#clojure logs

2011-10-28

01:06hiredmanthe lack of unsigned values in java makes my head hurt some times
02:05daakuwhat is the right way to reference a third party library in a macro in my library intended for use by yet another party?
02:06daakui had a :use X :only a directive which failed, i'm thinking a fully qualified require is the right way?
02:08cemerickdaaku: your macro emits code that is evaluated in the user's namespace; how you set up your namespace's requires/uses has no impact.
02:09cemerickThe failsafe way is to use fully-qualified references to the third-party library's functions/macros.
02:09daakucemerick: ah, i see. do fully qualified names not need :use or :require directives?
02:11cemerickThey only require that the namespace in question has been loaded. You can :require it in your namespace to be sure of that, but that :require has no impact on how the code your macro(s) emit is evaluated.
02:11daakucool, got it. thanks!
02:11cemericknp :-)
02:17amalloyusing ` is a shorthand for fully-qualifying things anyway
02:18ibdknoxand we all like to use shorthand :D
02:18amalloy&(require '[clojure.string :as str])
02:18lazybotjava.lang.ClassNotFoundException: clojure.string
02:18amalloyRaynes: ^? seriously?
02:18amalloy,(require '[clojure.string :as str])
02:18RaynesI don't know anything about that.
02:18clojurebotnil
02:19amalloy,`str/join
02:19clojurebotclojure.string/join
02:21ibdknoxhow would clojure.string be missing?
02:21ibdknoxlol
02:21RaynesIt isn't. That isn't even the right error.
02:21cemerickamalloy: I (perhaps wrongly) assumed that daaku wasn't using `.
02:21cemerick*shrug*
02:22amalloycemerick: he probably wasn't. i just want him to use (`foo whatever) instead of ('otherns.third-party.tool/foo whatever)
02:22daakui'm also learning clojure.test, so i'll see how it breaks soon :)
03:04bobnodeshi
03:05bobnodesI get the following error when using sandbar's wrap-stateful-session
03:05bobnodes"java.lang.IllegalStateException: Can't dynamically bind non-dynamic var: sandbar.stateful-session/sandbar-session"
03:05bobnodesideas anyone?
03:11mrh0057bobnodes: what version of clojure are you using
03:11bobnodes1.3.0
03:12mrh0057bobnodes: ring doesn't support 1.3.0
03:12bobnodeshaha no way
03:12mrh0057use 1.2.1
03:12bobnodesthat explains that then
03:13bobnodesthanks mrh0057
03:33amalloyring doesn't support 1.3? that would sorta surprise me - perhaps it's just sandbar that doesn't?
03:34amalloy(or, more likely still, the particular version of sandbar or ring that you're depending on)
03:35amalloyhuh. well, apparently it's ring. who knew? it looks like ring has a clojure13 branch, but i don't know how developed it is
03:36pyrring works fine with 1.3
03:36pyrI'm using ring and clout on a 1.3 project
03:36pyrno pb whatsoever
03:40bobnodesI'm using sandbar 0.4.0-SNAPSHOT
03:43bobnodesno-one here is using sandbar with clojure 1.3?
03:49bobnodesno sandbar users here?
03:57bobnodessigh
04:30rmrfchikanyone uses vimclojure? where I can find vimclojure.jar for nailgun server?
04:39ibdknoxRing definitely works with 1.3
04:45ibdknoxrmrfchik: https://github.com/ibdknox/lein-nailgun
04:58rmrfchikibdknox: something went wrong. "Exception in thread "main" org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository"
04:58rmrfchikshoul I add something to maven?
05:00ibdknoxwhat were you doing that caused that?
05:19lucianhas anyone tried batmanjs on phonegap? there are some caveats in the project's .html about file://
05:41bobnodesany way of having lein-ring start a REPL as well?
06:34algalHi, quick newbie question on preferred setup on OS X: is it sensible to install leiningen from macports? or better just to install it directly?
06:35algalI find macports usually makes stuff easier, but sometimes not when the "stuff" effectively includes its own distro system.
06:39walterYou could try this: http://www.unschooled.org/2011/10/how-to-setup-emacs-for-clojure-on-mac-os-x-lion/
06:42algalwalter: thanks. But I'd rather steer clear of homebrew. I've already got the basics up and running (Aquamacs + SLIME + macports/leingen + swank-clojure), but I'm starting to need to make changes to things and I'm trying to make sure my current setup is a recipe for pain down the road...
06:43ejacksonalgal: just install in straight, its easy and the preferred method
06:44algalFor instance, I'm noticing that the plain vanilla REPL leon offers doesn't include contribs in the class path. What's the "correct" way to fix this? I'm a bit leery of modifying the swank-clojure shell script that was setup by leiningen itself.
06:44algalejackson: thx
06:47algal(meaning, the script in ~/.lein/bin/swank-clojure )
06:52ejacksonalgal: you need to include any libraries in your project.clj, the contrib stuff should be there by default though
06:52ejacksonno i'm lying, include it in your project.clj, sorry.
06:54algalThe swank-clojure project.clj ( https://github.com/technomancy/swank-clojure/blob/1.3.x/project.clj ) doesn't seem to explicitly include contrib stuff. Is it including it implicitly in some way I'm not seeing?
06:54algalI think the effect of this is that, on the plain-vanilla REPL it offers, I can't do (require '(clojure contrib trace)) . But I'm new to the system so I'm still wrapping my head around how namespaces, class path, defproject, etc., interact with each other...
06:55ejacksonyeah, ok your mental model is off
06:55ejacksonyou need to create a project in which you work. you describe the dependencies you need in your project.clj file (such as contrib, say)
06:55ejacksonin the directory you run lein deps to grab the deps
06:56ejacksonthen run lein repl and it will load you up a repl with your deps classpathed in
06:57ejacksonso heres an example of a really small project: https://github.com/Raynes/hobbit
06:57ejacksonyou'll see the deps are in its, no leiningen's, project.clj
06:59algalejackson: hmm, okay. But what happens when I run "lein swank" to get a default REPL from emacs, or just run "lein repl" from a directory without a project.clj file ? Both those also give me a REPL, presumably with some kind of "default" config. Is there way to tweak that default configuration?
06:59algalOr maybe the lesson is, always always always work within a leiningen-created project, because otherwise the dependency management is too painful -- even for just a quick hack. ?
07:00ejacksonexactly
07:00ejacksonyou'll very soon want more than clojure itself
07:01algalBut I can't ask for more easily once I'm already up and running? For instance, let's say I did "lein repl" in a plain directly. Now I've got my REPL. But I can't require contrib stuff because the contrib jar isn't in the classpath. Is there a straightforward and blessed way to add it to the CLASSPATH from in the REPL and just get on with things?
07:02algalOr is it strongly preferred/required to declare all your dependencies before you start your REPL?
07:02ejacksonit is strongly preferred, the whole classpath thing is a real PITA
07:03ejacksoni think there is dark magic to fiddle the classpath in a running JVM, but its not something you want to be doing AFAIK
07:03joshnzCan you set a environment variable? Is there a CLASSPATH (i think)...? Then (require....) as needed? You can do this with the Ruby REPL.
07:03ejacksoncertainly not during your first steps of learnig it
07:03algalOkay. Good to know....
07:04ejacksonjoshnz: the JVM is not as flexible in this regard, again, AFAIK
07:04algalI've been mostly doing Common Lisp, where you just (load …) whatever you need once you're up.
07:04lnostdali see there's a few json libs out there .. is this https://github.com/dakrone/cheshire what people use now?
07:05ejacksonyeah, its a total PITA, which is why lein and cake exist !
07:06semperosI have a function that, for one of its params, takes a list of functions
07:06kzarlnostdal: I used clojure.data.json last time
07:06semperosthe function does one thing if all of the functions in that list evaluate to true
07:06semperosand another if any one of them is false
07:06algalHmmm.. Just stumbled into clojure.core/add-classpath, but it's marked deprecated.
07:07semperoswhat is the best way to structure that logic in Clojure, such that I evaluate the minimum number of functions to discover whether there is a false value in the list and "change course" in the program logic?
07:07semperosthoughts?
07:07kzarsemperos: use and I suppose
07:08kzarsemperos: (and true true false (print "hello"))
07:08ejackson,(doc while)
07:08clojurebot"([test & body]); Repeatedly executes body while test expression is true. Presumes some side-effect will cause test to become false/nil. Returns nil"
07:09ejacksonnot what I thought it was
07:09semperoskzar: the list is not fixed, and `and` as a macro doesn't allow `apply` type logic
07:09ejackson,(doc take-while)
07:09clojurebot"([pred coll]); Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects."
07:10kzarejackson: Oh, right (take-while identity stuff)
07:10ejacksonyup
07:11lnostdalok, kzar
07:12semperosis the take-while comment directed by way?
07:15ejacksoni don't understand ?
07:17algalfor this following along at home on the mystery of add-classpath, it seems like it was deprecated b/c it didn't work in the presence of OSGi and nontrivial class loaders. Someone is trying to replace it with something that does work: https://github.com/cemerick/pomegranate
07:17timvisheranyone know where swank/slime redirects their stdout?
07:17timvisheras in what buffer?
07:18timvisherI'm trying to see logging information from tools.logging and I can't find it anywhere
07:18timvisherbut when I run `lein repl` from a shell, I get the log output nicely inline in the console
07:19timvisherThe config I'm using is here https://github.com/timvisher/tools.logging-testing
07:20raektimvisher: if you use clojure-jack-in it will appear _at the top of_ the *swank* buffer (before the slime.el text)
07:20raekif you use lein swank, it will appear in the terminal you ran the lein swank command in
07:21timvisheri generally use jack-in
07:21timvisheri was expecting it, thus, to show up in *swank*, but it doesn't appear to
07:22timvishernor in *slime-events*
07:22timvishernor in *SLIME Compilation*
07:22ejacksonraek: at the top !
07:25timvisheroh gosh
07:25timvisherraek: sorry I didn't notice that first line
07:25timvisherlol
07:25timvishernow I feel like an idiot. :)
07:26timvisherwell that is confusing
07:28timvisherso now that I've got this figured out, how might i, without changing any code, log the inputs and outputs of all function calls?
07:28timvishersomething like defadvice in emacs
07:28timvisheror aop?
07:28clgvtimvisher: robert.hooke might help you
07:30timvishershucks, that technomancy kid's so friggin smart... :)
07:30timvisherthanks for the pointer, that looks like exactly what I want
07:32ejacksontimvisher: share some thanks for the man and get a shirt! http://www.cafepress.com/technomancy?utm_medium=cp_social&utm_source=addthis&utm_campaign=CafepressShop#.TqoexsC5DuE.twitter
07:33timvisherWoah! _and_ he's enterprising!
07:33mbachas anyone written a clojure web framework that uses CPS for to provide http statefulness
07:33timvisheri may have to get me thath mug
07:33mbaca la weblocks for common lisp?
07:38timvisheris there any way to attach a repl to a running `lein ring server`?
07:57semperosdrawing a blank...is there an "all" equivalent of `some`, such that it makes sure all elements of a list return true for a given predicate?
08:01tordmor(not (some (complement pred) coll))
08:02semperosthat makes sense (and is what I coded), but was just trying to remember if a specific core fn already existed...
08:10terom(doc every?)
08:10clojurebot"([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
08:14semperosterom: thanks
08:45fdaoudpersistence
09:01edwWith semantic versioning, is 1.0.0-SNAPSHOT "headed toward 1.0" and therefore possibly in flux with respect to API, etc? I'm tryin' to Do The Right Thing here...
09:05moogatronicedw: That is how we did it in the java shop I worked in (maven/pom). I don't know if SNAPSHOT necessarily carries any implications with API flux by definition though.
09:07moogatronicThe SNAPSHOT in maven is just indicating that there could be (1..n) releases / builds of the current version until the release happens, since you're in development mode.
09:09cemerickedw: SNAPSHOT doesn't carry any specific semantics about the scope of changes.
09:09cemerickit just means HEAD
09:11edwcemerick: So if I have 1.3.2 out there and I've got a branch with backwards incompatble changes checked it, it would be a decent idea to tag it as let's say 2.0.0-SNAPSHOT?
09:12edws/checked it/checked in/
09:12cemericks/tag/version
09:12cemerickyes
09:12edwCool. Thank you.
09:13fdaoudcemerick: your book has been delayed another month! argh!
09:14cemerickoh?
09:14cemerickfdaoud: I have no idea how those projections are generated in the first place :-)
09:14cemerickWe'll be done with it this month, FWIW.
09:15edwmoogatronic: Thanks too! Was AFK; didn't see your comments.
09:16moogatronicedw: no problem. =)
09:41fdaoudcemerick: I think it's 2-3 months after the authors are done. copyediting, typesetting, indexing, and production.
09:42cemerickfdaoud: I've been told 4-6 weeks. *shrug*
09:42cemerickWe'll see how good O'Reilly is, I guess. :-P
09:42edwI have yet to figure out a command for shutting down a REPL in SLIME that doesn't require I go manually kill buffers in order to have M-x clojure-jack-in work in Emacs. Is there a secret "obliterate all SLIME state" command?
09:42fdaoudcemerick: do you guys do the indexing?
09:42cemericknope
09:42edw(I've tried ,sayonara ,quit and ,close)
09:43cemerickIsn't indexing an automated process these days?
09:43fdaoudcemerick: indexing, yes. indexing worth something, no.
09:44cemerickThat's interesting.
09:44jcromartiehow to know your software project is bloated: when the Git change summary for a branch that adds a single dropdown to a single web form is "35 files changed, 702 insertions(+), 437 deletions(-)"
09:44mdeboardHa.
09:46cemerickfdaoud: I would have thought some n-gram analysis would get you 90% of the way there.
09:47fdaoudcemerick: sure, professional indexers must have tools to do a lot of the grunt work, but it's definitely a wholly automated process.
09:47fdaoud*definitely not
09:47fdaoudat some point at manning authors had to produce the index. not sure if that's still the case.
09:48cemerickouch
09:48cemerickThat may have been enough to keep me from doing the book! :-P
09:49cemerickEspecially since I wouldn't have the tools to do the grunt work.
09:49fdaoudyeah. to me that's a service the publisher must provide.
09:51kzarcemerick: I was just scrolling through the history to see what I missed and I wondered, what's the book about?
09:51cemerickkzar: http://oreilly.com/catalog/0636920013754/
09:52kzarWhen it's done will there be a version for Kindle?
09:53cemerickShould be, yeah.
09:54kzarCool I'll wait for that then
09:55jcromartieI'd imagine you could build an index from metadata added to the text itself
09:55jcromartieby basically annotating words you want in the index, kind of like WikiLinks or something
09:56cemerickoh, the pain ;-)
10:00fdaoudjcromartie: yes, but you would have to do it as you write, so that you don't have to do it all at the end. that's painful and wasteful because you constantly add/edit/remove material. or you could do it all at the end so you don't waste your time. more pain.
10:01fdaoudit's all bad :(
10:03theignoratiis there a function like time that doesn't print the result but returns it as well as the result of the expression?
10:03jweissany suggestion for navigating a tree structure in a ref? zippers are no good cuz they are not multithreaded. i am currently trying update-in style paths, since my trees just edit nodes, don't add/remove any, but this seems fragile
10:04theignoratior should I just copy the time macro and modify it
10:05andrewcleggtheignorati: http://pastie.org/2773296
10:05andrewcleggI happened to write my own just yesterday :-)
10:06andrewclegguse it like: (timed + 2 3)
10:06andrewclegggives [5 <time_in_milliseconds>]
10:08theignoratithanks!
10:11andrewcleggtheignorati: btw that catches and *returns* the exception as I wanted to count how many exceptions I got (and how long they took)
10:11andrewcleggyou may want to do something less crazy, like just letting them bubble thru
10:22gtrakdoes cliff click's final fields stuff apply to clojure?
10:23gtrakthe optimizations he mentions in last couple of blog posts
10:30gtrakhttp://www.azulsystems.com/blog/cliff/2011-10-27-final-fields-part-2
10:36Fossigtrak: how would that apply or not?
10:36gtrakFossi, well, I know we use final fields all over the place, but the other condition is to have accesses be deeply nested and available for inlining
10:37gtrakI feel like it should apply, I just don't know enough to say definitively
10:38Fossiyou mean whether an optimization would do anything performancewise?
10:38gtrakyes
10:38gtrakapparently it would for jruby
10:41Fossiah, ok
10:46cemerickandrewclegg, theignorati: you might want to prefer criterium (by hugod) instead: https://github.com/hugoduncan/criterium/
10:47theignoratiyes I saw that but that's like for testing how fast things are and comparing them?
10:48andrewcleggcemerick: I was actually testing the performance of a remote thrift service, so in my case, all the subtle things to do with my jvm's performance were probably unnecessary :-)
10:48theignoratiI want this so I can add it to my Compojure app and log how fast things are
10:48theignoratithen look at pretty graphs all day
10:58patchworkanyone here use sandbar? looks like it recently stopped being maintained.
10:58patchworkis there a canonical fork yet?
10:58patchworkI just found out that it was the reason clojure.contrib.jar was getting added to my project
11:08patchworkSo, I am getting to the point where I may have to switch from 1.3 back to 1.2
11:08patchworkI feel like I am fighting a losing battle here
11:13patchworkis that where everyone is at? have we abandoned 1.3?
11:14gtrakpatchwork, have people abandoned python 3?
11:15patchworkgtrak: I think they have. I know a lot of people who use python, and no one uses python 3
11:17patchworkThe problem is a transition like this takes the coordination of everyone, which inevitably fails because we are all so widely distributed and disagree etc.
11:17gtrakit just takes a little time i think
11:17patchworkI think python 3 is the perfect example
11:17patchworkthere comes a point when I have to balance idealism with getting work done
11:18gtrakwell, people are going to scratch their own itches, it might not be that hard to port sandbar over
11:20gtrakseeing as you have an itch :-)
11:22patchworkgtrak: that is reasonable, and that is what I am going to do today. it is frustrating because I have a lot of other things that need to get done on my own project. It is getting tiresome that whenever I want to use a library I have to spend time to figure out how to extract contrib, test it, debug it, post it as an alternative on clojars etc etc. it takes a lot of time I should be spending on what I'm getting paid to do.
11:23gtrakperhaps the sandbar google group might have something to say about it? I know, this is kinda the rub with open source
11:23patchworkgtrak: that is why the temptation to just revert to 1.2 and quit fighting it grows stronger
11:24gtrakyea, the clojure contrib split is probably more of a pain than 1.3
11:24gtrakhas no one ported old contrib to 1.3?
11:24patchworkgtrak: as I understand no one is going to
11:24patchworkthe idea is to let each library continue on its own, so that they don't have to coordinate releases etc
11:25patchworkcontrib as a whole moved way slower than any of its subprojects
11:25RaynesIIRC, there is an unofficial old-contrib compiled against 1.3.
11:25patchworkwhich is the reason for the splitup in the first place
11:25RaynesBut please, for the love of God, don't use it.
11:25patchworkRaynes: exactly, that would just exacerbate the problem
11:26patchworkThat is the deal, I believe in the split, monolithic contrib was/is a problem
11:26gtrakmaybe we just need a script to munge the source of stuff using contrib 1.2 to the new libs
11:26gtrakhow hard would that be?
11:26patchworkgtrak: It is not that easy. going through sandbar there are a number of different contrib libraries with specific functionality that themselves have not been ported to 1.3
11:26RaynesExtremely.
11:27patchworkso updating one library ends up being a task of updating a whole tree of libraries
11:27gtrakugh
11:27patchworkor figuring out how to replicate the functionality without the library
11:27patchworkwhich takes debugging, deep understanding of what it is doing there in the first place
11:27patchworketc etc
11:28gtrakyea, looks like sandbar is a few thousand lines
11:28patchworkI think I am talking myself into reverting to 1.2, I just don't want to give up on the dream
11:28patchworkLike, if I revert, then I am becoming part of the problem
11:28gtraknoir has some of that functionality too, doesn't it?
11:29TimMcAre there any major libraries that maintain both 1.2 and 1.3 versions?
11:29patchworkbut if I stay, I am taking on the charge of updating the entire clojure ecosystem
11:29TimMcI suppose you could use separate git branches...
11:29dnolenTimMc: core.match supports 1.2, 1.3 and ClojureScript. core.logic supports 1.2 and 1.3
11:29patchworkgtrak: I have not heard of noir
11:29dnolenbut I also didn't wait around to try out 1.3
11:29TimMcdnolen: How do you manage it?
11:30RaynesIt isn't really that hard to write Clojure than runs on both 1.2 an 1.3.
11:30patchworkTimMc: most libraries that are being maintained have both 1.2 and 1.3 support
11:30gtrakpatchwork, http://webnoir.org/autodoc/1.2.0/index.html
11:30cemerickTimMc: nREPL supports 1.1, 1.2, and 1.3; same for clutch
11:30patchworkRaynes: I agree, really it is using contrib that is the problem
11:30cemerickHrm, sorry, clutch is 1.2+
11:31TimMcRaynes: My question is how the sausage gets made. Separate git branches? Automatic conversion scripts that munge headers and cut releases?
11:31patchworkTimMc: I have seen people use lein multi-deps
11:31cemerickThat's just for testing
11:31cemerickIt doesn't take much to make the same source files compatible with both.
11:32patchworkcemerick: Ah I see
11:32cemericki.e. no sausage :-)
11:32patchworkcemerick: Yeah, the language itself really only has the ^:dynamic issue
11:32patchworkthe big problem is all the requiring of contrib that happens
11:32cemericksome old contrib libraries are 1.3-safe
11:33cemerickit's a big hairball to pull in, but it's not like the whole thing is marred.
11:33patchworkcemerick: sure, but you still have to make the change
11:33cemerickWhat change?
11:33patchworktrack down where the new library is (since it's not in contrib)
11:33bsod1how can I use clojure 1.3 with counterclockwise?
11:34patchworkchange the require from 'clojure.contrib.* to whatever it is now
11:34cemerickclutch still just depends upon contrib 1.2.0; it just happens to use 1.3-safe namespaces
11:34TimMcpatchwork: Was just referring to contrib deps, not language features.
11:34cemerick(a situation we'll be eliminating eventually, but it's not a huge priority)
11:34patchwork: (
11:36cemerickheh
11:36dnolenTimMc: I realized early on never to use anything from contrib. I rarely used binding. So supporting 1.2 and 1.3 was easy
11:36cemerickthe most significant dependency is the http agent stuff, which has no immediate corollary
11:36llasram`OOC, why is `add-classpath' deprecated (and not seem to work at all in 1.3)?
11:36dnolensupporting ClojureScript is easy if you're library is macro-centric.
11:37dnolenllasram`: because it's too hard to get working everywhere and noone has owned it.
11:38cemerickllasram`: it's very limited, and not generalized. Maybe try https://github.com/cemerick/pomegranate
11:38llasram`cemerick: Heh. I was actually just trying to get that working :-). The finding-and-pulling dependencies works fine, but nothing seems to be actually getting added to the classpath
11:39cemerickllasram`: by all means, file a bug, especially if you have a repeatable testcase
11:39cemerickI'd very much like to get pomegranate working well.
11:39llasram`cemerick: Oh, is it supposed to work under 1.3?
11:40llasram`I was assuming that whatever broke core/add-classpath for 1.3 was doing the same for pomegranate
11:40cemerickYes, pomegranate should work under 1.2 and 1.3
11:41llasram`Ok, cool. I'll make sure I don't have anything funky in my environment
11:41cemerickNah, I'm sure it's just a bug — or perhaps some characteristic of your environment that's getting in the way? In any case, definitely file a bug, esp. if you think you have a repeatable testcase.
11:44TimMcdnolen: I see, thanks.
11:47llasram`That is weird... lein project with just clojure 1.3 and pomegranate as deps. Works fine from 'lein repl', but under swank the effect is as if the add-classpath silently fails
11:47jamiltrondnolen: I know you have some experience with OpenGL + Clojure. I've been toying around with LWJGL and I've been getting some pretty choppy display. Did you ever find a similar issue?
11:48dnolenjamiltron: hmm I never messed w/ it much, only in the context of Penumbra. I don't recall choppy display issues.
11:48dnolenjamiltron: since that involves a lot of interop calls, probably a good idea to have reflection warnings on.
11:49jamiltrondnolen: I noticed that penumbra's tests often have choppy display too. And I've ran the tests on three different machines.
11:49jamiltrondnolen: good idea
11:49dnolenjamiltron: huh, what OS ?
11:50jamiltrondnolen: OSX, Arch Linux x64, and Windows 7 x64
11:50dnolenI would sometimes see choppiness as the JVM gets warmed up, but that would get smoothed out.
11:50jamiltronPretty much everything I could get my hands on
11:50dnolenjamiltron: yeah I ran them on OS X, asteroids, tetris, pong were all pretty smooth.
11:51jamiltronHuh, that's interesting.
11:51dnolenjamiltron: http://ideolalia.com/creating-a-simple-game-in-clojure
11:52dnolenit was always as smooth as the linked video.
11:52jamiltrondnolen: are you running it via lein?
11:52dnolenjamiltron: I would run via swank
11:53dnolenjamiltron: I'm assuming you're running the JVM w/ a good chunk of memory in server mode.
11:55jamiltrondnolen: I actually have a poor understanding of the jvm, so I should look into that :P
11:57dnolenjamiltron: that's probably it. JVM starts off with very little memory, you'll start GC'ing all the time. server mode is important, you won't get all the crazy optimizations w/o it.
11:58jamiltrondnolen: Are there any good articles or tutorials on running the jvm in server mode? I'm pretty green regarding all this stuff.
12:04ziltiAre there some kind of "access modifiers" for clojure functions?
12:05clgvjamiltron: java -server .... ;)
12:06clgv"Select the Java HotSpot Server VM. On a 64-bit capable jdk only the Java Hotspot Server VM is supported so the -server option is implicit."
12:07dnolenjamiltron: http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Ftprf_tunejvm.html
12:07dnolenjamiltron: the important thing is -server and the memory options
12:07jamiltrondnolen: thank you!
12:10cemerickIs there any justifiable use of aset-XXX rather than just using aset (along with an appropriate hint on the array in question)?
12:11cemerickllasram`: hrm, swank may be causing an issue there…
12:11mabesis this the best reference documentation about 1.3's new primitive support? http://dev.clojure.org/display/doc/Documentation+for+1.3+Numerics
12:12mabesit doesn't talk about primitives in collections which is what I'm curious about
12:12cemerickThere is a primitives-bearing vector implementation (see vector-of)
12:13cemerickBeyond that, values in collections remain boxed.
12:13mabesoh, I guess I got the wrong impression by following a recent thread on the list
12:15cemerickright, aset-XXX works with multidimensional arrays
12:20mabescemerick: thanks for the vector-of tip
12:20dnolencemerick: there's no reason to use aset-XXX ever, it does not inline - I think its there purely for higher order usage.
12:23mabesso, if you wanted to sum a collection of primitives you can't use reduce... you have to write a loop, correct?
12:23dnolenmabes: areduce
12:23cemerickmabes: see areduce
12:23cemerickheh
12:24cemerickdnolen: but this:
12:24cemerick,(aset ^ints (make-array Integer/TYPE 5 5 5) 1 1 1 (int 5))
12:24clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: argument type mismatch>
12:24cemerick,(aset-int (make-array Integer/TYPE 3 4 5) 1 1 1 (int 5))
12:24clojurebot5
12:25cemerickThe latter's value is getting boxed anyway, but at least it's not an error. Not sure if that's a good or bad thing.
12:26dnolencemerick: look at the implementation of aset, it supports setting multi dim arrays as well, don't have time to look into why your code isn't working at the moment.
12:28cemerickright, this works:
12:28cemerick,(aset (make-array Integer/TYPE 5 5 5) 1 1 1 (Integer. 5))
12:28clojurebot5
12:28mbacwhen i seq "1000" it becomes (\1 \0 \0 \0)
12:28mbacwhat is that representation?
12:28cemerickmultidim aset goes through apply,
12:28mbacand how do i make it a string again?
12:28cemerick(class \c)
12:28cemerick,(class \c)
12:28clojurebotjava.lang.Character
12:29cemerick(apply str (seq "foo"))
12:32Raynesmbac: That would be a sequence of characters.
12:32jamiltrondnolen: Thanks for all your help. I don't have my issue fixed yet but I think I'm getting closer.
13:00ejacksonwhat is the accepted way to extend a protocol to clojure.lang.PersistentHashMap and clojure.lang.PersistentArrayMap with the same code ?
13:01jcromartieejackson: can you implement it on a shared superclass
13:01jcromartie?
13:02ejacksonyeah, why not... suggestions ?
13:05ejacksoni guess that's lazy... I'll go look it up *sheepish*
13:05cemerickejackson: IPersistentMap
13:06ejacksoncemerick: you are a superhero ! I'm bringing you a cape at the conj... Thanks.
13:06cemerick:-)
13:06ejacksoncemerick: btw - were you also thinking of Bayesian nets during Sussman's talk ?
13:07cemerickA union jack as a cape would be not bad :-P
13:07ejacksonseemed like a node that stored a distribution and updated it on upon new distributions on its inputs would hack it.
13:08cemerickejackson: Some. I was already very familiar with Radul's work on propagators that he dug into some, so I had that in mind as well.
13:08ejacksonlol. No no, we don't have supreheroes here, "overly keen".
13:08cemerickThe thing about biological systems is that there's lots of scale-specific processing, vision being the canoncial example.
13:09technomancyejackson: what about Angle Grinder Man?
13:09ejacksonOK, the propogators was new to me, so I was tacking backwards.
13:09technomancyhttp://www.google.com/images?q=angle%20grinder%20man&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;sa=X&amp;oi=image_result_group
13:09ejacksontechnomancy: LOL !
13:09jcromartiethe fact that you can extend an interface with a protocol implementation is really brilliant
13:10cemerickAt least in my naive conceptualization of bayesian nets, getting to a point where you have different "granularities" present in the network and the JPDs doesn't seem obvious.
13:10cemerickejackson: ^
13:10cemerickfeature-isa-feature-isa-feature, etc.
13:11ejacksoncemerick: yeah, I've not thought about scale either.
13:11cemericke.g. http://en.wikipedia.org/wiki/Neocognitron
13:13ejacksoninteresting. I see almost everything in the hierarchical model way, and then just try figure out marginals. Haven't thought of less directed or scaled things.
13:15ejacksonbut the notion of updating distributions in response to fresh data and propogating that all about the place is a natural fit
13:32cemerickejackson: I agree. Once I get my feet under me a bit more, I'd like to start experimenting with hybrid networks; interop between bayesian + e.g. core.logic + declarative propagator-style bits.
13:33ejacksoncemerick: yeah, I hate to invoke Dementors, but the probability monad really seemed to be useful for that sort of thinking.
13:33cemerick*probably* just a pipe dream until I level up quite a lot, but oh well.
13:33ejacksonnaaaaah
13:33cemerickDementors?
13:33cemericksome harry potter thing?
13:34ejacksoni'm not going to ask
13:35Raynescemerick: You don't know what you're missing. Not sure I'd have survived a life without every flavor beans.
13:35ejacksonfor the record, dementors are nasty bits of spectral horror that suck the joy out of everything
13:35cemerickejackson: I can (and have) hacked around with bayesian networks and such, but I'm still lacking in the formalisms — and that's where such things meet.
13:35ejacksoni'm always stunned to read tutorials like "monads are like x", when x is clearly Dementors, in all cases.
13:35ejacksonor should be, but never is.
13:35pjstadigtechnomancy: with your talk recently about Dune, did you see this? http://twitter.com/#!/msimoni/status/129916820076503040
13:35redingerFunny, I googled Dementor and Bayes and found http://www.fanfiction.net/s/5782108/45/Harry_Potter_and_the_Methods_of_Rationality. I was trying to figure out what you were referring to :)
13:36cemerickRaynes: My first impression that it was a kiddie LoTR, so I didn't bother.
13:36Raynescemerick: Admittedly, the first few are cheesy and kiddish, but I get the sense that it was done on purpose because they *were* kids. Things and people grow up significantly in the later books/movies.
13:37RaynesAs a whole the series is good.
13:37ejacksoncemerick: the secret (don't tell) is that everybody is lacking in this background, there's just so much, and it all written in different formalisms.
13:37cemerickhah!
13:37cemerickMakes me sad for the world.
13:40mdeboardDo any of the bots have github support?
13:40blooperwhat are people here's thoughts on Clojure's performance in the language benchmark shootout thing? (http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&amp;lang=clojure&amp;lang2=java)
13:41hugodcemerick: the stanford ai-class is covering bayesian network theory
13:42cemerickredinger: Whoa, that has ~70 chapters!
13:42cemerickNot quite sure what to make of it.
13:42redingerFan Fic :)
13:42cemerickhugod: I heard!
13:42cemerickThat means that everyone at the conj is going to own my ass when I give my talk :-P
13:43ejacksoncemerick: I really doubt that
13:43ejacksonhave I recommended this http://www.amazon.co.uk/Probabilistic-Graphical-Models-Principles-Computation/dp/0262013193/ref=sr_1_1?ie=UTF8&amp;qid=1319823371&amp;sr=8-1 ?
13:43chewbrancaharry potter and the methods of rationality was a surprisingly good read
13:44chewbrancaI stay away from fan fiction, but checked it out after seeing it top HN 3 times
13:44hugodcemerick: it was poorly explained - I think that particular lesson will be responsible for a huge drop out rate
13:44ejacksonits solid, but I keep failing to get into it.
13:44cemerickejackson: I opted for this instead: http://www.amazon.com/Modeling-Reasoning-Bayesian-Networks-Darwiche/dp/0521884381/ref=pd_luc_sbs_02_01_t_lh#reader_0521884381
13:44cemerickOf course, in addition to the Pearl and such.
13:45ejacksonso many books, so little few hours
13:47cemerickejackson: The Darwiche outline was somewhat more compelling, IMO. Covers various topics that Killer doesn't (including compilation to circuits, which I'm particularly interested in).
13:47ejacksonredinger: LOL, I was just making it up, how funny.
13:48cemerickAlso, Darwiche is at UCLA; I took the proximity to Pearl as a positive signal.
13:48ejacksoncemerick: circuits, yes, the other thing Sussman kept invoking for me were FPGAs
13:49cemerickwell, bayes net -> circuit -> clojure code is my roadmap :-)
13:49technomancypjstadig: niiiice
13:50ejacksongotta hop. Its Friday in England, I have sausages and ale to find.
13:50ejacksoncheers all
13:50dnolencemerick: http://okmij.org/ftp/kakuritu/index.html is pretty fascinating, mixing logic programming with probabilistic programming.
13:51technomancysausages and ale... I should go to England.
13:54gtrakhugod, are you also taking the ml class? I think I'm going to pull back on the AI one
13:55mdeboardgtrak: why's that?
13:55gtrakalso working a full-time job and having a social life :-)
13:55mdeboardah
13:55gtrakthe ml class programming assignments seems like it'll be more fun, and there's some overlap
13:56hugodgtrak: I am, and it is a lot less demanding than the ai class
13:57gtrakyea
13:57hugodluckily I have seen most of the maths before
13:57gtraki've done some statistics, but it was a long time ago
13:59mdeboard,(+ 1 2)
13:59clojurebot3
13:59mdeboardwake up clojurebot
14:00gtrak4
14:01mdeboard,commits
14:01clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: commits in this context, compiling:(NO_SOURCE_PATH:0)>
14:02mdeboard,commits mattdeboard/saved-search
14:02clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: commits in this context, compiling:(NO_SOURCE_PATH:0)>
14:02mdeboardHm
14:25sridso ... (range) can't be used with *only* a "start" argument?
14:26srid,(take 5 (drop 3 (range)))
14:26clojurebot(3 4 5 6 7)
14:26sridno better way?
14:29gtrakwhoa, ([] (range 0 Double/POSITIVE_INFINITY 1))
14:32llasram`To POSITIVE_INFINITY and... no further!
14:34gtrakit's bugged
14:34gtrak,(range Double/POSITIVE_INFINITY (- Double/POSITIVE_INFINITY 1))
14:34clojurebot()
14:36Raynessrid: ##(take 5 (iterate inc 5))
14:36lazybot⇒ (5 6 7 8 9)
14:36RaynesThat's essentially range with only a start value.
14:42gtrak,(+ 5 (range 5))
14:43clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.Number>
14:43theignoratihow would I get the first part of an expression in a macro, like (first `(println "hello")) ?
14:44jcromartietheignorati: can you restate the question?
14:44gtrak,(map (partial + 5) (range 5))
14:44clojurebot(5 6 7 8 9)
14:47theignoratiheh
14:48theignoratihow would a macro look that does this: (ma (println "foo")) => (handle-name "clojure.core/println") (println "foo")
14:50stuartsierra,(resolve 'println)
14:50clojurebot#'clojure.core/println
14:50stuartsierra,(name (resolve 'println))
14:50clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.Named>
14:51stuartsierra,(let [m ((resolve 'println))] (str (name (:namespace m)) "/" (name (:name m)))
14:51clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
14:51stuartsierra,(let [m ((resolve 'println))] (str (name (:namespace m)) "/" (name (:name m))))
14:51clojurebot#<NullPointerException java.lang.NullPointerException>
14:51stuartsierraeh whatever
14:51hiredman.sym and .ns
14:52stuartsierrathat's cheating
14:52hiredmanthats all there is
14:52stuartsierra(meta (resolve 'println))
14:52stuartsierra,(meta (resolve 'println))
14:52clojurebot{:ns #<Namespace clojure.core>, :name println, :arglists ([& more]), :added "1.0", :static true, ...}
14:52technomancyyeah, it always struck me as a bit funny that namespaces aren't named
14:52theignoratidoesn't have to be the full name, I just don't get how to get it at all in a macro
14:53stuartsierra(defmacro foo [form] `(do (something-with ~(first form)) ~form))
14:54theignoraticheers
14:54cemericknamespaces could use some sprucing up in general
14:55stuartsierraThere's always tension there: adding more stuff for interactive development, removing stuff for leaner/faster production code.
14:57cemerickSure.
14:57technomancybut I can understand reluctance to add flags for things like that
14:57cemerickI'm sure I'll agitate in that direction eventually
14:58cemerickI'd really like to see namespaces become ARefs, not just AReferences.
14:59theignoratiis there a way of checking if a something supports metadata?
14:59cemerickTransactional code loading would be even better, but I'm willing to be incremental. :-)
15:10stuartsierraThe problem with transactional code loading is the same problem as Vars: every function call is a volatile read.
15:10seancorfieldsomeone just tweeted that try-clojure.org is down (nginx bad gateway error)
15:10stuartsierratheignorati: (instance? IMeta %)
15:14joegalloIMeta if you want to read it, IObj if you want to write it, iirc.
15:15jcromartietechnomancy: can functions have metadata?
15:18stuartsierrayes
15:19ibdknoxthey can't in CLJS right?
15:20stuartsierranot sure
15:20stuartsierraMost runtime stuff doesn't exist in ClojureScript.
15:20ibdknoxyeah
15:21dnolenibdknox: there's no IFn protocol, I looked at this for a bit and didn't see any obvious reason why it couldn't be supported.
15:22dnolenif there was you could just reify IMeta + IFn
15:22ibdknoxyeah
15:22ibdknoxthat would be cool
15:24moominHi, I was wondering if there's a sensible way to tell whether code is running under lein-ring.
15:25moominI've tried various tricks with hooks but I'm banging my head against a brick wall. :(
15:25dnolenibdknox: extending IFn just needs a special meaning, implement call.
15:27cemerickstuartsierra: But every addition to ns-interns/aliases/publics doesn't have to be.
15:29stuartsierraThat's the cheap part.
15:29cemerickgotta start somewhere
15:29stuartsierraNamespaces can change without changing any running code.
15:29stuartsierraBut if you really want hot code changes, you have to change root Var bindings.
15:31cemerickThat's not a problem; I can already attach watches to vars.
15:32stuartsierracemerick: So what is it you're looking for exactly?
15:32cemerickThere's some things that end up being out of band (i.e. what the prior value of #'foo's meta was, etc.), but that's good enough.
15:34cemerickstuartsierra: I want my tooling to get notified of code changes in a REPL, rather than it needing to poll.
15:34stuartsierraahh
15:34cemerick:-)
15:35mabesI'm unclear when, if ever, I should declare a fn to be static (via ^:static).. Is the static implied when I have a primitive return type hinted?
15:35mabes(I got the :static from http://www.assembla.com/wiki/show/clojure/Enhanced_Primitive_Support)
15:35stuartsierra:static is no longer used; it was only an experiment
15:35stuartsierraAssembla is deprecated, use http://dev.clojure.org/
15:35mabesokay, because it didn't seem like it made a difference
15:36cemerickThus, transactionality isn't actually important a.t.m. (though it seems like it could solve a lot of "oh, I just horked my environment because some file loaded only halfway), but being able to get watches on namespaces and their component maps is.
15:38stuartsierraHAHAHAHA
15:39cemerickstuartsierra: I was joking of course, but now that I think of it…
15:40stuartsierraWhy not put the hook in the editor, before it gets to the Clojure compiler?
15:41stuartsierraOr capture anything that returns a Var, like def/defn.
15:42cemerickoh, send each form one at a time?
15:42cemerickHrm.
15:44cemerickThis is complicated somewhat by the fact that the code loading in question is being done automatically by the eclipse builders (the framework that builds code in the background), which supports all the markup for e.g. compilation errors.
15:44stuartsierraeek
15:45ibdknoxwe just need our own IDE ;)
15:46cemerickstuartsierra: Sounds scarier than it is. It actually pushes the runtime closer to the "image" notion. All your project's code is loaded all the time, etc.
15:46stuartsierrainteresting
15:46stuartsierracemerick: By the way, how far did you get with your ClassLoader thingy?
15:46cemerickThat's how ccw is able to maintain a comprehensive namespace browser for a given project.
15:47cemerickstuartsierra: you mean this? https://github.com/cemerick/pomegranate
15:47stuartsierrayes
15:47cemerickit works :-)
15:47Raynes"(I got the :static from http://www.assembla.com/wiki/show/clojure/Enhanced_Primitive_Support)&quot;
15:47lazybotAssembla is deprecated. Use http://dev.clojure.org
15:47cemerickapparently not under swank for some reason
15:47Raynesstuartsierra: ^ There you go.
15:47Rayneslazybot automates your life. Embrace it.
15:47cemerickibdknox: Laurent has tossed around the notion of producing a Clojure-only Eclipse distribution.
15:48cemerickBuilding an editor/IDE from scratch terrifies me.
15:48ibdknoxeh
15:48ibdknoxit's not so bad ;)
15:48cemerickGiven resources, no. Handful of part-time-at-best volunteers? Eeek.
15:49Raynescemerick: I was aiming to try it out a couple of days ago. Found myself wishing there was a Clojure-only distribution. I didn't actually download Eclipse though. Couldn't bring myself to pull down 100+ megs for ccw.
15:49stuartsierracemerick: Ha, clojure-mode highlights add-classpath in red
15:49ibdknoxcemerick, yeah, it's an interesting thing to think through. I think you can steal the base editor from someone pretty easily
15:49RaynesThough, I didn't have much motivation given that I never intended to use it. Mostly just planned to look at it and smile.
15:50cemerickRaynes: emacs is 50MB, and that's before all the additional packages… 0.o
15:50Raynes(< 50 140) = true
15:50ibdknoxRaynes, are you sure?
15:50Raynes&(< 50 140)
15:50lazybot⇒ true
15:50cemerickibdknox: The question is, from who.
15:50ibdknoxwoah
15:50ibdknoxit' is
15:51ibdknox:p
15:51ibdknoxcemerick, depends on the platform we target :)
15:51Raynesibdknox: Also, I looked at Noir a few days ago. Fantastic. I'm moving try-clojure to it on my next round of revisions.
15:51RaynesIt's so magical.
15:51cemerickibdknox: orthogonal concern, no?
15:51RaynesI could have swore I saw a unicorn run through my peripheral vision.
15:52mefestoibdknox: lemme +1 that... I've been messing with it the past two days. great stuff :)
15:52ibdknoxRaynes, I've been chasing him for a while. Bastard won't stop moving.
15:52dnolenibdknox: http://dev.clojure.org/jira/browse/CLJS-96
15:52ibdknoxdnolen, thank you, sir!
15:53ibdknoxcemerick, is it really orthogonal? I was considering doing it in HTML, that would change what editor was used dramatically
15:54cemerickha
15:54ibdknoxcemerick, to be clear, not as a web app, just using a webkit view or something locally
15:54cemerickoh, ok
15:54cemerick*whew*
15:54ibdknoxhaha
15:54ibdknoxyeah.
15:54ibdknoxI'm not crazy.
15:54ibdknoxwell
15:54ibdknoxI am crazy... but not stupid. (most of the time) ;)
15:55ibdknoxthat was mostly pragmatic though, I know codemirror could do what we'd need for an editor and it's easy to hack the source to bend it to my will
15:55cemerickI dunno, I think you're shaving about the same order of magnitude of goats no matter what platform you target.
15:55ibdknoxmaybe a solid java alternative exists that's even better though
16:04tsdhHi. I'm trying to define a one-off leiningen task foo in my project. For that, I've created a file src/leiningen/foo.clj with a proper namespace declaration and a foo function. However, that function uses a class in a jar that is a dependency of the overall project and I get a ClassNotFound when running the task. How do tell leiningen to add that dep also for leiningen tasks?
16:05tsdhOr even better, only for that single leiningen task.
16:06tsdhAdding the required project to :dev-dependencies doesn't do the trick.
16:10cgrayis there documentation for the reader macros that one generally uses in defining macros?
16:11tsdhYou mean, ~, ~@, and `?
16:11RaynesSyntax quote?
16:11cgraytsdh: yeah
16:12tsdhHm, indeed http://www.clojure.org/macros doesn't contain them...
16:13Rayneshttp://clojure.org/reader
16:13gtraktsdh, could also use robert.hooke potentially, this would use your dev dependencies
16:13Raynestsdh: cgray: ^
16:13cgrayRaynes: thanks
16:16tsdhgtrak: Ok, I'll have a look at that, although I don't feel happy to add another dependency only to be able to call (SomeClass/main "--foo" "--bar") from leiningen...
16:16dnolenibdknox: clooj has some traction. would be nice to get something built off of ACE+Webkit wrapper, but that's a lot of work. Upside would be the ability to customize your IDE w/ ClojureScript.
16:16gtraktsdh, yea, i don't know why it doesn't work, it probably should
16:17gtrakbut just a suggestion
16:17ibdknoxdnolen, codemirror is a bit nicer than ACE these days, but yes
16:17ibdknoxdnolen, problem with Clooj is that it's starting completely from scratch
16:17ibdknoxdnolen, and as cemerick said, without a few truly dedicated folks, that's a monumental undertaking
16:18cgrayso i'm having a macro problem: http://pastebin.com/Hj53Q221
16:18dnolenibdknox: is codemirror based off of Ace?
16:18tsdhgtrak: Hm, the robert.hook descriptions looks like it would allow me to hook into existing lein tasks. That won't solve my problem of leiningen not adding the jar I need to the CLASSPATH of task execution.
16:18ibdknoxdnolen, different effort I believe
16:18ibdknoxdnolen, very active
16:19ibdknoxdnolen, http://codemirror.net/mode/clojure/index.html
16:19ibdknoxit does the indenting correctly and everything ;)
16:19gtrakdo some tasks use different dependencies than the dev-dependencies? obviously test uses dev-dependencies
16:20gtrakor possibly test uses regular dependencies, hmm
16:20dnolenibdknox: but didn't Ace merge Bespin which had the emacs design choices to provide many hooks for scripting? Is that the case w/ codemirror as well?
16:20cemerickibdknox: Reading stuff like that about web-based code editors is exactly why I'm skeptical of the entire endeavor ;-)
16:21technomancytsdh: dependencies that are needed by lein tasks need to be specified as dev-dependencies
16:22technomancyusing hooke should be a measure of last resort
16:22technomancytsdh: if you need access to regular dependencies you have to use eval-in-project
16:22dnolencemerick: given the state of Java hosted Clojure IDEs, I not sure what there's to be skeptical about ;) Font rendering in every Java IDE I've ever used ... sucks to put it lightly.
16:23moogatronicI may have missed this already, but what is the problem that CodeMirror is trying to solve?
16:23cemerickdnolen: font rendering?
16:23dnolencemerick: yes they can't even get that right.
16:23ibdknoxno
16:23dnolenmuch less the feature set
16:23hiredmanmaybe the javafx code dump will make it better
16:23ibdknoxnow*
16:24cemerickI mean, what font rendering issues are you talking about?
16:24Raynescgray: Do you plan to actually use this macro, or are you just doing it for fun?
16:24dnolencemerick: nuff said ;)
16:24cgrayRaynes: I would like to use it
16:24ibdknoxin any case
16:24RaynesDon't. Just catch the divide by zero exception and return nil.
16:24ibdknoxit doesn't make sense to write an editor from scratch
16:24ibdknoxso my goal would be to start with that in hand
16:24moogatronicFonts look okay to me in IntelliJ on os x. I think the font rendering is platform dependent?
16:24ibdknoxand build around it
16:25technomancyis jedit any good?
16:25cemerickmoogatronic: Yeah, eclipse does quite well, too. Still not sure what dnolen means.
16:25hiredmanhttp://gochev.blogspot.com/2009/08/ria-technologies-lets-compare-font.html
16:25technomancyI'm kind of surprised I don't hear about it more often
16:25cemericktechnomancy: man, jedit keeps on keepin' on, all these years.
16:25cgrayRaynes: good idea
16:25tsdhtechnomancy: Ah, stupid me. I correctly added the project as :dep-dependency, but I forgot to run "lein deps" afterwards.
16:26technomancytsdh: add :checksum-deps true to project.clj
16:26technomancythen it will happen for you whenever your dependencies change
16:26abrooksAnyone have experience with jswat Clojure debugging?
16:26dnolentechnomancy: it's passable Emacs competitor, but doesn't offer anything compelling to me. Tried it for a few months as my main editor for a while.
16:26cemerickIt's supported, and used by many, but it's sort of a death watch.
16:26technomancydnolen: sure, I don't mean as a competitor to Emacs, but as a bootstrapping mechanism for something clooj-like
16:27dnolentechnomancy: there's already a Clojure mode, but it's not as nice as Clooj at least from the parentheses matching REPL experience.
16:27ibdknoxcemerick, the reason I don't want to start from eclipse is that it is built on several assumptions about how an IDE should work that I don't think are necessarily true for the ideal Clojure env.
16:27hugodtechnomancy: does checksum-deps work for dev-dependencies when :local-repo-classpath is set?
16:27tsdhtechnomancy: Awesome, thank you.
16:27technomancyhugod: it should be orthogonal to :local-repo-classpath, but actually I'm not sure it will trigger for dev-deps now that I think about it
16:27ibdknoxcemerick, also, the sheer weight of it both in the size sense and the general baggage the platform carries with it is rather undesirable
16:27cemerickibdknox: That's fair, but perhaps also a worthy discussion. :-)
16:27moogatronicibdknox: most of the java teams i've worked with have dumped eclipse in favor of intellij, but that doesn't help with regards to an open paltform to start from.
16:28technomancyit may only affect tasks that use eval-in-project
16:28moogatronicyou're right about the assumptions for sure.
16:28stuartsierraI think to really be *better* than existing tools, a Clojure IDE would have to get away from source-code-as-text-files.
16:28abrooksSome of the frames (via jswat) have full locals but other frames have nulls for all their locals. Is this a known issue with jswat? Is there some way that the JVM is GC'ing stack objects before I can see them?
16:28cgrayRaynes: actually, I think it might be better to use a macro like the one I had, because I would like to take the negative reciprocal of infinity
16:28dnolenstuartsierra: and replace that w/ what?
16:28technomancyhugod: the checksum is saved to disk separately, it's not actually based on the jar files on disk. so you can screw it up if you poke around manually
16:28stuartsierradnolen: Code-as-data. All the way down.
16:28hiredmanseems unlikely
16:29ibdknoxmoogatronic, we were always impressed by intelli-j when I worked on VS
16:29moogatronicthe only improvement I would like to have for emacs is an easy to use visual file browser. maybe there is one. i've tried lots and have not found one that makes me happy.
16:29hiredmanyou would have to convert to text files anyway for the compiler
16:29Raynes(defmacro possibly-infinite [body] `(try ~body (catch ArithmeticException e# (when-not (re-find #"Divide by zero" (.getMessage e#)) (throw e#)))))
16:29moogatronicemacs makes it seem like i'm having fun while programming. IDEs remind me of my enterprisey days.
16:29Raynescgray: ^ In any case, there is a macro that catches that error.
16:29technomancyhiredman: you can skip the reader
16:29moogatronic(as i type this, I have intelliJ loaded with java and scala code.. heh..)
16:29technomancyserializable-fn style
16:29hiredmanmaybe for dev
16:29hiredmanI guess
16:30ibdknoxmoogatronic, you should have seen my designs for VS-next :)
16:30stuartsierrahiredman: no, the compiler takes data structures.
16:30technomancynot saying it's a good idea, but it's probably feasible
16:30hiredmanstuartsierra: Compiler/compile takes a LispReader
16:30moogatronicibdknox: minimalized VS?
16:30stuartsierraeasily fixed
16:30hiredman*shrug*
16:30hiredmanseems unlikely
16:31ibdknoxmoogatronic, very, it was much lighter weight, while being much more contextual with information when you needed it
16:31ibdknoxmoogatronic, the concepts would work even better for a Clojure IDE actually :)
16:31moogatronicmy only objections to anything VS is that it requires windows to run it. =)
16:31ibdknoxhaha
16:31ibdknoxthat too
16:31hiredmanthere is certainly a lot of room for richer text abstractions and a bridge to clojure datastructures
16:32hiredmandrag and drop of forms
16:32ibdknoxsounds like the makings of a structured editor ... :-p
16:33dnolenClojureScript + webkit + websocket + nRepl, would be fun.
16:33dnolenthe biggest pain being webkit
16:33cgrayRaynes: I got the original to work: all i needed to do was replace (quote ~args) with (list ~@args)
16:33hiredmansure, but you wouldn't want to abandon text at the bottom, you have an overlay of structure data
16:33technomancyyeah, I'm not eager to port git and emerge
16:33hiredman:)
16:34cgrayRaynes: I'm sure it'll eventually be a pain in the ass, but for now I'm holding out hope that it'll work :)
16:34ibdknoxI guess paredit is very close to the notion of a structured editor
16:34cemerickIt seems like everyone is excited by the notion of a better editor and such, when all the other stuff that surrounds it is the real tricky part, IMO.
16:35ibdknoxcemerick, the key is actually not to have it surround it :)
16:35hiredmancemerick: excited? bleh, sounds annoying, I'll stick with trying to decode mp3s in clojure in my spare time, thank you very much
16:35cemerickibdknox: git, profiling, debugging, introspection (code completion / hinting), etc etc
16:36hiredmanneed more hooks exposed in the compiler
16:36ibdknoxcemerick, done correctly that's all just in an editor
16:36hiredmanclojure's compiler as a service
16:36technomancy"any discussion of rewriting Emacs expands until it becomes a discussion of rewriting an OS" -- some corollary to jwz's law
16:36dnolencemerick: you're assuming everyone wants / needs that all in one place. Where's the $$$!
16:36cemerickdnolen: What's the "other place" we're all going to get it from?
16:37cemerickibdknox: I look forward to your becoming available in December, then. :-)
16:37dnolenRuby on Rails succeeded w/ TextMate which didn't exactly work that well compared to IDEs on the surface.
16:37cemerick:-(
16:37cemerickNot the kind of role model I'd like.
16:37moogatronicTextMate seemed sort of popular in the same way that Instragram is though.
16:38dnolencemerick: people want different things.
16:38ibdknoxcemerick, maybe I'll bring some "drawings" to the conj :)
16:38cemerickTrue enough, and they can coexist.
16:38ibdknoxwhat's wrong with TextMate? other than its abandonment?
16:38moogatronictho, if i could add Text Mates project drawer to my emacs setup, i'd be super happy.
16:38ibdknoxmoogatronic, that has to exist... VIM has nerdtree
16:39dnolenibdknox: nothing. TextMate shows that plenty of people weren't satisfied w/ complex IDEs
16:39ziltiIf I have a function how do I find out 1. how many arguments it takes and 2. what type the arguments are (if they're typed)?
16:39technomancyibdknox: what's wrong with TM is that it can't be extended in-process
16:39cemerickTM is great. Having "just" a text editor doesn't cut it for real work (or, not for how I work, anyway).
16:39moogatronicibdknox: i've used ECB before, but it's a bit combersome
16:39RaynesSublime Text 2 is nice, but I nearly hung myself while trying to write Python plugins for it.
16:39ziltimoogatronic: There's e.g. sr-speedbar or ECB
16:39technomancyyou have to work through its explicit plugin interface, which by definition isn't flexible enough. no dogfooding.
16:39dnolencemerick: how *you* is the key idea here :) you have something comfortable and that's what you like.
16:39ibdknoxtechnomancy, that's fair
16:40technomancymoogatronic: why does it have to be visual?
16:40ibdknoxfun fact: many of the devs on the VS Editor used VIM
16:40moogatronictechnomancy: cause i am a weak minded former enterprise java developer!
16:40technomancymoogatronic: at least you're honest. =)
16:40ibdknoxI've never bought the "you need and IDE" argument, ironically
16:40cemerickdnolen: Fully aware. :-)
16:41ziltiI'd say that, with Java, you definitely need an IDE. But with languages like Clojure you don't
16:41moogatronictechnomancy: honestly, i just get lost if my projects have more than a couple of directories worth of files.
16:41moogatronicmy projects lately have been all over the map with respect to languages, data, etc...
16:41moogatroniccurrently i'm working on a Hadoop/Pig/Java/Scala/Python project.
16:42technomancymoogatronic: I use the "tree" shell command in combination with find-file-in-project
16:42RaynesI don't even use dired. I use 'ls', 'mv', 'rm', and 'cd'. :>
16:42moogatronicfind-file-in-project… will investigate. =)
16:42cemerickI used jEdit almost exclusively up through 2005 coding Java & python, so I'm very familiar with the editor + console philosophy. It gets very tiresome after a while though.
16:42technomancymoogatronic: I don't really buy the notion that learning the project's layout necessarily needs to use the same UI as jumping to a file.
16:42moogatronicso far all the tips I get out of #clojure have been money.
16:43moominJust because you don't need an IDE doesn't mean one wouldn't be nice...
16:43technomancymoogatronic: well, I don't even really use find-file-in-project much these days; I just work in more smaller projects that are trivial to navigate =)
16:43technomancycemerick: all I know is that it was created by Slava Pestov, so I assumed it was pretty rockin' =)
16:43moomine.g. refactoring to split a namespace
16:43moogatronicOn a given day I just have to jump around a lot.. RA work, course work, actual get paid work, etc.
16:44cemericktechnomancy: It was. Even better when paired with Verdana. :-P
16:44moogatronicvim has become my textmate, emacs is my happy place, and intellij makes me money.
16:45technomancyhaha... from the #emacs channel: "Emacs continues to amaze me - even after a year of usage there are many cool features to be discovered!" / "That's like saying even after a year of listening to music i still discover new bands!"
16:47ziltiIf I have a function how do I find out 1. how many arguments it takes and 2. what type the arguments are (if they're typed)?
16:47cemerickmoogatronic: Hopefully we can make eclipse more like emacs…happy capitalists all around. ;-)
16:48Raynes&(:arglists (meta #'println))
16:48lazybot⇒ ([& more])
16:48technomancyzilti: there's no way to do it from a function, you need a var. I think there's an open issue about this though.
16:48RaynesThis only works with functions defined with defn, or functions that explicitly add arglists meta.
16:49RaynesAnd, like he said, you need the var.
16:49ziltiAnd with a macro?
16:50ziltisomething like (defmacro get-arguments [function] ...)
16:50moogatronicis there an easy way to get dark backgrounds in eclipse yet?
16:52jcromartiemoogatronic: are you on a Mac? Try Control-Option-Command-8 :)
16:52jcromartie(kidding... but not... but yeah...)
16:52moogatronicjcromartie: yes i know of this solution.. =)
16:52ziltijcromartie: Why, what does this?
16:52moogatronici did actually use it for a while
16:52moogatronicit's just late nite coding on white backgrounds that hurt.
16:52moogatronicF.lux has helped a lot with that actually.
16:52cemerickjcromartie: That's not bad, actually.
16:53jcromartieyes I was going to say, moogatronic
16:53jcromartieF.lux is good
16:53jcromartiebut not the total solution
16:54moogatroniczilti: inverse video
16:54ibdknoxWell.. there should be lots of good discussion at the Conj about tools :)
16:54cemerickmoogatronic: http://www.eclipsecolorthemes.org/ ?
16:54jcromartieit's amazing, when I hit that key combo, I can *feel* my eyes adjust
16:55moogatroniccemerick: awesome. did not exist at the time I switched to IntelliJ
16:55moogatronichonestly, having dark backgrounds was high on my list of reasons.. kind of lame I admit.
16:55ibdknoxI really hate white backgrounds... so I can understand that
16:55dnolenmoogatronic: you got stare at the damn screen all day, it better look how you want it to look ;)
16:55jcromartieI don't like white backgrounds
16:56jcromartiebut I hate light-on-dark text rendering almost as much
16:56moogatronicdnolen: agreed. Each computer I setup will always have my programming fonts now, and proper color themes.
16:56jcromartiethe letters are all thick
16:56jcromartiethe sub-pixel rendering is just not right
16:56moogatronic<- Inconsolata fan.
16:56ibdknoxfont rendering is hard.
16:56moogatroniclol.= )
16:56jcromartiejust look at the actual text in those color themes (http://www.eclipsecolorthemes.org/)
16:57jcromartiethe light background ones look a lot better, typographically
16:57jcromartieZenburn is OK
16:57moogatronicis that a function of the size of the text?
16:57jcromartie(my personal fave anyway... always count on a classic)
16:57jcromartiemoogatronic: nope
16:58jcromartiemoogatronic: it's just the consequences of rendering light text on a dark background... the AA is different
16:58moogatronici guess that makes sense.
16:59jcromartiehttp://jcromartie.tumblr.com/post/370728317/dark-vs-light-text-smoothing-on-os-x
17:00jcromartienotice the light text, inverted, is actually heavier than the plain dark text
17:02zerokarmalefti tried solarized light and dark, but went back to zenburn
17:02moogatronicjcromartie: interesting. I wonder what the long term cognitive/strain effects are of light.vs.dark and dark.vs.light, if there are any at all.
17:02moogatronici'm sure someone has studied this.
17:02jcromartiepossibly
17:03zerokarmaleftthe highlight on solarized dark was the deal breaker
17:04jcromartiemoogatronic: actually, light-on-dark can be more of an eye strain than dark-on-light
17:04jcromartieI think the key is lower overall display brightness
17:04jcromartieand color temperature
17:04jcromartieand ambient lighting
17:04jcromartieif the wall is as bright as the monitor in front of it, your eyes will be fine
17:05moogatronicand proper diet and exercise and ergonomic furnature. =)
17:05jcromartieheh sure
17:06jcromartieif you want to get really sciency abou tit
17:06jcromartieabout it
17:06jcromartieyou can use green text on a yellow background
17:06jcromartiewith a serif font
17:07bsod1why are there some commented lines in LispReader.java like syntax-quote symbol(line 43) in clojure 1.2? I'm trying to understand how reader macros implemented in clojure
17:07moogatronici need to strike a balance between looks beautiful / inspiring and hurts my face. =)
17:07jcromartiemoogatronic: yes, minimize face-hurting where possible
17:08moogatronicanyone who's attening the conj a runner? (slightly ontopic…)
17:09moogatroniccould possibly organize an unconference event as a reset-break between the conference and the other unconference events.
17:10moogatronicplus its like er, alan turing year next year, so theres the computational tie in.. =)
17:10technomancywhat I want to know is when we are going to fit all these unconference events into the schedule
17:10technomancyseems like we need another whole day
17:10jolyI was curious about that too; seems like there's a lot lined up
17:10moogatronictechnomancy: I was wondering what the scheduling was going to be for those!
17:10zippy314When compiling a clojurescript app on an Ubutnu box, I'm getting this error: Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil. Full stack trace here: http://pastie.org/2775324. I don't see that on my dev box (a mac). Any ideas what this means? I notice that js is produced for most of the clojurescript files, but not the addition of
17:11bsod1whe .get on a java.reflect.Field needs a third parameter? (.get field) IllegalArgumentException but (.get field nil) works
17:11cemericktechnomancy: after dinner, presumably. We'll have to get things aligned so that there is a minimum of conflict w.r.t. declared attendees, etc.
17:12cemerickBesides, who sleeps at the Conj? I certainly didn't last year. :-P
17:12moogatronicany decent brewpubs in the area? I usually try to make it a goal to try locally produced good beer if possible.. =)
17:12moogatronicI'm a homebrewer.. it's my duty.
17:13technomancycemerick: yeah, no matter how late you head to bed you can't shake the feeling of "oh man, if I sleep now I'll be missing out on all kinds of cool stuff!"
17:13moogatronicyou just need to chart your dependencey on caffeine with the half-life of caffeine in your system and dose appropriately.
17:14cemerickmoogatronic: but how does alcohol fit into that protocol?
17:15moogatronictechnomancy: If i would have had that foresight, I could have avoided the expense of hotels all together and just pulled a multi-all-nighters.
17:15technomancymoogatronic: economical! I like it.
17:15moogatroniccemerickl: yes, alcohol wrecks the equation.
17:15moogatronicat least for my system. I cant cope with the mixture of depressants and stimulants.
17:16moogatronicthough, I consider beer to be a holy sacrament, not a depressant. =)
17:19moogatronictechnomancy: i'm almost regretting my hotel booking now that i thnk about this more...
17:19moogatronicI would be pretty wrecked by the end.
17:19moogatronicif alive.
17:19technomancybut what a way to end it!
17:20ziltiYou can't stay awake 3 days in a row
17:20technomancynot without severe hallucinations anyway
17:20erldavesimple question: how should I store a list of maps?, e.g. (def x {:a 1 :b 2}) (:a (first (seq (s))) ;; doesn't work
17:21erldavesince the map entries end up appearing in the seq
17:21bsod1what is clojure way to build strings in a loop? (str old_string string_to_add) ?
17:21moogatroniczilti: yeah, and priceline wont' refund my hotel purchase anyway.
17:21ziltimoogatronic: A win-win-situation :)
17:22moogatronicI could totally be that crazy dude at the conference who got arrested for running around the hotel lobby naked while battling invisble demons.
17:22jcromartiebsod1: build a seq of what you want to concatenate, then use clojure.string/join
17:22jcromartiebsod1: which internally uses a stringbuilder and an actual loop
17:22jcromartiebut your code is better off passing a sequence to string/join
17:23bsod1jcromartie: thanks
17:24cemerickzilti: but you can crash on the roof, especially if you've been up too long enjoying moogatronic holy sacraments.
17:24cemericks/moogatronic/moogatronic's
17:24ziltilol
17:26erldaveshould I be wrapping the maps in the list inside atoms? that seems a bit odd
17:27TimMcerldave: What do atoms have to do with anything?
17:27TimMc,'({:a 1} {:b 2 :c 3}) ; erldave
17:27clojurebot({:a 1} {:b 2, :c 3})
17:27erldaveit would maybe stop (seq from reducing the type of the map to a mapentry, since the map/list of mapentries are now hidden in an atom
17:28erldaveso if I have x and y, both maps, how do I make a list containing those two maps?
17:28TimMcerldave: (list x y)
17:29erldaveahhh, thanks
17:29TimMc,(first '({:a 1} {:b 2 :c 3}))
17:29clojurebot{:a 1}
17:31dnolenerldave: also unless you really want a list, why not put them in a vector?
17:31dnolen,[{:foo 1} {:bar 2}]
17:31clojurebot[{:foo 1} {:bar 2}]
17:31erldavesorted, I now have what I want: (vector x y) instead of (vec x y) ;; doesn't run
17:31erldavethanks
17:32ziltiHow are those wrapping macros ( [] and {} ) defined anyway? Are they hardwired into the language?
17:32Raynes&(vec '(1 2 3 4))
17:32lazybot⇒ [1 2 3 4]
17:32erldaveoddly fn list doesn't appear to be in Joy of Clojure
17:32Chousukezilti: yes
17:33dnolenerldave: you don't need to say vector, just [x y]
17:34Chousukezilti: they're reader macros but reader macros are reserved for the implementation
17:34dnolenzilti: reader macros
17:34ziltiAh I see
17:35erldavednolen: better, ta
17:35ChousukeI'd sort of like to see user-definable reader macros in clojure but since I can't think of a sane way to solve the problems they would cause I'll go with the status quo :P
17:35technomancyChousuke: I never understood why reader macros couldn't be namespaced.
17:36ibdknox_what problems would they cause?
17:36mdeboardCan I have help with something rudimentary? How do I turn http://p.mattdeboard.net/fibowhat.html into a single fn?
17:36Chousuketechnomancy: what do you do if you want to use two reader macros that happen to use the same characters?
17:37technomancyChousuke: you'd declare which reader macros to use in the ns clause, and it would fail to compile if there was any overlap.
17:37Chousuketechnomancy: that doesn't solve the clash though, that just avoids running code that makes no sense
17:37Chousukeyou still can't use the macros together :/
17:37ziltiThat would make code much less readable
17:38technomancyChousuke: well if the reader macros only apply to code in a given namespace that explicitly requires them, there would be no clash.
17:38stuartsierraYou can get most of what you'd want reader macros for with regular macros.
17:38ibdknox_what reader macros would you really want?
17:38technomancyibdknox_: I want regex literals that are callable
17:38technomancyhaving to use re-find for conditionals is silly
17:38ibdknox_technomancy: I don't understand why we don't have those anyways
17:39technomancy(filter #"what up" ["bunch" "of" "strings"])
17:39ibdknox_I completely agree
17:39technomancyibdknox_: "for interop" =(
17:39Chousukeibdknox_: because of clojure no-wrapping policy
17:39ibdknox_but barring that... I can't think of anything else I'd really want
17:39technomancyyeah, that's pretty much it for me. =)
17:39Chousukemaybe someday there will be a "interop-callable" protocol or something
17:39hiredmanwell, there are multiple strategies for getting there, each one has objections
17:39technomancyIFn as a protocol would solve it too, but that's also been shot down.
17:39hiredmanthe cleanest path is invokedynamic
17:40Chousukeand you can use Patterns as functions. I just don't know how it could be done without interfering with fast function calls.
17:40psylloI like the callable regex idea.
17:40technomancyyeah, I have never in all my years seen Patterns used in interop scenarios
17:40ibdknox_I suspect everyone likes the callable regex idea
17:40ChousukeI like it too, if we consider only the benefits
17:40technomancybut I see them used as predicates all the time.
17:40Chousukebut lets not do that :)
17:40technomancy(partial re-find #"yuuuuck")
17:40psylloI'd like to have reader macros in Clojure. I'm for it. Arguments about legibility don't matter to me.
17:41ibdknox_psyllo: for what?
17:41psylloPower to the user... Lisp blurs the line between user and designer.
17:41Chousukepsyllo: how about arguments about fragmentation
17:41technomancyI don't necessarily want reader macros, I just don't understand why namespacing them doesn't address the collision objections.
17:41dnolenpsyllo: it will probably never happen. rhickey has said as much.
17:41Chousuketechnomancy: I suppose it just doesn't solve enough of the problem
17:42technomancyChousuke: because the motivation is usually "I want it to be like CL"? =)
17:42ibdknox_lol
17:42dnolenit's doesn't blur the line between user and designer. it just encourages bad taste.
17:42technomancyhas anyone ever used #"" for interop?
17:43cemerickgood enough for me! :-P
17:43Chousuketechnomancy: it solves a bit of it, but you're still left with not being able to use two reader macros from arbitrary sources if their dispatch characters clash
17:43dnolenthe amount of awful requests for syntax in CoffeeScript is mindblowing.
17:43ibdknox_technomancy: nope
17:43technomancyChousuke: you could say the same thing about function names
17:43psylloHave reader macros fragmented CL?
17:43Chousuketechnomancy: you can rename functions, but changing the dispatch character just creates more problems :P
17:44ibdknox_dnolen: haha you should've seen some of the suggestions we got for C#...
17:44psyllo(no they haven't)
17:44dnolenpsyllo: CL community is too small to fragment. Their just one name among the various Lisps.
17:45dnolenpsyllo: like it or not Clojure is the only Lisp in years to generate a community from the buzz.
17:45Chousuketechnomancy: at best you might get to something like where , say, $ starts a custom reader macro, followed by an arbitrary character (decided at import time), followed by whatever dispatch character the custom reader macro uses :P
17:45Chousukeand that's getting a bit perlish
17:46technomancyChousuke: I don't see why :reader [my.reader.macros :only [a b c] :rename {b l}] wouldn't work like :use.
17:47Chousuketechnomancy: but if the dispatch character for your macro is < you probably want it to end with >. Then if you change the dispatch it gets weird
17:47psylloI typically have problems with these sorts of restrictions... I tend to fall on the side of more options not less. I also understand where I typically fall on the spectrum of opinion.
17:48Chousukepsyllo: more options usually implies more costs
17:48Chousukepsyllo: in this case Rich simply decided that the benefit from reader macros does not justify the cost
17:48technomancyChousuke: I see. I don't think it's insurmountable, but yeah, I don't care enough about it to solve the problem since I just want regexes to be more useful.
17:48ibdknox_I still haven't heard a concrete example other than the regex one
17:49Chousuketechnomancy: yeah. You can cheat and hack the reader though if you REALLY want :P
17:49technomancynope!
17:49psyllotechnomancy: But that's exactly why you want reader macros.
17:49Chousuketechnomancy: or you can figure out how to add a callable protocol without screwing up performance
17:49technomancyI mean I might consider a patch if I had conclusive proof that no Clojure user had ever used regexes in an interop situation.
17:49psylloYou've just tapped into a real legit reason to not have the restriction.
17:49dnolenpsyllo: that's not a real reason.
17:49psylloOh?
17:49technomancyChousuke: that's way more interesting. but probably beyond my skillset. =)
17:50ibdknox_once case does not justify something as scary as reader macros
17:50Chousukepsyllo: it's a reason, but not a good enough one.
17:50dnolenwe're just talking about minor conveniences.
17:50technomancypsyllo: why not just fix the mistake in the reader?
17:50psylloYou're tending to want to make the decision for others, I'm tending to leave that door open.
17:50Chousukepsyllo: you need to make decisions
17:51psyllotechnomancy: Why not just let the user do that?
17:51Chousukepsyllo: if you try to allow everything you end up with a mess
17:51dnolenpsyllo: I'm not tending to do anything, I'm not in charge about reader.
17:51ibdknox_a language without opinion is useless
17:51psylloAgain, I understand where I fall on the spectrum of opinion in this.
17:51Chousukepsyllo: see: scala (tongue firmly in cheek :P)
17:51ibdknox_lol
17:51psylloibdknox: You're black-and-whiting the issue.
17:52technomancypsyllo: seems like an awful lot of work to fix a simple design flaw.
17:52dnolenin anycase, fortunately the world isn't black and white. There are other Lisps with different design decisions.
17:52dnolenand man are they fun and useful.
17:52psyllo... anyway it's fun to talk about because it's so fundamental to design.
17:52Chousuketechnomancy: #"" not being callable is not a design flaw though, just an unfortunate consequence of the interop policy
17:53technomancyChousuke: Rich has said that he doesn't use regexes himself, so I think it's pretty understandable that he would make a small mistake in this area of language design. =)
17:54RaynesRich doesn't use regexes? My hero.
17:54dnolentechnomancy: well he uses then in the Clojure(Script) tokenizer
17:54dnolens/then/them
17:54technomancydnolen: yeah, this was a couple years ago; I guess my info could be out of date.
17:54ChousukeAnd in the reader :P
17:54eirohello
17:54Chousukebut that's java
17:54dnolenChousuke: the tokenizer in the reader I meant
17:55dnolenChousuke: the ClojureScript has a reader in ClojureScript that uses regexes as well.
17:55ChousukeI wonder if I still have my clojure reader code somewhere
17:56ChousukeI got it working well enough that I could compile a version of Clojure with it.
17:57Chousukebut not quite in good enough shape to dare propose that someone use it :P
17:58psylloIf Rich Hickey doesn't use regexes it's likely because the problems he's solving are better solved in some alternative way and not because you has somehow moved beyond regexes is his programming mastery.
17:58psyllos/you has/he has/
18:00Chousukeor he doesn't solve problems that involve figuring out the content of strings :P
18:00RaynesI don't think anybody was implying that Rich is a God because he claims to not use regexes. ;)
18:02psylloRaynes: Yeah, gotcha ;)
18:02bsod1is there a better way to get a string's last char than (nth str (dec (count str))) ?
18:02Raynes&(last "foo")
18:02lazybot⇒ \o
18:03technomancydakrone: apparently my :insecure? branch uses connection pooling faultily.
18:03technomancy'nother patch comin' your way
18:03technomancydid you want to do general connection pooling for 0.2.3?
18:04psyllobsod1: Also you typically don't want to use 'str' as a variable name since there is a function 'str'. Also interesting is 'butlast'.
18:05bsod1Raynes: isn't it O(n) ? I thought my solution is O(1) since we already know string's length(or don't we?)
18:06RaynesIf he isn't using the 'str' function, it isn't necessarily bad to shadow it. I tend to avoid shadowing it in my own code just because it's such a common function that I might end up using it later and not think about the shadowing.
18:06psylloRaynes: "typically don't want to use"
18:06RaynesI'm not the guy to talk to about performance.
18:07RaynesBut that's how you get the last of any sequence, disregarding hacky more performant solutions that I can't come up with.
18:07psyllobsod1: You might want to look at the performance of 'count' in this case.
18:07TimMctechnomancy: The problem I see is that regexen can be used for either finding or matching.
18:08bsod1psyllo: yeah, strings are not counted so count is linear time on string (I think)
18:09TimMcI guess I would be OK with callable regex if it always used find -- I could just put in ^anchors$ if I needed full match.
18:09bsod1&(counted? "str")
18:09lazybot⇒ false
18:09hiredmanno
18:10hiredmanhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L509
18:10hiredmanuse count
18:10hiredmanpeople always seem to think count most convert it's arg to a seq first, that is not the cast
18:11hiredmancase
18:11hiredmanit is fast for arrays, strings, etc
18:11hiredmanI am sick of people using alength and such, please knock it off
18:13psyllobsod1: Cool. Just counted 9k characters as a string vs seq and counting a seq was 10x slower. So, yeah.
18:13RaynesOr else he'll shoot lightning bolts from his fingers and call upon the forces of hell to destroy your city.
18:16psyllohiredman: Piper down
18:16hiredmanpsyllo: excuse me?
18:16Raynespsyllo: Don't bother. :\
18:17psyllo:D
18:17psylloSorry, hiredman. I didn't see any mention of not using count.
18:17psylloI don't make assumption about those things. I usually look at the source or just do a simple test.
18:18psylloBeen fun. Have a good weekend y'all
19:09seancorfieldclj-time 0.3.2-SNAPSHOT uses Joda Time 2.0 and should be compatible with both Clojure 1.2.x and 1.3.0
19:21moogatronicseancorfield: joda is awesome. I definitely need to check out clj-time.
19:22moogatronicit saved me on a few giant ugly java projects so far.
19:22technomancydoes it still not have a generic "figure out how this time string is formatted and parse it" function?
19:22mdeboardHm so I just installed Leiningen on a new machine (ubuntu 11.10), have the executable on my path, but when I go to clojure-jack-in, it said "lein: command not found"
19:23technomancyhaving to pick a formatter up front is annoying
19:23mdeboardWhen I go to terminal emulator, even, and type `lein` it's runs properly.
19:23mdeboardAnyone have any idea why?
19:23moogatronictechnomancy: not sure. I think not though. Its main feature, as far as java is concerned, is that it has an API that was not designed by random people in mental hospitals.
19:23technomancymoogatronic: oh absoultely; it's a huge improvement over anything in the JDK
19:24technomancymoogatronic: I've considered having Leiningen issue a warning if it sees any reference to java.util.Date.
19:24aperiodictechnomancy: as far as I'm aware, you still have to specify a formatter upfront
19:24duck1123there's DateTime/parse, but I'm not sure how far that goes
19:24technomancymdeboard: must be a $PATH issue
19:24moogatronictechnomancy: not a bad idea. =)
19:24mdeboardtechnomancy: Well, color me puzzled :|
19:24hiredmanmdeboard: what happens if you try and run lein in eshell?
19:25mdeboardhiredman: Command not found
19:25hiredmanor M-x shell-command
19:25mdeboardsame
19:25hiredmanright, so for some reason or other emacs has a different idea of PATH
19:25hiredmanhow did you start it?
19:25mdeboardMmkay. Huh.
19:25hiredmanmost likely fork()ed from somewhere that didn't read some shell config somewhere
19:26technomancyactually it should be able to figure it out by launching a shell
19:26technomancy(defvar clojure-swank-command (if (locate-file "lein" exec-path) "lein jack-in %s" "echo \"lein jack-in %s\" | sh"))
19:26technomancygiven a new enough clojure-mode
19:26technomancythat may not have made it into a release yet though
19:27hiredmanwhy would sh have a differnt idea of PATH there?
19:27technomancyhmm... does sh need a special flag to source profile?
19:27technomancy.profile, rather
19:27technomancyman
19:28technomancyif only unix had a standard user-writable directory on the $PATH by default. ಠ_ಠ
19:28hiredmanmost likely his PATH is set in some other shell specific file, which is why it isn't seen by emacs
19:28Raynestechnomancy: That's in the latest release.
19:28RaynesI saw it when I was playing with defcustom.
19:28technomancyRaynes: ok, must be that sh doesn't honor profile when launched like that.
19:30technomancyseems like sh -l will source .profile on dash
19:30mdeboardhiredman: yeah the lein executable is on a path set in .bashrc
19:30technomancyanyone with a classic sh want to confirm that's portable?
19:30technomancymdeboard: ah yeah
19:30technomancythat belongs in ~/.profile instead
19:30mdeboardI see
19:31RaynesReally? I put all my PATH mods and such in .bashrc.
19:31mdeboardIs that a change?
19:31mdeboardin emacs 24/ubuntu 11.19
19:31mdeboard11.10*
19:31technomancyno, .bashrc has always been for bash-specific settings
19:31mdeboardeh never had a problem before
19:31RaynesGood to know.
19:31mdeboardbut I'll give it a go
19:31hiredmanmeh
19:32hiredmanI would just use some thing like (setenv "PATH" ...)
19:32technomancymdeboard: actually before you change it
19:32technomancycan you try (setq clojure-swank-command "echo \"lein jack-in %s\" | sh -l") ?
19:33technomancywait that won't actually help here since it's dash
19:33mdeboardlol
19:34technomancybut just for the record, would (setq clojure-swank-command "echo \"lein jack-in %s\" | bash -l") do it?
19:35Raynestechnomancy: Did you know that slamhound makes Java think that your code is a Swing application?
19:35technomancymaybe "echo \"lein jack-in %s\" | $SHELL -l" would be better?
19:35RaynesI'm not sure why, but whenever I use it, I get a Swing dock icon.
19:35Raynes(on a mac)
19:35technomancyheh
19:35technomancywell it does preload every namespace on the classpath
19:35technomancyso it could be triggering latent functionality in your codebase?
19:35technomancyor does it happen to empty skeleton applications too?
19:36RaynesNot in all of them.
19:36RaynesI've ran it against a bunch of applications.
19:40daakuwhat is the right way to trigger evaluating a seq returned form map (my deftest has a single map form)
19:40mdeboardwell, shit, even if i run it from command line
19:41mdeboard:-|
19:41mdeboarder
19:41mdeboardeven if I start emacs from the command line, that is.
19:41technomancymdeboard: oh? that's really weird.
19:43mdeboardhiredman: Can you re-enter the elisp command you suggested?
19:43technomancyis that emacs launched from bash where you've confirmed the same bash instance can launch it?
19:43hiredman(setenv "PATH" ...)
19:45technomancyheh; the way "lein ring" launches a swing web browser is adorable.
19:46ibdknoxdaaku: ##(doc dorun)
19:46lazybot⇒ "([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. dorun can be used to force any effects. Walks through the ... https://gist.github.com/1323858
19:46daakuibdknox: thanks!
19:46ibdknoxor if you need the results
19:46ibdknox,(doc doall)
19:46clojurebot"([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through the successive nexts of the seq, retains the head and returns it, thus causing the entire seq to reside in memory at one time."
19:47daakudorun worked great
19:48dnolensupport for js literals in ClojureScript, https://github.com/clojure/clojurescript/compare/37-support-for-js-literals
19:48dnolenwho wants it?
20:11mdeboardSo, I think now the problem is that I don't even have "jack-in" as a command. I'm missing swank-clojure, yeah?
20:12mdeboarddon't answer that, my idiocy is rhetorical.
20:12Raynes$dict rhetorical
20:12lazybotRaynes: adjective: Of or relating to rhetoric.
20:12RaynesMan, I hate when he does that.
20:12mdeboardYeah, me no talk good
20:12Raynes$dict rhetoric
20:12lazybotRaynes: noun: The art or study of using language effectively and persuasively.
20:13mdeboardME AM BAD TALK
20:14moogatronicmdeboard: Yesterday I didn't have jack-in either. My clojure mode was just old.
20:14mdeboardEh once I installed swank-clojure I was rhetorical
20:14mdeboardWorking fine, now
20:14mdeboardthe lesson is to never upgrade
20:14mdeboardanything
20:15moogatronicnah, i did a emacs 23-24 upgrade yesterday, and everything is working.
20:15moogatronicwell, everything that i've tried so far. =)
20:15mdeboardThis is all fresh/clean
20:15mdeboardso, there
20:15moogatronic=)
20:16moogatronicwell, my upgrade method involved porting over my previous settings.el to my current one, etc.
20:18mdeboardgot me
21:41jacobsenHi all, Clojure on Mac question from a total clojure newbie here — I'm following along with Stuart Halloway's "Programming Clojure" book. At one point there is an import: (use '[clojure.contrib.str-utils :only (re-split)]) … which barfs on my MacPorts install: FileNotFoundException Could not locate clojure/contrib/str_utils__init.class or clojure/contrib/str_utils.clj on classpath: clojure.lang.RT.load (RT.java:430) — any
22:02aperiodicjacobsen: are you using leiningen or cake?
22:07jacobsenhi aperiodic, I wasn't using either - just "clj" plus the REPL
22:09aperiodicjacobsen: i'd really recommend using one or the other. they'll automate things like managing the classpath and fetching dependencies, which will make your life much easier
22:11aperiodicjacobsen: leiningen seems to be more popular (it's what I have experience with), and it's available through macports (as well as brew)
22:12jacobsenaperiodic: 'lein' followed by 'lien repl' followed by the previously failing command worked — thanks!
22:13aperiodicjacobsen: see what i mean? ;)
22:13jacobsen:-)
22:13aperiodicglad to help!
22:13jacobsenthanks again
22:17jacobsenshould 'lein test' on a brand-new, unmodified project fail?
22:20aperiodicyes, it should fail with an error message that no tests have been written
22:21jacobsenCool, thanks
22:39jacobsenNext question — lein test with only a single trivial test takes 6 seconds to execute on a MacBook Pro — seems slow to me, is this typical (I assume this is mostly the JVM overhead?) — how are people dealing w/ this for TDD?
22:39technomancyjacobsen: most people run tests in an existing session
22:39technomancyeither via swank or the repl
22:39technomancyjacobsen: you can improve boot time by switching to the client JVM, but I'm not sure how to do that on macosecks.
22:40jacobsenI'm interested in setting up Eclipse to auto-run tests when I save files (something I do in Python, which is quite handy for TDD) — I'll have a look at Swank
22:40technomancythe other option is lein interactive. it's not terribly polished, but it's often better than relaunching the whole process.
22:41technomancyif you're using eclipse it's probably best to just call (run-tests) in the repl
22:41technomancyor if there's a way to trigger it on save that would be cool too
22:42jacobsenmaybe i'll take that on as a Clojure learning project — watch for save times in files and auto-run tests when they update
22:47technomancyfeel free to crib from clojure-test-mode
22:47technomancy(you would have to tie into the reporting mechanism for that, which I've already implemented in clojure-test-mode)
22:47jacobsenI'll take a look, thanks
22:48jacobsenHmm, maybe I'll go back to Emacs for this stuff — seems like the center of mass is (unsurprisingly) there rather than in IDEs
22:54jacobsensigning off, thanks to technomancy and aperiodic for the help
23:15seancorfieldany windows / emacs folks around?
23:32ThreeCupsHow can I print a ratio to look like n.nnn?
23:33archaicwhats a good way to alter *err* redirection using clojure-jack-in from the *swank* buffer to the clojure repl?
23:44callentechnomancy: never mind, answer me here if you do so at all.
23:49technomancycallen: yeah, clojure is a library and not really meant to be and end-user application. most of your direct interaction comes through leiningen on the command-line and slime in emacs.
23:50technomancyarchaic: for now you can use alter-var-root. the next version of swank should do it for you.
23:51ThreeCupsFYI, I ended up using the (double) function to cast my ratio
23:51technomancycallen: there's a bug in the current ubuntu apt package, so installing by hand as per the readme is your best bet
23:51callentechnomancy: I'll have to re-familiarize with "jack-in". Thanks, that's the use-case/design I thought I was supposed to follow.
23:51callentechnomancy: debian user, but I never trust apt packages for this sort of thing anyway.
23:52technomancycallen: yeah, apt and the JVM don't get along so well
23:52technomancycallen: the swank-clojure and leiningen readmes are the best places to start.
23:52callentechnomancy: shanks.
23:54technomancyheh; the debian version of lein actually has the fix, ubuntu just screwed it up in oneric.