aboutsummaryrefslogtreecommitdiff
path: root/docs/notes/data_types.txt
blob: 0e275790f97912b97c60d6ef33813c6b1982947f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

LRL types
---------

Bottom type  -  private
Top type     -  any
Unit type    -  ()
Product      -  (int, bool)
Set          -  bitfield (x, y, z) -- only with a (small) constant number of elements
Union        -  union (int, bool)
Option       -  int?
Equality     -  all types, except:
                  - types with unknown storage (private, any, incomplete)
                  - float types (which has nan values)
                  - function types
                  - unknown-length arrays

Integer      -  int, etc.
Float        -  float, etc.
Character    -  byte (ASCII) or uint32 (Unicode)
String       -  byte+>
Reference    -  ^
Pointer      -  +>, *+>, *>
Array        -  int#[2]
Record       -  (int x, bool b)
Boolean      -  bool
Enumeration  -  enum (x, y)
Function     -  (int)(int, int)
Opaque       -  private  (and incomplete types)
Recursive    -  typedef A = (A^? a);


Not implemented in LRL
----------------------
Bignum
Complex
Decimal
Fixed-point
Interval
Rational

Associative array
Class
Dependent type (except for arrays with lengths)
Inductive
List
Object
Collection
Exception
Semaphore (use phreads or whatever)
Stream (use stdio or whatever)
Type class


Not needed in LRL
---------------
void         - any and () are related