From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Meehan Newsgroups: gmane.lisp.guile.user Subject: C extensions Date: Sat, 20 Feb 2021 21:56:34 -0600 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21515"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Feb 21 04:56:59 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDfrf-0005UB-JU for guile-user@m.gmane-mx.org; Sun, 21 Feb 2021 04:56:59 +0100 Original-Received: from localhost ([::1]:39182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDfre-0002Et-4C for guile-user@m.gmane-mx.org; Sat, 20 Feb 2021 22:56:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDfrT-0002EZ-Vp for guile-user@gnu.org; Sat, 20 Feb 2021 22:56:48 -0500 Original-Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:43519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDfrS-00054L-DN for guile-user@gnu.org; Sat, 20 Feb 2021 22:56:47 -0500 Original-Received: by mail-qk1-x72f.google.com with SMTP id m144so9574218qke.10 for ; Sat, 20 Feb 2021 19:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Eb41eWtRKY4qq93UvKH/bMn1hTMxtR4pWWLmQq4rgw0=; b=VX0kyIGE1+2vU2UO10vkfAmIpW639k0n/QAjX6ZyZRdJhSd4ipV2650CmnlWLnO3D5 LnqZ2E6jYn5CugDTXwszzqviraMqWA3QU92eqOfDL/qGouAbNVKe2jlkhWWuHM+MjcJe Hwoofu7q/t39N9m9SUcEpA1djA4L/t5mYNLOzLbamg/n9XON7mDH3ime3OgtgZBSOdLP Jlz9A04ySsxyUOcgiU4tORkQlPYQCgNMPqrScP50zCg1srkpLy5vQC1YqzxNXGMwY+wT OHriqJJDfQRUyUUFPnht1xOLNleZUyS3OakLlKoxsSSTdIw9oaPxejAXLrHMhCn2CRVl +2kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Eb41eWtRKY4qq93UvKH/bMn1hTMxtR4pWWLmQq4rgw0=; b=eASGAm/VJo7V5BllOhPZ22rBUMuxquG7vj6judg10ZzDZQmfnlV/KnMXg3ONkQ6uWJ E6LqncrCdYWl5xsrBlMuKQFqX4vuifVt1khiNDAVFeWva6Nn9M7UnAULUUYuVeKgaT48 aMC6J4job0ccsATHX59tMgeklJkolAdUKKSutXO6RqFSQrLhd2snXz6bBwUUHV5momsq 2lk1/ZkciFxQgMTrPfkKYLuEHZSF0sN5tC8s06VnTSYDcHwjBloeaGzRkdFgiZztFeuB htMHE8Mo/ANHxFCqW6oimJL03o333nArrPHPpobnO6f5/PFT2qshNwJ6MK7d6dGWW0Af 5y7w== X-Gm-Message-State: AOAM533o6V1fFWHCRIbgB7liGnT2jdVlpj2CD+FLucTzsdfjEhJC7Q3h RIx1ef1gjghJh2F9HQ3z9oLDnVRF9YkQwWa6/rThSuLMmIY= X-Google-Smtp-Source: ABdhPJxCIwDBGdV0/j6iWCCnfxoWJ0IJgeVR8um9wOMOzFhQyGz99+RPUE8bV4bsSBJXWqdOFquR5pZibBabvAYb76E= X-Received: by 2002:a37:ae01:: with SMTP id x1mr15822427qke.492.1613879804850; Sat, 20 Feb 2021 19:56:44 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::72f; envelope-from=btmeehan@gmail.com; helo=mail-qk1-x72f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17288 Archived-At: I'm trying my hand a writing C extensions. I've done this for stuff like Matlab before, and was wondering how you do the usual checking of the arguments that are passed in from Guile. In the manual, 6.13.13.1 "C Support" has a few functions. libguile/numbers.h has a bunch more ... What I have is an extension function, sort of like the bessel function in the tutorial: https://www.gnu.org/software/guile/manual/html_node/A-Sample-Guile-Extension.html What I would like to do is verify that the first argument is an inexact number, larger than 0. How would I go about that? Perhaps some of it could be: SCM_REALP scm_misc_error Any tips?