[Ecls-list] deftype propagation in the ECL compiler

Gabriel Dos Reis gdr at cs.tamu.edu
Sun Nov 2 13:28:21 UTC 2008


"Juan Jose Garcia-Ripoll" <juanjose.garciaripoll at googlemail.com> writes:

| 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))))
| >
| > with
| >
| >  (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.

OK; thanks!

| 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
| bit operations.
| 
| CONS types, OTOH, do not fit this type system, for you may have
|    (deftype foo () '(CONS Integer foo))
| and more complicated things.

Hmm, my understanding of DEFTYPE was that, even though the newly
introduced type specifier, the recursion expansion must terminate.
Therefore, it would be OK to use a lattice system, since a DEFTYPE
could not introduce an infinitely branching type.
Is that not the case?

-- Gaby




More information about the ecl-devel mailing list