POV-Ray : Newsgroups : povray.general : Dictionaries and arrays : Re: Dictionaries and arrays Server Time
10 May 2024 16:53:48 EDT (-0400)
  Re: Dictionaries and arrays  
From: Bald Eagle
Date: 28 Sep 2023 13:40:00
Message: <web.6515b9e4e22320151f9dae3025979125@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:

> I am going to keep using dictionaries, because I think the syntax is more
> natural to me, and I don't have to keep track of index positions within an
> array.  But, is there any practical advantage to using a mixed array over a
> dictionary?  Or is it just a matter of personal syntactic taste?

I can't speak for anyone but myself -

For a while, all we had were standard arrays that only accepted a single data
type.
Then Jaap Frank discovered that if you had several arrays of different types,
those could be packaged into a single array, because doing it in that 2-step
process fooled POV-Ray and gave you an array of arrays, even though it was
functionally the same as a mixed array.

Then we got dictionaries, and jr was happy.

The end.

:)

Actually, I often use mixed arrays as a sort of parameter input for macros, so
having a mixed array helps.
Also, for the longest time we didn't have tuple-style variable assignment, and
so passing multiple values out of arrays was problematic.   I would (ab)use
vectors for that, or use the array of arrays workaround, but mixed arrays makes
passing a wide variety of results of different data types much easier.

- BW


Post a reply to this message

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