#clojure logs

2015-03-04

00:01ddellacostajustin_smith: thanks, that's the conversation I needed to have. Much appreciated
00:01justin_smithnp
00:07rhg135i miss clojure so much D:
00:08ob_what happened?
00:08rhg135after writing 3000 lines of java for an app that still only half-works i feel sad
00:08ob_:(
00:09ob_rewrite in clojure, problem solved!
00:09rhg135android
00:09rhg135i guess cljs exists, but glue code
00:10arrdemlein-android exists..
00:10codestormwould be cool if android had a first class FP option
00:11arrdemthere's a GSoC project proposed to build a Clojure -> ART compiler..
00:12ob_welcome your new overlords android and ios
00:12ob_and js
00:12arrdemeh compiler targets :D
00:13Guthurthere has always been overlords they just get toppled now and then
00:18cemerickarrdem: do you have a link for that beyond what's @ http://dev.clojure.org/display/community/Project+Ideas
00:18cemerick?
00:18arrdemcemerick: neg.
00:20rhg135on the upside i atleast am using clj_ds
00:20justin_smithI won't ask what that is and just imagine that's a clojure that targets the nintendo ds
00:20rhg135but no literals make rhg135 sad
00:25rhg135i know i enjoy reading code so here in case anyone wants to read java: https://github.com/rhg/derpyirc
00:27GuthurI have a template, and i would like to run a shell command when doing lein new
00:27Guthuris there any best practice for that
00:28justin_smithif lein lets you do that, it would be a very interesting way to root people's boxes
00:28rhg135|zzzit's called so mainly due to beaing a temp name, but it's quite fitting if you read the code
00:28rhg135|zzzcast all the things!
00:29johnmendoncain the repl, how do I look up docs for something like clojure.lang.Namespace?
00:29justin_smith,(apropos "javadoc")
00:29clojurebot()
00:30justin_smithhrmph
00:30Guthurjustin_smith: well the template seems to be just a function that lein calls which "renders" the files using what ever name is passed in
00:30Guthurso presumably one could invoke a shell command there
00:30justin_smithjohnmendonca: clojure.repl/javadoc can do that for you
00:30Guthurbut i was wondering if there were some other approach
00:31justin_smithGuthur: yes, and given that no OS is without local privelege escelation bugs, it would be a way to get root on dev boxes
00:31Guthuryeah, but then everyone is careful about code they run on their boxes, right
00:31Guthurhehe
00:31Guthurthis is for myself so I not really worried
00:32johnmendoncajustin_smith: thanks javadoc is working, I thought I tried it already...
00:32justin_smith"wget http://i-own-ur-box | sudo sh" is always the first line of my install guide
00:33TEttingerjustin_smith, quick give me a simple transducer example! I'm trying to show off what clojure does
00:33johnmendoncathough when i run (javadoc clojure.lang.Namespace) it opens a google tab with two not useful result
00:33justin_smithjohnmendonca: wow, that's weird
00:34justin_smithTEttinger: ##(sequence (comp (take 10) (map inc) (filter even?)) (range))
00:34lazybot⇒ (2 4 6 8 10)
00:34justin_smithnot the greatest example - what's cool there isn't really visible from the syntax
00:35TEttinger(inc justin_smith) ; thanks, I can understand it
00:35lazybot⇒ 204
00:37justin_smithGuthur: in all seriousness, I am sure you can fit a call to clojure.java.shell/sh into your driver function. But I also feel sketched out about the fact that it would be so easy.
00:37engblomIt seem like Gitorious has been the prefered place for Clojure code. As it will close on June 1 because Gitlab aquired Gitorious, lets hope all projects move to the same place so you do not end up searching many sites for suitable libraries and stuff.
00:38justin_smithengblom: what's on gitorious? I don't know of any clojure projects there.
00:39justin_smithengblom: most of us are using github, no? I have a paid account, I would think they would have told me if they were shutting down.
00:40engblomjustin_smith: You are right. I must have slept too little as when I woke up this morning and saw the news about Gitorious I mixed it with Github.
00:40justin_smithoh, OK
00:41justin_smithengblom: anyone who hangs out here has seen me have sillier mixups
01:01Niac_what is about the side-effect-free in clojure?
01:11numbertenis the idiomatic way to create directories in clojure just java interop?
01:11arrdemclojure.java.io is your friend
01:16l3dxhow do I get clojure to call a method with one required arg + varargs instead of the overload with a single arg of a different type?
01:17l3dxspecifically http://docs.oracle.com/javase/7/docs/api/java/nio/file/Paths.html#get(java.lang.String,%20java.lang.String...)
01:17numbertenarrdem: thanks :)
01:17l3dxinsetead of the one taking a URI
01:21l3dxI'm trying to call get(String)
01:22cemerickl3dx: (java.nio.file.Paths/get "foo" (into-array String []))
01:26EremoxWhy is there no official standard on clojure? Is it to young?
01:26l3dxcemerick: thanks :)
01:27arrdemEremox: there is no standard library or parser spec.
01:27arrdemwe are entirely implementation defined
01:28TEttingerthere are 3 main implementations, all of which have small platform differences in how some parts of the language work. CLJS is the most different, and even that is still pretty close to clojure
01:29TEttinger(inc cemerick) ; thanks, that's handy
01:29lazybot⇒ 18
01:30mercwithamouthhey is there a way for me to tell leiningen to use an older version of a template? like i'd like to use luminus...and JUST purchased a book that uses the web app that was published last month. however 2 days ago luminus updated to a new version that's completely different
03:15dysfunmercwithamouth: hrm, what's changed?
03:15dysfunhrm, they appear to have added ragtime
03:17dysfunhrm, they've changed a few things
03:19mercwithamouthdysfun: hey. lib-noir is gone
03:19mercwithamouthquite a few things it seems
03:21dysfunnoir-exception is still there
03:21dysfuni don't use lib-noir or noir-exception in my stuff
03:21dysfuni have been using the luminus template to give me a base and then heavily customising it
03:21dysfunlooks like i'm going to have to just go build my own template now
03:27mercwithamouthdysfun: yeah. i just bought clojure web development essentials and now it looks like i won't be able to follow it as it
03:47dysfunmercwithamouth: that's unfortunate. but you can check out one of my projects based on the old luminus if it helps
03:47dysfunlet me see what i've got that i didn't touch much after generation
03:49dysfunoh, i've just found one that i generated randomly and didn't use
03:49dysfunyou should be able to follow your book with that
03:53dysfunthe state of web development in clojure is such that i keep finding cool libraries i want to integrate
03:53dysfunso you'll probably move on from old luminus quite naturally
05:49devllHi,how to splice a lazy seq in macro?
05:50devll(defmacro splice-test [col]
05:50devll `(println ~@con))
05:50devll(splice-test (range 10))
05:50devll(splice-test (doall (range 10)))
05:50devllnone of all working.
05:52devllam I being muted for asking too easy questions?
05:52Bronsadevll: that doesn't make sense, you're trying to use the runtime value of (range 10) at compile time
05:52devlloh
05:53Bronsadevll: what exactly is that you want to do?
05:53devllI wanted to do mysql batch insert
05:54devll(j/insert! db-spec :fruit
05:54devll {:name "Pomegranate" :appearance "fresh" :cost 585}
05:54devll {:name "Kiwifruit" :grade 93})
05:55Bronsadevll: can't you justs iterate over a collection with map/reduce/doseq?
05:55devllslow
05:55devlltoo slow
05:55Bronsathat's not true
05:56Bronsadoseq expands to a loop, it's hardly going to be too slow
05:56devllyes. doseq is not slow.
05:57devllinserting one by one is.
05:57wagjodevll: (apply j/insert db-spec :fruit maps)
05:57Bronsagotcha, then you didn't explain yourself. use apply
05:58devllsorry.My English sucks.so does my programming.I am working on it.
05:58devllthanks.
05:59devll(inc wagjo)
05:59lazybot⇒ 4
05:59Bronsano worries, try what wagjo said
05:59wagjoyou're welcome
06:08enadensp
06:11egliit appears that I can't call juxt on macros
06:11egliI would like to ((juxt .getMessage .getLineNumber) exception)
06:12wagjoegli: juxt works with functions, and macros are not functions
06:13egliwagjo: I figured as much, thanks
06:13wagjoegli: try -> macro
06:13egliI want to do (zipmap [:error :line :column] ((juxt .getMessage .getLineNumber .getColumnNumber) exception))
06:13egliinstead of {:error (.getMessage exception)
06:13egli :line (.getLineNumber exception)
06:13egli :column (.getColumnNumber exception)}
06:14eglibut maybe it's not worth the hassle
06:15egliwagjo: -> probably doesn't work in this case
06:15wagjoegli: yep, won't work for your case
06:15Bronsaegli: .getMessage & co are neither function nor macros
06:16egliBronsa: ah .getMessage are macros that expand to a special form
06:16Bronsathey are sugar for . forms that only make sense in a call position, you can't use .foo as a higher-order method call
06:17egliBronsa: ok all clear now. Thanks
06:18wagjoegli: maybe you can use memfn
06:20wagjo,((juxt (memfn isEmpty) (memfn length)) "foo bar")
06:20clojurebot[false 7]
06:22egliwagjo: ah, thanks. Just what the doctor ordered
06:22Bronsawagjo: that code requires reflection. I don't think it's worth using memfn in egli's case
06:23wagjoyes the reflection is a big tradeoff here
06:23Bronsa(let [x (x.)] {:foo (.foo x) :bar (.bar x)}) vs (zipmap [:foo :bar] ((juxt (memfn ^x foo) (memfn ^x bar)) x))
06:23BronsaI would never write the latter, there's really no advantage
06:28wagjoegli: Bronsa: how about using bean for this?
06:29wagjo,(try (/ 1 0) (catch Exception e (bean (aget (.getStackTrace e) 0))))
06:29clojurebotwagjo: Titim gan éirí ort.
06:29wagjo,(try (/ 1 0) (catch Exception e (bean (aget (.getStackTrace e) 0))))
06:29clojurebotwagjo: Titim gan éirí ort.
06:33Bronsawagjo: that might be a good idea however I remember bean not caching the values, maybe I'm just mis-remembering though
06:34egliwagjo: seems like a clever idea. Maybe too clever though, i.e. border line obfuscating for such a simple use case
06:35Bronsa,(def a (Exception. "foo"))
06:35clojurebot#'sandbox/a
06:35Bronsa,(def b (bean a))
06:35clojurebot#'sandbox/b
06:35Bronsa,(seq (:stackTrace b))
06:35clojurebot(#<StackTraceElement sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)> #<StackTraceElement sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)> #<StackTraceElement sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)> #<StackTraceElement java.lang.reflect.Constructor.newInstance(Constructo...
06:35Bronsa,(.setStackTrace a (into-array StackTraceElement []))
06:35clojurebotnil
06:35Bronsa,(seq (:stackTrace b))
06:35clojurebotnil
06:35Bronsayeah, I really don't like bean because of this
06:36Bronsa,(instance? clojure.lang.IPersistentCollection b)
06:36clojurebottrue
06:36Bronsabut it's actually mutable
06:36wagjoheh
06:36clojurebotIt's greek to me.
06:37minoraciao
06:37minora!list
06:39minora|list
06:39Bronsaminora: that won't work
06:40minorawhy dont work?
06:41Bronsaminora: that's not a command implemented in any bot here. are you sure you're in the right channel? this is about the clojure programming language.
06:41minoraok thanks you
06:42minorabye
07:55noncomi have some questions regarding google guava
07:55noncom1) is using google guava eventbus a good practice for clojure?
07:55noncom2) does it have any advantages/disadvantages to core.async?
07:56noncom3) does anyone have actual experience with that?
07:56agarmannever used guava in Clojure. Used it a lot in Scala & Java.
07:56mavbozoi think stuart halloway and rich hickey found guava good enough to use in datomic
07:56mavbozobut i don't know if they use guava's eventbus
07:57noncomdatamic is too, mainly a java program afaik
07:58justin_smiththe fact that guava eventbus uses annotations makes it a bit less convenient from clojure
07:59tcrayford____noncom: datomic is *mostly* clojure from my understanding
07:59justin_smithannotations can be done from clojure, but it's a little awkward
07:59tcrayford____noncom: I use guava for yellerapp.com (just the caching though). It's been good so far
07:59tcrayford____(my api's 99th percentile response latency is ~300 microseconds, primarily because of guava caching)
08:00noncomtcrayford____: so, you say it is fast?
08:00tcrayford____noncom: well, the cache is fast enough for my purposes at least ;)
08:01tcrayford____noncom: no judging *at all* on the rest of the library, I use like 1% of it
08:01noncomok, so yes, eventbus is based on annotations, which would look strange in clojure i think (never done them like that)
08:01noncomtcrayford____: is yellerapp.com part where you use them written in clojure or java?
08:02tcrayford____I think many folk would recommend core.async or looking at the j.u.c queues (which are the queues datomic uses internally)
08:02tcrayford____noncom: I do *not* use eventbus, just guava's caching. It's all clojure
08:02noncomah, got it. just caching :)
08:02justin_smithtcrayford____: exactly - core.async for convenience / clarity, j.u.c queues when you need more perf
08:03tcrayford____or the disruptor or whatever. There are a lot of options for in memory java queues with different tradeoffs
08:03justin_smithright
08:04justin_smithis disruptor really usable from clojure? it has some weird constraints to go with that blazing performance
08:04tcrayford____(http://research.neustar.biz/tag/disruptor/ covers a buncha research around them [disclaimer, from a friend's company])
08:04tcrayford____justin_smith: it is, afaik. No annotations there, just a *lot* of mutability
08:04justin_smithgotta love ringbuffers :)
08:06noncomhow much lower performance can i expect from core.async vs j.u.c ?
08:06noncom(if it is answerable at all)
08:06tcrayford____depends entirely on your use case, machine configuration, jvm etc
08:07tcrayford____they're both pretty quick though
08:07justin_smithnoncom: I'd say don't worry about it until you have a bottleneck. Sadly I don't have a concrete measured comparison. I should make one one of these days.
08:07tcrayford____iirc core.async benches at something like 12m channel transfers/s or so (but that's from memory, and I didn't verify the benchmarks like I do these days)
08:07tcrayford____(and those benches were likely not on the machines you're gonna be running in prod either)
08:08noncomoh, well, that far covers my needs, i think :)
08:08tcrayford____likely most apps don't need anything like that though haha :)
08:08tcrayford____yeah. I'd just use core.async, it's an easy reach for most clojure devs, is well adopted etc
08:09noncomyes, i just want to choose a mechanism for messaging inside the app, that won't be even a 100 channels and no big data sent over it, just small messages
08:09noncomi guess, i'll pick core.async again for that :)
08:09tcrayford____neat!
08:09tcrayford____glad we could help :)
08:09noncomthanks :)
08:09justin_smithtcrayford____: I've noticed performance loss from using core.async. Maybe it's related to the core.async state machine and hotspot? not sure. There's more going on than just channel throughput anyway I think.
08:11noncomjustin_smith: what was your scenario?
08:11tcrayford____justin_smith: the go macro will most likely prevent inlining because of the code bloat it generates if you put a lot of code in it
08:12tcrayford____noncom: but again, the JVM is *very* fast, and it's likely that ain't gonna matter at all for your use case
08:12noncomyeah, my case is definitely the "light" one
08:13noncomi would go with j.u.c on something heavyweight then
08:13justin_smithnoncom: core.async coordinating requests / caching on an image resize server
08:14justin_smithit was more about latency, even for cached result
08:14justin_smiths
08:14justin_smithalso, I should do some more focused benchmarks, because it could have been something else stupid in my implementation logic :)
08:25arav93Hi! :)
08:26dysfuni need to maintain some dependency information. is there a library that aids in performing cycle detection?
08:27Bronsadysfun: tools.namespace has a namespace that handles dependency graphs
08:27dysfunyes, which uses 'component'
08:27dysfunbut i'm struggling to reason about the behaviour when you create cycles
08:27Bronsatools.namespace doesn't use component
08:27dysfunsorry, 'dependency'
08:28dysfunhttps://github.com/stuartsierra/dependency
08:29dysfunah, it throws an exception. i hadn't spotted that
08:29stuartsierraThe 'dependency' is just a copy of the dependency graph from tools.namespace
08:29dysfunthat's acceptable
08:30stuartsierraBoth are just a small adaptation from Clojure's hierarchy graph functions.
08:30dysfun*nod*
08:30dysfunthanks
08:33dysfunone of the things i love about clojure incidentally is that you randomly bump into the people who write the libraries you use on irc. it's quite a nice thing :)
09:07noncomi am trying to find the best way to write the macro: https://www.refheap.com/98107
09:07noncomplease could someone answer questions 1 and 2, written in the comments?
09:08dysfunyou're worried about performance loss using apply?
09:08noncomthe aim of the macro is to accept a [] of functions and apply the args to all of them, filtering out nils
09:08dysfuni would suggest not to be in the general case
09:08noncomdysfun: yeah, also, using apply implies using (into []), at least the way i have managed to make it work with apply. can i avoid (into [])
09:08noncom?
09:11Bronsanoncom: http://sprunge.us/MSOD?clj
09:12noncomBronsa: wow
09:13noncomso actually macros can have several `() places..
09:13noncomdid not know that
09:14Bronsaor even http://sprunge.us/UQUF?clj
09:14noncombut that's logical..
09:14Bronsanoncom: ` has nothing to do with macros
09:14noncomyes, i know.. but i just could not think of it this way :)
09:15noncomso, list* is even better..
09:38justin_smithnoncom: why not ((apply juxt (filter identity funs)) args)
09:40justin_smith,((apply juxt (filter identity [nil + - nil * /])) 5 3)
09:40clojurebot[8 2 15 5/3]
09:46justin_smitheven if you decide a macro is better, juxt can eliminate your apply / into
09:47justin_smitheg. fns-apps `((juxt ~@fns) ~@args)
09:49noncomjustin_smith: hmm, not really familiar with juxt much :) but i knew that a moment would come to get to know it better..
09:50justin_smithnoncom: the above should replace your fns-apps binding in the let block. The difference is it returns a vector of all the results, so you would want a `(peek ~fns-apps) at the end instead of the do
09:50justin_smith(if you only wanted to return the result of the last function)
09:51dm3is there a way to sidestep git tag signing on lein vcs tag?
09:52noncomyeah, juxt returns a vector.. well, in my particular usecade all fns are pure side-effects (it is an IO stuff), but as i make this macro into my library of useful things, i guess, juxt is a nice thing to have since it is more general in returning a vector, not making assumptions on fns being side-effetless
09:52justin_smithyeah, if you are typically ignoring the return value, may as well just return the vector if you use juxt
11:23nsjphwhat's a good file-backed key value store i can use with clojure?
11:24nsjphaside from just spitting out EDN to disk
11:34noncomhsjph: probably none.. widely known.. but why not edn?
11:35justin_smiththis makes me wonder if anyone has done a simple edn -> directory structure mapping
11:36nsjphnoncom: i don't feel like thinking about thread-safety and database-like resiliency for a flat file
11:36nsjphi also dont feel like using sqlite here
11:37justin_smithnumbers, strings would become files - the tricky part would be hash-maps with composite keys...
11:37nsjphso i was wondering what key-value stores with file-based backends (ala sqlite) are about
11:37justin_smithnsjph: there's mongo, if you are aware of the pitfalls and don't mind them
11:37justin_smithcongomongo
11:37nsjphjustin_smith: oh, and i dont want to install a database server
11:37noncomnsjph: maybe http://www.h2database.com/html/faq.html#database_files ?
11:37nsjphparticularly mongo ;)
11:38justin_smithwell, for sql, embedded h2 is an option, yeah
11:38nsjphi should probably just bite the bullet and use either sqlite or h2
11:38justin_smithwith a file backend
11:38justin_smithnsjph: couchdb?
11:39nsjphno network server :)
11:39noncomorient db also. they claimed to provide a local db mode
11:39nsjphi've also used couchdb, didn't mind it
11:39nsjphnot a bad db
11:39hiredmanhttp://hiredman.github.io/Amontillado/
11:40nsjphinteresting
11:41justin_smith(inc hiredman)
11:41lazybot⇒ 74
11:41justin_smiththat looks great
11:43noncomjustin_smith: so, what did you say about mapping edn to filesystem?
11:43noncomwhat is the use about this?
11:45justin_smithnoncom: it would mean that the persistent data structure operations could be mapped to file system operations
11:46justin_smithincluding cheap immutable update
11:46justin_smiththeoretically
11:46justin_smithmaybe it's a silly idea
11:46noncomjustin_smith: wow, why did not someone just made that? are there any problems with that?
11:46justin_smiththere's probably some pitfall that I am overlooking
11:47justin_smitheg. something that works in the jvm but not on a file system level
11:47justin_smithmaybe it's just the added difficulty of making it work on more than one OS (because they don't use the same filesystems, so they have different rules regarding locking etc.)
11:48noncomjava.nio.Files seems to target just that - working flawlessly on any fs
11:48noncom(available from java 7 and up)
11:48justin_smithclojure targets 1.5
11:48justin_smitherr, 5 by that system :)
11:48noncombut we can use any java version from inside clojure anyway...
11:57sdegutisIs there any chance for a ClojureScript compiler that doesn't depend on the Google Closure Compiler or Library at all?
11:57sdegutisI'd love to just write Clojure and let it compile down into pure JavaScript.
11:59justin_smithsdegutis: what about something like scriptjure? https://github.com/arohner/scriptjure
12:00sdegutisjustin_smith: not a bad idea
12:00sdegutisthanks
12:00justin_smithit doesn't do the clojure semantics, it's just a syntax translator
12:00sdegutisThat's fine, I don't mind JS semantics.
12:00sdegutisI'm just tired of managing commas.
12:01justin_smithsdegutis has forsaken immutability
12:02sdegutisjustin_smith: "If a tree falls in the woods, does it make a sound? If a pure function mutates some local data in order to produce an immutable return value, is that ok?" - Rich Hickey
12:02justin_smith:)
12:02sdegutisjustin_smith: I just use _.cloneDeep(json) for immutability
12:02sdegutiswhere _=lodash
12:02sdegutisjustin_smith: check out https://github.com/sdegutis/mybudget/blob/master/database.js btw, it was designed inspired by clojure's immutability
12:03justin_smithcool
12:03sdegutisI love that the immutability aspect made undo/redo into one-liners
12:03sdegutisOn the other hand, it's probably ridiculously inefficient compared to using something like Immutability.js
12:03sdegutis(which I assume does data-structure sharing etc)
12:04justin_smithyeah, proper persistent data structures
12:19puredangerjustin_smith: clojure targets Java 1.6, not 1.5
12:19justin_smithpuredanger: is that a recent change?
12:19puredangerClojure 1.6
12:19justin_smithoh, TIL, thanks
12:20justin_smith(inc puredanger)
12:20lazybot⇒ 34
12:20puredangerClojure 1.7 will also target Java 1.6+
12:20danielglauserpuredanger: what Java version does Clojure 1.7 target?
12:20justin_smithpuredanger: still supports the point I was making about 1.7 features :)
12:20puredangerClojure 1.8 will likely change to target Java 1.7+
12:21puredangerJava 1.7 public updates end next month
12:21puredangerhttp://www.oracle.com/technetwork/java/eol-135779.html
12:22puredangerJava 1.6 public updates ended 2 years ago
12:22puredangerif you want to use 1.7+ stuff but fall back to something else, search for the compile-if macro in Clojure's source
12:35eflynnSo I’m writing a scheme interpreter in clojure, and i’m wondering how i should handle mutable state
12:36eflynnI was thinking something like (eval exp env) -> (exp, env2)
12:36eflynnwhere changes in the environment are returned
12:36eflynnany thoughts
12:50justin_smitheflynn: one advantage of that (rather than an implicit global env, or env represented as a bunch of mutable objects) is that it is flexible enough to map cleanly to the other alternatives
12:51eflynnjustin_smith: map as in rewrite?
12:52justin_smitheflynn: you can implement a global env object, or separate mutable objects for each variable, based on the explicit passing of state
12:52justin_smiththe translation does not work as well going the other way
12:52justin_smithyou can't really model explicit state passing using a global env or mutable objects, at least not cleanly
12:53eflynnexplicit state passing with a global env wouldn’t make sense
12:54justin_smitheflynn: right, I am saying that given the implementation of explicit state passing, you can implement the others
12:54justin_smithbut not visa versa
12:54justin_smithso it's a superset of the others
12:54eflynnok
12:55justin_smithit would involve a wrapper function most likely
12:55justin_smithbut it's harder to write an unwrapper function :)
14:33dbelllong time no see clojurists...is there a way to get the # of args a fn takes? I've dug around in the source a bit but haven't found anything
14:34dnolendbell: you can only do that via the meta of a var
14:34dnolen,(-> #'first meta :arglists)
14:34clojurebot([coll])
14:34dnolendbell: ^
14:35dbellhow about in cljs?
14:35dbellwhat w/no vars
14:36dnolendbell: the will work in CLJS too
14:36dnolens/the/that
14:41justin_smith,(defn inane-arities [f] (keep #(try (apply f (repeat % nil)) % (catch clojure.lang.ArityException e nil) (catch Exception e %)) (range 1024)))
14:41clojurebotjustin_smith: Pardon?
14:41justin_smith:P
14:41justin_smithanyway, that code is stupid, but it returns all argument counts the function accepts below 1024
14:41justin_smithdon't use it, just a proof of concept
14:45dbelljustin, ha, yeah, i thought of that too, but it felt, uh, well, you know
14:45justin_smitha little dumb?
14:45dbellha, yeah
14:45dbelldavid, i must have misunderstood, but i can't seem to access vars in cljs
14:46dbelljustin---i might take that and use it to make a lookup table
14:47justin_smithhaha, oh man...
14:59justin_smithand thanks to that silliness I learn...
14:59justin_smith,(conj)
14:59clojurebot[]
15:02justin_smith(conj Double/NaN)
15:02justin_smith,(conj Double/NaN)
15:02clojurebotNaN
15:31amalloydnolen: anything i should be doing to make http://dev.clojure.org/jira/browse/LOGIC-167 more palatable? it's not like you to leave a patch unmerged for longer than ten minutes
15:31dnolenamalloy: nah nothing to do just been busy with other stuff
15:31amalloyokay
15:31dnolenother people have pinged me for another core.logic release since various fixes are still sitting around
15:31dnolenwill cut a release on Friday
15:33BeamedI hope you guys don't mind me asking, but I was having trouble with a random 4Clojure problem and was hoping to ask for some advice
15:33dbellfire away
15:34Beamedbasically, it's an implementation of interpose, and my solution is just (fn [val & seq]( reduce #(concat %1 val %2) seq) )
15:35Beamedbut for some reason, that just returns the passed sequence, rather than concatenating it with val :/
15:35Beamedfor example, given 0 [1 2 3] it should provide [1 0 2 0 3] , but it just returns [1 2 3]
15:36justin_smiththat's odd, because (concat 1 0 2) shouldn't work
15:36amalloyBeamed: you probably mean [val seq]
15:36Glenjamin,(concat 1 0 2)
15:36BeamedI ran it through the lein repl and it does the same justin
15:36clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
15:37Glenjaminah, i see why it doesn't error
15:37amalloyjustin_smith: seq here is [[1 2 3]], not [1 2 3] as intended
15:37justin_smithBeamed: it worked by accident, because of the issue amalloy points out
15:37Beamedamalloy - I think that's why it's not crashing; I was a dope and made seq a variadic param. Doy
15:37amalloyright
15:37Glenjaminthe & and missing initial case combine
15:38Beamedthanks, I knew it was something like that.
15:40amalloyBeamed: happy 4clojuring
15:50Beamedhah, and then I see it was as simple as combining but-last and interweave >_<
15:51amalloyBeamed: well. the thing about 4clojure is, you solve it in whatever way advances your understanding best
15:51amalloyyou wanted practice using reduce, so you used reduce
15:52amalloythat kind of flexibility is one of my favorite things about it
15:52blake_This is very true. You can go back and solve the same problem multiple times to gain insight into different mechanics.
15:54amalloyfor example when i solved 4clojure problems i already felt quite comfortable with combining built-in functions like map, filter, reduce, whatever, so i probably would have easily seen a solution like the second one you mentioned. but i wanted more practice with manual recursion, so i solved the problems that way instead
15:56BeamedYeah, you're right - I'll comb through ti again when I know more about all the built-in functions to see how simple and elegant I can re-do it - for now, I'll try learning them at all.
15:56BeamedThanks!
15:56puredangeras always, http://clojure.org/cheatsheet is a great resource
16:00amalloyis (some-> x (f)) a better or worse way to write (when x (f x))?
16:01justin_smithamalloy: I would usually express that as (and x (f x)) but maybe that's weird
16:01puredangerthe when is clearer to me at a glance
16:01dbelli would do what justin would do
16:02dbellbut some-> isn't well known
16:02dbellso maybe not such a bad thing
16:02amalloyjustin_smith: i don't like the and at all
16:02ToxicFrogamalloy: I'd write that as (some-> x f) or (and x (f x)), but I prefer the former.
16:02amalloybut i guess i haven't mentioned whether f is for side effects or values (it's side effectts)
16:03justin_smithoh yeah, I wouldn't use and for side effects
16:03amalloyjustin_smith: another thing is, to use when or and you have to actually name the thing; with some-> you can get away with never naming it
16:04justin_smithwell, you could generate it in context the same as you did with some->
16:04justin_smithor am I missing something there?
16:04justin_smithahh, right
16:04justin_smithdon't mind me, I get it now
16:04justin_smithyes, that's a clincher for some->
16:08ToxicFrog,(doc when)
16:08clojurebot"([test & body]); Evaluates test. If logical true, evaluates body in an implicit do."
16:08ToxicFrogOh that's handy.
16:08noncomi am writing an app that has a controlling messaging system in it, realized with core.async. i am thinking about using vectors for messages, where the first kw is the message id and then goes some parameters.
16:09noncommy wuestion is: will constructing a vector for each message be an expensive operation?
16:09amalloynoncom: are you writing the firmware for a pacemaker?
16:10noncombasically, a multimedia app. for example, i plan to use such messages for spreading mouse cursor parameters into the app
16:10justin_smithnoncom: depending what you do with it, the vector overhead isn't likely to be a big deal. Couldn't hurt to benchmark vector vs. list, it shouldn't be hard to write your code so they could be swapped out
16:10noncomor to facilitate messages between ui elements
16:10noncomthink of like a complex 3d game level scripting
16:11amalloynoncom: it was a rhetorical question, meant to imply: "unless you are writing software where the delay might kill somebody, focusing on microoptimizations like trying to reduce the number of vectors you allocate is pointless folly"
16:11puredangerhow are you going to *use* the data (indexed access, etc)?
16:12amalloyadditionally there are zillions of vector allocations you can't do anything about going on all the time, so removing some of yours won't have any substantial impact
16:12noncomoh :D
16:13noncomyes, data in the messages are access and some params
16:13noncommore like bash commands with params. a similar kind of load/idea
16:14puredangerif you need indexed access, then the cost of that (or not getting that) is probably more important than constructing the vector. but if you're really trying to push memory/perf, you could also consider arrays.
16:15puredangerin general, any "which data structure" question in clojure is often better approached first from the "how will it be used" angle
16:15amalloy(inc puredanger)
16:15lazybot⇒ 35
16:16noncomwell, like generating and destructuring 1000 []/s is ok?
16:17puredangersure :)
16:17puredanger(I have no idea really)
16:17puredangerwhy guess when you can test?
16:18noncomoh sure :)
16:18amalloynoncom: put an abstraction layer in between your logic and the data structure it manipulates, and then you can change it if you end up needing to do something else
16:18noncomright, that's nice !
16:20amalloypersonally my default choice would be to build more objects, not fewer, something like {:cmd "ls" :args ["/var/lib"]}. but it'll all depend on how you want to use your data, like puredanger says
17:38imanc_is there a way to break into the repl in some executing code similar to python's import pdb; pdb.set_trace() ?
17:45justin_smithimanc_: you can get close with jdb (but it's not clojure aware, you only see the jvm level stuff) or with cursive (not sure how extensively the debugging is implemented, but I know it is present)
17:46justin_smithand I meant to add, the debug tooling in cursive is more extensive than with any other clojure environment I know of
17:49imanc_OK, cursive sounds like the way forward :)
18:39farhavenasdffffff
18:39farhaven.
18:50cflemingimanc_: With Cursive you can set breakpoints and when it stops you can evaluate expressions
18:50cflemingimanc_: It's not quite a full REPL (yet) but it's pretty useful
18:51cflemingimanc_: And you can break on uncaught exceptions etc
18:51cflemingimanc_: I'll be talking about it and demoing it at Clojure/West actually
18:54the_dankogreetings
18:55the_dankoanyone know how to do a "ctrl-R" style command history search in the cursive REPL?
18:56cflemingthe_danko: Greetings. You're looking for Tools->REPL->Search REPL History
18:57the_dankosweet, thanks
18:57the_dankowill remap that guy
18:57cflemingthe_danko: Narrows down on typing, when you select it'll copy the command to the REPL editor or shift-enter will execute immediately
18:57the_dankoalso, what does this load forms in repl namespace fellow do?
18:58the_dankocfleming i was hoping you would be around!
18:58cflemingthe_danko: You mean Run top form in REPL?
18:58cflemingthe_danko: I saw the IRC bat-signal
18:58the_dankoha
18:59the_dankoi mean in settings
18:59cflemingthe_danko: Run top form in REPL finds the top-level form that your cursor is in, and sends that to the REPL for execution
18:59the_dankounder load out of date files transitively
18:59cflemingthe_danko: Ah
18:59cflemingthe_danko: That controls the namespace that's used when executing forms from the editor.
19:00michaniskin|BNCis there a library that will return #'clojure.core/ex-info, given the string "clojure.core$ex_info" (but for the java class name of any clojure function)?
19:00the_dankocfleming so on this subject, i do load file in repl a lot as i am working.
19:00cflemingthe_danko: So you send a form from the editor using Run top form or whatever - if that setting is checked, the form will be executed in the current namespace of the REPL. If it's not checked, the form will be run in the namespace of the file the form came from.
19:01the_dankocleming that is idomatic, no? but then i have to do ('using editor.namespace)
19:01the_dankoidiomatic
19:01the_dankoam i doing something wrong?
19:02the_dankouse
19:02the_dankonot using
19:02cflemingthe_danko: I'm not sure what you mean - you're talking about when you load a file in the REPL?
19:02the_dankoyeah so i have a file cljlearn.core
19:02the_dankoand my repl in the user namespace
19:03the_dankoand when i change a function in cljlearn.core and reload it
19:03the_dankosorry i mean when i add a function to cljlearn.core
19:03the_dankoi have to do (use 'cljlearn.core)
19:03the_dankoagain
19:03justin_smiththe_danko: that won't help
19:03justin_smithbecause you have loaded the ns already
19:04the_dankowell if i add something to the namespace
19:04the_dankoa new function
19:04the_dankothen i have to reload it
19:04justin_smithmaybe, but use won't reload
19:04the_dankobasically, i want to know what the best practice is as far as what namespace to keep the REPL in
19:04the_dankorelative to the file i am working on in the editor
19:05cflemingYeah, in that case you will have to, because the symbols are all interned at the point you (use...)
19:05cflemingSo you can just switch to that namespace and work in there
19:05the_dankocfleming is that what you do?
19:05cflemingOr you can create an alias to it, and use (alias/function ...)
19:05the_danko(in-ns 'cljlearn.core)
19:06cflemingthe_danko: Yeah, or there's a Cursive command to switch to the current ns
19:06the_dankocfleming and then (use 'clojure.core) and a bunch of other sh*t?
19:06cflemingthe_danko: It depends what I'm doing. I usually use aliases
19:06the_dankoso in the repl you set up an alias
19:06justin_smiththe_danko: (clojure.core/refer-clojure) because use won't work if clojure isn't referred yet
19:07the_dankoha yeah i mean so that seems like a pain
19:07justin_smiththe_danko: but if the ns has already been created properly, you won't need to do either
19:07cflemingCursive auto-requires in the REPL, so if I'm typing (str/tr and I complete it to str/trim, Cursive will auto-require clojure.string :as str, as long as there's an example of that somewhere in your project
19:08the_dankointeresting
19:08cflemingthe_danko: But I'm mostly working on Cursive itself, which is a relatively massive project, so my use case is different to working in a single namespace on a smaller project
19:08the_dankoyeah i bet
19:08cflemingthe_danko: For that, aliases work best
19:08the_dankofor which?
19:08the_dankothe large project?
19:09cflemingFor bigger projects
19:09cflemingFor a smaller one, I'd probably just switch to the ns and work there
19:09the_dankowell my project won't always be small
19:09the_dankook thanks
19:09cflemingthe_danko: Sure, but there's nothing to stop you changing how you work at that point
19:10the_dankogood poiont
19:10the_dankopoint
19:10cflemingthe_danko: If you really want to work in user, I'd recommend aliases, I think
19:10the_dankoso i open up the repl
19:10cflemingthe_danko: But I just do whatever's easiest for what I'm working on at the time
19:10the_dankoso what all is in user by default?
19:11the_dankocore
19:11the_dankothat i have to add when i work in a given namespace
19:11the_dankonevermind, i'll figure that out myself
19:11the_dankonot a high value question
19:11cflemingcore is always there, there's a few other things like pprint
19:11cflemingOne sex
19:11cflemingOooops
19:11cflemingOne sec, rather
19:11cflemingThat's a freudian slip if ever I saw one
19:12amalloycfleming: i was quite embarrassed as a teenager when i wrote "afk for a sex"
19:12amalloyeven worse than yours
19:13michaniskin|BNCa "freudian cock" as we say in the land of recursion
19:14the_dankoso cfleming, do you use the debugger at all?
19:14the_dankocfleming, like one does in java?
19:16cflemingthe_danko: (apply require clojure.main/repl-requires) will set any ns up as user is
19:16the_dankocfleming awesome, thanks!
19:16cflemingamalloy: When I was at school in the US while my folks were on sabattical, I was 14 I think, I asked a girl in my class for a rubber
19:16amalloycfleming: that's neat, i didn't know that
19:17amalloycfleming: ha, a classic cross-pond mixup
19:17cflemingamalloy: Which in the civilised world is an eraser
19:17amalloyi hope you asked for a fag at some point during a visit as well
19:17cflemingamalloy: I also had a similar "bush" incident
19:17amalloycfleming: have you checked to see if you are in a romantic comedy?
19:18justin_smithcfleming: a friend of mine went to australia from the US, did not know why everyone thought her story about falling on her fanny was so funny
19:18cflemingamalloy: I hope so, I'm hanging out for the happy ending
19:18cflemingjustin_smith: Another classic
19:18justin_smithpants is another good one
19:18amalloythong
19:19cflemingthe_danko: Yeah, I use the debugger all the time
19:19amalloyreally it's a wonder we can talk to you folks at all
19:19cflemingyeah, no doubt - especially as teenagers
19:19the_dankocfleming sweet, look forward to trying that
19:19the_dankocfleming i had to buy these http://www.amazon.com/gp/product/B003Y95IVU/ref=oh_aui_detailpage_o01_s00?ie=UTF8&amp;psc=1
19:20the_dankocfleming for my all black das in order to keep up with your keyboard shortcuts.
19:20the_dankocfleming ha, definitely worth it though.
19:20amalloythe_danko: huh? do you have an azerty layout or something?
19:20cflemingthe_danko: Ha, yeah, paredit with a das would be a challenge
19:20the_dankoi know where the letters are
19:21the_dankobut i dont have great memory yet for } ] f12
19:21the_dankoetc
19:21the_dankoas cfleming says, it's a little tough flying blind
19:21the_dankocfelming finally i was able to admit i needed help. it took a long itme.
19:21cflemingThat's always the first step in any recovery
19:22blake_cfleming: The auto-require is just wonderful.
19:22cflemingblake_: Yeah, I love that - I use it all the time
19:23blake_cfleming: Money's just burning a hole in my pocket, dude...
19:23cflemingblake_: Arg, I know
19:24blake_cfleming: heheh...I'm being very selfish here...I really want to encourage continuing development. =P
19:25cflemingblake_: hehe, yeah - development is continuing!
19:25blake_cfleming: Groovy.
19:25cflemingblake_: Development speed isn't limited by money as much as by only having 24 hours a day, and having a baby daughter
19:26blake_cfleming: Yeah, I get that. They're cute and exhausting and don't really care about your projects. =P
19:27cflemingblake_: I commented to a friend that kids will soak up all the time you let them. He said yeah, they're like Farmville
19:27cflemingHe's a fountain of wisdom
19:27blake_cfleming: lol...yeah...a regular Dr. Spock.
19:54CaptainLexIs there a good resource out there for relative beginners on how to use the REPL to debug? I hear it's very powerful and I think I'm in need of that power
19:54CaptainLexI'm actually working in CLJS but it'd be good to know for later CLJ projects
19:56bridgethillyerI found this useful: http://blog.jayfields.com/2014/01/repl-driven-development.html
19:56Morgawrmmm.. I recently updated clojurescript for my project and now it's telling me a lot of warnings about cljs.core/update being shadowed by some functions I have (which are called 'update')
19:57Morgawrthe problem is... where does update come from? It's not in the clojure.core library...
19:57Morgawror at least I can't find it. I see it in clojurescript
19:57Morgawris this something new that I missed?
19:58michaniskin|BNCMorgawr: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L4142
19:59Morgawrmichaniskin|BNC: Yes, I know, as I said in my question :P
19:59MorgawrI see it in clojurescript, but where does it come from?
19:59Morgawrit's not in clojure
20:00Morgawrlooks like a wrapper around using assoc with mutable javascript data.. ?
20:00CaptainLexmichaniskin|BNC: Thanks
20:00CaptainLex!
20:01enadent
20:11tvanhensis there any way to execute a series of jdbc requests in a transaction without using a macro in the jdbc library?
20:12amalloytvanhens: i mean, anything you can do with a macro can be done without a macro, by writing out whatever the macro expands to
20:13tvanhensgood point. was wondering if there was a function option in that lib before I start hacking with that approach
20:14hiredmanwhat would you expect the function to do?
20:15amalloytvanhens: db-transaction* looks like the thing to use?
20:15amalloyit takes in a database and a thunk, and executes that thunk while inside a transaction
20:15hiredmanthe bounds of jdbc's transaction macro go a long towards delineating a good transaction
20:16hiredmanamalloy: if tvanhens wants that there is also the option of (fn [db fun] (with-db-transaction [foo db] (fun foo)))
20:16amalloytrue
20:17hiredmanif your code does fit that shape, you might end up having a bad time with transactions
20:17hiredmandoesn't
20:17tvanhensthanks guys the problem with that approach hired is all my query definitions are in data. I'm trying to create all their jdbc calls with generated code so the macro is kinda throwing a wrench in things
20:19tvanhensdb-transact* looks promising
20:19hiredmanthe thing to keep in mind is transactions can fail, so how do you encapsulate the execution of the code for the transaction in a package that is retryable on failure
20:20lvhDoes anyone have any reccomendations for getting useful error messages out of core.test? as opposed to actual: false :/
20:20lvhcore.logic's featurec does almost what I want, but also won't give me a useful error message.
20:21hiredmanlvh: the messages you get are a result of what you put in
20:21lvhhiredman: Sure, that's why I'm asking for suggestions on how to make it better :)
20:21hiredmanif you are comparing two large structures using =, you get a single value back, true/false
20:22hiredmanif you compare different keys or positions or whatever by themselves you get more information (multiple values)
20:22hiredman(is (= a b)) vs (is (= (get a :foo) (get b :foo))
20:23lvhah; so just stuff multiple is'es into a testing block?
20:23hiredmanthat works for comparisons, but if you do some large calculation outside of the is, and then hand it to the is, all the is has is that value
20:24amalloysomeone at geni wrote some kind of macro that converted (is (= x {:a 1 :b 2 :c 3})) into three different calls to is
20:24hiredmanhttps://github.com/pjstadig/humane-test-output is also a thing (limited by the information you give to the is macro) you can also look at using are instead of is
20:24amalloywhich was kinda handy
20:25hiredmanamalloy: if I remembered the syntax to are, I think you could do that pretty quick
20:25amalloyyes
20:26justin_smith(is (= [nil nil] (take 2 (data/diff a b)))
20:26hiredman(are [x y z] (= (get y x) (get z x)) [:foo a b] [:bar a b] ...)
20:26amalloyjustin_smith: why take 2?
20:26justin_smithamalloy: the third value is the items the two had in common
20:27justin_smithless likely to need to assert anything about that
20:28justin_smithunless you expected a specific difference I guess?
20:29justin_smithbut of course the advantage there is that the failed test shows exactly the differences that are present but not expected
20:29amalloythe way 'are works makes me sad. the clojure.walk calls don't understand shadowing or quoting
20:30amalloyi wish we could get macrolet as part of the compiler, rather than clojure.tools.macro needing to reinvent it
20:33MorgawrI'm trying to wrap my head around testing in clojurescript... I run "lein cljsbuild test" and it says 1 test was run containing 1 assertion (which is (is 1 2) to make it fail) which doesn't fail... and I need to ctrl+c the commad to kill it because it doesn't terminate
20:33Morgawram I doing something wrong? (answer is very yes)
20:34Morgawroh, I guess is needs (is (= 1 2))
20:35Morgawrnow I only need to figure out how to make the command exit at the end...
20:36scottjMorgawr: maybe it is watching the files to rerun when they change?
20:38Morgawrscottj: weird, I just tried using rhino instead of phantomjs and it exits properly
20:38Morgawrwith phantomjs it just hangs and waits
20:39Morgawroh
20:39MorgawrI fixed it, I was missing :runner in the test command
20:39Morgawrnow it works :)
21:24vasHi I'm using datomic and trying to get relevant entities by supplying an author or eid ... but every time I query the db I get a :db.error/too-few-inputs ... https://www.refheap.com/98117
21:28scottjvas: I haven't used datomic, but I would guess ":in $ ?eid" is not what you want and is causing it to want an arg more than just the db connection, maybe?
21:28scottjvas: maybe you want :in [$ ?eid]
21:29puredangerthat's correct
21:29puredangerI mean it's correct that :in [$ ?eid] is going to expect another arg after the db
21:30puredangerso pass eid at the end
21:32owl-v-hi
21:33owl-v-what's the math library I can use for matrix operations in clojure?
21:34scottjowl-v-: core.matrix afaik
21:35scottjand/or vectorz-clj
21:36owl-v-thanks
21:37ennIf I want to use a local version of a (lein) project dependency, I can makes a checkouts directory. Is there any way to do something similar across projects, for a dependency that is defined in my profiles.clj?
21:48gfredericksenn: I can't tell how the second thing you described is different from the first thing
21:52amalloyit sounds like enn wants to have every project on the machine use a modified checkout
21:53gfredericksoooh I missed the profiles.clj part
21:53amalloywhich is just not a good idea: publish the modified version, or at least install it locally, under a different groupid; then you can depend on it like a proper person
21:53gfredericksI read "project.clj"
22:27ennyeah, I guess it is time for me to figure out how to deal with maven locally
23:02rufoaI'm trying to turn two sequences [:k1 :k2 :k3] and [:v1 :v2 :v3] into a map {:k1 :v1 :k2 :v2 :k3 :v3}
23:02rufoais there a neater way than this? (into {} (mapv vector [:k1 :k2 :k3] [:v1 :v2 :v3]))
23:03Wild_Cat`rufoa: zip?
23:03amalloyzipmap
23:04amalloybut also if you were going to do it your way, mapv is silly compared to just map
23:06rufoaah i'd forgotten about zipmap! and you're right about mapv of course yes
23:06rufoathanks!
23:14ennSince str returns something like "clojure.lang.LazySeq@e93c3" for a lazy sequence, why does it realize the sequence?
23:26amalloye93c3 is the hashcode, which is based on the sequence's items
23:31ennah
23:37nicola1i am trying to figure out why my clojure program won't exit after the last statement; any pointers on how what to do to figure this out?
23:37nicola1i put a println statement as the very last thing, it gets executed, so i'm looking for connections left open or things like that
23:38godd2nicola1 its possible that you're println'ing an infinite range?
23:38nicola1all i could find online is related to pmap/shutdown-agents, but i'm not using that
23:38tomjackkind of makes me sad when I need ~30G ram to chew a 1.6G file: https://www.refheap.com/e04a09f241c8c63bcd7b052ee
23:38justin_smithnicola1: shutdown-agents
23:38godd2I couldn't say without seeing the code
23:38tomjackwonder if there are obvious problems there besides, uh, using seqs
23:38justin_smithnicola1: if you have used futures, agents, etc. at all clojure won't shut down immediately unless you call shutdown-agents
23:38tomjack(whoops, s/soft/foo/ :( )
23:39nicola1i tried calling shutdown-agents at the end, didn't help :(
23:39nicola1i'm basically ingesting data from avro files into cassandra
23:40nicola1(let [connection ...] (doall (map #(ingest-into-cassandra connection %) filenames)))
23:40justin_smithtomjack: looks like a great use case for transducers rather than nested map / filter etc, if you can use 1.7
23:40tomjackyes, I just didn't want to write yet another reducers version of line-seq :(
23:41justin_smithnicola1: oh, I wasn't talking about pmap/shutdown-agents, just the regular shutdown-agents
23:41tomjackthis run just finished, and luckily this box has 250G ram, but I'll try transducers next time
23:41justin_smithtomjack: you can keep the line seq part, but turn the rest into reducers, that will reduce your heap usage
23:41tomjackhmm. good idea
23:41justin_smiths/reducers/transducers that is, of course
23:41nicola1justin_smith: yes me too, i shouldn't have written "/" since it's clojure syntax - sorry about that
23:44justin_smithnicola1: ahh, yeah. shutdown-agents is needed not just for pmap, but if any code touches the pool, which includes futures, agents, pmap, reducers...
23:46nicola1justin_smith: i was just trying again to make sure, that's not it unfortunately
23:49nicola1i'll keep poking, thanks for your help
23:50tomjackjustin_smith: well, it ran ~75% faster this time, and htop didn't show my heap growing (though I don't trust that _too_ much)
23:50tomjackthanks
23:51tomjack15min vs 3min ish, big difference!
23:51tomjacknext time I'll try to dig up a lines reducer
23:52justin_smithor transducer
23:52justin_smithahh, wait
23:52justin_smith75% faster with no change?