#clojure logs

2014-11-06

00:08Frozenlo`My 'lein uberjar' keeps running forever. Any idea what could be the problem?
00:09justin_smithFrozenlo`: are you calling shutdown-agents when the program is done
00:09justin_smith?
00:09Frozenlo`Not that I know of...
00:09justin_smithoh, you mean the process of creating the jar
00:09Frozenlo`Yes
00:09justin_smithshutdown-agents is for when you see a program hang at runtime, sorry
00:10justin_smithFrozenlo`: jstack will tell you what the program is doing
00:10justin_smith(in the form of a bunch of stack traces)
00:10Frozenlo`I see 'Compiling <bunch of files>...' and then it just hangs there.
00:10justin_smithjstack comes with the jdk, so you could have it already
00:11Frozenlo`justin_smith: thanks, I'll try that.
00:18amalloyFrozenlo`: the last thing it says it is compiling probably includes a top-level def with side effects like spinning up a server
00:21Frozenlo`amalloy: Yup, it crashes at a namespace where I start a repl
00:21amalloyanything you do at the top level is *at compile time*
00:21amalloystuff you only want to happen when running your program belongs in a defn
00:22FrozenlockOkay, so if I place that in the -main function I should be fine?
00:22amalloyyes
00:22FrozenlockGreat, thanks!
00:25Frozenlockamalloy: Worked like a charm! (tho I'm sure you're not surprised...)
00:25FrozenlockThanks again!
00:26amalloywell, i'm a *little* surprised, since often programs with one such problem have more than one, but i'm glad it worked
01:07nonubyany thoughts for best approach to delete a file after its being served (wkhtmltopdf generated) by ring since returning { :body (FileInputStream. "/tmp/123324.pdf") }. Im thinking of decorator approach where .close then delete the files after passing .close to the inner inputstream
01:09justin_smithnonuby: what if you never put it on disk in the first place, and just handed an input stream that would be garbage collected to the client?
01:09justin_smithnonuby: either generate it directly into the stream, or if that can't be done, put the contents in an input stream, delete, then return the stream
01:09nonubyi dont think wkhtmltopdf executable can output to stdout, let me check
01:10justin_smithnonuby: bonus, on a linux system you can delete a file that you have open, and you can continue using your file handle until you close it
01:10justin_smithand only then is the space on disk reclaimed
01:10nonubynice
01:10justin_smithso if you can be linux specific, that may be your best bet
01:11justin_smithbut really, the part where you put it on disk is just a performance bottleneck, so avoid that if you can
01:11justin_smithputting it on a ramdisk /tmp/ directory for example
01:12justin_smith(the file operators think it is a file, the OS never puts it on disk, win / win)
01:13nonubyjust give me a idea from something i read a while ago, moment
01:14nonubyin absence of no stdout from wkhtmltopdf, mkfifo fits perfect, once read its gone
01:14justin_smithoh, that's another option for sure
01:14justin_smithwell - won't the fifo still exist? it won't take up much space though
01:14nonubyno its gone once its read
01:15nonubyah no its not
01:15justin_smithoh, when I call mkfifo in the shell, that creates an actual thing
01:15nonubyyeah hmm.. i still need to clean up hmmm..
01:16justin_smithyeah, but once again, on a linux system you can delete it before you are done using it
01:16justin_smithbrowsers use this trick to hide the mp4 files that go with streaming video
01:16nonubyso if I combined mkfifo with the delete once I have the file handle, I presume it won't touch disk except for creating the handle?
01:17justin_smithit used to be very easy to grab streaming video into video files on a linux box :)
01:17justin_smithnonuby: right, creating and removing the handle, which is lightweight
01:17nonubyawesome, mkfifo, and delete open I have the file handle it is! thanks
01:57calihomerHi all. Clojure noob here. Here is a Gist that has me confused: https://gist.github.com/jayp/8bf732aa1622f642bfa2 . It's about a LazySeq that's actually a map... and why I can't destructure it without using "into".
01:59seancorfieldcalihomer: you're getting a sequence of maps, not just a single map
01:59Ember-yup
01:59Ember-was just about to say the same thing :)
01:59calihomerahh
01:59Ember-1..n db rows, single row represented by a map
02:00seancorfieldso (let [{:keys [value]} (first (db/get-value "foo"))] ...)
02:00calihomerhaha. makes sense!
02:00calihomerthanks all
03:23Viestihas anyone here used amazonica with dynamodb JSON support?
03:37Glenjaminis there a good way to get cljs docs? (doc) not existing in the cljs repl is starting to get annoying :(
04:10dysfunis there a 'design patterns with clojure STM' document anywhere? The system I'm building, i can think of several ways to implement it and i've got no idea what the impacts of those design decisions will be
04:17ordnungswidrigwhat are you thinking about?
04:19dysfunloosely, i have a data structure and indices int it. I *could* bang the whole lot in an atom, but i suspect some of those updates might take a little time, so i'm wondering if keeping them as separate refs might be a better idea
04:20ordnungswidrig what's the concurrency you're expecting on this data structure?
04:21dysfunprobably read-heavy, but potentially intense load
04:22dysfunmany threads will be working with them
04:22ordnungswidrigif the update takes time, other threads will see the old version for the refs
04:22dysfunand to deal with some interlinking, there are liable to be atoms inside it
04:22dysfunyes, i have no problem with old versions being seen. that's perfectly okay :)
04:22dysfunfor this case
04:22ordnungswidrigare you aware that atoms are not integrated with the STM?
04:23dysfunoh, i presumed they were just the simplest form of it
04:23ordnungswidrigno, only refs (and agents) are coordinated. atoms are uncoordinated.
04:24ordnungswidrigIf you don't have a lot of concurrent write access to the data then you can use a single reference to hold id.
04:24dysfunwell, i see it more as being the ability to deal with one datum vs many in a coordinated fashion
04:24dysfunbut semantics
04:25dysfunbut if i get more writes, it's liable to be more efficient to do multiple refs?
04:26dysfunwell, on throughput
04:26ordnungswidrigI guess: yes. As long as you're writing on distinct refs. Writing to multiple refs is still coordinated/atomic when it occurs in a single (dosync) block.
04:26dysfun*nod*
04:27dysfunsince these are indices into the data though, i wonder if we could let them go out of date a little
04:27ordnungswidrigYour should measure and decide basedon that data.
04:28ddellacostawhat the heck is going on when my lein uberjar compile just stops?
04:29ddellacostalike, just waiting for minutes
04:29ddellacostaif I ctrl-c it and start again it finishes right away, but if I lein clean and then do it again, same thing, hanging
04:29ddellacostadon't get it
04:29Ember-lein clean is superslow at least on windows
04:29Ember-like superduperslow
04:30Ember-not lightning fast on osx either
04:30Ember-but waaaay faster
04:30ddellacostaEmber-: lein clean is not that slow, but lein uberjar hangs
04:31Ember-well, does the uberjar print any output for you before it hangs?
04:31mnngfltgIs there a name for this function: #(vec %&)
04:31mnngfltg?
04:32mnngfltgIt would be cool if it had a name, just as (fn [x] x) is available as `identity`
04:32ddellacostaEmber-: it looks like it's compiling a bunch of namespaces
04:32Ember-maybe you just have a large project? :)
04:33ddellacostaEmber-: I do, but it doesn't make sense to me that it stops where it does, then I ctrl-c it, then I run the command again and it finishes rather quickly. Just wish I understood what it was doing
04:33Ember-mnngfltg: that is a reader macro for anonymous function declaration
04:33Ember-so it will create a similar function as (fn [x] x)
04:33mnngfltgEmber-, similar but not the same
04:34mnngfltgEmber-, because it accepts >1 args
04:34Ember-well, the content is different there :)
04:34mnngfltgmy point is that this is a pretty useful function, almost as useful as identity
04:35dysfuni'm not convinced it is
04:35Ember-well, why don't you write one for yourself then
04:35dysfunbut actually, isn't that the vector function?
04:35Ember-(fn [& args] (apply vec args))
04:36Ember-and yes, that is the vec function, no need to wrap it
04:36dysfunexcept with a bit more magic inside
04:36dysfunno, the function 'vector'
04:36Ember-,(vec 1 2 3)
04:36clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core/vec>
04:36dysfun,(vector 1 2 3)
04:36clojurebot[1 2 3]
04:36mnngfltgdysfun, yes! amazing!
04:36Ember-,(apply vec 1 2 3)
04:36clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
04:36Ember-aww
04:36dysfun,(apply vec [1 2 3])
04:36clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core/vec>
04:37Ember-but anyway, vector is the function
04:37Ember-and hash-map and so forth
04:37mnngfltgperfect, that's what I was looking for
04:37Ember-you can also do (which isn't exactly the same):
04:37dysfunhttp://clojure.org/cheatsheet
04:37ddellacostavector is very semantically different from #(vec %&) though
04:37Ember-,(into [] (range 1 10))
04:37clojurebot[1 2 3 4 5 ...]
04:38mnngfltgddellacosta, vector, not vec!
04:38Glenjaminddellacosta: is it? i'd have said it's semantically the same, but functionally different
04:38Glenjaminwell, same effect, different implementation
04:38dysfunthat's what i'd have said
04:38ddellacostamnngfltg: your example used vec, no? I'm comparing your original example to vector
04:38Ember-different API for different usage scenarios
04:38ddellacosta...
04:38Ember-same end result
04:39Glenjaminwell, there's no use case for #(vec %&)
04:39Ember-yup, there is none :)
04:39Ember-just use vector and vec directly
04:39mnngfltgddellacosta, well #(vec %&) gives the same results as `vector`
04:39Ember-,(apply vector '(1 2 3))
04:39clojurebot[1 2 3]
04:40ddellacostamnngfltg: Okay, but it wasn't clear what you were focusing on--the rest arg literal or the vec fn inside, or the anonymous fn, etc.
04:40Ember-(vec '(1 2 3))
04:40Ember-,(vec '(1 2 3))
04:40clojurebot[1 2 3]
04:40Ember-same thing
04:40mnngfltgHere's my use case: I'll use it for programming in the repl. If I want to work with a (map) with two collections, I'll start with (map vector coll1 coll2) first and see what it gives me
04:40ddellacostaif you just want something to return a vector there's a ton of ways to do so
04:40mnngfltgddellacosta, yeah, I didn't explain fully
04:41mnngfltg`vector` is prefect for this (as `identity` is when using single-collection (map))
04:42Glenjaminalso (list)
04:42ddellacostastill not really getting it, alas
04:43dysfuni'm still not really getting why we're bikeshedding when he just wants a vector out and he's found a function that does it
04:43ddellacostadysfun: haha, fair enough. I was curious because comparing it to identity in utility makes no sense to me
04:44dysfuni don't think it's quite so useful either
04:44ddellacostadysfun: so seems like there is more there than s/he just wants something that returns a vector
04:44ddellacostalike, maybe mnngfltg is trying to define some category theoretic concept or something
04:45mnngfltgddellacosta, I'm really not :)(
04:45mnngfltgI'm a pratical guy
04:46ddellacostamnngfltg: I wasn't saying you weren't
04:46dysfunis there a reason you care about it explicitly being a vec?
04:46dysfunwhat's wrong with a seq?
04:46M-xHi. Anyone using yesql here? Will there be any problems if I will use transactions in the sql queries?
04:46mnngfltgdysfun, no it could be a list of vec or any other seq
04:47mnngfltgdysfun, I just want a function that returns all its arguments for me to expect them :)
04:47mnngfltgidentity doesn't cut it because you can only call it with one argument
04:47M-xI mean, transactions in the sql file itself, not clojure.java.jdbc transactions. Could there be some collisions with jdbc driver's management of transactions or something like that?
04:47mnngfltg`list` or `vector` fit the bill
04:48dysfunso does 'seq'
04:48ddellacostaM-x: I don't know how yesql deals with that, but you can explicitly turn on/off transactions in c.j.j
04:48dysfunwell, not with the multiple args
04:48M-xdysfun: seq do not returns all its arguments on call.
04:49M-x*does not return. Sorry, not really good in english.
04:50dysfunmnngfltg: i think i know what you're trying to, and i think there's an easier way
04:50mnngfltgM-x, what's the worst that could happen - having nested transactions, right?
04:50ddellacostagood point
04:50dysfuni think you want interleave
04:50M-xddellacosta: thanks for the heads up. Guess no problems should occur when they are turned off.
04:51ddellacostadysfun: it's amazing how much you've been able to discern about mnngfltg's goals, I cannot make heads or tails of what's going on there
04:51ddellacostaM-x: np
04:51M-xmnngfltg: well, I guess so...
04:51ddellacostaM-x: but agree w/mnngfltg, that is wrapping them shouldn't cause issues as far as I know
04:51dysfunddellacosta: i've almost finished my first pot of coffee. i don't claim it makes awesome sense, but hey, i'm not awake yet either :)
04:51ddellacostadysfun: ha. :-)
04:52dysfunof course i'm intuiting here and i could be completely wrong
04:52dysfunbut it's sort of like 'clojure golf' on steroids (Where unlike perl golf, the idea is to write cleaner code by using the basic functions better)
04:53dysfunthrow in a bit of mind reading :)
04:53M-xddellacosta: by the way, do you know of any pure-java lib similar to yesql?
04:54mnngfltgdysfun, I think I'm fine with `vector` !
04:54M-xI'd like to reuse the queries I've written for yesql from java code without writing parsing code myself
04:54ddellacostaM-x: you mean, SQL in separate files (that's how yesql works, right?) but implemented in Java vs. Clojure? I do not, I'm sorry
04:55dysfun,(interleave [1 2 3] [4 5 6])
04:55clojurebot(1 4 2 5 3 ...)
04:55ssiderisM-x: could you not use yesql from java?
04:55dysfunoh no, it's not nested like vec would be
04:55M-xddellacosta: yeah, that's what I mean. Haven't googled anything similar too, I guess I'll have to write some simple parser myself.
04:56M-xssideris: well, technically I can, but I would like to see pure java solution.
05:07ssiderisyes, THIS. IS. CLOJUREEEEEE
05:07ssideris:-D
05:15M-x%)
05:18kenrestivopersonal pet peeve: keys with names like :?data
05:18kenrestivoit's :?ugly
05:19kenrestivoand smells of hungarian notation. if the key is optional, just name it :data and document that
05:19kenrestivo /rant
05:19ssiderisoh I've never seen that before
05:20daniel__i think it's highly clever
05:20clgv:?data! :D
05:21yocapybarahey guys, anyone using cursive? I'm currently rocking cider and emacs but normally spend my day in intellij, wondering whether anyone had any experiences, good or bad...
05:26clgvyocapybara: a student of mine is using it and it definitely gets the job done.
05:27TEttingercfleming makes it and could help if you have trouble, I'm sure
05:27clgvyocapybara: but he didn't use emacs, so I can't ask him for a comparison ;)
05:44yocapybaraclgv: thanks for the info
05:45yocapybaraTEttinger: thanks also :)
05:48kenrestivoi don't think it's clever at all. say you want to make that a not-optional key. what do you do, change it's name?
05:49kenrestivoplus, is it a predicate backwards? ?foo is optional key, foo? is a predicate. also when you destructure it, it's now an ugly var, ?foo. what, is the var now optional too?
05:50kenrestivoanyway, dunno why this gets up my nose but it does
06:17kungia 2ls
06:18justin_smithlazybot: would a name like ??data be better??
06:18lazybotjustin_smith: Uh, no. Why would you even ask?
06:23Kneiva?oof
06:23clgvlazybot: is justin_smith asking strange questions???
06:23lazybotclgv: Oh, absolutely.
06:29justin_smithhide your iphones, hide your macbooks http://www.zdziarski.com/blog/?p=4140
06:33dysfun...if you're downloading dodgy chinese software?
06:33dysfun"[+] Your OS X system isn't infected by the WireLurker. Thank you!"
06:35justin_smith,(map #(do %&) (range 10) (range 20 100)) ; mnngfltg:
06:35clojurebot((0 20) (1 21) (2 22) (3 23) (4 24) ...)
06:35justin_smith,(map #(identity %&) (range 10) (range 20 100)) ; mnngfltg:
06:35clojurebot((0 20) (1 21) (2 22) (3 23) (4 24) ...)
06:37clgvso what?
06:38clgv,(map list (range 10) (range 20 100))
06:38clojurebot((0 20) (1 21) (2 22) (3 23) (4 24) ...)
06:38mnngfltgjustin_smith, interesting
06:38clgvis shorter ;)
06:38justin_smith#(identity %&) seems to be getting at your intention semantically though
06:39mnngfltghow does #(identity %&) even work?
06:39clgvrest args
06:39justin_smith%& is a list of all arguments
06:40mnngfltgah yes, and identity just returns its sole argument
06:40justin_smith,(map (fn [& args] args) (range 10) (range 20 100))
06:40clojurebot((0 20) (1 21) (2 22) (3 23) (4 24) ...)
06:40justin_smiththat's the equivalent
06:40mnngfltgsure
06:41mnngfltg#(do ...) -- is that an idiom?
06:41justin_smithmnngfltg: yes, some people hate it
06:41dysfunit's quite handy sometimes though
06:41mnngfltg"do" screams side-effects to me
06:41justin_smithright, exactly the reason it is disliked
06:41mnngfltgbut it's short :)
06:41justin_smith,(map #(-> %&) (range 10) (range 20 100)) ; equivalent
06:41dysfunonce you've written a handful of macros that expand into dos, i think it loses its teeeth
06:41clojurebot((0 20) (1 21) (2 22) (3 23) (4 24) ...)
06:42justin_smithyeah, every fn body, every let body, are do
06:42dysfuni've written a lot
06:42dysfunof things that look like lets or defns
06:43Glenjaminall of those are more cyptic than (map list ...) imo :)
06:44clgvhuh? #(do %&) is an idom? I doubt that. the lambda shortcut is one though
06:46justin_smithclgv: more common is #(do [:a %& b]) or #(do {:a %&}) and variations
06:46grabarzguys, newbe's question. how to wrap argument into vector if it wasn't a vector and return it as it is otherwise? eg. (myfun "abc") -> ["abc"] and (myfun ["abc"]) -> ["abc"]
06:46clgvjustin_smith: didn't see that in any codebase yet
06:46clgvjust use the function instead of the literal in these cases...
06:47mnngfltggrabarz, maybe that's not a good idea?
06:47clgv#(vector :a %& :b) is not really longer
06:48clgvgrabarz: just query if it is a vector - (if (vector? x) x [x])
06:48mnngfltggrabarz, (if (seq x) x (vector x))
06:48clgvwell that works for atoms and vectors only ;)
06:48clgvgrabarz: I usually use (if (sequential? x) x [x])
06:48justin_smith,(vector? {}) ; what?
06:49clojurebotfalse
06:49grabarzmnngfltg: well, I'd like to always operate on a vector inside my fun, but allow pass a single arg just as single arg not a vector, eg (myfun "abc") or (myfun ["abc" "def"])
06:49clgvgrabarz: that's exactly the use case where I use the above form ;)
06:49justin_smithgrabarz: change your fun to (defn f [& args]) and let users use apply if they want to provide a vector / list
06:49clgvgrabarz: make it a helperfunction
06:50grabarzclgv: thanks, i'm checking it out
06:51clgvjustin_smith: that does not work for e.g. (defn foo [atom-or-seq, & other-params] ...)
06:51mnngfltggrabarz, maybe use "& args" ?
06:51clgvjustin_smith: you'd need similar logic as in the defn implementation then, which is a big overhead
06:51mnngfltggrabarz, that seems like a less confusing way to have a function that takes one or more arguments
06:51justin_smithclgv: fair point
06:52clgvmnngfltg: no there are valid use cases where you want to have a single param that can be both, atom or sequence of params
06:52grabarzmnngfltg: good point. thanks for help.
06:54clgvgrabarz: I have a similar logic in an "iteration macro" if only `x` is used `x` is bound to the current value. if I specify `[x i]` `x` is bound to the value while `i` is bound to the index
06:56mnngfltgclgv, yeah but that's pretty rare no?
06:57grabarzclgv: yup, I've just solved my problem this way :) thx a lot!
06:57clgvmnngfltg: no. I also have functions where something similar is pretty handy
06:58mnngfltgok
06:59clgvmnngfltg: my chart generation code has several use cases therefore. but it might be pretty rare for your scenarios...
07:06M-xIs prismatic/Schema suitable for validating user input or is it more like contract programming stuff?
07:09vijaykiranM-x: both AFAIK
07:11M-xvijaykiran: thanks, I'll dig more into it then
08:33martinklepschis there any reasonable difference to prefer compojure.route/files over ring.middleware.file/wrap-file or the other way around?
09:17vijaykiranmartinklepsch: I think they are more or less same since compojure uses ring file-response anyway
09:18ordnungswidrigm-x: schema has pretty un-humane error messages
09:19ordnungswidrigm-x: but I saw a lib to humanize the error, the other day.
09:21vijaykiranhttps://github.com/cddr/integrity ?
09:46perplexahmm, does (repeat) memoize or just call the inner form once and repeat the result?
09:46perplexa,(take 3 (repeat (str (java.util.UUID/randomUUID))))
09:46clojurebot("049c17a4-814d-4f52-adb1-c8ca0c60f8a4" "049c17a4-814d-4f52-adb1-c8ca0c60f8a4" "049c17a4-814d-4f52-adb1-c8ca0c60f8a4")
09:46perplexa;/
09:47opqdonutrepeat takes a value
09:47opqdonutso it's already "memoized" :)
09:47perplexahm ;x
09:47clgvperplexa: repeat is a fuction and just gets the value
09:47perplexayeah damnit
09:47clojurebotIt's greek to me.
09:47mgaaremaybe you're thinking of repeatedly
09:47perplexai thought it was a macro :(
09:47clgvperplexa: that's why `repeatedly` wants a function ;)
09:47perplexaah!
09:47perplexathank you
09:48opqdonutthe interesting question is whether forcing a long prefix of repeat uses lots of memory
09:48perplexa,(take 3 (repeat #(str (java.util.UUID/randomUUID))))
09:48clojurebot(#<sandbox$eval49$fn__50 sandbox$eval49$fn__50@1f374e5> #<sandbox$eval49$fn__50 sandbox$eval49$fn__50@1f374e5> #<sandbox$eval49$fn__50 sandbox$eval49$fn__50@1f374e5>)
09:48perplexawat :P
09:48perplexa,(take 3 (repeatedly #(str (java.util.UUID/randomUUID))))
09:48clojurebot("cd9d869b-ac39-40f7-8886-30d94d7b3ca3" "8a85b98d-696b-469d-817f-a4e4eb31a5d6" "e3ed6c77-2cb9-483c-a1ef-1a9ba1486701")
09:48perplexabetter \o/
09:49clgvopqdonut: well you pay for the `cons` and the LazySeq instances
09:49opqdonutone wouldn't need to
09:49opqdonutI think
09:49opqdonutyeah, it gobbles up memory, just checked via top
09:49opqdonutbut you could have a cyclic structure, at least with a suitable implementation of LazySeq
09:49clgvbut that is not due to the repeated object
09:50opqdonutyeah, it's an arbitrary object that might not be copyable in any way
09:50clgvopqdonut: you could write a reducer to do the same ;)
09:50opqdonut(c.f. haskell's repeat which uses O(1) space by just having "let xs = value:xs"(
09:50opqdonut)
09:51clgvwell the lazy-seq also uses O(1) memory - it starts to consume more if you realize a part of it
09:51opqdonutI mean haskell's uses O(1) space no matter what
09:52clgvopqdonut: that comparison is not valid since you need to store the elements somewhere ;)
09:52opqdonutnow I'm not following you
09:52clgvsince you certainly want a list of 5 elements to process further after (take 5 (repeat obj)) even in haskel ;)
09:52opqdonutoh, sure
09:52opqdonutyeah it doesn't really matter in practice
09:54sm0keis this good enough to resolve afunction from symbol ##(resolve 'inc)
09:54lazybotjava.lang.SecurityException: You tripped the alarm! resolve is bad!
09:55sm0kei am facing some problem resolving functions this way, when it is getting callel indirectly from another namespace
09:57clgvsmoke: depends - is the namespace required and the symbol referred into the current namespace?
09:58sm0keumm no actually i have something like (let [f (resolve 'sym)]..) inside a function in one namespace, when i execute the form it resolves correctly
09:58clgvsmoke: you gotta do something similar to (defn load-fn [symb] (when-let [ns (namespace symb)] (require (symbol ns))) (some-> symb resolve var-get))
09:59sm0kebut when i call this from another it resolves to nil
09:59clgvsm0ke: yeah you need to provide the namespace of the symbol when it is not referred in the other namespace
10:01clgv,(do (require 'clojure.string) (ns 'bla) (resolve 'clojure.string/join))
10:01clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol>
10:01clgv,(do (require 'clojure.string) (ns bla) (resolve 'clojure.string/join))
10:01clojurebot#'clojure.string/join
10:01clgv,(do (require 'clojure.string) (ns bla) (resolve 'join))
10:01clojurebotnil
10:01clgvsm0ke: see? ^^
10:03sm0kesorry brb, thanks clgv i will try this
10:05sm0keclgv: thanks, worked perfectly
10:05sm0ke(inc clgv)
10:05lazybot⇒ 35
10:05clgvgreat :)
10:05clgvsm0ke: your application is single threaded right?
10:20the_dankocfleming: so i upgraded to intellij 14, and it auto-suggested la clojure and some other one. i knew where to get the plugin link, but others may be tempted just to click yes on the lesser plugins. also it makes them look more official. i am sure you are aware of this already.
11:20perplexa?paste
11:20perplexa;x
11:21perplexahttps://www.refheap.com/92804 is that okay or would i use some fancy function instead that i don't know of, instead of flatten+map?
11:22llasramperplexa: mapcat
11:23perplexayeah i thought so but my implementation failed ;x
11:23perplexagonna give it another shot
11:24llasramperplexa: OOC, what is the `h/` namespace prefix here?
11:24perplexahdfs-clj
11:24perplexahttps://github.com/r0man/hdfs-clj/blob/master/src/hdfs/core.clj
11:25llasramInteresting. You might also be interested in https://github.com/damballa/parkour/
11:25llasramEven if just interacting with HDFS, parkour.fs add some nice things like extending clojure.java.io to HDFS Path objects
11:25perplexamapcat yields funny char maps of the split strings ;x
11:26llasramSo e.g. you can just `clojure.core/slurp` them
11:26llasramperplexa: mapcat requires every return value of the function be a collection. Wrap the atomic case as a single-element vector
11:26perplexathanks, i'm just moving files around, though :)
11:26perplexayep will do
11:27perplexayay it works, will also remove the tl macro \o/
11:27clgv~flatten
11:27clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
11:28perplexahttps://www.refheap.com/92805 :)
11:32llasramperplexa: BTW, the Hadoop API actually provides `.listFiles` method which takes a `recursive` option. It'll be a bit more Java interop for you, but won't hammer on your nameserver quite so hard
11:34perplexallasram: thanks for advice :)
11:37perplexagonna use that :)
11:44EvanRdoes anyone have gripes about performance of core.match
11:58perplexallasram: on the returning iterator, i'm using (while (.hasNext iter) (println (.next iter))) for now and it seems to not work ;/
12:00mmgI’ve got a java interop heavy fn. if it throws I want to catch and stop looping, otherwise I want to call recur. Because recur has to be in the tail position I’m having an annoying time with this. is there a good clojure abstraction around breaking out of a loop or something similar for this case?
12:00llasramperplexa: "not to work" is a bit vague for a diagnosis
12:00perplexa.hasNext is always true apparently, eventually the code ends with NoSuchElementException No more entry in /Users/perplexa/test org.apache.hadoop.fs.FileSystem$5.next
12:00llasramperplexa: refheap?
12:01perplexallasram: sorry?
12:01llasramperplexa: show the code
12:01perplexaoh
12:02llasrammmg: The usual pattern is to have a (try ...) expression which yields a vector of two values: nil/exception and results/nil for success/failure respectively
12:02perplexahttps://www.refheap.com/92807
12:02llasrammmg: Then you can `recur` on success or re-`throw` on failure
12:02Bronsaperplexa: remove the #
12:02mmgthanks Ilasram
12:02perplexaoh, hmpf :D
12:02perplexathanks, Bronsa. yeah it's working now
12:05llasramperplexa: I use reducers pretty heavily, and encapsulated that as https://www.refheap.com/92809, as for some reason it isn't just a regular `Iterator` and thus the standard clojure.core functions do not work
12:08perplexallasram: difference between coll-reduce and CollReduce?
12:09llasramperplexa: What now?
12:11noonianperplexa: CollReduce is a protocol, coll-reduce is the function that the protocol specifies and he's reifying CollReduce by implementing coll-reduce
12:11perplexaok, thanks :)
12:11justin_smith,(java.util.UUID/randomUUID) ; perplexa - it has a nice readable form if you don't apply str to it
12:11clojurebot#uuid "e521229f-c18d-4ba1-b38a-0ad2b86c44bf"
12:12perplexai've never seen reify before, just opened the docs and BAM, it's a lot ;x
12:12perplexajustin_smith: i know, but i was just putting the output into for i in a b c d; do mkdir $i/some/stuff; done for testing in my shell ;p
12:12noonianjust returns an object that implements the reified protocols
12:12perplexaso kinda needed the strings :)
12:15perplexanoonian: meh, so much new to learn every day :D
12:15bbloomguys: immutable data is awesome.
12:15bbloomi just keep finding fun new uses for it
12:19jackjamesbbloom: blog post incoming?
12:19vermain compojure is there a way to apply middleware to a certain context only?
12:20vermalike I want wrap json middleware applied to /api/ context
12:20vermaand leave all other alone
12:20vermaright now ring json middleware blindly JSONifies everything without looking at response's content type
12:21vermawhich is not what I want
12:21justin_smithverma: you can wrap a specific route in a middleware, yeah - I don't recall off the top of my head how it is normally done in compojure
12:21vermaI guess I could write my own middleware as well
12:21justin_smithverma: wouldn't it look at the accept field on the incoming request?
12:21vermajustin_smith, checking
12:21justin_smithverma: a middleware can be applied to a specif handler, or even a specific action
12:22bbloomjackjames: i have about 38754835 blog posts coming, but i rather have > 0 code coming ;-)
12:22vermajustin_smith, sure thanks, here is the middleware code: https://github.com/ring-clojure/ring-json/blob/master/src/ring/middleware/json.clj#L76 for wrap-response, it only checks if response is a coll?
12:23justin_smithwell that's dum
12:23ennlein test doesn't seem to be running my test.check defspecs, though they run fine in the repl with test-vars. Any idea what I might be missing?
12:24justin_smithor at least more eager than you thought it would be
12:24vermajustin_smith, I see a wrap-routes method, let me see what it does
12:24justin_smithverma: anyway, you can (wrap-json-response my-endpoint-function)
12:24justin_smithor that if you want to wrap multiple, sure
12:24jackjamesbbloom: maybe there's a reason/history i'm not aware of, but i think #clojurescript would be better if you joined us there
12:25vermajustin_smith, thanks, let me try
12:25jackjamesbbloom: i'm hacking on the circleci frontend and no-local-state om stuff that i assume is mostly your original ideas?
12:26perplexallasram: thanks for that, i've integrated it using (reduce conj [] (riterator-reducer iter)) :P
12:26perplexai really like!
12:26perplexa(inc llasram)
12:26lazybot⇒ 40
12:27bbloomjackjames: i was working on something like that prior to the release of React/Om. when dnolen_ originally built Om, I had planted the globalization-of-local-state idea in his head early (and repeatedly)
12:27bbloomjackjames: dnolen_ did the hard work of implementing all the intercession stuff, all i did was push it over the edge & convince daniel at circle that it was a damn good idea
12:28{blake}Is there a clojure idiom for a chain of when-let? Like "(when-let [x f1] (when-let [y (f2 x)] (when-let [z (f3 y)].."?
12:30vermawhat's the general opinion about boot here?
12:30{blake}The conditionals being necessary because the functions may return nils but error out when receiving nils?
12:31justin_smith,(cond-> 1 number? inc even? inc) ; blake
12:31clojurebot3
12:31justin_smith,(cond-> 2 number? inc even? inc) ; blake
12:31clojurebot4
12:31vermanodeso is spamming me :(
12:32{blake}justin_smith, Let me try that, thanx.
12:33justin_smith{blake}: it's not quite doing what I expected, I am likely getting the syntax wrong
12:33{blake}justin_smith, No worries. I had forgotten the whole "cond->", "cond->>" area.
12:33{blake}Gives me some place to look.
12:34justin_smith{blake}: the tests don't get the chained val as args, is the problem
12:36{blake}justin_smith Ahhhhhh. Yeah, that's the problem all right.
12:37{blake}justin_smith, cond->>?
12:37{blake}justin_smith, Nope, that's just cond-> that doesn't short-circuit, apparently.
12:39mgaare{blake}: some->
12:39mgaareah, but do you need all of the bindings?
12:40justin_smithoh yeah, some-> is likely what he wants
12:40{blake}mgaare, justin_smith Checking it out.
12:41mgaare{blake}: some-> is just -> with short-circuiting of nils
12:42Glenjaminchains of when-let are awkware, last time i had to do this i ended up using a trick from useful
12:43Glenjaminhttp://flatland.org/useful/flatland.useful.utils.html#var-let-later
12:43{blake}mgaare, Yes! some-> is exactly what I was looking for, thanx.
12:43{blake}(inc mgaare)
12:43lazybot⇒ 1
12:44mgaareif you need that plus you need access to bindings from previous forms, one possibility is using maybe-m from clojure.algo.monads
12:44{blake}mgaare, Cool, thanks. I'll check it out.
12:44{blake}Glenjamin, And I need to go through "useful", too, for sure.
12:45mgaare{blake}: yw!
12:46{blake}Is it just me, or does one spend a remarkable amount of time in Clojure (and I presume all functional languages) focused on manner of expression?
12:47technomancy{blake}: you mean style issues in particular?
12:47{blake}technomancy, No, I don't think "style" is the right word. Maybe, though.
12:47{blake}technomancy, Contrast with (my experience of) Python.
12:47technomancy"manner of expression" is pretty board in a language where everything is an expression =)
12:47mgaaresuch is the nature of things in an expressive language
12:47{blake}technomancy, Ha! Good point.
12:48technomancy{blake}: well python is kind of unique in it's "one way to do it" mantra
12:48justin_smith{blake}: like which way to express code among options that may use different functions but be functionally equivalent
12:48justin_smith(meant to end that with a ?)
12:48{blake}But, in Python, there is, e.g., "Code Golf". But it's a gimmick. Fun, but you shouldn't really be doing it in production.
12:49cbryanfunctional languages seem to inspire that lovable mix of "how can i do this better?" and "how can i do this so no one else can understand it?"
12:49technomancycbryan: that's point-free style for ya
12:50cbryanyeah, definitely worse in haskell than clojure ;)
12:50{blake}Whereas, in Clojure, it's more like "Have I really expressed (and =understood=!) the problem correctly?"
12:50{blake}"Have I complected?"
12:50{blake}"Am I being lazy? And is it good lazy or bad lazy?" =P
12:53clgv{blake}: you can code golf on 4clojure.com ;)
12:54{blake}clgv, Indeed. And there is some of that "how can I do this so no one else can understand it?" there.
12:58justin_smith{blake}: cbryan: I think the "so nobody else can understand it" can often be more charitably described as "I just learned about this cool new concept, don't totally get it yet, and was looking for an excuse to try to apply it"
12:58clgv{blake}: yeah code golf beyond a certain threshold leads to hard to understand code ;)
12:59technomancyjuxt!
12:59{blake}Heh.
13:00justin_smithclgv: I forget where I read this, but there is a concept that readability is one of a number of parameters you can optimize (tersness, performance being others) and often if you optimize one parameter others suffer
13:01{blake}I've always taken "readable" over "clever". But I think Clojure encourages you to--well, I guess it's the whole simple vs. easy thing.
13:04clgvjustin_smith: you need to find your preferred spot on the pareto front ;)
13:11arrdemto quote djikstra, cleaver tricks should be avoided like the plague
13:13pyrtsaExcept if you're a butcher.
13:15EvanR,(concat [1 2 3] [2 3 4])
13:15clojurebot(1 2 3 2 3 ...)
13:15EvanR,(concat [1 2 3] [2 3 4] [5 6 7])
13:15clojurebot(1 2 3 2 3 ...)
13:17justin_smith,(apply concat (partition 3 1 (range)))
13:17clojurebot(0 1 2 1 2 ...)
13:17justin_smith,(apply concat (partition 3 1 (range 1 10)))
13:17clojurebot(1 2 3 2 3 ...)
13:27clgvarrdem: I like that Dijkstra quote better: "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: As potential programmers they are mentally mutilated beyond hope of regeneration." :D ;)
13:27mgaarethese days that applies to Java instead of BASIC
13:28clgvmgaare: hmm no, not really
13:29dnolen_I learned w/ BASIC - guess I'm screwed
13:29devnIs there a specify!/specify in clojure?
13:29dnolen_devn: no
13:29arrdemif dnolen_ is screwed we have no hope :P
13:29{blake}I did Basic (and Assembler) for five years. It was so painful, it encouraged me to conceive of structured, OO and functional programming techniques.
13:29devnI guess I knew that, my question is more along the lines of, what would that look like if I wanted it in Clojure? Thoughts?
13:29clgvdnolen_: beyond repair - that's why you are doing all this weird clojurescript stuff ;) :D
13:30dnolen_devn: probably would require invokeDynamic
13:30clgvdevn: what would that do?
13:31mgaarednolen_: cljs, om, core.logic are like physical therapy for the BASIC brain damage
13:31EvanR,(flatten [[1 2 3] [3 4 5]])
13:31clojurebot(1 2 3 3 4 ...)
13:31dnolen_devn: well probably lots of slow ways to do it - but I don't think it would get implemented if it can't be fast
13:31EvanR,(flatten [[1 2 3] '(1 2 3)])
13:31clojurebot(1 2 3 1 2 ...)
13:31nopromptdnolen_: for our particular problem speed is not necessary.
13:32nopromptdnolen_: basically we need to add a marker protocol.
13:32dnolen_noprompt: definitely many cases where speed is not an issue - just saying I don't seeing it happening unless that is addressed
13:33nopromptdnolen_: how much effort does it require to implement it for our purposes?
13:33dnolen_noprompt: way beyond my understanding of the Clojure compiler
13:33nopromptlol
13:33nopromptdnolen_: any other clever ideas then? :P
13:34noprompti guess we could just model the problem differently in clojure
13:34dnolen_yeah I would just do it differently
13:35EvanRi seem to be putting (into [], and (into #{} in a lot of places when i use map
13:35nopromptseems like the best way to go.
13:35nopromptdnolen_: btw sorry for lagging on finishing up that patch. been a bit busy w/ work and family.
13:35dnolen_no worries
13:36clgvEvanR: you can replace (into [] (map ...)) by (mapv ...)
13:36EvanRah
13:36nopromptdnolen_: i did want to ask however, apply in clojurescript can be a bit annoying on the error message front if it ever ends up with nil instead of a function.
13:37nopromptdnolen_: could we not check and fail with a better error than the maxLangArity whatever?
13:37nopromptsome folks have lost a bit of time over it. :/
13:37dnolen_I guess so, but I don't see how this isn't immediately obvious via source maps
13:37nopromptcause they didn't understand the message
13:38dnolen_and they didn't turn on debugging?
13:38dnolen_Break on uncaught exceptions - is useful
13:38noprompti'm not sure. i'm familiar with the message so it was easy for me to tell them what the problem was.
13:39dnolen_I think it's better to get people to immediately lean on the debugger than to any checks here
13:39dnolen_what's the point of all that source map work if people don't use it
13:39nopromptyep.
13:39devnpoint, dnolen.
13:39EvanR,(flatten [1 2 3] [3])
13:39clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/flatten>
13:39devngame, set, match.
13:40nopromptoh man, the weirdest error message i've seen so far in clojure is the EOF errors when you accidentally doo #foo and not foo# in a macro.
13:42noprompt,(defmacro lol [x]
13:42noprompt `(let [#foo "b"]
13:42noprompt (str ~x foo#)))
13:42clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
13:42noprompt:(
13:42devnyou fail at IRC
13:43noprompt,(defmacro lol [x] `(let [#foo "b"] (str ~x foo#)))
13:43clojurebot#<RuntimeException java.lang.RuntimeException: No reader function for tag foo>
13:43justin_smiththat's perfectly reasonable - #foo should be a reader function
13:43noprompt1. Caused by java.lang.RuntimeException Unmatched delimiter: )
13:43justin_smith&(defmacro lol [x] `(let [#foo "b"] (str ~x foo#)))
13:43lazybotjava.lang.RuntimeException: No reader function for tag foo
13:43noprompt2. Unhandled clojure.lang.LispReader$ReaderException java.lang.RuntimeException: Unmatched delimiter: ) Util.java: 221
13:44justin_smithnoprompt: weird, both of the bots give the right error here
13:44nopromptjustin_smith: nah, try and evaluate that in a real repl
13:44justin_smithRuntimeException No reader function for tag foo clojure.lang.LispReader$CtorReader.readTagged (LispReader.java:1180)
13:45devn,*clojure-version*
13:45clojurebot{:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"}
13:45atyzIs anyone here using docker/fig for their development environement?
13:45devn&*clojure-version*
13:45lazybot⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}
13:45noprompt,(let [x 1] `(let [#foo "b"] (str ~x foo#)))
13:45clojurebot#<RuntimeException java.lang.RuntimeException: No reader function for tag foo>
13:45devnweird
13:45nopromptnah clojurebot is just wrong in this case
13:45nopromptthat's not the correct error.
13:46justin_smithwhat?
13:46clojurebotwhat is a better one i think: https://github.com/michaelklishin/neocons
13:46EvanR"correct error"
13:46nopromptor at least not the one i see in 1.6.1
13:46justin_smithnoprompt: that's the correct error
13:46EvanRhow many errors can a correct error correct
13:46EvanRif a correct error could correct errors
13:47justin_smithnoprompt: I get the no reader function for tag foo in 1.6.0 as well
13:47noprompti get it if i try to use read-string
13:47nopromptwhich makes since
13:47noprompt*sense
13:48justin_smithnoprompt: why should reading from the repl vs. reading from a string change the error that you get when reading?
13:53nopromptjustin_smith: did you copy that let expr up there in to a real repl and run it?
13:54noprompti don't have anything to gain by making stuff up. devn is sitting here w/ me and seeing the same error that i pasted.
13:56devnI get the same thing locally: RuntimeException with Unmatched delimiter: )
13:56devnIf I read-string it, I get the no reader fn for tag foo
14:06justin_smithnoprompt: I pasted the result of doing it in a real repl, yes
14:06justin_smithI did not make anything up
14:07justin_smithyeah, that's weird
14:11amalloydevn, noprompt: what clojure version, and what is the value of *data-readers*? i can't think of a data reader that would cause that behavior (clojurebot's is the only one that makes sense), but it would help narrow down the issue
14:11llasramAnd what REPL client
14:11amalloyoh yes, that's quite likely to be important too
14:12justin_smith oh yeah, a repl client or middleware could effect this, right?
14:12technomancymiddleware can do anything
14:12technomancythat's what's so scary about it
14:12amalloytechnomancy: why haven't we harnessed this awesome power?
14:13amalloylet's cure cancer, feed the poor, all with middleware!
14:13technomancyamalloy: with great power comes great responsibility
14:13dbaschtechnomancy: nah, that’s the guilt-tripping attempt of those who do not have the power :P
14:14justin_smithreminds me of a certain kind of theology - all the power in the world, and what it really wants to do is give you the wrong error message when you do a typo in a macro
14:16justin_smithor even Q in Star Trek
14:16technomancymy favourite idea for middleware would be to prank an nrepl client that can display pictures by rendering the stack trace as an image and introducing a ton of compression artifacts
14:16technomancyit really bums me out that the cider content-type work fizzled out
14:18nopromptamalloy: just cider.
14:18justin_smithtechnomancy: I'd just settle for cider working as documented at this point. Maybe my emacs is fubared, I don't even know.
14:18technomancyjustin_smith: come on; priorities, man
14:19justin_smithheh
14:19nopromptamalloy: clojure version is 1.6.1
14:20justin_smithtechnomancy: for example, I have the cider middleware in my profiles.clj, it shows up in my deps tree and I can successfully access the namespaces that it defines, but cider gives me the same "you have the wrong middleware" popup message each time I connect.
14:20justin_smiths/popup/splash
14:20technomancyjustin_smith: the hilarious part of that is how this used to happen all the time in slime
14:20justin_smithright, at this point I miss slime
14:20technomancyand it was one of the big reasons to ditch slime and create nrepl.el
14:20justin_smiththe eternal cycle of features and breakage
14:21technomancyyeah at this point we're just waiting for the frost giants to show up
14:21kenrestivois it just me or are simple case statements or core.match much easier to read and reason about than multimethod dispatch?
14:21bbloomkenrestivo: surely that depends on the problem at hand
14:22dysfunsome problems suggest some approaches more than others
14:22amalloyPS guys 2010 slime still works great
14:22justin_smithtechnomancy: M-x fenris
14:22kenrestivoyep, i think it's an overhead thing. multimethods with functions of 2 lines each, the overhead is so noisy, it's confusing. if i had huge functions then maybe a core.match or case would be too unweildy and fragile
14:23dysfunquite a lot of my functions are simple ifs or condps
14:23llasramkenrestivo: I'll just say straight up "yes," which is why I try to only use multimethods where the set of dispatch values is not known exhaustively to the interface
14:24kenrestivogood rule of thumb, thanks
14:24dysfunbut protocols can do that too
14:24dysfunwell, to some degree
14:24dysfunagain, depends on the individual case
14:25llasramdysfun: Sure, by "multimethods" there I meant "multimethod or protocol; whichever is most appropriate to the particular problem requiring open dispatch"
14:25justin_smithdysfun: to me multimethod and protocols are both about allowing external extension, with a flexibility+reloadability vs. performance tradeoff
14:25dysfunand yet i find myself writing protocols to tie things up quite commonly even where i've only got one case, because they seem like a convenient way of organising things
14:26llasramdoooooom
14:26TimMcDid you hear something?
14:27bbloomdysfun: eh gads, insert YAGNI or some other acronym or design principal here
14:27technomancyjustin_smith: have you tried falling back to an earlier cider?
14:27llasramI was just tolling the doom of functional style by the death of a thousand objects
14:27technomancyI've had good luck with 0.6
14:28justin_smithtechnomancy: yeah, I think there is something in an elc file or I don't know what
14:28dysfunbbloom: again, depends on what you're trying to do. there's more than one way to build software and all that
14:28justin_smithtechnomancy: OK, I will check 0.6 out next time I feel like shaving a yak, thanks
14:28technomancyjustin_smith: mv ~/.emacs.d/elpa/cider* ~ then M-x package-install from marmalade
14:28bbloomdysfun: by "only one case" you mean 1 object implementing the protocol and 1 method in the protocol? seems like a total waste, when a function would do
14:28technomancyshould do the trick
14:29technomancyif not you can always move it back
14:29justin_smithtechnomancy: I moved the whole elpa dir last time :P
14:29dysfunbbloom: no, multiple methods in the protocol
14:29TimMcversion your shit
14:29dbasch(inc 0.6)
14:29lazybot⇒ 1
14:29bbloomdysfun: *shrug* ok
14:29amalloydbasch: math is broken
14:29technomancydbasch: lol
14:29TimMc(inc 0)
14:29lazybot⇒ 1
14:29TimMcphew
14:29llasram(inc 0)
14:29bbloom(inc 0)
14:29lazybot⇒ 2
14:29lazybot⇒ 3
14:30bbloom :-D
14:30llasramUh oh
14:30TimMcnoooo
14:30justin_smith(inc 42)
14:30lazybot⇒ 8
14:30dbaschI saw a black sheep => all sheep are black
14:30nathan7uh oh, we broke the universe
14:30dysfun:D
14:30technomancyI won't tell ify ou ddon't
14:30amalloydbasch: well, being more careful is too tiring: i saw a black sheep => at least one sheep is black on at least one side
14:30nathan7don't you understand the graveness of our impending doom? :(
14:31amalloyis graveness a word? seems like it would be squished out by all the gravity
14:31dbaschthis universe is an alpha release anyway, it’s supposed to crash or fizzle out
14:31justin_smithnathan7: all we need is for 36 people to clap their hands, and tinkerbell will live
14:32dbaschamalloy: that assumes that sheep are immutable. Maybe it’s black on one side no more.
14:32TimMcSpoiler: Tinkerbell kills Wendy
14:33dbaschwe know that yaks are mutable
14:33dysfundbasch: a friend accused me of genetically engineering a bigger yak the other day to give me more to tackle
14:33dbaschdysfun: you think we’ll need a bigger yak?
14:34dysfunyou never *need* a bigger yak
14:34nopromptisn't that part of joke regarding a mathematician and some other non-mathematician folks?
14:34dysfuni can't speak for you, but i'm permanently waist-deep in yak hair
14:34nopromptsomething about being on a train in scotland.
14:35dbaschnoprompt: it’s even on wikipedia http://en.wikipedia.org/wiki/Mathematical_joke
14:35nopromptthere is at least one sheep in scotland with one black side.
14:35justin_smithnoprompt: my favorite is the one about the topologist in Africa, who climbs into a cage and declares that he has captured the lion.
14:35noprompthaven't read that one.
14:36dbaschthe mathematician actually contemplates the possibility of mutation
14:36nopromptbut just the gist of it made me laugh.
14:37justin_smithnoprompt: not what I had in mind, but amusing - http://komplexify.com/math/humor_pure/HuntingLions4.html
14:37justin_smithoh, this one http://komplexify.com/math/humor_pure/HuntingLions.html
14:39justin_smithor not...
14:39justin_smithI had no idea this was a whole genre
14:41justin_smithhttp://www.math.wichita.edu/~pparker/augtat/jokes1.htm
14:43bbloomsince clojure has hijacked the word "atom"... have we agreed upon a word to use for things that are not "composites"?
14:43technomancybbloom: joc uses "scalars"
14:43bbloomjoc?
14:44justin_smithimplementation wise, couldn't we say anything other than a primitive is composite?
14:44technomancybbloom: joy of clojure
14:44bbloomjustin_smith: strings are not primitive... but are they composite?
14:45justin_smithwell, they implement CharSequence
14:45bbloomtechnomancy: seems unfortunate to steal another word, but i the word "vector" is already stollen :-P
14:46bbloombut i guess i'll do with that
14:46bblooms/do/go
14:46bbloomthanks
14:47justin_smithbbloom: I would say the fact I can map on a string makes it effectively composite
14:48amalloyjustin_smith: you can map over nil, too
14:49justin_smithhmm
14:49bbloomjustin_smith: surely (seq 2) should return (0 1)
14:50bbloomie a bit string in little endian order
14:50bbloomdoes that make numbers composites?
14:50amalloybbloom: hah, i thought you were proposing (seq 2) be the same as (range 2)
14:50bbloomamalloy: TDD strikes again :-P
14:51amalloy(inc bbloom)
14:51lazybot⇒ 48
14:51bbloomi'm kinda not kidding about (seq Number) tho :-P
14:51bbloomi've wanted that, heh
14:51llasramRuby: [0, 1, 2].collect { |x| 5[x] } ;;=> [1, 0, 1]
14:52amalloybbloom: i'm quite certain that would produce errors far outweighing the convenience it adds
14:53bbloomamalloy: *sigh* you're probably right
14:53amalloybbloom: you're allowed to want it anyway, though
14:54justin_smithgigo, after all
14:54bbloomamalloy: more than that, i want "modular type classes"
14:54amalloymodular how?
14:54bbloomie the ability to scope the availability of a protocol to a particular lexical context
14:54justin_smithfirst class protocols?
14:55bbloom"for this namespace, numbers are colls of bits"
14:55bbloomamalloy: http://www.mpi-sws.org/~dreyer/papers/mtc/main-long.pdf
14:56bbloomlittle odd that paper doesn't mention scala though
14:56dbaschthat’s like redefining operators to do unexpected things
14:56amalloybbloom: so you mean scoping particular implementations of a protocol, rather than the entire protocol itself? if the whole protocol is limited in lexical scope, that means it's not open at all: you know at compile time all the instances, and could hard-code everything just as easily
14:56justin_smithbbloom: oh, so the other half - first class / scoped implementation of protocols
14:56dbaschthe kind of things programmer do because they (we) can
14:56bbloomamalloy: well you know i've wanted modules :-)
14:57amalloyman, i don't keep track of the crazy things wanted by everyone in #clojure
14:57bbloomamalloy: protocols are a dynamic mechanism for both open dispatch and dependency injection
14:57amalloyi just remember technomancy doesn't like the MIT license, and derive everything else from that
14:57justin_smith$learn bblom wants modular type classes
14:57lazybotMy memory is more powerful than M-x butterfly. I won't forget it.
14:57bbloomtype classes are a static mechanism for open dispatch, but not really for dependency injection ... you need an extenistential for that
14:58technomancyit's fine for personal projects, just crappy for work things
14:58bbloomwho is bblom? :-P
14:58justin_smith$rmtopic bblom
14:58lazybotTopic: "bblom" doesn't exist!
14:58justin_smith$learn bbloom wants modular type classes
14:58lazybotMy memory is more powerful than M-x butterfly. I won't forget it.
14:59amalloybbloom: i recently printed something with kerning so bad that my last name appeared to be "Malby"
14:59amalloyyou should be happy with bblom, or even bblorn
14:59Baluse http://raw.pro-chan.com/Raw/t/674_1382207920 watch
14:59bbloomi used to sign my full name, then just BBloom, then just Bloom, then just BL-squiggle. now it's basically just a stylized B
14:59justin_smithwith bad enough kerning, it could become bloloorn
15:00amalloyjustin_smith: how does the first B split apart but not the second? i would like to meet mister lololoom
15:01bbloomMWAHHAHAHA sewing
15:01dbaschBB Loom sounds like an apparel brand to me
15:01justin_smithhah
15:01Baluse http://raw.pro-chan.com/Raw/t/674_1382207920
15:01Balusebnan
15:01Baluseban
15:01bbloomBB Looms are super comfortable. I should know, we've been making them with only the highest quality fabrics, since 1949
15:02vermathe hell was that
15:02justin_smithsome gore
15:03vermaI mean Baluse pasted those links and then requested ban?
15:03justin_smith"ban me, I dare you!"
15:03mearnshbnan
15:04TimMcbnana
15:04vermalol
15:04dbaschpro tip: in chrome you can set flash to “click to play”, save memory and avoid being exposed to unwanted content
15:04mearnshnodeso is PMing spam...
15:08technomancysometimes I wonder if it'd save time to just not deop
15:08technomancy=\
15:08justin_smithtechnomancy: if only you had some tool that would acquire ops, do the thing, and give them up again
15:11technomancyfascinating
15:13nathan7dbasch: I just have flash blocked
15:13nathan7dbasch: ah, yes, that's the click-to-play, nvm
15:14bbloomtechnomancy: yeah, can't you just create a command alias that enables / bans / disables ?
15:17justin_smithbbloom: I bet he could make a keyboard with a dedicated "ban somebody" button
15:17bbloomlol
15:19gfrederickswhen I do C-c C-d w/ cider, a yellow dialog is displayed with the docstring; how do I scroll up and down in that window?
15:21shemAI bot that bans too imperative channel members?
15:22justin_smithgfredericks: there are commands scroll-other-window and scroll-other-window-down
15:22justin_smithC-M-v, C-M-S-v
15:23justin_smithgfredericks: I cannot guarantee they work in your situation, C-c C-d is totally broken in my cider
15:28gfrederickshmm. doesn't work immediately but you've pointed me somewhere; thanks
15:29justin_smithgfredericks: if you don't use it yet, M-x apropos is pretty cool
15:35cflemingjustin_smith: Does apropos search docstrings as well, or just function/var names?
15:35justin_smithcfleming: iirc doc strings, checking that now
15:36justin_smithcfleming: (apropos "ARG") returned enough to tell me "doc strings too"
15:36justin_smithit's a regex search, as well
15:37cflemingjustin_smith: Interesting, thanks.
15:37justin_smithkeeping up with the joneses ?
15:37cflemingjustin_smith: Yeah, I saw that - nice. Thought I'd be interested to know if that's ever actually that useful.
15:37cflemingHaha, a mix of that, general interest, and planning the competition :-)
15:38justin_smithcfleming: yeah, I use it when I know a few keywords to look for, but maybe not the proper command name
15:39justin_smithcfleming: like I used (apropos "scroll.*other") to find the function that may help gfredericks with scrolling the other window
15:40cflemingjustin_smith: I see. IntelliJ generally does partial string matching which works pretty well for that. So you'd search for "scroll other" and it would match.
15:40cflemingThere's no equivalent to apropos's "match two words" thing though.
15:40justin_smithcool, yeah, similar concept - with doc strings?
15:41cflemingWell, I'd have to add that. I'll start with just var names since they're already indexed.
15:41justin_smithor help contents, or whatever the equivalent is I guess
15:41cflemingYou can already navigate to any symbol by name, but showing the doc would be good.
15:42justin_smithcfleming: wait, are we talking about searching for code properties or editor commands now?
15:42cflemingActually, I just realised you can already see the doc or the implementation in that popup - cool.
15:42cflemingjustin_smith: Oh right, I'm talking about code search.
15:42cflemingIntelliJ already allows you to search for editor commands.
15:43cflemingSorry, wasn't thinking straight.
15:43justin_smithcfleming: it's overloaded, because he found the issue while searching for info about a symbol, and the potential solution was found by searching for info about a command, and both are implemented by "apropos" in two different languages
15:44cflemingSo apropos returns both?
15:44justin_smithcfleming: clojure.repl/apropos vs the elisp function arpopos
15:44justin_smithboth are lisps with similar influences
15:44cflemingjustin_smith: Ah, I see.
15:44zerokarmaleftthat guy got banned for the same crap in #haskell, guess he's making the rounds
15:52arrdemwho are we not banning today?
15:53justin_smithalternate idea for technomancy: a usb enabled hammer, activated by pounding a solid surface, that bans the username under the cursor.
15:56arrdemnaw come on technomancy totally needs an Atreus key for banning
15:57dbaschI would buy a keyboard that had “coffee” and “pizza” keys
15:58justin_smitharrdem: when your user interface is a physical hammer, every problem looks like a user you can ban
16:00arrdemjustin_smith: technomancy is an amazingly gentle dictator, don't go giving him ideas
16:00amalloyfwiw lazybot has an ops plugin
16:00arrdemamalloy: we totally talked about an ops bot before and decided it'd never happen
16:00amalloyyeah, i don't really expect anyone to give lazybot ops
16:01amalloythey won't even give 'em to me
16:01justin_smithamalloy: yeah, the ops plugin was kind of broken but I fixed it with my patch (it was taking the first arg, so if you sent "+b butthead" only "+b" would get run)
16:01TimMclazybot: Should you be given ops??
16:01lazybotTimMc: Definitely not.
16:02arrdemTimMc: I c u cheating
16:02arrdemlazybot: do you deserve ops???
16:02lazybotarrdem: Yes, 100% for sure.
16:02llasramlazybot: Is that an honest answer???
16:02lazybotllasram: Yes, 100% for sure.
16:02llasramWell, there we go
16:02TimMclazybot doesn't want power, so it is a good candidate for dictator.
16:02arrdemclearly we should op the bot
16:02justin_smith$will the fun ever stop?
16:02arrdembecause it said so
16:02lazybotjustin_smith: Yes.
16:02justin_smith:(
16:02llasramhah
16:02arrdemT_T
16:02llasramexistentialbot
16:02amalloyjustin_smith: i mean, you're not supposed to put that +b in there, right? isn't that just a user error?
16:02TimMcUsable energy is finite.
16:03arrdemlazybot: can the ammount of entropy in the universe be significantly decreased?
16:03dbaschbut the alternative would be for fun to slow down to an infinitesimal trickle, which is worse than stopping
16:03justin_smithamalloy: you send lazybot /ban butthead, lazybot generates a mode command, and sends "mode +b", cutting off the "butthead" part
16:03justin_smith@ban of course, but yeah
16:03amalloyhuh. well, if you say so
16:04EvanRso this api wants a quoted vector of symbols and vectors and shit, is it possible to programmatically compute this quoted structure? because right now i only know how to quote the fully expanded literal representation, typed out
16:04technomancybots with ops... I've been following SwiftOnSecurity with her doomsday machine-apocalypse warnings too much for me to feel comfortable with that
16:04Glenjamini think the operator services can do that stuff
16:04TimMcdbasch: I think fun is quantized.
16:04justin_smithamalloy: or I could be misremembering, this could be an interaction with the newer irclj version actually
16:04Glenjaminyou can /msg chanserv and it does something
16:04justin_smithamalloy: either way, I got it working before submitting the patch
16:05dbaschEvanR: what api is that?
16:05EvanRdatomic
16:05technomancyhttp://imgur.com/a/1PDRJ
16:05EvanR,'[1 2 3]
16:05clojurebot[1 2 3]
16:05EvanR,'[1 2 (+ 1 2)]
16:05clojurebot[1 2 (+ 1 2)]
16:05EvanR,(eval '[1 2 (+ 1 2)])
16:05clojurebot[1 2 3]
16:05arrdemtechnomancy: @swiftonsecurity is one of my fav joke accounts rn since doge_js got banned/deleted
16:06EvanR,(eval '[1 ?x (+ 1 2)])
16:06clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ?x in this context, compiling:(NO_SOURCE_PATH:0:0)>
16:06justin_smith,(vector 1 2 (list '+ 1 2)) ; EvanR
16:06clojurebot[1 2 (+ 1 2)]
16:06technomancyarrdem: high art
16:06EvanR,[1 '?x (+ 1 2)]
16:06clojurebot[1 ?x 3]
16:06technomancyhttp://i.imgur.com/w1PsvYS.jpg is particularly chilling
16:07EvanRtrying it
16:07technomancyyou hear that lazybot?
16:08EvanR'[1 ?x 3] is the same as [1 '?x 3] ?
16:08amalloytechnomancy: the internet is a weird place
16:08amalloyEvanR: certainly
16:08arrdemtechnomancy: art yes... high I'm not so sure about
16:09technomancyarrdem: in particular I'm thinking of when she was like "I'm Taylor Swift, and this is my keybase.io account"
16:09EvanRamalloy: is there some law or experiment i can use to prove that?
16:09justin_smithto prove that the internet is a weird place?
16:09EvanR,(first '[1 ?? 2])
16:09clojurebot1
16:10EvanRguess thats that
16:10EvanR,(second '[1 ?? 2])
16:10clojurebot??
16:10amalloyEvanR: that is what quoting does. '[a b c] is the same as ['a 'b 'c], because that is how quoting is defined. and '3 is the same as 3, because 3 evaluates to itself
16:10justin_smith,(= [1 '?x 3] '[1 ?x 3] (conj [1 '?x] 3))
16:10clojurebottrue
16:10EvanR,(type '?)
16:10clojurebotclojure.lang.Symbol
16:11EvanRyok
16:11Glenjamindoge_js got banned?!
16:11Glenjaminoutrageous
16:11justin_smithGlenjamin: top post here http://dogejs.tumblr.com/
16:11arrdemjustin_smith: .... I love you
16:12EvanR,'(a b { [ } ] d)
16:12clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: }>
16:12EvanRhah
16:12justin_smitharrdem: any particular reason?
16:12arrdemjustin_smith: I didn't know that tumblr existed
16:13EvanR,(type '(1 2))
16:13clojurebotclojure.lang.PersistentList
16:18justin_smithEvanR: btw, if you don't need to show the result to everyone, you can send a /msg to the bot. Or run your own repl, of course.
16:19EvanR(str '?)
16:19EvanR,(str '?)
16:19clojurebot"?"
16:19EvanRok
16:19godd2No, I think you confused him.
16:19EvanRwhat is unquotable?
16:19justin_smithEvanR: I think the more important question is what is readable
16:19justin_smithEvanR: if the form is unreadable, you can't get a quoted version
16:19mdrogalisHas anyone used lein-ring with Component? That plugin requires you give it the handler var name in project.clj, which is at odds with Component.
16:19Glenjaminit amuses me slightly that /msg to clojurebot is faster than starting a clojure repl on my own machine. even if not already on IRC
16:19justin_smithGlenjamin: it is quite easy to use ring without lein-ring
16:19Glenjaminyou mean mdrogalis
16:19justin_smitherr, oops, yeah
16:19Glenjaminand you can also create a ring-entry-point namespace which just calls your component (main) function and throws the ring server into a var
16:19justin_smithGlenjamin: clearly you need more ram, so that you always have 4 or 5 random clojure repls around
16:19mdrogalisjustin_smith: I'm trying to generate a war file.
16:19Glenjamincurrent JVM count: 4
16:20arrdemGlenjamin: don't forget the JVMs that lein leaves around :P
16:20mdrogalisGlenjamin: There we go. thanks :)
16:20Glenjaminarrdem: trampoine!
16:20Glenjaminpoline even
16:20justin_smith$ ps x | grep java | wc -l => 8
16:20arrdemtrampoline is good juju
16:20dbaschoutput of “pgrep java” : 14 lines
16:20justin_smiththat count is after some trampolines
16:20Glenjamini'm suspicious of activity monitor though, it claims 1 JVM is using 3.1MB RAM and one is using 1012KB :s
16:21dbaschjustin_smith: ps x|grep -c java
16:21justin_smithdbasch: oh, right :)
16:21Glenjaminunix philosophy: one thing well
16:21mdrogalisGlenjamin: I don't see any docs for that. Can you help me locate that?
16:21dbasch50% of the pipes :)
16:22Glenjaminmdrogalis: dunno if there are, just define (ns myapp.ring-entry-point)
16:22mdrogalisGlenjamin: Ah, okay. Thanks mate.
16:23justin_smithbringing it all together: pgrep -c java => 8
16:23dbaschjustin_smith: only that doesn’t work on osx
16:23justin_smithOK
16:23Glenjaminbrew install proctools
16:24Glenjaminwhenever i do clojure stuff i keep OS X's activity monitor on all the time filtered by java, i always seem to loose JVMs by accident otherwise
16:24Glenjamini blame lighttable
16:25dbaschloose JVMs contribute to global warming, we should all do our part
16:25dbaschdo global variables contribue to global warming?
16:26technomancydbasch: only if optimized by hotspot
16:27justin_smithdbasch: I think physics tells us that the more they move the higher the temperature, so immutible values help here
16:27justin_smithdbasch: or in js, of course, you can freeze them
16:28dbaschjustin_smith: but freezing something definitely contributes to global warming
16:29speiDoes anyone have a problem getting popups to work in the cider-repl for emacs 24.3?
16:29speipopups from company-mode
16:29dbaschspei: which cider?
16:29spei0.7
16:29dbaschspei: that’s one of the reasons I downgraded to 0.6
16:30speiso, it works in 0.6 but not 0.7? company mode seems to work in the normal .clj file buffer
16:30justin_smithdbasch: does 0.6 use an nrepl middleware dep on the jvm side?
16:31technomancy0.6 is "cider classic"
16:31technomancybasically just nrepl.el with a new name
16:31justin_smithawesome... I am getting more tempted to switch
16:31dbaschit works with 0.6 for me, in 0.7 I was experiencing random freezes
16:33speiwhere do I get cider 0.8.0-SNAPSHOT?
16:33zerokarmaleftI'm on 0.8.0-SNAPSHOT too, much more stable, though in certain cases company-mode still gets hung up
16:34zerokarmaleftbut at least that's interruptible
16:35speiis that the cider nrepl middleware part for leiningen?
16:37justin_smithspei: no, but you can pull it in via ~/.lein/profiles.clj
16:37perplexasome offtopic, but damn boy, the new pink floyd album is nice :)
16:38speijustin_smith: that won't align to the emacs CIDER version, right?
16:38justin_smithspei: there is no way to do that automatically
16:38justin_smithspei: you have to make sure you ask for the right version for your current emacs cider version
16:39technomancythere is
16:39justin_smithoh?
16:39technomancycider just doesn't do it
16:39technomancy(setq cider-lein-command "lein update-in :repl-options:middleware assoc whetevs -- repl")
16:41technomancyI guess it's a different defvar now but whatever
16:44technomancyyou should only have to specify nrepl middleware if you're launching your server by hand; this is dumb.
16:45speiis there a suggested way to launch a repl on a remote server?
16:46technomancyspei: check out the tools.nrepl readme; it covers that
16:47speithanks
17:06technomancybahaha "I'm reluctant to add increasingly special purpose builtin functions." <- re: map and filter in google go
17:06technomancyhttps://groups.google.com/forum/?_escaped_fragment_=topic/golang-nuts/RKymTuSCHS0#!topic/golang-nuts/RKymTuSCHS0
17:06technomancy"Where will this end? next you'll be saying you want reduce!"
17:07tbaldridgetechnomancy: that's why you don't, you just implement .reduce and then let everyone else built map, filter, etc ;-)
17:08technomancyconsidering google go's popularity among python refugees, being freaked out about reduce would almost make sense.
17:11technomancythe best part is how some of the people in the thread have "everything should be as simple as possible, but not simpler" in their signature
17:13technomancyoh man, it just keeps getting better
17:14technomancy«"bar = map(foo, f)" isn't actually any shorter than a for loop, because you have to write f somewhere, which you've conveniently omitted.»
17:14dbaschthat’s why we all use one-instruction-set computers. Simple is always better, because Einstein said so.
17:14technomancyhttp://p.hagelb.org/eyebrow.gif
17:15technomancydbasch: brb, rewinding my turing tape
17:16hiredmanI would prefer to have someway to write a generic map datatype without relying on interface {} over map/filter/reduce
17:17hiredmantechnomancy: do they talk about making the functions typesafe? I don't think you can in go
17:17Glenjaminbasically go rejects re-use
17:17Glenjaminor at least, the people who make the language seem to
17:18Glenjaminalso how did you get this google groups view? it's much better than the usual GWT mess
17:20technomancyhiredman: I get the feeling they have gone through pavlovian training which keeps them from mentioning the topic of generics outright, and thus they are forced to dance around the actual issues at play.
17:20technomancyGlenjamin: noscript!
17:21Glenjaminbah, it's only really mobile where i find it's a problem :(
17:21technomancyGlenjamin: it really needs a simple <hr> between messages, but other than that it's great
17:21Glenjaminyeah, userStyle.css to add a bottom border on those table cells would be neat
17:21hiredmantechnomancy: sounds about right
17:21technomancyhm. well if you end up writing one, let me know =)
17:22zerokarmaleft"You'd need two versions of map, one that mutated and one that copied." aw man, this is just full of depressing
17:22amalloytechnomancy: <hr>? ITYM <hr /> #justxhtmlthings
17:22hiredmanit does say "golang-nuts" in the url
17:23TimMcqft
17:23technomancyamalloy: I actually have to stop myself from being xhtml-pedantic still even after all these years
17:24TimMctechnomancy: This interface has the same problem LJ has where it puts the attribution block vertically centered next to the post.
17:24TimMcOr had, I guess. That was an interface or two back.
17:24amalloytechnomancy: stopping yourself from being pedantic doesn't sound like a fun way to live
17:25Glenjaminxhtml-pedanticity is great
17:25GlenjaminXML parsers are like a million times easier than tag-soup SGML
17:25technomancyamalloy: I'm trying to kick the habit, man
17:25amalloy"pedanticity" - a word you threw in for the english pedants?
17:26TimMcamalloy: Language is generative, deal.
17:26TimMc(is what I would say to anyone who objected)
17:26amalloyTimMc: well like...while that's true and i wish it weren't, i don't think that is enough to conclude that any sequence of letters someone mashes together once is a new word
17:26TimMcthat's total lavfiwkegw
17:27technomancythe word is cromulent.
17:28technomancyheh; wiktionary cites Real World Haskell for "cromulent"
17:28amalloywhaaaaat
17:28technomancyhttps://en.wiktionary.org/wiki/cromulent
17:29amalloyman, that reminds me. a while ago i talked to someone who believed that the tv show Lost was the originator of "you make your own luck"
17:29dbaschtechnomancy: I don’t think wikitionary is a cromulent source of information
17:29technomancydbasch: fine lemme check the urban dictionary
17:30technomancyafter all https://twitter.com/freebsdgirl/status/530462940823310337/photo/1
17:31turbofailfantabular
17:32Glenjamintechnomancy: https://userstyles.org/styles/107024/google-groups-noscript-separate-posts
17:33technomancyGlenjamin: top-notch
17:33technomancythanks
17:33Glenjaminoh right, pedantry
17:34Glenjaminmeh, pedanticity sounds better imo
17:35aperiodicHeh, I agglutinate words into longer versions of existing words all the time.
17:35Glenjaminoh god, i've stopped adjusting the CSS and started reading this thread
17:35dbaschaperiodic: it sounds like you’re in a real quyzbuk
17:35Glenjaminthis is horrifying
17:36Glenjaminand people keep flocking to Go
17:36hfaafbanyone here know how to make a lot of money with clojure?
17:36aperiodicdbasch: I'll probably be able to hoistificate myself out of it
17:36dbaschaperiodic: https://www.youtube.com/watch?v=pHw4_oPJ6s8 :)
17:36amalloyhfaafb: (nth 1000 (iterate better product))
17:36amalloy(repeatedly cash-in)
17:37Glenjamin" functions can span multiple line's / pages"
17:37dbasch(reduce costs)
17:37Glenjaminwhaaat
17:37Glenjaminit gets worse
17:37Glenjamin"and have a syntax that allow that body of code of that size to be legible"
17:38dbaschhfaafb: it depends on how you define “a lot” of course, but clojure jobs pay reasonably well
17:38hfaafbugh but i hate workin for the man
17:38hfaafbi applied to circleCI but i wasn't smart enough v0v
17:39hfaafbs/applied/interviewed with
17:40dbaschhfaafb: I don’t know, create a clojure-based cryptocurrency? HickeyCoin?
17:40Glenjamini guess you get more bang-per-buck from clojure than, say, Java - so there's bound to be less jobs D:
17:40dbaschafter all he is Rich already
17:40turbofaillol
17:40TimMcjuxtcoin
17:40hfaafbi enjoyed it
17:41TimMc~juxt
17:41clojurebotjuxt is usually the right answer
17:42mysamdogWhat do you guys think about intellij + cursive?
17:42mysamdogI usually use vim, but I'm installing intellij now to try it out
17:42amalloyi hear cursive is fine. but if you like vim, you don't have to switch
17:42TimMchfaafb: (println "This is a stick-up")
17:43mysamdogYeah, I do love vim, but tbh having multiple files open is a bit difficult
17:43dbaschif you believe clojure gives companies a competitive edge, you could invest in a basket of companies that are primarily clojure shops
17:43TimMcThere are some additional side-effects, though.
17:43amalloyhfaafb: (-> "This is a sideways stick")
17:43mysamdogAnd I tried sublime, but lack of a proper REPL killed it for me
17:45dbaschhfaafb: I have an idea, you could create a better development environment for Clojure developers and sell it. I have the perfect name for you: BrightDesk
17:46cflemingmysamdog: I like Cursive, but then I develop it, so I'm biased. Let me know if you have questions though.
17:46hfaafbI'll probably abandon it and start an even more nebulous project
17:47amalloydbasch: LuminiferousCounter
17:48dbaschamalloy: that sounds like a development environment for nuclear reactor software
17:49amalloyjava is no good for nuclear power plants
17:49dbaschamalloy: Homer Simpson would use IdiotiJ
17:50dbaschbut actually the drinking bird would do all the coding
17:52dbaschamalloy: apparently C++ is… http://www.nrc.gov/reading-rm/doc-collections/nuregs/contract/cr6463/
17:52amalloydbasch: why you gotta put nuclear-reactor documents in my browser history? i don't need the NSA interested in why i'm reading that stuff
17:53dbasch(dec nsa)
17:53lazybot⇒ -1
17:54turbofailthey also use C++ in avionics
17:54turbofaili'm not entirely sure which use is more terrifying
17:56dbaschturbofail: in a class I took decades ago the professor said that some boeing aircraft (perhaps the 777) had several computers that voted, where all but one had the same software written in ADA, and the other one was in C++
17:57technomancyfault-detection with multiple implementations is a thing in aerospace
17:57technomancyit's kind of clever, modulo the C++ part
17:58technomancythey're both clean-room implementations from the same spec
17:58dbaschsome defense contractors had a process in which developers were not even allowed to compile their code
17:59turbofailhuh. how would they even enforce that?
17:59TimMcProcess.
18:00TimMcdbasch: I don't see the point of having quorum or average where you don't have at least 3 impls.
18:01TimMcOK, getting kind of tired of the REPL printing the 2nd-from-top (or is it root?) exception in a stack trace.
18:01technomancyTimMc: the 3rd is a human
18:02technomancyas soon as a discrepancy is noticed, the problem gets surfaced to the pilot or whatever
18:02TimMchrm
18:02TimMcAnd a pilot is supposed to do what?
18:02turbofaili prefer to envision a human crammed into the nose of an airplane, furiously working an abacus
18:02TimMcFile it in JIRA?
18:03dbaschturbofail: you could mandate the use of a language for which only the testers have the compiler, for example
18:03dbaschturbofail: or need libraries that only the testers have
18:04turbofailso... what if you write code that doesn't compile? you'd have to wait for your testing department to come back to you and hand you a printout with your compile errors?
18:04dbaschturbofail: exactly
18:04turbofaili don't really see the benefit of this approach
18:05dbaschit’s software that takes 5-10 years to develop
18:05turbofaili can certainly see the benefit of having a testing department that has no contact with the people writing the code
18:06dbaschturbofail: https://groups.google.com/d/msg/comp.sys.amiga.programmer/bIvakgEKj9s/QUe_dJYuZvgJ (1992)
18:10turbofaili'd like to see the original study
18:11m1dnight_hmm, another namespace question guys :p
18:12danielcomptonI'm wanting to write an online pretty printer. However I'm a little concerned about prettyprinting arbitrary code from the internet. What should I be looking out for/thinking about?
18:12m1dnight_I have a file RetryEx.clj that contains exactly this: (ns meta-clojure.stm.RetryEx (:gen-class :extends java.lang.Error))
18:12m1dnight_and now I want to use it in an other file to throw as en error
18:12m1dnight_Now it says (throw (new Error))
18:13m1dnight_and in the source i cloned it said (throw (new meta-clojure.stm.RetryEx)) but that does not seem to compile
18:13m1dnight_the file I try to throw it in is the following:
18:13m1dnight_(ns meta-clojure.stm.v5-mvcc-fine-grained-barging)
18:13m1dnight_any clues?
18:16dbaschdanielcompton that’s what clojail is for
18:17amalloydanielcompton: if you don't *run* the code there's not much to worry about
18:17danielcomptonamalloy: that's what I was thinking, I'm not actually running it
18:17dbaschI assumed it was about pretty-printing the output, my bad
18:17amalloyjust read it with clojure.edn, and produce a string from the data structure
18:18amalloydefinitely don't read it with the clojure reader, which can do sneaky evals when you aren't expecting them
18:18danielcomptonAlthough I think to pass input to fipp it needs to be a clojure data structure, so that means I'd need to first parse the inpute
18:19amalloyright, you need a reader. and clojure.edn is the one for you
18:22danielcomptonamalloy: great. And I use clojure.edn, not org.edn-format.data.edn?
18:22m1dnight_anyone?
18:22clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
18:23m1dnight_I can't get it to work and it's frustrating me :p
18:23m1dnight_ (:use [meta-clojure.stm.RetryEx])) putting the :use in my file seems to work fine, which should imply the compiler can find it, right?
18:23danielcomptonm1dnight_: do you want to put your stacktrace in a pastebin?
18:23justin_smith meta-clojure.stm.Retryx is not a valid class name
18:24m1dnight_because of the capitalisation?
18:24justin_smithso it can't be used as an arg to new
18:24justin_smithbecause of the -
18:24amalloydanielcompton: i don't really know what edn-format is all about. it looks like it is an edn writer, not reader
18:24m1dnight_oh
18:24justin_smithmeta_clojure.stm.Retryx should work
18:24justin_smithalso (meta_clojure.stm.Retryx.) is better than (new meta_clojure.stm.Retryx)
18:24justin_smith(but they do the same thing)
18:25m1dnight_https://www.refheap.com/92830
18:25m1dnight_that's the stacktrace
18:25bbloomdanielcompton: fipp is a pretty printing engine with a built in formatter for clojure data
18:25m1dnight_let me post a tree hold on
18:25bbloomdanielcompton: the engine operates on a particular shape of clojure data, which you can generate yourself from any input you want
18:25bbloomyou need to create a "pretty document". see https://github.com/brandonbloom/fipp/blob/master/src/fipp/edn.clj for how that works on normal clojure data
18:25justin_smithm1dnight_: also, :use is for namespaces (which can have -), :import is for classes
18:25m1dnight_https://www.refheap.com/92831 <- the tree
18:26danielcomptonbbloom: what do you mean "a particular shape"?
18:26dbaschm1dnight_: did you change the RetryEx namespace?
18:26justin_smithm1dnight_: there is a cool config in emacs to put the ~ files in a . directory instead of alongside your files
18:27justin_smith(setq auto-save-file-name-transforms '((".*" "~/.emacs.d/backups/" t)))
18:27m1dnight_yes, I changed the namespace (to (ns meta_clojure.stm.RetryEx) that is)
18:28justin_smithm1dnight_: the namespace name is fine
18:28justin_smithyou just can't address the class that way
18:28m1dnight_yueah, i tried that first, doesn't work either
18:28bbloomdanielcompton: it's a little language for describing how you want your stuff pretty printed, look at that file
18:28m1dnight_I also recompile the RetryEx everytime in Emacs, so that should be fine
18:28Glenjamindanielcompton: Maybe use the cljs reader?
18:29danielcomptonGlenjamin: I don't think theres a cljs pprint library yet
18:29GlenjaminSounds like a golden opportunity!
18:30GlenjaminIt would solve any security issues anyway
18:30danielcomptonGlenjamin: theres a few places where it's being worked on https://github.com/brandonbloom/fipp/issues/7
18:30danielcomptonGlenjamin: http://dev.clojure.org/jira/browse/CLJS-710
18:30justin_smithm1dnight_: OK, the namespace can be meta-clojure.stm.RetryEx, and you should :require that namespace, and then (:import (meta_clojure.stm RetryEx)) and then you can create an instance with (RetryEx.)
18:30noonianshould write cljs format while your at it
18:30danielcomptonnoonian: not sure if I'm able to shave that yak at the same time
18:32m1dnight_hrm, still not working
18:32justin_smithm1dnight_: the same error?
18:32m1dnight_yes, classnotfount meta_clojure.stm.RetryEx, compiling /path../usingfile.clj
18:32m1dnight_found*
18:33m1dnight_I have put the following in usingfile.clj:
18:33m1dnight_ (:require [meta-clojure.stm.RetryEx])
18:33m1dnight_ (:import [meta_clojure.stm RetryEx])
18:33m1dnight_oh, sorry for paste on multiline
18:33justin_smithunless there is some error in how RetryEx is defined, that should work...
18:34justin_smithin the repl can you create an instance of that class?
18:34m1dnight_let me try, hold on
18:34amalloyremember that :gen-class doesn't do anything except when AOT compiling
18:34justin_smithyeah, if you are only doing this inside emacs, it likely won't work
18:36m1dnight_okay, so lein repl, eval (ns meta-/_clojure.stm.RetryEx), eval (RetryEx.) results in illegalargument, unable to resolve classname
18:36m1dnight_how can this be so hard
18:36justin_smithwhat is meta-/_clojure.stm.RetryEx
18:37m1dnight_i tried meta-clojure and meta_clojure
18:37justin_smithtake out the -/
18:37m1dnight_that's what I meant, sorry
18:37justin_smithsure
18:37mysamdogAfter switching DEs and installing a 600mb package, I can confirm that intellij isn't as nice as vim
18:37justin_smithm1dnight_: did you load the namespace before trying that?
18:37mysamdogI like xfce4 over my old hlwm setup tho
18:37m1dnight_yes I did, I executed (ns meta-clojure.stm.RetryEx), then (RetryEx.), that failed
18:37justin_smithno
18:37justin_smiththat's not how you load a namespace
18:38justin_smith(require 'meta-clojure.stm.RetryEx)
18:38mysamdogwait, I'm using cursive wrong
18:38noonian,(macroexpand '(ns foo))
18:38m1dnight_the require returns nil, so that went fine
18:38clojurebot(do (clojure.core/in-ns (quote foo)) (clojure.core/with-loading-context (clojure.core/refer (quote clojure.core))) (if (.equals (quote foo) (quote clojure.core)) nil (do (clojure.core/dosync (clojure.core/commute (clojure.core/deref (var clojure.core/*loaded-libs*)) clojure.core/conj (quote foo))) nil)))
18:38justin_smithm1dnight_: ok - just using (ns 'foo) creates the ns, it does not look up or load any code
18:39m1dnight_but then trying to throw a RetryEx fails
18:39justin_smithalso, you probably need a :reload if you already used ns
18:39justin_smithbecause require does nothing if the namespace already exists, unless you specify :reload
18:40justin_smith,(require 'meta-clojure.stm.RetryEx :reload)
18:40clojurebot#<FileNotFoundException java.io.FileNotFoundException: Could not locate meta_clojure/stm/RetryEx__init.class or meta_clojure/stm/RetryEx.clj on classpath: >
18:40justin_smitherr, sorry
18:40amalloyclojurebot: feature request: put code from every clojure project in the universe on your classpath
18:40clojurebotHuh?
18:40m1dnight_well, that doesn't work either
18:41m1dnight_would it help if I showed you my repo?
18:41justin_smithm1dnight_: sure, if you don't mind sharing I can check it out
18:41m1dnight_https://github.com/m1dnight/meta-clojure
18:42m1dnight_thanks for your paitence all, btw
18:42justin_smithm1dnight_: and remember that you need an explicit aot step for the genclass to work, I honestly forget how to combine that with running a repl
18:42m1dnight_patience
18:42m1dnight_so adding :aot :all in my project.clj is not enough then?
18:43justin_smithm1dnight_: well, that's in your uberjar profile
18:43justin_smithso for that to work I think you would need to create an uberjar, and run from that
18:43justin_smithm1dnight_: is this code checked into your repo? maybe it is in a branch?
18:43m1dnight_oh right, btw, the file I'm trying to compile and run is v5 in src/meta-clojure/stm/
18:43m1dnight_errr
18:44justin_smithfound it in the dev branch I think
18:44m1dnight_right, branch dev
18:44m1dnight_forgot about that :x
18:44justin_smithm1dnight_: this particular case of gen-class could be done much more easily with reify I think
18:47m1dnight_hey i think I got it working in my core.clj file
18:47m1dnight_(:import (meta_clojure.stm RetryEx)) in the (ns) macro
18:47m1dnight_and then just (throw (RetryEx. "message")) and that works
18:48justin_smithawesome
18:48justin_smithglad you got it sorted out then
18:48m1dnight_I think :aot :all did the trick
18:48justin_smithoh, added at the top level?
18:48m1dnight_(i got it working using lein run, though)
18:48m1dnight_in core.clj justin_smith
18:48m1dnight_it compiled everything and then it just worked
18:49justin_smithalso, I noticed in one of your namespaces (ns foo (:require [foo.bar]) (:require [foo.baz])) and it's better to make that (ns foo (:require [foo.bar] [foo.baz]))
18:49justin_smithm1dnight_: awesome
18:50mysamdoghey cfleming: after playing around with cursive a bit, I really like it
18:51m1dnight_justin_smith: yeah I should fix those, but it has been of a fight, me and namespaces. Admittedly, It's because I lack understanding though, i think
18:51justin_smithm1dnight_: once you get it, you'll miss them in the langs that don't have them
18:52mysamdogOnly complaint so far is that with structural editing I can't seem to insert a )
18:52technomancygen-class seems like a rough place to start
18:52justin_smithm1dnight_: something that helped me a lot was looking at the docs for refer, alias, and other related functions that build up the namespace ops like require and use. ymmv though
18:52m1dnight_hah, now it's just emacs that can't work with it
18:52m1dnight_oh
18:52amalloymysamdog: that's on purpose
18:52justin_smithtechnomancy: yeah, and it's so appealing to new clojure programmers whose go-to for any problem is "make a class"
18:53m1dnight_well, I intend to get a deeper understanding of clojure the coming months, so i might as well might :p
18:53mysamdogI understand why it wants to handle them automatically, but this code was shitty and I didn't balence the parens when I wrote it
18:53technomancyyou can run clojure.core/compile from any repl
18:53justin_smithmysamdog: in emacs?
18:53amalloymysamdog: i don't know about cursive specifically, but every other paren balancer i know of has some kind of override
18:53mysamdognope, vim
18:54dbaschmysamdog: disable it, fix it and re-enable it
18:54mysamdogdbasch: yep, thats what I did
18:54mysamdogBut so far, I'm really impressed
18:57justin_smithmysamdog: there's a conversion process, and then you are hooked
18:57justin_smithmysamdog: complete with withdrawal when you lose it
18:57amalloylike the borg
18:57mysamdogOh, I love the structural editing, I missed it when I switched from emacs to vim
18:58mysamdogI now realize why people love intellij so much
18:59aperiodicmysamdog: paredit.vim
19:01mysamdogaperiodic: got it, will be nice to have when I need to make some quick edits
19:02amalloydon't you vimmers have sweet navigation commands anyway? like %[ or something?
19:03mysamdogYeah, they were actually really great, they just didn't really do it for me
19:03mysamdogI wanted to love it
19:07aperiodicparedit.vim doesn't have much in the way of navigation commands besides [[ / ]] (go to beginning or end of top-level form)
19:08aperiodicI mainly move around by searching
19:09amalloyaperiodic: my favorite "advanced" paredit commands in emacs are paredit-forward-up and paredit-backward-up
19:10technomancywhat no love for convolute?
19:10amalloyfor navigation, anyway. for editing i'm a big fan of paredit-convolute-sexp
19:10amalloysince aperiodic was talking about navigation
19:11technomancyI see. carry on.
19:11aperiodicwhat does forward-up do?
19:11amalloyaperiodic: moves up one level of nesting (to a less nested form), and puts point at the end of it
19:12amalloyso like, "go to the end of the current form", and if you repeat it it goes to the end of the next-outermost form
19:12aperiodicso if you were in the middle of a value in a let block it'd take you to the end of the bindings?
19:12amalloyyes
19:12amalloywell
19:12amalloyassuming that value was just something like a numeric literal, yes
19:13aperiodicwhat if it was a single function call?
19:13amalloythen you get put to the end of that function call
19:13danielcomptonmysamdog: toggle structural editing is the command you're after
19:13amalloywhich leaves you in position to add another thing to let-bind
19:13danielcomptonCommand+Shift+A brings up the super command bar
19:14amalloyreally i use backward-up more often, for like "i'm in the middle of the body of a let, and i want to be in the let bindings": just hold down backward-up until i'm at the right level of nesting
19:14mysamdogdanielcompton: thanks
19:14mysamdogWhere is the best place to get a crash course on intellij?
19:14danielcomptonCommand+E is another handy one
19:15aperiodicbut if that were in the middle of the bindings, if you invoked it twice, then you'd be at the end?
19:15danielcomptonmysamdog: the cursive website has a pretty good one
19:15amalloyaperiodic: if the current state is like (let [x 1, y (+ |x 2)] ...), then pressing it twice would get you (let [x 1, y (+ x 2)]| ...), where | is point
19:16amalloyit's not clear whether this is exactly what you were asking
19:16postpunkjustinWoah, that's not even on the paredit refcard I have. I'm going to have to up my game.
19:17amalloypostpunkjustin: i don't know if it's bound to any keys by default
19:17aperiodicah, I thought the point would be one character to the left, but okay.
19:17postpunkjustinOk, well I'm going to bind the hell out of it right now.
19:17amalloyi put forward/backward up/down on C-M-{W,E,S,D}
19:18postpunkjustinCool, thanks
19:18amalloythe orientation of those on a square helps me remember which is which
19:18amalloypostpunkjustin: if you are upping your game, you should bind paredit-convolute-sexp too
19:18postpunkjustinIt sounds awesome, but what is it?
19:19amalloypostpunkjustin: (fn [x] (let [y 1] |(+ x y))) => |(let [y 1] (fn [x] (+ x y)))
19:19aperiodicpostpunkjustin: are your dotfiles on github or other publicly-accessable bit store? (or anybody else that uses emacs & evil?)
19:20postpunkjustinamalloy: my mind is blown.
19:20amalloyspeaking of which, if anyone has a suggestion for a good place to put convolute-sexp, i am happy to hear it. i put mine on M-<LEFT> back before i quit using the arrow keys
19:20postpunkjustinaperiodic: https://github.com/holguinj/evil-clojure-emacs/
19:21amalloy(technomancy?)
19:21technomancyamalloy: man
19:21technomancyamalloy: when I find a chance to run paredit-convolute-sexp... I savour it.
19:21technomancyI type the whole damn thing out
19:21TimMcSame here!
19:22TimMcWell... I autocomplete, actually.
19:22technomancythen I kick off for the rest of the day, because my work here is done
19:22amalloyturns out clojure users don't hate useless ceremony as much as rich thinks...?
19:23arrdemamalloy: so when do we get the lazybot redeploy?!
19:23amalloyarrdem: talk to Raynes. i'm not really set up to test it anymore, and i'm not gonna redeploy without testing
19:24arrdemkk
19:31MC-EscherichiaIf I have a sequence of maps which form the leaves of a tree, and contain a reference to their ancestor (which belongs to it's own generation of leaves, and has a pointer to its ancestor) is there an idomatic way to list all the nodes in the tree? (it's sort of the opposite starting point of `tree-seq`)
19:32MC-Escherichiai.e. nodes only know their parents, unlike tree-seq and zippers which assumes they know their children
19:34amalloyi think the only thing you can do is treat it like a walk of a graph (not a tree), and keep a set of visited nodes so you can avoid revisiting them. the seq of leaves is one additional "virtual root" which acts as your starting point
19:35noonianyeah, i'd write a recursive fn that traverses upwards and mapcat it over the seq of leaves
19:37MC-Escherichiai think amalloy's solution is more effient algorithmically but as long as someone else suggested the traverse upwards and mapcat solution I don't feel so bad starting with that
19:42cflemingmysamdog: You can toggle paredit in the status bar at the bottom of the window too
19:42cflemingWhere it says Structural: On
19:45MC-Escherichiajust looked up convolute-sexp had a chance to use it today, paused to wonder what the emacs command for that move was called and awkwardly copied the inner part, slurped the outer, and removed detritus
19:47technomancyif you convolute a sexp that includes juxt you get a combo bonus
19:48TEttinger(inc technomancy)
19:48lazybot⇒ 155
19:48TEttinger(inc juxt)
19:48lazybot⇒ 16
20:33akurilinQuestion: were there any recent lein issues with uberjar? Seems as of the latest version when I uberjar my ring app I get "Error: Could not find or load main class classroom.handler.main"
20:34akurilinThis only happens in uberjar mode, works just fine in dev
20:34TimMclein did hcnage some stuff around main class specification ~recently
20:38akurilinTimMc: yeah it looks like you might need a :main now in project.clj
20:38akurilinNot sure where my main is since I'm using lein-ring
20:54cflemingHow do I need to read a form in for it to have the metadata added by the reader?
20:54arrdemcfleming: example form?
20:54arrdemcfleming: the reader should always add metadata...
20:55cfleming,(binding [*print-meta* true] (pr-str (read-string "(+ (+ 1 2) (+ 3 4))")))
20:55clojurebot"(+ (+ 1 2) (+ 3 4))"
20:55cflemingIs there a reason there's no line info on those forms?
20:55cflemingAm I misunderstanding how this works?
20:56danielcomptonwhats the name of the ring middleware that catches exceptions and displays them nicely?
20:56danielcomptonI don't think it was a core ring one
20:57cflemingdanielcompton: There was one discussed on the ML a while back, one sec
20:58danielcomptoncfleming: I think it's prone
20:58cflemingdanielcompton: That's the one.
20:58cflemingdanielcompton: I've never used it but it looks nice.
20:59danielcomptoncfleming: sure does
20:59danielcomptoncfleming: when are you going to start charging for cursive?
21:00cflemingdanielcompton: Two months, maybe? I have a list for 1.0, it's getting shorter and shorter.
21:00danielcomptoncfleming: sweet
21:00danielcomptoncfleming: you planning on skipping Christmas?
21:01cflemingdanielcompton: Skipping in what sense?
21:01cflemingdanielcompton: Working on Cursive instead?
21:01danielcomptona release in two months will be just after Christmas
21:01cflemingdanielcompton: Ok, maybe 2.5 months :)
21:02cflemingarrdem: I must be crazy, I thought there was a :column field in the metadata, and I'd assumed that would be added to forms by read-string.
21:02cflemingarrdem: Neither appear to be true.
21:05arrdemcfleming: so :line, :file and :column will be added by I think it's LineNumberingReader... but yeah read-string doesn't set that stuff AFAIK
21:08cfleming,(binding [*print-meta* true] (pr-str (read (clojure.lang.LineNumberingPushbackReader. (java.io.StringReader. "(+ (+ 1 2) (+ 3 4))")))))
21:08clojurebot"^{:line 1, :column 1} (+ ^{:line 1, :column 4} (+ 1 2) ^{:line 1, :column 12} (+ 3 4))"
21:08cflemingarrdem: There you go, right.
21:33danielcomptoncfleming: thread form is nice
21:33danielcomptoncfleming: it even does the right thing when you've already got a threaded form there (adding to it, rather than making a new thread)
21:33cflemingdanielcompton: Thanks! Yeah, the only problem with it is that unthread messes up the whitespace sometimes.
21:34cflemingdanielcompton: But mostly it works well. I'm going to have a release dedicated to fixing a bunch of niggles with paredit post-conj.
21:35danielcomptoncfleming: wrapping quotes would be a nice one to fix
21:36cflemingdanielcompton: What's the problem with wrapping quotes?
21:38danielcomptoncfleming: can't find it in the tracker atm but a paredit wrap round doesn't work with quotes
21:39danielcompton"|" sym -> "sym|"
21:39danielcomptoncfleming: it doesn't do anything in that case
21:39cflemingdanielcompton: Oh, you mean slurp/barf?
21:39danielcomptonah yes, not wrap
21:39cflemingdanielcompton: Wrapping directly does work (Cmd-Shift-')
21:40cflemingdanielcompton: Yeah, that's up near the top of the list.
21:41danielcomptoncfleming: choice. Gotta head off, see you later.
21:57mlb-has anyone here experience with ElasticSearch?
21:58bhenrymlb-: what do you need to know?
21:58mlb-At $DAYJOB, which is very enterprise, I want our product to use it for log data visualization. However, customers won't allow "calling home" to our ElasticSearch servers. Therefore, I want to embed ElasticSearch with the product.
22:00bhenryyou can do that i think. in all their beginner tutorials you use a standalone java process.
22:00mlb-The ideal being, the product can expose REST APIs for graphs that merely proxy requests to Kibana3, and when I need to download logs for support cases, I simply have them supply me with a ElasticSearch DB dump.
22:02mlb-bhenry: alright, I'll play with it. Thanks =]
22:35dogonthehorizonGreetings folks. I'm using a record from a separate library that I'd like to return as a list in a static method that will be used from Java. So, in the :methods section of my gen-class I have "[Lwatchlist_models.models.User;" to define a list of type User, however whenever I attempt to create an uberjar from lein, it complains that it can't find the User class in my classpath. Should I be manually
22:35dogonthehorizonmanipulating my classpath to resolve this issue?
22:36TEttingerdogonthehorizon: can you make the java code that defines watchlist_models.models.User a dependency of the clojure project?
22:36TEttingeryou can also mix java and clojure source
22:37TEttinger&google leiningen sample
22:37lazybotjava.lang.RuntimeException: Unable to resolve symbol: google in this context
22:37TEttinger$google leiningen sample
22:37lazybot[leiningen/sample.project.clj at master · technomancy ... - GitHub] https://github.com/technomancy/leiningen/blob/master/sample.project.clj
22:38TEttingerit can be specified like this, dogonthehorizon: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L276
22:40dogonthehorizonTEttinger: It's not Java that's defining User, User is a record that I've created with defrecord in the watchlist-models project. The project I'm currently in is intended to be a library for a separate Java project. I can simply say java.util.ArrayList as the return type and go about my way, but this means that in Java I will need to typecast the list because Clojure will produce a return type of
22:40dogonthehorizonArrayList<Object> :/
22:41TEttingeroh, gotcha.
22:41TEttingerwell thanks to runtime erasure of generics, the two of those are identical at runtime
22:42TEttingerArrayList<Object> and ArrayList<User> will be the same at runtime, only different during compiles
22:43dogonthehorizonRight, so in my Java code I can simply treat the returned list as usual by doing (ArrayList<User>) list, but I'd rather like to avoid having to typecast everything :/
22:43TEttingeralso, [L is a fixed-length 1D array, which might not be what you want
22:44dogonthehorizonIf I specify the return of my method as java.util.ArrayList and then in the method itself return my list using clojure.core/into-array, will this have the desired effect?
22:45TEttingerit seems like it hasn't executed and compiled the defrecord by the time it gets to the type hint for the array
22:45TEttingerso there just isn't a User class on the classpath by the time it reads the type hint, and it complains
22:45dogonthehorizonHum... can I solve this by wrapping the ns that defines my models with a :gen-class?
22:49wodntdoes anybody have experience working with postgres extensions with java.jdbc?
22:50dogonthehorizonTEttinger: This sounds promising - "When AOT compiling, generates compiled bytecode for a class with the
22:50dogonthehorizongiven name (a symbol)"
22:50wodntI'm trying to use RETURNING with insert, but I'm not sure how to use it
22:50wodntwith the clojure.java.jdbc library. I'm open to using another interface too, if
22:50wodntone comes to mind
22:50dogonthehorizonI'll give that a shot and report back, thanks for your help so far!
22:56TEttingernp, dogonthehorizon, you could definitely fiddle with :aot namespaces in your project.clj, or try :aot :all
23:00dogonthehorizonI threw an :aot :all in the watchlist-models project since I'm only defining records there to be shared across several projects. Now when packaging an uberjar for a library that uses these models I don't run into any undefined errors. Thanks again for helping me work through this TEttinger :)!
23:01TEttingerno prob, it's something I've run into before, and it can be painful. glad it wasn't too bad this time!
23:15celwellHi, what would be a smart/safe way to store an encryption key for use in a clojure web app? (I augmented the clojure jdbc library to allow for use of mysql's AES_ENCRYPT() function, but I'm currently storing the 128-bit encryption in plain hex text in a (def ...))
23:16Wild_Catcelwell: environment variable?
23:16Wild_Catpossibly pointing to a file if you want extra indirection
23:18celwellWild_Cat: by pointing to a file do you mean to pull in the key with slurp or something?
23:18Wild_Catcelwell: yeah. Do it once at app initialization, of course.
23:19celwellWild_Cat: I was thinking something along those lines. I didn't know if there was some better practice though, but thanks for the input.
23:41jimrthyI'm running into what seems like an old issue: the resource/ directory in my project disappears when I create an uberjar. Does anyone have a link handy that's newer than ~2011?
23:53technomancyjimrthy: the point of the resources directory is to get files on the classpath
23:53technomancyif the files are in the uberjar, they're on the classpath
23:55jimrthytechnomancy: I'm probably thinking about this backwards
23:58technomancyjimrthy: try clojure.java.io/resource
23:59jimrthyThat's returning either an empty string or a 404