[OpenSCAD] eval( ) ???

G. Wade Johnson gwadej at anomaly.org
Wed May 13 08:14:49 EDT 2015


On Tue, 12 May 2015 22:17:20 -0400
doug moen <doug at moens.org> wrote:

> My feeling is that it's more important to have first class function
> values, and eval() is a poor substitute.

Definitely agree that function values is a better idea. Plus eval()
almost always results in major unintended consequences.

> FWIW, first class function values is part of the set of changes that I
> am currently discussing with Marius.
> 
> Doug Moen.
> 
> On 12/05/2015, runsun <runsun at gmail.com> wrote:
> > What do you guys think to have an eval() to evaluate code ?I am
> > thinking that
> > this would help in area where "function as a variable"  is needed,
> > which openscad can't do.For example, we can have a module call Line
> > from point P to Q :
> >
> >> module Line ( [P,Q],
> > *
> >> formula="sin(x)"
> > *
> >> ,
> > *
> >> scope=["x",[0,90,180,270]]
> > *
> >>   ){      formula to be converted to points :     points0 =
> > *
> >> eval( formula, scope )
> > *
> >>     (some other processings to use points0): points = ....
> >> faces= ....
> >>
> >> polyhedron( points= points, faces=faces)}
> >
> > Once this is set, we can have all kinds of different shapes of
> > Lines, generating from this single Line module.
> >
> >
> >
> >
> > -----
> >
> > $  Runsun Pan, PhD
> >
> > $ -- OpenScad_DocTest: doc and unit test ( Github , Thingiverse  )
> >
> > $ -- hash parameter model: here , here
> >
> > $ -- Linux Mint 17.1 Rebecca x64  + OpenSCAD
> > 2015.03.15/2015.04.01.nightly
> >
> >
> >
> >
> > --
> > View this message in context:
> > http://forum.openscad.org/eval-tp12627.html Sent from the OpenSCAD
> > mailing list archive at Nabble.com.
> 
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


-- 
Understanding is a three-edged sword.      -- Kosh in "Deathwalker"




More information about the Discuss mailing list