#db/id[:db.part/db] throws an exception

79 views
Skip to first unread message

edw...@kenworthy.info

unread,
Dec 16, 2014, 3:01:00 PM12/16/14
to clo...@googlegroups.com
I'm following the Clojure Cookbook recipe for defining a schema in datomic.

One of the forms is: #db/id[:db.part/db] but this generates an exception "clojure.lang.ExceptionInfo: No reader function for tag id :: {:column 25, :line 27, :type :reader-exception}"

Can anyone offer any insight?

Ryan Neufeld

unread,
Dec 16, 2014, 6:42:10 PM12/16/14
to clo...@googlegroups.com
Yeah, we shouldn't be telling you to use reader literals like that. Preferred is a call to (d/tempid ...). I'm updating the code now (https://github.com/clojure-cookbook/clojure-cookbook/blob/master/06_databases/6-11_schema.asciidoc)

edw...@kenworthy.info

unread,
Dec 17, 2014, 2:02:12 AM12/17/14
to clo...@googlegroups.com
I've tried that already but then Clojure complains about there being an uneven number of elements in a map.

Curious though: did the original code ever actually work? Is it something that was deprecated?

Have to say I am happy if that's the case, the original seemed unnecessarily arcane where as a standard function call is obvious.

edw...@kenworthy.info

unread,
Dec 17, 2014, 2:09:18 AM12/17/14
to clo...@googlegroups.com
Strangely making the change to my code didn't fix it (I got an exception about an uneven number of elements in a map) but copying and pasting your code -once I'd fixed the half dozen bracket and brace errors that have been introduced- it does work.

Ta.

Ryan Neufeld

unread,
Dec 17, 2014, 8:15:00 PM12/17/14
to clo...@googlegroups.com
There are still some errors in there. My bad. Someone came in with a pull request and I'll test it works. 

Generally all the code should have worked originally--I tested every recipe--but I may have missed one or two. 

-Ryan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/Ki6WWN3n2JU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages