Minor performance hack. Don't do this is real life kids, use macros instead.

This commit is contained in:
Elf M. Sternberg 2016-04-28 18:01:04 -07:00
parent 9544bf41d5
commit 82696a1f61
1 changed files with 3 additions and 4 deletions

View File

@ -36,13 +36,12 @@ ConsList = ->
nil = (-> new ConsList())()
vectorp = (c) -> toString.call(c) == '[object Array]'
cellp = (c) -> !!c.isList
pairp = (c) -> c.isList and (c.length == 2)
listp = (c) -> c.isList and (c.length == 2) and (cellp cdr c)
pairp = (c) -> !!c.isList and (c.length == 2)
listp = (c) -> !!c.isList and (c.length == 2) and (cellp cdr c)
recordp = (c) -> Object.prototype.toString.call(c) == '[object Object]'
nilp = (c) -> cellp(c) and c.length == 0
nilp = (c) -> !!c.isList and c.length == 0
cons = (a = nil, b = nil) ->
return nil if (nilp a) and (nilp b)