Quirks of Common Lisp Types

4 todsacerdoti 2 8/31/2025, 12:06:42 AM fosskers.ca ↗

Comments (2)

kazinator · 15h ago
> Note also that this isn't a linear hierarchy: in the String example above, simple-array and string are unrelated.

Are you sure? If that's the case, it would have to be that the object is not a suitable argument to a method parameter of type string.

Don't guess about whether they're considered unrelated in that implementation, use subtypep and typep.

If (typep "X" 'string) yields true, then the type of "X", whatever it is, is related to string.

kazinator · 13h ago
From article:

  (list (typep "漣" 'simple-array)
        (typep "漣" 'string)
        (typep "漣" 'vector)
        (typep "漣" 'array)
        (typep "漣" t))

  -> (T T T T T)
There you go. The type of "漣" is a subtype of string. Since we know that the type is (SIMPLE-ARRAY CHARACTER (1)), it means that this type is a subtype of string. They are therefore related by the supertype-subtype relationship.