contemplate parameter eval cont

This commit is contained in:
2023-05-16 23:48:26 -04:00
parent 093f3c0453
commit d44480bf6c

View File

@@ -113,7 +113,7 @@ pub enum Cont {
ID, ID,
Eval { e: Rc<Form>, nc: Box<Cont> }, Eval { e: Rc<Form>, nc: Box<Cont> },
Call { p: Rc<Form>, e: Rc<Form>, nc: Box<Cont> }, Call { p: Rc<Form>, e: Rc<Form>, nc: Box<Cont> },
//MidPrim { f: fn(Rc<Form>, Rc<Form>, Cont) -> Cursor, cd: Rc<Form>, nc: Box<Cont> }, PramEval { to_eval: u32, collected: Vec<Rc<Form>>, f: fn(Rc<Form>, Rc<Form>, Cont) -> Cursor, nc: Box<Cont> },
} }
pub fn eval(e: Rc<Form>, f: Rc<Form>) -> Rc<Form> { pub fn eval(e: Rc<Form>, f: Rc<Form>) -> Rc<Form> {
@@ -162,7 +162,13 @@ pub fn eval(e: Rc<Form>, f: Rc<Form>) -> Rc<Form> {
}, },
_ => panic!("Tried to call not a Prim/DeriComb {:?}", f), _ => panic!("Tried to call not a Prim/DeriComb {:?}", f),
} }
} },
Cont::PramEval { to_eval, collected, f, nc } => {
// tricky bit - if to_eval > 0 && collected.size == 0, then we haven't started yet
// and we should push an eval on the thingy
// otherwise, we're collecting, and need to push a new one
panic!("Wait this doesn't quite work we need to pass around the remaining params to eval too");
},
} }
} }
} }