Search found 53 matches
- Sat Oct 31, 2020 9:06 pm
- Forum: Oberon Language
- Topic: Type compatibility rules summary.
- Replies: 2
- Views: 65777
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 ...
- Sat May 21, 2016 12:28 pm
- Forum: Oberon Language
- Topic: Oberon Report Update 2016-05-01
- Replies: 33
- Views: 410542
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...
- Sat May 21, 2016 11:16 am
- Forum: Oberon Language
- Topic: Oberon Report Update 2016-05-01
- Replies: 33
- Views: 410542
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...
- Thu May 19, 2016 9:51 am
- Forum: Oberon Language
- Topic: Oberon Report Update 2016-05-01
- Replies: 33
- Views: 410542
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 ...
- Mon May 16, 2016 8:59 am
- Forum: Oberon Language
- Topic: Oberon Report Update 2016-05-01
- Replies: 33
- Views: 410542
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...
- Mon May 16, 2016 8:17 am
- Forum: Oberon Language
- Topic: Oberon Report Update 2016-05-01
- Replies: 33
- Views: 410542
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...
- Mon May 16, 2016 7:51 am
- Forum: Oberon Language
- Topic: Oberon Report Update 2016-05-01
- Replies: 33
- Views: 410542
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...
- Sat May 14, 2016 4:05 pm
- Forum: Oberon Language
- Topic: Oberon Report Update 2016-05-01
- Replies: 33
- Views: 410542
Re: Oberon Report Update 2016-05-01
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.augustk wrote:3. Open arrays can be assigned to arrays with the same base type.
- Sat May 14, 2016 3:53 pm
- Forum: Oberon Language
- Topic: Oberon Report Update 2016-05-01
- Replies: 33
- Views: 410542
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...
- Tue May 10, 2016 8:36 am
- Forum: Oberon Language
- Topic: Oberon Report Update 2016-05-03
- Replies: 4
- Views: 99845
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...