[OpenSCAD] Openscad Indirect Functions

nop head nop.head at gmail.com
Sun Oct 16 11:58:26 EDT 2016


Exactly. Rather than break everything by unifying the namespaces all it
needs is an @ sign that converts a string to a module or function depending
on the context.

It is also more readable than languages that use the type of the variable
instead. When you see an @ you know there is an indirection. Without it you
need to look at the name and find its type is a function pointer and not a
function to realise that.

On 16 October 2016 at 16:28, Greg Frost <gregorybartonfrost at gmail.com>
wrote:

>
> > nophead wrote
> >
> > ...... but you could do that without @ as well:
> >
> >
> > module whatsit (...) {...}
> >
> > module doit(m)
> >    ....
> >    ...transforms...  m(parameters);
> >
> >
> > doit(whatsit);
>
> What if you also had a variable called whatsit?
> That is where the @ comes in. It disambiguates the namespace like () does
> with a function.
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20161016/528ad089/attachment-0002.html>


More information about the Discuss mailing list