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

Rethink extends syntax #65

Closed
joajfreitas opened this issue Sep 30, 2024 · 0 comments · Fixed by #74
Closed

Rethink extends syntax #65

joajfreitas opened this issue Sep 30, 2024 · 0 comments · Fixed by #74

Comments

@joajfreitas
Copy link
Owner

joajfreitas commented Sep 30, 2024

Current syntax

protocol Foo extends Foo {
   ...
}

Considerations

  • Bad error messages from parsing. There's a top level block that can start with an identifier.
  • extends ?
  • Do we need a name for the extension block?

Proposals

Closest

protocol::Foo extends Foo {
   ....
}

Start the block with a keyword. No name for the extension block

impl can for Foo {
}

Similar to Rust... No name for the extension block?

Start the block with a keyword. Name the extension block

impl can::Foo for Foo {
}

or

impl can Foo for Foo {
}

Although the second one is weird.

Keep the extends keyword

extend can for Foo {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant