summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-2
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-13 11:42:15 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-13 11:42:15 -0800
commitfe86b3b137682db5c3764f016ee60a3bb5e65421 (patch)
treedcc430ccef4a39e7bf14b0aba3afd28e075242ff /starts/meaning-vm/level-2
parenta42d60d0bf035317f2cdf725fbcc2f076368f2e6 (diff)
downloadstandingwithresilience-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.hpp6
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)];