From: Christophe R. <cs...@ca...> - 2017-06-28 10:49:25
|
Christophe Rhodes <cs...@ca...> writes: >> I'm not sure why putting sequence at depth 1 works. > > Still not completely sure, but SEQUENCEP and EXTENDED-SEQUENCE-P are > special-cased, whereas (typep x 'stream) will be handled by the normal > hierarchical type test. That said, the special case for > extended-sequence-p looks exactly like that normal hierarchical type > test to my eye... OK. The main difference is in fact that STREAM is mixed in with STRUCTURE-OBJECT, which has a fixed depthoid of 1; this means that STREAM's depthoid can't be 1. SEQUENCE is not mixed in with STRUCTURE-OBJECT, so we don't hit problems. The layout-inherits computation is specialized for streams in src/code/defstruct.lisp !INHERITS-FOR-STRUCTURE. (I now feel moderately safe about releasing, because until now no-one has been able to subclass sequence with a structure-object mixin in any case.) Cheers, Christophe |