add prelude.lisp
This commit is contained in:
11
desktop/sources/lisp/prelude.lisp
Normal file
11
desktop/sources/lisp/prelude.lisp
Normal 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))))
|
||||
@@ -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})`))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user