summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/habit-starts
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-23 13:11:16 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-23 13:11:16 -0800
commitfe51b5bb71f7eadf6072a51c31c0ffee91c815c8 (patch)
treec42a69573c2b0105c50d2f2524af1d3b2e1e56f6 /starts/meaning-vm/habit-starts
parent8db6ac879adf30e9e1aa61a8b441dea2ff09f9fb (diff)
downloadstandingwithresilience-fe51b5bb71f7eadf6072a51c31c0ffee91c815c8.tar.gz
standingwithresilience-fe51b5bb71f7eadf6072a51c31c0ffee91c815c8.zip
some bugfixes
Diffstat (limited to 'starts/meaning-vm/habit-starts')
-rw-r--r--starts/meaning-vm/habit-starts/learning-parts.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/starts/meaning-vm/habit-starts/learning-parts.cpp b/starts/meaning-vm/habit-starts/learning-parts.cpp
index 56c7ffa..85c92c9 100644
--- a/starts/meaning-vm/habit-starts/learning-parts.cpp
+++ b/starts/meaning-vm/habit-starts/learning-parts.cpp
@@ -64,12 +64,13 @@ static int __init = ([]()->int{
ahabit(unlink, ((source, s), (type, t), (target, dst, anything)),
{
if (dst == anything) {
- result = s.unlink(t);
+ s.unlink(t);
} else {
- result = s.unlink(t, dst);
+ s.unlink(t, dst);
}
});
+ decls(get, set);
ahabit(get, ((source, s), (type, t)),
{
result = s.get(t);
@@ -95,7 +96,7 @@ static int __init = ([]()->int{
if (c.linked(is, group)) {
throw an(already-in-group).link
(habit, self,
- context, ctx,
+ "context", ctx,
concept, c,
group, g);
}
@@ -124,8 +125,8 @@ static int __init = ([]()->int{
// need args and result for sequence
//ahabit(habit-sequence, ((
- decls(list, nothing, next, previous);
- decls(make, add, to, until, each, item, in, remove, from, somewhere);
+ decls(list, nothing, next, previous, first, last, entry);
+ decls(add, to, until, each, item, remove, from, somewhere);
// list functiona are habits because ordered-behavior
// would use a list
@@ -182,7 +183,7 @@ static int __init = ([]()->int{
result = get(e, item);
});
- ahabit(add-to-list, ((item, i), (list, l)),
+ ahabit(list-add, ((list, l), (item, i)),
{
ref prev = (list-last-item)(l);
ref li = (know-is-list-entry)(
@@ -203,11 +204,11 @@ static int __init = ([]()->int{
prev.set(next, li);
}
});
- ahabit(list-each-entry, ((list, l), (context, c), (action, a)),
+ ahabit(list-each-entry, ((list, l), (context, c), (action, act)),
{
ref cur = l.get(first-item);
while (cur != nothing && result == nothing) {
- result = a(cur, context);
+ result = act(cur, c);
cur = cur.get(next);
}
});