One more inconsistencies, inability to resolve (overload) property `attr` and 
proc with same name.
    
    
    import std/tables
    
    type Element* = ref object
      tag*:   string
      attrs*: Table[string, string]
    
    proc attrs*[T](self: T, attrs: tuple): T =
      for k, v in attrs.field_pairs:
        self.attrs[k] = $v
      return self
    
    proc h*(tag: string): Element =
      Element(tag: tag)
    
    echo h("dif").attrs((class: "some"))[]
    
    
    Run

Reply via email to