External representation taylanbayirli@xxxxxx 10 Sep 2015 15:21 UTC

I think it would be very useful to specify external representation
(reader syntax) for hash tables, but I want to make sure I'm not adding
anything unreasonable to the spec.  External representation is a big
deal since it changes the lexical syntax.

My current idea:

#hashq((key . value) ...)  ; eq? based
#hashv((key . value) ...)  ; eqv? based

#hash((key . value) ...)  ; equal-hash & equal? based

#hash(string    (key . value) ...)  ; string-hash & string=? based
#hash(string-ci (key . value) ...)  ; string-ci-hash & string-ci=? based
#hash(symbol    (key . value) ...)  ; symbol-hash & eq? based

(Using symbol=? is unnecessary because the keys already pass through
symbol-hash which means the type-check of symbol=? isn't needed.)

Racket uses #hasheq and #hasheqv instead of #hashq and #hashv.  I
decided to go with the latter for similarity to memq and memv, and the
shorter the reader hash-tag the better.

What does everyone think?

Taylan