`with` is a keyword, so you can't use that. You could use something like this 
maybe? 
    
    
    import macros
    
    macro take(args,body:untyped):untyped =
      result = newstmtlist()
      result.add(newvarstmt(args[^1],args[1]))
      for st in body: result.add(st)
    
    take 3 as f:
        echo f
    

(I haven't really used macros a lot, there's probably a better way to copy the 
nodes from `body`)

Reply via email to