Search found 54 matches

by augustk
Sat Oct 31, 2020 9:38 pm
Forum: Oberon Language
Topic: Another clarification about local names
Replies: 3
Views: 5448

Re: Another clarification about local names

We could also conclude that it is undefined which procedure is called. In practice, using the same name for a local procedure would only be confusing.
by augustk
Sat Oct 31, 2020 9:06 pm
Forum: Oberon Language
Topic: Type compatibility rules summary.
Replies: 2
Views: 930

Re: Type compatibility rules summary.

The summary you link to mixes up types and type identifiers, and defines "same type" for two variables but then uses the term "same type" in a context that does not involve variables. Nevertheless, I think it's a useful document (and shows that it is possible to be clear about such matters without ...
by augustk
Sat May 21, 2016 12:28 pm
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-01
Replies: 33
Views: 108522

Re: Oberon Report Update 2016-05-01

Since the length of the string "test" is less than the length of s1, the assignment may fail and the program is not portable. Correct? No, that should be OK. As the source is an open array the lengths do not have to be the same (that is the new exceptional rule). The result would be the same as the...
by augustk
Sat May 21, 2016 11:16 am
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-01
Replies: 33
Views: 108522

Re: Oberon Report Update 2016-05-01

MODULE M; TYPE String = ARRAY 32 OF CHAR; VAR s: String; s1: ARRAY 32 OF CHAR; PROCEDURE P(s: ARRAY OF CHAR); BEGIN s1 := s END P; BEGIN s := "test"; P(s) END M. Sorry, I missed the fact that the lengths of the arrays in your example are indeed the same. I was more thinking of the following (innoce...
by augustk
Thu May 19, 2016 9:51 am
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-01
Replies: 33
Views: 108522

Re: Oberon Report Update 2016-05-01

Note that the following two Oberon examples are now also valid according to the 3.5.2016 Version of the report. MODULE M; TYPE String = ARRAY 32 OF CHAR; VAR s: String; s1: ARRAY 32 OF CHAR; PROCEDURE P(s: ARRAY OF CHAR); BEGIN s1 := s END P; BEGIN s := "test"; P(s) END M. The compiler implementer ...
by augustk
Mon May 16, 2016 8:59 am
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-01
Replies: 33
Views: 108522

Re: Oberon Report Update 2016-05-01

The general rule is: An array may be assigned to an array of equal base type and equal length. Only if the arrays have the same type. That depends on the interpretation of same type. My understanding of the latest report and feedback from Wirth is that arrays are assignment-compatible if they are s...
by augustk
Mon May 16, 2016 8:17 am
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-01
Replies: 33
Views: 108522

Re: Oberon Report Update 2016-05-01

3. Open arrays can be assigned to arrays with the same base type. If I understand it correctly, Wirth's own compiler only causes program abortion if the source array is longer than the destination array. That is correct. In this exceptional case, the lengths of the arrays do not have to match, only...
by augustk
Mon May 16, 2016 7:51 am
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-01
Replies: 33
Views: 108522

Re: Oberon Report Update 2016-05-01

Note that strings are effectively array initialisers and that array initialisers are not defined for arrays other than character arrays. Also the length of character arrays is determined by the position of the null byte that can only be determined at runtime whereas the length of arrays with base t...
by augustk
Sat May 14, 2016 4:05 pm
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-01
Replies: 33
Views: 108522

Re: Oberon Report Update 2016-05-01

augustk wrote:3. Open arrays can be assigned to arrays with the same base type.
If I understand it correctly, Wirth's own compiler only causes program abortion if the source array is longer than the destination array. As with strings, assigning a shorter array to a longer is accepted.
by augustk
Sat May 14, 2016 3:53 pm
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-01
Replies: 33
Views: 108522

Re: Oberon Report Update 2016-05-01

The general rule is: An array may be assigned to an array of equal base type and equal length. Only if the arrays have the same type. There are four variations of possible exceptions to this rule that do not include the equal length requirement: 1. An open array may be assigned to an array of equal...