in progress conversion of export to eval_lazy

This commit is contained in:
Aidan Hahn 2021-11-14 21:41:39 -08:00
parent 827458b06f
commit 5d345a4c73
No known key found for this signature in database
GPG key ID: 327711E983899316

View file

@ -42,14 +42,14 @@ pub fn get_export(env_cfg: bool) -> Function {
return Function{
name: String::from("export"),
loose_syms: true,
eval_lazy: false,
eval_lazy: true,
args: Args::Lazy(2),
function: Operation::Internal(
|a: Ast, b: Rc<RefCell<VTable>>, _c: Rc<RefCell<FTable>>| -> Ctr {
let inner = a.borrow_mut();
match &inner.car {
Ctr::Symbol(identifier) => {
match inner.cdr.clone() {
match eval(inner.cdr) {
Ctr::Seg(val) => {
let val_tmp = val.borrow().clone();
define(b, identifier.to_string(), Rc::new(val_tmp.car));
@ -62,6 +62,7 @@ pub fn get_export(env_cfg: bool) -> Function {
return Ctr::None;
},
_ => {
println!("{:#?}", a);
eprintln!("first argument to export must be a symbol");
return Ctr::None;
}