POV-Ray : Newsgroups : povray.text.scene-files : foreach macro : Re: foreach macro Server Time
15 May 2021 19:50:27 EDT (-0400)
  Re: foreach macro  
From: William F Pokorny
Date: 27 Apr 2021 19:56:24
Message: <6088a4a8$1@news.povray.org>
On 4/27/21 6:52 AM, jr wrote:
> hi,
> 

Played a few minutes with this just now and you can get your original 
code to run if you change the tail m_l10 macro to:

#macro m_l10(i_,n_)
   #debug concat("----------> level 10, n = ",str(n_,0,0),".\n")
   #fopen FID "parse_fore.tmp" write
   #write (FID,"#---\n")
   #fclose FID
#end

Though by the time it finishes it's consumed 1.6G or more of memory 
after maybe five minutes. My wild guess is all those Parse_String(s) end 
up sitting in memory until parsing is finished. In other words I think 
at the end we have unrolled more or less the whole recursion.

Parse_String is involved in what's happening, but it's not clear to me, 
why - some scope issue maybe as it comes after the last "call" to m_l10.

Bill P.


Post a reply to this message

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