From: Robert Dober Date: 2007-09-01T04:47:10+09:00 Subject: Re: python-style decorators On 8/31/07, Trans wrote: > > > On Aug 31, 7:37 am, "Robert Dober" wrote: > > On 8/31/07, Trans wrote: > > > > > So you've hit the same wall I did with module inheritance. That's > > > unfortunate. > > > > Hopefully I am not too egocentric about my own approach, but if so you > > could maybe explain ;)? > > I fail to grasp where exactly you hit that wall, I have this > > impression that it is the fact that you bind your methods too early, > > if you would just refrain from using methods that are defined inside > > the class, but would always do some include/extend trick, would the > > wall not just come trembling down? > > Sorry if I am missing the obvious here. > > In my case, I wanted to use the notation in stay of ClassMethods > tricks. For example: > > module M > > def ext.foo > "foo" > end > > end > > class X > include M > end > > X.foo #=> foo > > This proves impossible to do in a modular fashion because you can't > extend a class with a singleton class. > > But you may well be right about the current case, hence the potential > solution I posted. > Still trying to get the problem I know that you know (do I?) that you can do module M def foo; "foo" end end class X extend M end where's the catch? R. -- I'm an atheist and that's it. I believe there's nothing we can know except that we should be kind to each other and do what we can for other people. -- Katharine Hepburn