finally figure out how to hold closures

This commit is contained in:
Aidan Hahn 2022-01-16 22:01:42 -08:00
parent 69f31db23b
commit f805290a4b
No known key found for this signature in database
GPG key ID: 327711E983899316
8 changed files with 98 additions and 89 deletions

View file

@ -12,7 +12,7 @@ mod func_tests {
loose_syms: false,
eval_lazy: false,
args: Args::Strict(vec![Type::Bool]),
function: Operation::Internal(
function: Operation::Internal(Box::new(
|a: Ast, _b: Rc<RefCell<VTable>>, _c: Rc<RefCell<FTable>>| -> Ctr {
let inner = a.borrow();
let mut is_bool = false;
@ -22,7 +22,7 @@ mod func_tests {
Ctr::Bool(is_bool)
}
)
))
};
let ft = Rc::new(RefCell::new(FTable::new()));
let vt = Rc::new(RefCell::new(VTable::new()));
@ -174,7 +174,7 @@ mod func_tests {
loose_syms: false,
eval_lazy: false,
args: Args::Strict(vec![Type::Bool]),
function: Operation::Internal(
function: Operation::Internal(Box::new(
|a: Ast, _b: Rc<RefCell<VTable>>, _c: Rc<RefCell<FTable>>| -> Ctr {
let inner = a.borrow();
if let Ctr::Bool(b) = &inner.car {
@ -187,7 +187,7 @@ mod func_tests {
Ctr::None
}
}
)
))
};
match lex("((test_inner true))".to_string()) {