POV-Ray : Newsgroups : povray.general : Attempt to POV4 Syntax basics : Re: Attempt to POV4 Syntax basics Server Time
31 Jul 2024 04:22:33 EDT (-0400)
  Re: Attempt to POV4 Syntax basics  
From: Nicolas Alvarez
Date: 5 Oct 2007 15:09:29
Message: <47068be9@news.povray.org>

> some years ago, I had to produce individual images of a great number of 
> windows.
> I had a macro like this :
>  #macro Window (Height,Width,TopArc,MullionThick,...) //many parameters
> 
> When invoked, it looked like :
>  Window (250,300,25,5,2,1,1,4,6,120,5)
> 
> ...unreadable as hell.  I would loved to be able to do
>  Window {height = 250 width = 130 mullion_thickness = 5 ...}
> in any order, and with default values.
> 
> This is an example where an apparently more complex syntax
> leads to easier understanding.
> 
> Fabien.

Well, most languages don't have named parameters. But you can do this in 
OOP languages:
Window w = new Window();
w.height=250;
w.width=130;
...
w.createForReal(); //this creates the actual POV object

Or use the named parameter idiom, quite interesting: 
http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18

None of the three (real named params, the idiom using constructors, or 
changing properties) can be done with POV-Ray currently... Yep, we 
really need a new language :)


Post a reply to this message

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