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

Parser: Rename arg* to param* #12235

Merged
merged 4 commits into from
Sep 26, 2022

Conversation

potomak
Copy link
Contributor

@potomak potomak commented Jul 9, 2022

In a function or block definition you can define a list of parameters. The parser implementation calls them arguments, but this name is imprecise. Here I'm updating some variable and function names to clarify a bit that they are params instead of args.

  • Rename parse_*arg to parse_*param
  • Rename arg* to param* in parse_*param

See #10374

* Rename `parse_*arg` to `parse_*param`
* Rename `arg*` to `param*` in `parse_*param`
Follow the suggestion in the PR review and rename more arg* vars and
function names to param*.
@potomak potomak force-pushed the rename-arg-to-param branch from cf6d5cb to f2647d0 Compare July 9, 2022 19:28
There was one conditional branch in
`check_not_pipe_before_proc_literal_body` that didn't have an
assertion.
@HertzDevil HertzDevil changed the title Rename arg* to param* Parser: Rename arg* to param* Aug 18, 2022
@straight-shoota straight-shoota merged commit e05516f into crystal-lang:master Sep 26, 2022
@straight-shoota straight-shoota added this to the 1.6.0 milestone Sep 26, 2022
@asterite
Copy link
Member

I think there's still a confusion here.

We have a block param which is foo |x, y| where x and y are block params.

But then there's also def foo(&block : Int32 -> Int32) where &block is a block param.

Or would that be a block arg? I'll go with block arg for now.

@asterite
Copy link
Member

Actually I'll go with "def block param" for now in what I'm doing.

@HertzDevil
Copy link
Contributor

The conclusion on the forum is &block would be a block name and |x| would be a block parameter. Neither entity is an argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants