POV-Ray : Newsgroups : povray.general : how to call multiple instances of a macro? Server Time
30 Jul 2024 16:18:27 EDT (-0400)
  how to call multiple instances of a macro? (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Christian Froeschlin
Subject: Re: how to call multiple instances of a macro?
Date: 12 Mar 2009 05:53:41
Message: <49b8dba5$1@news.povray.org>
clipka wrote:

> POV SDL may be cumbersome at times, but let nobody say it wasn't flexible...

ah very clever, faking an eval using file I/O! What a dirty trick ;)


Post a reply to this message

From: Christian Froeschlin
Subject: Re: how to call multiple instances of a macro?
Date: 12 Mar 2009 05:59:48
Message: <49b8dd14$1@news.povray.org>
CShake wrote:

> I wonder how much overhead this really causes, I figure that Christian 
> Froeschlin's method of just using a selection macro and assigning 
> numerical values to each macro name would be slightly more efficient 
> when parsing, but involves more work for the user and is not very flexible.

if you don't call it thousands of times I think the overhead for
file I/O won't be too bad. Otherwise, a compromise might be to
generate the selection macro itself using #write in a loop.


Post a reply to this message

From: clipka
Subject: Re: how to call multiple instances of a macro?
Date: 12 Mar 2009 11:35:01
Message: <web.49b92ae2dc08335f708085d0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> ah very clever, faking an eval using file I/O! What a dirty trick ;)

YESS! =B)

"If at first you don't succeed... resort to dirty tricks"

The #write and #include combo rules!

I recently embarked on using file I/O to re-use interim parsing results, only to
find that hey, why mess around with #read and yet another #while loop to
assemble the objects in the second pass, when you can do *all* the work in the
first pass and just #include the whole smash...

From there, it is only a small step to #writing out complete scene files... or
just very short snippets of code, for that matter.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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