[plt-dev] `hash', `hasheq', and `hasheqv'

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Apr 23 10:37:33 EDT 2010

For the `racket' language, I'd like to introduce `hash', `hasheq', and
`hasheqv' constructors. They'd be just like `make-immutable-hash', etc,
but they'd take the content of the hash as arguments that are
alternately keys and values (so always an even number of arguments).

For example,

  (hash 1 'a
	2 'b
	3 'c)

would be the same as

  (make-immutable-hash (list (cons 1 'a) (cons 2 'b) (cons 3 'c)))

which, since the keys and values are all literals in that example,
could also be written as

 '#hash((1 . a) (2 . b) (3 . c))

Having `hash' seems nice and in parallel to `list', `vector', `string',
`set', etc.


Posted on the dev mailing list.