Re: Transfer rules of inout parameters



On Fri, Feb 9, 2018 at 12:31 PM, Philip Withnall <philip tecnocode co uk> wrote:
 • Instead, allow separate annotations for the ‘in’ and ‘out’ modes for
a parameter; something like (in (nullable) (transfer none)) (out (not
nullable) (transfer full)).
 • That’s because quite a few of the annotations could theoretically
differ between the modes: nullability, transfer and array length.
 • Because this is tricky to reason about, don’t have a default:
require that everything is always specified for inout parameters.
 • My suggested syntax is horrible.

Somewhat related, having two separate descriptions for in/out would
also be nice for the binding documentation as the in and out parts get
split into a parameter and a return value, each needing their own
description. For example with gtk_init_check [0] this currently
results in a confusing duplicated description which focuses on the C
value type instead of the actual values being transferred [1].

[0] https://gitlab.gnome.org/GNOME/gtk/blob/3.22.26/gtk/gtkmain.c#L1073
[1] https://lazka.github.io/pgi-docs/#Gtk-3.0/functions.html#Gtk.init_check


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]