Re: Pascal loops, was Testing strategy for compiler

George Neuner <gneuner2@comcast.net>
Tue, 22 Jun 2010 09:44:07 -0400

          From comp.compilers

Related articles
Testing strategy for compiler kuangpma@gmail.com (kuangpma) (2010-06-16)
Re: Testing strategy for compiler ott@mirix.org (Matthias-Christian Ott) (2010-06-18)
Re: Testing strategy for compiler gneuner2@comcast.net (George Neuner) (2010-06-18)
Re: Testing strategy for compiler gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-06-19)
Re: Testing strategy for compiler gneuner2@comcast.net (George Neuner) (2010-06-21)
Re: Pascal loops, was Testing strategy for compiler gneuner2@comcast.net (George Neuner) (2010-06-22)
| List of all articles for this month |
From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: Tue, 22 Jun 2010 09:44:07 -0400
Organization: A noiseless patient Spider
References: 10-06-037 10-06-044 10-06-050 10-06-054 10-06-061
Keywords: Pascal, design
Posted-Date: 23 Jun 2010 09:56:58 EDT

On Mon, 21 Jun 2010 17:16:53 -0400, George Neuner
<gneuner2@comcast.net> wrote:


>On Sat, 19 Jun 2010 18:41:42 +0000 (UTC), glen herrmannsfeldt
><gah@ugcs.caltech.edu> wrote:
>
>>George Neuner <gneuner2@comcast.net> wrote:
>>
>>> for n := 1 to 10 by -1
>>> do ...
>>> and generated an unreachable loop body.
>>
>>Is that illegal in PASCAL?
>
>Technically yes. The language standard defines the FOR loop step to
>be a cardinal (unsigned) type which further is not permitted to be
>zero.


Oops!


I was reminded privately that Pascal's BY loop step syntax was a
*draft* proposal to match Modula-2 and was not included in
ISO/IEC-10206. The step syntax apparently was only implemented in
some compilers that handled both Pascal and Modula-2.


Apologies for any confusion I may have created.


George



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.