[plt-dev] #hash vs. #s

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Feb 6 11:53:56 EST 2009

At Fri, 06 Feb 2009 11:46:24 -0500, Dave Herman wrote:
> The read behavior of #hash/#hasheq and #s is different; the former 
> always `quote' their body whereas the latter allows quasiquotation:
> 
>      > (define x 42)
>      > `#hash((x . ,x))
>      #hash((x . ,x))
>      > `#hasheq((x . ,x))
>      #hasheq((x . ,x))
>      > `#s(x ,x)
>      #s(x 42)
> 
> I don't know if it's too late for an incompatible change, but allowing 
> quasiquotation of #hash/#hasheq seems more useful, no?

Unquote for the value part of a `#hash' could work. I'm less sure that
it's a good idea for the key position, since the reader constructs a
hash table.

Aside from the possible constraint on keys, it's not so much a reader
issue as a question of what the `quasiquote' macro recognizes. The
source of `quasiquote' is "collects/scheme/qq-and-or.ss".



Posted on the dev mailing list.