From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexei Matveev Newsgroups: gmane.lisp.guile.bugs Subject: bug#10974: guile-user@gnu.org Date: Thu, 8 Mar 2012 12:36:37 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1331304130 1692 80.91.229.3 (9 Mar 2012 14:42:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2012 14:42:10 +0000 (UTC) To: 10974@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 09 15:42:09 2012 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 1S611E-0002wH-Ij for guile-bugs@m.gmane.org; Fri, 09 Mar 2012 15:42:08 +0100 Original-Received: from localhost ([::1]:44988 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S611D-0006yG-Sk for guile-bugs@m.gmane.org; Fri, 09 Mar 2012 09:42:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5uad-0006eg-4g for bug-guile@gnu.org; Fri, 09 Mar 2012 02:50:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5uaW-0004ET-RU for bug-guile@gnu.org; Fri, 09 Mar 2012 02:50:14 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5uaW-0004EN-LF for bug-guile@gnu.org; Fri, 09 Mar 2012 02:50:08 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S5ubO-0003B6-Ba for bug-guile@gnu.org; Fri, 09 Mar 2012 02:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alexei Matveev Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 09 Mar 2012 07:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10974 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.133127943912175 (code B ref -1); Fri, 09 Mar 2012 07:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Mar 2012 07:50:39 +0000 Original-Received: from eggs.gnu.org ([208.118.235.92]:36534) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S5bft-0006MS-Kf for submit@debbugs.gnu.org; Thu, 08 Mar 2012 06:38:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5bel-0008If-2U for submit@debbugs.gnu.org; Thu, 08 Mar 2012 06:37:20 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:48032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5bek-0008IY-T2 for submit@debbugs.gnu.org; Thu, 08 Mar 2012 06:37:14 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5bed-0003Ix-5A for bug-guile@gnu.org; Thu, 08 Mar 2012 06:37:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5beC-0008DW-BV for bug-guile@gnu.org; Thu, 08 Mar 2012 06:37:06 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:45133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5beC-0008D0-4w for bug-guile@gnu.org; Thu, 08 Mar 2012 06:36:40 -0500 Original-Received: by iajr24 with SMTP id r24so691473iaj.0 for ; Thu, 08 Mar 2012 03:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ZD1Q5iw1FkbQm1gTIhsO0rDszGt8eF68Ui5RcV8Xsc0=; b=G8jyBxthaGXJY2hM6qrsZBH0HwMH/N2FaqfphaecY66WSZW8fI5Gne6SApyrb9jC55 AC/RRxEqvYVq+8mW+V5NC17EgVx6cQMQZs8bA5Sz+sUZNCORLi2PWoqUsBpQWEPOJy/Q v4hYADcmVZ4Tgo6nLAAPJ1tc+iMBCMBzxzBm4Ik4QPUedheXJzZviRKuqB3SPK5d2VZ7 YLoLFc9yKhkNuIUlGPiWPFffB8JagAtIWrmecXY5rySBHc1gIkQEAPFLt9GpfBQK2/lV NsvYaFY/OnZs51+H7TZOdt8RDwhS8RDLJJu8xIVA/6wXBY0HnJfdpHMD3Q3lrl6MFvwi DGdw== Original-Received: by 10.50.158.133 with SMTP id wu5mr16536482igb.50.1331206597278; Thu, 08 Mar 2012 03:36:37 -0800 (PST) Original-Received: by 10.231.234.209 with HTTP; Thu, 8 Mar 2012 03:36:37 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Thu, 08 Mar 2012 12:52:53 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-List-Received-Date: Thu, 08 Mar 2012 11:38:32 -0000 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Fri, 09 Mar 2012 09:42:05 -0500 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:6254 Archived-At: Hi, All, For use from a Fortran program I am collecting API fixes for libguile.so as wrapper functions for what is provided to C-programs as macros. I noted that some of the macros are function-macros some are symbol macros. An example of the latter is #define scm_to_int scm_to_int23 This is inconsistent and makes escaping such macros slightly more difficult. (Honestly I dont know a way yet). One guile developer on IRC said this is "probably a good thing to fix" so I report it here. I dont build Guile 2 myself as the installations I use are quite dated/conservative. As a background, Fortran allows you to declare "foreign" functions, for example, like this: type, public, bind(c) :: scm_t private integer(c_intptr_t) :: do_not_ever_use end type scm_t interface function scm_symbol_p (obj) result (yes) bind (c) type(scm_t), intent(in), value :: obj type(scm_t) :: yes end function scm_symbol_p ... end interface This makes use of library functions quite handy. But it does not provide a way to access a C-macro, naturally. Alexei #include SCM guile_macro_scm_from_int (int i); int guile_macro_scm_to_int (SCM obj); int (scm_is_true) (SCM obj); int (scm_is_symbol) (SCM obj); int (scm_is_null) (SCM obj); SCM (scm_eol) (void); SCM guile_macro_scm_from_int (int i) { return scm_from_int(i); } int guile_macro_scm_to_int (SCM obj) { return scm_to_int(obj); } int (scm_is_true) (SCM obj) { return scm_is_true(obj); } int (scm_is_symbol) (SCM obj) { return scm_is_symbol(obj); } int (scm_is_null) (SCM obj) { return scm_is_null(obj); } SCM (scm_eol) () { return SCM_EOL; }