Re: Core foundation of Common Lisp (not pure Lisp)

From: Duane Rettig (duane_at_franz.com)
Date: 01/07/05


Date: 06 Jan 2005 19:02:49 -0800

Rahul Jain <rjain@nyct.net> writes:

> "Steven M. Haflich" <smh_no_spiced_ham@alum.mit.edu> writes:
>
> > It is more relevant to underatand why the following definition would
> > not have resulted in a working CL implementation:
> >
> > (defun not (x)
> > (declare (notinline not))
> > (not x))

Heh; I wasn't sure why Steve made this statement - it seemed
obvious. Now I understand why...

> Are you sure? "Special-forming" of CL operators is not covered under
> inlining, is it?

Special-forms has nothing to do with this example. Not is not a
special operator.

> I think the undefined behavior of redefining CL
> operators leaves the door open to the compiler implementing NOT as a
> direct assembly operation instead of a full function call. The NOTINLINE
> declaration would not hurt such an implementation.

The redefinition of CL operators is undefined, but the requirement
to obey the notinline declaration is not. It is not even clear
that the form given was placed in a package that uses the CL package.
What is clear, is that the example _must_ result in an infinite
loop/recursion in a conforming lisp.

-- 
Duane Rettig    duane@franz.com    Franz Inc.  http://www.franz.com/
555 12th St., Suite 1450               http://www.555citycenter.com/
Oakland, Ca. 94607        Phone: (510) 452-2000; Fax: (510) 452-0182