POV-Ray : Newsgroups : povray.general : Strange behaviour with looped function calls in POV 3.6 Server Time
15 Nov 2024 19:21:09 EST (-0500)
  Strange behaviour with looped function calls in POV 3.6 (Message 1 to 3 of 3)  
From: Florian Brucker
Subject: Strange behaviour with looped function calls in POV 3.6
Date: 28 Jun 2004 14:39:49
Message: <40e065f5$1@news.povray.org>
I get strange error messages running the following code in POV-Ray 3.6 
(It works fine in 3.5):

<POV>
#declare MyF = 	function { 1 }

#macro Test(F)
	(1)
#end

#local a = 0;
#while (a<20000)
   		
	#debug "Works\n"
	#local Dummy = Test(MyF);  			
   		
	#local a=a+1;
#end
</POV>



Here's the output:

<output>
...
Works
Works
Works
Works
Works
Works
File: bugsearch.pov  Line: 13
File Context (5 lines):
#while (a<20000)

#debug "Works\n"

#local Dummy = Test(MyF)
Parse Error: Identifier expected, incomplete function call or spline 
call found
  instead.
</output>


As you can see, it outputs "Works" more than 50 times (did not copy all 
of it :) before raising the error. I don't understand this, as each time 
absolutely the same code is executed (content of identifiers are 
unchanged etc.).

If I use

	#local Dummy = Test(function { MyF(x,y,z) });  			

(i.e. wrapping the function in another function block), it works again.

I'm experiencing this on Gentoo 2004.0, with 1 GB Ram and POV 3.6 
official binaries. As I said before, it works without problems under POV 
3.5.

Can anyone confirm this behaviour?

Florian


Post a reply to this message

From: Chambers
Subject: Re: Strange behaviour with looped function calls in POV 3.6
Date: 28 Jun 2004 17:45:00
Message: <web.40e090e23e8f0090ca11893c0@news.povray.org>
I can confirm that it runs for a couple hundred calls, then crashes POV 3.6
(official) on a PentiumIII ~730mHz w/ 128Megs of RAM running Windows98.

Strange, indeed...

....Chambers


Post a reply to this message

From: Hughes, B 
Subject: Re: Strange behaviour with looped function calls in POV 3.6
Date: 29 Jun 2004 02:31:59
Message: <40e10cdf$1@news.povray.org>
"Chambers" <bdc### [at] yahoocom> wrote in message
news:web.40e090e23e8f0090ca11893c0@news.povray.org...
> I can confirm that it runs for a couple hundred calls, then crashes POV
3.6
> (official) on a PentiumIII ~730mHz w/ 128Megs of RAM running Windows98.

961 times here, then the error.  ;-)

Seems to me that there had been talk of this kind of thing before; that is,
repeated macro calls of a function. Not too sure. I don't know why it would
be limited, if so. I'm just thinking #undef could be the only solution then,
as per my unclear memory on the subject. Checking that, with #undef Dummy
added to the end of the loop, lets it continue without a problem.

Bob H.


Post a reply to this message

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