From 77885036c182f8a3f93249e1cf23c33b0e6c43d7 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sat, 7 Dec 2024 11:17:01 +0000 Subject: [PATCH] doc: add lambdas to sample file --- doc/sample/Expressions.im | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/sample/Expressions.im b/doc/sample/Expressions.im index 92b2cd3..6826701 100644 --- a/doc/sample/Expressions.im +++ b/doc/sample/Expressions.im @@ -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 \ No newline at end of file +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').