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

Re: commonlisp types



...but I believe it is the case that there is no CL way to determine
if a given type is defined.

I wish there was some CL way to define a complex type and insert it in 
the existing hierarchy.  For example, I once tried to define the type
LIST-OF, which would be used like

 (TYPEP '(1 2 3) '(LIST-OF FIXNUM))  ==> T
 (TYPEP '(A B 3) '(LIST-OF FIXNUM))  ==> NIL
 (SUBTYPEP '(LIST-OF SYMBOL) 'LIST)  ==> T
 (SUBTYPEP '(LIST-OF FIXNUM) '(LIST-OF NUMBER))  ==> T
 (SUBTYPEP '(LIST-OF *) '(LIST-OF LIST))  ==> NIL NIL

On the TI Explorer this was really easy.
In Lucid CL, it was not possible except by bashing the definitions of
TYPEP and SUBTYPEP.

Can someone explain the rationale behind forcing SATISFIES to 
accept only function-names and not lambda expressions?
I can see that the compiler could have special knowledge about
such forms as (SATISFIES PLUSP), but CLtL says lambdas are excluded
"to avoid scoping problems."

Jamie