On May 24, 2008, at 10:24 AM, Dag Sverre Seljebotn wrote: > Robert wrote: >> On May 21, 2008, at 7:16 PM, Greg Ewing wrote: >> >>> What sort of things were you intending to do in between >>> type analysis and coercion? Could they still be done under >>> these restrictions? >> >> The phase that I'd like to stick here is type inference. The type >> analysis would type all declared variables, and in some cases assign >> types that are dependent on other (yet unknown) types. One would then >> run a type-resolution algorithm on the data of the symbol table, >> which could be used to actually resolve all the types. > > This kind of suggest that rather than trying to take coercion out of > analyse_types and put it after (as we've talked about earlier), it > could > be simpler and more natural to rather take the simplest "typing > declared > variables" out in a new phase before analyse_types? > > (This may be what you've concluded though, I'm just noting this > thinking > about earlier discussion on this.)
Yes. Currently analyse_types does lots of things at once. I'd do 1) Tag declared types and type relations (e.g. this type is the widest of these two) 2) Infer undeclared types (this would not be a traditional visitor/ recursive phase, rather analysis on the symtab from above 3) Tag types as inferred above, and insert coercions. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
