Multiple definition of .../std/regex.d.912_ModuleInfoZ

2012-03-04 Thread André
Hi, I have a project compiled as libary and a seccond example project using this library. The library is compiled without errors. The example project has 1 main module with an empty main function and imports two modules of the library. The errors following is given back from the compiler.

Re: how to use raw sockets

2012-03-04 Thread maarten van damme
I have created some bindings. I'm pretty sure they're not really good (I didn't port micros and certain other files) but if I have time I'm going to post them on github. A pretty annoying problem is that I have to use toStringz and that I can't write C strings with std.stdio (have to use

Some compile time help..

2012-03-04 Thread simendsjo
Hi. I have the following code: void f(Args...)(Args args) { needs_wchar_t(args); } I want to loop over Args, and if it's a string of some type, I want to run it through toUTFz. For all other values, I just want to push them as normal. How could I solve this?

Re: Some compile time help..

2012-03-04 Thread Daniel Murphy
simendsjo simend...@gmail.com wrote in message news:op.wanctrbux8p62v@simendsjo-desktop... Hi. I have the following code: void f(Args...)(Args args) { needs_wchar_t(args); } I want to loop over Args, and if it's a string of some type, I want to run it through toUTFz. For all other

Re: Multiple definition of .../std/regex.d.912_ModuleInfoZ

2012-03-04 Thread Dmitry Olshansky
On 04.03.2012 14:49, André wrote: Hi, I have a project compiled as libary and a seccond example project using this library. The library is compiled without errors. As it's a linker error I'd recommend checking that phobos and library are built using the same compiler. Basically recompile and

Re: how to use raw sockets

2012-03-04 Thread maarten van damme
and why on earth is timeval declared in std.socket instead of std.time?

Re: Some compile time help..

2012-03-04 Thread Andrej Mitrovic
On 3/4/12, Daniel Murphy yebbl...@nospamgmail.com wrote: void f(Args...)(Args args) { foreach(i, T; Args) { static if (isSomeString!T) args[i] = toUTFz(args[i]); } needs_wchar_t(args); } toUTFz returns a pointer, the isSomeString checks if a type is a string. IOW that will try

abstract base class and class members

2012-03-04 Thread David
Is this intended behaviour? http://ideone.com/xrvvL shouldn't the 2nd writeln print the same as the first, well at least the same content of i?

Re: abstract base class and class members

2012-03-04 Thread Timon Gehr
On 03/04/2012 06:16 PM, David wrote: Is this intended behaviour? http://ideone.com/xrvvL shouldn't the 2nd writeln print the same as the first, well at least the same content of i? This is intended behaviour. You have two distinct definitions of i. If you want to set i to 2 in the derived

Re: Some compile time help..

2012-03-04 Thread simendsjo
On Sun, 04 Mar 2012 18:14:28 +0100, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: On 3/4/12, Daniel Murphy yebbl...@nospamgmail.com wrote: void f(Args...)(Args args) { foreach(i, T; Args) { static if (isSomeString!T) args[i] = toUTFz(args[i]); } needs_wchar_t(args); }

Re: abstract base class and class members

2012-03-04 Thread H. S. Teoh
On Sun, Mar 04, 2012 at 06:22:47PM +0100, Timon Gehr wrote: On 03/04/2012 06:16 PM, David wrote: Is this intended behaviour? http://ideone.com/xrvvL shouldn't the 2nd writeln print the same as the first, well at least the same content of i? This is intended behaviour. You have two

Re: [SUCCESS] delegator

2012-03-04 Thread bioinfornatics
Le dimanche 04 mars 2012 à 02:50 +0100, bioinfornatics a écrit : dear, I have a little code who is able to delegate to an array see below code: https://gist.github.com/1969776 It should realy great to have same into std.array and into std.range (for reach different range ) Need help to

Re: abstract base class and class members

2012-03-04 Thread David
Am 04.03.2012 19:22, schrieb H. S. Teoh: On Sun, Mar 04, 2012 at 06:22:47PM +0100, Timon Gehr wrote: On 03/04/2012 06:16 PM, David wrote: Is this intended behaviour? http://ideone.com/xrvvL shouldn't the 2nd writeln print the same as the first, well at least the same content of i? This is

Re: strange file behaviour

2012-03-04 Thread Ali Çehreli
On 03/04/2012 11:43 AM, maarten van damme wrote: hello, I wrote this little test: import std.stdio; void main(){ auto testfile=new File(test.txt); That is a pointer but lines() takes a File. Either construct testfile like this: auto testfile = File(test.txt); or use

Re: abstract base class and class members

2012-03-04 Thread Jonathan M Davis
On Sunday, March 04, 2012 19:36:20 David wrote: Am 04.03.2012 19:22, schrieb H. S. Teoh: On Sun, Mar 04, 2012 at 06:22:47PM +0100, Timon Gehr wrote: On 03/04/2012 06:16 PM, David wrote: Is this intended behaviour? http://ideone.com/xrvvL shouldn't the 2nd writeln print the same as the

Re: how to use raw sockets

2012-03-04 Thread Jonathan M Davis
On Sunday, March 04, 2012 18:10:57 maarten van damme wrote: and why on earth is timeval declared in std.socket instead of std.time? std.socket is an old module and predates all of Phobos' current time stuff. It should probably use a core.time.Duration, but it hasn't been changed to do that. -

Re: abstract base class and class members

2012-03-04 Thread Timon Gehr
On 03/04/2012 07:22 PM, H. S. Teoh wrote: Makes one wonder, though... from an OO perspective, does it make sense to have overridable non-function members? What semantics would (should) that have? Yes, it does make sense. const/immutable/(final) fields can be covariant. OTOH, it is not

Re: strange file behaviour

2012-03-04 Thread maarten van damme
thank you for helping me out. I do not really understand why new File creates a pointer to a file object. does new struct() creates a pointer to that newly created struct?

Shutting down thread with Socket blocking for connection

2012-03-04 Thread Vidar Wahlberg
Coming from a C++/Java world I find D's approach to concurrency slightly difficult to grasp, perhaps someone could help me out a bit on this problem: I'd like to have a method that spawns a new thread which sets up a socket and listens for connections (in a blocking fashion). This part is

Re: abstract base class and class members

2012-03-04 Thread David
Am 04.03.2012 21:24, schrieb Jonathan M Davis: On Sunday, March 04, 2012 19:36:20 David wrote: Am 04.03.2012 19:22, schrieb H. S. Teoh: On Sun, Mar 04, 2012 at 06:22:47PM +0100, Timon Gehr wrote: On 03/04/2012 06:16 PM, David wrote: Is this intended behaviour? http://ideone.com/xrvvL

Re: how to use raw sockets

2012-03-04 Thread Jonathan M Davis
On Sunday, March 04, 2012 22:58:08 maarten van damme wrote: -how to convert c strings to d strings Use std.conv.to. auto str = to!string(cstr); -how to avoid having to call tostringz all the time You're probably out of luck on this one. If you're passing a string to C, you need to convert

Re: strange file behaviour

2012-03-04 Thread Ali Çehreli
On 03/04/2012 01:35 PM, maarten van damme wrote: thank you for helping me out. I do not really understand why new File creates a pointer to a file object. does new struct() creates a pointer to that newly created struct? Yes. new returns a pointer for structs and non-reference fundamental

Re: [SUCCESS] delegator

2012-03-04 Thread bioinfornatics
Le dimanche 04 mars 2012 à 19:22 +0100, bioinfornatics a écrit : Le dimanche 04 mars 2012 à 02:50 +0100, bioinfornatics a écrit : dear, I have a little code who is able to delegate to an array see below code: https://gist.github.com/1969776 It should realy great to have same into

Redis client

2012-03-04 Thread Pedro Lacerda
In an attempt to learn D and git I'm building a Redis client. Assertedly there are many problems in the implementation, I'd like to hear opinions pointing them or suggestions. If here isn't the place to ask these type of review, where is? github.com/pslacerda/dredis Some friend asked why I choose

Re: how to use raw sockets

2012-03-04 Thread maarten van damme
Thank you, now only have to understand the access violation error. I didn't knew to!targettype was so powerful.