 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Mon Jul 24, 2006 10:46 pm Post subject: Proposal for enhanced preprocessing |
|
|
I would enjoy seeing an extension to c++ that allowed more complicated
embedded preprocessor directives specified in C++ syntax, much
like PHP does for webpages.
I would argue that this kind of flexibility would be able to greatly
increase coding efficiency in some scenarios, and provides much more
power than the standard macro.
If you don't understand what I'm talking about then here's an example.
I have made up the "/#" and "#/" directives to mean start/end
preprocessor step.
PROPOSED EXAMPLE:
#include <stdio.h>
int main(int argc, char **argv)
{
/#
for(int i=0; i<3; i++){
printf(temp, "printf(\"%i\");", i);
}
#/
}
PROPOSED OUTPUT OF PREPROCESSOR:
#include <stdio.h>
int main(int argc, char **argv)
{
printf("0");printf("1");printf("2");
}
I would also like to echo the suggestions of others who have mentioned
the desire for nested comments. While #if 0/#endif does the trick,
there is no rational reason (from a standards point of vierw) for
traditional comments to NOT be nestable other than laziness.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ] |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|