Re: ANNOUNCE: Object::Stringify
On Sun, 1 Jun 2003, Ben Bennett wrote: > Ah, interesting, I missed those packages when searching for "prior > art". Class::Decorator seems not to allow what I want (new arbitrary > methods) but instead seems to allow you to insert pre and post code. > Class::Wrapper is closer but I don't think it is compatible because of > all the hackery I have to do to get the inheritence right for > overloaded operations (I have to make a package on the fly to get the > ISA magic right). > > That said the Class namespace might be better than the Object one I am > currently using, perhaps Class::Overload::Stringify? It really is decoration though (or wrapping). It'd be nice if it was integrated into another module. At least talk to the existing module authors to see if they're interested in a patch. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/
Re: ANNOUNCE: Object::Stringify
Ah, interesting, I missed those packages when searching for "prior art". Class::Decorator seems not to allow what I want (new arbitrary methods) but instead seems to allow you to insert pre and post code. Class::Wrapper is closer but I don't think it is compatible because of all the hackery I have to do to get the inheritence right for overloaded operations (I have to make a package on the fly to get the ISA magic right). That said the Class namespace might be better than the Object one I am currently using, perhaps Class::Overload::Stringify? I thought about implementing a way to do all of the overloadable operators, but there are some nasty twists that way... Perhaps I will look at that again. -ben On Sun, Jun 01, 2003 at 12:02:06PM -0500, Dave Rolsky wrote: > On Fri, 30 May 2003, Ben Bennett wrote: > > > This class allows you to wrap an arbitrary object and provide > > stringification and numification methods while changing the interface > > to the object as little as possible. > > Have you taken a look at Class::Decorator on CPAN? What you've > implemented is more or less the decoration pattern, but specifically > oriented at overloading. I'd suggest either offering a patch to > Class::Decorator to allow for overloading or to implement a > Class::Decorator::Overload module that uses Class::Decorator and adds > overloading, if the author doesn't accept your patch. > > > -dave > > /*=== > House Absolute Consulting > www.houseabsolute.com > ===*/
Re: ANNOUNCE: Object::Stringify
On Fri, 30 May 2003, Ben Bennett wrote: > This class allows you to wrap an arbitrary object and provide > stringification and numification methods while changing the interface > to the object as little as possible. Have you taken a look at Class::Decorator on CPAN? What you've implemented is more or less the decoration pattern, but specifically oriented at overloading. I'd suggest either offering a patch to Class::Decorator to allow for overloading or to implement a Class::Decorator::Overload module that uses Class::Decorator and adds overloading, if the author doesn't accept your patch. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/