From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.user Subject: Re: C extensions Date: Sun, 21 Feb 2021 12:10:23 +0800 Message-ID: References: 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="37653"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Tim Meehan Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Feb 21 05:10:51 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 1lDg54-0009gj-VO for guile-user@m.gmane-mx.org; Sun, 21 Feb 2021 05:10:50 +0100 Original-Received: from localhost ([::1]:40518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDg53-0003g2-OC for guile-user@m.gmane-mx.org; Sat, 20 Feb 2021 23:10:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDg4t-0003ff-VS for guile-user@gnu.org; Sat, 20 Feb 2021 23:10:40 -0500 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:40997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDg4s-00057n-8V for guile-user@gnu.org; Sat, 20 Feb 2021 23:10:39 -0500 Original-Received: by mail-lj1-x236.google.com with SMTP id e17so45114415ljl.8 for ; Sat, 20 Feb 2021 20:10:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7dv9Bh/l/xEyRvLZgza343qHF1hR2YLrcB8FQsY/hVk=; b=qlz1rpLW7z9QhZH7VoE/LjM3lbyL1XNUr61Ov9RJC+R6Nyz5VsUcm93sU9NIjx35Qh 56/Mxs3Ca02waF/PTkMhTfow85nx3bW5uEsMFgM0/5B8H8bqxjGNubP/IHHn3fdyoRVu 0SjoNl+6fvI3H2kRkYhmF2BKw8DrCC+r3aG2F7Cl4TYZ1r9K9OoBsHifzofGbpT35SQo WhD0oYAHxaL/1bJkRdn+ACbT1LS1Y5Pks0QzJ3AeqhEFWtGPDRdpNc9YiKtvEZ73rUsB 0ByAS+WKDx/UbJJb7mJgqBaL4x5DrA694JdTfjjruenLLGgd+GM+pqHB2ej8/eoT+cod /yQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7dv9Bh/l/xEyRvLZgza343qHF1hR2YLrcB8FQsY/hVk=; b=X41PtU/kPfoVsVGqlX2353a5dYcDtVwh/zqehNXjWAxTV6Ag2KBI8v5r6mFV8hq98Q X293xTLqnLwAWKl/I+6/zB1bb8DsI4gBFxmHxOvQK0JaqHPoJifMzvbhowvXCT1tCOJM xvneTkDsB6uSkEBh1R763hmQk/KH3CVRgUMmX8QDnXkvN9loMDM5QDRJ3UxDqcKvjP1K XGGUKwBL4KsvHuGLHOt5fbjAPqJ0W4kbYVkutY2OuRY6lHlDwDOKOrS9Y5xnrsirFWH8 +VSzF9iD6wXWj+WqefiFmim7MluNlVd188K85CPujrQMVYDyKdQ6Dp67zZzcytOhxdIr 2VVw== X-Gm-Message-State: AOAM531AbrJeA+245i1L8e+EQvslbLaIqbQokXdn3+6VYQp526zSlc3Z odxhaKIm6anPfM2hAABlgCM2w9pXjEfHe0uBNMc= X-Google-Smtp-Source: ABdhPJxId2WsMINdZZqBcKASArW1SwaPCvmf7YTsV4V61XbSe6eFavkoRoBwDijQYTkSfAZ445p5WzJhAsH3FIsMi0A= X-Received: by 2002:a19:f11d:: with SMTP id p29mr5707235lfh.547.1613880635918; Sat, 20 Feb 2021 20:10:35 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=nalaginrut@gmail.com; helo=mail-lj1-x236.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:17289 Archived-At: Hi Tim! I think you may try these functions: scm_is_true scm_is_real_p scm_geq_p Best regards. On Sun, Feb 21, 2021 at 11:57 AM Tim Meehan wrote: > 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? >