#clojure logs

2013-01-18

00:24handojinquiet
00:24handojinquiet
00:25cemerickluminus?
00:25cemerickluminus?
00:25handojin?
00:25cemerickWhat is luminus?
00:25handojinlein new luminus <projectname>
00:25handojinreplaces noir
00:26handojinhttp://www.luminusweb.net/docs
00:29handojinit was a bad question - i just started the server from the shell in ~home/workspace/<project>
00:31bbloomany easy way to get the stack trace of an exception that happened on a non-repl tread?
00:31bbloomthread*
00:41handojin@cemerick - friend looks really nice - thanks!
00:42cemerickoh, right (re: luminus)
00:42cemerickhandojin: you're welcome...though probably best to thank me after you have it working :-)
00:42cemerickbbloom: if you can get a reference to the exception :-P
00:43bbloomcemerick: i assume that :-P face means there isn't an easy way to do that? heh
00:43bbloomtry/catch/(def omgwtfbbq e) ?
00:44cemerickbbloom: That's certainly one way. Is the exception going entirely uncaught right now?
00:44bbloomcemerick: it was more of a hypothetical question, since the problem occurred in a pure function
00:44djwonkluminous, would you say that I have a plethora of pinatas?
00:44djwonkfrom the site: "Have access to the plethora of existing Clojure and Java libraries"
00:44bbloomi just printed out the inputs, copy pasted them into a buffer, and ran the function in isolation
00:45bbloomfor some odd reason, i find that clojure.core/+ is your worst nightmare when it comes to figuring out what's going wrong in your function
00:45bbloommath functions seem to hate stack traces
00:46cemerickbbloom: well, there's a couple of janky things you can do to backstop uncaught exceptions
00:46cemerick(1) http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html#setDefaultUncaughtExceptionHandler%28java.lang.Thread.UncaughtExceptionHandler%29
00:46cemerickand the higher-level (2) http://docs.oracle.com/javase/6/docs/api/java/lang/ThreadGroup.html#uncaughtException%28java.lang.Thread,%20java.lang.Throwable%29
00:47bbloomhmmm... would it be exceedingly janky for nrepl & friends to do that for me? :-)
00:47cemerickThe most common problem is that the exceptions you're interested in are *already* being caught, just by code you don't control
00:47cemerickbbloom: yes :-)
00:48cemerickAlthough you could readily sling together an nREPL middleware that could do useful things, like push successive exceptions into a stack, thus providing history
00:48bbloommy kingdom for a restart!
00:49luxbockwhat is the difference between let and let*?
00:49cemerickoh, well, there's at least 2 or 3 restart libs for Clojure
00:49bbloomcemerick: that work with arbitrary exceptions that i didn't throw?
00:50cemerickbbloom: sure, but that's not really the problem, is it?
00:50cemerickit's the exceptions you don't catch that you want to get at
00:50bbloom*shrug* i'm just getting spoiled by how nicely some things work: nrepl, lein, etc... i want my debugging cake too :-)
00:51bbloomi just want to `lein update` or upgrade or whatever it is and have all this work... i'm just being greedy and whiney, so ignore me :-)
00:52cemerickbbloom: oooh, you want break-on-exception in a debugger
00:52handojin@djwonk - is russlish maybe? more horrorshow than nadsat anyway
00:52bbloomand i want it to Just Work (tm)
00:53cemerickbbloom: I used it in ccw just today. 'tworks just fine. :-)
00:53bbloomis that via ritz ?
00:53cemerickRitz has break-on-exception as well AFAIK
00:53bbloombah. why is this not in `lein repl?`
00:53bbloom`?
00:53cemerickno, ccw just usess Eclipse's debugger
00:53bbloomoh
00:53bbloomboo
00:54cemerickhah
00:54cemerickI thought you wanted it to Just Work™? :-P
00:54bbloomAnd Use Less RAM (R)
00:54bbloomand VIM (C)
00:54cemerickgtfo with your netbook ;-)
00:54djwonkhandojin: ?… I was laughing at the 'plethora' use -- reminds me of Three Amigos
00:54bbloomheh, i'm on a mbp
00:55cemerickI run Eclipse with 512 heap FWIW.
00:55cemerickRitz isn't going to be much more lightweight, since there's 3 JVMs.
00:55handojinteh RAM be cheap these days
00:56cemerickThough I appreciate that some people inexplicably prefer textmode stuffs.
00:56bbloomi don't just write clojure
00:56xeqiI've gotten ritz's break-on-exception to work on the repl thread
00:56bbloomi need one text editor that keeps me sane across the board
00:56xeqinever tried in another one
00:57cemericksure, I use vim for everything but clojure
00:58bbloomi'd rather vim than a debugger :-P
00:58cemerickxeqi: you should be able to do it for all threads in the vm
00:58bbloomi also prefer command line debuggers anyway
00:58xeqicemerick: yeah, I'd expect it to owrk
00:59cemerickbbloom: well, just bring up jdebug only when you need it
00:59cemericksorry, jvisualvm
01:12bbloomibdknox: i'm github stalking ppl lately... saw you forked dommy. is template speed an issue at all for you?
01:35handojinanybody working with datomic?
01:46holohi
01:47holoin korma, any way to increment a value without making two queries?
02:18syrinx_i think i might be in love with noir
02:25bbloomi think i'm in love with writing functions that concatenate a sequence of side effects to be evaluated later
02:26syrinx_:D
02:36alex_baranoskybbloom: yes! hallelujah, yes
02:36alex_baranoskyholo: don't think there is, no
03:00cbp`anyone here using emacs live
03:00cbp`i keep getting segmentation faults :/
03:02tomoj&((juxt #(do %& %1) (fn [& args] (nth args 1))) 1 2 3)
03:02lazybot⇒ [1 2]
03:02tomojhmmm
03:07bbloom,(#(-> %&) 1 2 3)
03:07clojurebot(1 2 3)
03:07bbloomheh, what-ya know... i had no idea %& was a thing
03:07AtKaaZwhat am I doing wrong here: https://gist.github.com/4563026
03:08bbloom,(macroexpand '#(-> [%1 %2 %&]))
03:08clojurebot(fn* [p1__56# p2__57# & rest__58#] (-> [p1__56# p2__57# rest__58#]))
03:09bbloomAtKaaZ: call deref on var
03:09bbloomv.deref()
03:09bbloomyou want the current value of that var
03:09AtKaaZoh very nice, thank you!
03:10AtKaaZinteresting, so in clojure when the symbol for that var is encountered a deref is done
03:13alex_baranoskybbloom: so I think your idea of building up a sequence of io operations to execute later is a really important "design pattern" for clojure apps
03:14bbloomalex_baranosky: yup. i'm taking it to a tad of an extreme though :-)
03:15bbloomalex_baranosky: https://www.refheap.com/paste/8737
03:15alex_baranoskyI hate side-effects, I wonder how extreme is too extreme. Now you have me curious
03:15bbloomthat's a really simple example
03:15bbloomthe dom/ namespace contains a bunch of factjor words
03:16bbloomnotice how it recurses and creates children stuff before wrapping the create-element and append
03:16alex_baranoskynot sure that's so extreme
03:16bbloomif those were normal side effects, i'd be forced to use doseq and put the children order in the middle
03:17bbloomwell, it's extreme because i implemented a conatenative language interpreter to be able to do this :-)
03:17bbloomhaha
03:17alex_baranoskyyep; that's where you went over the limit
03:17alex_baranoskyhehe
03:18alex_baranoskyinteresting though… so you are using the sequence as a way to also add on the parameters?
03:18alex_baranoskyI would have tended to use currying or partials for that
03:18bbloomthe words in factjor are applicable & they do right-currying
03:19bbloomso these two things are equiv: ["the-rect" element-by-id :fill "red" set-attribute]
03:19bbloomand: [(get-by-id "the-rect") (set-attribute :fill "red")]
03:19AtKaaZ,(#(%&_) 1 2 3)
03:19clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalStateException: arg literal must be %, %& or %integer>
03:20AtKaaZ,(#(%_%&) 1 2 3)
03:20clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalStateException: arg literal must be %, %& or %integer>
03:20AtKaaZ,(#(%_&) 1 2 3)
03:20clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalStateException: arg literal must be %, %& or %integer>
03:20AtKaaZ,*clojure-version*
03:20clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}
03:20alex_baranoskyright, makes sense. You could do the same kind of things by saying [#(get-by-id "the-rect") #(set-attribute :fill "red")] no? then just calling each after?
03:21bbloomalex_baranosky: to some extent
03:21nonubycan anyone help with making this more pragmatic, function to replase any to or from key with value 1000. here what Ive come up with but feel icky https://www.refheap.com/paste/8738
03:21bbloomset-attribute needs an element to operate on
03:21bbloomso really it would be: [#(set-attribute (get-by-id "the-rect") :fill "red")]
03:22bbloomalex_baranosky: see the "stack effects" defined here: https://www.refheap.com/paste/8739
03:22bbloomnotice how all the operations leave elements on the stack
03:22AtKaaZah ofc I typoed: &(#(#_%&) 1 2 3)
03:22alex_baranoskybbloom: the idea is one worth pushing, we're moving our current design at work toward this kind of thing
03:22bbloomthere's also a cat/ namespace for generic concatenative operators
03:22bbloomlike cat/each
03:22AtKaaZ,(#(#_%&) 1 2 3)
03:22clojurebot()
03:22bbloomso you could do [(elements-with-tag "div") [cat/prn] cat/each]
03:23bbloomand that would print out each div on the page
03:23bbloom:-)
03:23bbloomthe result is a jquery-like api.... it's like threading macros on steroids!
03:24alex_baranoskyon thing you seem to loose is the ability to look at the data structure that holds the planned ii-executions, and manipulate it nicely… Because the args and the function names are mixed together
03:24bbloomalex_baranosky: i'm working on a solution to that too :-)
03:24alex_baranoskybbloom: so is this part of the API of your library?
03:24bbloomalex_baranosky: yeah
03:25bbloomalex_baranosky: i'm gonna make a polymorphic method to take a factjor program and return it in literal form
03:25alex_baranoskyneat stuff. the more you can see your IO effects as data the better, imho
03:25bbloomalex_baranosky: which will be useful for serializing programs and sending them across the wire
03:25Raynesalex_baranosky: Did you ever get your IRC client stuff sorted?
03:25RaynesI guess you forgot the znc creds
03:26juxovecwhat is the best Clojure book?
03:26alex_baranoskyRaynes: hey dude, I have been so dan busy with everything I back-burnered it. Linkinus mysteriously stopped being buggy for now
03:26alex_baranoskyjuxovec: read them all :P
03:26AtKaaZ,(= '() (#__) (list))
03:26clojurebottrue
03:26Raynesjuxovec: Clojure Programming is a good one.
03:26alex_baranoskyyeah I like the O'Reailly one
03:26AtKaaZ,#__
03:26clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
03:26juxovecRaynes: this one? http://www.clojurebook.com/
03:27RaynesYes.
03:27juxovecthanks
03:34bbloomi put together a little pong game to test some UI framework code... it's requiring ALL OF MY WILLPOWER to avoid writing a little physics engine
03:34bbloomthe manual hacky repetitive bounds checks make me cringe :-P
03:49augustlanyone here successfully used korma + clojure.java.jdbc to work with an in-memory h2 database?
03:57augustlthere seems to be a lack of interop there. I need to use the very same connection for all operations, since creating a new connection means creating a new in-memory database
03:58augustland korma works with their encapsulation, while clojure.java.jdbc works with the raw connections.
03:59ebaxtaugustl: I assume you are aware that the connection string affects the mode? http://www.h2database.com/html/features.html#connection_modes
03:59ebaxt?
04:01tomoj:( https://www.refheap.com/paste/882fea4675b8b7dc8fc4e9d99
04:01tomojoh, #(-> %1) is very cute
04:03borkdudetomoj ah yes, that's nice
04:04augustlebaxt: yeah, I'm using "jdbc:h2:mem:"
04:04piskettitomoj: mmmm, when would you use/need that? (pardon my ignorance)
04:05borkdudepisketti same as (fn [x] x)
04:05tomojwhich is better written `identity`
04:05piskettihow about identity?
04:05pisketti:)
04:05tomojbut I see #(-> %2) or #(-> %3)... occasionally
04:05tomojalso #(-> [%1 %2]) oslt
04:06tomojI mean I've never seen it written that way — I've seen equivalent functions
04:06borkdudepisketti yolo
04:06augustlseems like clojure.java.jdbc isn't made with in-memory h2 support in mind. It always takes the connection spec, not a raw connection object
04:07tomojit's too bad clojure.core.reducers doesn't expose its gerundives
04:07ebaxtaugustl: Can't you just name the in-memory db so you can use multiple connections? jdbc:h2:mem:foo?
04:08augustlebaxt: then I need to make sure I kill it though, was hoping to avoid that
04:09augustlthen again, the fact I'm passing a connection to my API is not very good anyway.. Implementing connection pooling later would suck
04:14augustlfeels a bit like I'm a pioneer by wanting to use in-memory h2 for my tests :)
04:23xificurCdoes anyone have a working windows batch file for starting clj files? I tried the one mentioned in wikibooks but I get "Exception in thread "main" java.io.FileNotFoundException"
04:26AtKaaZI'm on windows but I don't know what you mean
04:27xificurChttp://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started#Create_clj_Script
04:28AtKaaZthe batch is for very old clojure 1.2.0 which had contrib, you could try using leiningen instead
04:39clgvxificurC: better use leiningen 2.0 - it has a much better REPL built-in
04:44augustlKorma returns "{:scope_identity() 1}" for an insert, the docs say it is supposed to return just the ID. Anyone know what's going on there?
04:49augustlseems that Clojure isn't a good fit for talking to SQL databases
04:50xificurCclgv: I wanted to be able to run clj files from the command prompt, not opening the repl. Or am I not understanding you correctly?
04:52clgvxificurC: ah ok.
05:08alex_baranoskyaugust1: Korma really returns whatever java.jdbc returns
05:09alex_baranoskythat's a bit of a PITA, because it seems like different DBs return different things… However there is also some possibility that a recent change broke something
05:10augustlalex_baranosky: yeah I just noticed, tried raw jdbc, same thing
05:10alex_baranoskyso we should update the Korma docs
05:10augustlalex_baranosky: it seems that I need to use an ORM or some kind of abstraction layer in order to be able to use different DBS anyway
05:10alex_baranoskynot sure how much can be done about changing it, because it probably goes all the way down to the JDBC implementation for the db in question
05:10augustljust got lots of errors I didn't get on H2 when switching to MySQL
05:11augustlso then at least I can write db specific hacks :)
05:12alex_baranoskydb specific changes is potentially a lot of work. I already did a DB specific change for COUNT on Mysql. On th done hand it make some sense to be able to generate the SQL you can use, on the other hand it will make Korma much more compilcated
05:13augustlare there any general approaches to doing db reset between tests for jdbc/mysql?
05:13alex_baranoskyaugustl: specifically which errors are you seeing? are you setting your delimiters to "`"? I need that for MySQL
05:13augustlalex_baranosky: I got an error when inserting a date as a string, h2 accepted it but mysql barfed
05:13alex_baranoskyaugustl: not sure, but I like th idea of using an in memory db
05:14alex_baranoskyoh, I see. I guess its best to stick to the most standard approaches you can find
05:14augustlalex_baranosky: that's what I've been trying to set up, but it seems I would have to do a _lot_ of work to set it up
05:14alex_baranoskyhave you tried SQLLite?
05:15augustlno, but the fact that mysql and h2 behaved differently made me decide not to use in-memory for tests..
05:15alex_baranoskyyou could preparse inputs into Timestamps if running in test…. but that kinda stinks
05:16alex_baranoskyI think the approach has a lot of merit, esp if you have a lot of tests that want to hit the DB
05:18augustlI want my tests to be correct, not fast :)
05:18ebaxtaugustl: Have you tried setting compatibility mode in H2? jdbc:h2:~/test;MODE=MySQL
05:19augustlhmm, seems clojure.java.jdbc doesn't support dropping databases
05:20alex_baranoskyebaxt: nice one
05:20augustlebaxt: no, but now that I'm aware of the fact that jdbc doesn't abstract away differences (which makes sense tbh), I'm inclined to use MySQL itself
05:22ebaxtaugustl: We use oracle in prod, and h2 for tests. By setting compatibility mode we at least shave of some sharp edges. We use an ORM, but a lot of the queries are native so it does at least help in some ways :)
05:25augustlebaxt: I suppose money would be an issue in that case :)
05:25augustlusing Oracle as the database when running the tests, that is
05:27augustlI'll just do a full drop, create and load schema for every test. And switch to h2 if it gets too slow
05:28augustlalex_baranosky: does Korma do anything magic with dates etc for inserts? Or do I need to fix that myself? I.e. convert the string I get from JSON to a java.sql.Date
05:29alex_baranoskyKorma does no magic. It aims to just be a way to turn sexps into SQL queries
05:29augustlI see
05:38ejacksonaugustl: are you using anything clever for the schemas ?
05:39augustlejackson: no, it's pretty basic stuff
05:40ejacksonJust wondering :)
05:41augustlejackson: it's just DROP DATABASE IF EXISTS, CREATE DATABASE, and the create table stuff in clojure.java.jdbc
05:42ejacksonok, some time back I had a look at thing that could infer FKs and the like and build a tree of the schema. Only they were in their infancy. I was hoping you might be using one so I could get a free update on their status ;)
05:58AWizzArdcurrently nrepl.el shows me the buffer *nrepl-connection*. This is of no use for me — how can I have emacs hide it from me?
05:59AWizzArdAh okay, found it.
06:38augustlis there a way to "touch" the results in with-query-results of clojure.java.jdbc, so I can return a list of maps for all the data in the result?
06:41augustlor: how do I return all rows for a SELECT with clojure.java.jdbc
06:42augustl"doall" seems to work
06:44ska2342can someone tell me how to pursuade maven to run just the tests for one namespace in the clojure project itself?
07:22augustlanyone here used a data validation library other than the clojurewerkz one?
08:08Bodilaugustl: Does core.logic count? :)
08:25bozhidarHey, guys! I've been working recently on a Clojure coding style guide and would really like to hear your thoughts, feedback and suggestions to improve/extend it. Here's a link to the current version https://github.com/bbatsov/clojure-style-guide
08:34hyPiRionbozhidar: I've always wondered about "Limit the use of commas in collection literals."
08:36hyPiRionA quick glance at e.g. {132 3145 3345 88 1045 0 192387 5} doesn't easily show us whether 0 is a key or a value, whereas {132 3145, 3345 88, 1045 0, 192387 5} makes it easy to see.
08:36bozhidarhyPiRion: personally I have nothing against them, but several people commented that their use was considered bad style, therefore that particular rule
08:36hyPiRionI can see it when you have a map with keywords as keys and non-keywords as values though.
08:37loliveirabozhidar: i liked.
08:37bozhidarhyPiRion: I don't imagine someone has to deal with such map that often :-)
08:37bozhidarmaps*
08:39hyPiRionbozhidar: An extreme example, I know. It's just that I find commas at times useful for grouping key-value pairs
08:39Bodilbozhidar: I don't use commas in map literals myself, but that rule is a bit odd given that Clojure itself serialises them with commas.
08:42bozhidarhyPiRion Bodil: It's not me that you need to convince, I'm generally with you on this one
08:43stain_bozhidar: yes, there should be counterexamples for when commas are good
08:44hyPiRionbozhidar: Argh, and I was here hoping for a fight. Oh well.
08:44cmdrdatsbozhidar: nice work on the style guide, i like it :)
08:44hyPiRionI'll possibly voice my concerns later on.
08:44bozhidarHere's some feedback I received initially when I suggested the use of commas in maps https://github.com/bbatsov/clojure-style-guide/issues/1 (and I received more via other mediums)
08:44hyPiRion/s/concerns/views/
08:44stain_"Start every namespace with a comprehensive ns" should probably say the preferred order
08:44mpenetindentation or commas, pick your choice
08:45bozhidarstain_: good point
08:45mpenetat least for maps, for the other DS I dont bother
08:46stain_bozhidar: but lots of good stuff in there, mate/lass!
08:46bozhidarstain_: Could you please open a ticket about this so I won't forget to add it?
08:47bozhidarstain_: mate :-) Bozhidar is an obscure male name in the Cyrillic parts of the world (like the infamous Eastern Europe)
08:47clgvbozhidar: why are commas in maps bad? they really help if you have a lot of kv-pairs
08:48stain_bozhidar: "This rule should obviously be ignored if the complementing predicate exists in the form of a separate function (e.g. even? and odd?)." - make this into a separate rule - something like "Use predicate functions directly if they exists"
08:48stain_bozhidar: I kind of guessed it would be.. like Baltazar
08:48stain_ah man.. tickets! This is too much!
08:48ChongLiisn't there some point where your map literal grows too large to reasonably keep in your source file?
08:49ChongLiperhaps then it can have commas when it's serialized to another file
08:50bozhidarChongLi: As Bodil already mentioned maps are serialized with commas anyways
08:51ChongLiyeah so that seems like a reasonable guideline
08:51bozhidarChongLi: I guess so
08:52ChongLithough I guess those commas might use more bandwidth on the wire
08:52stain_bozhidar: Naming should discourage overlapping of clojure.core except for specialized reimplementations
08:52ChongLiwhich is kind of silly
08:53bozhidarstain_: Why so? After all we do have namespaces in Clojure and we all know that the use of use is bad :-)
08:55stain_bozhidar: where does it say..? :)
08:56ChongLibozhidar: it is a style guide, after all
08:56ChongLido not take anything for granted
08:56ChongLithe reader may be completely new
08:56stain_bozhidar: I meant also that you should try not to make a function argument called 'map'
08:57bozhidarstain_: ah, now I see. I'll add something on the subject.
08:57stain_so perhaps two.. don't shadow functions from clojure.core in local bindings - and the second, which would give you warnings anyway, is to not 'redefine' those functions unless you are really intending to
08:58bozhidarChongLi: Indeed. At some point I plan to add a bit of rationale behind some of the advices (especial the more obscure ones)
08:59bozhidarstain_: sounds good to me
09:02stain_I would want to see specific guideline on the recommended way to access maps - I don't know what is the current best practice. I use the dictionary as a function if it's being passed to something, but I call the (:keyword the-dict) if I just want something there and then. I almost never do (the-dict :keyword) and only use the (get) function on strings coming from elsewhere - (get the-dict (:name the-request))
09:02stain_but I don't know if that is the standard
09:02stain_perhaps the last one should be (the-dict (:name the-request))
09:03stain_no need for get there either unless it's being used in a higher-level function
09:04bozhidar(:key map) is the idiomatic way to get an element out of a map; of that I'm certain
09:04stain_so that should be in
09:04bozhidarindeed
09:04stain_and the exceptions would be where you are doing some functional magic or have other kind of keys
09:08iameduHi! I'm looking for some help... with jdbc and the jvm... this roughly explains my problem... http://eugeneciurana.com/pastebin/pastebin.php?show=45650
09:18zbyI've decided to tryout clojure - can I get some help here? https://gist.github.com/4564733 - why it is not looking into 'src'?
09:19zbyI followed the README from https://github.com/ring-clojure/ring/wiki/Getting-Started
09:19aperiodiczby: your syntax is incorrect. it should be (use 'login_app.core)
09:19zbyah
09:19aperiodiczby: note there's only one quotation mark
09:20zbyI see it now
09:24zbythaks a lot!
09:26aperiodicyou're welcome!
09:29amalloyalso should be login-app, not login_app
09:31amalloystain_: i don't think i ever use (m k), always preferring instead (get m k). perhaps i'm silly, or perhaps i'm prepared for the possibility that my map might be nil
09:34zbyyeah - that one I found myself :)
09:40amalloyhuh! i didn't realize that ##(let [stuff (fn [])] stuff) caused the function's classname to include "stuff"; i thought only (fn stuff []) did that
09:40lazybot⇒ #<sandbox47486$eval79130$stuff__79131 sandbox47486$eval79130$stuff__79131@144cbe2>
10:26augustlbeen failing for a while now to implement this: https://www.refheap.com/paste/8744 any suggestions?
10:26augustla nested filter, so to speak
10:26djcoin_Whats are the preferred way to shrink the start up time of the jvm ? Can't recall the name of the differents libs and who is the best
10:28joegalloif you aot your clojure code, and you put your stuff on the bootstrap classpath, then i think you're basically getting as fast as you can get
10:28joegalloleiningen does a fair amount of that stuff, you can look at what phil does there
10:29chouserdjcoin_: for your development cycle, or some other context?
10:29S11001001augustl: it's a map, where the f you give to map uses filter
10:29augustlS11001001: ah, I've only used filter
10:30djcoin_chouser: I can't remember but I saw somewhere tricks like keeping a jvm somewhere so it will actually already be started or something like this. It is just for accessing quickly the repl
10:31augustlS11001001: btw, the nesting can be infinitely deep.. Guess that doesn't help? :)
10:32chouseryeah, there are tools for that, but they all have various caveats. I'd recommend getting comfortable with and editor integration, like nrepl.el or foreplay
10:32S11001001augustl: then keep mapping until the structure is the right one for filter
10:32augustlS11001001: so a recursive map should work?
10:32S11001001augustl: yes
10:38djcoin_chouser: any hints for a vim user ?
10:39chouserdjcoin_: I haven't tried it yet, but I've heard this is the new hotness: https://github.com/tpope/vim-foreplay
10:39progoI don't understand what's bad about VimClojure
10:40ChongLiahh, this is interesting
10:40ChongLiif only I could get vim back into my head
10:40ChongLiit's so confusing switching back and forth between emacs and vim
10:41chouserChongLi: I recommend evil in emacs. That's what I use.
10:41ChongLioh yeah?
10:41ChongLiI tried a few of the other modes and they were kinda janky
10:41progoevil made me convert as well
10:42ChongLiwhat's better about evil?
10:42progoit's done very well indeed
10:42ChongLiI'm so damn used to emacs default keybindings
10:42ChongLidoes evil strictly add to those?
10:42chouserChongLi: yes, the other modes generally try to provide vi bindings. evil provides vim bindings.
10:43ChongLido all of the vim modes work? rectangular visual etc?
10:43chouseryes
10:43ChongLihmmm
10:43ChongLiI'll definitely give it a try then
10:43chouserand it keeps getting better, pretty rapidly
10:44ChongLiand it meshes well with emacs plugins like paredit?
10:44ChongLior is insert mode just regular emacs?
10:44progoinsert mode maps to emacs mode, but there is also an "Emacs mode"
10:45chouserIt's pretty fun to combine a multi-stroke vim command like ca( with a paredit like slurp, and the repeat the whole thing as needed with vim's .
10:45ChongLithat's pretty crazy
10:46chouserChongLi: it's not perfect, especially in other special mode like org, package-list, etc. For those you often either have to toggle in and out of emacs mode with C-z or escape individual emacs commands with \
10:46progobtw, what's the best tutorial on setting up clojure-mode on emacs with all the goodness. WHEN I already have an emacs with existing settings. I don't want any starter kit or 'clojure-in-box' solutions that google offers me so much.
10:47chouserlike in org mode I usually stay in insert mode and type \<tab> to expand things
10:47ChongLiC-z? I thought that'd be a SIGSTP
10:47ChongLisuspending the process
10:47progochouser, ChongLi: oh but evil provides decent support for appending to org-mode-map-{normal,insert,etc}
10:48progoit's manual tinkering, yes. But you can go very vim in these most emacs of modes.
10:48ChongLiit's amazing how deep the rabbit hole goes
10:49maleghastI gave up and started to learn emacs
10:49ChongLiI learned emacs as well
10:49ChongLithe main reason I'd be interested in this is for vim's useful command grammar
10:49ChongLiwhich is something I've always missed
10:50maleghastFair enough - I don't even know what you're referring to.
10:50maleghast(not kidding or judging, I am not that über when it comes to vim or emacs ;-) )
10:51ChongLiemacs's strength has always been in domain-specific programs (major modes)
10:51ChongLimaleghast: vim uses a simple grammer of single letter commands and modifiers
10:51ChongLisuch as c10w (change 10 words)
10:51maleghastIndeed
10:51maleghastI like those commands
10:52ChongLiit's very powerful and composable
10:52ChongLiespecially when you get into text objects and such
10:52progoTry evil. You'll be surprised how close to real thing it can be.
10:53maleghastOh I agree, I've just never got more than "head in" in terms of the rabbit hole.
10:53ChongLithe idea of using evil to extend emacs to this crazy hybrid
10:53maleghastI tried eVil mode - it just confused me wrt learning emacs.
10:53ChongLiyeah I think it's probably best saved for after you've become comfortable in emacs
10:56maleghast*nods*
10:56ChongLiso much to learn - so little time
10:56ChongLiI'm trying to learn webgl by implementing this tutorial stuff in clojurescript
10:57ChongLiit's pretty ugly transcribing the javascript directly into interop forms
10:57ChongLilater on I'll have to build some library to abstract that away
10:58muhooprogo: package-list-packages, install nrepl-mode, install leiningen per the instructions, then read the nrepl docs, i guess
10:58ChongLiare there any good FRP libs for clojurescript?
10:58maleghastFRP?
10:58ChongLianyone trying anything there?
10:58ChongLifunctional reactive programming
10:58piranhaChongLi: flapjax :)) there is shafty, but it's not completed yet
10:58muhoofoberglass reinforced plastic
10:59piranhahttps://github.com/cmeiklejohn/shafty
10:59ChongLianyone here looked at Elm?
10:59progomuhoo: I'll check nrepl, thanks.
11:00amalloyclojurebot: FRP is functional reactive programming, or maybe fiberglass reinforced plastic
11:00clojurebotIn Ordnung
11:00piranhaChongLi: I tried
11:00piranhabut without much success, I don't know Haskell and tutorial isn't good enough
11:00piranhait just says: put this code in your file and you'll get something
11:00ChongLielm seems really nice but it's incomplete
11:00piranhaand then 5 lines of code
11:01piranhayeah, and examples are surely lacking, etc
11:01ChongLiyeah it's basically a one man project
11:01ChongLithe guy wrote the language as part of his thesis I believe
11:01piranhayep
11:02piranhaI'm trying to get up and running with flapjax, but not finished yet
11:02ChongLiI really like the simple syntax elm uses for lifting an ordinary function into one that acts on reactive values
11:02ChongLihttp://elm-lang.org/edit/examples/Reactive/Position.elm
11:03ChongLithis example, in particular, just seems so elegant
11:03piranhaoh
11:03ChongLiasText is just a function that returns strings
11:04ChongLiand <~ is an infix function that lifts the first function into a function on reactive values
11:04ChongLiand Mouse.position is a source of reactive values
11:04ChongLian event
11:05ChongLiI guess it's called a signal in Elm
11:05ChongLiso (<~) :: (a -> b) -> Signal a -> Signal b
11:05piranhaChongLi: behavior
11:06piranha<~ is an alias for lift, it seems, no?
11:06ChongLiit is
11:06piranhaah, yes, signal in elm, and behavior in flapjax
11:09ChongLiI like this flapjax demo
11:10ChongLihttp://alandipert.github.com/flapjax-demo/
11:10ChongLimain.js is 708KB
11:10ChongLihaha
11:10piranhawell it's not minified
11:10ChongLiyeah
11:10muhoowith advanced compilation?
11:11ChongLino it's in full whitespace-preserving mode
11:11ChongLipretty printed
11:11ChongLiand huge amounts of dead code
11:12ChongLihow many people are working on/with cljs?
11:13ChongLiit still seems like very early days
11:13ChongLiI really love the language though so I want to see it succeed
11:13muhoolots,but yes its early
11:13muhoodive in and help. source maps would be nice
11:15ChongLithis seems to be a big thing in general with minified stuff
11:16ChongLiit's like symbol tables all over again
11:16ChongLijavascript really is becoming the "assembly language of the web"
11:18systemfaultNormal... JS itself sucks
11:18ChongLiyeah, that's obvious enough to everyone I think
11:19ChongLibut instead of fixing it we introduce all these workarounds that serve to further ingrain the language
11:20muhooi think of technology as immutable
11:20ChongLiwell in that case
11:21ChongLiwe're holding onto these old references and stopping the GC from doing its job!
11:21ChongLior I guess you could say the browsers are doing that
11:21ChongLi(the installed base of browsers)
11:22muhooif you're on an intel cpu running unix,that gc is 30 years late.but so what, it works
11:23ChongLiit could be better
11:24ChongLithere's always going to be some frontier where all the innovation happens
11:24ChongLibut if it has to be built upon enough layers of legacy cruft, innovation slows
11:43systemfaultSo far, I've watched the Rick videos about clojure for java programmers and clojure datastructures... is there other videos that are "must-be seen"?
11:44BodilChongLi: There are many credible efforts to fix JS, but with that kind of legacy code base, don't expect it to happen overnight...
11:44S11001001systemfault: no
11:47progonrepl-mode <3
11:47scottjsystemfault: "must-be seen" as in "really good" or "have info essential for writing Clojure"?
11:47systemfaultAs in "I want to learn clojure and want enlightening videos about it"
11:48progothis really motivates me to upgrade old lein1 projects with great haste
11:49scottjsystemfault: in that case I'd watch several more by Rich, including the concurrency video, are we there yet, datomic stuff/db as value, etc
11:49systemfaultNoted :) Thanks
11:50systemfaultI loved the clojure for java programmers talk... but didn't like those on datastructure as most of it was obvious :/
11:51algernonhammock driven development is pure gold too, altough it is completely language agnostic
11:51systemfaultI thought it was a philosophical talk (Nothing technical)
11:53matthavenersystemfault: is that talk available online somewhere?
11:53pbostromkovas: I checked out session, it looks nice, I especially like your editor w/ paredit, I might have to steal that :)
11:53systemfaultmatthavener: Rick's? Look for clojuretv, they're all there
11:54systemfaulthttp://www.youtube.com/user/ClojureTV
11:55algernonsystemfault: it is, yes. still worth watching, imo.
11:56matthavenersystemfault: thanks
11:58scottjsystemfault: there's tons of good stuff at http://www.infoq.com/author/Rich-Hickey
12:01augustlmaybe a bit off-topic.. I'm using clojure.java.jdbc and getting a MySQLIntegrityConstraintViolationException (as expected, from a unique index). Is there a generic way to read out the column name, or even know that this particular exception was due to an unique index? Other than grepping the message with a regexp or something.
12:03augustlI could always do a query first to see if it exists, but there's still the possibility of a race condition, so I would like to handle it via the exception always.
12:04augustlwhat I actually need to do: create an error message object, like {:email ["is taken"]}, based on that exception
12:04maleghastHave you thought about using (try …) ?
12:05augustlI am catching it yeah, the problem is to know that 1) the exception is for a unique index clash and 2) extract the column in question
12:05maleghastOh I see, sorry.
12:06augustlcan't find much on google
12:06maleghastNo, I bet..
12:06augustland matching on the message seems very unsafe..
12:06augustlbut I would assume that this is something people do a lot
12:06maleghastYeah, I reckon you're right...
12:06augustlapparently not..
12:07maleghastI haven't tried it (yet), but have you looked at sqlkorma?
12:07maleghastIt might have a useful way to handle it.
12:08augustlnot as far as I can tell
12:09augustlit's mostly a SQL DSL in Clojure and some connection management, it leaves the dirty stuff to the jdbc stack
12:09maleghastOh right
12:10augustlsomeone suggested INSERT IGNORE, but that doesn't seem to help either
12:10augustlthat means it's just, well, ignored. No insert, no exception
12:10augustlthen there's table locking..
12:12augustlah nice, the format of the error message is public, and associated with an error code
12:12maleghastHmmm - it's an interesting problem… I have to run - conference call (yes at 1700h on a Friday *headdesk*) good luck with it!
12:23amouatCan someone explain to me what the clojurescript macro defpartial from the crate library does?
12:30amouatI guess it's just for making sure any functions generating html get wrapped in calls to crate.core/html?
12:30ohpauleezamouat: Yeah, it's just to create smaller partial pieces of HTML that you can use to build out full pages
12:33amouatohpauleez: Thanks. I couldn't figure out why it was necessary at first, but it makes more sense now (after breaking things by not calling using it...)
12:33ohpauleezcool! np, happy to help
12:36piranhasystemfault: I'm not sure if anyone mentioned that, but I love 'simple made easy'
12:37loganlinn$help
12:37lazybotYou're going to need to tell me what you want help with.
12:45gfredericksso I google about how to get a jarname from java; it involves calling .getProtectionDomain().getCodeSource() on one of my classes
12:45gfrederickswell I guess that works; since I have an uberjar I can do that on clojure.lang.RT
12:45tomojhttp://hackage.haskell.org/packages/archive/ZipFold/latest/doc/html/Data-Zip-FoldL.html
12:46tomojdata FoldL b a = F (a -> b -> a) a
12:46tomojthat looks awfully like 'mapping' etc
12:50tomojbut what about WithCont (FoldL b), i.e. WC (F (a -> b -> a) a) (a -> c)
12:51tomojlooks kind of like (fn ([] a0) ([a] c) ([a b] a'))
12:51tomojbut an operator like reducer can't tell whether you pass such a thing
12:52tomojer, it looks not like 'mapping', but just like the things 'mapping' etc pass around - reducefs
12:52TimMcgfredericks: (-> + class .getProtectionDomain .getCodeSource) ;;= nil
12:57konr_tra`is there a name for clojure's data structure, like CLON?
12:58hiredmankonr_tra`: https://github.com/edn-format/edn
12:58AimHereNah. With clojure you just slurp it and read-string it
12:58AimHereAfter defining your DSL appropriately, of course
13:04TimMcThat's "DSL" in the semantic sense, not some formal programmatic construct.
13:09tomojif you had something that otherwise looked exactly like a vector, but which conj'd on the front, that would probably be bad, right?
13:11kovaspbostrom: thanks! I got it from https://github.com/achengs/subpar
13:13llasramtomoj: OOC, what's the benefit of `conj`ing onto the front?
13:13pbostromkovas: just curious, have you looked into trying to start up multiple nrepls, or would that be too heavyweight?
13:13kovaspbostrom: there is a multiplayer mode in session right now
13:13kovaspbostrom: but not multiple nrepls to do the eval
13:16pbostromkovas: ok, I see, I'll have to look at it a bit closer then, I think there is a bit of overlap in what I put together, it might make sense to do some collaboration
13:18kovaspbostrom: sweet. i'd like to figure out a way to make these sorts of projects more modular
13:18kovaspbostrom: what do you want to achieve with your thing?
13:20tomojllasram: well, sometimes that's just what you want
13:20tomojbut really, I'm thinking about right folds
13:20amalloytomoj: isn't that basically a queue, looked at upside-down?
13:21tomojmaybe, but this vector would peek and pop from the front
13:22amalloyso it's a list?
13:22amalloyor is the random access/update important?
13:22tomojyeah, but indexed
13:22llasramCan't you just read a vector backwards?
13:22tomojwell I don't really want that right now, I'm thinking about how you might make a right-foldable vector
13:22tomojright
13:23tomojso you can return a reducer that reduces the vector backwards
13:23tomojbut it seems pretty easy to just let vectors be truly reversible
13:24tomojmaybe not so easy..
13:25mmitchellanyone here use compojure and friend? I'm attempting to segregate auth-based routes from non-auth routes, but no luck
13:26pbostromkovas: I'm not quite sure yet, my first thought was to provide a sort of environment where beginners could collaborate with experienced coders to learn some key concepts
13:30pbostromkovas: I'm hesitant to try to tackle the problem of a full on dev environment, it seems like an intermediate developer can easily set up a shared tmux session, especially given some of the tools like technomancy's syme
13:31kovaspbostrom: yeah. I just think the terminal-based repl need to die
13:31Sgeo_What's this about the terminal-based REPL needing to die?
13:31Sgeo_Is this anything like living in a Smalltalk-like image?
13:32kovasrepresenting everything as text doesn't do justice to the stuff we want to create
13:32technomancyFSVO "we"
13:32pbostromkovas: anything in particular you won't to accomplish with session next? Or should I just look over your issues list on gh?
13:32kovasalso, being able to save values is definitely a win
13:33kovas(saving the VM state is too much complexity, but values we can certainly do)
13:33pbostroms/won't/want/
13:33kovaspbostrom: the issues like is pretty comprehensive
13:33kovaslist
13:35pbostromkovas: ok, I'll keep an eye on the gh page, FYI, I put my code up, not sure if you'll find it useful, especially since I didn't document anything: https://github.com/pbostrom/cwo-public
13:35Sgeo_kovas, what's wrong with everything being represented as text if we have manipulation tools that hide the textual representation
13:36Sgeo_Alternatively: Everything is not text, but can be serialized to text easily
13:36clojure-newbhey guys.. when I put a second when form in my function it is returning nil… I'm not sure what is going on… I'm trying to place two when forms at the same level to catch different predicates, any ideas ?
13:37dnolen`clojure-newb: paste
13:37kovasSgeo_: Yes I'm good with that, but that set of tools doesn't include the terminal
13:38Sgeo_kovas, hmm, so what do you have in mind?
13:38Sgeo_I rather like Smalltalk workspaces, but I can imagine there being better
13:38kovasSgeo_: browser-based repl can render stuff inline
13:39Sgeo_Oh, we're talking webdev?
13:39kovasSgeo_: you just put a protocol on your outputs and they render as whatever you want
13:39Sgeo_oh
13:39kovasSgeo_: I'm more interesting in data visualization
13:39kovasSgeo_: but theres plenty of situations where you want something more than text
13:39clojure-newbdnolen`: https://www.refheap.com/paste/8752
13:40kovaspbostrom: cool i will check it out!
13:40Sgeo_kovas, something like DrRacket?
13:40kovasSgeo_: I'm more inspired by Mathematica, since I used to help built it
13:40Sgeo_I know DrRacket displays image values as actual images and lets you paste images as code, I imagine it could be extended to other sorts of things
13:40kovasSgeo_: but yeah they have some basic stuff. its definitely the direction things are gonna go in
13:41dnolen`clojure-newb: that won't work, there's no such thing as early return in Clojure
13:41cbp`so my project starts a web server, anyone know how to make it create a console so that you can view messages and stop the server by closing the console?
13:41kovasSgeo_: the IPython has that as well, also the Factor repl
13:41clojure-newbdnolen`: what would be the idiomatic clojure alternative ?
13:41Sgeo_Haven't touched Python in a while
13:42kovasSgeo_: with clojure we have the benefit of the native dialect in the browser, so we can take it further
13:42dnolen`clojure-newb: use cond
13:42Sgeo_Also, forgot about Factor, I didn't ... quite remember something like that
13:42clojure-newbdnolen`: thanks
13:42Sgeo_kovas, there are a few Smalltalk dialects that run in Javascript
13:42kovasSgeo_: the IPython thing is getting a lot of traction
13:44gfredericksis there any answer to the problem of not being able to put data-reader stuff in your code?
13:44gfredericks(generally)
13:44yogthosclojure-newb: this would probably be cleaner https://www.refheap.com/paste/8753
13:45clojure-newbyogthos: thanks… still trying to get the basics, that helps
13:46yogthosclojure-newb: no prob, I also hihgly recommend going through at least some problems on http://www.4clojure.com/
13:46yogthosclojure-newb: if you make an account you can see solutions from others when you solve a problem, this way you can get a feel for idiomatic code
13:46clojure-newbwow, loads on there
13:46clojure-newbthanks
13:54seangroveHey guys, have a mildly annoying dev/production problem
13:54ohpauleezseangrove: let's hear it
13:55seangroveI have Oauth client-id's that I need to use in the frontend to start oauth flows, but they (obviously) differ between dev/production
13:55seangroveIn rails, I pre-processed the js files with erb and put in the correct client-id depending on the RAILS_ENV, but not sure how to approach it with cljs
13:56ohpauleezseangrove: Can you do conditional builds of the frontend. Like pipelining infrastructure
13:56seangroveI could change the server around so the client just asks for the appropriate oauth client-id to use, but not 100% sure about it
13:56technomancywe need a clojurebot factoid for "use environ or carica depending on whether you need nested values or just strings"
13:56seangroveI don't have anything like that setup right now, I just run cljsbuild auto <env>
13:57ohpauleezhttps://github.com/sonian/carica
13:57ohpauleezI also use lein profiles for some stuff now
13:58seangroveThanks for these guys, checking them out now
13:58technomancyclojurebot: config?
13:58clojurebotexcusez-moi
13:58tomojcan a cljsbuild build pass in configuration somehow to macroland?
13:58tomoje.g., I guess, set an environment var which tells which carica config file to load
13:59hiredmantomoj: no no, you use the classpath
13:59TimMcohpauleez: Hot damn that's a nice README.
13:59technomancyclojurebot: config is <reply>use https://github.com/sonian/carica for reading .clj files off the classpath if you have complex structure and need nesting. use https://github.com/weavejester/environ if you can get away with just strings for everything.
13:59clojurebotIk begrijp
13:59tomojhmm.. so etc_dev/config.clj, etc_prod/config.clj
13:59tomojand add one or the other to the classpath in your build?
14:00technomancytomoj: typically resources/config.clj and dev-resources/config.clj
14:00TimMctomoj: What are the consequences of using the wrong ID?
14:00technomancybut you can change it if you like for whatever reason
14:00tomojah, and the first one will be used
14:00tomojso you don't have to do anything.. nice!
14:00hiredmantomoj: no, your deployment software (chef, puppet, whatever) overides the default config by writing a config file that ends up first on the classpath
14:01gfredericksso to use #inst with joda I want to create a data-readers.clj and redirect #inst to a clj-time function?
14:01tomojsure
14:02seangroveAnd carica should work with cljs, presumably?
14:02seangroveI'm pretty fuzzy on how much clj libraries "just work" with cljs - it seems to be, "almost none"
14:02tomojso then the stuff you put in your cljsbuild builds is orthogonal to stuff in config.clj
14:02TimMcCarica... that's the genus of papaya.
14:02technomancyseangrove: the cljs compiler is written in clojure, so your configuration should affect the compiled output
14:02tomojyou can run a prod/min build with your dev config.clj or a dev build with your prod config.clj
14:02TimMcLooks like I'm not the only one using biological taxonomy as a source for project names!
14:03seangroveCarica looks pretty awesome. Will try it out now
14:03tomojseangrove: I think you'd need to define a macro if you just wanted to pull a config value out to js
14:03technomancyleathekd: why does the carica readme say to add a directory to :resource-paths?
14:05leathekdHmm, I suppose it isn't necessary so long as the config file ends up on the classpath where carica will find it.
14:06gfredericksaaaaaaugh
14:06technomancyleathekd: yeah, just curious if you saw some special value in keeping it separate from other resources
14:06leathekdtechnomancy: It might be an artificial separation but I like having config separate from src.
14:06technomancyoh right; separate from src/ absolutely
14:06TimMcBut why not in ./resources/?
14:06technomancyseparate from other resources is what struck me as curious
14:07seangroveHrm, I'm slightly confused how I set different resource-paths for different cljsbuilds: https://www.refheap.com/paste/88204855cbd6a01879b3aabc5
14:08borkdude,(-> 1)
14:08clojurebot1
14:08leathekdtechnomancy: ah, y'know, I don't think I was aware of the resources dir. I may even have personal projects with 'resources' in the resource-paths seq. heh
14:09seangroveAh, maybe by default it'll build whatever's in :resouce-paths, but that can be changed by passing in ENV vars to affect the class-path at build time?
14:10technomancyseangrove: typically you control those with profiles
14:11seangroveOk, I'll take a look at profiles then
14:11frozenlockcljsbuild - How can one include the externs.js file in the jar?
14:16frozenlockThe .cljs is included, but not the externs.js... does this mean that the user must add the externs.js manually each time?
14:16tomojhmm.. isa? hierarchies have to be made out of symbols, keywords, or classes, with classes only at the leaves, yes?
14:18tomojoh, but with collection dispatch values.. I guess I never understood isa? dispatch
14:18dnolen`frozenlock: I don't know this so, you should look at how jayq does this
14:18dnolen`"I don't think so"
14:20frozenlockyeah that was my first reflex.. but jayq really seems to be a special case. Its project.clj --> (defproject jayq "2.0.0"
14:20frozenlock :description "A ClojureScript wrapper for jQuery")
14:27dnolen`frozenlock: oh hmm, then maybe create a resources directory and put your extern file in it? This has come up before. Might be worth going over the mailing list archives.
14:27seangrovetomoj: Yeah, carica doesn't work in cljs as-is, will try the macro route
14:28frozenlockdnolen`: indeed -> https://github.com/emezeske/lein-cljsbuild/issues/95
14:29frozenlockI moved stuff around in directories and it worked. :-)
14:29dnolen`frozenlock: nice
14:30`fogusdnolen: Are you planning to move infd into the fd ns?
14:34dnolen``fogus: it's already been done
14:35dnolen``fogus: infd is now fd/in if you require clojure.core.logic.fd :as fd
14:35`fogusah!
14:35dnolen``fogus: I'm removed all cases where names ended w/ a fd suffix
14:36dnolen`it's now fd/distinct, fd/+ etc
14:36`fogusOK. That's more clojurey
14:36`fogus;-)
14:36dnolen``fogus: yes :)
14:40`fogusdnolen: I changed the examples page to use fd/ https://github.com/clojure/core.logic/wiki/Examples
14:40dnolen``fogus: great thanks!
14:41dnolen``fogus: I had fixed the other examples but missed that one.
14:41`fogusNo worries. Thanks for c.l
14:41dnolen``fogus: it's coming along slowly but surely!
14:44borkdudewho wants to test if this Pong game runs? made by first year undergraduate students https://www.dropbox.com/s/i3j5mxwrtmaxioo/Pong.jar
14:50ohpauleezborkdude: Are you trying to root my system?
14:50borkdudelol
14:50ohpauleezblindly accepting executable jars is a no-no now haha
14:50ohpauleez:)
14:50bbloomohpauleez: you're just doing it wrong. you need to blindly run lots of unverified code to build up your machine's immunities
14:51bbloomi thought you knew stuff about computers!
14:51systemfaultWhat doesn't kill your OS makes it stronger, right?
14:51ziltiCan I define some kind of "wildcards" in Compojure? Like saying "(GET "/foo/*" [args] ...) ?
14:51seangroveAh, damn.. I can't use a macro inside of a function in cljs?
14:51ohpauleezhaha, I know I've done a lot of autonomic computing… I suppose this is just the next logical step I should take
14:51ohpauleezbbloom: you've convinced me
14:52ziltiseangrove: Only compile-time macros for cljs
14:52amalloyseangrove: you do that every day when you write (defn foo [] (let [...] ...))
14:52seangroveIf zm/env-settings is a macro then, does this look acceptable? https://www.refheap.com/paste/920ca3135bc5627a18483c8e4
14:54seangroveI of couse get "zm is not defined" in the browser repl, which is reasonable
14:54seangroveI could pull them out into a top-level def so they're executed at compile time, I suppose
14:57augustlwith ring.middleware.session and the cookie store, how do I implement a "remember me" checkbox?
14:58ohpauleezaugustl: You set the :expires on the session
14:58ohpauleezhow you toggle that in your code is up to you
14:59augustlreading the code, seems it also read out :session-cookie-attrs from the response too
14:59augustlohpauleez: that's what I wanted to hear :)
15:00seangroveAlright, so if carica is telling me that some-path isn't a valid config when running "lein cljsbuild auto dev", but it works in clojure in the repl, is it likely I've messed up the profile?
15:04tomojI guess check (System/getProperty "java.class.path") inside a cljs macro
15:05tomojI see strange-looking stuff in cljsbuild about running 'in a subproject'
15:07tomojbbloom: do you know if dispatch-map suffers contention problems like those recently fixed in multimethods?
15:07bbloomtomoj: link?
15:08tomojhttp://dev.clojure.org/jira/browse/CLJ-988
15:08tomojI guess since it's an atom, no?
15:09bbloomoh yeah, no mine shouldn't suffer from that at all
15:09bbloomthey put the state in an atom
15:09tomojhttps://github.com/clojure/clojure/commit/83ebf814d5d6663c49c1b2d0d076b57638bff673
15:10tomojjust more overhead than multimethods then?
15:10bbloomno, a dispatch-map should be cheaper than a multimethod
15:10bbloomit's a subcomponent of multimethods
15:10tomojoh, right, but I mean using dispatch-map's reimpl of multimethods
15:11bbloommaaaybe, but that cost would be 1) very small and 2) only paid on defmethod
15:11bbloomshouldn't really have any serious runtime impact
15:12tomojcool
15:13bbloomyeah you can see for youself in https://github.com/brandonbloom/dispatch-map/blob/master/src/dispatch_map/core.clj
15:13bbloombasically search for @
15:13bbloomor !
15:13bbloomjust like dispatch map gained a State class
15:14bbloomer i mean just like real multimethods gained a State class
15:14bbloomdispatch map has DispatchCache
15:14bbloomwhich is stored in an atom
15:14bbloomreal multimethods then use a lock for the defmethod, prefer, etc
15:14bbloombut i use an atom for that too
15:15bbloomso atom + lock vs 2 atoms
15:16seangroveHrm, it seems like resource-paths is ignored by cljsbuild?
15:18seangrovetechnomancy: Should this be resource-paths here? https://github.com/emezeske/lein-cljsbuild/blob/master/plugin/src/leiningen/cljsbuild/subproject.clj#L66
15:19seangroveLooks like it might be ignoring resource-paths in project.clj for lein2 projects
15:21seangroveYeah, that didn't fix my problem, but at least my resource-paths are on the classpath now
15:28frozenlockI need help with cljs... I've done a wrapper for a js library. Everything works fine on its own, but I can't seem to require it from another project. Is there some magic stuff going on with underscores in the namespaces?
15:29frozenlockIn my wrapper: (ns envision-cljs.core). In my other project: (ns myprojectname.core (:require [envision-cljs.core :as v]))
15:29Bodilfrozenlock: Yeah, if your namespace is called envision-cljs.core, the file path needs to be envision_cljs/core.cljs
15:30Bodilfrozenlock: Just a wild guess at what's wrong, mind you, but that's the one I always keep running into :)
15:31frozenlockYeah I do often too, but in this case I did use the "_" in my path, which is why I'm confused.
15:32seangroveleathekd: Are there any debug options for carica so I can see *why* " (:google_docs :client_id) isn't a valid config"? I can't seem to get values to load when compiling cljs
15:32Bodilfrozenlock: In that case I'm confused too...
15:33frozenlockIt's my first cljs library that uses an externs.js; I'm not usre if it's related.
15:35frozenlockme 3 days ago "Oh, let me do that in cljs, I'll save time!"
15:36frozenlockI was so young and naive back then.
15:36seangroveUhg, carica works in the repl, even the cljs repl, but when compiling cljs carica won't put in the value... maybe carica isn't loaded at that point?
15:40seangroveAh, ok, so it looks like the fix to lein-cljsbuild subproject.clj did the trick. Phew.
15:40seangroveThe yaks are out with a vengeance today
15:40clojurebotwhat should I do today, it is the weekend and all
15:41frozenlockOk something funny is going on here. Every library is in the .lein-cljsbuild-compiler-X folder, except for my new one.
15:41frozenlock(I did clean and recompile multiple times)
15:44seangrovefrozenlock: I wrapper handlebars in cljs with an extern file, but I haven't released it as a jar, so haven't gone through any of this
15:45seangroveWould be much appreciated if you can keep track of what you had to do
15:45frozenlockseangrove: Fear not, I'm on this since yesterday evening... I'm so mad that I won't forget a thing :p
15:59frozenlockomg
15:59frozenlockomg omg omg omg
15:59frozenlocksomeone please shoot me
15:59amalloyonce you said omg five times, i was going to even if you didn't ask
15:59frozenlockcore.clj ---> core.cljs
15:59aroemersI think the bots won't let us..
16:02Thallasios_Xelonhello guys :)
16:03Thallasios_Xeloni want to do something like (let [ (first l) 5] .....)
16:03Thallasios_Xelonits an error right?
16:03Thallasios_Xeloni stuck...
16:03nDuffThallasios_Xelon: what do you actually want to do?
16:03nDuffThallasios_Xelon: ...that is -- what's the effect of this supposed to be?
16:04nDuffDo you have a local "l" which already exists outside this scope, and you want to change the value of only its first element within the let?
16:04Thallasios_Xeloni want to bind a variable,inside let
16:04Thallasios_Xelonnot a constant symbol
16:04nDuffThallasios_Xelon: Why is "first" involved?
16:04nDuff...
16:05nDuffOh. The easy answer is "you can't".
16:05Thallasios_Xelon(let [ symbol 5]
16:05Thallasios_Xeloni want to determine the symbol on runtime
16:05Thallasios_Xeloncan i?
16:05nDuffNo.
16:05Thallasios_Xelon:)
16:05nDuffIf you really have a legitimate use case for that, use a macro.
16:06nDuff...but I'd be curious to hear it.
16:06ibdknoxChances are you don't need to
16:06Thallasios_Xeloni am really newbie
16:06nDuff...and if you do have a real-world use case, there's probably a better way to satisfy it
16:06nDuff(such as a thread-local binding for a var)
16:07Thallasios_Xeloni want to use a thread-local binding,but with a variable symbol like (binding [ symbol_on_run_time_or_macro 5]
16:08Thallasios_Xeloncan i use a macro for that?
16:08seangroveThallasios_Xelon: But *why* do you want to do that?
16:08seangroveWhat are you trying to accomplish
16:08Thallasios_Xelona have a boolean formula,that i want to evaluate
16:09Thallasios_Xelonwith different bindings
16:09Thallasios_Xeloneach time
16:09augustlis there something like form authenticity tokens in Rails for Ring?
16:09ibdknoxaugustl: https://github.com/weavejester/ring-anti-forgery
16:10frozenlockThallasios_Xelon: to play with symbols https://www.refheap.com/paste/8756
16:11ibdknoxif you want dynamically bound symbols you can use with-bindings
16:11ibdknoxI still doubt that's really what you want though
16:11ibdknox,(doc with-bindings)
16:12clojurebot"([binding-map & body]); Takes a map of Var/value pairs. Installs for the given Vars the associated values as thread-local bindings. The executes body. Pops the installed bindings after body was evaluated. Returns the value of body."
16:12Thallasios_Xelonthx guys i will try reading and trying
16:16augustlidlecool: nice, thanks
16:16aroemersfrozenlock: nice macro, found a good use for it in my current project.
16:17frozenlockaroemers: Thanks. I was pretty sure it could only help me and my idiosyncrasies :)
16:17augustlibdknox, not idlecool, sorry
16:19brainproxywin +1
16:19Thallasios_Xelonif you wanted to evaluate a boolean formula, (and a b) for many a,b values what would you do?
16:19brainproxyderp
16:20frozenlockIs there a way to get a function's documentation from a cljs repl?
16:20Thallasios_Xeloni thought that i would be easy not to touch the formula,and evaluate it in different bindings for a and b
16:21Thallasios_Xelond
16:22augustlibdknox: semi off-topic, do you need CSRF protection for a JSON API? I can't think of a way for someone to POST JSON to that API from another origin
16:22augustlerr, not just ibdknox, anyone :)
16:22ibdknoxyes, you can just use curl
16:23ibdknoxThallasios_Xelon: ,(map and [true true] [false true])
16:23augustlor perhaps an <input type="hidden" name="json here"> would work actually
16:23ibdknox,(map and [true true] [false true])
16:23clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/and, compiling:(NO_SOURCE_PATH:0)>
16:23TimMcaugustl: Cross-site POST works.
16:23dnolenThallasios_Xelon: how is that not solved by (defn f [a b] (and a b)) ?
16:23ibdknox,(map #(and % %2) [true true] [false true])
16:23clojurebot(false true)
16:24TimMcaugustl: So yes, you need CSRF protection of some form. It may be as simple as checking that the request was made by XHR, which I believe adds a special header.
16:24Thallasios_Xelondnolen the formula isnt stable
16:24Thallasios_Xelonbut thanks
16:25augustlTimMc: was thinking that if I only accept JSON, I would be safe. But with that hidden input you should be able to send json anyway
16:26Thallasios_Xeloni want to evaluate any formula
16:26ibdknoxaugustl: I can send anything I want from curl
16:26ibdknoxwith xhr headers
16:27ibdknoxas json
16:27augustlibdknox: right, but that's not related to CSRF
16:27Thallasios_Xelonbye guys thx :))
16:27dnolenThallasios_Xelon: sounds like you need write some kind of solver then, trying to piggy back of the standard evalution model probably isn't going to work for you.
16:28augustlCSRF = exploiting the fact that POST-ing a form to some foreign origin causes the browser to send any cookies it might have with it, hence the need for a token
16:28Thallasios_Xeloni think i will use refs,as symbols to solve it
16:28augustlso, I was thinking that if the place you can POST to only accepts JSON, that'd be OK, but I guess there are ways to make plain forms to JSON
16:37augustlseems that a web based API shouldn't use cookies for authentication. Eliminating cookies = eliminating CSRF
16:37TimMcaugustl: I suppose the form submission would have a "form-encoded" header, which you could check against.
16:38augustlTimMc: I guess there's always some odd browser that doesn't even set that header :)
16:38TimMcbleh
16:38TimMcActually, I doubt that.
16:39augustlhmm, me too, but that means I'd base security on assumptions
16:39TimMcIf I were in your place I would be checking for known solutions.
16:39TimMcI haven't had to worry about CSRF in a while.
16:40TimMc...but it's a pretty well-solved problem, IIRC.
16:42augustlthe only problem is probably that I'm complecting things by having an API and a website that can use that API on the same domain ;)
16:42augustlshould separate them so my website doesn't gain additional privileges towards the API from being on the same origin
16:42TimMcLook into the XHR header thing. I think that's pretty solid.
16:45seangroveaugustl: Also, CORS
16:47bbloomif you write a java class that has a name endeding in List and you implement precisely ZERO collection interfaces: fuck you.
16:48systemfaultHaha
16:50tomojyes :(
16:50tomojor a Map
16:52augustlseangrove: I find CORS to be too specific, since I explicitly have to permit hostnames
16:52seangroveI think you can wildcard
16:53seangroveOr you can check the origin of the incoming request and set your cors headers to allow that
16:53ohpauleezyou can wildcard
16:53ohpauleezor you can support JSONP
16:54augustlseangrove: you can't wildcard on HTTPS and with cookies
16:54augustlwildcard = no cookies
16:54augustlwith good reason :)
16:54ohpauleezahh
16:54ohpauleezsure, totally
16:54seangroveAh, I see
16:54seangroveEvery request I make that way just includes the api-key, so no cookies
16:54augustlso, I'll separate the webapp and the api, and proxy the api from my webapp, and use CORS protection on the web app only
16:55augustlthe api will ignore cookies completely
16:55augustlseangrove: yeah :)
16:55augustlthe web app needs to store the api key in a cookie, but that's not a problem, since the web app is XSRF protected
16:55augustls/and use CORS/and use XSRF proteection/
16:56seangroveJesus christ, I think I may have fiished the second have of the ui for Zenbox
16:57seangroveUI (at least in js) is by far the most painful part of dev so far
16:57seangroveI have got to start an open-source project to port something like IB to clojurescript
16:57seangroveAs far as I can tell, it's basically entirely declarative, no?
16:58augustlseangrove: if you aren't using AngularJS, there's a high probability you are using the wrong tool :)
16:58seangroveUsing cljs and google closure ui
16:58augustlthe problem (imo) with google closure UI is that it's essentially just a better DOM
16:59augustlyou're still on your own when you want to update your UI when data changes
16:59seangroveaugustl: Yeup
16:59seangroveThe built-in controls are pretty nice though, still
17:00augustlangular provides the best solution to this problem I've ever seen :) https://twitter.com/silentbicycle/status/269128913572208640/photo/1/large
17:05augustlseangrove: this is very unscientific of course, but I rewrote an app in AngularJS in two weeks that I spent many months trying to program in Google Closure
17:05augustlthis app was wery stateful in nature though, lots of new state over the wire and state changes that affected the entire app, making angularjs a perfect fit
17:06seangroveaugustl: I've simulated that a bit using shoreleave's pubsub and handlers
17:06seangroveBut it's pretty manul
17:06seangroveHaven't found the right patterns to abstract yet
17:08ohpauleezseangrove: Hopefully the new Shoreleave updates help smooth that out
17:08seangroveohpauleez: Very much looking forward to it
17:08seangroveTrying not to pester you too much about it, now that working off of master for shoreleave-browser works
17:08frozenlockohpauleez: Is the new version ready?
17:08frozenlockI'm at a point where I need server/client communication, and I would like to use shoreleave :)
17:09ohpauleez(subscribe-> …) has been added, remote-ns is supported on Ring/Compojure, improvements in handling failures better
17:09ohpauleezfrozenlock: Getting there: https://github.com/shoreleave/shoreleave-baseline
17:09ohpauleezI'm a little bit behind from where I wanted to be, but I've cut one production app (light traffic, internal use only) over
17:17antoineBhello, what kind of deconstructor we have in clojure? i know vector and map, is there orthers?
17:18TimMcantoineB: It's not really a vector, it's a sequential destructurer.
17:18ohpauleezantoineB: You can destructure any associative or sequential thing
17:18TimMchmm...
17:19TimMc,(let [{a 0} [:bar]] a)
17:19clojurebot:bar
17:19TimMc,(let [{a :foo} {:foo :bar}] a)
17:19clojurebot:bar
17:19ohpauleezTimMc: Are you saying hmmm.. as in, "Records?" or hmmm… "it's probably a protocol"
17:19TimMcSo yeah, vectors can be destructured in two different ways.
17:19gtrak,(let [{a :foo} [[:foo :bar]] a)
17:19clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
17:20TimMcThe associative destructuring is probably more performant. :-/
17:20gtrak,(let [{a :foo} [[:foo :bar]]] a) ; darnit
17:20clojurebotnil
17:20amalloyTimMc: why would you say that?
17:20systemfaultDo you guys think that a small IRC bot would be a good starting project for clojure?
17:20systemfaultI have no other idea for now..
17:20TimMcamalloy: The sequential destructurer uses nth.
17:20amalloyso?
17:20amalloynth is fast on vectors
17:21TimMcOh, is it? I thought it forced a seq.
17:21ohpauleezsystemfault: Are you looking for starter projects?
17:21TimMc,(doc nth)
17:21clojurebot"([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences."
17:21TimMc,(nth (range 1 10) 1000)
17:21gtrakah, oops, I did it wrong, ##(let [{a :foo} '(:foo :bar)] a)
17:21clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
17:21lazybot⇒ :bar
17:22systemfaultohpauleez: Exactly.. something that would cover the basics.. data structures, functions, I/O
17:22TimMcgtrak: wat
17:23gtrak,(let [{a :foo} [:foo :bar]] a)
17:23clojurebotnil
17:23antoineBdoes exists other deconstructor like (let [#my-stuff[a b] something] a) ?
17:23gtrak,(let [{a :foo} (seq [:foo :bar])] a)
17:23clojurebot:bar
17:23ohpauleezsystemfault: HTML screen scraping using Enlive, a tic-tac-toe AI, a site-generator (like jekyll)
17:23gtrakwat wat
17:24systemfaultohpauleez: Good ideas, thank you :)
17:24ohpauleeztotally welcome
17:24antoineBohpauleez: a jekyll that read clojure maps as data, should be fun
17:25TimMc&(destructure '[{a :foo} (seq [:foo :bar])]) ;; gtrak
17:25lazybot⇒ [map__79211 (seq [:foo :bar]) map__79211 (if (clojure.core/seq? map__79211) (clojure.core/apply clojure.core/hash-map map__79211) map__79211) a (clojure.core/get map__79211 :foo)]
17:26gtrak yup
17:26TimMc,(let [{a 0} (range)] a) ;; so this should blow up
17:27amalloywow, that blew up even more than i expected
17:27TimMcbotgone?
17:27TimMc&(let [{a 0} (range)] a) ;; so this should blow up slightly less
17:28lazybotExecution Timed Out!
17:28TimMc$botsnack
17:28lazybotTimMc: Thanks! Om nom nom!!
17:29gtrak&(range)
17:29lazybotjava.lang.OutOfMemoryError: Java heap space
17:32gtrak,(throw (Exception. "##(println $botsnack)"))
17:32lazybotjava.lang.RuntimeException: Unable to resolve symbol: $botsnack in this context
17:32clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.Exception: ##(println $botsnack)>
17:33gtrak,(throw (Exception. "##(println \"$botsnack\")"))
17:33clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.Exception: ##(println "$botsnack")>
17:35scottjyedi: you asked about prismatic and clojurescript the other day. in case you didn't see it, they posted about it yesterday http://blog.getprismatic.com/blog/2013/1/14/bringing-functional-to-the-frontend-clojure-clojurescript-for-the-web
17:35yediscottj: I saw it
17:35TimMcgtrak: lazybot is snubbing clourebot these days
17:35yediand wow thanks for remembering and linking
17:35scottjhmm, the url says 1-14 but the article says 1-17, who knows
17:35yedii asked about prismatic and clojurescript on separate occasions!
17:36yediscottj: when I saw the title of the article, I was hoping for something more than a new templating library for cljs
17:36antoineBdoes clojure compiler support inlining functions?
17:36hiredmanyes
17:36hiredman,(doc definline)
17:36clojurebot"([name & decl]); Experimental - like defmacro, except defines a named function whose body is the expansion, calls to which may be expanded inline as if it were a macro. Cannot be used with variadic (&) args."
17:37yedisomething along the lines of using clojures powerful abstractions for frontend dev
17:37yedibut i guess hiccup-like templating fits that description
17:38hiredmanin some cases the compiler uses inlining of + together with an intrinsic for the static the method (Numbers/add) that it inlines to to emit a jvm iadd or ladd instead of a clojure function or java method call
17:45antoineBhiredman: in the code of definline i don't understand the "~(apply (eval (list `fn args expr)) args)" part
17:46akhudekI was somewhat disappointed to see another templating library when clojure/clojurescript already has several. The justification seems to be "because it fits our style better" rather than any more interesting technical motivation.
17:49frozenlockohpauleez: Is there a way to get a hold of the things returned from the server, or is it really just `fetch'? Anything in fetch just returns nil.
17:51TimMcakhudek: Which?
17:52scottjakhudek: in the blog and readme the main reason they give is improved performance, they claim ~3-4x
17:52TimMclaser?
17:52scottjTimMc: I think he's talking about https://github.com/prismatic/dommy
17:55antoineBdommy don't support namespace (.createElementNS) used for svg, that's a bad point for me
17:55gtrakdommy is like 100 lines
17:56antoineBbut can be easily change by a dynamic var
17:57akhudekscottj: saw that, but they don't compare against domina or enfocus.
17:57scottjakhudek: yeah, and I wonder how fast the jquery technique they used is compared to other js templating options
18:06ohpauleezfrozenlock: I'm not sure I understand the question, but whatever the server function returns, will get passed back to the client
18:07ohpauleezIf the function returns nil, the client will see nil. If the server function returns a map, the map gets returned. The only limit is: it has to be serializable with (pr-str ...)
18:07frozenlockohpauleez: In fetch, doing (fm/letrem [a (adder 3 4)] a) will return nil.
18:08frozenlockHowever (fm/letrem [a (adder 3 4)] (print a)) will print a
18:08ohpauleezfrozenlock: Yes, remotes can only call their bodies in a callback - they're non-blocking
18:09ohpauleezso the remote blocks on the client side will always return nil, but their bodies will run when the remote is satisfied (or an error occurs)
18:09frozenlockOk, I just have to stuck this into my mind and be surprised it happens :)
18:10frozenlock*stop being surprised when it happens
18:28brainproxyweavejester: concerning reload middleware.. for the heck of it, I tried wrapping wrap-reload so that if it throws an error during a reload I could go to a nice-looking 503 page
18:29brainproxybut what I found was that doesn't work -- if there is, for example, a syntax error, then my catch statement/s will run, but the client always gets a 500 response w/ no body
18:30brainproxyi.e. not whatever would otherwise be returned by the return of catch
18:37bosiehttps://www.refheap.com/paste/c4ca927d6d96ffb4f716a54f3 could someone please tell me why this is what happens?
18:39muhoook i'm confused. why would a java class import perfectly well in the repl, but blow up spectacularly in "lein check"?
18:40muhoospecifically https://www.refheap.com/paste/8762 , and this is with RC2
18:41muhoois there something radically different about what lein check does to compile namespaces, versus what the repl does?
18:42gtrakinteresting that it's a different class than what you're importing, sounds like a problem in your classpath, maybe duplicate deps?
18:42technomancymuhoo: the repl pulls in nrepl and clj-http and friends in order to function
18:42chronnobosie: don't use fn as the name of your first parameter
18:42bosiechronno: right but i am not sure why this error would happen
18:43chronnobosie: third line
18:43gtrakbosie: you're calling inc instead of creating a function
18:43chronnoyou are appplying inc there
18:43muhootechnomancy: is there some way to coax out a lein deps :tree of what the repl would consider its tree versus what lein check would?
18:44chronnobosie: with two paremeters, an empty vector and the return value of the let
18:44muhooapparently there's some missing dep, or, more likely, a conflict
18:44bosiechronno: oh true
18:44bosieis there a way to get better error/exception messages?
18:44muhooi bet either nrepl or clj-http is pulling in a different version of guano than what is specified in the project
18:44technomancymuhoo: that's still an open issue unfortunately: https://github.com/technomancy/leiningen/issues/520
18:45technomancyhaven't thought through a good solution
18:45gtrakbosie: it's an obvious error, how would you detect such a thing?
18:45bosiegtrak: pardon?
18:45gtrakhow would you automate detection of such a thing?
18:45muhoohuh, i guess i have a talent for something: running up against open issues. oh well. i'll figure something out
18:45dakronemuhoo: clj-http doesn't pull in guano at all
18:45technomancywait, is there actually a lib called guano?
18:46bosiegtrak: automate? it gives the wrong line number
18:46muhooit's a google thing, uh,
18:46bosiegtrak: if anything, giving the wrong line number is a bug
18:46muhooguava, not guano. it coats my life with guano though.
18:46technomancyhahaha
18:46gtrakbosie: the line number makes sense
18:46gtrakif you look at AFn
18:46gtrakit's not a syntax error, it's a semantics error
18:46bosiegtrak: the line number does not make sense. this is like revealing the C code line number for a ruby exception
18:47technomancysounds like an april fools project announcement; forking guava -> guano
18:47gtrakyou don't get it, it did what you told it to, it has no way to interpret what you meant to do
18:47bosiegtrak: apparently i don't
18:48bosiegtrak: i would have expected to see line 3 here
18:48gtrakcore$inc doesn't accept two args, that's pretty clear what it's trying to do. It doesn't clean up the jvm classname munging for you, granted.
18:49bosiegtrak: i overlooked line 3 and thought the error is in line 8
18:49muhoocljs pulls in this guan[oa]
18:49technomancymuhoo: for now you can just toss [org.clojure/tools.nrepl "0.2.1"] and [clojure-complete "0.2.2"] into project.clj
18:49technomancyif you want to get a deps tree
18:50bosiegtrak: i didn't think i could actually override fn
18:50muhootechnomancy: cool, thanks. i'm going to try explicitly calling out guan[oa] and see if that helps
18:50gtrakbosie: yea, fn's not a special form
18:50bosiegtrak: right
18:50technomancymuhoo: oh, also [org.thnetos/cd-client "0.3.6"]
18:50gtrakit's a runtime error by nature, since it compiles fine
18:51muhooweb stuff seems to involve a lot of tangled dependencies these days, specifically since lein itself wants web-related stuff in order to work (clj-http in particular)
18:52muhootechnomancy: problem worked-around: [com.google.guava/guava "13.0.1"] and everything works :-/
18:52technomancymuhoo: another option is to use a raw repl instead of nrepl
18:52bosiegtrak: is there a way to get better line number parsing?
18:52technomancy`rlwrap lein trampoline run -m clojure.main/repl`
18:52muhootrue, but i'd be lost without nrepl.el :-)
18:53technomancycompletely avoids the implicit dependencies
18:53muhooi was using the raw repl on an embedded platform for a while though, worked well.
18:53gtrakbosie: in this case, I'm afraid not. However, if the source is loaded from a file instead of eval'd at the repl, you can see the line number farther down the stacktrace.
18:53technomancyI should add a faq for that or something
18:54muhooit'd be helpful for debugging these strange dependency tangles, yes.
18:54bosiegtrak: thank you
18:55gtrakbosie: you'll see the line number of the call at that stack frame at the time of error, but the actual exception information is pointing to the appropriate place
18:55bosiegtrak: right
18:55technomancyanybody got any last-minute issues to report on leiningen 2.0.0-rc2?
18:56Raynestechnomancy: It isn't pink.
18:56muhooso far, rc2 seems pretty damn solid
18:56bosiegtrak: the only thing is, its pointing to the very very last line and i can't remember a language doing that. i also can't understand how exactly this is useful information in a debugging scenario. but maybe thats my inexperience speaking
18:56Raynestechnomancy: http://code.google.com/p/clementine-player/issues/detail?id=219
18:56frozenlockI have a bunch of datetime objects on a server that I want to transfert to a cljs app. Perfomance-wise, should I convert them to string, or to millis?
18:57technomancyRaynes: that might need to get pushed back to 3.0
18:57bbloomfrozenlock: shouldn't be too hard to try it and figure it out
18:57bbloomfrozenlock: but it's probably irrelevant: use an iso8601 string
18:57gtrakbosie: reading JVM stacktraces is kind of a hassle, agreed..
18:58gtrakI think this is the state of the art: https://github.com/mmcgrana/clj-stacktrace
18:59bosielet me give that a try
18:59Raynes(pst *e)
19:00muhooRaynes: wtf, are bronies trolling clementine's bugtracker or something?
19:00Raynesmuhoo: This was ages ago. And IIRC, he actually fixed it and made it so you can make it pink.
19:04bosiegtrak: still working on it
19:10technomancyinteresting thoughts re: "full-stack is easier": http://words.steveklabnik.com/rails-has-two-default-stacks
19:11bosiegtrak: https://www.refheap.com/paste/8765 mind sharing your wisdom for what i do wrong, again? ;)
19:11Raynescallen: It's Time by Imagine Dragons.
19:12gtrakbosie: firstly, the user profile doesn't go into project.clj, but into ~/.lein/profiles.clj
19:13bosiegtrak: thanks
19:13tomojs/defmethod/defnmethod/
19:13gtrakbosie: looks like you no longer need to explicitly use/require after that
19:13tomojguess it's fairly easy to write a pointfree defmethod, but what to call it? :)
19:14bbloomtomoj: i think clojure.pprint does that and calls it use-method
19:16bosiegtrak: hm. doesn't seem to work for me
19:16gtrakhrm, not sure, then
19:17Raynesmuhoo: There is a clementine setting that turns all album art into kitten pictures.
19:17bosiethe reason why i use require: https://github.com/mmcgrana/clj-stacktrace/issues/15
19:17xeqitechnomancy: I'm all for a default starting stack, and luminus seem ok for that
19:17gtrakbosie: I think that's irrelevant
19:17muhooRaynes: i'll have to check this out, thanks.
19:18gtraklooks like he's using it a different way entirely
19:18technomancyxeqi: yeah, it just challenges the whole "everything's easy with a full-stack framework"
19:18technomancythere's always going to be swapping out happening
19:18muhooRaynes: do you publish your playlist somewhere, like on one of those social music services?
19:18xeqiheh, I came for the prime stack side
19:18gtrakthough, isn't new a special form?
19:18xeqi*from
19:19technomancyxeqi: also the article is a bit silly in slapping all those orthogonal choices together; as if a preference for Postgres makes you more likely to use Haml
19:19xeqithough luminous does have weird choices for options, +bootstrap?
19:19technomancybut whatever; Clojure people understand that
19:19Raynesmuhoo: I don't have playlists as I tend to listen to entire albums at a time (which *are* playlists, but just playlists of a single album on spotify where they should be public), but I scrobble everything I listen to to last.fm.
19:19Raynesmuhoo: https://last.fm/user/RaynesFM
19:20seangroveHrm, I think I really need to get the CA-as-a-github-service sideproject going
19:20muhooRaynes: cool, thanks, you seem to be into all kinds of stuff i've never heard before
19:20technomancyare there any music players whose random shuffle is smart enough to only queue christmas music during december?
19:20xeqitechnomancy: heh, yet surprisingly accurate from rails people I know
19:21bosiegtrak: was that directed at me?
19:21gtrakbosie: yea, I question his usage of 'new'
19:21hiredmantechnomancy: I have an itunes smart playlist constructed from searching for "Christmas" and a few other terms, and my regular playlist is "all the music except what is on my christmas playlist"
19:22hiredmanseangrove: it's been done
19:22muhootechnomancy: they're called "shopping malls"
19:22seangrovehiredman: Oh?
19:22hiredmanseangrove: some one just anounced it
19:22bosiegtrak: i see what you mean
19:22technomancyhiredman: I don't know if matching on terms would be enough
19:22Raynesmuhoo: You'll note that MCR is my most listened to band by a fairly wide margin.
19:22technomancyunless you had copiously tagged with genre, etc
19:22seangrovehiredman: Even better, I didn't have to lift a finger for it
19:22hiredmanseangrove: http://www.clahub.com/
19:22bosiegtrak: swapped it out with just an 'n'
19:22hiredmantechnomancy: works for me
19:23bosiegtrak: and that ha the exact same effect
19:23Raynesmuhoo: The interesting bit is that I haven't listened to them often in a while, I just listened to them so much that even in a short amount of time it eclipsed everything else.
19:23gtrakhmm, no idea then, I don't use it myself
19:23hiredmantechnomancy: actually I match 11 terms
19:23bosiegtrak: new is a special form http://clojure.org/java_interop#new
19:23hiredmanit different fields (name, category, album, etc)
19:24technomancyhiredman: do you have a lot of metadata filled out typically?
19:24hiredmantechnomancy: dunno, what is a lot?
19:24hiredmanmost at least have album info at least
19:24technomancycategories, tags, genre I guess
19:25muhooRaynes: i have bands like that too. but i did most of my intense/obsessive music listening in the pre-scrobbling era.
19:25hiredmananyway, I am looking forward to a music player that just exposes a sql interface where playlists are views
19:27gtrakhiredman: sparql? http://techbase.kde.org/Development/Tutorials/Metadata/Nepomuk/QueryService
19:27muhoohiredman: sounds like a clj project waiting to happen
19:27technomancympd has a database; I wonder what they use
19:27muhootechnomancy: sqlite last i checked
19:28muhooyep libsqlite3-0 (>= 3.5.9
19:28technomancycool
19:28scottjhttp://nhrx.org/mpdc/ lets you do pretty nice queries on mpd
19:29muhooremember when every sample-code example project for every language and tool was making an mp3 player?
19:29bosietechnomancy: may i bother you about a clj-stacktrace lein2 question?
19:29muhoomp3 library, actually, not player
19:29hiredmanscottj: neat
19:30xeqimuhoo: instead of a blog?
19:30technomancybosie: sure
19:30muhooxeqi: yep, blogs was a couple years later
19:30xeqiheh, didn't mean to put a ? on the end of that
19:30technomancyscottj: looks like fun
19:32bosietechnomancy: https://www.refheap.com/paste/4ea781d471f04a45dc50e5d3b
19:32hiredmantechnomancy: and then enrique iglesias
19:32gtrakbosie: it looks like it's working
19:32gtraknotice: user/eval872
19:32xeqitechnomancy, yogthos: https://www.refheap.com/paste/8767 wow thats alot of poms and a -SNAPSHOT to download
19:32technomancybosie: oh yeah, that's reply unfortunately
19:33bosiegtrak: hm. i thought it would look like on the github readme page ;)
19:33technomancybosie: https://github.com/technomancy/leiningen/issues/799
19:33technomancybosie: there's probably a nasty alter-var-root hack that could be used to force it on reply; haven't looked into it myself since I use nrepl.el
19:34bosiei see
19:34yogthosxeqi: heh I don't even know where thneed is getting linked from
19:34technomancythneed =(
19:34technomancyI thought that was fixed
19:35xeqitechnomancy: this is with RC2 for ref
19:35technomancywas it leinjacker?
19:35yogthosat least it's only grabbing the latest jar :)
19:36xeqigotta run, but I'll check later
19:36xeqiwas wondering what sort of tests the generator built
19:37xeqisince I didn't see them much in the docs
19:41bosiethanks technomancy and gtrak
19:57bizarrefishHi, all
20:03bizarrefishI'm playing with some web stuff, and am trying to implement a fingerprinting mechanism. I have next to no experience with multithreading/refs in clojure, and I'm not convinced that this code is safe: http://pastie.org/5722707 . Could someone take a look, and tell me what they think
20:04bizarrefishAlso, is there a more..idiomatic way to include a big expensive operation in a ref-alter than using a lazy-seq?
20:05amalloybizarrefish: instead of a lazy-seq of one element, you're looking for ##(doc delay)
20:05lazybot⇒ "Macro ([& body]); Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force or deref/@), and will cache the result and return it on all subsequent force calls. See also - realized?"
20:05bizarrefishAhh, I didn't know about that :)
20:05amalloyyour multithreading is safe but awkward
20:06amalloywell, maybe not. my alternative doesn't come out much better
20:07bizarrefishamalloy: Looks to me like the only other way of doing it which might be cleaner is by moving the if into the fn
20:08yogthoswouldn't swap be better (def fingerprints (atom {})) (swap! fingerprints #(if-not (contains % uri) (first (compute-fingerprint body))))
20:08yogthoserr missed assoc there, but you get the idea
20:09bizarrefishAhh, the atom thing
20:09bizarrefishI'm still trying to get my head around the differece
20:10yogthoshere https://www.refheap.com/paste/8768
20:11yogthosif you don't need it to be coordinated atom is better
20:11bizarrefishIt sure looks like a better solution
20:12bizarrefishBy coordinated, I take it you mean jumping around between threads, like a producer/consumer kind of situation.
20:12yogthosit would still be safe to use an atom there
20:13yogthosbut if you have transactions, then you want a ref
20:13amalloyyogthos: your function sets fingerprints to nil pretty often
20:13yogthosoh right :)
20:13bizarrefishhehe
20:13bizarrefishnot so good
20:13bizarrefishBut thanks dudes, I see what you're saying.
20:14yogthoshehe
20:14yogthosI'm useless without the repl :P
20:14bizarrefishWhat's a good way to actually integrate the repl into the devving process?
20:14yogthoswhat do you use for the editor?
20:15bizarrefishI've been learning noir and such by making a website for my mate. I've generally been using gedit/nano/whatever's available, and "lein run". Sometimes "lein repl", and starting the server so I can poke stuff from there.
20:15bizarrefishFeels like I might be missing a trick
20:16yogthosyeah emacs or eclipse is much nicer for clojure
20:16yogthosif you're comfortable with emacs, it's probably the way to go as most people use it, but eclipse with ccw is very effective too http://code.google.com/p/counterclockwise/
20:16yogthosthe other big thing you get is structural editing
20:16bizarrefishI think I tried the eclipse one a while ago. My machine wasn't fast enough to make it usable, iirc :P
20:17yogthoshehe
20:17yogthosif you get the base eclipse without all the crap addons it's not too bad
20:17yogthosand ccw has had some speed issues in the past, it's much better now
20:17yogthosbut emacs and paredit is very nice as well, and not nearly as much of a hog
20:17bizarrefishI'm comfortable with a lot of stuff in the same vein as emacs, I was fooling with emacs the other day and it seems I could quite easily get used to it
20:18yogthosthe big advantage is that you can select code by expression, and move expressions around using shortcuts
20:18yogthosit's like playing with lego blocks ;)
20:18mattmossAnd once you learn M-x brew-coffee, everything is awesome.
20:18yogthosand if you're in a particular expression, you can just send it to the repl to evaluate
20:18yogthosand it will run it in the context of what's already running
20:18bizarrefishIt breaks my heart to say things like this, but: "my current machine could probably cope just fine with everything eclipse has to throw at it"
20:19bizarrefishI'll give it another go...after emacs
20:19yogthos:)
20:19bizarrefishyogthos: So, it's just like the elisp usage
20:19yogthosbizarrefish: precisely
20:20yogthosit makes it a lot easier to tell if your stuff works right, because you can just test functions as you write them
20:20yogthosmake something see it work, move to the next one
20:20yogthosyou never build up a bunch of code and then hope it all works together :)
20:20bizarrefishIt feels like with a homoiconic language like clojure, I should be able to do a certain amount of source editing programmatically.
20:20bizarrefishWould emacs allow me to say, 'walk' through my source code with an fn?
20:21yogthosemacs can do a lot of that :)
20:21yogthosyou can do that with macros too right from your code :)
20:21bizarrefishAnd maintain indentation? :O
20:21craigbrorecord macros
20:21yogthosclojure has a nice pprint too, which can format code
20:21zackzackzackLet's say that I want to start up a rexster server alongside ring, https://github.com/tinkerpop/rexster
20:22yogthosand afk here
20:22craigbrocomplex string replaces
20:22craigbrodocstring and fn param list reminders when you cursor over fns
20:22craigbrolookup docs at point
20:22craigbrosend some code to your repla and get the result
20:22zackzackzackWhat would the best way to do that? Currently, I'm wrapping rexster inside of a Thread and starting that up independently but ever once in a while the rexster server will stop responding.
20:23craigbroall that, and rainbow colored parenthesis
20:23amalloyugh, rainbow parens
20:24craigbrozackzackzack if rexster is stopping responding, I would say, you should put a try around the call that starts it up to catch any excpetions, and check your logs
20:24bizarrefishRighto, i'm sold on that :) I just had a play with pprint(another thing I didn't know was there), and it's pretty cool.
20:24craigbroif it's locking up, it prolly has nothing to do with ring
20:24amalloyeveryone is entitled to their own emacs setup, of course, but i discourage rainbow parens for someone who isn't already used to them; all they do is make you focus on the parens, when you should be focusing on indentation and ignoring parens
20:25technomancy(inc amalloy)
20:25lazybot⇒ 42
20:25ibdknoxI think that is highly subjective
20:27bizarrefishAlso, just like there is scriptjure to generate javascript, and lithium to generate machine code, is there anything which would generate something around the C kind of level? Seems like if you could write small, high performance programs in clojure that would be pretty sweet.
20:27zackzackzackcraigbro: I wonder, if errors are happening inside of a started Thread in clojure, then are they thrown to the main thread?
20:28amalloyi'm nothing if not subjective
20:28bizarrefishI imagine it would be backed by gcc and shared objects in implementation
20:29craigbrozackzackzack: I wouldn't count on it, there could be handlers anywhere in the call chain on that thread, and I would need more details, like your code, to answer more usefully
20:29bizarrefish(defcprogram (:int myfunc [:int a :int b] (+ a b))))
20:31bizarrefishWould also be sweet if you could marshal back and forth between clojure and those programs, transparently./
20:31hiredmanI really liked rainbox parens, but I had to turn them off because they were really slow for large clojure files (like core.clj)
20:32technomancyhiredman: that was before you started with paredit though, right?
20:32hiredmanthat was a few years ago, and I don't really remember what rainbox parens were like
20:32zackzackzackcraigbro: Good to know then. It all prints to stdout no matter the thread, but I'm just not sure about the errors. I haven't seen any errors on stdout yet, but it still hangs every once in a while.
20:32hiredmantechnomancy: no, that was with paredit
20:32ibdknoxlol
20:32ibdknoxwhat value is there in attacking preference?
20:33technomancyI feel like hiredman can take it
20:34ibdknoxhaha
20:34hiredmanuntrue, delicate flower, etc
20:34technomancybut seriously, encouraging newbies to pay more attention to parens can be unhelpful.
20:34ibdknoxI would argue it does the opposite
20:35tpopedumb put popular preferences also have a way of sneaking into the defaults
20:35ibdknoxthough again, I imagine that is very dependent on the person
20:35amalloyi used rainbow parens and paredit mode too. had the same problems with large files
20:35technomancysince they're already likely to be obsessing about parens more than they should be; they need to realize that the parens can just blend into the background and cause zero cognitive load
20:35ibdknoxuntil you need to see the scope of something
20:36craigbroI'm quite capable of perceiving multiple colors without losing my shit
20:36hiredmanyou may think that...
20:36ibdknoxheh
20:36ibdknoxwe did several studies on highlighting at MSFT
20:36amalloyclojurebot: craigbro is quite capable of perceiving multiple colors without losing his shit
20:37technomancyI'll grant it might be helpful if you don't have paredit turned on
20:37ibdknoxtrust me, there's no conclusive thing you can say here
20:37craigbrohehe
20:37amalloyhiredman: noooo, why isn't he learning my factoid?
20:37technomancybut "not using paredit" counts as "doing work in your head you could be offloading to the computer"
20:37hiredmanclojurebot: ping?
20:37bizarrefishRighto, it's my bedtime. Gotta goo. Thanks for the help doods :)
20:38craigbroyou know, I think in all my years of lisp hacking, I have used paredit for a month
20:38craigbroI like it, and I don't think I even know when rainbow parens are on
20:39craigbroI find paredit annoying at times, but learn to turn it off so I can fix it's confusion and then turn it back on
20:39hiredman,(+ 1 2)
20:39clojurebot3
20:39craigbrobut I went years without them, and I can't really say it makes as much difference to me
20:39amalloycraigbro: s/it's/my?
20:40craigbroamalloy: no, paredit shits the bed sometimes when using []s and cuttin' and pastering
20:41craigbroBTW< here is a screenshot of my emacs:
20:41craigbrohttp://raz.z0r.de/266
20:41craigbroto prove I can deal with colors
20:41amalloyif you cut and paste misbalanced expressions, yes
20:41craigbro(require 'bubble-bobble)
20:41amalloyepilepsy warning on that last link
20:41craigbroamalloy and sometimes I want to, cause I want just the last three args...
20:41technomancythat just means you're using non-paredit-aware operations
20:41craigbroyup
20:42craigbrotho the [] confusion is not me being non paredit
20:42technomancyI think that's due to an old version of paredit
20:42craigbrosweet, I'll upgradinate
20:44xeqitechnomancy, yogthos|away: thneed is coming from lein-jacker 0.2.0 in the luminus/lein-template 0.2.9 pom. If you update to lein-jacker 0.4.0 it'll stop
20:44amalloytbh i'm not sure how "the last three args" could ever cause you to wind up copy/pasting something unbalanced. surely you just type C-M-k three times, or C-3 C-M-k?
20:44xeqithough I'm surprised templates need dependencies
20:45technomancyclojurebot: thneed is coming from an old version of lein-jacker
20:45clojurebotc'est bon!
20:45technomancyI always forget
20:45craigbroamalloy, or doing what my emacs brain has done for the last decade, and C-k...
20:45amalloyC-k is bound to something sensible in paredit also
20:45technomancyit's C-w that will mess you up
20:45amalloy(and C-M-k doesn't come from paredit; emacs has had it built in for ages)
20:46xeqitechnomancy: yeah, for alot of people it'll be brought in even further up a chain by something like and old version of lein-ring
20:46technomancy(define-key 'paredit-mode-map (kbd "C-w") (lambda () (message "oh no you don't")))
20:46amalloytechnomancy: can i get a (keyboard-quit) in there so emacs looks mad at me?
20:46technomancyoh, also (interactively) in there
20:47xeqiyogthos|away: Y luminus NO HAVE tags in github?
20:47technomancyamalloy: (message "(╯°□°)╯︵ ┻━┻"))
20:48mattmossIs one preferable? (Double. "x") vs. (double (read-string "x")) ?
20:49hiredmanDouble/parseDouble
20:49ohpauleezmattmoss: You might just want to do parseDouble
20:50ohpauleezdamnit hiredman, c'mon - I was totally fielding that one haha
20:50mattmosslolz
20:50technomancyhiredman: at least with Integer the constructor is preferable since it's polymorphic
20:50technomancynot sure if Double is the same
20:51hiredmantechnomancy: no, if you are parsing you want parsing
20:51amalloyBigDecimal's constructor is polymorphic, which only leads to sadness
20:52amalloyalas, its static valueOf method is also polymorphic, but with only the wrong overloads intstead of the right ones
20:54mattmossThanks all.
20:54amalloyi agree with hiredman, though: if you know you have a string, Long/parseLong is definitely preferable to using the constructor
20:55craigbrohow does the poymorphic constructor make sad?
20:57amalloy&(java.math.BigDecimal. 0.33333333333333333333333333333)
20:57lazybot⇒ 0.333333333333333314829616256247390992939472198486328125M
20:57amalloy&(java.math.BigDecimal. "0.33333333333333333333333333333")
20:57lazybot⇒ 0.33333333333333333333333333333M
20:58mattmoss&(let [foo Double/parseDouble] (foo "3"))
20:58lazybotjava.lang.RuntimeException: Unable to find static field: parseDouble in class java.lang.Double
20:58amalloyif you make a bigdec out of a double, you've already lost
20:58mattmossIs there a way to get a "pointer" to a static class method?
20:58amalloylambdas, baby
20:58amalloy#(Double/parseDouble %)
20:58mattmossMan...
20:59mattmossWhy does my brain stop working after 5pm?
21:00ChongLiblood sugar
21:00mattmoss~brain
21:00clojurebotbrain dump is http://clj.thelastcitadel.com/clojurebot
21:01mattmossThat's a blank page, clojurebot.
21:03craigbroamalloy: ah, thanks
21:05craigbrowhat is current fave neo4j lib/wrapper?
21:08bbloomi need to write a library that provides a little database engine in a map
21:09bbloomi find myself regularly making maps that are essentially just indexes and reverse indexes
21:09bbloomand then i have to write this funny looking atom swap! functions to insert or remove from both indexes
21:09hiredmanbbloom: https://github.com/danlarkin/subrosa/blob/master/src/subrosa/database.clj
21:09hiredmanbbloom: or look at clojure.set
21:09craigbrobbloom: https://github.com/threatgrid/pldb
21:09craigbrouse core.logic 8)
21:09bbloomheh, i'm glad i asked :-P
21:10hiredmanhttp://richhickey.github.com/clojure/clojure.set-api.html#clojure.set/index http://richhickey.github.com/clojure/clojure.set-api.html#clojure.set/project etc
21:10lazybotNooooo, that's so out of date! Please see instead http://clojure.github.com/clojure/clojure.set-api.html#clojure.set/project and try to stop linking to rich's repo.
21:11hiredmanI ran in to https://gist.github.com/3181018 today too
21:11hiredman(speaking of core.logic and databases)
21:12ohpauleezyeah, I saw that last week or so
21:12ohpauleezdefinitely a cool idea
21:12craigbrooh wow
21:13bbloomim gonna hand roll this case b/c i have 1 insertion path and 2 deletion paths & the asymmetry is subtle :-/
21:13dnolenneat
21:33yogthosxeqi: didn't seem like it was necessary yet :)
21:34yogthosxeqi: there's much of value in using the older versions of the template
21:38TimMcHmm, how do I build Leiningen from checkout so I can test out modifications?
21:40TimMcCONTRIBUTING.md seems to indicate that I should be able to simply run the bin/lein in the checkout, but that fails.
21:52technomancyTimMc: did you do `lein1 install` inside leiningen-core?
21:53xeqiyogthos: ah, I was gonna use it to look at what made up the 0.2.9 release. if master is the development branch it requires going back through history to find that (and hope you can tell if releases wer just before or after a version bump)
21:54yogthosxeqi: yeah it makes archeology a bit tricky :)
21:54xeqithats a good word there
21:54yogthosxeqi: the only major change recently was to use ring server and get rid of run-jetty, otherwise I've been mainly adding new options
21:56TimMctechnomancy: Hmm, I think I must have been in the project root.
21:56TimMcRead-o.
22:04TimMctechnomancy: I'd like to do some cleanup in leiningen/new/templates.clj -- aside from deprecation and renaming of defns, can this piggyback on existing work in that ns?
22:10hadronzooI'd like to use EDN for serialization from within ClojureScript. Do I have to use shaunxcode/jsedn, or is there an existing ClojureScript package?
22:13xeqihadronzoo: pr-str ?
22:13xeqias in the function
22:13hadronzooxeqi: How would one deserialize from within ClojureScript?
22:14xeqicljs.reader/read-string
22:14xeqiat least thats what fetch uses
22:14xeqihttps://github.com/ibdknox/fetch/blob/master/src/fetch/remotes.cljs
22:14hadronzooxeqi: Wow, that's much simpler than I was expecting. Thank you.
22:15TimMcEDN is just a fancy name for Clojure (de)serialization.
22:15TimMcI don't know why it exists.
22:16TimMcSomething to do with Datomic, I guess?
22:16hadronzooTimMc: I suppose it makes sense to document the format so other languages can consume Clojure services
22:26TimMc$latest jkkramer/loom
22:26lazybot[jkkramer/loom "0.2.0"] -- https://clojars.org/jkkramer/loom
22:35seangrove$latest shoreleave-browser
22:35lazybotNo project by this name exists on clojars.
23:16babycljhi guys, thought I need someone here to "pimp" my code -- very newbie here :-)
23:16babycljsrc is here https://github.com/seymores/twitter-stats/blob/master/src/twitter_stats/core.clj
23:17akhudekone thing you can do is try running kibit on it https://github.com/jonase/kibit/
23:18technomancyTimMc: not sure which existing work you're referring to, but I'm planning on cutting a release in a matter of days, so probably best not to move anything unless it's private
23:19TimMcI figured it was either a really bad or really good time to rename stuff.
23:19technomancyheh
23:19akhudekbabyclj: also, you want to use if for things that return things and when for mutable things that do not return values
23:19TimMcI was just getting really annoyed at the name of leiningen.new.templates/sanitize
23:19technomancybabyclj: could we maybe find another metaphor that doesn't mean taking a cut of your code's sex work earnings in exchange for protection?
23:19akhudekor rather, when is for things with side effects
23:19technomancykthx
23:20babycljlol
23:20babycljakhudek: hmm yes
23:20babycljah kibit looks awesome
23:20technomancyTimMc: pretty sure there are extant templates that would break from that; probably not the right timing
23:21TimMcWhen would the right timing be? :-)
23:23technomancywe could move it and put a (def ^{:doc "..."} sanitize newname) alias in its place
23:24technomancybut we can't get rid of sanitize until 3.0
23:24technomancyon the bright side, I have concrete plans for 3.0 happening sooner than the 1->2 gap
23:24TimMcNice.
23:28xumingmingvanyone have preety emacs color theme to recommand? I know color-theme-soloarized, but it has issue supporting chinese gbk files.
23:29TimMchyPiRion: This is executable "normal" Clojure that should be compilable into swearjure: https://www.refheap.com/paste/8777
23:32infiniteoneanyone using nrepl and emacs ????
23:33infiniteoneif so i have a question ???
23:33lazybotinfiniteone: How could that be wrong?
23:33infiniteonenot wrong
23:34infiniteonelooking for a best method to deal with the stack trace which pops up
23:35infiniteoneFigured maybe someone in the clojure community had a way of dealing with this
23:36TimMcA bunch of people use Emacs and nREPL. (I don't.) What's the behavior that is problematic?
23:37xumingmingvwhat will lazybot answer a question even if you didnt ask him?
23:38infiniteonewhen I get a error I get a stack trace which opens another buffer and would like my cursor to automatically jump to the stack trace so that I can easily q quit the buffer
23:39infiniteonesomething I would get in slime, but my slime clojure-jack-in is broken :-(
23:40xumingmingvlazybot: what will you answer a question even if you didnt ask him?
23:40lazybotIt's AWWWW RIGHT!
23:40xumingmingvlazybot: what will you answer a question even if I didnt ask you?
23:40lazybotIt's AWWWW RIGHT!
23:41xumingmingvlazybot: ok, you are brilliant
23:48xeqiinfiniteone: it used to do that and people requested it stop. I think theres some customization that can be done to make it come back but I haven't tried to find it
23:48xeqihttps://github.com/kingtim/nrepl.el/issues/110
23:50ivaninfiniteone: you can just make that buffer not appear