[OpenSCAD] Openscad Indirect Functions

adrian adrianh.bsc at gmail.com
Mon Oct 10 16:50:50 EDT 2016

Bananapeel wrote
> I don't know why this thread is inside the thread "Convert from object to
> polygon/polyhedron."

Yes, I feel that my thread got hijacked somehow.

Bananapeel wrote
> IMO, there's just one "proper" syntax for this. And that is, that the name
> without () acts as a variable, and () means call. And function becomes
> just another type, like string and int. This means functions and variables
> must occupy the same namespace. This syntax can also work for modules,
> however, this means variables, functions and modules all share the same
> namespace, which currently isn't the case.
> Using () on a variable that isn't of type function or module would give a
> runtime error.

Yes, this sounds somewhat reasonable, but these namespaces don't have to
collide.  They can still be (and really should remain) separate, as changing
this could break a lot of scripts.  One can gain access to the function
namespace using that @ sign (or some other sign.  I assume that & wasn't
used for simplicity):

It would also be nice to have proper lambdas:

This syntax would introduce being able to create true lambdas on the fly,
instead of always having to name them and access the function namespace.

View this message in context: http://forum.openscad.org/Convert-from-object-to-polygon-polyhedron-tp18522p18662.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

More information about the Discuss mailing list