[OpenSCAD] Openscad Indirect Functions

Richard Urwin soronlin+openscad at googlemail.com
Mon Oct 17 11:23:10 EDT 2016

doug.moen wrote
> 3. Introduce a "pragma" statement that you write as the first line of a
> script, specifying whether all identifiers are in a single namespace, or
> in
> 3 namespaces. This provides pretty good backwards compatibility. If the
> default is the single namespace, then that's the best solution going
> forward for new code (a single namespace is simpler and easier to
> understand), but some old scripts will need to be modified to add the
> pragma.

Suppose instead, we mandated a first line for new programs. Let's make it
useful and specify a language version:

OpenSCAD 1.9

Then if that line is not present, all function names are prefixed "F_", all
modules are prefixed "M_" and all variables (and identifiers in expressions
not followed by open-parenthesis) are prefixed "V_". That creates three
namespaces for very low cost.

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

More information about the Discuss mailing list