() Doug Evans <d...@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
pgpO3yapJnvly.pgp
Description: PGP signature