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
- Do you miss these compact syntaxes? JohnAD
- Do you miss these compact syntaxes? ringabout
- Do you miss these compact syntaxes? didlybom
- Do you miss these compact syntaxes? alexeypetrushin
- Do you miss these compact syntaxes? inv2004
- Do you miss these compact syntaxes? Zoom
- Do you miss these compact syntaxes? Akito
- Do you miss these compact syntaxes? alexeypetrushin
- Do you miss these compact syntaxes? alexeypetrushin
- Do you miss these compact syntaxes? blackmius
- Do you miss these compact syntaxes? alexeypetrushin
- Do you miss these compact syntaxes? ElegantBeef
