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.
Some advantages of traditional here document syntax can be seen below
(all Ruby):
# Standard here document
foo = <<EOS
bar
EOS
# Here document, with stripped leading whitespace
def foo
return <<-EOS
bar
EOS
end
# Stacked here documents
foo(<<DOC1, <<DOC2)
this string is passed as the first argument
DOC1
this string is passed as the second argument
DOC2
It seems that triple-quoted string literals only seem to cover the first
case.
Cheers,
--
Nathan de Vries
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss
