From: Christophe R. <cs...@ca...> - 2003-06-09 16:38:07
|
Eric Marsden <ema...@la...> writes: >>>>>> "sr" == Sean Ross <sd...@jh...> writes: > > sr> (defun foo (x) > sr> (list x)) > sr> > sr> (defun bar (x) > sr> (+ x (foo x))) > CMUCL knows this; it says > > ,---- > | ; File: /tmp/warn.lisp > | ; In: defun bar > | ; (foo x) > | ; Warning: Result is a list, not a (values &optional number &rest t). ^^^^^^^^^^^^^^^^ That doesn't look like the optimal type to be asserting; (VALUES) is a (VALUES &OPTIONAL NUMBER &REST T), but isn't suitable as an argument to #'+. (It's possible that CMUCL's internal type is correct, but then the note is wrong :-). > SBCL doesn't warn (clearly because they've been fiddling too much with > the compiler :-). With a little fiddling to the compiler, sbcl-0.8.0.54 now warns for a file containing (defun foo (x) (list x)) (defun bar (x) (1+ (foo x))) while not warning for (defun foo2 (x) (list x)) (defun bar2 (x) (declare (notinline foo2)) (1+ (foo2 x))) (because the NOTINLINE declaration disallows the `static linking' treatment, as specified in section 3.2.2.3). Assuming that no unsolvable bugs are found in the new treatment, this new behaviour will be in the 0.8.1 release (expected at or near the end of the month). Cheers, Christophe -- http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757 (set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b))) (defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge) |