POV-Ray : Newsgroups : povray.unofficial.patches : Step function : Re: Step function Server Time
29 Apr 2024 03:49:14 EDT (-0400)
  Re: Step function  
From: Chris Huff
Date: 22 Aug 2000 14:08:04
Message: <chrishuff-33264E.13092622082000@news.povray.org>
In article <39A2B900.9BC7401A@usb.ve>, jac### [at] usbve wrote:

> So macro substitution doesn't work inside function{...}. I thought that
> at parse time, this macro substitution would take effect.
> 
> Is that a MegaPov misbehavior or is this intended for some reason?

This is the reason I wrote it as a function. :-)
No, macros don't work within functions, neither do #if, #switch, or 
#while. How should the internals of the macro work? Macros can have 
local variables and can do different things for each time they are 
called. The only way I can see to do it would be to have the macro be 
evaluated once, at parse time, but this would make it appear to the user 
that the macro is called from within the function, when it is really 
called to make part of the function.

I think the best way to do things would be to extend functions to have 
variable numbers of parameters(so you could just have 1 parameter, or 5, 
instead of always having 3), allow functions to be called like macros 
from within the scene file, and to extend the function language with 
loops, variables, and conditionals(there is already an if() function, 
but a slightly different syntax could be useful).

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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