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: [email protected] 
[mailto:[email protected]] On Behalf Of Mark Galeck 
(CW)
Sent: Sunday, September 18, 2011 3:53 PM
To: [email protected]
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
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to