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.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/type.lua b/type.lua index 0d3b776..0a0c62d 100644 --- a/type.lua +++ b/type.lua
@@ -115,12 +115,12 @@ function t.isNull (x)
115end 115end
116 116
117-- Lists are chained Conses ending in Null 117-- Lists are chained Conses ending in Null
118function t.List (items) 118function t.List (items, last)
119 local function tolist (base, items) 119 local function tolist (base, items)
120 if #items == 0 then return base end 120 if #items == 0 then return base end
121 return tolist(t.Cons(table.remove(items), base), items) 121 return tolist(t.Cons(table.remove(items), base), items)
122 end 122 end
123 return tolist(t.Null, items) 123 return tolist(last or t.Null, items)
124end 124end
125 125
126function t.isList (x) 126function t.isList (x)