[OpenSCAD] Any where to find the doc for lc-each, lc-else and lc-for-c ?
rcmpersiano at gmail.com
Mon Oct 31 14:50:56 EDT 2016
> So a legitimate question is: why not just allow the filter
> (if(B) yyy)
> in a "cond?~:~" ?
You have answered the question in your preceding message:
> Re-arranging "if(a==0) a+1" to "a+(if (a==0)1)" and suggesting they are
> same doesn't make any sense at all. If "a" is subject to the conditional
> pick/drop, why would it be placed BEFORE if ? I couldn't ever imagine an
> "if" can simultaneously decide the fate of the code before it (a) and
> it (1). That is a mess-up of scopes and only makes it more confusing.
That is exactly what is happening when you write something like:
> [for (a=A) a % 2 == 0 ? a: if (a!=1) a*10 ]
the filter /if/ *is deciding "the fate of the conditional before it"*. In
fact, the conditional expression above would not act as an expression but as
a filter. And that is confusing!
I agree that is inappropriate to call the construct if-else a filter and
that it is just a conditional that accepts filtering. But it is not
equivalent to ?: because it is not an expression either.
View this message in context: http://forum.openscad.org/Any-where-to-find-the-doc-for-lc-each-lc-else-and-lc-for-c-tp18823p18846.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
More information about the Discuss