[gtkada] GtkAda signal handlers interface proposal
Emmanuel Briot
briot at adacore.com
Thu Apr 28 14:49:12 CEST 2016
>>
> The scenario is when the user forgets to specify the Slot parameter, and when he will try to convert the parameter Constraint_Error will propagate and consequently crash the application. Using the Slot parameter is untyped and inherently unsafe.
No, as I explained it won't crash the application.
It isn't untyped at all. It cannot be statically checked by the compiler, granted, but it is of course
fully type safe.
Since this seems to be the issue you are trying to solve with your proposal, that sounds way too
much work (not to mention again that the design is dangerous as it stands) to be worth adding to
GtkAda. This is already handled using either the Slot object or generic instances with User_Data
(I should hope in that case that you are using a Watch on the object, so that the handler is removed
when the user data is destroyed !)
More information about the gtkada
mailing list