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
Plaintext

4 months ago
(
; 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
4 months ago
; 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)
4 months ago
endif
) $foreach
4 months ago
58 48 range
^emit foreach cr
4 months ago
)