John Demme incurred the wrath of Bob on May 4, by saying
>We didn't do over D's templates at the meeting tonight, so as promised here
>is the article on them:
>
>http://digitalmars.com/d/templates-revisited.html
>
So maybe I've got the wrong idea about metaprogramming, but let me give
it a shot...
One of my favorite things about the C preprocessor (I know, we're all
supposed to hate the C preprocessor -- it's either too limiting or too
powerful, depending on where you're coming from) is the stringification
operator. I'll often define a macro like
#define show_value(x) printf("value of " #x " is %d\n", x)
so that I can get the variable name into a string, and call it like
this for debugging:
int x = 5;
int y = 6;
int z = 3;
show_value(x);
show_value(y);
show_value(z);
Does D provide any way to convert a variable name to a string?
Going further, does it provide a way to do something comparable to the
concat operator for code (##) in CPP?
--
Cheers,
Bob Schmertz
After a long, long hiatus from the UMLUG list....