about summary refs log tree commit diff stats
path: root/type.lua
diff options
context:
space:
mode:
Diffstat (limited to 'type.lua')
-rw-r--r--type.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/type.lua b/type.lua index c205468..0000bfb 100644 --- a/type.lua +++ b/type.lua
@@ -207,9 +207,16 @@ function m.list (items, final)
207 return tolist(final or m.null, items) 207 return tolist(final or m.null, items)
208end 208end
209 209
210-- strings are vectors of chars 210-- strings are vectors of chars. not lam characters, but one-character strings.
211-- this is for utf8 ease-of-use... TODO i still need to write functions to pluck
212-- out a single lam character from a string, etc.
211function m.string (x) 213function m.string (x)
212 local t = tochars(tostring(x)) 214 local t
215 if m.luatype(x) == "table" then
216 t = x
217 else
218 t = tochars(tostring(x))
219 end
213 local mt = { 220 local mt = {
214 __type = "string", 221 __type = "string",
215 __tostring = 222 __tostring =