doh!  should have looked at the hyperspec in the first place ...

for-as-arithmetic::= var [type-spec] for-as-arithmetic-subclause

thanks.  You're right, I didn't cut and paste and missed "for x the
fixnum" on the first look.

[I was distracted by "(the fixnum (* x x))".  (* x x) was a bad choice of
code to stick in the example loop body b/c it really had nothing to do
with the problem.]


> CL-USER> (load (compile-file "test.lisp"))
>
> T
>
> Seems the actual problem is that you didn't cut-n-paste my code. It
> gives no warnings on cmucl or sbcl.
>
> Michael
>
> On 1/9/06, Jason F Kantz <[EMAIL PROTECTED]> wrote:
>> >
>> > On 1/9/06, Jason F Kantz <[EMAIL PROTECTED]> wrote:
>> >> Here's an example of my problem:
>> >>
>> >> (defun test (a b)
>> >>   (declare (optimize (speed 3))
>> >>            (type fixnum a)
>> >>            (type fixnum b))
>> >>   (loop for x from a to b
>> >>         do (print (* x x))))
>> >>
>> >> Is there a way to use loop without losing on type declarations like
>> >> this?
>> >
>> > (defun test (a b)
>> >   (declare (optimize (speed 3) (safety 0) (debug 0))
>> >            (type fixnum a)
>> >            (type fixnum b))
>> >   (loop for x fixnum from a to b
>> >         do (print (the fixnum (* x x)))))


Reply via email to