Re: nullablity
- From: Phil Clayton <phil clayton lineone net>
- To: gir-devel-list gnome org
- Subject: Re: nullablity
- Date: Mon, 05 Oct 2015 23:54:52 +0100
05/10/15 21:49, Christoph Reiter wrote:
On Mon, Oct 5, 2015 at 10:20 PM, Jasper St. Pierre
<jstpierre mecheye net> wrote:
So, there's a few complications here. The first is that our public
APIs tend to have g_return_val_if_fail (..., NULL); even if things
aren't normally null. In that case, what does a binding do? Crash?
If the NULL is only returned in case of an error (wrong usage, no GError, ...)
the bindings could raise an exception pointing to the root cause instead
of silently returning a NULL equivalent.
In writing bindings (for SML) I have been agonizing over whether a null
value should cause an exception when introspection annotations say that
the value cannot be null (in the absence of GError raised). Is it more
useful in practice to let, say, a signal handler blunder on rather than
prematurely return due to a Null exception? Ideally any function that
can fail would have a GError.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]