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

inline declaration for FLET and LABELS



    Date: Tue, 25 Mar 86 11:04 EST
    From: David C. Plummer <DCP at SCRC-QUABBIN.ARPA>

    A few of us just realized that
    	(defun foo ()
    	  (labels ((bar ...)
    		   (baz ...))
    	    (declare (inline bar baz))
    	    ...))
    is realitively easy to implement compare to
    	(defun foo ()
    	  (flet ((bar ...)
    		 (baz ...))
    	    (declare (inline bar baz))
    	    ...))
    The problem is the scoping rules.  Consider
    	(defun foo ()
    	  (flet ((car (x) (cdr x))
    		 (cdr (x) (car x)))
    	    (declare (inline car cdr))
    	    ...))
    While this is quite legal, it may be VERY hard to implement.  Therefore,
    when we consider allowing inline declarations for local functions, we
    should keep this in mind in the documentation.

I'm not sure I understand this -- do you have your flet and your labels
backwards here?  In that case, I think that most compilers that couldn't do
block compilation would just ignore inline declarations when they caused
circularities.  Consider that the situation you're describing isn't too
different from compiling globally defined mutually recursive functions that
are declared inline.