[WIP] std.range, map, ndslice type normalization#4935
[WIP] std.range, map, ndslice type normalization#49359il wants to merge 12 commits intodlang:masterfrom
Conversation
andralex
left a comment
There was a problem hiding this comment.
This is very interesting work, thanks. How about the following idea, which allows us extensibility without having to change map to recognize special type patterns:
- Look for a method
__mapinside the range - If the range defines that method, map should use it
- Otherwise, just do the usual
For the beginning, we don't document this and we only implement __map in the std ranges in this PR. If things go well, we change __map to mapImpl or even map and publish the API for anyone.
I've been thinking of this a lot lately: we should allow ranges to define additional methods under a specific nomenclature, similar to what allocators do. It's a great way to go about implementing features modularly.
| } | ||
| else | ||
| // Type_normalization: take.map -> map.take | ||
| static if (is(Range : Take!R, R)) |
Yes, will do. The PR changes also |
|
Eh, thanks I didn't see those two. I'd say how about we do this for |
No description provided.