Fixed issue with Lamda
This commit is contained in:
parent
6785286118
commit
0294c04858
@ -235,7 +235,7 @@ function Library (ronin) {
|
|||||||
this.sqrt = Math.sqrt // calculate the square root
|
this.sqrt = Math.sqrt // calculate the square root
|
||||||
|
|
||||||
this.sq = (a) => { // calculate the square
|
this.sq = (a) => { // calculate the square
|
||||||
return a * a;
|
return a * a
|
||||||
}
|
}
|
||||||
|
|
||||||
this.PI = Math.PI
|
this.PI = Math.PI
|
||||||
|
@ -152,7 +152,7 @@ function Lisp (lib = {}, includes = []) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const tokenize = function (input) {
|
const tokenize = function (input) {
|
||||||
const i = input.replace(/^\;.*\n?/gm, '').replace('λ', 'lambda ').split('"')
|
const i = input.replace(/^\;.*\n?/gm, '').replace(/λ /g, 'lambda ').split('"')
|
||||||
return i.map(function (x, i) {
|
return i.map(function (x, i) {
|
||||||
return i % 2 === 0
|
return i % 2 === 0
|
||||||
? x.replace(/\(/g, ' ( ')
|
? x.replace(/\(/g, ' ( ')
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
; gradients
|
|
||||||
|
|
||||||
(clear)
|
|
||||||
(fill
|
|
||||||
(svg "M405,15 L405,15 L150,150 L195,90 L240,135 L120,195 L75,90 L135,165 L120,225 L90,240 L60,210 L90,150 L255,180 L285,180 L285,165 ")
|
|
||||||
(gradient
|
|
||||||
(0 -50 600 175)
|
|
||||||
("red" "orange" "blue" "green")))
|
|
||||||
|
|
||||||
(stroke
|
|
||||||
(svg "M255,60 L255,60 L135,180 L75,60 L195,210 L120,225 L105,225 L165,255 L225,195 L255,135 L285,150") 1
|
|
||||||
(gradient
|
|
||||||
(50 0 180 0)
|
|
||||||
("black" "white" "blue" "green")))
|
|
12
examples/basics/svg.gradient.lisp
Normal file
12
examples/basics/svg.gradient.lisp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
; gradients
|
||||||
|
(clear)
|
||||||
|
(fill
|
||||||
|
(svg 0 0 "M405,15 L405,15 L150,150 L195,90 L240,135 L120,195 L75,90 L135,165 L120,225 L90,240 L60,210 L90,150 L255,180 L285,180 L285,165 ")
|
||||||
|
(gradient
|
||||||
|
(0 -50 600 175)
|
||||||
|
("red" "orange" "blue" "green")))
|
||||||
|
(stroke
|
||||||
|
(svg 0 0 "M255,60 L255,60 L135,180 L75,60 L195,210 L120,225 L105,225 L165,255 L225,195 L255,135 L285,150") 1
|
||||||
|
(gradient
|
||||||
|
(50 0 180 0)
|
||||||
|
("black" "white" "blue" "green")))
|
@ -1,30 +1,30 @@
|
|||||||
; animated recusive spiral
|
; animated recusive spiral
|
||||||
; by @local_guru
|
; by @local_guru
|
||||||
|
(clear)
|
||||||
(clear)
|
(defn rec
|
||||||
(defn rec
|
(v)
|
||||||
(v)
|
(if
|
||||||
(if
|
(gt v 0)
|
||||||
(gt v 0)
|
(
|
||||||
(
|
(stroke
|
||||||
(stroke
|
(circle
|
||||||
(circle
|
(add 375
|
||||||
(add 375
|
(mul
|
||||||
(mul
|
(cos
|
||||||
(cos
|
(add
|
||||||
(add
|
(div v 17)
|
||||||
(div v 17)
|
(div
|
||||||
(div
|
(time) 2000)))
|
||||||
(time) 2000)))
|
(div v 2)))
|
||||||
(div v 2)))
|
(add 300
|
||||||
(add 300
|
(mul
|
||||||
(mul
|
(sin
|
||||||
(sin
|
(div v 11))
|
||||||
(div v 11))
|
(div v 2)))
|
||||||
(div v 2)))
|
(div v 2)) 1 "rgba
|
||||||
(div v 2)) 1 "rgba(114,222, 194,0.1)")
|
(114,222, 194,0.1)")
|
||||||
(rec
|
(rec
|
||||||
(sub v 0.3)))))
|
(sub v 0.3)))))
|
||||||
; set false to stop
|
; set false to stop
|
||||||
(animate true)
|
(animate true)
|
||||||
(rec 300)
|
(rec 300)
|
@ -1,5 +1,5 @@
|
|||||||
; theme
|
; theme
|
||||||
|
; reads color from the theme.
|
||||||
(clear)
|
(clear)
|
||||||
(def col
|
(def col
|
||||||
(λ
|
(λ
|
Loading…
x
Reference in New Issue
Block a user