Ok, then I think I understand a bit of the problem. I have written a quick 
macro (bugs may exist) `expandIfCall` which let's you write inline 
if-statements like you showed earlier: <https://play.nim-lang.org/#ix=4ga3>

What it does is essentially if you write:
    
    
    expandIfCall fun(if cond1: a else: b)
    
    
    Run

It will expand it to:
    
    
    if cond:
      fun(a)
    else:
      fun(b)
    
    
    Run

It _should_ also work with multiple arguments:
    
    
    expandIfCall fun(if cond1: a else: b, if cond2: c else: d)
    
    
    Run

And rewrite it to the much more verbose:
    
    
    if cond1:
      if cond2:
        fun(a, c)
      else:
        fun(a, d)
    else:
      if cond2:
        fun(b, c)
      else:
        fun(b, d)
    
    
    Run

I hope could be useful as a starting point at least for what you want to 
achieve. 

Reply via email to