From fe86b3b137682db5c3764f016ee60a3bb5e65421 Mon Sep 17 00:00:00 2001 From: olpc user Date: Fri, 13 Dec 2019 11:42:15 -0800 Subject: bugfix for macro habits with more than one argument --- starts/meaning-vm/level-2/sugar.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'starts/meaning-vm/level-2/sugar.hpp') 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) \ [=](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)]; -- cgit v1.2.3