Binding rvalues to ref parameters redux
kinke
noone at nowhere.com
Thu Mar 28 23:46:34 UTC 2019
On Wednesday, 27 March 2019 at 01:38:40 UTC, Andrei Alexandrescu
wrote:
> Work has been underway on redoing DIP 1016.
Thanks for the reboot! I just quickly skimmed through, and it
seems to be what I hoped for, a more formal DIP1016 with nice
binding clarifications.
Things I noted:
* You use types T_k for the arguments in the binding rules, but
introduce them as E_k in the 2nd sentence.
* Wrt. binding rule 3, I had to think about the difference of
assignability vs. remaining lvalues after the previous rules. If
I understand correctly, you're proposing to let a non-assignable
`const uint` lvalue bind to a `ref long` param, as opposed to a
mutable `uint` lvalue argument. I'd find that a bit
counter-intuitive (or more complex than necessary) and would
rather disallow all remaining lvalues (+ the remaining
assignables), forcing the user to add a clarifying cast
regardless of the lvalue mutability.
More information about the Digitalmars-d
mailing list