Re: opDispatch, duck typing, and error messages

2011-04-24 Thread Jacob Carlborg
On 2011-04-24 01:39, Jonathan M Davis wrote: On 2011-04-22 01:54, Jonathan M Davis wrote: Jonathan M Davis wrote: I just checked. Exception _does_ take a default file and line number. Huh, maybe my dmd is getting old. Maybe we should revisit this after the next dmd release. Sounds like one i

Re: opDispatch, duck typing, and error messages

2011-04-23 Thread Jonathan M Davis
> On 2011-04-22 01:54, Jonathan M Davis wrote: > >> Jonathan M Davis wrote: > >>> I just checked. Exception _does_ take a default file and line number. > >> > >> Huh, maybe my dmd is getting old. > >> > >> Maybe we should revisit this after the next dmd release. Sounds like > >> one is coming pre

Re: opDispatch, duck typing, and error messages

2011-04-23 Thread Jacob Carlborg
On 2011-04-22 01:54, Jonathan M Davis wrote: Jonathan M Davis wrote: I just checked. Exception _does_ take a default file and line number. Huh, maybe my dmd is getting old. Maybe we should revisit this after the next dmd release. Sounds like one is coming pretty soon with a lot of yummy goodn

Re: opDispatch, duck typing, and error messages

2011-04-22 Thread spir
On 04/22/2011 03:53 AM, Robert Jacques wrote: On Thu, 21 Apr 2011 18:24:55 -0400, Adam D. Ruppe wrote: [snip] Or, there's a whole new approach: e) Duck typing for ranges in to!() might be a bad idea. Again, remember, a class might legitimately offer a range interface, so it would trigger this

Re: opDispatch, duck typing, and error messages

2011-04-22 Thread spir
On 04/22/2011 01:25 AM, Adam D. Ruppe wrote: bearophile wrote: Maybe exceptions nature should be changed a little so they store __FILE__ and __LINE__ on default (exceptions without this information are kept on request, for optimization purposes). I'd like that. Even with a stack trace, it's

Re: opDispatch, duck typing, and error messages

2011-04-22 Thread spir
On 04/22/2011 12:24 AM, Adam D. Ruppe wrote: I just made an innocent little change to one of my programs, hit compile, and got this vomit: /home/me/d/dmd2/linux/bin/../../src/phobos/std/conv.d(97): Error: template std.conv.toImpl(T,S) if (!implicitlyConverts!(S, T)&& isSomeString!(T)&& isInput

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Robert Jacques
On Thu, 21 Apr 2011 18:24:55 -0400, Adam D. Ruppe wrote: [snip] Or, there's a whole new approach: e) Duck typing for ranges in to!() might be a bad idea. Again, remember, a class might legitimately offer a range interface, so it would trigger this message without opDispatch. If ranges are me

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Adam D. Ruppe
Jonathan M Davis wrote: > It was in dmd 2.052. This is almost definitely my error then... I still have 2.050! I didn't realize so much has passed since my last update :S

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Andrej Mitrovic
On 4/22/11, Sean Kelly wrote: > On Apr 21, 2011, at 4:10 PM, Andrej Mitrovic wrote: > >> Btw, there is a stack trace for Windows and D2, see here: >> http://3d.benjamin-thaut.de/?p=15 > > Already in the next DMD release. > Whoa, the next release is gonna be big.

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Jonathan M Davis
> Jonathan M Davis wrote: > > I just checked. Exception _does_ take a default file and line number. > > Huh, maybe my dmd is getting old. > > Maybe we should revisit this after the next dmd release. Sounds like > one is coming pretty soon with a lot of yummy goodness in it. All > of this Exceptio

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Jonathan M Davis
> Jonathan M Davis wrote: > > It _does_ generally make sense for the file and line number to be > > from the throw point rather than the point where you called the > > function (especially when the throw point could be several function > > calls away in the stack), but without a proper stack trace,

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Adam D. Ruppe
Jonathan M Davis wrote: > I just checked. Exception _does_ take a default file and line number. Huh, maybe my dmd is getting old. Maybe we should revisit this after the next dmd release. Sounds like one is coming pretty soon with a lot of yummy goodness in it. All of this Exception stuff may be m

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Adam D. Ruppe
Jonathan M Davis wrote: > It _does_ generally make sense for the file and line number to be > from the throw point rather than the point where you called the > function (especially when the throw point could be several function > calls away in the stack), but without a proper stack trace, you > hav

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Sean Kelly
On Apr 21, 2011, at 4:10 PM, Andrej Mitrovic wrote: > Btw, there is a stack trace for Windows and D2, see here: > http://3d.benjamin-thaut.de/?p=15 Already in the next DMD release.

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Jonathan M Davis
> bearophile wrote: > > Maybe exceptions nature should be changed a little so they store > > > > __FILE__ and __LINE__ on default (exceptions without this > > information are kept on request, for optimization purposes). > > I'd like that. Even with a stack trace, it's nice to have that > availabl

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Adam D. Ruppe
bearophile wrote: > Maybe exceptions nature should be changed a little so they store > __FILE__ and __LINE__ on default (exceptions without this > information are kept on request, for optimization purposes). I'd like that. Even with a stack trace, it's nice to have that available right at the top

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Andrej Mitrovic
Btw, there is a stack trace for Windows and D2, see here: http://3d.benjamin-thaut.de/?p=15

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Andrej Mitrovic
> This is a more general problem of runtime errors, not just of to!(). Maybe > exceptions nature should be changed a little so they store __FILE__ and > __LINE__ on default (exceptions without this information are kept on > request, for optimization purposes). Vote up for that. At least it should

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread Jonathan M Davis
> Adam D. Ruppe: > > c) Maybe Phobos could help out somehow? Another thing to!() > > annoys the living crap of me with is it's runtime errors. It, again, > > doesn't tell me where in my code the problem occurred. > > > > Perhaps have it take default __FILE__ and __LINE__ args to print out > > too?

Re: opDispatch, duck typing, and error messages

2011-04-21 Thread bearophile
Adam D. Ruppe: > c) Maybe Phobos could help out somehow? Another thing to!() > annoys the living crap of me with is it's runtime errors. It, again, > doesn't tell me where in my code the problem occurred. > > Perhaps have it take default __FILE__ and __LINE__ args to print out > too? I think this

opDispatch, duck typing, and error messages

2011-04-21 Thread Adam D. Ruppe
I just made an innocent little change to one of my programs, hit compile, and got this vomit: /home/me/d/dmd2/linux/bin/../../src/phobos/std/conv.d(97): Error: template std.conv.toImpl(T,S) if (!implicitlyConverts!(S, T) && isSomeString!(T) && isInputRange!(Unqual!(S)) && isSomeChar!(ElementType!(