You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow using block labels as qualifiers for symbols defined in them, i.e. block1.proc1.
Motivation
In situations like this, there is no way to disambiguate them (nim-lang/Nim#18785):
procfoo() =echo1block:
procfoo() =echo2foo()
let x = foo
If we add a label to the block, we could qualify each proc by using the module name for the first proc, and the block label for the second proc.
Description
Not super sure how block labels are implemented, but I think the best way to implement this would be by setting the owner of the defined symbol to the block label symbol, if this is not the case already.
Not sure if module1.proc1 works for symbols defined in blocks. If so, it should be made so they shouldn't.
Code Examples
procfoo() =echo1block fooBlock:
procfoo() =echo2foo()
modulename.foo()
fooBlock.foo()
let x = modulename.foo
let y = fooBlock.foo
Backwards Compatibility
Macros that extract the modules of symbols using the owner field might have to account for this situation. i.e.
Abstract
Allow using block labels as qualifiers for symbols defined in them, i.e.
block1.proc1
.Motivation
In situations like this, there is no way to disambiguate them (nim-lang/Nim#18785):
If we add a label to the block, we could qualify each proc by using the module name for the first proc, and the block label for the second proc.
Description
Not super sure how block labels are implemented, but I think the best way to implement this would be by setting the
owner
of the defined symbol to the block label symbol, if this is not the case already.Not sure if
module1.proc1
works for symbols defined in blocks. If so, it should be made so they shouldn't.Code Examples
Backwards Compatibility
Macros that extract the modules of symbols using the
owner
field might have to account for this situation. i.e.Although they are probably already implemented like this, which should not be affected:
The text was updated successfully, but these errors were encountered: