shared methods

2014-01-21 Thread unknown soldier
I'm confused by shared and how to use it. import std.stdio; class Foo { File logFile; void log(in string line) shared { synchronized(this){ logFile.writeln(line); } } } This (or the equivalent code in my full size program) won't compile: source/log.d(256): Error:

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-21 Thread TheFlyingFiddle
On Saturday, 18 January 2014 at 19:40:38 UTC, Xavier Bigand wrote: I am not sure the issue come really from my code, cause it just works fine on ATI cards, I do something Nvidia drivers dislike. I tried to replace GL_LINE_LOOP by triangles, increase buffer size, put the GL_ELEMENT_ARRAY_BUFFER

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread Jeroen Bollen
On Tuesday, 21 January 2014 at 17:51:44 UTC, monarch_dodra Is that your actual code? "MersenneTwisterEngine(seed)" is not valid code, you have to provide the template arguments. I meant to answer to this by the way, sorry. (in need of edit feature :P )

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread Jeroen Bollen
On Tuesday, 21 January 2014 at 17:51:44 UTC, monarch_dodra wrote: On Tuesday, 21 January 2014 at 17:13:39 UTC, Jeroen Bollen wrote: On Friday, 17 January 2014 at 19:00:29 UTC, Jeroen Bollen wrote: On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a

Re: Shared objects aka dynamic libraries

2014-01-21 Thread Jacob Carlborg
On 2014-01-21 18:53, Russel Winder wrote: I'll have to get my wife's Windows 7 machine out to test all the D tool changes I am making. It is a real shame that anyone actually uses Windows for anything :-) DMD works quite well with Wine, what I've heard. But that might not be reliable enough.

Re: Shared objects aka dynamic libraries

2014-01-21 Thread Dicebot
On Tuesday, 21 January 2014 at 17:53:38 UTC, Russel Winder wrote: Hummm…. it seems that DMD still tries to search libphobos2.a by default instead of libphobos2.so, so the -defaultlib=libphobos2.so is the difference between success and failure :-( As far as I understand shared one will become

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread monarch_dodra
On Tuesday, 21 January 2014 at 17:13:39 UTC, Jeroen Bollen wrote: On Friday, 17 January 2014 at 19:00:29 UTC, Jeroen Bollen wrote: On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a MersenneTwisterEngine with a ulong as seed? This question still

Re: Shared objects aka dynamic libraries

2014-01-21 Thread Russel Winder
On Tue, 2014-01-21 at 15:59 +, Dicebot wrote: > Yes, support is relatively solid for DMD/Linux : > http://forum.dlang.org/post/minijortxmmyshyfn...@forum.dlang.org Hummm…. it seems that DMD still tries to search libphobos2.a by default instead of libphobos2.so, so the -defaultlib=libphobos2.s

Re: Is continuously seeding a random number generator performance intensive?

2014-01-21 Thread Jeroen Bollen
On Friday, 17 January 2014 at 19:00:29 UTC, Jeroen Bollen wrote: On Wednesday, 15 January 2014 at 21:00:57 UTC, Jeroen Bollen wrote: How do you correctly create a MersenneTwisterEngine with a ulong as seed? This question still isn't answered by the way. Come on, surely someone knows how to.

Re: Shared objects aka dynamic libraries

2014-01-21 Thread Dicebot
Yes, support is relatively solid for DMD/Linux : http://forum.dlang.org/post/minijortxmmyshyfn...@forum.dlang.org Don't use Windows but it is said to be much more complicated there. For LDC/GDC support is not yet ready AFAIK.

Shared objects aka dynamic libraries

2014-01-21 Thread Russel Winder
I appear to be unable to use Google the last couple of days :-( so I admit defeat, expose my current ignorance, hopefully to quickly become enlightened. Is it possible to easily with DMD, LDC and/or GDC create shared objects aka dynamic libraries from a D code base? Currently for me DMD and LDC r

Re: Any library with string encoding/decoding support?

2014-01-21 Thread FreeSlave
iconv as library is under LGPL. iconv as utility is under GPL. Note that iconv is not portable even on Linux, since different distros may have different implementations. Qt is not the case because it's unstable with D. It's also redundant dependency. And as far as I know Qt uses platform-depe