<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/11/11 Marco Leise <span dir="ltr"><<a href="mailto:Marco.Leise@gmx.de" target="_blank">Marco.Leise@gmx.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am Sun, 10 Nov 2013 21:03:34 +0900<br>
schrieb Kenji Hara <<a href="mailto:k.hara.pg@gmail.com">k.hara.pg@gmail.com</a>>:<br>
<div class="im"><br>
> So, separating "inout postblit' and 'unique postblit' may be reasonable.<br>
><br>
> (However, it seems to me that the syntax "this(inout this) inout;" looks<br>
> weird...<br>
><br>
> Kenji Hara<br>
<br>
</div>I see the value in DIP49. There is a hole in the type system<br>
that needs a proper solution and it is astonishing that the<br>
"unique" concept is already there in D, but existed under the<br>
radar of public perception. I haven't read everything, but<br>
agree with making the language more fail safe any time.<br></blockquote><div><br></div><div>Indeed the "unique" concept is not yet enough described in D language specification. But in recent (past one year or more), it has sometimes been appeared onto various D features, and I had felt about it while working for dmd.</div>
<div>The concept had been hidden between D's strong type system (transitive const and immutability) and 'pure' function long time.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I just find inout confusing as well. inout as a wildcard for<br>
const-ness is irritating enough, and with the double meaning<br>
as unique it might be difficult to read code using inout.<br>
Are the two concepts really coupled? Does it make the<br>
implementation of the DIP easier? Or should we have something<br>
like "unique" as a keyword?</blockquote><div><br></div><div>I think rather it is interesting.</div><div>Inside inout function, we can treat the inout object as a Schrödinger's cat (It may be mutable or immutable, or the middle of two == const). And the necessary requirement to make a copy from an inout object had derived "unique object" concept. I can agree it looks strange, but there's not any failures of logic, as far as I know.</div>
<div><br></div><div>Adding a specific keyword for the concept would hurt the language orthogonality rather.<br></div><div><br></div><div> Kenji Hara</div></div></div></div>