guile-gi icon indicating copy to clipboard operation
guile-gi copied to clipboard

Implement and test hash types

Open spk121 opened this issue 6 years ago • 3 comments

Implement scheme-to-GHashTable conversion functions and ensure that all the libmarshall tests pass for hash tables.

spk121 avatar Sep 03 '19 21:09 spk121

So it appears that in the GIR and Typelib files, all of the GHashTable constructors are marked as not introspectable, so there is no way to construct a GHashTable via introspected methods. However, the type itself and many methods are introspectable. Thus, any GHashTable constructors will need to be supplied by this project.

spk121 avatar Sep 16 '19 11:09 spk121

I've implemented a minimal interface. It is primitive, but, it provides the minimum functionality and tracks the C API. I'm not sure about what higher-level API would be appropriate, since so much depends on interpreting the pointers that GHashTables use as their keys and values.

spk121 avatar Nov 15 '19 06:11 spk121

These patches always convert a Guile hashtable to a GHashTable and vice versa as required by a function call. OUT and INOUT are handled correctly. The next problem is that a GHashTable can be marked as IN only in a function call, but, the function can still modify the hashtable. (see g_hash_table_insert) Two strategies

  • Return a Guile representation of the GHashTable as output, as if it were an INOUT parameter. (But can't use INOUT handling directly because of the extra level of indirection of INOUT parameters)
  • After the function call, modify the Guile hashtable to match the GHashTable

spk121 avatar Nov 26 '19 03:11 spk121