aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2013-01-23 01:56:25 +0100
committerDrahflow <drahflow@gmx.de>2013-01-23 01:56:25 +0100
commitd7fbde238c596c3f7cbc5471a0efb32481bdf6b8 (patch)
tree988353c9d4dcd64f9f57a93bea60a962f588e04e /examples
parente5b6407246b3fd64014f92e80679274cb1a7bfde (diff)
Thinner scope handling when necessary
Functions without own scope don't unneccesary save the current scope. This makes < > possible. Also: dearray implemented
Diffstat (limited to 'examples')
l---------examples/working-compiler/arraycat.test1
l---------examples/working-compiler/concat.test1
l---------examples/working-compiler/each.test1
l---------examples/working-compiler/fib.test1
l---------examples/working-compiler/fold.test1
l---------examples/working-compiler/hash-set.test1
l---------examples/working-compiler/scope.test1
-rw-r--r--examples/working/each.ey4
-rw-r--r--examples/working/fold.ey8
-rw-r--r--examples/working/hash-set.ey8
10 files changed, 19 insertions, 8 deletions
diff --git a/examples/working-compiler/arraycat.test b/examples/working-compiler/arraycat.test
new file mode 120000
index 0000000..250dcdd
--- /dev/null
+++ b/examples/working-compiler/arraycat.test
@@ -0,0 +1 @@
+../working/arraycat.ey \ No newline at end of file
diff --git a/examples/working-compiler/concat.test b/examples/working-compiler/concat.test
new file mode 120000
index 0000000..b65356c
--- /dev/null
+++ b/examples/working-compiler/concat.test
@@ -0,0 +1 @@
+../working/concat.ey \ No newline at end of file
diff --git a/examples/working-compiler/each.test b/examples/working-compiler/each.test
new file mode 120000
index 0000000..95ed5d2
--- /dev/null
+++ b/examples/working-compiler/each.test
@@ -0,0 +1 @@
+../working/each.ey \ No newline at end of file
diff --git a/examples/working-compiler/fib.test b/examples/working-compiler/fib.test
new file mode 120000
index 0000000..f4d924e
--- /dev/null
+++ b/examples/working-compiler/fib.test
@@ -0,0 +1 @@
+../working/fib.ey \ No newline at end of file
diff --git a/examples/working-compiler/fold.test b/examples/working-compiler/fold.test
new file mode 120000
index 0000000..13cc7fd
--- /dev/null
+++ b/examples/working-compiler/fold.test
@@ -0,0 +1 @@
+../working/fold.ey \ No newline at end of file
diff --git a/examples/working-compiler/hash-set.test b/examples/working-compiler/hash-set.test
new file mode 120000
index 0000000..0efdd80
--- /dev/null
+++ b/examples/working-compiler/hash-set.test
@@ -0,0 +1 @@
+../working/hash-set.ey \ No newline at end of file
diff --git a/examples/working-compiler/scope.test b/examples/working-compiler/scope.test
new file mode 120000
index 0000000..3fc0fb0
--- /dev/null
+++ b/examples/working-compiler/scope.test
@@ -0,0 +1 @@
+../working/scope.ey \ No newline at end of file
diff --git a/examples/working/each.ey b/examples/working/each.ey
index 0e59bc9..54b0323 100644
--- a/examples/working/each.ey
+++ b/examples/working/each.ey
@@ -1 +1,3 @@
-[ 1 2 3 ] { =i i dump } each
+|defv "==" deff
+
+[ 1 2 3 ] { ==i i dump } each
diff --git a/examples/working/fold.ey b/examples/working/fold.ey
index 9ae19d5..d3b20ce 100644
--- a/examples/working/fold.ey
+++ b/examples/working/fold.ey
@@ -1,4 +1,6 @@
-{ =f =a a len =l
+|defv "==" deff
+
+{ ==f ==a a len ==l
l {
0 a *
1 l 1 sub range { a * f * } each
@@ -6,9 +8,9 @@
? *
} /fold deff
-{ =f _ len =l l dearray l 1 sub f rep } /foldshort deff
+{ ==f _ len ==l l dearray l 1 sub f rep } /foldshort deff
-{ =f { f fold } } /enfold deff
+{ ==f { f fold } } /enfold deff
[ 1 2 3 ]
_ |add fold dump
diff --git a/examples/working/hash-set.ey b/examples/working/hash-set.ey
index 495c27f..046e42b 100644
--- a/examples/working/hash-set.ey
+++ b/examples/working/hash-set.ey
@@ -1,4 +1,4 @@
-< { defv }' /put deff > =hashSet
+< { defv }' /put deff > /hashSet defv
1 /one hashSet .put
2 /two hashSet .put
@@ -8,12 +8,12 @@ hashSet .two dump
hashSet keys dump
{
- < { defv }' /put deff > =hashSetB
+ < { defv }' /put deff > /hashSetB defv
1 /one hashSetB .put
2 /two hashSetB .put
hashSetB .one dump
hashSetB .two dump
- hashSetB keys dump
-} *
+ hashSetB
+} * keys dump