Empty VS null array?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Oct 18 14:14:13 PDT 2013


On Fri, Oct 18, 2013 at 10:04:52PM +0200, Meta wrote:
> On Friday, 18 October 2013 at 19:59:26 UTC, H. S. Teoh wrote:
> >...because it eliminates an unnecessary distinction between an
> >empty sequence and a non-existent sequence (which then leads to
> >similar issues one encounters with null pointers).
> 
> That just seems silly. Surely we all recognize that there's a
> difference between the empty set and having no set at all, and that
> it's valuable to be able to distinguish between the two. The empty
> set is still a set, while nothing is... nothing.

Yes, but if you declare a variable to contain a set, then by definition
there is *something*, even if it's an empty set. For there to be
nothing, there shouldn't even be a variable in the first place. The fact
that the variable exists and has an identifer means that there is
*something*. So your argument is moot.


T

-- 
Computers shouldn't beep through the keyhole.


More information about the Digitalmars-d mailing list