summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/habit-starts
diff options
context:
space:
mode:
authoruser <user@localhost.localdomain>2019-12-19 14:50:57 -0800
committeruser <user@localhost.localdomain>2019-12-19 14:50:57 -0800
commit88921e8a2174fa9d39fcbaf620bf70fdb3fa48d8 (patch)
treebe416e8fa9663a4caf00e8b3d7afeaf7f87ba2a9 /starts/meaning-vm/habit-starts
parenta305f62fcd65ca9d686b56ed0a058156079af725 (diff)
downloadstandingwithresilience-88921e8a2174fa9d39fcbaf620bf70fdb3fa48d8.tar.gz
standingwithresilience-88921e8a2174fa9d39fcbaf620bf70fdb3fa48d8.zip
different list approach from othet device
Diffstat (limited to 'starts/meaning-vm/habit-starts')
-rw-r--r--starts/meaning-vm/habit-starts/learning-parts.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/starts/meaning-vm/habit-starts/learning-parts.cpp b/starts/meaning-vm/habit-starts/learning-parts.cpp
index ee55b04..365653b 100644
--- a/starts/meaning-vm/habit-starts/learning-parts.cpp
+++ b/starts/meaning-vm/habit-starts/learning-parts.cpp
@@ -1185,3 +1185,34 @@ static int __init = ([]()->int{
return 0;
})();
+diff --git a/starts/meaning-vm/habit-starts/learning-parts.cpp b/starts/meaning-vm/habit-starts/learning-parts.cpp
+index ee55b04..09c7b64 100644
+@@ -1127,10 +94,13 @@ static int __init = ([]()->int{
+
+ if (!happened.linked(whenever-list)) { return; }
+
+- (until-each-list-item-context-in-list)(action-whenever-happened, ctx, happened.get(whenever-list));
++ ref stub = a(event);
++ stub.set(event, ev);
++
++ (until-each-list-item-context-in-list)(action-whenever-happened, stub, happened.get(whenever-list));
+ });
+
+- ahabit(action-whenever-happened, ((list-item, li), (happened-context, hapctx)),
++ ahabit(action-whenever-happened, ((list-item, li), (event, h)),
+ {
+ // here: when we trigger a behavior, we want information associated with producing the trigger,
+ // as well as the event that triggered. that's two contexts.
+@@ -1142,8 +112,11 @@ static int __init = ([]()->int{
+ // take one context, which is the one prepared
+ // in the list, then we inject our context
+ // into that, inside a "happened" property.
++ ref actctx = i.get(action-context);
++
++ actctx.set(happened, h);
+
+- i.get(action)(hapctx, i.get(action-context));
++ i.get(action).fun<ref>()(i.get(actctx));
+ });
+
+ ahabit(whenever-habit, ((happens, ev), (action, act), (action-context, actctx)),