--- gforth/glocals.fs 1996/05/09 18:12:59 1.21 +++ gforth/glocals.fs 1996/08/26 10:07:18 1.25 @@ -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 @@ -504,29 +505,30 @@ forth definitions code-address! then ; -: TO ( c|w|d|r "name" -- ) \ core-ext,local +:noname + ' dup >definer [ ' locals-wordlist >definer ] literal = + if + >body ! + else + -&32 throw + endif ; +:noname 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 + [ comp' clocal drop >definer ] literal OF POSTPONE laddr# >body @ lp-offset, POSTPONE c! ENDOF - [ ' wlocal >definer ] literal + [ comp' wlocal drop >definer ] literal OF POSTPONE laddr# >body @ lp-offset, POSTPONE ! ENDOF - [ ' dlocal >definer ] literal + [ comp' dlocal drop >definer ] literal OF POSTPONE laddr# >body @ lp-offset, POSTPONE 2! ENDOF - [ ' flocal >definer ] literal + [ comp' flocal drop >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 ; + endcase ; +interpret/compile: TO ( c|w|d|r "name" -- ) \ core-ext,local : locals| \ don't use 'locals|'! use '{'! A portable and free '{'