Автор Тема: Oberon 2016  (Прочитано 12428 раз)

valexey_u

  • Hero Member
  • *****
  • Сообщений: 3013
    • Просмотр профиля
Oberon 2016
« : Май 01, 2016, 02:02:44 pm »
Вышел новое сообщение о языке (1 мая 2016 года): https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon07.Report.pdf

Вот дифф относительно старого: http://paste.lisp.org/display/315134

--- old.txt 2016-05-01 14:25:17.925910136 +0200
+++ new.txt 2016-05-01 14:25:17.925910136 +0200
@@ -1,5 +1,5 @@
                    The Programming Language Oberon
-                                 Revision 1.10.2013 / 4.3.2016
+                                 Revision 1.10.2013 / 1.5.2016
                                             Niklaus Wirth
                      Make it as simple as possible, but not simpler. (A. Einstein)
 
@@ -26,7 +26,7 @@
 to serve as a reference for programmers, implementors, and manual writers. What remains unsaid
 is mostly left so intentionally, either because it is derivable from stated rules of the language, or
 because it would unnecessarily restrict the freedom of implementors.
-This document describes the language defined in 1988/90 as revised in 2007/11.
+This document describes the language defined in 1988/90 as revised in 2007 / 2016.
 
 2. Syntax
 A language is an infinite set of sentences, namely the sentences well formed according to its
@@ -138,11 +138,10 @@
 A data type determines the set of values which variables of that type may assume, and the
 operators that are applicable. A type declaration is used to associate an identifier with a type. The
 types define the structure of variables of this type and, by implication, the operators that are
-applicable to components. There are two different structures, namely arrays and records, with
+applicable to components. There are two different data structures, namely arrays and records, with
 different component selectors.
-        TypeDeclaration = identdef "=" StrucType.
-        StrucType = ArrayType | RecordType | PointerType | ProcedureType.
-        type = qualident | StrucType.
+        TypeDeclaration = identdef "=" type.
+        type = qualident | ArrayType | RecordType | PointerType | ProcedureType.
 Examples:
         Table          =      ARRAY N OF REAL
         Tree           =      POINTER TO Node
@@ -387,9 +386,10 @@
 hold:
 1. The constant NIL can be assigned to variables of any pointer or procedure type.
 2. Strings can be assigned to any array of characters, provided the number of characters in the
-  string is not greater than that of the array. If it is less, a null character (0X) is appended. Single-
-  character strings can also be assigned to variables of type CHAR.
+  string is less than that of the array. (A null character is appended). Single-character strings can
+  also be assigned to variables of type CHAR.
 3. In the case of records, the type of the source must be an extension of the type of the destination.
+4. An open array may be assigned to an array of equal base type.
 Examples of assignments (see examples in Ch. 7):
         i := 0
         p := i = j
@@ -718,7 +718,7 @@
         ADC(m, n)       INTEGER              INTEGER             add with carry C
         SBC(m, n)       INTEGER              INTEGER             subtract with carry C
         UML(m, n)       INTEGER              INTEGER             unsigned multiplication
-        COND(n)         INTEGER              BOOLEAN             IF Cond(8) THEN ...
+        COND(n)         INTEGER              BOOLEAN             IF Cond(n) THEN ...
 
 Proper procedures:
         Name            Argument types                           Function
@@ -743,9 +743,8 @@
     string = """ {character} """ | digit {hexDigit} "X".
     ConstDeclaration = identdef "=" ConstExpression.
     ConstExpression = expression.
-    TypeDeclaration = identdef "=" StrucType.
-    StrucType = ArrayType | RecordType | PointerType | ProcedureType.
-    type = qualident | StrucType.
+    TypeDeclaration = identdef "=" type.
+    type = qualident | ArrayType | RecordType | PointerType | ProcedureType.
     ArrayType = ARRAY length {"," length} OF type.
     length = ConstExpression.
     RecordType = RECORD ["(" BaseType ")"] [FieldListSequence] END.
Y = λf.(λx.f (x x)) (λx.f (x x))

vlad

  • Hero Member
  • *****
  • Сообщений: 1391
    • Просмотр профиля
Re: Oberon 2016
« Ответ #1 : Май 02, 2016, 03:13:49 pm »
Вот дифф относительно старого: http://paste.lisp.org/display/315134

Хе-хе. Вирта задолбало и он вернул тайпдефы? :)

vlad

  • Hero Member
  • *****
  • Сообщений: 1391
    • Просмотр профиля
Re: Oberon 2016
« Ответ #2 : Май 02, 2016, 09:22:12 pm »
Вот дифф относительно старого: http://paste.lisp.org/display/315134

Ну а про массивы - в лучших традициях. Как оно должно себя вести, если размеры массивов не сопадают - ХЗ...

kkkk

  • Full Member
  • ***
  • Сообщений: 135
    • Просмотр профиля
Re: Oberon 2016
« Ответ #3 : Сентябрь 29, 2016, 11:27:44 am »
Хе-хе. Вирта задолбало и он вернул тайпдефы? :)
Судя по описанию - это всего лишь синтаксическое послабление, но семантика осталась прежней.