implement chapter 13 in rust!
This commit is contained in:
parent
621c97102a
commit
32e5e8a41a
23 changed files with 318 additions and 19 deletions
|
@ -8,7 +8,7 @@ use ordered_float::OrderedFloat;
|
|||
use crate::{
|
||||
callable::{Callable, CallingError},
|
||||
interpreter::Interpreter,
|
||||
value::Value,
|
||||
value::{CallableType, Value},
|
||||
};
|
||||
|
||||
struct Clock;
|
||||
|
@ -37,5 +37,8 @@ impl Callable for Clock {
|
|||
}
|
||||
|
||||
pub fn all() -> Vec<(String, Value)> {
|
||||
vec![("clock".into(), Value::Callable(Rc::new(Clock {})))]
|
||||
vec![(
|
||||
"clock".into(),
|
||||
Value::Callable((Rc::new(Clock {}), CallableType::Function)),
|
||||
)]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue