diff options
| author | Cliff Click <cliffc@acm.org> | 2026-10-04 13:30:41 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-10-04 13:30:41 -0700 |
| commit | a4994371c0b0fbea9d2802acc22d9cc3977a0de0 (patch) | |
| tree | 98fd05869028a931f5ec8cf503b5cdf6b6c52e87 /docs/2026_REBASE/demos/methods.smp | |
| parent | 9149ea7a50c564856bd09633f38d980e8230c34f (diff) | |
| download | Simple-a4994371c0b0fbea9d2802acc22d9cc3977a0de0.tar.gz Simple-a4994371c0b0fbea9d2802acc22d9cc3977a0de0.zip | |
Slides for 2026 REBASEreadme
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(); |
