Jean-François Mertens wrote:
> 
> On 02 Jun 2009, at 03:03, Martin Costabel wrote:
> 
>> ...
>> The idea is clear, but preprocessor macros don't work like that.
> 
> Really thanks for making so clear msgs !
> FInally I understand for sure that cpp works
> like tex's \def rather than \edef _ and I'll
> feel much more comfortable using it knowing
> for sure the right interpretation !
> (and I guess there are no analogues of \edef or \let ?)

The most difficult thing was to find out how to print the value of a 
macro at a given moment. From a diving expedition into the depths of the 
docs, I brought home some macros that give the following small example 
program in C:

#include <stdio.h>
// stringify the value of a macro for printing
#define str(x) #x
#define xstr(x) str(x)
// play with replacing macros
#define OLD_DEBUG 1
#define DEBUG OLD_DEBUG
int main(){
         printf("Before: %s\n", xstr(DEBUG));
#undef OLD_DEBUG
         printf("After : %s\n", xstr(DEBUG));
         return(0);
}

If you compile and run this, it prints

costabel% ./a.out
Before: 1
After : OLD_DEBUG

I don't know enough to say that there are no analogues of \edef or \let, 
but I haven't come across them yet.

-- 
Martin


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.devel

Reply via email to