Suggestions to triple quoted strings proposal

Peter Hall peterjoel at gmail.com
Tue Dec 12 13:52:07 PST 2006


> I suggest to ignore first character of string if it is newline.

Can you explain why this would be useful?

If you ignore the first new line, should you also ignore all leading
new lines? It's not obvious how it would behave in that situation,
which makes it immediately "harder" - but that could be just because I
don't understand the use-case. Also, if you actually wanted to include
leading newlines you'd then have to use escape sequences which would
seem to defeat the whole point of """.

Assuming that there are some really convincing use-cases, perhaps
something along the lines of literal regexp options syntax could work.
e.g:

query = """
   SELECT * FROM people
   WHERE date_created > ? AND disabled = 'N'
   """n;

// n signifies ignore leading white on each line


But I'm dubious about how useful that is, compared to the extra
complexity, and I think Brendan is right about keeping it simple
(though I can't see "WYTIWYG" catching on ;-))


Btw is there a discussion somewhere, deciding on triple-quotes in
preference to heredoc syntax?

Peter



More information about the Es4-discuss mailing list