www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Array operation bug.

reply Sergey Kryzhanovsky <ksv sunbay.com> writes:
  Hello, all.

--------------- specification ---------------
So, for the expression:
     a[] = b[] + 3;
the result is equivalent to:
     for (i = 0; i < a.length; i++)
         a[i] = b[i] + 3;
--------------- specification ---------------

I tried the same code and DMD (0.86, 0.88) says
about mistake:

     int[3] a = 1; // a=[1,1,1]
     int[3] b = 2; // b=[2,2,2]
     a[] = b[]+1;  // a=[3,3,3]?

DMD output:
<..skip..> incompatible types for ((b[]) + (1)): 'int[]' and 'int'

What's wrong?

Best regards,
Sergey Kryzhanovsky.
May 07 2004
parent reply J Anderson <REMOVEanderson badmama.com.au> writes:
Sergey Kryzhanovsky wrote:

  Hello, all.

 --------------- specification ---------------
 So, for the expression:
     a[] = b[] + 3;
 the result is equivalent to:
     for (i = 0; i < a.length; i++)
         a[i] = b[i] + 3;
 --------------- specification ---------------

 I tried the same code and DMD (0.86, 0.88) says
 about mistake:

     int[3] a = 1; // a=[1,1,1]
     int[3] b = 2; // b=[2,2,2]

     a[] = b[]+1;  // a=[3,3,3]?

Has this been implemented yet? I don't think any array operations have been implemented yet. Unless I've missed something, I haven't upgraded to .87 yet.
 DMD output:
 <..skip..> incompatible types for ((b[]) + (1)): 'int[]' and 'int'

 What's wrong?

 Best regards,
 Sergey Kryzhanovsky.

-- -Anderson: http://badmama.com.au/~anderson/
May 07 2004
parent reply Sergey Kryzhanovsky <ksv sunbay.com> writes:
  Hello.

J Anderson wrote:
 Has this been implemented yet?

I don't know. :)
 I don't think any array operations have been implemented yet.

Is there a list of implemented features? Or something like roadmap? Best regards, Sergey Kryzhanovsky.
May 07 2004
parent J Anderson <REMOVEanderson badmama.com.au> writes:
Sergey Kryzhanovsky wrote:

  Hello.

 J Anderson wrote:

 Has this been implemented yet?

I don't know. :)
 I don't think any array operations have been implemented yet.

Is there a list of implemented features? Or something like roadmap? Best regards, Sergey Kryzhanovsky.

I think this is the only one mentioned in the specs that hasn't been implemented. There is no roadmap. Walter works on what he feels needs to be done. -- -Anderson: http://badmama.com.au/~anderson/
May 07 2004