Consistency

via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 16 05:02:25 PST 2015


On Sunday, 15 February 2015 at 21:23:13 UTC, Andrei Alexandrescu 
wrote:
> The one possible change would be to allow "in" with 
> statically-sized arrays, under the assumption that the amount 
> of data searched is fixed and proportional to the size of the 
> program.

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.


More information about the Digitalmars-d mailing list