[cmucl-ticket] [cmucl] #38: Inlining loses declarations

cmucl cmucl-devel at common-lisp.net
Fri Mar 5 19:17:30 UTC 2010


#38: Inlining loses declarations
--------------------+-------------------------------------------------------
 Reporter:  heller  |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  minor   |   Milestone:          
Component:  Core    |     Version:  20a     
 Keywords:          |  
--------------------+-------------------------------------------------------
 I'd like to write a function fx+ which is like + but only
 accepts fixnums as arguments and never conses, i.e. it's
 considered an error if the sum is not a fixnum.  Arguments
 and return value should be checked.  Essentially this
 {{{
 (declaim (inline fx+))
 (defun fx+ (x y)
   (declare (fixnum x y)
            (values fixnum))
   (+ x y))
 }}}
 is what I want.  If called as (fx+ 1 most-positive-fixnum)
 the error is detected as it should be.  But after inlining
 {{{
 (defun foo (x y)
   (fx+ x y))
 }}}
 and using it like (foo 1 most-positive-fixnum) it returns
 -536870912.

-- 
Ticket URL: <http://trac.common-lisp.net/cmucl/ticket/38>
cmucl <http://common-lisp.net/project/cmucl>
cmucl


More information about the cmucl-ticket mailing list