I have this code:
type Answer* {.pure.} = enum
A, B, C, T, N
converter `$`*(a: Answer): string =
case a:
of Answer.T:
"Tak"
of Answer.N:
"Nie"
else:
$a #How to call parent?
echo (A, B, T, N)
https://play.nim-lang.org/#ix=3ytJ
I want to get this output: (A, B, Tak, Nie).
Right now it's looping forever, because it's calling itself.
I know that I could assign string to enum, but in the future I wanted them to be translated.
I think that the proc to call is this one: https://nim-lang.org/docs/dollars.html#%24%2CEnum but how can I explicitly call it, as to break the loop?
system.`$`(a)