summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/habit-starts/rhythm.cpp
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-09 03:26:04 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-12-09 03:26:04 -0800
commit8ceeb5f83f22ed3db06fc02bb23710ccc1dbbb90 (patch)
tree8defe85cd6af09cbe258ace239eb490a0b98651c /starts/meaning-vm/habit-starts/rhythm.cpp
parent584ca7f9b6fca6da54608d3b28274273b2c9a4b8 (diff)
downloadstandingwithresilience-8ceeb5f83f22ed3db06fc02bb23710ccc1dbbb90.tar.gz
standingwithresilience-8ceeb5f83f22ed3db06fc02bb23710ccc1dbbb90.zip
use tls contexts for habits
Diffstat (limited to 'starts/meaning-vm/habit-starts/rhythm.cpp')
-rw-r--r--starts/meaning-vm/habit-starts/rhythm.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/starts/meaning-vm/habit-starts/rhythm.cpp b/starts/meaning-vm/habit-starts/rhythm.cpp
index 33e102a..7afb8ed 100644
--- a/starts/meaning-vm/habit-starts/rhythm.cpp
+++ b/starts/meaning-vm/habit-starts/rhythm.cpp
@@ -34,22 +34,22 @@ int main()
#undef self
ahabit(next-habit,
{
- ref n = ctx.get(active-habit).get(next);
+ ref n = ctx[active-habit].get(next);
ctx.set(active-habit, n);
- return n(ctx);
+ return n();
});
ahabit(start-habit,
{
- ref s = ctx.get(start);
+ ref s = ctx[start];
ctx.set(active-habit, s);
- return s(ctx);
+ return s();
});
ahabit(keep-doing-habit,
{
- (start-habit)(ctx);
+ (start-habit)();
while (true) {
- (next-habit)(ctx);
+ (next-habit)();
}
});
@@ -124,7 +124,6 @@ int main()
});
- a(context, habit-context);
- (habit-context).set(start, start-beat);
- (keep-doing-habit)(habit-context);
+ ref::context().set(start, start-beat);
+ (keep-doing-habit)();
}