1 S" FICL_WANT_OOP" ENVIRONMENT? drop [if]
2 \ ** ficl/softwords/ficlclass.fr
3 \ Classes to model ficl data structures in objects
5 \ John Sadler 14 Sep 1998
10 object subclass c-word
12 c-2byte obj: .hashcode
20 : get-name ( inst class -- c-addr u )
22 my=[ .pName get-ptr ] -rot
26 : next ( inst class -- link-inst class )
31 2dup --> get-name type cr
36 \ ** C - W O R D L I S T
39 \ get-current c-wordlist --> ref current
41 \ current --> .hash --> ?
42 \ current --> .hash --> next --> ?
44 object subclass c-wordlist
45 c-wordlist ref: .parent
48 c-word ref: .hash ( first entry in hash table )
51 --> get-name ." ficl wordlist " type cr ;
53 : pop 2drop previous ;
54 : set-current drop set-current ;
55 : get-name drop wid-get-name ;
57 this my=[ .size get ] 0 do
58 i this my=[ .hash index ] ( 2list-head )
60 2dup --> get-name type space
67 \ : named-wid wordlist postpone c-wordlist metaclass => ref ;
70 \ ** C - F I C L S T A C K
71 object subclass c-ficlstack
75 c-4byte obj: .stackBase
81 --> .sp --> .addr --> prev --> get ;