[etoys-dev] SQ-903 - Object displayed name does not always match name used to refer to object in scripts
Ricardo Moran
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
> wrote:
> 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
Cheers,
Richo
> _______________________________________________
> etoys-dev mailing list
> etoys-dev at squeakland.org
> http://lists.squeakland.org/mailman/listinfo/etoys-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakland.org/pipermail/etoys-dev/attachments/20110326/290ea069/attachment.html>
More information about the etoys-dev
mailing list