Please send questions to
st10@humboldt.edu .
b1 := [:name |
(SampledSound soundNamed:
name) play].
b1 value: #croak.
b1 value: #scratch.
b1 value: #chirp.
b1 value: #splash.
b1 value: #coyote.
b1 class. BlockClosure
3 + 2 5
2 + 6 * 6 / 3 16
"example of the Morphics graphics
architecture"
morph := Morph new openInWorld.
morph position: 110@40.
morph extent: 250@80.
morph color: (Color r: 1 g: 0 b: 0).
morph color: (Color r: 1 g: 0 b: 0 alpha: 0.6).
morph delete.
"example of an array in Smalltalk"
my_array := #(1 'dog' #croak 87.6).
my_array. #(1 'dog' #croak 87.6)
my_array at: 1. 1
"looky, array subscripts start at 1..."
my_array at: 3. #croak
my_array at: 2 put: 3.
my_array. #(1 3 #croak 87.6)
my_array at: 5 put: 42. "this gives a subscript-out-of-bounds error"
cars := #('leaf' 'prius' 'volt').
cars at: 2. 'prius'
5 class. SmallInteger
5 class inspect. "classes must respond to an inspect message"
5 class class. SmallInteger class
"Class methods are methods executed on classes"
Date today. 19 April 2011
#croak class. ByteSymbol
'howdy' class. ByteString
true class. True
True class. True class
true class. True