From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: rm@fabula.de Newsgroups: gmane.lisp.guile.devel Subject: Re: How to detect a procedure Date: Mon, 29 Apr 2002 11:45:50 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <20020429094550.GB31160@www> References: <3CCC5D23.9727BCCB@pacbell.net> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1020073727 31337 127.0.0.1 (29 Apr 2002 09:48:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 29 Apr 2002 09:48:47 +0000 (UTC) Cc: Bruce Korb , guile-devel@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 1727m3-00089J-00 for ; Mon, 29 Apr 2002 11:48:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1727lV-0005Na-00; Mon, 29 Apr 2002 05:48:13 -0400 Original-Received: from www.elogos.de ([212.18.192.92]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 1727g3-00054W-00 for ; Mon, 29 Apr 2002 05:42:36 -0400 Original-Received: by www.elogos.de (Postfix, from userid 5001) id 1FAEE1049B9; Mon, 29 Apr 2002 11:45:50 +0200 (CEST) Original-To: bitwize@wizards-of-source.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.24i Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:557 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:557 On Mon, Apr 29, 2002 at 06:52:28AM +0200, bitwize@wizards-of-source.org 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 > Guile-devel@gnu.org > http://mail.gnu.org/mailman/listinfo/guile-devel _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel