- FOR loop control variable restrictions?

From: Oberon microsystems AG, Tech-Support <"Oberon>
Date: Thu, 25 Aug 2005 13:41:53 +0200

----boundary-LibPST-iamunique-1947260757_-_-
Content-type: text/plain

Chris,

the Component Pascal reference defines the syntax for the FOR statement as follows:

FOR ident ":=" Expr TO Expr [BY ConstExpr] DO StatementSeq END.

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.

Since the FOR statement is defined in terms of the WHILE statement, a language change to allow also designators would be fairly straight forward.

Cheers
Marc
Oberon microsystems AG
 

> -----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



----boundary-LibPST-iamunique-1947260757_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV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luZyB0byB0aGVzZSBccGFyDQo+IHJl
c3RyaWN0aW9ucyBpbiBCbGFja0JveC4gQXJlIHRoZXkgaW50ZW50aW9uYWw/XHBhcg0KPiBccGFy
DQo+IENocmlzIEJ1cnJvd3NccGFyDQo+IENGQiBTb2Z0d2FyZVxwYXINCj4gaHR0cDovL3d3dy5j
ZmJzb2Z0d2FyZS5jb20vZ3BjcFxwYXINCj4gXHBhcg0KPiAtLS0gQmxhY2tCb3hccGFyDQo+IC0t
LSBzZW5kIHN1YmplY3QgSEVMUCBvciBVTlNVQlNDUklCRSB0byBibGFja2JveEBvYmVyb24uY2hc
cGFyDQo+IFxwYXINCj4gXHBhcg0KXHBhcg0KLS0tIEJsYWNrQm94XHBhcg0KLS0tIHNlbmQgc3Vi
amVjdCBIRUxQIG9yIFVOU1VCU0NSSUJFIHRvIGJsYWNrYm94QG9iZXJvbi5jaFxwYXINClxwYXIN
Cn0

----boundary-LibPST-iamunique-1947260757_-_---
Received on Thu Aug 25 2005 - 13:41:53 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:10 UTC