In expression for array

Janice Caron caron800 at googlemail.com
Fri Jan 25 01:09:02 PST 2008


On Jan 25, 2008 7:25 AM, bearophile <bearophileHUGS at lycos.com> wrote:
> - So using "in" makes code shorter, more flexible, more type-agnostic (generic), simpler to read, potentially faster and more standard :-)

All good points. But I know that part of the reason it's a no-go is
consistency. "in" has to scan the keys, not the values, or it would be
inconsistent with AAs.

Personally I wouldn't mind dropping "in" in favor of two new infix
functions "contains" and "containsKey", which would disambiguate the
two cases (and give extra functionality for AAs). But it's probably
too late to change things now, so forget I said anything. :-)



More information about the Digitalmars-d mailing list