Files
Nim/tests/template/mgensym_generic_cross_module.nim
Andreas Rumpf 22789a0bfc fixes #5419
2017-02-24 00:32:14 +01:00

15 lines
307 B
Nim

template makeDomElement(x: untyped, name: string = nil) =
const tag {.gensym.} = if name == nil: astToStr(x) else: name
proc x*(p: int|float) =
echo tag, p
proc x*(p: string|cstring) =
echo tag, p
#proc wrappedUp[T](x: T) =
# mixin foo, bar
makeDomElement(foo, "foo")
makeDomElement(bar)