Just-run-the-unittests

2014-03-16 Thread Sergei Nosov
Hi! Suppose I have a small .d script that has a main. Is there any simple way to just run the unit tests without running main at all? I thought -main switch was intended for this, but apparently it works only if there's no main defined at all, otherwise, it issues a double main definition

Re: Just-run-the-unittests

2014-03-16 Thread safety0ff
On Sunday, 16 March 2014 at 07:59:33 UTC, Sergei Nosov wrote: Hi! Suppose I have a small .d script that has a main. Is there any simple way to just run the unit tests without running main at all? Here's the first thing that came to mind: If you never want to both unit tests and regular

Re: Just-run-the-unittests

2014-03-16 Thread Sergei Nosov
On Sunday, 16 March 2014 at 08:22:04 UTC, safety0ff wrote: On Sunday, 16 March 2014 at 07:59:33 UTC, Sergei Nosov wrote: Hi! Suppose I have a small .d script that has a main. Is there any simple way to just run the unit tests without running main at all? Here's the first thing that came to

Re: Installing D on OSX using .dmg

2014-03-16 Thread Russel Winder
On Sun, 2014-03-16 at 04:02 +, Joel wrote: I get an access problem (Downloads Tools. link), it saying it's an unidentified developer. Thanks for any help. Apple are trying to impose a rule that all executables on OSX are signed. I am more or less convinced this is a good idea. It at

Re: Just-run-the-unittests

2014-03-16 Thread Andrej Mitrovic
On 3/16/14, Sergei Nosov sergei.no...@gmail.com wrote: Thx! That's better, but I think -main switch could be made to work like 'add or replace main by stub' instead of just 'add'. I don't think it'll hurt anybody, what do you think? It can't work, because main could be stored in a pre-built

Re: Ubuntu dmd 2.065 amd64 linkage problem.

2014-03-16 Thread Mathias LANG
On Sunday, 16 March 2014 at 02:12:37 UTC, Carl Sturtivant wrote: Back at 2.062 I was able to force the whole of D's runtime/phobos into an executable which was exactly what I wanted for a specific project containing not just D but around 50,000 lines of C. (This is to do with having dynamic

Re: Just-run-the-unittests

2014-03-16 Thread Rikki Cattermole
On Sunday, 16 March 2014 at 10:15:00 UTC, Andrej Mitrovic wrote: It can't work, because main could be stored in a pre-built object or static library that's passed to DMD. Hmm I really should consider making a DIP for a deferred CTFE block. Could really come in handy for a situation like

Re: Get Compile Errors - Command Line

2014-03-16 Thread Bauss
On Saturday, 15 March 2014 at 22:48:52 UTC, Adam D. Ruppe wrote: On Saturday, 15 March 2014 at 19:11:38 UTC, Bauss wrote: Note I am not typing the arguments, but rather starting the process. Skip to the bottom of this message if you are doing it in D and don't care how it is done in the

Re: Ubuntu dmd 2.065 amd64 linkage problem.

2014-03-16 Thread Carl Sturtivant
DMD started to support shared lib on linux from 2.063. This may be useful: http://dlang.org/dll-linux.html Also note that if you are only writting the shared lib and not the client, it would be easyier to bootstrap it using gcc's attributes (see

TDPL question: objects may not embed internal pointers, classes too?

2014-03-16 Thread Adam D. Ruppe
On page 249 of TDPL (Andrei's book), in a section on structs and postblits, it says D objects must be relocatable and other similar statements while banning internal pointers. I knew this applies to structs and the context makes that plainly clear, but the word object is a bit ambiguous: does

Re: Get Compile Errors - Command Line

2014-03-16 Thread Adam D. Ruppe
On Sunday, 16 March 2014 at 13:57:42 UTC, Bauss wrote: Actually I was doing it through C#. I have tried getting the output of the window but it doesn't seem to redirect it. Did you try the startup info there too? Here's a link with a .net example:

Memory errors

2014-03-16 Thread PhilE
When using both simpleimage and DWT my program crashes with core.exception.InvalidMemoryOperationError after I show an image in a GUI window and then close the window. I'm presumably misunderstanding something about how the windows deal with memory deallocation, but this happens even when

Re: Memory errors

2014-03-16 Thread PhilE
Ah, I need to dispose of the image before disposing of the display. On Sunday, 16 March 2014 at 19:33:09 UTC, PhilE wrote: When using both simpleimage and DWT my program crashes with core.exception.InvalidMemoryOperationError after I show an image in a GUI window and then close the window.

Re: Memory errors

2014-03-16 Thread Andrej Mitrovic
On 3/16/14, PhilE theotherp...@hotmail.com wrote: When using both simpleimage and DWT my program crashes with core.exception.InvalidMemoryOperationError It's likely something is trying to allocate in a destructor.

Re: Just-run-the-unittests

2014-03-16 Thread Dicebot
On Sunday, 16 March 2014 at 12:57:04 UTC, Rikki Cattermole wrote: On Sunday, 16 March 2014 at 10:15:00 UTC, Andrej Mitrovic wrote: It can't work, because main could be stored in a pre-built object or static library that's passed to DMD. Hmm I really should consider making a DIP for a

Re: Ubuntu dmd 2.065 amd64 linkage problem.

2014-03-16 Thread Carl Sturtivant
DMD started to support shared lib on linux from 2.063. This may be useful: http://dlang.org/dll-linux.html Also note that if you are only writting the shared lib and not the client, it would be easyier to bootstrap it using gcc's attributes (see

Re: Installing D on OSX using .dmg

2014-03-16 Thread Mengu
On Sunday, 16 March 2014 at 04:02:13 UTC, Joel wrote: I get an access problem (Downloads Tools. link), it saying it's an unidentified developer. Thanks for any help. If you are using Homebrew you can simply do brew install dmd.

Re: TDPL question: objects may not embed internal pointers, classes too?

2014-03-16 Thread Frustrated
On Sunday, 16 March 2014 at 18:41:51 UTC, Adam D. Ruppe wrote: On page 249 of TDPL (Andrei's book), in a section on structs and postblits, it says D objects must be relocatable and other similar statements while banning internal pointers. I knew this applies to structs and the context makes

Re: Installing D on OSX using .dmg

2014-03-16 Thread Joel
Thanks Russel! I've gotten past the security problem! There's options under Security Privacy (and what can be downloaded): O-MacApp Store O-idetinified developers @-Anywhere. Though this (Anywhere) lowers the security of what to download. I've been Recommended this OS. I can use Windows 7

Re: Just-run-the-unittests

2014-03-16 Thread Rikki Cattermole
On Sunday, 16 March 2014 at 20:22:15 UTC, Dicebot wrote: On Sunday, 16 March 2014 at 12:57:04 UTC, Rikki Cattermole wrote: On Sunday, 16 March 2014 at 10:15:00 UTC, Andrej Mitrovic wrote: It can't work, because main could be stored in a pre-built object or static library that's passed to DMD.