Hi Jerrad
On Thu, 2010-12-02 at 12:06 -0500, Jerrad Pierce via RT wrote:
Show quoted text> Thu Dec 02 12:06:48 2010: Request 63543 was acted upon.
> Transaction: Ticket created by JPIERCE
> Queue: Set-Array
> Subject: More chaining
> Broken in: 0.20
> Severity: Wishlist
> Owner: Nobody
> Requestors: jpierce@cpan.org
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=63543 >
>
>
> It would be nice if pop and shift could ascertain through context (or a
> parameter) whether to return the discarded element, or the array so that
> the method could be chained. Alternatively, cpop, cshift etc. could be
> offered as chainable variants.
pop() and shift() already return either the element or the element
blessed, so I think it's too complex to try making them also return the
underlying object in some cases.
Hence, I've implemented cpop() and cshift(), as suggested.
Show quoted text> Lastly, it would be helpful if the documentation noted which methods
> were chainable (perhaps starring the method names or something).
> Otherwise, if one unwittingly tries to chain pop an esoteric method
> erupts about not being an array ref from line 6XX of the module.
I think you mean line 426 (or thereabouts) :-).
I would have to annotate more-or-less every method :-(. I checked.
The other problem of course is that the chain-ability depends on the
context, it's not a can-or-can't binary fact.
I suggest you'll just have to get used to reading the section on OBJECT
BEHAVIOR.
I'm releasing V 0.21 now.
--
Ron Savage
http://savage.net.au/
Ph: 0421 920 622