[Openmcl-devel] make-hash-table: error: non-standard test specified without hash-function
Gary Byers
gb at clozure.com
Sat Mar 5 08:33:56 PST 2016
please see the CLHS entry foe MAKE_HASH-TABLE, especially where is says
of the :test
argument:
/te/st---a designator
<http://www.lispworks.com/documentation/lw50/CLHS/Body/26_glo_d.htm#designator>
for one of the functions
<http://www.lispworks.com/documentation/lw50/CLHS/Body/26_glo_f.htm#function>
eq <http://www.lispworks.com/documentation/lw50/CLHS/Body/f_eq.htm#eq>,
eql
<http://www.lispworks.com/documentation/lw50/CLHS/Body/f_eql.htm#eql>,
equal
<http://www.lispworks.com/documentation/lw50/CLHS/Body/f_equal.htm#equal>,
or equalp
<http://www.lispworks.com/documentation/lw50/CLHS/Body/f_equalp.htm#equalp>.
In other words, the results of using other things as :test the value of
the :test argument are not portably defined.
You don't need to provide a hash-function if you use a standard test
function (one of the above).
in CCL, you can use a non-standard test function, but you must also tell
MAKE_HASH-TABLE how to hash things so that two things that are
equivalent under transport-plugin-info-equal-p)
hash to the same value
On 03/05/2016 09:02 AM, Frank Goenninger wrote:
> Hi all:
>
> This code:
>
> (defun transport-plugin-info-equal-p (a b)
> (string= a b))
>
> (defvar *transport-plugin-infos* (make-hash-table :test 'transport-plugin-info-equal-p))
>
> produces this error; "non-standard test specified without hash-function"
>
> Well, yes, but…. I am not required to give a hash function, at least per CLHS. Any ideas ?
>
> Tnx!
>
> Kind regards
> Frank
>
>
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20160305/4e7540d8/attachment.htm>
More information about the Openmcl-devel
mailing list