in progress conversion of export to eval_lazy
This commit is contained in:
parent
827458b06f
commit
5d345a4c73
1 changed files with 3 additions and 2 deletions
|
|
@ -42,14 +42,14 @@ pub fn get_export(env_cfg: bool) -> Function {
|
||||||
return Function{
|
return Function{
|
||||||
name: String::from("export"),
|
name: String::from("export"),
|
||||||
loose_syms: true,
|
loose_syms: true,
|
||||||
eval_lazy: false,
|
eval_lazy: true,
|
||||||
args: Args::Lazy(2),
|
args: Args::Lazy(2),
|
||||||
function: Operation::Internal(
|
function: Operation::Internal(
|
||||||
|a: Ast, b: Rc<RefCell<VTable>>, _c: Rc<RefCell<FTable>>| -> Ctr {
|
|a: Ast, b: Rc<RefCell<VTable>>, _c: Rc<RefCell<FTable>>| -> Ctr {
|
||||||
let inner = a.borrow_mut();
|
let inner = a.borrow_mut();
|
||||||
match &inner.car {
|
match &inner.car {
|
||||||
Ctr::Symbol(identifier) => {
|
Ctr::Symbol(identifier) => {
|
||||||
match inner.cdr.clone() {
|
match eval(inner.cdr) {
|
||||||
Ctr::Seg(val) => {
|
Ctr::Seg(val) => {
|
||||||
let val_tmp = val.borrow().clone();
|
let val_tmp = val.borrow().clone();
|
||||||
define(b, identifier.to_string(), Rc::new(val_tmp.car));
|
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;
|
return Ctr::None;
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
|
println!("{:#?}", a);
|
||||||
eprintln!("first argument to export must be a symbol");
|
eprintln!("first argument to export must be a symbol");
|
||||||
return Ctr::None;
|
return Ctr::None;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue