Just where has this language gone wrong?

Simen Kjaeraas simen.kjaras at gmail.com
Tue Jul 24 02:03:16 PDT 2012


On Tue, 24 Jul 2012 04:21:18 +0200, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

>> Tuple!(float, "x", float, "y") bar() {
>> return typeof(return)( 0.0, 0.0 );
>> }
[snip]
> We could make
>
> return tuple(0.0, 0.0);
>
> to work. I can't imagine a scenario in which this relaxation would cause  
> a bug.

I would argue it should work, for the exact reasons outline above. And as
you say, it should cause no bugs.

But can it be made to work in current D, as a library solution? Or do you
mean the language should be changed? (This looks to me a lot like the old
opImplicitCast)

-- 
Simen


More information about the Digitalmars-d mailing list