Quote currently ignores all but the first argument. In the case of being called accidentally with multiple values, it should throw an exception specifying the error.
Screened by: Alex Miller
------- Original: --------
Every once in a while, you can just go down the rabbit hole.
I had an errant expression in my code:
One would think this would work; it certainly would if the key was a keyword and not a symbol.
One would expect this to expand to:
however, the reader is involved, so it is as if the source were:
which expands to:
... hilarity ensues! Because quote currently ignores extra parameters, my code gets the quoted value '(clojure.core/-> message get-message-values) rather than the expected string from the map; this shifts us from the "there's a bug in my code" to "the nature of reality is broken".
The correct expression is:
This took quite a while to track down; if the special form checked that it was passed exactly one form to quote and threw an exception otherwise, I think I would have caught this much earlier. It could even identify the expression it is quoting, which would provide a lot better understanding of where I went wrong.