Article View: comp.lang.modula2
Article #900Re: FOR loops
From: Randy Bush
Date: Thu, 05 Jul 1990 15:39
Date: Thu, 05 Jul 1990 15:39
23 lines
1683 bytes
1683 bytes
In <18442@rpp386.cactus.org> aubrey@rpp386.cactus.org (Aubrey McIntosh) writes:
> I think the business of the FOR loop is kept simple, the references local,
> the optimization is built in (no assignments are legal to the loop variable
> within the loop: It is safe to put the value into any special place, such as
> registers, without execution time safeguards.
Compiler writers loathe the FOR statement; efficiency at execution time often
implies trying to detect all sorts of horrors (e.g., aliasing) at compilation
time. So, if the language is defined to restrict the control variable (local,
not 'threatened' (passed as a VAR parameter, used as an lvalue in an enclosed
procedure, ...), ...) one complicates the language spec, but neither the
compiler nor the user's code.
The US committee momentarily considered a language change where FOR control
variables had only the scope of the FOR statement, as in Ada (thanks Robert
Firth). As it implied a language change, we disgarded the idea with some
sadness. [ Sadly, other national bodies were less cautious about the
language, see the DP. ]
Is the FOR statement still absent in the current version of Oberon?
--
..!{uunet,qiclab,intelhf}!m2xenix!randy randy@psg.com randy@m2xenix.uucp
Technical Details
Message-ID:
<1990Jul5.153926.11683@m2xenix.psg.com>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!zephyr.ens.tek.com!tektronix!nosun!qiclab!m2xenix!randyReferences:
<INFO-M2%90070316593556@UCF1VM.BITNET> <18442@rpp386.cactus.org>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!zephyr.ens.tek.com!tektronix!nosun!qiclab!m2xenix!randy From: randy@m2xenix.psg.com (Randy Bush) Newsgroups: comp.lang.modula2 Subject: Re: FOR loops Message-ID: <1990Jul5.153926.11683@m2xenix.psg.com> Date: 5 Jul 90 15:39:26 GMT References: <INFO-M2%90070316593556@UCF1VM.BITNET> <18442@rpp386.cactus.org> Organization: Pacific Systems Group, Portland Oregon US Lines: 23