From: Albert Schlef on
Raul Jara 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 Klemme 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?
--
Posted via http://www.ruby-forum.com/.

From: botp on
On Sun, Feb 21, 2010 at 5:48 AM, Albert Schlef <albertschlef(a)gmail.com> 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

From: Brian Candler on
Raul Jara 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.
--
Posted via http://www.ruby-forum.com/.

First  |  Prev  | 
Pages: 1 2 3 4 5
Prev: Help : Error in scrubyt
Next: DXF Writer?