Fork me on GitHub
Nathaniel Stevens17:10:02

Would somebody be able to tell me why this doesn't work? (-> [1 2 3] (filter odd?))


try to macroexpand it


user=> (macroexpand-1 '(-> [1 2 3] (filter odd?)))
(filter [1 2 3] odd?)


You need ->> is this particular case :)

Daniel Hines18:10:55

In the "Pull" section of the Datomic on-prem tutorial(, db/pull returns data that looks like this:

#:inv{:color #:db{:ident :blue}, ...}
What is the the #:inv and #:db? I've yet to encounter this sort of data literal/syntax.


#:foo{:bar 1 :baz 2} is sugar for {:foo/bar 1 :foo/baz 2}


i.e. all the idents (keywords and symbols) used as keys in the map will be namespaced by the prefix

❤️ 1
Daniel Hines18:10:06

Oooooh. I had no idea. Cool. Thanks!


assume I want to use some java 8 features in some piece of code if that code is running under java 8, but revert to a java 6 compatible code snippet when running under java 6. Would that be possible in clojure? And how? Conditional require call?


@d4hines You'll probably find this section of the destructuring guide helpful too


And the reader literal syntax associated with maps is discussed here

Daniel Hines21:10:01

@bronsa, @seancorfield, all of that is clarifying. Thanks!