about summary refs log tree commit diff stats
path: root/types.lua
diff options
context:
space:
mode:
authorCase Duckworth2024-02-21 22:20:45 -0600
committerCase Duckworth2024-02-21 22:20:45 -0600
commit65a1c1f8820425e5a531a1bd4d652390489d4f9c (patch)
tree5a2bcaba8244e11d764c29752ab1b5da68b2c6ad /types.lua
parentAdd makefile (diff)
downloadlam-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.lua37
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
3local types = {}
4
5function 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
20end
21
22types.Object = { __type = "Object" }
23function types.Object:new(o)
24 o = o or {}
25 setmetatable(o, self)
26 self.__index = self
27 return o
28end
29
30--- Boxed types
31
32-- Strings
33
34-- Lists
35
36---
37return types