Code question.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Code question.

Blake-5
I was reading Stephen Wessals morphic tutorial and came across this:

self activeSegments values anySatisfy: [:each | each = true]

which I thought was odd, and so I first replaced it with:

self activeSegments values anySatisfy: [:each | each = true]

and then just:

self activeSegments includes: true

I think this should be fine since Dictionary's "do" operates on values  
anyway, right?

Or am I missing something?
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Code question.

Tapple Gao
On Thu, Jul 05, 2007 at 04:28:49PM -0700, Blake wrote:
> I was reading Stephen Wessals morphic tutorial and came across this:
>
> self activeSegments values anySatisfy: [:each | each = true]
>
> which I thought was odd, and so I first replaced it with:
>
> self activeSegments values anySatisfy: [:each | each = true]

I assume you meant
self activeSegments anySatisfy: [:each | each = true]

> and then just:
>
> self activeSegments includes: true
>
> I think this should be fine since Dictionary's "do" operates on values  
> anyway, right?
>
> Or am I missing something?

Sounds right to me

--
Matthew Fulmer -- http://mtfulmer.wordpress.com/
Help improve Squeak Documentation: http://wiki.squeak.org/squeak/808
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Code question.

Blake-5
On Thu, 05 Jul 2007 16:54:22 -0700, Matthew Fulmer <[hidden email]>  
wrote:

> On Thu, Jul 05, 2007 at 04:28:49PM -0700, Blake wrote:
>> I was reading Stephen Wessals morphic tutorial and came across this:
>>
>> self activeSegments values anySatisfy: [:each | each = true]
>>
>> which I thought was odd, and so I first replaced it with:
>>
>> self activeSegments values anySatisfy: [:each | each = true]
>
> I assume you meant
> self activeSegments anySatisfy: [:each | each = true]

Newp. "values" is in there:  
http://squeak.preeminent.org/tut2007/html/020.html

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners