This shows you the differences between two versions of the page.

Link to this comparison view

if [2019/07/01 14:25] (current)
a.leofreddi created
Line 1: Line 1:
 +====== If ======
 +The if function evaluates the given expression and returns the first value if true, else the second.
 +The ternary operator implementation is backed by an if call, so that ''​a ? b : c''​ is equivalent to ''​if(a,​ b, c)''​.
 +===== Signature =====
 +T if(Boolean expr, T first, T second)
 +//T is a type variable, so it can bind any type//
  • if.txt
  • Last modified: 2019/07/01 14:25
  • by a.leofreddi