* bug#13022: hash-table accessors no longer work on vectors
@ 2012-11-28 16:00 Daniel Hartwig
2012-11-29 20:13 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Hartwig @ 2012-11-28 16:00 UTC (permalink / raw)
To: 13022
Straight out of (guile) Hash Table Examples:
scheme@(guile-user)> (define h (make-vector 7 '()))
scheme@(guile-user)> (hashq-set! h 'foo "bar")
ERROR: In procedure hashq-set!:
ERROR: In procedure scm_hash_fn_create_handle_x: Wrong type argument in position 1 (expecting hash-table): #(() () () () () () ())
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#13022: hash-table accessors no longer work on vectors
2012-11-28 16:00 bug#13022: hash-table accessors no longer work on vectors Daniel Hartwig
@ 2012-11-29 20:13 ` Ludovic Courtès
2012-11-30 1:52 ` Daniel Hartwig
0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2012-11-29 20:13 UTC (permalink / raw)
To: Daniel Hartwig; +Cc: 13022-done
Daniel Hartwig <mandyke@gmail.com> skribis:
> Straight out of (guile) Hash Table Examples:
>
> scheme@(guile-user)> (define h (make-vector 7 '()))
> scheme@(guile-user)> (hashq-set! h 'foo "bar")
> ERROR: In procedure hashq-set!:
> ERROR: In procedure scm_hash_fn_create_handle_x: Wrong type argument in position 1 (expecting hash-table): #(() () () () () () ())
I removed the faulty example from the doc, thanks!
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#13022: hash-table accessors no longer work on vectors
2012-11-29 20:13 ` Ludovic Courtès
@ 2012-11-30 1:52 ` Daniel Hartwig
2012-11-30 20:24 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Hartwig @ 2012-11-30 1:52 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 13022
[-- Attachment #1: Type: text/plain, Size: 376 bytes --]
On 30 November 2012 04:13, Ludovic Courtès <ludo@gnu.org> wrote:
> I removed the faulty example from the doc, thanks!
Ok. The attached patch cleans up some more references to this.
I did not find a mention in NEWS, although I see that the
functionality was removed in Jan 2011 and the commit indicates it was
deprecated prior to that. [commit f0554ee]
Regards
[-- Attachment #2: 0001-doc-remove-more-references-to-hash-tables-as-vectors.patch --]
[-- Type: application/octet-stream, Size: 3016 bytes --]
From 497f5cce8d4d8730ccc4b55d53c5db704a91e722 Mon Sep 17 00:00:00 2001
From: Daniel Hartwig <mandyke@gmail.com>
Date: Fri, 30 Nov 2012 09:40:36 +0800
Subject: [PATCH] doc: remove more references to hash-tables-as-vectors
* doc/ref/api-compound.texi (Hash Tables): Update.
---
doc/ref/api-compound.texi | 25 ++++++-------------------
1 file changed, 6 insertions(+), 19 deletions(-)
diff --git a/doc/ref/api-compound.texi b/doc/ref/api-compound.texi
index ba2dc8e..be3d65f 100644
--- a/doc/ref/api-compound.texi
+++ b/doc/ref/api-compound.texi
@@ -3721,12 +3721,6 @@ search in constant time. The drawback is that hash tables require a
little bit more memory, and that you can not use the normal list
procedures (@pxref{Lists}) for working with them.
-Guile provides two types of hashtables. One is an abstract data type
-that can only be manipulated with the functions in this section. The
-other type is concrete: it uses a normal vector with alists as
-elements. The advantage of the abstract hash tables is that they will
-be automatically resized when they become too full or too empty.
-
@menu
* Hash Table Examples:: Demonstration of hash table usage.
* Hash Table Reference:: Hash table procedure descriptions.
@@ -3831,19 +3825,12 @@ Hash tables are implemented as a vector indexed by a hash value formed
from the key, with an association list of key/value pairs for each
bucket in case distinct keys hash together. Direct access to the
pairs in those lists is provided by the @code{-handle-} functions.
-The abstract kind of hash tables hide the vector in an opaque object
-that represents the hash table, while for the concrete kind the vector
-@emph{is} the hashtable.
-
-When the number of table entries in an abstract hash table goes above
-a threshold, the vector is made larger and the entries are rehashed,
-to prevent the bucket lists from becoming too long and slowing down
-accesses. When the number of entries goes below a threshold, the
-vector is shrunk to save space.
-A abstract hash table is created with @code{make-hash-table}. To
-create a vector that is suitable as a hash table, use
-@code{(make-vector @var{size} '())}, for example.
+When the number of entries in a hash table goes above a threshold, the
+vector is made larger and the entries are rehashed, to prevent the
+bucket lists from becoming too long and slowing down accesses. When the
+number of entries goes below a threshold, the vector is shrunk to save
+space.
For the @code{hashx-} ``extended'' routines, an application supplies a
@var{hash} function producing an integer index like @code{hashq} etc
@@ -3878,7 +3865,7 @@ addition to @code{hashq} etc below, include @code{symbol-hash}
@sp 1
@deffn {Scheme Procedure} make-hash-table [size]
-Create a new abstract hash table object, with an optional minimum
+Create a new hash table object, with an optional minimum
vector @var{size}.
When @var{size} is given, the table vector will still grow and shrink
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#13022: hash-table accessors no longer work on vectors
2012-11-30 1:52 ` Daniel Hartwig
@ 2012-11-30 20:24 ` Ludovic Courtès
0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2012-11-30 20:24 UTC (permalink / raw)
To: Daniel Hartwig; +Cc: 13022
Hi Daniel,
Daniel Hartwig <mandyke@gmail.com> skribis:
> I did not find a mention in NEWS, although I see that the
> functionality was removed in Jan 2011 and the commit indicates it was
> deprecated prior to that. [commit f0554ee]
Indeed, that should have been mentioned in NEWS...
> From 497f5cce8d4d8730ccc4b55d53c5db704a91e722 Mon Sep 17 00:00:00 2001
> From: Daniel Hartwig <mandyke@gmail.com>
> Date: Fri, 30 Nov 2012 09:40:36 +0800
> Subject: [PATCH] doc: remove more references to hash-tables-as-vectors
>
> * doc/ref/api-compound.texi (Hash Tables): Update.
Applied, thanks!
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-30 20:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28 16:00 bug#13022: hash-table accessors no longer work on vectors Daniel Hartwig
2012-11-29 20:13 ` Ludovic Courtès
2012-11-30 1:52 ` Daniel Hartwig
2012-11-30 20:24 ` Ludovic Courtès
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).