summaryrefslogtreecommitdiff
path: root/starts
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-25 09:57:26 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-25 09:57:26 -0800
commit2bf700189c287c678539ba9bbf05167476dde312 (patch)
tree4b84e33782b5e4d5eb9350e632ab1e3d7b6325b2 /starts
parentf4bf61c2a465f2dbd06479982c07d93cc7d81818 (diff)
downloadstandingwithresilience-2bf700189c287c678539ba9bbf05167476dde312.tar.gz
standingwithresilience-2bf700189c287c678539ba9bbf05167476dde312.zip
-
Diffstat (limited to 'starts')
-rw-r--r--starts/meaning-vm/level-2/habits.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/starts/meaning-vm/level-2/habits.cpp b/starts/meaning-vm/level-2/habits.cpp
index 5cb071e..16133ca 100644
--- a/starts/meaning-vm/level-2/habits.cpp
+++ b/starts/meaning-vm/level-2/habits.cpp
@@ -306,11 +306,30 @@ int createhabits()
(action-list-item)(list-entry-item(le), subctx);
}));
});
+
+ // maybe condition and list could be merged better by factoring out the concept
+ // of translating?
+ // we're going to want to provide lists of subactions to condition
+ // the irritation around not having the condition be a function is the
+ // creation of anonymous variable names to hold the values. is likely fine.
+ // note: the name "outer-context" is being treated specially. we'll just use that.
+ // this name could make a quoting requirement. could be worked around.
+ //
+ // if we remove outer-context, we'll probably need to recognize condition-
+ // action in action-list-item, and pass the outer-context to it.
+ // either way, we can implement condition-action with outer-context as
+ // a passed value.
// TODO: a habit that evaluates habits depending on a condition
- ahabit(condition-action, ((context, ctx), (condition, cond), (actions, a)),
+ ahabit(make-condition, ((
+ ahabit(condition-action, ((condition, cond), (actions, a)),
{
- condition.fun<ref>(ctx);
+ // I'll leave outer-context special, and imply quoting.
+ // no mapping.
+ // so, we might want action-list-entries to be actionable
+ // but easiest to just handle action lists here
+
+ //condition.fun<ref>(ctx);
// how to pass context to condition within action-list?
//
// this function will have one context.