On 8/21/2018 6:07 PM, Mike Franklin wrote:
The proposed idea wants to make the first parameter, if it's `ref`, special.
This is because Phobos is written with functions of the form:
void put(sink, parameters...)
which corresponds to:
sink.put(parameters...)
The two forms are fairly interchangeable, made more so by the Uniform Function
Call Syntax.
> Why not the first `ref` parameter regardless of whether it's the absolute
first in the list. Why not the last `ref` parameter? Why not all `ref` parameters?
Good question. If this fairly restricted form solves the problems, then there is
no need for the more flexible form. Things can always be made more flexible in
the future, but tightening things can be pretty disruptive. Hence, unless there
is an obvious and fairly strong case case for the flexibility, then it should be
avoided for now.
But what bothers me the most is I think it's missing the bigger picture: D
needs a way to annotate lifetimes. Maybe `scope` and `return` with weird
conditions based on the order of parameters and their attributes are the way to
go. Maybe there's another way that hasn't yet been considered.
Put together a thorough description of the proposal, justify it, ask the larger
community for comment, vet it, and document it. At least that's what it's going
to take to get me to take action on the PR.
dip1000 has been around for two years, and its predecessor dip25 several years
now. Plenty of time for anyone to comment and/or propose something better.
---
I want to ensure Atila is successful with this. But that means Phobos has to
compile with dip1000. So I need to make it work.