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

Change the syntax of method definitions #156

Open
ppolesiuk opened this issue Nov 21, 2024 · 0 comments
Open

Change the syntax of method definitions #156

ppolesiuk opened this issue Nov 21, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ppolesiuk
Copy link
Member

In Fram, the self parameter of the method is the first (unnamed) parameter, but the syntax suggests something different (since it might be implicit, it looks like regular named parameter). We agreed to change the syntax. With the change, we should be able to write

method add self = (extern dbl_addInt : Int -> Int -> Int) self

or even

method add = (extern dbl_addInt : Int -> Int -> Int)
@ppolesiuk ppolesiuk added enhancement New feature or request good first issue Good for newcomers labels Nov 21, 2024
forell added a commit that referenced this issue Jan 9, 2025
The parser is updated to match the new version of Surface. Miscellanous
syntax changes requested in existing issues or discussed elsewhere were
made too:
* #156 method definitions no longer treat self in a special way, but
  the tests were not updated;
* #173;
* effect variable naming near the `handle` construct uses `/`;
* no more rows and `effect` or `label` fields (but the keyword `label`
  still cannot be used as an identifier).

The tests and examples should mostly parse now, though not necessarily
as expected due to the changes to method definitions.
forell added a commit that referenced this issue Jan 12, 2025
The parser is updated to match the new version of Surface. Miscellaneous
syntax changes requested in existing issues or discussed elsewhere were
made too:
* #156 method definitions no longer treat self in a special way, but
  the tests were not updated;
* #173;
* effect variable naming near the `handle` construct uses `/`;
* no more rows and `effect` or `label` fields (but the keyword `label`
  still cannot be used as an identifier).

The tests and examples should mostly parse now, though not necessarily
as expected due to the changes to method definitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant