This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Hash tables


Daniel Terhorst wrote:

> A better example:
> ;; -*- scheme -*-
> (require 'srfi-69)
> ;;
> (define H (alist->hash-table '(("53gqi")
>                              ("6vxk4"))))
> ;;
> (hash-table-ref H "53gqi") ; Expected: '()     Actual: '()
> (hash-table-delete! H "53gqi") ; should remove "53gqi" from the table
> (hash-table-ref/default H "53gqi" "GONE =)") ; Expected: GONE =)     Actual: '()
> ;;
> #\newline

It's a bug in the Kawa SRFI-69 implementation.  There is some kind of
problem removing the first key, but not the second.

#|kawa:34|# (define H (alist->hash-table '(("53gqi")
                             ("6vxk4"))))#|(---:35|#
#|kawa:36|# (hash-table->alist H)
((53gqi) (6vxk4))
#|kawa:37|# (hash-table-size H)
2
#|kawa:38|# (hash-table-delete! H "53gqi")
#|kawa:39|# (hash-table-size H)
1
#|kawa:40|# (hash-table->alist H)
((53gqi) (6vxk4))
#|kawa:41|# (hash-table-delete! H "53gqi")
#|kawa:42|# (hash-table-size H)
0
#|kawa:43|# (hash-table->alist H)
((53gqi) (6vxk4))
#|kawa:44|# (hash-table-delete! H "6vxk4")
#|kawa:45|# (hash-table-size H)
-1
#|kawa:46|# (hash-table->alist H)
((53gqi))

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]