strings combine

A

Albert Schlef

Raul said:
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 said:
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?
 
B

Brian Candler

Raul said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,417
Latest member
DarrenGaun

Latest Threads

Top