[Ecls-list] deftype propagation in the ECL compiler
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Sun Nov 2 11:49:27 UTC 2008
On Sat, Nov 1, 2008 at 5:40 PM, Gabriel Dos Reis <gdr at cs.tamu.edu> wrote:
> Note that If I replace
> (DEFTYPE |%Triple| () '(CONS |%Code| (CONS |%Mode| (CONS |%Env| NULL))))
> (DEFTYPE |%Triple| () 'LIST)
> then everything is OK -- but it is less precise.
Ok, ECL's type system currently does not handle complex CONS types.
Instead of warning, it was simply rejecting the type without
signalling an error message.
I have fixed the code so that the any (CONS a b) type is silently
upgraded to 'CONS.
The reason why ECL does not handle CONS types is that these may be
recursive. ECL's type system is based on a lattice system where types
can be assigned unique bit-masks and operations such as SUBTYPEP,
TYPEOF, type intersection and comparison can be accurately done using
CONS types, OTOH, do not fit this type system, for you may have
(deftype foo () '(CONS Integer foo))
and more complicated things.
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28009 (Spain)
More information about the ecl-devel