POV-Ray : Newsgroups : povray.documentation.inbuilt : Mixed-type arrays : Mixed-type arrays Server Time
20 Apr 2024 00:53:44 EDT (-0400)
  Mixed-type arrays  
From: clipka
Date: 23 Sep 2018 13:53:56
Message: <5ba7d334$1@news.povray.org>
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 }


Post a reply to this message

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