guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which hashtable API to use?


From: Matt Wette
Subject: Re: Which hashtable API to use?
Date: Fri, 16 Aug 2013 17:00:17 -0700

guile> (define ht (make-hash-table 7))
guile> (hash-set! ht "matt" "awesome")
"awesome"
guile> (hashq-ref ht "matt")
#f
guile> (hash-ref ht "matt")
"awesome"

On Aug 16, 2013, at 6:33 AM, Alexandru Cojocaru wrote:

> Ok, I got it. Basicaly if I do `(hash '(a) 3)' I'll always get the same hash 
> because it uses the contents of the list,
> while if I do `(hashq '(a) 3)' I may get different hashes because it uses the 
> list's pointer address.
> 
> On 16.08.2013 14:47, Matt Wette wrote:
>> WIth respect to your second question: hash table operations can compare keys 
>> with equal?, eq?, or eqv?.
>> Which one do you want to use?
>> 
>> On Aug 16, 2013, at 4:38 AM, Alexandru Cojocaru wrote:
>> 
>>> Hi,
>>> currently there are three hashtable APIs: R6RS, SRFI-69 and Guile's one.
>>> Which one to choose?
>>> 
>>> Also what's exactly the difference between hash, hashq and hashv?
>>> 
>>> Best regards,
>>> Alexandru Cojocaru
>>> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]