Comment 2 for bug 1023721

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : Re: [Bug 1023721] Re: optimization notes from RESTART-CASE

 status fixcommitted
 done

> (defun find-foo (seq)
> (map nil
> (lambda (x)
> (declare (optimize speed))
> (when (eq x :foo)
> (return-from find-foo t)))
> seq))
>
> ; note: Allocating a value-cell at runtime for checking possibly out of extent exit via
> ; (RETURN-FROM FIND-FOO T). Use GO/RETURN-FROM with SAFETY 0, or declare the exit
> ; function DYNAMIC-EXTENT to avoid.
>
> MAPCAR gives no note, but APPLY #'MAPCAR does.

This (probably) would be naturally addressed by any fix to #383078, or
(since this is user code) having the user themselves wrap the
RETURN-FROM in a suitable LOCALLY OPTIMIZE form.

Christophe