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

runsun runsun at gmail.com
Mon Oct 31 13:13:42 EDT 2016


After getting more familiar with this, I have this thought:

[ for(...) if(A) xxx else yyy ]  // allowed
[ for(...) if(A) (*if(B) xxx )* else yyy ]  // allowed
[ for(...) if(A) xxx else *(if(B)yyy )* ]  // allowed

They are basically the same as  :

[ for(...) A? xxx : yyy ]  // allowed
[ for(...) A? *(if(B)xxx)* : yyy ]  // NOT allowed
[ for(...) A? xxx : *(if(B) yyy)* ]  // NOT allowed

Since ALL "if-else" (w/o the filter *(if(B) yyy)*) are the same as
"cond?~:~" (both are *either-or conditional forks*), the only purpose of
introducing "else" seems to allow a filter *(if(B) yyy)* be valid.

That is, in order for a filter *(if(B) yyy)* to be legitimate, instead of
making it legitimate in the already-existing construct "cond?~:~", we create
a new one "if-else" that changes the role of "if", making it a source of
confusion.

So a legitimate question is: why not just allow the filter *(if(B) yyy)* in
a "cond?~:~" ?



-----

$  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-tp18823p18845.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list