POV-Ray : Newsgroups : povray.beta-test : Optional way to handle #include files? : Re: Optional way to handle #include files? Server Time
2 Jul 2024 09:34:02 EDT (-0400)
  Re: Optional way to handle #include files?  
From: clipka
Date: 1 Aug 2010 07:58:53
Message: <4c55617d$1@news.povray.org>
Am 01.08.2010 01:14, schrieb stbenge:
> Chris Cason wrote:
>> We could I suppose have a "fast_macro" keyword which is explicitly
>> defined
>> as being cached in memory. But none of us have the time to write this
>> ATM.
>
> Something like that would be great, mainly if you could mark *any* macro
> as being a fast_macro, so that official macros could be used in this
> manner without editing the includes files they come from.

Good point.

So maybe a suitable syntax would be:

     #macro Foo(...)
       ...
     #end
     #fast_macro Foo

where "#fast_macro IDENTIFIER" would cause the parser to retrieve the 
specified macro into memory.

I'd also suggest not to store the content of the macro literally, but 
rather in an already tokenized form, as I guess this would speed up 
things even a bit more.


BTW, when revisiting macro syntax, I think it would be a good idea to 
also introduce "local" macros, in analogy to local variables. But that's 
another story.


Post a reply to this message

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