From d7db62a145aa6fedba23c8782fd49ae3e7f84e82 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 28 Sep 2009 20:34:42 -0500 Subject: [PATCH] make byte-arrays and specialized-arrays reveal their elements through the inspector --- basis/mirrors/mirrors.factor | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/basis/mirrors/mirrors.factor b/basis/mirrors/mirrors.factor index 25486d127d..6ec6a9fbb2 100644 --- a/basis/mirrors/mirrors.factor +++ b/basis/mirrors/mirrors.factor @@ -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 ; -M: vector make-mirror ; -M: quotation make-mirror ; +M: enumerated-sequence make-mirror ; M: object make-mirror ;