[cdr-discuss] CDR-2 -- register-test-designator vs. keyword parameters

Chris Dean ctdean at sokitomi.com
Wed Dec 6 11:31:10 UTC 2006


Nikodemus Siivola <nikodemus at random-state.net> writes:
> and requires users to express the same intention over and over
> again.

Not really, since if they have the same test/hash pair can just create
a helper function:

  (defun make-people-hash-table ()
    (make-generic-hashtable :test 'people-test :hash-function 'people-hash))


>  (make-hash-table :test 'eq :key 'car)
>
> would be a hash-table whose keys are hashed and compared only based on
> their cars.

An excellent idea!  Why not add that?

If one were to stick with the register-test-designator design, I would
suggest that we change the name of the keyword parameter from TEST to
something else to reflect that in the general case it's not a test but
a designator that is being specified:

    (make-generic-hashtable &key size (designator ’eql)) 

Cheers,
Chris Dean




More information about the cdr-discuss mailing list