As was mentioned that's invalid Nim code. At one point I did throw together 
this macro for someone in the realtime chat which is similar to what you want. 
    
    
    import std/macros
    
    macro `<-`(p: untyped, args: array): untyped =
      let
        t = args.getType
        count = t[1][^1].intval
      result = p.copyNimTree
      var exprs: seq[NimNode]
      for x in 0..count:
        result.add nnkBracketExpr.newTree(args, newLit(x))
    
    proc test(a, b, c: int) = discard
    
    let a = [1, 2, 3]
    test() <- a
    
    
    Run

Reply via email to