You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
709 B
GLSL
37 lines
709 B
GLSL
(
|
|
; core utilities
|
|
($x ^x ^x) $dup
|
|
($_) $drop
|
|
($x $y ^x ^y) $swap
|
|
($a $b $c ^b ^a ^c) $rot
|
|
(sub) $-
|
|
(0 swap - -) $+
|
|
(()) $nil
|
|
(nil eq) $null?
|
|
($x x) $force
|
|
(10 emit) $cr
|
|
(dup car swap cdr) $carcdr
|
|
|
|
; if-stmt
|
|
($c $t $f c ^f ^t rot cswap $_ force) $if
|
|
($f $t $c $fn ^f ^t ^c fn) $endif
|
|
|
|
; range
|
|
($self $start $end
|
|
^if (^start ^end eq)
|
|
^nil
|
|
(^start ^end ^start 1 + self swap cons)
|
|
endif
|
|
) $range
|
|
|
|
($self $func $list
|
|
^if (^list null?)
|
|
nil
|
|
(^list carcdr swap func ^func self)
|
|
endif
|
|
) $foreach
|
|
|
|
58 48 range
|
|
^emit foreach cr
|
|
)
|