Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #26778
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: Forth200x enhanced locals implementation |
| Date | 2013-11-01 08:46 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2013Nov1.094656@mips.complang.tuwien.ac.at> (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> |
"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.
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2013: http://www.euroforth.org/ef13/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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