[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Test for procedure?
- To: t-discussion@YALE.ARPA (Newsgroups: arpa.t-discussion)
- Subject: Re: Test for procedure?
- From: Ram-Ashwin@YALE.ARPA (Ashwin Ram)
- Date: Fri ,6 May 88 15:25:34 EDT
- Full-name: Ashwin Ram
- In-reply-to: @MC.LCS.MIT.EDU,@MCC.COM:email@example.com
- Organization: Computer Science, Yale University, New Haven, CT 06520-2158
- References: <firstname.lastname@example.org.UUCP>
- Reply-to: Ram-Ashwin@YALE.ARPA (Ashwin Ram)
In article <email@example.com.UUCP>, @MC.LCS.MIT.EDU,@MCC writes:
> Is there a finer-grained test for procedure values than PROCEDURE? ?
> As it stands, PROCEDURE? answers true to both procedures and
> operations (and any other object that can be applied). We need to be
> able to distinguish actual, honest-to-goodness closures created by
> LAMBDA from these other apply-able entities
The predicate OPERATION? will let you distinguish operations from everything
> (operation? (lambda nil nil))
> (procedure? (lambda nil nil))
However, you should normally not need to rely on this distinction. There is
probably a better way to do what you need to do. For example, if you're
trying to distinguish closures that you create for some purpose from other
procedure-like objects lying around, you might create objects instead that
answer #t to a special predicate.