On 25/10/2024 16:10, Didier Kryn wrote:
>
> As usual, in Ada, you have several options to achieve your goal and it is up
> to you to choose the most elegant. You can also use the try-block method
> suggested by Karl, by inserting a short nested subprogram:
>
True. In fact here is two ways of doing an option type. The first is nice and
simple though it does use generics. The other uses tagged types and may be more
capable. I'm not sure as it is lacking documentation.
https://github.com/kevlar700/option_type/blob/main/option.ads
https://github.com/mosteo/optional/tree/main