help-make
[Top][All Lists]
Advanced

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

Re: temporary function variables in user defined make functions notblan


From: Noel Yap
Subject: Re: temporary function variables in user defined make functions notblanked out
Date: Tue, 11 Nov 2003 12:23:13 -0500

Great.

Just so that it's in the archives, the workaround I'm using is to wrap the 
implementation of the function with an interface function that explicitly 
blanks out the variable:

# reverse list
# $(1) is the space-separated-list
# $(2) is the temporary storage for the result
define _reverse-list
  $(if $(strip $(1)), \
    $(call _reverse-list,$(call pop-front,$(1)),$(firstword $(1)) $(2)), \
    $(2))
endef

# reverse list
# $(1) is the space-separated-list
reverse-list = $(call _reverse-list,$(1),)

Thanks,
Noel
"Paul D. Smith" wrote:
> 
> If this is what I think it is then it's an undocumented feature (in that
> I knew about it before the release), but it has been changed to work "as
> you'd expect" (where arguments are blanked before being passed to
> recursive invocations of call) in CVS for the next release, and
> documented to work this way.
> 
> --
> -------------------------------------------------------------------------------
>  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

-- 
NOTICE: If received in error, please destroy and notify sender.  Sender does 
not waive confidentiality or privilege, and use is prohibited.




reply via email to

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