[etoys-dev] SQ-903 - Object displayed name does not always match name used to refer to object in scripts
richi.moran at gmail.com
Sat Mar 26 14:01:34 EDT 2011
On Sat, Mar 26, 2011 at 7:16 AM, Scott Wallace <scott.wallace at squeakland.org
> On Mar 26, 2011, at 3:10 AM, Scott Wallace wrote:
> > foundPlayer := ActiveWorld presenter reallyAllExtantPlayersNoSort
> > detect: [:p |(p costume externalName = 'Cat') and: [p
> costume isInWorld])]
> > ifNone: [nil].
> > foundPlayer ifNotNil:
> > [ <proceed to do something to or with foundPlayer...> ]
> Oops, left an extra right-paren in there by mistake. The correct code
> would be:
> foundPlayer := ActiveWorld presenter reallyAllExtantPlayersNoSort
> detect: [:p |(p costume externalName = 'Cat') and: [p
> costume isInWorld]]
> ifNone: [nil].
> foundPlayer ifNotNil:
> [ <proceed to do something to or with foundPlayer...> ]
Wouldn't that be equivalent to my script?
(World findDeepSubmorphThat: [:each | each player externalName = aString]
ifAbsent: ) player
> etoys-dev mailing list
> etoys-dev at squeakland.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the etoys-dev