freenode/#sicl - IRC Chatlog
Search
16:02:53
beach
WAIT A SECOND. I should use probably ETYPECASE for CAR/CDR. Or possibly CTYPECASE. But CTYPECASE may just turn into CHECK-TYPE or something similar, of course.
16:05:47
pjb
you'd use check-type again, for the user interface it provides. I'm still not sure it's good or useful to use it from low-level functions. (because they don't hav access to the places where the user data is stored, only to internal parameters). But if you want to benefit from this user interface, you can indeed do it only in the exceptional case. eg.: (tagbody :agan (typecase (cons (primop:cons-car x)) (null nil) (t (check-ty
16:08:23
beach
But this discussion started by my wanting CHECK-TYPE because it is standard, but not wanting it because it signals a correctable error. So etypecase may be preferable.
16:12:51
pjb
Nope, I'm wrong: (defmacro check-type (place type &optional message) `(ctypecase ,place (,type nil))) wouldn't work, because check-type issues the optional message which ctypecase doesn't do.
16:13:41
pjb
for all type checking when a type error must be signaled, etypecase seems to be the right operator.
16:13:57
beach
And this entire discussion depends on how type inference is implemented. I mean, if I define CAR to use the functions CONSP and NULL, then there is no issue. But with CHECK-TYPE, ETYPECASE, and CTYPECASE, then I need to have a plan for turning TYPEP into something that can be checked at compile time.
16:14:39
beach
And this plan depends on why Bike declared failure of the type inference in Cleavir v1.
16:16:29
beach
dukester: But I bet you don't know CLOS, and I bet you don't like object-oriented programming because of the particular style traditional languages define it.