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


A decision procedure for common Lisp'sSUBTYPEP predicate
Authors:Henry G. Baker
Affiliation:(1) Nimble Computer Corporation, 16231 Meadow Ridge Way, 91436 Encino, California
Abstract:Common Lisp [25],[26] includes a dynamic datatype system of moderate complexity, as well as predicates for checking the types of language objects. Additionally, an interesting predicate of two ldquotype specifiersrdquoSUBTYPEP—is included in the language. Thissubtypep predicate provides a mechanism with which to query the Common Lisp type system regarding containment relations among the various built-in and user-defined types. Whilesubtypep is rarely needed by an applications programmer, the efficiency of a Common Lisp implementation can depend critically upon the quality of itssubtypep predicate: the run-time system typically calls uponsubtypep to decide what sort of representations to use when making arrays; the compiler calls uponsubtypep to interpret userdeclarations, on which efficient data representation and code generation decisions are based.As might be expected due to the complexity of the Common Lisp type system, there may be type containment questions which cannot be decided. In these casessubtypep is expected to return ldquocan't determinerdquo, in order to avoid giving an incorrect answer. Unfortunately, most Common Lisp implementations have abused this license by answering ldquocan't determinerdquo in all but the most trivial cases.In particular, most Common Lisp implementations of SUBTYPEP fail on the basic axioms of the Common Lisp type system itself [25][26]. This situation is particularly embarrassing for Lisp-the premier ldquosymbol processing languagerdquo—in which the implementation of complex symbolic logical operations should be relatively easy. Sincesubtypep was presumably included in Common Lisp to answer thehard cases of type containment, this ldquolazy evaluationrdquo limits the usefulness of an important language feature.
Keywords:
本文献已被 SpringerLink 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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