POV-Ray : Newsgroups : povray.programming : Fuctions : Re: Fuctions Server Time
28 Jul 2024 14:29:38 EDT (-0400)
  Re: Fuctions  
From: Chris Huff
Date: 24 Jul 2000 18:01:42
Message: <chrishuff-81E2AC.17022224072000@news.povray.org>
In article <B5A20496.1935%dav### [at] maccom>, David 
<dav### [at] maccom> wrote:

>     Well, for one, a fuction can return a var. Perhaps you can return 
> with a marco, but I don't know how...

Macros can return variables and expressions:
#macro Foo(Bar)
    #local Blah = Bar*2;
    Blah
#end
#macro Foo2(Bar)
    (Bar*2)
#end

They can also recurse, can have local variables, and can contain any 
statement you can put in a POV file, other than macro definitions.


> Functions can have templates. Hmmm...what else...fuctions can be used for
> overloading.

No. Those are specific features of C++ functions, and perhaps of 
functions in some other languages. They are not required in order for 
something to be a "function", but are features of a specific language, 
which happens to be quite a bit different from POV-Script. C, for 
example, has functions, but does not have overloading or templates.
Some of those could be added to POV macros, and some aren't necessary or 
couldn't be done even if functions were used, because of the structure 
of POV-Script.


> The list goes on.

Please continue, then.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

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