From: Neil Jerram <neil@ossau.uklinux.net>
Cc: Rob Browning <rlb@defaultvalue.org>,
Lynn Winebarger <owinebar@free-expression.org>,
bitwize@wizards-of-source.org, guile-devel@gnu.org
Subject: Re: How to detect a procedure
Date: 01 May 2002 23:18:48 +0100 [thread overview]
Message-ID: <m3znzjh5pz.fsf@laruns.ossau.uklinux.net> (raw)
In-Reply-To: 3CD05FD1.D2D9D53B@pacbell.net
>>>>> "Bruce" == Bruce Korb <bkorb@pacbell.net> writes:
Bruce> Rob Browning wrote:
>>
>> Lynn Winebarger <owinebar@free-expression.org> writes:
>>
>> >> (defined-as? 'mumble procedure?)
>> >
>> > How about (defined-as procedure? 'mumble)
>> > to keep the predicate clear?
>>
>> Looks better to me :>
Bruce> Me, too :)
But I think Rob's definition was missing a quote.
This works for me:
(define-macro (defined-as predicate symbol)
`(and (defined? ',symbol)
(,predicate ,symbol)))
guile> (defined-as procedure? procedure?)
#t
guile> (defined-as procedure? does-not-exist)
#f
guile> (defined-as procedure? defined-as)
#f
guile> (defined-as macro? defined-as)
#t
guile> (defined-as procedure? %load-path)
#f
guile> (defined-as list? %load-path)
#t
Neil
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
prev parent reply other threads:[~2002-05-01 22:18 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
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 [this message]
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=m3znzjh5pz.fsf@laruns.ossau.uklinux.net \
--to=neil@ossau.uklinux.net \
--cc=bitwize@wizards-of-source.org \
--cc=guile-devel@gnu.org \
--cc=owinebar@free-expression.org \
--cc=rlb@defaultvalue.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).