Empty VS null array?

ProgrammingGhost dsioafiseghvfawklncfskzdcf at sdifjsdiovgfdisjcisj.com
Fri Oct 18 15:45:02 PDT 2013


On Friday, 18 October 2013 at 21:15:32 UTC, H. S. Teoh wrote:
> 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

I was simply thinking about sdl where you pass in a rect for the 
coords to blt one surface to the other. Null/0 means copy the 
whole thing. Rect is an object but I was thinking what about 
arrays (empty VS pull a default somewhere). Thats how I came up 
with this question and the point is I WANT to NOT specify a value 
so a DYNAMIC SUITABLE default value can be used.


More information about the Digitalmars-d mailing list