From: Marco A. <ma...@cs...> - 2004-07-23 15:12:32
|
On Jul 22, 2004, at 1:20 PM, Alexey Dejneka wrote: > Marco Antoniotti <ma...@cs...> writes: >> >> As I said, I am more interested in "simple" typechecking rather that >> "typechecking aimed at optimization". Of course, the second one is a >> very good thing indeed. >> >> As another interesting problem, think of the following >> >> (defclass foo () ((bar :accessor bar :type vector))) >> >> (defclass zot () ((bar :type string))) >> >> (defclass zut (foo zot) ()) >> >> What should the FTYPE of BAR be at this point? > > (FUNCTION * *). But the compiler may also know, that if BAR's argument > is of type ZUT, then the result will be (AND VECTOR STRING) [as long > as the definition of FOO/ZOT/ZUT is the same FSVO "as long"]. Yep. Exaclty my point. Can we write a compiler that does that? Cheers -- Marco Antoniotti http://bioinformatics.nyu.edu NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488 715 Broadway 10th FL fax. +1 - 212 - 998 3484 New York, NY, 10003, U.S.A. |