PROPOSAL: String literals: version 1.1

rssh at rssh at
Tue Mar 3 03:24:57 PST 2009

> I don't think you need the U/W suffix; make all newlines \n regardless
> of what they are in the source file. If this annoys anybody, they can
> either manually add the \r in the string, or run a
> simple .replace("\n", "\r\n") at the end. I find collapsing whitespace

1. We must be able easy receive string in 'platform native' encoding.
 (If i wrote application, which generate part of text file, which I later
will open in text editor: this is matter)

2. Hmm, in principle for me difference between suffix and method of string
is not big (and smart compiler will be call this methods on constants
during compilation)

So, in principle suffixes can be changed to 3 methods

 nativeLf()  -  replace '\r\n'|'\n' to line terminaton sequence, native
for this platform.
 unixLf() - replace '\r\n' to '\n'
 windowsLf() - replace '\n' to '\r\n'

3. I does not like names like unixLf() or windowsLf()
 Are you have any ideas about better names ?

More information about the coin-dev mailing list