Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix query interpolation for expressions of type String #107

Merged
merged 2 commits into from
Apr 21, 2014

Conversation

dwhjames
Copy link
Owner

Clojure has both pr-str and print-str, the former for consumption by the reader and the latter for human consumption. Scala’s toString is equivalent to print-str and does not quote strings. To be able to interpolate expressions of type String, the macro needs to quote the resulting strings, such that they can be read with datomic.Util.read.

Now, when substituting trees of type string, the macro performs a type test for String.

As a small improvement, AbstractQuery provides overrides for equals, hashCode, and toString.

strings are not quoted, and they need to be when being substituted into Clojure data
can’t have an abstract value class, but we can still make it behave as one
@dwhjames dwhjames added this to the v0.7 milestone Apr 21, 2014
dwhjames added a commit that referenced this pull request Apr 21, 2014
Fix query interpolation for expressions of type String
@dwhjames dwhjames merged commit bb5d7e4 into develop Apr 21, 2014
@dwhjames dwhjames deleted the fix/macro-string-quote branch April 21, 2014 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant