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

@@ -108,15 +108,27 @@ class Person
#days => self::age / 365,
_ => 0
end!
$ exampleProperty | get => self::val, set => self::val = value.
$ exampleProperty | get => self::val, set => self::val = value.
$ exampleProperty2 |
get => self::val.
get => [ ^self::val ],
set => [ :x | self::val = x ].
$ exampleProperty3 | get => 42.
$ exampleProperty4 (get, set)
$ exampleProperty5 (get)
end
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').