POV-Ray : Newsgroups : povray.bugreports : Bug in functions (3.7) : Re: Bug in functions (3.7) Server Time
19 May 2024 16:37:10 EDT (-0400)
  Re: Bug in functions (3.7)  
From: Christian Froeschlin
Date: 10 Nov 2008 06:36:47
Message: <49181ccf$1@news.povray.org>
SharkD wrote:

> Christian Froeschlin <chr### [at] chrfrde> wrote:
> 
>>Kenneth wrote:
>>
>>
>>>#local Temp_function_2 = function{Temp_function(x,y,z)}
>>
>>Thats defining Temp_function_2 to be a function
>>which just happen to pass its default arguments
>>x,y,z to Temp_function.

> I thought this was the way to make an exact copy of a function? If I am wrong,
> what is the proper way to do it?

The syntax doesn't seem to distinguish between those cases.
As the result returned by the function is the same in both
cases, its more a question of internal optimization.

BTW, I thought I would be able to spot a difference with

#local f_A = function {0}
#local f_B = function {f_A(x,y,z)}
#debug str(f_B(0,0,0),2,0)
#undef f_A
#local f_A = function {1}
#debug str(f_B(0,0,0),2,0)

but it seems that dependant functions are always copied
(or possibly kept alive using some reference counting?),
as the output for both debug statements is consistently
equal, even if f_B is a composite expression such as
#local f_B = function {f_A(x,y,z)+1}.


Post a reply to this message

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