doc: add lambdas to sample file

This commit is contained in:
2024-12-07 11:17:01 +00:00
parent d404e21b33
commit 77885036c1

View File

@@ -112,7 +112,8 @@ class Person
$ exampleProperty | get => self::val, set => self::val = value.
$ exampleProperty2 |
get => self::val.
get => [ ^self::val ],
set => [ :x | self::val = x ].
$ exampleProperty3 | get => 42.
@@ -120,3 +121,14 @@ class Person
$ exampleProperty5 (get)
end
j = [ cout put:'Hello!' ].
k = [ :x :y | cout put:'Hello, {x}, {y}!' ].
x > 2
if:[ cout put:'True' ]
else:[ cout put: 'False' ].
0 to:100 step:2 do:[ :i | cout put:'Count: {i}' ].
p1 test(param:'Hello' :'World').