unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Gregory Marton <gremio@mit.edu>
To: Neil Jerram <neil@ossau.uklinux.net>
Cc: bug-guile@gnu.org
Subject: Re: [bug #22022] hashx-set! and -ref
Date: Thu, 17 Jan 2008 19:30:08 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.62.0801171928360.6868@ashmore.csail.mit.edu> (raw)
In-Reply-To: <87d4s0cag8.fsf@ossau.uklinux.net>

Thank you.  I did something far less elegant already, but it's good to have 
this.  I should also read all of my email before responding.  :-)

Best wishes,
Grem

> Gregory Marton <INVALID.NOREPLY@gnu.org> writes:
>
>> As an enhancement request, it would be nice for the common case to be able to
>> pass a hash-function argument and assoc to make-hash-table or to have a
>> (make-hashx-table hash assoc [size]), and in either case to remember the hash
>> function so that resize works correctly.
>
> Last email on this topic for tonight...!
>
> Note that anyone wanting to implement this "saner" interface can
> straightforwardly do so in Scheme:
>
> (define hash-table-hash-fn (make-object-property))
>
> (define hash-table-assoc-fn (make-object-property))
>
> (define (make-hashx-table hash assoc . args)
>  (let ((t (apply make-hash-table args)))
>    (set! (hash-table-hash-fn t) hash)
>    (set! (hash-table-assoc-fn t) assoc)
>    t))
>
> (define (hashx-table-ref t key)
>  (hashx-ref (hash-table-hash-fn t) (hash-table-assoc-fn t) t key))
>
> etc.
>
> Regards,
>       Neil
>
>
>
>
>

-- 
------ __@   Gregory A. Marton                http://csail.mit.edu/~gremio/
--- _`\<,_                                                                .
-- (*)/ (*)               Truth, Beauty, Love, and Darwinfish!
~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~





      reply	other threads:[~2008-01-18  0:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14 22:40 [bug #22022] hashx-set! and -ref Gregory Marton
2008-01-17 21:52 ` Neil Jerram
2008-01-17 21:54   ` Gregory Marton
2008-01-17 23:02     ` Neil Jerram
2008-01-18  0:25       ` Gregory Marton
2008-01-17 21:57   ` Neil Jerram
2008-01-17 22:01     ` Gregory Marton
2008-01-17 22:45     ` Neil Jerram
2008-01-18  0:22       ` Gregory Marton
2008-01-29 22:28       ` Neil Jerram
2008-12-07 16:51         ` Neil Jerram
2008-01-17 23:13 ` Neil Jerram
2008-01-18  0:30   ` Gregory Marton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.62.0801171928360.6868@ashmore.csail.mit.edu \
    --to=gremio@mit.edu \
    --cc=bug-guile@gnu.org \
    --cc=neil@ossau.uklinux.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).