[OpenSCAD] Any where to find the doc for lc-each, lc-else and lc-for-c ?
rcmpersiano at gmail.com
Mon Oct 31 11:35:03 EDT 2016
> I think you made it too complicated. It should be expressed as follows
> instead :
>> A? (B?x:
>> ) : z
> which, in my opinion, is a lot easier to both read and write than the 3
> forms you presented.
We are discussing two different matters: the benefits of the if-else filter
in list comprehension and your alternative sintax of it. The first point of
my last message was about the benefits. So, your recoding above mix the two
things and did not help.
The second issue (your alternative to if-else filter) has it own drawbacks.
With my trivial example:
> [ for(a=A) a+(if (a==0) 1) ]
> [ for(a=A) if (a==0) a+1 ]
which is a filter, and not your code:
> [ for(a=A) a==0? a+1:a ]
which is not. The /if/ in the first expression imposes a filter as in your
alternative sintax. That is, if a filter /if/ is allowed as a filter in
conditional expression why wouldn't it be allowed in any expression (keeping
its effect of filtering) ?
View this message in context: http://forum.openscad.org/Any-where-to-find-the-doc-for-lc-each-lc-else-and-lc-for-c-tp18823p18843.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
More information about the Discuss