🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #869

Re: Ident vs Designator

#869
From: Peter Funk
Date: Mon, 02 Jul 1990 07:05
33 lines
1696 bytes
ROSS@UCF1VM.BITNET (Bri) writes:

br> I would like to know the reasoning behind the requirement
br> of using an Ident instead of a Designator as the index variable
br> in a FOR statement.

br> I do not see why the use of Designators is not allowed.

br> FOR record.integer := 1 TO 10 DO
br> END; (* FOR *)

br> Such a case causes no problems for compilers or loaders and seems quite
br> logical.

br> Anyone have any comments or reasons as to why such a restriction/definition
br> was written into the language?

Consider the following Record :

	TYPE example = RECORD one : [ 0 .. 15 ];
			      two : [ 0 .. 4095 ];
		       END;

A compiler (-writer) might consider to implement this as one 16-Bit Word.
If it would be allowed to use one of the record components as a for-loop 
index variable, this would introduce many difficulties into the 
loop-control code to be generated.
-- 
Peter Funk \\ ArtCom GmbH, Schwachhauser Heerstr. 78, D-2800 Bremen 1
Work at home: Oldenburger Str.86, D-2875 Ganderkesee 1 /+49 4222 6018 (8am-6pm)
>> PLEASE Don't send BIG mails (oversea) ! I've to pay for it : $0.3/kB
   Don't use the bang path of this news article for mails (They will bounce).
   Only the address 'pf@artcom0.artcom.north.de' will work. Thank You ! <<
Technical Details
Message-ID: <2150@artcom0.artcom.north.de>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!snorkelwacker!ira.uka.de!smurf!artcom0!pf
References: <INFO-M2%90070101452673@UCF1VM.BITNET>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!snorkelwacker!ira.uka.de!smurf!artcom0!pf
From: pf@artcom0.artcom.north.de (Peter Funk)
Newsgroups: comp.lang.modula2
Subject: Re: Ident vs Designator
Message-ID: <2150@artcom0.artcom.north.de>
Date: 2 Jul 90 07:05:02 GMT
References: <INFO-M2%90070101452673@UCF1VM.BITNET>
Organization: ArtCom GmbH, Atelier f. Computergrafik, Bremen(FRG)
Lines: 33