diff --git a/desktop/sources/scripts/lisp.js b/desktop/sources/scripts/lisp.js index 793ea80..2b7788e 100644 --- a/desktop/sources/scripts/lisp.js +++ b/desktop/sources/scripts/lisp.js @@ -19,7 +19,7 @@ function Lisp (input, lib) { } const special = { - run: (input, context) => { + include: (input, context) => { const p = input[1].value if (!fs.existsSync(p)) { console.warn('Source', p); return [] } const file = fs.readFileSync(p, { encoding: 'utf-8' }) diff --git a/examples/recursive.lisp b/examples/recursive.lisp index 50a2c7c..7c4cd6c 100644 --- a/examples/recursive.lisp +++ b/examples/recursive.lisp @@ -2,13 +2,14 @@ ( (clear) + (def line-color "red") (defn rec (v) (if (gt v 0) ((stroke (circle (mul 5 v) (mul 5 v) - (mul 5 v)) 1 "red") + (mul 5 v)) 1 line-color) (rec (sub v 5)))) ) diff --git a/examples/run.lisp b/examples/run.lisp index 0954598..1877cf0 100644 --- a/examples/run.lisp +++ b/examples/run.lisp @@ -1,5 +1,4 @@ ( - (run "../examples/recursive.lisp") - (echo value) - (echo (addOne value)) + (include "../examples/recursive.lisp") + (echo line-color) ) \ No newline at end of file