I just tried to optimize the gintro generated code a bit.
One known issue is the alias for proc names -- some people like the get and set
prefixes for getters and setters, others don't. Like in container.getChild() vs
container.child().
Some years ago I tried to use plain const proc names as alias, but there was an
issue, so I generated the procs twice. No problem, but not optimal for compile
time, and only optimal for executable size when the compilers are smart.
So I tried again using const, and now I remember the issues:
#proc getLength(i: int): int=
# sizeof(i)
proc getLength(s: string): int =
s.len
const
length = getLength
echo length("alias")
Run
Works fine when the topmost proc is not present -- but for gtk with more then
10k procs there is often a conflict.
Maybe now, some years later, there is a solution? Can we give full parameter
list for proc consts? Or use templates? Or something like "when compiles" to
skip conflicts? Or continue generate procs twice?