unit mem/dict create _ _ 'e _ - const _CREATEOFF : forget 'e @ SYSDICT ! ; : delete 0 'e e>wlen c! ; : deleteall ( "name" -- ) word begin dup sysdict findentry ?dup while 0 swap e>wlen c! repeat drop ; : extractdict 0 'e @! SYSDICT @! const ; create _ ,"???" :~ ( n e nmax -- a u ) rot 2dup < if 2drop drop _ 3 else - 0 do @ loop entryname[] then ; : enumrev sysdict current execute ['] ~ bind> bind ; \ Address-to-Entry mechanism : memok? ( a -- f ) bi KERNELSTART KERNELEND within? | HERESTART here within? or ; : namerange? ( c -- f ) $21 - $5d <= ; : entry? ( a -- f ) dup memok? if ( e ) dup entryname[] ?dup if ( e a u ) 0 do c@+ namerange? not if 2drop 0 unloop exit then loop 2drop 1 else 2drop 0 then else drop 0 then ; : ?var>e ( a -- e-or-0 ) _CREATEOFF - dup entry? not if drop 0 then ; : ?xt>e ( a -- e-or-0 ) 4 - dup entry? not if drop 0 then ; :~ dup not ?abort"no associated entry" ; : xt>e# ?xt>e ~ ; : var>e# ?var>e ~ ; : .word ( w -- ) xt>e# entryname[] rtype ; : words ( -- ) SYSDICT @ begin dup while dup e>xt .word spc> @ repeat drop ; \ Unit : inunit? ( e unit -- f ) dup unittop @ >A begin ( e unit A=ll ) over A> <> while dup unitbottom @ A> <> while @A@ >A repeat 0 else 1 then nip nip ; : unitofentry ( e -- unit-or-0 ) currentunit @ begin ( e ll ) ?dup while 2dup inunit? not while @ repeat ( e unit ) else ( e ) 0 then nip ;