首页 | 本学科首页   官方微博 | 高级检索  
     

ND-P0lya中协变-反变问题的处理方法
引用本文:唐宝,马晓星,陶先平,吕建.ND-P0lya中协变-反变问题的处理方法[J].计算机学报,1999,22(9):953-957.
作者姓名:唐宝  马晓星  陶先平  吕建
作者单位:南京大学计算机软件新技术国家重点实验室,南京,210093;南京大学计算机软件研究所,南京,210093
基金项目:国家自然科学基金,国家杰出青年科学基金,江苏省青年基金
摘    要:协变-反变问题讨论面向对象语言中继承机制和多态计算的关系,晃当前面向对象程序设计语言中的一个重要的理论问题。反变的方法重定义不符合思维习惯,一盘采用协变精化的设计方法。但抛弃反变后的面向对象程序设计,在多态计算中会产生类型问题。针对这一问题,该文基于Castagna的重载函数模型,提出处理协变相关类型问题的类型系统和计算模型,并在ND-Polya语言及系统中具体实现。该方法可以应用到其它协变面向对

关 键 词:面向对象语言  协变-反变  类型
修稿时间:1998年8月24日

COVAR-CONTRAVARIANCE IN ND-POLYA SYSTEM
TANG Bao,MA Xiao-Xing,TAO Xian-Ping,LU Jian.COVAR-CONTRAVARIANCE IN ND-POLYA SYSTEM[J].Chinese Journal of Computers,1999,22(9):953-957.
Authors:TANG Bao  MA Xiao-Xing  TAO Xian-Ping  LU Jian
Abstract:The covariance versus contravariance issue, exploring type safety problem caused by the interaction between inheritance and polymorphism, has been, and still is an important problem in current OOPLs. Because contravariant redefinition of method is not consistent with traditional programming style, covariant redefinition of method is preferred to as the mechanism to support specialization. But object oriented programming will introduce type error in polymorphism computation without sticking to contravariance. To solve this problem, this paper proposes a type system and a polymorphism computation model on the basis of the Castagna's theoretical model of overloaded functions, which were implemented in OOPL ND Polya developed by authors and its supporting system. And this method can be applied to other covariant OOPLs.
Keywords:OOPL  covar  contravariance  type  
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号