We currently have two namespaces: user defined types and everything else (variables, and functions).
Interesting that both Rust and C++ have 1 namespace, but they each have different rules about how to avoid collisions in common situations. I'm just mentioning this because we are still working through all the issues of having user defined types.
The first example (and major?) example is instantiation:
struct C (integer a, integer b);
function C(integer a, integer b) returns (integer, integer) {
return (a, b);
}
function main() returns integer {
C v = C(1, 2);
return 0;
}
If we had one namespace you couldn't declare function C because struct C is already defined. Would that not solve the ambiguity in main?
We currently have two namespaces: user defined types and everything else (variables, and functions).
Interesting that both Rust and C++ have 1 namespace, but they each have different rules about how to avoid collisions in common situations. I'm just mentioning this because we are still working through all the issues of having user defined types.
The first example (and major?) example is instantiation:
struct C (integer a, integer b);
function C(integer a, integer b) returns (integer, integer) {
return (a, b);
}
function main() returns integer {
C v = C(1, 2);
return 0;
}
If we had one namespace you couldn't declare function C because struct C is already defined. Would that not solve the ambiguity in main?