Why not extend array operations to full Fortran90 power ?

2011-11-16 Thread Joachim Wuttke
Compare (1) Y[] = X[]*X[]; (2) Y[] = sin( X[] ); With gdc 4.4.6, (1) compiles and executes as I expected, whereas (2) is not allowed (fails at compile time). Why? The semantics of (2) is unambiguous, and it works perfectly well in Fortran90. Allowing (2) would make D really attractive

Re: Why not extend array operations to full Fortran90 power ?

2011-11-16 Thread Kagamin
Joachim Wuttke Wrote: > Compare > >(1) Y[] = X[]*X[]; >(2) Y[] = sin( X[] ); > > With gdc 4.4.6, >(1) compiles and executes as I expected, whereas >(2) is not allowed (fails at compile time). > Why? > > The semantics of (2) is unambiguous, > and it works perfectly well in For

Re: Why not extend array operations to full Fortran90 power ?

2011-11-16 Thread Timon Gehr
On 11/16/2011 08:08 PM, Joachim Wuttke wrote: Compare (1) Y[] = X[]*X[]; (2) Y[] = sin( X[] ); With gdc 4.4.6, (1) compiles and executes as I expected, whereas (2) is not allowed (fails at compile time). Why? The semantics of (2) is unambiguous, and it works perfectly well in Fortran90. Allow

Re: Why not extend array operations to full Fortran90 power ?

2011-11-16 Thread Xinok
On 11/16/2011 2:08 PM, Joachim Wuttke wrote: Compare (1) Y[] = X[]*X[]; (2) Y[] = sin( X[] ); With gdc 4.4.6, (1) compiles and executes as I expected, whereas (2) is not allowed (fails at compile time). Why? The semantics of (2) is unambiguous, and it works perfectly well in Fortran90. Allowi

Re: Why not extend array operations to full Fortran90 power ?

2011-11-16 Thread Simen Kjærås
On Wed, 16 Nov 2011 22:31:31 +0100, Xinok wrote: On 11/16/2011 2:08 PM, Joachim Wuttke wrote: Compare (1) Y[] = X[]*X[]; (2) Y[] = sin( X[] ); With gdc 4.4.6, (1) compiles and executes as I expected, whereas (2) is not allowed (fails at compile time). Why? The semantics of (2) is unambiguo

Re: Why not extend array operations to full Fortran90 power ?

2011-11-16 Thread Timon Gehr
On 11/16/2011 10:48 PM, Simen Kjærås wrote: On Wed, 16 Nov 2011 22:31:31 +0100, Xinok wrote: On 11/16/2011 2:08 PM, Joachim Wuttke wrote: Compare (1) Y[] = X[]*X[]; (2) Y[] = sin( X[] ); With gdc 4.4.6, (1) compiles and executes as I expected, whereas (2) is not allowed (fails at compile t

Re: Why not extend array operations to full Fortran90 power ?

2011-11-16 Thread Xinok
On 11/16/2011 4:48 PM, Simen Kjærås wrote: On Wed, 16 Nov 2011 22:31:31 +0100, Xinok wrote: On 11/16/2011 2:08 PM, Joachim Wuttke wrote: Compare (1) Y[] = X[]*X[]; (2) Y[] = sin( X[] ); With gdc 4.4.6, (1) compiles and executes as I expected, whereas (2) is not allowed (fails at compile ti

Re: Why not extend array operations to full Fortran90 power ?

2011-11-16 Thread Robert Jacques
On Wed, 16 Nov 2011 14:08:33 -0500, Joachim Wuttke wrote: Compare (1) Y[] = X[]*X[]; (2) Y[] = sin( X[] ); With gdc 4.4.6, (1) compiles and executes as I expected, whereas (2) is not allowed (fails at compile time). Why? The semantics of (2) is unambiguous, and it works perfec

Re: Why not extend array operations to full Fortran90 power ?

2011-11-17 Thread Steve Teale
> The semantics of (2) is unambiguous, > and it works perfectly well in Fortran90. Allowing (2) would make D > really attractive for formula-heavy mathematical work. > > - Joachim Heard that line before Walter? I still have the T shirt. Steve

Re: Why not extend array operations to full Fortran90 power ?

2011-11-17 Thread Xinok
On 11/16/2011 2:08 PM, Joachim Wuttke wrote: (1) Y[] = X[]*X[]; (2) Y[] = sin( X[] ); I realized a problem with (2), it's actually not possible to rewrite it using existing constructs because foreach doesn't support multiple iterators. You can use std.range.zip: foreach(i; zip(Y, X

Re: Why not extend array operations to full Fortran90 power ?

2011-11-17 Thread Timon Gehr
On 11/17/2011 07:48 PM, Xinok wrote: On 11/16/2011 2:08 PM, Joachim Wuttke wrote: (1) Y[] = X[]*X[]; (2) Y[] = sin( X[] ); I realized a problem with (2), it's actually not possible to rewrite it using existing constructs Yes it is. D is Turing Complete! because foreach doesn't support mul