diff options
-rw-r--r-- | type.lua | 13 |
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 |
173 | end | 173 | end |
174 | 174 | ||
175 | function 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 | ||
186 | end | ||
187 | |||
175 | -------- | 188 | -------- |
176 | return m | 189 | return m |