[#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: TRANS <transfire@...>
Date: 2007-06-17 10:10:42 UTC
List: ruby-core #11495
On 6/17/07, David Flanagan <david@davidflanagan.com> wrote:
> 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 that the intent of the Matz's proposal from 6 months ago was to
> acheive something like this, and there seemed to be some consensus that
> that would be a good thing.  What I'm adding with my proposal here is an
> explicit punctuation prefix that would, I think, make it possible to
> implement this kind of local method without altering the method name
> resolution algorithm that is currently used for private methods.

One worry I have about the prefix is how would one include a module as
local-private? Ie.

  module M
    def x; ...; end
  end

  class R
    include_as_local M
  end

Would #include_as_local change the names of M's methods somehow?

T.

In This Thread