diff --git a/src/call_stack.rs b/src/call_stack.rs index 939bf6a1..a32ffec0 100644 --- a/src/call_stack.rs +++ b/src/call_stack.rs @@ -45,15 +45,13 @@ pub fn extend_call_stack( code: Calcit, args: &CalcitItems, ) -> CallStackList { - let mut s2 = stack.to_owned(); - s2 = s2.push_front(CalcitStack { + stack.push_front(CalcitStack { ns: ns.to_owned(), def: def.to_owned(), code, args: args.to_owned(), kind, - }); - s2 + }) } // show simplified version of stack diff --git a/src/codegen/emit_js/gen_stack.rs b/src/codegen/emit_js/gen_stack.rs index f2a73c9d..d48eda23 100644 --- a/src/codegen/emit_js/gen_stack.rs +++ b/src/codegen/emit_js/gen_stack.rs @@ -9,7 +9,7 @@ lazy_static! { pub fn push_call_stack(ns: &str, def: &str, kind: StackKind, code: Calcit, args: &CalcitItems) { let mut stack = CALL_STACK.write().unwrap(); - *stack = stack.push_front(CalcitStack { + stack.push_front_mut(CalcitStack { ns: ns.into(), def: def.into(), code, diff --git a/src/runner.rs b/src/runner.rs index 00f89e88..2ad9428d 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -301,14 +301,6 @@ pub fn bind_args( base_scope: &CalcitScope, call_stack: &CallStackList, ) -> Result { - // TODO arguments spreading syntax - // if values.len() != args.len() { - // return Err(CalcitErr::use_msg_stack(format!( - // "arguments length mismatch: {} ... {}", - // Calcit::List(values.to_owned()), - // Calcit::List(args.to_owned()), - // ), call_stack)); - // } let mut scope = base_scope.to_owned(); let mut spreading = false; let mut optional = false;