Re: Multithreaded file IO?

2011-09-29 Thread Christophe
Jerry , dans le message (digitalmars.D.learn:29830), a écrit : trav...@phare.normalesup.org (Christophe) writes: Jerry Quinn , dans le message (digitalmars.D.learn:29763), a écrit : What I really want is a shared fifo where the input is lines from a file, and many workers grab something

Re: Why an abstract pointer cannot be used as value in an associate array?

2011-09-29 Thread Christophe
what is the error message ?

Re: Why an abstract pointer cannot be used as value in an associate array?

2011-09-29 Thread Trass3r
Am 29.09.2011, 06:51 Uhr, schrieb Cheng Wei riverch...@gmail.com: extern(C) { struct ab; } ab*[int] map; void main() { map.clear(); } Cannot be compiled. Why? Thanks. Just use void* for opaque pointers in D.

Re: Why an abstract pointer cannot be used as value in an associate array?

2011-09-29 Thread Timon Gehr
On 09/29/2011 01:28 PM, Trass3r wrote: Am 29.09.2011, 06:51 Uhr, schrieb Cheng Wei riverch...@gmail.com: extern(C) { struct ab; } ab*[int] map; void main() { map.clear(); } Cannot be compiled. Why? Thanks. Just use void* for opaque pointers in D. Or an empty struct. struct ab{}

Sourcing a script's env into D?

2011-09-29 Thread Nick Sabalausky
Due to process separation, the following won't work: script.sh: #!/bin/sh SOME_VAR=foobar test.d: import std.process; void main() { system(./script.sh); assert(environment[SOME_VAR] == foobar); } This, of course, is because the script is run in a totally separate process (AIUI). The

Simple I know, but could use some help compiling with make

2011-09-29 Thread Roderick Gibson
It's my first foray into the arcana of makefiles and command line compiling. My makefile looks like this: IMPORT = -IC:\Dlang\dmd2\src\ext\Derelict2\import LIB_PATHS = -LC:\Dlang\dmd2\src\ext\Derelict2\lib LIB_INCLUDES = DerelictSDL.lib DerelictGL.lib DerelictUtil.lib all: dmd

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Andrej Mitrovic
No it's not the same for Windows. On Windows you have to use -L+, e.g.: dmd myfile.d -L+path/to/libs mylib.lib

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Andrej Mitrovic
Documented here: http://prowiki.org/wiki4d/wiki.cgi?D__Tutorial/CompilingLinkingD#PassingsearchdirectoriesforstaticlibraryfilestoOptlink Damn what a big hashtag, lol.

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Steven Schveighoffer
On Thu, 29 Sep 2011 14:32:28 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: No it's not the same for Windows. On Windows you have to use -L+, e.g.: dmd myfile.d -L+path/to/libs mylib.lib That's because +path/to/libs is the search-path parameter for OPTLINK. -L goes before all

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Andrej Mitrovic
On 9/29/11, Steven Schveighoffer schvei...@yahoo.com wrote: On Thu, 29 Sep 2011 14:32:28 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: No it's not the same for Windows. On Windows you have to use -L+, e.g.: dmd myfile.d -L+path/to/libs mylib.lib That's because +path/to/libs is

Re: Sourcing a script's env into D?

2011-09-29 Thread Graham Fawcett
On Thu, 29 Sep 2011 13:31:13 -0400, Nick Sabalausky wrote: Due to process separation, the following won't work: script.sh: #!/bin/sh SOME_VAR=foobar test.d: import std.process; void main() { system(./script.sh); assert(environment[SOME_VAR] == foobar); } This, of course,

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Steven Schveighoffer
On Thu, 29 Sep 2011 15:28:56 -0400, Roderick Gibson knit...@gmail.com wrote: On 9/29/2011 11:52 AM, Andrej Mitrovic wrote: On 9/29/11, Steven Schveighofferschvei...@yahoo.com wrote: On Thu, 29 Sep 2011 14:32:28 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: No it's not the same

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Andrej Mitrovic
Odd, I never have to do double backslashes. Maybe it's a problem with make. Personally I just use batch files, I kind of got used to them for simple projects. For everything else a D script is my handy tool.

Re: Sourcing a script's env into D?

2011-09-29 Thread Nick Sabalausky
Steven Schveighoffer schvei...@yahoo.com wrote in message news:op.v2k6axvveav7ka@localhost.localdomain... On Thu, 29 Sep 2011 13:31:13 -0400, Nick Sabalausky a@a.a wrote: Due to process separation, the following won't work: script.sh: #!/bin/sh SOME_VAR=foobar test.d: import

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Nick Sabalausky
Roderick Gibson knit...@gmail.com wrote in message news:j62d4i$1d8l$1...@digitalmars.com... It's my first foray into the arcana of makefiles and command line compiling. My makefile looks like this: IMPORT = -IC:\Dlang\dmd2\src\ext\Derelict2\import LIB_PATHS =

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Nick Sabalausky
Nick Sabalausky a@a.a wrote in message news:j62msu$205t$1...@digitalmars.com... Roderick Gibson knit...@gmail.com wrote in message news:j62d4i$1d8l$1...@digitalmars.com... It's my first foray into the arcana of makefiles and command line compiling. My makefile looks like this: IMPORT =

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Steven Schveighoffer
On Thu, 29 Sep 2011 16:30:54 -0400, Roderick Gibson knit...@gmail.com wrote: On 9/29/2011 1:02 PM, Steven Schveighoffer wrote: On Thu, 29 Sep 2011 15:28:56 -0400, Roderick Gibson knit...@gmail.com wrote: On 9/29/2011 11:52 AM, Andrej Mitrovic wrote: On 9/29/11, Steven

Re: Sourcing a script's env into D?

2011-09-29 Thread Steven Schveighoffer
On Thu, 29 Sep 2011 17:02:28 -0400, Nick Sabalausky a@a.a wrote: Graham Fawcett fawc...@uwindsor.ca wrote in message news:j62ido$1n0s$1...@digitalmars.com... On Thu, 29 Sep 2011 13:31:13 -0400, Nick Sabalausky wrote: Due to process separation, the following won't work: script.sh: #!/bin/sh

WinRT

2011-09-29 Thread RenatoL
Hi all. What do you about WinRT? I think this new APIs could be a very interesting point for D... they are open to any language and i think that D is perfect to work with them. What's your opinion? Best regards

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Roderick Gibson
On 9/29/2011 2:15 PM, Nick Sabalausky wrote: Nick Sabalauskya@a.a wrote in message news:j62msu$205t$1...@digitalmars.com... Roderick Gibsonknit...@gmail.com wrote in message news:j62d4i$1d8l$1...@digitalmars.com... It's my first foray into the arcana of makefiles and command line compiling.

Re: WinRT

2011-09-29 Thread Nick Sabalausky
RenatoL ren...@relhost.net wrote in message news:j62nl3$21g5$1...@digitalmars.com... Hi all. What do you about WinRT? I think this new APIs could be a very interesting point for D... they are open to any language and i think that D is perfect to work with them. What's your opinion? Best

Re: WinRT

2011-09-29 Thread Nick Sabalausky
RenatoL ren...@relhost.net wrote in message news:j62q4v$25tn$1...@digitalmars.com... Eh eh, it may be strange something good come out from MS... but i think this time we could look at this with interest this an object replacement for win32 and the OS exposes it in an open way... i believe

Re: Simple I know, but could use some help compiling with make

2011-09-29 Thread Roderick Gibson
On 9/29/2011 2:39 PM, Nick Sabalausky wrote: Roderick Gibsonknit...@gmail.com wrote in message news:j62nvo$2237$1...@digitalmars.com... On 9/29/2011 2:15 PM, Nick Sabalausky wrote: Nick Sabalauskya@a.a wrote in message news:j62msu$205t$1...@digitalmars.com... Roderick

Re: Why an abstract pointer cannot be used as value in an associate array?

2011-09-29 Thread Cheng Wei
The problem is that the void* cannot convert back to AB* when we want to use it in c library. Just don't understand why the cast(AB*)p (p is void *) needs to know the size of AB. Is there any unsafe cast which can blindly cast the pointers?

Re: Why an abstract pointer cannot be used as value in an associate array?

2011-09-29 Thread Cheng Wei
Thanks a lot. This solves the problem. However, it breaks the abstractness. Now in D side, we can call auto v = ab(). This does not make sense, because then v cannot be used in the C library. I don't understand why when we manipulate AB*, D compiler needs to know the size of struct ab. Moreover,