On 11/20/14, 9:05 AM, uri wrote:
On Thursday, 20 November 2014 at 10:41:24 UTC, bearophile wrote:
uri:

It's by design

And it's a nice handy design.

Bye,
bearophile

For Wysiwyg strings I agree that it's great but I prefer C/C++/Python
like behaviour for double quoted strings. I guess it's what I'm used to :)




Cheers,
uri



In Crystal we chose the following: you can have two consecutive string literals but only if they are separated by a `\` at the end of the line.

So this is a syntax error:

foo("bar" "baz")

But this is ok:

foo("bar" \
    "baz")

Likewise, this is an error:

["foo", "bar" "baz", "qux"] # most probably we forgot to add a comma

But this is ok:

["foo", "bar" \
 "baz", "qux"]

This way you avoid silly typing mistakes while at the same time you allow splitting a string across several lines without having to concatenate them at runtime.

Reply via email to