var y = 1 + 2 * 3 / 4 * 5 - 6 + 7 multiplyBy:2. var z = w = 2 + 3 multiplyBy:2. var x = (((1 + 2 * 3) multiplyBy:3) add: 5) + 2. x = ((1 + 2 * 3) multiplyBy:3). var p = 5 multiply(by:3 add:(2 + 1)). var q = 10 squared squared. p1 setAge:2 squared squared + 4 squared multiply(by:2 add:4 + 1 * 3) in:"mon" + "ths". var m = xz multiply(by:3 add:2) squared. m = xz multiply(by:3 add:2); squared. var x = OrderedCollection new add: 2; add: 4; add: 6; yourself. var age = Person new(name:"John Doe" age:34) setAge:144 inUnit:"months"; ageInMonths. x = 5. var q = 10 if x > 2 else 20. q = if x > 2 then 10 else 20 end. cout put:5 multiply(by:5 add:2) if x > 2. if x > 2 then cout put:"Greater" else cout put:"Less" end var q = match yz in 1 => age = age, 2 => age = age / 12, 3 => age = age / 365, _ => age = 0 end. while x > 2 do cout put:"message" end for i in 0 to:100 step:2 do cout put:'Count is {i}' end cout put:"message" while x > 2. cout put:'Count is {i}' for i in 0 to:100 step:2. var z = do var x = 1. var y = 2. ^x + y end. var j = [ cout put:'Hello!' ]. var 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'). var pkg = {}. pkg = { 0 }. pkg = { 1, 2, 3, 4, 5 }. pkg = { 10, 2 => "Hello", 9, 5 => "World", 14 }. 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). for (x, y) in pkg do cout put:'{x}: {y}' end pkg[0] = 16. /* All of these accesses are equivalent */ pkg['x'] = 32. pkg->x = 32. pkg at:'x' put:32. var v = pkg['x']. v = pkg->x. v = pkg at:'x'. var pkg2 = { onEnter => [ cout put:'start!' ], onExit => [ cout put:'end!' ] }. var index = 'x'. pkg[index] = 32. pkg at:index put:32.