Skip to content

namespaces #91

@rcunrau

Description

@rcunrau

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions