mirror of
https://github.com/kanaka/mal.git
synced 2024-10-05 18:08:55 +03:00
java: prevent defmacro from mutating functions
This commit is contained in:
parent
d4abb633b5
commit
e1b778481c
@ -156,6 +156,7 @@ public class step8_macros {
|
||||
a1 = ast.nth(1);
|
||||
a2 = ast.nth(2);
|
||||
res = EVAL(a2, env);
|
||||
res = res.copy();
|
||||
((MalFunction)res).setMacro();
|
||||
env.set((MalSymbol)a1, res);
|
||||
return res;
|
||||
|
@ -158,6 +158,7 @@ public class step9_try {
|
||||
a1 = ast.nth(1);
|
||||
a2 = ast.nth(2);
|
||||
res = EVAL(a2, env);
|
||||
res = res.copy();
|
||||
((MalFunction)res).setMacro();
|
||||
env.set((MalSymbol)a1, res);
|
||||
return res;
|
||||
|
@ -158,6 +158,7 @@ public class stepA_mal {
|
||||
a1 = ast.nth(1);
|
||||
a2 = ast.nth(2);
|
||||
res = EVAL(a2, env);
|
||||
res = res.copy();
|
||||
((MalFunction)res).setMacro();
|
||||
env.set((MalSymbol)a1, res);
|
||||
return res;
|
||||
|
Loading…
Reference in New Issue
Block a user