A Proposal for Making Eiffel Type-Safe

W. Cook
{"title":"A Proposal for Making Eiffel Type-Safe","authors":"W. Cook","doi":"10.1093/comjnl/32.4.305","DOIUrl":null,"url":null,"abstract":"Statically type-correct Eiffel programs may produce run-time errors because (1) attributes may be redeclared during inheritance, invalidating assignments in the superclass, (2) a formal method argument type may be restricted in violation of the contravariance of function types, and (3) two applications of a generic class are assumed to conform if the actual arguments conform. The third problem is solved by case analysis on the variance of generic parameters. Declaration by association provides a solution to the first two problems, but it suffers from additional difficulties. Type attributes, or generic parameters with default values, are suggested as a replacement for most cases of declaration by association. The special association type used to express type recursion cannot be explained using type attributes, and it appears to be a truly novel construct for typing object-oriented programs. One consequence of this construct is that Eiffel’s conformance hierarchy is a proper subset of its inheritance hierarchy. To appear in the Proceedings of the European Conference on ObjectOriented Programming, 10-14 July, 1989, and in The Computer Journal, September 1989.","PeriodicalId":80982,"journal":{"name":"Computer/law journal","volume":"27 1","pages":"57-70"},"PeriodicalIF":0.0000,"publicationDate":"1989-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"209","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer/law journal","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1093/comjnl/32.4.305","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 209

Abstract

Statically type-correct Eiffel programs may produce run-time errors because (1) attributes may be redeclared during inheritance, invalidating assignments in the superclass, (2) a formal method argument type may be restricted in violation of the contravariance of function types, and (3) two applications of a generic class are assumed to conform if the actual arguments conform. The third problem is solved by case analysis on the variance of generic parameters. Declaration by association provides a solution to the first two problems, but it suffers from additional difficulties. Type attributes, or generic parameters with default values, are suggested as a replacement for most cases of declaration by association. The special association type used to express type recursion cannot be explained using type attributes, and it appears to be a truly novel construct for typing object-oriented programs. One consequence of this construct is that Eiffel’s conformance hierarchy is a proper subset of its inheritance hierarchy. To appear in the Proceedings of the European Conference on ObjectOriented Programming, 10-14 July, 1989, and in The Computer Journal, September 1989.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
一个使Eiffel类型安全的建议
静态类型正确的Eiffel程序可能会产生运行时错误,因为(1)在继承期间可能会重新声明属性,使超类中的赋值无效,(2)由于违反函数类型的逆变性,可能会限制正式方法参数类型,以及(3)如果实际参数一致,则假定泛型类的两个应用程序一致。第三个问题是通过对通用参数方差的实例分析解决的。关联声明提供了前两个问题的解决方案,但它还存在额外的困难。建议使用类型属性或具有默认值的泛型参数替代大多数情况下的关联声明。用于表达类型递归的特殊关联类型不能用类型属性来解释,对于面向类型的程序来说,它似乎是一个真正新颖的结构。这种构造的一个结果是,Eiffel的一致性层次结构是其继承层次结构的适当子集。发表于1989年7月10-14日的欧洲面向对象编程会议论文集和1989年9月的计算机杂志。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Semantic Subtyping for Objects and Classes Transactional and Incremental Type Inference from Data Updates Planar and Quasi-Planar Simultaneous Geometric Embedding An Engineering Approach to Formal Digital System Design Studying the ML Module System in HOL
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1