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

underscores for routine parameters #21192

Merged
merged 4 commits into from
Jan 8, 2023
Merged

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Dec 28, 2022

fixes #13443, fixes #13804, refs #21121

This is #17581 but with support for templates and generic procs. The implementation works now due to #21121.

Would document, but that would be best alongside a full PR for #20687.

Failing package is weave: mratsim/weave#190 (merged)

@Varriount Varriount requested a review from Araq January 4, 2023 20:14
@Varriount Varriount added the Requires Araq To Merge PR should only be merged by Araq label Jan 4, 2023
@Araq Araq merged commit 05c6db6 into nim-lang:devel Jan 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2023

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 05c6db6

Hint: mm: orc; opt: speed; options: -d:release
166138 lines; 12.316s; 611.559MiB peakmem

@ringabout
Copy link
Member

@metagn Hey, It breaks norm, which means

proc hello[_](x: _) = discard

doesn't compile any more.

PhilippMDoerner added a commit to PhilippMDoerner/norm that referenced this pull request Feb 25, 2023
These are (currently) no longer supported by nim devel.
For reference, see:
- nim-lang/Nim#21435
- nim-lang/Nim#21192

It is likely that this behaviour will stay.
Either way, there is no particular need to stick with [_],
thus we shall proactively remove it, just to be safe.
PhilippMDoerner added a commit to PhilippMDoerner/Nim that referenced this pull request Feb 26, 2023
As described by nim-lang#21435 , generic proc declarations making use of `_` as generic
parameter are no longer possible. This is a change that was introduced by 
nim-lang#21192 . During the debate over if this should be part of the intended spec in
nim-lang#21435 we concluded that it is and thus should be mentioned as a breaking
change in the changelogs.
ringabout pushed a commit that referenced this pull request Feb 26, 2023
…21437)

Add mention of breaking change to changelog

As described by #21435 , generic proc declarations making use of `_` as generic
parameter are no longer possible. This is a change that was introduced by 
#21192 . During the debate over if this should be part of the intended spec in
#21435 we concluded that it is and thus should be mentioned as a breaking
change in the changelogs.
survivorm pushed a commit to survivorm/Nim that referenced this pull request Feb 28, 2023
* underscores for routine parameters

fixes nim-lang#13443, fixes nim-lang#13804, refs nim-lang#21121

* add changelog + more tests

* support generics and ensure inferred lambdas work
survivorm pushed a commit to survivorm/Nim that referenced this pull request Feb 28, 2023
…im-lang#21437)

Add mention of breaking change to changelog

As described by nim-lang#21435 , generic proc declarations making use of `_` as generic
parameter are no longer possible. This is a change that was introduced by 
nim-lang#21192 . During the debate over if this should be part of the intended spec in
nim-lang#21435 we concluded that it is and thus should be mentioned as a breaking
change in the changelogs.
capocasa pushed a commit to capocasa/Nim that referenced this pull request Mar 31, 2023
* underscores for routine parameters

fixes nim-lang#13443, fixes nim-lang#13804, refs nim-lang#21121

* add changelog + more tests

* support generics and ensure inferred lambdas work
capocasa pushed a commit to capocasa/Nim that referenced this pull request Mar 31, 2023
…im-lang#21437)

Add mention of breaking change to changelog

As described by nim-lang#21435 , generic proc declarations making use of `_` as generic
parameter are no longer possible. This is a change that was introduced by 
nim-lang#21192 . During the debate over if this should be part of the intended spec in
nim-lang#21435 we concluded that it is and thus should be mentioned as a breaking
change in the changelogs.
bung87 pushed a commit to bung87/Nim that referenced this pull request Jul 29, 2023
* underscores for routine parameters

fixes nim-lang#13443, fixes nim-lang#13804, refs nim-lang#21121

* add changelog + more tests

* support generics and ensure inferred lambdas work
bung87 pushed a commit to bung87/Nim that referenced this pull request Jul 29, 2023
…im-lang#21437)

Add mention of breaking change to changelog

As described by nim-lang#21435 , generic proc declarations making use of `_` as generic
parameter are no longer possible. This is a change that was introduced by 
nim-lang#21192 . During the debate over if this should be part of the intended spec in
nim-lang#21435 we concluded that it is and thus should be mentioned as a breaking
change in the changelogs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Requires Araq To Merge PR should only be merged by Araq
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_ (underscore) is not ignored inside templates Underscore cannot be defined more than once in proc
4 participants