The current status of D?

Steven Schveighoffer schveiguy at yahoo.com
Fri Dec 2 10:41:13 PST 2011


On Fri, 02 Dec 2011 11:28:45 -0500, Mehrdad <wfunction at hotmail.com> wrote:

> ... another bug with inout():
>
>      import std.stdio;
>      //Error: inout on parameter means inout must be on return type as  
> well  (???)
>      class C { inout(C) foo() inout { writeln(this); return this; } }
>      void main() { }
>
> IMHO, 'inout' is fundamentally flawed: it should not act like a type  
> constructor at all, because that makes no sense. But it seems to be what  
> it's doing here...

inout must participate in the return value or there is no point in using  
inout (use const instead).

However, one thing we did not anticipate is how to do IFTI with inout  
values.  There is an open bug report on this:  
http://d.puremagic.com/issues/show_bug.cgi?id=6809

You can work around by explicitly instantiating with const, or by doing:

writeln(cast(const)this);

> So no, I wasn't joking -- getting around these problems gets pretty  
> annoying (getting rid of one causes another), as trivial as you may make  
> them out to be. I love D's features as well, but if I have to spend a  
> nontrivial amount of time working around the D compiler, then I probably  
> wouldn't use the D compiler at all.

This is understandable.  We have some major issues to resolve still.  But  
if you don't hit those, it's reasonable to work with.

-Steve


More information about the Digitalmars-d mailing list