July 28, 2003
Charles Sanders wrote:
> I don't see the point either, I vote not to include it.
> 
> Charles
> 
> "Sean L. Palmer" <palmer.sean@verizon.net> wrote in message
> news:bg2kii$1fs0$1@digitaldaemon.com...
> 
>>I don't see the point of wysiwyg string.  You will need escapes for the
>>quotes anyway, and in order to have escapes you have to have an escape for
>>the escape character.  Next thing you know you're back at the "normal" C
>>string.
>>
>>Why do we need two kinds of string again?  So people can embed control
>>characters in the string or something?
>>
>>Sean
>>
>>"Carlos Santander B." <carlos8294@msn.com> wrote in message
>>news:bg2469$ta2$1@digitaldaemon.com...
>>
>>>I was going to vote for $"wysiwyg string", but now this seems like a
>>
>>better
>>
>>>idea, IMHO.
>>
>>
>>
> 
> 

Regexps. :)

If you want to match "c:\con\*.exe" you'd have to write the regexp as "c\\:\\\\con\\\\.*\\.\\*" if raw strings were not available.

July 28, 2003
"Matthew Wilson" <matthew@stlsoft.org> wrote in message news:bg29h0$12sg$1@digitaldaemon.com...
> > `string`
> > """string"""
>
> Instinct tells me that this is a parsing nightmare, no?

Not that bad, actually. The clunky ones are the arbitrary lookahead problems.


July 28, 2003
It strikes me that perhaps backslash is a poor choice for regexp escape character, since it conflicts with both C escapes and path separators.

Sean

"Andy Friesen" <andy@ikagames.com> wrote in message news:bg3gqj$2c6t$1@digitaldaemon.com...
> Regexps. :)
>
> If you want to match "c:\con\*.exe" you'd have to write the regexp as "c\\:\\\\con\\\\.*\\.\\*" if raw strings were not available.


July 28, 2003
I vote for ( a bit verbose )
W"string"
C"string"
E"string"

In article <1103_1059382594@bose>, Karl Bochert says..
July 28, 2003
I vote for ( a bit verbose )
Ws"string"
Cs"string"
Es"string"
Sorry on the previos post

In article <1103_1059382594@bose>, Karl Bochert says..
July 28, 2003
Charles Sanders wrote:
> I don't see the point either, I vote not to include it.

However, a way to conveniently include tabs and linebreaks without cluttering text with excape characters would be good.

Actually, D has no parsing problems with all of this, so why not make "" and '' be semi-escaped strings, with a difference that with one the single and with the other the double quotes don't have to be escaped. Besides, since D faces no severe parsing problems (unlike Python), these *both* can be made to include tabs and linebreaks as plain text without replacing them by escapes.

And yet we need some character designator - why not use a "c" prefix for any kind of string which would cast it into a character?

Yet another possibility would be """string""" and '''string''' for strings completely without escape characters - being basically both the same. This clunky syntax could only get better if you allow to ignore (or force) the first linebreak directly after the opening """, as well as the last one just before the closing ones? These things are intended for writing blocks of text anyway.

-i.

July 28, 2003
I agree. I use WYSIWYG strings and escaped strings all the time. I very rarely use character literals. So, I'd prefer a syntax that uses traditional '' and "", respectively for WYSIWYG and escaped strings, giving an oddball syntax to the character literals.

And the nice thing about character literals is that, by definition, they are only once character long, so there is no need for a closing delimiter, only a starting delimiter.

My favorite options for character literals are:

\c
\\n     (for an escaped single-character, in this case a newline)
@c
#c
{c}
<c>

--Benji Smith


>"Daniel Yokomiso" <daniel_yokomiso@yahoo.com.br> wrote in message news:bg0q5t$2ieb$1@digitaldaemon.com...
>
> Hi,
>
>     Couldn't we use a symbol for character literals, like other languages,
> like #a or $a for the letter "a"? It would probably be simpler, and we
>could
> keep '' and "" for strings. Also \ would be character literals, instead of single character strings.
>
>     Best regards,
>     Daniel Yokomiso.
>


July 28, 2003
Charles Sanders wrote:
> I don't see the point either, I vote not to include it.
> 
> Charles

Ditto.

July 28, 2003
Walter,

Do things the C way as your intuition suggests.  Revert 'x' to char literal and find something else for WYSIWYGs.  In a language so heavily based on C it makes no sense to confuse end users about the meaning of 'x'.

I dislike # or $ or @ because # is a comment in some files, $ reminds me of Perl, and @ makes me think about the Internet.  These are ugly solutions.

There is always «French» or Python triple-quotes for WYSIWYGs.  I do not think they will be as rare as you imagine.

Mark


July 28, 2003
>Regexps. :)
>
>If you want to match "c:\con\*.exe" you'd have to write the regexp as "c\\:\\\\con\\\\.*\\.\\*" if raw strings were not available.


So true, and reason to avoid regex-meaningful chars when inventing a string syntax.  It might be smart to follow the C# convention just on user numbers.

Mark