uncons as basis

- clear deletes stack at once, not in a loop
- make uncons basis and define first and rest in tems of it
This commit is contained in:
Simon Forman 2022-04-05 10:06:40 -07:00
parent 2fb27971f1
commit 9fe565a929
2 changed files with 5 additions and 4 deletions

View File

@ -83,13 +83,14 @@ split_list [take reverse] [drop] clop
sqr dup *
stackd [stack] dip
step_zero 0 roll> step
stuncons stack uncons
sum [+] step_zero
swapd [swap] dip
swons swap cons
swoncat swap concat
sqr dup mul
tailrec [i] genrec
take [] roll> [shift] times pop
take <<{} [shift] times pop
ternary binary popd
third rest second
tuck dup swapd

View File

@ -18,7 +18,7 @@ b [i] dip i
binary unary popd
ccccons ccons ccons
ccons cons cons
clear stack bool [pop stack bool] loop
clear [] swaack pop
cleave fork popdd
clop cleave popdd
codi cons dip
@ -33,6 +33,7 @@ dupdd [dup] dipd
dupdip dupd dip
dupdipd dup dipd
enstacken stack [clear] dip
first uncons pop
flatten <{} [concat] step
fork [i] app2
fourth rest third
@ -65,7 +66,7 @@ quoted [unit] dip
range [0 <=] [1 - dup] anamorphism
range_to_zero unit [down_to_zero] infra
reco rest cons
rest [pop] infra
rest uncons popd
reverse <{} shunt
roll> swap swapd
roll< swapd swap
@ -95,7 +96,6 @@ ternary binary popd
third rest second
tuck dup swapd
unary nullary popd
uncons [first] [rest] cleave
unit [] cons
unquoted [i] dip
unswons uncons swap