From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#18592: FFI should have portable access to =?UTF-8?Q?=E2=80=98errno=E2=80=99?= Date: Tue, 05 Jan 2016 10:08:09 -0500 Message-ID: <87vb78jc86.fsf@netris.org> References: <87fvf8oocf.fsf@ft.bewatermyfriend.org> <87h9vmy0zw.fsf@gnu.org> <87twzgeh3c.fsf@yeeloong.lan> <87r3uko4c9.fsf@gnu.org> <1451565229.3594.59.camel@Renee-desktop.suse> <1451909046.3594.135.camel@Renee-desktop.suse> <8760z9gw7o.fsf@netris.org> <1451934872.3594.150.camel@Renee-desktop.suse> <20160105074924.GA23165@tuxteam.de> <1451983123.3594.156.camel@Renee-desktop.suse> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1452006563 16460 80.91.229.3 (5 Jan 2016 15:09:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jan 2016 15:09:23 +0000 (UTC) Cc: 18592@debbugs.gnu.org To: Nala Ginrut Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Jan 05 16:09:14 2016 Return-path: Envelope-to: guile-bugs@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 1aGTEW-0008Bj-IC for guile-bugs@m.gmane.org; Tue, 05 Jan 2016 16:09:12 +0100 Original-Received: from localhost ([::1]:50035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGTEV-0006Gj-RS for guile-bugs@m.gmane.org; Tue, 05 Jan 2016 10:09:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGTES-0006GT-4H for bug-guile@gnu.org; Tue, 05 Jan 2016 10:09:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGTEM-0006d6-66 for bug-guile@gnu.org; Tue, 05 Jan 2016 10:09:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGTEM-0006cl-29 for bug-guile@gnu.org; Tue, 05 Jan 2016 10:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aGTEL-0005Xb-Ls for bug-guile@gnu.org; Tue, 05 Jan 2016 10:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 05 Jan 2016 15:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18592 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 18592-submit@debbugs.gnu.org id=B18592.145200650021249 (code B ref 18592); Tue, 05 Jan 2016 15:09:01 +0000 Original-Received: (at 18592) by debbugs.gnu.org; 5 Jan 2016 15:08:20 +0000 Original-Received: from localhost ([127.0.0.1]:38961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGTDg-0005Wf-ED for submit@debbugs.gnu.org; Tue, 05 Jan 2016 10:08:20 -0500 Original-Received: from world.peace.net ([50.252.239.5]:43388 ident=hope9) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGTDe-0005WX-Bd for 18592@debbugs.gnu.org; Tue, 05 Jan 2016 10:08:18 -0500 Original-Received: from [10.1.10.78] (helo=jojen) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aGTDX-0002gG-DO; Tue, 05 Jan 2016 10:08:11 -0500 In-Reply-To: <1451983123.3594.156.camel@Renee-desktop.suse> (Nala Ginrut's message of "Tue, 05 Jan 2016 16:38:43 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7927 Archived-At: Nala Ginrut writes: > On Tue, 2016-01-05 at 08:49 +0100, tomas@tuxteam.de wrote: >> Sorry for intervening from the peanut gallery, but if I understood Mark >> correctly, he only was proposing to introduce a second function for the >> C API (to keep backward compatibility at the linking-to-C level). At the >> Guile source level, I guess all can be subsumed under one function. Yes, Tom=C3=A1s is correct. For the Scheme API, I would prefer to keep just one procedure 'pointer->procedure' that accepts an optional #:return-errno? keyword argument, as we had previously agreed. > If we want to combine them in Scheme level, we have to change the name > "pointer->procedure" in C level, since it's registered with SCM_DEFINE. That's right, the C function name in the SCM_DEFINE construct would need to have a different name and be private, perhaps something like 'scm_i_pointer_to_procedure_with_keywords'. > Dunno if it breaks the ABI too. As long as there still exists a 'scm_pointer_to_procedure' function with the same signature and semantics as it has now, that will preserve ABI compatibility. More specifically, here's what I'd suggest: * A new, static, 'pointer_to_procedure' C function that inherits the signature and body of 'scm_pointer_to_procedure' but with a new and required 'return_errno' argument. The other functions below would be wrappers for this function. * A new private 'scm_i_pointer_to_procedure_with_keywords' C function, defined using SCM_DEFINE and bound to 'pointer->procedure' in Scheme, that uses 'scm_c_bind_keyword_arguments' and calls 'pointer_to_procedure'. * The C API function 'scm_pointer_to_procedure', which has the same arguments as in Guile 2.0.11 and calls 'pointer_to_procedure' with 'return_errno' set to SCM_BOOL_F. * A new C API function 'scm_pointer_to_procedure_with_errno', which is identical to 'scm_pointer_to_procedure' except that it calls 'pointer_to_procedure' with 'return_errno' set to SCM_BOOL_T. The only change to foreign.h would be to add a prototype for 'scm_pointer_to_procedure_with_errno'. What do you think? Regards, Mark