'in' syntax for searching arrays

Bill Baxter dnewsgroup at billbaxter.com
Sat Nov 3 23:10:24 PDT 2007


Denton Cockburn wrote:
> On Sun, 04 Nov 2007 13:42:41 +0900, Bill Baxter wrote:
> 
>> Denton Cockburn wrote:
>>> What would be the problem in extending the 'in' syntax used for AA to
>>> regular arrays?
>>>
>>> I think it's rather nice syntactic sugar.
>> What it should mean.  See the series of arguments and counter-arguments 
>> in the enh request I filed:
>> http://d.puremagic.com/issues/show_bug.cgi?id=1323
>>
>> So which meaning where you hoping it would have?
>>
>> --bb
> 
> search by values, not by index.
> I wrote a contains function, and I assume everyone who comes across a
> similar use-case does the same.
> 
> I just figure it's done often enough that adding it wouldn't be hard,
> especially considering the keyword is already there, and with the same
> general meaning.

Yeh, well that's what I think it should mean, and that's what Python 
thinks it should mean.  But not everyone agrees, and Walter doesn't seem 
interested.

--bb



More information about the Digitalmars-d mailing list