Skip Menu |

This queue is for tickets about the Class-XSAccessor CPAN distribution.

Report information
The Basics
Id: 38794
Status: resolved
Priority: 0/
Queue: Class-XSAccessor

People
Owner: Nobody in particular
Requestors: alexander [...] bitcard.contacting.de
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Wishlist: chained, fallback only
Is there any behaviour planned equivalent in behaviour to Class::Accessor::Chained concerning a return value of $self when calling mutators? Alexander
On Thu Aug 28 09:49:35 2008, alexanderk wrote: Show quoted text
> Is there any behaviour planned equivalent in behaviour to > Class::Accessor::Chained concerning a return value of $self when calling > mutators?
No, not really. It would be trivial to implement, but I'm not entirely convinced it's worth cluttering the interface for this feature. Right now, you can export getters, setters, testers and mutators. Offering two types of mutators seems to be asking for confusion. Supposing I was convinced, I'd just take the XS code of the mutator and return self variable in one branch of the if(){}else{}. How about this: If you can suggest an interface (which can be just a name) for this feature that makes clear what it does and how it differs from the normal mutators, then I'll add the feature. Best regards, Steffen
Subject: Re: [rt.cpan.org #38794] Wishlist: chained, fallback only
Date: Thu, 28 Aug 2008 18:30:33 +0200
To: bug-Class-XSAccessor [...] rt.cpan.org
From: alexanderk <alexander [...] bitcard.contacting.de>
What about flagging this behaviour same way as with the replacement of methods. Like: chained => 1 or chained_accessors => 1 I'm not really confident that you like this approach, because the 'replace' feature to my knowledge is not documented yet. Best regards Alexander Steffen Mueller via RT schrieb: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=38794 > > > On Thu Aug 28 09:49:35 2008, alexanderk wrote: >
>> Is there any behaviour planned equivalent in behaviour to >> Class::Accessor::Chained concerning a return value of $self when calling >> mutators? >>
> > No, not really. It would be trivial to implement, but I'm not entirely > convinced it's worth cluttering the interface for this feature. Right > now, you can export getters, setters, testers and mutators. Offering two > types of mutators seems to be asking for confusion. > > Supposing I was convinced, I'd just take the XS code of the mutator and > return self variable in one branch of the if(){}else{}. > > How about this: If you can suggest an interface (which can be just a > name) for this feature that makes clear what it does and how it differs > from the normal mutators, then I'll add the feature. > > Best regards, > Steffen > > >
Hi Alexander, On Thu Aug 28 12:30:59 2008, alexanderk wrote: Show quoted text
> What about flagging this behaviour same way as with the replacement of > methods. > Like: > chained => 1 > or > chained_accessors => 1 > > I'm not really confident that you like this approach, because the > 'replace' feature to my knowledge is not documented yet.
Hmm, that's another bug. I just made a new release which adds the "chained" option, a couple of tests, and documentation for the replace option. Best regards, Steffen