From: "David A. Black" Date: 2004-12-01T11:10:13+09:00 Subject: Re: singleton methods : when are they not permitted? Hi -- On Wed, 1 Dec 2004, Christoph wrote: > Francis Hwang schrieb: > > > > > On Nov 30, 2004, at 6:12 PM, Florian Gross wrote: > > > >> It also seems not to be possible to directly add methods to literals > >> like this: (Not sure why -- maybe Ruby optimizes literals?) > > > Pardon my igmorance but what is a literal? > > > Errrr. So what's the difference between > > > > def ("x").foo; end > > > > and > > > > def (("x")).foo; end > > > > Why do the extra parens make the parser treat it differently? My head > > hurts. > > Mine too - I find these error messages rather missleading > after all both > > ("x") == "x" > > (("x")) == "x" > > evalute to true So does: a = "x" a == "x" but still, during parsing a bare identifier like 'a' and a literal like '"x"' are not treated the same way. David -- David A. Black dblack@wobblini.net