Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qualification aliases #55

Open
TheJJ opened this issue Sep 6, 2018 · 0 comments
Open

Qualification aliases #55

TheJJ opened this issue Sep 6, 2018 · 0 comments
Labels
proposal pending discussion about something to do specification involves the nyan language specification

Comments

@TheJJ
Copy link
Member

TheJJ commented Sep 6, 2018

When member qualification is required, aliases could be specified to avoid writing the full origin object name.
Parent name aliases are only valid locally (i.e. whenever accessing this object's scope) and are not passed down the inheritance hierary.

ParentName():
    lol : int

ObjName(ParentName as PN):
    PN.lol = 1337

ChildObject(ObjName):
    ParentName.lol = 42

In ChildObject the alias is no longer valid.
I can't come up with a good syntax for an alias definition in the scope of this object.

Maybe something like this (but that can be confused with the inher-add synatax:
[inherdef](parentdef)[aliasdef]:

ChildObject(ObjName)[ParentName as PN]:
    PN.lol = 42
@TheJJ TheJJ added specification involves the nyan language specification proposal pending discussion about something to do labels Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal pending discussion about something to do specification involves the nyan language specification
Projects
None yet
Development

No branches or pull requests

1 participant