Lähettäjä: Kevin Chadwick Päiväys: Vastaanottaja: dng Aihe: Re: [DNG] another programming language question
On 25/10/2024 12:39, Didier Kryn wrote: > The last section, which is optionnal, is where you decide what to do with
> exceptions, either cure the problem, print some smart information, convert it to
> another exception and forward it to the caller, or what else.
>
> After the "begin" and before the "exception" or the "end", is where the
> normal algorithm happens. In this part, you don't care about exceptions, except
> you can raise some, of course.
>
You can return from the local exception handler including a generic option type
ala rust too or just an enum which is much nicer than a C code.
The Ada community is traditionally, perhaps mostly with you Dider in regard to
exceptions but some of us are not. I don't propagate exceptions with Ada because
you can't on a light runtime but actually you can't miss handling something when
it is right there and especially if you can't get to the procedures output
unless it was successful (when using Ada to create an option type ala rust).
The counter argument is that you should engineer software and exception handler
locations properly but you can still do that with the more verbose error/success
returning too.