Strings combine

Ahhh. I had assumed that the ruby parser kept a running list of defined
methods/defined variables. Thanks for clearing that up.

On Sun, Feb 21, 2010 at 5:48 AM, Albert S. [email protected]
wrote:

BTW, you don’t need to put a space between the literals!

it’s a feature, so that it would be easier to the eye.

best regards -botp

Raul J. wrote:

I was asking for a rationale.

This feature lets you mix several quoting styles when entering a string:

s = ‘"’ “ab’cd” ‘"’

or…

s = ‘some\tthing’ “\n”

BTW, you don’t need to put a space between the literals!

Robert K. wrote:

Apart from that, I believe it is quite common in programming
languages to allow concatenation of string literals

I know that Python supports this syntax. The Unix shell too support this
(when you don’t separate the tokens with a space; it’s a feature I use
often).

But, Robert, what other languages support this?

Raul J. wrote:

Ahhh. I had assumed that the ruby parser kept a running list of defined
methods/defined variables. Thanks for clearing that up.

Defined local variables, yes. Defined methods, no. Methods can be
dynamically added to methods and classes at runtime, and also depend on
the runtime class of the receiving object, so you have no idea at parse
time whether a method exists or not.