aboutsummaryrefslogtreecommitdiff
path: root/buzzard/demo6.th
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-06-10 23:18:31 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-06-10 23:18:31 +0200
commitda312e375eb0a0758a4dd72e287d3aba86c04d99 (patch)
treeaa7d3631273b516e7f10ef40a53a5edd21a81b7e /buzzard/demo6.th
parente4d7ac43458f9f96a15041d35feddecca20ddbba (diff)
Add FIRST & THIRD almost FORTH
Diffstat (limited to 'buzzard/demo6.th')
-rw-r--r--buzzard/demo6.th18
1 files changed, 18 insertions, 0 deletions
diff --git a/buzzard/demo6.th b/buzzard/demo6.th
new file mode 100644
index 0000000..75ec667
--- /dev/null
+++ b/buzzard/demo6.th
@@ -0,0 +1,18 @@
+: foobar
+ 2
+ [ 2 , ( '[' turns the compiler off, allowing us to execute code )
+ 1 1 1 + + , ( and we compile in-line a 2 and a three )
+ ( the '2' means 'push the number following this' )
+ ]
+ + . cr
+;
+
+foobar
+
+: 'foobar ' foobar ; ( ' can only be run inside the compiler )
+ ( ' leaves the address of the following word
+ on the stack )
+
+'foobar . cr
+
+'foobar dump