array operation a[] + b[] not implemented??

Don nospam at nospam.com
Mon Jan 18 00:09:50 PST 2010


Trass3r wrote:
>> As a side note, why isn't this allowed?  It seems like a perfectly 
>> reasonable thing to have:
>>
>> float[] c = a[] + b;
>>
> 
> Can't think of any point against it as well.
> Add
>     writeln(a[] + b[])
> as a case where one would expect a new array to be created.
> 
> 
>> Also, see bug 2549 
>> (http://d.puremagic.com/issues/show_bug.cgi?id=2549).  If for
>> some reason we don't allow the creation of new arrays using array ops, 
>> we need to fix the error detection.
>>
> 
> Yeah, it's strange that something like
>     writeln(a[] * 4.f + 1.f);
> or
>     writeln(a[] * b[]);
> 
> gives the described access violation, while
>     writeln(a[] + b[]);
> 
> yields Array operation not implemented.

Array operations are still one of the most incomplete parts of the 
compiler. It's not hard to find bugs.



More information about the Digitalmars-d mailing list