diff options
author | user <user@localhost.localdomain> | 2019-12-23 11:08:26 -0800 |
---|---|---|
committer | user <user@localhost.localdomain> | 2019-12-23 11:08:26 -0800 |
commit | 217d6142e92a21f592ffacadb6598fb41005d577 (patch) | |
tree | 72f22ba843256c7f46074bb65175f3cee6c0d4ff /starts/meaning-vm/habit-starts | |
parent | e720dfea4d7b07cbeb5312dbfd6940fd7fa29633 (diff) | |
download | standingwithresilience-217d6142e92a21f592ffacadb6598fb41005d577.tar.gz standingwithresilience-217d6142e92a21f592ffacadb6598fb41005d577.zip |
wip link iteration habits
Diffstat (limited to 'starts/meaning-vm/habit-starts')
-rw-r--r-- | starts/meaning-vm/habit-starts/learning-parts.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/starts/meaning-vm/habit-starts/learning-parts.cpp b/starts/meaning-vm/habit-starts/learning-parts.cpp index c53b260..b5cd56c 100644 --- a/starts/meaning-vm/habit-starts/learning-parts.cpp +++ b/starts/meaning-vm/habit-starts/learning-parts.cpp @@ -234,6 +234,25 @@ static int __init = ([]()->int{ i, l); }); + using links_it = level0::baseref::links_t::iterator; + ahabit(populate-link-entry, ((link-entry, le)), + { + result = le; + result.set("source", c); + result.set("type", result.vget<links_t>().first); + result.set("target", result.vget<links_t>().second); + }); + ahabit(first-link-entry, ((concept, c)), + { + result = level1::alloc(level, c.links().begin()); + (populate-link-entry)(result); + }); + ahabit(last-link-entry, ((concept, c)), + { + result = level1::alloc(level, --c.links().end()); + (populate-link-entry)(result); + }); + ahabit(happened-habit, ((happened, ev)), { if (!happened.linked(whenever-list)) { return; } |