aboutsummaryrefslogtreecommitdiff
path: root/examples/working/arraylimits.ey
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2014-03-02 00:23:33 +0100
committerDrahflow <drahflow@gmx.de>2014-03-02 00:23:33 +0100
commit3e15935528f17cbf6c13c0af21992f1e05bdf443 (patch)
treec125fba9941a4d2cefc86f6adf4d036bceea503c /examples/working/arraylimits.ey
parent80011a7059303d878d31a2eeb1c6ca9895ece2bd (diff)
A small example on modifyability
Diffstat (limited to 'examples/working/arraylimits.ey')
-rw-r--r--examples/working/arraylimits.ey17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/working/arraylimits.ey b/examples/working/arraylimits.ey
new file mode 100644
index 0000000..97057a8
--- /dev/null
+++ b/examples/working/arraylimits.ey
@@ -0,0 +1,17 @@
+<
+ "]" | "]]" deffd
+
+ {
+ ]] _ =*a len ==l
+ {
+ _ 0 lt { "index too low" die } rep
+ _ l ge { "index too high" die } rep
+ a
+ }
+ }
+> -- "]" deffd
+
+[ 1 2 3 ] =*a
+
+1 a
+7 a