make byte-arrays and specialized-arrays reveal their elements through the inspector

db4
Joe Groff 2009-09-28 20:34:42 -05:00
parent 44f393771b
commit d7db62a145
1 changed files with 9 additions and 4 deletions

View File

@ -3,7 +3,7 @@
USING: assocs hashtables kernel sequences generic words
arrays classes slots slots.private classes.tuple
classes.tuple.private math vectors quotations accessors
combinators ;
combinators byte-arrays specialized-arrays ;
IN: mirrors
TUPLE: mirror { object read-only } ;
@ -48,10 +48,15 @@ M: mirror assoc-size object>> layout-of second ;
INSTANCE: mirror assoc
MIXIN: enumerated-sequence
INSTANCE: array enumerated-sequence
INSTANCE: vector enumerated-sequence
INSTANCE: callable enumerated-sequence
INSTANCE: byte-array enumerated-sequence
INSTANCE: specialized-array enumerated-sequence
GENERIC: make-mirror ( obj -- assoc )
M: hashtable make-mirror ;
M: integer make-mirror drop f ;
M: array make-mirror <enum> ;
M: vector make-mirror <enum> ;
M: quotation make-mirror <enum> ;
M: enumerated-sequence make-mirror <enum> ;
M: object make-mirror <mirror> ;