diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-13 11:08:49 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-13 11:08:49 -0800 |
commit | 45c907426052ba2d5658b719371b6c49bdd11177 (patch) | |
tree | d8dce77c8fb27f6c96bcc02a4aedf89165120d76 | |
parent | 3d4f57e3ba54ec4d63c1c94f35fd642b90cf1f29 (diff) | |
download | standingwithresilience-45c907426052ba2d5658b719371b6c49bdd11177.tar.gz standingwithresilience-45c907426052ba2d5658b719371b6c49bdd11177.zip |
stub update
-rw-r--r-- | starts/meaning-vm/habit-starts/common.hpp | 2 | ||||
-rw-r--r-- | starts/meaning-vm/habit-starts/learning-parts.cpp | 13 | ||||
-rw-r--r-- | starts/meaning-vm/habit-starts/learning-parts.hpp | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/starts/meaning-vm/habit-starts/common.hpp b/starts/meaning-vm/habit-starts/common.hpp index 963bbea..950930a 100644 --- a/starts/meaning-vm/habit-starts/common.hpp +++ b/starts/meaning-vm/habit-starts/common.hpp @@ -5,6 +5,8 @@ namespace habitstarts { +using namespace intellect::level2; + decl(habit); } diff --git a/starts/meaning-vm/habit-starts/learning-parts.cpp b/starts/meaning-vm/habit-starts/learning-parts.cpp index 92afc7d..ed91f3e 100644 --- a/starts/meaning-vm/habit-starts/learning-parts.cpp +++ b/starts/meaning-vm/habit-starts/learning-parts.cpp @@ -1,19 +1,18 @@ #include "learning-parts.hpp" using namespace habitstarts; -using namespace intellect::level1; +using namespace intellect::level2; static int __init = ([]()->int{ - ahabit(happened-habit, + ahabit(happened-habit, ((happened, ev)), { - ref ev = ctx.get(happens); - // TODO: perform each event associated with ctx[happens] (see line above) + // TODO: perform each event associated with ctx[happened] // use a sub-habit for each call, so we can handle happened for them, too. }); - ahabit(whenever-habit, + ahabit(whenever-habit, ((happens, ev), (action, act), (action-context, actctx)), { // store ctx[action] on ctx[happens] as behavior to do // store ctx[action-context] as context for behavior @@ -24,12 +23,12 @@ static int __init = ([]()->int{ // a unique concept ref for each error type. plan to add to level-0. }); - ahabit(stop-when-habit, + ahabit(stop-when-habit, ((action, act), (happens, ev)), { // remove doing ctx[action] for ctx[happens] }); - ahabit(once-habit, + ahabit(once-habit, ((happens, ev), (action, act), (action-context, actctx)), { // takes ctx[action] and ctx[happens] and ctx[action-context] // uses above habits to do the action only once, probably by using diff --git a/starts/meaning-vm/habit-starts/learning-parts.hpp b/starts/meaning-vm/habit-starts/learning-parts.hpp index 59fe5ab..e3a3ccc 100644 --- a/starts/meaning-vm/habit-starts/learning-parts.hpp +++ b/starts/meaning-vm/habit-starts/learning-parts.hpp @@ -9,7 +9,7 @@ namespace habitstarts { // stop doing B whenever A happens. // when A happens, do B once. -decl(action, happens, context); +decl(action); decl(happens); decl(context); decl(happened); // happened-habit(ctx) performs actions associated with ctx[happens] decl(whenever); // whenever-habit(ctx) stores to do ctx[action] when ctx[happens] happens // providing ctx[action-context] |