Re: Just a little question before 4.0 will be released
- Posted by DerekParnell (admin) Feb 21, 2009
- 984 views
if idx = 2 then idx = idx + 25 output = #/ #Dear Mr. John Doe, # #I am very happy for your support # #Mr. Jeff Doe #/ else .... more .... end if
So, if the string starts with the magic hash, then all white space preceeding it is stripped. Maybe it could be the magic character that you choose:
Suppose we combine these ideas:
Use the /@ (or whatever) once and its location determines how far whitespace will be striped to:
sequence c_code = /@if ( strcmp( "foo", "bar" ) == 1 ) { printf("strcmp works correctly."); } @/
I've given these ideas some thought and come up with this ...
if idx = 2 then idx = idx + 25 output = #/ ________ Dear Mr. John Doe, I am very happy for your support with respect to the offer of help. Mr. Jeff Doe / else .... more .... end if
Which will display as
Dear Mr. John Doe, I am very happy for your support with respect to the offer of help. Mr. Jeff Doe
and
sequence c_code = ## __________________if ( strcmp( "foo", "bar" ) == 1 ) { printf("strcmp works correctly."); } #
Which displays as
if ( strcmp( "foo", "bar" ) == 1 ) { printf("strcmp works correctly."); }
The difference is one added line after the start of the extended string start token. This is a line of underscore characters that represents the maximum number of leading whitespace that will be trimmed off each line of string text in this extended text literal.
This is fast to implement, allows easy of entering and maintenance of the text, and visually highlights the "special" nature of the text literal.