From: "David A. Black" Date: 2004-12-09T11:52:01+09:00 Subject: Re: [ ruby-Bugs-1173 ] Incorrect escaping in strings produced by String::inspect --927295978-1098324783-1102560719=:8544 Content-Type: MULTIPART/MIXED; BOUNDARY="927295978-1098324783-1102560719=:8544" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --927295978-1098324783-1102560719=:8544 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Thu, 9 Dec 2004, [ISO-8859-1] Florian Gro=DF wrote: > David A. Black wrote: > >>> The following causes a runtime syntax error: >>> eval('Foo #@ bar'.inspect) >>>=20 >>> I'm not sure if that use-case is supposed to be supported, but I think = a=20 >>> number of applications rely on it. >> I don't think it's inspect or eval specific. >>=20 >> irb(main):001:0> "#@a" >> =3D> "" > > I think the original poster wanted '#@a'.inspect to be "\#@a" instead of= =20 > "#@a". (There's no interpolation for single quote Strings and this form o= f=20 > variable interpolation can be escaped via \) I don't think that's what he meant. eval('#@a'.inspect) doesn't raise a SyntaxError, whereas what he's written does and that was what he was suggesting was buggy. David --=20 David A. Black dblack@wobblini.net --927295978-1098324783-1102560719=:8544-- --927295978-1098324783-1102560719=:8544--