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

Re: 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.

Very good point.  Maybe instead of a new proclamation we just need a
clarification to point out that this is the proper way to do local
inlining.

> 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.

Yes, that's not too nice, but a least you can do a (PROCLAIM '(NOTINLINE
FOO)) at the time you edit out the INLINE.  A worse problem is
(PROCLAIM '(SPECIAL ...)) which doesn't have any standard way to undo it.

>    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.

But Symbolics has redefined DEFSUBST to be equivalent to a Common Lisp
INLINE function; the original meaning of DEFSUBST in Zetalisp was not
quite the same, so I imagine that's why Common Lisp avoided using that
name.  On the Explorer, DEFSUBST still has the old meaning (but is
considered obsolete).