🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #893

Re: FOR loops

#893
From: Eliot Moss
Date: Fri, 06 Jul 1990 21:35
29 lines
2100 bytes
The type of "id" in the Modula-3 loop

	FOR id := first TO last BY step DO S END

is the common basetype of "first" and "last". This will be either INTEGER or
some enumeration type; it will never be a subrange, though if first and last
are compile-time known then the compiler can clearly take advantage of that in
doing array bounds checks, assignments to variables having subrange types,
etc. The index variable "id" may not be assigned within the loop or passed as
a VAR parameter; technically, it is called "readonly".

Joe Touch is right that Modula-3 is not a pure superset of Modula-2.
Personally, I consider it an improvement over Pascal and Modula-2, because of
its addition of garbage collection, objects with single inheritance,
exceptions and handlers, and true concurrent threads; it also deleted some
items that I feel are needlessly complex. Not everyone agrees with this view;
some feel that Oberon is more attractive because it is smaller. That is,
ignoring the addition of objects/extensions, Modula-3 looks more like a
superset of Modula-2 and Oberon looks more like a subset. Each to their own,
but I think garbage collection and exceptions are definite wins in developing
quality software.						Eliot
--

		J. Eliot B. Moss, Assistant Professor
		Department of Computer and Information Science
		Lederle Graduate Research Center
		University of Massachusetts
		Amherst, MA  01003
		(413) 545-4206; Moss@cs.umass.edu
Technical Details
Message-ID: <MOSS.90Jul6173546@ibis.cs.umass.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!snorkelwacker!bu.edu!xylogics!transfer!crackers!m2c!umvlsi!dime!dime.cs.umass.edu!moss
References: <INFO-M2%90070316593556@UCF1VM.BITNET> <MOSS.90Jul5090826@ibis.cs.umass.edu> <26730@netnews.upenn.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!snorkelwacker!bu.edu!xylogics!transfer!crackers!m2c!umvlsi!dime!dime.cs.umass.edu!moss
From: moss@cs.umass.edu (Eliot Moss)
Newsgroups: comp.lang.modula2
Subject: Re: FOR loops
Message-ID: <MOSS.90Jul6173546@ibis.cs.umass.edu>
Date: 6 Jul 90 21:35:46 GMT
References: <INFO-M2%90070316593556@UCF1VM.BITNET>
 <MOSS.90Jul5090826@ibis.cs.umass.edu> <26730@netnews.upenn.edu>
Sender: news@dime.cs.umass.edu
Reply-To: moss@cs.umass.edu
Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst)
Lines: 29
In-reply-to: touch@dsl.cis.upenn.edu's message of 5 Jul 90 16:14:21 GMT