[Squeak] Newbie permutations

Brian T. Rice water at tunes.org
Wed Apr 10 02:28:22 UTC 2002


The compromise is to introduce a way to pipe out permutations one at a 
time onto a stream, maybe permutationsOnStream: and have the stream pull 
them as necessary, probably at the request of the stream-consumer.

~

On Tuesday, April 9, 2002, at 07:15 PM, Andrew C. Greenberg wrote:

> Could be.  On the other hand, the utility of #permutations is entirely 
> unclear to me.  Even for small collections, the number of permutations 
> gathered rate to be fairly large.
>
> On Tuesday, April 9, 2002, at 06:48 PM, Bijan Parsia wrote:
>
>> On Tue, 9 Apr 2002, Andrew C. Greenberg wrote:
>>
>>> It is an implementation concern that should probably be documented.  I
>>> imagine it was done this way because it would be inefficient for
>>> applications where copies are not required to have the method make
>>> copies in each instance.
>>
>> Given that the selector is #permutationsDo:, it's perhaps worth 
>> having a
>> separate method, #permutations, which would produce a collection of the
>> distinct permuations. Then idioms like foo permutations select:...et al
>> would work as expected.
>>
>> Cheers,
>> Bijan Parsia.
>




More information about the Squeak-dev mailing list