POV-Ray : Newsgroups : povray.off-topic : Innovative open source? : Re: Innovative open source? Server Time
9 Oct 2024 13:16:48 EDT (-0400)
  Re: Innovative open source?  
From: nemesis
Date: 4 Apr 2009 13:30:00
Message: <web.49d79851aca2c31c1ec805060@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> nemesis wrote:
> > Darren New <dne### [at] sanrrcom> wrote:
> >> But that's kind of the point. Why do you think that?  Saying "order
> >> shouldn't matter because it's a set" is begging the question.
> >
> > A set in the mathematical sense has no order.
>
> I'm asking you why a dictionary shouldn't have order. You're saying "A
> dictionary is a set, so it shouldn't have order." But what makes a
> dictionary a set?
>
> > If the guy wants order, he goes for a list.
>
> And now you're telling me how to work around the problem of sets not having
> order. See? :-)
>
> Not that it's worth arguing. I'm just pointing out the logic is flawed.
>
> > PHP only got array, so it has to play many roles.
>
> Or, I could say "Python dictionaries are broken, so you need something else
> to substitute for when you want ordered pairs."

You could say math is broken.

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.

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.

> Considering there are
> occasions when you want an order-maintaining dictionary, it would seem to be
> of benefit to have such built in.

Sure.  There's also plenty of practical benefits from having a language
automatically parse numbers out of strings such as v = "24"+1, as Perl and its
bastard son PHP do.

> > Named arguments is a thing of a hip generation used to lots of cheap computing
> > power and general resources.
>
> Errrrr... math generally doesn't use named arguments, even back when
> "computer" was a job title.

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.


Post a reply to this message

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