In Leiningen, the reader side is in a different process (owned by 
Leiningen, without your project code on the classpath), than the execution 
side. So I think you see this error due to classpath separation: the lein 
side doesn't have data_readers.clj specification, or the reader functions 
defined in the project. 

Short-term, you can use `lein trampoline repl` instead of `lein repl` to 
fix this, assuming it's the root problem.

I guess we'll need to do some thinking about what reader-side things would 
need to change to accommodate custom reader literals in a cross-process 
scenario. Simple things like a line consisting of only the reader literal 
could be made to work by catching exceptions, but we use the Clojure reader 
to decide when the user is done entering input, then pass the plaintext to 
the server. So if we're not done with a form when we hit the exception, as 
is the case in `(def x #db/id [:db/part.db] )`, we're stuck not knowing 
whether the form is really complete or not, only that the reader failed to 
read a reader literal.

It seems like ideally we'd have in-hand on the reader side what all the 
data_readers.clj files have on the execution side *and* the functions 
defining them, but it seems scary to have a server shipping code to execute 
directly on the reader side.

Or maybe [hopefully] there's a more elegant solution that I'm missing?



On Wednesday, July 25, 2012 5:02:50 PM UTC-5, tbc++ wrote:
>
> I'm using the new Clojars version of datomic-free: 
>
> (defproject clj-lobapp "0.1.0-SNAPSHOT" 
>   :description "FIXME: write description" 
>   :url "http://example.com/FIXME"; 
>   :license {:name "Eclipse Public License" 
>             :url "http://www.eclipse.org/legal/epl-v10.html"} 
>   :plugins [[lein-localrepo "0.4.0"]] 
>   :dependencies [[org.clojure/clojure "1.4.0"] 
>                  [com.datomic/datomic "0.8.3335"]]) 
>
>
> user=> ;; make in memory database 
>        (use '[datomic.api :only (q db) :as d]) 
> nil 
> user=> (def uri "datomic:mem://matches") 
> #'user/uri 
> user=> (d/create-database uri) 
> true 
> user=> (def conn (d/connect uri)) 
> #'user/conn 
> user=> 
>
> user=> #db/id [:db.part/db] 
> #<RuntimeException java.lang.RuntimeException: No reader function for tag 
> db/id> 
> nil 
> user=> *data-readers* 
> {base64 #'datomic.codec/base-64-literal, db/fn 
> #'datomic.function/construct, db/id #'datomic.db/id-literal} 
> user=> (get *data-readers* 'db/id) 
> #'datomic.db/id-literal 
> user=> ((get *data-readers* 'db/id) :db.part/db) 
> UnsupportedOperationException nth not supported on this type: Keyword 
> clojure.lang.RT.nthFrom (RT.java:787) 
>
> user=> ((get *data-readers* 'db/id) [:db.part/db]) 
> #db/id[:db.part/db -1000000] 
>
>
>
> What am I missing here? 
>
>
> Thanks, 
>
> Timothy Baldridge 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to