[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: #{} and \" don't like each other

Mark Wilson

9/16/2003 11:23:00 PM


On Tuesday, September 16, 2003, at 07:04 PM, Peter wrote:

> [snip]
>
> I really don't see the problem with interpreting what I wrote. On
> encountering '#{' in a string literal, anything up to the first
> unbalanced
> '}' can be interpreted as any general ruby expression, including '\"'
> in
> string literals within that expression, and after encountering the
> unbalanced '}' the reading of the original string is resumed until the
> closing quote.

IANAIE (I am not an interpreter expert), but I think

double-quote as beginning of string literal,
string interpolation open,
double-quote as beginning of string literal,
double-quote as character,
double-quote as character,
double-quote as end of string literal,
string interpolation close, and
end of string literal

is a lot for the interpreter to handle if one also wants to preserve a
semlance of readability.

> AFAICS, it is grammatically perfectly sound.

I can't tell one way or the other.

Regards,

Mark