|
From: steve g. <sgo...@gm...> - 2026-05-23 15:59:00
|
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>
|