summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level0.cpp
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-24 16:15:08 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-24 16:15:08 -0800
commitdbbed1e4e1d4b3f268c71236c89f1d673fa0c165 (patch)
treefd12a1f4bcb2fe9cc1695787f5e3d992117b9edc /starts/meaning-vm/level0.cpp
parentf80b3ce2b52f568bb04005c24ad11c3a05cf7a15 (diff)
downloadstandingwithresilience-dbbed1e4e1d4b3f268c71236c89f1d673fa0c165.tar.gz
standingwithresilience-dbbed1e4e1d4b3f268c71236c89f1d673fa0c165.zip
add a linking mixin for use by ref classes
Diffstat (limited to 'starts/meaning-vm/level0.cpp')
-rw-r--r--starts/meaning-vm/level0.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/starts/meaning-vm/level0.cpp b/starts/meaning-vm/level0.cpp
index 8cb60f9..a69da91 100644
--- a/starts/meaning-vm/level0.cpp
+++ b/starts/meaning-vm/level0.cpp
@@ -21,22 +21,22 @@ int main()
ref skip = alloc();
- a->link(b, c);
- a->link(d, e);
- e->link(b, a);
- c->link(b, e);
- a->link(numlink, num);
- a->link(codelink, code);
+ a.set(b, c);
+ a.link(d, e);
+ e.link(b, a);
+ c.link(b, e);
+ a.link(numlink, num);
+ a.link(codelink, code);
std::cout << "Num: " << ref(num).dump(skip, skip);
std::cout << "Code: " << ref(code).dump(skip, skip);
std::cout << a.dump(skip, skip);
- std::cout << "Num: " << a->vget<int>(numlink).val() << std::endl;
- std::cout << "Code: "; a->vget<std::function<void()>>(codelink).val()();
+ std::cout << "Num: " << a.vget<int>(numlink).val() << std::endl;
+ std::cout << "Code: "; a.vget<std::function<void()>>(codelink).val()();
std::cout << allocated() << " allocated" << std::endl;
- e->unlink(b, a);
+ e.unlink(b, a);
dealloc(a);
dealloc(c);
dealloc(e);