summaryrefslogtreecommitdiff
path: root/Slices/slices.b
diff options
context:
space:
mode:
Diffstat (limited to 'Slices/slices.b')
-rw-r--r--Slices/slices.b31
1 files changed, 31 insertions, 0 deletions
diff --git a/Slices/slices.b b/Slices/slices.b
new file mode 100644
index 0000000..5f9db96
--- /dev/null
+++ b/Slices/slices.b
@@ -0,0 +1,31 @@
+implement Slices;
+
+include "sys.m";
+include "draw.m";
+
+sys: Sys;
+print: import sys;
+
+Slices: module {
+ init: fn(nil: ref Draw->Context, nil: list of string);
+};
+
+init(nil: ref Draw->Context, nil: list of string) {
+ sys = load Sys Sys->PATH;
+
+ str := "little_baby_ducks";
+ print("%s\n", str);
+
+ n := 3;
+
+ a := str[:n];
+ print("%s\n", a);
+
+ b := str[4:];
+ print("%s\n", b);
+
+ c := array of byte str[2:len str -1];
+ print("%s\n", string c[4:8]);
+
+ exit;
+}