Re: Can I do an or in a version block?

2012-03-13 Thread Ali Çehreli
On 03/09/2012 06:20 AM, Andrej Mitrovic wrote: The same story goes for unittests which can't be independently ran to get a list of all failing unittests D unittest blocks are for code correctness (as opposed to other meanings of the unfortunately overused term unit testing e.g. the

Re: Can I do an or in a version block?

2012-03-13 Thread Ary Manzana
On 3/13/12 2:21 PM, Ali Çehreli wrote: On 03/09/2012 06:20 AM, Andrej Mitrovic wrote: The same story goes for unittests which can't be independently ran to get a list of all failing unittests D unittest blocks are for code correctness (as opposed to other meanings of the unfortunately

Re: Can I do an or in a version block?

2012-03-13 Thread Ali Çehreli
On 03/13/2012 11:04 AM, Ary Manzana wrote: On 3/13/12 2:21 PM, Ali Çehreli wrote: On 03/09/2012 06:20 AM, Andrej Mitrovic wrote: The same story goes for unittests which can't be independently ran to get a list of all failing unittests D unittest blocks are for code correctness (as

Re: Can I do an or in a version block?

2012-03-13 Thread Jonathan M Davis
On Tuesday, March 13, 2012 15:04:09 Ary Manzana wrote: How can you re-run just a failing test? (without having to run all the previous tests that will succeed?) You can't, not without essentially creating your own unit testing framework. D's unit testing framework is quite simple. If you

Re: Can I do an or in a version block?

2012-03-13 Thread Ali Çehreli
On 03/13/2012 11:49 AM, Andrej Mitrovic wrote: On 3/13/12, Ali Çehreliacehr...@yahoo.com wrote: Developers wouldn't want that to happen every time a .d file is compiled. Well luckily unittests don't run when you compile a .d file but when you run the app! :) Good point. :) Our C++ unit

Re: Can I do an or in a version block?

2012-03-13 Thread H. S. Teoh
On Tue, Mar 13, 2012 at 11:28:24AM -0700, Ali Çehreli wrote: [...] We are getting a little off topic here but I've been following the recent unit test thread about writing to files. Unit tests should not have external interactions like that either. For example, no test should connect to an

Re: Can I do an or in a version block?

2012-03-09 Thread Timon Gehr
On 03/09/2012 02:25 AM, Ary Manzana wrote: On 3/8/12 6:11 PM, H. S. Teoh wrote: On Thu, Mar 08, 2012 at 05:56:09PM -0300, Ary Manzana wrote: [...] I don't think it would be hard to implement boolean logic inside version. It's not hard at all. Would it make sense if I make a pull request

Re: Can I do an or in a version block?

2012-03-09 Thread Andrej Mitrovic
I have a felling people will end up abusing string mixins to generate version statements, and this will be the exact opposite effect Walter wanted. The same story goes for unittests which can't be independently ran to get a list of all failing unittests, and so people are coming up with their own

Re: Can I do an or in a version block?

2012-03-08 Thread Jacob Carlborg
On 2012-03-08 06:38, Tyler Jameson Little wrote: I would like to do something like this: version (linux || BSD) { // do something... } else { version (Windows) { // do something else } else { // do something else assert(false, Unsupported operating system); } } The only way I've been able to

Re: Can I do an or in a version block?

2012-03-08 Thread Regan Heath
On Thu, 08 Mar 2012 06:12:44 -, Jonathan M Davis jmdavisp...@gmx.com wrote: On Thursday, March 08, 2012 06:38:48 Tyler Jameson Little wrote: I would like to do something like this: version (linux || BSD) { // do something... } else { version (Windows) { // do something

Re: Can I do an or in a version block?

2012-03-08 Thread Steven Schveighoffer
On Thu, 08 Mar 2012 01:07:08 -0500, James Miller ja...@aatch.net wrote: On 8 March 2012 18:38, Tyler Jameson Little beatgam...@gmail.com wrote: I would like to do something like this: version (linux || BSD) { // do something... } else { version (Windows) { // do something else

Re: Can I do an or in a version block?

2012-03-08 Thread Andrej Mitrovic
I find it interesting that having this feature would somehow enable abuse, yet we can do so much abuse already with CTFE, templates, and string mixins. One large pain in the ass is to pass an integral at compile time. I sometimes wish to use a syntax such as version(foo == 5) {}. The only

Re: Can I do an or in a version block?

2012-03-08 Thread Ary Manzana
On 3/8/12 2:38 AM, Tyler Jameson Little wrote: I would like to do something like this: version (linux || BSD) { // do something... } else { version (Windows) { // do something else } else { // do something else assert(false, Unsupported operating system); } } The only way I've been able to do

Re: Can I do an or in a version block?

2012-03-08 Thread H. S. Teoh
On Thu, Mar 08, 2012 at 05:56:09PM -0300, Ary Manzana wrote: [...] I don't think it would be hard to implement boolean logic inside version. It's not hard at all. Would it make sense if I make a pull request for it? Walter would reject it. He has stated clearly in the past that he intended

Re: Can I do an or in a version block?

2012-03-08 Thread Ary Manzana
On 3/8/12 6:11 PM, H. S. Teoh wrote: On Thu, Mar 08, 2012 at 05:56:09PM -0300, Ary Manzana wrote: [...] I don't think it would be hard to implement boolean logic inside version. It's not hard at all. Would it make sense if I make a pull request for it? Walter would reject it. He has

Re: Can I do an or in a version block?

2012-03-08 Thread H. S. Teoh
On Thu, Mar 08, 2012 at 10:25:53PM -0300, Ary Manzana wrote: On 3/8/12 6:11 PM, H. S. Teoh wrote: On Thu, Mar 08, 2012 at 05:56:09PM -0300, Ary Manzana wrote: [...] I don't think it would be hard to implement boolean logic inside version. It's not hard at all. Would it make sense if I

Can I do an or in a version block?

2012-03-07 Thread Tyler Jameson Little
I would like to do something like this: version (linux || BSD) { // do something... } else { version (Windows) { // do something else } else { // do something else assert(false, Unsupported operating system); } } The only way I've been able to do this, is

Re: Can I do an or in a version block?

2012-03-07 Thread James Miller
On 8 March 2012 18:38, Tyler Jameson Little beatgam...@gmail.com wrote: I would like to do something like this: version (linux || BSD) {    // do something... } else {    version (Windows) {        // do something else    } else {        // do something else        assert(false,

Re: Can I do an or in a version block?

2012-03-07 Thread Ali Çehreli
On 03/07/2012 10:07 PM, James Miller wrote: On 8 March 2012 18:38, Tyler Jameson Littlebeatgam...@gmail.com wrote: I would like to do something like this: version (linux || BSD) { // do something... } else { version (Windows) { // do something else } else { // do

Re: Can I do an or in a version block?

2012-03-07 Thread Jonathan M Davis
On Thursday, March 08, 2012 06:38:48 Tyler Jameson Little wrote: I would like to do something like this: version (linux || BSD) { // do something... } else { version (Windows) { // do something else } else { // do something else assert(false,

Re: Can I do an or in a version block?

2012-03-07 Thread Tyler Jameson Little
Now, you could do version(x) version = xOrY else version(y) version = xOrY version(xOrY) {} Huh, clever! I like it!! I hope I don't have to do that very often, though... Of course, if the issue is linux || FreeBSD, you might want to just consider using Posix. Unless you're doing

Re: Can I do an or in a version block?

2012-03-07 Thread Tyler Jameson Little
Now, you could do version(x) version = xOrY else version(y) version = xOrY version(xOrY) {} Huh, clever! I like it!! I hope I don't have to do that very often, though... Of course, if the issue is linux || FreeBSD, you might want to just consider using Posix. Unless you're doing