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

Ronaldo rcmpersiano at gmail.com
Mon Oct 31 18:04:40 EDT 2016


This will be my third message trying to clarify my point about your proposed
syntax. And, I promise, it will be the last one.

The operator *?:* is a ternary operator. As such, it requires 3 operand, no
more no less. In the expression you prefer:

>  a % 2 == 0 ? a: if (a!=1) a*10

when a=3 the operator *?:* receives the following operands: true, 3 and
<nothing>. That is, it receives just 2 operands as the filter *if* returns
nothing at all. And you expect the operator *?:* returns nothing at all in
this case. That is a twisted (and confusing) behavior of it. 

The *if-else* construct on the other hand has the *very special property*
that it returns nothing if the followed branch (either true or false)
receives nothing. And that is the reason why it cannot be used (like filter*
if*) as a operand of any other operator except itself and the filter* if*.

If we allow the operator *?:* receives less that 3 operands why not allow
the sum operator* +* receives less that two?



--
View this message in context: http://forum.openscad.org/Any-where-to-find-the-doc-for-lc-each-lc-else-and-lc-for-c-tp18823p18848.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list