unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Rob Browning <rlb@defaultvalue.org>
Cc: Lynn Winebarger <owinebar@free-expression.org>,
	bitwize@wizards-of-source.org, guile-devel@gnu.org
Subject: Re: How to detect a procedure
Date: Tue, 30 Apr 2002 21:35:40 -0500	[thread overview]
Message-ID: <87ofg0k32b.fsf@raven.i.defaultvalue.org> (raw)
In-Reply-To: <3CCF436E.C4D765DF@pacbell.net> (Bruce Korb's message of "Tue, 30 Apr 2002 18:22:54 -0700")

Bruce Korb <bkorb@pacbell.net> writes:

> I would like:
>
>   (defined-as? 'mumble scm_class_procedure)
>
> to be equivalent to:
>
>   (and (defined? 'mumble) (procedure? mumble))
>
> but the latter is conceptually simpler.  I like simple.

or if you really like the idea of a helper, perhaps (nb: not tested,
or even carefully checked :>):

  (define-macro (defined-as? item predicate)
    `(and (defined? ,item) (,predicate ,item)))

i.e.

  (defined-as? 'mumble procedure?)

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2002-05-01  2:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-28 20:35 How to detect a procedure Bruce Korb
2002-04-29  4:52 ` bitwize
2002-04-29  9:45   ` rm
2002-04-30  0:00   ` Lynn Winebarger
2002-04-30  0:36     ` Bruce Korb
2002-04-30 13:50       ` Rob Browning
2002-05-01  1:22         ` Bruce Korb
2002-05-01  2:35           ` Rob Browning [this message]
2002-05-01  2:46             ` Lynn Winebarger
2002-05-01  3:39               ` Rob Browning
2002-05-01 21:36                 ` Bruce Korb
2002-05-01 22:18                   ` Neil Jerram

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=87ofg0k32b.fsf@raven.i.defaultvalue.org \
    --to=rlb@defaultvalue.org \
    --cc=bitwize@wizards-of-source.org \
    --cc=guile-devel@gnu.org \
    --cc=owinebar@free-expression.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).