#clojure log - Apr 02 2012

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

0:00 brehaut: heh thats a good description

0:00 technomancy: brehaut: it's hard work to get a bot that's as illogical as talk shows, but rudybot succeeds

0:00 brehaut: technomancy: thats fantastic :)

0:16 autodidakto: To my newbie eyes, list comprehensions seem imperative... Is there an advantage to using them over map + filter, etc besides conciseness?

0:17 trescenzi: Quick question: So I am trying to start using noir and I'm looking off of the noir blog example. The getter functions are defined as, for example the one to get a single post, id->post. Does the -> mean thread in the context of a function name or is it just a way to make clear what the function does?

0:18 Raynes: autodidakto: In what way could they be described as imperative?

0:18 autodidakto: Raynes: "python uses them". shallow, I know

0:18 Raynes: and i've seen them uses as a dotimes kind of thing

0:19 Raynes: Then they are being used wrong.

0:19 technomancy: autodidakto: for is merely an equivalent to filter+map that can be more concise in some cases, yes

0:20 amalloy: more like an equivalent to mapcat

0:20 autodidakto: trescenzi: "->" in a function name is just descriptive text, a common convention. it's like not the php/perl -> (if i remember right..)

0:20 Raynes: When used to iterate over a single sequence, they aren't much different from map. The important thing is that for has :when, :while, and :let and allows for destructuring, making some things more concisely expressed than with map.

0:22 trescenzi: autodidakto: awesome thank you

0:22 autodidakto: the doc example for "for" uses it to construct a lazy seq. Is this a common use case?

0:23 amalloy: it's impossible to not do that, so i guess yes?

0:24 autodidakto: trescenzi: my pleasure. It's nice to be able to contribute to the signal (instead of noise) in this channel every once in a while :)

0:25 ,(doc mapcat)

0:25 clojurebot: "([f & colls]); Returns the result of applying concat to the result of applying map to f and colls. Thus function f should return a collection."

0:27 autodidakto: Raynes, technomancy, amalloy: Thanks for the clearification.

0:33 Lajla: &(print (list (symbol "I worship His") 'Shadow))

0:33 lazybot: ⇒ (I worship His Shadow)nil

0:44 autodidakto: ,(nil? (print "yes, that's "))

0:45 clojurebot: yes, that's

0:45 true

0:58 jblomo: if I specify any :methods in gen-class, must I specify all of them?

1:02 autodidakto: the methods of the superclass/interfaces?

1:03 from the doc -> "The generated class automatically defines all of the non-private methods of its superclasses/interfaces. This parameter can be used to specify the signatures of additional methods of the generated class. ... Do not repeat superclass/interface signatures here.

1:06 jblomo: no, for new methods

1:07 eg. if i have 10 methods, but only specify 1 in :methods, is that OK?

1:17 yoklov: why do you have 10 methods?

1:18 if you specify only one presumably the others wouldn't be considered methods?

1:19 i don't think you're supposed to really use gen-class for new methods

1:19 unless you need it for interop weirdly.

1:19 jblomo: i need to add annotations to the methods

1:19 well, to one method in particular

1:19 i guesss i will try it and find out

1:20 yoklov: oh, okay… i'd try just using one in the list then.

1:31 jorge: is Enlive still an active project? Is that the most popular HTML templating solution on Clojure atm?

1:38 yoklov: theres also hiccup

1:38 jorge: just looking at that now

1:38 yoklov: i haven't ever use enlive but i like hiccup

1:39 jorge: thanks

1:39 yoklov: i've heard that enlive is better if you're dealing with existing html, but if you're generating it hiccup is better,

1:43 replaca: Personally, I prefer to write my html as html, so enlive works nicely for me. But if you like to write html in clojure than hiccup might be your cup of tea

1:47 JulioBarros: Anybody using Stencil, a mustache implementation?

1:47 autodidakto: jorge: Enlive is still active. It just has a documentation/public relations problem

1:49 jorge: and hiccup is more popular. but as yoklov said, they're different philosophies

1:49 Raynes: I prefer Mustache to both solutions.

1:50 And stencil is a really good implementation of it.

1:52 autodidakto: Raynes: Got a good summary why you prefer it?

1:53 Raynes: autodidakto: dsantiago is a performance nut and thus stencil has a lot of optimizations.

1:53 Oh, you mean mustache.

1:54 autodidakto: either/both

1:55 Raynes: When I used Enlive, I ended up with lots of hacks and lots of code to get what I wanted. It's also significantly more complicated than mustache, so I had to spend a bit of time figuring out the function wrapping function soup.

1:55 dsantiago: JulioBarros: I use stencil.

1:55 Raynes: Enlive is great for manipulating HTML. I just don't really like it for templating.

1:56 JulioBarros: dsantiago you wrote it :)

1:56 Raynes: :p

1:56 oakwise: :qa

1:56 dsantiago: Yeah, but that means it counts less? I wrote it because the alternative sucked.

1:56 oakwise: doh

1:58 JulioBarros: Nah, I like it a lot. Wrote to you recently about formatting numbers and was wondering if others used it and/or if there were alternatives that I should check out.

1:59 dsantiago: JulioBarros: I have been thinking lately of just pushing past Mustache's lame/glacial stewardship and implementing the extensions I see fit on my own.

1:59 It seems to be the thing to do in the mustache world. And so there's a trillion different mustaches, all with incompatible extensions.

1:59 But vanilla mustache is a bit too minimal.

2:00 JulioBarros: Interesting. What else would you add? One thing I did not ask you is about adding a css class under certain conditions. Again with my numbers example, I might want to make negative numbers red.

2:01 dsantiago: JulioBarros: Well, regarding what we were talking about, my vision is to have something like Liquid's filters: https://github.com/Shopify/liquid/wiki/Liquid-for-Designers

2:01 As I'd do them, they'd be functions that you can stick in the context map and call them similarly to liquid's syntax, including the chaining.

2:01 So you could write yourself a filter function that checks an input number for negative, and outputs a string containing the formatting you want for it.

2:03 Another thing I've been considering is something along the lines of this discussion: https://github.com/mustache/spec/issues/38

2:03 Sam Pullara and I clearly did not see eye to eye on how to do that.

2:07 JulioBarros: dsantiago I'll have to read that discussion more carefully. I hacked something simple for my use with a render-in-layout function that calls render-file twice.

2:07 once for the 'content' and once for the layout.

2:07 dsantiago: I see. That's probably slow.

2:09 JulioBarros: :) probably but its the only way I could think of to get standard page layouts.

2:09 dsantiago: I hear ya. Like I said, I think mustache is just a bit too minimal.

2:09 Maybe more than a bit.

2:10 It is, however, very nice for letting users make templates that you don't control. It is also nice in that it can be used to generate any output type; seemingly most template processors assume HTML and/or XML output.

2:12 JulioBarros: I think its awesome and like it better than hiccup or enlive for general purpose html generation. Stencil is a great implementation. Just trying to figure the best way to use it or if there is something else I should consider.

2:13 Actually, I've been thinking of mixing in some enlive for A/B (split) testing type stuff ... generate with stencil and then swap out parts with enlive ... I know you'll say its slow :)

2:14 dsantiago: JulioBarros: If you're gonna do that, why not just use Enlive? Better yet, use Tinsel.

2:15 JulioBarros: Because mustache is much more pleasant for most things and something like that would let me control the experiments from a db for the most part.

2:15 Didn't know about Tinsel. Will check it out. Thanks.

2:16 dsantiago: Sure… but how pleasant can it be when it seemingly can't meet your requirements?

2:32 autodidakto: dsantiago: got a link, or can you talk about the different philosophies of templating? I've been trying to wrap my head around the different approaches. ERB/haml-style vs Moustache, etc

2:33 My question is fustratingly vague because I'm struggling to articulate something... like, where the logic goes? or?

2:38 dsantiago: autodidakto: I'm not sure I really know the different philosophies of templating. And I'm also not familiar with ERB, myself.

2:39 People are very into logic/presentation separation these days, but I think people are often very confused about what that means. It's probably a bad idea to have a tempate language so expressive that it can do business logic in the templates.

2:39 But as you saw with Julio's issue, sometimes presentation has a certain amount of logic that it needs.

2:39 I think that type of logic is fine in the template.

2:39 But that's just me.

2:41 jorge: how can I avoid these? WARNING: get already refers to: #'clojure.core/get in namespace: clj-oauth2.client, being replaced by: #'clj-oauth2.client/get

2:46 dsantiago: jorge: I think you should probably be doing (:require [clj-oauth2.client :as oauth]) instead of (:use clj-oauth2.client)

2:46 autodidakto: dsantiago: thanks. it's that I've been running into a lot of different approaches recently about how to handle views. that's why i've been thinking about it

2:47 dsantiago: autodidakto: Sure. I don't think there's any one approach that is good enough for every case.

2:48 I wrote Tinsel to be very fast at rendering the templates. It's just about as fast as string-pasting. But it assumes that it is rendering only a small number of pre-known templates.

2:48 autodidakto: jorge: use puts the added functions in your current namespace, possibly colliding, require lets you give me a qualifier/

2:48 dsantiago: Stencil I wrote because I wanted to be able to generate any type of output, not just HTML.

2:48 autodidakto: *lets you give them

2:49 dsantiago: What else have you output'ed with stencil?

2:49 dsantiago: Both of those basically combine a map of key/values with a template to generate the output.

2:49 autodidakto: Well, for example, Pallet and leiningen use stencil to generate Clojure source code from templates.

2:50 You can generate basically any text-based file format.

2:51 autodidakto: ahh. I see. Cool

2:56 I was talking to ibdknox earlier about hiccup, external html files, etc.... Should the view be a native datastructive? Static HTML manipulated? A view file? with how much logic? In OO programming, there are templating engines that treat the view as a full object that knows how to render itself as html, etc

2:57 *data structure

2:57 *a view file = a template file

2:57 late at night for me :)

2:57 dsantiago: I don't think there's any one right way to do that, necessarily.

2:57 I use Hiccup, and Tinsel is built on hiccup.

2:58 I rarely use vanilla HIccup anymore, because it can be hard to compose the templates.

2:59 If you have a template that recursively calls another template, and so on, then because hiccup's only organizing principle is that templates = functions, you need to design args into your functions to pass all the needed data into the templates called by other templates.

2:59 Tinsel takes as input a skeletal HTML file, and lets you specify the points on that tree that more HTML nodes should be inserted at when the HTML is rendered.

2:59 It's really just another layer on top of Hiccup, that organizes the passing of data into subtemplates when you compose them.

2:59 autodidakto: hmm

3:08 jorge: autodidakto: , thanks

3:13 autodidakto: dsantiago: would it be fair to call tinsel a sort of compromise between hiccup and enlive?

3:14 dsantiago: autodidakto: Sure.

3:26 autodidakto: dsantiago: You have a project to benchmark stencil. He wasn't kidding when he said you cared about the performance of stencil

3:27 dsantiago: That's correct.

3:29 autodidakto: dsantiago: It seems that string processing isn't a common bottle neck. Or am I wrong?

3:29 dsantiago: autodidakto: Not sure what you mean there.

3:31 autodidakto: me neither. I mean, is moustache slow?

3:32 is google performance a passion of yours in general, or is there something about templating that needs the attention?

3:32 dsantiago: The language itself? It depends on how you implement it. You can only make a language so fast, but you can make it as slow as you want.

3:32 autodidakto: is google... lol, is *good

3:33 dsantiago: I don't understand the question. What's a good amount of resources to waste doing something inefficiently?

3:35 autodidakto: Well, there's always a cost-benefit analysis... some people are very careful about squeezing out every ounce of performance. Others, not so much.

3:37 dsantiago: I don't think Stencil does everything it can to be fast. But it does enough for now, I think.

3:37 autodidakto: i see

3:38 dsantiago: Tinsel I see fewer ways to make faster.

3:38 It already compiles down to code that is basically pasting together strings into a StringBuilder.

3:46 wei_: what's the idiomatic clojure way to run 10 threads doing synchronous http requests?

3:46 I'm using (doall (repeat 10 @(future (make-http-calls)))) but not I'm sure if it's doing the calls in parallel

3:56 amalloy: that's not even doing all the calls

4:09 emezeske: wei_: this is hideous, but works: (doall (map deref (doall (map #(future (println %)) (range 0 9)))))

4:15 progo: what about doseq

4:15 hmm, don't remember the correct form.

4:22 wei_: i would use doseq, but I want to keep the output of (make-http-calls), for statistics

4:23 also, my log4j call inside make-http-calls only seem to get called once (instead of 10 times as I expected). is this a characteristic of future?

4:41 @emezeske that seems to work, thanks

4:42 @amalloy what's wrong with my previous implementation?

4:45 nevermind, i see now :)

4:47 Raynes: wei_: Repeat simply repeats its argument several times. The code is only executed once, the result is just duplicated.

4:47 wei_: i see. is that also true with repeatedly?

4:48 Raynes: &(repeatedly 10 #(rand-int 20))

4:48 lazybot: ⇒ (3 12 19 11 17 3 14 13 19 12)

4:48 Raynes: &(repeat 10 (rand-int 20))

4:48 lazybot: ⇒ (16 16 16 16 16 16 16 16 16 16)

4:50 wei_: nice. very concise explanation, thanks

9:09 gtrak`: first arg to assoc is the map

9:29 dribnet: leiningen sadness on mixed clj/java project, soliciting help...

9:30 using gen-class, so i need to compile the clj before the java

9:30 Lajla: dribnet,

9:30 dribnet: ok, so this not lien's forte, and required a custom plugin, which i finally got right

9:31 Lajla: What is your opinion on ##(symbol? (symbol "I worship His Shadow"))

9:31 lazybot: ⇒ true

9:31 dribnet: but now i see that i need to compile some java (interfaces), then the clojure, then the rest of the java

9:33 arrrgghhh. for someone new to clojure, getting these dependencies right within lein is somewhat daunting.

9:34 note that as a workaround I can simply ignore the lein errors and type lein compile again and everything works (on the second pass with classes now in the classpath)

9:34 )

9:35 but I'm trying to be a good boy and package up a jar, and this workaround doesn't work there.

9:35 anyway, if anyone has any tips or suggestions, i'm all appreciative ears.

9:39 lajla,

9:40 my opinion should be 'true', but currently it is 'ClassNotFoundException'

9:44 *sigh* I wish I could solve a 3 file dependency in lein without resorting to a page of plugin code...

9:45 gtrak`: samaaron, http://www.youtube.com/watch?v=415OTzYEXsk

9:46 cmeier: gtrak: Coolness

9:47 gtrak`: haha, thanks :-), it has some 'emergent' behavior right now though

9:47 i bought a book on physics engines to add to my stack

9:48 cmeier: gtrak: code on the github?

9:49 gtrak`: ah, yea: https://github.com/gtrak/quilltest/tree/master/src/quilltest

9:49 cmeier: thanks - watched ;)

9:50 gtrak`: do you remember that old 'arcade volleyball' game from the early 90's? I want to make that

9:50 cmeier: yeah - that would be cool

9:52 gtrak`: quil's easy enough to work with that I can do the mechanics and put off graphics

10:14 jayunit100: any suggestions for more efficient clojure dev. workflow to avoid errors and mistakes ? Right now i use Coda, and a single REPL.

10:15 gtrak`: what's Coda?

10:15 jayunit100: Coda is a text editor. got a nice clojure plugin for highlighting, so im pretty happy so far.

10:16 gtrak`: ah, emacs with autocomplete fills in keywords for me so I don't have spelling errors, that's been helpful

10:17 the slime repl is pretty nice, too

10:20 c0smikdebris: I had to fight swank-clojure a bit to get it working nicely. its kinda intimidating for a newbie

10:25 x89: amalloy_: 4clojure is down

11:33 llasram: Hmmm. I'm trying to do some hacks around gen-class to support more interactive development, but I'm seeing some kind of unsurprising results

11:34 Well, one unsurprising result: invoking the same `gen-class' form more than once produces no results on subsequent runs

11:35 Any ideas?

12:01 Huh, not sure how I managed that one: s,unsurprising,surprising,

12:07 devn: is it possible with lein to specify a git repo which is not a lein project (only contains a pom.xml) as a dependency?

12:09 melipone: help! I am importing classes from a jar that I put into my lib and I am getting an "unsupportedClassVersionError" from the Classloader. It was working fine on another machine and I can't figure out why.

12:10 hiredman: melipone: your classes are generate by a newer version of java than you are trying to run with

12:10 melipone: what is the version of Java for Clojure 1.3?

12:10 hiredman: what is the version of Java for Clojure 1.3?

12:13 llasram: devn: You can probably use the Leiningen 'checkouts' feature

12:22 TimMc: melipone: What version of Java are you running?

12:22 gtrak`: nah, checkouts only works for lein projects

12:22 devn, i think you have to mvn install it

12:24 melipone: TimMc: I'm running java 1.7.0_01. Well, it works well outside of emacs. For some reason, my emacs is not picking up my java path.

12:25 RickInGA: melipone: are you running osx? I have heard that emacs doesn't pick up class path correctly when launched from gui interface on mac

12:28 technomancy: checkout deps currently don't work with maven projects

12:28 llasram: gtrak`: Oh, you're right. Needs to read dependency project.clj to find :source-path/s

12:28 technomancy: you could use lein-nevam on it though

12:29 TimMc: melipone: Maybe you have multiple JVMs installed?

12:32 devn: gtrak`: yeah, but i dont ant to do that

12:35 melipone: TimMc: yes, emacs is picking up the java openjdk and not the Java I've compiled the library with

12:35 llasram: technomancy: Any suggestions on a general approach in lein2 for AOT-compiling with one dependency-set then (uber)jaring with another?

12:35 I'm trying to switch to lein2 for some Hadoop-related projects, where general practice is not to include Hadoop classes in job JARs

12:36 technomancy: llasram: yeah, you could use profiles for that

12:36 probably

12:36 llasram: Profiles seem ready-made for it, if you can e.g. have a plugin programmatically switch profiles for different tasks

12:36 technomancy: lein with-profile one compile, with-profile two uberjar

12:37 llasram: Won't the uberjar task trigger a re-compile with that profile?

12:38 technomancy: not unless the timestamps have changed on the files

12:38 problem is it should

12:38 llasram: Heh

12:39 technomancy: in most cases changing the deps is the kind of thing that should trigger a recompile

12:39 llasram: Right, agreed

12:39 technomancy: so I guess you can do that, but you're taking advantage of a bug

12:41 llasram: Not may favorite plan... Oh, I feel silly now, actually looking at with-profile. I can create a plugin which takes two profile sets, compiles with the first, then applies Hadoop-specific JARing with the second

12:43 technomancy: hadoop sounds like the torture-test of builds

12:43 if you can handle all the crazy shit hadoop throws your way, you're probably in good shape =)

12:45 llasram: So it would seem, although surely there are other JVM frameworks which expect you to depend on the versions of classes provided by the framework at run-time?

12:46 technomancy: if there are, their users have been suspiciously silent

12:46 or they are more tolerant of duplication perhaps

12:46 also uberjars are nearly always used in containerless deployments

12:58 llasram: technomancy: How would you feel about the 'jar' task somehow taking an optional argument which informs it *not* to (re)compile?

12:58 technomancy: llasram: oh... actually you can do this

12:59 (jar (update-in project [:prep-tasks] empty))

12:59 in lein2

13:01 or just dissoc I guess

13:06 ipostelnik: llasram, why are you not using dev-dependencies for hadoop?

13:07 llasram: technomancy: OOC, how does that prevent the jar task from running a compile? I'm trying to follow along on the current lein master and not seeing it

13:07 ipostelnik: lein 1.x dev-dependencies do work exactly that way, but lein 2.x profiles are a new world

13:08 technomancy: llasram: the javac and compile tasks are triggered by the presence of :prep-tasks in the project.clj, which is added by default

13:08 see the prep function in leiningen-core/src/leiningen/core/eval.clj

13:08 ipostelnik: technomancy, does lein2 not support dev-dependecies?

13:08 technomancy: ipostelnik: dev-dependecies in lein2 are just dependencies in the :dev profile

13:09 llasram: technomancy: Oh ok. It looks like leiningen.jar/jar also explicitly and unilaterally calls leiningen.compile/compile

13:09 technomancy: llasram: I see. that should be swapped for a call to prep

13:09 I can make that change

13:09 llasram: Awesome! Thanks much :-)

13:09 ipostelnik: technomancy, how is one supposed to handle equivalent of maven "provided" scope?

13:10 technomancy: ipostelnik: what are the semantics of provided scope?

13:12 ipostelnik: from maven website: This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not

13:12 transitive.

13:13 technomancy: sounds like a perfect fit for the dev profile

13:13 ipostelnik: you want to have it a compile time, but packaging tasks (like uberjar, war, etc...) should skip it

13:13 technomancy: how is that different from being test-scoped?

13:14 ipostelnik: it applies to source as well as test, not just test

13:15 the servlet API is a great example, you need to compile, but you don't want to include it in the war file during packaging

13:16 technomancy: ok, so the problem is that the profiles are stripped away before the jar project triggers compilation

13:17 if you're writing a plugin it's easy to work around that with vary-meta, but I guess you should be able to make it work without writing a custom plugin

13:18 I wonder why this isn't a problem with the servlet API

13:19 maybe tomcat is just more careful about ordering its classpath such that the version it provides always takes precedence

13:20 llasram: I'm fairly sure in the Hadoop case it would still work to bundle up he Hadoop libraries + deps in the job JAR. Would just bloat things quite a bit

13:21 technomancy: ah, ok that makes more sense

13:23 devn: "lein-nevam is mean to be run in project directory that has an existing pom.xml file but has no project.clj."

13:23 "Couldn't find project.clj, which is needed for nevam"

13:24 technomancy: devn: thickey may know more?

13:24 devn: yeah, not sure on this

13:43 hhutch: *sigh* ... writing vanilla javascript and wishing for if-let

13:44 achin_: Hi, everyone. I'm trying to upgrade to lein2. I've put a bunch of plugins into my ~/.lein/profiles.clj, but it doesn't look like they're being merged with my project's profiles. I don't even see the "user" profile when I run "lein profiles." Any idea what I might be doing wrong?

13:47 technomancy: achin_: can you paste ~/.lein/profiles.clj and project.clj?

13:47 llasram: I've got jar using prep now instead of invoking compile directly, so that might get you what you need

13:48 fprefect: ,01

13:48 clojurebot: 1

13:48 fprefect: ,08

13:48 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 08>

13:49 achin_: technomancy: Actually. I feel stupid now. I just saw that I have $LEIN_HOME set to something other than $HOME/.lein. Works now that I moved profiles.clj to $LEIN_HOME.

13:49 technomancy: nice

13:49 llasram: technomancy: That looks perfect. Thank you!

13:49 fprefect: why is 08 an invalid number?

13:49 fdaoud: fprefect: 08 implies octal

13:49 fprefect: oh i see

13:49 fdaoud: ,(+ 07 1)

13:49 clojurebot: 8

13:50 fdaoud: sorry that was pointless

13:50 but you know what I mean :)

13:50 fprefect: yes thanks

13:50 fdaoud: ,0xA

13:50 clojurebot: 10

13:50 technomancy: llasram: good. would be interested in your feedback on https://github.com/technomancy/leiningen/issues/468 if you want to follow along with addressing the problem further

13:50 fdaoud: welcome fprefect

13:54 llasram: Ooh, tricky

13:54 fdaoud: ,(format "%o" (+ 07 1))

13:54 clojurebot: "10"

14:21 achin_: technomancy: Where does lein2 put what used to be in each project's ./lib directory?

14:22 technomancy: achin_: everything is referenced directly out of ~/.m2

14:23 adamspgh: in the more conventional Maven-kind-of-way ...

14:23 technomancy: adamspgh: yes, copying to lib/ was only ever done because there used to be a number of tools (from pre-lein days) that assumed dependencies were in the project dir

14:23 achin_: Hm. Yeah, that's a lot nicer. I used to look in ./lib to see if all my dependencies were resolved correctly. What's the best way of checking that now?

14:24 technomancy: you can just do "lein deps :tree"

14:24 though that's too new to be in the preview2 release

14:24 so you'll have to run from master or wait for preview3

14:25 achin_: Gotcha. That works. Thanks.

14:25 adamspgh: technomancy: ah, I didn't know about "lein deps :tree" Very nice!

14:25 technomancy: thank xeqi

14:25 and cemerick; that's their goodness

14:25 xeqi: theres a lein-deps-tree plugin that was announced on the mailing list today that does something similiar

14:25 can be used in preview2

14:28 fprefect: http://pastebin.com/LQWHcmNt is there a more concise way to parse such grids of integers?

14:31 could i prevent wrapping parseInt by using some built-in clojure function for parsing the integers?

14:36 jkkramer: fprefect: if you're not worried about bad input, you could use read-string

14:37 TimMc: &(read-string "017")

14:37 lazybot: ⇒ 15

14:37 TimMc: Make sure you won't have leading zeroes. :-)

14:37 (I think parseInt is more appropriate.)

14:38 fdaoud: fprefect: doesn't look like there is a built-in clojure function that wraps parseInt.

14:38 fprefect: is there no way to prevent the reader to parse numbers with leading zero as octal?

14:42 fdaoud: fprefect: but you don't get that problem when you use parseInt, right..?

14:43 fprefect: but you don't get that problem when you use parseInt, right..?

14:44 fprefect: right

14:45 Licenser: Hi I have a very odd error in cljs: No protocol method IHash.-hash defined for type array: 1000

14:45 has anyone an idea what the heck is wrong?

14:46 hhutch: Licenser: can you use refheap.com to paste the code?

14:46 fdaoud: fprefect: instead of two map calls, I would do (map parseInt (clojure.string/split (clojure.string/join " " grid-string) #" "))

14:48 Licenser: hhutch: https://refheap.com/paste/1660

14:49 it totally makes no sense o.O

14:53 hhutch: Licenser: the {[100] 1 ...} you mention on line 31 of your paste

14:54 .. is that a JS object, or a clojure hash-map ?

14:54 Licenser: hhutch it is a hash map I try to convert to a json string by converting it into a js object and then printing it

14:57 hhutch crash happens on L14

14:57 hhutch: Licenser: brb, testing

14:58 Licenser: thanks mate :)

14:59 oakwise: Licenser: js objects can't use arrays as keys

14:59 Licenser: ah sneaky

15:01 oakwise you saved my day :D

15:01 TimMc: ew

15:01 oakwise: hehe glad to hear it

15:01 TimMc: I guess that makes some amount of sense, since arrays are mutable...

15:01 oakwise: that bites a lot of people who are used to more general maps in clj/python/ruby/etc. js objects really only work with strings as keys.

15:02 Wild_Cat: Python dicts have a similar restriction -- only immutable/hashable objects may be used as keys

15:02 TimMc: ...and that's why I switched away from Python in one of my projects.

15:03 Wild_Cat: TimMc: out of curiosity, what was the problem?

15:03 TimMc: I wanted sets of dicts or something.

15:03 and Python was like NOPE

15:03 Wild_Cat: yeah, because dicts are mutable and therefore you can't use them in sets.

15:04 how *do* you use a mutable object in any hash-based data structure, though?

15:04 fdaoud: well shoot, I was talking to.. nobody.

15:05 Wild_Cat: I mean, the hash is a function of their content, so mutating the object changes its hash... Unless you have triggers on your container to reshuffle it every time anything inside changes, how do you get them to keep working?

15:09 amalloy: Wild_Cat: don't mutate the keys

15:10 Wild_Cat: amalloy: sure, but what happens if you do anyway?

15:10 amalloy: undefined behavior, probably

15:10 which is to say, anything at all

15:11 Wild_Cat: yay. I think I prefer the Python way, then :p

15:12 amalloy: i'm surprised python has a check like that. isn't basically-everything mutable? surely it's not the case that the only things you can use for hash keys are numbers and strings

15:12 that'd be like php with fewer braces and more spaces

15:12 Wild_Cat: amalloy: numbers, strings, tuples and frozensets.

15:13 oh, functions, methods and classes, too, can be used as keys.

15:13 TimMc: It's a bit silly to not provide hashable versions of such important data structures. I'd rather be able to hash them with the knowledge that I shouldn't mutate them.

15:14 Wild_Cat: TimMc: well, you can build a hashable version of a dict, provided the values are all hashable. tuple(d.iteritems())

15:14 it's ugly, I'll give you that. And you may want to use the sorted() version.

15:15 but yeah, Python was never big on immutability and purity, hence the lack of frozendict.

15:20 are there any JSON or CSV readers/writers in the Clojure stdlib?

15:23 joegallo: https://github.com/clojure/data.csv

15:23 autodidakto: ibdknox: have a favorite way of jumping to a function definition in vim?

15:23 joegallo: and https://github.com/dakrone/cheshire for json

15:23 eggsby: autodidakto: besides marks, my favorites are / and } :p

15:24 joegallo: or, i suppose, https://github.com/clojure/data.json if you want

15:25 hiredman: (note how cheshire has benchmarks comparing it to other encoders but data.json doesn't)

15:25 autodidakto: eggsby: just doesn't seem very robust... looking at someone's code, i would like to jump to the def of a function... / might work, but maybe it's in another file, maybe it's defn with ^{:dynamic or something.

15:26 progo: autodidakto, there's ctags plugin for lein but it didn't work OOB with vim tags support :/

15:26 would be superb to get that working.

15:28 And if you know how is vim's tags support, you'll love it.

15:28 oakwise: last I checked vimclojure had a goto def feature, no?

15:30 progo: hmm, <LocalLeader>gw or gi

15:30 haven't tried that myself

15:31 autodidakto: ahh

15:31 GotoSourceWord (gw)

15:31 or GotoSourceWordInteractive (gi)

15:31 replaca: Just so everybody knows: there is now a complete list of the libraries under the clojure organization at http://clojure.github.com (except for core.logic, which is coming). It's still a work in progress, but I think everything's there at least at library level.

15:32 autodidakto: replaca: Cool. Good documentation is underrated.

15:32 replaca: and it has it has links to the autodoc pages for each project and a full index of all the functions, marcros, protocols and such

15:33 *macros

15:42 autodidakto: oakwise: Can you clearify the documentation for GotoSourceWord? It says that the source must be in a directory of the 'path' option, and that the CLOJURE_SOURCE_DIRS env variable will be added to the 'path' setting

15:43 how do I make it so GotoSourceWord{Interactive} see's everything in my project?

15:44 *looking through the vim :help path doc now..*

15:47 oakwise: autodidakto: sorry, I haven't used vimclojure in a while... I love vim, but I tried emacs for clj and never looked back :P

15:47 autodidakto: how are you launching the nailgun server?

15:47 autodidakto: oakwise: is there a certain feature you fell in love with?

15:48 with lein nailgun (plugin)

15:49 oakwise: autodidakto: mostly the complete lispy integration. Vimclojure is a great effort, but it's one person tacking things on to something that wasn't it wasn't designed for. And the help system in emacs is *really* nice -- instant answers for "what does this key combo do?" "what does this variable do?" "what is this variable?" on and on

15:51 and evil mode (vim emulation for movement/editing) gets you almost all of the good parts of vim (the economy of keystrokes when editing)

15:52 but for now I'm sure there's a way to get your gotosourceword working... I had it at one point

15:54 autodidakto: hmm

15:54 oakwise: hm actually maybe not easily. It might now poke into jars. What do you have for $CLOJURE_SOURCE_DIRS?

15:55 wei_: how do I (use 'clojure.repl) by defaultl in the repl?

15:55 using vimclojure, if that makes a difference

15:55 oakwise: autodidakto: You might need to do `export CLOJURE_SOURCE_DIRS="$HOME/src/clojure/;$HOME/src/clojure.core.logic/;" etc, pointing to the actual source for everything you might want to lookup

15:56 s/;/:/g

15:56 autodidakto: oakwise: I'll add those. But I'm struggling to get it to even work with the clj files in my project dir.

15:57 oakwise: autodidakto: but other nailgun features work?

15:59 autodidakto: oakwise: Yeah. Perfectly. Are you sure GotoSourceWord is a nailgun feature?

15:59 wei_: using the vimclojure/nailgun repl?

15:59 wei_: yep

16:00 replaca: technomancy: you here?

16:01 autodidakto: oakwise: ah yes, it does look like a nailgun thing. nvm

16:03 eggsby: I wonder if dnonel's clojurescript talk he's doing today will be available anywhere

16:03 dnolen*

16:05 technomancy: replaca: yeah, what's up?

16:07 replaca: technomancy: how come swank-clojure doesn't load clojure.repl & pprint?

16:08 technomancy: replaca: you mean into the user ns?

16:08 replaca: technomancy: yeah

16:08 technomancy: I'm not aware of anything in clojure.repl that doesn't have a more useful counterpart already in slime

16:09 autodidakto: wei_: I dont think it gives you a way to easily auto require/use stuff... I'm looking at VimClojure/autoload/vimclojure.vim line 722 right now..

16:09 technomancy: in general I don't bother preloading the user ns because I never use it; with swank I always use C-c M-p to switch namespaces before doing anything

16:09 replaca: perhaps, though the consistency between slime and vanilla repls is nice

16:10 technomancy: I think I tried briefly, but I'd take a patch for it anyway

16:10 replaca: technomancy: mostly I seem to want doc & pprint. Is there a way to autoload these on startup?

16:11 Raynes: technomancy: One of these days I'm going to hack the internet and remove all references to 'SLIME' from all of the servers/computers in the world just to spite you, sir.

16:11 technomancy: replaca: you could try adding an :injections key to project.clj that contains forms that do the use calls you need.

16:12 Raynes: what makes you think I wouldn't want that?

16:13 Raynes: technomancy: The idea is that it would wipe SLIME from your computer and prevent you from obtaining it. Thus you'd have to use lein repl.

16:13 replaca: technomancy: per project & shared :(. same issue as not wanting clojure-wank itself in my project.clj

16:13 Raynes: Bahahaha, clojure-wank.

16:13 technomancy: Raynes: oh, I thought you meant just documentation and stuff

16:13 replaca: you can put it in your user profile

16:14 replaca: technomancy: perfect. where's that go?

16:14 technomancy: {:user {:injections ['(use 'clojure.repl 'clojure.pprint)]}} in ~/.lein/profiles.clj I think

16:14 wei_: autodidakto: hmm, I can't see an easy way either. thanks for looking into it for me though

16:14 technomancy: Raynes: if that happened it would just force me to implement nrepl.el

16:15 Raynes: Oh man, that'd be great.

16:15 technomancy: Raynes: but that would force me to implement a clojure->elisp compiler

16:15 replaca: technomancy: thanks, I'll give that a try. Is that lein 1, lein 2, or both?

16:15 technomancy: Raynes: which would force me to make the Emacs maintainers add immutable strings at gunpoint

16:15 Raynes: Haha

16:15 wei_: technomancy: thanks!

16:15 technomancy: replaca: that's lein2 only, though there may be another way to do it in lein1, try "lein help sample"

16:16 replaca: technomancy: I'm happy enough with lein 2. I'm planning on switching in the next week or so

16:16 technomancy: sweet

16:17 replaca: thanks!

16:17 Raynes: you can go back and watch some more Beavis & Butthead now. :)

16:18 Raynes: replaca: Funfact: never actually seen that show, though I have played the Sega Genesis video game.

16:18 autodidakto: wei_: Np. it seems like you can pass "require"'s to the nailgunclient, but more investigation is necessary to find the right syntax..

16:28 oakwise: any tips for making the switch?

16:30 oakwise: autodidakto: use technomancy's emacs-starter-kit, learn the basic of emacs before turning on evil mode, and then read the whole evil-mode documentation pdf

16:31 autodidakto: oakwise: is there a good source of info about using the clojure/repl tools?

16:31 oakwise: oh, and evil mode colors will help you a *lot* to figure out what the hell mode you are in: https://refheap.com/paste/1664 <-- red = "emacs mode, abort!" :P

16:32 Raynes: autodidakto: FWIW, I switched from Emacs *to* Vim.

16:32 oakwise: https://github.com/technomancy/swank-clojure is a good starting point

16:32 Raynes: If you already use Vim, I don't see any overwhelming reason to learn Emacs unless you just want to. Don't do it *just* for Clojure.

16:34 oakwise: Why not? Learning a new editor isn't going to unlearn vim. I still happily use vim for everything except for elisp and clj.

16:34 autodidakto: Raynes: heh. interesting. I'm in search of the holy grail-optmizied repl+editor driven development... for lack of better terms. And I run into roadblocks with vimclojure

16:35 Raynes: I don't use the REPL stuff VimClojure has.

16:35 But I might in the future. I think VimClojure is dropping nailgun in favor of nrepl, which is fantastic.

16:36 autodidakto: Mostly, just make sure you don't conflate Emacs with Clojure. You can work with Clojure just fine without Emacs, but it does have some niceties.

16:37 It's worth learning anyways because it is a fantastic editor.

16:39 replaca: technomancy: how do I get clojure-jack-in not to just say "Connection closed" after I've done a slime-quit-lisp?

16:41 technomancy: replaca: not aware of a way to do that

16:41 replaca: technomancy: so I have to restart emacs?

16:42 technomancy: replaca: you can just do M-x clojure-jack-in again

16:42 replaca: technomancy: but when I do that it says "connection closed" over and over

16:43 technomancy: huh; never seen that

16:43 same if you kill the *swank* buffer?

16:44 replaca: dunno, I see it pretty often. Just updated everything last week, too

16:44 yup, just tried that

16:44 looks like it's got some state wedged :)

16:44 oakwise: autodidakto: feel free to ping me with questions if you do decide to try the switch. I did it relatively recently so I may be familiar with issues that arise (esp evil mode stuff)

16:45 replaca: technomancy: ahh, the slime-repl seemed to be holding the state. When I kill that, I can get it to work again. Hmm...

16:46 autodidakto: oakwise: cool, thanks

16:46 Raynes: thanks for the tips.

16:47 Raynes: the nrepl/vimclojure info, btw, is at -> https://bitbucket.org/kotarak/vimclojure/issue/82/use-nrepl . Last update a month ago

16:49 Raynes: autodidakto: Yeah. Haven't figured out how to get it running though. No docs yet.

16:59 wei_: how do I run something only once? defonce? I have (set-logger! :level :info) in my top-level namespace and it's getting run every time I evaluate the file

16:59 Raynes: Or just stuff it in a function and only call it when necessary.

17:03 hiredman: wei_: one way is to use a combination of defonce, delay, and force

17:06 wei_: good ideas. i think i'll put it in a function call it from the repl. still have to remember to call it once though

17:31 replaca: How do I get real java ints when I need them? Apache XML-RPC is whining at me about sending it longs.

17:31 unlink: How would I clean up after a seque which has thrown an exception half-way through its evaluation? I am producing a list of files, and if making any one of them fails, I want to remove all the ones that succeeded, and propagage the exception.

17:31 technomancy: replaca: supposedly you call int, but sometimes that doesn't work

17:32 replaca: (class (int 22)) returns java.lang.Long for me

17:32 hiredman: replaca: what version?

17:32 (of clojure)

17:32 ,(class (int 1))

17:32 clojurebot: java.lang.Integer

17:32 replaca: hiredman: 1.3

17:32 hiredman: *clojure-version*

17:32 1.3 is not good

17:32 ,*clojure-version*

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

17:33 technomancy: I was running into this earlier; ant yells at you if you give it Longs too, and calling int doesn't help

17:33 replaca: so should I skip 1.3 and go straight to 1.4?

17:33 hiredman: on 1.3 you may need to manually box the long as an Integer and call .intValue

17:33 replaca: I'm rolling some old 1.2 code forward

17:33 hiredman: replaca: I would recommend it

17:33 replaca: even that was giving me Long!

17:34 I'll give it a try. How bad could it be! (famous last words)

17:34 Do you guys know what the latest beta is?

17:36 hiredman: [mantle/clojure "1.4.0-beta3m1"] is what we are using at work, https://github.com/scgilardi/clojure/commits/mantle

17:36 Raynes: I'm using clojure "1.6.0-from-the-future" at work.

17:36 replaca: hiredman: is mantle a version that includes screened patches?

17:36 hiredman: hopefully clj-942 is fixed before the release

17:37 mantle there just includes the fix for clj-942

17:37 replaca: oh, ok. thanks

17:37 hiredman: but actually that may be in the latest beta

17:38 clj-942 is fixed as of beta4

17:38 beta6 is the latest

17:41 replaca: yeah, I was getting confused looking at JIRA!

17:42 beta6, here I go!

17:43 technomancy: jira, confusing? it can't be.

17:43 hiredman: o/~ livin' on the edge o/~

17:45 replaca: technomancy: sarcasm is not allowed in this channel. (oops, I think we'll both be banned)

17:51 TimMc: &(class (short 4))

17:51 lazybot: ⇒ java.lang.Short

17:51 TimMc: &(class (int 4))

17:51 lazybot: ⇒ java.lang.Long

17:51 TimMc: ...

17:54 replaca: &*clojure-version*

17:54 lazybot: ⇒ {:major 1, :minor 3, :incremental 0, :qualifier nil}

17:55 TimMc: ,[(class (short 4)) (class (int 4))]

17:56 clojurebot: [java.lang.Short java.lang.Integer]

17:57 amalloy: TimMc: what's buggin' you?

17:57 the int/Long thing? switch to 1.4 :P

18:00 TimMc: No, I'm just surprised that shorts and bytes didn't promote as well.

18:24 y3di: what's a good channel for discussing API design?

18:26 mk: I'd bet there isn't one, but pretend you're talking about a clojure api, and this channel might work for you

18:29 y3di: if you find one, let me know where it is

18:56 yoklov: if I want to map over a list with Math/abs am I limited to doing it with #(Math/abs %)?

18:59 mk: yoklov: there's memfn, but I don't think it works with static

18:59 yoklov: nope

18:59 it does not

18:59 ,(map (memfn Math/abs) [1 -2 3 -4])

18:59 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No matching method found: abs for class java.lang.Long>

19:02 mk: yoklov: there's also math from clojure-contrib, I think

19:14 yoklov: lol yeah and clojure.math but its not worth the difference between #(Math/abs %)

19:14 besides i'm doing this for code golf so

19:30 muhoo: hehehe, well, fail.

19:30 the customer who i thought i'd convinced to let me deliver him code in clojure, just gave me the task: write a wrapper for S3 in PHP and Java. FAIL.

19:30 * muhoo makes blowing-head-off-with-shotgun motion

19:32 Frozenlock: muhoo: So what will you do?

19:33 talios: muhoo: did he specify Java "source" or "java" (aka class files)

19:33 a jar is a jar :)

19:37 muhoo: naw, he wants it in java.

19:38 but i'll almost certainly end up writing it in clj then transliterating it to java

19:38 or, i'm considering just pointing him to the already-extant open-source libraries which do what he wants.

19:39 because, money is great, but despair is not.

19:39 gf3: muhoo: yes, I am certain these wheels have already been implemented

19:40 cemerick: muhoo: Depending on how crazy you want to get, you could write Clojure to generate the Java and PHP. :-P

19:40 archaic: if I create a custom type such as (defrecord Complex [re im]), is there a way to have it printed in the REPL as (->Complex 2 3) => 2 + 3i ?

19:40 muhoo: i was seriously considering it

19:40 cemerick: i heard about pharen

19:40 but it has different semantics than clojure, and that bothered me.

19:41 talios: cemerick: were there any april fools clojure stories out in the wild at all?

19:42 cemerick: muhoo: haven't looked at it myself

19:42 muhoo: if there's really no hope for me ever escaping php/java hell, then yes, i could see taking on a quixotic task like writing a dsl to generate code in those languages.

19:42 cemerick: talios: Not that I'm aware of. The scala slagging that had the "stay calm, use Clojure" image at the bottom was the most prevalent 4/1 Clojure mention, I think.

19:43 4/1 being on a Sunday tempered the usual range of craziness, I think.

19:43 muhoo: the problem i have with generated code in general is that it's not very readable

19:44 talios: cemerick: we did an April Fools UO podcast with "news", but we forgot to mention anything about clojure.

19:44 cemerick: sadly, that scala truths post was so close to the truth I'm not sure it was an april fools

19:44 arohner: if I want a defrecord to implement j.u.c.Callable, I have to implement it directly, right? I can't just implement IFn?

19:45 cemerick: talios: Yeah, the only hint was that it was written by a scala enthusiast

19:45 Maybe he's just going to toss the lot.

19:45 it was achingly close to the truth in my experience…

19:46 amalloy: arohner: correct

19:47 i mean, sorta

19:47 talios: 'lo brehaut

19:47 brehaut: hi talios

19:48 amalloy: you don't have to "mention" Callable; the IFn interface extends Callable, so you can just include (call [this]) in the implementation of IFn

19:49 but you can't just implement (invoke [this]) and have Callable magically work

19:49 arohner: freeze_fn.SerializableFn.run()V [Thrown class java.lang.AbstractMethodError]

19:50 amalloy: Runnable

19:50 arohner: right, but I get the same error for both

19:50 freeze_fn.SerializableFn.call()Ljava/lang/Object;

19:51 amalloy: the only reason i can imagine for that is that you didn't take my advice and include an implementation for (call [this])

19:52 arohner: https://gist.github.com/ed2a1de1af8dc047c5f6

19:54 talios: brehaut: you should come up for our clojure hackday - http://www.meetup.com/codelounge/events/57876162/

19:54 brehaut: talios: oh interesting. i should

19:54 cemerick: talios: Richard is going to learn Clojure?!?

19:54 amalloy: that looks like it should work, although you'll need to implement applyTo at some point

19:55 talios: cemerick: he wants to try something with clojure/webnoir and see what the fuss is about.

19:55 arohner: amalloy: interesting. it *should* work, yet it doesn't :-)

19:55 cemerick: heh, cool

19:55 talios: what's your plan for oauth support?

19:55 talios: cemerick: I think however he's an alien imposter, I mean - he's learning vim as well.

19:55 amalloy: works fine for me, arohner

19:56 cemerick: talios: Well, I'm in Counterclockwise and vim all day, so… :-)

19:56 talios: cemerick: mm, oauth - good question. but then I've also not looked at that in straight java let alone clojure :)

19:57 amalloy: i pulled out your resolve-var-str because it's not related to the defrecord issue: https://gist.github.com/b4774f8b8ed83657d3e0

19:57 cemerick: talios: https://github.com/mattrepl/clj-oauth is the freshest lib I know of, though it's sort of kit more than anything else AFAICT

19:57 brehaut: talios: maven‽ for shame ;)

19:57 arohner: amalloy: oh, I bet I have some AOT / .classfile issue

19:58 technomancy: IIRC https://github.com/DerGuteMoritz/clj-oauth2 is more up to date

19:58 arohner: this stuff has to be AOT'd to work with a java lib

19:58 talios: brehaut: i think he's humouring me :) it's also familar. tho I'd probably push lein as a starting point, maven for larger projects integrating with other projects

19:58 technomancy: it has 2 in the URL; it must be newer!

19:58 talios: cemerick: cheers, will check it out.

19:58 cemerick: talios: I'm working the kinks out of a Clojure analogue to anyauth/warden/spring-security that clj-oauth should be able to drop into nicely; hopefully it's ready by the time the lounge rolls around

19:59 talios: cemerick: you should fly down :)

19:59 and pick up technomancy on the way

19:59 :)

19:59 cemerick: talios: :-) I think I may be exactly on the other side of the earth from NZ

19:59 technomancy: "more up to date" in what vector?

20:00 I'm still in the blissful "I don't care about oauth" stage.

20:00 It looks like a moose-sized yak.

20:01 technomancy: cemerick: more up to date as in "there was a talk on it at clojurewest"

20:01 arohner: amalloy: yes, I had AOT issues. thanks for the help

20:02 cemerick: technomancy: oh, which one?

20:02 technomancy: it's an "emerging standard", but clj-oauth2 apparently works with the biggest providers of oauth2; dunno if you need oauth1

20:02 http://clojurewest.org/sessions#patterson

20:02 cemerick: ah "Accessing Real-World APIs from Clojure

20:02 "

20:03 Should have had oauth in the title, I may have gone. :-)

20:03 muhoo: oauth is annoying but not necessarily complicated

20:03 it's just the back-and-forth and token exchange which is irritating

20:04 cemerick: muhoo: It sure *looks* complicated.

20:04 Every provider seems to have its own set of "stuff" you have to do/provide/register for/etc.

20:04 Sorta like oauth is a meta-authentication mechanism.

20:06 muhoo: i implemented oauth crap for php not long ago, for accessing mailchimp

20:06 hiredman: ugh

20:06 muhoo: look, i suck, and this is what i have to do for money. :-/

20:06 brehaut: that sounds like death

20:07 muhoo: i appreciate your sympathy.

20:07 but wait, do you guys actually get paid to do stuff that DOESN'T suck? really? is that even possible?

20:08 it's been my experience that the suck and pay are strongly positively correlated

20:09 brehaut: in my case, it depends what you think of python/django ;)

20:11 muhoo: i enjoyed python. it was my go-to language until i found clojure

20:11 arohner: muhoo: I like my job. Though I am the founder, and I'm not really making money yet :-0

20:16 cemerick: muhoo: Suck is mostly opt-in AFAICT.

20:38 wei_: (take 5 (repeat [1 2])) => ([1 2] [1 2] [1 2] [1 2] [1 2]) but I want (1 2 1 2 1). how to get that?

20:38 brehaut: ,(apropos cycle)

20:39 clojurebot: ()

20:39 aperiodic: ,(take 5 (cycle [1 2]))

20:39 clojurebot: (1 2 1 2 1)

20:40 muhoo: cemerick: i guess that's a positive way to look at it.

20:40 nsxt: muhoo: i've also found that correlation as well... :(

20:42 i'd kill for a high paying job wherein i'm not validating user input and instructing other people about the benefits of bound parameters.

20:45 wei_: apropos? interesting

20:45 cycle. awesome

20:46 llasram: cemerick: +1

20:46 If you aren't in a position to make it not suck, there's plenty of other places to go

20:47 wei_: arohner: good luck with your venture! I wrote some clojure for my own startup a while ago

20:48 technomancy: arohner: how do you handle gem dependencies with clojure projects?

21:11 arohner: technomancy: at the time, I had a Gemfile and a project.clj

21:12 technomancy: but there's no ruby code anymore, so no more Gemfile

21:13 AFAIK, there are solutions for packaging jars as gems, but no solution for packaging gems as jars

22:17 muhoo: if i were writing clojure to be called from java, is this still the most current description of how to do it? http://blog.objectmentor.com/articles/2009/08/07/java-calling-clojure

22:33 auugh, what's weird about the java interop is that the -'s run backwards

22:33 in regular clojure, -private seems to be the norm. in making a class to be called from java, -public appears to be the norm

22:39 cemerick: man, any more betas and ibdknox's korma 0.3.0 is going to be the duke nukem of Clojure libraries. ;-)

22:40 talios: pull of porn and a terrible game play experience?

22:40 full of even

22:40 cemerick: talios prompts the strangest mental images…

22:41 talios: :)

22:44 cemerick: talios: so, when are you going to port your maven builds over to leiningen 2? ;-)

22:45 talios: at the rate this projects going we'll be going cake, and by cake I mean javascript. I'm crying here.

22:46 cemerick: the node bandwagon carries on?

22:46 talios: web guys are annoyed ( rightly so ) my coffee-maven-plugin is slow ( rhino ) so now we're going to shell out to node.js, phantomjs, cake, and something else from inside maven :)

22:46 brehaut: talios: you need to get wombleton and his ilk on a tighter leash

22:47 cemerick: oh, well, if you're munging coffescript, *shrug*

22:47 talios: they didn't like the idea of clojurescript

22:49 cemerick: talios: which part(s)?

22:50 I can imagine dedicated web folk being mostly worried about having another runtime underneath.

22:51 muhoo: how can i force lein to aot compile an ns?

22:51 talios: cemerick: the clojure parts

22:52 cemerick: ha

22:52 talios: a bit on the nose, eh?

22:52 talios: it's been sooooo long since I've done any clojure

22:52 cemerick: muhoo: add `:aot [your.ns.name]` to project.clj

22:53 talios: I keep having love/hate affairs with s-expressions

22:53 muhoo: ah got it :aot [org.example.sample]

22:53 https://github.com/technomancy/leiningen/blob/preview/sample.project.clj

22:53 * muhoo bookmarks

22:53 cemerick: talios: I'm more on the 90/10 end of things, but yeah.

22:53 muhoo: if this works, i'm going to do a dance of celebration

22:58 brehaut: talios, cemerick: im mostly fine with s-exps, its dynamic types that i have a love hate relationship with

23:02 cemerick: brehaut: keep rooting on Ambrose, dnolen, et al. on then. Seems like they'll end up producing something spectacular.

23:03 brehaut: cemerick: i really hope so

23:04 cemerick: im particularly hopeful that typed-clojure will be useful for macros (e.g. fmap, monad and friends using types rather than dynamic vars)

23:05 muhoo: are you talking about this? https://github.com/downloads/frenchy64/papers/research-proposal-final-draft.pdf

23:05 brehaut: yes

23:05 the project repo should be there too

23:06 http://github.com/frenchy64/typed-clojure/

23:06 muhoo: dnolen is working on that?

23:06 brehaut: indirectly i think?

23:07 its built on core.logic i think?

23:07 muhoo: impressiveo

23:08 brehaut: ~rimshot

23:08 clojurebot: Badum, *tish*

23:09 muhoo: well i've aot'ed a class that has a java interface. now... to try importing it as java

23:10 gawd lein is great.

23:11 if i'm able to actually write something in clj, and deliver a jar that can be called from java, wrapped in a junit test, i'll cry tears of joy.

23:12 brehaut: i dunno about the junut tests, but the former should definately work

23:13 cemerick: muhoo: You can produce junit tests from Clojure without a problem. Old-style `testFoo` style, as well as using annotations.

23:13 There's actually an example of this in the book.

23:13 brehaut: cemerick: oh, which book is that?

23:14 cemerick: brehaut: dunno, something about Clojure. :-P

23:15 brehaut: :P

23:15 cemerick: should actually start shipping from amazon this week

23:15 or, that's the rumor

23:15 muhoo: don't mind brehaut and I, BTW: http://clojurebook.com

23:17 brehaut: cemerick: thats great :) i might actually be able to afford the postage from amazon

23:17 cemerick: brehaut: I have no info on amazon.co.nz :-/

23:17 brehaut: heh

23:17 no such thing exists

23:18 but amazon.com and .co.uk have sane shipping

23:18 cemerick: oh, lookit that, it redirects to .co.uk

23:18 brehaut: o'r was going to charge me more than the book itself

23:18 cemerick: yeah, I can imagine

23:20 brehaut: just how irritating is it that you get shuffled along to a .co.uk for something like amazon?

23:20 muhoo: cemerick: congratulations on the book. yes, i'll buy it.

23:20 brehaut: actually not too bad; amazon.co.uk does free shipping for us with a big enough order

23:21 muhoo: though i still haven't finished fogus's book, and i feel guilty about my eyes being bigger than my stomach.

23:21 brehaut: (25£ worth from memory)

23:21 cemerick: muhoo: No worries; but, thanks in advance if you do end up buying it. :-)

23:21 muhoo: oh i'll buy it just to give you some $

23:22 and then i'll feel guilty about starting a new one before finishing the other one first :-)

23:22 brehaut: cemerick: and unlike in the US, kiwis don't assume there is a dot cones for any website we want to visit; we are used to the lag

23:22 cemerick: brehaut: Yeah. It'd be quite unsettling to have to go to e.g. amazon.ca or something. Wouldn't feel right.

23:22 "You are not catering to me enough." :-P

23:22 brehaut: hehe :P

23:23 muhoo: cemerick: is there a downloadable pdf?

23:23 brehaut: on the other hand, we have trademe which is how we spell ebay, and its not horrific

23:23 muhoo: or is that not how o'reilly rolls?

23:23 brehaut: muhoo: yes, from the publisher

23:24 talios: we used to have ebay.co.nz - but trademe already had the market

23:24 cemerick: muhoo: If you order from o'reilly, you'll get a DRM-free copy of the book in PDF, ePub, Kindle-compatible .mobi, DAISY, and Android .apk formats, as well as a hardcopy if you choose to preorder that as well.

23:24 talios: brehaut: ferrit!

23:24 brehaut: baha

23:24 talios: is that still a thing?

23:25 talios: I don't think so. Fishpond are good for books here

23:25 brehaut: as are mightyape

23:26 although i wish it was easier to get small press books down here

23:30 muhoo: cemerick: ok, well you and brian and cristophe are now US$35 richer (or some fraction thereof), and i'm off to find the unit test example you mentioned. thanks.

23:31 p 385, disco.

23:32 cemerick: muhoo: code here, BTW: https://github.com/clojurebook/ClojureProgramming/blob/master/ch09-annotations/src/main/clojure/com/clojurebook/annotations/junit.clj

23:32 I guess I should've pasted that earlier…but, the text is helpful to see as well

23:33 muhoo: ah cool, well github doesn't result in money, so it's just as well

23:33 brehaut: wait wait, you can make money from publishing a book‽

23:34 cemerick: brehaut: no, not really

23:34 or, wait, yes, you can make money *publishing* a book, just not *writing* one.

23:34 muhoo: that's a very important distinction

23:34 brehaut: aha

23:35 cemerick: I shouldn't be so harsh, but that's my expectation.

23:35 I'm planning on letting it run a year before doing a proper retrospective.

23:36 brehaut: that'd be interesting to see

23:39 seancorfield: realized i've been off channel for several days... missing y'all! :)

23:40 Raynes: seancorfield: Man. Don't do that. We were calling the police, hospitals, cat shows. Has been a hard couple of days for the channel.

23:46 cemerick: seancorfield: if you're not on irc, you're just not livin', amirite? :-P

23:47 brehaut: as a freelancer, IRC and IM is the only human contact i get for most of the day; i think id go loopy without it

23:47 muhoo: holy crap, it worked. kinky and weird, i aot compiled it with omit-source, then did lein local-repo to add it, then pulled it into a running repl with pomegranate. and it worked.

23:48 imported it as a java class. so now onto the unit tests.

23:48 brehaut: muhoo: congrats :)

23:48 muhoo: thanks!

23:49 brehaut: so you freelance as well? good to know.

23:49 cemerick: muhoo: Just make sure to mind what you're getting on the other side for a Java signature. What's acceptable and whether or not you'll want to have a specific public interface depends a lot on the expectations of your Java consumers.

23:50 muhoo: i'll have to be pretty strict about the interface, yes.

23:50 and i'll have to do some careful exception checking so they don't get that massive spew we so love to see in clojure

23:50 cemerick: brehaut: same here

23:51 muhoo: btw, is longbottom out yet?

23:51 cemerick: muhoo: clojure.reflect and javap are your friends in that area

23:51 The last tweet I saw about it from chouser is that it may be getting integrated into clj-stacktrace?

23:52 y3di: where do you guys go to get new info on clojure/related topics? (besides disclojure)

23:53 talios: prismatic, cemerick's podcast, here, twitter, me :)

23:53 muhoo: y3di: https://refheap.com/paste/1672 ?

23:53 brehaut: http://planet.clojure.in/

23:53 talios: what is prismatic; ive seen it a bunch in your toots recently

23:55 muhoo: isn't prismatic that thing the guy at cljwest was presenting on?

23:55 talios: http://getprismatic.com/ - bradford cross's startup, clojure based

23:55 brehaut: oh right. cool

23:55 talios: brehaut: PM me an email addy and I'll send you an invite

23:57 cemerick: talios: what do you think of the 'cast overall, BTW? I'm trying to figure out what to do with it next.

23:58 talios: cemerick: other than making me also spit coffee all over the car with you talking about my beard, I'm enjoying it :)

23:58 cemerick: heh

23:59 that was purely a word association thing ;-)

23:59 beards, metal, "that hat", etc

23:59 talios: would be interesting to hear from someone doing mixed lang projects with clojure.

Logging service provided by n01se.net