-! Copyright (C) 2005, 2009 Slava Pestov.
+! Copyright (C) 2005, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays generic hashtables io kernel assocs math
namespaces prettyprint prettyprint.custom prettyprint.sections
sequences strings io.styles vectors words quotations mirrors
splitting math.parser classes vocabs sets sorting summary
debugger continuations fry combinators ;
+FROM: namespaces => set ;
IN: inspector
SYMBOL: +number-rows+
-: print-summary ( obj -- ) [ summary ] keep write-object ;
+: print-summary ( obj -- )
+ [ safe-summary ] keep write-object ;
<PRIVATE
M: enum add-numbers ;
M: assoc add-numbers
- +number-rows+ get [
- dup length [ prefix ] 2map
- ] when ;
+ +number-rows+ get [ [ prefix ] map-index ] when ;
TUPLE: slot-name name ;
M: tuple error. describe ;
: vars-in-scope ( seq -- alist )
- [ [ global eq? not ] filter [ keys ] gather ] keep
+ [ [ global eq? ] reject [ keys ] gather ] keep
'[ dup _ assoc-stack ] H{ } map>assoc ;
: .vars ( -- )
: &back ( -- )
inspector-stack get
- dup length 1 <= [ drop ] [ [ pop* ] [ peek reinspect ] bi ] if ;
+ dup length 1 <= [ drop ] [ [ pop* ] [ last reinspect ] bi ] if ;
: &add ( value key -- ) mirror get set-at &push reinspect ;