Make /\ and \/ check that their args are Booleans.
This commit is contained in:
parent
ad0f135376
commit
e771e0182b
|
|
@ -1,3 +1,9 @@
|
|||
eq [false] [true] [false] cmp
|
||||
gt [true] [false] [false] cmp
|
||||
lt [false] [false] [true] cmp
|
||||
neq [true] [false] [true] cmp
|
||||
le [false] [true] [true] cmp
|
||||
ge [true] [true] [false] cmp
|
||||
-- 1 -
|
||||
? dup bool
|
||||
&& nulco [nullary [false]] dip branch
|
||||
|
|
@ -26,7 +32,8 @@ codi cons dip
|
|||
codireco codi reco
|
||||
dinfrirst dip infrst
|
||||
dipd [dip] codi
|
||||
disenstacken ? [uncons ?] loop pop
|
||||
disenstacken swaack pop
|
||||
divmod [/] [%] clop
|
||||
down_to_zero [0 >] [dup --] while
|
||||
drop [rest] times
|
||||
dupd [dup] dip
|
||||
|
|
@ -52,6 +59,7 @@ mod %
|
|||
neg 0 swap -
|
||||
not [true] [false] branch
|
||||
nulco [nullary] cons
|
||||
null [] concat bool not
|
||||
nullary [stack] dinfrirst
|
||||
of swap at
|
||||
pam [i] map
|
||||
|
|
@ -64,7 +72,7 @@ popopd [popop] dip
|
|||
popopdd [popop] dipd
|
||||
product 1 swap [*] step
|
||||
quoted [unit] dip
|
||||
range [0 <=] [1 - dup] anamorphism
|
||||
range [0 <=] [-- dup] anamorphism
|
||||
range_to_zero unit [down_to_zero] infra
|
||||
reco rest cons
|
||||
rest uncons popd
|
||||
|
|
@ -79,10 +87,11 @@ second rest first
|
|||
shift uncons [swons] dip
|
||||
shunt [swons] step
|
||||
size [pop ++] step_zero
|
||||
small dup null [rest null] [pop true] branch
|
||||
spiral_next [[[abs] ii <=] [[<>] [pop !-] ||] &&] [[!-] [[++]] [[--]] ifte dip] [[pop !-] [--] [++] ifte] ifte
|
||||
split_at [drop] [take] clop
|
||||
split_list [take reverse] [drop] clop
|
||||
sqr dup *
|
||||
sqr dup mul
|
||||
stackd [stack] dip
|
||||
step_zero 0 roll> step
|
||||
stuncons stack uncons
|
||||
|
|
@ -90,7 +99,6 @@ sum [+] step_zero
|
|||
swapd [swap] dip
|
||||
swons swap cons
|
||||
swoncat swap concat
|
||||
sqr dup mul
|
||||
tailrec [i] genrec
|
||||
take <<{} [shift] times pop
|
||||
ternary binary popd
|
||||
|
|
@ -100,6 +108,7 @@ unary nullary popd
|
|||
uncons [first] [rest] cleave
|
||||
unit [] cons
|
||||
unquoted [i] dip
|
||||
unstack [[] swaack] dip swoncat swaack pop
|
||||
unswons uncons swap
|
||||
while swap nulco dupdipd concat loop
|
||||
x dup i
|
||||
|
|
@ -117,3 +126,6 @@ _mape popd reverse
|
|||
_map0 [_map1] dipd _map2
|
||||
_map1 stackd shift
|
||||
_map2 [infrst] cons dipd roll< swons
|
||||
_\/_ [not not] [not] branch
|
||||
/\ [not not ] ii [pop false] [] branch
|
||||
\/ [not not ] ii [] [pop true] branch
|
||||
|
|
@ -127,5 +127,5 @@ _map0 [_map1] dipd _map2
|
|||
_map1 stackd shift
|
||||
_map2 [infrst] cons dipd roll< swons
|
||||
_\/_ [not not] [not] branch
|
||||
/\ [pop false] [not not] branch
|
||||
\/ [not not] [pop true] branch
|
||||
/\ [not not ] ii [pop false] [] branch
|
||||
\/ [not not ] ii [] [pop true] branch
|
||||
Loading…
Reference in New Issue