#clojure logs

2012-04-02

00:00brehautheh thats a good description
00:00technomancybrehaut: it's hard work to get a bot that's as illogical as talk shows, but rudybot succeeds
00:00brehauttechnomancy: thats fantastic :)
00:16autodidaktoTo my newbie eyes, list comprehensions seem imperative... Is there an advantage to using them over map + filter, etc besides conciseness?
00:17trescenziQuick 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?
00:18Raynesautodidakto: In what way could they be described as imperative?
00:18autodidaktoRaynes: "python uses them". shallow, I know
00:18autodidaktoRaynes: and i've seen them uses as a dotimes kind of thing
00:19RaynesThen they are being used wrong.
00:19technomancyautodidakto: for is merely an equivalent to filter+map that can be more concise in some cases, yes
00:20amalloymore like an equivalent to mapcat
00:20autodidaktotrescenzi: "->" in a function name is just descriptive text, a common convention. it's like not the php/perl -> (if i remember right..)
00:20RaynesWhen 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.
00:22trescenziautodidakto: awesome thank you
00:22autodidaktothe doc example for "for" uses it to construct a lazy seq. Is this a common use case?
00:23amalloyit's impossible to not do that, so i guess yes?
00:24autodidaktotrescenzi: my pleasure. It's nice to be able to contribute to the signal (instead of noise) in this channel every once in a while :)
00:25autodidakto,(doc mapcat)
00:25clojurebot"([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."
00:27autodidaktoRaynes, technomancy, amalloy: Thanks for the clearification.
00:33Lajla&(print (list (symbol "I worship His") 'Shadow))
00:33lazybot⇒ (I worship His Shadow)nil
00:44autodidakto,(nil? (print "yes, that's "))
00:45clojurebotyes, that's
00:45clojurebottrue
00:58jblomoif I specify any :methods in gen-class, must I specify all of them?
01:02autodidaktothe methods of the superclass/interfaces?
01:03autodidaktofrom 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.
01:06jblomono, for new methods
01:07jblomoeg. if i have 10 methods, but only specify 1 in :methods, is that OK?
01:17yoklovwhy do you have 10 methods?
01:18yoklovif you specify only one presumably the others wouldn't be considered methods?
01:19yoklovi don't think you're supposed to really use gen-class for new methods
01:19yoklovunless you need it for interop weirdly.
01:19jblomoi need to add annotations to the methods
01:19jblomowell, to one method in particular
01:19jblomoi guesss i will try it and find out
01:20yoklovoh, okay… i'd try just using one in the list then.
01:31jorgeis Enlive still an active project? Is that the most popular HTML templating solution on Clojure atm?
01:38yoklovtheres also hiccup
01:38jorgejust looking at that now
01:38yoklovi haven't ever use enlive but i like hiccup
01:39jorgethanks
01:39yoklovi've heard that enlive is better if you're dealing with existing html, but if you're generating it hiccup is better,
01:43replacaPersonally, 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
01:47JulioBarrosAnybody using Stencil, a mustache implementation?
01:47autodidaktojorge: Enlive is still active. It just has a documentation/public relations problem
01:49autodidaktojorge: and hiccup is more popular. but as yoklov said, they're different philosophies
01:49RaynesI prefer Mustache to both solutions.
01:50RaynesAnd stencil is a really good implementation of it.
01:52autodidaktoRaynes: Got a good summary why you prefer it?
01:53Raynesautodidakto: dsantiago is a performance nut and thus stencil has a lot of optimizations.
01:53RaynesOh, you mean mustache.
01:54autodidaktoeither/both
01:55RaynesWhen 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.
01:55dsantiagoJulioBarros: I use stencil.
01:55RaynesEnlive is great for manipulating HTML. I just don't really like it for templating.
01:56JulioBarrosdsantiago you wrote it :)
01:56Raynes:p
01:56oakwise:qa
01:56dsantiagoYeah, but that means it counts less? I wrote it because the alternative sucked.
01:56oakwisedoh
01:58JulioBarrosNah, 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.
01:59dsantiagoJulioBarros: I have been thinking lately of just pushing past Mustache's lame/glacial stewardship and implementing the extensions I see fit on my own.
01:59dsantiagoIt seems to be the thing to do in the mustache world. And so there's a trillion different mustaches, all with incompatible extensions.
01:59dsantiagoBut vanilla mustache is a bit too minimal.
02:00JulioBarrosInteresting. 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.
02:01dsantiagoJulioBarros: 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
02:01dsantiagoAs 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.
02:01dsantiagoSo 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.
02:03dsantiagoAnother thing I've been considering is something along the lines of this discussion: https://github.com/mustache/spec/issues/38
02:03dsantiagoSam Pullara and I clearly did not see eye to eye on how to do that.
02:07JulioBarrosdsantiago 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.
02:07JulioBarrosonce for the 'content' and once for the layout.
02:07dsantiagoI see. That's probably slow.
02:09JulioBarros:) probably but its the only way I could think of to get standard page layouts.
02:09dsantiagoI hear ya. Like I said, I think mustache is just a bit too minimal.
02:09dsantiagoMaybe more than a bit.
02:10dsantiagoIt 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.
02:12JulioBarrosI 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.
02:13JulioBarrosActually, 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 :)
02:14dsantiagoJulioBarros: If you're gonna do that, why not just use Enlive? Better yet, use Tinsel.
02:15JulioBarrosBecause 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.
02:15JulioBarrosDidn't know about Tinsel. Will check it out. Thanks.
02:16dsantiagoSure… but how pleasant can it be when it seemingly can't meet your requirements?
02:32autodidaktodsantiago: 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
02:33autodidaktoMy question is fustratingly vague because I'm struggling to articulate something... like, where the logic goes? or?
02:38dsantiagoautodidakto: I'm not sure I really know the different philosophies of templating. And I'm also not familiar with ERB, myself.
02:39dsantiagoPeople 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.
02:39dsantiagoBut as you saw with Julio's issue, sometimes presentation has a certain amount of logic that it needs.
02:39dsantiagoI think that type of logic is fine in the template.
02:39dsantiagoBut that's just me.
02:41jorgehow can I avoid these? WARNING: get already refers to: #'clojure.core/get in namespace: clj-oauth2.client, being replaced by: #'clj-oauth2.client/get
02:46dsantiagojorge: I think you should probably be doing (:require [clj-oauth2.client :as oauth]) instead of (:use clj-oauth2.client)
02:46autodidaktodsantiago: 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
02:47dsantiagoautodidakto: Sure. I don't think there's any one approach that is good enough for every case.
02:48dsantiagoI 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.
02:48autodidaktojorge: use puts the added functions in your current namespace, possibly colliding, require lets you give me a qualifier/
02:48dsantiagoStencil I wrote because I wanted to be able to generate any type of output, not just HTML.
02:48autodidakto*lets you give them
02:49autodidaktodsantiago: What else have you output'ed with stencil?
02:49dsantiagoBoth of those basically combine a map of key/values with a template to generate the output.
02:49dsantiagoautodidakto: Well, for example, Pallet and leiningen use stencil to generate Clojure source code from templates.
02:50dsantiagoYou can generate basically any text-based file format.
02:51autodidaktoahh. I see. Cool
02:56autodidaktoI 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
02:57autodidakto*data structure
02:57autodidakto*a view file = a template file
02:57autodidaktolate at night for me :)
02:57dsantiagoI don't think there's any one right way to do that, necessarily.
02:57dsantiagoI use Hiccup, and Tinsel is built on hiccup.
02:58dsantiagoI rarely use vanilla HIccup anymore, because it can be hard to compose the templates.
02:59dsantiagoIf 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.
02:59dsantiagoTinsel 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.
02:59dsantiagoIt's really just another layer on top of Hiccup, that organizes the passing of data into subtemplates when you compose them.
02:59autodidaktohmm
03:08jorgeautodidakto: , thanks
03:13autodidaktodsantiago: would it be fair to call tinsel a sort of compromise between hiccup and enlive?
03:14dsantiagoautodidakto: Sure.
03:26autodidaktodsantiago: You have a project to benchmark stencil. He wasn't kidding when he said you cared about the performance of stencil
03:27dsantiagoThat's correct.
03:29autodidaktodsantiago: It seems that string processing isn't a common bottle neck. Or am I wrong?
03:29dsantiagoautodidakto: Not sure what you mean there.
03:31autodidaktome neither. I mean, is moustache slow?
03:32autodidaktois google performance a passion of yours in general, or is there something about templating that needs the attention?
03:32dsantiagoThe 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.
03:32autodidaktois google... lol, is *good
03:33dsantiagoI don't understand the question. What's a good amount of resources to waste doing something inefficiently?
03:35autodidaktoWell, there's always a cost-benefit analysis... some people are very careful about squeezing out every ounce of performance. Others, not so much.
03:37dsantiagoI don't think Stencil does everything it can to be fast. But it does enough for now, I think.
03:37autodidaktoi see
03:38dsantiagoTinsel I see fewer ways to make faster.
03:38dsantiagoIt already compiles down to code that is basically pasting together strings into a StringBuilder.
03:46wei_what's the idiomatic clojure way to run 10 threads doing synchronous http requests?
03:46wei_I'm using (doall (repeat 10 @(future (make-http-calls)))) but not I'm sure if it's doing the calls in parallel
03:56amalloythat's not even doing all the calls
04:09emezeskewei_: this is hideous, but works: (doall (map deref (doall (map #(future (println %)) (range 0 9)))))
04:15progowhat about doseq
04:15progohmm, don't remember the correct form.
04:22wei_i would use doseq, but I want to keep the output of (make-http-calls), for statistics
04:23wei_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?
04:41wei_@emezeske that seems to work, thanks
04:42wei_@amalloy what's wrong with my previous implementation?
04:45wei_nevermind, i see now :)
04:47Rayneswei_: Repeat simply repeats its argument several times. The code is only executed once, the result is just duplicated.
04:47wei_i see. is that also true with repeatedly?
04:48Raynes&(repeatedly 10 #(rand-int 20))
04:48lazybot⇒ (3 12 19 11 17 3 14 13 19 12)
04:48Raynes&(repeat 10 (rand-int 20))
04:48lazybot⇒ (16 16 16 16 16 16 16 16 16 16)
04:50wei_nice. very concise explanation, thanks
09:09gtrak`first arg to assoc is the map
09:29dribnetleiningen sadness on mixed clj/java project, soliciting help...
09:30dribnetusing gen-class, so i need to compile the clj before the java
09:30Lajladribnet,
09:30dribnetok, so this not lien's forte, and required a custom plugin, which i finally got right
09:31LajlaWhat is your opinion on ##(symbol? (symbol "I worship His Shadow"))
09:31lazybot⇒ true
09:31dribnetbut now i see that i need to compile some java (interfaces), then the clojure, then the rest of the java
09:33dribnetarrrgghhh. for someone new to clojure, getting these dependencies right within lein is somewhat daunting.
09:34dribnetnote 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)
09:34dribnet)
09:35dribnetbut I'm trying to be a good boy and package up a jar, and this workaround doesn't work there.
09:35dribnetanyway, if anyone has any tips or suggestions, i'm all appreciative ears.
09:39dribnetlajla,
09:40dribnetmy opinion should be 'true', but currently it is 'ClassNotFoundException'
09:44dribnet*sigh* I wish I could solve a 3 file dependency in lein without resorting to a page of plugin code...
09:45gtrak`samaaron, http://www.youtube.com/watch?v=415OTzYEXsk
09:46cmeiergtrak: Coolness
09:47gtrak`haha, thanks :-), it has some 'emergent' behavior right now though
09:47gtrak`i bought a book on physics engines to add to my stack
09:48cmeiergtrak: code on the github?
09:49gtrak`ah, yea: https://github.com/gtrak/quilltest/tree/master/src/quilltest
09:49cmeierthanks - watched ;)
09:50gtrak`do you remember that old 'arcade volleyball' game from the early 90's? I want to make that
09:50cmeieryeah - that would be cool
09:52gtrak`quil's easy enough to work with that I can do the mechanics and put off graphics
10:14jayunit100any suggestions for more efficient clojure dev. workflow to avoid errors and mistakes ? Right now i use Coda, and a single REPL.
10:15gtrak`what's Coda?
10:15jayunit100Coda is a text editor. got a nice clojure plugin for highlighting, so im pretty happy so far.
10:16gtrak`ah, emacs with autocomplete fills in keywords for me so I don't have spelling errors, that's been helpful
10:17gtrak`the slime repl is pretty nice, too
10:20c0smikdebrisI had to fight swank-clojure a bit to get it working nicely. its kinda intimidating for a newbie
10:25x89amalloy_: 4clojure is down
11:33llasramHmmm. 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:34llasramWell, one unsurprising result: invoking the same `gen-class' form more than once produces no results on subsequent runs
11:35llasramAny ideas?
12:01llasramHuh, not sure how I managed that one: s,unsurprising,surprising,
12:07devnis it possible with lein to specify a git repo which is not a lein project (only contains a pom.xml) as a dependency?
12:09meliponehelp! 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:10hiredmanmelipone: your classes are generate by a newer version of java than you are trying to run with
12:10meliponewhat is the version of Java for Clojure 1.3?
12:10meliponehiredman: what is the version of Java for Clojure 1.3?
12:13llasramdevn: You can probably use the Leiningen 'checkouts' feature
12:22TimMcmelipone: What version of Java are you running?
12:22gtrak`nah, checkouts only works for lein projects
12:22gtrak`devn, i think you have to mvn install it
12:24meliponeTimMc: 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:25RickInGAmelipone: are you running osx? I have heard that emacs doesn't pick up class path correctly when launched from gui interface on mac
12:28technomancycheckout deps currently don't work with maven projects
12:28llasramgtrak`: Oh, you're right. Needs to read dependency project.clj to find :source-path/s
12:28technomancyyou could use lein-nevam on it though
12:29TimMcmelipone: Maybe you have multiple JVMs installed?
12:32devngtrak`: yeah, but i dont ant to do that
12:35meliponeTimMc: yes, emacs is picking up the java openjdk and not the Java I've compiled the library with
12:35llasramtechnomancy: Any suggestions on a general approach in lein2 for AOT-compiling with one dependency-set then (uber)jaring with another?
12:35llasramI'm trying to switch to lein2 for some Hadoop-related projects, where general practice is not to include Hadoop classes in job JARs
12:36technomancyllasram: yeah, you could use profiles for that
12:36technomancyprobably
12:36llasramProfiles seem ready-made for it, if you can e.g. have a plugin programmatically switch profiles for different tasks
12:36technomancylein with-profile one compile, with-profile two uberjar
12:37llasramWon't the uberjar task trigger a re-compile with that profile?
12:38technomancynot unless the timestamps have changed on the files
12:38technomancyproblem is it should
12:38llasramHeh
12:39technomancyin most cases changing the deps is the kind of thing that should trigger a recompile
12:39llasramRight, agreed
12:39technomancyso I guess you can do that, but you're taking advantage of a bug
12:41llasramNot 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:43technomancyhadoop sounds like the torture-test of builds
12:43technomancyif you can handle all the crazy shit hadoop throws your way, you're probably in good shape =)
12:45llasramSo 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:46technomancyif there are, their users have been suspiciously silent
12:46technomancyor they are more tolerant of duplication perhaps
12:46technomancyalso uberjars are nearly always used in containerless deployments
12:58llasramtechnomancy: How would you feel about the 'jar' task somehow taking an optional argument which informs it *not* to (re)compile?
12:58technomancyllasram: oh... actually you can do this
12:59technomancy(jar (update-in project [:prep-tasks] empty))
12:59technomancyin lein2
13:01technomancyor just dissoc I guess
13:06ipostelnikllasram, why are you not using dev-dependencies for hadoop?
13:07llasramtechnomancy: 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:07llasramipostelnik: lein 1.x dev-dependencies do work exactly that way, but lein 2.x profiles are a new world
13:08technomancyllasram: the javac and compile tasks are triggered by the presence of :prep-tasks in the project.clj, which is added by default
13:08technomancysee the prep function in leiningen-core/src/leiningen/core/eval.clj
13:08ipostelniktechnomancy, does lein2 not support dev-dependecies?
13:08technomancyipostelnik: dev-dependecies in lein2 are just dependencies in the :dev profile
13:09llasramtechnomancy: Oh ok. It looks like leiningen.jar/jar also explicitly and unilaterally calls leiningen.compile/compile
13:09technomancyllasram: I see. that should be swapped for a call to prep
13:09technomancyI can make that change
13:09llasramAwesome! Thanks much :-)
13:09ipostelniktechnomancy, how is one supposed to handle equivalent of maven "provided" scope?
13:10technomancyipostelnik: what are the semantics of provided scope?
13:12ipostelnikfrom 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:12ipostelnik transitive.
13:13technomancysounds like a perfect fit for the dev profile
13:13ipostelnikyou want to have it a compile time, but packaging tasks (like uberjar, war, etc...) should skip it
13:13technomancyhow is that different from being test-scoped?
13:14ipostelnikit applies to source as well as test, not just test
13:15ipostelnikthe 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:16technomancyok, so the problem is that the profiles are stripped away before the jar project triggers compilation
13:17technomancyif 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:18technomancyI wonder why this isn't a problem with the servlet API
13:19technomancymaybe tomcat is just more careful about ordering its classpath such that the version it provides always takes precedence
13:20llasramI'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:21technomancyah, ok that makes more sense
13:23devn"lein-nevam is mean to be run in project directory that has an existing pom.xml file but has no project.clj."
13:23devn"Couldn't find project.clj, which is needed for nevam"
13:24technomancydevn: thickey may know more?
13:24devnyeah, not sure on this
13:43hhutch*sigh* ... writing vanilla javascript and wishing for if-let
13:44achin_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:47technomancyachin_: can you paste ~/.lein/profiles.clj and project.clj?
13:47technomancyllasram: I've got jar using prep now instead of invoking compile directly, so that might get you what you need
13:48fprefect,01
13:48clojurebot1
13:48fprefect,08
13:48clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 08>
13:49achin_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:49technomancynice
13:49llasramtechnomancy: That looks perfect. Thank you!
13:49fprefectwhy is 08 an invalid number?
13:49fdaoudfprefect: 08 implies octal
13:49fprefectoh i see
13:49fdaoud,(+ 07 1)
13:49clojurebot8
13:50fdaoudsorry that was pointless
13:50fdaoudbut you know what I mean :)
13:50fprefectyes thanks
13:50fdaoud,0xA
13:50clojurebot10
13:50technomancyllasram: 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:50fdaoudwelcome fprefect
13:54llasramOoh, tricky
13:54fdaoud,(format "%o" (+ 07 1))
13:54clojurebot"10"
14:21achin_technomancy: Where does lein2 put what used to be in each project's ./lib directory?
14:22technomancyachin_: everything is referenced directly out of ~/.m2
14:23adamspghin the more conventional Maven-kind-of-way ...
14:23technomancyadamspgh: 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:23achin_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:24technomancyyou can just do "lein deps :tree"
14:24technomancythough that's too new to be in the preview2 release
14:24technomancyso you'll have to run from master or wait for preview3
14:25achin_Gotcha. That works. Thanks.
14:25adamspghtechnomancy: ah, I didn't know about "lein deps :tree" Very nice!
14:25technomancythank xeqi
14:25technomancyand cemerick; that's their goodness
14:25xeqitheres a lein-deps-tree plugin that was announced on the mailing list today that does something similiar
14:25xeqican be used in preview2
14:28fprefecthttp://pastebin.com/LQWHcmNt is there a more concise way to parse such grids of integers?
14:31fprefectcould i prevent wrapping parseInt by using some built-in clojure function for parsing the integers?
14:36jkkramerfprefect: if you're not worried about bad input, you could use read-string
14:37TimMc&(read-string "017")
14:37lazybot⇒ 15
14:37TimMcMake sure you won't have leading zeroes. :-)
14:37TimMc(I think parseInt is more appropriate.)
14:38fdaoudfprefect: doesn't look like there is a built-in clojure function that wraps parseInt.
14:38fprefectis there no way to prevent the reader to parse numbers with leading zero as octal?
14:42fdaoudfprefect: but you don't get that problem when you use parseInt, right..?
14:43fdaoudfprefect: but you don't get that problem when you use parseInt, right..?
14:44fprefectright
14:45LicenserHi I have a very odd error in cljs: No protocol method IHash.-hash defined for type array: 1000
14:45Licenserhas anyone an idea what the heck is wrong?
14:46hhutchLicenser: can you use refheap.com to paste the code?
14:46fdaoudfprefect: instead of two map calls, I would do (map parseInt (clojure.string/split (clojure.string/join " " grid-string) #" "))
14:48Licenserhhutch: https://refheap.com/paste/1660
14:49Licenserit totally makes no sense o.O
14:53hhutchLicenser: the {[100] 1 ...} you mention on line 31 of your paste
14:54hhutch.. is that a JS object, or a clojure hash-map ?
14:54Licenserhhutch 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:57Licenserhhutch crash happens on L14
14:57hhutchLicenser: brb, testing
14:58Licenserthanks mate :)
14:59oakwiseLicenser: js objects can't use arrays as keys
14:59Licenserah sneaky
15:01Licenseroakwise you saved my day :D
15:01TimMcew
15:01oakwisehehe glad to hear it
15:01TimMcI guess that makes some amount of sense, since arrays are mutable...
15:01oakwisethat 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:02Wild_CatPython dicts have a similar restriction -- only immutable/hashable objects may be used as keys
15:02TimMc...and that's why I switched away from Python in one of my projects.
15:03Wild_CatTimMc: out of curiosity, what was the problem?
15:03TimMcI wanted sets of dicts or something.
15:03TimMcand Python was like NOPE
15:03Wild_Catyeah, because dicts are mutable and therefore you can't use them in sets.
15:04Wild_Cathow *do* you use a mutable object in any hash-based data structure, though?
15:04fdaoudwell shoot, I was talking to.. nobody.
15:05Wild_CatI 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:09amalloyWild_Cat: don't mutate the keys
15:10Wild_Catamalloy: sure, but what happens if you do anyway?
15:10amalloyundefined behavior, probably
15:10amalloywhich is to say, anything at all
15:11Wild_Catyay. I think I prefer the Python way, then :p
15:12amalloyi'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:12amalloythat'd be like php with fewer braces and more spaces
15:12Wild_Catamalloy: numbers, strings, tuples and frozensets.
15:13Wild_Catoh, functions, methods and classes, too, can be used as keys.
15:13TimMcIt'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:14Wild_CatTimMc: well, you can build a hashable version of a dict, provided the values are all hashable. tuple(d.iteritems())
15:14Wild_Catit's ugly, I'll give you that. And you may want to use the sorted() version.
15:15Wild_Catbut yeah, Python was never big on immutability and purity, hence the lack of frozendict.
15:20Wild_Catare there any JSON or CSV readers/writers in the Clojure stdlib?
15:23joegallohttps://github.com/clojure/data.csv
15:23autodidaktoibdknox: have a favorite way of jumping to a function definition in vim?
15:23joegalloand https://github.com/dakrone/cheshire for json
15:23eggsbyautodidakto: besides marks, my favorites are / and } :p
15:24joegalloor, i suppose, https://github.com/clojure/data.json if you want
15:25hiredman(note how cheshire has benchmarks comparing it to other encoders but data.json doesn't)
15:25autodidaktoeggsby: 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:26progoautodidakto, there's ctags plugin for lein but it didn't work OOB with vim tags support :/
15:26progowould be superb to get that working.
15:28progoAnd if you know how is vim's tags support, you'll love it.
15:28oakwiselast I checked vimclojure had a goto def feature, no?
15:30progohmm, <LocalLeader>gw or gi
15:30progohaven't tried that myself
15:31autodidaktoahh
15:31autodidaktoGotoSourceWord (gw)
15:31autodidaktoor GotoSourceWordInteractive (gi)
15:31replacaJust 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:32autodidaktoreplaca: Cool. Good documentation is underrated.
15:32replacaand 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:33replaca*macros
15:42autodidaktooakwise: 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:43autodidaktohow do I make it so GotoSourceWord{Interactive} see's everything in my project?
15:44autodidakto*looking through the vim :help path doc now..*
15:47oakwiseautodidakto: sorry, I haven't used vimclojure in a while... I love vim, but I tried emacs for clj and never looked back :P
15:47oakwiseautodidakto: how are you launching the nailgun server?
15:47autodidaktooakwise: is there a certain feature you fell in love with?
15:48autodidaktowith lein nailgun (plugin)
15:49oakwiseautodidakto: 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:51oakwiseand evil mode (vim emulation for movement/editing) gets you almost all of the good parts of vim (the economy of keystrokes when editing)
15:52oakwisebut for now I'm sure there's a way to get your gotosourceword working... I had it at one point
15:54autodidaktohmm
15:54oakwisehm actually maybe not easily. It might now poke into jars. What do you have for $CLOJURE_SOURCE_DIRS?
15:55wei_how do I (use 'clojure.repl) by defaultl in the repl?
15:55wei_using vimclojure, if that makes a difference
15:55oakwiseautodidakto: 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:56oakwises/;/:/g
15:56autodidaktooakwise: I'll add those. But I'm struggling to get it to even work with the clj files in my project dir.
15:57oakwiseautodidakto: but other nailgun features work?
15:59autodidaktooakwise: Yeah. Perfectly. Are you sure GotoSourceWord is a nailgun feature?
15:59autodidaktowei_: using the vimclojure/nailgun repl?
15:59wei_yep
16:00replacatechnomancy: you here?
16:01autodidaktooakwise: ah yes, it does look like a nailgun thing. nvm
16:03eggsbyI wonder if dnonel's clojurescript talk he's doing today will be available anywhere
16:03eggsbydnolen*
16:05technomancyreplaca: yeah, what's up?
16:07replacatechnomancy: how come swank-clojure doesn't load clojure.repl & pprint?
16:08technomancyreplaca: you mean into the user ns?
16:08replacatechnomancy: yeah
16:08technomancyI'm not aware of anything in clojure.repl that doesn't have a more useful counterpart already in slime
16:09autodidaktowei_: 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:09technomancyin 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:09replacaperhaps, though the consistency between slime and vanilla repls is nice
16:10technomancyI think I tried briefly, but I'd take a patch for it anyway
16:10replacatechnomancy: mostly I seem to want doc & pprint. Is there a way to autoload these on startup?
16:11Raynestechnomancy: 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:11technomancyreplaca: you could try adding an :injections key to project.clj that contains forms that do the use calls you need.
16:12technomancyRaynes: what makes you think I wouldn't want that?
16:13Raynestechnomancy: 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:13replacatechnomancy: per project & shared :(. same issue as not wanting clojure-wank itself in my project.clj
16:13RaynesBahahaha, clojure-wank.
16:13technomancyRaynes: oh, I thought you meant just documentation and stuff
16:13technomancyreplaca: you can put it in your user profile
16:14replacatechnomancy: perfect. where's that go?
16:14technomancy{:user {:injections ['(use 'clojure.repl 'clojure.pprint)]}} in ~/.lein/profiles.clj I think
16:14wei_autodidakto: hmm, I can't see an easy way either. thanks for looking into it for me though
16:14technomancyRaynes: if that happened it would just force me to implement nrepl.el
16:15RaynesOh man, that'd be great.
16:15technomancyRaynes: but that would force me to implement a clojure->elisp compiler
16:15replacatechnomancy: thanks, I'll give that a try. Is that lein 1, lein 2, or both?
16:15technomancyRaynes: which would force me to make the Emacs maintainers add immutable strings at gunpoint
16:15RaynesHaha
16:15wei_technomancy: thanks!
16:15technomancyreplaca: that's lein2 only, though there may be another way to do it in lein1, try "lein help sample"
16:16replacatechnomancy: I'm happy enough with lein 2. I'm planning on switching in the next week or so
16:16technomancysweet
16:17replacathanks!
16:17replacaRaynes: you can go back and watch some more Beavis & Butthead now. :)
16:18Raynesreplaca: Funfact: never actually seen that show, though I have played the Sega Genesis video game.
16:18autodidaktowei_: Np. it seems like you can pass "require"'s to the nailgunclient, but more investigation is necessary to find the right syntax..
16:28autodidaktooakwise: any tips for making the switch?
16:30oakwiseautodidakto: 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:31autodidaktooakwise: is there a good source of info about using the clojure/repl tools?
16:31oakwiseoh, 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:32Raynesautodidakto: FWIW, I switched from Emacs *to* Vim.
16:32oakwisehttps://github.com/technomancy/swank-clojure is a good starting point
16:32RaynesIf 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:34oakwiseWhy not? Learning a new editor isn't going to unlearn vim. I still happily use vim for everything except for elisp and clj.
16:34autodidaktoRaynes: 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:35RaynesI don't use the REPL stuff VimClojure has.
16:35RaynesBut I might in the future. I think VimClojure is dropping nailgun in favor of nrepl, which is fantastic.
16:36Raynesautodidakto: 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:37RaynesIt's worth learning anyways because it is a fantastic editor.
16:39replacatechnomancy: how do I get clojure-jack-in not to just say "Connection closed" after I've done a slime-quit-lisp?
16:41technomancyreplaca: not aware of a way to do that
16:41replacatechnomancy: so I have to restart emacs?
16:42technomancyreplaca: you can just do M-x clojure-jack-in again
16:42replacatechnomancy: but when I do that it says "connection closed" over and over
16:43technomancyhuh; never seen that
16:43technomancysame if you kill the *swank* buffer?
16:44replacadunno, I see it pretty often. Just updated everything last week, too
16:44replacayup, just tried that
16:44replacalooks like it's got some state wedged :)
16:44oakwiseautodidakto: 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:45replacatechnomancy: ahh, the slime-repl seemed to be holding the state. When I kill that, I can get it to work again. Hmm...
16:46autodidaktooakwise: cool, thanks
16:46autodidaktoRaynes: thanks for the tips.
16:47autodidaktoRaynes: the nrepl/vimclojure info, btw, is at -> https://bitbucket.org/kotarak/vimclojure/issue/82/use-nrepl . Last update a month ago
16:49Raynesautodidakto: Yeah. Haven't figured out how to get it running though. No docs yet.
16:59wei_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:59RaynesOr just stuff it in a function and only call it when necessary.
17:03hiredmanwei_: one way is to use a combination of defonce, delay, and force
17:06wei_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:31replacaHow do I get real java ints when I need them? Apache XML-RPC is whining at me about sending it longs.
17:31unlinkHow 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:31technomancyreplaca: supposedly you call int, but sometimes that doesn't work
17:32replaca(class (int 22)) returns java.lang.Long for me
17:32hiredmanreplaca: what version?
17:32hiredman(of clojure)
17:32hiredman,(class (int 1))
17:32clojurebotjava.lang.Integer
17:32replacahiredman: 1.3
17:32hiredman*clojure-version*
17:32hiredman1.3 is not good
17:32hiredman,*clojure-version*
17:32clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}
17:33technomancyI was running into this earlier; ant yells at you if you give it Longs too, and calling int doesn't help
17:33replacaso should I skip 1.3 and go straight to 1.4?
17:33hiredmanon 1.3 you may need to manually box the long as an Integer and call .intValue
17:33replacaI'm rolling some old 1.2 code forward
17:33hiredmanreplaca: I would recommend it
17:33replacaeven that was giving me Long!
17:34replacaI'll give it a try. How bad could it be! (famous last words)
17:34replacaDo you guys know what the latest beta is?
17:36hiredman[mantle/clojure "1.4.0-beta3m1"] is what we are using at work, https://github.com/scgilardi/clojure/commits/mantle
17:36RaynesI'm using clojure "1.6.0-from-the-future" at work.
17:36replacahiredman: is mantle a version that includes screened patches?
17:36hiredmanhopefully clj-942 is fixed before the release
17:37hiredmanmantle there just includes the fix for clj-942
17:37replacaoh, ok. thanks
17:37hiredmanbut actually that may be in the latest beta
17:38hiredmanclj-942 is fixed as of beta4
17:38hiredmanbeta6 is the latest
17:41replacayeah, I was getting confused looking at JIRA!
17:42replacabeta6, here I go!
17:43technomancyjira, confusing? it can't be.
17:43hiredmano/~ livin' on the edge o/~
17:45replacatechnomancy: sarcasm is not allowed in this channel. (oops, I think we'll both be banned)
17:51TimMc&(class (short 4))
17:51lazybot⇒ java.lang.Short
17:51TimMc&(class (int 4))
17:51lazybot⇒ java.lang.Long
17:51TimMc...
17:54replaca&*clojure-version*
17:54lazybot⇒ {:major 1, :minor 3, :incremental 0, :qualifier nil}
17:55TimMc,[(class (short 4)) (class (int 4))]
17:56clojurebot[java.lang.Short java.lang.Integer]
17:57amalloyTimMc: what's buggin' you?
17:57amalloythe int/Long thing? switch to 1.4 :P
18:00TimMcNo, I'm just surprised that shorts and bytes didn't promote as well.
18:24y3diwhat's a good channel for discussing API design?
18:26mkI'd bet there isn't one, but pretend you're talking about a clojure api, and this channel might work for you
18:29mky3di: if you find one, let me know where it is
18:56yoklovif I want to map over a list with Math/abs am I limited to doing it with #(Math/abs %)?
18:59mkyoklov: there's memfn, but I don't think it works with static
18:59yoklovnope
18:59yoklovit does not
18:59yoklov,(map (memfn Math/abs) [1 -2 3 -4])
18:59clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No matching method found: abs for class java.lang.Long>
19:02mkyoklov: there's also math from clojure-contrib, I think
19:14yoklovlol yeah and clojure.math but its not worth the difference between #(Math/abs %)
19:14yoklovbesides i'm doing this for code golf so
19:30muhoohehehe, well, fail.
19:30muhoothe 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:32Frozenlockmuhoo: So what will you do?
19:33taliosmuhoo: did he specify Java "source" or "java" (aka class files)
19:33taliosa jar is a jar :)
19:37muhoonaw, he wants it in java.
19:38muhoobut i'll almost certainly end up writing it in clj then transliterating it to java
19:38muhooor, i'm considering just pointing him to the already-extant open-source libraries which do what he wants.
19:39muhoobecause, money is great, but despair is not.
19:39gf3muhoo: yes, I am certain these wheels have already been implemented
19:40cemerickmuhoo: Depending on how crazy you want to get, you could write Clojure to generate the Java and PHP. :-P
19:40archaicif 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:40muhooi was seriously considering it
19:40muhoocemerick: i heard about pharen
19:40muhoobut it has different semantics than clojure, and that bothered me.
19:41talioscemerick: were there any april fools clojure stories out in the wild at all?
19:42cemerickmuhoo: haven't looked at it myself
19:42muhooif 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:42cemericktalios: 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:43cemerick4/1 being on a Sunday tempered the usual range of craziness, I think.
19:43muhoothe problem i have with generated code in general is that it's not very readable
19:44talioscemerick: we did an April Fools UO podcast with "news", but we forgot to mention anything about clojure.
19:44talioscemerick: sadly, that scala truths post was so close to the truth I'm not sure it was an april fools
19:44arohnerif I want a defrecord to implement j.u.c.Callable, I have to implement it directly, right? I can't just implement IFn?
19:45cemericktalios: Yeah, the only hint was that it was written by a scala enthusiast
19:45cemerickMaybe he's just going to toss the lot.
19:45cemerickit was achingly close to the truth in my experience…
19:46amalloyarohner: correct
19:47amalloyi mean, sorta
19:47talios'lo brehaut
19:47brehauthi talios
19:48amalloyyou don't have to "mention" Callable; the IFn interface extends Callable, so you can just include (call [this]) in the implementation of IFn
19:49amalloybut you can't just implement (invoke [this]) and have Callable magically work
19:49arohnerfreeze_fn.SerializableFn.run()V [Thrown class java.lang.AbstractMethodError]
19:50amalloyRunnable
19:50arohnerright, but I get the same error for both
19:50arohnerfreeze_fn.SerializableFn.call()Ljava/lang/Object;
19:51amalloythe only reason i can imagine for that is that you didn't take my advice and include an implementation for (call [this])
19:52arohnerhttps://gist.github.com/ed2a1de1af8dc047c5f6
19:54taliosbrehaut: you should come up for our clojure hackday - http://www.meetup.com/codelounge/events/57876162/
19:54brehauttalios: oh interesting. i should
19:54cemericktalios: Richard is going to learn Clojure?!?
19:54amalloythat looks like it should work, although you'll need to implement applyTo at some point
19:55talioscemerick: he wants to try something with clojure/webnoir and see what the fuss is about.
19:55arohneramalloy: interesting. it *should* work, yet it doesn't :-)
19:55cemerickheh, cool
19:55cemericktalios: what's your plan for oauth support?
19:55talioscemerick: I think however he's an alien imposter, I mean - he's learning vim as well.
19:55amalloyworks fine for me, arohner
19:56cemericktalios: Well, I'm in Counterclockwise and vim all day, so… :-)
19:56talioscemerick: mm, oauth - good question. but then I've also not looked at that in straight java let alone clojure :)
19:57amalloyi pulled out your resolve-var-str because it's not related to the defrecord issue: https://gist.github.com/b4774f8b8ed83657d3e0
19:57cemericktalios: 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:57brehauttalios: maven‽ for shame ;)
19:57arohneramalloy: oh, I bet I have some AOT / .classfile issue
19:58technomancyIIRC https://github.com/DerGuteMoritz/clj-oauth2 is more up to date
19:58arohnerthis stuff has to be AOT'd to work with a java lib
19:58taliosbrehaut: 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:58technomancyit has 2 in the URL; it must be newer!
19:58talioscemerick: cheers, will check it out.
19:58cemericktalios: 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:59talioscemerick: you should fly down :)
19:59taliosand pick up technomancy on the way
19:59talios:)
19:59cemericktalios: :-) I think I may be exactly on the other side of the earth from NZ
19:59cemericktechnomancy: "more up to date" in what vector?
20:00cemerickI'm still in the blissful "I don't care about oauth" stage.
20:00cemerickIt looks like a moose-sized yak.
20:01technomancycemerick: more up to date as in "there was a talk on it at clojurewest"
20:01arohneramalloy: yes, I had AOT issues. thanks for the help
20:02cemericktechnomancy: oh, which one?
20:02technomancyit's an "emerging standard", but clj-oauth2 apparently works with the biggest providers of oauth2; dunno if you need oauth1
20:02technomancyhttp://clojurewest.org/sessions#patterson
20:02cemerickah "Accessing Real-World APIs from Clojure
20:02cemerick"
20:03cemerickShould have had oauth in the title, I may have gone. :-)
20:03muhoooauth is annoying but not necessarily complicated
20:03muhooit's just the back-and-forth and token exchange which is irritating
20:04cemerickmuhoo: It sure *looks* complicated.
20:04cemerickEvery provider seems to have its own set of "stuff" you have to do/provide/register for/etc.
20:04cemerickSorta like oauth is a meta-authentication mechanism.
20:06muhooi implemented oauth crap for php not long ago, for accessing mailchimp
20:06hiredmanugh
20:06muhoolook, i suck, and this is what i have to do for money. :-/
20:06brehautthat sounds like death
20:07muhooi appreciate your sympathy.
20:07muhoobut wait, do you guys actually get paid to do stuff that DOESN'T suck? really? is that even possible?
20:08muhooit's been my experience that the suck and pay are strongly positively correlated
20:09brehautin my case, it depends what you think of python/django ;)
20:11muhooi enjoyed python. it was my go-to language until i found clojure
20:11arohnermuhoo: I like my job. Though I am the founder, and I'm not really making money yet :-0
20:16cemerickmuhoo: Suck is mostly opt-in AFAICT.
20:38wei_(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:38brehaut,(apropos cycle)
20:39clojurebot()
20:39aperiodic,(take 5 (cycle [1 2]))
20:39clojurebot(1 2 1 2 1)
20:40muhoocemerick: i guess that's a positive way to look at it.
20:40nsxtmuhoo: i've also found that correlation as well... :(
20:42nsxti'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:45wei_apropos? interesting
20:45wei_cycle. awesome
20:46llasramcemerick: +1
20:46llasramIf you aren't in a position to make it not suck, there's plenty of other places to go
20:47wei_arohner: good luck with your venture! I wrote some clojure for my own startup a while ago
20:48technomancyarohner: how do you handle gem dependencies with clojure projects?
21:11arohnertechnomancy: at the time, I had a Gemfile and a project.clj
21:12arohnertechnomancy: but there's no ruby code anymore, so no more Gemfile
21:13arohnerAFAIK, there are solutions for packaging jars as gems, but no solution for packaging gems as jars
22:17muhooif 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:33muhooauugh, what's weird about the java interop is that the -'s run backwards
22:33muhooin regular clojure, -private seems to be the norm. in making a class to be called from java, -public appears to be the norm
22:39cemerickman, any more betas and ibdknox's korma 0.3.0 is going to be the duke nukem of Clojure libraries. ;-)
22:40taliospull of porn and a terrible game play experience?
22:40taliosfull of even
22:40cemericktalios prompts the strangest mental images…
22:41talios:)
22:44cemericktalios: so, when are you going to port your maven builds over to leiningen 2? ;-)
22:45taliosat the rate this projects going we'll be going cake, and by cake I mean javascript. I'm crying here.
22:46cemerickthe node bandwagon carries on?
22:46taliosweb 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:46brehauttalios: you need to get wombleton and his ilk on a tighter leash
22:47cemerickoh, well, if you're munging coffescript, *shrug*
22:47taliosthey didn't like the idea of clojurescript
22:49cemericktalios: which part(s)?
22:50cemerickI can imagine dedicated web folk being mostly worried about having another runtime underneath.
22:51muhoohow can i force lein to aot compile an ns?
22:51talioscemerick: the clojure parts
22:52cemerickha
22:52cemericktalios: a bit on the nose, eh?
22:52taliosit's been sooooo long since I've done any clojure
22:52cemerickmuhoo: add `:aot [your.ns.name]` to project.clj
22:53taliosI keep having love/hate affairs with s-expressions
22:53muhooah got it :aot [org.example.sample]
22:53muhoohttps://github.com/technomancy/leiningen/blob/preview/sample.project.clj
22:53cemericktalios: I'm more on the 90/10 end of things, but yeah.
22:53muhooif this works, i'm going to do a dance of celebration
22:58brehauttalios, cemerick: im mostly fine with s-exps, its dynamic types that i have a love hate relationship with
23:02cemerickbrehaut: keep rooting on Ambrose, dnolen, et al. on then. Seems like they'll end up producing something spectacular.
23:03brehautcemerick: i really hope so
23:04brehautcemerick: im particularly hopeful that typed-clojure will be useful for macros (e.g. fmap, monad and friends using types rather than dynamic vars)
23:05muhooare you talking about this? https://github.com/downloads/frenchy64/papers/research-proposal-final-draft.pdf
23:05brehautyes
23:05brehautthe project repo should be there too
23:06brehauthttp://github.com/frenchy64/typed-clojure/
23:06muhoodnolen is working on that?
23:06brehautindirectly i think?
23:07brehautits built on core.logic i think?
23:07muhooimpressiveo
23:08brehaut~rimshot
23:08clojurebotBadum, *tish*
23:09muhoowell i've aot'ed a class that has a java interface. now... to try importing it as java
23:10muhoogawd lein is great.
23:11muhooif 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:12brehauti dunno about the junut tests, but the former should definately work
23:13cemerickmuhoo: You can produce junit tests from Clojure without a problem. Old-style `testFoo` style, as well as using annotations.
23:13cemerickThere's actually an example of this in the book.
23:13brehautcemerick: oh, which book is that?
23:14cemerickbrehaut: dunno, something about Clojure. :-P
23:15brehaut:P
23:15cemerickshould actually start shipping from amazon this week
23:15cemerickor, that's the rumor
23:15cemerickmuhoo: don't mind brehaut and I, BTW: http://clojurebook.com
23:17brehautcemerick: thats great :) i might actually be able to afford the postage from amazon
23:17cemerickbrehaut: I have no info on amazon.co.nz :-/
23:17brehautheh
23:17brehautno such thing exists
23:18brehautbut amazon.com and .co.uk have sane shipping
23:18cemerickoh, lookit that, it redirects to .co.uk
23:18brehauto'r was going to charge me more than the book itself
23:18cemerickyeah, I can imagine
23:20cemerickbrehaut: just how irritating is it that you get shuffled along to a .co.uk for something like amazon?
23:20muhoocemerick: congratulations on the book. yes, i'll buy it.
23:20brehautactually not too bad; amazon.co.uk does free shipping for us with a big enough order
23:21muhoothough i still haven't finished fogus's book, and i feel guilty about my eyes being bigger than my stomach.
23:21brehaut(25£ worth from memory)
23:21cemerickmuhoo: No worries; but, thanks in advance if you do end up buying it. :-)
23:21muhoooh i'll buy it just to give you some $
23:22muhooand then i'll feel guilty about starting a new one before finishing the other one first :-)
23:22brehautcemerick: 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:22cemerickbrehaut: Yeah. It'd be quite unsettling to have to go to e.g. amazon.ca or something. Wouldn't feel right.
23:22cemerick"You are not catering to me enough." :-P
23:22brehauthehe :P
23:23muhoocemerick: is there a downloadable pdf?
23:23brehauton the other hand, we have trademe which is how we spell ebay, and its not horrific
23:23muhooor is that not how o'reilly rolls?
23:23brehautmuhoo: yes, from the publisher
23:24talioswe used to have ebay.co.nz - but trademe already had the market
23:24cemerickmuhoo: 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:24taliosbrehaut: ferrit!
23:24brehautbaha
23:24brehauttalios: is that still a thing?
23:25taliosI don't think so. Fishpond are good for books here
23:25brehautas are mightyape
23:26brehautalthough i wish it was easier to get small press books down here
23:30muhoocemerick: 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:31muhoop 385, disco.
23:32cemerickmuhoo: code here, BTW: https://github.com/clojurebook/ClojureProgramming/blob/master/ch09-annotations/src/main/clojure/com/clojurebook/annotations/junit.clj
23:32cemerickI guess I should've pasted that earlier…but, the text is helpful to see as well
23:33muhooah cool, well github doesn't result in money, so it's just as well
23:33brehautwait wait, you can make money from publishing a book‽
23:34cemerickbrehaut: no, not really
23:34cemerickor, wait, yes, you can make money *publishing* a book, just not *writing* one.
23:34muhoothat's a very important distinction
23:34brehautaha
23:35cemerickI shouldn't be so harsh, but that's my expectation.
23:35cemerickI'm planning on letting it run a year before doing a proper retrospective.
23:36brehautthat'd be interesting to see
23:39seancorfieldrealized i've been off channel for several days... missing y'all! :)
23:40Raynesseancorfield: Man. Don't do that. We were calling the police, hospitals, cat shows. Has been a hard couple of days for the channel.
23:46cemerickseancorfield: if you're not on irc, you're just not livin', amirite? :-P
23:47brehautas 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:47muhooholy 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:48muhooimported it as a java class. so now onto the unit tests.
23:48brehautmuhoo: congrats :)
23:48muhoothanks!
23:49muhoobrehaut: so you freelance as well? good to know.
23:49cemerickmuhoo: 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:50muhooi'll have to be pretty strict about the interface, yes.
23:50muhooand 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:50cemerickbrehaut: same here
23:51muhoobtw, is longbottom out yet?
23:51cemerickmuhoo: clojure.reflect and javap are your friends in that area
23:51cemerickThe last tweet I saw about it from chouser is that it may be getting integrated into clj-stacktrace?
23:52y3diwhere do you guys go to get new info on clojure/related topics? (besides disclojure)
23:53taliosprismatic, cemerick's podcast, here, twitter, me :)
23:53muhooy3di: https://refheap.com/paste/1672 ?
23:53brehauthttp://planet.clojure.in/
23:53brehauttalios: what is prismatic; ive seen it a bunch in your toots recently
23:55muhooisn't prismatic that thing the guy at cljwest was presenting on?
23:55talioshttp://getprismatic.com/ - bradford cross's startup, clojure based
23:55brehautoh right. cool
23:55taliosbrehaut: PM me an email addy and I'll send you an invite
23:57cemericktalios: what do you think of the 'cast overall, BTW? I'm trying to figure out what to do with it next.
23:58talioscemerick: other than making me also spit coffee all over the car with you talking about my beard, I'm enjoying it :)
23:58cemerickheh
23:59cemerickthat was purely a word association thing ;-)
23:59cemerickbeards, metal, "that hat", etc
23:59talioswould be interesting to hear from someone doing mixed lang projects with clojure.