[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue ALLOW-LOCAL-INLINE (Version 1)



In the Symbolics implementation, at least, you can achieve most
of the ALLOW-INLINE effect by doing:

 (PROCLAIM '(INLINE FOO))
 (DEFUN FOO (X) (+ X 7))
 (PROCLAIM '(NOTINLINE FOO))
 (DEFUN BAR (X) (DECLARE (INLINE FOO)) (FOO X))
 (DEFUN BAZ (X) (FOO X))

BAR will get FOO inlined, but BAZ will not. I say "most of"
the effect because you proposed that NOTINLINE turn off ALLOW-INLINE,
and obviously in the above example, NOTINLINE does something very
different.

I sort of assumed that this behavior was portable. If it's not, that
might make your proposal more interesting -- or it might make for an
interesting proposal of its own.

Personally, I'm bothered by the following more significant problem:

 --- File a.lisp ---
 (PROCLAIM '(INLINE FOO))
 (DEFUN FOO (X) ...)
 -------------------

 (load "a.lisp")

Then later, after editing the out the (PROCLAIM '(INLINE FOO)),

 (load "a.lisp")

does not leave me with A not being inline. It used to be in Symbolics
implementations that you wrote

 (DEFSUBST FOO ...)

to get an inlined definition and if you changed it to DEFUN you would
get it notinlined. But with the advent of CL, DEFSUBST was changed to
do
 (PROGN (PROCLAIM '(INLINE FOO))
        (DEFUN FOO ...))
which means that a later change to DEFUN cannot tell that you've changed
 from DEFSUBST to DEFUN and so cannot remove the INLINE-ness. Pity.

Personally, I think CL should just flush the INLINE proclamation and
support DEFSUBST instead because it would make this incremental
development situation easier.