This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-04
Channels
- # beginners (90)
- # boot (5)
- # cider (89)
- # cljsrn (27)
- # clojure (33)
- # clojure-dev (2)
- # clojure-italy (3)
- # clojure-spec (35)
- # clojure-uk (17)
- # clojurescript (93)
- # code-reviews (1)
- # datascript (2)
- # datomic (14)
- # defnpodcast (6)
- # emacs (11)
- # figwheel (8)
- # figwheel-main (6)
- # hyperfiddle (14)
- # jobs-rus (1)
- # nrepl (3)
- # off-topic (13)
- # onyx (6)
- # reagent (6)
- # reitit (4)
- # shadow-cljs (110)
- # spacemacs (1)
- # tools-deps (10)
- # vim (17)
I've been working on a project called eden, and I need to provide better error-messages. Typically when you provide an error message, you also provide a line number where the error occured, etc.
Only problem is, the edn parser doesn't seem to have facilities for tagging lines numbers from the output
So a good project would be to extend tools.reader.edn to allow you to read in an edn string, but return it in a form that includes this information
I'm not 100% sure what the scope of this project is, it might be useful to make an EDN linter first
Something like this: https://gist.github.com/benzap/fb4e977de36ff8fe2f6530d67af44dfc
i dont know of any ordering guarentees on persistent maps, so it probably cant be done in post
yeah, I definitely can't be done in post, unless the tools.reader already includes that information
Is there's a way to read-line
for password in command line with Clojure?
@ampersanda looks like you can use System/console https://groups.google.com/forum/m/#!topic/clojure/r77ydJ0tnLI
@scriptor: I tried using it, but it always return JavaNullPointer
Is there a way to place a primitive return type on a protocol function? This doesn't work:
(defprotocol Tp
(get-x ^long [this]))
(defrecord T1 [x]
Tp
(get-x [this] x))
hey guys, im running into a weird issue with a future in a unit test. I'm making doing this (roughly)
(let [fx (future (myfunc some params))
ms (t/in-millis (t/interval (t/now) deadline))]
(deref fx ms (timeout fx req)))
for the unit test I have deadline
set to 10 minutes in the future (so it's roughly 600000 ms, and I've confirmed that). However deref is almost immediately timing out and calling the timeout function. The future is not realized at this point (checked via realized?
). Anyone have any thoughts on why deref might not be blocking / is waking up too early?hm, it doesnt look like timeout-val should be getting evaluated before timing out: https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/core.clj#L2290
ok well using a token like :timeout and then checking for that token afterward seems to work ok....i dunno.
should probably be documented if it's evaluating the timeout value up front, that seems unexpected.
i figured out what i screwed up...disregard all this, the world is ok still (other than my ego)
@jgh I guess you already realized that deref, being a Clojure function, eagerly evaluates all of its arguments before the function is called? If you want your expression (timeout fx req)
only to be evaluated after the deref timeout has expired, you could perhaps wrap it in a (delay ...)
form, for example, which would then require forcing it after deref returns, if deref returned the timeout value.
why doesn’t this work?
(doto (make-array SignalServiceUrl 1)
(.push (SignalServiceUrl. ""
trust-store)))
I get
No matching method found: push for class
[Lorg.whispersystems.signalservice.internal.configuration.SignalServiceUrl;
The [L
before org.
etc. is a way that the JVM uses to indicate that it is an array where the elements are of the type after the [L
Example: `user=> (type (make-array Object 1)) [Ljava.lang.Object;`