* hash table handles
@ 2002-10-30 17:17 Paul Jarc
2002-11-04 23:56 ` Paul Jarc
0 siblings, 1 reply; 5+ messages in thread
From: Paul Jarc @ 2002-10-30 17:17 UTC (permalink / raw)
If I have a pair returned by hash*-get-handle or hash*-create-handle,
can I use set-cdr! on it and expect to see the change reflected in
future lookups of the same key?
paul
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: hash table handles
2002-10-30 17:17 hash table handles Paul Jarc
@ 2002-11-04 23:56 ` Paul Jarc
2002-11-05 1:49 ` Thien-Thi Nguyen
0 siblings, 1 reply; 5+ messages in thread
From: Paul Jarc @ 2002-11-04 23:56 UTC (permalink / raw)
I wrote:
> If I have a pair returned by hash*-get-handle or hash*-create-handle,
> can I use set-cdr! on it and expect to see the change reflected in
> future lookups of the same key?
To clarify: I can see by experimentation that the code does behave
this way. But the documentation doesn't make it entirely clear
whether this is by design, or an accident, and thus whether it might
change in the future.
paul
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: hash table handles
2002-11-04 23:56 ` Paul Jarc
@ 2002-11-05 1:49 ` Thien-Thi Nguyen
2002-11-05 17:15 ` Paul Jarc
0 siblings, 1 reply; 5+ messages in thread
From: Thien-Thi Nguyen @ 2002-11-05 1:49 UTC (permalink / raw)
Cc: guile-user
From: prj@po.cwru.edu (Paul Jarc)
Date: Mon, 04 Nov 2002 18:56:21 -0500
But the documentation doesn't make it entirely clear whether this is
by design, or an accident, and thus whether it might change in the
future.
using cdr to access the associated data should be fine. i see this:
By convention, a handle in a hash table is the pair which associates a
key with a value.
how would you change this to be more clear?
thi
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: hash table handles
2002-11-05 1:49 ` Thien-Thi Nguyen
@ 2002-11-05 17:15 ` Paul Jarc
2002-11-05 18:41 ` Thien-Thi Nguyen
0 siblings, 1 reply; 5+ messages in thread
From: Paul Jarc @ 2002-11-05 17:15 UTC (permalink / raw)
Thien-Thi Nguyen <ttn@giblet.glug.org> wrote:
> using cdr to access the associated data should be fine.
I had no doubt of that. My doubt is about set-cdr!.
> i see this:
>
> By convention, a handle in a hash table is the pair which associates a
> key with a value.
I don't see that in the 1.6.0 manual, so I'll assume it was added
later. Assuming the following is in fact true, I would also like to
see something to the effect of:
Changes to the cdr of a handle (e.g., via set-cdr!) will be
reflected in future lookups for the same key. Changes to the car of
a handle (e.g., via set-car!) may cause future lookups to fail.
paul
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: hash table handles
2002-11-05 17:15 ` Paul Jarc
@ 2002-11-05 18:41 ` Thien-Thi Nguyen
0 siblings, 0 replies; 5+ messages in thread
From: Thien-Thi Nguyen @ 2002-11-05 18:41 UTC (permalink / raw)
Cc: guile-user
From: prj@po.cwru.edu (Paul Jarc)
Date: Tue, 05 Nov 2002 12:15:51 -0500
Thien-Thi Nguyen <ttn@giblet.glug.org> wrote:
> using cdr to access the associated data should be fine.
I had no doubt of that. My doubt is about set-cdr!.
sorry, i wasn't clear: "using cdr" should be "using the cdr", i.e., read
via "cdr", write via "set-cdr!".
I don't see that in the 1.6.0 manual, so I'll assume it was added
later.
see 1.4.1.91 manual, which derives from 1.5.7 and HEAD, mostly. the
referenced portion is part of the hash*-get-handle docstrings harvested
automagically from libguile/hashtab.c by "make" in doc/ref/.
Changes to the cdr of a handle (e.g., via set-cdr!) will be
reflected in future lookups for the same key. Changes to the car
of a handle (e.g., via set-car!) may cause future lookups to fail.
or, "behavior after changing the car of a handle is unspecified."
thi
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-11-05 18:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-30 17:17 hash table handles Paul Jarc
2002-11-04 23:56 ` Paul Jarc
2002-11-05 1:49 ` Thien-Thi Nguyen
2002-11-05 17:15 ` Paul Jarc
2002-11-05 18:41 ` Thien-Thi Nguyen
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).