From: Peter Date: 2003-09-17T08:04:18+09:00 Subject: Re: #{} and \" don't like each other > As you may have already discovered, the following gives the expected > results: > > print "" It does not since I want quotes around the name... > In the variable assignment, you need to escape the quotes because > otherwise the literal string you are creating would be considered > terminated. Inside a literal string, inside #{}, it's not necessary, > because we indicate the end of the expression to be interpolated with > an unescaped '}'. In addition, if we interpreted '\"' inside #{}, we > would not be able to terminate the parent string literal after the > appearance of '#{', which would be bad (because there is a sequence of > characters we can't put in a string literal, ever). 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. AFAICS, it is grammatically perfectly sound. Maybe we should ask Matz... Peter