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

runsun runsun at gmail.com
Mon Oct 31 10:43:57 EDT 2016

```Tim, I had the similar confusion, took me a lot of "brain twists" to
understand it. Now that after I keep talking to myself for hours:

"*an if w/o else is a filter*", and "*an if with an else is the same as
cond?A:B*".

I am able to decode it and I think once you keep reminding yourself this
principle, it'd be easier for you, too.

So the example:

>> if ( A ) (  if( B ) x  else if (C) y ) else  z

has 3 if's: the first and 2nd ones, if(A) and if(B), are followed by an
"else", so are the same as A?~:~ and B?~:~, respectively

The 3rd one, if(C), has no "else", so it is a filter. So it can be
translated to the "imagined workable code":

A? ( B?x: if(C)y) : z

Once this principle is embedded in mind, it becomes easy.

In the mean time, however, I believe this construct will continue to
frustrate future (or even current) users.

-----

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

```