Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Are ordered hashes useful?



Marty Pauley writes:
 > On Sat, Feb 12, 2011 at 3:42 PM, Jun-Dai Bates-Kobashigawa
 > <jd.lists@example.com> wrote:
 > >
 > > Then there are cases where you want a data structure that provides both
 > > dictionary access and ordered list access.
 > 
 > That data structure is called a "tree".  It's very common.

Not to mention highly elaborated.

But it's not clear that dictionary order and ordered-list order are
the same.  For example, on python-dev the killer reason (ie, one that
cannot be implemented with existing constructs) for requesting ordered
dictionary was not for user use, but rather for implementing an
optimization in function calls.

The application is that database interfaces often create functions
that have hundreds of named arguments, and it's often (unacceptably)
inefficient to access them by name.  If the list were ordered and
accessible by index position, this could be optimized.  But the order
in question here is not dictionary (lexicographic) order of names, but
the order in the function call (which typically corresponds to the
database schema, as you've probably already guessed).

 > 
 > > If there were such a construct in the language I was working in,
 > > I'm guessing I would use it.
 > 
 > Maybe time to find a better language? :-)

Or a better employer. :-)



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links