POV-Ray : Newsgroups : povray.beta-test : Dictionary 'reassign' : Re: Dictionary 'reassign' Server Time
14 Jun 2021 18:33:47 EDT (-0400)
  Re: Dictionary 'reassign'  
From: jr
Date: 4 Dec 2018 14:20:01
Message: <web.5c06d2c1a98f76e2e43b71790@news.povray.org>
hi,

ingo <ing### [at] tagpovrayorg> wrote:
> Don't know the proper word for what I do, but the code below fails. Should
> it? Can it be made not to fail?
>
> #declare T = dictionary {
>   ["Index"] : array[2]{"Base1", "Base2"},
>   ["Base1"] : <1,2,3>,
>   ["Base2"] : <0,1,2>
> };
>
> #declare Chain = T["Index"][0];
> #declare Vec = T.Chain;
>
> Parse Error: Cannot pass uninitialized identifier to non-optional LValue.


I don't suppose "the other way round" is any good to you?  eg:

#version 3.8;

global_settings {assumed_gamma 1}

#declare T = dictionary {
  .base0 : 0,
  .base1 : 1,
  .base2 : 2,
  .vecs : array {<1,2,3>,<0,1,2>,<4,5,6>}
};

#debug concat("2)  <",vstr(3,T.vecs[T.base2],",",0,0),">.\n")


regards, jr.


Post a reply to this message

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