doc: add lambdas to sample file
This commit is contained in:
@@ -108,15 +108,27 @@ class Person
|
|||||||
#days => self::age / 365,
|
#days => self::age / 365,
|
||||||
_ => 0
|
_ => 0
|
||||||
end!
|
end!
|
||||||
|
|
||||||
$ exampleProperty | get => self::val, set => self::val = value.
|
$ exampleProperty | get => self::val, set => self::val = value.
|
||||||
|
|
||||||
$ exampleProperty2 |
|
$ exampleProperty2 |
|
||||||
get => self::val.
|
get => [ ^self::val ],
|
||||||
|
set => [ :x | self::val = x ].
|
||||||
|
|
||||||
$ exampleProperty3 | get => 42.
|
$ exampleProperty3 | get => 42.
|
||||||
|
|
||||||
$ exampleProperty4 (get, set)
|
$ exampleProperty4 (get, set)
|
||||||
|
|
||||||
$ exampleProperty5 (get)
|
$ 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').
|
||||||
|
|||||||
Reference in New Issue
Block a user