help-make
[Top][All Lists]
Advanced

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

RE: why does blank have to be deferred when eval'd?


From: Mark Galeck (CW)
Subject: RE: why does blank have to be deferred when eval'd?
Date: Sun, 18 Sep 2011 16:04:08 -0700

OK, I understand! What I did not realize, is that "1 2to" is produced 
(apparently as an indeterminate value) from the erroneous function call $(subst 
 ,to,1 2).  

Once you notice that, the answer is obvious, if empty $(from) is not deferred, 
the deferred $$(subst) just sees the first argument as non-existent and 
produces the above.  



-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Mark Galeck (CW)
Sent: Sunday, September 18, 2011 3:53 PM
To: address@hidden
Subject: why does blank have to be deferred when eval'd?

Hello,

I want to substitute a blank, to go from "1 2" to "1to2",  like this:


empty :=
from:= $(empty) $(empty) #blank character
#from := $(empty)nonspace$(empty)

define VAR
WORDS := 1$(from)2
$$(info $$(subst $(from),to,$$(WORDS)))
endef

$(eval $(VAR))


This does not work: it produces "1 2to".  To get the desired result, I have to 
use $$(from) instead of $(from), which should not be necessary, since from 
variable is established before eval.

Indeed, if I use the non-blank from (comment out the first from and uncomment 
the second one), then everything works as expected, I don't need $$(from)


Why??

Thank you,

Mark


You can go to this Wiki page for information about FI-SX Diagnostics:
http://cmbldc/twiki/bin/view/Platform/FiSxDiagnostics

_______________________________________________
Help-make mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-make



reply via email to

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