Things that make writing a clean binding system more difficult
jmh530 via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jul 28 14:08:26 PDT 2016
On Thursday, 28 July 2016 at 20:16:11 UTC, Jonathan M Davis wrote:
>
> Well, if we decided to make parens with ref legal, then we
> could make it work. e.g.
>
> ref(int) function(int, int) functionPointer;
>
> Now, I don't know of any other case where you'd actually use
> parens with ref if it were legal, but it would solve this
> particular case if we wanted to provide a way around the
> ambiguity.
>
> - Jonathan M Davis
On a somewhat related tangent, I was looking for the history of
why ref was included in the language. My recollection of Andrei's
book is that it just takes ref as a given, instead of pass by
reference or address in C++, rather than say why that decision
was made. I found that ref was added in D 1.011 as a replacement
for inout. Looking through some of the D 1.0 documentation, I see
that
"C++ does not distinguish between in, out and ref (i.e. inout)
parameters."
but not much else.
More information about the Digitalmars-d
mailing list