[#11439] comments needed for Random class — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

15 messages 2007/06/12

[#11450] Re: new method dispatch rule (matz' proposal) — David Flanagan <david@...>

This is a late response to the very long thread that started back in

17 messages 2007/06/13

[#11482] Ruby Changes Its Mind About Non-Word Characters — James Edward Gray II <james@...>

Does this look like a bug to anyone else?

10 messages 2007/06/16

[#11505] Question about the patchlevel release cycle — Sylvain Joyeux <sylvain.joyeux@...4x.org>

1.8.6 thread support was broken in bad ways. It stayed for three months

20 messages 2007/06/20
[#11512] Re: Question about the patchlevel release cycle — Urabe Shyouhei <shyouhei@...> 2007/06/20

Hi, I'm the 1.8.6 branch manager.

[#11543] Re: Apple reportedly to ship with ruby 1.8.6-p36 unless informed what to patch — James Edward Gray II <james@...>

On Jun 27, 2007, at 4:47 PM, Bill Kelly wrote:

10 messages 2007/06/27

Re: new method dispatch rule (matz' proposal)

From: Steven Lumos <steven@...>
Date: 2007-06-18 23:25:56 UTC
List: ruby-core #11503
David Flanagan <david@davidflanagan.com> writes:
> Steven Lumos wrote:
>> Maybe I'm confused, which of these are you talking about?
>>
>> class A
>>   def m; @f(); end
>>   def @f; true; end
>> end
>>
>> class B < A
>> end
>>
>> B.new.m  #=> Error: The mighty class author requires that you
>>              reimplement @f.
>>
>> or
>>
>> class B < A
>>   def @f; false; end
>>   #=> Error: The mighty class author forbids you to reimplement @f
>> end
>>
>> Steve
>>
>>
>
> Steve,
>
> I don't intend either of those, really.  My proposal is that the
> method @f would be completely local to the defining class.  There is
> no inheritance of these hypothetical methods, and so the class
> hierarchy is irrelevant.  If you try to invoke @f in a class B that
> does not define @f you get a NoMethodError or whatever. And you can
> define @f in a class B regardless of what is defined in the
> superclass, so you'd never get an error message like your second one.

I think I get it now.

class B < A; end
B.new.m  #=> true

class B < A
  def m; @f(); end
end
B.new.m  #=> NoMethodError

class B < A
  def @f; false; end
end
B.new.m  #=> true

class B < A
  def m; @f(); end
  def @f; false; end
end
B.new.m  #=> false

Steve


In This Thread

Prev Next