Re: [Sbcl-commits] master: Allow the compile-evaluator to evaluate forms directly.

steve gonedes <[email protected]> Sat, 23 May 2026 11:58:43 -0400
Newsgroups gmane.lisp.steel-bank.devel
Message-ID <[email protected]>
On 5/18/26 10:58 AM, Stas Boukarev wrote:
> (let () (compile nil `(lambda (x)
>                                    (declare (optimize speed))
>                                    (1+ x))))
> stopped producing optimization notes.


have you tried the code starting with locally instead of let?



CL-USER> (locally (declare (optimize (speed 3) (debug 2)))
   (compile nil `(lambda (x)
                   (declare (optimize speed))
                   (1+ x))))
; in: LAMBDA (X)
;     (1+ X)
;
; note: unable to associate +/(+ -) of constants due to type 
uncertainty: The first argument is a NUMBER, not a RATIONAL.
;
; note: forced to do GENERIC-+ (cost 10)
;       unable to do #1=inline fixnum arithmetic (cost 1) because:
;       The first argument is a T, not a FIXNUM.
;       The result is a (VALUES NUMBER . #2=(&OPTIONAL)), not a (VALUES 
FIXNUM . #2#).
;       unable to do #1# (cost 2) because:
;       The first argument is a T, not a FIXNUM.
;       The result is a (VALUES NUMBER . #2#), not a (VALUES FIXNUM . #2#).
;       etc.
;
; compilation unit finished
;   printed 2 notes
#<FUNCTION (LAMBDA (X)) {B800C1C84B}>
NIL
NIL
CL-USER>