I know that nim can use expressions for default values in procedures (saw it somewhere in stdlib), but until today I never realized that I could also make use of other parameters in the expression.
proc ape(a: string, b: string = ("no" & a)): string = "🐒 " & a & b
echo ape("bo")
output:
🐒 bonobo
I find it an extremely cool feature, but I was not able to find a reference in the documentation of this (well, I checked Manual and Tutorial), not even for the fact that you can use expression in parameters. Anyone knows a documentation source for this? Are there any gotchas about it? Happy to make a doc PR somewhere if it can improve visibility of this feature.