[Ecls-list] Type propagator and "bogus" existing code

Gabriel Dos Reis gdr at integrable-solutions.net
Sat Jun 19 15:49:06 UTC 2010

On Sat, Jun 19, 2010 at 10:44 AM, Juan Jose Garcia-Ripoll
<juanjose.garciaripoll at googlemail.com> wrote:
> On Sat, Jun 19, 2010 at 5:27 PM, Gabriel Dos Reis
> <gdr at integrable-solutions.net> wrote:
>> On Sat, Jun 19, 2010 at 10:21 AM, Juan Jose Garcia-Ripoll
>> <juanjose.garciaripoll at googlemail.com> wrote:
>> >>
>> >> The compiler can infer that FOO inside the branch must have type
>> >> STRING.
>> >
>> > Doing this is not as easy as it sounds. Inferring types from conditional
>> > expressions and branches is not only difficult, but it may also be
>> > impossible when predicates are combined.
>> What about:
>>  (1) do the inference per basic blocks
>>  (2) if combining types from two branches is impossible to check
>>       issue a runtime check (based on compilation policy, debug, speed,
>> etc.)
>>       and issue a note
> This might work if we represented the code as a graph, but from my previous
> email you will understand that this is not the case.

Sorry, I just got your other email -- and I sent the one you're
replying to before.
Many thanks for the explanation.

> An IF statement sees
> the condition as an expression, with no type information about other
> expressions or variables being propagated.

Yes, you are right.

> Anyway, I think I will settle for a simple style warning. The disadvantage
> is that this will mask real problems, such as real type errors, but given
> Common Lisp's semantics and the code out there, nothing else seems sensible.

That sounds reasonable to me.

-- Gaby

More information about the ecl-devel mailing list