Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

gcl quirks

2 views
Skip to first unread message

Erik Naggum

unread,
Jan 23, 1998, 3:00:00 AM1/23/98
to

* Sam Steingold
| in gcl 2.2.2 on linux:
|
| (functionp 'cdr) ==> T
| Well, 'cdr is funcallable, but a function...

GCL does not purport to conform to ANSI X3.226 Common Lisp, so you will
find many such problems. one must judge conformance according to the
document/standard to which conformance is purported.

| Interesting. Will I have to add #' in front of all my lambdas or is
| there an easier way?

of course. LAMBDA is just a macro. this suggested implementation is
taken directly from the HyperSpec/standard:

(defmacro lambda (&whole form &rest bvl-decls-and-body)
(declare (ignore bvl-decls-and-body))
`#',form)

#:Erik
--
The year "98" was new 1900 years ago. | Help fight MULE in GNU Emacs 20!
Be year 2000 compliant, write "1998"! | http://sourcery.naggum.no/emacs/

Kent M Pitman

unread,
Jan 23, 1998, 3:00:00 AM1/23/98
to

Sam Steingold <s...@usa.net> writes:
> in gcl 2.2.2 on linux:
> (functionp (lambda()))
> Error: The function LAMBDA is undefined.

> Interesting. Will I have to add #' in front of all my lambdas or is
> there an easier way?

Well, strictly it isn't legal to redefine CL symbols, but in practice where
LAMBDA is not available as a macro, it usually works to do
something like:
(defmacro lambda (bvl &body forms) `#'(lambda ,bvl ,@forms))

One of the reasons it's disallowed to do this in CL, btw, is so that
when two people patch this same bug they don't clobber each other.


Barry Margolin

unread,
Jan 23, 1998, 3:00:00 AM1/23/98
to

In article <m3pvlk8...@mute.eaglets.com>,

Sam Steingold <s...@usa.net> wrote:
>in gcl 2.2.2 on linux:
>
>(functionp 'cdr) ==> T

GCL is based on the original CLtL, not CLtL2 or the ANSI standard. CLtL
says, "FUNCTIONP is always true of symbols, ..."; as a result even
(functionp 'symbol-I-just-made-up-that-doesn\'t-name-a-function) should
return T in GCL. If you have CLtL2, this is in the dotted-out part of the
description.

>(functionp (lambda()))
>Error: The function LAMBDA is undefined.

The LAMBDA macro was added by the ANSI committee. It happened late enough
that it didn't even make it into CLtL2.

--
Barry Margolin, bar...@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
Support the anti-spam movement; see <http://www.cauce.org/>
Please don't send technical questions directly to me, post them to newsgroups.

0 new messages