Implement REPL resolves #5

This commit is contained in:
2021-05-30 10:19:35 -04:00
parent 390c5d1b48
commit aaa93d8593
4 changed files with 60 additions and 24 deletions

View File

@@ -66,8 +66,12 @@ pub fn eq(args: Vec<Datum>) -> Datum {
for i in 2..args.len() {
let current = &args[i];
match (first, current) {
(Boolean(b1), Boolean(b2)) => {return Boolean(b1 == b2);},
(Number(n1), Number(n2)) => {return Boolean(n1 == n2);},
(Boolean(b1), Boolean(b2)) => {
return Boolean(b1 == b2);
}
(Number(n1), Number(n2)) => {
return Boolean(n1 == n2);
}
_ => {
println!("{:?} is not equal to {:?}", first, current);
return Boolean(false);
@@ -76,4 +80,4 @@ pub fn eq(args: Vec<Datum>) -> Datum {
}
Boolean(true)
}
}
}