[OpenSCAD] Programming in Functional OpenSCAD

TLC123 torleif.ceder at gmail.com
Sat Jan 27 00:18:53 EST 2018


Those named indexes is a neat style .
Paired with some selected glue comments it has potential.
And with a helper constructor function it hides the "listness" of the data.
I like it. 


// NamedStruct "2-3TreeNode"
BRANCH1  = 0; // pointer
VALUE1     = 1; // value
BRANCH2  = 2; // pointer
VALUE2     = 3; // value
BRANCH3  = 4; // pointer
//

function new_2-3TreeNode ( BRANCH1, VALUE1 , BRANCH2, VALUE2, BRANCH3)=
                                         [BRANCH1, VALUE1 , BRANCH2, VALUE2,
BRANCH3];





--
Sent from: http://forum.openscad.org/




More information about the Discuss mailing list