POV-Ray : Newsgroups : povray.beta-test : I have a hunch some of you may like this... : Re: I have a hunch some of you may like this... Server Time
29 Apr 2024 15:00:20 EDT (-0400)
  Re: I have a hunch some of you may like this...  
From: Mike Horvath
Date: 5 Oct 2016 04:28:03
Message: <57f4b993$1@news.povray.org>
On 9/28/2016 5:03 PM, Christian Froeschlin wrote:
> Nice feature!
>
> Regarding syntax I would recommend not to get carried away
> with multiple variants and syntactic sugar, it all has to be
> maintained, is source of potential parser bugs, causes confusion
> reading code of other people when there is no "right way" (TM).
> And someday it might be rewritten completely and it all has to
> be backward compatible etc...
>
> So it might be preferrably to define only one "POV" syntax
> for single item access and one for initializer list.
>
> Personally I prefer quotes around key like dict["foo"] = 42 to
> keep a distinction between identifiers and values. Although I may
> be biased towards strictly typed languages, and in scripting a
> distinction between structs and dictionaries is less needed.
>
> For the initializer list I must say the mathematician in me
> dies when I see something like "Foo" = 42 :)
>
> On the other hand I quite like the perl option "Foo" => 42
> which seems to intuitively define some sort of mapping.
>

But clipka is asking what do you do when Foo is an variable identifier.

For instance these two are different things:

     #declare MyFrobnitz["Foo"] = 42;
     #declare MyFrobnitz[Foo] = 42;

And the shorthand syntax needs to handle this situation equally well.

Mike


Post a reply to this message

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