Last active 1 month ago

capitalex's Avatar capitalex revised this gist 1 month ago. Go to revision

1 file changed, 4 insertions, 35 deletions

tak.wul

@@ -1,13 +1,14 @@
1 +
1 2 { @ewe ( 8 4 7 tak @ewe.call ) }
2 3
3 4 @ewe def tak ; @ewe.stack ~( $x $y $z ) {
4 5 @ewe (
5 6 $x $y $z
6 - $y $x @ewe.lt @ewe.not [tak-true] [tak-false] @ewe.if
7 + $y $x @ewe.lt @ewe.not tak.true tak.false @ewe.if
7 8 )
8 9 }
9 10
10 - @ewe def [tak-true] ; @ewe.stack ~( $x $y $z ) {
11 + @ewe def tak.true ; @ewe.stack ~( $x $y $z ) {
11 12 @ewe (
12 13 $x 1 @ewe.sub $y $z tak @ewe.call
13 14 $y 1 @ewe.sub $z $x tak @ewe.call
@@ -16,39 +17,7 @@
16 17 )
17 18 }
18 19
19 - @ewe def [tak-false] ; @ewe.stack ~( $x $y $z ) {
20 + @ewe def tak.false ; @ewe.stack ~( $x $y $z ) {
20 21 @ewe $z
21 22 }
22 23
23 - @ewe @ewe.dup ; @ewe.stack $ {
24 - @ewe.stack ( $ $ )
25 - }
26 -
27 - @ewe @ewe.swap ; @ewe.stack ( $x $y ) {
28 - @ewe.stack ( $y $x )
29 - }
30 -
31 - @ewe @ewe.call ; @ewe.stack $fn {
32 - @ewe def $fn ;
33 - }
34 -
35 - @ewe @ewe.if ; @ewe.stack ( $true $ true ) {
36 - @ewe def $true
37 - }
38 -
39 - @ewe @ewe.if ; @ewe.stack ( $ $false false ) {
40 - @ewe def $false
41 - }
42 -
43 - @ewe @ewe.lt ; @ewe.stack ~( $x $y ) {
44 - @ewe.stack $z ; @code [$z = tostring(tonumber($x) < tonumber($y))]
45 - }
46 -
47 - @ewe @ewe.not ; @ewe.stack true { @ewe.stack false }
48 - @ewe @ewe.not ; @ewe.stack false { @ewe.stack true }
49 -
50 - @ewe @ewe.sub ; @ewe.stack ~( $x $y ) {
51 - @ewe.stack $z ; @code [$z = tostring($x - $y)]
52 - }
53 -
54 - @ewe ( $x ) { @ewe.stack $x }

capitalex's Avatar capitalex revised this gist 1 month ago. Go to revision

1 file changed, 54 insertions

tak.wul(file created)

@@ -0,0 +1,54 @@
1 + { @ewe ( 8 4 7 tak @ewe.call ) }
2 +
3 + @ewe def tak ; @ewe.stack ~( $x $y $z ) {
4 + @ewe (
5 + $x $y $z
6 + $y $x @ewe.lt @ewe.not [tak-true] [tak-false] @ewe.if
7 + )
8 + }
9 +
10 + @ewe def [tak-true] ; @ewe.stack ~( $x $y $z ) {
11 + @ewe (
12 + $x 1 @ewe.sub $y $z tak @ewe.call
13 + $y 1 @ewe.sub $z $x tak @ewe.call
14 + $z 1 @ewe.sub $x $y tak @ewe.call
15 + tak @ewe.call
16 + )
17 + }
18 +
19 + @ewe def [tak-false] ; @ewe.stack ~( $x $y $z ) {
20 + @ewe $z
21 + }
22 +
23 + @ewe @ewe.dup ; @ewe.stack $ {
24 + @ewe.stack ( $ $ )
25 + }
26 +
27 + @ewe @ewe.swap ; @ewe.stack ( $x $y ) {
28 + @ewe.stack ( $y $x )
29 + }
30 +
31 + @ewe @ewe.call ; @ewe.stack $fn {
32 + @ewe def $fn ;
33 + }
34 +
35 + @ewe @ewe.if ; @ewe.stack ( $true $ true ) {
36 + @ewe def $true
37 + }
38 +
39 + @ewe @ewe.if ; @ewe.stack ( $ $false false ) {
40 + @ewe def $false
41 + }
42 +
43 + @ewe @ewe.lt ; @ewe.stack ~( $x $y ) {
44 + @ewe.stack $z ; @code [$z = tostring(tonumber($x) < tonumber($y))]
45 + }
46 +
47 + @ewe @ewe.not ; @ewe.stack true { @ewe.stack false }
48 + @ewe @ewe.not ; @ewe.stack false { @ewe.stack true }
49 +
50 + @ewe @ewe.sub ; @ewe.stack ~( $x $y ) {
51 + @ewe.stack $z ; @code [$z = tostring($x - $y)]
52 + }
53 +
54 + @ewe ( $x ) { @ewe.stack $x }
Newer Older