home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / forth / 2831 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.6 KB  |  44 lines

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!email!mips.complang.tuwien.ac.at!anton
  3. From: anton@mips.complang.tuwien.ac.at (Anton Martin Ertl)
  4. Subject: Re: +LOOP in the Standard
  5. Message-ID: <1992Jul22.080702.12713@email.tuwien.ac.at>
  6. Sender: news@email.tuwien.ac.at
  7. Nntp-Posting-Host: mips.complang.tuwien.ac.at
  8. Organization: Institut fuer Computersprachen, Technische Universitaet Wien
  9. References: <1992Jul17.122128.27889@email.tuwien.ac.at> <l6lr51INNsvo@appserv.Eng.Sun.COM>
  10. Date: Wed, 22 Jul 1992 08:07:02 GMT
  11. Lines: 31
  12.  
  13. In article <l6lr51INNsvo@appserv.Eng.Sun.COM>, wmb@pi.Eng.Sun.COM (Mitch Bradley) writes:
  14. |> 
  15. |> > As it reads in Basis 15,
  16. |> >     2 0 DO 1 +LOOP
  17. |> > will loop twice, but
  18. |> >     -2 0 DO -1 +LOOP
  19. |> > will loop three times.
  20. |> > 
  21. |> > Is this in the current dpANS and is this intended?
  22. |> 
  23. |> Yes, and it's the way that Forth systems have always worked.
  24.  
  25. Thanks for the reply.
  26.  
  27. I have tested it on two systems, TILE Release 2.1 (which claims to be
  28. a Forth-83) and a fig-Forth derived system that claims to be a
  29. Forth-79. On both systems both loops loop two times.
  30.  
  31. Also, the fig-Forth installation manual defines this as the fig-Forth
  32. behaviour. Zech's Forth book (the one I learned Forth with) teaches
  33. this symmetric behaviour.
  34.  
  35. So, you (the ANSI team) should add a big warning to the description of
  36. +LOOP, making implementors aware of the problem and the ANSI
  37. conforming behaviour, advising porters to check their +LOOPs and
  38. perhaps advising users not to use negative increments.
  39.  
  40. - anton
  41. -- 
  42. M. Anton Ertl                    Some things have to be seen to be believed
  43. anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
  44.