MichaelAtOz,
in OpenSCAD you can call functions and modules with an unlimited number of
arguments - e.g. you don't get an error with misspelled paraemeter names,
which can be nasty problem when it comes to tracking an error.
However, the good news (with respect to $arguments) is: Those arguments that
are not defined in the prototype are currently ignored. The bad news is:
they are not accessible at all. So you can't implement functions and modules
with a variable number of arguments unless you pack them into a list, parse
this list and solve the naming problem.
myfunc(1,2,3,a=4,b=5,c=6);
module myfunc() echo("works but no args declared");
So the new $arguments variable would allow for:
module myfunc() echo("works withargs ", $arguments);
and give access to any provided parameters and its names which can also be
"$argument_x" if anonymous, as is the case in the call
myfunc(1,2,3,a=4,b=5,c=6);
But let me mention that OpenSCAD already provides an even wierder mechanism.
You don't have to declare parameters at all. Why not just use them and trust
on the caller?
myfunc(1,2,3,a=4,b=5,c=6);
module myfunc() echo("works even no args were declared: ", a, b, c);
--
Sent from: http://forum.openscad.org/