implement chapter 11 in rust
This commit is contained in:
parent
8860a1c639
commit
a25b6d1e92
16 changed files with 470 additions and 32 deletions
|
@ -3,6 +3,8 @@ use std::{
|
|||
time::{SystemTime, UNIX_EPOCH},
|
||||
};
|
||||
|
||||
use ordered_float::OrderedFloat;
|
||||
|
||||
use crate::{
|
||||
callable::{Callable, CallingError},
|
||||
interpreter::Interpreter,
|
||||
|
@ -30,7 +32,7 @@ impl Callable for Clock {
|
|||
.duration_since(UNIX_EPOCH)
|
||||
.map_err(|e| CallingError::CallFailed(e.to_string()))?;
|
||||
|
||||
Ok(Value::Number(since_the_epoch.as_secs_f64()))
|
||||
Ok(Value::Number(OrderedFloat(since_the_epoch.as_secs_f64())))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue