• R/O
  • SSH

Joypy: Commit

Main interpreter and library.


Commit MetaInfo

Revisionfa6d3b3810b818b5fe140d9d76294f9c9136cc25 (tree)
Time2019-08-12 11:57:28
AuthorSimon Forman <sforman@hush...>
CommiterSimon Forman

Log Message

unstack, least_fraction

Change Summary

Incremental Difference

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 @@
3232 ii == [dip] dupdip i
3333 infra == swons swaack [i] dip swaack
3434 infrst == infra first
35+least_fraction == dup [gcd] infra [div] concat map
3536 make_generator == [codireco] ccons
3637 neg == 0 swap -
3738 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 @@
8282 func(swap, [A, B|S], [B, A|S]).
8383 func(dup, [A|S], [A, A|S]).
8484 func(pop, [_|S], S ).
85-
86-func(sqrt, [A|S], [B|S]) :- B is sqrt(A).
87-
8885 func(concat, [A, B|S], [C|S]) :- append(B, A, C).
8986 func(flatten, [A|S], [B|S]) :- flatten(A, B).
9087 func(swaack, [R|S], [S|R]).
9188 func(stack, S , [S|S]).
89+func(unstack, [S|_], S ).
9290 func(clear, _ , []).
9391 func(first, [[X|_]|S], [X|S]).
9492 func(rest, [[_|X]|S], [X|S]).
@@ -112,6 +110,7 @@
112110
113111 func(bool, [_|S], [true|S]).
114112
113+func(sqrt, [A|S], [B|S]) :- B is sqrt(A).
115114
116115
117116 /*
Show on old repository browser