Updating.

This commit is contained in:
Elf M. Sternberg 2015-07-03 12:58:08 -07:00
parent c2ff0a3d88
commit f711432626
1 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ class Continuation
constructor: (@k) -> constructor: (@k) ->
invoke: (v, env, kont) -> invoke: (v, env, kont) ->
if nilp cdr v if nilp cdr v
resume @k, (car v) @k.resume (car v)
else else
throw "Continuations expect one argument", [v, env, kont] throw "Continuations expect one argument", [v, env, kont]
@ -200,6 +200,9 @@ defprimitive = (name, nativ, arity) ->
else else
throw "Incorrect arity") throw "Incorrect arity")
defpredicate = (name, nativ, arity) ->
defprimitive name, ((a, b) -> if nativ.call(null, a, b) then true else the_false_value), arity
the_false_value = (cons "false", "boolean") the_false_value = (cons "false", "boolean")
definitial "#t", true definitial "#t", true
@ -211,9 +214,6 @@ for i in [
definitial i definitial i
defpredicate = (name, nativ, arity) ->
defprimitive name, ((a, b) -> if nativ.call(null, a, b) then true else the_false_value), arity
defprimitive "cons", cons, 2 defprimitive "cons", cons, 2
defprimitive "car", car, 2 defprimitive "car", car, 2
defprimitive "set-cdr!", setcdr, 2 defprimitive "set-cdr!", setcdr, 2