mirror of
https://github.com/kanaka/mal.git
synced 2024-10-05 18:08:55 +03:00
vhdl: defmacro! doesn't modify existing functions
This commit is contained in:
parent
b9dd70c442
commit
fdd4e53f54
@ -291,11 +291,12 @@ architecture test of step8_macros is
|
||||
next; -- TCO
|
||||
|
||||
elsif a0.string_val.all = "defmacro!" then
|
||||
EVAL(ast.seq_val(2), env, val, sub_err);
|
||||
EVAL(ast.seq_val(2), env, fn, sub_err);
|
||||
if sub_err /= null then
|
||||
err := sub_err;
|
||||
return;
|
||||
end if;
|
||||
new_fn(fn.func_val.f_body, fn.func_val.f_args, fn.func_val.f_env, val);
|
||||
val.func_val.f_is_macro := true;
|
||||
env_set(env, ast.seq_val(1), val);
|
||||
result := val;
|
||||
|
@ -331,11 +331,12 @@ architecture test of step9_try is
|
||||
next; -- TCO
|
||||
|
||||
elsif a0.string_val.all = "defmacro!" then
|
||||
EVAL(ast.seq_val(2), env, val, sub_err);
|
||||
EVAL(ast.seq_val(2), env, fn, sub_err);
|
||||
if sub_err /= null then
|
||||
err := sub_err;
|
||||
return;
|
||||
end if;
|
||||
new_fn(fn.func_val.f_body, fn.func_val.f_args, fn.func_val.f_env, val);
|
||||
val.func_val.f_is_macro := true;
|
||||
env_set(env, ast.seq_val(1), val);
|
||||
result := val;
|
||||
|
@ -331,11 +331,12 @@ architecture test of stepA_mal is
|
||||
next; -- TCO
|
||||
|
||||
elsif a0.string_val.all = "defmacro!" then
|
||||
EVAL(ast.seq_val(2), env, val, sub_err);
|
||||
EVAL(ast.seq_val(2), env, fn, sub_err);
|
||||
if sub_err /= null then
|
||||
err := sub_err;
|
||||
return;
|
||||
end if;
|
||||
new_fn(fn.func_val.f_body, fn.func_val.f_args, fn.func_val.f_env, val);
|
||||
val.func_val.f_is_macro := true;
|
||||
env_set(env, ast.seq_val(1), val);
|
||||
result := val;
|
||||
|
Loading…
Reference in New Issue
Block a user