From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Catonano Newsgroups: gmane.lisp.guile.user Subject: Re: type friction C <-> scheme Date: Sun, 11 Jun 2017 19:15:00 +0200 Message-ID: References: <87d1ab3wfr.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1497201334 9929 195.159.176.226 (11 Jun 2017 17:15:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Jun 2017 17:15:34 +0000 (UTC) Cc: guile-user@gnu.org, Matt Wette To: Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jun 11 19:15:27 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dK6ST-00028T-4H for guile-user@m.gmane.org; Sun, 11 Jun 2017 19:15:25 +0200 Original-Received: from localhost ([::1]:34698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dK6SY-0008MT-IM for guile-user@m.gmane.org; Sun, 11 Jun 2017 13:15:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dK6S7-0008M7-B5 for guile-user@gnu.org; Sun, 11 Jun 2017 13:15:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dK6S6-0003LC-9v for guile-user@gnu.org; Sun, 11 Jun 2017 13:15:03 -0400 Original-Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]:33805) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dK6S6-0003Kx-0B for guile-user@gnu.org; Sun, 11 Jun 2017 13:15:02 -0400 Original-Received: by mail-wr0-x22d.google.com with SMTP id g76so74403554wrd.1 for ; Sun, 11 Jun 2017 10:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+pIC0nuy93Nsn6qz6W3ouBXRgcZLSoN9GCHnvYrbmwM=; b=oHya2Q5UMsKGp7IpJz81RoiJ6Ii0Upsf746xHTFOkrTuF+ReJaLwkUhfAWYkYFR5je jYx6wHvYtPG2vLf5ZOgQa1m6zDsm4G3NF0SzUNg92SQDUcckWCzgtATB7JFF7XfJGjwM 4EG0/B2WZ+5AlJq4fJaDFVVL/Ez8nBzTIn4Mjxvl6CZXsu7dTZLPRxagI25gCHtQkskp Tri7n1V1Y8vpWDJcwp45lQl1NlX6YFOIRwtGHME19MAbAsnRYTWeoBHaSPgJA4BDgb2P wHG8EJOGpXmz6jTRTVeJRtwlHPiR6ncuBYp4fXiZwXTaBuKNKMXwBBM+VfbhlFw/bl/A bK5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+pIC0nuy93Nsn6qz6W3ouBXRgcZLSoN9GCHnvYrbmwM=; b=ExeTsBQbWoXNsNNBJsCafPoUoeLAoJdvXuYPg+4RUzJ9YaRx+S0pjIUuQWzpKVcfHA MYmeqre6EDQHJ/i/WAYN3qxnRYSjFVkndJwdqhpUhYDWH1lgOFY4eueZNhv3bBPzZIVk UtqXNvW8FUApUu2i9+gZFZdqTVAtYz2oPjE4uktPEIsOcsKGV+KEKfEiQ7ZRigbrtOO4 xN50jsZJXGgxfwatBJTNSWNFqb4lRotBOVvF1EdlNRJN9/nEEhZ1Mt3gdz3ktnLt9uoR eKvWwzD2gdT0E+LVq0g1xaTj7/omRwTq3kE/a630lYMBJlDoAOiReiSygfmip38v1OIK +Qgg== X-Gm-Message-State: AODbwcDrplcGjrAz3GYiNObFw3F6pIz7l6xXG4LmfH13nwwPMRddxlxS 13eQZrRrguzGCNGD6ioBhotDltUhxw== X-Received: by 10.80.149.132 with SMTP id w4mr18317551eda.82.1497201301002; Sun, 11 Jun 2017 10:15:01 -0700 (PDT) Original-Received: by 10.80.131.4 with HTTP; Sun, 11 Jun 2017 10:15:00 -0700 (PDT) In-Reply-To: <87d1ab3wfr.fsf@netris.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22d X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13807 Archived-At: 2017-06-11 7:50 GMT+02:00 Mark H Weaver : > Catonano writes: > > > 2017-06-10 0:33 GMT+02:00 Matt Wette : > > > > I think Mike caught your real error: you were passing (list =E2=80=98* = =E2=80=98int =E2=80=98*) > and > >> it wants (list =E2=80=98* int =E2=80=98*). `int=E2=80=99 is a variabl= e defined by guile. > >> > > > > And isn't `*' a variable defined in guile too ? > > > > > >> > >> scheme@(guile-user)> (use-modules (system foreign)) > >> scheme@(guile-user)> int > >> $1 =3D 8 > >> > > > > yes, and > > > > scheme@(freexl common)> * > > $14 =3D # > > 'int' is a variable exported by (system foreign) whose sole purpose is > to represent a foreign type. > > '*' is something completely different, namely a procedure to multiply > numbers. IMO, it would be a nasty hack for the FFI to check > specifically for a multiplication procedure and interpret that as a > pointer type. > Ok, there was a misunderstanding here I thought that iin that context `*' was being exported from (system foreign) too and it was bound to someting used to represent a C pointer I hadn't understood that it is instead bound to the vanilla multiplication = ! > > I took a look at the guile-gcrypt code again > > > > it's full of things like > > > > '(* * ,int ,size_t *) > > > > that is, only asterisks (pointers) are quoted > > > > Other types are not > > > > So this must be an established convention > > > > It just seems unconsistent to me > > I agree that it's inconsistent, but '* is shorter than any descriptive > variable name that we might have chosen for this purpose, and pointers > are common enough to warrant a short name. > sure. Now I understand better > > On the other hand, if we had used symbols uniformly for all foreign > types, then it would have been impossible to bind your own type names > (e.g. for struct types) without adding a global registry of foreign > types, which would have various nasty problems such as the potential for > collisions between unrelated libraries. > Right, right Thanks for your remarks Mark, would you mind to take a look at the other thread (#define SOMETHING some_value) ? I'm stuck in wrapping this funtion from Freexl Thanks again !