filter-out instead of filter

Norman Feske norman.feske at genode-labs.com
Tue Jul 3 15:07:45 CEST 2018


Hello Guido,

> $(filter-out ...)
...
> But it goes against the manual of make [1] where the first param is
> the pattern X and the second is the string 'text' to look up the
> string X.

the relevant part of the documentation is:

  "Returns all whitespace-separated words in text that do not match any
   of the pattern words, removing the words that do match one or more."

Note that both arguments may be lists of words.

The use of 'filter-out' has the advantage that the pattern doesn't need
to be repeated, which would otherwise produce possible inconsistencies
during later maintenance steps (e.g., when changing the pattern).

> I've grepped the code and I found the idiom:
>     'ifeq (filter-out $SPECS, X),)'

Here, 'X' appears once.

> I wonder why the code is not:
>     'ifeq (filter (X,$(SPECS)),X)'

Here, 'X' appears twice.

Cheers
Norman

-- 
Dr.-Ing. Norman Feske
Genode Labs

https://www.genode-labs.com · https://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth



More information about the users mailing list