[Joypy-announce] joypy/Joypy: unstack, least_fraction

アーカイブの一覧に戻る
scmno****@osdn***** scmno****@osdn*****
Mon Aug 12 11:58:01 JST 2019


changeset fa6d3b3810b8 in joypy/Joypy
details: http://hg.osdn.jp/view/joypy/Joypy?cmd=changeset;node=fa6d3b3810b8
user: Simon Forman <sform****@hushm*****>
date: Sun Aug 11 19:57:28 2019 -0700
description: unstack, least_fraction

diffstat:

 thun/gnu-prolog/defs.txt |  1 +
 thun/gnu-prolog/thun.pl  |  5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r c471ca8421ff -r fa6d3b3810b8 thun/gnu-prolog/defs.txt
--- a/thun/gnu-prolog/defs.txt	Sun Aug 11 19:41:11 2019 -0700
+++ b/thun/gnu-prolog/defs.txt	Sun Aug 11 19:57:28 2019 -0700
@@ -32,6 +32,7 @@
 ii == [dip] dupdip i
 infra == swons swaack [i] dip swaack
 infrst == infra first
+least_fraction == dup [gcd] infra [div] concat map
 make_generator == [codireco] ccons
 neg == 0 swap -
 nullary == [stack] dinfrirst
diff -r c471ca8421ff -r fa6d3b3810b8 thun/gnu-prolog/thun.pl
--- a/thun/gnu-prolog/thun.pl	Sun Aug 11 19:41:11 2019 -0700
+++ b/thun/gnu-prolog/thun.pl	Sun Aug 11 19:57:28 2019 -0700
@@ -82,13 +82,11 @@
 func(swap, [A, B|S],  [B, A|S]).
 func(dup,     [A|S],  [A, A|S]).
 func(pop,     [_|S],        S ).
-
-func(sqrt, [A|S], [B|S]) :- B is sqrt(A).
-
 func(concat, [A, B|S],   [C|S]) :- append(B, A, C).
 func(flatten,   [A|S],   [B|S]) :- flatten(A, B).
 func(swaack,    [R|S],   [S|R]).
 func(stack,        S ,   [S|S]).
+func(unstack,   [S|_],      S ).
 func(clear,        _ ,      []).
 func(first, [[X|_]|S],   [X|S]).
 func(rest,  [[_|X]|S],   [X|S]).
@@ -112,6 +110,7 @@
 
 func(bool, [_|S], [true|S]).
 
+func(sqrt, [A|S], [B|S]) :- B is sqrt(A).
 
 
 /*



More information about the Joypy-announce mailing list
アーカイブの一覧に戻る