Re: how to call class' template constructor

2014-10-12 Thread Cliff via Digitalmars-d-learn
On Sunday, 12 October 2014 at 19:46:41 UTC, ketmar via Digitalmars-d-learn wrote: Hello. please, how to call template constructor of a class? it's completely escaped my mind. i.e. i have this class: class A { this(alias ent) (string name) { ... } } and i want to do:

Localizing a D application - best practices?

2014-09-28 Thread Cliff via Digitalmars-d-learn
Coming from the C# world, all of localization we did was based on defining string resource files (XML-formatted source files which were translated into C# classes with named-string accessors by the build process) that would get included in the final application. For log messages, exception

Re: Object.factory from shared libraries

2014-09-26 Thread Cliff via Digitalmars-d-learn
On Friday, 26 September 2014 at 15:45:11 UTC, Jacob Carlborg wrote: On 2014-09-26 16:24, krzaq wrote: That would be satisfactory to me, except for the linux-only part. In that case, I think I'll simply try to call filename() as the factory function in each library - that should work

Re: can't understand why code do not working

2014-09-22 Thread Cliff via Digitalmars-d-learn
On Monday, 22 September 2014 at 20:12:28 UTC, Suliman wrote: void worker() { int value = 0; while (value =10) { value = receiveOnly!int(); writeln(value); int result = value * 3; ownerTid.send(result); } } give me: Running .\app1.exe 2 6 3 9 4

Re: can't understand why code do not working

2014-09-22 Thread Cliff via Digitalmars-d-learn
On Monday, 22 September 2014 at 21:28:25 UTC, Cliff wrote: On Monday, 22 September 2014 at 21:24:58 UTC, monarch_dodra wrote: On Monday, 22 September 2014 at 21:19:37 UTC, Steven Schveighoffer wrote: On 9/22/14 4:37 PM, Cliff wrote: Is stdout threadsafe? Yes, stdout is thread safe, it's

Re: can't understand why code do not working

2014-09-22 Thread Cliff via Digitalmars-d-learn
On Monday, 22 September 2014 at 21:24:58 UTC, monarch_dodra wrote: On Monday, 22 September 2014 at 21:19:37 UTC, Steven Schveighoffer wrote: On 9/22/14 4:37 PM, Cliff wrote: Is stdout threadsafe? Yes, stdout is thread safe, it's based on C's stdout which is thread safe. -Steve

Re: Interop with C++ library - what toolchain do you use?

2014-09-18 Thread Cliff via Digitalmars-d-learn
On Thursday, 18 September 2014 at 08:27:07 UTC, Szymon Gatner wrote: On Wednesday, 17 September 2014 at 22:28:44 UTC, Cliff wrote: So I am trying to use a C++ library with D. My toolchain is currently Visual Studio 2013 with Visual D, using the DMD compiler. When trying to link, I obviously

Re: Code doesn't work - why?

2014-09-17 Thread Cliff via Digitalmars-d-learn
On Wednesday, 17 September 2014 at 21:33:01 UTC, Robin wrote: Here is the fully working code for everyone experiencing similar bugs or problems with pointers and value types. =) struct DeterministicState { public: this(string name, bool isFinal, DeterministicState *[char] transits...) {

Re: Code doesn't work - why?

2014-09-17 Thread Cliff via Digitalmars-d-learn
On Wednesday, 17 September 2014 at 21:45:01 UTC, Robin wrote: This is actually a good question as this code isn't really complex or doesn't require the best possible performance. But in case I will ever need optimum performance I should have learned how to handle tasks with value types which is

Interop with C++ library - what toolchain do you use?

2014-09-17 Thread Cliff via Digitalmars-d-learn
So I am trying to use a C++ library with D. My toolchain is currently Visual Studio 2013 with Visual D, using the DMD compiler. When trying to link, I obviously ran into the OMF vs. COFF issue, which makes using the C++ library a bit of a trial to say the least (I played around with some lib

Re: compile automation, makefile, or whatever?

2014-09-16 Thread Cliff via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 19:00:05 UTC, K.K. wrote: Hey I have a quick question: Does D have it's own version of makefiles or anything (preferably simpler)? So instead of typing in PowerShell dmd file1.d file2.d lib\foo.lib -Isrc\ . I could just type most of that into a file and then

Re: compile automation, makefile, or whatever?

2014-09-16 Thread Cliff via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 20:29:12 UTC, K.K. wrote: On Tuesday, 16 September 2014 at 19:26:29 UTC, Cliff wrote: I want to say somewhere on the forums are some descriptions of using CMake for this. Might try searching for that. Yeah I just looked up the CMake thing. It definitely seems

Re: compile automation, makefile, or whatever?

2014-09-16 Thread Cliff via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 20:45:29 UTC, K.K. wrote: On Tuesday, 16 September 2014 at 20:31:33 UTC, Cliff wrote: Out of curiosity, why are you not using dub (on the command-line)? I'm not against using it or anything, but I've found that it didn't help me significantly nor did I have

Re: compile automation, makefile, or whatever?

2014-09-16 Thread Cliff via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 21:05:18 UTC, K.K. wrote: On Tuesday, 16 September 2014 at 20:53:08 UTC, Cliff wrote: Would you be willing to provide some more detail on what about it you didn't like (errors, missing features, etc.)? I ask because build systems are a particular interest of

Re: Idiomatic async programming like C# async/await

2014-09-14 Thread Cliff via Digitalmars-d-learn
On Sunday, 14 September 2014 at 09:19:11 UTC, Kagamin wrote: On Friday, 12 September 2014 at 03:59:58 UTC, Cliff wrote: ...but std.parallelism.Task requires parameterization on the function which the task would execute - that is clearly an implementation detail of the store. I think, you can

Re: Idiomatic async programming like C# async/await

2014-09-12 Thread Cliff via Digitalmars-d-learn
On Friday, 12 September 2014 at 07:15:33 UTC, Kagamin wrote: async/await is not so much about futures/promises, but optimization of IO-bound operations, i.e. when you wait on network/disk, you don't consume stack, threads and similar resources, an analog in D is vibe.d I should have been

Idiomatic async programming like C# async/await

2014-09-11 Thread Cliff via Digitalmars-d-learn
(New to D, old hand at software engineering...) I come from .NET and have made heavy use of the async/await programming paradigm there. In particular, the Task mechanism (futures/promises) lets one encapsulate the future result of some work and pass that around. D seems to have something