That is, if we look at it as all objects and messages, then
"Did this earlier: x := Array new: 20"
x at: 3 put: 123 "this will put 123 into slot 3"
can work only if x at: 3
return like a "cell" object, so the cell can take in an Interger object, which is 123. (or, so that the cell object can let some myContent
property point to the 123 object)
Then in this case, how can
y := (x at: 3) + 567
work? Because how does a cell deal with the +
message? Is it that somehow the cell object thinks it doesn't know how to handle the +
message, so it looks into its content (maybe by something like self myContent
) and then return it? How does it work? I wonder also if there is a Design Pattern name for it.