You can use a template instead of a proc:
template usesFoo =
foo()
block:
proc foo = echo "a"
usesFoo
block:
proc foo = echo "b"
usesFoo
# prints:
# a
# b
Run
- Is there a default initializer that can be overloaded? spip
- Re: Is there a default initializer that can be overloaded? dawkot
