[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FLET & declarations
- To: GZ%OZ.AI.MIT.EDU@XX.LCS.MIT.EDU
- Subject: FLET & declarations
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Tue, 18 Aug 87 16:27 EDT
- Cc: common-lisp@SAIL.STANFORD.EDU
- In-reply-to: <12327146435.14.GZ@OZ.AI.MIT.EDU>
Date: Mon 17 Aug 87 03:57:47-EDT
Are 'pervasive' declarations in FLET supposed to apply to the function bodies?
(flet ((foo () x)) ;Is this x special?
(declare (special x))
(flet ((foo () (foo) ...)) ;Does this call to (foo) return a fixnum?
(declare (function foo () fixnum))
(flet ((foo () (foo 17))) ;Is (foo 17) inline?
(declare (inline foo))
CLtL does not permit DECLARE to be used in that position (see p.113).
I believe it has been proposed to change that, although I couldn't
find a copy of the proposal in my rather disorganized files. I would
argue that the paragraph in the middle of page 155 of CLtL supports
the position that when this extension is made, the pervasive declarations
should apply to the function bodies.
Note that the FUNCTION declaration used in your middle example is not
pervasive. Since you use FLET rather than LABELS, this declaration
would not apply to the call to FOO within the body of FOO. It's a
The INLINE declaration is said by CLtL to be pervasive, however I
believe that to be a bug since it makes it unclear which of the two
FOOs in your example it refers to. Perhaps it refers to both.
Anyone putting together a proposal to clean up the specification of
declarations in Common Lisp ought to address the issues raised by