pointers, functions, and uniform call syntax
monarch_dodra
monarchdodra at gmail.com
Mon Sep 3 09:06:32 PDT 2012
On Monday, 3 September 2012 at 15:46:49 UTC, Carl Sturtivant
wrote:
>
> It seems that the following discussion is relevant to the above.
>
> "Why can't we have reference variables"
> http://forum.dlang.org/thread/ruwapnhkuvozitefzplt@forum.dlang.org
>
> A conservative viewpoint is that converting S* to ref S at the
> point of call requires that the pointer is valid (because
> non-pointer variables always work properly as a part of the way
> the language is defined), and there's no way that the compiler
> can simply verify that this is so. Therefore, such a conversion
> should be the programmers responsibility and not be done
> implicitly.
>
> Carl.
Truth be told, I had thought of that argument, yet at the same
time, the argument also applies for "s.foo();"
What is bothering me is the inconsistent treatment. That and
"there is no -> in D because it is not needed", when well, it
sure feels like it is.
More information about the Digitalmars-d
mailing list