Consistency

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 16 05:10:44 PST 2015


"Marc Schütz" " wrote in message 
news:iftpzvhoyxxqhbfsxull at forum.dlang.org...

> To be really consistent,
>      x in arr
> would need to be equivalent to:
>      (x >= 0) && (x < arr.length)
>
> `in` tests for the presence of a _key_ in AAs, and the equivalent notion 
> of a key for arrays is an index.

It's called 'in', not 'haskey'.  Is 3 in the array?  Is 7 in the map? 
Everybody understands what it means and the whole argument is nonsense. 
Next somebody will be arguing that float/float and int/int aren't the same 
operation and should have different syntax. 



More information about the Digitalmars-d mailing list