From d44480bf6cbc5365d4f6769f2c12295b58475183 Mon Sep 17 00:00:00 2001 From: Nathan Braswell Date: Tue, 16 May 2023 23:48:26 -0400 Subject: [PATCH] contemplate parameter eval cont --- kv/src/ast.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kv/src/ast.rs b/kv/src/ast.rs index 32d1d53..9101079 100644 --- a/kv/src/ast.rs +++ b/kv/src/ast.rs @@ -111,9 +111,9 @@ impl fmt::Display for Form { pub struct Cursor { f: Rc
, c: Cont } pub enum Cont { ID, - Eval { e: Rc, nc: Box }, - Call { p: Rc, e: Rc, nc: Box }, - //MidPrim { f: fn(Rc, Rc, Cont) -> Cursor, cd: Rc, nc: Box }, + Eval { e: Rc, nc: Box }, + Call { p: Rc, e: Rc, nc: Box }, + PramEval { to_eval: u32, collected: Vec>, f: fn(Rc, Rc, Cont) -> Cursor, nc: Box }, } pub fn eval(e: Rc, f: Rc) -> Rc { @@ -162,7 +162,13 @@ pub fn eval(e: Rc, f: Rc) -> Rc { }, _ => 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"); + }, } } }