Re: Question on @nothrow

2017-07-05 Thread Ali Çehreli via Digitalmars-d-learn
On 06/02/2017 12:35 AM, Vasileios Anagnostopoulos wrote: > On Friday, 2 June 2017 at 07:33:05 UTC, Vasileios Anagnostopoulos wrote: >> But still I believe that @nothrow should be mandatory if there is no >> possibility for a function to throw something. I understand that in >> the DLL/LIB level t

Re: Question on @nothrow

2017-07-05 Thread Yuxuan Shui via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 09:31:48 UTC, Jonathan M Davis wrote: On Wednesday, May 31, 2017 08:18:07 Vasileios Anagnostopoulos via Digitalmars-d-learn wrote: [...] Well, if you're not doing checked exceptions, the interesting question is really what _doesn't_ throw rather than what throws,

Re: Question on @nothrow

2017-07-05 Thread Yuxuan Shui via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 08:18:07 UTC, Vasileios Anagnostopoulos wrote: Hi, after reading various articles bout the "supposed" drawbacks of checked exceptions I started to have questions on @nothrow. Why there exists and not a @throws annotation enforced by the compiler? I understand that

Re: Question on @nothrow

2017-06-02 Thread Vasileios Anagnostopoulos via Digitalmars-d-learn
On Friday, 2 June 2017 at 07:33:05 UTC, Vasileios Anagnostopoulos wrote: On Thursday, 1 June 2017 at 17:03:52 UTC, Ali Çehreli wrote: [...] But still I believe that @nothrow should be mandatory if there is no possibility for a function to throw something. I understand that in the DLL/LIB lev

Re: Question on @nothrow

2017-06-02 Thread Vasileios Anagnostopoulos via Digitalmars-d-learn
On Thursday, 1 June 2017 at 17:03:52 UTC, Ali Çehreli wrote: On 06/01/2017 08:41 AM, Vasileios Anagnostopoulos wrote: //If I do not know void haveToCommunicateWithAli() { sendEmailToAli(); } //can blow-up after code has shipped //and have no chance to recover What shall I do in this case? T

Re: Question on @nothrow

2017-06-01 Thread Ali Çehreli via Digitalmars-d-learn
On 06/01/2017 08:41 AM, Vasileios Anagnostopoulos wrote: //If I do not know void haveToCommunicateWithAli() { sendEmailToAli(); } //can blow-up after code has shipped //and have no chance to recover What shall I do in this case? Thank you in advance. Vasileios (Sorry if I go to too basic

Re: Question on @nothrow

2017-06-01 Thread Vasileios Anagnostopoulos via Digitalmars-d-learn
On Thursday, 1 June 2017 at 15:17:32 UTC, Ali Çehreli wrote: On 06/01/2017 06:26 AM, Vasileios Anagnostopoulos wrote: > how do I know that a function "may throw" an > exception in order to use a try/catch/finally block? This is my biggest > problem (sorry, coming from a java/C background). I co

Re: Question on @nothrow

2017-06-01 Thread Ali Çehreli via Digitalmars-d-learn
On 06/01/2017 06:26 AM, Vasileios Anagnostopoulos wrote: > how do I know that a function "may throw" an > exception in order to use a try/catch/finally block? This is my biggest > problem (sorry, coming from a java/C background). I come from a C++ background so the advices may be different from

Re: Question on @nothrow

2017-06-01 Thread Vasileios Anagnostopoulos via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 17:20:08 UTC, Ali Çehreli wrote: On 05/31/2017 02:10 AM, Vasileios Anagnostopoulos wrote: > compiler enforced @throws For that to be possible, the compiler would have to see all definitions, which is not possible with separate compilation. Besides, I think the on

Re: Question on @nothrow

2017-05-31 Thread Ali Çehreli via Digitalmars-d-learn
On 05/31/2017 02:10 AM, Vasileios Anagnostopoulos wrote: > compiler enforced @throws For that to be possible, the compiler would have to see all definitions, which is not possible with separate compilation. Besides, I think the only meaning of @throws would be "may throw". If so, since the i

Re: Question on @nothrow

2017-05-31 Thread Vasileios Anagnostopoulos via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 09:31:48 UTC, Jonathan M Davis wrote: [...] Thank you for the answers.

Re: Question on @nothrow

2017-05-31 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, May 31, 2017 08:18:07 Vasileios Anagnostopoulos via Digitalmars-d-learn wrote: > Hi, > > after reading various articles bout the "supposed" drawbacks of > checked exceptions I started to have questions on @nothrow. Why > there exists and not a @throws annotation enforced by the > com

Re: Question on @nothrow

2017-05-31 Thread Vasileios Anagnostopoulos via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 08:52:51 UTC, Mike Parker wrote: This has come up several times over the years. For summary, go to the search bar and type: "checked exceptions" Walter Do you realize that I do not talk about checked exceptions, only a compiler enforced @throws and nothing el

Re: Question on @nothrow

2017-05-31 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 08:18:07 UTC, Vasileios Anagnostopoulos wrote: Hi, after reading various articles bout the "supposed" drawbacks of checked exceptions I started to have questions on @nothrow. Why there exists and not a @throws annotation enforced by the compiler? I understand that

Question on @nothrow

2017-05-31 Thread Vasileios Anagnostopoulos via Digitalmars-d-learn
Hi, after reading various articles bout the "supposed" drawbacks of checked exceptions I started to have questions on @nothrow. Why there exists and not a @throws annotation enforced by the compiler? I understand that people are divided on checked exceptions and each side has some valid point