POV-Ray : Newsgroups : povray.documentation.inbuilt : Mixed-type arrays : Re: Mixed-type arrays Server Time
18 Sep 2021 06:25:00 EDT (-0400)
  Re: Mixed-type arrays  
From: Jim Holsenback
Date: 4 Oct 2018 07:09:51
Message: <5bb5f4ff$1@news.povray.org>
On 9/23/18 1:53 PM, clipka wrote:
> Contrary to earlier claims, intentions, the documentation already on the
> Wiki, and my own clouded memory, the restriction that array elements
> have to be of the same type has /not/ been removed.
> 
> While I could fix this, I have decided not to, as same-type arrays are
> clearly the default use case, and it may actually be helpful to get an
> early error message when accidently assigning a value of a mismatching
> type to one element.
> 
> Instead, the behaviour will be changed as follows:
> 
> 
> In an array declaration, the `array` keyword may be followed by the
> `mixed` keyword. This declares the array as a /mixed-type array/,
> allowing it to hold elements of different types.
> 
> Example:
> 
>      #declare Foo = array mixed[3];
>      #declare Foo[0] = 42;
>      #declare Foo[1] = "Fnord";
>      #declare Foo[2] = sphere { <0,0,0>, 1 }
> 

done: http://wiki.povray.org/content/Reference:Array


Post a reply to this message

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