This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-12
Channels
- # beginners (34)
- # boot (210)
- # cider (16)
- # cljs-dev (65)
- # cljsrn (3)
- # clojars (2)
- # clojure (107)
- # clojure-austin (8)
- # clojure-berlin (10)
- # clojure-brasil (1)
- # clojure-canada (1)
- # clojure-dev (1)
- # clojure-fr (1)
- # clojure-italy (22)
- # clojure-new-zealand (12)
- # clojure-nl (28)
- # clojure-russia (13)
- # clojure-spec (25)
- # clojure-uk (10)
- # clojurescript (109)
- # cursive (18)
- # datomic (44)
- # defnpodcast (1)
- # dirac (4)
- # emacs (2)
- # funcool (1)
- # hoplon (16)
- # jobs (14)
- # lambdaisland (23)
- # leiningen (2)
- # luminus (3)
- # off-topic (7)
- # om (58)
- # onyx (16)
- # proton (6)
- # re-frame (42)
- # reagent (55)
- # ring-swagger (5)
- # untangled (47)
- # vim (9)
Some feedback on this library would be nice if you could spare it 🙂 https://github.com/escherize/tracks
@escherize That looks really cool, kind of like suggest.el but instead of finding an appropriate function, just creates it for you. No technical feedback yet, but I’ll definitely check it out!
what am i doing
I love the idea @escherize but I don't even understand the 2nd example: you def must-go-deeper but then seem to call deep-ways -- ???
hello guys, need community help ^^
I am new to Clojure and I read Clojure For The Brave And True, I can't understand well core.async
; anyone has been through that and tell me where to go to find out more ?
@baptiste-from-paris I recommend @dnolen’s webinar
ok thanks a lot
clojure or clojurescript specific ?
or both ?
Ok thanks @borkdude 🙂
@baptiste-from-paris After that, Tim Baldridge also does presentations on it, with more focus on internals
great ! tx a lot !
love clojure but there are so many things to learn compared to classical OOP
Clojure Applied has a lot of coverage of core.async
speaking of core.async, is there a way to print out the name of the current thread? I'm trying to get past the major problem point in async which is the "exception occurred in async-dispatch-thread-n" problem, where your program execution gets squirelled away beyond where your debugger can go.
I want to be able to print the name of the current thread "async-dispatch-4" for example
so that i can at least see, once the exception raises, if it was spawned by the thread I think it was spawned by
why does clojure.edn/read-string include an :eof option and can I have an example of it’s usage + output?
@idiomancy (.getName (Thread/currentThread))
I also have some code doing stuff like
`(defn set-thread-name!
"Set the name of the current thread to n
"
[n]
(-> (Thread/currentThread)
(.setName n)))`
@tomjkidd - late to the party, but i found bhauman’s http://rigsomelight.com/2013/07/18/clojurescript-core-async-todos.html extremely helpful when i was trying to understand core.async
@alexmiller ok, thx, will buy that one then
@borkdude that's used to define a custom sentinel indicating eof
Usually before calling the reader you create the sentinel, like (Object.)
Ah, so the only useful case of that would be when reading an empty string?
(let [o (Object.)]
(= o (edn/read-string {:eof o} ""))) ;;=> true
Is there a way to compose a set of core.match "matchers" from disperate matching exprs? Similar to how in compojure you can build up a routing table by composing several routes def'd with defroutes?
ex: (match [x y] matchers1 matchers2 matchers3 ..)
where matchersX
might be something that returned [true false] (fn ...) [false false] (fn ..)
Why is it that boolean?
isn’t mentioned http://clojure.github.io/clojure/ or http://clojure.org/api/cheatsheet ?
I actually first noticed its existence (s/def :dog/tail? boolean?)
in http://clojure.org/guides/spec
@samedhi Look at the 1.9 docs http://clojure.github.io/clojure/branch-master/index.html
The link you gave is the 1.8 docs.
Managing CAs is neither easy nor simple?
so I wish my problem would be as complex as managing a CA and distributing trusted certs 😉
do you guys know whether or not httpkit's asynchronous callbacks run in a different thread?
@borkdude well the other flag that is relevant is whether to throw on eof - if you want to avoid throwing then you need to receive some value indicating eof, and you want that to be distinguishable from any other value you might have read that was in the data. So passing the sentinenal EOF (made by you) is how that’s done.
@bcbradley no they don't last time I checked, and it's one of the reasons I somewhat dislike http-kit. Not enough documentation/thought put into the async model. For example websocket sends in http-kit are blocking with no option to do async sends.
do you have a suggestion for a good lightweight high throughput http library for clojure?
Why yes I do 😉
Oh a HTTP client library, sorry that wasn't clear.
basically i'm trying to make a library for interfacing with the discord api in clojure
i'm hiding the server behind an async chan so i can control how many requests are issued per second
hi if I have a simple question regarding aero is this the right place to ask ? apologies if not. I am new to the community but loving clojure.
@bcbradley I've used the Apache HTTP Async library on more than one occasion. It's fairly light and quite easy to implement: http://hc.apache.org/httpcomponents-client-ga/httpclient/examples/org/apache/http/examples/client/ClientWithResponseHandler.java
So if we back up to http-kit though (as it's probably simpler) I would suggest just putting the data into a channel with a large buffer
I've used the apache library with Clojure before, you just pull in 2 java classes, then use reify to extend a single interface, but I understand interop can be tricky.
But if you have http-kit dump into a channel with a large buffer you can pull from that channel in a different thread and do your processing
understandable
yeah that's one way to do it. If you have processing steps that fit in common clojure functions you can also look at async/pipeline-blocking : https://clojure.github.io/core.async/#clojure.core.async/pipeline. This allows you to do something like (async/pipeline-blocking 4 to (map inc) from)
^^ that will increment all the values taken from from
put them in to
and use 4 threads to do the processing.
Sure, then just use a loop to take from the channel, inside async/thread and take with async/<!!
Any suggestions for helping fund clojure open source software?
@flyboarder - @ambrosebs likely has some relevant thoughts on the topic (see eg http://frenchy64.github.io/2016/08/15/infer-functions.html )
hey guys, I’m confused about protocols within clojurescript vs clojure. If I wanted to extend-type String
in java it would be java.lang.String
, but in cljs is js/String
the “right” way to handle this?
thanks @kenny . is there somewhere I can find the type definitions? for example if I wanted to do the same to map
, it surely cannot be map (a function).
i've tried peeking at the source many a time, but it’s still pretty foreign to me, what with my unfamiliarity with records, deftype, and the other few ‘more advanced’ language features
(def a {})
(def b [])
;; compiles to
cljs.user.a = cljs.core.PersistentArrayMap.EMPTY;
cljs.user.b = cljs.core.PersistentVector.EMPTY;
@lwhorton @kenny when you construct a map it is created as either an ArrayMap or a HashMap depending on the size
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentArrayMap.java#L33
Rut roh. Does that mean I have to extend-type of both to guarantee no problems? or is there something more clever?
seems like it does https://github.com/clojure/clojurescript/blob/ab7a4911f1fd3a81210b1a9f2d84857748f8268b/src/main/clojure/cljs/closure.clj#L359