Procedures use "static dispatch" meaning which overload is called is decided at 
compile time. What you are asking here is "dynamic dispatch", which are in Nim 
as multimethods and are made for objects with inheritance and nothing else. To 
achieve what you want, procedures would have a special rule to have dynamic 
dispatch that checks equality of arguments to literals/constants, which would 
be too complex of a rule to be a language feature. Nim is meant to be 
extensible with macros and this is definitely a feature candidate for a macro 
library.

Reply via email to