Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #26779

Re: Forth200x enhanced locals implementation

From "Alex McDonald" <blog@rivadpm.com>
Newsgroups comp.lang.forth
Subject Re: Forth200x enhanced locals implementation
Date 2013-11-01 10:36 +0000
Organization A noiseless patient Spider
Message-ID <l5007g$ucl$1@dont-email.me> (permalink)
References <2013Oct30.180302@mips.complang.tuwien.ac.at> <l4s0sb$mti$1@dont-email.me> <2013Oct31.130647@mips.complang.tuwien.ac.at> <l4u5to$la9$1@dont-email.me> <2013Nov1.094656@mips.complang.tuwien.ac.at>

Show all headers | View raw


on 01/11/2013 08:46:53,  wrote:
> "Alex McDonald" <blog@rivadpm.com> writes:
>>on 31/10/2013 12:06:46,  wrote:
>>> "Alex McDonald" <blog@rivadpm.com> writes:
>>>>on 30/10/2013 17:02:58,  wrote:
>>>>: {: ( -- )  \ {: :} locals
>>>>   compile-only>
>>>>     0 to localdcl          \ zero dcl counter, new set of locals
>>>>     begin definite-word                    \ get next word
>>>>       2dup s" |" str= >r               \ as in {: [...] | ...
>>>>       2dup s" --" str= >r              \ as in {: [...] -- ...
>>>>       2dup s" :}"  str= 2r> or or not    \ as in {: [...] :} ...
>>>>     while (local) repeat                   \ if none, then not done
>>>>     0 0 (local)                          \ done all locals
>>>>     begin
>>>>       2dup s" :}" str= >r          \ here at ... -- or ... :}
>>>>            s" |" str= r> or not
>>>>     while definite-word repeat ;  \ skip until finish
>>>
>>> It seems to me that the locals are defined in the reverse order and
>>
>>: locals| ( -- ) \ ans standard locals
>>    compile-only> -1 to localord postpone {: ;  \ reversed stack order
>>
>>The definitions don't generate code until 0 0 (LOCAL). LOCALORD sets the
>>order.
> 
> Ah, ok. However, the default for (LOCAL) should be the behaviour with
> "-1 to localord", otherwise standard programs that use (LOCAL), like
> xlocals.fs, don't work correctly.

Good point; fixed.

> 
> - anton

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Forth200x enhanced locals implementation anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-10-30 17:03 +0000
  Re: Forth200x enhanced locals implementation "Alex McDonald" <blog@rivadpm.com> - 2013-10-30 22:23 +0000
    Re: Forth200x enhanced locals implementation anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-10-31 12:06 +0000
      Re: Forth200x enhanced locals implementation "Alex McDonald" <blog@rivadpm.com> - 2013-10-31 18:01 +0000
        Re: Forth200x enhanced locals implementation anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-11-01 08:46 +0000
          Re: Forth200x enhanced locals implementation "Alex McDonald" <blog@rivadpm.com> - 2013-11-01 10:36 +0000
  Re: Forth200x enhanced locals implementation albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-10-31 14:21 +0000
  Re: Forth200x enhanced locals implementation anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-11-03 14:22 +0000

csiph-web