diff options
Diffstat (limited to 'types.lua')
-rw-r--r-- | types.lua | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/types.lua b/types.lua deleted file mode 100644 index 042edce..0000000 --- a/types.lua +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | --- lam.types | ||
2 | |||
3 | local types = {} | ||
4 | |||
5 | function types.Type(x) | ||
6 | if type(x) == "string" then | ||
7 | -- Symbols are Lua strings | ||
8 | return "Symbol" | ||
9 | elseif type(x) == "number" then | ||
10 | -- Numbers are Lua numbers | ||
11 | return "Number" | ||
12 | elseif x.__type then | ||
13 | return x.__type | ||
14 | elseif type(x) == "table" then | ||
15 | -- Lists are Lua tables (non-adorned) | ||
16 | return "List" | ||
17 | else | ||
18 | return type(x) | ||
19 | end | ||
20 | end | ||
21 | |||
22 | types.Object = { __type = "Object" } | ||
23 | function types.Object:new(o) | ||
24 | o = o or {} | ||
25 | setmetatable(o, self) | ||
26 | self.__index = self | ||
27 | return o | ||
28 | end | ||
29 | |||
30 | --- Boxed types | ||
31 | |||
32 | -- Strings | ||
33 | |||
34 | -- Lists | ||
35 | |||
36 | --- | ||
37 | return types | ||