DynamoDS/Dynamo — pull request #1758 by ke-yu (2014-06-13 04:16:38+00:00)
Title: Compile IF node to inline condition

In this full request, IF node is compiled to inline condition instead of imperative language block with if-else.

The major reason is if IF node is compiled to imperative language block, it can't be passed as a function object to higher order function like List.Map. Besides, it doesn't support replication.

As inline condition will finally be compiled to builtin function ```%inlineconditional()```, IF node could behave like a normal function node. So defect http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-3483 gets fixed.

Note there are still some limitations:
1. Both true and false branches still are evaluated.
2. The signature of ```%inlinecondtional()``` is

```%inlinecondtional(cond:bool, trueExpr:var[]..[], falseExpr:var[]..[])```,

therefore IF node only replicates on its condition. This may give some weird results. Zach confirmed it is
expected behavior, which is captured in test case ```TestIFBasic()```
3. Because of IF's replication behavior, if use IF in custom node, and the input of custom node is an array,
the result would be unexpected. It is captured in test case ```TestIfInCustomNode2()```. The fix would be
in custom node. In short, it requires 1) should be able to set the type of input parameters of custom
node; 2) enable lacing strategy of custom node. I've created a defect
http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-3740 to trace this issue.