Hi! Can I call "original" procedure from overloaded? I Can't find any example for this theme
for example:
proc `$` (x: int):string = "Integer " & ($x)
echo 5
is infinite recursion
as solution a tried to make additional procedure
proc toString (x: int):string = $x
proc `$` (x: int):string = "Integer " & (x.toString())
echo 5
is it a "good practice" in Nim, or there exists another way? (maybe something like a super.<method> from python, or parent.<method> from C#, or base.<method> from C++?) What you want seems to be to define a $ proc for type int and call system.`$` from inside that proc.
proc `$` (x: int):string = "Integer " & (system.`$`(x))
echo 5
$ ./t
Integer 5
I was not sure that echo() would call our new proc, but seems it does :-)