aboutsummaryrefslogtreecommitdiff
path: root/test/tables.tm
blob: 5b53fc80b84614586d03624449b3b35e393c197a (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

>> t := {"one"=>1, "two"=>2; default=999}
= {"one"=>1, "two"=>2; default=999}
>> t["one"]
= 1
>> t["two"]
= 2
>> t["???"]
= 999
>> t.default
= ?(readonly)999
>> t.fallback
= !{Str=>Int64}

>> t.keys
= ["one", "two"]
>> t.values
= [1, 2]

>> t2 := {"three"=>3; fallback=t}
= {"three"=>3; fallback={"one"=>1, "two"=>2; default=999}}
>> t2["one"]
= 1
>> t2["three"]
= 3
>> t2["???"]
= 999
>> t2.default
= !Int64
>> t2.fallback
= ?(readonly){"one"=>1, "two"=>2; default=999}