Either way it seems logical to implement it using Sets, or at least
extract the core uniquification logic and share it with Set.

So what do/should these methods do if passed a function of indeterminate arity?




On 9/8/08, Moritz Lenz <[EMAIL PROTECTED]> wrote:
> Damian Conway wrote:
>> Moritz Lenz wrote:
>>
>>> There are some tests for List.uniq in the test suite, and pugs
>>> implements it, but it's not in S29.
>>> Damian seems to have though we should have it.
>>> So should we have it?
>>
>> I still think we should. If only because I've seen it re-(mis)-implemented
>> so
>> many times.
>>
>> I'd also suggest that it have the same interface as .sort. Namely that you
>> can
>> pass a block to specify either a unary key-extractor or a binary
>> comparator
>> function.
>
> I like the idea with an unary function, but I have my doubts with the
> two arg comparison function, because it implies O(n²) runtime. But then
> again if the user needs that, he'd have to implement it in O(n²) anyway...
>
> Moritz
>
> --
> Moritz Lenz
> http://moritz.faui2k3.org/ |  http://perl-6.de/
>

-- 
Sent from Gmail for mobile | mobile.google.com

Mark J. Reed <[EMAIL PROTECTED]>

Reply via email to