diff options
Diffstat (limited to 'type.lua')
-rw-r--r-- | type.lua | 4 |
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) | |||
115 | end | 115 | end |
116 | 116 | ||
117 | -- Lists are chained Conses ending in Null | 117 | -- Lists are chained Conses ending in Null |
118 | function t.List (items) | 118 | function 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) |
124 | end | 124 | end |
125 | 125 | ||
126 | function t.isList (x) | 126 | function t.isList (x) |