[OpenSCAD] Any where to find the doc for lc-each, lc-else and lc-for-c ?

runsun runsun at gmail.com
Sun Oct 30 06:50:45 EDT 2016


Trying out the newest snapshot 2016.10.04 (git 7e0935d) and found these new
features: lc-each, lc-else and lc-for-c

Can't seem to find docs/examples about them in  list comprehension
<https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/List_Comprehensions>  
doc.

The lc-else is easy to understand:


> list = [ for (a = [ 1 : 8 ]) if (a % 2 == 0) a else a*10 ];
> echo(list); // ECHO: [10, 2, 30, 4, 50, 6, 70, 8]

But I am a bit wondering what's benefit of it over this shorter one:


> list = [ for (a = [ 1 : 8 ]) (a % 2 == 0)? a : a*10 ];

I can't figure out the other two and will need help. 







-----

$  Runsun Pan, PhD $ libs: doctest , faces ( git ), offline doc ( git ), runscad.py ( 2 , git ), synwrite ( 2 );   $ tips: hash ( 2 ), matrix ( 2 , 3 ), sweep ( 2 , 3 ), var ( 2 ), lerp , animation ( gif , prodVid , animlib ), precision ( 2 ), xl-control , type , rounded polygon , chfont , tailRecur ( 2, 3 ), isosphere ( 2 ), area , vol/center , RGB , CurvedImg , tests ( 2 ); $ Apps: rollApp , blockscad , openjscad , on AWS ( pdf ) 
--
View this message in context: http://forum.openscad.org/Any-where-to-find-the-doc-for-lc-each-lc-else-and-lc-for-c-tp18823.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list