diff options
Diffstat (limited to 'docs/2026_REBASE/demos/methods.smp')
| -rw-r--r-- | docs/2026_REBASE/demos/methods.smp | 11 |
1 files changed, 11 insertions, 0 deletions
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(); |
