Count your blessings!

Robert Fraser fraserofthenight at gmail.com
Wed Jun 10 19:02:49 PDT 2009


Andrei Alexandrescu wrote:
> Bill Baxter wrote:
>> On Wed, Jun 10, 2009 at 4:35 PM, Andrei
>> Alexandrescu<SeeWebsiteForEmail at erdani.org> wrote:
>>> Bill Baxter wrote:
>>>> On Wed, Jun 10, 2009 at 4:09 PM, Andrei
>>>> Alexandrescu<SeeWebsiteForEmail at erdani.org> wrote:
>>>>> I agree. D has it already by the way:
>>>>>
>>>>> Exp1 && Exp2;
>>>> Doesn't that evaluate to a bool rather than typeof(Exp1)?
>>> Sorry, I'd forgotten that.
>>
>> You musta been thinking of Perl.
> 
> I am. I'd suggested to Walter to did the same but he mentioned the 
> ensuing incompatibility with C and C++ expressions.
> 
> Andrei

As well as the incompatibility with intuition. If anything, I'd think 
the Elvis operator is more of an "or" since "x ?: y" means "x !is null ? 
x : y". Doesn't && evaluate both arguments unless the first is false (or 
in this case, null)?



More information about the Digitalmars-d mailing list