[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: what does (declare (downward-function)) do?
- To: engber@aristotle.ils.nwu.edu (Mike Engber)
- Subject: Re: what does (declare (downward-function)) do?
- From: Bill St. Clair <bill>
- Date: Wed, 21 Aug 91 16:50:17 -0400
- Cc: info-mcl
- In-reply-to: Your message of Wed, 21 Aug 91 13:59:33 -0500. <9108211859.AA28510@aristotle.ils.nwu.edu>
Date: Wed, 21 Aug 91 13:59:33 CDT
From: engber@aristotle.ils.nwu.edu (Mike Engber)
To: info-mcl@cambridge.apple.com
Subject: what does (declare (downward-function)) do?
The subject line says it all. I see no mention in Steele.
I assume it allows for some optimization.
-ME
DOWNWARD-FUNCTION will no longer exist in MCL 2.0 final.
It is a Lisp Machine concept providing an alternative way to declare
that a closure has DYNAMIC-EXTENT. We decided to get rid of it
because the extent of the closure is confusing.
In 2.0b1 you can write:
(defun map+ (list value)
(mapcar #'(lambda (x) (declare (downward-function) (+ value x)))
list))
In 2.0 final, DOWNWARD-FUNCTION is no more. The example becomes:
(defun map+ (list value)
(let ((f #'(lambda (x) (+ value x))))
(declare (dynamic-extent f))
(mapcar f list)))
or:
(defun map+ (list value)
(flet ((f (x) (+ value x)))
(declare (dynamic-extent #'f))
(mapcar #'f list)))