咨询与建议

看过本文的还看了

相关文献

该作者的其他文献

文献详情 >Type dispatch for named hierar... 收藏

Type dispatch for named hierarchical types

作     者:Glew, N 

作者机构:Cornell Univ Dept Comp Sci Ithaca NY 14853 USA 

出 版 物:《ACM SIGPLAN NOTICES》 (SIGPLAN Not)

年 卷 期:1999年第34卷第9期

页      面:172-182页

核心收录:

学科分类:08[工学] 0835[工学-软件工程] 0812[工学-计算机科学与技术(可授工学、理学学位)] 

主  题:Object oriented programming 

摘      要:Type dispatch constructs are an important feature of many programming languages. Scheme has predicates for testing the runtime type of a value. Java has a class cast expression and a try statement for switching on an exception s dass. Crucial to these mechanisms, in typed languages, is type refinement: The static type system will use type dispatch to refine types in successful branches. Considerable previous work has addressed type case constructs for structural type systems without subtyping, but these do not extend to named type systems with subtyping, as is common in object oriented languages. Previous work on type dispatch in named type systems with subtyping has not addressed its implementation formally. This paper describes a number of type dispatch constructs that share a common theme: class cast and class case constructs in object oriented languages, ML style exceptions, hierarchical extensible sums, and multimethods. I describe a unifying mechanism, tagging, that abstracts the operation of these constructs, and I formalise a small tagging language. After discussing how to implement the tagging language, I present a typed language without type dispatch primitives, and a give a,formal translation from the tagging language.

读者评论 与其他读者分享你的观点

用户名:未登录
我的评分