This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-30
Channels
- # beginners (126)
- # boot (2)
- # cider (6)
- # cljs-dev (46)
- # cljsjs (8)
- # clojure (122)
- # clojure-greece (57)
- # clojure-italy (6)
- # clojure-poland (3)
- # clojure-russia (2)
- # clojure-serbia (5)
- # clojure-spec (26)
- # clojure-uk (99)
- # clojurescript (39)
- # cursive (15)
- # datascript (7)
- # datomic (21)
- # dirac (7)
- # duct (1)
- # emacs (19)
- # fulcro (58)
- # garden (4)
- # graphql (15)
- # hoplon (2)
- # immutant (1)
- # instaparse (3)
- # jobs (5)
- # juxt (15)
- # klipse (4)
- # leiningen (2)
- # lumo (52)
- # off-topic (8)
- # om (27)
- # onyx (22)
- # other-languages (3)
- # portkey (2)
- # protorepl (2)
- # re-frame (7)
- # reagent (7)
- # ring (11)
- # rum (7)
- # shadow-cljs (114)
- # spacemacs (20)
- # specter (16)
- # test-check (5)
- # timbre (1)
- # unrepl (43)
- # yada (17)
morning
So I finally booked my tickets to clojureX last night. Is anyone else here going?
@rickmoynihan pricey time to book
I’ve had a lot of problems and other things on my mind this year. Thankfully I can expense it.
I am going @rickmoynihan
Cool. I’ve not actually met many people AFK in the clojure community, so it’d be good to actually meet some of you
@rickmoynihan Should be fun.
@jasonbell: I hope so 🙂
Stupid lost voice
If anyone finds my vocal cords, can you please send them back my way
@yogidevbear Oh that’s no good, how are you going to heckle?
With sign language 🖕
Just kidding 🙂
I must be shouting at my son too much. He struggles with this concept of listening 😉
I would have liked to go to ClojureX but there's just too much other stuff I've had booked for a while for that week both in and outside work :-S
Hey @carr0t, yes… Thanks for doing the talk the other month btw… was sorry I couldn’t make it.
did you have a good turn out? I think Hakim said it went well.
yeah I know the feeling about being overbooked 🙂
Well that's relative. There were I think 4 other people apart from myself and Hakim, so not the best turnout we've had but not the worst either 😉 And when you say "I'm going to be talking about Clojure Macros! You don't need to know any Clojure first, honest" anyone who isn't interested in Clojure and doesn't know what macros are might just not feel like turning up anyway
And a few people who wanted to make it but couldn't. The guy who runs defshef was one of those, asked for the slides afterwards and wondered if I'd like to go over and do it for them sometime next year too
haha yeah… it kinda goes with lambda lounges territory… Our niche is in running a regular meetup on niche topics that don’t get an audience elsewhere…. so we don’t measure our success on turn out 🙂
Incidentally I owe you a lambda lounge sticker… I try to give them to everyone who does a talk, but I often forget…
@carr0t do you still have slides/video about your talk on clojure macros? I would be interested in seeing / reading them
Video, no. Slides, yes. I'm not sure how useful they'd be without the talk though. A lot of it was code on screen that I then talked about, without much on the screen to reiterate what I was saying. I was aiming to avoid text overload 😉
I'll hunt them down if you're still interested. Might add some notes so it's more understandable what I was going for 😉
Afternoon. I have a ticket to Clojure eXchange next week but can't make it any more 😞. Assuming it's ok to transfer the ticket somehow (I haven't checked) does anyone want it or know someone who wants to go?
thanks @dominicm. it's short notice so I'm amenable to offers or just giving it away!
@jamesalmond to transfer a ClojureX ticket can just email SkillsMatter ( info at skillsmatter dot com ) with your name and the persons name & email you are transferring the ticket too. You may want to send a message about the ticket on offer to https://groups.google.com/forum/#!forum/london-clojurians as they get snapped up pretty quick
aha! thanks @jr0cket. I'll add a message there.
Sorry you cant make it, hope to see you at the next one.
has anyone seen this before:
Error updating class definitions:
NullPointerException java.util.concurrent.ConcurrentHashMap.get (ConcurrentHashMap.java:936)
I sometimes get them at the REPL
I do not.
That gets printed, and *e
is nil
I guess it’s from some other thread - is there a cunning way to obtain such exceptions?
This is just clutching at straws, but i remember a (i think) stuart sierra blogpost about having a global exception handler
yes maybe - It’s worth a try, as I have the code to hand
So at a minimum, I recommend always including this snippet of code somewhere in the start-up procedure of your application:
yes - I have it in my production code
but it’s not always loaded in my REPL
thanks though!
Seriously?! I just walked into the same glass sliding door again!
There was a monk at my school (it was not a normal school) who once walked through one of those full height glass panels. He just went straight through it. He was rather shocked afterwards but I don’t think he was badly hurt. I think it used to happen quite a lot, but now they tend to print some kind of pattern on the glass to help people notice them.
I've never done this type of stuff before. Clearly... The glass has been cleaned too well 😆
has anyone had a go at lines-reducible in this? https://tech.grammarly.com/blog/building-etl-pipelines-with-clojure
or worked with reducible-stream https://github.com/pjstadig/reducible-stream
@otfrom I wouldn't use that lines-reducible
, it's wrong with regards to reduced
handling
@ghadi has these two awesome functions https://gist.github.com/ghadishayban/902373e247e920855139902912d237f0 , they've been sufficient to me when I've wanted to produce custom reducibles
So, I've seen people use lazy seqs to do CLJ-1906. I suspect that's wrong, but haven't been able to formulate why.
;; Shamelessly stolen from
(defn baldr-reducible [^InputStream is]
(reify clojure.lang.IReduceInit
(reduce [this f init]
(try
(loop [state init]
(if (reduced? state)
@state
(if-let [record (baldr/read-record is)]
(recur (f state record))
state)))
(finally (.close is))))))
as opposed to ghadi's supply
which allows you to control when and how your resource is closed
not very different from baldr-reducible
if I (.close is)
anytime below after the call. I do like more supply
tho, just don't see a big difference
if you've ever used clojure.java.jdbc
I'm sure it's happened at least once that you got resultset closed
while trying to consume a query result set
there's your perfect example of why resoure management using lazy seqs is easy to get wrong
@dominicm: as someone who’s done it (and regretted it)… the difficulties are mainly around the resource lifetime being different from the sequences lifetime.
lazy sequences escape contexts (it’s what we like about them) but when tying them to stateful things you need to control the underlying resource/socket etc, and that control can’t flow through your program to whichever callsite is responsible for actually consuming the sequence, as the sequence abstraction has no mechanism for controlling resources. Also handling errors can be awkward.
if you are talking of network or other slow resources then manifold/stream makes resource control easy with its on-closed
and on-drained
callbacks. probably not so great for tight compute-bound loops though
This reminds me I really need to return to my (trans|re)ducible-io side project…
@rickmoynihan I'd love some of that. 🙂
@otfrom: same… can’t recall quite how far I got… I can’t be sure without checking again but IIRC it didn’t have the issue @bronsa highlighted with reducible-lines… but doubtless has lots of others 😉
at the bottom there were basically reducers which were essentially just loop
/`recur`s on bytebuffers/arrays etc then you’d stack more reducers on top…
Will need to tidy it up a bit and get it on github for validation. I’m sure @bronsa would pick some holes in it 🙂
I was tinkering with the following. Can it be any useful? Assuming I understand what you want to achieve, @otfrom, it should be possible to formulate a baldr-seq like a line-seq.
(import '[ BufferedReader StringReader])
(def br (BufferedReader. (StringReader. s)))
(def s "hey\nyou\nhow are you\nSunny\ntoday")
(let [br (BufferedReader. (StringReader. s))
lines (line-seq br)]
(transduce
(comp
(remove empty?)
(mapcat #(clojure.string/split % #"\s+")))
(completing
#(assoc! %1 %2 (inc (get %1 %2 0)))
#(do (.close br) (persistent! %)))
(transient {})
lines))