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


Groups > comp.lang.forth > #59711

Re: allot which initialize the alloted space ?

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: allot which initialize the alloted space ?
Date 2017-05-22 07:40 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2017May22.094013@mips.complang.tuwien.ac.at> (permalink)
References <ofrun4$e80$1@dont-email.me> <9dc8fce7-889a-40ca-b57c-382d3569620f@googlegroups.com> <ofsapd$le7$1@dont-email.me> <be9ff482-b5c2-41e7-a06b-dc9d1f8571eb@googlegroups.com>

Show all headers | View raw


hughaguilar96@gmail.com writes:
>This is the same argument that Anton Ertl made in regard to his {: definer.=
> He wasn't zeroing out the uninitialized locals (the locals to the right of=
> the | in the list of locals). He wanted to make it legal to initialize the=
>m to whatever data happened to be in memory already.

Reality check: The "enhanced local variable syntax" proposal is by
Stephen Pelc, and he included the "|" feature.

I argued that "|" is unnecessary, because you can write

0 0 {: a b c d :} 

instead of

{: a b | c d :}

and voila, you get initialized c and d.  And the better approach is to
define c and d where you get the actual data instead of at the start.
So the "|" feature is mainly a workaround for the inability of most
Forth systems to support multiple locals definitions and locals
definitions inside control structures.

Stephen Pelc included a "reference implementation" based on a word
BUILDLV that is not implemented in a working way in the reference
implementation, nor implemented in any Forth system.

I then implemented {: twice in standard Forth, based on (LOCAL):

http://www.forth200x.org/reference-implementations/locals.fs
http://www.forth200x.org/reference-implementations/extended-locals.fs

Both initialize the locals after |, because this is a good idea, and
because (LOCAL) requires an initialization value.  locals.fs
initializes the locals after | to 0, extended-locals.fs to 12345.

- 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 2017: http://www.euroforth.org/ef17/

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


Thread

allot which initialize the alloted space ? Andreas Klimas <klimas@w3group.de> - 2017-05-21 13:50 +0200
  Re: allot which initialize the alloted space ? Coos Haak <htrofhc@gmail.com> - 2017-05-21 14:13 +0200
  Re: allot which initialize the alloted space ? hughaguilar96@gmail.com - 2017-05-21 08:01 -0700
    Re: allot which initialize the alloted space ? Ron Aaron <rambamist@gmail.com> - 2017-05-21 18:16 +0300
      Re: allot which initialize the alloted space ? hughaguilar96@gmail.com - 2017-05-21 09:02 -0700
        Re: allot which initialize the alloted space ? Ron Aaron <rambamist@gmail.com> - 2017-05-21 19:17 +0300
          Re: allot which initialize the alloted space ? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-22 11:22 +0000
          Re: allot which initialize the alloted space ? hughaguilar96@gmail.com - 2017-05-24 08:03 -0700
            Re: allot which initialize the alloted space ? Alex <alex@rivadpm.com> - 2017-05-24 16:58 +0100
        Re: allot which initialize the alloted space ? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-22 07:40 +0000
          Re: allot which initialize the alloted space ? Mark Wills <markwills1970@gmail.com> - 2017-05-22 08:02 -0700
            Re: allot which initialize the alloted space ? "HAA" <someone@microsoft.com> - 2017-05-24 16:40 +1000
          Re: allot which initialize the alloted space ? hughaguilar96@gmail.com - 2017-05-22 13:27 -0700
      Re: allot which initialize the alloted space ? Alex <alex@rivadpm.com> - 2017-05-21 17:16 +0100
        Re: allot which initialize the alloted space ? Ron Aaron <rambamist@gmail.com> - 2017-05-21 19:22 +0300
          Re: allot which initialize the alloted space ? Alex <alex@rivadpm.com> - 2017-05-21 18:03 +0100
          Re: allot which initialize the alloted space ? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-05-21 20:46 +0200
            Re: allot which initialize the alloted space ? Alex <alex@rivadpm.com> - 2017-05-21 20:34 +0100
      Re: allot which initialize the alloted space ? "HAA" <someone@microsoft.com> - 2017-05-24 16:41 +1000
  Re: allot which initialize the alloted space ? Julian Fondren <julian.fondren@gmail.com> - 2017-05-21 08:36 -0700

csiph-web