This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-24
Channels
- # beginners (13)
- # cider (1)
- # cljsrn (2)
- # clojars (5)
- # clojure (110)
- # clojure-czech (1)
- # clojure-dusseldorf (3)
- # clojure-japan (1)
- # clojure-spec (39)
- # clojurescript (13)
- # cloverage (2)
- # cursive (2)
- # defnpodcast (4)
- # lein-figwheel (7)
- # off-topic (1)
- # om (38)
- # om-next (4)
- # perun (1)
- # planck (3)
- # reactive (8)
- # rethinkdb (1)
- # ring-swagger (1)
- # specter (17)
- # vim (1)
- # yada (4)
How to poll all available messages from core.async channel? I need a vector with all the available messages. Needs to be non-blocking and return an empty vector if no messages are available...
You can use async/reduce with conj to conj into a collection
hmm, how to do get https requests in clojure?
I tried using clj-http but I get SSLException Received fatal alert: internal_error sun.security.ssl.Alerts.getSSLException (Alerts.java:208)
clj-http works fine for HTTPS. Start by connecting to other known-good HTTPS servers and make sure the client is working. Could be an incompatible server version/configuration. Debugging TLS errors can be challenging because so many things can go wrong. Turn on full debug, and try to narrow in on the specific error.
the most general thing for creating lazy seqs is lazy-seq
and recursion, and you might need that
I can't tell what you're trying to do exactly
I was looking at lazy-seq but what isn’t clear is how I’d advance the sequences (what is done with the recur step)
with lazy-seq
you use explicit recursion rather than recur
But what exactly do you want to be the input and output of your function? I don't really understand what you're trying to do here
right now i'm using 1.9-alpha but some of the libraries i use fail to pass some of the core specs
the inputs are N potentially very large sorted sequences and I want to produce the merged sorted sequence [[0 2 4 5 ] [ 1 3 5 7]] -> [0 1 2 3 4 5 5 7]
for instance https://github.com/LightTable/Clojure fails at lighttable.nrepl.handler
a lot of code exists out there that has been using "working" but not documented functionality. Strictly speaking, they shouldn't, but they are. This core spec stuff is revealing a lot of that.
Also keep in mind that for me this is also a learning exercise (ie: my clojure is bad) 🙂
here is what i did to solve it: come up with a function that maps each element in the sequence to a value
then map the sequence to a map that uses that value as a key, and the unmodified original value as the value
ultimately you are going to have to answer some basic questions about what you are doing, and be honest with yourself about the complexity that it implies
is it possible that the output somehow depends on the order of what i've been given?
could it be that the first value of the infinite sequence A and last of the infinite sequence B would influence the result C?
there are lots of problems which are basically what I’ve said. N way merge of sorted data which is too big to fit in memory being the most obvious one.
https://en.wikipedia.org/wiki/External_sorting <- for example.
in theory it shouldn’t be that hard.. you have lazy sequences of input and want to produce the output lazily where the data is pulled one element at a time.
suppose when you "run out" you start returning "nil" on the "out" key / value, or better yet just dissoc it
@mnewhook you don't need to worry about stack with lazy-seq
and recursion because lazy-seq
creates a thunk that defers execution
it is definitely possible to write this without having everything in memory
I doubt it
you can find those breakages before it's released though, by trying out alphas
you can make fork releases for unresponsive libraries
@mnewhook looks good; if you want to get fancy you could use a sorted-set-by
so you don't have to sort the seqs at each step
it’s a bit quiet in #clojure-spec — how do I print a spec? for example, I want to view: :clojure.core.specs/args+body
I mean more like this: https://github.com/clojure/clojure/blob/a1c3dafec01ab02fb10d91f98b9ffd3241e860c0/src/clj/clojure/core/specs.clj#L73
You don't need the get-spec in there afaik - just (s/describe :clojure.core.specs/args+body) should work?
Or s/form if you want something that should be able to be sent remotely
Can you do (pst *e) at the end?
Ah interesting. That's a regression from the namespace map literals
Any chance you could file a jira for it?
Yep -- will do. Anything else you need or is the information here sufficient?
That's enough
It's triggered by nrepl interestingly
I've created http://dev.clojure.org/jira/browse/CLJ-2027 -- appreciate the help!