implement chapter 13 in rust!

This commit is contained in:
Sebastian Hugentobler 2025-05-26 10:19:18 +02:00
parent 621c97102a
commit 32e5e8a41a
Signed by: shu
SSH key fingerprint: SHA256:ppcx6MlixdNZd5EUM1nkHOKoyQYoJwzuQKXM6J/t66M
23 changed files with 318 additions and 19 deletions

View file

@ -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)),
)]
}