News from D-IDE

2010-03-12 Thread Alexander Bothe
Hey everyone,

D-IDE 1.0.4.0 released...just check it out and give me your exception reports 
;-)

http://d-ide.sourceforge.net


Re: Do not use 2.041

2010-03-12 Thread Nick Sabalausky
"bearophile"  wrote in message 
news:hnd8hr$1q6...@digitalmars.com...
> Fawzi Mohamed:
>> Yes tango has it, there are a couple of things that are a bit clumsy,
>> due to backward compatibility to previous implementations, but I think
>> that the basic approach is sound:
>
> A nice stack trace is a quite significant improvement when I program in D. 
> It helps solve problems in quite less time.
>

Yup. Between recently discovering tango's stack-tracing for exceptions, and
the template instantition backtrace that was added to DMD not long ago, I'm
one very happy D camper :)




Re: dmd 1.057 and 2.041 release

2010-03-12 Thread bearophile
> In 2.041 it has to be written like this:
> 
> real x = 1.2;
> 
> real[4][4] M2 = [
>   [1, 0, 0, x],
>   [0, 1, 0, x],
>   [0, 0, 1, x],
>   [0, 0, 0, cast(real)1]
> ];

I have seen something different, using dmd 2.041 on Windows. Here are few cases 
of code followed by the error messages dmd outputs to me.

A good way to write code that contains a little less bugs is to try all 
possible corner cases, systematically, orthogonally, trying all the little 
boxes you can find in the matrix/tensor of possibilities (like Guy Steele did 
when he designed Java attributes). I think dmd will need few more tons of tests.

---

real x = 1.2;
real[4][4] M2 = [[1, 0, 0, x],
 [0, 1, 0, x],
 [0, 0, 1, x],
 [0, 0, 0, cast(real)1]];
void main() {}


test.d(5): Error: non-constant expression x
test.d(5): Error: non-constant expression x
test.d(5): Error: non-constant expression x

---

real x = 1.2;
real[4][4] M2 = [[1, 0, 0, x],
 [0, 1, 0, x],
 [0, 0, 1, x],
 [0, 0, 0, 1]];
void main() {}



bug1.d(5): Error: non-constant expression x
bug1.d(5): Error: non-constant expression x
bug1.d(5): Error: non-constant expression x

---

const real x = 1.2;
real[4][4] M2 = [[1, 0, 0, x],
 [0, 1, 0, x],
 [0, 0, 1, x],
 [0, 0, 0, 1]];
void main() {}


No errors with const, immutable, enum.

---

const real x = 1.2;
real[4][4] M2 = [[0, 0, 1, x],
 [0, 0, 0, 1]];
void main() {}


No errors.

---

const real x = 1.2;
real[4][2] M2 = [[0, 0, 1, x],
 [0, 0, 0, 1]];
void main() {}


No errors.

---

const real x = 1.2;
real[2][4] M2 = [[0, 0, 1, x],
 [0, 0, 0, 1]];
void main() {}


bug1.d(3): Error: cannot implicitly convert expression ([0,0,0,1]) of type 
int[] to real[2u]

This seems a wrong error message at best.

---

Can't x be mutable? So are array literals kinda constant now?
Do you see something that needs to go to Bugzilla?

Bye,
bearophile


Re: dmd 1.057 and 2.041 release

2010-03-12 Thread Steven Schveighoffer

On Fri, 12 Mar 2010 09:14:26 -0500, Ivan  wrote:


On 8.3.2010 7:54, Walter Bright wrote:

Lots of meat and potatoes here, and a cookie! (spelling checker for
error messages)

http://www.digitalmars.com/d/1.0/changelog.html
http://ftp.digitalmars.com/dmd.1.057.zip


http://www.digitalmars.com/d/2.0/changelog.html
http://ftp.digitalmars.com/dmd.2.041.zip

Thanks to the many people who contributed to this update!


In 2.040 this worked:

real x = 1.2;

real[4][4] M2 = [
[1, 0, 0, x],
[0, 1, 0, x],
[0, 0, 1, x],
[0, 0, 0, 1]
];


In 2.041 it has to be written like this:

real x = 1.2;

real[4][4] M2 = [
[1, 0, 0, x],
[0, 1, 0, x],
[0, 0, 1, x],
[0, 0, 0, cast(real)1]
];

Don't know if the first one should still work and this is a bug or is  
the new behaviour ok so I am checking here.


The error on the first array initialization in 2.041 is

Error: incompatible types for (([cast(real)1,cast(real)0,cast(real)0,x])  
? ([0,0,0,1])): 'real[]' and 'int[]'
ArraysTest.d(23): Error: cannot implicitly convert expression  
([0L,1L,0L,x]) of type real[] to int
ArraysTest.d(23): Error: cannot implicitly convert expression  
([0L,0L,1L,x]) of type real[] to int


This is a bug.  Any time you are specifying the exact type on the lhs of a  
literal assignment, the literal should be typed that way.


-Steve


Re: dmd 1.057 and 2.041 release

2010-03-12 Thread Ivan

On 8.3.2010 7:54, Walter Bright wrote:

Lots of meat and potatoes here, and a cookie! (spelling checker for
error messages)

http://www.digitalmars.com/d/1.0/changelog.html
http://ftp.digitalmars.com/dmd.1.057.zip


http://www.digitalmars.com/d/2.0/changelog.html
http://ftp.digitalmars.com/dmd.2.041.zip

Thanks to the many people who contributed to this update!


In 2.040 this worked:

real x = 1.2;

real[4][4] M2 = [
[1, 0, 0, x],
[0, 1, 0, x],
[0, 0, 1, x],
[0, 0, 0, 1]
];


In 2.041 it has to be written like this:

real x = 1.2;

real[4][4] M2 = [
[1, 0, 0, x],
[0, 1, 0, x],
[0, 0, 1, x],
[0, 0, 0, cast(real)1]
];

Don't know if the first one should still work and this is a bug or is 
the new behaviour ok so I am checking here.


The error on the first array initialization in 2.041 is

Error: incompatible types for (([cast(real)1,cast(real)0,cast(real)0,x]) 
? ([0,0,0,1])): 'real[]' and 'int[]'
ArraysTest.d(23): Error: cannot implicitly convert expression 
([0L,1L,0L,x]) of type real[] to int
ArraysTest.d(23): Error: cannot implicitly convert expression 
([0L,0L,1L,x]) of type real[] to int


Re: Do not use 2.041

2010-03-12 Thread bearophile
Fawzi Mohamed:
> Yes tango has it, there are a couple of things that are a bit clumsy,  
> due to backward compatibility to previous implementations, but I think  
> that the basic approach is sound:

A nice stack trace is a quite significant improvement when I program in D. It 
helps solve problems in quite less time.
And I think in D2 backward compatibility can be broken, if you think it gives 
some advantages.

Thank you,
bye,
bearophile