[Top][All Lists]

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

Exposing common type wrapping/unwrapping methods

From: Ludovic Courtès
Subject: Exposing common type wrapping/unwrapping methods
Date: Mon, 04 Apr 2005 16:37:34 +0200
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)


Most type wrapping/unwrapping methods that are used within Guile are not
exposed to the user, which is a pity.  For example, `scm_addr_vector'
(in socket.c) which converts a `sockaddr' structure to its Scheme
representation (a vector) is defined as `static'.  This leaves the C
programmer with the following alternative:

* use, e.g., `scm_connect ()' instead of `connect ()' in its C code;

* define a new SMOB (or other representation) for `sockaddr' that may be
  incompatible with Guile's representation of this C type;

* copy/paste Guile's conversion methods, hoping that they're going to
  remain valid.

Obviously, the best solution would be to expose the relevant functions
to the user.  :-)

What do you think?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]