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