aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/common/lib/forth2012/facility/structures-test.frt
blob: c4e810c2bde0ad2ad65437649b910c79a4502eb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 !