[Discussion] enable `some` in closure parameter position

I don't know if this is the correct thread to post this, but the Motivation section of the Rust RFC that accepts impl Trait (more or less our some P) as an argument (after it was already used as a return type), is really well written. The critique rebuttals are quite interesting as well.

I also learned today, in The Evolutions of Lambdas in C++14, C++17 and C++20, that C++ accepts auto for both caller-supplied types and callee-supplied types.

Reasoning by analogy is full of traps, so I wouldn't personally rush to conclusion. Yet, right in front of my eyes, I see two major languages that tend to agree that programmers have a very deep intuition around the difference between arguments and return values, and "who" provides which (amongst caller and callee) (quoted from the Rust RFC).

7 Likes