diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-13 11:42:15 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-13 11:42:15 -0800 |
commit | fe86b3b137682db5c3764f016ee60a3bb5e65421 (patch) | |
tree | dcc430ccef4a39e7bf14b0aba3afd28e075242ff /starts/meaning-vm/level-2 | |
parent | a42d60d0bf035317f2cdf725fbcc2f076368f2e6 (diff) | |
download | standingwithresilience-fe86b3b137682db5c3764f016ee60a3bb5e65421.tar.gz standingwithresilience-fe86b3b137682db5c3764f016ee60a3bb5e65421.zip |
bugfix for macro habits with more than one argument
Diffstat (limited to 'starts/meaning-vm/level-2')
-rw-r--r-- | starts/meaning-vm/level-2/sugar.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/starts/meaning-vm/level-2/sugar.hpp b/starts/meaning-vm/level-2/sugar.hpp index e0dfcd9..bff945b 100644 --- a/starts/meaning-vm/level-2/sugar.hpp +++ b/starts/meaning-vm/level-2/sugar.hpp @@ -23,7 +23,7 @@ #define ahabit(name, argnametoklist, ...) \ intellect::level2::makehabit( \ name, \ - {_macro_call(_macro_for_each_parens, _macro_habit_argnameref _macro_comma_remove_parens(argnametoklist))}, \ + {_macro_call(_macro_for_each_parens, _macro_habit_argnameref, _macro_habit_commaargnameref _macro_comma_remove_parens(argnametoklist))}, \ (std::function<void(ref)>) \ [=](ref ctx) \ { \ @@ -32,11 +32,13 @@ usleep(delay); \ } \ ref self = name; (void)self; \ - _macro_call(_macro_for_each_parens, _macro_habit_set_posarg _macro_comma_remove_parens(argnametoklist)); \ + _macro_call(_macro_for_each_parens, _macro_habit_set_posarg, _macro_habit_set_posarg _macro_comma_remove_parens(argnametoklist)); \ __VA_ARGS__ \ }); #define _macro_habit_argnameref(name, tok) \ ref(#name) + #define _macro_habit_commaargnameref(name, tok) \ + , ref(#name) #define _macro_habit_set_posarg(name, tok) \ ref tok = ctx[ref(#name)]; |