|
![](/i/fill.gif) |
> 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
|
![](/i/fill.gif) |