#clojure logs

2011-09-22

00:07devnAnyone here familiar with bricolage programming?
00:09symboleOnly what Google shows.
00:09devnhttp://yaxu.org/writing/ppig.pdf
00:10nappingis there no clojure-contrib 1.2.1?
00:10devnnapping: correct.
00:10devnnapping: If you're on 1.2.1, use clojure-contrib 1.2.0
00:11symboledevn: Sounds like an interesting concept.
00:11devn(That's probably confusing and could be fixed.)
00:11devnsymbole: I think it relates back to what Rich was talking about in his talk the other night.
00:11nappingI was working of something that mentioned clojure-core 1.2.0 and clojure-contrib-1.2.0, so I thought maybe they should match
00:11symboledevn: I'm not familiar with Rich's talk.
00:11devnnapping: That seems totally natural.
00:15devthTrying to write a macro that `let`s a few symbols for use inside the ~@body, but clojure makes me put a # at the end of the identifier to avoid capture. Can I explicitly capture them?
00:15nappingIs it just coincidental that both were at 1.2.0 for a while?
00:15symboledevth: ~'x would capture x.
00:16jliaaa//a
00:16jlier, apologies for the line noise
00:17devthsymbole: thanks
00:20devnnapping: You can still get clojure 1.2.0. I can understand the confusion.
00:20devnOne does not expect contrib to be off by a point release.
00:21devnPerhaps an alias or something would prevent confusion like this in the future.
00:21symboledevn: Is there a recent talk Rich gave? Any recording of it?
00:21devnsymbole: No recording yet, but you will want to see it. :) It was a really fantastic talk. Sussman gave him a standing ovation.
00:22symboleWas this at a local user group?
00:22devnNo, Stange Loop.
00:22symboleOh, nice. Seems like a really fun conference.
00:23devnsymbole: Yeah it was a lot of fun.
00:24devnIt was the precursor to Clojure conj. Lots and lots of Clojure talks. Lots of people from the communit there, etc.
00:24devncommunity*
00:24symboleMakes me want to go to Clojure Conj.
00:25nappingdevn: if anything, fixing the README in the git head for seesaw might have helped, and that's not the sort of thing you should worry about just based on me jumping into things - but I should send a patch
00:26devnnapping: Regardless I feel like if there's no release for contrib that will ever occupy 1.2.1, then someone might as well make it possible to use "1.2.1" to grab "1.2.0", but maybe that's crazy talk-- I'm going to ask the list and see what people think.
00:31nappingIt's pretty clearly listed here http://clojure.org/downloads
00:32nappingah, this http://richhickey.github.com/clojure-contrib/index.html is for the development verison
00:38nappingProbably no point, if 1.3 is coming out soon, and contrib is splitting
00:41tomojovertone's "may this be the start" inversion is delightful :)
00:50quotemstrSo is push-thread-bindings like progv?
00:56thearthurim switching a project to clojure 1.3.0-RC0: is this the latest 1.3. what do i put for X.Y.Z in :dev-dependencies [[swank-clojure "1.2.1"]]
00:56thearthurerrr[org.clojure.contrib/shell-out "1.3."]]
00:57thearthur sorry cut-and-paste fail. im asking about clojure-contrib shell out as a leiningen dependency
00:58quotemstrIt'd be nice if Firefox actually scrolled to the appropriate anchor in Clojure documentation pages.
01:00thearthurwhere can i find a list of the various contrib projects, are they on github?
01:06quotemstrIs there a way to make reflection warnings fatal
01:06quotemstr?
01:06thearthurdoes contrib.shell-out exist in the new contrib?
01:09thearthurquotemstr: not that I know of
01:11thearthurare all the contrib projects listed at https://github.com/clojure or are they scattered around github?
01:18adam_is there a clojure debian package with all the contrib libraries?
01:24hiredmanadam_: don't use apt packages for clojure http://technomancy.us/151
01:27quotemstr(let [sslfactory (.getSocketFactory ctx) sslsock (.createSocket sslfactory "example.com" 443) session (.getSession #^SSLSocket sslsock)] ...)
01:27quotemstrWhy can the compiler infer the type of ctx for getSocketFactory, and the type of sslfactory for CreateSocket, but not the type of sslsock for getSession?
01:28quotemstr(Omitting the #^SSLSocket hint generates a reflection warning.)
01:28nappinghttp://download.oracle.com/javase/1.4.2/docs/api/javax/net/ssl/SSLSocketFactory.html
01:28hiredmanlose the '#'
01:28hiredmanwhat version of clojure are you using?
01:28quotemstrhiredman: But all the examples I've seen use it.
01:28adam_@hiredman, for my research, I don't use packages for that exact reason
01:28adam_i have a couple installed
01:28adam_1.2.0 with counterclock wise
01:28adam_1.0.0 from the deb package
01:28nappingcreateSocket just claims to return a plain Socket
01:28hiredmanquotemstr: look at newer examples
01:29quotemstrhiredman: 1.2.1
01:29adam_and 1.1.0 alpha
01:29hiredman#^ is depricated, just use ^
01:29quotemstrhiredman: Thanks. Switched.
01:29quotemstrnapping: So what's wrong with that?
01:30quotemstrOh.
01:30quotemstrRight. Thanks.
01:33nappingI don't know why it is that way, it should have been legal to say SSLSocket createSocket(Socket s, String host, int port, boolean autoClose)
01:33quotemstrnapping: Does Java have what C++ calls "covariant return types"?
01:34hiredmanI believe it does
01:34hiredmanbut it may have been a late addition
01:35adam_it does for 5.0 and later
01:35hiredman"Covariant return types have been (partially) allowed in the Java language since the release of JDK5.0"
01:35hiredmanand the ssl stuff predates that
01:35nappingah, I guess that's it
01:37quotemstrAh, I see.
01:37quotemstrIs it possible to pare down the default clojure.jar so that applets start faster?
01:38hiredmanis there a supported way? no, but you can certainly try it, fork clojure and rip out bits
01:38hiredmanare you aot compiling everything?
01:39hiredmanthat can speed up launch time a little
01:39quotemstrDoes invoking clojure.lang.Compile do AOT compilation?
01:39hiredmandepends
01:40quotemstrI have a simple makefile that runs that, then creates a jar out of all the generated class files.
01:40hiredman~aot
01:40quotemstrI suppose I can do better.
01:40clojurebotAOT genclass is http://paste.lisp.org/display/70665 and http://clojure-log.n01se.net/date/2008-11-18.html#14:19
01:40hiredmanwow thats old
01:40hiredmanhttp://clojure.org/compilation
01:41quotemstrYep, I'm using AOT compilation then.
01:47thearthurhow do i find version numbers for the new contrib projects? ie: :dependencies [[org.clojure.contrib/shell-out "X.Y.Z"]]
01:47thearthur(does shell-out exist in the new contrib stuff?
01:47hiredmanno
01:48thearthurthat would explain the trouble finding it
01:48hiredmanclojure.java.shell
01:48hiredmanit is in core now
01:49thearthuryay :)
02:00justin`anyone have experience setting up clojure with mod_proxy? Everything seems to be working, except all my html is escaped
02:01justin`(using noir + enlive, the problem might also stem from that combination)
03:13rqcursqHave a good day
03:26_harsh-1joi #haskell
03:31Blktgood morning everyone
03:32robermannhi
03:33Blkthi
04:16patchworkhey all, quick question: I have a java file with a single class and I want to include it in my lein project. Where do I put it and how do I import it? (I tried putting it in the src directory under the package path but it tells me ClassNotFound)
04:17patchworkSo the java file has this package declaration:
04:17patchworkpackage com.thebuzzmedia.imgscalr;
04:18patchworkand has this class:
04:18patchworkpublic class Scalr {
04:18patchworkI put it in ~/src/com/thebuzzmedia/imgscalr/Scalr.java
04:19patchworkand tried to import it from the repl thusly:
04:19patchwork(import '(com.thebuzzmedia.imgscalr Scalr))
04:19patchworkAnd I get this:
04:19patchworkcom.thebuzzmedia.imgscalr.Scalr
04:19patchwork [Thrown class java.lang.ClassNotFoundException]
04:19patchworkwhat am I missing?
04:21robermannI'm not an expert: In my opinion an src lein's project folder should contain only .clj files.
04:21patchworkrobermann: Aha, so where do I put the .java files?
04:22robermannI think you first should compile your class and put it into lib
04:22robermann(inside a jar)
04:23robermannwait a second
04:23patchworkAha… hmm
04:25robermannput your .class inside the "classes" folder
04:25robermann(honoring the package declaration)
04:30patchworkcool thanks! I am kind of new to java, I just did javac but I notice there is a build.xml in the main folder. Is there a customary java tool that builds with a build.xml?
04:31patchworkAlso, when I used javac it made a bunch of files like Scalr$1.class and Scalr$Method.class. is this normal?
04:32patchworknevermind, found ant
04:32patchworkway better than javac
04:48robermann*$*.class files are generated by javac when you define inner classes in your source Java file
04:51patchworkokay, good to know
04:52patchworkHmm, it finds the class, but does not seem to have the resize method, though it is in the source. How do I see what methods a java class has from clojure?
04:52patchwork> Scalr
04:52hsbot Not in scope: data constructor `Scalr'
04:52patchworkcom.thebuzzmedia.imgscalr.Scalr
04:53patchworkah, I triggered hsbot
04:53robermanndoes your methods/constructors are public?
04:54patchworkYeah,
04:54patchwork public static BufferedImage resize(BufferedImage src, int targetSize,
04:54patchwork BufferedImageOp... ops) throws IllegalArgumentException {
04:54patchwork return resize(src, Method.AUTOMATIC, Mode.AUTOMATIC, Rotation.NONE,
04:54patchwork targetSize, targetSize, ops);
04:54patchwork }
04:54patchworkSo I should be able to say
04:54patchwork (Scalr/resize img 180)
04:54patchworkbut I get a
04:54patchworkNo matching method: resize
04:54patchwork [Thrown class java.lang.IllegalArgumentException]
04:55patchworkI got img by doing a
04:55patchwork (javax.imageio.ImageIO/read (as-file "/Users/rspangler/Desktop/Spomenik_03.jpg"))
04:56patchworkwhich shows it is an BufferedImage object
04:58robermannI think you should pass the third parameter too
05:04patchworkthat was it, thanks!
05:10robermannBTW, if you want to inspect the methods of a class (String, for excample), try: (for [method (seq (.getMethods java.lang.String)) :let [method-name (.getName method)]] method-name)
05:10patchworkThat is what I was looking for
05:10patchworkso .getMethods is the magic
05:10patchworkHow do I access a java enum from clojure?
05:11patchworkthis scalr class has options that are enums
05:11patchworkScalr/Method fails
05:11patchwork public static enum Method {
05:11patchworkinside the class def
05:12patchworkOnce I have a reference to the enum I can say (Method/valueOf :QUALITY)
05:12patchworkor something
05:12patchworkbut I can't get at the enum, even though it is public and static
05:19patchworkFound it
05:19patchworkScalr$Method/QUALITY
05:19patchworkodd syntax
05:20robermannyes (javax.tools.JavaFileObject$Kind/HTML)
05:20robermannnot so intuitive :D
05:25patchworkdefinitely expanding my java interop skills tonight
05:34patchworkHmm… how do I call a java function that has … ?
05:35patchworkThe last argument is
05:35patchwork I was trying to be clojure flexible with BufferedImageOps…
05:35patchwork(with ellipses)
05:35patchworkIf I pass in an argument I get the "No matching method found: resize" exception
05:35ivan__patchwork: isnt ... just an Object[] ... so i guess you could pass in a Object[] ?
05:36ivan__(disclaimer, im not a clojure user :))
05:36patchworkAh, so how do I create an Object[] in clojure?
05:36patchworkfunny, I am used to just clojure and all of this java stuff is throwing me off
05:37ivan__patchwork: http://clojure.org/java_interop#Java%20Interop-Arrays ?
05:38raekpatchwork: (into-array collection)
05:38raekor maybe object-array is better here
05:39ivan__patchwork: https://github.com/nickmbailey/java.jmx/commit/2a1e991c49718dc34c584fcebb989338ec8a13bc
05:39ivan__i think this is being called heh
05:39patchworkThat works!
05:40patchworkthanks all
05:40patchworkso I need to use java arrays for interop, makes sense now
05:40patchworkfor some reason I thought clojure collections would just be translated into java arrays
05:40ivan__patchwork: http://stackoverflow.com/questions/5638541/problems-calling-a-variadic-java-function-from-clojure
05:40ivan__ah cool
05:40raekthe java interop is perhaps more accurately described as JVM interop...
05:41raekit doesn't have much syntactic sugar for Java inventions (eg. nested classes, varargs)
05:41ivan__you just have to match it to how its represented in bytecode/on jvm
05:42ivan__in scala object a{def blah} gets mapped to equivlent of class a{public static void blah} in java
06:17shtutgartany advice on articles about building gui with clojurescript? (except "Most Basic ClojureScript GUI")
06:28shtutgartis it (clojurescript) even ready for use in production? maybe i should pick some java framework like vaadin?
06:35bsteubershtutgart: I'd recommend reading "Closure: The definite guide"
06:36bsteuberof course it's for js, so you have to translate the OO-patterns to functional stuff for yourself
06:37bsteuberbut it explains the API well
06:38shtutgartbsteuber: ok, thanks
06:52kjeldahlAs much as I hate it, I need to make some jetty stuff (using the noir framework) run under Windows. After I quit the server (from a "lein.bat run"), the java process keeps running. Any simple workarounds (other than manually killing every time; cygwin kill doesn't seem to do the job properly)?
06:54kjeldahlFWIW, built-in kill in cygwin bash does not work, but /bin/kill -f PID does.
08:57Blkthow do I get a seq or a list from a Double[]?
08:58kzarAny ideas what I'm doing wrong here? http://paste.lisp.org/display/124777 I'm somehow messing up a really really simple XOM query
08:59fdaoudBlkt: (seq dblarray)
08:59kzarBlkt: (seq (double-array [1 2 3 4 5]))
09:00Blktthanks
09:00Blktthanks a lot guys
09:00fdaoudwelcome
09:33Blkthow do I return multiple values?
09:34Fossiin a vector
09:34Fossifor example
09:35Blktisn't there a "values" construct?
09:36joegalloyes, it's called vector :)
09:37Blktdoesen't sound like Common Lisp's values, but that'll do the trick
09:40joegalloi'm not very familiar with values, but a very very quick read makes me think that you'll like this
09:40joegalloif i have a (point) function that returns a vector of an x and y coordinate, which is very idiomatic, then i could use it like this:
09:40joegallo(let [p (point)] (print (first p) (second p)) ;; but that's pretty lame
09:41joegallohowever, i can combine that with clojure's destructuring, and get something much nicer:
09:41joegallo(let [[x y] (point)] (print x y))
09:41joegalloso, as long as you're in a let context, it feels more like the vector is multiple value return, and less like a vector
09:50jliBlkt: clojure uses jvm calling convenions, so no multiple value return
09:50jlipeople just use one of the nice general data structures :)
10:07Blktjli: I supposed id, thanks for the explenation
10:23kzarI'm parsing a big XML file with XOM, I want to check the xmlns beforehand though any ideas? (I thought of reading the first 5 lines and finding it myself but it seems like the wrong approach.)
10:26kzar(I have to set up a context object with the xmlns so that I can query for things later. I want to set it dynamically so it always works.)
10:34lnostdalwhere's clojure.contrib.math gone in 1.3? i'm looking for round .. (java's Math/round isn't as good; it doesn't accept ints)
10:36lnostdalok, no one knows .. i'll copy paste from the old clojure-contrib github then .....
10:36clojurebot() invokes the form inside, but there is an implied str call. The semantics are different inside the interpolated string, necessarily so.
10:40lnostdaland add a java.lang.Long method for it... sigh ..
11:01TimMclnostdal: It's probably in core somewhere.
11:14chridohi, i'm in general new to the whole java ecosystem. my application will do the whole day processing some messages and serving a status html page.
11:14chridohow would you deploy such an application on a windows box?
11:15chridowrap it as a windows service? put it into tomcat?
11:15joegallois it already running in an application server or servlet container like jboss, tomcat, jetty or the like?
11:15joegalloor is it a standalone java/clojure application?
11:16chridono, i'm just beginning with the application, greenfield
11:18joegallookay, here's my $.02. since you are talking about serving up an html status page, you're probably going to be deploying something that ends up either running inside tomcat as a war file, in which case you should look at installing tomcat as a windows service (their windows installer handles this for you, iirc)
11:18joegalloOR, you'll embed jetty into your application, such that when you start your application as a normal java app, you'll also be starting jetty, and your app will use jetty to serve the html
11:18joegalloin which case you'll want to look at the java service wrappers for windows that exist
11:19chridodoes tomcat start the application after deployment automatically?
11:19joegallogoogle and here are some thing for that list of service wrappers: http://stackoverflow.com/questions/68113/how-to-create-a-windows-service-from-java-app
11:19chridoah, thanks!
11:20joegalloif you deploy your application as a war file, and you have that war file in the right tomcat directory, then, yes, tomcat will automatically load up your application upon start. and you'll be ready to start serving html.
11:21joegalloin order to kick off some non-html-serving aspect of your application, though, you'll need to hook into something like the ServletContextListener, which is a hook that tomcat can call into your code to let you know that "hey, your app just started", and from there you could kick off a thread that will do the message processing or whatever.
11:22joegallobased on nothing, i would argue that the embed jetty approach will make you happier, if what you're looking to do is write clojure code
11:22joegallobut that's based on nothing
11:22joegallo(besides my own prejudice, i suppose)
11:23chridojoegallo: ok, thanks a lot, just found a jetty windows service wrapper, seems to be also usable by our administrator, i think i will go with jetty
11:24joegallookay, best of luck, have fun
11:31cemerickWe're raised almost half of what we need to get Ambrose to the Conj. If you can, please donate — or share the post's link so that others can hear about the 'scholarship' fundraiser: http://wp.me/p10OJi-aX
11:32cemerickOf course, thanks to everyone that's already donated; every cent is greatly appreciated. :-D
11:32joegallocemerick: what are we looking at for top donations? i mean, if i'm going to donate, i want to win the autographed books. :)
11:33cemerickjoegallo: I guess I don't really want to say precisely, as I'd be giving away what the eventual top donors had pitched in (which I guess they might not appreciate).
11:33joegalloblast
11:33cemerick> $100, certainly
11:33joegallobut good point
11:33hsbot <hint>:1:1: parse error on input `$'
11:34joegalloi guess the only way to be sure is to give $3000 - current account balance
11:34joegallo:)
11:34cemerickhah
11:35fdaoudcemerick: that's a nice incentive. just curious: what happens to the donated amount if it's not enough?
11:35cemerickfdaoud: I don't plan on falling short. :-)
11:35fdaoudcemerick: of course not.! but what if?
11:35cemerickPeople will end up donating, just to get me to shut up.
11:36cemerickfdaoud: I've never contemplated the possibility, honestly.
11:36joegalloit won't happen
11:37joegalloi mean, he'll harass everyone until he gets there.
11:37cemerickExactly right.
11:37fdaoud*<8-)
11:37fdaoudI like your incentive. I'd do anything for a free computer book ;)
11:38cemerickSeemed like an easy, reasonable, fun extra.
11:38michaelr525>
11:38michaelr525err
11:38michaelr525so what
11:38michaelr525what
11:38michaelr525where is rich hickeys slides from strange loop?
11:40cemerickmichaelr525: not up yet; will be here when they are: https://github.com/strangeloop/2011-slides
11:41michaelr525yeah, i'm polling on this page all day :)
11:42michaelr525really great stuff in there
11:42michaelr525wish I could be there too to hear all that
11:42khaliGyes paredit, but is there is a clever way to avoid having to hit shift+9 and shift+0 all the time?
11:43cemerickThanks all; now we are *actually* halfway to the fundraising goal. Go #clojure :-)
11:43michaelr525how many people donated so far?
11:44cemerick~35 or so?
11:44clojurebotexcusez-moi
11:44michaelr525oh
11:44michaelr525,(div 1500 35)
11:44clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: div in this context, compiling:(NO_SOURCE_PATH:0)>
11:45cemerick~$42 / person
11:45clojurebotHuh?
11:45michaelr525yes, very generous people
11:45michaelr525imho
11:46cemerickWell, that's just a mean. :-)
11:46cemerickGotta run for a while. Keep spreading the world, everyone. Thanks again :-D
11:53dnolenplease retweet if you have a free moment, https://twitter.com/swannodette/status/116899593119219712
11:59Blktgood evening everyone
12:07dnolenwow Shen released, http://www.lambdassociates.org/Download/download.htm
12:08dnolenoops spoke too soon 12AM GMT tomorrow
12:09technomancydidn't see that coming
12:12khaliGdnolen, sweet
12:37chewbrancaanyone have any recommendations for a database migration library? been checking out lobos and drift, curious to see if anyone has any thoughts
12:58devntechnomancy: I'm asking this question without having done much homework, but I figured asking you might save me some time. I'm playing around with using ruby from clojure and what I'm doing is grabbing the gem source and placing it in src/foogem. The issue is that src/foogem/lib needs to be renamed to something else otherwise it will be blow away.
12:59devntechnomancy: I'm trying to figure out if there's a way to stop that from happening. According to Yoko Harada this didn't happen to her locally but happened on deploy to Heroku. Do you suspect Heroku, or could it be lein?
13:06technomancydevn: nothing comes to mind off the top of my head. only lib/ in the top-level of the project should be affected
13:21michael_campbellAnyone here going to clojure/conv?
13:21dnolenmichael_campbell: lots.
13:21michael_campbellI registered yesterday, so will be there also,although I feel I'm woefully under-brained for it still =)
13:26zerokarmaleftmichael_campbell: kind of in the same boat...we can get some jackets made
13:27michael_campbellzerokarmaleft: *chuckle* indeed. I'll be identifiable as the drooling idiot in the back ;-)
13:28michael_campbellNot that that is out of the ordinary for me most of the time as it is...
13:28manutterI've been drooling since the schedule was posted...
13:46justin`Anyone know why my ouput might be coming out completey escaped when using enlive+noir?
13:52iceyjustin`: I think enlive escapes everything by default
13:57jlilnostdal: did you see this page? http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
14:02elderling jli: Link appreciated.
14:05justin`icey: any idea how to unescape it? I'm basiclly just trying to define a single html page as a teplate in enlive and as a page in noir, and I'm getting fully escaped html
14:06justin`when using the code from the new tutorial now on the enlive github, the same thing happens, oddly, but when spitting out hiccup code, everything's fine
14:07lnostdaljli, it leads to some log site
14:07lnostdal"latest build status"
14:08lnostdalbut googling https://github.com/clojure/math.numeric-tower
14:10iceyjustin`: yeah, i think it's enlive that's doing the escaping, not noir. I think there is something you can call in enlive to mark the string as already escaped. give me a second, i'll see if I can find it
14:11justin`yeah I've been looking around in the source but can't seem to find anything, but maybe I'm just looking for the wrong thing
14:12iceyjustin`: I think you're looking for html/escaped
14:12iceyjustin`: http://www.mail-archive.com/clojure@googlegroups.com/msg08293.html
14:14justin`k thanks I'll check that out! I think that function was removed from the current version
14:14iceyjustin`: oh shoot, that's not going to be helpful then lol
14:15iceyjustin`: have you tried using emit* ?
14:16icey(I'm not really an enlive user, so I'm not sure if this is something that you would have already tried)
14:16bsod1clojure(and I think most lisps) doesn't have statements, right? everything is either expression(has a return value) or special form(like if, fn)
14:18amalloybsod1: first half true, second half...sorta true
14:18amalloyeverything is an expression, full stop. some things are also special forms
14:18justin`icey: yeah I'm guessing I should just use it on the result of the template? When I do it just double escapes eveything, so it looks like that's causing the problem, gotta run out for now but thanks again
14:18amalloy&(let [x (+ 1 (if true 2 1000))] x) ;; used special form in "expression context"
14:19bsod1thanks. one more question, what are differences between a real tail-call and clojure's recur?
14:19iceyjustin`: when you come back it might be useful for you to post up some code
14:19amalloy,(let [x (+ 1 (if true 2 1000))] x)
14:19clojurebot3
14:19amalloyrecur can only do self-recursion. tall calls can call other functions
14:24bsod1what is a good way to create a new vector from an old vector but without it's first and last elements?
14:26kharrington,(doc subvec)
14:26clojurebot"([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done."
14:52bsod1amalloy
14:52amalloy*ponder* what was that about?
14:53thorstadthit and run
14:54manutternever define colon as a hotkey for "Quit"
15:00fdaouddo bcarper or cgrand ever hang out here?
15:02amalloyfdaoud: if they do those aren't their irc nicks
15:02hiredman2010:Feb:15:05:45:33 cgrand : chouser: what was your latest use case?
15:04fdaoudamalloy: yeah I figured, however I figured people here would know what they use instead :)
15:04fdaoudthey don't use anything special on github
15:06fdaoudhiredman: ok so cgrand hasn't been here a year and a half.. :/
15:21symboleWizywig: Ping.
15:21JochenRis there anyone like me who is missing a function mmap that is like map but takes a map and produces a map processing just the values?
15:21Wizywigsymbole: pong
15:24symboleJochenR: I think it just mind be you :)
15:25symbolemight be*
15:26JochenRhmm, is there such a function in core? I have of course written it myself
15:26JochenRtopically I see (into {} (map …)) but I find this to be just noise
15:26r0manis there a recommended version of swank-clojure to use with clojure 1.3-RC0? i keep getting "No matching field found: getRoot for class clojure.lang.Var" errors when running my tests via emacs. lein test runs fine on the command line. any hints?
15:27hiredmanr0man: the latest version will work fine
15:27hiredmanlatest release or any snapshot
15:27symboleJochenR: You can always use (vals ..) to get all the values. Seems pretty easy to make, but I don't know if one is already in the core.
15:28r0manhiredman: hmm, that's what i tried :(
15:29hiredmanJochenR: is it really a map then? not a list of tuples?
15:29hiredmanmaps as datastructures are generally not for linear traversal
15:30dnolenJochenR: another alternative is to use reduce.
15:30JochenRjust see a vector as a map with the keys being indexes
15:31JochenRmmap is a function that treats maps in the same way as map treats vectors
15:31hiredmanpeople have a tendency to use {:id1 :value1 :id2 :value2} instead of [{:id :id1 :value :value1} {:id :id2 :value :value2}]
15:31dnolenJochenR: map doesn't treat vectors, it works w/ sequences
15:31dnolenand you get a lazy sequence as a result, not a vector
15:31JochenRyeah, sure, but still you rely n the same ordering when you have a
15:31JochenR
15:31hiredmanbut the second is better for a lot of cases and infact maps more closer to something like a sql table
15:32JochenRvector
15:32hiredmanthe first is more like a k/v store
15:32JochenR(mmap inc {:a 1 :b 2}) -> {:a 2 :b 3}
15:32hiredmanwe understand what it does
15:33hiredmanand why people ask about
15:33JochenRoh, I am not the first? ;*)
15:33hiredmanjust saying you may reconsider your choice of data representation
15:34JochenRi see but, hmm, I do not really agree
15:34ipostelnikhiredman, every clojure shop seems to maintain a set of map fn variants to work with maps
15:35hiredmanipostelnik: really? how many clojure shops have you surveyed?
15:35ipostelnik2 :)
15:35hiredman(no one asked me)
15:36hiredmanipostelnik: I would say the same to them, if you want to linearly traverse a map, you may be using the wrong structure
15:36JochenRnot linearly, just make sure all values get processed (pmap is fine). Order plays no role here
15:36ipostelniksmall maps as tagged data representation are very common
15:36hiredmanthe second representation is far more flexable and can be made lazy while the map cannot
15:37JochenRhiredman: good point, maybe this is why it is missing from core. It is not "simple"
15:38hiredmanipostelnik: I am not taking a poll, I don't care what is common
15:38hiredmanas I said "people have a tendency to ..." I think that tendency is very short sighted
15:38amalloyyes, while it's tempting to map a function over a map's values, dumping it back into a map at the end is expensive
15:38hiredmancorrect
15:39amalloybetter to work lazily with a bunch of k/v pairs for as long as possible, and dump it into a map at the end if you really need to (often it turns out you don't)
15:39arohnerJochenR: I call that fn map-values
15:39amalloyeg, clojure-useful contains map-vals, which has exactly the function you're asking about, but i never use it
15:39JochenRhmm, this smells a bit like implementation detail to me.
15:39arohnerJochenR: I also have map-keys
15:40amalloyJochenR: it is *not* an implementation detail
15:40amalloymaps are not lazy, and cannot be while preserving the guarantees they make about fast key lookup
15:40hiredmanworking with sql, hadoop, riak map/reduce, etc the second case is all you see
15:41hiredmanactually that is not entirely fair, you'd need a transform between mapping and reducing depending
15:42JochenRas I see it clojure has chosen sequence as its main abstraction, other languages do different and there the set of functions over collections is a bit different, with different performance characteristics
15:43JochenRbut in clojure you might be right, you have to think in sequences, not collections here
15:43arohnerJochenR: clojure hasn't chosen seqs as its main abstraction. All of the seq and coll functions in clojure have complexity guarantees
15:44JochenRwell, map filer etc. al produce just sees from any squabble input
15:45amalloyJochenR: in a mutable language, you can modify a map's values in-place cheaply. you can't really do that when the maps are immutable, i think
15:45arohnerbut you explicitly can't do contains? on a seq, and some has a big warning that it's O(n)
15:47hiredmanyou can do it with maps, sure, and plenty of people have, but you can choose to do better
15:48hiredman(heck I have)
15:49JochenRin smalltalk e.g collection is the base abstraction. aMap.collect fn yields a map, aVector.collect fn yields an ordered collection etc. You get something from the same "species" (roughly like equality paritions in clojure) In clojure you end up with a seq. aMap.collect is mmap. No mutation,new items are returned.
15:49hiredman(done it with maps, and argued with coworkers that the second way is better and just given up and let them do stuff)
15:49hiredmanJochenR: this is not smalltalk
15:50amalloyJochenR: i don't think it can both (a) do it in O(n) time without mutation, and (b) provide constant-time lookup after creating the new one
15:50amalloyif it can i would be interested to hear how
15:50hiredmaneven though smalltalk makes that method available, I would still argue that if you find yourself using it, you may want to pause and think about it
15:50TimMcI like "seqable" -> "squabble".
15:50hiredman"is this the correct representation of my data?"
15:52JochenRDon't get so defensive :-). I am not saying that one should always use mmap, but in case you need a map over the values of a map (map is somehow bound twice here) it would be a useful function. I nfor sure need it sometimes..
15:52hiredmandefensive?
15:53ipostelnikyou don't always get to choose the representation - for instance ring gives you parameters as a map not a sequence
15:53hiredmanuseful, but often a poor choice, similar to calling contains? on a seq. clojure tends to push away from bad choices
15:53amalloyipostelnik: and if you find yourself wanting to use map-vals on a ring map, let me know
15:53JochenRfeel a bit like that because i hear performance all the time, but i just want to have readable code. I optimize just when it gets slow. With my small maps I do normally not care.
15:53hiredmanipostelnik: which is fine, do you really often map over all of the different kinds of fields there?
15:54ipostelnikhiredman, not often, but in my last project I needed to convert the keys to int
15:54eug_hi all. suppose i have a java object in repl. is there a way to get a list of its methods?
15:54ipostelnikit was super convenient to use a mmap on it and very easy to read the resulting code
15:54bhenry,(doc show)
15:54hiredmanipostelnik: all of them?
15:54clojurebotNo entiendo
15:54amalloyeug_: clojure.repl/show
15:54eug_cool
15:54ipostelnikall the query parameters
15:54JochenRyep
15:55eug_that's awesome!
15:55hiredmanipostelnik: so now the more query parameters I pass in the, the longer your app will take running that loop
15:55ipostelnikhiredman, sure
15:56hiredmanipostelnik: I am not saying down with maps, my example had more maps!
15:57eug_does anyone bind () to other keys? they're so faaar away from home row
15:57bhenryipostelnik: he never said it's never a good idea. he said if you find yourself using it you might want to reconsider. in that case, it makes sense to mmap, because you probably only have a handful of params. but in another instance, you might be considering, "hey, i don't want to do it this way"
15:57amalloyeug_: i bind then to 9 and 0 - not having to use shift is good enough for me
15:57JochenRI just today had a map with some keys and strings, all of the strings to be resolved into data structures under same keys. mmap was very handy.
15:57hiredmanI tried lowercase parens once, too much of a pain, turns out I type a lot of numbers
15:57amalloy(in fact i swap all the numbers with symbols, which on the whole has been a net gain i think)
15:58amalloyhiredman: i know! more than i thought i did too
15:58eug_mind blowing idea
15:59amalloybut as it turns out i'm more fond of shouting! (and parenthetical asides)
15:59ipostelnikbhenry, I'm not arguing that maps are always the right data representation - my original point was that I've seen a lot of mmap implementations
15:59TimMceug_: Also, you only really need the left paren.
15:59dnolenJochenR: if you're constantly mapping over maps just to put them back into maps, I think you might have a representation problem. otherwise the occasional (into {}) doesn't really affect readability at all.
15:59amalloyTimMc: only true in emacs
15:59TimMcamalloy: Anywhere where paredit functionality is available.
15:59amalloyi guess i'm a sinner for not using erc, but it's handy to have ) available in irc
15:59TimMchmm
16:00TimMcYou really shouldn't type unbalanced parens anywhere. :-P
16:00TimMcor should I say
16:00TimMc:-)
16:00bhenryTimMc: ) is handy to jump to the end of a form even when you have paredit.
16:00eug_TimMc: hm; but even in emacs/slime i don't get the autoclose
16:00amalloybhenry: i use ]
16:00amalloyi think
16:01bhenryamalloy: touche
16:01TimMc< and > are pretty rare
16:01TimMcswap 'em with ( and ) maybe
16:01eug_that's very convenient
16:01eug_ah
16:01JochenRdnolen: haha, well, not constantly;-)
16:01eug_but not in cascalog
16:01amalloyTimMc: what, because <> are easier to reach? not at all
16:01eug_amalloy: much easier!
16:01TimMcfoot pedal, that's the only solution.
16:01eug_i actually *do* have a usb pedal
16:01TimMcC, M, (, and )
16:02eug_http://www.gizmag.com/thanko-usb-foot-switch-computer-pedal/18737/picture/134895/
16:02dnolenJochenR: then it's just a minor convenience. Including mmap would mean including vmap, smap, lmap, etc.
16:02TimMcI might make one out of a cannibalized USB keyboard.
16:02amalloyi still only use it like 10% of the time, though - never really got used to using it
16:03amalloyC, M, and S, in fact; that helps counter the problem of swapping numbers/symbols
16:04JochenRdnolen: no, maps are different, as their keys are not transparently handled by map (only here you get k v pairs) as with vectors sets etc.
16:04JochenRit depends on how you see it.
16:06amalloymaps are only different because you want to treat them differently. sets and vectors are just as different, to someone with slightly different goals than whatever your current goal is
16:07JochenRNo. See it from the side of the function you pass in. In map over maps you have to handle key value pairs, in all the other cases, just values.
16:07JochenR(map inc {:a 1 :b 2}) -> {:a 2 :b 3}
16:07JochenR(map inc [1 2]) -> (2 3)
16:08JochenR(sorry, first should be mmap)
16:08amalloyJochenR: yes, i'm aware of the distinction you're asserting. but someone just like you would be equally reasonable asking for (map inc #{1 2 3}) to return a set
16:08dnolenJochenR: if you want map-map, then you want set-map
16:08dnolenJochenR: sets are key oriented.
16:09JochenR(map inc #{1 2} -> #{3 2}) (e.g.). See it from the fn side
16:09amalloybut seriously, if you want mmap so badly, then write it once and put it in a utilities library, or use one of the many existing libraries that have it already
16:10JochenRthis is I think why I sometimes missed mmap and wrote it.
16:10amalloy&(map inc #{1 2})
16:10lazybot⇒ (2 3)
16:10bhenryJochenR: (map inc #{1 2}) does not return a set
16:10JochenRlazybot: of course you are right
16:10dnolen,(set? (map inc #{1 2}))
16:10clojurebotfalse
16:10JochenRbut doesn't change the point I wanted to make
16:10amalloylazybot: does mapping inc over a set return a set??
16:10lazybotamalloy: What are you, crazy? Of course not!
16:11TimMcI think that point has been made...
16:11JochenRTimM: yep, fortunately also way before :-)
16:12TimMcJochenR: What's a practical example where you've felt the need for mmap, anyway?
16:12TimMcI'm having a hard time remembering where I've needed to do the same thing to all the values of a map, ignoring their keys.
16:13amalloyTimMc: converting web-request params from strings to ints is really the most common case i've seen
16:13TimMcAh, I see.
16:13amalloypersonally, i don't like to do it in middleware, but if you wanted to you'd have to keep it as a map
16:14JochenRToday, resolving names into data structures.
16:14amalloyfor example, instead i use https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/graphs.clj#L55 at the least-abstract level possible, so that i don't have to turn it back into a map
16:15JochenRanother one was convering [x y w h} rectangles into awt rectangles
16:15amalloy(using with-adjustments from https://github.com/flatland/useful/blob/develop/src/useful/utils.clj#L89 )
16:16dnolenJochenR: I just ran a recursive grep on probably 10000-20000 lines of Clojure code, various libraries my own code. into {} appears 12 times
16:16TimMcSo, type conversions, of sorts.
16:17JochenRnot always, I have just found one where I dissoc'ed one key from all values (also maps)
16:17JochenRmaybe it is because I am doing o web development
16:19dnolenJochenR: this includes my own web stuff, I don't recall using into {} that much there either
16:21JochenRwell, I also think I have at 100 times more map than mmap, but if I need to process just map values with map I miss it as I have to write into {} and adapt the fn arg as well..
16:22dnolenJochenR: so create a utility lib, upload to clojars and require in your projects, done :)
16:22JochenR(mmap inc {:a 1 :b 2}) <=> (into {} (map (fn [[k v]] [k (inc v)]) {:a 1 :b 2})
16:23bhenryin emacs/slime/swank how do i recall an error? i pressed q too soon and the process runs long. i am hoping to just view the error on the buffer i just quit.
16:23JochenRdnolen: smalles lib in clojars ;-)
16:23arohnerbhenry: I don't know about that, but the last exception might be in *e in the repl
16:24dnolenJochenR: don't forget zipmap, (zipmap (keys m) (map inc (vals m)))
16:24bhenryarohner: haha crap! i typed e* on accident so now *e is unable to resolve symbol. d'oh!
16:25amalloyJochenR: put more in there than just mmap. put all the functions you want more than once. i have a whole blog post at http://amalloy.hubpages.com/hub/Build-your-own-Clojure-toolkit about how you should have your own personal library on clojars
16:25JochenRdnolen: sure, but still….
16:25amalloyJochenR: also, use for instead of map in that example
16:25amalloy(into {} (for [[k v] m] [k (inc v)]))
16:25JochenR(zip map is a bit easier to read, though)
16:26JochenRwhy for?
16:26amalloy(map (fn [x] (inc x)) foo)
16:26amalloy(for [x foo] (inc x))
16:27dnolenJochenR: easier to read, once you get used to it.
16:27amalloyand way more flexible
16:27JochenRwell, here I disagree completely. It is matter of taste I would say.
16:28amalloy(for [xs foo, x xs] (+ 2 x))
16:28amalloy(mapcat (fn [xs] (map (fn [x] (+ 2 x)) xs)) foo)
16:28TimMcWhy (fn [x] (inc x)) instead of inc?
16:28amalloyTimMc: yes, for actual literals like inc, map is nicer; that's why i changed my second example to add two :P
16:28dnolenJochenR: familiarity as well.
16:28TimMck
16:29JochenRdnolen: depends from where you come :-)
16:29amalloyJochenR: map is fine for what it's good at
16:29dnolenJochenR: in general in Lisp readability is about structure. Does the structure of your code reflect the operation.
16:30JochenRamalloy: yes, I agree
16:30dnolenJochenR: I find zipmap more reflective structurally of the operation being done.
16:30amalloyand `for` is more flexible for all but the simplest of mapping operations
16:30JochenRamalloy: yes, but I need just simple
16:30JochenR(here)
16:30amalloyno you don't, i just saw you write (map (fn [[k v]] ...))
16:31amalloyas soon as you have to declare a function literal inline, you're just using map to write a longer version of for
16:31JochenRand what was the alternative?
16:32amalloy(map (fn [[k v]] foo) bar)
16:32amalloy(for [[k v] bar] foo)
16:34JochenRI just see fn missing and the order is reversed. I like the map order better (mmap foo bar)
16:35JochenRbut I think this is in a loop now.
16:36JochenRThanks for the nice discussion!
16:37kharrington,(let [m (zipmap (range 1000) (range 1000))
16:37kharrington mr (time (doall (map (fn [[k v]] v) m)))
16:37kharrington fr (time (doall (for [[k v] m] v)))])
16:37clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
16:37kharrington,(let [m (zipmap (range 1000) (range 1000)) mr (time (doall (map (fn [[k v\
16:37kharrington]] v) m))) fr (time (doall (for [[k v] m] v)))])
16:37clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading character>
16:37kharringtonarg
16:38kharrington(let [m (zipmap (range 1000) (range 1000)) mr (time (doall (map (fn [[k v]] v) m))) fr (time (doall (for [[k v] m] v)))])
16:38kharrington,(let [m (zipmap (range 1000) (range 1000)) mr (time (doall (map (fn [[k v]] v) m))) fr (time (doall (for [[k v] m] v)))])
16:38clojurebot"Elapsed time: 3.8 msecs"
16:38clojurebot"Elapsed time: 6.137 msecs"
16:38kharringtonthere... copy paste fail...
16:39dnolenJochenR: the takeaway is that lots of people want little small additions to the language (including myself) that don't add much expressive power. and these requests are not infrequent.
16:39bhenrykharrington: if you're map is that big you're almost definitely using the wrong data structure.
16:40JochenRdnolen: sure true
16:40TimMcWhy?
16:40clojurebothttp://clojure.org/rationale
16:40TimMc~antibotsnack
16:40clojurebotPardon?
16:41amalloy~botsmack
16:41clojurebotOwww!
16:41TimMcha
16:41kharringtonbhenry: the ratio of performance is just as bad for a map of 20 entries
16:41bhenryah
16:41TimMc,(let [m (zipmap (range 100000) (range 100000)) mr (time (doall (map (fn [[k v]] v) m))) fr (time (doall (for [[k v] m] v)))])
16:42clojurebot"Elapsed time: 188.032 msecs"
16:42clojurebot"Elapsed time: 207.119 msecs"
16:42kharrington,(let [m (zipmap (range 20) (range 20)) mr (time (doall (map (fn [[k v]] v\
16:42kharrington) m))) fr (time (doall (for [[k v] m] v)))])
16:42clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading character>
16:42kharrington,(let [m (zipmap (range 20) (range 20)) mr (time (doall (map (fn [[k v]] v) m))) fr (time (doall (for [[k v] m] v)))])
16:42clojurebot"Elapsed time: 0.417 msecs"
16:42clojurebot"Elapsed time: 1.397 msecs"
16:42TimMckharrington: You need larger numbers to test performance.
16:42TimMcAlso, /query clojurebot
16:42amalloyTimMc: i think he's publicizing it on purpose though, so everyone can see the difference
16:42TimMcI usually PM clojurebot until I have the syntax correct.
16:43kharringtonTimMc: well, then you get into bhenry's argument
16:43kharringtoni use a REPL on my own machine to test syntax, it was just a horrible serious of copy/paste fails
16:43kharringtonseries... see... typing fail
16:44bhenrykharrington: i believed you before you did the second example
16:44kharringtonbhenry: well, its kind of interesting that it balances out as you increase in the size of the map
16:45TimMckharrington: I've been doing runs of 100000 on clojurebot and the time is pretty variable.
16:45TimMcI should be using a separate JVM from the rest of you. :-P
16:46RaynesThe code is sandboxed/molested in either bot.
16:46technomancyclojurebot: are you a benchmarking platform?
16:46clojurebotexcusez-moi
16:46technomancyhmm... he used to have a factoid to that effect
16:47amalloylazybot: is clojurebot a benchmarking platform??
16:47lazybotamalloy: Definitely not.
16:47Rayneslazybot doesn't know he is sandboxed. I have a perception filter in place to make him feel free, but he isn't free.
16:47amalloytechnomancy: see, this way is just easier
16:48technomancytrue. clojurebot is a lot of things, but consistent is not one of them.
16:51TimMcSame with my home server, apparently.
16:52TimMcAnyway, if we don't care about giant maps, why do we care about performance?
16:53TimMcRepeated operations over many small maps?
16:55TimMckharrington: I think the second method always runs slower because of GC or something.
16:55TimMcReverse your tests and weep.
16:56kharrington,(let [m (zipmap (range 20) (range 20)) fr (time (doall (for [[k v] m] v))) mr (time (doall (map (fn [[k v]] v) m)))])
16:56clojurebot"Elapsed time: 1.362 msecs"
16:56clojurebot"Elapsed time: 0.453 msecs"
17:12TimMckharrington: You need *way* bigger numbers for benchmarking.
17:12TimMc20 isn't going to cut through the jitter.
17:18kharringtonTimMc: I do buy that there is a point at which they seem to more or less equal out (>>10k entries in the map), but up until that point the map call is pretty consistently faster (even with the hash-map def-ed, and with the order of the map/for swapped)
17:18NetpilgrimIs there a specific reason behind the parameter order of (nth coll index)? All other functions that take some number and a collection seem to have the order reversed.
17:19amalloyNetpilgrim: the best explanation i've come up with is to match other lisps; i think everyone gets confused by nth with the current ordering, so it "can't" be on purpose
17:19TimMckharrington: Right, so if you want to test 20-item maps, you need to repeat that maybe 10000 times and average the times.
17:20Netpilgrimamalloy: Too bad, I had hoped for some clever design idea – something to do with function composition perhaps.
17:22Netpilgrimamalloy: The order might also be chosen to mirror ([…] index).
17:22TimMcNetpilgrim: With some functions it *is* hard to say which arguments people will most likely want to partially apply.
17:24kharringtonTimMc: touche, when wrapped in a dotimes, for does seem to outperform map after a certain number of trials
17:25kharringtonbut that being said, if the call isn't iterated a ton of times, would the jitter actually be a reasonable thing to consider for performance's sake?
17:26kharringtonin the context of the call being contained in a bunch of other code
17:27TimMcNo, because you can't predict jitter, so why let it contaminate your results?
17:27TimMcUltimately, things like branch prediction become important in real-world code, so these toy loops don't even tell us much.
17:28TimMcI.e., wait until you have slow code, *then* try replacing for with map. :-)
17:28kharringtonmmm... but i'm curious now!
17:29TimMcI just don't think you can say "for is faster than map" (or vice versa) outside the context of a full program.
17:29TimMcEverything is relative, there is no god, etc.
17:40amalloyTimMc: no, i think map is faster than for, without exception
17:40amalloyit just doesn't *matter*
17:41amalloysince for macroexpands into a big mess that has a map deep down inside
17:46amalloyon further inspection, it doesn't contain any maps, it does the lazy-seq stuff manually. whatever
17:50kharringtonamalloy: i'm not so sure anymore though. i have been running a loop that steps through various sized maps, trying both let [... map ... for] and [... for ... map], and it really seems to be more or less equaling out, generally favoring for if the hash map is large
17:50kharringtonfar too much time spent on this at this point though
17:58TimMcThey're both O(n), it's all good.
18:00amalloyTimMc: laziness makes even that a confusing thing to say
18:00amalloyconcat is O(n), except that it's also O(1)
18:01TimMcreturns in O(1), computes in O(n)
18:01kharringtonand hence the argument about usage in the context of a real program
18:10tomojdoes (range) "return" in O(infinity) ?
18:11hiredmanit is O(1) but walking the result is O(n) where n is too large
18:14TimMc,(let [N (range)]) ; tomoj
18:14clojurebotnil
18:14tomojer, "compute"
18:14TimMcyeah
18:15TimMcBut it is O(n), where n is infinity,
18:15tomojthat doesn't make any sense
18:15TimMckharrington: ##(let [N (range)] N) won't hurt
18:15kharringtondoall
18:15lazybotExecution Timed Out!
18:15tomojI guess "O(n)" hardly ever really means O(n)
18:15TimMcSee?
18:16TimMctomoj: range is O(n). (range) uses an infinitely high n,
18:17amalloyi realized recently that intern (as in java's string interning) is just (memoize identity)
18:18amalloynot really related to this O(n) discussion but i thought someone here would find it interesting all the same
18:18TimMc,(doc memoize)
18:18clojurebot"([f]); Returns a memoized version of a referentially transparent function. The memoized version of the function keeps a cache of the mapping from arguments to results and, when calls with the same arguments are repeated often, has higher performance at the expense of higher memory use."
18:19TimMcHmm, it doesn't say what is used for equality.
18:19amalloy=
18:19TimMc&source memoize
18:19lazybotjava.lang.Exception: Unable to resolve symbol: source in this context
18:20TimMc$source memoize
18:20lazybotmemoize is http://is.gd/se7JvF
18:20amalloy&(let [intern (memoize identity)] (identical? (intern "test") (intern (str "te" "st"))))
18:20lazybotjava.lang.SecurityException: You tripped the alarm! intern is bad!
18:20TimMchah
18:20amalloy&(let [int (memoize identity)] (identical? (int "test") (int (str "te" "st"))))
18:20lazybot⇒ true
18:20amalloy&(identical? "test" (str "te" "st"))
18:20lazybot⇒ false
18:21amalloyi mean, really i guess what's used for equality is hash-map/get
18:21TimMcSo clojail bans by symbol, not var.
18:21amalloyTimMc: yes, clojail is remarkably stupid in many ways
18:21amalloybut it's hard to do better
18:21TimMcConservatively stupid, I would hope.
18:22amalloymostly. there are areas where you can't really do that; sandboxing is a huge topic
18:22amalloy(tune in at the conj for Raynes's talk about clojail, if you're interested)
18:23TimMcHuh, "find".
18:23amalloyfind is sweet
18:23hiredmansome day the clojure compiler will have the hooks
18:24amalloyhiredman: i would love that
18:24TimMc,(let [eval 3])
18:24clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
18:24TimMc"SANBOX" :-P
18:25reburghey #clojure... trying to construct a multipart HTTP POST... I have a File object, but I'm not sure where to go from there.
18:25reburgi'm using clj-http for now, but i'm not wedded to it in any way
18:25hiredmanI sort of started fiddling with the compiler to expose hooks for it, but it rapidly degenerated into something rather distasteful
18:26amalloyTimMc: all the clojure sandboxing environments are woefully insufficient at the moment
18:27naeuhi there
18:27amalloy,((resolve (symbol (str "ev" "al"))) '(inc 1)) ;; for example
18:27clojurebot2
18:28TimMcyup
18:28amalloyclojail has its own issues, like the ability to spin up new threads that the sandbox can't kill off
18:28TimMcI recall some other neat tricks.
18:28naeuI was hoping someone could help me with a macro I'm trying to write
18:28amalloy(which problem is currently causing us headaches at 4clojure)
18:29hiredmanclojurebots sandbox is actually running in a different classloader and with a different version of clojure than clojurebot now, which is kind of neat
18:29naeu(defmacro foo [& body] `(let [bar# (some-fn-which-returns-a-list)] (let [~@bar#] ~@body)))
18:29amalloyyeah, i like that feature
18:29naeuI'd like to do somethign like this
18:29hiredmanimpossible or very hard to get at clojurebot internals from the sandbox
18:29amalloynaeu: you can't
18:30TimMcamalloy: But Clojure needs to say yes! :-P
18:30naeuamalloy: is it totally impossible? :-(
18:30amalloyyes
18:30TimMc...and with that I am headed home.
18:30amalloyTimMc: see, i said yes
18:30amalloynaeu: i mean, you can do anything with eval
18:30naeuamalloy: sure
18:31amalloybut you need the let-bindings available at compile-time, and you want them to be computed at run-time
18:31naeuyup, that's the size of it
18:31TimMcnaeu: macros are syntax transformers -- they turn your code into other code before any values are available
18:32TimMc(really actually heading home now)
18:32naeuTimMc: thanks
18:32naeui'll look for another approach then
18:36simardI have a list and I want to create a hash-map out of that list (the list's items are the keys, the initial value would be nil for all of them), is there a function for that ?
18:36tomojsure you don't just want {}?
18:36simard?
18:37amalloy&(zipmap [:a :b :c] (repeat nil))
18:37lazybot⇒ {:c nil, :b nil, :a nil}
18:37dakronereburg: right now I don't think there's a way to do multipart POSTS with clj-http
18:37tomojoh, are you using it kind of like a set too?
18:37dakronereburg: may be worth looking into though, I'll add it to the TODO
18:37reburgdakrone: any idea of what i should be using?
18:37amalloy&(into {} (for [k [:a :b :c]] [k nil]))
18:37lazybot⇒ {:a nil, :b nil, :c nil}
18:37tomoj&(= (:foo {}) (:foo {:foo nil}))
18:37lazybot⇒ true
18:38amalloyoh, i see what you're getting at, tomoj
18:38dakronereburg: I don't know of any library that does it currently, sorry
18:38simardhehehe I don't
18:38simardbut zipmap and into are what I want
18:38amalloysimard: a map with no entries is indistinguishavle, in most contexts, from a map with keys that have nil values
18:38tomojthere is no reason to put those keys in there unless you do something like (get the-map a-key :not-found) or check keys or something
18:39simardtomoj: I intend to fill it later
18:39amalloytomoj: or (= m1 m2)
18:39reburgdakrone: actually, it doesn't have to be multipart... how would i go about doing a post w/ the file contents in the body?
18:39tomojjust fill it later then :)
18:39amalloysimard: doesn't matter
18:39simardtomoj: well yes, I want to test the presence of a key, actually
18:39tomojah
18:39simardprobably :)
18:40tomojcontains? would be a good reason too
18:40amalloytomoj: i considered that to be enfolded by "or check keys or something"
18:41tomojthat was accidental, I meant keys the function :)
18:42NetpilgrimWhat is wrong with this reimplementation of map: https://gist.github.com/1236249 E.g., I get an NPE for (map- inc [1 2 3]).
18:42amalloyNetpilgrim: you forgot an end-condition
18:42amalloy(take 3 (map- inc [1 2 3])) probably works fine
18:43Netpilgrimamalloy: Oh. That should have been obvious. Thanks.
18:43jlimbac: write more clojure
18:44amalloyjli: did i miss a message from mbac?
18:44jliamalloy: no, I just know him IRL :)
18:45reburgactually, i need to run. thanks for your help dakrone!
18:46dakronereburg: sorry I couldn't help more, hit me up later
19:04Netpilgrimamalloy: Small bug in 4clojure: If you sort the problems by difficulty, the order is alphabetical (easy, elemantary, hard, medium).
19:06naeuhow might I refer clojure into a namespace created by create-ns?
19:06amalloyNetpilgrim: yeah, if you're handy with javascript i'm sure the patch to configure data.tables to do that is minimal
19:06amalloyand we'd be happy to take it
19:07Netpilgrimamalloy: I’ve actually managed to stay away from JavaScript.
19:08jliamalloy: not quite rewritten in clojurescript yet? :P
19:09amalloyjli: unlikely to ever happen
19:09jlihum, why's that?
19:11amalloyi'm not at all excited about adding a compilation step for the js, especially a compilation step that doesn't work on openjdk (last i checked)
19:11jlihm, yeah.
19:12amalloyand since we're using jquery and all that crap, we couldn't use the optimizing compiler; we'd just end up with really bloated js code
19:12amalloyand everyone who wants to touch the frontend would have to learn cljs...there's just no compelling reason to switch
19:16hiredmanhttps://thestrangeloop.com/sessions/post-pc-computing-is-not-a-vision <-- this was a pretty depressing talk
19:16hiredman"js everywhere!!!"
19:16rbransonheh
19:16hiredmanI think he meant it as something to be excited about
19:16rbransonthe rant of a senile old man
19:16technomancyhiredman: http://twitter.com/#!/dibblego/status/116861441876824064
19:17hiredmanat one point he had a slide with a js+html+dom stack super imposed on a washing machine
19:17companion_cubeis there something to read on it on the web?
19:18hiredmanhis slides will be up at some point
19:18hiredmannot worth a read
19:18rbransonmaybe he'll fix the rampant typos
19:18hiredmando-deca-dec worst talk at strangeloop
19:18rbransonby far
19:18rbransonmade richey look even more like a bawss
19:19rbransonhickey, wow
19:19jliwhat did rich talk about?
19:19amalloythe perils of TDD, to judge from the twitterverse
19:19hiredman:D I went out to eat with rich and some relevence guys afterwards, it was sweet
19:19jlihm, interesting
19:20rbransonhe made like one comment about TDD, but everyone got all caremad
19:20companion_cubemany talks seem cool
19:20rbransonI don't think he's even against TDD, just the zealotry
19:20hiredmanwell, the middle D there
19:20technomancyhiredman: man, I got stuck at a scala dinner where they were commisserating the scala-bashing in the keynote
19:20hiredmanhah
19:20simardI have this snippet here: http://pastebin.com/bHN00AZp , which I'd like to simplify or make more elegant, is there anything obviously wrong to it ?
19:21technomancyhiredman: actually it wasn't that bad
19:21jlitechnomancy: what was the keynote?
19:21amalloy(comp #{:a-type} :type)
19:21rbransonyeah it wasn't -- he pretty much pissed off everyone in one way or another
19:21technomancyexcept for the part where he was all "I still don't believe that anyone who actually understands the curry-howard isomorphisms could really be against having a type system."
19:21rbransonwhich is what made it so great
19:21technomancyjli: rich's simplicity keynote
19:21technomancycouple thinly-veiled jabs at scala in there
19:22jliheh
19:22technomancyor at least that's how the scala guys took it
19:22rbransonhe had jabs to go around :D
19:23technomancyhttp://twitter.com/#!/moonpolysoft/status/116269563389296640
19:23technomancy(SFW)
19:23rbransonexcept for the dick background? ;)
19:24technomancyoops
19:24technomancySFW compared to the average moonpolysoft tweet
19:24technomancy(it's just ascii; don't worry)
19:24amalloysorta depends where you work
19:25rbransonwhere I work -- doesn't matter
19:25mdeboardAnyone know of any person/people/organization(s) doing any ML (or greater AI) work with Clojure?
19:25amalloyi'm really just trying to wedge in a joke about technomancy working at a porn studio, but i can't get it to make sense
19:27rbransonhttp://blog.markwshead.com/1069/simple-made-easy-rich-hickey/ <--- notes
19:27technomancyI'll defer to danlarkin
19:27mdeboardrbranson: Since you own Virgin International, you could come in to work wearing a suit made of dildos and no one would say a word.
19:27rbransonthey would probably say lots of words, really
19:28mdeboard"Nice suit, Mr. Branson!"
19:28mdeboardTHanks for the link, btw, was looking
19:29rbransoni'd wait for the video before looking at the slides -- will just be confusing
19:29jliman, I really don't understand how to follow discussion on twitter :(
19:30rbransonif anything, I think it most thoroughly bashes the NodeJS and MongoDB crowd the most
19:30technomancyrbranson: "This is UNIX^H^H^H^HJabbascript; I know this!"
19:31danlarkinconfirmed, technomancy works at a porn studio
19:31mdeboardnice
19:31jlileiningen was a classic film - kudos
19:31technomancydanlarkin: just because you keep adding me as a clojuredongs committer...
19:32mdeboardlol.
19:32jliall those ants, superhot
19:32mdeboardrbranson: Do you have any idea when said video will surface @ InfoQ?
19:32mdeboardJust reading those notes have piqued my interest. We do everything the "easy" way at work.
19:32rbransonmdeboard: they are really slow
19:32rbransonat least they were for 2010
19:33mdeboardTHey pace them out to milk page views I'm sure
19:33rbransonmdeboard: it was pretty transformational in my thinking… sounds cliche but whatever
19:33mdeboardhoping Mssr. Hickey's is among the first
19:33mdeboardrbranson: You're the second person who's said that about that talk, of the two people I've talked to about it
19:34hiredmanrich mentioned something about if/cond being "complected" (bad) which was interesting
19:34technomancya lot of what he said was in Stuart H's conj talk if you just can't wait.
19:34rbransoni'm not even a clojure user really. have looked into the concepts because i find them interesting, and after his talk, i'm looking more into it just after all that
19:35hiredmanno one really has said anything about that
19:35hiredmanhe mentioned using a rules engine instead
19:35technomancyhiredman: and/or predicate dispatch
19:35technomancyIIRC
19:36technomancybut yeah, being dataflow-ish was a theme between him and sussman
19:36hiredmanreally? I don't recall him mentioning predicate dispatch there
19:37hiredmanpattern matching was mentioned separately from if/cond I believe
19:37technomancyperhaps that was a jump I made in my own head
19:38technomancyclosed/open -> match/pred-dispatch was mentioned by dnolen at least.
19:38hiredmanright
19:38technomancyand cond basically only exists as a compilation target for match, right? =)
19:39rbransontold everyone to go fuck themselves and use prolog ;D
19:41dnolenI think Rich was advocating moving conditionals outside of fns - predicate dispatch / rules are both ways to get there.
19:42dnolenrules/logic programming also good ways to emphasize what over how
19:44mdeboarddnolen: "outside of fns"?
19:45mdeboardWhat's fns stand for?
19:45mdeboardOh
19:45mdeboard`fn`s
19:45rbransonlike not using if-then-else statements basically
19:45mdeboardderp.
19:49hiredmanwhich I don't really get, like if I replace (if (> 3 4) a b) with (query-expert-system (is (> 3 4)) (choices a b)) dunno how that is different
19:49hiredmanwhich is why I found it an interesting point
19:50rbranson<dnolen> rules/logic programming also good ways to emphasize what over how
19:50rbransonthat is basically it
19:51rbransonit's hard to make a bunch of if-then-else spaghetti composable
19:51hiredmanbut it means the rule engine has to drive your code, you can't just query it
19:52rbransoni'm not expert, but i agree… just because the rule code i've written & seen has all been terrible
19:54dnolenhiredman: I don't think he's talking about simple conditionals. But once you start getting to more than 4-5 cases, probably a good target for pred dispatch / rules
19:55rbransoninterdependent rule code also tends to get littered across the codebase
19:58companion_cubeI find that in many cases, complicated if/then/else should be local only, and conditional otherwise should be replaced by something like an event system that uncouples parts of the application
19:59mdeboardrbranson: I found your personal website and am forced to dismiss your opinion
19:59mdeboardrbranson: On *everything*
19:59rbransonmdeboard: quit stalking me :)
19:59mdeboardI wish I could unsee it
20:00mdeboardalso I wanted to make sure you weren't the famous richard branson
20:01rbransonthanks for reminding me to update it to something more relevant
20:03mdeboardI dunno, I think you could market it as an avant garde critique of modern web design
20:03rbransonit's much better now
20:05mdeboardrbranson: Wow
20:05mdeboardnailed it.
20:05rbransonthey call me the oracle
20:06dnolencompanion_cube: interesting opinion given that dispatch on type is one giant non-local conditional statement
20:08companion_cubednolen: i wasn't thinking of type-based events
20:09companion_cubemore something like FRP
20:09companion_cubelet's say a system in which events are objets, not types
20:27hiredmandnolen: right the simple if is jsut an example
21:06cemerickdnolen: where did 'swannodette' come from, anyway?
21:08rbransonnytimes I believe
21:12cemerickrbranson: really?
21:31amalloycemerick: you should wear a mask at the conj, for everyone else's safety
21:31redingerIf he wears a mask how would we tell him and Fogus apart?
21:32amalloywe could ask which one has published a...damn!
21:33dnolencemerick: marcel proust
21:33cemerickamalloy: don't jinx it! ;-)
21:36amalloy /join #lame
21:36amalloythey wouldn't let me in. not sure if this is a good sign or bad
21:39cemerick"I never wanted to be part of any club that would have me as a member."?
21:51ibdknoxdnolen: just sent out my post to clojure-dev, loops themselves are just incredibly slow
21:56gtrakdo you have to do anything special to make cljsc compile multiple files?
21:57ibdknoxgtrak: no
21:57gtrakit doesn't see the :require'd file
21:57ibdknoxgtrak: http://github.com/ibdknox/cljs-watch might make your life easier
21:57ibdknoxare you compiling a specific file? or a directory?
21:58gtraka file, but I suppose it should be the directory?
21:59ibdknoxyep
22:03dnolenibdknox: it's not loop/recur that is slow, it's doseq - that'll wrap array in a ArraySeq
22:03dnolenibdknox: I would measure with raw loop/recur
22:05ibdknoxdnolen: I'll add numbers for that in a few
22:13ibdknoxdnolen: still 2 orders of magnitude off
22:13ibdknoxdnolen: does drop it down to 3000 though instead of 4500
22:13dnolenibdknox: what's the compiled JS look like?
22:14dnolenibdknox: and is this in advanced compiliation mode?
22:14dnolenibdknox: I'm pretty sure deep property lookup gets eliminated by the compiler, which is another big perf hit.
22:15ibdknoxdnolen: collecting advanced numbers now
22:17ibdknoxdnolen: gist updated with advanced mode output. Still 1700-2000ms
22:18dnolenibdknox: what gist?
22:18ibdknoxhttps://gist.github.com/1236554
22:21dnolenibdknox: you're just measure seq performance, not loop performance. using range to control iteration is not going to be fast, instantiation per step
22:21dnolenmeasuring
22:22ibdknoxdnolen: good point. One sec
22:22ibdknoxindeed.
22:23ibdknoxdnolen: all the way down to 126!
22:23ibdknoxdnolen: problem is seqs are how we interact with everything
22:23dnolenibdknox: now you're paying for the fact that (inc i) should be inlined
22:23ibdknoxyes
22:23dnolenibdknox: no in hi-perf Clojure you don't use seqs
22:23dnolennor in ClojureScript
22:23dnolensame rules apply
22:24ibdknoxdnolen: the correct solution is an array?
22:24dnolenibdknox: array ops + loop/recur with an integer counter
22:25ibdknoxdnolen: why can't that just be an implementation detail?
22:25dnolenibdknox: they should be but we haven't figured out what that is yet. That was idea behind Pods.
22:28ibdknoxdnolen: maybe that's something we should try to get out of the conj. It seems very wrong to me that I have to explicitly not use one of the best parts of Clojure to be able to do something realistic.
22:30dnolenibdknox: we'll have to pick rhickey's brain, he got started on it, but stalled because he couldn't solve something around access in multithreaded scenario, but maybe we don't need to care about that.
22:31pcerratoRich's "sequences" talk appears to have shrunk to 8 seconds both on blip.tv and iTunes. Anyone know where I can find to full talk?
22:39amalloypcerrato: rich can convey a lot of information in 8 seconds
22:40pcerratothis is true ...
22:40symboleAny StrangeLoop videos posted already?
23:09livingstonI have a list that I am destructuring, it will have 3 or sometimes 4 items, the 4th is optional. a valid value for the fourth is nil, so what's the best way to detect the difference between a given nil and an unprovided nil?
23:10srid%g tools.match
23:10srid$g tools.match
23:11sridlivingston: use multiple arity function and core.match?
23:12livingstonit's not multiple arity, the input is one list e.g. [[a b c d]] where sometimes the function will be called (foo '(x y z))
23:13brehautlivingston: kind of hideous but ((fn [[a b c d :as l]] (if (= 4 (count l)) d :no-d)) [1 2 3])
23:14livingstonright now I'm just doing [[a b c d :as x]] and then checkign the length of x
23:14livingstonha, that was what I was about to say. thanks.
23:19brehautlivingston: its much less horrible than ((fn f ([l] (apply f l)) ([a b c] :no-d) ([a b c d] d)) [1 2 3])
23:19livingstonbrehaut: what the heck is that?
23:20brehautan abomination
23:20ibdknoxit's probably cleaner to destructure in a let
23:20ibdknoxand just take x as your param
23:21brehautibdknox: im just using fn because livingston said it was a function
23:21livingstonibdknox: I am. this is part of a bigger thing
23:21ibdknoxlivingston: good deal
23:22livingstonbrehaut: yeah it doesn't much matter, destructure here or there it's 6 one way, half dozen the other
23:22livingstoni'm assuming the desctruring in the call signature is just syntactic sugar that macros away to something like that anyway
23:22ibdknoxwell
23:23ibdknoxyes, but the way you would then write that code changes significantly
23:23brehautlivingstone, the macro just calls destructure
23:23livingstonoh but duh if I have the parameter I don't need the :as bit
23:23ibdknoxbecause you can use an if while destructuring
23:24livingston(fn [quad] (let [[a b c d] quad] (if (= 4 (count quad)) ...
23:27sridsomething like http://pow.cx/ but for clojure would be cool.
23:28ibdknoxsrid: what is missing from Noir for that to be true?
23:28sridlivingston: you can also `apply` the fn over the list (create wrapper function that does that)
23:28livingstonsrid: yeah but that seems messy, destructure will do it.
23:29sridibdknox: pow is framework agnostic. pow for clojure would be more like 'run any ring-based apps -- based on "lein run"' just by symlinking the code directory (with auto-restart, etc..)
23:29ibdknoxsrid: so kind of like lein ring server then? Except maybe a bit more robust
23:30sridibdknox: yea, but not tied to single app. ln ~/code/myrubyapp ~/.pow is all that is required to have http://myrubyapp.dev refer to a running server
23:30ibdknoxI see
23:30sridthat's `ln` (symlink)
23:30ibdknoxyep
23:31ibdknoxseems like it wouldn't be hard to build
23:31ibdknoxthe only difficult part is the vhosts
23:32amalloy&(map (fn [[a b c & [d :as has-d]]] [a b c d has-d]) [[1 2 3 4] [5 6 7]])?
23:32lazybot⇒ ([1 2 3 4 (4)] [5 6 7 nil nil])
23:32amalloylivingston, brehaut: ^
23:32brehautamalloy: aha of course
23:34brehautibdknox, srid: would multicast dns be a solution to that?
23:34livingstonamalloy: interesting, I'm not really sure how that makes me feel, but it'd certainly work
23:34livingstonit avoids the counting that I don't like
23:34ibdknoxamalloy: I feel like we could get juxt in there somewhere ;)
23:34amalloylivingston: the counting is evil; it means you couldn't ever extend this pattern to work for infinite sequences, for example
23:35livingstonsomeone better not be putting one of those here.
23:35ibdknoxlivingston: what does the function do? lol
23:36ibdknoxit's kind of a weird pattern
23:36livingstonI would hope that the compiler could optimize (= 4 (count ... )) to know that it can stop at 5 but maybe it can't
23:36ibdknoxit doesn't
23:37livingstonthat's why some people recomend testing (rest (rest ...)) if you want to know if there is more than 2
23:37amalloy*cough* next, not rest
23:37brehautnnext
23:37ibdknoxnth!
23:38amalloy&(nthnext [1 2 3] 2)
23:38lazybot⇒ (3)
23:38amalloy&(nthnext [1 2 3] 3)
23:38lazybot⇒ nil
23:38livingstonin common-lisp it was neither either nth-cdr or (cddr
23:38brehautbecause common lisp is anti vowels?
23:38ibdknoxlol
23:38technomancybrehaut: optimized for wheel of fortune!
23:39livingstonibdknox: the function takes an rdf triple or optionally a quad if the graph is specified, if the graph isn't specified it goes to the default graph.
23:39brehauttechnomancy: the APL edition of WoF would be quite hard
23:39technomancyhehe
23:39amalloytechnomancy: i assume it's so you can replacd or replaca it?
23:39livingstontechnomancy: how else would you change the value?
23:40technomancylivingston: change? what's change?
23:40livingstonbrehaut: you could have some 'a's in there ... (caddr that's "third"
23:40ibdknoxwe don't need no stinkin' changes here
23:41simardI have a list of hash-maps ({:N 1 :string "stuff" :more "stuff"} {:N 2 :string "hello" :more "world"}) and I want to find the first hash that matches with a candidate hash that contains all keys but one, like {:string "stuff" :more "stuff"}. if there is a match, I want {:N 1 :string "stuff" :more "stuff"} to be returned, otherwise nil.
23:41simardthere's probably an easy way out, right ? :)
23:42livingstonsimard: is it one specific key you don't want?
23:42simardno, I want it
23:42simardI just don't care if it matches or not
23:42simardand yes, it's one specific key
23:42simardsay, :N
23:42livingston(some (fn [m] (not (:bad-key m))) maps)
23:43livingstonthat's not what your asking though right you want a set of keys to match?
23:43amalloy&(let [maps '({:N 1 :string "stuff" :more "stuff"} {:N 2 :string "hello" :more "world"}), test {:string "stuff" :more "stuff"}] (first (filter #(= test (dissoc % :N)) maps)))?
23:43lazybot⇒ {:N 1, :string "stuff", :more "stuff"}
23:43ibdknoxmeh
23:43ibdknoxyou beat me to it
23:44simardmeh indeed
23:44ibdknoxsimard: hm? amalloy's solution is a good one
23:44amalloyibdknox: all of my code is correct on the first try so i just type it into irc without testing
23:45ibdknoxlol
23:45simardyes I agree, I'm just impressed that anything I ask here is answered within the minute
23:45simardlol
23:45amalloysimard: maybe a language issue? "meh" is an expression of...apathy or indifference
23:45simardamalloy: yes I guess that's it
23:45simardshould have been, "wow"
23:46brehautthe great thing about #clojure is that it acts like prolog. you ask a question and you get a stream of answers until hiredman says 'no'
23:46ibdknoxhahaha
23:46ibdknoxor 'incorrect'
23:46amalloynice
23:47amalloyi'm sure i've answered at least one question today with "no"
23:48amalloysomeone wanted to do something crazy with a macro that needed runtime information
23:48technomancyamalloy: steve yegge disapproves.
23:48ibdknoxsrsly
23:48amalloytechnomancy: second one to make that joke about my answer already :)
23:48ibdknoxLet's ostracize him.
23:49technomancyoh snap
23:49amalloyamalloy: naeu: you can't
23:49amalloyTimMc: amalloy: But Clojure needs to say yes! :-P
23:51ibdknoxI feel like I should write something ridiculous that lets me write awesome blog posts like this one: http://blog.whatsapp.com/index.php/2011/09/one-million/
23:52amalloyibdknox: just make a bunch of money instead. then you can write: "I recently deployed my horizontally-scaled webapp, with an established TCP connection on each of my million machines"
23:52ibdknoxhahaha
23:52ibdknoxfunny you should mention that...
23:53ibdknoxOne of our original plans for typewire was to essentially spin up 600 machines to handle a couple of very high traffic events
23:53ibdknoxthat's when I ditched node.js ;)
23:54livingstonwhat's the business plan for that thing?
23:55ibdknoxWhat do you mean exactly? Right now it's mostly just sitting there with a few folks using it
23:56ibdknoxGot screwed over by the contracts of a couple competitors
23:56livingstonI mean how do they plan on monitizing "i'm going to let you use a lot of my bandwidth for free"?
23:56ibdknoxah, totally misunderstood. For whatsapp? I have no idea. I can only imagine their magical 1 million connections are all dormant
23:57livingstonyeah sorry I ment whatsapp
23:57ibdknoxso in theory they're not really shelling out much money
23:57ibdknoxbut yeah, it's not clear how they intend to monitize
23:58livingstonif they are going to start routing messages texts whatever that costs them something, so I was just wondering how they planed to even recoup that? unless the whatapp app has a high enough cost
23:59ibdknox$0.99 doesn't seem like enough to cover a user over the lifetime of use