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

Support explicit references ownership #10

Open
flaxed opened this issue Aug 15, 2019 · 0 comments
Open

Support explicit references ownership #10

flaxed opened this issue Aug 15, 2019 · 0 comments
Labels
feature Feature suggestion

Comments

@flaxed
Copy link
Contributor

flaxed commented Aug 15, 2019

If we support references in #3 it can be useful to know who owns the reference. If the data instance, or something else.

This could be implemented with a dedicated keyword, owns as an example, (placeholder syntax):

def data Car {
    engine: owns &Engine,
}

or alternatively with an attribute, owns_ref as an example, (placeholder syntax):

def data Car {
    engine: &Engine [ owns_ref, editable ],
}

As with any new features, it can bring added complexity, and in this case I expect even further complexity when dealing with collections of references.
In the attribute based alternative we could use a new attribute, owns_item_ref, example (placeholder syntax):

def data Car {
    engine: Vec<&Engine> [ owns_item_ref ],
}

With the keyword approach it would end up with (placeholder syntax):

def data Car {
    engine: Vec<owns &Engine>,
}
@flaxed flaxed added the feature Feature suggestion label Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature suggestion
Projects
None yet
Development

No branches or pull requests

1 participant