Re: My hash has 5 object but inspect shows only 4; help
steve gonedes <[email protected]> Fri, 10 Apr 2026 10:38:56 -0400
| Newsgroups | gmane.lisp.steel-bank.general |
|---|---|
| Message-ID | <[email protected]> |
On 4/3/26 1:45 PM, Jacek Podkanski wrote:
> I solved my previous <<error printing object>> and now I have another
> problem. When my example stops running, and I want to (inspect *arbs*)
> to see the hash, inspect shows 5 objects.
> But when i press 4 to see the pairs of the hash, I see only 4 objects.
>
> How am I supposed to understand it?
CL-USER> (defvar *hash* (make-hash-table ))
*HASH*
#\d
#\e
#\f
NIL
CL-USER> (loop for i across "abcdef" do (setf (gethash i *hash*) i))
NIL
CL-USER> *hash*
#<HASH-TABLE :TEST EQL :COUNT 6 {100481C203}>
### this is all she wrote.
CL-USER> (inspect '*hash*)
The object is a SYMBOL.
0. Name: "*HASH*"
1. Package: #<PACKAGE "COMMON-LISP-USER">
2. Value: #<HASH-TABLE :TEST EQL :COUNT 6 {100481C203}>
3. Function: #<unbound slot>
4. Plist: NIL
> 2
The object is a STRUCTURE-OBJECT of type HASH-TABLE.
0. GETHASH-IMPL: #<FUNCTION SB-IMPL::GETHASH/EQL>
1. PUTHASH-IMPL: #<FUNCTION SB-IMPL::PUTHASH/EQL>
2. REMHASH-IMPL: #<FUNCTION SB-IMPL::REMHASH/EQL>
3. CLRHASH-IMPL: #<FUNCTION SB-IMPL::CLRHASH-IMPL>
4. PAIRS: #(6 0 #\a #\a #\b #\b #\c #\c #\d #\d #\e #\e #\f #\f
#1=#<unbound> #1# T)
5. CACHE: 17592186044414
6. INDEX-VECTOR: #(0 0 0 0 0 0 0 6)
7. NEXT-VECTOR: #(0 0 1 2 3 4 5 0)
8. HASH-VECTOR: NIL
9. FLAGS: 16
10. %LOCK: NIL
11. TEST-FUN: #<FUNCTION EQL>
12. HASH-FUN: #<FUNCTION SB-IMPL::EQL-HASH>
13. TEST: EQL
14. REHASH-SIZE: 1.5
15. REHASH-THRESHOLD: 1.0
16. %COUNT: 6
17. NEXT-FREE-KV: 7
> q
; No value
CL-USER>