Arrays: new and old keys, i

Mark Wieder mwieder at ahsoftware.net
Sun Sep 14 11:17:57 EDT 2008


Ken-

Saturday, September 13, 2008, 10:25:58 PM, you wrote:

> "What benefit is it to the Rev developer (not the engine) to have the keys
> NOT sorted?"

I agree. While I don't think it's a traditional role of arrays to have
their keys sorted and hash tables have their own internal key sorting,
I think it would be a useful addition to rev arrays. I've been
questioning the "order in which I entered them" sort order, but some
good arguments have been advanced for that. It's still not the top of
my list for a sort order, but I don't think having an unsorted order
helps anyone except for a possible speed benefit.

Maybe a property of arrays would do this:

set the sortorder of theDataA to empty -- unsorted, fastest
set the sortorder of theDataA to "first input" -- FIFO
set the sortorder of theDataA to "last input" -- LFIFO
set the sortorder of theDataA to "alpha" -- alphabetic
set the sortorder of theDataA to "MySortFunction" -- custom sort
set the sortorder of theDataA to "random" -- just kidding

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list