[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to detect a procedure
From: |
rm |
Subject: |
Re: How to detect a procedure |
Date: |
Mon, 29 Apr 2002 11:45:50 +0200 |
User-agent: |
Mutt/1.3.24i |
On Mon, Apr 29, 2002 at 06:52:28AM +0200, address@hidden wrote:
> On Sun, 28 Apr 2002, Bruce Korb wrote:
>
> >
> > OK. If:
> >
> > (if (procedure? 'mumble) (mumble))
> >
> > doesn't work, what does? I keep trying different things
> > to no avail. This is very, very frustrating.
>
> First of all, this type of thing is better off posted to guile-user
> instead of guile-devel (where nitty-gritty implementation details are
> mainly discussed).
>
> Secondly, the answer to your query is, procedures are stored in the same
> namespace as ordinary variables; (procedure? mumble) returns #t if mumble
> names a prevoiusly defined procedure. There is no need to quote, e.g.
> 'mumble, or to use the Common LISP convention #'mumble.
Well, there's no need to quote, but if mumble _isn't_ defined than (procedure?
mumble)
will barf ...
The most stable approach would be:
(and (defined 'blub) (procedure? blub))
and the conditional execution could be done like this:
(if (and (defined 'blub) (procedure? blub))
(blub ...)
(error "You need a newer version of transmogrify!"))
Ralf Mattes
> Note that this applies to primitives, too; (procedure? procedure?) returns
> #t. :)
>
> --
> Jeffrey T. Read
> "LOBSTER STICKS TO MAGNET!"
>
>
> _______________________________________________
> Guile-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/guile-devel
- How to detect a procedure, Bruce Korb, 2002/04/28
- Re: How to detect a procedure, bitwize, 2002/04/29
- Re: How to detect a procedure,
rm <=
- Re: How to detect a procedure, Lynn Winebarger, 2002/04/29
- Re: How to detect a procedure, Bruce Korb, 2002/04/29
- Re: How to detect a procedure, Rob Browning, 2002/04/30
- Re: How to detect a procedure, Bruce Korb, 2002/04/30
- Re: How to detect a procedure, Rob Browning, 2002/04/30
- Re: How to detect a procedure, Lynn Winebarger, 2002/04/30
- Re: How to detect a procedure, Rob Browning, 2002/04/30