POV-Ray : Newsgroups : povray.general : Problem with name space for user-defined functions : Re: Problem with name space for user-defined functions Server Time
24 Apr 2024 03:19:25 EDT (-0400)
  Re: Problem with name space for user-defined functions  
From: Kenneth
Date: 4 Apr 2018 20:45:01
Message: <web.5ac57135f0f198f8a47873e10@news.povray.org>
I'm understanding most of this-- although I confess that the 'dictionary'
feature is new to me. I knew it was added to v3.8, but I'm currently clueless as
to what it's for  :-O

From a user's standpoint re: functions, I think the actual problem-- a small
one--may be with the error message itself (and maybe the documentation about
#undefining a function). For example...

#declare B = function(0)
#declare B = 0

The error message (as Tor Olav mentioned) is...
"Redeclaring functions is not allowed-- #undef the function first!"

Until now, I've understood that to mean, "if I try to re-define the first
function as another FUNCTION".  Like,

#declare B = function{0}
#declare B = function(y){sin(2*pi*y)}

Although, I now see that there's a *different* way of reading the error
message-- the way that was probably intended: "Don't try to redeclare a function
name without undefining it first." That solves the ambiguity. It may not be
technically accurate, but it takes care of situations like my first example
above.


Post a reply to this message

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