[Ecls-list] In LET/LET* bindings, the type of the form NIL is SYMBOL, not FIXNUM.

Gabriel Dos Reis gdr at integrable-solutions.net
Thu Jun 24 07:56:03 UTC 2010


On Tue, Jun 15, 2010 at 4:03 PM, Juan Jose Garcia-Ripoll
<juanjose.garciaripoll at googlemail.com> wrote:
> On Sun, Jun 13, 2010 at 2:01 AM, Matthew Mondor <mm_lists at pulsar-zone.net>
> wrote:
>>
>> I am seeing this warning with HEAD ECL when compiling some code for
>> which I don't see how a value is unexpectedly NIL.  I'm wondering if
>> perhaps it could be a bug in the new compiler?
>
> This is simple to understand: you declared a variable A to have type FIXNUM
> but did not provide any intial value or, more precisely, according to ANSI,
> the initial value is NIL, as in
>
> (let (a) (declare (fixnum a)) (setf a 0) ...)
>
> That is valid but not really correct code and I am happy that ECL is
> figuring out that problem :-)

OpenAxiom generates more LET-forms with initialization, e.g.

   (let ((a 3)) ...)

instead of

   (prog (a) (setq a 3) ...)

I hope ECL is taking advantage of that in its type propagation for
code generation purposes...

-- Gaby




More information about the ecl-devel mailing list