abcl icon indicating copy to clipboard operation
abcl copied to clipboard

SUBTYPEP failures on ABCL 1.8.0

Open phoe opened this issue 3 years ago • 4 comments

From https://gitlab.common-lisp.net/alexandria/alexandria/-/jobs/27735 (@phmarek)

Test ALEXANDRIA-TESTS::TYPE=.2 failed
Form: (ALEXANDRIA:TYPE= (QUOTE LIST) (QUOTE (OR NULL CONS)))
Expected values: T
                 T
Actual values: NIL
               T.
Test ALEXANDRIA-TESTS::TYPE=.3 failed
Form: (ALEXANDRIA:TYPE= (QUOTE NULL) (QUOTE (AND SYMBOL LIST)))
Expected values: T
                 T
Actual values: NIL
               NIL.

In the Bear:

CL-USER(3): (subtypep '(or null cons) 'list)
T
T
CL-USER(4): (subtypep 'list '(or null cons))
NIL
NIL
CL-USER(5): (subtypep 'null '(and symbol list))
T
T
CL-USER(6): (subtypep '(and symbol list) 'null)
NIL
NIL

phoe avatar Jan 28 '22 11:01 phoe

I'm not a 100% sure of this but I've been reading the standard for subtypep and it seems that this behaviour is allowed.

image

alejandrozf avatar Jan 29 '22 22:01 alejandrozf

subtypep is permitted to return the values false and false only when at least one argument involves one of these type specifiers: and, eql, the list form of function, member, not, or, satisfies, or values.

Hm. As un-useful as it is for the end user, that's correct, and therefore not strictly a conformance bug. Looks like the Alexandria tests might need to get corrected in that case?...

phoe avatar Jan 29 '22 22:01 phoe

Yes maybe they should change it. And also, maybe add some conditional warning inside the code of alexandria:type= when any of these type identifiers are used in at least one of the parameters.

alejandrozf avatar Jan 30 '22 17:01 alejandrozf

https://gitlab.common-lisp.net/alexandria/alexandria/-/issues/26 was created, let's see how this goes.

phoe avatar Jan 31 '22 09:01 phoe

abcl-1.9.3-dev now contains "emergency" special (i.e. ugly) fix for this case. This has revealed the need to treat ABCL's subtypep implementation with more care.

Thanks, as always, @phoe

easye avatar Jul 10 '23 11:07 easye