Hi --

On Mon, 8 Mar 2004, Simon Strandgaard wrote:

> On Sun, 07 Mar 2004 19:59:50 -0500, Kent S. wrote:
> > David A. Black wrote:
> >>>I had the impression that they didn't differ much.
> >>>Is there anyone which can explain this to me?
> >> 
> >> 
> >> When you do "obj.extend(Mod)", obj.ancestors changes (new module
> >> added).
> >> 
> > 
> > To be precise, class << obj; self end.ancestors changes :-)
> > 
> 
> Thanks David and Kent,  now I understand. it seems logical that the
> ancestors change when doing 'obj.extend',  and doesn't when doing
> 'class<<obj'.
> 
> 
> 
> Still... I propose that 'class<<self' should invoke #extended or some sort
> of suitable replacement, so that initialization can take place.
> What do you think ?
> 
> Should it be named #extended ?  or  have another name?

I don't think there needs to be such a thing.  (If there is, it
definitely shouldn't have the word "extend" in it, since that could
cause confusion with the current concept of extending an object, as
described wrongly by me and correctly by Kent.)  As Nobu pointed out
in another thread, you can just do:

  class << obj
    puts "Executing a puts statement...."
    # ...
  end

and the code will execute.  


> ATT: David A Black
> > (Testing a new way of posting to Usenet.... hoping it works....)
> > (Copy to Simon)
> >
> 
> Your message didn't show up in the newsgroup... But the posting which I am
> replying to now gave me a hint, so I checked on ruby-talk, and saw your
> message there.

Thanks :-)  My Usenet provider seems to propagate things very slowly, 
especially on weekends, so it's possible it will show up later. 


David

-- 
David A. Black
dblack / wobblini.net