POV-Ray : Newsgroups : povray.newusers : Using arrays of vectors : Re: Using arrays of vectors Server Time
29 Jul 2024 14:22:26 EDT (-0400)
  Re: Using arrays of vectors  
From: Warp
Date: 29 Sep 2005 03:25:42
Message: <433b96f6@news.povray.org>
kurtz le pirate <kur### [at] yahoofr> wrote:
> comma, no comma... documentation at 
> http://www.povray.org/documentation/view/3.6.1/286/ is a little a 
> ambiguous ! the syntax is :

  Yes, the documentation is a bit vague on the usage of commas as list
item separators.
  However, povray is very permissive about missing commas as long as it
is unambiguous where the limit between the items is. However, this should
be used with care.
  For example:

  #define A = array[3] { a b c };

is equal to

  #define A = array[3] { a, b, c };

and even:

  #define A = array[3] { 1 2 3 };

is equal to:

  #define A = array[3] { 1, 2, 3 };

  However, be very careful with lists like this:

  #define A = array[3] { 1 2 -3 };

because these can contain unexpected surprises.

  The optionality of commas in most places is very handy because it allows
you to create item lists in a loop without having to worry if a comma is
required/prohibited in some place.

-- 
                                                          - Warp


Post a reply to this message

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