summaryrefslogtreecommitdiff
path: root/chapter31/src/main/smp/sys/text.smp
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-11-13 16:17:13 -0800
committerCliff Click <cliffc@acm.org>2026-11-13 16:17:13 -0800
commitafcf96444366fb4b7c83f938763013cbc360aade (patch)
tree67eb69ac6cc58322549020550d48aceb8f2f5ff8 /chapter31/src/main/smp/sys/text.smp
parentd2c59dbe9d6cc8dc4ff4d1e7949bfeddd8bef5d0 (diff)
downloadSimple-afcf96444366fb4b7c83f938763013cbc360aade.tar.gz
Simple-afcf96444366fb4b7c83f938763013cbc360aade.zip
Array init syntax
New array init syntax; used in a bunch of places. Allows e.g. read-only arrays with not-null entries. Fix bug x86 encoding of mem/cmp/fp compares
Diffstat (limited to 'chapter31/src/main/smp/sys/text.smp')
-rw-r--r--chapter31/src/main/smp/sys/text.smp5
1 files changed, 1 insertions, 4 deletions
diff --git a/chapter31/src/main/smp/sys/text.smp b/chapter31/src/main/smp/sys/text.smp
index a28edf6d..2c4b44ff 100644
--- a/chapter31/src/main/smp/sys/text.smp
+++ b/chapter31/src/main/smp/sys/text.smp
@@ -5,10 +5,7 @@
val begin = { -> new aryu8(); };
val end = { aryu8 b ->
- val bytes = new u8[b.len];
- ary.copy(bytes,0,b.buf,0,b.len);
- u8[~] result = bytes;
- result;
+ new u8[~b.len]{ i64 i -> b.buf[i]; };
};
val _pad = { !aryu8 b, i64 n, u8 c ->