add def implementation for lambdas

This commit is contained in:
Quentin Leonetti
2019-07-14 06:07:05 +02:00
parent 950716f2f3
commit 15f1e6a2b1
4 changed files with 12 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ function Lisp (input, lib) {
return interpret(input[2], letContext)
},
def: function (input, context) {
context.scope[input[1].value] = input[2].value
context.scope[input[1].value] = interpret(input[2], context)
return input[2]
},
lambda: function (input, context) {