Noeud « Next »: , Noeud « Up »: Semantics



1.3.1 Declarations

arrays
The size of the array does not belong to the type. Arrays are always initialized.
          let type int_array = array of int
              var  table := int_array[100] of 0
          in ... end
     

builtin types
There are two builtin types, int and string. They may be redefined.
equivalence
Two record types or two array types are equivalent iff there are issued from the same definition. As in C, unlike Pascal, structural equivalence is rejected.

Type aliases do not build new types, hence they are equivalent.

          let
            type a = int
            type b = int
            var a := 1
            var b := 2
          in
            a = b           /* OK */
          end
     

Name spaces
There are three name spaces: types, variables and functions. Appel uses only two, since variables and functions share the same name space. The motivation, as suggested by Sébastien Carlier, is probably related to the fact that in the second part of his book, while describing functional extensions of Tiger, functions can be assigned to variables.
          let type a = {a : int}
              var  a := 0
              function a (a : a) : a = a{a = a.a}
          in
              a (a{a = a})
          end
     

But three name spaces is easier to implement than two.