[Joypy-announce] joypy/Joypy: A few more functions.

Zurück zum Archiv-Index
scmno****@osdn***** scmno****@osdn*****
Fri Aug 9 23:27:24 JST 2019


changeset cd6cec038e74 in joypy/Joypy
details: http://hg.osdn.jp/view/joypy/Joypy?cmd=changeset;node=cd6cec038e74
user: Simon Forman <sform****@hushm*****>
date: Fri Aug 09 07:26:37 2019 -0700
description: A few more functions.

reverse, shift, shunt, take, split_at

diffstat:

 thun/defs.txt |  8 +++++++-
 thun/thun.pl  |  2 ++
 2 files changed, 9 insertions(+), 1 deletions(-)

diffs (52 lines):

diff -r 7763457c8c8b -r cd6cec038e74 thun/defs.txt
--- a/thun/defs.txt	Wed Aug 07 23:36:38 2019 -0700
+++ b/thun/defs.txt	Fri Aug 09 07:26:37 2019 -0700
@@ -12,6 +12,7 @@
 binary == unary popd
 ccons == cons cons
 cleave == fork popdd
+clop == cleave popdd
 codireco == cons dip rest cons
 dinfrirst == dip infrst
 disenstacken == ? [uncons ?] loop pop
@@ -37,7 +38,7 @@
 nullary == [stack] dinfrirst
 of == swap at
 pam == [i] map
-pm == [+] [-] cleave popdd
+pm == [+] [-] clop
 popd == [pop] dip
 popdd == [pop] dipd
 popop == pop pop
@@ -48,14 +49,19 @@
 quoted == [unit] dip
 range == [0 <=] [1 - dup] anamorphism
 range_to_zero == unit [down_to_zero] infra
+reverse == [] swap shunt
 rrest == rest rest
 run == [] swap infra
 second == rest first
+shift == uncons [swons] dip
+shunt == [swons] step
 size == 0 swap [pop ++] step
+split_at == [drop] [take] clop
 sqr == dup *
 step_zero == 0 roll> step
 sum == 0 swap [+] step
 swons == swap cons
+take == [] rolldown [shift] times pop
 ternary == binary popd
 third == rest second
 unary == nullary popd
diff -r 7763457c8c8b -r cd6cec038e74 thun/thun.pl
--- a/thun/thun.pl	Wed Aug 07 23:36:38 2019 -0700
+++ b/thun/thun.pl	Fri Aug 09 07:26:37 2019 -0700
@@ -175,6 +175,8 @@
 func(over,        [A, B|S], [B, A, B|S]).
 func(tuck,        [A, B|S], [A, B, A|S]).
 
+func(shift, [[B|A], C|D], [A, [B|C]|D]).
+
 func(rollup, Si, So) :- func(rolldown, So, Si).
 func(uncons, Si, So) :- func(cons, So, Si).
 



More information about the Joypy-announce mailing list
Zurück zum Archiv-Index