help-make
[Top][All Lists]
Advanced

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

Re: what would/should "VAR -= <text>" correspond to?


From: Paul D. Smith
Subject: Re: what would/should "VAR -= <text>" correspond to?
Date: Fri, 11 Mar 2005 14:53:50 -0500

%% "Robert P. J. Day" <address@hidden> writes:

  rpjd> i just ran across a situation where it would have been
  rpjd> enormously handy to be able to quickly remove arbitrary items
  rpjd> from a list of items.

  rpjd> in the same way that variables support the operations

  rpjd>         VAR = fred barney
  rpjd>         VAR += wilma betty

  rpjd> it would have been nice to be able to do:

  rpjd>         VAR -= wilma bambam

  rpjd> the semantics being to remove (a la "filter-out") an arbitrary
  rpjd> set of matching strings.  if an item is not a word in the
  rpjd> string, then nothing happens.  no harm, no foul, with the result
  rpjd> of the above being that

  rpjd>         VAR = fred barney betty

  rpjd> i realize i can get the same effect by, say, writing a macro
  rpjd> involving "filter-out", but is there a reason the above couldn't
  rpjd> be done?

Why do you need a macro?  Just write it; that's what filter-out is for:

    VAR := $(filter-out wilma bambam,$(VAR))

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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