[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Strange hash-table behavior in compiled code
From: |
Mario Domenech Goulart |
Subject: |
Re: [Chicken-users] Strange hash-table behavior in compiled code |
Date: |
Mon, 26 Sep 2005 21:00:37 +0000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Hello Alex, Felix and list
On Mon, 26 Sep 2005 07:51:43 +0200 felix winkelmann <address@hidden> wrote:
> On 9/26/05, Alex Shinn <address@hidden> wrote:
>> At Sun, 25 Sep 2005 14:38:50 +0000, Mario Domenech Goulart wrote:
>> >
>> > I'm confused about the behavior of hash tables in compiled code.
>> >
>> > $ cat ht.scm
>> > (let ((ht (make-hash-table string=?)))
>> > (hash-table-set! ht "a" "b")
>> > (print (hash-table-ref ht "a")))
>>
>> [...]
>>
>> > #;1> (use ht)
>> > ; loading ./ht.so ...
>> > #f
>>
>> The default hash procedure doesn't seem to handle literal strings
>> correctly. If you were to use non-literals it would work:
>
> Here a patch for extras.scm:
>
> 1493d1492
> < ((##sys#permanent? x) (##core#inline "C_hashptr" x))
Thanks a lot for your help.
Passing the string-hash as argument to make-hash-table did the trick.
I'm going to apply the patch to extras.scm (this machine takes a very
long time to compile chicken, that's why I haven't done it yet -- but
I'm gonna do it soon).
Again, thanks for your time.
Best wishes,
Mario