spk121 / guile-gi

Bindings for GObject Introspection and libgirepository for Guile
GNU General Public License v3.0
58 stars 7 forks source link

Support conversion of Guile lists to c native immediate arrays #89

Open spk121 opened 3 years ago

spk121 commented 3 years ago

When working with tree-store:set aka gtk_tree_store_set_valuesv, it uses gint* to receive a list of columns. Currently guile-gi expects to receive a bytevector. For IN arguments, we could support converting Scheme lists of integers to gint* arrays make such API easier on use. This could be extended to the multiple integer and real number types This would be a slow path, but, in the case of tree-store:set these C arrays are expected to be quite short.

LordYuuma commented 3 years ago

Is there a reason to do this internally rather than using list->[us]XX-vector, the procedures from (gi util) or even the [us]XXvector notation? Doing that would not only complicate the logic inside gig_argument, but also the creation of functions as we'd have to create any number of overrides for list/bytevector equivalences [not just those for optional arguments].