[OpenSCAD] Functions literals / higher order functions

Ronaldo Persiano rcmpersiano at gmail.com
Mon Nov 25 21:23:57 EST 2019


Inserting an indirection also works fine:


function move(a, g) =
  function(x) identity(x+a) ;

function  identity(x) = x;

g1 = function(x) x;
g2 = move(0,g1);
g3 = move(0,g2);

echo(g3_x=g3);
echo(g3_2=g3(2));



>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20191126/20d0bf4d/attachment.html>


More information about the Discuss mailing list