Skip to content
Anton Zherdev edited this page May 22, 2014 · 1 revision

datatype ::= <primitive> | <option> | <array> | <map> | <tuple> | <reference> | <lambda> | self¹
primitive² ::= void | byte | ubyte | int | uint | int4 | uint4 | int8 | uint8 | float | float4 | float8 | char | string | bool | any
array ::= [ <datatype> ] //class ImArray
map ::= [ <datatype> : <datatype> ] _//class ImHashMap
tuple³ ::= ( <datatype>, <datatype> [, <datatype> ...] )
reference ::= className [< <datatype> [, <datatype> ...] > ] lambda ::= <datatype> -> <datatype>

  1. The same data type as a current class. This is very useful for builders with inheritance.
  2. Prefix u means unsigned. Number 4 and 8 means number of bytes. Datatypes without the number (int, uint, float) could contain different number of bytes in different environments.
  3. To get a field of the tuple use the latin alphabet. a - the first field, b - the second field etc.

val a : [int] = [1, 2]
val b : [int : string] = [(1, "1"), (2, "2")]
val c : (int, string, int) = (1, "2", 3)
val d : MList<int> = MList<int>()
val e : int -> int = x : int -> x*x
val f : (int, int) -> int = x : int, y : int -> x + y
Clone this wiki locally