[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: what does (declare (downward-function)) do?
- To: firstname.lastname@example.org (Mike Engber)
- Subject: Re: what does (declare (downward-function)) do?
- From: Gary Byers <gb>
- Date: Wed, 21 Aug 91 15:37:53 EDT
- Cc: email@example.com
- In-reply-to: <9108211859.AA28510@aristotle.ils.nwu.edu>; from "Mike Engber" at Aug 21, 91 1:59 pm
> The subject line says it all. I see no mention in Steele.
> I assume it allows for some optimization.
It becomes extinct or obsolete.
It was intended as a way of advertising that an anonymous lexical closure
had dynamic extent; the effect was to treat:
(foo #'(lambda (x y) (declare (downward-function)) ...) ...)
as if it were:
(flet ((#:g1 (x y) ...))
(declare (dynamic-extent #'#:g1))
(foo #'#:g1 ...))
i.e., as if the closure's extent "wrapped around" the nearest surrounding
Aside from being syntactically obscure, the semantics are sometimes a bit
surprising, as in cases like:
(foo (identity #'(lambda (x y) (declare (downward-function)) ...)) ...)
Using some binding form and a DYNAMIC-EXTENT declaration seems preferable;
although one may have to expend some effort in thinking up a name to bind the
function to, one is at least making it clear just which extent it is that's