[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:mark@mcc.com
- Organization: Computer Science, Yale University, New Haven, CT 06520-2158
- References: <28600@yale-celray.yale.UUCP>
- Reply-to: Ram-Ashwin@YALE.ARPA (Ashwin Ram)
In article <28600@yale-celray.yale.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
else:
> (operation? (lambda nil nil))
()
> (procedure? (lambda nil nil))
#T
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.
-- Ashwin.
ARPA: Ram-Ashwin@cs.yale.edu
UUCP: {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin
BITNET: Ram@yalecs