summaryrefslogtreecommitdiff
path: root/test.pez
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-10-10 11:09:00 +0200
committerlemon <lsof@mailbox.org>2022-10-10 11:09:00 +0200
commit124972dd5216da7935cf3a928bf6d94e4d6ce833 (patch)
tree465e9a2e5a0e046359e03aaf12efab572fc6713c /test.pez
parentcfb9a64a40016f71370433f9220b9d3ce0d735d8 (diff)
dilambdas and such
Diffstat (limited to 'test.pez')
-rw-r--r--test.pez40
1 files changed, 24 insertions, 16 deletions
diff --git a/test.pez b/test.pez
index 118be00..d01ea10 100644
--- a/test.pez
+++ b/test.pez
@@ -1,21 +1,29 @@
-@print: {[x] printf["%a\n", x]}
-
@Box: {[value]
- @it = 0
- (
- @test = 7
- @h2 = 100
- it = #[{value},
- {[new] printf["test: %a\n", test] value = new}]
- )
- (
- @hmm = 999
- )
- it
+ dilambda[
+ { value },
+ {[new] value = new }
+ ]
}
+@Array2d: {[w, h]
+ @data: array#fill[w * h, 0]
+ @w = w
+ dilambda[
+ {[x, y] data[x + (y * w)] },
+ {[x, y, new] data[x + (y * w)] = new }
+ ]
+}
+@print: {[x] printf["x -> %a\n", x] }
@x = Box[-7]
-print[x[0][]]
-x[1]['awesome]
-print[x[0][]]
+x[] *= 2
+print[x[]]
+x[] = 'abcdef
+print[x[]]
+
+@m: Array2d[10, 10]
+FOR [@x: 0][< 10][+ 1]
+ FOR [@y: 0][< 10][+ 1]
+ m[x, y] = x ^ y
+
+printf["%a == %a\n", m[3,7], 3^7]