#clojure log - May 04 2012

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

0:05 muhoo: turning things into clojure maps is such a joy

0:06 i just did a bunch of data import from excel csv's, and with clojure-csv and a little bit of code it went really well.

0:07 https://refheap.com/paste/2540

0:08 brehaut: couchdb replication is magical

0:08 mdeboard: muhoo: That's cheating imo :P You didn't paste your parse-csv function, where all the cooking is

0:09 muhoo: mdeboard: it's in clojure-csv

0:10 mdeboard: I turned on paredit for the first time in months since this screencast is using it, took about 3 minutes before I remembered why I don't like it.

0:10 muhoo: mdeboard: https://github.com/davidsantiago/clojure-csv

0:10 m0smith: hi

0:10 mdeboard: hi

0:10 LuminousMonkey: mdeboard: You don't? I love paredit.

0:10 m0smith: I am trying to move to 1.4

0:10 LuminousMonkey: Hello

0:10 m0smith: I am getting an error "Too many arguments to def"

0:10 mdeboard: LuminousMonkey: Well, what do I need to do to change ["foo"] to ("foo") ? I can't delete those brackets :(

0:11 muhoo: m0smith: def or defn? :-)

0:11 m0smith: (def ^:dynamic *hibernate-session-factory* "" (atom nil))

0:11 def

0:11 LuminousMonkey: mdeboard: I do a alt-( before the first [

0:11 m0smith: muhoo: Did something change with the dynamics again?

0:11 LuminousMonkey: mdeboard: Then Esc-up on the first "

0:11 muhoo: &(doc def)

0:11 amalloy: mdeboard: you want M-r

0:11 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

0:12 muhoo: ##(doc def)

0:12 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

0:12 mdeboard: Oh, thanks amalloy

0:12 LuminousMonkey: amalloy: I was about to say there might be a better way. :)

0:12 amalloy: that's probably what M-up does, but who wants to leave the home row ever?

0:12 mdeboard: I freak when my backspace stpos working.

0:12 muhoo: m0smith: it doesn't like the docstring?

0:12 amalloy: mdeboard: automatic sliding doors don't let you push them open, but you don't need to so it's fine

0:13 LuminousMonkey: I hate it, when I leave the homerow, that was my reason with sticking to vim, but, er, to lazy to find out another way.

0:13 m0smith: def is bad?

0:13 muhoo: m0smith: in a bot, yes

0:13 LuminousMonkey: Bad def, naughty def.

0:13 muhoo: iirc the bot runs clojail ?

0:14 mos def

0:14 * muhoo ducks

0:15 mdeboard: amalloy: Oh, they let me. http://www.youtube.com/watch?v=6nb0BogGIv0&feature=results_video&playnext=1&list=PL199543E4A9F91CBC

0:16 amalloy: that's not even the door, man. you couldn't find one where someone goes through a door?

0:16 mdeboard: yeah but they all have annoying music

0:20 mattrepl: is there a reason that set! shouldn't work on an Integer field marked as volatile-mutable in a deftype? it's clojure 1.3 and I'm using ^{:volatile-mutable true} theField in the [fields] portion of the deftype form

0:23 hiredman: mattrepl how are you calling set! ? and on what version of clojure?

0:23 mattrepl: hiredman: (set! theField newVal) within a method implementation in the deftype

0:23 amalloy: mattrepl: as long as you're doing it from within the context of the deftype body it should work

0:27 you can see an example at https://github.com/flatland/ordered/blob/develop/src/ordered/set.clj, where (change! field f & args) expands to (set! field (f field ~@args))

0:28 mattrepl: aha, it's set! within a locking macro that fails

0:29 amalloy: mmmmm, that should work too

0:29 unless you try to do it from two different threads

0:30 m0smith: muhoo: yep, no more docstrings in defs (weird)

0:30 mattrepl: compilation won't work if set! is in a locking macro, but works fine when just outside

0:30 amalloy: m0smith: are you sure you aren't accidentally downgrading to 1.2?

0:31 mattrepl: perhaps it's missing metadata for the symbol

0:34 m0smith: muhoo: you are right

0:34 muhoo: :dependencies [[org.clojure/clojure "1.4.0"]

0:35 mdeboard: Is enlive an outlier in terms of its package naming? i.e. ``:dependencies [[enlive "1.0.0"]]`` in project.clj but then in the source I import it via ``:require [net.cgrand.enlive-html]``

0:35 m0smith: but 1.2.1 is in the lib directory

0:40 mattrepl: need to read docs, but problem may be that modification of volatile field uses a lock on the instance being modified

0:41 and why you would use :unsynchronized-mutable...

0:45 muhoo: mdeboard: iirc, package names can, and often do, have nothing whatsoever to do with namespace names

0:45 mdeboard: Right, just confusing

0:47 muhoo: :dependencies [com.lets.drive.everyone.nuts/packagename "1.0.0"] ...... (:require hahahaa.suckers.its.all.different)

0:48 mdeboard: technomancy: By re-running clojure-jack-in is it starting an additional JVM? http://dl.dropbox.com/u/21321471/Screenshot%20from%202012-05-04%2000%3A36%3A44.png

0:50 muhoo: wow, i think i finally got my brain around this whole nosql thing. what a struggle it's been.

0:51 it seems the secret is to do all the calculation at WRITE time. no calculation at all at read time, becuase the query language is so limited.

0:52 technomancy: mdeboard: yeah

0:52 mdeboard: muhoo: That is definitely the case for Solr.

0:53 muhoo: advantage: i can do the calculations in clojure :-)

0:55 LuminousMonkey: Is there a way to take a sequence of maps like this: https://gist.github.com/2592077 and make it a nested map {table-name {column-name {column-detail} column-name2 {column-detail}} table-name2 {column-name {...}}} etc.

0:56 I'm thinking about using group-by in two passes, but is there a cleaner way?

0:56 muhoo: LuminousMonkey: a question for amalloy, i expect :-)

0:58 amalloy: i dunno, you could do it that way, or maybe reduce with update-in

0:59 LuminousMonkey: Hmm, I'll keep playing. :)

0:59 Thanks.

0:59 amalloy: (reduce (fn [m {:keys [table_name column_name] :as details] (assoc-in m table_name column_name (-> details (dissoc :table_name :column_name)))) {} rows)?

1:02 mdeboard: I totally forgot I wrote a url shortener using korma + noir like

1:02 holy stuffing, 6 months ago

1:04 muhoo: does it seem like a message from a distant galaxy when you read it now?

1:04 mdeboard: Yes, I have no idea what's happening

1:04 Something about parentheses

1:05 muhoo: i've experienced this same surreal phenomenon recently too

1:05 mdeboard: only reason I even remembered is because I'm going through this screencast

1:05 and it's building out a url shortener. Seeing the form jogged my memory

1:09 muhoo: i'm surprised there isn't some general function or library in clojure to turn a series of flat rows into a map

1:10 into a tree, really. maybe it's in zippers or somewhere

1:10 mdeboard: What do you mean by flat rows

1:10 muhoo: LuminousMonkey's gist

1:12 mdeboard: Seems like an odd way to handle the data

1:13 LuminousMonkey: Making it into nested maps?

1:14 mdeboard: Yeah, not sure what the use case is though. I'm really tired however, so that doesn't mean anything.

1:15 tomoj: can you give the gist again?

1:16 mdeboard: https://gist.github.com/2592077

1:16 LuminousMonkey: mdeboard: You are probably right, I'm so used to handling arrays.

1:16 clojurebot: Excuse me?

1:17 tomoj: I don't see what kind of nested maps you would make out of that

1:20 mdeboard: I could see e.g. https://gist.github.com/853b5066813fe1c2d329

1:21 LuminousMonkey: I must be thinking the wrong way, I'm going to have to stop and think about it.

1:23 creese: what's the best way to search a string "cat" to see if it contains the letter \a and return true if it does?

1:24 LuminousMonkey: amalloy: Thanks, I got: (reduce (fn [m {:keys [table_name column_name] :as details}] (assoc-in m [table_name column_name] (-> details (dissoc :table_name :column_name)))) {} (get-current-schema))

1:25 Which seems to work, how on earth you came up with that so quick, I don't know. :)

1:25 amalloy: $javadoc String contains

1:25 lazybot: http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#contains(java.lang.CharSequence)

1:26 mdeboard: oh god yes lein2 repl has `exit`

1:26 LuminousMonkey: mdeboard: exit?

1:26 amalloy: mdeboard: accept unix into your heart and type Ctrl-D

1:26 LuminousMonkey: mdeboard: I always used ctrl-D :)

1:27 mdeboard: amalloy: That has left behind a running jvm that I need to then kill

1:27 Raynes: mdeboard: It has always had exit.

1:27 (System/exit 0)

1:27 mdeboard: that's not `exit` :)

1:28 Raynes: It's precisely the same.

1:28 mdeboard: Maybe under the hood, but I shouldn't be expected to google how to exit a repl

1:28 no user should

1:29 Raynes: Every user on this planet knows control d.

1:29 mdeboard: Sure, I just don't want to Ctrl-D and also have to kill -9 whatever

1:30 Raynes: uh

1:30 Ctrl-d kills the process, dude.

1:30 amalloy: Raynes: there have been versions of lein where that's broken

1:30 LuminousMonkey: mdeboard: Maybe a bug? I just tested, and it works correctly.

1:30 Raynes: amalloy: There are versions of Leiningen where profiles didn't exist. Not sure that is relevant either.

1:30 mdeboard: Yeah it works now with lein2

1:31 which is great, hence my excitement :)

1:31 Raynes: :)

1:32 tomoj: mdeboard: yeah

1:34 LuminousMonkey: I get terribly impressed with little things in Clojure, like {:keys } destructing, I did not know that.

1:39 tomoj: do default field aliases in defentity not work in korma?

1:45 ibdknox: tomoj: to my knowledge I didn't implement default field aliases :)

1:45 Raynes: "But I was drunk at the time, so hey, who knows?"

1:46 tomoj: I was using fields instead of entity-fields

1:46 but entity-fields doesn't seem to work either

1:47 (for aliases)

1:47 well, doesn't do anything without aliases either

1:49 ibdknox: tomoj: yeah neither of those implement a magical field replacing strategy

1:49 Raynes: :p

1:49 tomoj: what I usually do is something like (def myfiels [[:a :a2] [:b b2]])

1:49 and just use myfields all over the place

1:50 tomoj: can you just (def entity (fields entity myfields))?

1:50 Raynes: "The whole "documentation everywhere" reminds me of Eclipse. Does he really think this is a new idea? "

1:50 Man, ibdknox, do people not even watch or read about light table before spewing random garbage about it?

1:50 ibdknox: Raynes: my personal favorite are the I could totally write an emacs plugin that does all of that

1:50 I think they might be missing the point

1:51 tomoj: entity-fields is what you want

1:51 LuminousMonkey: all?!

1:51 ibdknox: tomoj: though that means every query will use them by default unless you specify fields manually

1:52 _tca: ibdknox: have you seen blocky?

1:53 tomoj: that's exactly what I want

1:53 but it doesn't seem to work

1:53 (well, not quite exactly, but close enough)

1:53 ibdknox: _tca: I haven't, link?

1:54 tomoj: running (select items (where {:id 3573})) I get all fields when I did (entity-fields :id)

1:54 ibdknox: tomoj: might be a bug. I basically never use that

1:54 _tca: http://blocky.io/blog/

1:54 tomoj: entity-fields or korma?

1:54 ibdknox: entity-fields :p

1:54 _tca: ibdknox: it's pretty relevant to stuff you've been doing

1:55 tomoj: I'll do the myfields thing

1:55 ibdknox: _tca: oh neat :)

1:58 LuminousMonkey: I think Bret Victor would be happy with all the stuff that's been happening from his concepts.

2:01 ibdknox: _tca: thanks for that pointer

2:01 looks like he's doing some cool work

2:02 LuminousMonkey: yeah, it's funny. They're all old ideas. We just needed people championing them again

2:02 I stopped thinking about dev tools for a good bit

2:04 LuminousMonkey: ibdknox: Everything in Comp Sci seems to be based off old ideas. :)

2:04 ibdknox: all of it was invented in the 70's by Xerox-PARC ;)

2:05 muhoo: ibdknox: no, 1969: http://en.wikipedia.org/wiki/The_Mother_of_All_Demos

2:05 LuminousMonkey: 1968? :P

2:06 muhoo: 1968, sorry. i saw the video of it. it was breathtaking. http://www.dougengelbart.org/firsts/dougs-1968-demo.html

2:06 ibdknox: huh

2:06 I thought that was in 74

2:06 muhoo: it felt a LOT like watching ibdknox's demo of lighttable :-)

2:06 ibdknox: something important went down in 74

2:06 LuminousMonkey: muhoo: Thanks for that link, I'll watch that later.

2:15 michaelr525: hey

2:16 why my uberjar doesn't work? I specified :main in project.clj

2:16 java -jar uberjar.jar says it can't find the main class

2:17 LuminousMonkey: And you have (defn -main ...) in the ns you specified with :main in project.clj?

2:18 michaelr525: yup..

2:19 I found someone saying that one has to include a third component in the namespace

2:19 mine only has two components

2:20 LuminousMonkey: I think you might also need (:gen-class) in the namespace declaration that you're using as main?

2:20 Raynes: Yes.

2:22 michaelr525: Yes?

2:22 clojurebot: yes is is

2:22 muhoo: interestingly, in noir projects (maybe for ring projects too?), no such gen-class seems necessary for main

2:23 michaelr525: yes for :gen-class?

2:23 Raynes: Are you running it with `lein run`

2:23 muhoo: ^

2:23 muhoo: ah, yes.

2:23 Raynes: Yeah, lein handles it itself.

2:23 muhoo: i guess lein-uberwar injects that for me

2:23 lein ring uberwar, sorry

2:27 michaelr525: can I still run it from the repl or `lein run` after adding :gen-class?

2:27 ok :gen-class solved the uberjar problem

2:27 hey nathan

2:39 aperiodi1: michaelr525: yes, you can still launch it in all the normal ways

2:40 aperiodic: i have run into issues where what's in classes/ matters, but i do a lot of kinda hairy java interop (hadoop) so you might not run into that

2:41 judicious use of lein clean; lein compile will handle those sorts of things, though

2:54 michaelr525: aperiodic: cool

2:54 thanks

2:55 how do you guys feel about debugging clojure?

2:56 I mean, when I work in Visual Studio with C# I just press F5 and if the program fails, the debugger breaks in at the failure point and I have everything there

2:57 when something fails in clojure I just have the stacktrace and have to start debugging with pprints and such

3:33 mojito: hi im making my way through clojure koans from: https://github.com/functional-koans/clojure-koans

3:33 im stuck at - "Higher-order functions take function arguments" (= 25 (___ (fn [n] (* n n))))

3:34 my guess was that i could use some kind of "apply" the fn to an arg

3:34 is that the intent of this koan?

3:37 michaelr525: i think ->

3:38 mojito: ^

3:39 mojito: michealr525: ok -> is interesting. but the intent seems to be HOF.

3:39 i googled around and found #(% 5)

3:39 michaelr525: # is also a macro

3:40 mojito: my question is: what should i take away from this koan? that functions can take functions as arguments? or something else?

3:41 michaelr525: i don't know, i never solved any koans :)

3:42 mojito: :)

3:42 nm. thanks anyway.

3:42 emezeske: mojito: I think that is what you are supposed to take away.

3:42 E.g. functions are just values like everything else, and you can pass 'em as args, etc, etc

3:43 mojito: emezeske: cool

3:54 kral: namaste

4:44 y3di: does anyone know which company backed lighttable 10k?

4:49 Raynes: y3di: Yep.

4:50 Can't say I remember at the moment htough.

4:50 though*

5:00 y3di: Raynes: ah, well if you remember, do post it here

5:00 also it looks like lighttables funding is guaranteed

5:00 (basically)

5:00 tis good to see

5:02 ejackson: yeah, its great stuff

5:14 how does one override lein2's repository locations ?

5:14 I have a local nexus and maven is happily using it, but lein thumbs it nose at me

5:36 qerub: Hello. What's the proper way to use clojure.contrib.str-utils (re-gsub) with Clojure 1.3?

5:37 ejackson: str-utils is deprecated

5:37 check out clojure.string

5:37 qerub: Ah, right. Thanks!

5:38 clojure.string/replace will do the trick indeed.

5:38 ejackson: http://clojuredocs.org/clojure_core/1.3.0/clojure.string

6:34 cshell: waking up early: the world's way of giving you an opportunity to get ahead of your competition

6:37 beffbernard: cshell: or you just can't fall back asleep

6:37 ;)

6:57 cshell: beffbernard: haha, that too ;-)

7:10 ssedano1: Hi, how can I make an array of java.lang.String ? I need because of a java method that expects a vararg

7:12 &(into-array ["blah"])

7:12 lazybot: ⇒ #<String[] [Ljava.lang.String;@c056dc>

7:12 ssedano1: coola

7:12 cool*

7:14 lucian: O'Reily 50% off sale to support DRM-free books

7:14 * lucian just got Clojure Programming

7:14 lucian: s/books/ebooks/

7:34 cshell: lucian: that is the best book on clojure that I've found

7:36 lucian: cshell: i read the preview and had the same impression

7:36 i'm a bit too poor for the full price version, but this i've certainly bought

7:37 and hopefully it'll help O'Reily's statistics about how well their DRM-free sale went

7:39 x_or: I'm using emacs/slime to do some clojure programming. I am trying to use the repl, and getting this error: "Unable to resolve symbol: shorten in this context"

7:39 I have defn'd shorten, but my repl does not seem to be able to access it.

7:39 cshell: lucian: it's great, it has a chapter for all the questions I've ever had about clojure - Chapter 12: how java design patterns map to clojure and then a later chapter that has a flowchart of which type of data structure to use

7:40 x_or: what namespace are you in?

7:40 x_or: foobar.core

7:40 Do I need to prefix the call with that?

7:40 cshell: and you defined it in there?

7:40 x_or: No, and I'm new to clojure, so bear with me. The code is like this

7:40 lucian: cshell: the former isn't entirely relevant to a pythonista, but i've thumbed through and looks very nice

7:41 x_or: (ns foobar.core (:use ...) (:require ... ))

7:41 (defn shorten [] ... )

7:41 So, shorten is outside of the NS, right?

7:41 cshell: right, but the default namespace in the REPL is user

7:41 type *ns* at the repl and it will tell you which one you're in

7:41 x_or: OK. It shows user> at the prompt.

7:42 cshell: lucian: good point - it has some good python references in there too

7:42 x_or: #<Namespace user>

7:42 cshell: x_or: type (require '[foodbar.core :as f])

7:42 then you do f/shorten

7:42 er, foobar even

7:43 cemerick: That flowchart originated here, BTW: http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/

7:43 x_or: Says unmatched delimiter, do I need to use :require?

7:44 Chousuke: you're missing a paren somewher

7:44 e

7:44 cshell: x_or: :require is needed for the REPL - you're missing either a bracket or a paren

7:44 x_or: OK, will verify.

7:45 cshell: cemerick: thanks Chas, you've written a great book - the namespace chapter really clarified things for me - especially regarding use vs refer and require - i'm waiting to read even more, and when i'm done i'll give it a five star review on amazon

7:46 cemerick: cshell: thanks, I'm glad you're enjoying it :-)

7:47 cshell: cemerick: 600 pages - incredible - how long does it take to write a book like that? (and maintain such high quality, of course)

7:47 x_or: cemerick: I really enjoyed your screencast via Oreilly the other day. Not sure if you felt this way, but seeing you troubleshoot when things went awry was actually very helpful to me.

7:47 cemerick: cshell: Well, I had help, too :-)

7:48 But, the writing essentially took a full 12 months.

7:48 Plus 4 months on each end of that for all sorts of *stuff* around the project.

7:49 cshell: cemerick: wow, amazing - that contrasts so much with other authors I know who just throw together a basic example and write 200 pages about it in two weeks

7:49 cemerick: hah, which authors can do that?! :-)

7:51 cshell: Haha, I forget his name, but he was a part time trainer for a software company and told me he'd just read the specs, and just make an example based off of it - he said he was contracted for about one a month or so - but like most of the tech books out there now, it lacked in depth - you guys seem to have covered everything

7:52 every question i've had so far, whether about syntax, idioms, or moving from java, has all been answered

8:02 Borkdude: I have this git project: https://github.com/Borkdude/tictactoe. I cloned it, created a general project out of it in Eclipse and now want to turn on Clojure+Leiningen support

8:02 When I try to turn on Clojure support I get this: http://twitpic.com/9h51np

8:03 why?

8:03 clojurebot: why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

8:04 Borkdude: cemerick: poke

8:05 cshell: Borkdude: there's probably a message in a log file somewhere that will help you

8:05 cemerick: Borkdude: can you paste the project.clj?

8:06 Borkdude: cemerick: it's on github, https://github.com/Borkdude/tictactoe

8:06 cemerick: and yeah, there's probably a helpful exception in the error log

8:06 sorry, didn't scroll up :-)

8:06 well, that's simple enough

8:07 Borkdude: cshell: cemerick do you mean in the "Problems" view?

8:07 cemerick: Borkdude: nope; Window > Show View > Error Log

8:08 Borkdude: cemerick: wanted to try out the approach from your video

8:08 cemerick: but maybe I missed something?

8:08 cshell: Borkdude: Can you run the project from the command line with lein?

8:08 cemerick: Borkdude: I just created a project and added Leiningen support without an issue using that project.clj. Definitely need that stack trace.

8:09 Borkdude: cemerick: ow, here it is: Nature ccw.nature is missing prerequisite nature: org.eclipse.jdt.core.javanature.

8:10 cemerick: yuck

8:10 Borkdude: cshell: I think so, but I want to try it from Eclipse only (it's for my students, so that they won't have to install the script)

8:10 cemerick: Borkdude: what sort of Eclipse build do you have? Does it have Java support in it?

8:10 cshell: Borkdude: something seems wrong with your eclipse install - I don't think that error is clojure/lein related

8:10 cemerick: also, what version of ccw?

8:10 Borkdude: cemerick: yes, it's Indigo, the J2EE version, I do lots of Java and Clojure things with it

8:11 cemerick: 0.7.0.STABLE001

8:12 cemerick: hrm, same as me, mostly

8:12 Borkdude: cemerick: I did forget anything? I created a "general project" instead of a Java or Clojure project, but I saw that from your video I think

8:12 "did I" I mean..

8:12 cshell: Borkdude: It's not a clojure 1.2.0 vs 1.3.0 is it?

8:14 Borkdude: cshell: hem, it says clojure 1.2.0 in the project.clj but ccw doesn't look at this right

8:14 cemerick: ah-ha

8:14 Borkdude: you have to add Leiningen support first, *then* Clojure.

8:14 Borkdude: cemerick: ah… sorry then

8:14 :(

8:14 cemerick: Adding the lein support coerces it into a JDT project, which explains the error message.

8:15 cshell: interesting quirk

8:15 cemerick: lpetit is working on a proper leiningen/clojure import wizard AFAIK

8:15 Borkdude: cemerick: so from configure I should see "add leiningen support"?

8:15 cemerick: cshell: that's an artifact of bootstrapping the thing from a bare project, vs. a Java or Clojure project from the start.

8:16 Borkdude: cemerick: I don't see this option…

8:16 cemerick: Borkdude: right-click project node > Configure > Convert to Leiningen Project

8:17 cshell: cemerick: ah cool

8:17 Borkdude: cemerick: http://twitpic.com/9h58nj ...

8:17 cemerick: Borkdude: have you not installed the Leiningen eclipse plugin?

8:18 http://ccw.cgrand.net/updatesite-lein-betas is the update site FYI

8:18 Borkdude: cemerick: I thought I had, but I must have removed it…. going to try it again

8:21 cshell: Does anyone know the state of ClojureScript? Is it mature enough to use on a production app?

8:21 Borkdude: cemerick: ok did that… and now add clojure support to it?

8:21 cemerick: after adding leiningen support I mean

8:23 cemerick: Borkdude: Yup

8:24 Borkdude: cemerick: I keep getting the same msg

8:24 cemerick: does the project now have a "Leiningen dependencies" classpath container within it?

8:24 Borkdude: cemerick: Problem requiring namespace/getting var ccw.clojure-project-nature/factory from bundle ccw.core

8:24 cemerick: no...

8:25 cshell: restart eclipse?

8:25 cemerick: There's something wonky.

8:25 I would suggest: cloning the project clean

8:25 and, if you didn't restart eclipse after installing the leiningen plugin, doing so

8:26 (I've never been able to install an eclipse plugin, enable it, and use it properly without restarting) :-(

8:26 Borkdude: cemerick: ah.. the plugin installation doesn't demand it? then I didn't do it, will do now

8:27 cemerick: let me just try the workflow from the beginning, having restarted eclipse

8:29 cemerick: deleted project. did a git clone, made a project in eclipse. "convert to leiningen project" -> Unhandled event loop exception

8:30 cemerick: bizarre

8:30 Borkdude: cemerick: https://gist.github.com/2594486

8:30 cemerick: whoa, clojure.core/refer is unbound?!

8:30 something is definitely wonky in your environment / install

8:31 I suggest reporting this (e.g. to http://groups.google.com/group/clojuredev-users/) with the stack trace and a link to the project, etc.

8:31 x_or: cshell: I've tried all the things you suggest, but still cannot get this (https://gist.github.com/2594485) to work. cemerick: I am using the example you used a few days in your webcast.

8:31 When I run (require '[foobar.core :as f]) I get "Unmatched delimiter: ]"

8:32 cemerick: x_or: You have an extra ] instead of a ) after the compojure.core :use

8:34 x_or: cemerick: OK, that makes sense. Now when I run the require I get "Could not locate compojure/core__init.class or compojure/core.clj on classpath:"

8:35 Borkdude: cemerick: I had this error before, this is why I de-installed the leiningen plugin before I think… can try a fresh Eclipse

8:35 x_or: Shouldn't lein manage dependencies for me? Or, do I need to run something within emacs to handle installing compojure?

8:35 cemerick: x_or: yes, you should absolutely be using Leiningen.

8:35 Sorry, misread that Q :-)

8:36 x_or: how are you starting a REPL within emacs?

8:36 x_or: clojure-jack-in

8:36 lein is in my path.

8:37 cemerick: I'd start a REPL on the console `lein repl` and see how things go. If things work fine there, then you need to find an emacs wizard to help you with that department. :-)

8:37 x_or: cemerick: Sounds good. Thanks, appreciate getting feedback from the guru. :)

8:38 Same error: FileNotFoundException Could not locate compojure/core__init.class or compojure/core.clj on classpath: clojure.lang.RT.load (RT.java:430)

8:39 cemerick: x_or: can you paste your project.clj?

8:39 x_or: Do I need to do something special to install compojure?

8:41 Ooh that is the problem...

8:43 felideon: ooh nice, Clojure Programming ebook for $17.99

8:43 (today)

8:47 Borkdude: cemerick: fyi, a fresh Eclipse with a fresh leiningen plugin, I get this https://gist.github.com/2594570

8:47 cemerick: will e-mail it to the list now

8:47 cemerick: man, that's a low-level failure :-|

8:51 robertstuttaford: has anyone got any pointers to quickstarts with clojure and mongodb? as a learning project i want to replicate a rest json api we have together using ring and compojure that uses our mongo db

9:01 Borkdude: cemerick: sent the e-mail, I'm off now

9:11 mdeboard: So is this just how pattern matching in Clojure works? dnolen just tweeted this a bit ago https://gist.github.com/2594296

9:13 babilen: mdeboard: For further details see https://github.com/clojure/core.match

9:13 mdeboard: So, yes then?

9:14 Licenser: pattern matching is cool

9:14 mdeboard: lokos like it, p funny. I think his gist is in response to http://news.ycombinator.com/item?id=3927652

9:14 cemerick: yes, that's one approach to pattern matching

9:14 surely the most popular, as these things go

9:14 robertstuttaford: *tries to understand it*

9:15 mdeboard: robertstuttaford: It helps to think of it in terms of "if/else if" blocks

9:15 It helps me*

9:16 robertstuttaford: so the first [] {} is and if () {}, and the rest of the [] {} are else if () {}?

9:16 an*

9:16 oh i get it

9:16 that's awesome!

9:16 Licenser: it is

9:16 * Licenser luvs it

9:17 Licenser: then again I'm an erlang person :) have to

9:17 robertstuttaford: i'm about 5 days into FP as a whole

9:17 mind blown regularly

9:17 Licenser: yea get a good head to cover all the brain that will gow out of the craters

9:18 robertstuttaford: i'm busy doing the clojure koans. really enjoying it

9:19 Licenser: can imagine :) it's one of the greatest langauges to learn

9:25 robertstuttaford: this one's confused me

9:25 (= 25 (___ (fn [n] (* n n))))

9:25 mdeboard: Is pattern matching considered cyclomatic complexity?

9:25 robertstuttaford: "Higher-order functions take function arguments"

9:32 _KY_: Is there a function to find the position of a sub-list within a list?

9:34 mdeboard: _KY_: Is this a list of lists? e.g. '((1 2) (3 4) (5 6)) etc?

9:34 _KY_: No just a flat list...

9:35 So I want to find say [4 5 6] in [2 3 4 5 6 7]

9:36 mdeboard: Right, there are several "longest common subsequence" algorithms, e.g. http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm not sure if there's a stdlib implementation

9:36 robertstuttaford: clojure.set/intersection?

9:36 clojurebot: clojure is the bestest programming language available.

9:37 mdeboard: robertstuttaford: He wants position though

9:37 robertstuttaford: ah

9:41 _KY_: Just a simple function will do... the lists are tiny =)

9:42 dxlr8r: trying to set up leiningen… but it stands on "Downloading index from central - http://repo1.maven.org/maven2" forever when I try to search for something

9:42 I have a fast internet, been at it for over half an hour

9:42 _KY_: Yeah I have that problem before

9:43 mdeboard: robertstuttaford: I dunno about higher order functions but #(% 5) solves your question earlier

9:43 _KY_: The site seems overloaded or broken

9:43 dxlr8r: du -s .m2 , it doesn't get bigger either

9:43 mdeboard: # is just a macro for an anonymous fn though

9:43 _KY_: I ended up not searching and asking for others to fill in the incantations

9:43 dxlr8r: _KY_ why does that always happen when us noobs are going to test out stuff? :P

9:44 robertstuttaford: mdeboard: yes, thank you, got there

9:44 _KY_: =)

9:45 robertstuttaford: i was able to install lein2 earlier today

9:45 dxlr8r: well, trying to delete .m2 and se what's happening

9:45 robertstuttaford: using the instructions on the lein github page

9:45 dxlr8r: yeah, me 2

9:46 there should be mirrors

9:47 mdeboard: (= 25 (->> 5 ((fn [n] (* n n))))) is a better way imo, but doesn't fit the problem

9:48 dxlr8r: the few times I have been dealing with maven it has seemed to fuck up everything...

9:48 robertstuttaford: i have yet to learn about (->) and (->>)

9:52 mdeboard: they're pretty neat

9:59 robertstuttaford: how many 'core' functions are there to learn?

9:59 clojurebot: anonymous functions are functions with no names

9:59 robertstuttaford: tens? hundreds?

9:59 clojurebot???

9:59 lazybot: robertstuttaford: Oh, absolutely.

9:59 clojurebot: clojurebot is amazing

9:59 mdeboard: lol

10:01 robertstuttaford: http://www.clojureatlas.com/org.clojure:clojure:1.4.0?guest=t

10:01 uvtc: robertstuttaford, http://clojure.org/cheatsheet

10:01 robertstuttaford: i guess the only function i need to know is (doc)

10:01 awesome

10:03 mdeboard: I'm not sure how I feel about the atlas

10:04 x_or: I'm getting a "Too many arguments to def" error when I attempt to require my module. Is there a reference on how to breakdown the stack trace and understand whether this is an issue in my code or the clojure library?

10:04 acheng: robertstuttaford: sometimes find-doc before doc, and sometimes just #clojure :-P

10:04 robertstuttaford: ah, find-doc - thanks for that!

10:05 mdeboard: x_or: If there is a good/simple/straightforward way to understand stack trace for Clojure (any JVM language, I expect) I don't know what it is.

10:05 Not that me not knowing is indicative of a larger issue

10:06 x_or: mdeboard: :)

10:07 mdeboard: x_or: I've never used this, and just found it via google, but http://richhickey.github.com/clojure/clojure.stacktrace-api.html

10:07 lazybot: Nooooo, that's so out of date! Please see instead http://clojure.github.com/clojure/clojure.stacktrace-api.html and try to stop linking to rich's repo.

10:07 mdeboard: oops, your'e right lazybot, sory

10:07 didn't check the uRL

10:07 fliebel: x_or: Usually when I get that error, I have been doing Python, and defined a function using def instead of defn

10:07 mdeboard: ha

10:07 felideon: lol nice lazybot

10:08 fliebel: Can't rich just fix the internet and update his clojure repo?

10:08 acheng: robertstuttaford: thanks for the tip yesterday that paredit exists in eclipse (and not just in emacs) i didn't know that

10:09 ssedano1: How can I create an array of a certain enum to pass it to a java method vararg?

10:09 x_or: fliebel: Yep, that was it.

10:09 mdeboard: awesome

10:10 fliebel: ssedano1: An array of an enum?

10:10 robertstuttaford: my pleasure. CCW is great

10:11 paredit is fantastic

10:11 ssedano1: (into-array [(Enum/VALUE)]) ?

10:13 yeah that it is

10:15 &(into-array [java.lang.Integer/MAX_VALUE])

10:15 lazybot: ⇒ #<Integer[] [Ljava.lang.Integer;@6a67dc>

10:18 mdeboard: cemerick: If I pay for Atlas is there a setting to stop the bouncey nodes

10:18 cemerick: bouncey nodes?

10:19 mdeboard: the animation

10:19 ssedano1: fliebel: I need to call a java method that expectes a vararg of an enum type

10:19 fliebel: that's why I needed to create a java array of one enum value

10:19 fliebel: ah

10:19 ssedano1: but I figured it out, thank you

10:19 mdeboard: Like, not totally stop it but it's hard to find what I want quickly as I need to wait for the animation to stop

10:20 cemerick: mdeboard: oh, I see. Yes, that's probably the #1 gripe.

10:21 working on it :-)

10:21 it's a particle simulation underneath, which hopefully partially explains the challenge.

10:21 mdeboard: cool, good enough for me

10:21 fliebel: cemerick: What is the advantage of paying anyhow? Does the try function expire eventually?

10:21 cemerick: fliebel: it'll stop nagging you

10:21 mdeboard: i like paying people for neat stuff they make as long as it's not ridiculously expensive

10:21 and $5 isn't bad

10:22 fliebel: hadn't noticed the nagging...

10:22 mdeboard: fliebel: Clean up your room

10:22 cemerick: fliebel: heh, maybe I have it set too high; I think it starts after 25 clicks or something.

10:22 mdeboard: and call your mother more often

10:22 fliebel: mdeboard: ?

10:22 mdeboard: nagging

10:22 uvtc: not naggy enough. Must increase nagging factor.

10:24 fliebel: I wonder if Atlas + Light table is something interesting.

10:28 mdeboard: rm seo/tests/runner.py

10:28 feh

10:28 robertstuttaford: heh

10:30 TEttinger: I assume many people in here know about http://www.kickstarter.com/projects/ibdknox/light-table?ref=home_popular ?

10:31 I'm kinda wondering if I want to back it

10:31 espeed: how do you enable SLIME REPL history for the up arrow?

10:32 fliebel: TEttinger: You want. At least, deep inside...

10:32 TEttinger: as long as ibdknox isn't this guy http://penny-arcade.com/comic/2012/05/04

10:35 uvtc: What does it mean for a data structure to "participate" in an abstraction? (primary Clojure abstractions such as Collection, Sequence, Associative, etc.)

10:36 (Reading the wonderful "Clojure Programming" book, btw. Thank you authors (cemerick, not sure of others' nicks).)

10:36 Is an abstraction defined by the functions that are expected to work right on object types which implement said abstraction?

10:37 mdeboard: TEttinger: I kicked in a couple dollars toward it, based strictly on the strength of ibdknox's contributions to Clojure in general. I wasn't as amped about the idea in general as others, tbh. But he's one of those dudes I feel like can make something cool given resources.

10:37 uvtc: It seems like you're asking about the general concept of an abstraction

10:39 uvtc: mdeboard, Well, I know what an abstraction is in terms of OOP languages. You've got an abstraction which says, "if your object supports these methods, than it implements the abstraction". If it quacks like a duck ...

10:39 s/than/then

10:40 But in Clojure, the data structures are just data ...

10:41 mdeboard: Well, they're not JUST data, they're also instructions. instructions which abstract away implementation details from the user while preserving semantics

10:42 e.g. &(doc partial)

10:42 uvtc: mdeboard, I don't see how, say, a vector is "also instructions". It's just an indexable sequence of things, afaict.

10:42 mdeboard: &(doc partial)

10:42 lazybot: ⇒ "([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & more]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."

10:42 faust45: hi guys

10:42 robertstuttaford: data that contain instructions that cause the runtime to do things. those instructions belong to these abstractions

10:42 faust45: is it right way to handle non block io with agents send-off

10:42 ?

10:43 Chousuke: uvtc: the abstractions define a bunch of operations that the data structures support

10:43 mdeboard: uvtc: I think in the book (I don't have it in front of me) participation in an abstraction just means that that particular data type is used to create the abstraction. e.g. seqs used to create like (take), (drop) etc

10:43 uvtc: Chousuke, but how does a data structure "support" anything? Isn't it up to the function to decide if it supports the data structure?

10:43 Chousuke: uvtc: no

10:44 uvtc: the data structure determines what operations are sensible.

10:44 you can't add in the middle of a vector for example

10:45 and linked lists are not associative, so it makes no sense for them to implement lookup by key

10:45 mdeboard: There are certain operations that can be efficiently executed on one data type but not another, etc.

10:45 bolic: Is anyone using clojureql? I would like to process a large resultset sequentially, using paging (mysql first/max). Is there a way to do it without using take/drop? Here's an attempt that doesn't work so far http://pastie.org/3859229 (see comment below the code: no paging params in the generated sql)

10:45 uvtc: Chousuke, Oh, implement behind the scenes. Hm.

10:46 mdeboard: uvtc: "implementation behind the scenes" is the a characteristic of an abstraction

10:47 whoops, "is a core characteristic"

10:47 Chousuke: uvtc: but in essence each abstraction is just a bunch of operations with no data attached to them

10:47 which is different from usual class-style abstraction which couples data and operations

10:47 and which is generally frowned upon in clojure-land :P

10:48 mdeboard: oh hm, never really made that connection

10:48 * uvtc ruminating...

10:48 mdeboard: ditto

10:49 uvtc: Chousuke, mdeboard I think my brain has been stuck in OO-mode for a while. Thanks for the help.

10:50 Chousuke: in a Clojure application you could just as well provide an abstraction as a bunch of functions, with no language-level "interface" behind it

10:50 mdeboard: uvtc: Yeah was just thinking that I haven't trained my brain to flex the FP muscles while relaxing the OO muscles

10:51 Like how I can wink my right eye without moving my left, but not vice versa :P

10:51 uvtc: The book mentions the Collection abstraction, and then lists: conj, seq, count, empty, and =. If some data objects behaves correctly when those fn's are called on it, then it implements the Collection abstraction. Correct?

10:51 gfredericks: mdeboard: ;)

10:51 uvtc: s/data objects/data object/

10:52 Borkdude: functions are objects, sometimes with data attached (closures)

10:52 Chousuke: uvtc: yeah. and in the JVM implementation the objects actually implement the corresponding interface(s).

10:53 TimMc: gfredericks: ¦)

10:53 Borkdude: I need caffeine now...

10:53 Chousuke: but eq java String works with seq even though it doesn't implement the clojure interface; it's special-cased in the implementation

10:53 so you could say it participates in the abstraction because all the user sees of it the "seq" function

10:54 +is

10:54 gfredericks: TimMc: ooooooh

10:54 TimMc: I bet that took practice

10:54 Chousuke: also eg

10:54 :P

10:54 uvtc: Chousuke, Thank you.

10:54 gfredericks: huh; do string seqs hold a ref to the string?

10:55 joegallo: mdeboard: a semi-related thought. java has a "stream" abstraction. but there's no class for stream itself. there's InputStream and OutputStream, and they represent aspects of the stream abstraction, but the language itself doesn't have (doesn't need?) a mechanism for elaborating on that thing by itself. (this seems related to me, but if it just confuses things more, then please ignore me.)

10:55 Chousuke: gfredericks: as far as I know yes

10:55 mdeboard: joegallo: No I see what you mean

10:55 S11001001: unfortunately forall x,y in javaarrays, (= (seq x) (seq y)) does not imply (= x y)

10:55 Chousuke: yeah seqs over mutable things are a bit iffy :/

10:56 TimMc: gfredericks: Does your keyboard still have the ¦ symbol for the | key? Mine doesn't. When did that happen?

10:56 mdeboard: |)

10:56 Chousuke: actually, mutable things are a bit iffy :p

10:56 gfredericks: TimMc: nope

10:56 |)

10:56 I guess that's a geordi face?

10:56 mdeboard: |-) looks mor eli--

10:56 dammit

10:57 * gfredericks wins

10:57 Chousuke: hmm, I can get ¦ with shift-altgr-<

10:57 I wonder if that character is useful somewhere

10:57 gfredericks: demonstrating double-winking skills

10:58 TimMc: gfredericks: I practice that every night, for hours at a time.

10:58 Sometimes it causes me to hallucinate.

10:58 gfredericks: crap

10:58 mdeboard: lol

10:58 @ that description of blinking/sleeping

10:59 TimMc: There: https://en.wikipedia.org/wiki/Vertical_bar#Solid_vertical_bar_vs_broken_bar

11:00 ejackson: geordi face !

11:00 acheng: ;) !)

11:00 gfredericks: I would go drinking at a place called "Solid Vertical Bar Vs Broken Bar"

11:04 Fullmoon: Could someone critique a little bit of code I wrote to read all the output of a shell command? I am not quite sure I do the right thing wrt reading from the stream

11:05 https://gist.github.com/2595281

11:05 gfredericks: immutability in parenting: "changing" a diaper does not actually alter the original diaper, but rather returns a new diaper.

11:06 tmciver: gfredericks: yeah, but the *baby* alters the original diaper . . .

11:07 acheng: garbage collection on the old diaper happens too slow imho

11:08 michaelr525: err

11:10 gfredericks: tmciver: I infer from your punctuation that babies can have thread-local bindings

11:13 nDuff: gfredericks: ...there certainly do exist people for whom who is and is not their baby depends on context.

11:14 mdeboard: I am so disturbed.

11:14 dynamic babies

11:14 gfredericks: (with-baby jake (generate-birthday-gift))

11:17 tomoj: Fullmoon: you shouldn't need to read char by char

11:18 Fullmoon: tomoj: Yeah, I could read it into buffers, but then the if-eof check is more the thing which I think is most problematic

11:18 tomoj: (defn exec [command & args] (slurp (.getInputStream (run-process (into [command] args)))))

11:20 also I imagine this is a pedagogical example, but https://github.com/Raynes/conch

11:21 Fullmoon: tomoj: Nice, thank you

11:22 Borkdude: when I do a "lein test" on this one https://github.com/Borkdude/tictactoe it also tries to test the namespace "testdata", can I tell lein that this namespace doesn't contain tests?

11:23 not such a big deal btw

11:31 TimMc: Fascinating. If I understand this correctly, the JVM considers a method's return type to be part of its signature, but Java does not.

11:32 nonuby: TimMc, that essential or how would object a = x.method1() work

11:32 rhc: TimMc: what are the implications of that?

11:32 mefesto: TimMc: How so? I thought Java did

11:33 nonuby: if there exists a method1() that returns Car

11:33 TimMc: So to account for narrowing return types in Java-method "overrides", the compiler inserts a synthetic bridge method with the wider return type.

11:33 nonuby: and method1() that returns Truck

11:33 both derives types of Object

11:33 rhc: ah crazy

11:33 similar weirdness in C++ with narrowing retrn types in derived classes

11:34 TimMc: mefesto: Java only pays attention to the params.

11:34 chouser: TimMc: if that's right, that's the clearest explanation of bridge methods I've ever heard. Thanks!

11:34 TimMc: chouser: Well, there are other kinds of bridge methods, too. The problem is, they apparently aren't documented in the JVM spec. They just exist...

11:35 ^ second-hand information

11:35 Borkdude: what is a bridge method?

11:35 mefesto: TimMc: But if you implement an interface you must have an acceptable return type for the methods you implement, no?

11:36 TimMc: mefesto: Yes, but the return type can be narrower.

11:36 rhc: mefesto: check this out http://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html

11:37 TimMc: Yep, that's the source I used.

11:41 rhc: that's interesting when you think about performance: every call to a generics base class will actually incur two function calls, right?

11:45 mefesto: interesting

11:45 TimMc: Sure, but function calls are pretty fast, and I would imagine that HotSpot can inline such tiny methods.

11:46 yoklov: i mean, lambda is the ultimate goto, after all :p

11:46 though i don't know if the jvm has gotos

11:47 dnolen: yoklov: exceptions

11:48 fdaoud: Hi all. I'm looking at Mustache and I don't "get" what lambdas are or why you would need to use them in your templates. Any enlightment would be appreciated.

11:49 yoklov: dnolen: ah, that sorta makes sense. exceptions are sort of more general than gotos though, right?

11:49 or more specific maybe, hm

11:49 dnolen: yoklov: yes more specific.

11:50 yoklov: fdaoud: what sort of languages do you have experience with?

11:50 a lambda is just a first class function, equivalent to javascript's `function` keyword

11:50 fdaoud: yoklov: Java, Clojure, Groovy, Ruby..

11:51 yoklov: it's the fn keyword in clojure, and something like blocks/procs/lambdas in ruby

11:51 fdaoud: yoklov: ok, I'm with you there. I just don't understand how they are used in Mustache templates, what problems they solve.

11:52 yoklov: I mean, wouldn't you just do all the "hard work" in Clojure to prepare a data structure for the view, and just ship it off to a simple Mustache template?

11:52 bhenry1: someone refresh my memory. what would make me want to put ^:export in a clojurescript defn?

11:53 yoklov: fdaoud: i don't really have experience with moustache, i experience explaining lambdas to people, haha.

11:53 fdaoud: yoklov: fair enough :-)

11:54 yoklov: Though, looking at it it looks like they serve the purpose of allowing you to write more customizable templates

11:55 vojd: fdaoud: if i understand it correctly its not too far from a macro. the lambda is called and expands into the template

11:55 so you could cleanly print {{ nof_users }}

11:55 and then have a lambda which would format the html around that block

11:56 yoklov: the documentation has {:greet #(str "Hello, " %)} and then {{#greet}}Felix{{/greet}}, which inserts the output of (#(str "Hello, " %) "Felix") into whatever you are templating

11:56 vojd: check here: http://mustache.github.com/mustache.5.html and scroll down to Lambda

12:00 fdaoud: yoklov, vojd: I've read the docs and the examples. I just don't understand why you need that. Why not just {:greet (greet "Felix")} and (defn greet [x] (str "Hello, " x))

12:00 then the template just has {{greet}}

12:00 vojd: fdaoud: my quick answer is. moustache wasnt written with clojure in mind ;)

12:01 think of all the other languages out there which would benefit greatly from a neat template language

12:01 yoklov: fdaoud: what if you want to greet many people the same way?

12:01 you could just use greet, and then later should you want to change the way you greet them you only need to change the definition of greet

12:02 fdaoud: yoklov: {:greet (map greet many-people)}

12:02 vojd: another plus for moustache is that a person familiar with it can work together with devs from clojure, python, java and still have a tool which works in all areas

12:02 yoklov: fdaoud: wouldn't work if those greetings weren't all in the same place

12:02 _tca: fdaoud: it's all preference

12:03 yoklov: fdaoud: using it as a function is more flexible

12:04 fdaoud: but yeah, it comes down to personal preference.

12:04 though i think using functions would prove to be less of a pain to maintain in the future.

12:05 fdaoud: yoklov: ok, I think I get it. thanks.

12:08 yoklov: fdaoud: great!

12:09 fdaoud: yoklov: I guess I find it strange to pass a function to the template and have the template call that function with data. I don't see how that data could be in the template but not on the server. Also strange to go back to the server to generate the output.

12:09 seems backwards to me.

12:11 vojd: but you do have the data in the template already

12:11 no round trips to the server

12:11 brainproxy: I'm getting an error when trying to call the add-dependencies func from clojurescript's closure.clj

12:11 https://gist.github.com/2595668

12:12 fdaoud: vojd: best thing for me to understand is an example where the solution with a mustache lambda is better than a solution without.

12:12 yoklov: fdaoud: i'd think of the server-side part as making a library of functions for use inside your templates

12:12 brainproxy: note I'm a noob and feeling my along, so I may be making a basic mistake, but haven't been able to figure it out w/ google's help

12:13 fdaoud: yoklov: ok, but why call those functions from the templates instead of calling them from the code that prepares the data for the template?

12:13 yoklov: fdaoud: hm, i'd think that it would make your templates clearer

12:15 Licenser: A prime example why imutabilty is great: https://gist.github.com/2595753

12:15 vojd: fdaoud: imagine you're writing front end stuff for a system where you have no control over the backend

12:15 yoklov: fdaoud: honestly though, I don't really know enough about moustache to say

12:16 Licenser: 6 code examples and the only one that works is the one that looks totally wrong

12:16 yoklov: brainproxy: Have you considered using lein-cljsbuild?

12:16 fdaoud: yoklov: ok, I do appreciate your responses!

12:17 yoklov: fdaoud: haha, thanks, wish I could help more!

12:17 brainproxy: yoklov: I'm doing something custom which doesn't fit in with lein, at least not yet

12:17 TimMc: Where did I see some horrible hack that allows you to write fancy condition systems in Java?

12:17 fdaoud: vojd: I think I understand what you mean, but I'm used to the server being the data king, and the client being the powerless slave.. :)

12:18 vojd: so the client template would just have {{stuff}} or {{#things}}<li>{{something}}</li>{{/things}} and let the server create the data structure

12:18 vojd: fdaoud: indeed . i'm with you on that point :)

12:19 brainproxy: yoklov: mainly I'm just trying to understand the error; I can run other functions in the closure namespace, e.g. closure/-compile

12:19 and those work fine

12:19 vojd: fdaoud: and in all honesty, the things made with moustasche can of course also be done with javascript. just a matter of taste in the end

12:20 fdaoud: vojd: so I can't see myself calling {{#lambda}}Jack{{/lambda}} from a template because what is Jack? Why does the template know about Jack?

12:21 yoklov: brainproxy: you're somehow calling something which ends up as (make-reader nil)

12:21 muhoo: is there a clojure idiom for destructuring a map into another map, i.e. mostly renaming and shifting keys around?

12:21 yoklov: since nil doesn't implement clojure.java.io/IOFactory, this is an error

12:21 tomoj: idiom for destructuring?

12:22 yoklov: for anything more you'd have to ask someone who understands the internals of the cljs compiler better than i

12:22 such as dnolen, for example, if he's around

12:22 brainproxy: yoklov: okay, well thanks for the feedback, appreciated :)

12:23 muhoo: i.e. to turn {:foo {:bar "baz" } :quux "blah"} into {:somekey "baz" :anotherkey "blah"} ?

12:23 brainproxy: yoklov: cool, will do

12:23 vojd: fdaoud: but say you have different user groups. all strawberry-members shall have a nice little strawberry-avatar and a bold name while the banana-team shall have something else

12:24 dnolen: yoklov: brainproxy: closure.clj is one of the files I don't know that well.

12:24 tomoj: ,(doc clojure.set/rename-keys)

12:24 clojurebot: Gabh mo leithscéal?

12:24 dnolen: brainproxy: I'm curious as to why you need to mess around with that directly.

12:24 tomoj: that helps a bit

12:29 dnolen: lynaghk`: nice C2 on HN.

12:33 lynaghk`: dnolen: uh oh

12:33 why do I always get publicity before I have time to cleanup READMEs

12:34 yoklov: haha

12:34 ibdknox: heh, that's like when I first "released" noir

12:34 what a disaster that was

12:35 lynaghk`: ibdknox: someone just stumbled on the github and posted to HN?

12:35 ibdknox: yep, at 2am

12:35 lynaghk`: hah

12:35 ibdknox: I had just gotten the site up but hadn't had time to make sure it was ok

12:35 and I was going to bed

12:35 3 hours later I finally passed out

12:36 woke up a couple hours later to find out that I hadn't daemonized my lein process correctly

12:36 and linux killed the process :p

12:36 progo: ouch :)

12:36 ibdknox: I think it was down for like 40 minutes

12:37 lynaghk`: so look at the bright side, at least it's during the day!

12:37 lynaghk`: all of my sites are totally static. I was really stoked about the latest Keming Labs homepage redesign since it ended up being under 100k (including images) and has no JavaScript whatsoever---basically the antithesis of everything we make

12:37 ibdknox: yeah, true true. The next half hour is as good as any to cleanup the README...

12:39 ibdknox: python's naming conventions seem to be incredibly inconsistent. I miss my everything is lowercase with dashes.

12:41 ivan: the real trouble starts when someone with a PEP8 program wants to use a camelCase library

12:42 Python standard library actually implements both camel case and underscore in some places

12:42 ibdknox: I've noticed :(

12:42 hhutch: lynaghk`: i was just looking at cljs-chosen .. looks really neat... i'm just still not sure i like adding jQuery as a dependency in my CLJS stack

12:43 dnolen: so should we do another CLJS release?

12:43 lynaghk`: hhutch: since the Harvest folks designed Chosen to support jQuery and prototype, I think you could probably replace the DOM calls to use google's closure

12:43 ibdknox: dnolen: yes please :)

12:43 lynaghk`: hhutch: also, they wrote it in CoffeeScript, so you can use my/bolenfest's fork of that compiler to emit Closure-compatible JS

12:44 hhutch: so, what I'm saying is: "pull requests welcome" = )

12:44 dnolen: hells yes.

12:45 dnolen: k email sent to clojure-dev

12:46 hhutch: lynaghk`: i guess i was just commenting because this is an internal debate i'm having about my projects and especially CLJS libraries that will add another dependency (like jquery) in the stack. It seems like jayq has pretty much ended this debate though

12:47 brainproxy: dnolen: I'm working on bridging nodejs/npm directly into the clojurescript compiler using thre require extensions mechanism proided node

12:47 lynaghk`: hhutch: yeah, it depends on your use case. Most of the work we do is on internal networks, so size / dependency bloat hasn't been a big issue for us. Conceptually, though, I would like to be able to avoid jQuery in cljs projects.

12:47 brainproxy: *the require...

12:47 err.. *provided by node

12:48 dnolen: that way, you should be able to do require('clojure-script') and have the same effect as require('coffee-script') with respect to .cljs files

12:49 dnolen: brainproxy: neat. Were you planning on putting together a patch for this?

12:49 brainproxy: dnolen: it will be an npm module

12:49 actually, I've already pub'd it, but it doesn't really work yet

12:50 dnolen: brainproxy: yes, what I mean is that doesn't this require currently require changing the compiler and maintaining your own fork of CLJS?

12:59 brainproxy: dnolen: sorry, internet connection woes .. big storm in the area

13:00 dnolen: https://github.com/michaelsbradleyjr/node-clojurescript

13:00 shouldn't require a fork, as I'm using node-java package to bridge directly into the java api

13:00 OwenOu: hi i am just curious if anyone has played with java 7's new GC with clojure? http://www.oracle.com/technetwork/java/javase/tech/g1-intro-jsp-135488.html

13:00 dnolen: brainproxy: gotcha. looks cool.

13:01 brainproxy: dnolen: closure/-compile works fine

13:01 it spits back a javascript string

13:01 but if I try closure/add-dependencies, which is what I need next, I'm getting the error in that gist

13:01 prpatel: emacs-clojure n00b here. have quick question: i have everything running, project in lein, swank plugged in, etc.

13:01 brainproxy: not sure if it's an issue with the clojure build I'm using, with clojurescript or what exactly

13:02 wkmanire: Howdy folks.

13:02 dnolen: Licenser: that's more an issue of the lack of proper let scoping in JS

13:02 Licenser: did that fix yesterday help you much?

13:03 brainproxy: dnolen: btw, once I have it working, I'll rewrite a newer version of the package in clojurescript, but to start with, it's written in coffeescript

13:03 wkmanire: prpatel: Question?

13:03 Licenser: dnolen I haven't yet run into the same issue :) but I guess it will when I do

13:04 dnolen: brainproxy: hmm, yeah not sure what's going on there - I've never tried calling add-dependencies directly.

13:04 prpatel: trying to run this in the REPL in emacs: (def server (jetty/run-jetty #'app {:port 8080 :join? false}))

13:04 i'm working through cemerick's screencast

13:04 in emacs rather than CCW

13:04 dang it

13:04 nevermind

13:04 seems to work now, of course the minute I go ask for help

13:05 brainproxy: dnolen: very similar error messages are being reported with a recent vesion of lein

13:05 dnolen: but, this is all a crash course for me, as previously I've not programmed in java or clojure

13:05 prpatel: i was wondering if the REPL in emacs was tied to the running instance... i guess it is

13:05 brainproxy: however, I learn quickly :D

13:05 wkmanire: prpatel: You're using swank right?

13:05 prpatel: yessir I am

13:06 dnolen: brainproxy: it's nice to see that more people are interesting in getting CLJS to work well with Node.js

13:06 interested

13:06 wkmanire: Then yeah. It's a client-server setup.

13:06 prpatel: super excited about digging into clojure script... finally found a good use (for me) for clojure :)

13:06 muhoo: technomancy: would you happen to know how many dynos, and of what type, i have to throw at heroku to prevent the app from spinning down?

13:07 brainproxy: dnolen: heck yeah, the promise of immutability, protocols, etc. are just too good not to jump on cljs

13:07 dnolen: a friend and I started playing w/ cljs this past weekend at a hackathon, we're both big node nerds

13:07 technomancy: muhoo: only 1-dyno apps spin down I believe

13:07 brainproxy: by the time we went home, we both were convinced that to not adopt cljs would be a mistake

13:07 :)

13:07 dnolen: brainproxy: awesome!

13:07 muhoo: technomancy: so 2 dynos is no spindown?

13:08 wkmanire: technomancy, muhoo: What does "spin down" mean?

13:08 technomancy: muhoo: that's my understanding

13:08 muhoo: that's great deal actually, thanks

13:08 dnolen: brainproxy: bunch of perf work left to do, but it's cool to hear you're excited about it even it's current state :)

13:08 muhoo: wkmanire: heroku free apps shut down the jvm if it's idle for an hour

13:08 ibdknox: I can confirm that two prevents the spindown

13:09 muhoo: ibdknox: thanks

13:09 lynaghk`: muhoo: that explains a lot...any way to prevent that?

13:09 wkmanire: and this shut down process is called spindown?

13:09 brainproxy: dnolen: the main thing holding me back was the fact that it's not a good palyer wrt npm and node's module system in general

13:09 muhoo: lynaghk`: yeah, pay $35/mo :-)

13:09 technomancy: wkmanire: I think the preferred term is "idling"

13:09 brainproxy: when I discovered node-java earlier this week, I figured what the heck, let's do this

13:09 ibdknox: lynaghk`: or set up something to ping it every 30mins ;)

13:09 dnolen: brainproxy: yeah. Again we're listening - anything to make that simpler is something we're very interested in.

13:10 wkmanire: Oh ok.

13:10 muhoo: the cron-job-to-ping-the-app approach would work for my own stuff, but this is for someone with a budget, they can afford $35/mo

13:10 dnolen: ibdknox: so I take you're not ready to talk about that big donor from yesterday?

13:10 brainproxy: dnolen: what I'm aiming for is to provide the same functionality as the coffee-script module for node, and also make it possible to do things akin to what the ender project does w/ npm

13:10 ibdknox: They won't be well known here I think haha

13:10 dnolen: It's Red Gate software

13:11 * TimMc googles

13:11 brainproxy: dnolen: instead of cake, projects should probably use lein for for build routines and whatnot, but I haven't started messing w/ lein yet

13:11 ibdknox: TimMc: big player in .NET tools

13:11 dnolen: ibdknox: wow, that's very interesting

13:12 ibdknox: dnolen: very interesting lol

13:12 it's a bit of a poke at the bear

13:12 wkmanire: I've used some red gate stuff. I can't remember what it was.

13:12 TimMc: Ah, they are fed up with VS, or what?

13:12 wkmanire: I think it was a code analysis plugin for VS.

13:12 ibdknox: TimMc: I think it's "go where the puck will be"

13:13 10k for a largish organization is a rounding error

13:13 so probably hedging their bets

13:13 they were genuinely excited about it

13:13 a guy flew down yesterday and I talked with him

13:13 (he came for other reasons as well)

13:14 TimMc: Nifty.

13:14 muhoo: most large companies have an internal vc team

13:14 dnolen: brainproxy: looking forward to seeing where this goes.

13:14 muhoo: looking for potential acquisitions, they get toe in with angel money

13:14 ibdknox: muhoo: yeah

13:14 muhoo: that's really good news tho

13:14 dnolen: ibdknox: still nice, you haven't got much further to go now.

13:14 ibdknox: I have another one that I think you guys will be excited about :)

13:15 brainproxy: dnolen: well I'm stuck atm, :), even if you're not too familiar w/ closure.clj, any tips on how I can hunt down the error in that gist?

13:16 jodaro: wow a $10k'er

13:16 nice

13:16 dnolen: ibdknox: more secrets!

13:16 ibdknox: dnolen: Hopefully I'll convince them today :)

13:17 solussd_: how do I get aquamacs to use .emacs.d

13:17 ?

13:18 * muhoo starts mumbling "it's a cinderalla story" like bill murray from "caddyshack"

13:19 dnolen: brainproxy: huh when I run that at the repl it just works.

13:19 prpatel: solussd_: you may need to stuff it under /Applications/Aquaemacs/

13:19 brainproxy: dnolen: what version of clojure?

13:19 technomancy: aquamacs? =(

13:20 dnolen: brainproxy: 1.3.0 - that's what ClojureScript uses at the moment

13:20 ibdknox: muhoo: I love that movie

13:20 brainproxy: dnolen: doh, okay, I'm on 1.4.0

13:20 prpatel: solussd_ don't use aquaemacs if possible, just grab emacs 24 and get technomancy or batsov's .emacsd stff

13:20 brainproxy: dnolen: I'll try using 1.3.0

13:20 solussd_: prpatel: It's actually using ~/.emacs.d for me, trying to figure out "how" it is for a coworker

13:21 dnolen: brainproxy: trying now with 1.4

13:21 brainproxy: works

13:21 technomancy: suuuuure; it's "for a friend" =)

13:22 brainproxy: solussd_: using "emacs for os x" emacs24 build and bbatsov's prelude are working a lot better for me than aquamacs

13:22 prpatel: solussd_ : don't know much about aquaemacs anymore

13:22 brainproxy: dnolen: okay, well i'll try the older version anyway, just to see if it makes any diff for me

13:23 jodaro: wow

13:23 MCA is dead

13:23 http://www.tmz.com/2012/05/04/beastie-boys-adam-yauch-dead/

13:28 muhoo: wat? sad.

13:28 zakwilson: I want to get the path to my running jar. A Java answer suggests ClassLoader.getSystemClassLoader().getResource(".").getPath(), but when I try that, getResource returns nil.

13:28 fdaoud: ibdknox: just curious, what does 'ibdknox' mean?

13:29 ibdknox: fdaoud: it's from high school back when I used to play Halo and such. Knox is just what I always named characters, IBD = International Baccalaureate Dork. All my friends were in IB together.

13:30 fdaoud: my cofounder is ibdthor lol

13:30 fdaoud: ibdknox: heh, cool :)

13:30 ivan: lynaghk`: you might be losing some users with that non-obvious --extract flag that you have to find in the video

13:30 short attention spans and all...

13:31 hiredman: zakwilson: yeah, I can't image that would ever work

13:32 fdaoud: brb

13:32 zakwilson: hiredman: I know little of these things and just tried something I saw on StackOverflow.

13:32 hiredman: . is a unix file system thing, seems unlikely that .getResource would ever look kindly upon it

13:32 zakwilson: I suggest doing whatever in a way that avoids needing the path

13:33 zakwilson: hiredman: I want it to look for and/or create files relative to the jar without knowing how the user will launch it (and therefore not being able to predict the working directory at launch)

13:34 lynaghk`: ivan: it's in the vrepl/README.markdown. Where do you think I should add an additional note?

13:35 ivan: well, no thinking is required if that flag isn't needed and the browser page shows "This visual REPL will automatically load the most-recently modified file in samples/"

13:35 not sure if you want the shortest-attention-span users, though ;)

13:36 brainproxy: dnolen: didnt' work, but was just looking at the pom.xml.template for cljs .. do I need to have the google closure library on my class path in addition to the google closure compiler?

13:36 ivan: I just grabbed the jar and didn't even know there was a README

13:36 dnolen: brainproxy: probably.

13:37 lynaghk`: ivan: I hate it when I run things and they barf on my filesystem, which is why there's a flag. Putting the command line args in the default startup page is a good idea though. I'll cut a new JAR in the next few minutes.

13:37 ivan: thanks for the feedback.

13:37 ivan: oh, I was running in a VM anyway and didn't care about barfing

13:37 good point

13:38 wkmanire: lynaghk`: That was nearly quotable.

13:38 lynaghk`: wkmanire: ?

13:39 wkmanire: lynaghk`: I hate it when I run things and they barf on my filesystem too.

13:39 Happened to me yesterday.

13:39 lynaghk`: wkmanire: oh, definitely. so rude!

13:39 wkmanire: Nothing like hand-picking 30 files out of 200 to delete.

13:39 ivan: ls -lrt makes it a little easier

13:40 gfredericks: emacs is always barfing on things

13:40 ivan: not enough backup files, write more backup files

13:40 wkmanire: gfredericks: #WHAT DO YOU MEAN# emacs~ would~ never~ do~ #THAT#

13:40 gfredericks: .#never

13:41 joegallo: zakwilson: getResource on something that actually exists. like clojure/core.clj :)

13:41 ivan: let's put 1000 Clojurists in one room and rewrite Emacs in a week

13:41 joegallo: then you can hork the resulting url apart pretty easily.

13:41 technomancy: ivan: no rudybot in here, sorry =)

13:41 rudybot might be more realistic to rewrite in a week though

13:42 wkmanire: Clemacs? Clomacs... Emojure....

13:42 ivan: I'll go with Emojure

13:42 zakwilson: joegallo: thanks. That actually gives me something.

13:42 TimMc: lol @ emojure

13:43 gfredericks: there was a ban of *jure names I think, but I also think rewriting emacs would be an understandable exception

13:43 TimMc: "Clyde" would be a pretty decent name for a Clojure IDE.

13:43 gfredericks: TimMc: that's brilliant

13:44 Chousuke: needs a tool called Bonnie to go with it

13:44 joegallo: I would call it Hubris, but that's just my $.02.

13:44 ivan: would a PersistentVector be a good choice for an editor buffer?

13:44 * wkmanire is actually laughing out loud.

13:44 wkmanire: Damn my nerdly existence.

13:46 gfredericks: ivan: that sounds bad to me

13:46 don't those have to be pretty flexible?

13:46 splicing and joining everywhere?

13:46 zakwilson: It's my understanding that editor buffers are surprisingly hard to do well, and usually end up using specialized tree structures.

13:46 ivan: gfredericks: yes

13:46 gfredericks: I saw an interesting discussion of them on the Good Math Bad Math blog

13:46 ivan: (multiple cursors make things even worse)

13:47 Borkdude: why build clemacs, better build clojure on elisp and not throw away emacs?

13:48 wkmanire: Borkdude: I think it was more of a running joke than anything else.

13:48 ivan: Borkdude: it would be better to keep the elisp and throw away Emacs' buffer/window code (though I don't think many will agree with me)

13:48 technomancy: Borkdude: because emacs doesn't have immutable data structures

13:48 ibdknox: zakwilson: that is correct, some really fancy data structures

13:48 technomancy: Borkdude: http://technomancy.us/159.html

13:49 ivan: Borkdude: mousewheel, word wrap, cursor outside viewport, everything is wrong

13:49 the scrollbar changes size as you scroll. it's amazing.

13:49 zakwilson: ibdknox: yay! I got one right!

13:49 technomancy: who keeps the scrollbar turned on?

13:50 Borkdude: technomancy: javascript and python do not either right?

13:51 technomancy: Borkdude: JS and Python have immutable strings

13:51 and let you implement data structures; with elisp you're stuck with what's implemented in C

13:52 felideon: oh wow, redgate

13:52 Borkdude: technomancy: aha

13:52 felideon: they make some nice tools for .NET ppl

13:53 Fullmoon: I am looking for a Quicktest-style test frameowrk, any recommendations?

13:53 ivan: Python even has immutable tuples on which you can build an ArrayMap

13:54 wkmanire: technomancy: Interesting article.

13:58 technomancy: Just out of curiosity, if I answer "no" to your spam filter question will it still post my comment?

13:58 Borkdude: ibdknox: what is the interest of companies investing larger sums of money, they get more say in the final product? or altruism?

13:58 technomancy: wkmanire: nope, it will be discarded

13:59 wkmanire: technomancy: Ah ok.

14:02 It's pretty damned hard to whistle Thunder Struck isn't it.

14:02 mebaran151: I would like to implement a protocol that would handle generic maps and specific defrecords, with differing semantics. Can I configure extend-type to prefer my implementation inside my defrecord than the generic version for maps?

14:02 wkmanire: My neighbor probably thinks I'm trying to immitate a bird since I have headphones on.

14:06 No Cemerick today eh?

14:07 Borkdude: wkmanire: he was here earlier today

14:08 * gfredericks watches Thunderstruck

14:08 amalloy: wkmanire: http://www.youtube.com/watch?v=EkmbjUsFZt0 is a string-only cover of thunderstruck, if you're into that sort of thing

14:08 gfredericks: this must be one of those things from "the eighties" or something similar

14:11 mebaran151: also, is there an easy way to convert record to a map so I can use transients on them?

14:13 mdeboard: technomancy: re: Your elisp-in-clojure post, thanks. That actually answered some questions I was pondering.

14:13 gfredericks: mebaran151: (into {} rec) should work

14:14 technomancy: mdeboard: cool

14:14 mebaran151: ah yeah that makes sense

14:14 gfredericks: thanks

14:16 wkmanire: gfredericks: It is. It was/is really popular at hockey games.

14:16 amalloy: Neat

14:16 Borkdude: I just got through is breakdown of the game of life algorithm. That's one of my favorite problems. I'm having to re-read the code over and over again to really take in the way you do this sort of thing with clojure.

14:17 Fullmoon: Let's say I have a sequence of maps, and I want to return a map with them grouped key -> count of them, is there something special for that, opposed to reducing, and then map [a, (count b)] ?

14:17 Borkdude: wkmanire: in the clojure book?

14:17 wkmanire: The next bit is the wilson's maze. I'm looking forward to it.

14:17 Borkdude: Yep.

14:17 Borkdude: wkmanire: still waiting for it.. amazon.de is slow this time

14:18 wkmanire: Borkdude: I bought it for my kindle. Aside from the code getting wrapped annoyingly it is well formatted.

14:18 Sometimes I have to use the amazon cloud reader to see the code correctly.

14:18 Borkdude: Fullmoon: (for [s seqs] [(count s) s]) ?

14:19 wkmanire: I wish I could change the orientation of the reader to horizontal for the code segments.

14:19 lynaghk`: ivan: new C2 VREPL pushed.

14:19 Fullmoon: Borkdude: Sure, but I thought that grouping-by-and-returning-the-keys-and-count is so common that it has it's own function

14:19 Borkdude: wkmanire: this is why I don't read textbooks on my kindle yet

14:20 Fullmoon: I never needed that yet, what do you use it for?

14:20 wkmanire: Borkdude: I thought about buying the larger one, but I ended up not spending the money... now I sort of regret it.

14:21 After another few iterations of the kindle I'll probably make the switch to a larger display.

14:24 zanes: wkmanire: You ... can do that? Or do you mean for just the code segments?

14:25 wkmanire: zanes: I'm sorry, I don't understand your question.

14:25 zanes: I can do what?

14:25 zanes: wkmanire: You said that you wished you could change the orientation to horizontal.

14:25 wkmanire: zanes: Yes. Is that possible?

14:25 muhoo: hmm, pprint seems not to be honoring *print-level*

14:26 technomancy: pprint also ignores *flush-on-newlines* =(

14:26 zanes: wkmanire: Totally! http://www.amazon.com/gp/help/customer/display.html?nodeId=200375800

14:26 muhoo: um, is there a way to get it to behave?

14:26 technomancy: replaca might know

14:26 zanes: wkmanire: Under 'Screen Rotation'.

14:26 * muhoo looks at replaca

14:27 wkmanire: cemerick: Hello. I was just talking about your section on Conway's game of life. I was really pleased to see that, it happens to be one of my favorite problems. I don't fully understand the clojure implementation you wrote yet though.

14:27 cemerick: After a few more re-reads and some experimentation I will. I'm looking forward to getting into the wilson's maze algorithm next. Great content!

14:27 cemerick: wkmanire: That part is nearly all Christophe. :-)

14:27 faust45: is it right way using agents send-off to handle non-block io ?

14:27 wkmanire: ahh, well I hope he read that.

14:28 cemerick: He's not in irc much these days.

14:28 muhoo: hehe. blog.n01se.net/?p=85 is reported as an attack page by ffx

14:28 :-o

14:29 wkmanire: zanes: I'm using the newer version. the touch. It doesn't have a keyboard.

14:29 TimMc: muhoo: The diagnostic message is pretty confusing.

14:30 muhoo: Apparently 0 page(s) resulted in 22 scripting exploit(s) and 1 trojan(s) being downloaded...

14:30 wkmanire: zanes: Looks like the touch doesn't rotate.

14:30 zanes: wkmanire: Oh wow. I have the non-touch latest gen kindle (also no keyboard). I didn't realize the touch didn't have screen orientation controls. That's awful.

14:30 wkmanire: Yeah, just read. Terrible.

14:30 :(

14:31 TimMc: And even the Kindle *with* rotate has very confusing navigation semantics.

14:31 wkmanire: zanes: Yep. Not too pleased about that.

14:31 TimMc: It's not the most pleasant UI.

14:31 patchwork: Hey, what happened to lein interactive?

14:32 technomancy: patchwork: in lein2 that role will hopefully be handled by jark

14:32 (but that doesn't work yet)

14:32 wkmanire: cemerick: Anyway, the part about representing the board as a simple collection of live cells is completely obvious to me now.

14:32 TimMc: chouser: You know that blog.n01se.net is marked as an attack page in Firefox?

14:32 wkmanire: cemerick: But I probably would never have thought about it with the book pointing it out.

14:32 patchwork: So I just want to have a lein terminal running that I can execute lein tasks in… anything else out there for that?

14:33 cemerick: wkmanire: then you have reached enlightenment. Or something. :-)

14:33 wkmanire: lol

14:33 cemerick: The maze generation is the real killer IMO.

14:33 muhoo: apparently there's this workaround, but me no like; (binding [*print-level* 2] (pprint ...

14:33 heh, even that doesn't work

14:34 tibaldshillings: #python

14:34 wkmanire: cemerick: That is going to be fun for sure.

14:35 technomancy: cemerick: it's funny how different people react to this drawbridge article

14:35 _KY_: How can I force the first element of a lazy sequence to be evaluated?

14:35 technomancy: cemerick: the ruby people are all "holy crap; that's sweet" and the clojure people are all "man, it's about time!"

14:36 muhoo: i thought drawbridge had been around for a while now

14:36 great tutorial btw

14:36 technomancy: thanks =)

14:36 mdeboard: drawbridge?

14:36 tutorial?

14:36 clojurebot: leiningen tutorial is at http://github.com/technomancy/leiningen/blob/master/TUTORIAL.md

14:36 mdeboard: IRC?

14:36 clojurebot: irc is only for opionfests

14:36 mdeboard: where am I

14:37 muhoo: opion?

14:37 technomancy: muhoo: it's been maybe a month, but I just mean that you haven't been able to get a REPL in a live web dyno on Heroku until recently

14:37 "where's my swank?" has been near the top of the list of complaints since we started offering Clojure

14:38 mdeboard: https://devcenter.heroku.com/articles/debugging-clojure

14:38 I should post that to the Clojure list

14:38 mdeboard: orite, neat

14:38 muhoo: that'd be a good place for it

14:39 amalloy: _KY_: just call seq on it

14:40 mdeboard: (defn if-you-like-it-then-you-should-have-put-a-seq-on-it [coll] (seq (first coll)))

14:41 foxdonut: drawbridge?

14:41 technomancy: foxdonut: see the devcenter link above

14:41 dnolen: CLJS users, any thoughts about this ticket? http://dev.clojure.org/jira/browse/CLJS-180

14:42 foxdonut: technomancy: thanks, couldn't tell from the link that it was drawbridge.

14:45 cemerick: technomancy: is this happening publicly?

14:46 chouser: TimMc: *sigh* I did not. Thanks.

14:48 technomancy: cemerick: sorta: https://mobile.twitter.com/rwdaigle/status/198241118629007361

14:49 cemerick: oh, sure

14:49 he's "ruby people" then?

14:50 technomancy: I'm going to amend your comment for twitter purposes :-P

14:50 Raynes: dnolen: Didn't I report that issue a long time ago?

14:51 technomancy: sure thing =)

14:51 wkmanire: Time to go do boring crap. *grumble*

14:51 Later fellas.

14:56 muhoo: i am trying to use zippers with defrecord to represent a recursive tree of categories, and i'm lost

14:57 i started with this: http://tech.puredanger.com/2010/10/22/zippers-with-records-in-clojure/

14:58 i ended up with this https://refheap.com/paste/2550

14:59 dnolen: Raynes: I never saw that ticket

15:00 Raynes: dnolen: It might have been slightly different, and I think my case was fixed so the ticket was probably closed. We talked about it, but it was ages ago.

15:00 amalloy: i think Raynes is referring to his ticket about top-level namespaces being shadowed by functions, not function arguments

15:00 Raynes: Right.

15:02 rednovae: is there a clojure interpter, like clj, that uses something like readline so when i hit UP i get the previous command?

15:02 dnolen: amalloy: Raynes: oh right. This one is a bit trickier (or simpler)

15:02 TimMc: rednovae: You mean a REPL?

15:02 rednovae: TimMc <- 3 minutes of clojure experience, so... maybe?

15:02 amalloy: install leiningen

15:02 yoklov: rednovae: try lein repl

15:03 happy4crazy: rednovae: you could use rlwrap

15:03 rednovae: ok

15:03 TimMc: rednovae: Is "clj" a shell script that launches Clojure? Don't do that.

15:03 Raynes: Guys.

15:03 ibdknox: dnolen: I don't think you can gensym the param names

15:03 Raynes: Just say "install leiningen".

15:03 dnolen: ibdknox: why not?

15:03 Raynes: It is no more difficult or interesting than that.

15:03 Don't berate or confuse the poor guy.

15:04 amalloy: but +1 for using rlwrap on similar problems, for when you don't have an option as cool as lein

15:04 rednovae: install leiningen

15:04 Raynes: Indeed.

15:04 rednovae: oh man i am in deep now

15:04 Raynes: https://github.com/technomancy/leiningen

15:04 TimMc: Raynes: You would have me not be pedantic? o\__/o

15:04 ibdknox: dnolen: hm, I take that back. I was thinking there might be weird ambiguities with things like "name"

15:05 dnolen: ibdknox: it is kinda gross I admit that.

15:05 ibdknox: dnolen: where it's also shadowing functions in the NS or whatnot, but I guess that isn't ambiguous

15:05 dnolen: ibdknox: but I'm not sure how else we could prevent clashes.

15:06 ibdknox: dnolen: sucks for looking at the generated code

15:06 amalloy: you could gensym the namespaces instead

15:06 ibdknox: dnolen: I'm trying to think of that makes some of the things I'm doing harder, since the names will get munged

15:06 it*

15:06 grr

15:06 if*

15:07 * Raynes pats ibdknox on the head.

15:07 Raynes: We've all had those days.

15:07 cemerick: ibdknox: man, interviews and everything? Don't forget about us peons now that you've made it big. ;-P

15:07 ibdknox: lol

15:07 there should be another one in the next .net magazine :)

15:08 rednovae: ok i'm going to leiningen it up

15:08 dnolen: ibdknox: k I'm convinced we should do the hard thing. I guess advanced compilation makes this less of an issue when dealing with external libs that aren't compiled w/ GClosure.

15:08 Raynes: cemerick: Yeah, dude, I wish he would have asked me for server space so I could sue him later for not considering me a founder… or… or whatever the hell happened in that facebook movie.

15:08 ibdknox: haha

15:08 speaking of servers.. I should've used smaller images

15:08 muhoo: Raynes: you'd need to wear a suit to do that

15:08 ibdknox: I server over half a terabyte off of S3

15:09 served

15:09 turns out that has moderate cost lol

15:10 muhoo: all i can say is, i hope noir has a bus factor > 1

15:10 dnolen: ibdknox: so we'll warn on clashes, leave param names alone. Fixing CLJS-180 will depend on fixing the analysis order issue first.

15:11 ibdknox: dnolen: analysis order?

15:11 yoklov: dnolen: couldn't you gensym the param names only if there's a clash?

15:11 dnolen: ibdknox: it's pretty random at the moment.

15:11 ibdknox: mm

15:11 muhoo: because the startup bus is coming :-)

15:11 dnolen: ibdknox: analysis doesn't follow requires / uses

15:11 ibdknox: dnolen: ah, yes.

15:12 dnolen: ibdknox: once we do that then we can accurately warn about param name clashes with namespaces

15:12 jonasen: dnolen: this doesn't happen with let, right? (let [foo 1] (x/bar)) should work?

15:12 ibdknox: muhoo: lol, yeah ideally someone will take an interest in helping with a couple of my libs

15:12 dnolen: jonasen: dunno, you should test.

15:13 ibdknox: lets get gensymed

15:13 in cljs

15:13 not in CLJ

15:13 which is wicked confusing

15:13 yoklov: yeah, never seen lets not get gensymmed

15:14 ibdknox: it's a "cleaner" solution to the (let [foo 1 foo (inc foo)] ..) mess I guess

15:14 TimMc: Is there any support in CLJS or some CLJS lib for streaming a seq of data from the server to the client?

15:15 That would be killer.

15:15 ibdknox: like over websockets?

15:16 Borkdude: ibdknox: btw, my question was just out of curiosity, not out of criticism

15:16 ibdknox: Borkdude: totally missed your question

15:16 ah

15:16 found it

15:16 Borkdude: ibdknox: question was, what gain is in it for companies investing largely in your product?

15:16 Raynes: Borkdude: I saw you using cljbin recently. Damned traitor, you.

15:17 ibdknox: Borkdude: honestly, it's a gamble. Let's say I manage to pull this off and it ends up big. You would want your company's name attached to it

15:17 Borkdude: Raynes: I am a hedonist. I use whatever comes my way ;).

15:17 TimMc: ibdknox: And they get an IDE.

15:17 ibdknox: For others it's about introducing a new platform where they can try to come out as the "leaders" on it

15:17 and as TimMc just said, many of them actually just want the thing

15:18 Raynes: ibdknox: When you've got a second, I'd like to talk over something I'm doing with you and see what you think.

15:18 mdeboard: 15:07 <ibdknox> For others it's about introducing a new platform where they can try to come out as the "leaders" on it <---- this will make it easier for them to attract top candidates as well

15:18 ibdknox: It's one of those pascal's wager moments

15:18 Borkdude: ibdknox: do you think Jetbrains would be interested to invest in it?

15:18 ibdknox: no idea

15:19 I worked with those guys a bit at MSFT

15:19 felideon: they make some nice tools for .NET ppl

15:19 err

15:19 sry copy paste

15:20 Borkdude: felideon: actually Jetbrains have made smth nice for .NET too, although I never used it (Resharper)

15:20 felideon: Up Arrow + Enter rather

15:20 ibdknox: I still haven't heard from any of the major players yet :)

15:20 That'll be when things get interesting

15:20 muhoo: ok i almost got it working https://refheap.com/paste/2555 the only problem is that trying to access empty leafs casues an NPE

15:21 mattrepl: a set! on a :volatile-mutable or :unsychronized-mutable field in a deftype method should work when inside a (locking this &body) form, right? I am seeing it work fine outside of a locking form, but ObjExpr throws an exception about the LocalBinding not being mutable.

15:21 felideon: Borkdude: right. actually i almost confused them.

15:21 glad i'm not in 'that world' anymore :)

15:22 ibdknox: Borkdude: felideon: as I recall resharper is the most commonly used VS plugin

15:22 Borkdude: I had to use Python, and after trying several IDEs I sort of liked Pycharm (Jetbrains) the best

15:22 felideon: yeah it probably is.

15:23 technomancy: http://news.ycombinator.com/item?id=3929789

15:24 mdeboard: I've been watching a coworker who's new to Python development using WingIDE and it just looks awkward as shit.

15:24 Borkdude: ibdknox: I'm curious about what kinds of refactoring options Light Table will support for clojure, I didn't see anything related to that in the video

15:24 ibdknox: technomancy: never post the direct link

15:24 technomancy: that's how you get ringed

15:24 technomancy: ibdknox: oh dang

15:24 jonasen: dnolen: I think we should gensym {:name (munge name)} here: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/compiler.clj#L925

15:24 ibdknox: Borkdude: no idea yet :)

15:24 felideon: lispers need no refactoring tool non-sense!

15:24 technomancy: ibdknox: you've been doing this longer than I have apparently =)

15:25 mdeboard: Oh, huh

15:25 That sucks.

15:25 Borkdude: felideon: an example of 5 mins ago: I decided to use require instead of use, with an alias, so I had to manually prefix the alias… could this be automated?

15:25 dnolen: jonasen: I think we should avoid gensym'ing for now - unless somebody gives us a source map patch.

15:26 jonasen: CLJS-180 ticket updates pointing to new ticket - fixing require / use analysis order would make warning on clashes pretty easy.

15:26 felideon: Borkdude: sounds like a sed one-liner

15:26 Borkdude: felideon: sed doesn't have any namespace intelligence

15:27 technomancy: Borkdude: slamhound automates that

15:27 Borkdude: Raynes: I'm going to try refheap now

15:27 mdeboard: lol I love your project names

15:28 Raynes: Borkdude: It will eventually have cljbin's evaluation feature (only betters).

15:28 S11001001: technomancy: it's a whole-source transformer now?

15:28 Raynes: Borkdude: But I will not break your face for using cljbin in the meantime if you like that sort of thing.

15:28 Borkdude: Raynes: ah, that's what I like about cljbin, so good

15:28 mdeboard: holy Ffffffff

15:28 @ slamhound

15:28 felideon: technomancy: that's kinda cool

15:28 technomancy: S11001001: oh, no I just misread what he said

15:28 S11001001: some day though

15:28 jonasen: dnolen: Is a warning good enough?

15:28 technomancy: if it's implemented as a logic program, you could run it forwards or backwards

15:29 Borkdude: I will check out slamhound now… and see if it worth a "sweet!" or "about time…"

15:29 technomancy: Borkdude: more like, "this will be nice once it's finished..." =)

15:29 dnolen: jonasen: probably not - gensym the specific clashing parameter.

15:29 technomancy: hopefully

15:30 Borkdude: technomancy: as I read the README, it can fix ns declarations, but can it fix code that needs alias prefixing?

15:30 technomancy: once it's finished.. ;)

15:31 technomancy: Borkdude: well that would be more like once it's completely rewritten and transformed into a logic program; I misread your original question

15:32 Borkdude: "extract macro" would be a nice refactoring

15:32 gfredericks: does it remove unneeded requires?

15:32 technomancy: gfredericks: unneeded :require/:as

15:33 it won't work if you need a require and use a fully-qualified reference

15:33 felideon: Borkdude: i dont get what's so hard about s|foo|x/foo| or whatever

15:34 how many symbols do you need to replace

15:34 Borkdude: felideon: not so many, but let me show you… wait a minute

15:36 michaelbarton: What's the correct way to insert a map function into a (-> ...) pipeline?

15:37 jonaskoelker: what's the syntax for variable arity function definitions?

15:37 chouser: michaelbarton: there's no right way. You could use ->> instead, but if you find yourself fighting either one, it's probably better just to use let

15:38 Borkdude: felideon: https://github.com/Borkdude/tictactoe/commit/d5fa8427d9891f6765807ef456b666aa7111f05a test/tictactoe/test/models/model.clj

15:38 jonaskoelker: michaelbarton: I'm not sure I understand your question, but (-> somelist (partial (map my-function)) ...) ?

15:39 chouser: jonaskoelker: you can have multiple fn bodies, each with a different arity (defn f ([a] (prn a)) ([a b] (prn a b)))

15:39 jonaskoelker: that partial will receive somelist as it's first arg, so probably not what you want.

15:39 brehaut: jonaskoelker: (partial somelist (map … probably wont do what you want

15:39 Borkdude: felideon: I had to type the prefix nine times

15:40 felideon: and it is error prone

15:40 felideon: your poor fingers!

15:40 chouser: jonaskoelker: for varargs, your arg vector can look like [a b & args] in which case args will be nil or a lazy seq

15:40 michaelbarton: I have (-> (first *command-line-args*) reader line-seq)) and I'd like to do some mapping and filtering on this.?

15:40 chouser: michaelbarton: ->> should work for that

15:40 felideon: Borkdude: that link didnt work

15:40 michaelbarton: Ok

15:41 What is the difference between the two?

15:41 Borkdude: felideon: it was a link, then a space and then a file name

15:41 mattrepl: yup, there's a bug where try forms don't know about the deftype fields and thus ObjExpr#isMutable returns true and compilation fails

15:41 Borkdude: felideon: so not a link with a space in it

15:41 felideon: Borkdude: ah k

15:41 chouser: ->> puts each expr as the *last* arg of the next expr, instead of the *first*

15:41 michaelbarton: I see

15:41 Thank you

15:42 I will try that.

15:42 jonaskoelker: brehaut: that would be a good point :)

15:42 chouser: so something like (-> (first *cla*) (reader ,,,) (line-seq ,,,) (map #(do-foo %) ,,,))

15:42 felideon: Borkdude: yeah so, if you had to do this accross thousands of lines of code, a simple script would have done fine

15:42 jonaskoelker: chouser: the first one is exactly what I want. Thank you :)

15:42 chouser: ...to use the notation Fogus put in the book

15:42 jonaskoelker: yw

15:43 Borkdude: felideon: how does the script now what symbols need prefixing?

15:43 know

15:43 felideon: you give it the list.

15:43 Borkdude: felideon: I'm too lazy to make the list. ok ok...

15:43 felideon: yeah i mean comon, you're a programmer. God forbid you have to type.

15:43 ^_^

15:43 jonaskoelker: :D

15:43 Borkdude: =)

15:44 jonaskoelker: it didn't say "typist" on the job offer

15:44 brehaut: wheres tavis rudd when someone delivers a line like that

15:44 amalloy: chouser: you accidentally used -> instead of ->>

15:45 making the commas not line up with reality

15:45 michaelbarton: That

15:45 That

15:45 That's great.

15:45 Just what I was looking for.

15:46 Thank you.

15:47 nollidj: anyone here start a new incanter project (with incanter 1.2.2) lately? i've just created a project.clj and tried to "lein deps" it with leiningen 1.7.1, and lein is complaining that it can't find clojure-contrib 1.2.0-master-SNAPSHOT. sounds to me like incanter really needs updating, but repo.incanter.org says 1.2.2 is the latest stable release.

15:49 tomoj: nollidj: 1.3.0 appears to be released

15:49 nollidj: ah, i'll try updating. thanks.

15:50 ralfonso: did lein interactive disappear in lein2? I'm looking for a way to speed up test runs.

15:52 nollidj: tomoj: did you look at clojars directly to find that out, or are you looking at an incanter project page i haven't found?

15:52 pandeiro: is there any way that cljs.reader/read-string would be able to work with html-escaped data?

15:53 tomoj: clojars

15:53 amalloy: pandeiro: ...un-html-escape it first?

16:00 chouser: amalloy: gah. thanks.

16:21 pandeiro: how can i deal with the :body element of a ring-request when i am serializing/deserializing between clj and cljs?

16:24 gtrak: body's a bytearray, right? I bet you could convert it to a string?

16:25 pandeiro: gtrak: it's one of these: #<Input org.mortbay.jetty.HttpParser$Input@5b506da4>

16:25 mefesto: body is an InputStream which can be put in a string easily like gtrak says

16:26 gtrak: http://jetty.codehaus.org/jetty/jetty-6/apidocs/org/mortbay/jetty/HttpParser.Input.html

16:26 extends InputStream

16:27 mefesto: ,(doc slurp)

16:27 clojurebot: "([f & opts]); Opens a reader on f and reads all its contents, returning a string. See clojure.java.io/reader for a complete list of supported arguments."

16:29 mefesto: pandeiro: try (slurp (:body request))

16:30 pandeiro: mefesto: great thanks.. is there an assoc-like fn that will convert :body to (slurp ...) in place?

16:31 gtrak: you can make a middleware that adds a :body-str attribute?

16:32 mefesto: pandeiro: i like gtrak's approach better

16:32 gtrak: or does it in place, not sure if that's considered clean

16:32 mefesto: pandeiro: but update-in might do it

16:33 pandeiro: update-in is it, perfect

16:33 beffbernard: If I'm to upgrade to lein2, is there anything special I need to do in my project.clj so emacs/swank-clojure/clojure-jack-in jive together?

16:34 pandeiro: gtrak: i am doing this in middleware, conj'ing each request to an atom that i can inspect from the browser to make debugging a little nicer

16:39 nDuff: I'm playing around with field reflection, and have an object which clojure, at the REPL, simply prints as "int". (type that-thing) returns java.lang.Class... what _is_ it?

16:40 patchwork: Hmmm, jark server install fails because it cannot verify github's certificate?

16:40 what is that about?

16:41 amalloy: nDuff: int.class

16:42 the Class object representing the JVM primitive type "int"

16:43 nDuff: amalloy: ...what's the canonical way to refer to that class in Clojure?

16:43 amalloy: &Integer/TYPE

16:43 lazybot: ⇒ int

16:44 nDuff: graci

16:47 gfredericks: &(prn Integer/TYPE)

16:47 lazybot: ⇒ int nil

16:47 technomancy: beffbernard: you just need to declare lein-swank as a user-level plugin in ~/.lein/profiles.clj

16:47 I think it's covered in the swank readme

16:52 beffbernard: technomancy: swank readme or lein wiki?

16:52 like this? {:user {:plugins [[lein-swank "1.4.4"]]} ; ~/.lein/profiles.clj

16:53 technomancy: yeah

16:55 beffbernard: If I want to use the name lein2 instead of lein.. Do I (setq clojure-swank-command "lein2 jack-in %s") ?

16:55 technomancy: that should do the trick

16:56 mebaran151: if I concat two map statements (say they both map over results from a REST API that they have to GET), will the second map statement evaluate its arguments immediately or only when I exhaust the list from the first call to map

16:56 ieure: Is there a convenient way to decompile things in Clojure?

16:56 e.g.

16:56 I want to load up a class which I didn't write and dump its bytecode in the repl

16:59 beffbernard: technomancy: perfect

17:02 aaelony: what's the best way to provide a file chooser via clojurescript? I'm googling around without much success...

17:04 gfredericks: aaelony: like the regular built-in browser upload form?

17:04 aaelony: gfredericks: exactly, yes.

17:05 dnolen: brainproxy: I'm assuming your Michael Bradley? Mind not spamming the #clojurescript Twitter stream with turbonode? :)

17:05 gfredericks: aaelony: isn't that just [:input {:type "file"}]? or something close to that?

17:06 aaelony: gfredericks: thanks! I'll try that. Just learning... :)

17:06 gfredericks: oh no prob

17:08 dnolen: mmarczyk: ping

17:08 mmarczyk: dnolen: pong

17:09 aaelony: gfredericks: that's amazing. Works like a charm. :)

17:09 dnolen: mmarczyk: how much are you planning on digging into CLJS-235?

17:09 gfredericks: is there a standard clojure/java mechanims for running some code X seconds later without hogging a thread the whole time?

17:10 aaelony: delay ??

17:10 lazybot: aaelony: What are you, crazy? Of course not!

17:10 aaelony: funny

17:10 mmarczyk: dnolen: well, so far I've got a patch with replacement first / rest that seems to be a clear win in the ISeq case

17:10 gfredericks: aaelony: if you mean the clojure function, that's not what I'm talking about

17:10 aaelony: ok

17:10 mmarczyk: dnolen: could post that on the ticket with some cleanup and a proper commit message, actually

17:10 Chousuke: gfredericks: there's probably a java api for that

17:11 mmarczyk: dnolen: and apart from that -- a preliminary bit-and-based version of satisfies? which doesn't seem to be a win on node, so needs work

17:12 dnolen: mmarczyk: go ahead and do that if you have a second - I'm thinking about starting branch called rt-cljs where we can do this work.

17:12 gfredericks: Chousuke: ooh, java.util.Timer

17:12 mmarczyk: dnolen: ok

17:13 dnolen: mmarczyk: thx!

17:13 mmarczyk: dnolen: as for your actual question, which time frame did you have in mind? I'll probably need to go a little slower over the weekend, but that seems to be the most promising direction of cljs work, so I'd like to dig quit a lot eventually

17:14 ^dig into it

17:14 brainproxy: dnolen: yes ... wasn't aware it was spamming it

17:14 ???

17:14 lazybot: brainproxy: How could that be wrong?

17:14 dnolen: mmarczyk: yes that's why I'm suggesting a branch for this work instead of ticket.

17:14 mmarczyk: dnolen: ah, right

17:14 ok, making the patch now, be back in a sec

17:15 brainproxy: dnolen: is their a bot or something keying on mentions of clojurescript?

17:15 * gfredericks needs to implement the TimerTask class and so uses cemerick's flowchart to figure out how

17:16 dnolen: brainproxy: http://twitter.com/#!/search/realtime/clojurescript

17:16 hiredman: gfredericks: :(

17:16 brainproxy: dnolen: okay, i've turned off the github hook that posts to my dev stream

17:16 dnolen: brainproxy: thanks much

17:16 hiredman: gfredericks: you mean you need to use a scheduledthreadpoolexecutor

17:16 brainproxy: dnolen: sure thing, didn't realize it would cause a problem

17:16 hiredman: http://stackoverflow.com/questions/409932/java-timer-vs-executorservice

17:16 Chousuke: the kingdom of nouns :P

17:16 gfredericks: hiredman: aw crap

17:17 cemerick: gfredericks: if you're ever going outside of java.util.concurrent for…concurrency stuff…your spidey sense should tingle. :-)

17:17 brainproxy: dnolen: btw, I realized I was being a dummy .. the bootstrap and compile scripts in clojure-clojurescript/script/ were all I needed to use as part of my npm postinstall routines, rather than keeping my own copy of clojure sources and whatnot checked-in

17:17 hiredman: https://github.com/hiredman/clojurebot/blob/master/src/hiredman/schedule.clj

17:17 decentish, but not great

17:18 dnolen: brainproxy: so things are working for you now?

17:18 brainproxy: dnolen: sort of ... add-dependencies is working, but optimize is complaining about a null pointer

17:18 and I don't want stuff to go to disk, just want the whole string in memory ... I'll figure it out

17:18 anyway, getting much closer :)

17:19 hiredman: ideally you'd want a scheduled thread pool on top of clojure's existing threadpools

17:21 mmarczyk: dnolen: just posted the patch -- NB. I've skipped the second nil check (after calling seq in the non-ISeq case)

17:21 gfredericks: burgle...

17:22 dnolen: mmarczyk: the mask patch isn't based on master tho right?

17:22 mmarczyk: dnolen: ah, no

17:22 dnolen: mmarczyk: I still see the hasOwnProperty test.

17:22 mmarczyk: dnolen: yeah, that's the WIP patch -- out of date

17:23 dnolen: the first / rest patch seems like a win for ISeqs even with the current satisfies -- > 20 ms -> ~15 ms for first / rest on lists

17:24 dnolen: mmarczyk: yeah makes sense.

17:26 solussd: can I use #_ yet? ::D

17:26 err

17:26 #=

17:27 dnolen: mmarczyk: I've created a rt-cljs branch in my fork, if you track we can stay in sync.

17:27 mmarczyk: dnolen: yeah, I've noticed -- will track

17:30 dnolen: mmarczyk: so I take the satisfies? work is flux so you can't make a patch?

17:30 is in flux

17:31 mmarczyk: dnolen: hm, yeah, atm -- but I can probably polish it a bit so you can take it for a test ride tonight

17:31 dnolen: mmarczyk: please do, I'll apply that to rt-cljs.

17:32 gfredericks: you guys are so dang productive

17:32 mmarczyk: dnolen: ok, will do that in an hour or two I guess -- got to go away for a moment now

17:32 cbp`: hello, is there like a for where the sequences are traversed in parallel

17:33 dnolen: mmarczyk: great, thx!

17:33 gfredericks: cbp`: like ##(map vector (range) [:foo :bar :baz] "hahaha foo") ?

17:33 lazybot: ⇒ ([0 :foo \h] [1 :bar \a] [2 :baz \h])

17:34 dnolen: yoklov: haha, your latest project sounds fun.

17:35 cbp`: yes

17:35 gfredericks: hiredman: thanks for the example, that helped

17:35 yoklov: dnolen: haha, thanks, it's been quite fun so far

17:35 cbp`: but i want to bind it to a symbol

17:36 gfredericks: cbp`: you can use that within for

17:36 &(for [[a b c] (map vector (range) [:foo :bar :baz] "hahaha foo")] {:a a :b b :see c})

17:36 lazybot: ⇒ ({:a 0, :b :foo, :see \h} {:a 1, :b :bar, :see \a} {:a 2, :b :baz, :see \h})

17:37 cbp`: oh ok

17:37 thanks

17:42 mebaran151: is flatten lazy?

17:42 gfredericks: $source flatten

17:42 lazybot: flatten is http://is.gd/WWBDNQ

17:43 hiredman: ~flatten

17:43 clojurebot: flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.

17:43 mebaran151: I'm actually looking for mapcat

17:44 gfredericks: mebaran151: flatten looks lazy

17:45 amalloy: in the sense that if you use it, it's because you were too lazy to find the right function?

17:45 (but yes, it is lazy)

17:46 mebaran151: hiredma pointed me to mapcat, which was exactly what I needed

17:46 amalloy: clojurebot: high five!

17:46 clojurebot: It's greek to me.

17:57 mmarczyk: dnolen: just realized that I could post a patch for satisfies? using the general approach of the original WIP patch (no partitions yet) but with your improvements to satisfies? in place -- so that's attached to the ticket now -- next up, partitions-based patch

17:57 dnolen: mmarczyk: great thanks.

17:57 mmarczyk: ok, bbl

18:00 nDuff: What am I doing wrong when trying to use (into {} (partition 2 [:a :b :c :d]))?

18:02 gfredericks: &(into {} (partition 2 [:a :b

18:02 :c :d]))

18:02 lazybot: java.lang.RuntimeException: EOF while reading, starting at line 1

18:02 gfredericks: (into {} (partition 2 [:a :b :c :d]))

18:02 paste fail

18:02 &(into {} (partition 2 [:a :b :c :d]))

18:02 lazybot: java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry

18:02 gfredericks: &(partition 2 [:a :b :c :d])

18:02 lazybot: ⇒ ((:a :b) (:c :d))

18:03 gfredericks: &(into {} [[:a :b] [:c :d]])

18:03 lazybot: ⇒ {:a :b, :c :d}

18:03 gfredericks: &(into {} ['(:a :b) '(:c :d)])

18:03 lazybot: java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry

18:03 gfredericks: &(into {} (map vec (partition 2 [:a :b :c :d])))

18:03 lazybot: ⇒ {:a :b, :c :d}

18:03 gfredericks: hm

18:04 I can't think of why it would act that way

18:04 but apparently it likes vectors

18:04 amalloy: gfredericks: conj on maps has a stupid contract

18:05 gfredericks: welp. there you go.

18:05 it is stupid because a slightly lower-level thing is stupid.

18:06 amalloy: and of course it's an implicit contract, which you can only figure out by reading the source

18:06 gfredericks: it is hard to write good software.

18:07 yoklov: that's not a bug?

18:07 gfredericks: &(conj {} '(3 4))

18:07 lazybot: java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry

18:08 gfredericks: yoklov: do you know of any docs saying ^that should work?

18:09 yoklov: no, but it seems like it should i guess

18:09 regardless you can still do

18:09 ,(apply hashmap [:a :b :c :d])

18:09 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: hashmap in this context, compiling:(NO_SOURCE_PATH:0)>

18:09 yoklov: :(

18:09 gfredericks: oh I forget about that one

18:10 yoklov: ,(apply hash-map '(:a :b :c :d))

18:10 clojurebot: {:a :b, :c :d}

18:10 yoklov: nDuff: you can go about it that way

18:11 nDuff: Ahh; graci

18:58 cbp`: ughhh traversing vectors so different from other languages

18:58 i'm so confused

18:59 can't recur from inside doseq/for right

19:00 wkmanire: cbp`: One of the things I'm learning is that a lot of the time where you would want to traverse a vector in an imperative language, in clojure you really just want to map it or reduce it.

19:00 Basically perform some kind of transformation on the data

19:00 The other day I was using nth for example where I ended up being able to use destructuring.

19:01 technomancy: justified uses of loop/recur are very rare

19:01 cbp`: say if i'm traversing a vector of vectors and for every "special" value i find i need to do something to the rest of the matrix can i do that with maps/filters/etc

19:02 antares_: cbp`: you certainly can filter out "special" entries and do something with them. Do you need to modify the coll?

19:02 dnolen: mmarczyk: ping

19:02 kovasb__: cbp`: the function way to do it is to first find all the special values (maybe including their position)

19:03 cbp`: and then do the needed transformation

19:03 cbp`: with another function

19:03 cbp`: if you are more specific in the transformation you want to do, maybe theres another approach

19:03 cbp`: basically im

19:04 have you played the board game connect four

19:04 kovasb__: nope :)

19:04 cbp`: imagine you can turn it 90 degrees so that the pieces fall to the side

19:04 jodaro: pretty sneaky sis!

19:04 cbp`: well you drop pieces on stacks

19:05 so basically im representing that with a vector of vectors and rotating and then making the pieces "fall" to the ground

19:06 wkmanire: cbp`: I read a really interesting article today in Cemerick's book about representing Conway's game of life different.

19:06 It is one of thos vector intensive type problems in most languages.

19:06 Instead, Cemerick represents the game board as a collection of tuples of live cells.

19:06 Instead of using a vector of vectors.

19:07 The final solution ended up being very elegant. I wonder if you could take the same approach.

19:07 cbp`: well maybe

19:07 its just that i need to wrap my head around this really fast because its for a timed contest

19:07 wkmanire: myBoard == ([1 1] [2 2]) ;; I have pieces at 1,1 and 2,2.

19:07 cbp`: and i understand the problem in terms of matrices very easily and can do it very easily in python

19:07 kovasb__: cbp`: ive done stuff like that, it just write a function to identify the positions of the places of interest

19:08 cbp`: and then feed that into another function that takes the current state, those positions, and gives the new state

19:08 emezeske: cbp`: In your vector of vectors, are the inner fectors columns or rows?

19:10 cbp`: its something very literally like this:

19:10 [[. . .]

19:10 [. x .]

19:10 [x x x]

19:10 [x x x]]

19:10 so i rotate and it should give this:

19:10 [[. . .]

19:10 [x x .]

19:10 [x x .]

19:10 [x x x]

19:11 uhm assume its square and top row doesnt exist ^^

19:11 emezeske: cbp`: understood

19:11 cbp`: Given the nature of the game, where gravity affects columns, I might suggest making the inner vectors columns

19:12 cbp`: Then you could do something like (map apply-gravity matrix)

19:12 cbp`: yeah i guess thanks

19:13 amalloy: emezeske: i don't think that matters much, because when you rotate the board it "switches"

19:13 so if you used row-major format, you could apply-gravity then transpose, and in column-major you could transpose then apply-gravity

19:13 emezeske: Yeah that's true

19:14 Makes more sense to me to rotate and then apply gravity, though, although it really doesn't matter

19:14 jayunit100: hi guys -> this method has a weird siganture : http://pastebin.com/raw.php?i=4AW2j1Ad.

19:14 amalloy: yeah, and when you're not actively rotating it's probably better to go column-major

19:15 emezeske: cbp`: Another hint: something like this might be useful for apply-gravity (concat (repeat 3 "x") (repeat 1 "."))

19:15 amalloy: actually, perhaps it's best to have a board like [[a b c] [d e f] [g h i]], where a is the bottom-left and c is the top-left?

19:15 ie, column-major but bottom-first? it seems like that helps somehow

19:16 emezeske: amalloy: I could see that making the gravity reduce easier maybe?

19:16 amalloy: right

19:16 i'm not sure how, but it feels like it will

19:16 emezeske: I'd probably just go quick & easy and just count the chips, and do the concat repeat thing I pasted above

19:16 Not very elegant though

19:17 amalloy: (defn apply-gravity [column] (apply concat ((juxt filter remove) piece? column)))

19:18 emezeske: Nice!

19:18 I love juxt...

19:18 cbp`: don't need elegant =p need something i can think up and implement in 10 minutes

19:22 jayunit100: rephrase question :) -> how can you have a defn with 2 [] []s after it ? I've never seen such syntax before.

19:23 emezeske: jayunit100: The first [] specifies the arguments, the second [] is the body of the function

19:23 cbp`: returns empty vector?

19:23 emezeske: jayunit100: In other words, the function returns a vector

19:23 jayunit100: Oh i guess the ( is only needed if we want to eval.

19:23 emezeske: jayunit100: (defn [] [1 2 3]) would be like (defn [] (vector 1 2 3))

19:24 jayunit100: aha yup/ not thinking very clojurely. my bad been in java ee world all day 2day

19:24 emezeske: :)

19:29 dnolen: muahahaha

19:30 CLJS satisfies? call is faster than JS instanceof on V8

19:30 amalloy: nice

19:33 * wkmanire wishes he was already messing with CLJS.

19:34 wkmanire: Alas, my time has not yet come.

19:34 emezeske: dnolen: That's just ridiculous

19:34 amalloy: dnolen: was satisfies? using instanceof before? i didn't think js had multiple inheritance, and you were just looking up some method with a funky name in the prototype

19:35 dnolen: amalloy: satisifes? was looking up the prototype chain before.

19:36 emezeske: amalloy: >2X faster :D

19:36 dreish: p3i.P3i cannot be cast to p3i.P3i [Thrown class java.lang.ClassCastException]. Oooooookay ...

19:36 dnolen: than instanceof

19:36 >10X faster than old satisfies?

19:36 ibdknox: dnolen: Good work!

19:37 dnolen: ibdknox: yes this is big.

19:37 amalloy: does satisfies? actually end up getting used at all? shouldn't most of those tests wind up being polymorphic dispatch?

19:37 wkmanire: dnolen: I totally misread your first statement.

19:38 dnolen: amalloy: polymorphic dispatch is relatively slow

19:38 amalloy: we want to test membership to avoid hitting protocols when possible.

19:38 wkmanire: I thought "CLSJ satisfies?" was a proposition. Didn't realize you were refering to a function.

19:38 ibdknox: lol

19:38 dnolen: wkmanire: satisifes? is actually a macro ;0

19:39 oops

19:40 wkmanire: I like having punctuation be valid in symbol names, but sometimes I get hung up on it when I'm reading.

19:40 amalloy: oh i see. so you can actually expand to the bit-test at compile time

19:40 wkmanire: My internal syntax parser wants to reverify it several times.

19:40 dnolen: amalloy: yep

19:40 dreish: I think I might have found it, in case anyone saw my confounding error message above. After recompiling p3i.clj (which has a defrecord P3i), I needed to redo (import 'p3i.P3i) at the repl.

19:40 dnolen: amalloy: satisfies? is not a function call - never was.

19:40 amalloy: dnolen: is it really a macro, or a function with a compiler-macro around it? i can imagine wanting to do like (filter (partial satisfies? Counted) ...)

19:41 dnolen: amalloy: satisfies? won't be a function anytime soon.

19:42 scottj: lein question: do :jvm-opts of dependencies apply or just the main project.clj?

19:42 hiredman: dnolen: maybe a canidate for something like definline ?

19:42 amalloy: is there a reason for that? it seems like a level of dynamism that there's no reason to reject

19:43 dnolen: hiredman: well CLJS doesn't have definline

19:43 amalloy: it has compiler macros though, right?

19:43 hiredman: you can't just lift the definline macro from core.clj?

19:43 dnolen: amalloy: yes

19:44 hiredman: there's no need with compiler macros really.

19:44 amalloy: now that I think about - now that protocol mask exists, yes satisfies can be function :)

19:44 hiredman: dnolen: if you want something to be like a macro and like a function?

19:45 dnolen: hiredman: define the function, define the compiler macro w/ the same name.

19:45 hiredman: ah

19:55 muhoo: this is where not having a cs degree is a huge limitation for me, but, how would i walk a tree and get a list of the parents for each leaf node? functionally (i know how to do it imperatively, easily)

19:56 mmarczyk: dnolen: pong

19:56 wkmanire: muhoo: Still working on your new category structure?

19:56 muhoo: ya, that one

19:57 dnolen: mmarczyk: so bit mask protocol test is fast - very, very fast :)

19:57 wkmanire: Do you want just the parents? Or you do you want the leaf and it's parents?

19:57 mmarczyk: dnolen: hah! great :-)

19:57 dnolen: do you mean my WIP patch or did you write another impl?

19:57 muhoo: what i ultimately want is a structure like [leaf [parent grandparent greatgrandparent]]

19:58 wkmanire: So you want the whole branch from root to leaf.

19:58 muhoo: for each of the leaves, yes

19:58 postwalk is great, but i haven't figured out how to SAVE the values, without resorting to atoms and such

19:58 gfredericks: muhoo: I think it'd be pretty simple to define recursively

19:59 wkmanire: muhoo: Whatever you end up doing to solve this, I'd like to see the solution if you don't mind.

19:59 dnolen: mmarczyk: there a couple problems

19:59 muhoo: sure thing, it'd be a nice generic library thing

19:59 dnolen: mmarczyk: bool type inference needed fixing

19:59 wkmanire: My puny FP brain sais create a seq out of the branch and then flatten it to an array.

19:59 gfredericks: (fn parents-map [tree] (if (leaf? tree) {tree []} ...))

19:59 wkmanire: rather, a vector.

19:59 says*

19:59 dnolen: mmarczyk: needed a bit-and that won't trigger truth test

19:59 mmarczyk: and needed an or around bit test and prototype chain lookup

20:00 "there were a couple of problems" I mean.

20:00 mmarczyk: dnolen: right

20:00 muhoo: gfredericks: where's the leaf? function?

20:00 clojurebot: functions are maps

20:00 mmarczyk: dnolen: oh, so you got around the truth_ in satisfies? then?

20:00 dnolen: fantastic :-)

20:00 dnolen: mmarczyk: no truth_ in satisfies? anymore

20:00 mmarczyk: dnolen: :-D

20:00 gfredericks: muhoo: depends on exactly how your tree is represented

20:01 muhoo: when you say you want the parents, is a parent a whole subtree or just the root node of the subtree?

20:01 dnolen: mmarczyk: all the changes are in my CLJS fork, rt-cljs branch

20:01 muhoo: [node [subnode [subsubnode1 subsubnode2] subnode2]

20:01 gfredericks: i'm looking for the path

20:01 so, for subsubnode1 above, i'd want [subsubnode1 [subnode node]]

20:01 mmarczyk: dnolen: looking at it now

20:02 gfredericks: muhoo: okay so

20:03 muhoo: of [subnode1 [node subnode]] . i know how to use reverse :-)

20:03 dnolen: mmarczyk: k, so I'm seeing a 2X perf boost on first on lists.

20:03 muhoo: or

20:03 mmarczyk: dnolen: hm, so how are you measuring this?

20:03 dnolen: mmarczyk: w/ node

20:03 mmarczyk: dnolen: https://gist.github.com/2598523 <- my simplistic benchmark "suite"

20:04 dnolen: running cljsc on that w/ :opt :adv, then node timings.js

20:04 gfredericks: muhoo: hold on gonna make a paste

20:04 mmarczyk: dnolen: ...and then totally misreading the output, lol

20:04 dnolen: yeah, I'm seeing a huge perf boost too :-d

20:04 :-D, that is

20:05 gfredericks: wtf refheap.com gives a cert error?

20:05 ibdknox: Raynes: ^

20:05 gfredericks: Raynes u can haz hax0r

20:05 dnolen: mmarczyk: :)

20:05 Raynes: gfredericks: I'm currently working on moving to Heroku.

20:05 mmarczyk: dnolen: though actually the win seems to be there on master

20:05 Raynes: gfredericks: Could you tell me exactly what it is telling you?

20:06 mmarczyk: dnolen: with your satisfies? fix

20:06 Raynes: My dns is cached, so I'm kinda screwed.

20:06 gfredericks: Raynes: pm

20:08 muhoo: refheap works, i shrugged and added exception to the ssl error

20:08 Raynes: muhoo: Yeah, but it shouldn't happen. Working it out.

20:08 gfredericks: muhoo: https://gist.github.com/2598613

20:08 mmarczyk: dnolen: oh, you haven't applied the first/rest patch on the branch then?

20:09 dnolen: mmarczyk: not yet no, you really want to do what I said in the ticket, and not what you did in your patch.

20:09 muhoo: Raynes: oh, smells like phish too. hmm, glad you're tracking that

20:09 mmarczyk: dnolen: with the extra nil check you mean?

20:09 dnolen: mmarczyk: yes

20:10 muhoo: getpersonas? uh huh.

20:10 Raynes: muhoo: It's just a DNS problem.

20:10 dnolen: mmarczyk: otherwise you slow down the nil path.

20:10 mmarczyk: dnolen: I suppose, though I couldn't measure much of a difference

20:10 dnolen: mmarczyk: calling a protocol fn should basically be last resort.

20:10 mmarczyk: if you have nil return nil, don't waste time calling a protocol fn.

20:10 muhoo: oh np

20:10 dnolen: mmarczyk: nil is slow, because you can't even handle that null via a JS prototype

20:11 Raynes: muhoo: Does refheap.com redirect to www.refheap.com?

20:11 mmarczyk: dnolen: ok, about satisfies? -- are you seeing a speedup on rt-cljs vs. current master?

20:12 muhoo: Raynes: curl -i refheap.com => Location: https://refheap.com/

20:12 dnolen: speedup for what? satisfies?

20:12 mmarczyk: yeah

20:12 muhoo: ah, curl -i https://refheap.com => SSL: certificate subject name '*.heroku.com' does not match target host name 'refheap.com'

20:12 that's it

20:12 dnolen: marchdown: satisfies? on master for 1e6 takes >100ms, for 1e6 on rt-cljs ~10ms

20:13 gfredericks: muhoo: come on man tell me how much you love my codez

20:13 muhoo: i'm stunned by your codez, gfredericks

20:13 gfredericks: phew

20:13 * gfredericks exhales

20:14 muhoo: i'm testing it now, hope to see if it works, but i'm inclinded to take some time to try to digest it

20:14 gfredericks: wow, and it does, perfectly.

20:15 mmarczyk: dnolen: wow, I'm seeing a speedup alright at huge iteration counts, but nowhere near 10x

20:15 muhoo: how the hell??? it's going to take me a while to understand that :-)

20:15 gfredericks: w00p

20:15 Raynes: I think I know what's going on. I've pointed refheap.com to heroku and the ssl cert doesn't like that at all. The canonical host now will be www.refheap.com (which should be working fine, btw, as long as your DNS is up-to-date), but I think I'm going to have to add a redirect on my own server.

20:15 Can somebody confirm www.refheap.com gives no SSL whining?

20:16 muhoo: Raynes: still whining, according to curl

20:16 gfredericks: muhoo: think of it from the perspective of any internal node; if you know the paths up to all your children, you know the paths up to yourself are just those paths plus yourself (i.e. the conj)

20:16 muhoo: gfredericks: it's great code, in particular because it uses stuff i'm well familiar with. and yet, i really need to study it

20:17 gfredericks: recursion and trees are well familiar with each other

20:17 amalloy: gfredericks: doesn't that only work if all the tree elements are unique?

20:17 muhoo: hehee, and here comes amalloy preparing rev 2.0 of it :-)

20:17 which will be 1 line and have 3 symbols

20:18 mmarczyk: dnolen: 1e7 iterations of (satisfies? ISeq coll), where coll is a list created outside of the timed block: ~265 ms -> ~250 ms

20:18 gfredericks: amalloy: yeah, I forgot he didn't specify a map

20:18 muhoo: so if they're not unique then you can't use a map, but I think the other version would be about as simple

20:19 mmarczyk: dnolen: could you paste the code you use for timings somewhere? I'm trying to figure out what's wrong with my timings

20:19 dnolen: mmarczyk: avoid advanced optimizations for now, use simple + static-fns true

20:19 mmarczyk: dnolen: ok, trying that now

20:19 Raynes: muhoo: www.refheap.com, not refheap.com

20:20 mmarczyk: dnolen: ...and all of a sudden the satisfies? test takes 5x as long on master, advanced compilation must have been doing something

20:20 dnolen: mmarczyk: yep

20:20 mmarczyk: it's important to look at the generated code

20:21 mmarczyk: advanced opts often just eliminates the work.

20:21 Raynes: I just switched DNS providers (google's dns is up to date), and refheap.com is the only host giving SSL warnings. www.refheap.com should work fine, and refheap.com should redirect to www.refheap.com after you accept the evil SSL. So, I should be right in that just adding a redirect on my own server should work, so I'm going to do that.

20:21 dnolen: mmarczyk: esp. if it's simple

20:21 mmarczyk: I mean simple work

20:21 gfredericks: muhoo: I think just change {tree []} to [[tree []]] and use concat instead of merge and screw the (into {})

20:21 Raynes: Also, sorry for clogging up the channel with this stuff, it's just you guys are the only people I know who use the site. :p

20:22 gfredericks: Raynes: wrong channel, please move the conversation to #refheap-dns

20:22 Raynes: gfredericks: :p

20:22 muhoo: Raynes: www.refheap.com is working, no whining

20:22 mmarczyk: dnolen: ok, what I'm seeing now is literally unbelievable

20:22 dnolen: :-D

20:22 Raynes: muhoo: Great, then I can fix this!

20:22 Bear with me boys and girls.

20:22 dnolen: mmarczyk: ;)

20:23 mmarczyk: dnolen: right, so I guess I'll be putting the finishing touches on the partitioned proto masks now :-)

20:23 dnolen: mmarczyk: excellent

20:23 mmarczyk: dnolen: do you want a patch on the ticket for that or a commit in my fork?

20:23 muhoo: gfredericks: amalloy: they are unique, so no problem there

20:23 dnolen: mmarczyk: just work on your fork

20:23 mmarczyk: and I'll pull your changes.

20:24 mmarczyk: dnolen: cool

20:24 muhoo: i'm working on figuring out if i can mod it to give me parents for the intermediate nodes too, not just the leaves. just to see if i really understand it

20:25 pandeiro: anyone noticed weird double retrieval of resources with noir/cljs-template?

20:27 mmarczyk: dnolen: just pushed first/rest with the second nil check

20:31 muhoo: gfredericks: well i knew enough to replace (apply (concat (map .. with mapcat :-)

20:31 gfredericks: wuhoo mapcat

20:32 Raynes: Okay guys, refheap.com is still going to fail until DNS propagates and then it should point back to my server and my nginx rewrite takes effect. The canonical domain is www.refheap.com now anyways, so you can just use that. Sorry for any inconveniences.

20:33 The reason this happened was because I didn't realize you had to use subdomains with SSL on Heroku, and they frown on naked domains. I pulled the trigger a little too quickly. ;)

20:34 muhoo: i see where i got stuck. i was trying to figure out how to do it with recur. advanced tco mojo was not necessary and was just confusing me

20:34 (not (= recur recursion))

20:34 gfredericks: yeah tco gets thwarted whenever you want to recur more than once

20:49 zakwilson_: http://news.ycombinator.com/item?id=3927891 <-- node.js clone for the JVM. Is this a cargo cult?

20:53 jtoy: how do I get all the urls from a string? I am trying something like : (re-find #"^http://S+" "http://asdasd.com asdasd http://google.com")

20:54 gfredericks: jtoy: and you're only getting the first one? because of the ^?

20:54 amalloy: re-seq

20:54 gfredericks: oh right

20:54 that too

20:54 jtoy: oh cool

20:54 gfredericks: amalloy always fixes my answers

20:54 Raynes: &(re-seq #"^http://S+" "http://asdasd.com asdasd http://google.com

20:54 lazybot: java.lang.RuntimeException: EOF while reading string

20:54 Raynes: &(re-seq #"^http://S+" "http://asdasd.com asdasd http://google.com")

20:54 lazybot: ⇒ ("http://asdasd.com")

20:54 amalloy: it's okay, i wouldn't have noticed the ^ issue

20:54 Raynes: Me either.

20:54 amalloy: evidently

20:55 jtoy: &(re-seq #"http://S+" "http://asdasd.com asdasd http://google.com")

20:55 lazybot: ⇒ ("http://asdasd.com" "http://google.com")

20:55 zakwilson: URLs are used for protocols that aren't HTTP. It's fine if you don't care about that, but be aware.

20:56 gfredericks: tincan://

20:58 mmarczyk: dnolen: almost done on the partition-based patch -- seeing a speedup of 2x :-)

20:59 dnolen: (first/rest on a list)

20:59 dnolen: mmarczyk: yep that's basically what I'm seeing.

21:00 mmarczyk: dnolen: right, and now the same thing should be possible for all core protocols :-)

21:05 jayunit100: Exception messages and handling could be improved in clj.. hope soon :] .. would be cool if we could contribute exception messages without being official "contributors" somehow.

21:06 mmarczyk: dnolen: apparently it breaks the (= () (rest nil)) test, though -- looking into it

21:09 gfredericks: swank-clojure assumes I am a male

21:12 mmarczyk: dnolen: hm, it's the first/rest patch that is breaking the test -- not sure what's going on

21:12 dnolen: ohhhh wait

21:12 dnolen: mmarczyk: yes we'll have to be careful to preserve the various invariants.

21:13 mmarczyk: dnolen: just realized that (rest nil) is probably meant to be ()

21:13 dnolen: mmarczyk: yep

21:13 mmarczyk: dnolen: fixing that now

21:13 dnolen: mmarczyk: RT.java more

21:13 mmarczyk: yeah

21:18 dnolen: ok, just pushed rt-cljs to my fork w/ partitioned protocol masks and first/rest

21:25 dnolen: mmarczyk: merged, please merge from my fork.

21:25 mmarczyk: first on List getting reasonable

21:26 mmarczyk: dnolen: :-)

21:26 dnolen: mmarczyk: first on PV crazy slow :)

21:27 mmarczyk: dnolen: yeah :-(

21:27 dnolen: that does take a hit

21:28 dnolen: mmarczyk: probably just needs looking into.

21:28 mmarczyk: dnolen: yes

21:30 dnolen: first on vector is 6x slower than first on list in Clojure, though

21:30 dnolen: which is not a problem in practice :-)

21:30 dnolen: mmarczyk: yeah

21:31 mmarczyk: dnolen: so clearly this is a huge win -- I really had to see it to believe it

21:31 dnolen: fantastic idea!

21:31 the speedup on satisfies is ridiculous

21:31 dnolen: mmarczyk: yes :) there's quite a bit of work left to do.

21:31 mmarczyk: dnolen: ok, so what are the next steps?

21:31 dnolen: mmarczyk: V8 is awesome but I think we'll find that it leaves much to be desired compared to the JVM

21:32 mmarczyk: inlining is not nearly so aggressive on V8 as the JVM.

21:33 mmarczyk: next steps I think are going through RT.java and seeing which fundamental fns could benefit from RT.java style.

21:34 mmarczyk: dnolen: there's a bunch of functions which just call through to the proto method

21:34 dnolen: seq on non-nil, conj

21:34 dnolen: mmarczyk: we should apply your patches to remove the extend-type default

21:35 mmarczyk: dnolen: they should apply cleanly, I think

21:36 dnolen: mmarczyk: where possible we should try to avoid calling protocol dispatch on nil I think.

21:36 mmarczyk: dnolen: inline the impls on nil by hand, basically?

21:37 brweber2: Does anyone know if a clojurescript book is in the works? Is it stable enough to publish something?

21:37 dnolen: mmarczyk: now that I think bout that we should do that last

21:37 mmarczyk: dnolen: I *think* there might be some spots in core where -methods are used directly in a way which would then not be nil-safe, but I'm not sure; will go and check

21:39 TimMc: jayunit100: Are you familiar with (pst) in the REPL?

21:39 jayunit100: Or do you mean the error messages themselves?

21:39 dnolen: mmarczyk: next & seq probably should involve some thinking how to optimize they are critical.

21:39 mmarczyk: dnolen: what do you think about next? any way to avoid that seq call? (can't just check for ISeq, since LazySeq implements that too)

21:39 dnolen: mmarczyk: another one is handling of EmptyList

21:39 mmarczyk: dnolen: right

21:40 dnolen: mmarczyk: EmptyList in Clojure on JVM is not ASeq

21:40 mmarczyk: dnolen: no, but it implements ISeq

21:41 dnolen: mmarczyk: but I wonder if we shouldn't have ASeq as a marker protocol

21:41 mmarczyk: dnolen: with what semantics?

21:41 pandeiro: ibdknox: is there a known bug with noir.server/add-middleware (1.3b3)? my logging fn shows everything getting requested twice when i add it with add-middleware, but not when i create the handler manually

21:42 dnolen: mmarczyk: ASeq is ISeq sans EmptyList?

21:42 mmarczyk: no need to rush this stuff :) I'm about to call it quits soon.

21:42 mmarczyk: dnolen: LazySeqs might or might not be empty though, so it couldn't carry a non-empty guarantee

21:42 dnolen: sure

21:43 dnolen: I wonder if next could somehow handle lazy seqs specially -- only calling seq on them -- without taking too much of a hit from the extra tests

21:44 dnolen: ILazySeq marker?

21:44 dnolen: mmarczyk: why not just (instance? LazySeq x)

21:44 mmarczyk: dnolen: hm, yeah, there will be no other impl

21:45 amalloy: dnolen: that loses the generality/extensibility of the languages. now nobody else can implement their own "flavor" of lazy seqs, right? you've hardcoded special behavior to the existing impl

21:45 eg, chunked seqs

21:45 mmarczyk: dnolen: so then next would check for that and return (rest coll) on false, (seq (rest coll)) on true

21:45 * spjt is awake, dumb question time

21:45 mmarczyk: oh. fair point.

21:46 incidentally what's the status of that chunked vector patch?

21:46 spjt: So.. how do I make "lein repl" load the current version of clojure?

21:46 dnolen: amalloy: perhaps ...

21:46 brehaut: spjt: specify it in your project.clj and hope none of your dependancies override it

21:46 dnolen: mmarczyk: chunked vector would be nice

21:46 spjt: brehaut: I'm starting lein in a directory with no project

21:46 mmarczyk: dnolen: yeah, and there is a patch on the ticket actually

21:47 brehaut: then you get whatever lein wants to give you

21:47 mmarczyk: dnolen: *probably* not usable as-is because of the changes to PV around transients

21:47 spjt: brehaut: is there some configuration file for lein? I've been looking at google for a while about this

21:47 brehaut: spjt: there might be fore lein2, but i dont think there was for lein 1 (not that im an expert)

21:47 i just create a dummy project when i really care

21:48 mmarczyk: dnolen: well actually that patch is only the beginning of the story, since then things actually need to check for chunkiness, we need chunked-cons & Co.

21:48 dnolen: which means it's kinda fortunate that satisfies? just got faster, cause it's gonna be needed :-)

21:48 spjt: hmm. I actually looked and "lein" is some shell script and the clojure jar filename is in there.. twice. Bad.

21:49 CLOJURE_JAR="$HOME/.m2/repository/org/clojure/clojure/1.2.1/clojure-1.2.1.jar"

21:49 CLOJURE_JAR_URL=http://build.clojure.org/releases/org/clojure/clojure/1.2.1/clojure-1.2.1.jar

21:49 mmarczyk: dnolen: ok, I'll try to merge the existing patch and build sth on top of that, or if it's unmergeable for some reason, start over

21:49 pandeiro: spjt: i believe that's just the version lein1 uses internally or something

21:50 dnolen: mmarczyk: sounds good

21:50 spjt: pandeiro: It's the version it uses for lein repl. I'm not at the point where I want to create a project

21:51 pandeiro: spjt: i think you always want to create a project to use lein

21:51 lein new foo && cd foo && lein repl

21:51 spjt: pandeiro: I only use "lein repl", I'm not advanced enough to make any sort of project

21:51 mmarczyk: dnolen: back to the RT.java stuff: I think nth could perhaps use a split into -nth-based part and a linear helper?

21:52 pandeiro: spjt: blind leading the blind here but i think you should try what i suggested

21:52 spjt: Hmm.

21:52 pandeiro: ...that is, if you want to use clojure 1.3 or 1.4

21:53 spjt: emacs inferior-lisp is also running 1.2.1, i think it runs lein repl

21:55 dnolen: mmarczyk: lets leave the chunked stuff alone for now. and focus on RT.java

21:56 mmarczyk: dnolen: I notice that cljs.core/find should now be faster, by magic

21:56 dnolen: apart from that, there is a whole bunch of functions which delegate straight to the proto method

21:57 dnolen: current impl of nth, say

21:57 dnolen: mmarczyk: one thing we should be very careful about - slowing things down.

21:57 xeqi: spjt: the clojure jar has to be on the classpath to run lein. in lein 1.x it uses 1.2.1 for this. This is what you get when lein is run outside a project

21:57 mmarczyk: dnolen: so in the cases where the proto method is called and nothing else happens

21:57 xeqi: if you have a project then lein will spawn another jvm with the specified version

21:58 mmarczyk: dnolen: there's nothing to be gained from an extra check, right?

21:58 dnolen: mmarczyk: like the PV case, it also seems like first on prim arrays may have gotten slower.

21:58 mmarczyk: I think we're going to have measure carefully against master

21:59 mmarczyk: dnolen: anything which is not an ISeq will be slower, as will anything which is an ISeq, but not a cljs type / record, and thus has no proto masks attached

21:59 dnolen: extend-type could of course attach proto masks to prototypes

22:00 dnolen: mmarczyk: yes but we're missing a opportunity to simplify the code path.

22:00 mmarczyk: under advanced optimization we have all the information

22:00 mmarczyk: no need to do the prototype chain lookup at all

22:01 if mask fails, it fails

22:01 mmarczyk: dnolen: well it still has to be attached somewhere; for strings that would presumably be to the string prototype?

22:01 dnolen: mmarczyk: JS natives are not directly extended.

22:02 mmarczyk: separate test entirely.

22:02 mmarczyk: dnolen: oh ok, that's right

22:02 dnolen: mmarczyk: in anycase I'm done :) some fun stuff to play with and test for the next few days.

22:02 mmarczyk: dnolen: :-)

22:04 dnolen: ok, I'll call it a night too for now -- looking forward to more CLJS fun soon though :-)

22:04 spjt: Weird, if I change the version of clojure in the lein shell script it crashes.

22:05 mmarczyk: (or I might actually get the node repl done, cause the lack of it is beginning to drive me crazy :-P)

22:11 pandeiro: spjt: if you use arch the version in community is already 1.4.0... you can get a repl with `clj`, no lein necessary (since you're not really wanting to create a project)

22:12 spjt: pandeiro: Emacs uses lein to make the inferior-lisp repl, I had it working with "clj"

22:13 pandeiro: spjt: hmm, emacs using clojure-mode does that by default? ... but emacs is another can of worms i think if all you want is a repl

22:14 spjt: I managed to get it to use 1.4.0 by creating a project, creating a new file, opening a repl in that window, but it seems pretty.. inelegant.

22:15 pandeiro: spjt: what OS do you use?

22:15 spjt: then again, maybe I should have asked if what I want to do already exists

22:15 pandeiro: OSX, I can try it in Linux

22:16 pandeiro: no any nix is fine, just create an alias for quickly setting up a dummy project and entering the repl

22:16 spjt: I wanted to write a clojure "program" that just has little snippets to show an example for each function in core

22:16 pandeiro: that you would then use at the repl?

22:16 spjt: maybe such a thing already exists

22:17 pandeiro: I'd use it in emacs since it's so easy to evaluate expressions

22:17 you just move to the end and hit C-x C-e and it shows the output

22:17 pandeiro: spjt: have you checked out swank-clojure?

22:18 xeqi: spjt: have you seen the clojure koans? not quite what you're describing, but kind of that direction

22:18 pandeiro: i think nREPL also has the ability to fetch stuff from clojuredocs, which often include examples

22:18 spjt: pandeiro: hehe, yeah. I think I got it working once, but it puts the output in the minibuffer which I didn't like

22:19 pandeiro: spjt: swank-clojure gives you the function clojure-jack-in, which opens a SLIME REPL, not a minibuffer at all... it's a repl on steroids

22:19 spjt: pandeiro: It outputs on the minibuffer.

22:20 pandeiro: *slime-repl ...* is a minibuffer? don't think so...

22:20 spjt: pandeiro: You can type into the buffer, but eval output appears in the minibuffer.

22:21 I know I had it working once, but I can't remember how to start it, I just ran clojure-jack-in and it gave me a page of errors

22:22 pandeiro: it is not exactly plug and play but i'm 7-8 months in to clojure/emacs and i'd say swank-clojure is well worth the effort... the github page for it has pretty simple instructions

22:22 C-x C-e will eval the form under point in the slime repl i believe

22:23 one of the main gotchas with swank-clojure is having another version of slime installed, get past that hurdle and you should be fine i think

22:24 spjt: hehe. I think Clojure is the first language I've seen where it's harder to run a program than it is to write it

22:27 pandeiro: spjt: no joke, the environment can be a challenge

22:27 wait til you try clojurescript :)

22:29 emezeske: spjt: Have you tried Leiningen? For me it removes all challenges to running a program

22:30 spjt: emezeske: I think lein is actually where my challenges started

22:30 emezeske: spjt: Huh.

22:30 pandeiro: spjt: what's the actual obstacle at this point?

22:31 spjt: pandeiro: I dunno, I suppose I can get around it, I have inferior-lisp running 1.4.0

22:31 I got swank to work once, but I don't remember how I did it.

22:33 pandeiro: spjt: do you have an ~/emacs.d already? mine is here https://github.com/pandeiro/dotemacs, you could just swipe it and it should work

22:33 spjt: pandeiro: yeah, I can set it aside temporarily

22:34 actually I'm wondering if I ever reinstalled all the necessary el files

22:35 pandeiro: spjt: that got me once as well, i accidentally removed slime and clojure-jack-in stopped working :)

22:37 spjt: i have them all installed afaik

22:38 technomancy: all you need is clojure-mode, leiningen, and lein-swank

22:38 spjt: hm?..

22:39 It's starting the server, it just can't connect to it

22:44 error in process filter: Symbol's value as variable is void: slime-clj

22:44 gotten it down to only one error at least

22:45 technomancy: spjt: yeah, get rid of slime-clj

22:45 it's deprecated

22:45 spjt: technomancy: in favor of what?

22:46 technomancy: slime-clj became ritz, which is an alternative to swank-clojure

22:46 it just used to have a terrible name

22:47 spjt: technomancy: hmm, I saw that ritz thing, I had no idea what it was.

22:48 As long as I don't have to give up emacs. That was the worst thing about clojure at first, but now I'm using it instead of Windows at work

22:49 technomancy: clojurebot: swank?

22:49 clojurebot: swank is trust the readme and the readme only. all others will lead you astray.

22:50 technomancy: ^ real truth

22:51 spjt: I don't know why I'm even bothering with this, inferior-lisp works fine now as long as I load a file in the project directory

22:53 I don't think this has anything to do with emacs though, it's lein that's messed up

22:53 technomancy: it has happened before

22:54 spjt: At the command line, "lein swank" runs fine. "lein jack-in" runs fine

22:55 As long as they're not running at the same time.

22:56 when I do that, I get:

22:56 Exception in thread "main" java.lang.RuntimeException: java.net.BindException: Address already in use

23:08 I got it working, such a silly issue.

23:08 whatever it was, rm -rf ~/.emacs.d/swank fixed it

23:09 technomancy: you can't open two servers on the same port

23:09 spjt: technomancy: I was trying to open a server and a client.

23:10 The worst part is that now that I've finally got everything working, I completely forgot what I wanted to write.

23:12 technomancy: jack-in opens a server and a client at the same time

23:12 it's meant to replace lein-swank rather than working with it

23:13 spjt: technomancy: yeah, I was just trying to run it manually on the command line to figure out why it wasn't running.

23:14 technomancy: For whatever reason, whatever it ended up compiling into .emacs.d/swank was making it no longer work, because it started working once I deleted it.

23:17 _KY_: What is the way to avoid name clashes when I "use" 2 modules in the test module?

23:17 tmciver: _KY_: don't use; require

23:18 _KY_: (:require lib.name :as alias)

23:18 _KY_: I see...

23:18 tmciver: err, (:require [lib.name :as alias])

23:21 clojure aphorism: only use use with only

23:22 technomancy: only use :use with versions of clojure prior to 1.4 doesn't quite have the same ring to it

23:22 xeqi: hmm, do other people alias clojure.test vs use/refer+require

23:23 technomancy: xeqi: I like to think of clojure.test as being the equivalent of clojure.core for the test/ directory =)

23:23 tmciver: yes, I use clojure.test :/

23:23 technomancy: there are only 3-5 vars you'll ever use from it, so I think :refer :all is pretty well-justified

23:27 ivan: I noticed that in Clojure it's more common to accept both Thing and a vector of Thing, than it is in Python

23:27 is there a design rationale somewhere for this forgiveness?

23:29 xeqi: ivan: do you have an example?

23:29 ivan: (require 'x) (require '[x y])

23:30 something else I can't remember right now

23:30 er, maybe it was not require but something similar

23:31 I'll come back when I have better examples

23:37 amalloy: ivan: (require 'x) is very different from (require '[x y])

23:37 ivan: yep

23:38 https://github.com/mmcgrana/ring/blob/master/SPEC <- ring has a String or a seq of Strings

23:38 amalloy: i guess my point is it's not accepting "x or a vector of x", it's accepting "a symbol or a totally different datatype, which happens to be a vector"

23:39 technomancy: ivan: the seq of strings is to allow for response bodies to be lazy

23:39 ivan: technomancy: I meant the headers, sorry

23:40 technomancy: that's just a quirk of the HTTP spec; you can have a header provided multiple times with different values

23:41 ivan: yeah, I know that part. I'm just wondering if it's good design to accept both Thing and seq of Thing, instead of only seq of Thing

23:41 a little bike-sheddy, perhaps

23:41 but you can get spectacular explosions when you treat a string as a list of Thing and get bytes or whatever

23:42 even worse in Python, where you get 1-byte strings

23:42 technomancy: I'd say it's not a good principle in general; each of these cases have specific motivations behind them

23:43 mlozano: evening!

23:43 ivan: supporting a non-seq would seem to expand every API user's code slightly

23:52 Raynes: &(repeat 500 "I'm a little teapot")

23:52 lazybot: ⇒ ("I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapo... https://www.refheap.com/paste/2574

23:52 Raynes: Excellent.

23:53 technomancy: Raynes: I was going to mention that apex domains are strongly advised against if you ever might face a DDOS: https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords

23:53 xeqi: &(repeat "I'm a little teapot?")

23:53 technomancy: so the whole adding www is probably the right move

23:54 lazybot: Execution Timed Out!

23:54 Raynes: technomancy: I didn't have a choice in the matter, but I read the rationale and it made sense so I was okay with it.

23:54 Besides, it's 4 more characters. We have URL shorteners for a reason.

23:55 technomancy: Also, fwiw, refheap is now running entirely on heroku. All I've got left on my server is a nginx rewrite of refheap.com to www.refheap.com

23:56 technomancy: slick!

23:57 Raynes: Thanks again for all the help with the transition.

23:57 mmarczyk: technomancy: hm, apparently lein2, when running out of a checkout, has test stuff on its regular classpath -- `lein2` (no args) says there's a bluuugh task available, for example

23:57 Raynes: Haha

23:57 technomancy: mmarczyk: heh; yeah I noticed that =)

23:58 Raynes: technomancy: Also, re www: if it's good enough for Google, it's good enough for Raynes.

23:58 mmarczyk: technomancy: oh, ok :-)

23:58 technomancy: if it's not on purpose, I could look into fixing that

23:58 technomancy: it's been low on my priority list, but a fix would be great =)

23:58 since it doesn't affect the releases

23:59 mmarczyk: also I tagged a bunch of the easier issues with the "newbie" tag if you're looking for stuff to do =)

23:59 ibdknox: technomancy: is there a replacement for :extra-classpath-dirs?

23:59 mmarczyk: cool, sometime when I'm not feeling sleep-deprived then :-)

23:59 technomancy: ibdknox: depends; what were you using it for?

Logging service provided by n01se.net