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

error on fetcher example #8

Closed
ghost opened this issue Aug 16, 2012 · 3 comments
Closed

error on fetcher example #8

ghost opened this issue Aug 16, 2012 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 16, 2012

Running this code in the REPL,

(def fetcher (build-url-fetcher :disk "/tmp/cache"))

(def fetched
      (with-fetcher fetcher
        (retrieve-feed "http://planet-muddev.disinterest.org/rss20.xml")))

results in the error,

<ClassCastException java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to clojure.lang.Symbol>

ClassCastException clojure.lang.Var$Unbound cannot be cast to clojure.lang.Symbol clojure.core/find-ns (core.clj:3659)

The reader example works as expected.

Do I need to somehow register converters in fetcher?

@ghost
Copy link
Author

ghost commented Aug 16, 2012

After some experimentation I got the fetcher example working by:

  • copying the reader.clj register-converters to fetcher.clj
  • changing the fetcher.clj ns macro to (require ... :as) rather than (use ... :as) (not sure if that was a problem?)
  • changing the retrieve-feed fn so that gav/translate takes a :nspace like it does in reader.clj

However I'm not sure if this is really the solution, though I'd be happy to make a pull request if this looks right to you.

@ngrunwald
Copy link
Owner

yes, sorry about this, the gavagai API has been somewhat in flux lately as it is nearing it's first stable release and I have failed to keep the rome fetcher in sync. The commit 5c4ebfb should fix this. Actually, only your third modification was really necessary, it fits the new gavagai API where translation are namespace local. I have pushed a new snapshot to Clojars and I hope to get a stable 0.3 soon (as soon as I have a stable gavagai release really). Tell me if this fixes it for you!

@ghost
Copy link
Author

ghost commented Aug 17, 2012

Thanks for the prompt fix, pulled down the new snapshot and it works great. Also I like what you've done with clj-rome + gavagai, nice work.

@ghost ghost closed this as completed Aug 17, 2012
This issue was closed.
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

No branches or pull requests

1 participant