Skip to content

Commit

Permalink
chuck: prevent defmacro! from mutating its argument
Browse files Browse the repository at this point in the history
  • Loading branch information
asarhaddon authored and kanaka committed Oct 22, 2024
1 parent 1873468 commit ac666a1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions impls/chuck/step8_macros.ck
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ fun MalObject EVAL(MalObject m, Env env)
return value;
}

value.clone() @=> value;
true => (value$Func).isMacro;

env.set(a1, value);
Expand Down
1 change: 1 addition & 0 deletions impls/chuck/step9_try.ck
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ fun MalObject EVAL(MalObject m, Env env)
return value;
}

value.clone() @=> value;
true => (value$Func).isMacro;

env.set(a1, value);
Expand Down
1 change: 1 addition & 0 deletions impls/chuck/stepA_mal.ck
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ fun MalObject EVAL(MalObject m, Env env)
return value;
}

value.clone() @=> value;
true => (value$Func).isMacro;

env.set(a1, value);
Expand Down

0 comments on commit ac666a1

Please sign in to comment.