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

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

Re: dmd 1.057 and 2.041 release

2010-03-10 Thread Leandro Lucarella
Steven Schveighoffer, el 8 de marzo a las 14:57 me escribiste: Tell me how you would parse the following text serialization string for a string[]: hello world how are you What if it was a string[][]? Compare that to: [hello world, [how are, you]] What about [1, 2]? That is almost

Re: dmd 1.057 and 2.041 release

2010-03-10 Thread bearophile
Sorry for the delayed answer. Andrei Alexandrescu: In wake of printing multi-dimensional arrays, I agree that start and end delimiters should be present by default. If delimiters are present, it only makes sense to make the array look like a D array, so the , becomes an acceptable

Re: dmd 1.057 and 2.041 release

2010-03-10 Thread Bernard Helyer
On 10/03/10 11:06, Nick Sabalausky wrote: Philippe Sigaudphilippe.sig...@gmail.com wrote in message news:mailman.119.1268166534.4461.digitalmars-d-annou...@puremagic.com... enableStomping? placeUnderFoot? greekWedding?

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Alexander Suhoverhov
Steven Schveighoffer at Mon, 08 Mar 2010 15:23:51 -0500 wrote: SS On Mon, 08 Mar 2010 15:12:24 -0500, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: Tell me how you would parse the following text serialization string for a string[]: hello world how are you What

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread biozic
Steven Schveighoffer Wrote: * shrinkToFit(T[] arr): This one is a bit tricky and technically unsafe. It reduces the size of the allocated length to fit the length of the array. The allocated length is the length that the runtime assumes is being used of the memory block. This is

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread grauzone
Robert Jacques wrote: On Mon, 08 Mar 2010 16:42:54 -0500, Philippe Sigaud philippe.sig...@gmail.com wrote: On Mon, Mar 8, 2010 at 14:22, Steven Schveighoffer schvei...@yahoo.comwrote: The shrinkToFit name is not my favorite, anyone care to submit a better name? minimize is out because it

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Fawzi Mohamed
On 2010-03-09 09:09:51 +0100, Alexander Suhoverhov alexan...@suhoverhov.selfip.net said: Steven Schveighoffer at Mon, 08 Mar 2010 15:23:51 -0500 wrote: SS On Mon, 08 Mar 2010 15:12:24 -0500, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: Tell me how you would parse

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Steven Schveighoffer
On Mon, 08 Mar 2010 17:52:25 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Printing values with spaces between them is entirely fine for e.g. all numbers. You know what, you are right. Why should phobos cater to people wanting to print something as arcane as a

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Bernard Helyer
On 09/03/10 09:12, Walter Bright wrote: obj2asm tells the tale. (obj2asm is an incredibly useful tool, I don't know why nobody uses it.) Maybe a minor quibble, but obj2asm is really slow. If I'm going to disassemble something, I am never going to reach for obj2asm: `ds` is a dmdscript

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Fawzi Mohamed
On 9-mar-10, at 13:00, Steven Schveighoffer wrote: On Tue, 09 Mar 2010 03:09:51 -0500, Alexander Suhoverhov alexan...@suhoverhov.selfip.net wrote: Steven Schveighoffer at Mon, 08 Mar 2010 15:23:51 -0500 wrote: SS On Mon, 08 Mar 2010 15:12:24 -0500, bearophile bearophileh...@lycos.com

Re: dmd 1.057 and 2.041 release - operator overloading docs typo

2010-03-09 Thread Nick Treleaven
On Sun, 07 Mar 2010 22:54:12 -0800, Walter Bright wrote: http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.041.zip Great, thanks :) BTW on this page: http://www.digitalmars.com/d/2.0/operatoroverloading.html The 'Index Operator Overloading' link text at the top

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Steven Schveighoffer
On Tue, 09 Mar 2010 10:10:10 -0500, biozic bio...@free.fr wrote: Steven Schveighoffer Wrote: * shrinkToFit(T[] arr): This one is a bit tricky and technically unsafe. It reduces the size of the allocated length to fit the length of the array. The allocated length is the length that the

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Steven Schveighoffer
On Tue, 09 Mar 2010 03:09:51 -0500, Alexander Suhoverhov alexan...@suhoverhov.selfip.net wrote: Steven Schveighoffer at Mon, 08 Mar 2010 15:23:51 -0500 wrote: SS On Mon, 08 Mar 2010 15:12:24 -0500, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: Tell me how you

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Michal Minich
On Tue, 09 Mar 2010 10:23:07 -0500, Steven Schveighoffer wrote: I want to focus more on the fact that you are declaring the data after the slice as being no longer used. kind of assumeUnique ... assumeNoArrayReference ?

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Ellery Newcomer
On 03/09/2010 05:53 AM, Steven Schveighoffer wrote: On Mon, 08 Mar 2010 17:52:25 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Printing values with spaces between them is entirely fine for e.g. all numbers. You know what, you are right. Why should phobos cater to people

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Andrei Alexandrescu
Ellery Newcomer wrote: On 03/09/2010 05:53 AM, Steven Schveighoffer wrote: On Mon, 08 Mar 2010 17:52:25 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Printing values with spaces between them is entirely fine for e.g. all numbers. You know what, you are right. Why should

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Steven Schveighoffer
On Tue, 09 Mar 2010 12:33:01 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: In wake of printing multi-dimensional arrays, I agree that start and end delimiters should be present by default. If delimiters are present, it only makes sense to make the array look like a D

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Lutger
Michal Minich wrote: On Tue, 09 Mar 2010 10:23:07 -0500, Steven Schveighoffer wrote: I want to focus more on the fact that you are declaring the data after the slice as being no longer used. kind of assumeUnique ... assumeNoArrayReference ? I like that. Or assumeNoMemoryAliasing. It

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread bearophile
Lutger: Or assumeNoMemoryAliasing. It should be clear that it is a potentially very unsafe function. This is getting there :-) Bye, bearophile

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Walter Bright
Bernard Helyer wrote: On 09/03/10 09:12, Walter Bright wrote: obj2asm tells the tale. (obj2asm is an incredibly useful tool, I don't know why nobody uses it.) Maybe a minor quibble, but obj2asm is really slow. If I'm going to disassemble something, I am never going to reach for obj2asm:

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Fawzi Mohamed
On 9-mar-10, at 18:56, Steven Schveighoffer wrote: On Tue, 09 Mar 2010 12:33:01 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: In wake of printing multi-dimensional arrays, I agree that start and end delimiters should be present by default. If delimiters are present, it

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Fawzi Mohamed
On 2010-03-09 20:15:44 +0100, Fawzi Mohamed fa...@gmx.ch said: [...] some html spam sorry about that...

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Bernard Helyer
On 10/03/10 07:54, Walter Bright wrote: Hmm, I never noticed it being slow at all. I wonder what's going on. Obviously, I can't tell from here, but I can tell you what my system says obliquely. It spends that minute at 100% CPU, and about 100 megs resident (which it allocates quickly,

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Bernard Helyer
On 10/03/10 08:57, Bernard Helyer wrote: On 10/03/10 07:54, Walter Bright wrote: Hmm, I never noticed it being slow at all. I wonder what's going on. Obviously, I can't tell from here, but I can tell you what my system says obliquely. It spends that minute at 100% CPU, and about 100 megs

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Steven Schveighoffer
On Tue, 09 Mar 2010 14:54:11 -0500, David Gileadi f...@bar.com wrote: On 3/9/2010 12:44 PM, Steven Schveighoffer wrote: On Tue, 09 Mar 2010 14:36:41 -0500, Michal Minich michal.min...@gmail.com wrote: assumeNoArrayReference does not express that there can be references to the original array

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Walter Bright
Bernard Helyer wrote: On 10/03/10 08:57, Bernard Helyer wrote: On 10/03/10 07:54, Walter Bright wrote: Hmm, I never noticed it being slow at all. I wonder what's going on. Obviously, I can't tell from here, but I can tell you what my system says obliquely. It spends that minute at 100%

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Philippe Sigaud
On Tue, Mar 9, 2010 at 11:29, grauzone n...@example.net wrote: Many of these names (including shrinkToFit) suggest that memory usage is reduced by freeing the left over memory after the array. This is not true: the function just enables stomping of the memory past the slice passed to the

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Don
Steven Schveighoffer wrote: On Tue, 09 Mar 2010 14:54:11 -0500, David Gileadi f...@bar.com wrote: On 3/9/2010 12:44 PM, Steven Schveighoffer wrote: On Tue, 09 Mar 2010 14:36:41 -0500, Michal Minich michal.min...@gmail.com wrote: assumeNoArrayReference does not express that there can be

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Steven Schveighoffer
On Tue, 09 Mar 2010 15:29:04 -0500, Don nos...@nospam.com wrote: Steven Schveighoffer wrote: On Tue, 09 Mar 2010 14:54:11 -0500, David Gileadi f...@bar.com wrote: As long as we're bikeshedding, maybe assumeUnreferencedAfter? This is exactly the semantic meaning we are going for. I'd like

Re: dmd 1.057 and 2.041 release

2010-03-09 Thread Nick Sabalausky
Philippe Sigaud philippe.sig...@gmail.com wrote in message news:mailman.119.1268166534.4461.digitalmars-d-annou...@puremagic.com... On Tue, Mar 9, 2010 at 11:29, grauzone n...@example.net wrote: Many of these names (including shrinkToFit) suggest that memory usage is reduced by freeing the

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Lutger
Thanks! A pleasant surprise to see interface contracts.

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Simen kjaeraas
Walter Bright newshou...@digitalmars.com 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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Lars T. Kyllingstad
Simen kjaeraas wrote: Walter Bright newshou...@digitalmars.com 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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Lars T. Kyllingstad
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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Denis Koroskin
On Mon, 08 Mar 2010 09:54:12 +0300, Walter Bright newshou...@digitalmars.com 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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Steven Schveighoffer
On Mon, 08 Mar 2010 03:45:21 -0500, Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: Simen kjaeraas wrote: Walter Bright newshou...@digitalmars.com wrote: Lots of meat and potatoes here, and a cookie! (spelling checker for error messages)

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Ary Borenszweig
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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Walter Bright Wrote: Lots of meat and potatoes here, and a cookie! (spelling checker for error messages) Thank you for the cookie too :-) I will need some more time to try all the new things. In the meantime I have already two small questions: 1) What does Implemented attributes for

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Ary Borenszweig
Ary Borenszweig wrote: 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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
The Html of the change logs seems a bit wrong, the latest version now is at the top, and in the 2.0 changelog the Bugs Fixed are divided in two different horizontal alignments.

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Ary Borenszweig: And isn't it better for the spellchecker to show the closest match using levenshtein distance instead of just distance 1? Walter is an engineer, and follows the KISS principle, he likes to use the simpler thing that can possibly work (especially in the first version of

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Ary Borenszweig: I'm normally interested to enter the if branch if x is not null and it has an interesting value. For example, if I implement a String class I would implement it as not being empty. But I think the biggest problem is making a different semantic for this to structs and

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Ary Borenszweig
bearophile wrote: Ary Borenszweig: I'm normally interested to enter the if branch if x is not null and it has an interesting value. For example, if I implement a String class I would implement it as not being empty. But I think the biggest problem is making a different semantic for this to

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Trass3r
Is there a better way to use the new operator overloading than string mixins? Also the following code strangely yields: dsfml\system\vector2.d(47): Error: variable dsfml.system.vector2.Vector2!(float).Vector2.op only parameters or foreach declarations can be ref /// element-wise operations, +,

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Adam Ruppe
__traits allMembers and and derivedMembers now return a tuple of strings rather than an array of strings. Enclose __traits in [ ] to make array literal. This makes it possible for foreach statements to iterate at compile time over it. How exciting! On 3/8/10, Trass3r u...@known.com wrote:

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Andrei Alexandrescu
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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Andrei Alexandrescu
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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Andrei Alexandrescu: $(LI std.conv: changed the default array formatting from [a, b, c] to a b c) That's a regression!!! (And I think in the past it was [a,b,c] instead of [a, b, c], because it's better to save some screen space, it costs a lot!). Bye, bearophile

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Don
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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: $(LI std.conv: changed the default array formatting from [a, b, c] to a b c) That's a regression!!! (And I think in the past it was [a,b,c] instead of [a, b, c], because it's better to save some screen space, it costs a lot!). Sorry, this stays. The

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
If you compile a program like this: double[100_000] arr; void main() {} With dmd you produce a binary about 1 MB in size, because doubles in D are not filled with zero. So for n-D arrays bigger than a certain amount of memory, can DMD compile that code with a zero initialization plus filling

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Steven Schveighoffer
On Mon, 08 Mar 2010 14:27:36 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: bearophile wrote: Andrei Alexandrescu: $(LI std.conv: changed the default array formatting from [a, b, c] to a b c) That's a regression!!! (And I think in the past it was [a,b,c] instead of [a,

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Andrei Alexandrescu: Sorry, this stays. Then I'm not going to use the Phobos printing in all my future D2 programs. As I was not using it in D1. I'm not going to change idea on this. (e.g. the comma may be a decimal point in some languages, so is [1,2] in a German locale an array of double

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Mon, 08 Mar 2010 14:27:36 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: bearophile wrote: Andrei Alexandrescu: $(LI std.conv: changed the default array formatting from [a, b, c] to a b c) That's a regression!!! (And I think in the past

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: Sorry, this stays. Then I'm not going to use the Phobos printing in all my future D2 programs. As I was not using it in D1. I'm not going to change idea on this. (e.g. the comma may be a decimal point in some languages, so is [1,2] in a German locale

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Lars T. Kyllingstad
Steven Schveighoffer wrote: On Mon, 08 Mar 2010 14:27:36 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: bearophile wrote: Andrei Alexandrescu: $(LI std.conv: changed the default array formatting from [a, b, c] to a b c) That's a regression!!! (And I think in the past

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Steven Schveighoffer
On Mon, 08 Mar 2010 14:49:33 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: bearophile wrote: Andrei Alexandrescu: Sorry, this stays. Then I'm not going to use the Phobos printing in all my future D2 programs. As I was not using it in D1. I'm not going to change idea on

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Walter Bright
bearophile wrote: While this hangs my compiler, I don't know why: double[100_000] arr = 0.0; static this() { arr[] = typeof(arr[0]).init; } void main() {} Well, it didn't hang, it just took a while. I found the problem.

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Steven Schveighoffer: Tell me how you would parse the following text serialization string for a string[]: hello world how are you What if it was a string[][]? Compare that to: [hello world, [how are, you]] You are missing something: [hello world, [how are, you]] :-) (And yes,

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Walter Bright
bearophile wrote: Note: this produces the same very large binary, I don't know why: double[100_000] arr = void; static this() { arr[] = typeof(arr[0]).init; } void main() {} obj2asm tells the tale. (obj2asm is an incredibly useful tool, I don't know why nobody uses it.)

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Walter Bright
Don wrote: Bug 1914 Array initialisation from const array yields memory trample was fixed, in D2 only. Can we get this into D1 as well? The problem is I don't think it's the right fix, and I haven't spent the time figuring it out yet.

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Andrei Alexandrescu: Your choice of leading/trailing symbols and of separators makes 'to' friendlier for printing e.g. debug strings. My choice makes it a primitive for text serialization. I'm not 100% sure which is the more frequent use and therefore which is the most appropriate as a

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Steven Schveighoffer
On Mon, 08 Mar 2010 15:12:24 -0500, bearophile bearophileh...@lycos.com wrote: Steven Schveighoffer: Tell me how you would parse the following text serialization string for a string[]: hello world how are you What if it was a string[][]? Compare that to: [hello world, [how are, you]]

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Steven Schveighoffer: For completely unambiguous, yes. But still, I find often that quotes are more noise than they are worth when just doing simple printouts. What we want is the most useful default. Quotes add a bit of noise, but I prefer to tell apart the cases of two strings from

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Mon, 08 Mar 2010 14:49:33 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: bearophile wrote: Andrei Alexandrescu: Sorry, this stays. Then I'm not going to use the Phobos printing in all my future D2 programs. As I was not using it in D1. I'm

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Gareth Charnock
I think this bug has been squished as well. Both test cases now compile fine. http://d.puremagic.com/issues/show_bug.cgi?id=3694 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

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Philippe Sigaud
On Mon, Mar 8, 2010 at 14:22, Steven Schveighoffer schvei...@yahoo.comwrote: The shrinkToFit name is not my favorite, anyone care to submit a better name? minimize is out because it has connotations of math already. minCapacity minimizeCapacity shrinkCapacity shrink (just shrink)

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
2) What's the best way to translate this to the new operator regime? T foo(T)(T s) if (__traits(hasMember, T, opAdd)) { return s + s; } I have not found a good solution yet. This solution looks buggy (also because fixed-sized arrays have a buggy .init): import std.stdio: writeln;

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Steven Schveighoffer
On Mon, 08 Mar 2010 15:56:14 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Steven Schveighoffer wrote: On Mon, 08 Mar 2010 14:49:33 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: bearophile wrote: Andrei Alexandrescu: Sorry, this stays. Then I'm

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Robert Clipsham
On 08/03/10 22:03, bearophile wrote: 2) What's the best way to translate this to the new operator regime? T foo(T)(T s) if (__traits(hasMember, T, opAdd)) { return s + s; } I have not found a good solution yet. This solution looks buggy (also because fixed-sized arrays have a buggy

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Mon, 08 Mar 2010 15:56:14 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Steven Schveighoffer wrote: On Mon, 08 Mar 2010 14:49:33 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: bearophile wrote: Andrei Alexandrescu:

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Andrei Alexandrescu
Robert Clipsham wrote: On 08/03/10 22:03, bearophile wrote: 2) What's the best way to translate this to the new operator regime? T foo(T)(T s) if (__traits(hasMember, T, opAdd)) { return s + s; } I have not found a good solution yet. This solution looks buggy (also because fixed-sized

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Robert Clipsham: Untested, will the following do what you need? T foo(T)(T s) if (__traits(compiles, {return s + s;})) { return s + s; } Seems like you may as well test if you can add what you're passed rather than the initial value for the type. Oh, nice, I didn't

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
But now I don't know what's happening, because that trait correctly returns false, but the compiler generates a compile error at line 14 still. I think there's a new bug. I have added a bug: http://d.puremagic.com/issues/show_bug.cgi?id=3903 Bye, bearophile

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Andrei Alexandrescu: What I usually do is: T foo(T)(T s) if (is(typeof(s + s))) { } Nice, thank you, I'll use that. (That solution too presents the bug 3903) Bye, bearophile

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Andrei Alexandrescu: I'll also point out that AAs have a default policy that is much more reasonable. I guess that should be changed too :o). -.- Bye, bearophile

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Robert Clipsham
On 08/03/10 22:53, Andrei Alexandrescu wrote: What I usually do is: T foo(T)(T s) if (is(typeof(s + s))) { } Andrei That's far nicer, I keep forgetting about is(typeof()), thanks :)

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Philippe Sigaud
writeln(typeid(typeof(a.init))); // prints: int ?! You mean typeof(a) != typeof((typeof(a)).init) ?! Ugh... I thought (int[2]).init was [0,0] and in general (T[n]).init was [(T.init) n times] writeln(foo(a)); // test.d(14): Error: Array operation s + s not implemented } But now

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Andrei Alexandrescu
Robert Clipsham wrote: On 08/03/10 22:53, Andrei Alexandrescu wrote: What I usually do is: T foo(T)(T s) if (is(typeof(s + s))) { } Andrei That's far nicer, I keep forgetting about is(typeof()), thanks :) It'll be hard to forget once TDPL will be out there, the idiom is present in

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
Philippe Sigaud: writeln(typeid(typeof(a.init))); // prints: int ?! You mean typeof(a) != typeof((typeof(a)).init) ?! Ugh... I thought (int[2]).init was [0,0] and in general (T[n]).init was [(T.init) n times] http://d.puremagic.com/issues/show_bug.cgi?id=3826 Bye, bearophile

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Robert Clipsham
On 08/03/10 23:35, Andrei Alexandrescu wrote: Man I can't wait for that book to be out. I suspect you're not the only one, I was filled with excitement when I saw the expected delivery date become earlier a few days ago, I'm eagerly awaiting it so I can start playing with D2 properly rather

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread bearophile
To try the new operators I have created this helper that works: auto operators(string[] items...) { struct Bunch { string[] items; bool opBinaryRight(string s:in)(string item) { foreach (el; items) if (el == item) return true;

Re: dmd 1.057 and 2.041 release

2010-03-08 Thread Robert Jacques
On Mon, 08 Mar 2010 16:42:54 -0500, Philippe Sigaud philippe.sig...@gmail.com wrote: On Mon, Mar 8, 2010 at 14:22, Steven Schveighoffer schvei...@yahoo.comwrote: The shrinkToFit name is not my favorite, anyone care to submit a better name? minimize is out because it has connotations of

dmd 1.057 and 2.041 release

2010-03-07 Thread Walter Bright
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