|
|
Am 05.12.2018 um 01:24 schrieb jr:
> hi,
>
> clipka <ano### [at] anonymousorg> wrote:
>> https://github.com/POV-Ray/povray/releases/tag/v3.8.0-alpha.9945627
>
> this version allows me to omit a comma in a dictionary, I'm guessing that's
> unintended?
>
> #declare X = dictionary {
> .v0 : array
> .v1 : 0,
> .v2 : 1
> };
>
> same for x.tokenizer.9945666.
>
> regards, jr.
No, that's entirely intentional. Commas are always optional, provided
that this doesn't lead to ambiguity.
For example, the following will NOT work:
#declare Foo = <1,2,3>;
#declare X = dictionary {
.v0 : Foo
.v1 : 0,
.v2 : 1
};
That's because `Foo` is a vector, so POV-Ray would misinterpret the `.`
in `.v1` as belonging to `Foo`, and expect either `x`, `y` or `z` to
follow. Placing a comma after `Foo` indicates to POV-Ray that this
expression is completed.
As another example, consider the following:
#declare Foo = <1 2 3>;
This will declare a 3-dimensional vector. On the other hand, the
following will declare a 2-dimensional vector:
#declare Foo = <1 -2 3>;
That's because POV-Ray interprets `1 -2` as the expression `1-2`, i.e.
the single value -1.
Post a reply to this message
|
|