unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: olivier.dion--- via General Guile related discussions <guile-user@gnu.org>
To: Matt Wette <matt.wette@gmail.com>, Guile User <guile-user@gnu.org>
Subject: Re: no scm_foreign_object_p ?
Date: Sat, 23 Jan 2021 14:29:13 -0500	[thread overview]
Message-ID: <87zh0zfo52.fsf@clara> (raw)
In-Reply-To: <87f7e2c4-3a42-acdf-35cf-6920b6240444@gmail.com>

On Sat, 23 Jan 2021, Matt Wette <matt.wette@gmail.com> wrote:
> I started using foreign objects but want something akin to number?, 
> string? etc.
> Is there something that works here?
> I was hoping to see scm_foreign_object_p(type, object).

The only thing I see in the manual is `scm_assert_foreign_object_type`.

For something equivalent in scheme, I guess you could do something like:
----------------------------------------------------------------------
(define (foreign? obj)
  (not (or (number? obj)
           (string? obj)
           (null? obj)
           ;; and so on..
           )))
----------------------------------------------------------------------

I agree that such predicate should be part of the buitlin API.

-- 
Olivier Dion
PolyMtl



  reply	other threads:[~2021-01-23 19:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-23 18:58 no scm_foreign_object_p ? Matt Wette
2021-01-23 19:29 ` olivier.dion--- via General Guile related discussions [this message]
2021-01-23 20:04   ` divoplade
2021-01-23 20:52     ` Matt Wette

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=87zh0zfo52.fsf@clara \
    --to=guile-user@gnu.org \
    --cc=matt.wette@gmail.com \
    --cc=olivier.dion@polymtl.ca \
    /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).