From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: scm_to_pointer vs scm->pointer Date: Tue, 03 Jul 2012 23:47:26 +0200 Message-ID: <871uksms9d.fsf@gnu.org> References: <871uktsv1n.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: dough.gmane.org 1341352072 30715 80.91.229.3 (3 Jul 2012 21:47:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 3 Jul 2012 21:47:52 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jul 03 23:47:52 2012 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 1SmAwo-0004t4-Dd for guile-devel@m.gmane.org; Tue, 03 Jul 2012 23:47:50 +0200 Original-Received: from localhost ([::1]:56384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmAwn-0006Ez-G5 for guile-devel@m.gmane.org; Tue, 03 Jul 2012 17:47:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmAwh-0006E4-Tt for guile-devel@gnu.org; Tue, 03 Jul 2012 17:47:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmAwf-0002G2-Um for guile-devel@gnu.org; Tue, 03 Jul 2012 17:47:43 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmAwf-0002DZ-Mc for guile-devel@gnu.org; Tue, 03 Jul 2012 17:47:41 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SmAwd-0004dq-Ow for guile-devel@gnu.org; Tue, 03 Jul 2012 23:47:39 +0200 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 03 Jul 2012 23:47:39 +0200 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 03 Jul 2012 23:47:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 Messidor an 220 de la =?iso-8859-1?Q?R=E9volution?= 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.130005 (Ma Gnus v0.5) Emacs/24.1 (gnu/linux) Cancel-Lock: sha1:ADzcY0U1WiFQhAXbr2kw/pmBwVM= 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:14701 Archived-At: Heya! Andy Wingo skribis: > scm->pointer takes a Scheme value and returns a Scheme value which is a > foreign pointer to the Scheme value. It has been in Guile since 2.0 I > think. v2.0.0-105-g148c331, apparently. > scm_to_pointer takes a Scheme value which is a foreign pointer, and > unpacks that foregin pointer as a void*. > > scm_to_pointer is a new interface in master that is not in 2.0.5, Yes. ‘scm_from_pointer’ is pre-2.0.0. > and that is inconsistent with scm->pointer / scm_scm_to_pointer. Yes, but it’s consistent with the other scm_{to,from} functions. > This should be fixed. Otherwise it's impossible to document in any > sane fashion. > > Suggestion: change scm_to_pointer to SCM_POINTER_VALUE. WDYT? I’m happy with this change. Mark? (Back then, I was skeptical about the usefulness of the C pointer API. I have since used ‘SCM_POINTER_VALUE’ and ‘scm_from_pointer’ in Guile-GCC, which uses a mixed dynamic/static FFI, and for good reasons.) Thanks, Ludo’.