diff options
author | Case Duckworth | 2024-02-21 22:20:45 -0600 |
---|---|---|
committer | Case Duckworth | 2024-02-21 22:20:45 -0600 |
commit | 65a1c1f8820425e5a531a1bd4d652390489d4f9c (patch) | |
tree | 5a2bcaba8244e11d764c29752ab1b5da68b2c6ad /types.lua | |
parent | Add makefile (diff) | |
download | lam-65a1c1f8820425e5a531a1bd4d652390489d4f9c.tar.gz lam-65a1c1f8820425e5a531a1bd4d652390489d4f9c.zip |
Fix weird eval problem
Don't do things ya don't get, kids
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 | ||