Re: Conclusions of the exception discussion

2012-03-02 Thread Don
On 25.02.2012 06:53, Jonathan M Davis wrote: Okay, the "The Right Approach to Exceptions" thread is a huge, confusing mess at this point without a clear, definitive conclusion, and we need one. So, I'm posting here, in a new thread, what appears to me to be the conclusion that that thread comes t

Re: Conclusions of the exception discussion

2012-02-26 Thread bearophile
Timon Gehr: > Do you realize that syntactic sugar improvements are trivial to > implement (just re-write the AST a little), and have almost no influence > on the existing code base? In my opinion it's good to have a syntax to catch a many exceptions "at once". But this is yet another special sy

Re: Conclusions of the exception discussion

2012-02-26 Thread Piotr Szturmaj
Timon Gehr wrote: On 02/26/2012 07:46 PM, Piotr Szturmaj wrote: Please do not do that. It will introduce additional set of bugs and increase maintaining effort for the sake of small syntactic sugar improvements. I think current exception handling style is enough. Its successively used in C# for

Re: Conclusions of the exception discussion

2012-02-26 Thread Timon Gehr
On 02/26/2012 07:46 PM, Piotr Szturmaj wrote: Please do not do that. It will introduce additional set of bugs and increase maintaining effort for the sake of small syntactic sugar improvements. I think current exception handling style is enough. Its successively used in C# for years. Do you r

Re: Conclusions of the exception discussion

2012-02-26 Thread Piotr Szturmaj
Jonathan M Davis wrote: Okay, the "The Right Approach to Exceptions" thread is a huge, confusing mess at this point without a clear, definitive conclusion, and we need one. So, I'm posting here, in a new thread, what appears to me to be the conclusion that that thread comes to and see if we can g

Re: Conclusions of the exception discussion

2012-02-26 Thread Jonathan M Davis
On Sunday, February 26, 2012 12:24:09 Kagamin wrote: > On Saturday, 25 February 2012 at 23:32:24 UTC, Jonathan M Davis > > wrote: > > which resets the stack trace. > > This is the issue, you're trying to address with these proposals? It's _an_ issue, not the only issue. The bigger issue there is

Re: Conclusions of the exception discussion

2012-02-26 Thread Kagamin
On Saturday, 25 February 2012 at 23:32:24 UTC, Jonathan M Davis wrote: which resets the stack trace. This is the issue, you're trying to address with these proposals?

Re: Conclusions of the exception discussion

2012-02-25 Thread Daniel Murphy
"deadalnix" wrote in message news:jib71o$1v05 > > Wow, it didn't got that. This is nice, but then, the Exception type is > completely lost. > > It does means that we are not interested in the Exception type, but of its > presence, and so, maybe we just have created useless Exception types and >

Re: Conclusions of the exception discussion

2012-02-25 Thread Daniel Murphy
"kennytm" wrote in message news:1711314076351895446.251635kennytm-gmail@news.digitalmars.com... >> >> catch(auto e : E1, E2) { body; } >> -> >> >> catch(E1 e) >> { >> goto catchE2; >> } >> catch(E2 e) >> { >> catchE2: >> body; >> } > > Won't work unless the compiler enforce that 'body' do

Re: Conclusions of the exception discussion

2012-02-25 Thread Jonathan M Davis
On Saturday, February 25, 2012 07:29:01 Kevin Cox wrote: > I think there should also be multiple catches so that you can deal with > different exceptions different ways without trying to upcast them over and > over again. You can do that now. Just catch each specific exception type that you want t

Re: Conclusions of the exception discussion

2012-02-25 Thread kennytm
"Daniel Murphy" wrote: > "deadalnix" wrote in message > news:jiagbg$liu$1...@digitalmars.com... >> Le 25/02/2012 07:26, Daniel Murphy a Ècrit : >>> https://github.com/D-Programming-Language/dmd/pull/738 >> >> I do think this approach have a flaw. If we go in that direction, then it >> push dev

Re: Conclusions of the exception discussion

2012-02-25 Thread deadalnix
Le 25/02/2012 14:11, Daniel Murphy a écrit : "deadalnix" wrote in message news:jiagbg$liu$1...@digitalmars.com... Le 25/02/2012 07:26, Daniel Murphy a �crit : https://github.com/D-Programming-Language/dmd/pull/738 I do think this approach have a flaw. If we go in that direction, then it push

Re: Conclusions of the exception discussion

2012-02-25 Thread H. S. Teoh
On Sat, Feb 25, 2012 at 10:11:56AM +0100, Johannes Pfau wrote: [...] > What about that lisp exception/recovery idea? That was the most > interesting idea imho. Deadalnix & myself did a few skeletal prototypes of it, and I think it should be possible to implement it on top of the existing exception

Re: Conclusions of the exception discussion

2012-02-25 Thread Daniel Murphy
"Martin Nowak" wrote in message news:op.v98ik4hysqu...@dawg-freebsd.lan... >> It's currently 'catch(auto e : E1, E2, E3)' but changing the syntax is >> trivial if everyone decides they want it. >> > We should be consistent and allow to specify a type instead of auto. That's a very good idea. >

Re: Conclusions of the exception discussion

2012-02-25 Thread Daniel Murphy
"deadalnix" wrote in message news:jiagbg$liu$1...@digitalmars.com... > Le 25/02/2012 07:26, Daniel Murphy a écrit : >> https://github.com/D-Programming-Language/dmd/pull/738 > > I do think this approach have a flaw. If we go in that direction, then it > push devs to create new Exception type jus

Re: Conclusions of the exception discussion

2012-02-25 Thread Daniel Murphy
Could you give a code example of what you mean? You can still use multiple catch blocks perfectly well with this patch. "Kevin Cox" wrote in message news:mailman.97.1330172953.24984.digitalmar...@puremagic.com... I think there should also be multiple catches so that you can deal with diffe

Re: Conclusions of the exception discussion

2012-02-25 Thread Martin Nowak
It's currently 'catch(auto e : E1, E2, E3)' but changing the syntax is trivial if everyone decides they want it. We should be consistent and allow to specify a type instead of auto. The exception types (E1, E2, E3) should expand TypeTuples similar to how you declare base classes. alias TypeT

Re: Conclusions of the exception discussion

2012-02-25 Thread Kevin Cox
I think there should also be multiple catches so that you can deal with different exceptions different ways without trying to upcast them over and over again. On Feb 25, 2012 1:30 AM, "Daniel Murphy" wrote: > "Jonathan M Davis" wrote in message > news:mailman.93.1330149312.24984.digitalmar...@pu

Re: Conclusions of the exception discussion

2012-02-25 Thread deadalnix
Le 25/02/2012 10:11, Johannes Pfau a écrit : Am Fri, 24 Feb 2012 21:53:47 -0800 schrieb Jonathan M Davis: There were other ideas that were discussed in the thread, but I think that these are the ones that we have at least some consensus on. However, given the mess that thread is, we really shou

Re: Conclusions of the exception discussion

2012-02-25 Thread deadalnix
Le 25/02/2012 07:26, Daniel Murphy a écrit : "Jonathan M Davis" wrote in message news:mailman.93.1330149312.24984.digitalmar...@puremagic.com... However, regardless of which we choose, someone is going to have to take the time to implement it, since odds are that Walter isn't going to do it. So

Re: Conclusions of the exception discussion

2012-02-25 Thread Jonathan M Davis
On Saturday, February 25, 2012 21:12:51 Daniel Murphy wrote: > Lol I've been around for a while. I know. But particularly over the last few months, you seem to be doing a lot. - Jonathan M Davis

Re: Conclusions of the exception discussion

2012-02-25 Thread Daniel Murphy
"Jonathan M Davis" wrote in message news:mailman.94.1330151556.24984.digitalmar...@puremagic.com... > On Saturday, February 25, 2012 17:26:02 Daniel Murphy wrote: >> "Jonathan M Davis" wrote in message >> news:mailman.93.1330149312.24984.digitalmar...@puremagic.com... >> >> > However, regardless

Re: Conclusions of the exception discussion

2012-02-25 Thread Jonathan M Davis
On Saturday, February 25, 2012 10:11:56 Johannes Pfau wrote: > Am Fri, 24 Feb 2012 21:53:47 -0800 > > schrieb Jonathan M Davis : > > There were other ideas that were discussed in the thread, but I think > > that these are the ones that we have at least some consensus on. > > However, given the mes

Re: Conclusions of the exception discussion

2012-02-25 Thread Johannes Pfau
Am Fri, 24 Feb 2012 21:53:47 -0800 schrieb Jonathan M Davis : > There were other ideas that were discussed in the thread, but I think > that these are the ones that we have at least some consensus on. > However, given the mess that thread is, we really should make it > clear in a separate thread (

Re: Conclusions of the exception discussion

2012-02-24 Thread Jonathan M Davis
On Saturday, February 25, 2012 17:26:02 Daniel Murphy wrote: > "Jonathan M Davis" wrote in message > news:mailman.93.1330149312.24984.digitalmar...@puremagic.com... > > > However, regardless of which we choose, someone is going to have to take > > the > > time to implement it, since odds are that

Re: Conclusions of the exception discussion

2012-02-24 Thread Daniel Murphy
"Jonathan M Davis" wrote in message news:mailman.93.1330149312.24984.digitalmar...@puremagic.com... > However, regardless of which we choose, someone is going to have to take > the > time to implement it, since odds are that Walter isn't going to do it. So, > whether we end up with a feature alo

Conclusions of the exception discussion

2012-02-24 Thread Jonathan M Davis
Okay, the "The Right Approach to Exceptions" thread is a huge, confusing mess at this point without a clear, definitive conclusion, and we need one. So, I'm posting here, in a new thread, what appears to me to be the conclusion that that thread comes to and see if we can get some sort of consens