summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'starts/meaning-vm/level1.cpp')
-rw-r--r--starts/meaning-vm/level1.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/starts/meaning-vm/level1.cpp b/starts/meaning-vm/level1.cpp
index ae70b5a..2e005e2 100644
--- a/starts/meaning-vm/level1.cpp
+++ b/starts/meaning-vm/level1.cpp
@@ -14,6 +14,7 @@ int main()
decls(source, type, target);
decls(structure, function, argument, position);
decls(variable, provide);
+ decls(act);
(make-linked).link(
is, habit,
@@ -35,8 +36,30 @@ int main()
assumes, not-A-B-C-linked,
makes, A-B-C-linked
);
+ (make-linked).fset(
+ act,
+ (std::function<void(ref)>)[](ref args)
+ {
+ ref source = args.get("A");
+ ref type = args.get("B");
+ ref target = args.get("C");
+ std::cout << "Linking " << source.name() << " by " << type.name() << " to " << target.name() << std::endl;
+ source.link(type, target);
+ }
+ );
std::cout << (make-linked).dump("dumped", true) << std::endl;
+ decls(apple, fruit);
+ (make-linked).get(act)
+ (a(function-argument)
+ .link(
+ A, apple,
+ B, is,
+ C, fruit
+ ));
+
+ std::cout << apple.dump("dumped", true) << std::endl;
+
return 0;
}