(defun set-hash-values (hash pairs)
(when pairs
(setf (gethash (car pairs) hash) (cadr pairs))
(set-hash-values hash (cddr pairs))))
(defun in-place-hash (stream char)
(declare (ignore char))
`(let ((hash (make-hash-table)))
(set-hash-values hash ',(read-delimited-list #\} stream t))
hash))
(set-macro-character #\{ #'in-place-hash)
(set-syntax-from-char #\} #\))
But to be honest, I think this {} stuff is an abuse of the hash structure. People are really looking to make quick anonymous classes/structs; you see this all the time in the perl world, and now we get to see this abuse promoted and propagated in Clojure. In that case, {} should really translate to a MOP-generated anonymous class.Also, you are stuck with the decision some developer made for your hash's efficiency trade-offs. In my reader macro, I left things at make-hash-table defaults, but that might not be appropriate for your situation. Do you want to be able to read quickly from your hash in exchange for slow writes, or do you want to be able to write quickly to the hash in exchange for slow reads?
On another note, the [] vector reader macro is much easier to create. I just wanted to prove to myself that I could write {}. But this additional syntax is annoying. In practice when programming Lisp, it is easy to slap in a bunch of ))))) until the right alternate parentheses highlights. Now I have to remember to slap in ] and } at the right spots, leaving me with )]}]]}})) noise. Maybe that is why CL's in-place vector syntax is #().
Anyway, I would hesitate to call {} and [] an innovation.