#clojure log - Jan 18 2013

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

0:24 handojin: quiet

0:24 quiet

0:25 cemerick: luminus?

0:25 luminus?

0:25 handojin: ?

0:25 cemerick: What is luminus?

0:25 handojin: lein new luminus <projectname>

0:25 replaces noir

0:26 http://www.luminusweb.net/docs

0:29 it was a bad question - i just started the server from the shell in ~home/workspace/<project>

0:31 bbloom: any easy way to get the stack trace of an exception that happened on a non-repl tread?

0:31 thread*

0:41 handojin: @cemerick - friend looks really nice - thanks!

0:42 cemerick: oh, right (re: luminus)

0:42 handojin: you're welcome...though probably best to thank me after you have it working :-)

0:42 bbloom: if you can get a reference to the exception :-P

0:43 bbloom: cemerick: i assume that :-P face means there isn't an easy way to do that? heh

0:43 try/catch/(def omgwtfbbq e) ?

0:44 cemerick: bbloom: That's certainly one way. Is the exception going entirely uncaught right now?

0:44 bbloom: cemerick: it was more of a hypothetical question, since the problem occurred in a pure function

0:44 djwonk: luminous, would you say that I have a plethora of pinatas?

0:44 from the site: "Have access to the plethora of existing Clojure and Java libraries"

0:44 bbloom: i just printed out the inputs, copy pasted them into a buffer, and ran the function in isolation

0:44 * bbloom pats self on back

0:45 bbloom: for 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

0:45 math functions seem to hate stack traces

0:46 cemerick: bbloom: well, there's a couple of janky things you can do to backstop uncaught exceptions

0:46 (1) http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html#setDefaultUncaughtExceptionHandler%28java.lang.Thread.UncaughtExceptionHandler%29

0:46 and the higher-level (2) http://docs.oracle.com/javase/6/docs/api/java/lang/ThreadGroup.html#uncaughtException%28java.lang.Thread,%20java.lang.Throwable%29

0:47 bbloom: hmmm... would it be exceedingly janky for nrepl & friends to do that for me? :-)

0:47 cemerick: The most common problem is that the exceptions you're interested in are *already* being caught, just by code you don't control

0:47 bbloom: yes :-)

0:48 Although you could readily sling together an nREPL middleware that could do useful things, like push successive exceptions into a stack, thus providing history

0:48 bbloom: my kingdom for a restart!

0:49 luxbock: what is the difference between let and let*?

0:49 cemerick: oh, well, there's at least 2 or 3 restart libs for Clojure

0:49 bbloom: cemerick: that work with arbitrary exceptions that i didn't throw?

0:50 cemerick: bbloom: sure, but that's not really the problem, is it?

0:50 it's the exceptions you don't catch that you want to get at

0:50 bbloom: *shrug* i'm just getting spoiled by how nicely some things work: nrepl, lein, etc... i want my debugging cake too :-)

0:51 i 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 :-)

0:52 cemerick: bbloom: oooh, you want break-on-exception in a debugger

0:52 handojin: @djwonk - is russlish maybe? more horrorshow than nadsat anyway

0:52 bbloom: and i want it to Just Work (tm)

0:53 cemerick: bbloom: I used it in ccw just today. 'tworks just fine. :-)

0:53 bbloom: is that via ritz ?

0:53 cemerick: Ritz has break-on-exception as well AFAIK

0:53 bbloom: bah. why is this not in `lein repl?`

0:53 `?

0:53 cemerick: no, ccw just usess Eclipse's debugger

0:53 bbloom: oh

0:53 boo

0:54 cemerick: hah

0:54 I thought you wanted it to Just Work™? :-P

0:54 bbloom: And Use Less RAM (R)

0:54 and VIM (C)

0:54 cemerick: gtfo with your netbook ;-)

0:54 djwonk: handojin: ?… I was laughing at the 'plethora' use -- reminds me of Three Amigos

0:54 bbloom: heh, i'm on a mbp

0:55 cemerick: I run Eclipse with 512 heap FWIW.

0:55 Ritz isn't going to be much more lightweight, since there's 3 JVMs.

0:55 handojin: teh RAM be cheap these days

0:56 cemerick: Though I appreciate that some people inexplicably prefer textmode stuffs.

0:56 bbloom: i don't just write clojure

0:56 xeqi: I've gotten ritz's break-on-exception to work on the repl thread

0:56 bbloom: i need one text editor that keeps me sane across the board

0:56 xeqi: never tried in another one

0:57 cemerick: sure, I use vim for everything but clojure

0:58 bbloom: i'd rather vim than a debugger :-P

0:58 cemerick: xeqi: you should be able to do it for all threads in the vm

0:58 bbloom: i also prefer command line debuggers anyway

0:58 xeqi: cemerick: yeah, I'd expect it to owrk

0:59 cemerick: bbloom: well, just bring up jdebug only when you need it

0:59 sorry, jvisualvm

1:12 bbloom: ibdknox: i'm github stalking ppl lately... saw you forked dommy. is template speed an issue at all for you?

1:35 handojin: anybody working with datomic?

1:46 holo: hi

1:47 in korma, any way to increment a value without making two queries?

2:18 syrinx_: i think i might be in love with noir

2:25 bbloom: i think i'm in love with writing functions that concatenate a sequence of side effects to be evaluated later

2:26 syrinx_: :D

2:36 alex_baranosky: bbloom: yes! hallelujah, yes

2:36 holo: don't think there is, no

3:00 cbp`: anyone here using emacs live

3:00 i keep getting segmentation faults :/

3:02 tomoj: &((juxt #(do %& %1) (fn [& args] (nth args 1))) 1 2 3)

3:02 lazybot: ⇒ [1 2]

3:02 tomoj: hmmm

3:07 bbloom: ,(#(-> %&) 1 2 3)

3:07 clojurebot: (1 2 3)

3:07 bbloom: heh, what-ya know... i had no idea %& was a thing

3:07 AtKaaZ: what am I doing wrong here: https://gist.github.com/4563026

3:08 bbloom: ,(macroexpand '#(-> [%1 %2 %&]))

3:08 clojurebot: (fn* [p1__56# p2__57# & rest__58#] (-> [p1__56# p2__57# rest__58#]))

3:09 bbloom: AtKaaZ: call deref on var

3:09 v.deref()

3:09 you want the current value of that var

3:09 AtKaaZ: oh very nice, thank you!

3:10 interesting, so in clojure when the symbol for that var is encountered a deref is done

3:13 alex_baranosky: bbloom: 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

3:14 bbloom: alex_baranosky: yup. i'm taking it to a tad of an extreme though :-)

3:15 alex_baranosky: https://www.refheap.com/paste/8737

3:15 alex_baranosky: I hate side-effects, I wonder how extreme is too extreme. Now you have me curious

3:15 bbloom: that's a really simple example

3:15 the dom/ namespace contains a bunch of factjor words

3:16 notice how it recurses and creates children stuff before wrapping the create-element and append

3:16 alex_baranosky: not sure that's so extreme

3:16 bbloom: if those were normal side effects, i'd be forced to use doseq and put the children order in the middle

3:17 well, it's extreme because i implemented a conatenative language interpreter to be able to do this :-)

3:17 haha

3:17 alex_baranosky: yep; that's where you went over the limit

3:17 hehe

3:18 interesting though… so you are using the sequence as a way to also add on the parameters?

3:18 I would have tended to use currying or partials for that

3:18 bbloom: the words in factjor are applicable & they do right-currying

3:19 so these two things are equiv: ["the-rect" element-by-id :fill "red" set-attribute]

3:19 and: [(get-by-id "the-rect") (set-attribute :fill "red")]

3:19 AtKaaZ: ,(#(%&_) 1 2 3)

3:19 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalStateException: arg literal must be %, %& or %integer>

3:20 AtKaaZ: ,(#(%_%&) 1 2 3)

3:20 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalStateException: arg literal must be %, %& or %integer>

3:20 AtKaaZ: ,(#(%_&) 1 2 3)

3:20 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalStateException: arg literal must be %, %& or %integer>

3:20 AtKaaZ: ,*clojure-version*

3:20 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}

3:20 alex_baranosky: right, 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?

3:21 bbloom: alex_baranosky: to some extent

3:21 nonuby: can 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

3:21 bbloom: set-attribute needs an element to operate on

3:21 so really it would be: [#(set-attribute (get-by-id "the-rect") :fill "red")]

3:22 alex_baranosky: see the "stack effects" defined here: https://www.refheap.com/paste/8739

3:22 notice how all the operations leave elements on the stack

3:22 AtKaaZ: ah ofc I typoed: &(#(#_%&) 1 2 3)

3:22 alex_baranosky: bbloom: the idea is one worth pushing, we're moving our current design at work toward this kind of thing

3:22 bbloom: there's also a cat/ namespace for generic concatenative operators

3:22 like cat/each

3:22 AtKaaZ: ,(#(#_%&) 1 2 3)

3:22 clojurebot: ()

3:22 bbloom: so you could do [(elements-with-tag "div") [cat/prn] cat/each]

3:23 and that would print out each div on the page

3:23 :-)

3:23 the result is a jquery-like api.... it's like threading macros on steroids!

3:24 alex_baranosky: on 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

3:24 bbloom: alex_baranosky: i'm working on a solution to that too :-)

3:24 alex_baranosky: bbloom: so is this part of the API of your library?

3:24 bbloom: alex_baranosky: yeah

3:25 alex_baranosky: i'm gonna make a polymorphic method to take a factjor program and return it in literal form

3:25 alex_baranosky: neat stuff. the more you can see your IO effects as data the better, imho

3:25 bbloom: alex_baranosky: which will be useful for serializing programs and sending them across the wire

3:25 Raynes: alex_baranosky: Did you ever get your IRC client stuff sorted?

3:25 I guess you forgot the znc creds

3:26 juxovec: what is the best Clojure book?

3:26 alex_baranosky: Raynes: hey dude, I have been so dan busy with everything I back-burnered it. Linkinus mysteriously stopped being buggy for now

3:26 juxovec: read them all :P

3:26 AtKaaZ: ,(= '() (#__) (list))

3:26 clojurebot: true

3:26 Raynes: juxovec: Clojure Programming is a good one.

3:26 alex_baranosky: yeah I like the O'Reailly one

3:26 AtKaaZ: ,#__

3:26 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

3:26 juxovec: Raynes: this one? http://www.clojurebook.com/

3:27 Raynes: Yes.

3:27 juxovec: thanks

3:34 bbloom: i 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

3:34 the manual hacky repetitive bounds checks make me cringe :-P

3:49 augustl: anyone here successfully used korma + clojure.java.jdbc to work with an in-memory h2 database?

3:57 there 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

3:58 and korma works with their encapsulation, while clojure.java.jdbc works with the raw connections.

3:59 ebaxt: augustl: I assume you are aware that the connection string affects the mode? http://www.h2database.com/html/features.html#connection_modes

3:59 ?

4:01 tomoj: :( https://www.refheap.com/paste/882fea4675b8b7dc8fc4e9d99

4:01 oh, #(-> %1) is very cute

4:03 borkdude: tomoj ah yes, that's nice

4:04 augustl: ebaxt: yeah, I'm using "jdbc:h2:mem:"

4:04 pisketti: tomoj: mmmm, when would you use/need that? (pardon my ignorance)

4:05 borkdude: pisketti same as (fn [x] x)

4:05 tomoj: which is better written `identity`

4:05 pisketti: how about identity?

4:05 :)

4:05 tomoj: but I see #(-> %2) or #(-> %3)... occasionally

4:05 also #(-> [%1 %2]) oslt

4:06 I mean I've never seen it written that way — I've seen equivalent functions

4:06 borkdude: pisketti yolo

4:06 augustl: seems 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

4:07 tomoj: it's too bad clojure.core.reducers doesn't expose its gerundives

4:07 ebaxt: augustl: Can't you just name the in-memory db so you can use multiple connections? jdbc:h2:mem:foo?

4:08 augustl: ebaxt: then I need to make sure I kill it though, was hoping to avoid that

4:09 then again, the fact I'm passing a connection to my API is not very good anyway.. Implementing connection pooling later would suck

4:14 feels a bit like I'm a pioneer by wanting to use in-memory h2 for my tests :)

4:23 xificurC: does 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"

4:26 AtKaaZ: I'm on windows but I don't know what you mean

4:27 xificurC: http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started#Create_clj_Script

4:28 AtKaaZ: the batch is for very old clojure 1.2.0 which had contrib, you could try using leiningen instead

4:39 clgv: xificurC: better use leiningen 2.0 - it has a much better REPL built-in

4:44 augustl: Korma 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?

4:49 seems that Clojure isn't a good fit for talking to SQL databases

4:50 xificurC: clgv: I wanted to be able to run clj files from the command prompt, not opening the repl. Or am I not understanding you correctly?

4:52 clgv: xificurC: ah ok.

5:08 alex_baranosky: august1: Korma really returns whatever java.jdbc returns

5:09 that'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

5:10 augustl: alex_baranosky: yeah I just noticed, tried raw jdbc, same thing

5:10 alex_baranosky: so we should update the Korma docs

5:10 augustl: alex_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

5:10 alex_baranosky: not 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

5:10 augustl: just got lots of errors I didn't get on H2 when switching to MySQL

5:11 so then at least I can write db specific hacks :)

5:12 alex_baranosky: db 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

5:13 augustl: are there any general approaches to doing db reset between tests for jdbc/mysql?

5:13 alex_baranosky: augustl: specifically which errors are you seeing? are you setting your delimiters to "`"? I need that for MySQL

5:13 augustl: alex_baranosky: I got an error when inserting a date as a string, h2 accepted it but mysql barfed

5:13 alex_baranosky: augustl: not sure, but I like th idea of using an in memory db

5:14 oh, I see. I guess its best to stick to the most standard approaches you can find

5:14 augustl: alex_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

5:14 alex_baranosky: have you tried SQLLite?

5:15 augustl: no, but the fact that mysql and h2 behaved differently made me decide not to use in-memory for tests..

5:15 alex_baranosky: you could preparse inputs into Timestamps if running in test…. but that kinda stinks

5:16 I think the approach has a lot of merit, esp if you have a lot of tests that want to hit the DB

5:18 augustl: I want my tests to be correct, not fast :)

5:18 ebaxt: augustl: Have you tried setting compatibility mode in H2? jdbc:h2:~/test;MODE=MySQL

5:19 augustl: hmm, seems clojure.java.jdbc doesn't support dropping databases

5:20 alex_baranosky: ebaxt: nice one

5:20 augustl: ebaxt: 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

5:22 ebaxt: augustl: 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 :)

5:25 augustl: ebaxt: I suppose money would be an issue in that case :)

5:25 using Oracle as the database when running the tests, that is

5:27 I'll just do a full drop, create and load schema for every test. And switch to h2 if it gets too slow

5:28 alex_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

5:29 alex_baranosky: Korma does no magic. It aims to just be a way to turn sexps into SQL queries

5:29 augustl: I see

5:38 ejackson: augustl: are you using anything clever for the schemas ?

5:39 augustl: ejackson: no, it's pretty basic stuff

5:40 ejackson: Just wondering :)

5:41 augustl: ejackson: it's just DROP DATABASE IF EXISTS, CREATE DATABASE, and the create table stuff in clojure.java.jdbc

5:42 ejackson: ok, 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 ;)

5:58 AWizzArd: currently nrepl.el shows me the buffer *nrepl-connection*. This is of no use for me — how can I have emacs hide it from me?

5:59 Ah okay, found it.

6:38 augustl: is 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?

6:41 or: how do I return all rows for a SELECT with clojure.java.jdbc

6:42 "doall" seems to work

6:44 ska2342: can someone tell me how to pursuade maven to run just the tests for one namespace in the clojure project itself?

7:22 augustl: anyone here used a data validation library other than the clojurewerkz one?

8:08 Bodil: augustl: Does core.logic count? :)

8:25 bozhidar: Hey, 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

8:34 hyPiRion: bozhidar: I've always wondered about "Limit the use of commas in collection literals."

8:36 A 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.

8:36 bozhidar: hyPiRion: personally I have nothing against them, but several people commented that their use was considered bad style, therefore that particular rule

8:36 hyPiRion: I can see it when you have a map with keywords as keys and non-keywords as values though.

8:37 loliveira: bozhidar: i liked.

8:37 bozhidar: hyPiRion: I don't imagine someone has to deal with such map that often :-)

8:37 maps*

8:39 hyPiRion: bozhidar: An extreme example, I know. It's just that I find commas at times useful for grouping key-value pairs

8:39 Bodil: bozhidar: I don't use commas in map literals myself, but that rule is a bit odd given that Clojure itself serialises them with commas.

8:42 bozhidar: hyPiRion Bodil: It's not me that you need to convince, I'm generally with you on this one

8:43 stain_: bozhidar: yes, there should be counterexamples for when commas are good

8:44 hyPiRion: bozhidar: Argh, and I was here hoping for a fight. Oh well.

8:44 cmdrdats: bozhidar: nice work on the style guide, i like it :)

8:44 hyPiRion: I'll possibly voice my concerns later on.

8:44 bozhidar: Here'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)

8:44 hyPiRion: /s/concerns/views/

8:44 stain_: "Start every namespace with a comprehensive ns" should probably say the preferred order

8:44 mpenet: indentation or commas, pick your choice

8:45 bozhidar: stain_: good point

8:45 mpenet: at least for maps, for the other DS I dont bother

8:46 stain_: bozhidar: but lots of good stuff in there, mate/lass!

8:46 bozhidar: stain_: Could you please open a ticket about this so I won't forget to add it?

8:47 stain_: mate :-) Bozhidar is an obscure male name in the Cyrillic parts of the world (like the infamous Eastern Europe)

8:47 clgv: bozhidar: why are commas in maps bad? they really help if you have a lot of kv-pairs

8:48 stain_: 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"

8:48 bozhidar: I kind of guessed it would be.. like Baltazar

8:48 ah man.. tickets! This is too much!

8:48 ChongLi: isn't there some point where your map literal grows too large to reasonably keep in your source file?

8:49 perhaps then it can have commas when it's serialized to another file

8:50 bozhidar: ChongLi: As Bodil already mentioned maps are serialized with commas anyways

8:51 ChongLi: yeah so that seems like a reasonable guideline

8:51 bozhidar: ChongLi: I guess so

8:52 ChongLi: though I guess those commas might use more bandwidth on the wire

8:52 stain_: bozhidar: Naming should discourage overlapping of clojure.core except for specialized reimplementations

8:52 ChongLi: which is kind of silly

8:53 bozhidar: stain_: Why so? After all we do have namespaces in Clojure and we all know that the use of use is bad :-)

8:55 stain_: bozhidar: where does it say..? :)

8:56 ChongLi: bozhidar: it is a style guide, after all

8:56 do not take anything for granted

8:56 the reader may be completely new

8:56 stain_: bozhidar: I meant also that you should try not to make a function argument called 'map'

8:57 bozhidar: stain_: ah, now I see. I'll add something on the subject.

8:57 stain_: 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

8:58 bozhidar: ChongLi: Indeed. At some point I plan to add a bit of rationale behind some of the advices (especial the more obscure ones)

8:59 stain_: sounds good to me

9:02 stain_: 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))

9:02 but I don't know if that is the standard

9:02 perhaps the last one should be (the-dict (:name the-request))

9:03 no need for get there either unless it's being used in a higher-level function

9:04 bozhidar: (:key map) is the idiomatic way to get an element out of a map; of that I'm certain

9:04 stain_: so that should be in

9:04 bozhidar: indeed

9:04 stain_: and the exceptions would be where you are doing some functional magic or have other kind of keys

9:08 iamedu: Hi! I'm looking for some help... with jdbc and the jvm... this roughly explains my problem... http://eugeneciurana.com/pastebin/pastebin.php?show=45650

9:18 zby: I've decided to tryout clojure - can I get some help here? https://gist.github.com/4564733 - why it is not looking into 'src'?

9:19 I followed the README from https://github.com/ring-clojure/ring/wiki/Getting-Started

9:19 aperiodic: zby: your syntax is incorrect. it should be (use 'login_app.core)

9:19 zby: ah

9:19 aperiodic: zby: note there's only one quotation mark

9:20 zby: I see it now

9:24 thaks a lot!

9:26 aperiodic: you're welcome!

9:29 amalloy: also should be login-app, not login_app

9:31 stain_: 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

9:34 zby: yeah - that one I found myself :)

9:40 amalloy: huh! i didn't realize that ##(let [stuff (fn [])] stuff) caused the function's classname to include "stuff"; i thought only (fn stuff []) did that

9:40 lazybot: ⇒ #<sandbox47486$eval79130$stuff__79131 sandbox47486$eval79130$stuff__79131@144cbe2>

10:26 augustl: been failing for a while now to implement this: https://www.refheap.com/paste/8744 any suggestions?

10:26 a nested filter, so to speak

10:26 djcoin_: 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:28 joegallo: if 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:28 leiningen does a fair amount of that stuff, you can look at what phil does there

10:29 chouser: djcoin_: for your development cycle, or some other context?

10:29 S11001001: augustl: it's a map, where the f you give to map uses filter

10:29 augustl: S11001001: ah, I've only used filter

10:30 djcoin_: 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:31 augustl: S11001001: btw, the nesting can be infinitely deep.. Guess that doesn't help? :)

10:32 chouser: yeah, 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:32 S11001001: augustl: then keep mapping until the structure is the right one for filter

10:32 augustl: S11001001: so a recursive map should work?

10:32 S11001001: augustl: yes

10:38 djcoin_: chouser: any hints for a vim user ?

10:39 chouser: djcoin_: I haven't tried it yet, but I've heard this is the new hotness: https://github.com/tpope/vim-foreplay

10:39 progo: I don't understand what's bad about VimClojure

10:40 ChongLi: ahh, this is interesting

10:40 if only I could get vim back into my head

10:40 it's so confusing switching back and forth between emacs and vim

10:41 chouser: ChongLi: I recommend evil in emacs. That's what I use.

10:41 ChongLi: oh yeah?

10:41 I tried a few of the other modes and they were kinda janky

10:41 progo: evil made me convert as well

10:42 ChongLi: what's better about evil?

10:42 progo: it's done very well indeed

10:42 ChongLi: I'm so damn used to emacs default keybindings

10:42 does evil strictly add to those?

10:42 chouser: ChongLi: yes, the other modes generally try to provide vi bindings. evil provides vim bindings.

10:43 ChongLi: do all of the vim modes work? rectangular visual etc?

10:43 chouser: yes

10:43 ChongLi: hmmm

10:43 I'll definitely give it a try then

10:43 chouser: and it keeps getting better, pretty rapidly

10:44 ChongLi: and it meshes well with emacs plugins like paredit?

10:44 or is insert mode just regular emacs?

10:44 progo: insert mode maps to emacs mode, but there is also an "Emacs mode"

10:45 chouser: It'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:45 ChongLi: that's pretty crazy

10:46 chouser: ChongLi: 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:46 progo: btw, 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:47 chouser: like in org mode I usually stay in insert mode and type \<tab> to expand things

10:47 ChongLi: C-z? I thought that'd be a SIGSTP

10:47 suspending the process

10:47 progo: chouser, ChongLi: oh but evil provides decent support for appending to org-mode-map-{normal,insert,etc}

10:48 it's manual tinkering, yes. But you can go very vim in these most emacs of modes.

10:48 ChongLi: it's amazing how deep the rabbit hole goes

10:49 maleghast: I gave up and started to learn emacs

10:49 ChongLi: I learned emacs as well

10:49 the main reason I'd be interested in this is for vim's useful command grammar

10:49 which is something I've always missed

10:50 maleghast: Fair enough - I don't even know what you're referring to.

10:50 (not kidding or judging, I am not that über when it comes to vim or emacs ;-) )

10:51 ChongLi: emacs's strength has always been in domain-specific programs (major modes)

10:51 maleghast: vim uses a simple grammer of single letter commands and modifiers

10:51 such as c10w (change 10 words)

10:51 maleghast: Indeed

10:51 I like those commands

10:52 ChongLi: it's very powerful and composable

10:52 especially when you get into text objects and such

10:52 progo: Try evil. You'll be surprised how close to real thing it can be.

10:53 maleghast: Oh I agree, I've just never got more than "head in" in terms of the rabbit hole.

10:53 ChongLi: the idea of using evil to extend emacs to this crazy hybrid

10:53 maleghast: I tried eVil mode - it just confused me wrt learning emacs.

10:53 ChongLi: yeah I think it's probably best saved for after you've become comfortable in emacs

10:56 maleghast: *nods*

10:56 ChongLi: so much to learn - so little time

10:56 I'm trying to learn webgl by implementing this tutorial stuff in clojurescript

10:57 it's pretty ugly transcribing the javascript directly into interop forms

10:57 later on I'll have to build some library to abstract that away

10:58 muhoo: progo: package-list-packages, install nrepl-mode, install leiningen per the instructions, then read the nrepl docs, i guess

10:58 ChongLi: are there any good FRP libs for clojurescript?

10:58 maleghast: FRP?

10:58 ChongLi: anyone trying anything there?

10:58 functional reactive programming

10:58 piranha: ChongLi: flapjax :)) there is shafty, but it's not completed yet

10:58 muhoo: foberglass reinforced plastic

10:59 piranha: https://github.com/cmeiklejohn/shafty

10:59 ChongLi: anyone here looked at Elm?

10:59 progo: muhoo: I'll check nrepl, thanks.

11:00 amalloy: clojurebot: FRP is functional reactive programming, or maybe fiberglass reinforced plastic

11:00 clojurebot: In Ordnung

11:00 piranha: ChongLi: I tried

11:00 but without much success, I don't know Haskell and tutorial isn't good enough

11:00 it just says: put this code in your file and you'll get something

11:00 ChongLi: elm seems really nice but it's incomplete

11:00 piranha: and then 5 lines of code

11:01 yeah, and examples are surely lacking, etc

11:01 ChongLi: yeah it's basically a one man project

11:01 the guy wrote the language as part of his thesis I believe

11:01 piranha: yep

11:02 I'm trying to get up and running with flapjax, but not finished yet

11:02 ChongLi: I really like the simple syntax elm uses for lifting an ordinary function into one that acts on reactive values

11:02 http://elm-lang.org/edit/examples/Reactive/Position.elm

11:03 this example, in particular, just seems so elegant

11:03 piranha: oh

11:03 ChongLi: asText is just a function that returns strings

11:04 and <~ is an infix function that lifts the first function into a function on reactive values

11:04 and Mouse.position is a source of reactive values

11:04 an event

11:05 I guess it's called a signal in Elm

11:05 so (<~) :: (a -> b) -> Signal a -> Signal b

11:05 piranha: ChongLi: behavior

11:06 <~ is an alias for lift, it seems, no?

11:06 ChongLi: it is

11:06 piranha: ah, yes, signal in elm, and behavior in flapjax

11:09 ChongLi: I like this flapjax demo

11:10 http://alandipert.github.com/flapjax-demo/

11:10 main.js is 708KB

11:10 haha

11:10 piranha: well it's not minified

11:10 ChongLi: yeah

11:10 muhoo: with advanced compilation?

11:11 ChongLi: no it's in full whitespace-preserving mode

11:11 pretty printed

11:11 and huge amounts of dead code

11:12 how many people are working on/with cljs?

11:13 it still seems like very early days

11:13 I really love the language though so I want to see it succeed

11:13 muhoo: lots,but yes its early

11:13 * nDuff has cljs code in "production" (internal tooling, but _important_ internal tooling)

11:13 muhoo: dive in and help. source maps would be nice

11:15 ChongLi: this seems to be a big thing in general with minified stuff

11:16 it's like symbol tables all over again

11:16 javascript really is becoming the "assembly language of the web"

11:18 systemfault: Normal... JS itself sucks

11:18 ChongLi: yeah, that's obvious enough to everyone I think

11:19 but instead of fixing it we introduce all these workarounds that serve to further ingrain the language

11:20 muhoo: i think of technology as immutable

11:20 ChongLi: well in that case

11:21 we're holding onto these old references and stopping the GC from doing its job!

11:21 or I guess you could say the browsers are doing that

11:21 (the installed base of browsers)

11:22 muhoo: if you're on an intel cpu running unix,that gc is 30 years late.but so what, it works

11:23 ChongLi: it could be better

11:24 there's always going to be some frontier where all the innovation happens

11:24 but if it has to be built upon enough layers of legacy cruft, innovation slows

11:43 systemfault: So 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:44 Bodil: ChongLi: There are many credible efforts to fix JS, but with that kind of legacy code base, don't expect it to happen overnight...

11:44 S11001001: systemfault: no

11:47 progo: nrepl-mode <3

11:47 scottj: systemfault: "must-be seen" as in "really good" or "have info essential for writing Clojure"?

11:47 systemfault: As in "I want to learn clojure and want enlightening videos about it"

11:48 progo: this really motivates me to upgrade old lein1 projects with great haste

11:49 scottj: systemfault: 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:49 systemfault: Noted :) Thanks

11:50 I loved the clojure for java programmers talk... but didn't like those on datastructure as most of it was obvious :/

11:51 algernon: hammock driven development is pure gold too, altough it is completely language agnostic

11:51 systemfault: I thought it was a philosophical talk (Nothing technical)

11:53 matthavener: systemfault: is that talk available online somewhere?

11:53 pbostrom: kovas: I checked out session, it looks nice, I especially like your editor w/ paredit, I might have to steal that :)

11:53 systemfault: matthavener: Rick's? Look for clojuretv, they're all there

11:54 http://www.youtube.com/user/ClojureTV

11:55 algernon: systemfault: it is, yes. still worth watching, imo.

11:56 matthavener: systemfault: thanks

11:58 scottj: systemfault: there's tons of good stuff at http://www.infoq.com/author/Rich-Hickey

12:01 augustl: maybe 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:03 I 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:04 what I actually need to do: create an error message object, like {:email ["is taken"]}, based on that exception

12:04 maleghast: Have you thought about using (try …) ?

12:05 augustl: I 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:05 maleghast: Oh I see, sorry.

12:06 augustl: can't find much on google

12:06 maleghast: No, I bet..

12:06 augustl: and matching on the message seems very unsafe..

12:06 but I would assume that this is something people do a lot

12:06 maleghast: Yeah, I reckon you're right...

12:06 augustl: apparently not..

12:07 maleghast: I haven't tried it (yet), but have you looked at sqlkorma?

12:07 It might have a useful way to handle it.

12:08 augustl: not as far as I can tell

12:09 it's mostly a SQL DSL in Clojure and some connection management, it leaves the dirty stuff to the jdbc stack

12:09 maleghast: Oh right

12:10 augustl: someone suggested INSERT IGNORE, but that doesn't seem to help either

12:10 that means it's just, well, ignored. No insert, no exception

12:10 then there's table locking..

12:12 ah nice, the format of the error message is public, and associated with an error code

12:12 maleghast: Hmmm - it's an interesting problem… I have to run - conference call (yes at 1700h on a Friday *headdesk*) good luck with it!

12:23 amouat: Can someone explain to me what the clojurescript macro defpartial from the crate library does?

12:30 I guess it's just for making sure any functions generating html get wrapped in calls to crate.core/html?

12:30 ohpauleez: amouat: Yeah, it's just to create smaller partial pieces of HTML that you can use to build out full pages

12:33 amouat: ohpauleez: 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:33 ohpauleez: cool! np, happy to help

12:36 piranha: systemfault: I'm not sure if anyone mentioned that, but I love 'simple made easy'

12:37 loganlinn: $help

12:37 lazybot: You're going to need to tell me what you want help with.

12:45 gfredericks: so I google about how to get a jarname from java; it involves calling .getProtectionDomain().getCodeSource() on one of my classes

12:45 well I guess that works; since I have an uberjar I can do that on clojure.lang.RT

12:45 tomoj: http://hackage.haskell.org/packages/archive/ZipFold/latest/doc/html/Data-Zip-FoldL.html

12:46 data FoldL b a = F (a -> b -> a) a

12:46 that looks awfully like 'mapping' etc

12:50 but what about WithCont (FoldL b), i.e. WC (F (a -> b -> a) a) (a -> c)

12:51 looks kind of like (fn ([] a0) ([a] c) ([a b] a'))

12:51 but an operator like reducer can't tell whether you pass such a thing

12:52 er, it looks not like 'mapping', but just like the things 'mapping' etc pass around - reducefs

12:52 TimMc: gfredericks: (-> + class .getProtectionDomain .getCodeSource) ;;= nil

12:57 konr_tra`: is there a name for clojure's data structure, like CLON?

12:58 hiredman: konr_tra`: https://github.com/edn-format/edn

12:58 AimHere: Nah. With clojure you just slurp it and read-string it

12:58 After defining your DSL appropriately, of course

13:04 TimMc: That's "DSL" in the semantic sense, not some formal programmatic construct.

13:09 tomoj: if you had something that otherwise looked exactly like a vector, but which conj'd on the front, that would probably be bad, right?

13:11 kovas: pbostrom: thanks! I got it from https://github.com/achengs/subpar

13:13 llasram: tomoj: OOC, what's the benefit of `conj`ing onto the front?

13:13 pbostrom: kovas: just curious, have you looked into trying to start up multiple nrepls, or would that be too heavyweight?

13:13 kovas: pbostrom: there is a multiplayer mode in session right now

13:13 pbostrom: but not multiple nrepls to do the eval

13:16 pbostrom: kovas: 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:18 kovas: pbostrom: sweet. i'd like to figure out a way to make these sorts of projects more modular

13:18 pbostrom: what do you want to achieve with your thing?

13:20 tomoj: llasram: well, sometimes that's just what you want

13:20 but really, I'm thinking about right folds

13:20 amalloy: tomoj: isn't that basically a queue, looked at upside-down?

13:21 tomoj: maybe, but this vector would peek and pop from the front

13:22 amalloy: so it's a list?

13:22 or is the random access/update important?

13:22 tomoj: yeah, but indexed

13:22 llasram: Can't you just read a vector backwards?

13:22 tomoj: well I don't really want that right now, I'm thinking about how you might make a right-foldable vector

13:22 right

13:23 so you can return a reducer that reduces the vector backwards

13:23 but it seems pretty easy to just let vectors be truly reversible

13:24 maybe not so easy..

13:25 mmitchell: anyone here use compojure and friend? I'm attempting to segregate auth-based routes from non-auth routes, but no luck

13:26 pbostrom: kovas: 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:30 kovas: 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:31 kovas: pbostrom: yeah. I just think the terminal-based repl need to die

13:31 Sgeo_: What's this about the terminal-based REPL needing to die?

13:31 Is this anything like living in a Smalltalk-like image?

13:32 kovas: representing everything as text doesn't do justice to the stuff we want to create

13:32 technomancy: FSVO "we"

13:32 pbostrom: kovas: anything in particular you won't to accomplish with session next? Or should I just look over your issues list on gh?

13:32 kovas: also, being able to save values is definitely a win

13:33 (saving the VM state is too much complexity, but values we can certainly do)

13:33 pbostrom: s/won't/want/

13:33 kovas: pbostrom: the issues like is pretty comprehensive

13:33 list

13:35 pbostrom: kovas: 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:35 Sgeo_: kovas, what's wrong with everything being represented as text if we have manipulation tools that hide the textual representation

13:36 Alternatively: Everything is not text, but can be serialized to text easily

13:36 clojure-newb: hey 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:37 dnolen`: clojure-newb: paste

13:37 kovas: Sgeo_: Yes I'm good with that, but that set of tools doesn't include the terminal

13:38 Sgeo_: kovas, hmm, so what do you have in mind?

13:38 I rather like Smalltalk workspaces, but I can imagine there being better

13:38 kovas: Sgeo_: browser-based repl can render stuff inline

13:39 Sgeo_: Oh, we're talking webdev?

13:39 kovas: Sgeo_: you just put a protocol on your outputs and they render as whatever you want

13:39 Sgeo_: oh

13:39 kovas: Sgeo_: I'm more interesting in data visualization

13:39 Sgeo_: but theres plenty of situations where you want something more than text

13:39 clojure-newb: dnolen`: https://www.refheap.com/paste/8752

13:40 kovas: pbostrom: cool i will check it out!

13:40 Sgeo_: kovas, something like DrRacket?

13:40 kovas: Sgeo_: I'm more inspired by Mathematica, since I used to help built it

13:40 Sgeo_: 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:40 kovas: Sgeo_: but yeah they have some basic stuff. its definitely the direction things are gonna go in

13:41 dnolen`: clojure-newb: that won't work, there's no such thing as early return in Clojure

13:41 cbp`: 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:41 kovas: Sgeo_: the IPython has that as well, also the Factor repl

13:41 clojure-newb: dnolen`: what would be the idiomatic clojure alternative ?

13:41 Sgeo_: Haven't touched Python in a while

13:42 kovas: Sgeo_: with clojure we have the benefit of the native dialect in the browser, so we can take it further

13:42 dnolen`: clojure-newb: use cond

13:42 Sgeo_: Also, forgot about Factor, I didn't ... quite remember something like that

13:42 clojure-newb: dnolen`: thanks

13:42 Sgeo_: kovas, there are a few Smalltalk dialects that run in Javascript

13:42 kovas: Sgeo_: the IPython thing is getting a lot of traction

13:44 gfredericks: is there any answer to the problem of not being able to put data-reader stuff in your code?

13:44 (generally)

13:44 yogthos: clojure-newb: this would probably be cleaner https://www.refheap.com/paste/8753

13:45 clojure-newb: yogthos: thanks… still trying to get the basics, that helps

13:46 yogthos: clojure-newb: no prob, I also hihgly recommend going through at least some problems on http://www.4clojure.com/

13:46 clojure-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:46 clojure-newb: wow, loads on there

13:46 thanks

13:54 seangrove: Hey guys, have a mildly annoying dev/production problem

13:54 ohpauleez: seangrove: let's hear it

13:55 seangrove: I 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:55 In 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:56 ohpauleez: seangrove: Can you do conditional builds of the frontend. Like pipelining infrastructure

13:56 seangrove: I 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:56 technomancy: we need a clojurebot factoid for "use environ or carica depending on whether you need nested values or just strings"

13:56 seangrove: I don't have anything like that setup right now, I just run cljsbuild auto <env>

13:57 ohpauleez: https://github.com/sonian/carica

13:57 I also use lein profiles for some stuff now

13:58 seangrove: Thanks for these guys, checking them out now

13:58 technomancy: clojurebot: config?

13:58 clojurebot: excusez-moi

13:58 tomoj: can a cljsbuild build pass in configuration somehow to macroland?

13:58 e.g., I guess, set an environment var which tells which carica config file to load

13:59 hiredman: tomoj: no no, you use the classpath

13:59 TimMc: ohpauleez: Hot damn that's a nice README.

13:59 technomancy: clojurebot: 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:59 clojurebot: Ik begrijp

13:59 tomoj: hmm.. so etc_dev/config.clj, etc_prod/config.clj

13:59 and add one or the other to the classpath in your build?

14:00 technomancy: tomoj: typically resources/config.clj and dev-resources/config.clj

14:00 TimMc: tomoj: What are the consequences of using the wrong ID?

14:00 technomancy: but you can change it if you like for whatever reason

14:00 tomoj: ah, and the first one will be used

14:00 so you don't have to do anything.. nice!

14:00 hiredman: tomoj: no, your deployment software (chef, puppet, whatever) overides the default config by writing a config file that ends up first on the classpath

14:01 gfredericks: so to use #inst with joda I want to create a data-readers.clj and redirect #inst to a clj-time function?

14:01 tomoj: sure

14:02 seangrove: And carica should work with cljs, presumably?

14:02 I'm pretty fuzzy on how much clj libraries "just work" with cljs - it seems to be, "almost none"

14:02 tomoj: so then the stuff you put in your cljsbuild builds is orthogonal to stuff in config.clj

14:02 TimMc: Carica... that's the genus of papaya.

14:02 technomancy: seangrove: the cljs compiler is written in clojure, so your configuration should affect the compiled output

14:02 tomoj: you can run a prod/min build with your dev config.clj or a dev build with your prod config.clj

14:02 TimMc: Looks like I'm not the only one using biological taxonomy as a source for project names!

14:03 seangrove: Carica looks pretty awesome. Will try it out now

14:03 tomoj: seangrove: I think you'd need to define a macro if you just wanted to pull a config value out to js

14:03 technomancy: leathekd: why does the carica readme say to add a directory to :resource-paths?

14:05 leathekd: Hmm, I suppose it isn't necessary so long as the config file ends up on the classpath where carica will find it.

14:06 gfredericks: aaaaaaugh

14:06 * gfredericks curses data readers

14:06 technomancy: leathekd: yeah, just curious if you saw some special value in keeping it separate from other resources

14:06 leathekd: technomancy: It might be an artificial separation but I like having config separate from src.

14:06 technomancy: oh right; separate from src/ absolutely

14:06 TimMc: But why not in ./resources/?

14:06 technomancy: separate from other resources is what struck me as curious

14:07 seangrove: Hrm, I'm slightly confused how I set different resource-paths for different cljsbuilds: https://www.refheap.com/paste/88204855cbd6a01879b3aabc5

14:08 borkdude: ,(-> 1)

14:08 clojurebot: 1

14:08 leathekd: technomancy: 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:09 seangrove: Ah, 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:10 technomancy: seangrove: typically you control those with profiles

14:11 seangrove: Ok, I'll take a look at profiles then

14:11 frozenlock: cljsbuild - How can one include the externs.js file in the jar?

14:16 The .cljs is included, but not the externs.js... does this mean that the user must add the externs.js manually each time?

14:16 tomoj: hmm.. isa? hierarchies have to be made out of symbols, keywords, or classes, with classes only at the leaves, yes?

14:18 oh, but with collection dispatch values.. I guess I never understood isa? dispatch

14:18 dnolen`: frozenlock: I don't know this so, you should look at how jayq does this

14:18 "I don't think so"

14:20 frozenlock: yeah that was my first reflex.. but jayq really seems to be a special case. Its project.clj --> (defproject jayq "2.0.0"

14:20 :description "A ClojureScript wrapper for jQuery")

14:27 dnolen`: 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:27 seangrove: tomoj: Yeah, carica doesn't work in cljs as-is, will try the macro route

14:28 frozenlock: dnolen`: indeed -> https://github.com/emezeske/lein-cljsbuild/issues/95

14:29 I moved stuff around in directories and it worked. :-)

14:29 dnolen`: frozenlock: nice

14:30 `fogus: dnolen: Are you planning to move infd into the fd ns?

14:34 dnolen`: `fogus: it's already been done

14:35 `fogus: infd is now fd/in if you require clojure.core.logic.fd :as fd

14:35 `fogus: ah!

14:35 dnolen`: `fogus: I'm removed all cases where names ended w/ a fd suffix

14:36 it's now fd/distinct, fd/+ etc

14:36 `fogus: OK. That's more clojurey

14:36 ;-)

14:36 dnolen`: `fogus: yes :)

14:40 `fogus: dnolen: I changed the examples page to use fd/ https://github.com/clojure/core.logic/wiki/Examples

14:40 dnolen`: `fogus: great thanks!

14:41 `fogus: I had fixed the other examples but missed that one.

14:41 `fogus: No worries. Thanks for c.l

14:41 dnolen`: `fogus: it's coming along slowly but surely!

14:44 borkdude: who wants to test if this Pong game runs? made by first year undergraduate students https://www.dropbox.com/s/i3j5mxwrtmaxioo/Pong.jar

14:50 ohpauleez: borkdude: Are you trying to root my system?

14:50 borkdude: lol

14:50 ohpauleez: blindly accepting executable jars is a no-no now haha

14:50 :)

14:50 bbloom: ohpauleez: you're just doing it wrong. you need to blindly run lots of unverified code to build up your machine's immunities

14:51 i thought you knew stuff about computers!

14:51 systemfault: What doesn't kill your OS makes it stronger, right?

14:51 zilti: Can I define some kind of "wildcards" in Compojure? Like saying "(GET "/foo/*" [args] ...) ?

14:51 seangrove: Ah, damn.. I can't use a macro inside of a function in cljs?

14:51 ohpauleez: haha, I know I've done a lot of autonomic computing… I suppose this is just the next logical step I should take

14:51 bbloom: you've convinced me

14:52 zilti: seangrove: Only compile-time macros for cljs

14:52 amalloy: seangrove: you do that every day when you write (defn foo [] (let [...] ...))

14:52 seangrove: If zm/env-settings is a macro then, does this look acceptable? https://www.refheap.com/paste/920ca3135bc5627a18483c8e4

14:54 I of couse get "zm is not defined" in the browser repl, which is reasonable

14:54 I could pull them out into a top-level def so they're executed at compile time, I suppose

14:57 augustl: with ring.middleware.session and the cookie store, how do I implement a "remember me" checkbox?

14:58 ohpauleez: augustl: You set the :expires on the session

14:58 how you toggle that in your code is up to you

14:59 augustl: reading the code, seems it also read out :session-cookie-attrs from the response too

14:59 ohpauleez: that's what I wanted to hear :)

15:00 seangrove: Alright, 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:04 tomoj: I guess check (System/getProperty "java.class.path") inside a cljs macro

15:05 I see strange-looking stuff in cljsbuild about running 'in a subproject'

15:07 bbloom: do you know if dispatch-map suffers contention problems like those recently fixed in multimethods?

15:07 bbloom: tomoj: link?

15:08 tomoj: http://dev.clojure.org/jira/browse/CLJ-988

15:08 I guess since it's an atom, no?

15:09 bbloom: oh yeah, no mine shouldn't suffer from that at all

15:09 they put the state in an atom

15:09 tomoj: https://github.com/clojure/clojure/commit/83ebf814d5d6663c49c1b2d0d076b57638bff673

15:10 just more overhead than multimethods then?

15:10 bbloom: no, a dispatch-map should be cheaper than a multimethod

15:10 it's a subcomponent of multimethods

15:10 tomoj: oh, right, but I mean using dispatch-map's reimpl of multimethods

15:11 bbloom: maaaybe, but that cost would be 1) very small and 2) only paid on defmethod

15:11 shouldn't really have any serious runtime impact

15:12 tomoj: cool

15:13 bbloom: yeah you can see for youself in https://github.com/brandonbloom/dispatch-map/blob/master/src/dispatch_map/core.clj

15:13 basically search for @

15:13 or !

15:13 just like dispatch map gained a State class

15:14 er i mean just like real multimethods gained a State class

15:14 dispatch map has DispatchCache

15:14 which is stored in an atom

15:14 real multimethods then use a lock for the defmethod, prefer, etc

15:14 but i use an atom for that too

15:15 so atom + lock vs 2 atoms

15:16 seangrove: Hrm, it seems like resource-paths is ignored by cljsbuild?

15:18 technomancy: Should this be resource-paths here? https://github.com/emezeske/lein-cljsbuild/blob/master/plugin/src/leiningen/cljsbuild/subproject.clj#L66

15:19 Looks like it might be ignoring resource-paths in project.clj for lein2 projects

15:21 Yeah, that didn't fix my problem, but at least my resource-paths are on the classpath now

15:28 frozenlock: I 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:29 In my wrapper: (ns envision-cljs.core). In my other project: (ns myprojectname.core (:require [envision-cljs.core :as v]))

15:29 Bodil: frozenlock: Yeah, if your namespace is called envision-cljs.core, the file path needs to be envision_cljs/core.cljs

15:30 frozenlock: Just a wild guess at what's wrong, mind you, but that's the one I always keep running into :)

15:31 frozenlock: Yeah I do often too, but in this case I did use the "_" in my path, which is why I'm confused.

15:32 seangrove: leathekd: 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:32 Bodil: frozenlock: In that case I'm confused too...

15:33 frozenlock: It's my first cljs library that uses an externs.js; I'm not usre if it's related.

15:35 me 3 days ago "Oh, let me do that in cljs, I'll save time!"

15:36 I was so young and naive back then.

15:36 seangrove: Uhg, 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:40 Ah, ok, so it looks like the fix to lein-cljsbuild subproject.clj did the trick. Phew.

15:40 The yaks are out with a vengeance today

15:40 clojurebot: what should I do today, it is the weekend and all

15:41 frozenlock: Ok something funny is going on here. Every library is in the .lein-cljsbuild-compiler-X folder, except for my new one.

15:41 (I did clean and recompile multiple times)

15:44 seangrove: frozenlock: 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:45 Would be much appreciated if you can keep track of what you had to do

15:45 frozenlock: seangrove: Fear not, I'm on this since yesterday evening... I'm so mad that I won't forget a thing :p

15:59 omg

15:59 omg omg omg omg

15:59 someone please shoot me

15:59 amalloy: once you said omg five times, i was going to even if you didn't ask

15:59 frozenlock: core.clj ---> core.cljs

15:59 aroemers: I think the bots won't let us..

16:02 Thallasios_Xelon: hello guys :)

16:03 i want to do something like (let [ (first l) 5] .....)

16:03 its an error right?

16:03 i stuck...

16:03 nDuff: Thallasios_Xelon: what do you actually want to do?

16:03 Thallasios_Xelon: ...that is -- what's the effect of this supposed to be?

16:04 Do 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:04 Thallasios_Xelon: i want to bind a variable,inside let

16:04 not a constant symbol

16:04 nDuff: Thallasios_Xelon: Why is "first" involved?

16:04 ...

16:05 Oh. The easy answer is "you can't".

16:05 Thallasios_Xelon: (let [ symbol 5]

16:05 i want to determine the symbol on runtime

16:05 can i?

16:05 nDuff: No.

16:05 Thallasios_Xelon: :)

16:05 nDuff: If you really have a legitimate use case for that, use a macro.

16:06 ...but I'd be curious to hear it.

16:06 ibdknox: Chances are you don't need to

16:06 Thallasios_Xelon: i am really newbie

16:06 nDuff: ...and if you do have a real-world use case, there's probably a better way to satisfy it

16:06 (such as a thread-local binding for a var)

16:07 Thallasios_Xelon: i want to use a thread-local binding,but with a variable symbol like (binding [ symbol_on_run_time_or_macro 5]

16:08 can i use a macro for that?

16:08 seangrove: Thallasios_Xelon: But *why* do you want to do that?

16:08 What are you trying to accomplish

16:08 Thallasios_Xelon: a have a boolean formula,that i want to evaluate

16:09 with different bindings

16:09 each time

16:09 augustl: is there something like form authenticity tokens in Rails for Ring?

16:09 ibdknox: augustl: https://github.com/weavejester/ring-anti-forgery

16:10 frozenlock: Thallasios_Xelon: to play with symbols https://www.refheap.com/paste/8756

16:11 ibdknox: if you want dynamically bound symbols you can use with-bindings

16:11 I still doubt that's really what you want though

16:11 ,(doc with-bindings)

16:12 clojurebot: "([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:12 Thallasios_Xelon: thx guys i will try reading and trying

16:16 augustl: idlecool: nice, thanks

16:16 aroemers: frozenlock: nice macro, found a good use for it in my current project.

16:17 frozenlock: aroemers: Thanks. I was pretty sure it could only help me and my idiosyncrasies :)

16:17 augustl: ibdknox, not idlecool, sorry

16:19 brainproxy: win +1

16:19 Thallasios_Xelon: if you wanted to evaluate a boolean formula, (and a b) for many a,b values what would you do?

16:19 brainproxy: derp

16:20 frozenlock: Is there a way to get a function's documentation from a cljs repl?

16:20 Thallasios_Xelon: i thought that i would be easy not to touch the formula,and evaluate it in different bindings for a and b

16:21 d

16:22 augustl: ibdknox: 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:22 err, not just ibdknox, anyone :)

16:22 ibdknox: yes, you can just use curl

16:23 Thallasios_Xelon: ,(map and [true true] [false true])

16:23 augustl: or perhaps an <input type="hidden" name="json here"> would work actually

16:23 ibdknox: ,(map and [true true] [false true])

16:23 clojurebot: #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/and, compiling:(NO_SOURCE_PATH:0)>

16:23 TimMc: augustl: Cross-site POST works.

16:23 dnolen: Thallasios_Xelon: how is that not solved by (defn f [a b] (and a b)) ?

16:23 ibdknox: ,(map #(and % %2) [true true] [false true])

16:23 clojurebot: (false true)

16:24 TimMc: augustl: 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:24 Thallasios_Xelon: dnolen the formula isnt stable

16:24 but thanks

16:25 augustl: TimMc: 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:26 Thallasios_Xelon: i want to evaluate any formula

16:26 ibdknox: augustl: I can send anything I want from curl

16:26 with xhr headers

16:27 as json

16:27 augustl: ibdknox: right, but that's not related to CSRF

16:27 Thallasios_Xelon: bye guys thx :))

16:27 dnolen: Thallasios_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:28 augustl: CSRF = 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:28 Thallasios_Xelon: i think i will use refs,as symbols to solve it

16:28 augustl: so, 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:37 seems that a web based API shouldn't use cookies for authentication. Eliminating cookies = eliminating CSRF

16:37 TimMc: augustl: I suppose the form submission would have a "form-encoded" header, which you could check against.

16:38 augustl: TimMc: I guess there's always some odd browser that doesn't even set that header :)

16:38 TimMc: bleh

16:38 Actually, I doubt that.

16:39 augustl: hmm, me too, but that means I'd base security on assumptions

16:39 TimMc: If I were in your place I would be checking for known solutions.

16:39 I haven't had to worry about CSRF in a while.

16:40 ...but it's a pretty well-solved problem, IIRC.

16:42 augustl: the 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:42 should separate them so my website doesn't gain additional privileges towards the API from being on the same origin

16:42 TimMc: Look into the XHR header thing. I think that's pretty solid.

16:45 seangrove: augustl: Also, CORS

16:47 bbloom: if you write a java class that has a name endeding in List and you implement precisely ZERO collection interfaces: fuck you.

16:48 systemfault: Haha

16:50 tomoj: yes :(

16:50 or a Map

16:52 augustl: seangrove: I find CORS to be too specific, since I explicitly have to permit hostnames

16:52 seangrove: I think you can wildcard

16:53 Or you can check the origin of the incoming request and set your cors headers to allow that

16:53 ohpauleez: you can wildcard

16:53 or you can support JSONP

16:54 augustl: seangrove: you can't wildcard on HTTPS and with cookies

16:54 wildcard = no cookies

16:54 with good reason :)

16:54 ohpauleez: ahh

16:54 sure, totally

16:54 seangrove: Ah, I see

16:54 Every request I make that way just includes the api-key, so no cookies

16:54 augustl: so, 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:55 the api will ignore cookies completely

16:55 seangrove: yeah :)

16:55 the 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:55 s/and use CORS/and use XSRF proteection/

16:56 seangrove: Jesus christ, I think I may have fiished the second have of the ui for Zenbox

16:57 UI (at least in js) is by far the most painful part of dev so far

16:57 I have got to start an open-source project to port something like IB to clojurescript

16:57 As far as I can tell, it's basically entirely declarative, no?

16:58 augustl: seangrove: if you aren't using AngularJS, there's a high probability you are using the wrong tool :)

16:58 seangrove: Using cljs and google closure ui

16:58 augustl: the problem (imo) with google closure UI is that it's essentially just a better DOM

16:59 you're still on your own when you want to update your UI when data changes

16:59 seangrove: augustl: Yeup

16:59 The built-in controls are pretty nice though, still

17:00 augustl: angular provides the best solution to this problem I've ever seen :) https://twitter.com/silentbicycle/status/269128913572208640/photo/1/large

17:05 seangrove: 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:05 this 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:06 seangrove: augustl: I've simulated that a bit using shoreleave's pubsub and handlers

17:06 But it's pretty manul

17:06 Haven't found the right patterns to abstract yet

17:08 ohpauleez: seangrove: Hopefully the new Shoreleave updates help smooth that out

17:08 seangrove: ohpauleez: Very much looking forward to it

17:08 Trying not to pester you too much about it, now that working off of master for shoreleave-browser works

17:08 frozenlock: ohpauleez: Is the new version ready?

17:08 I'm at a point where I need server/client communication, and I would like to use shoreleave :)

17:09 ohpauleez: (subscribe-> …) has been added, remote-ns is supported on Ring/Compojure, improvements in handling failures better

17:09 frozenlock: Getting there: https://github.com/shoreleave/shoreleave-baseline

17:09 I'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:17 antoineB: hello, what kind of deconstructor we have in clojure? i know vector and map, is there orthers?

17:18 TimMc: antoineB: It's not really a vector, it's a sequential destructurer.

17:18 ohpauleez: antoineB: You can destructure any associative or sequential thing

17:18 TimMc: hmm...

17:19 ,(let [{a 0} [:bar]] a)

17:19 clojurebot: :bar

17:19 TimMc: ,(let [{a :foo} {:foo :bar}] a)

17:19 clojurebot: :bar

17:19 ohpauleez: TimMc: Are you saying hmmm.. as in, "Records?" or hmmm… "it's probably a protocol"

17:19 TimMc: So yeah, vectors can be destructured in two different ways.

17:19 gtrak: ,(let [{a :foo} [[:foo :bar]] a)

17:19 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>

17:20 TimMc: The associative destructuring is probably more performant. :-/

17:20 gtrak: ,(let [{a :foo} [[:foo :bar]]] a) ; darnit

17:20 clojurebot: nil

17:20 amalloy: TimMc: why would you say that?

17:20 systemfault: Do you guys think that a small IRC bot would be a good starting project for clojure?

17:20 I have no other idea for now..

17:20 TimMc: amalloy: The sequential destructurer uses nth.

17:20 amalloy: so?

17:20 nth is fast on vectors

17:21 TimMc: Oh, is it? I thought it forced a seq.

17:21 ohpauleez: systemfault: Are you looking for starter projects?

17:21 TimMc: ,(doc nth)

17:21 clojurebot: "([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:21 TimMc: ,(nth (range 1 10) 1000)

17:21 gtrak: ah, oops, I did it wrong, ##(let [{a :foo} '(:foo :bar)] a)

17:21 clojurebot: #<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>

17:21 lazybot: ⇒ :bar

17:22 systemfault: ohpauleez: Exactly.. something that would cover the basics.. data structures, functions, I/O

17:22 TimMc: gtrak: wat

17:23 gtrak: ,(let [{a :foo} [:foo :bar]] a)

17:23 clojurebot: nil

17:23 antoineB: does exists other deconstructor like (let [#my-stuff[a b] something] a) ?

17:23 gtrak: ,(let [{a :foo} (seq [:foo :bar])] a)

17:23 clojurebot: :bar

17:23 ohpauleez: systemfault: HTML screen scraping using Enlive, a tic-tac-toe AI, a site-generator (like jekyll)

17:23 gtrak: wat wat

17:24 systemfault: ohpauleez: Good ideas, thank you :)

17:24 ohpauleez: totally welcome

17:24 antoineB: ohpauleez: a jekyll that read clojure maps as data, should be fun

17:25 TimMc: &(destructure '[{a :foo} (seq [:foo :bar])]) ;; gtrak

17:25 lazybot: ⇒ [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:26 gtrak: yup

17:26 TimMc: ,(let [{a 0} (range)] a) ;; so this should blow up

17:27 * TimMc checks his watch

17:27 amalloy: wow, that blew up even more than i expected

17:27 TimMc: botgone?

17:27 &(let [{a 0} (range)] a) ;; so this should blow up slightly less

17:28 lazybot: Execution Timed Out!

17:28 TimMc: $botsnack

17:28 lazybot: TimMc: Thanks! Om nom nom!!

17:29 gtrak: &(range)

17:29 lazybot: java.lang.OutOfMemoryError: Java heap space

17:32 gtrak: ,(throw (Exception. "##(println $botsnack)"))

17:32 lazybot: java.lang.RuntimeException: Unable to resolve symbol: $botsnack in this context

17:32 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.Exception: ##(println $botsnack)>

17:33 gtrak: ,(throw (Exception. "##(println \"$botsnack\")"))

17:33 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.Exception: ##(println "$botsnack")>

17:35 scottj: yedi: 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:35 yedi: scottj: I saw it

17:35 TimMc: gtrak: lazybot is snubbing clourebot these days

17:35 yedi: and wow thanks for remembering and linking

17:35 scottj: hmm, the url says 1-14 but the article says 1-17, who knows

17:35 yedi: i asked about prismatic and clojurescript on separate occasions!

17:36 scottj: when I saw the title of the article, I was hoping for something more than a new templating library for cljs

17:36 antoineB: does clojure compiler support inlining functions?

17:36 hiredman: yes

17:36 ,(doc definline)

17:36 clojurebot: "([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:37 yedi: something along the lines of using clojures powerful abstractions for frontend dev

17:37 but i guess hiccup-like templating fits that description

17:38 hiredman: in 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:45 antoineB: hiredman: in the code of definline i don't understand the "~(apply (eval (list `fn args expr)) args)" part

17:46 akhudek: I 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:49 frozenlock: ohpauleez: 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:51 TimMc: akhudek: Which?

17:52 scottj: akhudek: in the blog and readme the main reason they give is improved performance, they claim ~3-4x

17:52 TimMc: laser?

17:52 scottj: TimMc: I think he's talking about https://github.com/prismatic/dommy

17:55 antoineB: dommy don't support namespace (.createElementNS) used for svg, that's a bad point for me

17:55 gtrak: dommy is like 100 lines

17:56 antoineB: but can be easily change by a dynamic var

17:57 akhudek: scottj: saw that, but they don't compare against domina or enfocus.

17:57 scottj: akhudek: yeah, and I wonder how fast the jquery technique they used is compared to other js templating options

18:06 ohpauleez: frozenlock: I'm not sure I understand the question, but whatever the server function returns, will get passed back to the client

18:07 If 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:07 frozenlock: ohpauleez: In fetch, doing (fm/letrem [a (adder 3 4)] a) will return nil.

18:08 However (fm/letrem [a (adder 3 4)] (print a)) will print a

18:08 ohpauleez: frozenlock: Yes, remotes can only call their bodies in a callback - they're non-blocking

18:09 so 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:09 frozenlock: Ok, I just have to stuck this into my mind and be surprised it happens :)

18:10 *stop being surprised when it happens

18:28 brainproxy: weavejester: 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:29 but 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:30 i.e. not whatever would otherwise be returned by the return of catch

18:37 bosie: https://www.refheap.com/paste/c4ca927d6d96ffb4f716a54f3 could someone please tell me why this is what happens?

18:39 muhoo: ok i'm confused. why would a java class import perfectly well in the repl, but blow up spectacularly in "lein check"?

18:40 specifically https://www.refheap.com/paste/8762 , and this is with RC2

18:41 is there something radically different about what lein check does to compile namespaces, versus what the repl does?

18:42 gtrak: interesting that it's a different class than what you're importing, sounds like a problem in your classpath, maybe duplicate deps?

18:42 technomancy: muhoo: the repl pulls in nrepl and clj-http and friends in order to function

18:42 chronno: bosie: don't use fn as the name of your first parameter

18:42 bosie: chronno: right but i am not sure why this error would happen

18:43 chronno: bosie: third line

18:43 gtrak: bosie: you're calling inc instead of creating a function

18:43 chronno: you are appplying inc there

18:43 muhoo: technomancy: 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:44 chronno: bosie: with two paremeters, an empty vector and the return value of the let

18:44 muhoo: apparently there's some missing dep, or, more likely, a conflict

18:44 bosie: chronno: oh true

18:44 is there a way to get better error/exception messages?

18:44 muhoo: i bet either nrepl or clj-http is pulling in a different version of guano than what is specified in the project

18:44 technomancy: muhoo: that's still an open issue unfortunately: https://github.com/technomancy/leiningen/issues/520

18:45 haven't thought through a good solution

18:45 gtrak: bosie: it's an obvious error, how would you detect such a thing?

18:45 bosie: gtrak: pardon?

18:45 gtrak: how would you automate detection of such a thing?

18:45 muhoo: huh, i guess i have a talent for something: running up against open issues. oh well. i'll figure something out

18:45 dakrone: muhoo: clj-http doesn't pull in guano at all

18:45 technomancy: wait, is there actually a lib called guano?

18:46 bosie: gtrak: automate? it gives the wrong line number

18:46 muhoo: it's a google thing, uh,

18:46 bosie: gtrak: if anything, giving the wrong line number is a bug

18:46 muhoo: guava, not guano. it coats my life with guano though.

18:46 technomancy: hahaha

18:46 gtrak: bosie: the line number makes sense

18:46 if you look at AFn

18:46 it's not a syntax error, it's a semantics error

18:46 bosie: gtrak: the line number does not make sense. this is like revealing the C code line number for a ruby exception

18:47 technomancy: sounds like an april fools project announcement; forking guava -> guano

18:47 gtrak: you don't get it, it did what you told it to, it has no way to interpret what you meant to do

18:47 bosie: gtrak: apparently i don't

18:48 gtrak: i would have expected to see line 3 here

18:48 gtrak: core$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:49 bosie: gtrak: i overlooked line 3 and thought the error is in line 8

18:49 muhoo: cljs pulls in this guan[oa]

18:49 technomancy: muhoo: for now you can just toss [org.clojure/tools.nrepl "0.2.1"] and [clojure-complete "0.2.2"] into project.clj

18:49 if you want to get a deps tree

18:50 bosie: gtrak: i didn't think i could actually override fn

18:50 muhoo: technomancy: cool, thanks. i'm going to try explicitly calling out guan[oa] and see if that helps

18:50 gtrak: bosie: yea, fn's not a special form

18:50 bosie: gtrak: right

18:50 technomancy: muhoo: oh, also [org.thnetos/cd-client "0.3.6"]

18:50 gtrak: it's a runtime error by nature, since it compiles fine

18:51 muhoo: web 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:52 technomancy: problem worked-around: [com.google.guava/guava "13.0.1"] and everything works :-/

18:52 technomancy: muhoo: another option is to use a raw repl instead of nrepl

18:52 bosie: gtrak: is there a way to get better line number parsing?

18:52 technomancy: `rlwrap lein trampoline run -m clojure.main/repl`

18:52 muhoo: true, but i'd be lost without nrepl.el :-)

18:53 technomancy: completely avoids the implicit dependencies

18:53 muhoo: i was using the raw repl on an embedded platform for a while though, worked well.

18:53 gtrak: bosie: 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:53 technomancy: I should add a faq for that or something

18:54 muhoo: it'd be helpful for debugging these strange dependency tangles, yes.

18:54 bosie: gtrak: thank you

18:55 gtrak: bosie: 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:55 bosie: gtrak: right

18:55 technomancy: anybody got any last-minute issues to report on leiningen 2.0.0-rc2?

18:56 Raynes: technomancy: It isn't pink.

18:56 muhoo: so far, rc2 seems pretty damn solid

18:56 bosie: gtrak: 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:56 Raynes: technomancy: http://code.google.com/p/clementine-player/issues/detail?id=219

18:56 frozenlock: I 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:57 technomancy: Raynes: that might need to get pushed back to 3.0

18:57 bbloom: frozenlock: shouldn't be too hard to try it and figure it out

18:57 frozenlock: but it's probably irrelevant: use an iso8601 string

18:57 gtrak: bosie: reading JVM stacktraces is kind of a hassle, agreed..

18:58 I think this is the state of the art: https://github.com/mmcgrana/clj-stacktrace

18:59 bosie: let me give that a try

18:59 Raynes: (pst *e)

19:00 muhoo: Raynes: wtf, are bronies trolling clementine's bugtracker or something?

19:00 Raynes: muhoo: This was ages ago. And IIRC, he actually fixed it and made it so you can make it pink.

19:04 bosie: gtrak: still working on it

19:10 technomancy: interesting thoughts re: "full-stack is easier": http://words.steveklabnik.com/rails-has-two-default-stacks

19:11 bosie: gtrak: https://www.refheap.com/paste/8765 mind sharing your wisdom for what i do wrong, again? ;)

19:11 Raynes: callen: It's Time by Imagine Dragons.

19:12 gtrak: bosie: firstly, the user profile doesn't go into project.clj, but into ~/.lein/profiles.clj

19:13 bosie: gtrak: thanks

19:13 tomoj: s/defmethod/defnmethod/

19:13 gtrak: bosie: looks like you no longer need to explicitly use/require after that

19:13 tomoj: guess it's fairly easy to write a pointfree defmethod, but what to call it? :)

19:14 bbloom: tomoj: i think clojure.pprint does that and calls it use-method

19:16 bosie: gtrak: hm. doesn't seem to work for me

19:16 gtrak: hrm, not sure, then

19:17 Raynes: muhoo: There is a clementine setting that turns all album art into kitten pictures.

19:17 bosie: the reason why i use require: https://github.com/mmcgrana/clj-stacktrace/issues/15

19:17 xeqi: technomancy: I'm all for a default starting stack, and luminus seem ok for that

19:17 gtrak: bosie: I think that's irrelevant

19:17 muhoo: Raynes: i'll have to check this out, thanks.

19:18 gtrak: looks like he's using it a different way entirely

19:18 technomancy: xeqi: yeah, it just challenges the whole "everything's easy with a full-stack framework"

19:18 there's always going to be swapping out happening

19:18 muhoo: Raynes: do you publish your playlist somewhere, like on one of those social music services?

19:18 xeqi: heh, I came for the prime stack side

19:18 gtrak: though, isn't new a special form?

19:18 xeqi: *from

19:19 technomancy: xeqi: 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:19 xeqi: though luminous does have weird choices for options, +bootstrap?

19:19 technomancy: but whatever; Clojure people understand that

19:19 Raynes: muhoo: 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:19 muhoo: https://last.fm/user/RaynesFM

19:20 seangrove: Hrm, I think I really need to get the CA-as-a-github-service sideproject going

19:20 muhoo: Raynes: cool, thanks, you seem to be into all kinds of stuff i've never heard before

19:20 technomancy: are there any music players whose random shuffle is smart enough to only queue christmas music during december?

19:20 xeqi: technomancy: heh, yet surprisingly accurate from rails people I know

19:21 bosie: gtrak: was that directed at me?

19:21 gtrak: bosie: yea, I question his usage of 'new'

19:21 hiredman: technomancy: 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:22 seangrove: it's been done

19:22 muhoo: technomancy: they're called "shopping malls"

19:22 seangrove: hiredman: Oh?

19:22 hiredman: seangrove: some one just anounced it

19:22 bosie: gtrak: i see what you mean

19:22 technomancy: hiredman: I don't know if matching on terms would be enough

19:22 Raynes: muhoo: You'll note that MCR is my most listened to band by a fairly wide margin.

19:22 technomancy: unless you had copiously tagged with genre, etc

19:22 seangrove: hiredman: Even better, I didn't have to lift a finger for it

19:22 hiredman: seangrove: http://www.clahub.com/

19:22 * muhoo hates "holiday" music and walks around every december with plugs in his ears

19:22 bosie: gtrak: swapped it out with just an 'n'

19:22 hiredman: technomancy: works for me

19:23 bosie: gtrak: and that ha the exact same effect

19:23 Raynes: muhoo: 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:23 gtrak: hmm, no idea then, I don't use it myself

19:23 hiredman: technomancy: actually I match 11 terms

19:23 bosie: gtrak: new is a special form http://clojure.org/java_interop#new

19:23 hiredman: it different fields (name, category, album, etc)

19:24 technomancy: hiredman: do you have a lot of metadata filled out typically?

19:24 hiredman: technomancy: dunno, what is a lot?

19:24 most at least have album info at least

19:24 technomancy: categories, tags, genre I guess

19:25 muhoo: Raynes: i have bands like that too. but i did most of my intense/obsessive music listening in the pre-scrobbling era.

19:25 hiredman: anyway, I am looking forward to a music player that just exposes a sql interface where playlists are views

19:27 gtrak: hiredman: sparql? http://techbase.kde.org/Development/Tutorials/Metadata/Nepomuk/QueryService

19:27 muhoo: hiredman: sounds like a clj project waiting to happen

19:27 technomancy: mpd has a database; I wonder what they use

19:27 muhoo: technomancy: sqlite last i checked

19:28 yep libsqlite3-0 (>= 3.5.9

19:28 technomancy: cool

19:28 scottj: http://nhrx.org/mpdc/ lets you do pretty nice queries on mpd

19:29 muhoo: remember when every sample-code example project for every language and tool was making an mp3 player?

19:29 bosie: technomancy: may i bother you about a clj-stacktrace lein2 question?

19:29 muhoo: mp3 library, actually, not player

19:29 hiredman: scottj: neat

19:30 xeqi: muhoo: instead of a blog?

19:30 technomancy: bosie: sure

19:30 muhoo: xeqi: yep, blogs was a couple years later

19:30 xeqi: heh, didn't mean to put a ? on the end of that

19:30 technomancy: scottj: looks like fun

19:31 * technomancy just watched Insurrection last night; there's a scene where Picard walks into his room and asks for music and then chides the computer, "no not that. something latin."

19:32 bosie: technomancy: https://www.refheap.com/paste/4ea781d471f04a45dc50e5d3b

19:32 hiredman: technomancy: and then enrique iglesias

19:32 gtrak: bosie: it looks like it's working

19:32 notice: user/eval872

19:32 xeqi: technomancy, yogthos: https://www.refheap.com/paste/8767 wow thats alot of poms and a -SNAPSHOT to download

19:32 technomancy: bosie: oh yeah, that's reply unfortunately

19:33 bosie: gtrak: hm. i thought it would look like on the github readme page ;)

19:33 technomancy: bosie: https://github.com/technomancy/leiningen/issues/799

19:33 bosie: 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:34 bosie: i see

19:34 yogthos: xeqi: heh I don't even know where thneed is getting linked from

19:34 technomancy: thneed =(

19:34 I thought that was fixed

19:35 xeqi: technomancy: this is with RC2 for ref

19:35 technomancy: was it leinjacker?

19:35 yogthos: at least it's only grabbing the latest jar :)

19:36 xeqi: gotta run, but I'll check later

19:36 was wondering what sort of tests the generator built

19:37 since I didn't see them much in the docs

19:41 bosie: thanks technomancy and gtrak

19:57 bizarrefish: Hi, all

20:03 I'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:04 Also, is there a more..idiomatic way to include a big expensive operation in a ref-alter than using a lazy-seq?

20:05 amalloy: bizarrefish: instead of a lazy-seq of one element, you're looking for ##(doc delay)

20:05 lazybot: ⇒ "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:05 bizarrefish: Ahh, I didn't know about that :)

20:05 amalloy: your multithreading is safe but awkward

20:06 well, maybe not. my alternative doesn't come out much better

20:07 bizarrefish: amalloy: Looks to me like the only other way of doing it which might be cleaner is by moving the if into the fn

20:08 yogthos: wouldn't swap be better (def fingerprints (atom {})) (swap! fingerprints #(if-not (contains % uri) (first (compute-fingerprint body))))

20:08 err missed assoc there, but you get the idea

20:09 bizarrefish: Ahh, the atom thing

20:09 I'm still trying to get my head around the differece

20:10 yogthos: here https://www.refheap.com/paste/8768

20:11 if you don't need it to be coordinated atom is better

20:11 bizarrefish: It sure looks like a better solution

20:12 By coordinated, I take it you mean jumping around between threads, like a producer/consumer kind of situation.

20:12 yogthos: it would still be safe to use an atom there

20:13 but if you have transactions, then you want a ref

20:13 amalloy: yogthos: your function sets fingerprints to nil pretty often

20:13 yogthos: oh right :)

20:13 bizarrefish: hehe

20:13 not so good

20:13 But thanks dudes, I see what you're saying.

20:14 yogthos: hehe

20:14 I'm useless without the repl :P

20:14 bizarrefish: What's a good way to actually integrate the repl into the devving process?

20:14 yogthos: what do you use for the editor?

20:15 bizarrefish: I'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:15 Feels like I might be missing a trick

20:16 yogthos: yeah emacs or eclipse is much nicer for clojure

20:16 if 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:16 the other big thing you get is structural editing

20:16 bizarrefish: I think I tried the eclipse one a while ago. My machine wasn't fast enough to make it usable, iirc :P

20:17 yogthos: hehe

20:17 if you get the base eclipse without all the crap addons it's not too bad

20:17 and ccw has had some speed issues in the past, it's much better now

20:17 but emacs and paredit is very nice as well, and not nearly as much of a hog

20:17 bizarrefish: I'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:18 yogthos: the big advantage is that you can select code by expression, and move expressions around using shortcuts

20:18 it's like playing with lego blocks ;)

20:18 mattmoss: And once you learn M-x brew-coffee, everything is awesome.

20:18 yogthos: and if you're in a particular expression, you can just send it to the repl to evaluate

20:18 and it will run it in the context of what's already running

20:18 bizarrefish: It 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:19 I'll give it another go...after emacs

20:19 yogthos: :)

20:19 bizarrefish: yogthos: So, it's just like the elisp usage

20:19 yogthos: bizarrefish: precisely

20:20 it makes it a lot easier to tell if your stuff works right, because you can just test functions as you write them

20:20 make something see it work, move to the next one

20:20 you never build up a bunch of code and then hope it all works together :)

20:20 bizarrefish: It feels like with a homoiconic language like clojure, I should be able to do a certain amount of source editing programmatically.

20:20 Would emacs allow me to say, 'walk' through my source code with an fn?

20:21 yogthos: emacs can do a lot of that :)

20:21 you can do that with macros too right from your code :)

20:21 bizarrefish: And maintain indentation? :O

20:21 craigbro: record macros

20:21 yogthos: clojure has a nice pprint too, which can format code

20:21 zackzackzack: Let's say that I want to start up a rexster server alongside ring, https://github.com/tinkerpop/rexster

20:22 yogthos: and afk here

20:22 craigbro: complex string replaces

20:22 docstring and fn param list reminders when you cursor over fns

20:22 lookup docs at point

20:22 send some code to your repla and get the result

20:22 zackzackzack: What 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:23 craigbro: all that, and rainbow colored parenthesis

20:23 amalloy: ugh, rainbow parens

20:24 craigbro: zackzackzack 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:24 bizarrefish: Righto, 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:24 craigbro: if it's locking up, it prolly has nothing to do with ring

20:24 amalloy: everyone 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:25 technomancy: (inc amalloy)

20:25 lazybot: ⇒ 42

20:25 ibdknox: I think that is highly subjective

20:27 bizarrefish: Also, 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:27 zackzackzack: craigbro: I wonder, if errors are happening inside of a started Thread in clojure, then are they thrown to the main thread?

20:28 amalloy: i'm nothing if not subjective

20:28 bizarrefish: I imagine it would be backed by gcc and shared objects in implementation

20:29 craigbro: zackzackzack: 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:29 bizarrefish: (defcprogram (:int myfunc [:int a :int b] (+ a b))))

20:31 Would also be sweet if you could marshal back and forth between clojure and those programs, transparently./

20:31 hiredman: I really liked rainbox parens, but I had to turn them off because they were really slow for large clojure files (like core.clj)

20:32 technomancy: hiredman: that was before you started with paredit though, right?

20:32 hiredman: that was a few years ago, and I don't really remember what rainbox parens were like

20:32 zackzackzack: craigbro: 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:32 hiredman: technomancy: no, that was with paredit

20:32 * technomancy shakes his head

20:32 ibdknox: lol

20:32 what value is there in attacking preference?

20:33 technomancy: I feel like hiredman can take it

20:34 ibdknox: haha

20:34 hiredman: untrue, delicate flower, etc

20:34 technomancy: but seriously, encouraging newbies to pay more attention to parens can be unhelpful.

20:34 ibdknox: I would argue it does the opposite

20:35 tpope: dumb put popular preferences also have a way of sneaking into the defaults

20:35 ibdknox: though again, I imagine that is very dependent on the person

20:35 amalloy: i used rainbow parens and paredit mode too. had the same problems with large files

20:35 technomancy: since 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:35 ibdknox: until you need to see the scope of something

20:36 craigbro: I'm quite capable of perceiving multiple colors without losing my shit

20:36 hiredman: you may think that...

20:36 ibdknox: heh

20:36 we did several studies on highlighting at MSFT

20:36 amalloy: clojurebot: craigbro is quite capable of perceiving multiple colors without losing his shit

20:37 technomancy: I'll grant it might be helpful if you don't have paredit turned on

20:37 ibdknox: trust me, there's no conclusive thing you can say here

20:37 craigbro: hehe

20:37 amalloy: hiredman: noooo, why isn't he learning my factoid?

20:37 technomancy: but "not using paredit" counts as "doing work in your head you could be offloading to the computer"

20:37 hiredman: clojurebot: ping?

20:37 bizarrefish: Righto, it's my bedtime. Gotta goo. Thanks for the help doods :)

20:38 craigbro: you know, I think in all my years of lisp hacking, I have used paredit for a month

20:38 I like it, and I don't think I even know when rainbow parens are on

20:39 I 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:39 hiredman: ,(+ 1 2)

20:39 clojurebot: 3

20:39 craigbro: but I went years without them, and I can't really say it makes as much difference to me

20:39 amalloy: craigbro: s/it's/my?

20:40 craigbro: amalloy: no, paredit shits the bed sometimes when using []s and cuttin' and pastering

20:41 BTW< here is a screenshot of my emacs:

20:41 http://raz.z0r.de/266

20:41 to prove I can deal with colors

20:41 amalloy: if you cut and paste misbalanced expressions, yes

20:41 craigbro: (require 'bubble-bobble)

20:41 amalloy: epilepsy warning on that last link

20:41 craigbro: amalloy and sometimes I want to, cause I want just the last three args...

20:41 technomancy: that just means you're using non-paredit-aware operations

20:41 craigbro: yup

20:42 tho the [] confusion is not me being non paredit

20:42 technomancy: I think that's due to an old version of paredit

20:42 craigbro: sweet, I'll upgradinate

20:44 xeqi: technomancy, 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:44 amalloy: tbh 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:44 xeqi: though I'm surprised templates need dependencies

20:45 technomancy: clojurebot: thneed is coming from an old version of lein-jacker

20:45 clojurebot: c'est bon!

20:45 technomancy: I always forget

20:45 craigbro: amalloy, or doing what my emacs brain has done for the last decade, and C-k...

20:45 amalloy: C-k is bound to something sensible in paredit also

20:45 technomancy: it's C-w that will mess you up

20:45 amalloy: (and C-M-k doesn't come from paredit; emacs has had it built in for ages)

20:46 xeqi: technomancy: 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:46 technomancy: (define-key 'paredit-mode-map (kbd "C-w") (lambda () (message "oh no you don't")))

20:46 amalloy: technomancy: can i get a (keyboard-quit) in there so emacs looks mad at me?

20:46 technomancy: oh, also (interactively) in there

20:47 xeqi: yogthos|away: Y luminus NO HAVE tags in github?

20:47 technomancy: amalloy: (message "(╯°□°)╯︵ ┻━┻"))

20:48 mattmoss: Is one preferable? (Double. "x") vs. (double (read-string "x")) ?

20:49 hiredman: Double/parseDouble

20:49 ohpauleez: mattmoss: You might just want to do parseDouble

20:50 damnit hiredman, c'mon - I was totally fielding that one haha

20:50 mattmoss: lolz

20:50 technomancy: hiredman: at least with Integer the constructor is preferable since it's polymorphic

20:50 not sure if Double is the same

20:51 hiredman: technomancy: no, if you are parsing you want parsing

20:51 amalloy: BigDecimal's constructor is polymorphic, which only leads to sadness

20:52 alas, its static valueOf method is also polymorphic, but with only the wrong overloads intstead of the right ones

20:54 mattmoss: Thanks all.

20:54 amalloy: i agree with hiredman, though: if you know you have a string, Long/parseLong is definitely preferable to using the constructor

20:55 craigbro: how does the poymorphic constructor make sad?

20:57 amalloy: &(java.math.BigDecimal. 0.33333333333333333333333333333)

20:57 lazybot: ⇒ 0.333333333333333314829616256247390992939472198486328125M

20:57 amalloy: &(java.math.BigDecimal. "0.33333333333333333333333333333")

20:57 lazybot: ⇒ 0.33333333333333333333333333333M

20:58 mattmoss: &(let [foo Double/parseDouble] (foo "3"))

20:58 lazybot: java.lang.RuntimeException: Unable to find static field: parseDouble in class java.lang.Double

20:58 amalloy: if you make a bigdec out of a double, you've already lost

20:58 mattmoss: Is there a way to get a "pointer" to a static class method?

20:58 amalloy: lambdas, baby

20:58 #(Double/parseDouble %)

20:58 mattmoss: Man...

20:59 Why does my brain stop working after 5pm?

21:00 ChongLi: blood sugar

21:00 mattmoss: ~brain

21:00 clojurebot: brain dump is http://clj.thelastcitadel.com/clojurebot

21:01 mattmoss: That's a blank page, clojurebot.

21:03 craigbro: amalloy: ah, thanks

21:05 what is current fave neo4j lib/wrapper?

21:08 bbloom: i need to write a library that provides a little database engine in a map

21:09 i find myself regularly making maps that are essentially just indexes and reverse indexes

21:09 and then i have to write this funny looking atom swap! functions to insert or remove from both indexes

21:09 hiredman: bbloom: https://github.com/danlarkin/subrosa/blob/master/src/subrosa/database.clj

21:09 bbloom: or look at clojure.set

21:09 craigbro: bbloom: https://github.com/threatgrid/pldb

21:09 use core.logic 8)

21:09 bbloom: heh, i'm glad i asked :-P

21:10 hiredman: http://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:10 lazybot: Nooooo, 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:11 hiredman: I ran in to https://gist.github.com/3181018 today too

21:11 (speaking of core.logic and databases)

21:12 ohpauleez: yeah, I saw that last week or so

21:12 definitely a cool idea

21:12 craigbro: oh wow

21:13 bbloom: im gonna hand roll this case b/c i have 1 insertion path and 2 deletion paths & the asymmetry is subtle :-/

21:13 dnolen: neat

21:33 yogthos: xeqi: didn't seem like it was necessary yet :)

21:34 xeqi: there's much of value in using the older versions of the template

21:38 TimMc: Hmm, how do I build Leiningen from checkout so I can test out modifications?

21:40 CONTRIBUTING.md seems to indicate that I should be able to simply run the bin/lein in the checkout, but that fails.

21:52 technomancy: TimMc: did you do `lein1 install` inside leiningen-core?

21:53 xeqi: yogthos: 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:54 yogthos: xeqi: yeah it makes archeology a bit tricky :)

21:54 xeqi: thats a good word there

21:54 yogthos: xeqi: 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:56 TimMc: technomancy: Hmm, I think I must have been in the project root.

21:56 Read-o.

22:04 technomancy: 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:10 hadronzoo: I'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:13 xeqi: hadronzoo: pr-str ?

22:13 as in the function

22:13 hadronzoo: xeqi: How would one deserialize from within ClojureScript?

22:14 xeqi: cljs.reader/read-string

22:14 at least thats what fetch uses

22:14 https://github.com/ibdknox/fetch/blob/master/src/fetch/remotes.cljs

22:14 hadronzoo: xeqi: Wow, that's much simpler than I was expecting. Thank you.

22:15 TimMc: EDN is just a fancy name for Clojure (de)serialization.

22:15 I don't know why it exists.

22:16 Something to do with Datomic, I guess?

22:16 hadronzoo: TimMc: I suppose it makes sense to document the format so other languages can consume Clojure services

22:26 TimMc: $latest jkkramer/loom

22:26 lazybot: [jkkramer/loom "0.2.0"] -- https://clojars.org/jkkramer/loom

22:35 seangrove: $latest shoreleave-browser

22:35 lazybot: No project by this name exists on clojars.

23:16 babyclj: hi guys, thought I need someone here to "pimp" my code -- very newbie here :-)

23:16 src is here https://github.com/seymores/twitter-stats/blob/master/src/twitter_stats/core.clj

23:17 akhudek: one thing you can do is try running kibit on it https://github.com/jonase/kibit/

23:18 technomancy: TimMc: 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:19 TimMc: I figured it was either a really bad or really good time to rename stuff.

23:19 technomancy: heh

23:19 akhudek: babyclj: also, you want to use if for things that return things and when for mutable things that do not return values

23:19 TimMc: I was just getting really annoyed at the name of leiningen.new.templates/sanitize

23:19 technomancy: babyclj: 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:19 akhudek: or rather, when is for things with side effects

23:19 technomancy: kthx

23:20 babyclj: lol

23:20 akhudek: hmm yes

23:20 ah kibit looks awesome

23:20 technomancy: TimMc: pretty sure there are extant templates that would break from that; probably not the right timing

23:21 TimMc: When would the right timing be? :-)

23:23 technomancy: we could move it and put a (def ^{:doc "..."} sanitize newname) alias in its place

23:24 but we can't get rid of sanitize until 3.0

23:24 on the bright side, I have concrete plans for 3.0 happening sooner than the 1->2 gap

23:24 TimMc: Nice.

23:28 xumingmingv: anyone have preety emacs color theme to recommand? I know color-theme-soloarized, but it has issue supporting chinese gbk files.

23:29 TimMc: hyPiRion: This is executable "normal" Clojure that should be compilable into swearjure: https://www.refheap.com/paste/8777

23:32 infiniteone: anyone using nrepl and emacs ????

23:33 if so i have a question ???

23:33 lazybot: infiniteone: How could that be wrong?

23:33 infiniteone: not wrong

23:34 looking for a best method to deal with the stack trace which pops up

23:35 Figured maybe someone in the clojure community had a way of dealing with this

23:36 TimMc: A bunch of people use Emacs and nREPL. (I don't.) What's the behavior that is problematic?

23:37 xumingmingv: what will lazybot answer a question even if you didnt ask him?

23:38 infiniteone: when 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:39 something I would get in slime, but my slime clojure-jack-in is broken :-(

23:40 xumingmingv: lazybot: what will you answer a question even if you didnt ask him?

23:40 lazybot: It's AWWWW RIGHT!

23:40 xumingmingv: lazybot: what will you answer a question even if I didnt ask you?

23:40 lazybot: It's AWWWW RIGHT!

23:41 xumingmingv: lazybot: ok, you are brilliant

23:48 xeqi: infiniteone: 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:48 https://github.com/kingtim/nrepl.el/issues/110

23:50 ivan: infiniteone: you can just make that buffer not appear

Logging service provided by n01se.net