DMD 1.034 and 2.018 releases

Walter Bright newshound1 at digitalmars.com
Fri Aug 8 22:43:08 PDT 2008


bearophile wrote:
> Probably I am missing something important, I have tried this code
> with the 1.034 (that compiles my large d libs fine), but I have found
> many problems:
> 
> import std.stdio: putr = writefln;
> 
> void main() { int[] a1 = [1, 2, 3]; int[] a2 = [2, 4, 6];
> 
> //putr(a1[] + a2[]); // test.d(6): Error: Array operations not
> implemented

It only works if the top level is an assignment operation.

> 
> auto a3 = a1[] + 4; putr(a3); // [1,2,3,0,0,0,0]
> 
> int[] a4 = a1[] + a2[]; // test.d(12): Error: Array operations not
> implemented

Doesn't work for initializers.

> 
> int[] a5 = [3, 5, 7, 9]; int[] a6 = a1 + a5; // test.d(16): Error:
> Array operations not implemented

Doesn't work for initializers.

> 
> int[] a7; a7[] = a1[] + a2[]; putr(a7); // prints: []

I don't know what putr is.

> 
> auto a8 = a1 + a2; // test.d(21): Error: Array operations not
> implemented

Have to use slice [] operator.

> putr(a8); }
> 
> 
> Few more questions/notes: - I like a syntax as a+b and a[]+4 instead
> of a[]+b[] and a[]+4, I am used to that from PyLab, etc. - How does
> it works (or not works) with jagged/square matrices?

It doesn't.

  - When possible
> I'm do few benchmarks compared to normal D code, C code compiled
> normally with GCC and C code automatically vectorized by GCC. - Is it
> able to compute a+b+c with a single loop (as all Fortran compilers
> do)?

Yes.

  I presume the answer is negative. - Hopefully in the future they
> may support the SSE3/SSSE3 too that my CPU supports.
> 
> Bye, and good work, bearophile


More information about the Digitalmars-d-announce mailing list