Smart Do

Francisco Garau francisco.garau at gmail.com
Fri Nov 3 00:50:22 UTC 2006


The following version of do works in a slighltly smarter way. It's a more
generic version of #pairsDo:

 #( 1 2 3 ) smartDo: [:a | Transcript cr; show: a]
 #( 1 1 2 2 3 3 ) smartDo: [:a :b | Transcript cr; show: a + b]
 #( 1 1 1 2 2 2 3 3 3 ) smartDo: [:a :b :c | Transcript cr; show: a + b + c]

I'm attaching a ChangeSet with the implementation. (Is this the best to
contribute things? or should I package it in some other format?)

Cheers,
Francisco
---
That which we call a rose by another name would smell as sweet -- WS
--- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SmartDo.3.cs
Type: application/octet-stream
Size: 799 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20061103/2ec9aee5/SmartDo.3.obj


More information about the Squeak-dev mailing list