C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Proposal for enhanced preprocessing

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Mon Jul 24, 2006 10:46 pm    Post subject: Proposal for enhanced preprocessing Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.