Comparing Multiple Values

Bill Baxter dnewsgroup at billbaxter.com
Tue Mar 11 13:34:02 PDT 2008


BCS wrote:
> Reply to Downs,
> 
>> Bill Baxter wrote:
>>
>>> downs wrote:
>>>
>>>>
>>>> `in` already is an infix operator :)
>>>>
>>>> --downs
>>>>
>>> Yes, but it doesn't work!
>>>
>>> --bb
>>>
>> Curious.
>>
>> Works here, GDC 1.028 / 4.1.2
>>
>> What are you using?
>>
>> --downs
>>
> 
> I think he was saying the "in" operator dosn't work / works wrong. 

Right, as in "a in [1,2,3]"  is an error, rather than doing what the 
poster who started this thread expected it to do.

> As in 
> (a in [0:0, 1:2, 2:4, 3:6]) == (0<= a <=4) rather than (a==0 || a==2 || 
> a==4 || a==6).

No that's fine.  If I ask you "is 'ain't' in the the dictionary?" I'm 
clearly not asking if it appears as a definition.

--bb


More information about the Digitalmars-d-learn mailing list