Sorry for the late answer, I am quite busy now. Mafi has already answered, I
will probably repeat some things already said.
simendsjo:
Array ops currently have many bugs, they are fragile asm glass things, so when
you use them you have to be kind, if you misuse them a bit things crash and
Don:
That is bug 4578, which has been fixed, and will be in the next compiler
release.
Good, there is no need to file it then.
simendsjo post shows two more cases, this is the first:
{
double[3] a = [1,1,1];
auto b = a[] + 3; // What happens here?
On 07.08.2010 14:10, simendsjo wrote:
I'm new to D2, so please.. :)
(...)
Thanks for all answers. Seems array operations is a bit buggy, so I'll
rather look more into them at a later date.
I'm new to D2, so please.. :)
The spec on Array Operations,
http://www.digitalmars.com/d/2./arrays.html says:
A vector operation is indicated by the slice operator appearing as
the lvalue of an =, +=, -=, *=, /=, %=, ^=, = or |= operator.
The following tests works fine as I expected:
Am 07.08.2010 14:10, schrieb simendsjo:
I'm new to D2, so please.. :)
The spec on Array Operations,
http://www.digitalmars.com/d/2./arrays.html says:
A vector operation is indicated by the slice operator appearing as
the lvalue of an =, +=, -=, *=, /=, %=, ^=, = or |= operator.
The following
Hey, here Mafi again,
I thought about your snippets and here's what I have.
Am 07.08.2010 14:10, schrieb simendsjo:
{
double[3] a = [1,1,1];
double[3] b;
b[] = a[] + 3;
assert(a == [1,1,1]);
assert(b == [4,4,4]);
}
{
double[3] a = [1,1,1];
auto b = a;
b[] = a[] + 3;
assert(a == [1,1,1]);
Mafi wrote:
Hey, here Mafi again,
I thought about your snippets and here's what I have.
Am 07.08.2010 14:10, schrieb simendsjo:
{ // Like the previous example, but with dynamic arrays..
double[] a = [1,1,1];
auto b = a;
assert(a is b);
b = a[] + 3;
assert(a == [1,1,1]);
//writeln(b); //