help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: func to remove dupes


From: Stephan Beal
Subject: Re: func to remove dupes
Date: Thu, 28 Jun 2007 15:39:53 +0200
User-agent: KMail/1.9.7

On Thursday 28 June 2007, John Graham-Cumming wrote:
> You could always use the function 'uniq' which is in my GMSL.  Here's
> the definition:
>
> uniq = $(if $1,$(call uniq,$(call chop,$1)) $(if $(filter $(call
> last,$1),$(call chop,$1)),,$(call last,$1)))

The list's Christoph Schulz sent a nice implementation which uses fewer 
$(call)s:

remove-dupes = $(if $1,$(strip $(word 1,$1) $(call $0,$(filter-out 
$(word 1,$1),$1))))

Pretty elegant, IMO :).

(In any case, both yours and Christoph's implementations are far more 
elegant than mine!)

-- 
----- stephan beal
http://www.wanderinghorse.net

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]