This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-10
Channels
- # admin-announcements (4)
- # aleph (1)
- # beginners (29)
- # boot (112)
- # braveandtrue (1)
- # cider (44)
- # cljs-site (1)
- # cljsjs (2)
- # cljsrn (1)
- # clojure (46)
- # clojure-gamedev (3)
- # clojure-germany (1)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojure-russia (20)
- # clojure-sg (2)
- # clojure-uk (14)
- # clojurescript (228)
- # cursive (41)
- # datascript (5)
- # datomic (17)
- # editors-rus (48)
- # emacs (3)
- # flambo (1)
- # hoplon (9)
- # jobs (2)
- # kekkonen (1)
- # lein-figwheel (1)
- # luminus (5)
- # mount (11)
- # nrepl (3)
- # off-topic (7)
- # om (12)
- # onyx (139)
- # other-languages (54)
- # planck (1)
- # proton (17)
- # re-frame (37)
- # remote-jobs (1)
- # rethinkdb (9)
- # ring (2)
- # ring-swagger (6)
- # test-check (1)
- # uncomplicate (8)
- # untangled (2)
Does anyone know of a clojure wrapper for Jedis?
or if Carmine will do the key lookup like Jedis will?
I’m trying to add custom format middleware for protobuf, but cannot make it work properly
Found this old issue: https://github.com/metosin/compojure-api/issues/61, but there are no hints
Anyone every compare images in clojure/java? Any suggestions?
Hey guys! I’m writing a report about Clojure at my alma mater. Does anyone know where I can get Rich’s paper „The Clojure Programming Language“ (proceedings of the 2008 symposium on dynamic languages)?
@currentoor I’ve been used for web scraping. I’ve used it with firefox driver and chrome driver.
You could try OpenCV, although I've never used its Java bindings http://docs.opencv.org/java/2.4.11/
Hi everyone.. I'm new to clojure and am in the learning stages. I encountered an error and am unsure how to solve it. In one project, I have a function where I'm invoking a command on a remote REPL. The command on the remote REPL returns a tagged object #object[com.example.namespace.DoubleEntity 0x5359c6c8 "{:mykey \"value\", :mykey2 \"value2\" }"]
.. But my function is returning the following error: RuntimeException No reader function for tag object clojure.lang.LispReader$CtorReader.readTagged (LispReader.java:1245)
. Any ideas how I can get my project's reader to properly read this object?
@bassam.khouri: the easiest is probably to change how the remote represents that object, you can implement print-method
for that type
(defmethod print-method com.example.namespace.DoubleEntity [v ^java.io.Writer w]
(.write w (str "(com.example.namespace.DoubleEntity. "
(prn (:mykey v))
" "
(prn (:mykey2 v))
")")))
I want an infinite sequence of integers starting at 1. Is there something more elegant than (map inc (range))
?
@plexus: Thanks for the suggestion.
@plexus: I looked into the print-method
and it doesn't appear that it will do the job. first, it only prints to the screen and may return nil
. Second, this will change the return for the entire remote function. The remote function resides in a library and it may cause more work than needed.
@bassam.khouri: you don't actually have to call print-method
, it's used internally by the REPL to represent an object as a string. Providing that defmethod
should be enough.
I did some tests on my local REPL
`user=> (deftype FOO [] ) user.FOO user=> (prn (FOO.)) #object[user.FOO 0x4540e5da "user.FOO@4540e5da"] user=> (defmethod print-method FOO [v ^java.io.Writer w] #_=> (.write w "<<-FOO->>")) #object[clojure.lang.MultiFn 0x4b7b90ce "clojure.lang.MultiFn@4b7b90ce"] user=> (prn (FOO.)) <<-FOO->> nil user=> (FOO.) <<-FOO->> user=> (FOO) RuntimeException Expecting var, but FOO is mapped to class user.FOO clojure.lang.Util.runtimeException (Util.java:221) `
If you can't add that defmethod
on the remote side then you'll have to do your own parsing. As far as I can tell the representation you get now is not valid EDN
the representation I'm getting is from the repl or something
`
user=> (deftype FOO [] )
user.FOO
user=> (prn (FOO.))
#object[user.FOO 0x4540e5da "user.FOO@4540e5da"]
that's without the print-method
my local repl is using Clojure 1.7.0
Yeah exactly, the Clojure reader won't be able to read that. Not everything can simply round trip like that
what's odd is the the remote server doesn't encounter that problem.
and the same tagged litteral is being used..
The "object" is defined in a clojure library
it does.. otherwise it would have been fixed
Is there a way to update the readers in my project?
Can I add custom litterals?
I have the project as a dependency.
how can I make my reader parse a deftype
defined in a library?