class Object example
The following statements create a simple object with a few properties—some referenced by name and some referenced by number—and a codeblock as a method.
o = new Object()
o.title = "Summer"
o[ 2000 ] = "Sydney"
o[ 1996 ] = "Atlanta"
o.cityInYear = {|y| this[ y ]}
? o.cityInYear( 2000 ) // Displays "Sydney"