Nim is far more orthogonal than C, which means you don't even need a ternary 
operator (and I don't meant that the Go way).

An if can also be an expression, as long as it's guaranteed to return something 
of a certain type: 
    
    
    let x = (if true: 4 else: 2)
    
    
    Run

But this goes further: 
    
    
    let x = (case 0
      of 1: 4
      of 4: 1
      else: 9)
    
    
    Run

This goes even further 
[https://nim-lang.org/docs/manual.html#statements-and-expressions-block-expression](https://nim-lang.org/docs/manual.html#statements-and-expressions-block-expression)

Reply via email to