why the proc in the ansi_c.nim does not export with "*"?
BTW,how can i echo a val's type msg? var i = 10 echo(type(i))
the error is
test.nim(8, 5) Error: type mismatch: got (typedesc[int]) but expected one of: system.$(x: int64): string system.$(x: uint64): string system.$(x: seq[T]): string system.$(x: float): string system.$(x: char): string system.$(w: WideCString, estimate: int): string system.$(x: T): string system.$(x: cstring): string system.$(x: int): string system.$(x: string): string system.$(s: WideCString): string system.$(x: T): string system.$(x: TEnum): string system.$(x: set[T]): string system.$(x: bool): string os.$(err: TOSErrorCode): string
why the proc in the ansi_c.nim does not export with "*"?
Why should we? Properly designed C interfaces expose their own free wrapper anyway for technical reasons.
import typetraits
var i = 10
echo(name(type(i)))
this is pretty useful, I'm going to keep it around
import typetraits
proc `$`* [T] (some:typedesc[T]): string = name(T)
template test (x): stmt =
echo "type: ", type(x), ", value: ", x
test 42
test "Foo"
test(@['A','B'])