Previous: , Up: Argument Conversion   [Contents][Index]


2.4.10 Hash Tables and GHashTable Types

One special case is that of GLib’s GHashTable types. The guile-gi library converts native Guile hash tables to GHashTable types as necessary when calling introspected native functions. However, marshalling Guile hash tables into GHashTable types and back again has limitations.

First, the keys of instances of GHashTable have a native type, and only a few common key types are handled by guile-gi: integers, real numbers, and strings can be converted. All other types are treated as a pointer, which may not be what is intended.

Second, some introspected native functions modify instances of GHashTable that are passed in as input arguments. The modifications to an instance of GHashTable input will not be reflected in the Guile hash tables from which is was created.