From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: RFC: Foreign objects facility Date: Mon, 28 Apr 2014 10:24:43 +0200 Message-ID: <87tx9ddfp0.fsf@gnu.org> References: <87bnvm52u6.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1398673515 6849 80.91.229.3 (28 Apr 2014 08:25:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2014 08:25:15 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Apr 28 10:25:10 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wegs9-0004iV-FX for guile-devel@m.gmane.org; Mon, 28 Apr 2014 10:25:09 +0200 Original-Received: from localhost ([::1]:42350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wegs9-0000HO-1u for guile-devel@m.gmane.org; Mon, 28 Apr 2014 04:25:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wegs1-0008Vk-GH for guile-devel@gnu.org; Mon, 28 Apr 2014 04:25:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wegrw-0003e8-Nk for guile-devel@gnu.org; Mon, 28 Apr 2014 04:25:01 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:53556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wegrw-0003dx-HV for guile-devel@gnu.org; Mon, 28 Apr 2014 04:24:56 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Wegru-0004M6-OD for guile-devel@gnu.org; Mon, 28 Apr 2014 10:24:54 +0200 Original-Received: from pluto.bordeaux.inria.fr ([193.50.110.57]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Apr 2014 10:24:54 +0200 Original-Received: from ludo by pluto.bordeaux.inria.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Apr 2014 10:24:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pluto.bordeaux.inria.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?utf-8?Q?Flor=C3=A9al?= an 222 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:nwv1mH6EkksaC3X9/IXJRPOydDA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17109 Archived-At: Hello! Andy Wingo 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’.