From: Nala Ginrut <nalaginrut@gmail.com>
To: Tim Meehan <btmeehan@gmail.com>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: C extensions
Date: Sun, 21 Feb 2021 12:10:23 +0800 [thread overview]
Message-ID: <CAPjoZocofyPTqntHax49pe+H-yPNW_+rNC6pwnJd37T18vd2OQ@mail.gmail.com> (raw)
In-Reply-To: <CACgrOxKeVr5TBH3NfyyPwQu9995prtFB48YTYGTWOgYifQiC4A@mail.gmail.com>
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 <btmeehan@gmail.com> 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?
>
next prev parent reply other threads:[~2021-02-21 4:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-21 3:56 C extensions Tim Meehan
2021-02-21 4:10 ` Nala Ginrut [this message]
2021-02-21 16:00 ` Olivier Dion via General Guile related discussions
2021-02-21 21:58 ` Tim Meehan
2021-02-21 22:18 ` Tim Meehan
2021-02-21 22:41 ` Olivier Dion via General Guile related discussions
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPjoZocofyPTqntHax49pe+H-yPNW_+rNC6pwnJd37T18vd2OQ@mail.gmail.com \
--to=nalaginrut@gmail.com \
--cc=btmeehan@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).