subtypep doesn't understand EQL/MEMBER/KEYWORD type

Bug #1533685 reported by Jim Newton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

I'd like to request an enhancement.

In SBCL (subtypep '(eql :x) 'keyword) returns NIL,NIL
but
(subtypep '(eql "x") 'string) returns T, T
and
(typep :x 'keyword) returns T
and
(subtypep '(member 1 2 3) 'fixnum) returns T, T

According to the spec subtypep IS ALLOWED to return NIL, NIL if the computation involves EQL or MEMBER,
so the behavior is not a bug.

In any case I'd like (subtypep '(eql :x) 'keyword) and (subtypep '(member :x :y :z) 'keyword) to return T, T

According to a conversation with Douglas Katzmann, this is a known issue related to a limitation of the KEYWORD type.

Revision history for this message
Stas Boukarev (stassats) wrote :

KEYWORD is a deftype for (and symbol (satisfies keywordp)), and subtypep can't reason well about satisfies.

Revision history for this message
Jim Newton (jimka-issy) wrote :

Am I wrong? why would SUBTYPEP need to reason about satisfies when its first argument is (EQL ...) or (MEMBER ...) ?
It seems to me, (without understanding the details of course, hence the question), that in this case
SUBTYPEP, should call TYPEP on the argument of EQL or the arguments of MEMBER.
Perhaps there's a bootstrapping or metacircularity issue with my suggestion?

Jim Newton (jimka-issy)
summary: - subtypep don't understand EQL/MEMBER/KEYWORD type
+ subtypep doesn't understand EQL/MEMBER/KEYWORD type
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.