home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.forth
- Path: sparky!uunet!email!mips.complang.tuwien.ac.at!anton
- From: anton@mips.complang.tuwien.ac.at (Anton Martin Ertl)
- Subject: Re: +LOOP in the Standard
- Message-ID: <1992Jul22.080702.12713@email.tuwien.ac.at>
- Sender: news@email.tuwien.ac.at
- Nntp-Posting-Host: mips.complang.tuwien.ac.at
- Organization: Institut fuer Computersprachen, Technische Universitaet Wien
- References: <1992Jul17.122128.27889@email.tuwien.ac.at> <l6lr51INNsvo@appserv.Eng.Sun.COM>
- Date: Wed, 22 Jul 1992 08:07:02 GMT
- Lines: 31
-
- In article <l6lr51INNsvo@appserv.Eng.Sun.COM>, wmb@pi.Eng.Sun.COM (Mitch Bradley) writes:
- |>
- |> > As it reads in Basis 15,
- |> > 2 0 DO 1 +LOOP
- |> > will loop twice, but
- |> > -2 0 DO -1 +LOOP
- |> > will loop three times.
- |> >
- |> > Is this in the current dpANS and is this intended?
- |>
- |> Yes, and it's the way that Forth systems have always worked.
-
- Thanks for the reply.
-
- I have tested it on two systems, TILE Release 2.1 (which claims to be
- a Forth-83) and a fig-Forth derived system that claims to be a
- Forth-79. On both systems both loops loop two times.
-
- Also, the fig-Forth installation manual defines this as the fig-Forth
- behaviour. Zech's Forth book (the one I learned Forth with) teaches
- this symmetric behaviour.
-
- So, you (the ANSI team) should add a big warning to the description of
- +LOOP, making implementors aware of the problem and the ANSI
- conforming behaviour, advising porters to check their +LOOPs and
- perhaps advising users not to use negative increments.
-
- - anton
- --
- M. Anton Ertl Some things have to be seen to be believed
- anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
-