summaryrefslogtreecommitdiff
path: root/chapter28b/src/test/smp/lazy/App
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-10-24 15:31:01 -0700
committerCliff Click <cliffc@acm.org>2026-10-24 15:31:01 -0700
commitfeb98e1bb6c973428b94591ed5b0aed5e4137bd0 (patch)
treeee104333658a452590546c483fda1cae315ce134 /chapter28b/src/test/smp/lazy/App
parente2b042bd9721995486f4f0cf96847c02d27908e3 (diff)
downloadSimple-feb98e1bb6c973428b94591ed5b0aed5e4137bd0.tar.gz
Simple-feb98e1bb6c973428b94591ed5b0aed5e4137bd0.zip
Finish separate compilation snapshot in chapter 28b
Diffstat (limited to 'chapter28b/src/test/smp/lazy/App')
-rw-r--r--chapter28b/src/test/smp/lazy/App/Main.smp1
-rw-r--r--chapter28b/src/test/smp/lazy/App/Stats.smp1
-rw-r--r--chapter28b/src/test/smp/lazy/App/Tables.smp4
3 files changed, 6 insertions, 0 deletions
diff --git a/chapter28b/src/test/smp/lazy/App/Main.smp b/chapter28b/src/test/smp/lazy/App/Main.smp
new file mode 100644
index 00000000..2444f21b
--- /dev/null
+++ b/chapter28b/src/test/smp/lazy/App/Main.smp
@@ -0,0 +1 @@
+return arg ? Tables.square(3)+Tables.square(4)+100*Stats.builds : Stats.builds;
diff --git a/chapter28b/src/test/smp/lazy/App/Stats.smp b/chapter28b/src/test/smp/lazy/App/Stats.smp
new file mode 100644
index 00000000..e2d9e02e
--- /dev/null
+++ b/chapter28b/src/test/smp/lazy/App/Stats.smp
@@ -0,0 +1 @@
+int builds=0;
diff --git a/chapter28b/src/test/smp/lazy/App/Tables.smp b/chapter28b/src/test/smp/lazy/App/Tables.smp
new file mode 100644
index 00000000..0f32a118
--- /dev/null
+++ b/chapter28b/src/test/smp/lazy/App/Tables.smp
@@ -0,0 +1,4 @@
+Stats.builds++;
+int[] _squares=new int[256];
+for(int i=0; i<256; i++) _squares[i]=i*i;
+val square={u8 n -> _squares[n];};