Discussion:
string-hash
Jonathan Rees
2012-05-16 18:29:31 UTC
Permalink
http://www.cse.yorku.ca/~oz/hash.html

vm/data/struct.scm has

(define (vm-string-hash s)
(let ((n (vm-string-length s)))
(do ((i 0 (+ i 1))
(h 0 (+ h (char->ascii (vm-string-ref s i)))))
((>= i n) h))))

also other places in the source (but not srfi-13)

I'm not complaining, just thought this might want to go on the to-do-someday list.

Interesting coincidence, this page was the top google hit for "string hash", and its author was the first person to get ahold of scheme48 (beyond Richard and me)

Jonathan
Michael Sperber
2012-05-17 13:37:07 UTC
Permalink
Post by Jonathan Rees
http://www.cse.yorku.ca/~oz/hash.html
vm/data/struct.scm has
(define (vm-string-hash s)
(let ((n (vm-string-length s)))
(do ((i 0 (+ i 1))
(h 0 (+ h (char->ascii (vm-string-ref s i)))))
((>= i n) h))))
also other places in the source (but not srfi-13)
I'm not complaining, just thought this might want to go on the to-do-someday list.
Marcus Crestani fixed this in 2008. I just need to make a release with
the fix in it.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Loading...