From a4994371c0b0fbea9d2802acc22d9cc3977a0de0 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 4 Oct 2026 13:30:41 -0700 Subject: Slides for 2026 REBASE --- docs/2026_REBASE/demos/methods.smp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docs/2026_REBASE/demos/methods.smp (limited to 'docs/2026_REBASE/demos/methods.smp') diff --git a/docs/2026_REBASE/demos/methods.smp b/docs/2026_REBASE/demos/methods.smp new file mode 100644 index 00000000..683540c3 --- /dev/null +++ b/docs/2026_REBASE/demos/methods.smp @@ -0,0 +1,11 @@ +struct Counter { + int n; + val add = { int delta -> + n += delta; + return self; + }; + val get = { -> return n; }; +}; +!Counter c = new Counter { n = arg; }; +c.add(3).add(4); +return c.get(); -- cgit v1.2.3