#clojure log - Aug 12 2014

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:22 blur3d: I’m trying to add cljx to an existing clojure project that uses core async. It’s almost ready, but I am not sure what to do about the use of alts!! <!! >!! - since core.async doesn’t seem to support them in cljs

0:24 puredanger: you can't use those in cljs - they require real threads

0:25 blur3d: will using <! >! alt! likely be a problem?

0:25 or is their an expected alternative

0:25 puredanger: no, those are fine. you need to do all of your channel ops like <! >! alt! in go blocks and interface with any callback stuff on the edges with take! and put!

0:26 blur3d: puredanger: ok, thanks

2:09 TEttinger2: I'm guessing amalloy and Raynes are asleep, but does anyone know if lazybot does some redirect of *out* to a place other than the shell? I can't see why a println in a hook on message fails to print

2:09 amalloy: asleep!? it's only 11 here on the west coast

2:10 TEttinger2: https://gist.github.com/anonymous/e0198ca2826a321dfb88#file-title-clj-L79 this line never gets executed

2:10 amalloy: and, i dunno, lazybot's logging is really terrible

2:10 TEttinger2: oh I thought you were east coast

2:10 amalloy: it's probably in a future, whose *out* is not bound to anything interesting

2:11 TEttinger2: how can I reliably log something?

2:11 Raynes: amalloy: uh

2:11 TEttinger2: (in a lazybot hook)

2:11 Raynes: amalloy: Its logging isn't that bad.

2:11 TEttinger2: hey the lazygang's all ere

2:12 Raynes: TEttinger2: When you run it it should be printing to *out* by default.

2:12 How are you running the bot?

2:12 TEttinger2: strange...

2:12 java -jar lazybot.jar

2:12 no --logpath

2:12 i had that earlier but stopped using it

2:13 Raynes: If you pass --logpath does it write to file as intended?

2:13 TEttinger2: not that I could see

2:13 let me try

2:13 Raynes: Also, what sha is your checkout of lazybot?

2:14 TEttinger2: haha uh... it's old with new stuff pasted in when something breaks

2:14 it has 84 weeks of history stored

2:14 and the bot itself predates that

2:15 Raynes: TEttinger2: Wait, is there no printing whatsoever, or only just that line above?

2:15 I didn't read hard enough.

2:15 TEttinger2: ugh I'm a moron

2:15 I wasn't building the jar

2:16 i am used to lein run

2:16 Raynes: ?

2:16 TEttinger2: java -jar lazybot.jar ;; but lazybot.jar was old

2:16 Raynes: Oh.

2:16 I think lein run should also work.

2:16 If not, it shouldn't be much work to make it work.

2:17 The jar's -main is run.clj

2:17 TEttinger2: well a new uberjar appears to have fixed it

2:17 Raynes: Because derp when I was 16 and I can't be arsed to change filenames to conventional stuff.

2:17 TEttinger2: thanks for tolerating my stupidity :)

2:17 Raynes: No worries <3

2:18 TEttinger2: this was a crazy bug stemming from http youtube links redirecting to https ones. my fix works now but it wasn't running it before

2:46 supreme__: best book to learn clojure?

2:46 is the joy of clojure good? I like fogus

2:51 jakesendar: Curious if anybody's had issues targeting node on recent cljs releases... evaluating js/require throws a "is not ISeqable" exception every time. Any help would be greatly appreciated.

2:51 michaelr: hello

3:08 ucb: supreme__: joy of clojure is a great book if you ask me. Programming Clojure is also good (those are the two books I read so I can't comment on any of the many others)

3:09 supreme__: it really depends on your background though, programming Clojure is better suited as an entry book, while the joy of Clojure is better when you have at least a grasp of Clojure already

3:45 wink: you can read Joy of Clojure even if you just fiddled around for a few hours

3:46 but you should do some more work then and reread it

3:47 clgv: wink: JoC as recommendation for a beginner?

3:51 wink: clgv: worked for me

3:51 rolfb: the infix explaination in the beginning isn't very interesting imho :P

3:51 wink: clgv: maybe it's not the *best* way, but I wouldn't say it totally advanced.

3:51 clgv: wink: yeah it mi9ght work, but with high probability it will confuse ;) I'd recommend "Programming Clojure" or "Clojure Programming" as first and JoC as second book

3:52 rolfb: I would recommend starting with Clojure Inside Out videos and then moving to the book

3:52 * wink just played around with noir, then bought only one book

3:52 clgv: yeah well we had the first book at our department and I only bought JoC ;)

3:52 wink: and I am re-re-reading it after a year just this week :P

3:53 still stuff in there I missed

3:54 clgv: how was that code search engine called? I remember there was a popular one a couple of years ago

3:55 wink: koders?

3:55 clgv: sounds familiar

3:55 wink: google code was the popular one

3:56 ;)

3:56 clgv: oh it got superseeded by ohloh code

4:38 bajabongo: hello,

4:38 does anybody know, why is it impossible to add metadata to a string?

4:38 gist related: https://gist.github.com/anonymous/962275ab342c4831b70b

4:39 TEttinger: bajabongo, I think because it's a java object and doesn't extend IMeta

4:40 basically clojure has to deal with what it's been given by java...

4:40 lvh: bajabongo: yeah, metadata is attached to the object not to the name/var

4:40 bajabongo: TEttinger, ok, so I suppose it's just impossible to add meta to the string?

4:40 lvh: bajabongo: afaik yes

4:41 TEttinger: you could get by with wrapping it

4:41 ,(meta ^{:sample-key "sample data"} ["string"])

4:41 clojurebot: {:sample-key "sample data"}

4:41 bajabongo: TEttinger: yeah, I noticed that when I make, ex. a vector ["string"], it works

4:41 exactly

4:42 TEttinger: yeah, the strings can come from java code (and usually do at some point), so they could not be guaranteed to be whatever custom string clojure could have tried to implement

4:43 bajabongo: TEttinger: lvh: ok, thanks guys

4:43 TEttinger: np

4:44 bajabongo, oh and also: java strings are implemented very oddly compared to normal classes for efficiency

4:44 (within java 7 and java 8 it's different)

4:44 so if clojure made its own it wouldn't probably perform as well

4:44 bajabongo: TEttinger: as far as I know the're immutable, aren't they?

4:45 TEttinger: right, and they convert silently between different internal representations

4:45 one for large strings, one for small, pretty much

4:45 bajabongo: TEttinger: has that anything related with unicode?

4:45 TEttinger: externally they're the same except for performance

4:46 possibly, java has very good unicode support

4:47 being able to do stuff like ##(re-find "...stuff" #"\pl+")

4:47 bajabongo: interesting, although I'm just a novice at Clojure and, actually, I'm learning it towards ClojureScript,

4:47 TEttinger: ,(re-find "...stuff" #"\pl+")

4:47 clojurebot: #<SecurityException java.lang.SecurityException: denied>

4:47 TEttinger: what

4:47 bajabongo: but it's always better to know more than less :)

4:48 TEttinger: ,(re-find "...stuff" #"\p{Letter}+")

4:48 clojurebot: #<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class java.util.regex.PatternSyntaxException>

4:48 TEttinger: uhhh

4:48 ,(re-find "...stuff" #"\p{L}+")

4:48 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>

4:48 TEttinger: ,(re-find #"\p{L}+" "...stuff")

4:48 clojurebot: "stuff"

4:49 TEttinger: that uses unicode, and is a bit slower than some other regex operations

4:51 bajabongo: TEttinger: with regards to strings in java, maybe difference in internal structure comes from different data structure used (i.e. plain array for short strings, [rope](http://en.wikipedia.org/wiki/Rope_(data_structure) for long ones)

4:52 but ofc I just wonder, I don't actually know

4:52 TEttinger: yeah, there's some stuff that I've seen profiling that's definitely some kind of long string representation (actually it was used for a char array)

4:52 CharBuffer or something in a sun package instead of a java one

5:38 TEttinger2: Raynes: privmsg ok? there's an issue with clojail

5:58 sm0ke: hello all

5:59 i am facing a problem w.r.t to core.async channels not getting gc'ed

6:00 https://www.refheap.com/89131

6:00 since the reference to (chan) is no longer ,...it should ideally get closed automatically?

6:03 any comments?

6:09 i guess finalize does not provide guarantees

6:11 stain_: sm0ke: GC won't run unless you are running short of memory

6:11 with-open would normally work for closing.. but I am not sure if it works on async channels

6:12 sm0ke: doesnt apply to my example...it has to be managed

6:13 which is a pain

7:15 supreme__: ucb: a little bit late on your answer but thanks! I haven't looked that much on clojure, but looked into a few koans etc and I "understand" the code. Know alot of other programming languages so bought Joy of Clojure :)

7:17 ucb: supreme__: cool!

8:22 sveri1: Hi, I am using sente for websockets, now, when I open a socket from client to server with: sente/make-channel-socket! I would like to pass in additional information like a client id. Is that possible? Or should this be done after the connection is established?

8:42 Kneiva: ,(def my-map {{:x "foo" :y "bar"} {'a 1 'b 2} {:x "baz" :y "qux"} {'a 2 'b 3}})

8:42 clojurebot: #'sandbox/my-map

8:42 Kneiva: ,(apply hash-map (apply concat (map (fn [[k v]] [k (update-in v ['a] (partial + 100))]) my-map)))

8:42 clojurebot: {{:y "qux", :x "baz"} {a 102, b 3}, {:y "bar", :x "foo"} {a 101, b 2}}

8:43 Kneiva: is there a better way to update a value in all values?

8:48 dnolen_: ,(into {} (map (fn [[k v]] [k (update-in v ['a] #(+ % 100))]) my-map))

8:48 clojurebot: {{:y "qux", :x "baz"} {a 102, b 3}, {:y "bar", :x "foo"} {a 101, b 2}}

8:48 TEttinger: (inc dnolen_)

8:48 lazybot: ⇒ 4

8:48 TEttinger: (inc dnolen)

8:48 lazybot: ⇒ 15

8:48 TEttinger: that seems low, aren't you a primary author of cljs?

8:49 dnolen_: Kneiva: I would probably write it like ^, easy to make a helper fn out of that

8:49 TEttinger: $karma TEttinger

8:49 lazybot: TEttinger has karma 20.

8:49 TEttinger: how did that happen...

8:52 Kneiva: dnolen_: thanks

8:52 CookedGryphon: Hey everyone. So I have a pattern of building up sets/lists conditionally that seems to pop up everywhere

8:52 and I end up doing something like (set (concat (when blah [:this :that]) (when foo [:thing]) ...)

8:53 because concat discards the nil as desired

8:53 is there any way I could build up similarly, without having to make single element lists?

8:54 llasram: CookedGryphon: (cond-> #{} foo (conj :foo), bar (into [:bar :baz]))

8:54 clojurebot: Titim gan éirí ort.

8:54 TEttinger: woah, llasram, never seen cond-> before

8:54 CookedGryphon: yeah, that works for some of my cases

8:55 llasram: TEttinger: added in 1.5

8:55 TEttinger: that explains it, my lazybot is still on an old version

9:03 clgv: &(clojure-version)

9:03 lazybot: ⇒ "1.4.0"

9:03 clgv: ,(clojure-version)

9:03 clojurebot: "1.7.0-master-SNAPSHOT"

9:04 lvh: ooh, shiny.

9:07 pcn: Woo

9:09 clgv: ,(sequence (map inc) (range 5))

9:09 clojurebot: (1 2 3 4 5)

9:20 qswz: Hi people, can I ask which IDE you use?

9:22 clgv: qswz: Eclipse with Counterclockwise

9:22 qswz: clgv: thanks, and what is the library manager for Clojure, maven?

9:22 clgv: (the non-representative regarding the majority is mentioned first :P)

9:22 qswz: you use leiningen, which is integrated with counterclockwise

9:23 qswz: ok

9:23 clgv: qswz: the majority uses emacs and (probably) cider (by now)

9:23 qswz: emacs, hmm not yet for me

9:24 clgv: there is also intellij with cursive

9:24 or vim-fireplace

9:26 qswz: cursice is commercial, but I've found "La Clojure"

9:28 puredanger: la clojure has not been updated in years; you should use Cursive

9:28 qswz: ok, I'll start Eclipse I guess, thanks puredanger

9:29 puredanger: you might also be interested in simpler environments like nightcode or light table

9:29 both written in clojure

9:29 qswz: simple IDEs ok

9:30 puredanger: both have repls and leiningen integration

9:30 qswz: I'll be tryong counterclockwise first thanks

9:41 TEttinger: qswz, yeah I have had really good luck with nightcode. it has a lot of handy stuff right there in the window

9:41 qswz: ok

9:42 TEttinger: that said, clojure doesn't strictly need an IDE, I develop from time to time in jEdit

9:42 puredanger: some people like sublime as a simple editor, haven't tried it myself

9:42 TEttinger: hell, I do enough in messages to bots...

9:42 qswz: TEttinger: what library manager is there?

9:42 TEttinger: qswz, leiningen

9:42 ##(clojure.string/join " "(repeatedly 998(fn[](apply str(concat(rand-nth[[(rand-nth["B""D""G""C""F""T""K"])(rand-nth["r"""""""""])][(rand-nth["S""L""Th""Ch""Sh""L""Y""W""Z""V""M""N""T"])]])(take(+ 2 (rand-int 3))(interleave(repeatedly #(rand-nth ["a""o""e""i""u""a""o""e""i""au""oi""ou""oo""ai""ee"]))(repeatedly #(rand-nth ["s""p""t""n""m""b""mb""rd""g""st""f""rt""sp""ch""rl""x""sh""y""ng"])))))))))

9:42 lazybot: ⇒ "Lagob Loy Sourt Werlois Brete Langoi Dausoif Yiyi Kembi Yoibee Coordug Fotoi Leert Chemou Meen Zauspoo Daimoisp Shotoost Laime Yofou Femb Shoimos Soub Soirdo Tin Mif Taushat Boitoix Chax Sog Shoortee Mootee Doub Krif Cret Zeesau Vopaust Krurtix Teespoich Voufou Yimo... https://www.refheap.com/89143

9:42 qswz: ok

9:43 ##(+ 1 2)

9:43 lazybot: ⇒ 3

9:43 TEttinger: I typed that up without an IDE, then shortened it to that unreadable form

9:43 the shortening only really needed paren matching

9:43 qswz: ##(reverse "foo")

9:43 lazybot: ⇒ (\o \o \f)

9:44 qswz: ##(join (reverse "foo"))

9:44 lazybot: java.lang.RuntimeException: Unable to resolve symbol: join in this context

9:44 TEttinger: there's two bots here, lazybot uses ## or & to eval code, and clojurebot uses a message starting with ,

9:44 ,(apply str (reverse "foo"))

9:44 clojurebot: "oof"

9:44 qswz: ##(join "" (reverse "foo"))

9:44 lazybot: java.lang.RuntimeException: Unable to resolve symbol: join in this context

9:44 qswz: oh

9:45 ,(apply sum [1 2])

9:45 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: sum in this context, compiling:(NO_SOURCE_PATH:0:0)>

9:45 TEttinger: there's also clojure.string/join, which calls join in an optional lib called clojure.string

9:45 qswz: ,(sum [1 2])

9:45 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: sum in this context, compiling:(NO_SOURCE_PATH:0:0)>

9:45 TEttinger: ,(applu + [1 2 3])

9:45 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: applu in this context, compiling:(NO_SOURCE_PATH:0:0)>

9:45 TEttinger: ,(apply + [1 2 3])

9:45 clojurebot: 6

9:45 rberthel: ##(clojure.string/join "" (reverse "foo"))

9:45 lazybot: ⇒ "oof"

9:45 qswz: yep

9:45 TEttinger: ,(+ 1 2 3)

9:45 clojurebot: 6

9:45 TEttinger: ,(/ 1 2 3)

9:45 clojurebot: 1/6

9:46 TEttinger: these bots are handy, but you can also privmsg them to avoid flooding the channel

9:46 qswz: ,(apply (/ 2.) [1 2 3])

9:46 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Double cannot be cast to clojure.lang.IFn>

9:46 TEttinger: as in /msg clojurebot ,(apply (partial / 2.) [1 2 3])

9:47 qswz: ok for privatemsg I know how spammy it is sorry

9:47 TEttinger: it's fine

9:47 we can see your process here :)

9:47 but if there's an existing conversation, you can use privmsg to not interrupt it

9:47 qswz: How could you apply 5 times / 2 to 8 for example

9:48 TEttinger: uh, can you write that out like a formula?

9:48 5 * 2 + 8 ?

9:48 not sure what you mean

9:48 qswz: TEttinger: I want 8 4 2 1 .5 as the result

9:48 I mean 4 2 1 .5 .25

9:48 TEttinger: oh gotcha

9:49 ,(map (fn [num] (/ 4 num)) (range 1 6))

9:49 clojurebot: (4 2 4/3 1 4/5)

9:50 TEttinger: err, that won't work

9:50 oh I get it

9:50 qswz: TEttinger: I see, it(s even better what you did

9:50 the exponential way

9:51 ,(map (fn [num] (/ 4.0 num)) (range 1 6))

9:51 clojurebot: (4.0 2.0 1.3333333333333333 1.0 0.8)

9:51 TEttinger: ,(reductions (fn [start num] (/ start num)) 4 (repeat 5 2))

9:51 clojurebot: (4 2 1 1/2 1/4 ...)

9:51 TEttinger: err

9:51 ##(reductions (fn [start num] (/ start num)) 4 (repeat 5 2))

9:51 lazybot: ⇒ (4 2 1 1/2 1/4 1/8)

9:51 TEttinger: reductions also includes the un-applied starting value

9:51 qswz: ,(range 1 6)

9:51 clojurebot: (1 2 3 4 5)

9:52 TEttinger: non-inclusive end, like java

9:52 qswz: ,[1 2 3 4 5]

9:52 clojurebot: [1 2 3 4 5]

9:52 TEttinger: reductions is an interesting function

9:52 qswz: like reduce of map/reduce?

9:52 TEttinger: but to understand it you should learn reduce first

9:52 yep

9:52 qswz: ok

9:52 TEttinger: ,(reduce + [1 2 3])

9:52 clojurebot: 6

9:53 qswz: TEttinger: What's the difference between (1 2) and [1 2]

9:53 joegallo: TEttinger: i'm really happy for you, and immma let you finish, but juxt is one of the most interesting functions OF ALL TIME

9:53 TEttinger: simple, right? same as apply + here

9:53 joegallo: :D

9:53 TEttinger: joegallo, haha

9:53 clgv: ,(require '[clojure.string :as str])

9:53 clojurebot: nil

9:53 TEttinger: qw, so ()

9:53 clgv: (str/join "" (reverse "foo"))

9:53 ,(str/join "" (reverse "foo"))

9:53 clojurebot: "oof"

9:54 clgv: qswz: ^^

9:54 TEttinger: qswz so (1 2) actually won't work as is. if you try it, ##(1 2) it's an error

9:54 lazybot: java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn

9:54 TEttinger: ,'(1 2)

9:54 clojurebot: (1 2)

9:54 TEttinger: is a quoted list

9:54 but (1 2) tries to call 1 as a function, hence that error

9:54 qswz: ,(str/split "," "ok,I,see")

9:54 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: str, compiling:(NO_SOURCE_PATH:0:0)>

9:55 TEttinger: yeah after 5 min it gets forgotten by the bot

9:55 to avoid lengthy breaking

9:55 ,(require '[clojure.string :as str])

9:55 clojurebot: nil

9:55 TEttinger: ,(str/split "," "ok,I,see")

9:55 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>

9:55 TEttinger: ,(str/split #"," "ok,I,see")

9:55 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>

9:55 TEttinger: ,(str/split "ok,I,see" #",")

9:56 clojurebot: ["ok" "I" "see"]

9:56 TEttinger: sorry I always forget the args

9:56 for that case, there's

9:56 ,(doc str/split)

9:56 clojurebot: "([s re] [s re limit]); Splits string on a regular expression. Optional argument limit is the maximum number of splits. Not lazy. Returns vector of the splits."

9:56 qswz: ,(str/split "ok,I,see" ""\d+")

9:56 clojurebot: #<RuntimeException java.lang.RuntimeException: Unsupported character: \d+>

9:56 qswz: ,(str/split "ok,I,see" #"\d+")

9:56 clojurebot: ["ok,I,see"]

9:56 TEttinger: yep, no numbers there

9:56 qswz: ,(str/split "ok,I,see" #"\w+")

9:56 clojurebot: ["" "," ","]

9:57 TEttinger: there you go

9:57 qswz: ,(str/split "ok,I,see" #"\W+")

9:57 clojurebot: ["ok" "I" "see"]

9:57 TEttinger: next steps to learn clojure are probably 4clojure for you

9:57 you seem to be getting this stuff quickly

9:57 qswz: yep I did some erland and a bit of haskell before

9:58 erlang*

9:58 TEttinger: that explains it, also says you certainly ain't slow if you can use those :)

9:58 qswz: I'll try to port my project in clojure to test it

9:59 TEttinger: people coming from java have a harder time than haskell/erlang I think

9:59 qswz: possible yes

9:59 TEttinger: but they are less surprised by JVM stacktraces from errors :)

10:00 qswz: http://www.4clojure.com/ , I highly recommend you make an account and start seeing how to solve some of their tricky code problems

10:00 qswz: yep I've opened it

10:01 TEttinger: I haven't been there in a while, but when I was learning it was eye-opening. I realize I could write a lot of solutions better now

10:01 qswz: and registered

10:01 clgv: TEttinger: are the performance problems due to the sandbox solved yet?

10:02 TEttinger: I still need to do 7 problems, but I stopped trying when runtime characteristics over there were not predictable

10:03 TEttinger: clgv, I never "beat the game"

10:03 I am sure it still is a bit slow, but that just means you need to write faster code :P

10:04 clgv: TEttingerwell that's pretty difficult when you are optimizing in a different environment ;)

10:04 TEttinger: which problem did you mean?

10:05 TEttinger: I never solved past like 70

10:05 clgv: ah ok

10:26 CookedGryphon: arrdem: Just reading your latest post about oxcart and I'm not sure I get what the conclusion is. Is defprotocol/defmulti a blocker for this full stop? Or are you just saying that their definitions in core would need to change first

10:26 (my interest being in an optimised "production mode", and assuming I'll use normal clojure for repl development)

10:47 mdrogalis: ToxicFrog & tbaldridge & technomancy: I heard I need to read the entirety of clojure.core to be productive.

10:48 * ToxicFrog sets mdrogalis on fire

10:48 justin_smith: (inc mdrogalis)

10:48 lazybot: ⇒ 6

10:48 mdrogalis: Ha. So while that conversation looked terrible to be a part of, I rather enjoyed reading the log.

10:48 cmdrdats: (inc ToxicFrog)

10:48 lazybot: ⇒ 3

10:49 tbaldridge: mdrogalis 's current status: https://www.youtube.com/watch?v=sCNrK-n68CM

10:49 mdrogalis: Though FWIW, I couldn't tell if he was trolling either.

10:49 tbaldridge: Haha.

10:49 llasram: mdrogalis: The funny thing is I actually do think reading clojure.core is very helpful (albeit not necessary)

10:50 mdrogalis: llasram: Yeah, I actually agree. I wouldn't call it unreadable, though.

10:50 Dunno what he meant by a language-per-fn

10:51 ToxicFrog: mdrogalis: he seemed extremely paranoid about macros.

10:51 lvh: I'm trying to describe the intent of a request (let's start with just HTTP) in a serializable fashion. Any suggestions?

10:52 maybe I should be serializing clojure functions and running them in a sandbox

10:53 mdrogalis: ToxicFrog: The go macro sends your program to the moon and back.

10:53 Your program needs to be astronaut-compliant.

10:55 justin_smith: macros like go, or even for could be seen as little languages. But you don't have to use them, and they don't leak so if you get the results you expect from the input you expect I don't see where the distrust comes from.

10:57 tbaldridge: I get what he's saying though. In Python (and even Javascript) most functions bottom-out pretty quickly to language primitives. Clojure is not like that. Go look at something destructuring let. That requires many parts of core to even work

10:58 *something like

10:58 Not that any of that matters, I just use let, I don't have to give a crap how it works.

10:59 mdrogalis: So, the tell-tale sign that he was a troll was his exit of: "I like Clojure, but only if it's *all* code that I wrote."

10:59 That's not livable. :P

10:59 tbaldridge: in any language

11:00 jtackett: so question, I am runing a lein ring server locally with a clojure web app that pulls emails based on a given date range, but when I deploy the code to heroku the date calculations, comparisons, and conversions get messed up. Any idea why?

11:01 justin_smith: jtackett: are the remote jvm and sql server on the same machine?

11:01 jtackett: not using an sql server for the app

11:01 and I specify for heroku to use java 1.7 in the system properties file

11:02 justin_smith: oh - does your heroku machine have the same time zone / time settings as your local machine?

11:02 jtackett: that’s a good question

11:02 how do you check?

11:02 justin_smith: you could make a route that returns it's "local time"

11:03 ,(str "The time is now" (java.util.Date.))

11:03 clojurebot: "The time is nowTue Aug 12 15:02:23 UTC 2014"

11:03 jtackett: got ya

11:04 looks like it’s sets the default to UTC and I’m EST

11:04 now just need to figure out how to change it

11:05 justin_smith: or you could account for it in your logic

11:05 jtackett: I could but easier to just set a config var on heroku

11:06 justin_smith: for example you may want it to respect any user's current local time

11:06 or maybe the code should know that the time stamps on the emails are all EST

11:08 jtackett: good point, I’ll see if I can parse the time zone from the IMAP email message I pull

11:19 up and running, thanks everyone

11:20 heroku config:add TZ="America/Los_Angeles

11:20 that’s the command to set the time zone for heroku

11:21 TimMc: justin_smith: Much better: (str "The time is now" #_period)

11:22 justin_smith: ,#_period returns nil for me

11:22 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: returns in this context, compiling:(NO_SOURCE_PATH:0:0)>

11:22 justin_smith: ,#_period ;; returns nil for me

11:22 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

11:23 TEttinger: ,(str "The time is now" #_period)

11:23 clojurebot: "The time is now"

11:23 TEttinger: #_... means ignore ... without executing or returning

11:23 justin_smith: right

11:24 I guess my repl made an implicit nil

11:24 yeah, it also returns nil for a newline

11:26 this guy is experienced with audio synth but new to clojure - the lib looks like it could be interesting http://kunstmusik.com/2014/08/11/announcing-pink-a-library-for-music-systems-design-written-in-clojure/

11:27 schmir: I'm trying to create a proxy that implements a certain interface. that interface has a method say-hello, but I have to implement say_hello in the call to proxy. is that a bug? should I stay away from special characters in interfaces?

11:27 s/interface/protocol/

11:29 csd_: Hi would someone please explain why I'm receiving the error in the following code? http://pastebin.com/CqK7uHYG

11:30 justin_smith: you call is-symytric with three args on line 6

11:30 cbp`: csd_: last line of is-symmetric? youre passing 3 args, you prolly want a list of those

11:30 justin_smith: *is-symetric?

11:31 cbp`: pft

11:31 csd_: cbp: good call thanks

11:32 llasram: schmir: If you implement a protocol's backing interface in a `proxy`d type, you need to use the mangled name of the methods.

11:33 `proxy` predates protocols and isn't aware of them

11:34 schmir: Unless you really need the ability to inherit from an existing class, you could use `reify` instead, which is protocol-aware

11:35 kschrader: anybody used component and timbre together to build a logging component?

11:36 schmir: llasram: thanks

11:36 justin_smith: kschrader: wouldn't it be a problem that timbre uses a global config - or is that compatible with component?

11:37 mdrogalis: kschrader: I have.

11:37 kschrader: justin_smith: yeah, that's the problem that I'm running into

11:37 mdrogalis: Timbre's global config is incredibly annoying, but I do set up the global config in a component.

11:37 kschrader: mdrogalis: how did you deal with the global config?

11:37 hmmm

11:37 mdrogalis: Punted :(

11:37 If you come up with a solution, let me know.

11:37 It's an awesome logging framework - except for that.

11:38 kschrader: mdrogalis: do you have a gist somewhere of how you put it together?

11:39 mdrogalis: kschrader: https://gist.github.com/MichaelDrogalis/551d1d532e04c1d85ae7

11:39 At a minimum, it's a central configuration point.

11:40 kschrader: yeah, that's about what I have too

11:40 thought that someone might ahve come up with a better idea :)

11:41 arrdem: CookedGryphon: ping

11:41 kschrader: mdrogalis: thanks

11:42 if I come up with something more interesting I'll let you know

11:42 mdrogalis: kschrader: Thanks! :)

11:45 CookedGryphon: arrdem: Hi, sorry, was in a meeting

11:46 arrdem: CookedGryphon: no worries I just woke up

11:48 CookedGryphon: arrdem: cool, I haven't missed anything. So yes, my question, what does this mean for the prospect of an oxcart based production mode?

11:49 arrdem: CookedGryphon: the takeaway that I was trying to leave people with in that article is that clojure makes a number of tradeoffs that are designed to make REPL development efficient at what seem to be small sacrifices in terms of runtime performance.

11:50 CookedGryphon: This means that when you start pulling dynamic dispatch out of the language you don't have Clojure at all anymore, you have ClojureScript for the JVM. This is valuable in and of itself, but it's not really what I set out to build.

11:52 ToxicFrog: What's idiomatic clojure for zip? interleave+partition?

11:53 qswz: What is the best lib or way to go for developing a websocket server?

11:53 arrdem: CookedGryphon: so in terms of being a "faster Clojure" I think that Oxcart is more or less a bust because it pegged the cost of supporting REPL development at only a ~10-15% slowdown on normal code, and the best speedup I ever got was ~24% for some pretty unrealistic code.

11:54 ToBeReplaced: ToxicFrog: (map vector coll-a coll-b)?

11:54 justin_smith: ToxicFrog: (map list a b)

11:54 ToBeReplaced: qswz: depends on the server platform (servlets or not), and how configurable you need to be

11:55 qswz: i wrote one because nothign else worked for my use case (needed to generate WS urls on the fly as opposed to rely on sessions for auth) https://github.com/ToBeReplaced/jetty9-websockets-async

11:55 TEttinger: CookedGryphon, I think clojure code might port well to Julia, the seq fns seem to be mostly similar between the two. Julia's probably fastest for scientific matrix-heavy code

11:55 qswz: TobeReplaced I did it in Java this way: https://github.com/cauburtin/mongo-cli-java/blob/master/src/main/java/ws/WsServlet.java

11:56 oh perfect, I'll see yours

11:56 CookedGryphon: arrdem: What I'd be most interested in is the impact on startup time for android apps

11:56 TEttinger: (julia's probably not an option if you have jvm libs to use)

11:56 CookedGryphon: arrdem: what with tree shaking and the capability to strip var metadata, it could make a huge difference

11:56 qswz: right, Jetty use Clojure

11:57 ToBeReplaced: qswz: also see https://github.com/james-henderson/chord , and there's another i can't remember if you look for it that's more batteries-included, but less configurable

11:57 arrdem: CookedGryphon: the issue is that due to the structure of clojure.lang.RT there's nothing I can do about trimming startup time without forking the language and building my own RT. I'm gonna try and do that this week, but that's me doing crazy stuff in spare time at the end.

11:58 qswz: ToBeReplaced: thanks

12:01 CookedGryphon: arrdem: how much needs to happen on that front? I take it the worry is that then it wouldn't be maintainable

12:01 tbaldridge: CookedGryphon: and there's always the question if it wouldn't be better to fork/port ClojureScript to the JVM instead.

12:02 CookedGryphon: interesting point

12:02 TEttinger: or LLVM even

12:02 arrdem: CookedGryphon: Right. It'd probably be easier to implement some near-clojure language like ClojureScript for the JVM than to hack the existing Clojure implementation into behaving more nicely.

12:03 tbaldridge: CookedGryphon: IMO, the problem with this sort of thing will almost always be macros. There are very, very few languages that compile standalone optimized programs that allow full macros. Even macros in Rust are basically pattern matching/splicing

12:04 I think that's the one thing that makes a lot of this really tough

12:04 arrdem: tbaldridge: yep. Mkera and I were talking about his kiss ideas, and I'm a fan... except for the impact that it has on the macro system.

12:06 CookedGryphon: If you're not doing bad things in macro code (compile time side effects and the like), could macros not be expanded at compile time?

12:07 on whatever machine is compiling it

12:07 or are there examples you can name where that wouldn't work

12:07 edw: I almost want to ask, "If your macros aren't doing bad things, why are yuo writing macros?"

12:07 tbaldridge: that's exactly what they do, they expand at compile time. The problem is this.

12:07 arrdem: CookedGryphon: the issue is that typically we write macros in terms of previously defined functions, which means that you have to have done per-form compilation to be able to run previously defined functions to macroexpand the rest of your code.

12:08 CookedGryphon: which defeats the point of having a whole program compiler

12:08 bah is cider on the blink for anyone else today?

12:08 tbaldridge: imagine a macro that uses destructuring...that means you need much of core...which means you need most of Clojure's data structures, plus you need something to run the macro. So eval at compile time.

12:11 CookedGryphon: hmm, yes, I see. What's to stop you having a traditional copy of the program evaluated at compile time. Again you would have to avoid compile time side effects, but if no entry points are executed and everything you do is pure functions that would be alright, wouldn't it?

12:12 arrdem: That would work, but then you need both interpretation infrastructure for running code at compile time and the entire whole program compiler/optimizer thing whereas a single form compilation Lisp dialect only need one of the above.

12:12 so now you have two problems :/

12:13 CookedGryphon: true, but we have one of those things already

12:14 arrdem: yeah and that's what Oxcart winds up doing... it abuses the "official" clojure runtime to get macroexpansion and actually loads up the whole program before doing AOT.

12:15 CookedGryphon: I'm doing android development, and I'd be willing to make sacrifices/contortions in the libraries I use+ways I use clojure to get rid of the startup time and dependency on unused code

12:15 tbaldridge: CookedGryphon: which, BTW is pretty much what ClojureScript does. Macros are written in Clojure, the rest of your program in ClojureScript.

12:15 but that also means sharing code between macros and program code is harder.

12:16 CookedGryphon: yeah, that makes sense

12:16 but as I say, totally a sacrifice I'd be willing to make to turn my really nice prototyping setup into actually deployable production code

12:17 Bronsa: racket has a neat solution for this https://www.cs.utah.edu/plt/publications/macromod.pdf

12:18 jgdavey: "/format own_msg {ownmsgnick $2 {ownnick $[-9]0}}$1"

12:18 "/format own_msg_channel {ownmsgnick $3 {ownnick $[-9]0}{msgchannel $1}}$2"

12:18 "/format pubmsg_me {pubmsgmenick $2 {menick $[-9]0}}$1"

12:18 "/format pubmsg_me_channel {pubmsgmenick $3 {menick $[-9]0}{msgchannel $1}}$2"

12:18 "/format pubmsg_hilight {pubmsghinick $0 $3 $[-9]1}$2"

12:18 "/format pubmsg_hilight_channel {pubmsghinick $0 $4 $[-9]1{msgchannel $2}}$3"

12:18 "/format pubmsg {pubmsgnick $2 {pubnick $[-9]0}}$1"

12:18 arrdem: Cider-nrepl 0.7.0: totally horked can't open a REPL. cider-nrepl 0.7.0-SNAPSHOT" works just fine

12:18 jgdavey: "/format pubmsg_channel {pubmsgnick $3 {pubnick $[-9]0}{msgchannel $1}}$2"

12:18 arrdem: jgdavey: ooooohboy

12:18 jgdavey: whoops

12:19 arrdem: Bronsa: reading...

12:21 clgv: CookedGryphon: ClojureScript dev for Android is not feasible for you?

12:21 CookedGryphon: clgv: what do you mean? Actually running JS? Or emitting bytecode

12:21 clgv: CookedGryphon: I heard someone using apache cordova for that

12:22 CookedGryphon: clgv: no, that's not feasible

12:22 clgv: CookedGryphon: yeah that would be running JS

12:22 CookedGryphon: ok, so you have hard performance requirements?

12:23 CookedGryphon: I'm writing a responsive application that runs all the time and which interacts with native JNI code

12:23 and it works great (not that I'd say no to a 25% runtime performance boost), but the startup time is 20 seconds

12:23 tbaldridge: if it runs all the time, why do you care about startup time?

12:24 CookedGryphon: I personally don't think it's a major issue

12:24 but it affects the user perception on first run and reboots

12:25 and I've been told that I need to get it under 2 seconds

12:25 20 seconds is a little extreme to be fair

12:25 clgv: factor ten, that's some way to go ;)

12:26 CookedGryphon: quite

12:26 tbaldridge: CookedGryphon: is that with everything compiled as an uberjar?

12:26 CookedGryphon: yeah, that's everything aot compiled into an apk

12:26 tbaldridge: oh right, this is Android

12:26 CookedGryphon: yeah

12:28 I think simple tree shaking would get me a long way, and not loading all the var metadata

12:28 arrdem: CookedGryphon: did you see Alexander's skummet ann today?

12:28 CookedGryphon: but yeah, if there wasn't the loading vars steps and it was simple method invokes, I could easily see me getting my order of magnitude speedup

12:29 arrdem: no, no I haven't seen that

12:29 tbaldridge: CookedGryphon: it'd be interesting, from every test I've seen it's not an order of magnitude.

12:29 2x or 3x perhaps, but not 10x

12:31 ghadishayban: what won't work for android purposes is what Nashorn does: lazy compilation

12:31 function g(a,b) {...giant code} -> compiles nothing until g is used/linked

12:32 if you run jjs --print-code you'll see this behavior on the latest JVMs

12:33 CookedGryphon: arrdem: hrmm, looking at skummet now.. looks more than a little hacky, can't see this being maintainable. Much prefer your approach.

12:33 arrdem: ahahahahaha

12:33 someone has a _lot_ more faith than's appropriate in my code :P

12:35 CookedGryphon: I dunno, I could follow through what it was doing at a glance, nice and readable and modular

12:36 arrdem: Bronsa and I have been able to write obviously correct code for the most part, but I still wouldn't trust a compiler built by a pair of undergrads

12:37 michaelr`: hellooww

12:37 CookedGryphon: well we'll see. I have to head off now, but I'll be watching with interest any further developments.

12:37 so many people have been talking about a lean production mode clojure that *something* usable's got to come out of it

12:41 tbaldridge: what will probably be the most usable is what is in clojure/clojure at the moment

12:41 there's two branches there Rich has been working on. Those are the only two likely to be committed for now.

12:41 I mean, I find it odd that your requirements are now "under 2 sec" when I don't know of a single person who has pulled that off on Android.

12:42 Sounds like someone is making the rules without knowing what is actually possible. </rant>

12:42 technomancy: uhh

12:43 isn't it more like "this is my requirement, and whether it's possible for clojure to meet it or not is an open question"?=

12:43 tbaldridge: yep

12:43 technomancy: if it's not possible in clojure that doesn't mean it's an unreasonable requirement

12:43 it just means clojure isn't a good fit for it

12:43 tbaldridge: oh I completely agree.

12:44 CookedGryphon: not sure what your JNI requirements are, but ClojureScripts' startup times are way better than Clojure's

13:13 scottj: CookedGryphon: if you try the direct branch I'd be very curious to hear how much it changes your startup time on android.

13:14 puredanger: CookedGryphon: actually, you should try the fastload branch, not direct to assess startup difference

13:24 llasram: Ah, the joys of software archaeology

13:25 Fare: hi

13:26 what's the clojure equivalent of CL's run-program, i.e. spawn an external program and capture its I/O

13:27 nkoza: Fare: seems to be: https://clojure.github.io/clojure/clojure.java.shell-api.html

13:27 Fare: (inc nkoza)

13:27 lazybot: ⇒ 1

13:30 Fare: is there a def- to make a non-public def just like defn- for def?

13:30 for defn

13:30 teslanick: def ^:private, IIRC.

13:31 i.e. it's a meta property you attach to the var when you define it.

13:32 llasram: dakrone: I've got more details on https://github.com/dakrone/clj-http/issues/202 if you'd like

13:32 dakrone: Have you already been thinking about switching to the non-deprecated HttpClient connection APIs?

13:32 dakrone: llasram: I saw that, very helpful

13:32 llasram: yes, I would definitely like to

13:33 llasram: just need to find the time or a PR :)

13:34 llasram: Ok. Someone on my team might do it. Need to figure out priorities. I'll comment on the ticket again before taking a hack to prevent duplicate work

13:35 dakrone: llasram: if I start implementing it I will comment on the ticket as well

13:35 llasram: Cool beans. Coordination!

13:43 jcromartie: How can I use Enlive to interpolate some data into a sequence of elements without cloning them?

13:47 I want to avoid doing this: https://gist.github.com/jcromartie/b9f5e4fbaf528d5e4bfb

13:47 (where populate-fields is a node transformer constructor)

13:47 amalloy: Fare: me.raynes/conch is a shell library, if you're looking for something more fully-featured than c.j.shell

13:49 Raynes: $google raynes conch

13:49 lazybot: [Raynes/conch · GitHub] https://github.com/Raynes/conch

13:49 Raynes: Holy 183 watchers how'd that happen

13:53 jcromartie: how do I interpolate some collection into the respective nodes in an enlive template?

13:54 the nodes already exist in the template so they shouldn't be cloned

13:56 JohanIV: omg, IRC really is alive

13:57 ...at least sort of, it seems

14:43 afhammad: how do you add a leiningen dep to a local library you are developing? documentation is scarce on this

14:44 DomKM: afhammad: the same way you would for an application. In project.clj :dependencies

14:44 Raynes: https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies

14:44 llasram: You're working on two projects at once, and one Leiningen-launched JVMs in one project to pick up the local source of the other as its dependency?

14:44 Raynes: afhammad: See my link.

14:44 Documentation isn't *that* scarce, you likely just didn't know what it was called.

14:44 llasram: s,and one,and want, ; and if so probably want what Raynes said

14:45 Raynes: s/,/\//

14:45 llasram: sed accepts either one :-p

14:45 Well, anything really

14:45 Raynes: Psh, sed.

14:46 amalloy and I only use perl.

14:46 amalloy: which also accepts anything

14:46 * Raynes has flashbacks to amalloy giving him random perl one liners for random problems.

14:46 Raynes: You haven't passed me a perl in a long time.

14:47 afhammad: Raynes: Thanks for the link. My googles turned up nothing, and you would think it would mention something here: http://clojure-doc.org/articles/ecosystem/libraries_authoring.html

14:47 Raynes: clojure-doc.org is super unofficial and community supported.

14:47 arohner: afhammad: google for 'lein checkout dependencies'

14:47 Raynes: It can be mentioned there, someone has to send a pull request first.

14:48 technomancy: be the change you want to see in the world or something

14:48 afhammad: arohner: thanks

14:49 Raynes: I'll send a PR once i figure it out :)

14:49 Raynes: afhammad: <3

14:49 dakrone: llasram: I started on the httpclient rewrite, this is a pretty big change though, it's basically rewriting most of conn_mgr.clj and core.clj, so it could take quite a while, don't let me stop you if you get a chance to work on it also :)

14:50 Raynes: technomancy: Did you just commit to el-get

14:50 technomancy: explain yourself heathen

14:50 technomancy: Raynes: did you see what the commit was about?

14:50 Raynes: Haven't looked yet

14:50 technomancy: it will explain everything

14:51 https://github.com/technomancy/el-get/compare/allow-insecure?expand=1#diff-25adde20ec565805259a2e8e267c02f4R24

14:51 Raynes: technomancy: )))

14:52 llasram: dakrone: Noted. I was hoping the interfaces wouldn't be too different, but alas

14:52 dakrone: yea, lots of changes

14:52 well, guess it's time for some cleanup too

14:53 technomancy: Raynes: I've carried the banner for marmalade for too long; it finally seems to have got its uptime issues under control, but it's still happening over unencrypted HTTP.

14:54 pepijndevos: hm, it seems to me that with core.match. adding rules can actually make things faster.

14:56 ghadishayban: arrdem: there is work being done on interpreting C on top of Truffle/Graal

14:57 arrdem: craziest thing i've ever heard. http://ssw.jku.at/Research/Papers/Grimmer13Master/

15:01 arrdem: ghadishayban: why would you ever..

15:01 llasram: Stack a stack of turtles on top of itself. Easiest way to get an infinite stack of turtles.

15:02 AimHere: Well the easiest way would be to stack a single turtle on top of itself

15:03 arrdem: usually that involves turning the turle inside out..

15:03 this kills the turtle

15:07 teslanick: Dead turtle still turtle.

15:07 clojurebot: Pardon?

15:07 teslanick: clojurebot: Pardon?

15:07 clojurebot: Huh?

15:08 llasram: clojurebot: a dead turtle is still a turtle.

15:09 clojurebot: Ok.

15:09 llasram: clojurebot: a dead turtle?

15:09 clojurebot: a dead turtle is still a turtle.

15:10 teslanick: yes.

15:11 ilarg: so i published a lib to clojars, but it packaged an empty jar. Before I did lein deploy clojars i built once so clj/cljs source was in target in the correct place.

15:15 technomancy: ilarg: lein deploy clojars assumes your code is configured so that `lein jar` from a fresh checkout does the right hting

15:15 thing

15:15 you are probably missing :prep-tasks

15:15 arrdem: ghadishayban: is the thesis worth reading?

15:17 ilarg: hm i haven't used that command yet. i've only been working with uberjar and dev stuff.

15:19 so the full command would be something like lein deploy clojars :prep-tasks?

15:24 i guess my question is, what is the prep-task expectation? cli commands to copy files where?

15:28 llasram: ilarg: This is :prep-tasks -- https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L230-L233

15:29 ilarg: right and i see what looks like command line invocations even though i'm not sure why the protobuf invocation is a nested vector

15:30 for my clj/cljs projects, what should i be looking to put there?

15:30 llasram: It depends on what tasks you need to run to get a working project

15:31 You said that you were building uberjars though... Did you verify that e.g. `lein do clean, jar` produces a JAR containing everything you expect?

15:32 ilarg: the uberjar was for another project - this project is a cljx one.. i use an alias to build it once "lein once" is the complete command. when i did the test just now (lein jar) i see it reproduces the empty jar effect.

15:33 llasram: Well there you go. So you need to add :prep-tasks (whatever the cljx one is) such that `lein jar` produces a correct JAR

15:33 Then you should be able to `deploy` a new version

15:43 ilarg: alright! jar produces my code :) i had to move cljx to base profile for some reason, otherwise it wouldn't see the task, but it works! my sources are in the jar.

15:43 thanks llasram and techno :)

16:07 technomancy: you're modifying the :base profile?

16:07 ilarg: that's kind of an internal lein implementation detail; it's not something that's meant to be user-modified

16:08 ilarg: no my bad i meant the default profile in use when you define no custom profiles.

16:09 technomancy: oh, so just the defproject root

16:10 ilarg: yeah

17:33 cbp: ,(defn ಠ_ಠ [s] (throw (Exception. s)))

17:33 clojurebot: #'sandbox/ಠ_ಠ

17:35 Raynes: ,(ಠ_ಠ "Well, shit")

17:35 clojurebot: #<Exception java.lang.Exception: Well, shit>

18:46 arohner: how do you guys debug core.async errors? exceptions disappear into the nether

18:47 technomancy: that's the main reason I don't write async code =)=

18:51 hyPiRion: arohner: Obsidian → portal → get exception back

18:52 arohner: is that a minecraft joke?

18:53 hyPiRion: it was a bad attempt at one

18:57 llasram: arohner: same as any other code -- printf debugging :-)

18:58 arohner: llasram: yup. I had a prof who refused to teach undergrads about the existence of debuggers, because one day, you'll have to printf anyways

18:58 alisdair: debuggers are just fancy printf frameworks

18:59 arohner: that, and stack-mangling code injectors

19:00 llasram: arohner: If you're running a recent-enough core.async under JVM Clojure, looks like there are some JVM facilities you can use to make use of the exceptions: https://github.com/clojure/core.async/commit/4b99e41b7d46d72887bb395de30330ac63183a29

19:03 Well, or old-enough

19:03 Any version without the random "print the exception object with no backtrace" behavior

19:09 Huh. JVM core.async starts a thread pool which: (a) allocates 42+(2*cores) threads; and (b) doesn't set the parameters allowing the pool to reclaim threads which are idle for some extended periods of time

19:18 hiredman: llasram: the extra 42 are because people shouldn't be doing io on that pool, but people are terrible and likely will

19:18 (by io I mean blocking operations)

19:19 arohner: llasram: thanks

19:20 llasram: I wonder how difficult/annoying it would be to implement something like ForkJoin does for I/O, where there's an interface for explicit potentially-blocking operations allowing the pool to manage what's happening

19:34 danielcompton: Does clojure.tools.trace work with core.async?

19:39 Is there a way to do the reverse of destructuring a map? i.e. given a number of symbols, return a map with the keys as the name of the symbols and the values as the symbols?

19:40 justin_smith: danielcompton: flatland/useful has that

19:41 danielcompton: justin_smith: thanks, that sounds... useful

19:42 badum tish

19:42 justin_smith: I forget what they call it though

19:43 keyed, I think https://github.com/flatland/useful/blob/develop/src/flatland/useful/map.clj#L8

19:44 danielcompton: yep keyed looks like the one

20:50 gfredericks: I submitted a PR to plumbing for keyed today

21:19 mthvedt: can i add jvm arguments on the lein command line?

21:20 amalloy: mthvedt: LEIN_JVM_OPTS=... lein run, i think

21:20 mthvedt: amalloy: thx

21:22 TEttinger: Raynes: sorry about the flurry of privmsgs last night.

21:22 I did solve the issue

22:34 arrdem: technomancy: do you have any suggestions for ocaml resources?

22:37 justin_smith: arrdem: the official ocaml docs come in the form of an introductory book by the language authors

22:37 it's pretty good (though translated from the French)

22:38 rpaulo: arrdem: https://github.com/rizo/awesome-ocaml

22:38 arrdem: justin_smith: I'll check it out. Wirth's books have been pretty good but I'm generally suspect of the "official guide"

22:39 Jaood: arrdem: https://realworldocaml.org/

22:56 technomancy: (inc realworldocaml)

22:56 lazybot: ⇒ 1

23:12 codygman: Is there a way to memoize my "all-categories" function? core/memoize only works with referentially transparent functions right? So it would only ever run the http request once? Would also appreciate a general code review, though the code is small: http://pastebin.com/zPmeu5GT

23:15 ToxicFrog: Argh

23:15 The fact (nil? '()) is false keeps tripping me up

23:16 johnwalker: codygman: core memoize will still cache functions that aren't pure

23:19 codygman: johnwalker: Oh alright. Thanks. It seems the easiest option for me would be to make a small wrapper around memoize that does a head request and checks to see if the document has been modified, otherwise return the memozied function. What do you think?

23:21 johnwalker: well, that would work, but whether it's a good idea depends on what you're doing ;p

23:22 xeqi: codygman: the def saves the return value with a name so it is basically cached. It only runs once (when the namespace is loaded, which might not be what you want).

23:24 johnwalker: xeqi: it seems like it would be defmemoized http-req [headers url]

23:25 justin_smith: ToxicFrog: seq is helpful for that

23:25 ,(nil? (set ()))

23:25 clojurebot: false

23:25 justin_smith: err...

23:25 ,(nil? (seq ()))

23:25 clojurebot: true

23:26 johnwalker: xeqi: actually nevermind, you were talking about something else entirely

23:28 metellus: ,()

23:28 clojurebot: ()

23:28 metellus: ,(conj () :a)

23:28 clojurebot: (:a)

23:29 metellus: I didn't realize you could use () instead of '()

23:32 ToxicFrog: justin_smith: yeah, in this case I was processing a list and using (nil? list) rather than (empty? list)

23:32 And blowing the stack as a result

23:32 justin_smith: ahh

23:33 mthvedt: part of me wants () to throw an exception

23:34 johnwalker: it throws EmptyListException

23:34 jarofghosts: orly

23:34 justin_smith: johnwalker: in what context does it do that?

23:35 johnwalker: err, it doesn't

23:35 justin_smith: ,(first ())

23:35 clojurebot: nil

23:35 jarofghosts: ok

23:35 because ' just prevents evaluation, right?

23:35 so () should be valid

23:35 just an empty list

23:35 justin_smith: well, otherwise (*) would mean invoke what's inside

23:36 rather than just have it be a list

23:36 johnwalker: ,(+ (*) (*) (*))

23:36 clojurebot: 3

23:36 justin_smith: I meant * as in "zero or more things"

23:37 jarofghosts: ah i imagine it as (+)

23:37 justin_smith: except in case, and probably some other situations I am missing

23:37 jarofghosts: though im totally a newbie here

23:37 justin_smith: ,(+)

23:37 clojurebot: 0

23:37 jarofghosts: sorry i mean in the context of regex

23:37 + being 1 or more

23:38 justin_smith: of course :)

23:38 jarofghosts: :P

23:40 metellus: ,()

23:40 clojurebot: ()

23:40 metellus: ,(+ 1 2)

23:40 clojurebot: 3

23:40 metellus: in those cases doesn't it basically mean invoke what's inside?

23:41 in the second case, I mean

23:41 justin_smith: ,() ; is a literal

23:41 right

23:41 clojurebot: ()

23:41 justin_smith: ,(case 1 (0 2 4) :even (1 3 5) :odd)

23:41 clojurebot: :odd

23:41 justin_smith: the other exception I can think of

23:43 mthvedt: () seems like the syntax version of a divide by zero

23:43 xeqi: codygman: as for review, I'd probably write it like http://pastebin.com/7q8fv0JA

23:45 mthvedt: maybe i can find a nice monoid on s-expressions to show () shouldn’t be evaluatable

Logging service provided by n01se.net