about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--type.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/type.lua b/type.lua index 07f78f1..f119270 100644 --- a/type.lua +++ b/type.lua
@@ -172,5 +172,18 @@ function m.islist (x)
172 end 172 end
173end 173end
174 174
175function m.isatom (x)
176 if x == m.null then
177 return true -- '() is the only value that is both atom and list
178 elseif m.luatype(x) == "table" then
179 -- generally, anything that's implemented as a table is *not* an
180 -- atom, at least as I will define it. (it's not an actual
181 -- scheme procedure)
182 return false
183 else
184 return true
185 end
186end
187
175-------- 188--------
176return m 189return m