Run is now include
This commit is contained in:
parent
5f766f7270
commit
7a8e25b51b
@ -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' })
|
||||
|
@ -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))))
|
||||
)
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
(
|
||||
(run "../examples/recursive.lisp")
|
||||
(echo value)
|
||||
(echo (addOne value))
|
||||
(include "../examples/recursive.lisp")
|
||||
(echo line-color)
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user