🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4895

Re: BY expression

#4895
From: Piet van Oostrum
Date: Thu, 01 Feb 1990 22:54
15 lines
1411 bytes
In article <INFO-M2%90013108331746@UCF1VM.BITNET>, BARRY@LAUCOSC (Barry Adams) writes:
 `Does anyone know why the BY expression in a FOR loop must be
 `a constant expression? Is there some semantic reason?

If you want an answer to a question of the kind: Why is this or that not
possible in Pascal or Modula-2, the answer is usually: Because it is easier
to compile. If the BY expression is allowed to be a variable expression, it
could be either positive or negative at run time. So the compiler must
insert extra code to decide at runtime whether the loop will be ascending
or descending.
-- 
Piet* van Oostrum, Dept of Computer Science, Utrecht University,
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
Telephone: +31-30-531806   Uucp:   uunet!mcsun!hp4nl!ruuinf!piet
Telefax:   +31-30-513791   Internet:  piet@cs.ruu.nl   (*`Pete')
Technical Details
Message-ID: <2378@ruuinf.cs.ruu.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!hp4nl!ruuinf!cs.ruu.nl
References: <INFO-M2%90013108331746@UCF1VM.BITNET>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!hp4nl!ruuinf!cs.ruu.nl
From: piet@cs.ruu.nl (Piet van Oostrum)
Newsgroups: comp.lang.modula2
Subject: Re: BY expression
Message-ID: <2378@ruuinf.cs.ruu.nl>
Date: 1 Feb 90 22:54:25 GMT
References: <INFO-M2%90013108331746@UCF1VM.BITNET>
Sender: news@ruuinf.cs.ruu.nl
Reply-To: piet@cs.ruu.nl (Piet van Oostrum)
Organization: Dept of Computer Science, Utrecht University, The Netherlands
Lines: 15
In-reply-to: BARRY@LAUCOSC.LAURENTIAN.CA (Barry Adams)