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

new feature: Method call with named arguments #464

Merged
merged 10 commits into from
Feb 2, 2023
Merged

new feature: Method call with named arguments #464

merged 10 commits into from
Feb 2, 2023

Conversation

yhara
Copy link
Collaborator

@yhara yhara commented Feb 2, 2023

This PR allows specifying method argument by name. For example:

foo(1, 2, c: 3, d: 4)

Unlike Ruby, there is no difference on the definition side. In other words, any argument is considered a keyword argument.

yhara and others added 10 commits January 30, 2023 12:25
Fixed errors parsing these

- `def f(foo: Int) ...`
- `g{|foo: Int| ...`

Also disallowed these

- `def f(foo : Int) ...`
- `g{|foo : Int| ...`
by just ignoreing the keys for a moment
because it equals to args.block.is_some()
@yhara yhara merged commit 9b1d236 into main Feb 2, 2023
@yhara yhara deleted the kwarg branch February 2, 2023 09:04
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 this pull request may close these issues.

1 participant