Re:Why should I have written ZeroMQ in C, not C++ (2012)
by int_19h on Thursday December 13, 2018 @06:15AM
(#18671452)
It's also more flexible and composable, since checked exceptions aren't quite a proper part of the type system. Consider the case of a higher-order function that wants to derive its exception specification from the function it wraps.
[ Parent
| on HN ]
Re:Why should I have written ZeroMQ in C, not C++ (2012)
by barrkel on Thursday December 13, 2018 @05:05PM
(#18676555)
Eh. Very easy to model as a second return type on the function type. If your function type is polymorphic, it's just another type argument.
Re:Why should I have written ZeroMQ in C, not C++ (2012)
by int_19h on Thursday December 13, 2018 @09:11PM
(#18677864)
You also need union types. But yes, you can make it work (the original lambda proposal for Java tried to do that). Of course, once you push it to the point where it does, then it is practically indistinguishable from having a single return value that is a discriminated union.