The recent discussion of optimizing Lisp with number has been quite
interesting.  One question I had about CMUCL I don't think got
answered.  In Allegro Lisp, I believe it's the case that local
functions can return numbers without fear that they'll be boxed:

(labels ((nfn () ...))
   (cond (...)
         (t (sqrt (nfn ...)))))

I don't know if any declarations are required, but the idea is that
even if nfn returns a double-float, the compiler can figure out that
it doesn't need to box it when passing it to sqrt.  (Of course, all
bets are off if we do something like (setq global-var* #'nfn).)

Is this also true for CMUCL?  If so, it's another way to cope besides
inlining and block compiling.  (Not always applicable, I realize, if
you really do need to call nfn in more than one function).

-- 

                                         -- Drew McDermott
                                            Yale University
                                            Computer Science Department


Reply via email to