POV-Ray : Newsgroups : povray.beta-test : A v3.8 / v4.0 / yuqk vector tuple assignment issue. : Re: A v3.8 / v4.0 / yuqk vector tuple assignment issue. Server Time
17 May 2024 07:21:20 EDT (-0400)
  Re: A v3.8 / v4.0 / yuqk vector tuple assignment issue.  
From: William F Pokorny
Date: 6 Nov 2023 10:04:59
Message: <6549009b$1@news.povray.org>
On 11/4/23 03:07, William F Pokorny wrote:
> Attempting to attach original post as text file.

Attempting again to post about issue again with Chris's spam filter fix 
in place.

  I've been working through more tuple (batch) ID assignment test cases. 
In the documentation I've been able to turn up for the original tuple 
capability, there was this bit related to assigning components of 
vectors to individual identifiers:

---
In addition, a similar syntax extension has been added for easier 
assignment of vector components to individual variables:

     #declare < ID1, ID2, ... > = VECTOR_EXPR;

This statement is fully equivalent to:

     #local TEMP = VECTOR_EXPR;
     #declare ID1 = TEMP.x;
     #declare IDY = TEMP.y;
    ...

except that the new syntax does not actually define a local variable 
named TEMP.  The terminating semicolon is mandatory.
---

All seems to work except the mandatory semicolon bit is not enforced by 
the parser!

This means the following code runs without complaint, but incorrectly.

     #declare <A0,A1,A2> = <3,2,1>; // This works.
     #declare <A0,A1,A2> = <1,2,3>  // This only appears to work
                                    // Meaning no parse error
     #debug concat("A0 = ",str(A0,3,1),"\n")
     #debug concat("A1 = ",str(A1,3,1),"\n")
     #debug concat("A2 = ",str(A2,3,1),"\n")

     #error "Stopping at parse test end\n"

The exposure made worse because in other applications, the tuple ID 
assignments treat the trailing semicolon as optional.

Bill P.


Post a reply to this message

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