Hi, I'm very noob with macros, I'm trying to learn, but I'm getting this error:

undeclared field: 'kind' for type system.NimNode
    
    
    proc createSlide(title, body: varargs[string]) =
      echo "createSlide", title, body
    
    proc slideDslImpl(head, body: NimNode): NimNode =
      if body.kind == nnkIdent:
        var args: seq[string]
        for n in body.sons:
          if n.kind == nnkStrLit:
            args.add n.strVal
        result = createSlide(body.strVal, args)
    
    macro slide*(head, body: untyped): untyped =
      result = slideDslImpl(head, body)
      echo result.treeRepr # let us inspect the result
    
    
    Run

Reply via email to