[OpenSCAD] Programming in Functional OpenSCAD

doug moen doug at moens.org
Tue Jan 30 18:29:41 EST 2018

It may be possible to use some purely functional data structures in
OpenSCAD. Unlike the 2-3 tree, these data structures are designed to be
efficient in a language with only immutable objects.


OpenSCAD is missing some language features needed by some functional data
structures, but maybe this is a starting point.

On 30 January 2018 at 18:22, Ronaldo Persiano <rcmpersiano at gmail.com> wrote:

> The question is how to build things like Delaunay triangulation when
> needed. You can't do it without the support of a complex data structure.
> 2018-01-30 21:16 GMT-02:00 doug moen <doug at moens.org>:
>> OpenSCAD uses references to reference-counted, immutable values. Multiple
>> variables can point to the same immutable list object. There is no need for
>> OpenSCAD to make copies of lists, since there are no operations for
>> mutating a list. AFAIK; I haven't read all the code in the interpreter.
>> I don't think there's much point in worrying about this, though. Like
>> Ronaldo says, just use the simplest possible data structure. If this leads
>> to a performance problem, and you want to use a more complicated data
>> structure, you should measure the performance to ensure that the more
>> complicated code is actually faster. OpenSCAD doesn't have the same
>> performance characteristics as conventional languages, so your complicated
>> code might be slower.
> _______________________________________________
> 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/20180130/f7902158/attachment-0002.html>

More information about the Discuss mailing list