Fix inspector problem with empty hashtables
parent
d84a4cc497
commit
e9f73af344
|
|
@ -13,3 +13,4 @@ V{ } clone inspector-stack set
|
|||
f (inspect)
|
||||
\ + (inspect)
|
||||
H{ } (inspect)
|
||||
H{ } describe
|
||||
|
|
|
|||
|
|
@ -78,8 +78,12 @@ M: word summary ( word -- )
|
|||
DEFER: describe
|
||||
|
||||
: sheet. ( sheet -- )
|
||||
dup format-sheet swap peek
|
||||
[ dup [ describe ] curry simple-outliner terpri ] 2each ;
|
||||
dup empty? [
|
||||
drop
|
||||
] [
|
||||
dup format-sheet swap peek
|
||||
[ dup [ describe ] curry simple-outliner terpri ] 2each
|
||||
] if ;
|
||||
|
||||
: describe ( object -- ) dup summary print sheet sheet. ;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ prettyprint sequences words ;
|
|||
SYMBOL: inspector-slots
|
||||
|
||||
: sheet-numbers ( sheet -- sheet )
|
||||
dup first length >array 1array swap append
|
||||
dup peek inspector-slots set ;
|
||||
dup empty? [
|
||||
dup first length >array 1array swap append
|
||||
dup peek inspector-slots set
|
||||
] unless ;
|
||||
|
||||
SYMBOL: inspector-stack
|
||||
|
||||
|
|
@ -18,7 +20,7 @@ SYMBOL: inspector-stack
|
|||
: (inspect) ( obj -- )
|
||||
dup inspector-stack get push
|
||||
dup summary print
|
||||
sheet dup empty? [ drop ] [ sheet-numbers sheet. ] if ;
|
||||
sheet sheet-numbers sheet. ;
|
||||
|
||||
: inspector-help ( -- )
|
||||
"Object inspector." print
|
||||
|
|
|
|||
Loading…
Reference in New Issue