--- gforth/glocals.fs 1994/08/31 19:42:47 1.6 +++ gforth/glocals.fs 1995/04/20 09:42:54 1.11 @@ -61,22 +61,22 @@ \ Currently locals may only be \ defined at the outer level and TO is not supported. -include float.fs include search-order.fs +include float.fs -: compile-@local ( n -- ) +: compile-@local ( n -- ) \ new compile-fetch-local case - 0 of postpone @local0 endof - 4 of postpone @local4 endof - 8 of postpone @local8 endof - 12 of postpone @local12 endof + 0 of postpone @local0 endof + 1 cells of postpone @local1 endof + 2 cells of postpone @local2 endof + 3 cells of postpone @local3 endof ( otherwise ) dup postpone @local# , endcase ; -: compile-f@local ( n -- ) +: compile-f@local ( n -- ) \ new compile-f-fetch-local case - 0 of postpone f@local0 endof - 8 of postpone f@local8 endof + 0 of postpone f@local0 endof + 1 floats of postpone f@local1 endof ( otherwise ) dup postpone f@local# , endcase ; @@ -134,7 +134,8 @@ variable locals-dp \ so here's the speci postpone lp@ postpone c! ; : create-local ( " name" -- a-addr ) - \ defines the local "name"; the offset of the local shall be stored in a-addr + \ defines the local "name"; the offset of the local shall be + \ stored in a-addr create immediate here 0 , ( place for the offset ) ; @@ -263,7 +264,7 @@ locals-types definitions : -- ( addr wid 0 ... -- ) } - [char] } word drop ; + [char] } parse 2drop ; forth definitions @@ -497,17 +498,21 @@ forth definitions OF POSTPONE laddr# >body @ lp-offset, POSTPONE d! ENDOF [ ' flocal >definer ] literal OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF - abort" can only store TO value or local value" + -&32 throw endcase else [ ' locals-wordlist >definer ] literal = if >body ! else - abort" can only store TO value" + -&32 throw endif endif ; immediate : locals| - BEGIN sname 2dup s" |" compare 0= WHILE - (local) REPEAT drop 0 (local) ; immediate restrict + BEGIN + name 2dup s" |" compare 0<> + WHILE + (local) + REPEAT + drop 0 (local) ; immediate restrict