Triple quoted strings
mdaeumli at adobe.com
Wed Mar 5 23:33:03 PST 2008
Well, I do find the feature useful...
I have seen a lot of scripts that contain multiline strings. Yes, you
can used escaped newlines, but triple-quoting is definitely much more
useful. For what it's worth, triple-quoting is syntactic sugar, but the
1) is easy to describe and implement,
2) does not add ugly stuff to the language,
3) makes multiline strings much more readable.
From: es4-discuss-bounces at mozilla.org
[mailto:es4-discuss-bounces at mozilla.org] On Behalf Of Brendan Eich
Sent: Wednesday, March 05, 2008 11:24 PM
Subject: Re: Triple quoted strings
On Mar 5, 2008, at 11:17 PM, Nathan de Vries wrote:
> On Thu, 2008-03-06 at 00:14 +0000, Peter Hall wrote:
>> Except that it would have a few unexpected behaviours, especially
>> around the & and < characters.
> What would those unexpected behaviours be? Here document syntax is
> available (and relatively standard) in UNIX shell, PHP, Perl & Ruby.
> Python seems to be the only language that has strayed from the
> traditional syntax, and I'm not entirely sure why ES4 is planning to
> follow suite.
I'm an old Unix hacker, I remember the Bourne Shell (source too, in C-
gol). E4X may have given people the idea that ES4 will add even more
(mis-)appropriated syntax but we aren't doing pipelines or command
substitution. I don't see why we need here documents in all their glory,
although I like and use them.
Triple-quoted strings are simply for embedding quote and newline
characters, verbatim and freely. If no one (including you
Pythonistas) would find them useful then we should defer the proposal.
Es4-discuss mailing list
Es4-discuss at mozilla.org
More information about the Es4-discuss