2 \ ** ficl/softwords/ficlclass.fr
3 \ Classes to model ficl data structures in objects
5 \ John Sadler 14 Sep 1998
11 object subclass c-word
13 c-2byte obj: .hashcode
21 : get-name ( inst class -- c-addr u )
23 my=[ .pName get-ptr ] -rot
27 : next ( inst class -- link-inst class )
32 2dup --> get-name type cr
37 \ ** C - W O R D L I S T
40 \ get-current c-wordlist --> ref current
42 \ current --> .hash --> ?
43 \ current --> .hash --> next --> ?
45 object subclass c-wordlist
46 c-wordlist ref: .parent
49 c-word ref: .hash ( first entry in hash table )
52 --> get-name ." ficl wordlist " type cr ;
54 : pop 2drop previous ;
55 : set-current drop set-current ;
56 : get-name drop wid-get-name ;
58 this my=[ .size get ] 0 do
59 i this my=[ .hash index ] ( 2list-head )
61 2dup --> get-name type space
68 \ : named-wid wordlist postpone c-wordlist metaclass => ref ;
71 \ ** C - F I C L S T A C K
72 object subclass c-ficlstack
76 c-4byte obj: .stackBase
82 --> .sp --> .addr --> prev --> get ;