Generic collection/element function signatures in D2 versus D1

2010-09-04 Thread Nick Sabalausky
In D1 I did this sort of thing a fair amount: void foo(T)(T[] collection, T elem) { // Blah, whatever } Worked for any of the string types, worked for any array, or anything with the appropriate opIndexes, and for all I know there may be some improvement that could still be made. But of

Re: Generic collection/element function signatures in D2 versus D1

2010-09-04 Thread Nick Sabalausky
Nick Sabalausky a...@a.a wrote in message news:i5su5e$23m...@digitalmars.com... In D1 I did this sort of thing a fair amount: void foo(T)(T[] collection, T elem) { // Blah, whatever } Worked for any of the string types, worked for any array, or anything with the appropriate

Re: Generic collection/element function signatures in D2 versus D1

2010-09-04 Thread Jacob Carlborg
On 2010-09-04 10:02, Nick Sabalausky wrote: Nick Sabalauskya...@a.a wrote in message news:i5su5e$23m...@digitalmars.com... In D1 I did this sort of thing a fair amount: void foo(T)(T[] collection, T elem) { // Blah, whatever } Worked for any of the string types, worked for any array, or

Re: Understanding isInfinite(Range)

2010-09-04 Thread Simen kjaeraas
Peter Alexander peter.alexander...@gmail.com wrote: == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Fri, 03 Sep 2010 11:12:29 -0400, Andrej Mitrovic andrej.mitrov...@test.com wrote: What does char[1 + Range.empty] do? It looks rather cryptic.. char[1+Range.empty] is a

Synchronized methods in D2

2010-09-04 Thread Jacob Carlborg
I'm currently porting a D1 code base to D2 which has the following class hierarchy: interface Map { void clear (); } class Hashtable : Map { synchronized void clear () {}; } class HashMap : Map { void clear () {}; } When I compiler the code I get an error about the clear method

Re: Synchronized methods in D2

2010-09-04 Thread Era Scarecrow
I'm currently porting a D1 code base to D2 which has the following class hierarchy: interface Map {       void clear (); } class Hashtable : Map {      synchronized void clear () {}; } class HashMap : Map {      void clear () {}; } When I compiler the code I get an error

Exception stack traces on Phobos2? (Win or Lin)

2010-09-04 Thread Nick Sabalausky
Is there a way to get stack traces for exceptions on Phobos2? For either Windows (preferably), or for Linux. --- Not sent from an iPhone.

Re: Exception stack traces on Phobos2? (Win or Lin)

2010-09-04 Thread Nick Sabalausky
Nick Sabalausky a...@a.a wrote in message news:i5ufqs$1v2...@digitalmars.com... Is there a way to get stack traces for exceptions on Phobos2? For either Windows (preferably), or for Linux. Oops, sorry, I completely forgot I asked the exact same thing here little more than a month ago :)

Re: Exception stack traces on Phobos2? (Win or Lin)

2010-09-04 Thread Brad Roberts
On 9/4/2010 3:14 PM, Nick Sabalausky wrote: Nick Sabalausky a...@a.a wrote in message news:i5ufqs$1v2...@digitalmars.com... Is there a way to get stack traces for exceptions on Phobos2? For either Windows (preferably), or for Linux. Oops, sorry, I completely forgot I asked the exact same

Re: Generic collection/element function signatures in D2 versus D1

2010-09-04 Thread Jonathan M Davis
On Saturday 04 September 2010 00:57:48 Nick Sabalausky wrote: In D1 I did this sort of thing a fair amount: void foo(T)(T[] collection, T elem) { // Blah, whatever } Worked for any of the string types, worked for any array, or anything with the appropriate opIndexes, and for all I

Re: Synchronized methods in D2

2010-09-04 Thread Jonathan M Davis
On Saturday 04 September 2010 12:06:23 Era Scarecrow wrote: I'm currently porting a D1 code base to D2 which has the following class hierarchy: interface Map { void clear (); } class Hashtable : Map { synchronized void clear () {}; } class HashMap : Map

Re: Exception stack traces on Phobos2? (Win or Lin)

2010-09-04 Thread Jonathan M Davis
On Saturday 04 September 2010 15:14:30 Nick Sabalausky wrote: Nick Sabalausky a...@a.a wrote in message news:i5ufqs$1v2...@digitalmars.com... Is there a way to get stack traces for exceptions on Phobos2? For either Windows (preferably), or for Linux. Oops, sorry, I completely forgot I

Re: Exception stack traces on Phobos2? (Win or Lin)

2010-09-04 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmail.com wrote in message news:mailman.95.1283646171.858.digitalmars-d-le...@puremagic.com... On Saturday 04 September 2010 15:14:30 Nick Sabalausky wrote: Nick Sabalausky a...@a.a wrote in message news:i5ufqs$1v2...@digitalmars.com... Is there a way to get

Re: Exception stack traces on Phobos2? (Win or Lin)

2010-09-04 Thread Jonathan M Davis
On Saturday 04 September 2010 17:25:23 Nick Sabalausky wrote: Didn't work for me on Linux/2.048. I'm not sure what to tell you. I'm using dmd 2.048 on linux, and if I compile the following program void func() { assert(1 == 0); } void main() { func(); } with the command dmd d.d

Re: Exception stack traces on Phobos2? (Win or Lin)

2010-09-04 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmail.com wrote in message news:mailman.96.1283648486.858.digitalmars-d-le...@puremagic.com... On Saturday 04 September 2010 17:25:23 Nick Sabalausky wrote: Didn't work for me on Linux/2.048. I'm not sure what to tell you. I'm using dmd 2.048 on linux, and if I

Re: Exception stack traces on Phobos2? (Win or Lin)

2010-09-04 Thread Nick Sabalausky
Nick Sabalausky a...@a.a wrote in message news:i5v7gv$22...@digitalmars.com... Jonathan M Davis jmdavisp...@gmail.com wrote in message news:mailman.96.1283648486.858.digitalmars-d-le...@puremagic.com... On Saturday 04 September 2010 17:25:23 Nick Sabalausky wrote: Didn't work for me on