[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: Common-Lisp@su-ai.ARPA*Subject*: Re: Types of Functions*From*: masinter.pa@Xerox.COM*Date*: Thu, 03 Jul 1986 18:15:00 -0000*In-reply-to*: Fahlman%C.CS.CMU:EDU:Xerox's message of 2 Jul 86 17:32

The problem is that the "function" types isn't a very good member of the type lattice. For example, "functionp" is true of lists whose car is lambda. In this case, "functionp" is a much more dynamic property. With most data types, (typecase x (regulartype ... compute ... use x ... )) the "use x" can assume that x is still "regulartype". This is currently true of all types except those defined with "satisfies". In this example, if "compute" were to (setf (car x) 'not-lambda), functionp would no longer be true. Given the existence of "satisfies" type specifiers, (deftype function () '(satisfies functionp)) Note also that symbols satisfy "functionp". ("functionp is always true of symbols, lists whose car is the symbol lambda, any value returned by the function special form, and any values returned by the function compile... "). This is dangerous to those who might write (typecase foo (function ...) (symbol ...) ...) Finally, it is an implementation dependent type like "fixnum", whose use is discouraged. Functions aren't a first-class type in Common Lisp, and wishing it so (or allowing 'function in a typep) won't make it so.

- Prev by Date:
**Re: Argument lists** - Next by Date:
**DECLARE SPECIAL Considered Confusing** - Previous by thread:
**Types of Functions** - Next by thread:
**underspecified type-of** - Index(es):