diff --git a/scheme/ikarus.hash-tables.ss b/scheme/ikarus.hash-tables.ss index 21a33fe..7b23d07 100644 --- a/scheme/ikarus.hash-tables.ss +++ b/scheme/ikarus.hash-tables.ss @@ -19,7 +19,7 @@ hashtable-size hashtable-delete! hashtable-contains? hashtable-update! hashtable-keys hashtable-mutable? hashtable-clear! hashtable-entries hashtable-copy - string-hash) + string-hash string-ci-hash symbol-hash) (import (ikarus system $pairs) (ikarus system $vectors) @@ -29,7 +29,7 @@ hashtable-size hashtable-delete! hashtable-contains? hashtable-update! hashtable-keys hashtable-mutable? hashtable-clear! hashtable-entries hashtable-copy - string-hash)) + string-hash string-ci-hash symbol-hash)) (define-struct hasht (vec count tc mutable?)) @@ -411,4 +411,15 @@ (foreign-call "ikrt_string_hash" s) (error 'string-hash "not a string" s))) + (define (string-ci-hash s) + (if (string? s) + (foreign-call "ikrt_string_hash" + (string-foldcase s)) + (error 'string-ci-hash "not a string" s))) + + (define (symbol-hash s) + (if (symbol? s) + (foreign-call "ikrt_string_hash" (symbol->string s)) + (error 'symbol-hash "not a symbol" s))) + ) diff --git a/scheme/last-revision b/scheme/last-revision index 1b6d75c..42ba964 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1115 +1116 diff --git a/scheme/makefile.ss b/scheme/makefile.ss index 90008ed..885ddd0 100755 --- a/scheme/makefile.ss +++ b/scheme/makefile.ss @@ -1193,8 +1193,8 @@ [hashtable-equivalence-function r ht] [equal-hash r ht] [string-hash i r ht] - [string-ci-hash r ht] - [symbol-hash r ht] + [string-ci-hash i r ht] + [symbol-hash i r ht] [list-sort i r sr] [vector-sort i r sr] [vector-sort! i r sr] diff --git a/scheme/todo-r6rs.ss b/scheme/todo-r6rs.ss index cc25e1d..5680361 100755 --- a/scheme/todo-r6rs.ss +++ b/scheme/todo-r6rs.ss @@ -700,8 +700,8 @@ [hashtable-equivalence-function S ht] [equal-hash S ht] [string-hash C ht] - [string-ci-hash S ht] - [symbol-hash S ht] + [string-ci-hash C ht] + [symbol-hash C ht] ;;; [list-sort C sr] [vector-sort C sr] diff --git a/src/ikarus-symbol-table.c b/src/ikarus-symbol-table.c index 41871a2..18e42b6 100644 --- a/src/ikarus-symbol-table.c +++ b/src/ikarus-symbol-table.c @@ -53,7 +53,7 @@ compute_hash(ikp str){ ikp ikrt_string_hash(ikp str){ - return fix(compute_hash(str)); + return compute_hash(str) & (~ fx_mask); } static int strings_eqp(ikp str1, ikp str2){