In expression for array

Michiel Helvensteijn nomail at please.com
Fri Jan 25 04:10:35 PST 2008


Bill Baxter wrote:

> Summary: some people (including Walter, I believe) think that, if
> implemented at all,  "x in some_array" should be equivalent to "x>=0 &&
> x<some_array.length".

I understand that that is more efficient, but that's not the point.

If you ask me, there are 'collections' of items. A set is unordered. A map
can find them based on a key. An array can find them based on an index. But
the focus should be on the items. So the in-operator should look for an
item, not a key (or index).

Well, I'm sure this argument isn't new either. :-)

-- 
Michiel




More information about the Digitalmars-d mailing list