POV-Ray : Newsgroups : povray.advanced-users : <no subject> : <no subject> Server Time
20 May 2024 06:57:09 EDT (-0400)
  <no subject>  
From: Bald Eagle
Date: 3 Jul 2023 19:45:00
Message: <web.64a35d5ec23a6d91f9dae3025979125@news.povray.org>
So, I had some experiments I wanted to try, but I need to make some functions
that are based on other functions.
In order to vary what base function I use, I have to do that with a macro, which
seems to work fine, but I seem to be missing something, either in the creation
syntax or the invocation syntax.


#declare Zero = function (N) {0}
#declare One = function (N) {1}


#macro MakeFunction (Function)
 function {Function (0) + 1}
#end

#declare Two = MakeFunction (One);

#debug concat( "Zero = ", str (Zero (10), 0, 3), "\n")
#debug concat( "One = ", str (One (10), 0, 3), "\n")

#declare Val = Two (10);

#debug concat( "Two = ", str (Val, 0, 3), "\n")

That gets me:

Parse Error: Expected 'numeric expression', ) found instead

I have yet to find a way around that.  Though I could swear that I've done
something similar to this before....


Does anyone have any ideas?



- BW


Post a reply to this message

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