POV-Ray : Newsgroups : povray.off-topic : Innovative open source? : Re: Innovative open source? Server Time
9 Oct 2024 13:15:41 EDT (-0400)
  Re: Innovative open source?  
From: Darren New
Date: 4 Apr 2009 13:48:57
Message: <49d79d89$1@news.povray.org>
nemesis wrote:
> The primary function of a hash table is for lookup.  Looking up individual
> registers associated with a given key.  No one said anything about order.

Yes. So... why is a "dict" a hashtable instead of something else?

Again, you're begging the question. You're asserting that the way Python 
does it is right, then justifying it based on the fact that Python decided 
to implement it that way. See?

You're saying "a hastable is for lookups. It doesn't have an order. 
Therefore, Python is right to base its data structures on hash tables."

> If you want order, append the keys to a list as they are inserted into the hash
> and implement a display_hash function that will display hash items by iterating
> over items from the list.

Well, there ya go. So why isn't that built in, like it is in PHP, since it 
allows both random and sequential lookups? :-)

> All the worse as mathematicians would need to write down far too much more
> symbols on paper, rather than resorting to the simpler approach of following a
> given order.  Lists are always simpler than sets.

So, it's OK for a mathematical set to maintain order when it's simpler, but 
it's not logical to make the data structures in your language have the same 
simplicity? I'm not following. :-)

-- 
   Darren New, San Diego CA, USA (PST)
   There's no CD like OCD, there's no CD I knoooow!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.