From: nobu.nokada@... Date: 2003-02-07T17:43:44+09:00 Subject: Re: Private lvalue methods unusable? Hi, At Fri, 7 Feb 2003 13:29:58 +0900, Yukihiro Matsumoto wrote: > |> self.send(:dollars=, 100) > | > |I'm assuming there's some good reason for this that isn't apparent to (at > |least) me. Would someone care to enlighten me out of interest? > > "private" does mean "can only be called without explicit receiver". > This is the reason. It it a bad idea to relax the restriction, "can only be called without explicit receiver or with `self' receiver"? class C private def x=(val) @x = val end public def set_x(val) self.x = val # OK self end end C.new.set_x(1) # OK C.new.x = 1 # NG -- Nobu Nakada