>>>>> "Harvey" == Harvey J Stein <[EMAIL PROTECTED]> writes:

    Harvey> For example, why were macros used to convert things like:
    Harvey>    (* a b)
    Harvey> to
    Harvey>    (the 'double-float (* (the 'double-float a) (the 'double-float 
b)))?

Hmm, even though I participated in that, I don't recall why this was
done.  It's certainly not necessary in cmucl if a and b have been
declared to be double-float's.

[snip]

    Harvey> I was surprised that the compiler doesn't figure out that s is a 
fixnum
    Harvey> as well, given that I start off by assigning it to zero, and only 
add
    Harvey> fixnums to it, but in retrospect, to do be completely correct, the
    Harvey> compiler would have to sum the series to be able to safely deduce
    Harvey> this, so of course it won't.

I think it could if the compiler saw the dotimes, but I think by the
time the type-inferencer sees it, it's been macroexpanded to something
else.  I think cmucl does know that s is an unsigned-byte, which
doesn't help too much.

[snip]

    Harvey> Why do I get no notes on the fixnum version, but get a cost 13 float
    Harvey> to pointer coercion in the double-float version?

Because fixnum's don't ever need boxing, but the result of the
function needs to be boxed when returning a double-float.

Ray

Reply via email to