On Sat, Mar 26, 2011 at 7:16 AM, Scott Wallace <scott.wallace@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@squeakland.org
http://lists.squeakland.org/mailman/listinfo/etoys-dev