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


Groups > comp.lang.forth > #42031

Re: old `leave` renamed to `exhaust`

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: old `leave` renamed to `exhaust`
Date 2015-09-16 06:10 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2015Sep16.081024@mips.complang.tuwien.ac.at> (permalink)
References (2 earlier) <mt5b3m$2c9$1@speranza.aioe.org> <2015Sep14.103356@mips.complang.tuwien.ac.at> <mt8f9i$qm3$1@speranza.aioe.org> <y7pior0acvxj.ch2dlom72stl$.dlg@40tude.net> <mtafsr$j8m$1@speranza.aioe.org>

Show all headers | View raw


"HAA" <someone@microsoft.com> writes:
>Coos Haak wrote:
>>
>> Is there any description of what /LOOP and \LOOP are supposed to do?
>> I've never found an implementation of them, even several versions
>> of Gforth don't have them.
>
>/LOOP \LOOP use unsigned limit/index and are defined in the Forth-79
>Reference Word Set.

Thanks.  This says:

/LOOP          n --                                       "up-loop"
     A DO-LOOP terminating word.   The loop index is incremented by
     the  unsigned  magnitude  of n.   Until  the  resultant  index
     exceeds  the  limit,  execution  returns  to  just  after  the
     corresponding   DO:   otherwise,   the  index  and  limit  are
     discarded.  Magnitude logic is used.

\LOOP          n --                          I,C        "down-loop"
     A DO-LOOP terminating word.   The loop index is decremented by
     n  and  the loop terminated when the resultant  index  becomes
     equal to or less than the limit.  Magnitude logic is used, and
     n must be positive.

Not sure what they meant by "magnitude logic"; "magnitude" occurs only
in U< /LOOP and \LOOP in the Forth-79 document, with no definition.

\LOOP works like Gforth's -LOOP, except that -LOOP also works for
unsigned operands exceeding the +n range.  The "exceeds the limit" in
/LOOP is curious, as it does not match \LOOP and LOOP either in
wording, or in meaning.

+LOOP in Forth-79 already was assymetric:

+LOOP          n --                          I,C,141    "plus-loop"
     Add  the  signed  increment  n to the  loop  index  using  the
     convention for +,  and compare the total to the limit.  Return
     execution to the corresponding DO until the new index is equal
     to or greater than the limit (n>0),  or until the new index is
     less  than the limit (n<0).   Upon the exiting from the  loop,
     discard  the  loop control  parameters,  continuing  execution
     ahead.   Index and  limit are  signed  integers in  the  range
     {-32,768..32,767}.

     (Comment:  It is a historical precedent that the limit for n<0
     is irregular.   Further consideration of the characteristic is
     unlikely.)

- 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 2015: http://www.rigwit.co.uk/EuroForth2015/

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


Thread

old `leave` renamed to `exhaust` Marcos Cruz <null_email_so_use_my_contact_page@programandala.net> - 2015-09-07 20:29 +0000
  Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-08 14:52 +1000
    Re: old `leave` renamed to `exhaust` Mark Wills <markwills1970@gmail.com> - 2015-09-08 00:57 -0700
      Re: old `leave` renamed to `exhaust` Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-08 15:19 +0200
    Re: old `leave` renamed to `exhaust` Marcos Cruz <null_email_so_use_my_contact_page@programandala.net> - 2015-09-08 16:25 +0000
      Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-09 11:39 +1000
        Re: old `leave` renamed to `exhaust` Marcos Cruz <null_email_so_use_my_contact_page@programandala.net> - 2015-09-09 10:42 +0000
          Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-10 14:05 +1000
            Re: old `leave` renamed to `exhaust` Marcos Cruz <null_email_so_use_my_contact_page@programandala.net> - 2015-09-10 13:33 +0000
              Re: old `leave` renamed to `exhaust` Coos Haak <chforth@hccnet.nl> - 2015-09-10 22:04 +0200
                Re: old `leave` renamed to `exhaust` Coos Haak <chforth@hccnet.nl> - 2015-09-10 22:13 +0200
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-11 13:14 +1000
                Re: old `leave` renamed to `exhaust` Coos Haak <chforth@hccnet.nl> - 2015-09-11 12:30 +0200
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-11 21:47 +1000
                Re: old `leave` renamed to `exhaust` Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-11 14:09 +0200
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-12 11:29 +1000
                Re: old `leave` renamed to `exhaust` "Elizabeth D. Rather" <erather@forth.com> - 2015-09-11 16:05 -1000
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-14 12:25 +1000
                Re: old `leave` renamed to `exhaust` "Elizabeth D. Rather" <erather@forth.com> - 2015-09-13 17:53 -1000
                Re: old `leave` renamed to `exhaust` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-14 08:33 +0000
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-15 16:55 +1000
                Re: old `leave` renamed to `exhaust` hughaguilar96@gmail.com - 2015-09-15 01:46 -0700
                Re: old `leave` renamed to `exhaust` Coos Haak <chforth@hccnet.nl> - 2015-09-15 15:14 +0200
                Re: old `leave` renamed to `exhaust` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-15 15:13 +0000
                Re: old `leave` renamed to `exhaust` hughaguilar96@gmail.com - 2015-09-15 16:13 -0700
                Re: old `leave` renamed to `exhaust` jim.brakefield@ieee.org - 2015-09-15 17:05 -0700
                Re: old `leave` renamed to `exhaust` hughaguilar96@gmail.com - 2015-09-15 18:35 -0700
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-19 11:42 +1000
                Re: old `leave` renamed to `exhaust` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-19 10:48 +0000
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-20 00:01 +1000
                Re: old `leave` renamed to `exhaust` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-19 15:02 +0000
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-21 15:51 +1000
                Re: old `leave` renamed to `exhaust` "Elizabeth D. Rather" <erather@forth.com> - 2015-09-15 08:45 -1000
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-16 11:18 +1000
                Re: old `leave` renamed to `exhaust` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-16 06:10 +0000
                Re: old `leave` renamed to `exhaust` "HAA" <someone@microsoft.com> - 2015-09-17 15:15 +1000
                Re: old `leave` renamed to `exhaust` anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-17 06:04 +0000
                Re: old `leave` renamed to `exhaust` Coos Haak <chforth@hccnet.nl> - 2015-09-11 14:16 +0200

csiph-web