On 01/09/2013 11:18 AM, Frank Church wrote: > > When I print it returns an empty array #(), but I expect to get subset > of TextMorphForEditView allInstances. > > What is the likely purpose of the notNil? > > -- > Frank Church
The #firstOwnerSuchThat: method either returns the morph that meets the criteria specified in the block sent to it (in this instance that the owner is a SystemWindow and its model is a Workspace) or nil. The #select: block needs the code inside it to return a boolean, so the #notNil converts the response from the #firstOwnerSuchThat: method into a boolean rather than leaving it as either nil or the morph. If you right click on a method and choose Implementors you can see how each class that implements the method defines it. You can also right click the method and choose Senders to see examples of how the method is used.
