Skip to content
This repository was archived by the owner on Jun 27, 2022. It is now read-only.

[Lang Enhancement Proposal] Implementation of namespaces using namespace NAME { } #73

Description

@Luna-Klatzer

Affected area by change:

  • Language Syntax: yes
  • Language Library (Parac Base Library): no
  • Compiler: yes
  • Pre-Processor: no
  • Documentation: yes

Short Introduction and Summary
Implement namespaces for mangling variable names and differentiate variable names in one or more files.

Is your request related to a problem? Please describe.

Currently, with the planned implementation of name mangling, namespaces will have to be implemented in a certain way, to allow for
easier differentiation in files.

Describe the solution you'd like

Implement the keyword namespace, like the following:

namespace section {
   int variable = 3;
}

To access the variable variable, the namespace will have to be used as the parent identifier, like in the struct syntax:

section.variable // Accessing the namespace and its child variable

Describe alternatives you've considered

None.

Additional context

None.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestlanguageCore language issue, change or idea

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions