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

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sat Jun 19 15:44:35 UTC 2010

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. An IF statement sees
the condition as an expression, with no type information about other
expressions or variables being propagated.

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.


Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20100619/9612ff63/attachment.html>

More information about the ecl-devel mailing list