This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: guile scripting for gdb


() Doug Evans <dje@sebabeach.org>
() Sat, 9 Nov 2013 10:40:18 -0800

   Would it be ok to punt on eq?-ness until there's a compelling reason
   to make it work?

Does the non-âeq?â-ness of smobs prevent them from retaining object
properties, here?  This is the long-standing bug that GNU Serveez is
addressing (in the next release):

 http://git.savannah.gnu.org/cgit/serveez.git?h=p

by keeping a hash of all smobs, keyed on the underlying C object
address, and requiring the C layer to inform the Guile glue code when
the C object is about to be freed (a degenerate "observer pattern").

We are able to do this only because two of the types are in the glue
code (no special hooks needed) and the one hook necessary for the type
"internally" managed by libserveez is easy to add because we control the
libserveez API.

Anyway, however one chooses to do it (i am open to suggestions on how to
do it better, btw!), the benefit to the user is that:

 (define prop (make-object-property))
 (set! (prop OBJ) VALUE)

works "normally, as expected" for OBJ == smob wrapping the "same C
object", as well as any other.  (One less thing to worry about.)
For GNU Serveez, at least, this is compelling enough.

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

Attachment: pgp6p0GFlHb9f.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]