Argument-Dependent Lookup and Function-Dependent Lookup will both be used when calling functions. ADL happens first. See #13 for order of scope lookup. Unresolved parameters/identifiers are ignored at this point.
After ADL comes FDL - one or more functions have been selected and the selection needs to be narrowed down to just one. First, unresolved parameters/identifiers are attempted to be resolved based on the functions' own local scopes. Only the functions which resolve all parameters/identifiers in the expression are considered.
After FDL resolves parameters/identifiers, traditional type-based lookup should narrow down to one function as with many other languages that allow function overloading.
Resolving parameters/identifiers? Huh?
Functions have privacy and scoping rules too - any publicly exposed members of the function can be considered during FDL, such as enums and types specific to that function. This allows for unqualified names, or names qualified as belonging to the function, to be used in a function call expression and for those names to bind to those within the function's scope.
With f(0, yes), if yes is unresolved for ADL, then ADL will only use 0 to gather functions. Then, FLD will loom for functions that expose yes. If yes would normally be resolved when it should not be, then f(0, f:yes) may be used instead to have it participate in FDL. If each f needs to be different, rather than the same, then yet-to-be-determined function selection syntax can disambiguate this.
Argument-Dependent Lookup and Function-Dependent Lookup will both be used when calling functions. ADL happens first. See #13 for order of scope lookup. Unresolved parameters/identifiers are ignored at this point.
After ADL comes FDL - one or more functions have been selected and the selection needs to be narrowed down to just one. First, unresolved parameters/identifiers are attempted to be resolved based on the functions' own local scopes. Only the functions which resolve all parameters/identifiers in the expression are considered.
After FDL resolves parameters/identifiers, traditional type-based lookup should narrow down to one function as with many other languages that allow function overloading.
Resolving parameters/identifiers? Huh?
Functions have privacy and scoping rules too - any publicly exposed members of the function can be considered during FDL, such as enums and types specific to that function. This allows for unqualified names, or names qualified as belonging to the function, to be used in a function call expression and for those names to bind to those within the function's scope.
With
f(0, yes)
, ifyes
is unresolved for ADL, then ADL will only use0
to gather functions. Then, FLD will loom for functions that exposeyes
. Ifyes
would normally be resolved when it should not be, thenf(0, f:yes)
may be used instead to have it participate in FDL. If eachf
needs to be different, rather than the same, then yet-to-be-determined function selection syntax can disambiguate this.