[Openmcl-devel] Is it safe to make hash tables with non-standard tests?

Willem Rein Oudshoorn woudshoo at xs4all.nl
Sat Jul 20 01:43:46 PDT 2013


Ron Garret <ron at flownet.com> writes:

>
>
> I was actually going to use (sxhash (string-upcase (princ-to-string thing))) as the hash function, and STRING-EQUAL as the test.
>

This is a bit late maybe, but if you care about efficiency and safety,
it is maybe better to either write your own datastructure, or wrap the
hashtable with well defined accessor methods which will do the checks.

I mention this because if you use the hash function as defined above, it
will create at least two temporary strings for each hash table access.
And I guess that the string-upcase function has to do some work 
with respect to unicode etc.

Wim Oudshoorn.







More information about the Openmcl-devel mailing list