import std/macros
    
    macro examine(ident: typed{sym}) =
        # My goal is to read the list of arguments right here, but
        # the following line fails with the error: "node is not a symbol"
        echo ident.getImpl.treeRepr
    
    # ----
    
    proc someProc[T](arg: T) =
        discard
    
    examine(someProc)
    
    
    Run

If you want to look up a symbol you need to have `typed` ast, as `ident` s are 
just fancy strings labels. As it's easier I used the Nim constraints so it'll 
only take `{sym}` s.

Reply via email to