--- gforth/glocals.fs 1995/12/23 16:21:58 1.17 +++ gforth/glocals.fs 1996/05/13 16:36:58 1.22 @@ -254,7 +254,8 @@ previous : new-locals-reveal ( -- ) true abort" this should not happen: new-locals-reveal" ; -create new-locals-map ' new-locals-find A, ' new-locals-reveal A, +create new-locals-map ( -- wordlist-map ) +' new-locals-find A, ' new-locals-reveal A, vocabulary new-locals new-locals-map ' new-locals >body cell+ A! \ !! use special access words @@ -488,7 +489,7 @@ forth definitions \ this gives a unique identifier for the way the xt was defined \ words defined with different does>-codes have different definers \ the definer can be used for comparison and in definer! - dup >code-address [ ' bits >code-address ] Literal = + dup >code-address [ ' spaces >code-address ] Literal = \ !! this definition will not work on some implementations for `bits' if \ if >code-address delivers the same value for all does>-def'd words >does-code 1 or \ bit 0 marks special treatment for does codes @@ -505,36 +506,32 @@ forth definitions then ; : TO ( c|w|d|r "name" -- ) \ core-ext,local -\ !! state smart - 0 0 0. 0.0e0 { c: clocal w: wlocal d: dlocal f: flocal } - ' dup >definer - state @ - if - case - [ ' locals-wordlist >definer ] literal \ value - OF >body POSTPONE Aliteral POSTPONE ! ENDOF - [ ' clocal >definer ] literal - OF POSTPONE laddr# >body @ lp-offset, POSTPONE c! ENDOF - [ ' wlocal >definer ] literal - OF POSTPONE laddr# >body @ lp-offset, POSTPONE ! ENDOF - [ ' dlocal >definer ] literal - OF POSTPONE laddr# >body @ lp-offset, POSTPONE d! ENDOF - [ ' flocal >definer ] literal - OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF - -&32 throw - endcase - else - [ ' locals-wordlist >definer ] literal = - if - >body ! - else - -&32 throw - endif - endif ; immediate + 0 0 0. 0.0e0 { c: clocal w: wlocal d: dlocal f: flocal } + ' dup >definer + case + [ ' locals-wordlist >definer ] literal \ value + OF >body POSTPONE Aliteral POSTPONE ! ENDOF + [ ' clocal >definer ] literal + OF POSTPONE laddr# >body @ lp-offset, POSTPONE c! ENDOF + [ ' wlocal >definer ] literal + OF POSTPONE laddr# >body @ lp-offset, POSTPONE ! ENDOF + [ ' dlocal >definer ] literal + OF POSTPONE laddr# >body @ lp-offset, POSTPONE 2! ENDOF + [ ' flocal >definer ] literal + OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF + -&32 throw + endcase ; immediate +interpretation: + ' dup >definer [ ' locals-wordlist >definer ] literal = + if + >body ! + else + -&32 throw + endif ; : locals| \ don't use 'locals|'! use '{'! A portable and free '{' - \ implementation is anslocals.fs + \ implementation is compat/anslocals.fs BEGIN name 2dup s" |" compare 0<> WHILE