| a strm | strm := WriteStream with: (String new: 100). a := Array new: 10. a at: 1 put: 'fee fi fo fum'. a at: 2 put: 3.14159. a at: 3 put: 8. (a at: 2) printOn: strm. strm contents
Object subclass: #Octopus instanceVariableNames: 'myblock' classVariableNames: '' poolDictionaries: '' setValue: x myblock := [x]. setBlock: y myblock := y. getValue ^ myblock valueWhat is the result of evaluating the following code? (The value in each case will be the value of the last o getValue expression.)
| o a | a := 3. o := Octopus new. o setValue: a. a := a+1. o getValueAnd what about this code?
| o a b | a := 3. b := [a]. o := Octopus new. o setBlock: b. a := a+1. o getValue