add prelude.lisp

This commit is contained in:
Quentin Leonetti
2019-07-20 21:25:28 +02:00
parent fade8cb396
commit 0f2acc0d0e
3 changed files with 20 additions and 8 deletions

View File

@@ -0,0 +1,11 @@
(echo "Loading prelude.lisp")
(defn translate
(r p)
(clone
r
(rect
(of p :x)
(of p :y)
(of r :w)
(of r :h))))

View File

@@ -167,10 +167,12 @@ function Lisp (input, lib) {
}
this.parse = function (input) {
return parenthesize(tokenize(`(${input})`))
return parenthesize(tokenize(input))
}
this.toPixels = async function () {
return interpret(this.parse(input))
return interpret(this.parse(`(
(include "./sources/lisp/prelude.lisp")
${input})`))
}
}