Hello! Andy Wingo <wi...@pobox.com> skribis:
> 7) There is legacy code out there that uses e.g. SCM_SETCDR to set > smob fields. (This is terrible, but it exists: > https://github.com/search?q=SCM_SETCDR+smob&ref=cmdform&type=Code > for an example.) [...] > I propose to provide a new interface that will eventually make SMOBs > obsolete. This new interface is based on structs with raw fields -- the > 'u' fields. (See > http://www.gnu.org/software/guile/docs/master/guile.html/Vtables.html#Vtables > for description of 'u' fields. Note that the documentation is wrong -- > these fields are indeed traced by the GC.) I like the idea or basic the new facility on structs. I would have preferred to rebase SMOBs on top of structs, with the added documentation as to how they can be accessed from Scheme, but I suppose this is ruled out by the SCM_SETCDR issue above? > So, what do people think? The patch below is against stable-2.0. The API looks good to me. The C code could use comments above functions, but otherwise nothing more than what Mark said about the patch. Thanks! Ludo’.