Created a secretive inheritance method for the compiler. You

don't need to see this, move along...
This commit is contained in:
Elf M. Sternberg 2016-04-29 07:17:52 -07:00
parent d23c849cf9
commit 950ea513c7
2 changed files with 90 additions and 67 deletions

View File

@ -6,3 +6,14 @@
PROJECT_ROOT=`pwd`
PATH="$PROJECT_ROOT/bin:$PROJECT_ROOT/node_modules/.bin:$PATH"
export PATH
if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
_OLD_VIRTUAL_PS1="$PS1"
if [ "x" != x ] ; then
PS1="$PS1"
else
PS1="(`basename \"$PROJECT_ROOT\"`)$PS1"
fi
export PS1
fi

View File

@ -34,6 +34,13 @@ ConsList = ->
writeable: false
list
_annotate = (ConsList) ->
nilp = (c) -> !!c.isList and c.length == 0
cons = (a = nil, b = nil) ->
return (new ConsList()) if (nilp a) and (nilp b)
if (a) then (new ConsList(a, b)) else (new ConsList(b))
nil = (-> new ConsList())()
vectorp = (c) -> toString.call(c) == '[object Array]'
@ -41,11 +48,6 @@ cellp = (c) -> !!c.isList
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) -> !!c.isList and c.length == 0
cons = (a = nil, b = nil) ->
return (new ConsList()) if (nilp a) and (nilp b)
if (a) then (new ConsList(a, b)) else (new ConsList(b))
car = (c) -> c[0]
cdr = (c) -> c[1]
@ -79,7 +81,7 @@ metacadr = (m) ->
inner ops[(car s)](l), (cdr s)
inner l, seq
module.exports =
{
cons: cons
nil: nil
car: car
@ -104,3 +106,13 @@ module.exports =
caadr: (l) -> car (car (cdr l))
cdadr: (l) -> cdr (car (cdr l))
metacadr: metacadr
}
_export = _annotate(ConsList)
Object.defineProperty _export, '_annotate',
value: _annotate
configurable: false,
enumerable: false,
writeable: false
module.exports = _export