[Kc] untie or unoverload an array from within its class?

David Nicol davidnicol at gmail.com
Wed Oct 19 07:58:05 PDT 2011

thinking (out loud) about lazy sort utilities.

Given an invocation something like

           makelazysortedarray ( my @Sorted, @Unsorted); # presume "cmp" for
comparison function

which would work behind the scenes with a (\@@) protoype, and work by either
tying @{$_[0]} or blessing $_[0] into an overloaded class (which in turn
ties, so there's no advantage there)

when the sort is complete, @{$_[0]} could be untied with "untie" and then
get the complete remaining list assigned to it, or for an overload

     $_[0] = [ @CompleteSortedList ]

would also work.

Am I right?

"I am waiting for the war to make the world safe for anarchy" -- Lawrence
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/kc/attachments/20111019/c9b5806e/attachment.html>

More information about the kc mailing list