POV-Ray : Newsgroups : povray.programming : ATT: POV team and everyone - POV4 design proposal : Re: ATT: POV team and everyone - POV4 design proposal Server Time
28 Jul 2024 22:29:18 EDT (-0400)
  Re: ATT: POV team and everyone - POV4 design proposal  
From: Mark Wagner
Date: 14 Jan 2002 00:18:41
Message: <3c426a31@news.povray.org>
Eugene Arenhaus wrote in message <3C41628F.7B4132C1@avalon-net.co.il>...
>Can I make a macro that would calculate a macro that I would pass it in
>a parameter?


Do you mean you want to pass a macro name to a macro, and then have that
second macro evaluate the first macro?  Try something like this from my
implementation of a binary search tree ADT in POV:

#macro Parse_String(String)
    #fopen FOut "parse_string.tmp" write
    #write(FOut,String)
    #fclose FOut
    #include "parse_string.tmp"
#end

#macro Compare(Data, D, _BST_COMPFUNC) /* _BST_COMPFUNC is a string
containing the name of a macro or internal function with the same semantics
as the strcmp function */
    #local Comp = Parse_String(_BST_COMPFUNC) (Data, D); /* Evaluates the
macro with the parameters Data and D */
    Comp
#end


Post a reply to this message

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