🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4644

Survey: Changing the Control Variable in a FOR

#4644
From: Richard Pattis
Date: Sun, 12 Feb 1989 23:31
15 lines
1048 bytes
I'd like to conduct a brief survey on the net.  Does your M-2 compiler
allow the following code fragment?

  FOR I:=1 TO 10 DO
    I:= 1
  END

  The M-2 report says, "Its [the control variable] value should not be changed
by the statement sequence." (page 158, 3rd corrected edition)  The Logitech
VAX/VMS compiler that I have access to allows this code fragment. Is this
statement aimed at the programmer or the compiler writer? Are there any other
obvious examples of properties that could be statically checked by the
compiler, but aren't required by the Modula-2 report?  Thanks for your time.

Rich Pattis
Technical Details
Message-ID: <7257@june.cs.washington.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-june!pattis

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-june!pattis
From: pattis@june.cs.washington.edu (Richard Pattis)
Newsgroups: comp.lang.modula2
Subject: Survey: Changing the Control Variable in a FOR
Summary: Does this code compile on your compiler?
Message-ID: <7257@june.cs.washington.edu>
Date: 12 Feb 89 23:31:44 GMT
Organization: U of Washington, Computer Science, Seattle
Lines: 15