<div dir="ltr">What CLtL1 says isn't really relevant in 2013. There also isn't a need to create a hash table for #'string= because that functionality is already supported by the standard.<div><br></div><div>So the statement in Ron's message that a 'string= hashtable [...] is not in the standard" is false, and there is no reason to use a non-standard approach when the standard covers both this case and a #'string-equal case.</div>
<div><br></div><div>So while my response doesn't directly answer his exact question, it answers it in a way that obviates the need for his original query.</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sun, Jul 14, 2013 at 8:48 PM, Gary Byers <span dir="ltr"><<a href="mailto:gb@clozure.com" target="_blank">gb@clozure.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If the question was "can TEST functions other than EQ/EQL/EQUAL/EQUALP<br>
be used non-portably in CCL, and should that be considered a supported<br>
extension that should be documented ?", the answer is "yes". IIRC, in<br>
CLtL1 EQUALP wasn't a standard test function, and supporting arbitrary<br>
test functions (and user-provided hashing functions) was one way of<br>
supporting EQUALP as a test.<br>
<br>
If the question was "is this a non-portable extenstion ?" ... I don't<br>
think that that was the question.<br>
<br>
If the question was "is there a compelling reason to use a non-standard<br>
test function (other than typechecking and whatever the performance tradeoffs<br>
are at the moment), and is such a reason more compelling than portability<br>
concerns that one may or may not have ?" ... well, that's a good question<br>
to ask and one that different people can have good reasons to answer differently.<div class="im"><br>
<br>
On Sun, 14 Jul 2013, Tom Emerson wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
You don't need to: using 'equal as your test achieves the same result.<br></div>
Welcome to Clozure Common Lisp Version 1.9-r15757 ?(LinuxX8664)!<div class="im"><br>
? (defvar foo (make-hash-table :test 'equal))<br>
#<HASH-TABLE :TEST EQUAL size 0/60 #x3020006F2C3D><br>
? (setf (gethash "abc" foo) 100)<br>
100<br>
? (gethash "abc" foo)<br>
100<br>
T<br>
? (gethash "ABC" foo)<br>
NIL<br>
NIL<br>
<br>
If instead you want the test to be string-equal then use 'equalp<br>
<br>
? (setq foo (make-hash-table :test 'equalp))<br>
#<HASH-TABLE :TEST EQUALP size 0/60 #x3020006F9D5D><br>
? (setf (gethash "abc" foo) 100)<br>
100<br>
? (gethash "abc" foo)<br>
100<br>
T<br>
? (gethash "ABC" foo)<br>
100<br>
T<br>
<br>
This is portable: same results in SBCL.<br>
<br>
<br>
<br>
On Sun, Jul 14, 2013 at 3:53 PM, Ron Garret <<a href="mailto:ron@flownet.com" target="_blank">ron@flownet.com</a>> wrote:<br></div>
I need a string= hash table, which is not in the standard. ?It<div class="im"><br>
appears that CCL can actually make one:<br>
<br>
(make-hash-table :test 'string= :hash-function 'sxhash)<br>
<br></div>
This seems to do the Right Thing, but ?it's not documented. ?Is<div class="im"><br>
it safe to use this feature?<br>
<br>
rg<br>
<br>
______________________________<u></u>_________________<br>
Openmcl-devel mailing list<br>
<a href="mailto:Openmcl-devel@clozure.com" target="_blank">Openmcl-devel@clozure.com</a><br>
<a href="http://clozure.com/mailman/listinfo/openmcl-devel" target="_blank">http://clozure.com/mailman/<u></u>listinfo/openmcl-devel</a><br>
<br>
<br>
<br>
<br>
--<br>
Tom Emerson<br>
<a href="mailto:tremerson@gmail.com" target="_blank">tremerson@gmail.com</a><br>
<a href="http://www.dreamersrealm.net/tree" target="_blank">http://www.dreamersrealm.net/<u></u>tree</a><br>
<br>
<br>
</div></blockquote>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Tom Emerson<br><a href="mailto:tremerson@gmail.com" target="_blank">tremerson@gmail.com</a><br><a href="http://www.dreamersrealm.net/tree" target="_blank">http://www.dreamersrealm.net/tree</a>
</div>