if(;){} opinion

Bruno Medeiros daiphoenixNO at SPAMlycos.com
Tue Feb 28 05:29:35 PST 2006


Derek Parnell wrote:
> On Tue, 28 Feb 2006 21:04:49 +1100, Walter Bright 
> <newshound at digitalmars.com> wrote:
> 
>>
>> "clayasaurus" <clayasaurus at gmail.com> wrote in message
>> news:dtvmkf$2e1a$1 at digitaldaemon.com...
>>> I'll vote against it because I don't understand the value of
>>>
>>> if (m; search("abcdef", "BcdasdfD"))
>>>
>>> over
>>>
>>> if (Regexp m = search("abcdef", "BcdasdfD") ) .
>>>
>>> Maybe someone can enlighten me?
>>
>> 1) m is implicitly typed
>> 2) looks like the foreach
>> 3) more concise
> 
>   4) ugly (looks like C)
>   5) Walter's idea
> 
Agreed that it's damn ugly, but don't see why it looks like C.

I think I too prefer:
   if (auto m = search("abcdef", "BcdasdfD") )
but don't support it 100%. Maybe there is a even better way out there..

-- 
Bruno Medeiros - CS/E student
"Certain aspects of D are a pathway to many abilities some consider to 
be... unnatural."



More information about the Digitalmars-d mailing list