From: Roger Pack on
Shouldn't the following be a syntax error?

>> ' 3' '4'
=> " 34"

?
-rp
--
Posted via http://www.ruby-forum.com/.

From: Gary Wright on

On Feb 18, 2010, at 12:54 PM, Roger Pack wrote:

> Shouldn't the following be a syntax error?
>
>>> ' 3' '4'
> => " 34"


Rarely seen, but string literal "implicit" concatenation has always been a feature.

Gary Wright



From: Tony Arcieri on
[Note: parts of this message were removed to make it a legal post.]

On Thu, Feb 18, 2010 at 11:34 AM, Gary Wright <gwtmp01(a)mac.com> wrote:

> Rarely seen, but string literal "implicit" concatenation has always been a
> feature.
>

I remember at one point I tried Python-style triple quotes, all "cool, Ruby
supports that too!"

Except it doesn't... :/

--
Tony Arcieri
Medioh! A Kudelski Brand

From: Roger Pack on

>> Shouldn't the following be a syntax error?
>>
>>>> ' 3' '4'
>> => " 34"
>
>
> Rarely seen, but string literal "implicit" concatenation has always been
> a feature.

Yeah--for me it has almost always represented a bug (like a missing ,
between parameters or what not).
Ahh well.
-rp
--
Posted via http://www.ruby-forum.com/.

From: Robert Klemme on
On 02/18/2010 11:32 PM, Roger Pack wrote:
>>> Shouldn't the following be a syntax error?
>>>
>>>>> ' 3' '4'
>>> => " 34"
>>
>> Rarely seen, but string literal "implicit" concatenation has always been
>> a feature.
>
> Yeah--for me it has almost always represented a bug (like a missing ,
> between parameters or what not).
> Ahh well.

I can't remember having used it but it can be useful if you want to
create a longer string and do not want to use a here document (because
of indentation issues for example).

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
 |  Next  |  Last
Pages: 1 2 3 4 5
Prev: Help : Error in scrubyt
Next: DXF Writer?