@lispi314 @dekkzz76 @aphistic @jacqueline
in this case I think it is best to OPTIMIZE for #sbcl as per the #cmucl definitions of optimize levels. These are incredibly useful, such as using the optimize space level to turn on and off function inlining in compilation. To my knowledge these are still only detailed in the CMUCL manual.
Hence not defining what these do allowed them to have contextually very important abilities attached to them, in which case (as with all things) SBCL is de facto
Small vignette on excavating sbcl #lisp features from #cmucl docs this morning!
gopher://beastie.sdf.org:7991/0phlogs/j.lol-at-infer-sbcl-usage-from-smucl-docs.txt
gopher.club phlogs seem sleepy ( @SDF ) at the moment, so please visit my beastie directly:
gopher://beastie.sdf.org
Web proxy for those land-locked:
https://gopher.floodgap.com/gopher/gw.lite?=beastie.sdf.org+7991+312f
@svetlyak40wt @galdor
No fear, I did it. The #sbcl #manual refers us to the #cmucl manual on this topic as being 95% right. #CommonLisp
https://cmucl.org/docs/cmu-user/cmu-user.html#The-Maybe_002dInline-Declaration
I suggest
(declaim (sb-ext:maybe-inline fmt-string))
(defun fmt-string (a) (format nil "~a" a))
(locally (declare (optimize (space 0)))
(defun thing-1 (x) (fmt-string x)))
(locally (declare (optimize (space 1)))
(defun thing--2 (x) (fmt-string x)))
This does what you want. So if you want to maybe inline in sbcl, 'sb-ext:maybe-inline
#sbcl #manual #cmucl #commonlisp