#clojure logs

2014-08-12

00:22blur3dI’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
00:24puredangeryou can't use those in cljs - they require real threads
00:25blur3dwill using <! >! alt! likely be a problem?
00:25blur3dor is their an expected alternative
00:25puredangerno, 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!
00:26blur3dpuredanger: ok, thanks
02:09TEttinger2I'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
02:09amalloyasleep!? it's only 11 here on the west coast
02:10TEttinger2https://gist.github.com/anonymous/e0198ca2826a321dfb88#file-title-clj-L79 this line never gets executed
02:10amalloyand, i dunno, lazybot's logging is really terrible
02:10TEttinger2oh I thought you were east coast
02:10amalloyit's probably in a future, whose *out* is not bound to anything interesting
02:11TEttinger2how can I reliably log something?
02:11Raynesamalloy: uh
02:11TEttinger2(in a lazybot hook)
02:11Raynesamalloy: Its logging isn't that bad.
02:11TEttinger2hey the lazygang's all ere
02:12RaynesTEttinger2: When you run it it should be printing to *out* by default.
02:12RaynesHow are you running the bot?
02:12TEttinger2strange...
02:12TEttinger2java -jar lazybot.jar
02:12TEttinger2no --logpath
02:12TEttinger2i had that earlier but stopped using it
02:13RaynesIf you pass --logpath does it write to file as intended?
02:13TEttinger2not that I could see
02:13TEttinger2let me try
02:13RaynesAlso, what sha is your checkout of lazybot?
02:14TEttinger2haha uh... it's old with new stuff pasted in when something breaks
02:14TEttinger2it has 84 weeks of history stored
02:14TEttinger2and the bot itself predates that
02:15RaynesTEttinger2: Wait, is there no printing whatsoever, or only just that line above?
02:15RaynesI didn't read hard enough.
02:15TEttinger2ugh I'm a moron
02:15TEttinger2I wasn't building the jar
02:16TEttinger2i am used to lein run
02:16Raynes?
02:16TEttinger2java -jar lazybot.jar ;; but lazybot.jar was old
02:16RaynesOh.
02:16RaynesI think lein run should also work.
02:16RaynesIf not, it shouldn't be much work to make it work.
02:17RaynesThe jar's -main is run.clj
02:17TEttinger2well a new uberjar appears to have fixed it
02:17RaynesBecause derp when I was 16 and I can't be arsed to change filenames to conventional stuff.
02:17TEttinger2thanks for tolerating my stupidity :)
02:17RaynesNo worries <3
02:18TEttinger2this was a crazy bug stemming from http youtube links redirecting to https ones. my fix works now but it wasn't running it before
02:46supreme__best book to learn clojure?
02:46supreme__is the joy of clojure good? I like fogus
02:51jakesendarCurious 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.
02:51michaelrhello
03:08ucbsupreme__: 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)
03:09ucbsupreme__: 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
03:45winkyou can read Joy of Clojure even if you just fiddled around for a few hours
03:46winkbut you should do some more work then and reread it
03:47clgvwink: JoC as recommendation for a beginner?
03:51winkclgv: worked for me
03:51rolfbthe infix explaination in the beginning isn't very interesting imho :P
03:51winkclgv: maybe it's not the *best* way, but I wouldn't say it totally advanced.
03:51clgvwink: 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
03:52rolfbI would recommend starting with Clojure Inside Out videos and then moving to the book
03:52clgvyeah well we had the first book at our department and I only bought JoC ;)
03:52winkand I am re-re-reading it after a year just this week :P
03:53winkstill stuff in there I missed
03:54clgvhow was that code search engine called? I remember there was a popular one a couple of years ago
03:55winkkoders?
03:55clgvsounds familiar
03:55winkgoogle code was the popular one
03:56wink;)
03:56clgvoh it got superseeded by ohloh code
04:38bajabongohello,
04:38bajabongodoes anybody know, why is it impossible to add metadata to a string?
04:38bajabongogist related: https://gist.github.com/anonymous/962275ab342c4831b70b
04:39TEttingerbajabongo, I think because it's a java object and doesn't extend IMeta
04:40TEttingerbasically clojure has to deal with what it's been given by java...
04:40lvhbajabongo: yeah, metadata is attached to the object not to the name/var
04:40bajabongoTEttinger, ok, so I suppose it's just impossible to add meta to the string?
04:40lvhbajabongo: afaik yes
04:41TEttingeryou could get by with wrapping it
04:41TEttinger,(meta ^{:sample-key "sample data"} ["string"])
04:41clojurebot{:sample-key "sample data"}
04:41bajabongoTEttinger: yeah, I noticed that when I make, ex. a vector ["string"], it works
04:41bajabongoexactly
04:42TEttingeryeah, 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
04:43bajabongoTEttinger: lvh: ok, thanks guys
04:43TEttingernp
04:44TEttingerbajabongo, oh and also: java strings are implemented very oddly compared to normal classes for efficiency
04:44TEttinger(within java 7 and java 8 it's different)
04:44TEttingerso if clojure made its own it wouldn't probably perform as well
04:44bajabongoTEttinger: as far as I know the're immutable, aren't they?
04:45TEttingerright, and they convert silently between different internal representations
04:45TEttingerone for large strings, one for small, pretty much
04:45bajabongoTEttinger: has that anything related with unicode?
04:45TEttingerexternally they're the same except for performance
04:46TEttingerpossibly, java has very good unicode support
04:47TEttingerbeing able to do stuff like ##(re-find "...stuff" #"\pl+")
04:47bajabongointeresting, although I'm just a novice at Clojure and, actually, I'm learning it towards ClojureScript,
04:47TEttinger,(re-find "...stuff" #"\pl+")
04:47clojurebot#<SecurityException java.lang.SecurityException: denied>
04:47TEttingerwhat
04:47bajabongobut it's always better to know more than less :)
04:48TEttinger,(re-find "...stuff" #"\p{Letter}+")
04:48clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class java.util.regex.PatternSyntaxException>
04:48TEttingeruhhh
04:48TEttinger,(re-find "...stuff" #"\p{L}+")
04:48clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>
04:48TEttinger,(re-find #"\p{L}+" "...stuff")
04:48clojurebot"stuff"
04:49TEttingerthat uses unicode, and is a bit slower than some other regex operations
04:51bajabongoTEttinger: 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)
04:52bajabongobut ofc I just wonder, I don't actually know
04:52TEttingeryeah, 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)
04:52TEttingerCharBuffer or something in a sun package instead of a java one
05:38TEttinger2Raynes: privmsg ok? there's an issue with clojail
05:58sm0kehello all
05:59sm0kei am facing a problem w.r.t to core.async channels not getting gc'ed
06:00sm0kehttps://www.refheap.com/89131
06:00sm0kesince the reference to (chan) is no longer ,...it should ideally get closed automatically?
06:03sm0keany comments?
06:09sm0kei guess finalize does not provide guarantees
06:11stain_sm0ke: GC won't run unless you are running short of memory
06:11stain_with-open would normally work for closing.. but I am not sure if it works on async channels
06:12sm0kedoesnt apply to my example...it has to be managed
06:13sm0kewhich is a pain
07:15supreme__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 :)
07:17ucbsupreme__: cool!
08:22sveri1Hi, 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?
08:42Kneiva,(def my-map {{:x "foo" :y "bar"} {'a 1 'b 2} {:x "baz" :y "qux"} {'a 2 'b 3}})
08:42clojurebot#'sandbox/my-map
08:42Kneiva,(apply hash-map (apply concat (map (fn [[k v]] [k (update-in v ['a] (partial + 100))]) my-map)))
08:42clojurebot{{:y "qux", :x "baz"} {a 102, b 3}, {:y "bar", :x "foo"} {a 101, b 2}}
08:43Kneivais there a better way to update a value in all values?
08:48dnolen_,(into {} (map (fn [[k v]] [k (update-in v ['a] #(+ % 100))]) my-map))
08:48clojurebot{{:y "qux", :x "baz"} {a 102, b 3}, {:y "bar", :x "foo"} {a 101, b 2}}
08:48TEttinger(inc dnolen_)
08:48lazybot⇒ 4
08:48TEttinger(inc dnolen)
08:48lazybot⇒ 15
08:48TEttingerthat seems low, aren't you a primary author of cljs?
08:49dnolen_Kneiva: I would probably write it like ^, easy to make a helper fn out of that
08:49TEttinger$karma TEttinger
08:49lazybotTEttinger has karma 20.
08:49TEttingerhow did that happen...
08:52Kneivadnolen_: thanks
08:52CookedGryphonHey everyone. So I have a pattern of building up sets/lists conditionally that seems to pop up everywhere
08:52CookedGryphonand I end up doing something like (set (concat (when blah [:this :that]) (when foo [:thing]) ...)
08:53CookedGryphonbecause concat discards the nil as desired
08:53CookedGryphonis there any way I could build up similarly, without having to make single element lists?
08:54llasramCookedGryphon: (cond-> #{} foo (conj :foo), bar (into [:bar :baz]))
08:54clojurebotTitim gan éirí ort.
08:54TEttingerwoah, llasram, never seen cond-> before
08:54CookedGryphonyeah, that works for some of my cases
08:55llasramTEttinger: added in 1.5
08:55TEttingerthat explains it, my lazybot is still on an old version
09:03clgv&(clojure-version)
09:03lazybot⇒ "1.4.0"
09:03clgv,(clojure-version)
09:03clojurebot"1.7.0-master-SNAPSHOT"
09:04lvhooh, shiny.
09:07pcnWoo
09:09clgv,(sequence (map inc) (range 5))
09:09clojurebot(1 2 3 4 5)
09:20qswzHi people, can I ask which IDE you use?
09:22clgvqswz: Eclipse with Counterclockwise
09:22qswzclgv: thanks, and what is the library manager for Clojure, maven?
09:22clgv(the non-representative regarding the majority is mentioned first :P)
09:22clgvqswz: you use leiningen, which is integrated with counterclockwise
09:23qswzok
09:23clgvqswz: the majority uses emacs and (probably) cider (by now)
09:23qswzemacs, hmm not yet for me
09:24clgvthere is also intellij with cursive
09:24clgvor vim-fireplace
09:26qswzcursice is commercial, but I've found "La Clojure"
09:28puredangerla clojure has not been updated in years; you should use Cursive
09:28qswzok, I'll start Eclipse I guess, thanks puredanger
09:29puredangeryou might also be interested in simpler environments like nightcode or light table
09:29puredangerboth written in clojure
09:29qswzsimple IDEs ok
09:30puredangerboth have repls and leiningen integration
09:30qswzI'll be tryong counterclockwise first thanks
09:41TEttingerqswz, yeah I have had really good luck with nightcode. it has a lot of handy stuff right there in the window
09:41qswzok
09:42TEttingerthat said, clojure doesn't strictly need an IDE, I develop from time to time in jEdit
09:42puredangersome people like sublime as a simple editor, haven't tried it myself
09:42TEttingerhell, I do enough in messages to bots...
09:42qswzTEttinger: what library manager is there?
09:42TEttingerqswz, leiningen
09:42TEttinger##(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"])))))))))
09:42lazybot⇒ "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
09:42qswzok
09:43qswz##(+ 1 2)
09:43lazybot⇒ 3
09:43TEttingerI typed that up without an IDE, then shortened it to that unreadable form
09:43TEttingerthe shortening only really needed paren matching
09:43qswz##(reverse "foo")
09:43lazybot⇒ (\o \o \f)
09:44qswz##(join (reverse "foo"))
09:44lazybotjava.lang.RuntimeException: Unable to resolve symbol: join in this context
09:44TEttingerthere's two bots here, lazybot uses ## or & to eval code, and clojurebot uses a message starting with ,
09:44TEttinger,(apply str (reverse "foo"))
09:44clojurebot"oof"
09:44qswz##(join "" (reverse "foo"))
09:44lazybotjava.lang.RuntimeException: Unable to resolve symbol: join in this context
09:44qswzoh
09:45qswz,(apply sum [1 2])
09:45clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: sum in this context, compiling:(NO_SOURCE_PATH:0:0)>
09:45TEttingerthere's also clojure.string/join, which calls join in an optional lib called clojure.string
09:45qswz,(sum [1 2])
09:45clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: sum in this context, compiling:(NO_SOURCE_PATH:0:0)>
09:45TEttinger,(applu + [1 2 3])
09:45clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: applu in this context, compiling:(NO_SOURCE_PATH:0:0)>
09:45TEttinger,(apply + [1 2 3])
09:45clojurebot6
09:45rberthel##(clojure.string/join "" (reverse "foo"))
09:45lazybot⇒ "oof"
09:45qswzyep
09:45TEttinger,(+ 1 2 3)
09:45clojurebot6
09:45TEttinger,(/ 1 2 3)
09:45clojurebot1/6
09:46TEttingerthese bots are handy, but you can also privmsg them to avoid flooding the channel
09:46qswz,(apply (/ 2.) [1 2 3])
09:46clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Double cannot be cast to clojure.lang.IFn>
09:46TEttingeras in /msg clojurebot ,(apply (partial / 2.) [1 2 3])
09:47qswzok for privatemsg I know how spammy it is sorry
09:47TEttingerit's fine
09:47TEttingerwe can see your process here :)
09:47TEttingerbut if there's an existing conversation, you can use privmsg to not interrupt it
09:47qswzHow could you apply 5 times / 2 to 8 for example
09:48TEttingeruh, can you write that out like a formula?
09:48TEttinger5 * 2 + 8 ?
09:48TEttingernot sure what you mean
09:48qswzTEttinger: I want 8 4 2 1 .5 as the result
09:48qswzI mean 4 2 1 .5 .25
09:48TEttingeroh gotcha
09:49TEttinger,(map (fn [num] (/ 4 num)) (range 1 6))
09:49clojurebot(4 2 4/3 1 4/5)
09:50TEttingererr, that won't work
09:50TEttingeroh I get it
09:50qswzTEttinger: I see, it(s even better what you did
09:50qswzthe exponential way
09:51qswz ,(map (fn [num] (/ 4.0 num)) (range 1 6))
09:51clojurebot(4.0 2.0 1.3333333333333333 1.0 0.8)
09:51TEttinger,(reductions (fn [start num] (/ start num)) 4 (repeat 5 2))
09:51clojurebot(4 2 1 1/2 1/4 ...)
09:51TEttingererr
09:51TEttinger##(reductions (fn [start num] (/ start num)) 4 (repeat 5 2))
09:51lazybot⇒ (4 2 1 1/2 1/4 1/8)
09:51TEttingerreductions also includes the un-applied starting value
09:51qswz ,(range 1 6)
09:51clojurebot(1 2 3 4 5)
09:52TEttingernon-inclusive end, like java
09:52qswz ,[1 2 3 4 5]
09:52clojurebot[1 2 3 4 5]
09:52TEttingerreductions is an interesting function
09:52qswzlike reduce of map/reduce?
09:52TEttingerbut to understand it you should learn reduce first
09:52TEttingeryep
09:52qswzok
09:52TEttinger,(reduce + [1 2 3])
09:52clojurebot6
09:53qswzTEttinger: What's the difference between (1 2) and [1 2]
09:53joegalloTEttinger: i'm really happy for you, and immma let you finish, but juxt is one of the most interesting functions OF ALL TIME
09:53TEttingersimple, right? same as apply + here
09:53joegallo:D
09:53TEttingerjoegallo, haha
09:53clgv,(require '[clojure.string :as str])
09:53clojurebotnil
09:53TEttingerqw, so ()
09:53clgv(str/join "" (reverse "foo"))
09:53clgv,(str/join "" (reverse "foo"))
09:53clojurebot"oof"
09:54clgvqswz: ^^
09:54TEttingerqswz so (1 2) actually won't work as is. if you try it, ##(1 2) it's an error
09:54lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn
09:54TEttinger,'(1 2)
09:54clojurebot(1 2)
09:54TEttingeris a quoted list
09:54TEttingerbut (1 2) tries to call 1 as a function, hence that error
09:54qswz,(str/split "," "ok,I,see")
09:54clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: str, compiling:(NO_SOURCE_PATH:0:0)>
09:55TEttingeryeah after 5 min it gets forgotten by the bot
09:55TEttingerto avoid lengthy breaking
09:55TEttinger,(require '[clojure.string :as str])
09:55clojurebotnil
09:55TEttinger,(str/split "," "ok,I,see")
09:55clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>
09:55TEttinger,(str/split #"," "ok,I,see")
09:55clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>
09:55TEttinger,(str/split "ok,I,see" #",")
09:56clojurebot["ok" "I" "see"]
09:56TEttingersorry I always forget the args
09:56TEttingerfor that case, there's
09:56TEttinger,(doc str/split)
09:56clojurebot"([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."
09:56qswz,(str/split "ok,I,see" ""\d+")
09:56clojurebot#<RuntimeException java.lang.RuntimeException: Unsupported character: \d+>
09:56qswz,(str/split "ok,I,see" #"\d+")
09:56clojurebot["ok,I,see"]
09:56TEttingeryep, no numbers there
09:56qswz,(str/split "ok,I,see" #"\w+")
09:56clojurebot["" "," ","]
09:57TEttingerthere you go
09:57qswz,(str/split "ok,I,see" #"\W+")
09:57clojurebot["ok" "I" "see"]
09:57TEttingernext steps to learn clojure are probably 4clojure for you
09:57TEttingeryou seem to be getting this stuff quickly
09:57qswzyep I did some erland and a bit of haskell before
09:58qswzerlang*
09:58TEttingerthat explains it, also says you certainly ain't slow if you can use those :)
09:58qswzI'll try to port my project in clojure to test it
09:59TEttingerpeople coming from java have a harder time than haskell/erlang I think
09:59qswzpossible yes
09:59TEttingerbut they are less surprised by JVM stacktraces from errors :)
10:00TEttingerqswz: http://www.4clojure.com/ , I highly recommend you make an account and start seeing how to solve some of their tricky code problems
10:00qswzyep I've opened it
10:01TEttingerI 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:01qswzand registered
10:01clgvTEttinger: are the performance problems due to the sandbox solved yet?
10:02clgvTEttinger: I still need to do 7 problems, but I stopped trying when runtime characteristics over there were not predictable
10:03TEttingerclgv, I never "beat the game"
10:03TEttingerI am sure it still is a bit slow, but that just means you need to write faster code :P
10:04clgvTEttingerwell that's pretty difficult when you are optimizing in a different environment ;)
10:04clgvTEttinger: which problem did you mean?
10:05TEttingerI never solved past like 70
10:05clgvah ok
10:26CookedGryphonarrdem: 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:26CookedGryphon(my interest being in an optimised "production mode", and assuming I'll use normal clojure for repl development)
10:47mdrogalisToxicFrog & tbaldridge & technomancy: I heard I need to read the entirety of clojure.core to be productive.
10:48justin_smith(inc mdrogalis)
10:48lazybot⇒ 6
10:48mdrogalisHa. So while that conversation looked terrible to be a part of, I rather enjoyed reading the log.
10:48cmdrdats(inc ToxicFrog)
10:48lazybot⇒ 3
10:49tbaldridgemdrogalis 's current status: https://www.youtube.com/watch?v=sCNrK-n68CM
10:49mdrogalisThough FWIW, I couldn't tell if he was trolling either.
10:49mdrogalistbaldridge: Haha.
10:49llasrammdrogalis: The funny thing is I actually do think reading clojure.core is very helpful (albeit not necessary)
10:50mdrogalisllasram: Yeah, I actually agree. I wouldn't call it unreadable, though.
10:50mdrogalisDunno what he meant by a language-per-fn
10:51ToxicFrogmdrogalis: he seemed extremely paranoid about macros.
10:51lvhI'm trying to describe the intent of a request (let's start with just HTTP) in a serializable fashion. Any suggestions?
10:52lvhmaybe I should be serializing clojure functions and running them in a sandbox
10:53mdrogalisToxicFrog: The go macro sends your program to the moon and back.
10:53mdrogalisYour program needs to be astronaut-compliant.
10:55justin_smithmacros 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:57tbaldridgeI 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:58tbaldridge*something like
10:58tbaldridgeNot that any of that matters, I just use let, I don't have to give a crap how it works.
10:59mdrogalisSo, 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:59mdrogalisThat's not livable. :P
10:59tbaldridgein any language
11:00jtackettso 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:01justin_smithjtackett: are the remote jvm and sql server on the same machine?
11:01jtackettnot using an sql server for the app
11:01jtackettand I specify for heroku to use java 1.7 in the system properties file
11:02justin_smithoh - does your heroku machine have the same time zone / time settings as your local machine?
11:02jtackettthat’s a good question
11:02jtacketthow do you check?
11:02justin_smithyou could make a route that returns it's "local time"
11:03justin_smith,(str "The time is now" (java.util.Date.))
11:03clojurebot"The time is nowTue Aug 12 15:02:23 UTC 2014"
11:03jtackettgot ya
11:04jtackettlooks like it’s sets the default to UTC and I’m EST
11:04jtackettnow just need to figure out how to change it
11:05justin_smithor you could account for it in your logic
11:05jtackettI could but easier to just set a config var on heroku
11:06justin_smithfor example you may want it to respect any user's current local time
11:06justin_smithor maybe the code should know that the time stamps on the emails are all EST
11:08jtackettgood point, I’ll see if I can parse the time zone from the IMAP email message I pull
11:19jtackettup and running, thanks everyone
11:20jtackettheroku config:add TZ="America/Los_Angeles
11:20jtackettthat’s the command to set the time zone for heroku
11:21TimMcjustin_smith: Much better: (str "The time is now" #_period)
11:22justin_smith,#_period returns nil for me
11:22clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: returns in this context, compiling:(NO_SOURCE_PATH:0:0)>
11:22justin_smith,#_period ;; returns nil for me
11:22clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
11:23TEttinger,(str "The time is now" #_period)
11:23clojurebot"The time is now"
11:23TEttinger#_... means ignore ... without executing or returning
11:23justin_smithright
11:24justin_smithI guess my repl made an implicit nil
11:24justin_smithyeah, it also returns nil for a newline
11:26justin_smiththis 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:27schmirI'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:27schmirs/interface/protocol/
11:29csd_Hi would someone please explain why I'm receiving the error in the following code? http://pastebin.com/CqK7uHYG
11:30justin_smithyou call is-symytric with three args on line 6
11:30cbp`csd_: last line of is-symmetric? youre passing 3 args, you prolly want a list of those
11:30justin_smith*is-symetric?
11:31cbp`pft
11:31csd_cbp: good call thanks
11:32llasramschmir: If you implement a protocol's backing interface in a `proxy`d type, you need to use the mangled name of the methods.
11:33llasram`proxy` predates protocols and isn't aware of them
11:34llasramschmir: Unless you really need the ability to inherit from an existing class, you could use `reify` instead, which is protocol-aware
11:35kschraderanybody used component and timbre together to build a logging component?
11:36schmirllasram: thanks
11:36justin_smithkschrader: wouldn't it be a problem that timbre uses a global config - or is that compatible with component?
11:37mdrogaliskschrader: I have.
11:37kschraderjustin_smith: yeah, that's the problem that I'm running into
11:37mdrogalisTimbre's global config is incredibly annoying, but I do set up the global config in a component.
11:37kschradermdrogalis: how did you deal with the global config?
11:37kschraderhmmm
11:37mdrogalisPunted :(
11:37mdrogalisIf you come up with a solution, let me know.
11:37mdrogalisIt's an awesome logging framework - except for that.
11:38kschradermdrogalis: do you have a gist somewhere of how you put it together?
11:39mdrogaliskschrader: https://gist.github.com/MichaelDrogalis/551d1d532e04c1d85ae7
11:39mdrogalisAt a minimum, it's a central configuration point.
11:40kschraderyeah, that's about what I have too
11:40kschraderthought that someone might ahve come up with a better idea :)
11:41arrdemCookedGryphon: ping
11:41kschradermdrogalis: thanks
11:42kschraderif I come up with something more interesting I'll let you know
11:42mdrogaliskschrader: Thanks! :)
11:45CookedGryphonarrdem: Hi, sorry, was in a meeting
11:46arrdemCookedGryphon: no worries I just woke up
11:48CookedGryphonarrdem: cool, I haven't missed anything. So yes, my question, what does this mean for the prospect of an oxcart based production mode?
11:49arrdemCookedGryphon: 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:50arrdemCookedGryphon: 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:52ToxicFrogWhat's idiomatic clojure for zip? interleave+partition?
11:53qswzWhat is the best lib or way to go for developing a websocket server?
11:53arrdemCookedGryphon: 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:54ToBeReplacedToxicFrog: (map vector coll-a coll-b)?
11:54justin_smithToxicFrog: (map list a b)
11:54ToBeReplacedqswz: depends on the server platform (servlets or not), and how configurable you need to be
11:55ToBeReplacedqswz: 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:55TEttingerCookedGryphon, 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:55qswzTobeReplaced I did it in Java this way: https://github.com/cauburtin/mongo-cli-java/blob/master/src/main/java/ws/WsServlet.java
11:56qswzoh perfect, I'll see yours
11:56CookedGryphonarrdem: What I'd be most interested in is the impact on startup time for android apps
11:56TEttinger(julia's probably not an option if you have jvm libs to use)
11:56CookedGryphonarrdem: what with tree shaking and the capability to strip var metadata, it could make a huge difference
11:56qswzright, Jetty use Clojure
11:57ToBeReplacedqswz: 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:57arrdemCookedGryphon: 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:58qswzToBeReplaced: thanks
12:01CookedGryphonarrdem: how much needs to happen on that front? I take it the worry is that then it wouldn't be maintainable
12:01tbaldridgeCookedGryphon: and there's always the question if it wouldn't be better to fork/port ClojureScript to the JVM instead.
12:02CookedGryphoninteresting point
12:02TEttingeror LLVM even
12:02arrdemCookedGryphon: 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:03tbaldridgeCookedGryphon: 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:04tbaldridgeI think that's the one thing that makes a lot of this really tough
12:04arrdemtbaldridge: 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:06CookedGryphonIf 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:07CookedGryphonon whatever machine is compiling it
12:07CookedGryphonor are there examples you can name where that wouldn't work
12:07edwI almost want to ask, "If your macros aren't doing bad things, why are yuo writing macros?"
12:07tbaldridgethat's exactly what they do, they expand at compile time. The problem is this.
12:07arrdemCookedGryphon: 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:08arrdemCookedGryphon: which defeats the point of having a whole program compiler
12:08arrdembah is cider on the blink for anyone else today?
12:08tbaldridgeimagine 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:11CookedGryphonhmm, 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:12arrdemThat 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:12arrdemso now you have two problems :/
12:13CookedGryphontrue, but we have one of those things already
12:14arrdemyeah 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:15CookedGryphonI'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:15tbaldridgeCookedGryphon: which, BTW is pretty much what ClojureScript does. Macros are written in Clojure, the rest of your program in ClojureScript.
12:15tbaldridgebut that also means sharing code between macros and program code is harder.
12:16CookedGryphonyeah, that makes sense
12:16CookedGryphonbut 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:17Bronsaracket has a neat solution for this https://www.cs.utah.edu/plt/publications/macromod.pdf
12:18jgdavey"/format own_msg {ownmsgnick $2 {ownnick $[-9]0}}$1"
12:18jgdavey"/format own_msg_channel {ownmsgnick $3 {ownnick $[-9]0}{msgchannel $1}}$2"
12:18jgdavey"/format pubmsg_me {pubmsgmenick $2 {menick $[-9]0}}$1"
12:18jgdavey"/format pubmsg_me_channel {pubmsgmenick $3 {menick $[-9]0}{msgchannel $1}}$2"
12:18jgdavey"/format pubmsg_hilight {pubmsghinick $0 $3 $[-9]1}$2"
12:18jgdavey"/format pubmsg_hilight_channel {pubmsghinick $0 $4 $[-9]1{msgchannel $2}}$3"
12:18jgdavey"/format pubmsg {pubmsgnick $2 {pubnick $[-9]0}}$1"
12:18arrdemCider-nrepl 0.7.0: totally horked can't open a REPL. cider-nrepl 0.7.0-SNAPSHOT" works just fine
12:18jgdavey"/format pubmsg_channel {pubmsgnick $3 {pubnick $[-9]0}{msgchannel $1}}$2"
12:18arrdemjgdavey: ooooohboy
12:18jgdaveywhoops
12:19arrdemBronsa: reading...
12:21clgvCookedGryphon: ClojureScript dev for Android is not feasible for you?
12:21CookedGryphonclgv: what do you mean? Actually running JS? Or emitting bytecode
12:21clgvCookedGryphon: I heard someone using apache cordova for that
12:22CookedGryphonclgv: no, that's not feasible
12:22clgvCookedGryphon: yeah that would be running JS
12:22clgvCookedGryphon: ok, so you have hard performance requirements?
12:23CookedGryphonI'm writing a responsive application that runs all the time and which interacts with native JNI code
12:23CookedGryphonand it works great (not that I'd say no to a 25% runtime performance boost), but the startup time is 20 seconds
12:23tbaldridgeif it runs all the time, why do you care about startup time?
12:24CookedGryphonI personally don't think it's a major issue
12:24CookedGryphonbut it affects the user perception on first run and reboots
12:25CookedGryphonand I've been told that I need to get it under 2 seconds
12:25CookedGryphon20 seconds is a little extreme to be fair
12:25clgvfactor ten, that's some way to go ;)
12:26CookedGryphonquite
12:26tbaldridgeCookedGryphon: is that with everything compiled as an uberjar?
12:26CookedGryphonyeah, that's everything aot compiled into an apk
12:26tbaldridgeoh right, this is Android
12:26CookedGryphonyeah
12:28CookedGryphonI think simple tree shaking would get me a long way, and not loading all the var metadata
12:28arrdemCookedGryphon: did you see Alexander's skummet ann today?
12:28CookedGryphonbut 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:29CookedGryphonarrdem: no, no I haven't seen that
12:29tbaldridgeCookedGryphon: it'd be interesting, from every test I've seen it's not an order of magnitude.
12:29tbaldridge2x or 3x perhaps, but not 10x
12:31ghadishaybanwhat won't work for android purposes is what Nashorn does: lazy compilation
12:31ghadishaybanfunction g(a,b) {...giant code} -> compiles nothing until g is used/linked
12:32ghadishaybanif you run jjs --print-code you'll see this behavior on the latest JVMs
12:33CookedGryphonarrdem: hrmm, looking at skummet now.. looks more than a little hacky, can't see this being maintainable. Much prefer your approach.
12:33arrdemahahahahaha
12:33arrdemsomeone has a _lot_ more faith than's appropriate in my code :P
12:35CookedGryphonI dunno, I could follow through what it was doing at a glance, nice and readable and modular
12:36arrdemBronsa 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:37michaelr`hellooww
12:37CookedGryphonwell we'll see. I have to head off now, but I'll be watching with interest any further developments.
12:37CookedGryphonso many people have been talking about a lean production mode clojure that *something* usable's got to come out of it
12:41tbaldridgewhat will probably be the most usable is what is in clojure/clojure at the moment
12:41tbaldridgethere's two branches there Rich has been working on. Those are the only two likely to be committed for now.
12:41tbaldridgeI 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:42tbaldridgeSounds like someone is making the rules without knowing what is actually possible. </rant>
12:42technomancyuhh
12:43technomancyisn'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:43tbaldridgeyep
12:43technomancyif it's not possible in clojure that doesn't mean it's an unreasonable requirement
12:43technomancyit just means clojure isn't a good fit for it
12:43tbaldridgeoh I completely agree.
12:44tbaldridgeCookedGryphon: not sure what your JNI requirements are, but ClojureScripts' startup times are way better than Clojure's
13:13scottjCookedGryphon: if you try the direct branch I'd be very curious to hear how much it changes your startup time on android.
13:14puredangerCookedGryphon: actually, you should try the fastload branch, not direct to assess startup difference
13:24llasramAh, the joys of software archaeology
13:25Farehi
13:26Farewhat's the clojure equivalent of CL's run-program, i.e. spawn an external program and capture its I/O
13:27nkozaFare: seems to be: https://clojure.github.io/clojure/clojure.java.shell-api.html
13:27Fare(inc nkoza)
13:27lazybot⇒ 1
13:30Fareis there a def- to make a non-public def just like defn- for def?
13:30Farefor defn
13:30teslanickdef ^:private, IIRC.
13:31teslanicki.e. it's a meta property you attach to the var when you define it.
13:32llasramdakrone: I've got more details on https://github.com/dakrone/clj-http/issues/202 if you'd like
13:32llasramdakrone: Have you already been thinking about switching to the non-deprecated HttpClient connection APIs?
13:32dakronellasram: I saw that, very helpful
13:32dakronellasram: yes, I would definitely like to
13:33dakronellasram: just need to find the time or a PR :)
13:34llasramOk. 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:35dakronellasram: if I start implementing it I will comment on the ticket as well
13:35llasramCool beans. Coordination!
13:43jcromartieHow can I use Enlive to interpolate some data into a sequence of elements without cloning them?
13:47jcromartieI want to avoid doing this: https://gist.github.com/jcromartie/b9f5e4fbaf528d5e4bfb
13:47jcromartie(where populate-fields is a node transformer constructor)
13:47amalloyFare: me.raynes/conch is a shell library, if you're looking for something more fully-featured than c.j.shell
13:49Raynes$google raynes conch
13:49lazybot[Raynes/conch · GitHub] https://github.com/Raynes/conch
13:49RaynesHoly 183 watchers how'd that happen
13:53jcromartiehow do I interpolate some collection into the respective nodes in an enlive template?
13:54jcromartiethe nodes already exist in the template so they shouldn't be cloned
13:56JohanIVomg, IRC really is alive
13:57JohanIV...at least sort of, it seems
14:43afhammadhow do you add a leiningen dep to a local library you are developing? documentation is scarce on this
14:44DomKMafhammad: the same way you would for an application. In project.clj :dependencies
14:44Rayneshttps://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies
14:44llasramYou'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:44Raynesafhammad: See my link.
14:44RaynesDocumentation isn't *that* scarce, you likely just didn't know what it was called.
14:44llasrams,and one,and want, ; and if so probably want what Raynes said
14:45Rayness/,/\//
14:45llasramsed accepts either one :-p
14:45llasramWell, anything really
14:45RaynesPsh, sed.
14:46Raynesamalloy and I only use perl.
14:46amalloywhich also accepts anything
14:46RaynesYou haven't passed me a perl in a long time.
14:47afhammadRaynes: 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:47Raynesclojure-doc.org is super unofficial and community supported.
14:47arohnerafhammad: google for 'lein checkout dependencies'
14:47RaynesIt can be mentioned there, someone has to send a pull request first.
14:48technomancybe the change you want to see in the world or something
14:48afhammadarohner: thanks
14:49afhammadRaynes: I'll send a PR once i figure it out :)
14:49Raynesafhammad: <3
14:49dakronellasram: 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:50Raynestechnomancy: Did you just commit to el-get
14:50Raynestechnomancy: explain yourself heathen
14:50technomancyRaynes: did you see what the commit was about?
14:50RaynesHaven't looked yet
14:50technomancyit will explain everything
14:51technomancyhttps://github.com/technomancy/el-get/compare/allow-insecure?expand=1#diff-25adde20ec565805259a2e8e267c02f4R24
14:51Raynestechnomancy: )))
14:52llasramdakrone: Noted. I was hoping the interfaces wouldn't be too different, but alas
14:52dakroneyea, lots of changes
14:52dakronewell, guess it's time for some cleanup too
14:53technomancyRaynes: 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:54pepijndevoshm, it seems to me that with core.match. adding rules can actually make things faster.
14:56ghadishaybanarrdem: there is work being done on interpreting C on top of Truffle/Graal
14:57ghadishaybanarrdem: craziest thing i've ever heard. http://ssw.jku.at/Research/Papers/Grimmer13Master/
15:01arrdemghadishayban: why would you ever..
15:01llasramStack a stack of turtles on top of itself. Easiest way to get an infinite stack of turtles.
15:02AimHereWell the easiest way would be to stack a single turtle on top of itself
15:03arrdemusually that involves turning the turle inside out..
15:03arrdemthis kills the turtle
15:07teslanickDead turtle still turtle.
15:07clojurebotPardon?
15:07teslanickclojurebot: Pardon?
15:07clojurebotHuh?
15:08llasramclojurebot: a dead turtle is still a turtle.
15:09clojurebotOk.
15:09llasramclojurebot: a dead turtle?
15:09clojurebota dead turtle is still a turtle.
15:10teslanickyes.
15:11ilargso 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:15technomancyilarg: lein deploy clojars assumes your code is configured so that `lein jar` from a fresh checkout does the right hting
15:15technomancything
15:15technomancyyou are probably missing :prep-tasks
15:15arrdemghadishayban: is the thesis worth reading?
15:17ilarghm i haven't used that command yet. i've only been working with uberjar and dev stuff.
15:19ilargso the full command would be something like lein deploy clojars :prep-tasks?
15:24ilargi guess my question is, what is the prep-task expectation? cli commands to copy files where?
15:28llasramilarg: This is :prep-tasks -- https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L230-L233
15:29ilargright and i see what looks like command line invocations even though i'm not sure why the protobuf invocation is a nested vector
15:30ilargfor my clj/cljs projects, what should i be looking to put there?
15:30llasramIt depends on what tasks you need to run to get a working project
15:31llasramYou 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:32ilargthe 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:33llasramWell there you go. So you need to add :prep-tasks (whatever the cljx one is) such that `lein jar` produces a correct JAR
15:33llasramThen you should be able to `deploy` a new version
15:43ilargalright! 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:43ilargthanks llasram and techno :)
16:07technomancyyou're modifying the :base profile?
16:07technomancyilarg: that's kind of an internal lein implementation detail; it's not something that's meant to be user-modified
16:08ilargno my bad i meant the default profile in use when you define no custom profiles.
16:09technomancyoh, so just the defproject root
16:10ilargyeah
17:33cbp,(defn ಠ_ಠ [s] (throw (Exception. s)))
17:33clojurebot#'sandbox/ಠ_ಠ
17:35Raynes,(ಠ_ಠ "Well, shit")
17:35clojurebot#<Exception java.lang.Exception: Well, shit>
18:46arohnerhow do you guys debug core.async errors? exceptions disappear into the nether
18:47technomancythat's the main reason I don't write async code =)=
18:51hyPiRionarohner: Obsidian → portal → get exception back
18:52arohneris that a minecraft joke?
18:53hyPiRionit was a bad attempt at one
18:57llasramarohner: same as any other code -- printf debugging :-)
18:58arohnerllasram: 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:58alisdairdebuggers are just fancy printf frameworks
18:59arohnerthat, and stack-mangling code injectors
19:00llasramarohner: 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:03llasramWell, or old-enough
19:03llasramAny version without the random "print the exception object with no backtrace" behavior
19:09llasramHuh. 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:18hiredmanllasram: the extra 42 are because people shouldn't be doing io on that pool, but people are terrible and likely will
19:18hiredman(by io I mean blocking operations)
19:19arohnerllasram: thanks
19:20llasramI 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:34danielcomptonDoes clojure.tools.trace work with core.async?
19:39danielcomptonIs 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:40justin_smithdanielcompton: flatland/useful has that
19:41danielcomptonjustin_smith: thanks, that sounds... useful
19:42danielcomptonbadum tish
19:42justin_smithI forget what they call it though
19:43justin_smithkeyed, I think https://github.com/flatland/useful/blob/develop/src/flatland/useful/map.clj#L8
19:44danielcomptonyep keyed looks like the one
20:50gfredericksI submitted a PR to plumbing for keyed today
21:19mthvedtcan i add jvm arguments on the lein command line?
21:20amalloymthvedt: LEIN_JVM_OPTS=... lein run, i think
21:20mthvedtamalloy: thx
21:22TEttingerRaynes: sorry about the flurry of privmsgs last night.
21:22TEttingerI did solve the issue
22:34arrdemtechnomancy: do you have any suggestions for ocaml resources?
22:37justin_smitharrdem: the official ocaml docs come in the form of an introductory book by the language authors
22:37justin_smithit's pretty good (though translated from the French)
22:38rpauloarrdem: https://github.com/rizo/awesome-ocaml
22:38arrdemjustin_smith: I'll check it out. Wirth's books have been pretty good but I'm generally suspect of the "official guide"
22:39Jaoodarrdem: https://realworldocaml.org/
22:56technomancy(inc realworldocaml)
22:56lazybot⇒ 1
23:12codygmanIs 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:15ToxicFrogArgh
23:15ToxicFrogThe fact (nil? '()) is false keeps tripping me up
23:16johnwalkercodygman: core memoize will still cache functions that aren't pure
23:19codygmanjohnwalker: 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:21johnwalkerwell, that would work, but whether it's a good idea depends on what you're doing ;p
23:22xeqicodygman: 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:24johnwalkerxeqi: it seems like it would be defmemoized http-req [headers url]
23:25justin_smithToxicFrog: seq is helpful for that
23:25justin_smith,(nil? (set ()))
23:25clojurebotfalse
23:25justin_smitherr...
23:25justin_smith,(nil? (seq ()))
23:25clojurebottrue
23:26johnwalkerxeqi: actually nevermind, you were talking about something else entirely
23:28metellus,()
23:28clojurebot()
23:28metellus,(conj () :a)
23:28clojurebot(:a)
23:29metellusI didn't realize you could use () instead of '()
23:32ToxicFrogjustin_smith: yeah, in this case I was processing a list and using (nil? list) rather than (empty? list)
23:32ToxicFrogAnd blowing the stack as a result
23:32justin_smithahh
23:33mthvedtpart of me wants () to throw an exception
23:34johnwalkerit throws EmptyListException
23:34jarofghostsorly
23:34justin_smithjohnwalker: in what context does it do that?
23:35johnwalkererr, it doesn't
23:35justin_smith,(first ())
23:35clojurebotnil
23:35jarofghostsok
23:35jarofghostsbecause ' just prevents evaluation, right?
23:35jarofghostsso () should be valid
23:35jarofghostsjust an empty list
23:35justin_smithwell, otherwise (*) would mean invoke what's inside
23:36justin_smithrather than just have it be a list
23:36johnwalker,(+ (*) (*) (*))
23:36clojurebot3
23:36justin_smithI meant * as in "zero or more things"
23:37jarofghostsah i imagine it as (+)
23:37justin_smithexcept in case, and probably some other situations I am missing
23:37jarofghoststhough im totally a newbie here
23:37justin_smith,(+)
23:37clojurebot0
23:37jarofghostssorry i mean in the context of regex
23:37jarofghosts+ being 1 or more
23:38justin_smithof course :)
23:38jarofghosts:P
23:40metellus,()
23:40clojurebot()
23:40metellus,(+ 1 2)
23:40clojurebot3
23:40metellusin those cases doesn't it basically mean invoke what's inside?
23:41metellusin the second case, I mean
23:41justin_smith,() ; is a literal
23:41justin_smithright
23:41clojurebot()
23:41justin_smith,(case 1 (0 2 4) :even (1 3 5) :odd)
23:41clojurebot:odd
23:41justin_smiththe other exception I can think of
23:43mthvedt() seems like the syntax version of a divide by zero
23:43xeqicodygman: as for review, I'd probably write it like http://pastebin.com/7q8fv0JA
23:45mthvedtmaybe i can find a nice monoid on s-expressions to show () shouldn’t be evaluatable