On Thursday, August 14, 2003, 6:35:28 PM, Yukihiro wrote:


> In message "Re: Module methods in nested modules with 1.8.0"
>     on 03/08/14, Gavin Sinclair <gsinclair / soyabean.com.au> writes:

|  irb(main):005:0>> def ("x").foo
|  irb(main):006:1>> end
> |  SyntaxError: compile error
> |  (irb):5: can't define single method for literals

> |Not so "arbitrary" after all.

> No.  But how do you call the defined singleton method, considering the
> fact string literals return independent string objects each time they
> evaluated.  The error is much better than the singleton method
> vanished away.

I quite agree, but

  def ([4] + [5]).foo
  end

works.  What you wrote above applies here as well.

Not that I care, mind you.

Gavin