Skip to content

[SPEC] Gazprea has three namespaces, not two? #146

Open

Description

@Sir-NoChill

Issue: The namespaces.rst section currently describes only two namespaces:

  • Type namespace
  • Variable/Function/procedure namespace

But I think that there are three since we can have something like this:

typealias integer foo;
foo foo = 0;

function foo(foo foo) returns foo {
  ...
}

Variable names are shadowed, so the global foo is not the same as the local foo. Then we have the function named foo and the type foo, so to me that reads as three. Thoughts and opinions? The other fun thing is then the inner struct scope can have additional foos as required, but that is less ambiguous because of scoping.

Recommended fix: Update namespaces.rst to clarify:

  • Type namespace: structs, typealiases (globally unique, so a typealias declared within a function that shadows an outer type alias would be a type error or a symbol error, not exactly sure which atm). This is possible since structs are declared with tagged members struct S(integer a, integer b) s = (a: 0, b: 1);
  • Function/procedure namespace: functions, procedures (globally unique)
  • Variable namespace: variables (scoped; can shadow outer names within scope)

This would align with the de facto behavior and make the scoping rules explicit.

Affected files:

  • namespaces.rst (primary)
  • declarations.rst (mentions variable scoping rules)
  • functions.rst / procedures.rst (mention namespace sharing)

Activity

  1. self-assigned this
    on Sep 10, 2026
  2. changed the title [-]Clarify: Gazprea has three namespaces, not two[/-] [+][SPEC] Gazprea has three namespaces, not two?[/+] on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions