[CHANGE] Type namespace != Function/Procedure/Variable namespace#96
Closed
Sir-NoChill wants to merge 6 commits into
Closed
[CHANGE] Type namespace != Function/Procedure/Variable namespace#96Sir-NoChill wants to merge 6 commits into
Sir-NoChill wants to merge 6 commits into
Conversation
Introduce spec/namespaces.rst as the single source of truth for Gazprea's namespace rules: a type namespace (structs, typealiases) and a separate variable/function/procedure namespace. Subsequent commits remove the conflicting per-file descriptions that this page replaces.
Add spec/namespaces to the Language Specification toctree, immediately after identifiers, so the new page is included in the rendered docs.
The Namespaces section in identifiers.rst described a one-namespace model in which struct literals shared the function namespace, contradicting the two-namespace model used elsewhere. Replace it with a cross-reference to the canonical spec/namespaces page. No remaining references to the removed ssec:namespace label exist.
State that structs live in the type namespace and never conflict with variables, functions, or procedures, replacing the old claim that structs share the function and procedure namespaces. Rename the section label from the duplicated ssec:function_namespacing to ssec:struct_namespacing to remove the ambiguous-label collision (one of three identical definitions).
Replace the claim that functions share the struct and procedure namespaces with the correct rule: functions and procedures share one namespace and do not conflict with types. The section label ssec:function_namespacing is retained and is now unique after the struct section was renamed.
Replace the claim that procedures share the struct and function namespaces with the correct rule: procedures and functions share one namespace and do not conflict with types. Rename the section label from the duplicated ssec:function_namespacing to ssec:procedure_namespacing, removing the last of the three colliding label definitions.
Collaborator
|
I can't remember what we gain/lose by making this change. I know we
discussed it - did we also document our thoughts?
…On Mon, Jun 22, 2026 at 6:31 PM Sir-NoChill ***@***.***> wrote:
This is a suggestion also pulled from my other PR just to clarify the
naming rules on structs. I propose that type names live in a different
namespace to the rest of the named statements in gazprea.
That means that things like
typealias main = integer;
struct foo (main a, main b);
procedure main() returns integer { ... }
function foo() returns foo { ... }
would be legal. This deviates from what we did last year with structs
sharing the function namespace due to declaration syntax. To that effect, I
propose that we change struct declaration syntax but that can live in
another PR, or if this seems like a sensible idea I could merge it into
this one.
------------------------------
You can view, comment on, or merge this pull request online at:
#96
Commit Summary
- 049586c
<049586c>
spec: add canonical two-namespace definition page
- 15a4133
<15a4133>
spec: register namespaces page in the toctree
- c5270fc
<c5270fc>
spec: remove outdated Namespaces section from identifiers
- a18de41
<a18de41>
spec: align struct namespacing with two-namespace model
- 9a678ca
<9a678ca>
spec: align function namespacing with two-namespace model
- 927584c
<927584c>
spec: align procedure namespacing with two-namespace model
File Changes
(6 files <https://github.com/cmput415/415-docs/pull/96/files>)
- *M* gazprea/index.rst
<https://github.com/cmput415/415-docs/pull/96/files#diff-126436b735423d38ef756244dce5ed4a0b70c5082aaa2d9f09fce0f34c06b453>
(1)
- *M* gazprea/spec/functions.rst
<https://github.com/cmput415/415-docs/pull/96/files#diff-9ddf088f83dab2f8d3c28ca202d15e9b47778a74bbc99fc1f42a63acb74bce89>
(10)
- *M* gazprea/spec/identifiers.rst
<https://github.com/cmput415/415-docs/pull/96/files#diff-89dd0b0d1043306adbfb2cab991df3033762b37c39170a92802de7074faa4065>
(32)
- *A* gazprea/spec/namespaces.rst
<https://github.com/cmput415/415-docs/pull/96/files#diff-4ddced899f0de5bcf514835b7bcc28b0e75269cb5da0a22ee4068424db313947>
(44)
- *M* gazprea/spec/procedures.rst
<https://github.com/cmput415/415-docs/pull/96/files#diff-3b2872f0fd85abd58bf7aaab5a1f649378cff0313f761a38415edef8656ae68d>
(14)
- *M* gazprea/spec/types/struct.rst
<https://github.com/cmput415/415-docs/pull/96/files#diff-de283235195127b46cd502508ab6ebf489e23d269c15ded96fab899cdd7110b5>
(15)
Patch Links:
- https://github.com/cmput415/415-docs/pull/96.patch
- https://github.com/cmput415/415-docs/pull/96.diff
—
Reply to this email directly, view it on GitHub
<#96?email_source=notifications&email_token=AU2ZJ7C23FKUKTIWSLPBZ2D5BFUNXA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTSMJUGAZTGOBTGGTHEZLBONXW5MDSMV3GSZLXL5ZGK4LVMVZXIZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AU2ZJ7H73HRS727LIDGXLFL5BFUNXAVCNFSNUABFKJSXA33TNF2G64TZHMYTGNZVGMYDMMRXHNEXG43VMU5TINZRHEYDKNJRGYZ2C5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AU2ZJ7GRA3S6GMWCMQRTWHL5BFUNXA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTSMJUGAZTGOBTGGTHEZLBONXW5MDSMV3GSZLXL5ZGK4LVMVZXIZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/AU2ZJ7DY3SZGA5VIJBHNR3D5BFUNXA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTSMJUGAZTGOBTGGTHEZLBONXW5MDSMV3GSZLXL5ZGK4LVMVZXIZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because your review was requested.Message ID:
***@***.***>
|
Benefit:
See my commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a suggestion also pulled from my other PR just to clarify the naming rules on structs. I propose that type names live in a different namespace to the rest of the named statements in gazprea.
That means that things like
would be legal. This deviates from what we did last year with structs sharing the function namespace due to declaration syntax. To that effect, I propose that we change struct declaration syntax but that can live in another PR, or if this seems like a sensible idea I could merge it into this one.