finally figure out how to hold closures
This commit is contained in:
parent
69f31db23b
commit
f805290a4b
8 changed files with 98 additions and 89 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue