----boundary-LibPST-iamunique-763558938_-_-
Content-type: text/plain
Marc,
Thank you for your reply. On reflection I should have instead asked ETH
whether they intended to *allow* the statements. Further investigation
shows that recent implementations of their Oberon compiler have included
a number of other significant extensions not defined in the Oberon-2
report (e.g. operator overloading, vector arithmetic, use of parameters
to define local dynamic arrays etc.) so it is quite possible.
> The definition for ident is:
>
> ident = (letter | "_") {letter | "_" | digit}.
> letter = "A" .. "Z" | "a" .. "z" | "À".."Ö" | "Ø".."ö" | "ø".."ÿ".
> digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7"
> | "8" | "9".
>
> That's why designators of the form "r.i" or "a[0]" cannot be
> used as control variables.
>
OK - but that then leads to the question:
The following statement *does* compile in BlackBox:
FOR M.i := 1 TO 10 DO END;
where i is an integer variable exported from Module M.
Is that intentionally allowed?
> Since the FOR statement is defined in terms of the WHILE
> statement, a language change to allow also designators would
> be fairly straight forward.
>
I wasn't trying to suggest that it would be a good thing. Such a change
could impact on the compiler's ability to optimise the FOR loop. Because
of my Pascal / Modula-2 background it normally wouldn't have occurred to
me to use anything other than local variables in a FOR statement. The
questions simply arose while making some modifications to the Modula-2
to Component Pascal translator and investigating in detail the
differences between the two languages. I was aware that some earlier
restrictions on the FOR loop had been elimated but wasn't sure how far
it had been taken. Thank you for your clarification,
Regards,
Chris
Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp
info{([at]})nowhere.xy
>
> > -----Original Message-----
> > From: blackbox{([at]})nowhere.xy> > Behalf Of CFB Software
> > Sent: Donnerstag, 25. August 2005 02:33
> > To: Blackbox
> > Subject: [BlackBox] - FOR loop control variable restrictions?
> >
> >
> > The following statements which compile under ETH Oberon-2 for
> > Windows fail to compile in BlackBox:
> >
> > FOR r.i := 1 TO 10 DO END;
> > FOR a[0] := 1 TO 10 DO END;
> >
> > where r and a are declared as:
> >
> > r: RECORD i: INTEGER END;
> > a: ARRAY 10 OF INTEGER;
> >
> > I cannot find any documentation relating to these
> > restrictions in BlackBox. Are they intentional?
> >
> > Chris Burrows
> > CFB Software
> > http://www.cfbsoftware.com/gpcp
> >
> > --- BlackBox
> > --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy> >
> >
>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy>
>
>
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-763558938_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBNYXJjLFxwYXINClxwYXINClRo
YW5rIHlvdSBmb3IgeW91ciByZXBseS4gT24gcmVmbGVjdGlvbiBJIHNob3VsZCBoYXZlIGluc3Rl
YWQgYXNrZWQgRVRIXHBhcg0Kd2hldGhlciB0aGV5IGludGVuZGVkIHRvICphbGxvdyogdGhlIHN0
YXRlbWVudHMuIEZ1cnRoZXIgaW52ZXN0aWdhdGlvblxwYXINCnNob3dzIHRoYXQgcmVjZW50IGlt
cGxlbWVudGF0aW9ucyBvZiB0aGVpciBPYmVyb24gY29tcGlsZXIgaGF2ZSBpbmNsdWRlZFxwYXIN
CmEgbnVtYmVyIG9mIG90aGVyIHNpZ25pZmljYW50IGV4dGVuc2lvbnMgbm90IGRlZmluZWQgaW4g
dGhlIE9iZXJvbi0yX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