doc: add lambdas to sample file
This commit is contained in:
@@ -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').
|
||||
|
||||
Reference in New Issue
Block a user