Quick actions

cmd+k|ctrl+k

Navigation

Languages

Untitled

Snippet info

Language

Nim

Visibility

unlisted

Author

legacy-anonymous

Created

2017-04-18T00:04:14Z

Updated

2017-04-18T00:04:14Z

import macros

proc foo(bar: float): float = bar

proc foo(bar: int): int = bar

macro print2():untyped =
  echo "Implementation one:"
  echo treerepr getImpl(symbol(bindSym("foo")[0]))
  echo()
  echo "Implementation two:"
  echo treerepr getImpl(symbol(bindSym("foo")[1]))
  

print2() # this also echoes the body
INFO