Shortcircuit Boolean combinators.

This commit is contained in:
Simon Forman 2020-04-23 15:15:36 -07:00
parent 8a898e0292
commit 53632fdbad
1 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,10 @@
-- 1 - -- 1 -
? dup bool ? dup bool
&& [nullary] cons [nullary [false]] dip branch
++ 1 + ++ 1 +
|| [nullary] cons [nullary] dip [true] branch
!- 0 >=
abs dup 0 < [] [neg] branch
anamorphism [pop []] swap [dip swons] genrec anamorphism [pop []] swap [dip swons] genrec
app1 grba infrst app1 grba infrst
app2 [grba swap grba swap] dip [infrst] cons ii app2 [grba swap grba swap] dip [infrst] cons ii
@ -57,6 +61,7 @@ second rest first
shift uncons [swons] dip shift uncons [swons] dip
shunt [swons] step shunt [swons] step
size 0 swap [pop ++] step size 0 swap [pop ++] step
spiral_next [[[abs] ii <=] [[<>] [pop !-] ||] &&] [[!-] [[++]] [[--]] ifte dip] [[pop !-] [--] [++] ifte] ifte
split_at [drop] [take] clop split_at [drop] [take] clop
sqr dup * sqr dup *
step_zero 0 roll> step step_zero 0 roll> step