Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!bellcore!wind!sdh From: sdh@wind.bellcore.com (Stephen D Hawley) Newsgroups: comp.lang.forth Subject: Re: Random comments Message-ID: <17337@bellcore.bellcore.com> Date: 3 Aug 89 13:52:27 GMT References: <10425@dasys1.UUCP> Sender: news@bellcore.bellcore.com Reply-To: sdh@wind.UUCP (Stephen D Hawley) Organization: Bellcore, Morristown, NJ Lines: 26 In article <10425@dasys1.UUCP> aj-mberg@dasys1.UUCP (Micha Berger) writes: > I also mind that DO loops up to, >not including the limit - it's not intuitive. Depends on what your definition of intuitive is. :') Consider the pascal loop: for x := 1 to 20 do ... ; This runs x from 1 to 20 inclusive, just what you expect. But what about the c loop: for (x=0; x < 20; x++) ... ; This also iterates 20 times, but goes from 0 to 19. I find this more intuitive. Really. I've made more boundary errors with pascal than with any other language (iterate once too many or once too few). I think this is because of the tendency to start at 1 in pascal. Most of the programs I've seen in pascal do this (as well as declaring arrays as [1..n]). Fine. So what does this have to do with forth? Well, not much really, except that 'intuitive' is subjective, not universal. Steve Hawley sdh@flash.bellcore.com "Up is where you hang your hat." --Jim Blandy, computer scientist