From b6bfdd0fd1da3f33e17ba7cedec317f94fa0a4f2 Mon Sep 17 00:00:00 2001 From: Max Wash Date: Wed, 26 Mar 2025 22:27:06 +0000 Subject: [PATCH] doc: adjust package messages; add more sample code --- doc/sample/Expressions.im | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/sample/Expressions.im b/doc/sample/Expressions.im index 4a50272..5e7bf01 100644 --- a/doc/sample/Expressions.im +++ b/doc/sample/Expressions.im @@ -142,7 +142,7 @@ pkg = { { 0 }, { 1 }, { y for y in huh } }. pkg = { x multiplyBy:2 for x in wow if x > 2 }. pkg->x = 32. -K = (1 multiplyBy:2, 4). +k = (1 multiplyBy:2, 4). for (x, y) in pkg do cout put:'{x}: {y}' @@ -153,8 +153,22 @@ pkg[0] = 16. /* All of these accesses are equivalent */ pkg['x'] = 32. pkg->x = 32. -pkg put:32 at:'x'. +pkg at:'x' put:32. + +v = pkg['x']. +v = pkg->x. +v = pkg at:'x'. + +pkg2 = { + onEnter => [ + cout put:'start!' + ], + + onExit => [ + cout put:'end!' + ] +}. index = 'x'. pkg[index] = 32. -pkg put:32 at:index. \ No newline at end of file +pkg at:index put:32.