scsh 0.3, linux 1.48
> (define tab (make-table))
> (let loop ((i 0)) (table-set! tab (list i) i) (loop (+ i 1)))
Error: value cannot be used as a table key
(14)
1>
once the table is converted from linear to hash at size 15, the
`general' hash function is invoked, but it doesn't handle pairs:
;; scsh-0.3/big/general-table.scm
(define (default-table-hash-function obj)
(cond ((symbol? obj) (string-hash (symbol->string obj)))
((integer? obj)
(if (< obj 0) (- -1 obj) obj))
((char? obj) (+ 333 (char->integer obj)))
((eq? obj #f) 3001)
((eq? obj #t) 3003)
((null? obj) 3005)
(else (error "value cannot be used as a table key" obj))))
neither does it handle procedures... imo the default hash function
shouldn't produce an error when it crosses an unrecognized type, but
should just return 0.
|