We have proposed lightweight family polymorphism, a programming style to support reusable yet type-safe mutually recursive classes, and introduced its formal core calculus .FJ. In this paper, we give a formal translation, which changes only type declarations, from .FJ into FGJself, an extension of Featherweight GJ with self type variables. They improve self typing and are required for the translation to preserve typing. Therefore we claim that self type variables represent the essential difference between .FJ and Featherweight GJ, namely, lightweight family polymorphism provides better self typing for mutually recursive classes than Java generics. To support this claim rigorously, we show that FGJself enjoys type soundness and the formal translation preserves typing and reduction.
Note: Due to the typographical sophistication of this article, no HTML version is available. Please use the PDF version.
About the authors
Chieri Saito and Atsushi Igarashi: "The Essence of Lightweight Family Polymorphism", in Journal of Object Technology, vol. 7, no. 5, Special Issue: Workshop on FTfJP, ECOOP 07, June 2008, pp. 67-99 http://www.jot.fm/issues/issue_2008_06/article3/