Re: Isn't using find with retro awkward?

2011-02-15 Thread spir
On 02/15/2011 05:03 AM, Jonathan M Davis wrote: On Monday 14 February 2011 19:35:21 Andrej Mitrovic wrote: import std.stdio, std.algorithm, std.range; void main() { writeln( find([5, 1, 2, 3, 4, 5, 1], 5) ); writeln( find(retro([5, 1, 2, 3, 4, 5, 1]), 5) ); } Output: [5, 1, 2, 3, 4,

Re: Isn't using find with retro awkward?

2011-02-15 Thread spir
On 02/15/2011 05:40 AM, Andrej Mitrovic wrote: On 2/15/11, Jonathan M Davisjmdavisp...@gmx.com wrote: retro revereses the whole range. What you want is something like findFromBack. I don't think that we have any functions like findFromBack though. It's probably worth an enhancement request.

Re: Array types not treated uniformly when passed as ranges

2011-02-15 Thread Steven Schveighoffer
On Mon, 14 Feb 2011 21:18:39 -0500, jam gr0v...@gmail.com wrote: Hi all, Just curious as to the difference in the built-in variable length array vs. the std.container.Array and fixed length arrays when it comes to using them in functions that take Ranges. For instance the following does not

Re: Array types not treated uniformly when passed as ranges

2011-02-15 Thread Steven Schveighoffer
On Mon, 14 Feb 2011 22:59:52 -0500, Jonathan M Davis jmdavisp...@gmx.com wrote: It's because an Array is not a range. Dynamic arrays are a bit special in that they're both a container and a range. An Array is just a container. But honestly, you wouldn't really want it to work. Dynamic

Re: Isn't using find with retro awkward?

2011-02-15 Thread Steven Schveighoffer
On Mon, 14 Feb 2011 22:35:21 -0500, Andrej Mitrovic n...@none.none wrote: import std.stdio, std.algorithm, std.range; void main() { writeln( find([5, 1, 2, 3, 4, 5, 1], 5) ); writeln( find(retro([5, 1, 2, 3, 4, 5, 1]), 5) ); } Output: [5, 1, 2, 3, 4, 5, 1] [5, 4, 3, 2, 1, 5] The docs

Sending a socket to another thread

2011-02-15 Thread lurker
I'd like to modify the listener sample to handle requests in separate threads but I'm experiencing weird crashes. Once a connection is established can I send() the relevant socket to another thread and receive() from there? Thanks

Re: Defult stack size on Windows?

2011-02-15 Thread Simon
On 14/02/2011 22:47, Nick Sabalausky wrote: Anyone know what DMD/OPTLINK's default stack size on windows is? Or how to find out? Dunno. Also, I don't suppose there's a way to give a linker flag to DMD that it'll simply ignore on non-Windows platforms, is there? Last time I played with it

Re: Array types not treated uniformly when passed as ranges

2011-02-15 Thread jam
On Tue, 15 Feb 2011 09:00:54 -0500, Steven Schveighoffer wrote: On Mon, 14 Feb 2011 21:18:39 -0500, jam gr0v...@gmail.com wrote: Hi all, Just curious as to the difference in the built-in variable length array vs. the std.container.Array and fixed length arrays when it comes to using them

Re: Array types not treated uniformly when passed as ranges

2011-02-15 Thread Jonathan M Davis
On Tuesday, February 15, 2011 06:10:57 Steven Schveighoffer wrote: On Mon, 14 Feb 2011 22:59:52 -0500, Jonathan M Davis jmdavisp...@gmx.com wrote: It's because an Array is not a range. Dynamic arrays are a bit special in that they're both a container and a range. An Array is just a

Git library for checkouts?

2011-02-15 Thread Jacob Carlborg
Maybe a little off topic but does anyone know about a git library, I'll only need to do checkouts? -- /Jacob Carlborg

Re: Array types not treated uniformly when passed as ranges

2011-02-15 Thread spir
On 02/15/2011 03:00 PM, Steven Schveighoffer wrote: On Mon, 14 Feb 2011 21:18:39 -0500, jam gr0v...@gmail.com wrote: Hi all, Just curious as to the difference in the built-in variable length array vs. the std.container.Array and fixed length arrays when it comes to using them in functions

Re: Git library for checkouts?

2011-02-15 Thread Lars T. Kyllingstad
On Tue, 15 Feb 2011 21:32:06 +0100, Jacob Carlborg wrote: Maybe a little off topic but does anyone know about a git library, I'll only need to do checkouts? Here is a C library, written by the folks behind GitHub: https://github.com/schacon/libgit -Lars

Re: Array types not treated uniformly when passed as ranges

2011-02-15 Thread spir
On 02/15/2011 03:10 PM, Steven Schveighoffer wrote: On Mon, 14 Feb 2011 22:59:52 -0500, Jonathan M Davis jmdavisp...@gmx.com wrote: It's because an Array is not a range. Dynamic arrays are a bit special in that they're both a container and a range. An Array is just a container. But honestly,

Re: Sending a socket to another thread

2011-02-15 Thread Andrew Wiley
On Tue, Feb 15, 2011 at 12:00 PM, lurker lur...@mailinator.com wrote: I'd like to modify the listener sample to handle requests in separate threads but I'm experiencing weird crashes. What platform and version of DMD? There was a bug in the Socket implementation on Windows recently where the

Re: Array types not treated uniformly when passed as ranges

2011-02-15 Thread Jonathan M Davis
On Tuesday, February 15, 2011 13:15:22 spir wrote: On 02/15/2011 03:10 PM, Steven Schveighoffer wrote: On Mon, 14 Feb 2011 22:59:52 -0500, Jonathan M Davis jmdavisp...@gmx.com wrote: It's because an Array is not a range. Dynamic arrays are a bit special in that they're both a container and

Re: Sending a socket to another thread

2011-02-15 Thread lurker
What platform and version of DMD? There was a bug in the Socket implementation on Windows recently where the WinSock data was either initialized or deinitialized multiple times. I don't remember the details, but I remember having weird crashes. Yes, Windows + dmd 2.51. Yes, I've done this

Re: Sending a socket to another thread

2011-02-15 Thread Andrew Wiley
On Tue, Feb 15, 2011 at 4:13 PM, lurker lur...@mailinator.com wrote: What platform and version of DMD? There was a bug in the Socket implementation on Windows recently where the WinSock data was either initialized or deinitialized multiple times. I don't remember the details, but I remember

Re: Sending a socket to another thread

2011-02-15 Thread Andrew Wiley
On Tue, Feb 15, 2011 at 4:59 PM, Andrew Wiley debio...@gmail.com wrote: On Tue, Feb 15, 2011 at 4:13 PM, lurker lur...@mailinator.com wrote: What platform and version of DMD? There was a bug in the Socket implementation on Windows recently where the WinSock data was either initialized or

Re: Isn't using find with retro awkward?

2011-02-15 Thread Denis Koroskin
On Tue, 15 Feb 2011 06:35:21 +0300, Andrej Mitrovic n...@none.none wrote: import std.stdio, std.algorithm, std.range; void main() { writeln( find([5, 1, 2, 3, 4, 5, 1], 5) ); writeln( find(retro([5, 1, 2, 3, 4, 5, 1]), 5) ); } Output: [5, 1, 2, 3, 4, 5, 1] [5, 4, 3, 2, 1, 5] The docs

Re: Isn't using find with retro awkward?

2011-02-15 Thread Denis Koroskin
On Wed, 16 Feb 2011 09:22:02 +0300, Denis Koroskin 2kor...@gmail.com wrote: On Tue, 15 Feb 2011 06:35:21 +0300, Andrej Mitrovic n...@none.none wrote: import std.stdio, std.algorithm, std.range; void main() { writeln( find([5, 1, 2, 3, 4, 5, 1], 5) ); writeln( find(retro([5, 1, 2,