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

fix mapIt issues #12625 & #12639 #14041

Merged
merged 4 commits into from
Apr 21, 2020
Merged

fix mapIt issues #12625 & #12639 #14041

merged 4 commits into from
Apr 21, 2020

Conversation

foldl
Copy link
Contributor

@foldl foldl commented Apr 21, 2020

  1. fallback to call map when the result of op is a closure;
  2. use items(s) in the for loop;
  3. add a testcase.

foldl added 2 commits April 21, 2020 11:45
1. fallback to call `map` when the result of `op` is a closure;
2. use `items(s)` in the for loop.
@Araq
Copy link
Member

Araq commented Apr 21, 2020

Isn't this a workaround for a compiler bug? Also, I think it's wiser to error out instead of using map because of the different performance characteristics.

@foldl
Copy link
Contributor Author

foldl commented Apr 21, 2020

It is not a compiler bug. It's limitations of mapIt.

On fallback to map or report error: maybe it's better to fallback to map and give a hint on performance? For me, in this fallback case, mapIt means less code than map, while performance are
the same.

@Araq
Copy link
Member

Araq commented Apr 21, 2020

Well since you understand the problem and I don't, please add a good comment to the source code helping me and others in the review process.

@Araq Araq merged commit 04c3265 into nim-lang:devel Apr 21, 2020
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.

2 participants