I've started talking about "containers" instead of arrays and hashes
since those both tie directly to implementation details, and containers
are abstractions.


A self-sorting container would be easy enough to tie to, most methods
would inherit from an underlying numbered array, except the insertion
methods and the assignment methods would be different, as after every
alteration, extension, push or unshift the new or modified element
would need to be checked for proper placement.  Or proper placement
could be defered until someone tries to access the container and done
then (when the sort happens is an implementation issue)


Maybe the hash syntax would be better for sorted containers, just using
the key return order for the sorting.


If hashes normally had a sort method of null, they would work normally,
but you could overload the sort method of any hash with

methodoverloadoperator(%thehashinquestion, 'sort', {$a flubber $b})

What is a better syntax for this?







-- 
                          David Nicol 816.235.1187 [EMAIL PROTECTED]
:wq

Reply via email to