POV-Ray : Newsgroups : povray.general : Problem with name space for user-defined functions : Re: Problem with name space for user-defined functions Server Time
20 Apr 2024 01:37:46 EDT (-0400)
  Re: Problem with name space for user-defined functions  
From: Thorsten Froehlich
Date: 4 Apr 2018 07:45:00
Message: <web.5ac4ba55f0f198f8f773ca290@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> I just did another test...
>
> #declare B = function{0};
> #declare B = 0;
>
> This causes the same "...#undef the function first" error-- even though the new
> B is not a function. So the error result is not specific to macros.
>
> The documentation about re-defining funtions doesn't mention this particular
> behavior. It appears that if B is first assigned to a *function*, that function
> 'legacy' is still part of B when the attempt is made to re-declare B as
> *anything* else, whether as another function or not...unless the original B is
> 'destroyed' first.

No, B is a function and you are trying to assign some value to the function B.
The undef rule applies to B as long as it is a function, and the lack of an
undef means by the time you try to assign the value 0, B is still a defined
function. No magic, just logic here.


Post a reply to this message

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