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 

raw strings in c++0x

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Johan Hahn
Guest





PostPosted: Wed Oct 29, 2003 4:45 pm    Post subject: raw strings in c++0x Reply with quote



Hi

As I understand it, regular expressions will be added to the next standard.
However, I don't see a proposal for a raw string format, like r""-strings in
Python. Clearly that would be very nice to have since regular expressions
do contain an awful lot of backslashes. Have I missed it or is it waiting
for
N1429 to finish, or what?

(Raw strings are simple c-strings that can contain special characters which
gets translated by the compiler.)

.....johahn


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Thomas Hansen
Guest





PostPosted: Fri Oct 31, 2003 11:33 pm    Post subject: Re: raw strings in c++0x Reply with quote



On 29 Oct 2003 11:45:57 -0500, there came a drop of sanity from "Johan
Hahn" <johahn2003 (AT) home (DOT) se> containing:

Quote:
Hi

As I understand it, regular expressions will be added to the next standard.
However, I don't see a proposal for a raw string format, like r""-strings in
Python. Clearly that would be very nice to have since regular expressions
do contain an awful lot of backslashes. Have I missed it or is it waiting
for
N1429 to finish, or what?

(Raw strings are simple c-strings that can contain special characters which
gets translated by the compiler.)

....johahn
You have them in C# too, there they are prefixed by @

This makes it possible to write e.g. @"This is a CR/LF rn"
Fact is that specially when doing regular expressions I seriously miss
a "raw string" specification like you have e.g. in C# since regualr
expressions do LOTS of ""'s.

But there are backdrafts too, firstly it's a language enhancement.
0x standard officials says that they will try to not suggest so many
new language enhancements but rather build up the libraries.
This is probably because it's much easier to get compiler writers to
implement libraries as opposed to changing the language semantics.

Another issue is e.g.
#define @ myX
string g = @"HellorntEarth!!";
??

List goes on...

--
My email:
"john.johnson (AT) theJohnsons (DOT) com"
* Replace "john" with "thomas"
* Replace "johnson" with "hansen"
* Replace "theJohnsons" with "adramatch"

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) 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.