Forbid dynamic arrays in boolean evaluation contexts

deadalnix deadalnix at gmail.com
Wed Mar 27 11:09:00 PDT 2013


On Wednesday, 27 March 2013 at 12:18:35 UTC, Vladimir Panteleev 
wrote:
> No. The code is specifically WRITTEN. For the third time: You 
> don't know if this was a conscious design decision made with 
> the distinction between null and empty arrays in mind, so 
> please stop wording things like it was.
>

Well that is not sure. I don't have the answer.

BUT !

In D, you'll find many places where identity and value are 
conflated. This is one instance of the problem. This is pretty 
bad in general.

implicit cast to bool usually imply using the value (otherwise, 
an int would always cast to true) and it is rather surprising 
that it does check for identity for slices.


More information about the Digitalmars-d mailing list