POV-Ray : Newsgroups : povray.bugreports : Can't #undef a dict item that contains an array or dict Server Time
27 Apr 2024 19:05:45 EDT (-0400)
  Can't #undef a dict item that contains an array or dict (Message 1 to 4 of 4)  
From: ingo
Subject: Can't #undef a dict item that contains an array or dict
Date: 24 Jun 2023 09:10:00
Message: <web.6496ea4a662ea7f17bac71e8ffb8ce3@news.povray.org>
---%<------%<------%<---
#version 3.8;

#declare D = dictionary{
  ["test"]:"test",
  ["Arr"]: array{1,2},
  ["Dict"]: dictionary{["1"]:1}  //parse error: Tried to free undefined symbol
} ;

#undef D["test"]

#undef D["Arr"] //parse error: Tried to free undefined symbol

#undef D["Dict"] //parse error: Tried to free undefined symbol

---%<------%<------%<---

Win11, Persistence of Vision(tm) Ray Tracer Version
3.8.0-beta.2+gh7.msvc14.win64

ingo


Post a reply to this message

From: jr
Subject: Re: Can't #undef a dict item that contains an array or dict
Date: 24 Jun 2023 09:50:00
Message: <web.6496f3ecf8ae749fb49d80446cde94f1@news.povray.org>
hi,

"ingo" <nomail@nomail> wrote:
> ---%<------%<------%<---
> #version 3.8;
>
> #declare D = dictionary{
>   ["test"]:"test",
>   ["Arr"]: array{1,2},
>   ["Dict"]: dictionary{["1"]:1}  //parse error: Tried to free undefined symbol
> } ;
>
> #undef D["test"]
>
> #undef D["Arr"] //parse error: Tried to free undefined symbol
>
> #undef D["Dict"] //parse error: Tried to free undefined symbol
>
> ---%<------%<------%<---
>
> Win11, Persistence of Vision(tm) Ray Tracer Version
> 3.8.0-beta.2+gh7.msvc14.win64

I think that may be to do with not being allowed to address "a slice" of an
array, eg.
  #undef D["Arr"][0]
  #undef D["Arr"][1]
and
  #undef D["Dict"]["1"]

work "as advertised".


regards, jr.


Post a reply to this message

From: ingo
Subject: Re: Can't #undef a dict item that contains an array or dict
Date: 24 Jun 2023 13:00:00
Message: <web.64972030f8ae749f17bac71e8ffb8ce3@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> I think that may be to do with not being allowed to address "a slice" of an
> array, eg.
>   #undef D["Arr"][0]
>   #undef D["Arr"][1]
> and
>   #undef D["Dict"]["1"]
>
> work "as advertised".
>

Thanks, yes, I had figured that out, but am not happy with it.

#undef D["Arr"][0]
#undef D["Arr"][1]
#ifdef(D["Arr"])
  #debug "D_Arr\n"
#end

This prints "D_arr", so D["Arr"] isn't gone, it's just empty. Don't know how
harmful it is, if at all?

Thanks,
ingo


Post a reply to this message

From: ingo
Subject: Re: Can't #undef a dict item that contains an array or dict
Date: 24 Jun 2023 23:35:00
Message: <web.6497b544f8ae749f17bac71e8ffb8ce3@news.povray.org>
This works around it:

#declare D["Arr"]=""
#undef D["Arr"]

ingo


Post a reply to this message

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