Search found 52 matches

by augustk
Sat May 21, 2016 12:28 pm
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-01
Replies: 33
Views: 103015

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

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

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

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

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

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

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

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...
by augustk
Tue May 10, 2016 8:36 am
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-03
Replies: 4
Views: 15673

Re: Oberon Report Update 2016-05-03

My conclusion is that the EBNF in the Appendix is correct. The wrong semicolon was originally removed in Section 11 and has not been restored yet - otherwise the example in Section 11 would be incorrect. Yes, you are correct. I never noticed the previous error with the extra semicolon in section 11...
by augustk
Mon May 09, 2016 8:48 pm
Forum: Oberon Language
Topic: Oberon Report Update 2016-05-03
Replies: 4
Views: 15673

Re: Oberon Report Update 2016-05-03

As of 2016-05-08 the semicolon after the import list has also been dropped.