aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/common/lib/forth2012/facility/structures-test.frt
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/common/lib/forth2012/facility/structures-test.frt')
-rw-r--r--amforth-6.5/common/lib/forth2012/facility/structures-test.frt16
1 files changed, 16 insertions, 0 deletions
diff --git a/amforth-6.5/common/lib/forth2012/facility/structures-test.frt b/amforth-6.5/common/lib/forth2012/facility/structures-test.frt
new file mode 100644
index 0000000..c4e810c
--- /dev/null
+++ b/amforth-6.5/common/lib/forth2012/facility/structures-test.frt
@@ -0,0 +1,16 @@
+\ simple test example for forth200x structures
+\ define a new data structure named list.
+
+begin-structure list
+ field: l.p \ previous
+ field: l.n \ next
+ field: l.d \ data
+end-structure
+
+\ create an instance of the datastructure list
+\ named listroot
+
+list buffer: listroot
+
+\ access an element from the instance
+$55aa listroot l.d !