Article: D Exceptions and C Callbacks

Mike Parker aldacron at gmail.com
Fri Aug 9 07:54:43 PDT 2013


On Friday, 9 August 2013 at 14:08:48 UTC, Rene Zwanenburg wrote:

>
> - In your second code sample, the D translation of the C code, 
> the line
>     glfwSetWindowCloseCallback( &onWindowClose );
>   should read either
>     glfwSetWindowCloseCallback( win, &onWindowClose );
>   or
>     win.glfwSetWindowCloseCallback( &onWindowClose );

Thanks! That was an oversight. I've corrected it.

>
> - When explaining the difference between D Throwable, 
> Exception, and Error, you write:
>     The latter is analagous to Java's RuntimeException in that
>     it is not intended to be caught. It should be thrown to
>     indicate an unrecoverable error in the program.
>   Java uses Error for unrecoverable errors too. 
> RuntimeExceptions are recoverable and meant to be catched. It 
> would be more accurate to say D lacks Java's checked 
> exceptions, D exceptions are like Java's RuntimeExceptions, and 
> D Errors are like Java Errors.

I just removed the reference to Java entirely. Thanks for 
pointing that out. I've had it in my head for years that 
RuntimeException was for unrecoverable errors.


More information about the Digitalmars-d-announce mailing list