if(arr) now a warning

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 10 10:00:19 PDT 2015


On Fri, 10 Apr 2015 23:47:19 +1000, Daniel Murphy wrote:

> "ketmar"  wrote in message news:mg8hda$2rs$12 at digitalmars.com...
> 
> 
>> > I use arr.length when I'm working with arrays, and .empty when
>> > working with general ranges.  I generally prefer not to mix the two.
>>
>> isn't it a compiler task to track types? ranges can be empty, arrays
>> can be empty. i can't see why one should remember that their emptiness
>> if somehow different.
> 
> Nobody said you have to remember anything, it's a style choice.

ah, sorry, i thought that you mean "there is no sense to moving `.empty`, 
'cause people should use `.length` for arrays". sorry.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150410/c30b8e3d/attachment.sig>


More information about the Digitalmars-d mailing list