- Compiler bug?

From: Fyodor Tkachov <"Fyodor>
Date: Mon, 28 Feb 2005 14:30:35 -0700

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

It may help to explain this behavior in a less formal way:

the Oberon compilers do not attempt, as a matter of principle, to be smart in regard of guessing the programmer's intentions:
the coincidence of array lengths may have been accidental, leading to bad computational errors (e.g. in physics: Lorentz 4-vectors and quaternions)
-- unlike with explicitly named types.

With open array parameters, it is clear that the programmer intended the procedure to accept arrays of any length.

The rules in Appendix A are just a formalization of the above, necessarily somewhat obscure as most formalizations.

Practically all language features can be interpreted in a human fashion, but such a text is lacking so far ...

Cheers
Fyodor

> > Can anyone compiler this?
> >
> > -------------------------------------------------------------------
> > MODULE PrivTest;
> >
> > PROCEDURE ^ Test (VAR ident: ARRAY 10 OF INTEGER);
> >
> > PROCEDURE Test (VAR ident: ARRAY 10 OF INTEGER);
> > BEGIN
> > END Test;
> >
> > END PrivTest.
> > -------------------------------------------------------------------
> >
> > Same code with "ARRAY OF INTEGER" compiles OK.
> >
> > --- BlackBox
> > --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
>
> Dejan,
>
> Your first example won't compile because two occurrences of ARRAY n OF
> anything do not correspond to the same types (See appendix A of the language
> reference). Conversely, two occurrences of open arrays with the same array
> elements correspond two the same type.
>
> Cheers.
>
> Gerard
>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy

Powered by the E-mail PIM - Info Select - www.miclog.com

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy



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

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlx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EZWphbixccGFyDQo+XHBhcg0KPiBZb3VyIGZpcnN0IGV4YW1wbGUgd29uJ3Qg
Y29tcGlsZSBiZWNhdXNlIHR3byBvY2N1cnJlbmNlcyBvZiBBUlJBWSBuIE9GXHBhcg0KPiBhbnl0
aGluZyBkbyBub3QgY29ycmVzcG9uZCB0byB0aGUgc2FtZSB0eXBlcyAoU2VlIGFwcGVuZGl4IEEg
b2YgdGhlIGxhbmd1YWdlXHBhcg0KPiByZWZlcmVuY2UpLiBDb252ZXJzZWx5LCB0d28gb2NjdXJy
ZW5jZXMgb2Ygb3BlbiBhcnJheXMgd2l0aCB0aGUgc2FtZSBhcnJheVxwYXINCj4gZWxlbWVudHMg
Y29ycmVzcG9uZCB0d28gdGhlIHNhbWUgdHlwZS5ccGFyDQo+XHBhcg0KPiBDaGVlcnMuXHBhcg0K
PlxwYXINCj4gR2VyYXJkXHBhcg0KPlxwYXINCj4gLS0tIEJsYWNrQm94XHBhcg0KPiAtLS0gc2Vu
ZCBzdWJqZWN0IEhFTFAgb3IgVU5TVUJTQ1JJQkUgdG8gYmxhY2tib3hAb2Jlcm9uLmNoXHBhcg0K
XHBhcg0KUG93ZXJlZCBieSB0aGUgRS1tYWlsIFBJTSAtIEluZm8gU2VsZWN0IC0gd3d3Lm1pY2xv
Zy5jb21ccGFyDQpccGFyDQotLS0gQmxhY2tCb3hccGFyDQotLS0gc2VuZCBzdWJqZWN0IEhFTFAg
b3IgVU5TVUJTQ1JJQkUgdG8gYmxhY2tib3hAb2Jlcm9ufX0ADQoJaWQgOUMxODE4MA=


----boundary-LibPST-iamunique-760810055_-_---
Received on Mon Feb 28 2005 - 22:30:35 UTC

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