Re: Short article on std.parallism

2011-05-30 Thread Lars T. Kyllingstad
On Sun, 29 May 2011 18:18:14 -0700, Jeremy Wright wrote: I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism. I welcome any feedback. http://www.codestrokes.com/archives/116 Nice article. :) A tip to make the code even more terse: You can replace

Re: Short article on std.parallism

2011-05-30 Thread Johann MacDonagh
On 5/29/2011 9:18 PM, Jeremy Wright wrote: I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism. I welcome any feedback. http://www.codestrokes.com/archives/116 Jeremy Wright Nice. Just a few nit-picks: 1. End of first paragraph: makes writing parallel code,

Re: Short article on std.parallism

2011-05-30 Thread Graham Fawcett
On Sun, 29 May 2011 18:18:14 -0700, Jeremy Wright wrote: I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism. I welcome any feedback. http://www.codestrokes.com/archives/116 Haven't read it yet, but: like many faucets -- like many facets Best, Graham

Re: Short article on std.parallism

2011-05-30 Thread Jeremy Wright
Wow! Thank you for your feedback. I'll work through your comments. I appreciate you all taking the time to read my article. Jeremy Wright Jeremy Wright wrote in message news:irurgr$1g65$1...@digitalmars.com... I implemented bucket sort in D to demonstrate how easy it is to use

Re: Short article on std.parallism

2011-05-30 Thread Jeremy Wright
Wow! Thank you for your feedback. I'll work through your comments. I appreciate you all taking the time to read my article. Jeremy Wright Jeremy Wright wrote in message news:irurgr$1g65$1...@digitalmars.com... I implemented bucket sort in D to demonstrate how easy it is to use

Win an iPad2 contest deadline on June 1!

2011-05-30 Thread Walter Bright
Just a reminder! Article submission deadline: before June 1, 2011, GMT Voting deadline: before June 8, 2011, GMT

Re: Short article on std.parallism

2011-05-30 Thread Vladimir Panteleev
On Mon, 30 May 2011 04:18:14 +0300, Jeremy Wright jer...@codestrokes.com wrote: I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism. I welcome any feedback. One thing: I would suggest to avoid using ~= in a tight loop, as it is rather slow. Using

Re: Win an iPad2 contest deadline on June 1!

2011-05-30 Thread bearophile
Walter: Just a reminder! Article submission deadline: before June 1, 2011, GMT Voting deadline: before June 8, 2011, GMT Was this contest announced on Reddit and elsewhere? Bye, bearophile

Re: Win an iPad2 contest deadline on June 1!

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 13:49, bearophile wrote: Walter: Just a reminder! Article submission deadline: before June 1, 2011, GMT Voting deadline: before June 8, 2011, GMT Was this contest announced on Reddit and elsewhere? I'm not sure, but I don't think that there was much point in doing so,

Re: Win an iPad2 contest deadline on June 1!

2011-05-30 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.474.1306789057.14074.digitalmars-d-annou...@puremagic.com... On 2011-05-30 13:49, bearophile wrote: Walter: Just a reminder! Article submission deadline: before June 1, 2011, GMT Voting deadline: before June 8, 2011, GMT

Re: Win an iPad2 contest deadline on June 1!

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 13:59, Nick Sabalausky wrote: Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.474.1306789057.14074.digitalmars-d-annou...@puremagic.com... On 2011-05-30 13:49, bearophile wrote: Walter: Just a reminder! Article submission deadline: before June 1,

Re: Short article on std.parallism

2011-05-30 Thread Andrej Mitrovic
On 5/30/11, Vladimir Panteleev vladi...@thecybershadow.net wrote: On Mon, 30 May 2011 04:18:14 +0300, Jeremy Wright jer...@codestrokes.com wrote: I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism. I welcome any feedback. One thing: I would suggest to avoid

Does alias prevent hijacking?

2011-05-30 Thread Kagamin
class Base { void foo(string s){} } class Derived: Base { alias Base.foo foo; void foo(long s){} } So far so good. Now add new method to the Base class. class Base { void foo(string s){} void foo(int s){} } Now behavior of the calling code silently changes.

Re: Character set conversions

2011-05-30 Thread Kagamin
Jonathan M Davis Wrote: especially with no feature requests or bug reports no the matter. Personally, I wasn't even aware that it was an issue. Pure UTF-8 has always worked just fine for me. Presumably, you're running into issues with it because you're actually using D at work. May be,

Re: Another Log implementation

2011-05-30 Thread Vincent
On Mon, 30 May 2011 01:32:44 +0200, Daniel Gibson metalcae...@gmail.com wrote: So if it's just EmailLogEngine or whatever and it's using SMTP, changing it to use the SMTP-alternative It's just a wrong view on a whole conception. Log uses different KIND of targets: file, database(do

Re: Another Log implementation

2011-05-30 Thread Daniel Gibson
Am 30.05.2011 11:18, schrieb Vincent: On Mon, 30 May 2011 01:32:44 +0200, Daniel Gibson metalcae...@gmail.com wrote: So if it's just EmailLogEngine or whatever and it's using SMTP, changing it to use the SMTP-alternative It's just a wrong view on a whole conception. Log uses different

Re: Another Log implementation

2011-05-30 Thread Vincent
On Mon, 30 May 2011 02:58:00 +0200, Jose Armando Garcia jsan...@gmail.com wrote: Why is verbosity not useful? Probably, because it's too expensive? :) You just remember that the developer that wrote the IO layer was nice enough to log all IO inputs at verbosity level 3. OK, but saying

Re: std.log available for viewing

2011-05-30 Thread Jacob Carlborg
On 2011-05-29 23:07, Andrei Alexandrescu wrote: On 05/29/2011 01:42 PM, Jacob Carlborg wrote: On 2011-05-29 20:34, Andrei Alexandrescu wrote: On 05/29/2011 01:32 PM, Jacob Carlborg wrote: Sometimes you are very consistent but other times you just want to go with the shortest. Why can't we

Re: std.log available for viewing

2011-05-30 Thread Jacob Carlborg
On 2011-05-30 01:59, Jose Armando Garcia wrote: By default the module will read the command line arguments looking for known option. For any option that is missing the default will be used. The default for each option is described in FilterConfig, VerboseConfig and LoggerConfig. I.e. the module

Re: Does alias prevent hijacking?

2011-05-30 Thread Jacob Carlborg
On 2011-05-30 08:53, Kagamin wrote: class Base { void foo(string s){} } class Derived: Base { alias Base.foo foo; void foo(long s){} } So far so good. Now add new method to the Base class. class Base { void foo(string s){} void foo(int s){} } Now behavior of the calling code

Re: Another Log implementation

2011-05-30 Thread David Nadlinger
On 5/30/11 12:13 PM, Vincent wrote: I can say more: looking at program trace I more interested not in 'give me more details', but 'give me details on this object'. In your case it's IO object - turning ON verbosity, you do it for ALL logging, while you need just an IO module. What you say on

Has anyone used OpenSSL in D yet?

2011-05-30 Thread David Nadlinger
Hello list, as I'd like to add SSL support to my Thrift project soon, I am wondering whether anybody has a set of OpenSSL bindings lying around – or maybe even a complete D port? David

Re: Another Log implementation

2011-05-30 Thread Vincent
On Mon, 30 May 2011 01:13:13 +0200, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Without automated headers including location of the log line and date/time, one can't even call that a logging library. I repeat: if people so careless that they don't know what and from where

Re: Another Log implementation

2011-05-30 Thread Vincent
On Mon, 30 May 2011 14:24:10 +0200, David Nadlinger s...@klickverbot.at wrote: First, please note that Jose turned verbose logging on just for IO as well, you might want to have a closer look at his post. Oh, really? This is cite from his library: vlog(0)(Verbosity 0 message);

Re: Another Log implementation

2011-05-30 Thread David Nadlinger
On 5/30/11 3:48 PM, Vincent wrote: On Mon, 30 May 2011 14:24:10 +0200, David Nadlinger s...@klickverbot.at wrote: First, please note that Jose turned verbose logging on just for IO as well, you might want to have a closer look at his post. Oh, really? This is cite from his library:

Re: Character set conversions

2011-05-30 Thread Adam D. Ruppe
Kagamin wrote: May be, it's his cgi lib? :) Client is free to send requests in any encoding, I suppose. In practice, that hasn't been a problem because browser tend to send requests in the same encoding as the html you served. Since the D always outputs utf8, the browsers all send back utf8

Re: Another Log implementation

2011-05-30 Thread Vincent
On Mon, 30 May 2011 11:22:39 +0200, Daniel Gibson metalcae...@gmail.com wrote: How is auto logCrash = new Log(new EmailLogEngine(MailProto.SMTP, smtp.myserver.com)); better than auto logCrash = new Log(new SMPTLogEngine(smtp.myserver.com)); ? Well, my answer was too fast. Look at this:

Re: Another Log implementation

2011-05-30 Thread Graham Fawcett
On Sun, 29 May 2011 22:05:23 +0200, David Nadlinger wrote: On 5/29/11 9:50 PM, Vincent wrote: Perhaps EmailLogEngine should be renamed to SMTPLogEngine. And next year we will add IMAPLogEngine? :) Nope, I prefer just 'Email' - more generic approach. Uh, IMAP has nothing to do with sending

Re: Another Log implementation

2011-05-30 Thread Vincent
On Mon, 30 May 2011 16:01:21 +0200, David Nadlinger s...@klickverbot.at wrote: In terms of code, e.g. here: https://github.com/jsancio/phobos/blob/master/std/log.d#L864 Great! Didn't catch it from docs, sorry. Anyway, it's not 'verbosity' as meaning in english - it's FILTERING and yep,

Re: Another Log implementation

2011-05-30 Thread David Nadlinger
On 5/30/11 4:50 PM, Vincent wrote: I was referring to the post of you I actually cited, where you wrote: --- In this case I prefer snippets like this: // some IO logic version(log_io) logDbg(`SENT: ` ~ line); --- Clearly, you can't activate/deactivate logging at runtime here You can, see

Re: Another Log implementation

2011-05-30 Thread David Nadlinger
On 5/30/11 4:48 PM, Graham Fawcett wrote: On Sun, 29 May 2011 22:05:23 +0200, David Nadlinger wrote: On 5/29/11 9:50 PM, Vincent wrote: Perhaps EmailLogEngine should be renamed to SMTPLogEngine. And next year we will add IMAPLogEngine? :) Nope, I prefer just 'Email' - more generic approach.

Re: Another Log implementation

2011-05-30 Thread Jose Armando Garcia
2011/5/30 Vincent thor...@gmail.com: On Mon, 30 May 2011 02:58:00 +0200, Jose Armando Garcia jsan...@gmail.com wrote: Why is verbosity not useful? Probably, because it's too expensive? :) You just remember that the developer that wrote the IO layer was nice enough to log all IO inputs at

Re: Has anyone used OpenSSL in D yet?

2011-05-30 Thread Moritz Warning
On Mon, 30 May 2011 15:08:52 +0200, David Nadlinger wrote: Hello list, as I'd like to add SSL support to my Thrift project soon, I am wondering whether anybody has a set of OpenSSL bindings lying around – or maybe even a complete D port? David Tango has SSLSockets etc., maybe you can

Re: Another Log implementation

2011-05-30 Thread Jose Armando Garcia
On Mon, May 30, 2011 at 11:50 AM, Vincent thor...@gmail.com wrote: On Mon, 30 May 2011 16:01:21 +0200, David Nadlinger s...@klickverbot.at wrote: In terms of code, e.g. here: https://github.com/jsancio/phobos/blob/master/std/log.d#L864 Great! Didn't catch it from docs, sorry. Anyway, it's

Re: Has anyone used OpenSSL in D yet?

2011-05-30 Thread David Nadlinger
On 5/30/11 6:31 PM, Moritz Warning wrote: On Mon, 30 May 2011 15:08:52 +0200, David Nadlinger wrote: Hello list, as I'd like to add SSL support to my Thrift project soon, I am wondering whether anybody has a set of OpenSSL bindings lying around – or maybe even a complete D port? David

Re: std.log available for viewing

2011-05-30 Thread Jose Armando Garcia
On Sun, May 29, 2011 at 3:57 PM, Walter Bright newshou...@digitalmars.com wrote: On 5/29/2011 3:07 AM, Jacob Carlborg wrote: Why is everyone that contribute with a std.log implementation keep insisting that it should be configured via command line options? What rolls down stairs alone or

Re: Curl wrapper

2011-05-30 Thread jdrewsen
Den 30-05-2011 01:16, Jimmy Cao skrev: Is there any reason why this code (using SMTP + Curl): https://gist.github.com/998214 segfaults on Windows but not on Fedora 15? I found an easy fix, but it looks like a bug somewhere that I can't figure out. etc.curl is currently a moving target. The

Re: std.log available for viewing

2011-05-30 Thread KennyTM~
On May 31, 11 00:59, Jose Armando Garcia wrote: [snip] Walter, what do you think about adding __MODULE__ to the language? It will work similar to __FILE__ and __LINE__ but instead get replaced by the name of the module. This would be really useful for std.log's verbosity filtering feature. I

Re: Character set conversions

2011-05-30 Thread Jérôme M. Berger
Adam D. Ruppe wrote: Kagamin wrote: May be, it's his cgi lib? :) Client is free to send requests in any encoding, I suppose. In practice, that hasn't been a problem because browser tend to send requests in the same encoding as the html you served. Since the D always outputs utf8, the

Re: Curl wrapper

2011-05-30 Thread Jimmy Cao
On Mon, May 30, 2011 at 12:38 PM, jdrewsen jdrew...@nospam.com wrote: Den 30-05-2011 01:16, Jimmy Cao skrev: Is there any reason why this code (using SMTP + Curl): https://gist.github.com/998214 segfaults on Windows but not on Fedora 15? I found an easy fix, but it looks like a bug

Re: std.log available for viewing

2011-05-30 Thread Walter Bright
On 5/30/2011 9:59 AM, Jose Armando Garcia wrote: Walter, what do you think about adding __MODULE__ to the language? It will work similar to __FILE__ and __LINE__ but instead get replaced by the name of the module. This would be really useful for std.log's verbosity filtering feature. I don't

Re: std.log available for viewing

2011-05-30 Thread Andrei Alexandrescu
On 05/30/2011 01:02 PM, Walter Bright wrote: On 5/30/2011 9:59 AM, Jose Armando Garcia wrote: Walter, what do you think about adding __MODULE__ to the language? It will work similar to __FILE__ and __LINE__ but instead get replaced by the name of the module. This would be really useful for

Re: std.log available for viewing

2011-05-30 Thread Robert Clipsham
On 30/05/2011 20:08, Andrei Alexandrescu wrote: On 05/30/2011 01:02 PM, Walter Bright wrote: On 5/30/2011 9:59 AM, Jose Armando Garcia wrote: Walter, what do you think about adding __MODULE__ to the language? It will work similar to __FILE__ and __LINE__ but instead get replaced by the name of

Re: std.log available for viewing

2011-05-30 Thread KennyTM~
On May 31, 11 03:32, Robert Clipsham wrote: On 30/05/2011 20:08, Andrei Alexandrescu wrote: On 05/30/2011 01:02 PM, Walter Bright wrote: On 5/30/2011 9:59 AM, Jose Armando Garcia wrote: Walter, what do you think about adding __MODULE__ to the language? It will work similar to __FILE__ and

Re: std.log available for viewing

2011-05-30 Thread Timon Gehr
On May 31, 11 00:59, Jose Armando Garcia wrote: [snip] Walter, what do you think about adding __MODULE__ to the language? It will work similar to __FILE__ and __LINE__ but instead get replaced by the name of the module. This would be really useful for std.log's verbosity filtering feature.

Re: Character set conversions

2011-05-30 Thread Nick Sabalausky
Jérôme M. Berger jeber...@free.fr wrote in message news:is0m2h$1s32$1...@digitalmars.com... Fun fact about Excel generated CSV files: quite apart from encoding issues, the separator used between cells depends on the locale: for example, in English locales it uses a coma but in French locales it

Re: std.log available for viewing

2011-05-30 Thread KennyTM~
On May 31, 11 03:56, Timon Gehr wrote: On May 31, 11 00:59, Jose Armando Garcia wrote: [snip] Walter, what do you think about adding __MODULE__ to the language? It will work similar to __FILE__ and __LINE__ but instead get replaced by the name of the module. This would be really useful for

Re: Character set conversions

2011-05-30 Thread Simen Kjaeraas
On Mon, 30 May 2011 19:57:32 +0200, Jérôme M. Berger jeber...@free.fr wrote: Fun fact about Excel generated CSV files: quite apart from encoding issues, the separator used between cells depends on the locale: for example, in English locales it uses a coma but in French locales it uses

Re: Character set conversions

2011-05-30 Thread Adam D. Ruppe
Fun fact about Excel generated CSV files: quite apart from encoding issues, the separator used between cells depends on the locale: for example, in English locales it uses a coma but in French locales it uses a semicolon... Yeah, I've seen the semicolon in the wild before too, though I

Re: Character set conversions

2011-05-30 Thread Daniel Gibson
Am 30.05.2011 22:20, schrieb Simen Kjaeraas: On Mon, 30 May 2011 19:57:32 +0200, Jérôme M. Berger jeber...@free.fr wrote: Fun fact about Excel generated CSV files: quite apart from encoding issues, the separator used between cells depends on the locale: for example, in English locales

Re: Character set conversions

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 13:20, Simen Kjaeraas wrote: On Mon, 30 May 2011 19:57:32 +0200, Jérôme M. Berger jeber...@free.fr wrote: Fun fact about Excel generated CSV files: quite apart from encoding issues, the separator used between cells depends on the locale: for example, in English

Re: Character set conversions

2011-05-30 Thread Sean Kelly
I suggest looking into ICU if you're doing this stuff. I believe there's even a wrapper somewhere in the Mango tree on DSource. On May 29, 2011, at 7:21 PM, Adam D. Ruppe wrote: I've encountered some problems with other charsets recently. Phobos has a std.encoding that can do some useful

Re: Character set conversions

2011-05-30 Thread Jérôme M. Berger
Daniel Gibson wrote: In plain C (at least on Linux) you have fun locale-dependent in/output as well: printf and scanf are locale dependent, so if you use sprintf to generate a string you'll write into a file (or fprintf directly) with one locale, reading it with scanf functions with another

Re: Character set conversions

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 14:40, Jérôme M. Berger wrote: Daniel Gibson wrote: In plain C (at least on Linux) you have fun locale-dependent in/output as well: printf and scanf are locale dependent, so if you use sprintf to generate a string you'll write into a file (or fprintf directly) with one

Which link to use?

2011-05-30 Thread Michel Fortin
I'm writing something that needs to link to the D programming language website... which website should I link to? d-programming-language.org or digitalmars.com/d/2.0 ? Is the former ready for prime time? I have to admit I find the current situation a little confusing. -- Michel Fortin

Re: Which link to use?

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 17:28, Michel Fortin wrote: I'm writing something that needs to link to the D programming language website... which website should I link to? d-programming-language.org or digitalmars.com/d/2.0 ? Is the former ready for prime time? I have to admit I find the current situation a

Re: Which link to use?

2011-05-30 Thread albeitnicht
Michel Fortin wrote [in subject]: which link to use? Answer: comp.lang.C++ (Deal with it. It is the truth)

Re: Which link to use?

2011-05-30 Thread Ali Çehreli
On 05/30/2011 09:37 PM, albeitnicht wrote: Michel Fortin wrote [in subject]: which link to use? Answer: comp.lang.C++ Oooh... You can't handle comp.lang.c++.moderated? Poor kitty... (Deal with it. It is the truth) Deal with it. It is the truth. Ali

Re: Empty const strings result in linker errors.

2011-05-30 Thread Jacob Carlborg
On 2011-05-29 22:28, Nick Sabalausky wrote: Jacob Carlborgd...@me.com wrote in message news:iru404$4qp$1...@digitalmars.com... In DMD 1.068 I get linker errors, missing symbols, on empty strings that are const. Is this a bug or intentional? It's an already-reported bug in D1:

Re: Linking with/Debugging static C/C++ libraries

2011-05-30 Thread Trass3r
Am 30.05.2011, 04:09 Uhr, schrieb Jeff Slutter mrmust...@gmail.com: One of the things that's important to us is being able to link against some existing C/C++ static libraries (built with VS 2008, so PE COFF format). Good luck with that. DLLs are no problem but static libraries are another

Template parameter defaults

2011-05-30 Thread Johann MacDonagh
I'm wondering if there's a cleaner way to do this: class Test(T = uint) { this(string s) { } } void main(string[] argv) { auto a = new Test!()(test); } I'd *like* to be able to do this: auto a = new Test(test); and: auto a = new Test!double(test); The only possibility I see

Re: Template parameter defaults

2011-05-30 Thread Jacob Carlborg
On 2011-05-30 15:42, Johann MacDonagh wrote: I'm wondering if there's a cleaner way to do this: class Test(T = uint) { this(string s) { } } void main(string[] argv) { auto a = new Test!()(test); } I'd *like* to be able to do this: auto a = new Test(test); and: auto a = new

Re: Linking with/Debugging static C/C++ libraries

2011-05-30 Thread Dmitry Olshansky
On 30.05.2011 16:57, Trass3r wrote: Am 30.05.2011, 04:09 Uhr, schrieb Jeff Slutter mrmust...@gmail.com: One of the things that's important to us is being able to link against some existing C/C++ static libraries (built with VS 2008, so PE COFF format). Good luck with that. DLLs are no problem

Re: Template parameter defaults

2011-05-30 Thread Johann MacDonagh
On 5/30/2011 10:12 AM, Jacob Carlborg wrote: If you want to use the default parameter I think you have to do this: auto a = new Test!()(test); Yeah, that's the best I could come up with too :( I suppose users can alias it if necessary. Thanks!

Re: Linking with/Debugging static C/C++ libraries

2011-05-30 Thread Jeff Slutter
On 5/30/2011 10:57 AM, Dmitry Olshansky wrote: It was me who brought it Unilink out of infernal abyss :) See also: http://www.digitalmars.com/d/archives/digitalmars/D/announce/Alternative_linker_win32_64_20086.html Seriously I still suggest to try it out, and at any rate author showed

Re: Linking with/Debugging static C/C++ libraries

2011-05-30 Thread Dmitry Olshansky
On 30.05.2011 19:14, Jeff Slutter wrote: On 5/30/2011 10:57 AM, Dmitry Olshansky wrote: It was me who brought it Unilink out of infernal abyss :) See also: http://www.digitalmars.com/d/archives/digitalmars/D/announce/Alternative_linker_win32_64_20086.html Seriously I still suggest to try it

The compiler can not find the property function.

2011-05-30 Thread choi heejo
Greeting. I tried to compile this code with DMD 2.053: @property bool isZero(float value) { return value float.epsilon; } void main() { 0.1f.isZero; readln(); } But the compiler said, no property 'isZero' for type 'float'. I cannot understand this error.

Re: The compiler can not find the property function.

2011-05-30 Thread David Nadlinger
On 5/30/11 5:54 PM, choi heejo wrote: Greeting. I tried to compile this code with DMD 2.053: @property bool isZero(float value) { return value float.epsilon; } void main() { 0.1f.isZero; readln(); } But the compiler said, no property 'isZero' for type 'float'. I cannot understand this

Helping the compiler with assumptions while using exceptions

2011-05-30 Thread simendsjo
I'm having some problems trying to get the best of both worlds here. void f(Class c) { assert(c != null); // use c } In this example, we tell the compiler that c is never able to be null. The compiler can use assertions like this for optimizations (not sure if dmd does this though). But

Re: Template parameter defaults

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 06:42, Johann MacDonagh wrote: I'm wondering if there's a cleaner way to do this: class Test(T = uint) { this(string s) { } } void main(string[] argv) { auto a = new Test!()(test); } I'd *like* to be able to do this: auto a = new Test(test);

Re: The compiler can not find the property function.

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 08:54, choi heejo wrote: Greeting. I tried to compile this code with DMD 2.053: @property bool isZero(float value) { return value float.epsilon; } void main() { 0.1f.isZero; readln(); } But the compiler said, no property 'isZero' for type 'float'. I cannot

Compiling 64-bit code under Windows 7?

2011-05-30 Thread Sean Eskapp
I'm trying to compile a very simple file, main.d: void main() { } Under Windows 7, 64-bit, with out-of-the-box DMD v2.053 installation. I get this, however: C:\Users\Me\devl\testdmd -m64 main.d Internal error: msc.c 268

Re: nested comments

2011-05-30 Thread Adam D. Ruppe
I use them when commenting out code or when writing documentation examples. (which may have comments nested inside the doc comment) Commenting out code is the purpose in general though.

Re: Helping the compiler with assumptions while using exceptions

2011-05-30 Thread Timon Gehr
Jonathan M Davis wrote: On 2011-05-30 12:49, simendsjo wrote: I'm having some problems trying to get the best of both worlds here. void f(Class c) { assert(c != null); // use c } In this example, we tell the compiler that c is never able to be null. The compiler can use assertions

Re: Compiling 64-bit code under Windows 7?

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 14:17, Sean Eskapp wrote: I'm trying to compile a very simple file, main.d: void main() { } Under Windows 7, 64-bit, with out-of-the-box DMD v2.053 installation. I get this, however: C:\Users\Me\devl\testdmd -m64 main.d Internal error: msc.c 268 There is no 64-bit

Re: Helping the compiler with assumptions while using exceptions

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 14:39, Timon Gehr wrote: Jonathan M Davis wrote: On 2011-05-30 12:49, simendsjo wrote: I'm having some problems trying to get the best of both worlds here. void f(Class c) { assert(c != null); // use c } In this example, we tell the compiler that c is

Re: Helping the compiler with assumptions while using exceptions

2011-05-30 Thread bearophile
Timon Gehr: The answer is yes, theoretically it could. (It would either have to have some very advanced code analysis caps, or would just have to treat enforce specially.) Id's not so advanced stuff. Bye, bearophile

Re: Helping the compiler with assumptions while using exceptions

2011-05-30 Thread Brad Roberts
On 5/30/2011 2:55 PM, Jonathan M Davis wrote: I'd be very surprised to see the compiler ever optimize code based on assert or enforce statement. It's unlikely to do so based on assert simply because the assertion is going to be compiled out. I think that there's a high chance that

Re: Helping the compiler with assumptions while using exceptions

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 15:03, Brad Roberts wrote: On 5/30/2011 2:55 PM, Jonathan M Davis wrote: I'd be very surprised to see the compiler ever optimize code based on assert or enforce statement. It's unlikely to do so based on assert simply because the assertion is going to be compiled out. I think

Re: Helping the compiler with assumptions while using exceptions

2011-05-30 Thread Timon Gehr
Timon Gehr: The answer is yes, theoretically it could. (It would either have to have some very advanced code analysis caps, or would just have to treat enforce specially.) Id's not so advanced stuff. Bye, bearophile You are saying that analyzing a function for thrown exceptions and

Re: nested comments

2011-05-30 Thread %u
I understand it thanks

Re: Assert allowed to have side effects?

2011-05-30 Thread Stewart Gordon
On 29/05/2011 14:03, bearophile wrote: Stewart Gordon: There are places where the spec fails to make a clear distinction between illegal code and incorrect code that the compiler may reject if it's smart enough. In D there are pure functions, so I think it's not too much hard for it to tell

Re: Assert allowed to have side effects?

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 16:34, Stewart Gordon wrote: On 29/05/2011 14:03, bearophile wrote: Stewart Gordon: There are places where the spec fails to make a clear distinction between illegal code and incorrect code that the compiler may reject if it's smart enough. In D there are pure

Re: nested comments

2011-05-30 Thread Jesse Phillips
%u Wrote: what is the purpose of nested comments ? The purpose is commenting out code, but note that there is also version(none) { } which is never compiled in.

Re: nested comments

2011-05-30 Thread bearophile
Jesse Phillips: The purpose is commenting out code, but note that there is also version(none) { } which is never compiled in. version(none) {} is probably the official way to comment out code. And if you use a versioning system to keep your code, then commenting out code is not a so wise

Re: nested comments

2011-05-30 Thread Nick Sabalausky
bearophile bearophileh...@lycos.com wrote in message news:is1dj6$ihb$1...@digitalmars.com... Jesse Phillips: The purpose is commenting out code, but note that there is also version(none) { } which is never compiled in. version(none) {} is probably the official way to comment out code. And

Re: nested comments

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 17:43, bearophile wrote: Jesse Phillips: The purpose is commenting out code, but note that there is also version(none) { } which is never compiled in. version(none) {} is probably the official way to comment out code. And if you use a versioning system to keep your code,

Re: nested comments

2011-05-30 Thread Ary Manzana
On 5/31/11 7:58 AM, Nick Sabalausky wrote: bearophilebearophileh...@lycos.com wrote in message news:is1dj6$ihb$1...@digitalmars.com... Jesse Phillips: The purpose is commenting out code, but note that there is also version(none) { } which is never compiled in. version(none) {} is probably

Re: nested comments

2011-05-30 Thread bearophile
Jonathan M Davis: What _is_ a bad idea is leaving in sections of commented out code when you check in code. Right, that's what I meant. Commenting out parts is fine while you are fixing or writing code. Bye, bearophile

Re: nested comments

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 18:52, Ary Manzana wrote: On 5/31/11 7:58 AM, Nick Sabalausky wrote: bearophilebearophileh...@lycos.com wrote in message news:is1dj6$ihb$1...@digitalmars.com... Jesse Phillips: The purpose is commenting out code, but note that there is also version(none) { } which is

Re: nested comments

2011-05-30 Thread Nick Sabalausky
Ary Manzana a...@esperanto.org.ar wrote in message news:is1hsa$p53$1...@digitalmars.com... On 5/31/11 7:58 AM, Nick Sabalausky wrote: bearophilebearophileh...@lycos.com wrote in message news:is1dj6$ihb$1...@digitalmars.com... Jesse Phillips: The purpose is commenting out code, but note

Re: nested comments

2011-05-30 Thread Jonathan M Davis
On 2011-05-30 19:53, Nick Sabalausky wrote: Ary Manzana a...@esperanto.org.ar wrote in message news:is1hsa$p53$1...@digitalmars.com... On 5/31/11 7:58 AM, Nick Sabalausky wrote: bearophilebearophileh...@lycos.com wrote in message news:is1dj6$ihb$1...@digitalmars.com... Jesse

[Issue 4904] Win32 phobos unittest crashes with access violation

2011-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4904 --- Comment #7 from Rainer Schuetze r.sagita...@gmx.de 2011-05-29 23:39:00 PDT --- The optlink fix for 3372 increased the number of allowed symbols for each OMF object file from 16384 to 32768. So expect to hit that limit too with growing

[Issue 6074] Assert expressions shouldn't have side effects

2011-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6074 --- Comment #8 from Walter Bright bugzi...@digitalmars.com 2011-05-30 01:34:52 PDT --- (In reply to comment #5) A reminder: forbidding side effects in asserts is useful for static analyzability of the asserts. Languages that take Contracts

[Issue 5708] Incorrect string constant folding with -inline

2011-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5708 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|RESOLVED|REOPENED

[Issue 3792] Regression(1.053) non-constant expression for a template inside a struct using a struct initializer

2011-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3792 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|REOPENED|RESOLVED

[Issue 6054] [CTFE] ICE when returning a returned compile-time associative array containing a key of an idup-ed array literal

2011-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6054 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 5954] [CTFE] enum structs with ctor

2011-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5954 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 6052] [CTFE] Structs elements in an array are treated like reference type

2011-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6052 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|NEW |RESOLVED