| : new-locals-reveal ( -- ) |
: new-locals-reveal ( -- ) |
| true abort" this should not happen: 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 |
vocabulary new-locals |
| new-locals-map ' new-locals >body cell+ A! \ !! use special access words |
new-locals-map ' new-locals >body cell+ A! \ !! use special access words |
| code-address! |
code-address! |
| then ; |
then ; |
| |
|
| : TO ( c|w|d|r "name" -- ) \ core-ext,local |
:noname |
| \ !! state smart |
' 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 } |
0 0 0. 0.0e0 { c: clocal w: wlocal d: dlocal f: flocal } |
| ' dup >definer |
' dup >definer |
| state @ |
|
| if |
|
| case |
case |
| [ ' locals-wordlist >definer ] literal \ value |
[ ' locals-wordlist >definer ] literal \ value |
| OF >body POSTPONE Aliteral POSTPONE ! ENDOF |
OF >body POSTPONE Aliteral POSTPONE ! ENDOF |
| [ ' flocal >definer ] literal |
[ ' flocal >definer ] literal |
| OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF |
OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF |
| -&32 throw |
-&32 throw |
| endcase |
endcase ; |
| else |
special: TO ( c|w|d|r "name" -- ) \ core-ext,local |
| [ ' locals-wordlist >definer ] literal = |
|
| if |
|
| >body ! |
|
| else |
|
| -&32 throw |
|
| endif |
|
| endif ; immediate |
|
| |
|
| : locals| |
: locals| |
| \ don't use 'locals|'! use '{'! A portable and free '{' |
\ don't use 'locals|'! use '{'! A portable and free '{' |
| \ implementation is anslocals.fs |
\ implementation is compat/anslocals.fs |
| BEGIN |
BEGIN |
| name 2dup s" |" compare 0<> |
name 2dup s" |" compare 0<> |
| WHILE |
WHILE |