Hi,

At Wed, 17 Sep 2003 08:04:18 +0900,
Peter wrote:
> > As you may have already discovered, the following gives the expected 
> > results:
> > 
> > print "<user #{"name=" + name + ""}></user>"
> 
> It does not since I want quotes around the name...

These work as expected, and are faster.

  print "<user name=\"#{name}\"}></user>"
  print %{<user name="#{name}"}></user>}

> 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.

Yes, it can be interpreted as you expected, and may be in
future version.  But it was different till 1.6, so "escaped
terminator" is warned and interpreted as sole terminator, for
backward compatibility.

-- 
Nobu Nakada