Run is now include

This commit is contained in:
Devine Lu Linvega 2019-07-16 14:19:16 +09:00
parent 5f766f7270
commit 7a8e25b51b
3 changed files with 5 additions and 5 deletions

View File

@ -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' })

View File

@ -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))))
)

View File

@ -1,5 +1,4 @@
(
(run "../examples/recursive.lisp")
(echo value)
(echo (addOne value))
(include "../examples/recursive.lisp")
(echo line-color)
)