#clojure log - Oct 28 2011

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

1:06 hiredman: the lack of unsigned values in java makes my head hurt some times

2:05 daaku: what is the right way to reference a third party library in a macro in my library intended for use by yet another party?

2:06 i had a :use X :only a directive which failed, i'm thinking a fully qualified require is the right way?

2:08 cemerick: daaku: your macro emits code that is evaluated in the user's namespace; how you set up your namespace's requires/uses has no impact.

2:09 The failsafe way is to use fully-qualified references to the third-party library's functions/macros.

2:09 daaku: cemerick: ah, i see. do fully qualified names not need :use or :require directives?

2:11 cemerick: They 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.

2:11 daaku: cool, got it. thanks!

2:11 cemerick: np :-)

2:17 amalloy: using ` is a shorthand for fully-qualifying things anyway

2:18 ibdknox: and we all like to use shorthand :D

2:18 amalloy: &(require '[clojure.string :as str])

2:18 lazybot: java.lang.ClassNotFoundException: clojure.string

2:18 amalloy: Raynes: ^? seriously?

2:18 ,(require '[clojure.string :as str])

2:18 Raynes: I don't know anything about that.

2:18 clojurebot: nil

2:19 amalloy: ,`str/join

2:19 clojurebot: clojure.string/join

2:21 ibdknox: how would clojure.string be missing?

2:21 lol

2:21 Raynes: It isn't. That isn't even the right error.

2:21 cemerick: amalloy: I (perhaps wrongly) assumed that daaku wasn't using `.

2:21 *shrug*

2:22 amalloy: cemerick: he probably wasn't. i just want him to use (`foo whatever) instead of ('otherns.third-party.tool/foo whatever)

2:22 daaku: i'm also learning clojure.test, so i'll see how it breaks soon :)

3:04 bobnodes: hi

3:05 I get the following error when using sandbar's wrap-stateful-session

3:05 "java.lang.IllegalStateException: Can't dynamically bind non-dynamic var: sandbar.stateful-session/sandbar-session"

3:05 ideas anyone?

3:11 mrh0057: bobnodes: what version of clojure are you using

3:11 bobnodes: 1.3.0

3:12 mrh0057: bobnodes: ring doesn't support 1.3.0

3:12 bobnodes: haha no way

3:12 mrh0057: use 1.2.1

3:12 bobnodes: that explains that then

3:13 thanks mrh0057

3:33 amalloy: ring doesn't support 1.3? that would sorta surprise me - perhaps it's just sandbar that doesn't?

3:34 (or, more likely still, the particular version of sandbar or ring that you're depending on)

3:35 huh. well, apparently it's ring. who knew? it looks like ring has a clojure13 branch, but i don't know how developed it is

3:36 pyr: ring works fine with 1.3

3:36 I'm using ring and clout on a 1.3 project

3:36 no pb whatsoever

3:40 bobnodes: I'm using sandbar 0.4.0-SNAPSHOT

3:43 no-one here is using sandbar with clojure 1.3?

3:49 no sandbar users here?

3:57 sigh

4:30 rmrfchik: anyone uses vimclojure? where I can find vimclojure.jar for nailgun server?

4:39 ibdknox: Ring definitely works with 1.3

4:45 rmrfchik: https://github.com/ibdknox/lein-nailgun

4:58 rmrfchik: ibdknox: something went wrong. "Exception in thread "main" org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository"

4:58 shoul I add something to maven?

5:00 ibdknox: what were you doing that caused that?

5:19 lucian: has anyone tried batmanjs on phonegap? there are some caveats in the project's .html about file://

5:41 bobnodes: any way of having lein-ring start a REPL as well?

6:34 algal: Hi, quick newbie question on preferred setup on OS X: is it sensible to install leiningen from macports? or better just to install it directly?

6:35 I find macports usually makes stuff easier, but sometimes not when the "stuff" effectively includes its own distro system.

6:39 walter: You could try this: http://www.unschooled.org/2011/10/how-to-setup-emacs-for-clojure-on-mac-os-x-lion/

6:42 algal: walter: 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...

6:43 ejackson: algal: just install in straight, its easy and the preferred method

6:44 algal: For 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.

6:44 ejackson: thx

6:47 (meaning, the script in ~/.lein/bin/swank-clojure )

6:52 ejackson: algal: you need to include any libraries in your project.clj, the contrib stuff should be there by default though

6:52 no i'm lying, include it in your project.clj, sorry.

6:54 algal: The 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?

6:54 I 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...

6:55 ejackson: yeah, ok your mental model is off

6:55 you need to create a project in which you work. you describe the dependencies you need in your project.clj file (such as contrib, say)

6:55 in the directory you run lein deps to grab the deps

6:56 then run lein repl and it will load you up a repl with your deps classpathed in

6:57 so heres an example of a really small project: https://github.com/Raynes/hobbit

6:57 you'll see the deps are in its, no leiningen's, project.clj

6:59 algal: ejackson: 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?

6:59 Or 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. ?

7:00 ejackson: exactly

7:00 you'll very soon want more than clojure itself

7:01 algal: But 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?

7:02 Or is it strongly preferred/required to declare all your dependencies before you start your REPL?

7:02 ejackson: it is strongly preferred, the whole classpath thing is a real PITA

7:03 i think there is dark magic to fiddle the classpath in a running JVM, but its not something you want to be doing AFAIK

7:03 joshnz: Can you set a environment variable? Is there a CLASSPATH (i think)...? Then (require....) as needed? You can do this with the Ruby REPL.

7:03 ejackson: certainly not during your first steps of learnig it

7:03 algal: Okay. Good to know....

7:04 ejackson: joshnz: the JVM is not as flexible in this regard, again, AFAIK

7:04 algal: I've been mostly doing Common Lisp, where you just (load …) whatever you need once you're up.

7:04 lnostdal: i see there's a few json libs out there .. is this https://github.com/dakrone/cheshire what people use now?

7:05 ejackson: yeah, its a total PITA, which is why lein and cake exist !

7:06 semperos: I have a function that, for one of its params, takes a list of functions

7:06 kzar: lnostdal: I used clojure.data.json last time

7:06 semperos: the function does one thing if all of the functions in that list evaluate to true

7:06 and another if any one of them is false

7:06 algal: Hmmm.. Just stumbled into clojure.core/add-classpath, but it's marked deprecated.

7:07 semperos: what 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?

7:07 thoughts?

7:07 kzar: semperos: use and I suppose

7:08 semperos: (and true true false (print "hello"))

7:08 ejackson: ,(doc while)

7:08 clojurebot: "([test & body]); Repeatedly executes body while test expression is true. Presumes some side-effect will cause test to become false/nil. Returns nil"

7:09 ejackson: not what I thought it was

7:09 semperos: kzar: the list is not fixed, and `and` as a macro doesn't allow `apply` type logic

7:09 ejackson: ,(doc take-while)

7:09 clojurebot: "([pred coll]); Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects."

7:10 kzar: ejackson: Oh, right (take-while identity stuff)

7:10 ejackson: yup

7:11 lnostdal: ok, kzar

7:12 semperos: is the take-while comment directed by way?

7:15 ejackson: i don't understand ?

7:17 algal: for 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

7:17 timvisher: anyone know where swank/slime redirects their stdout?

7:17 as in what buffer?

7:18 I'm trying to see logging information from tools.logging and I can't find it anywhere

7:18 but when I run `lein repl` from a shell, I get the log output nicely inline in the console

7:19 The config I'm using is here https://github.com/timvisher/tools.logging-testing

7:20 raek: timvisher: if you use clojure-jack-in it will appear _at the top of_ the *swank* buffer (before the slime.el text)

7:20 if you use lein swank, it will appear in the terminal you ran the lein swank command in

7:21 timvisher: i generally use jack-in

7:21 i was expecting it, thus, to show up in *swank*, but it doesn't appear to

7:22 nor in *slime-events*

7:22 nor in *SLIME Compilation*

7:22 ejackson: raek: at the top !

7:25 timvisher: oh gosh

7:25 raek: sorry I didn't notice that first line

7:25 lol

7:25 now I feel like an idiot. :)

7:26 well that is confusing

7:28 so now that I've got this figured out, how might i, without changing any code, log the inputs and outputs of all function calls?

7:28 something like defadvice in emacs

7:28 or aop?

7:28 clgv: timvisher: robert.hooke might help you

7:30 timvisher: shucks, that technomancy kid's so friggin smart... :)

7:30 thanks for the pointer, that looks like exactly what I want

7:32 ejackson: timvisher: 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

7:33 timvisher: Woah! _and_ he's enterprising!

7:33 mbac: has anyone written a clojure web framework that uses CPS for to provide http statefulness

7:33 timvisher: i may have to get me thath mug

7:33 mbac: a la weblocks for common lisp?

7:38 timvisher: is there any way to attach a repl to a running `lein ring server`?

7:57 semperos: drawing 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?

8:01 tordmor: (not (some (complement pred) coll))

8:02 semperos: that makes sense (and is what I coded), but was just trying to remember if a specific core fn already existed...

8:10 terom: (doc every?)

8:10 clojurebot: "([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."

8:14 semperos: terom: thanks

8:45 fdaoud: persistence

9:01 edw: With 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...

9:05 moogatronic: edw: 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.

9:07 The 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.

9:09 cemerick: edw: SNAPSHOT doesn't carry any specific semantics about the scope of changes.

9:09 it just means HEAD

9:11 edw: cemerick: 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?

9:12 s/checked it/checked in/

9:12 cemerick: s/tag/version

9:12 yes

9:12 edw: Cool. Thank you.

9:13 fdaoud: cemerick: your book has been delayed another month! argh!

9:14 cemerick: oh?

9:14 fdaoud: I have no idea how those projections are generated in the first place :-)

9:14 We'll be done with it this month, FWIW.

9:15 edw: moogatronic: Thanks too! Was AFK; didn't see your comments.

9:16 moogatronic: edw: no problem. =)

9:41 fdaoud: cemerick: I think it's 2-3 months after the authors are done. copyediting, typesetting, indexing, and production.

9:42 cemerick: fdaoud: I've been told 4-6 weeks. *shrug*

9:42 We'll see how good O'Reilly is, I guess. :-P

9:42 edw: I 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?

9:42 fdaoud: cemerick: do you guys do the indexing?

9:42 cemerick: nope

9:42 edw: (I've tried ,sayonara ,quit and ,close)

9:43 cemerick: Isn't indexing an automated process these days?

9:43 fdaoud: cemerick: indexing, yes. indexing worth something, no.

9:44 cemerick: That's interesting.

9:44 jcromartie: how 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(-)"

9:44 mdeboard: Ha.

9:46 cemerick: fdaoud: I would have thought some n-gram analysis would get you 90% of the way there.

9:47 fdaoud: cemerick: sure, professional indexers must have tools to do a lot of the grunt work, but it's definitely a wholly automated process.

9:47 *definitely not

9:47 at some point at manning authors had to produce the index. not sure if that's still the case.

9:48 cemerick: ouch

9:48 That may have been enough to keep me from doing the book! :-P

9:49 Especially since I wouldn't have the tools to do the grunt work.

9:49 fdaoud: yeah. to me that's a service the publisher must provide.

9:51 kzar: cemerick: I was just scrolling through the history to see what I missed and I wondered, what's the book about?

9:51 cemerick: kzar: http://oreilly.com/catalog/0636920013754/

9:52 kzar: When it's done will there be a version for Kindle?

9:53 cemerick: Should be, yeah.

9:54 kzar: Cool I'll wait for that then

9:55 jcromartie: I'd imagine you could build an index from metadata added to the text itself

9:55 by basically annotating words you want in the index, kind of like WikiLinks or something

9:56 cemerick: oh, the pain ;-)

10:00 fdaoud: jcromartie: 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:01 it's all bad :(

10:03 theignorati: is there a function like time that doesn't print the result but returns it as well as the result of the expression?

10:03 jweiss: any 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:04 theignorati: or should I just copy the time macro and modify it

10:05 andrewclegg: theignorati: http://pastie.org/2773296

10:05 I happened to write my own just yesterday :-)

10:06 use it like: (timed + 2 3)

10:06 gives [5 <time_in_milliseconds>]

10:08 theignorati: thanks!

10:11 andrewclegg: theignorati: btw that catches and *returns* the exception as I wanted to count how many exceptions I got (and how long they took)

10:11 you may want to do something less crazy, like just letting them bubble thru

10:22 gtrak: does cliff click's final fields stuff apply to clojure?

10:23 the optimizations he mentions in last couple of blog posts

10:30 http://www.azulsystems.com/blog/cliff/2011-10-27-final-fields-part-2

10:36 Fossi: gtrak: how would that apply or not?

10:36 gtrak: Fossi, 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:37 I feel like it should apply, I just don't know enough to say definitively

10:38 Fossi: you mean whether an optimization would do anything performancewise?

10:38 gtrak: yes

10:38 apparently it would for jruby

10:41 Fossi: ah, ok

10:46 cemerick: andrewclegg, theignorati: you might want to prefer criterium (by hugod) instead: https://github.com/hugoduncan/criterium/

10:47 theignorati: yes I saw that but that's like for testing how fast things are and comparing them?

10:48 andrewclegg: cemerick: 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:48 theignorati: I want this so I can add it to my Compojure app and log how fast things are

10:48 then look at pretty graphs all day

10:58 patchwork: anyone here use sandbar? looks like it recently stopped being maintained.

10:58 is there a canonical fork yet?

10:58 I just found out that it was the reason clojure.contrib.jar was getting added to my project

11:08 So, I am getting to the point where I may have to switch from 1.3 back to 1.2

11:08 I feel like I am fighting a losing battle here

11:13 is that where everyone is at? have we abandoned 1.3?

11:14 gtrak: patchwork, have people abandoned python 3?

11:15 patchwork: gtrak: I think they have. I know a lot of people who use python, and no one uses python 3

11:17 The 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:17 gtrak: it just takes a little time i think

11:17 patchwork: I think python 3 is the perfect example

11:17 there comes a point when I have to balance idealism with getting work done

11:18 gtrak: well, people are going to scratch their own itches, it might not be that hard to port sandbar over

11:20 seeing as you have an itch :-)

11:22 patchwork: gtrak: 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:23 gtrak: perhaps the sandbar google group might have something to say about it? I know, this is kinda the rub with open source

11:23 patchwork: gtrak: that is why the temptation to just revert to 1.2 and quit fighting it grows stronger

11:24 gtrak: yea, the clojure contrib split is probably more of a pain than 1.3

11:24 has no one ported old contrib to 1.3?

11:24 patchwork: gtrak: as I understand no one is going to

11:24 the idea is to let each library continue on its own, so that they don't have to coordinate releases etc

11:25 contrib as a whole moved way slower than any of its subprojects

11:25 Raynes: IIRC, there is an unofficial old-contrib compiled against 1.3.

11:25 patchwork: which is the reason for the splitup in the first place

11:25 Raynes: But please, for the love of God, don't use it.

11:25 patchwork: Raynes: exactly, that would just exacerbate the problem

11:26 That is the deal, I believe in the split, monolithic contrib was/is a problem

11:26 gtrak: maybe we just need a script to munge the source of stuff using contrib 1.2 to the new libs

11:26 how hard would that be?

11:26 patchwork: gtrak: 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:26 Raynes: Extremely.

11:27 patchwork: so updating one library ends up being a task of updating a whole tree of libraries

11:27 gtrak: ugh

11:27 patchwork: or figuring out how to replicate the functionality without the library

11:27 which takes debugging, deep understanding of what it is doing there in the first place

11:27 etc etc

11:28 gtrak: yea, looks like sandbar is a few thousand lines

11:28 patchwork: I think I am talking myself into reverting to 1.2, I just don't want to give up on the dream

11:28 Like, if I revert, then I am becoming part of the problem

11:28 gtrak: noir has some of that functionality too, doesn't it?

11:29 TimMc: Are there any major libraries that maintain both 1.2 and 1.3 versions?

11:29 patchwork: but if I stay, I am taking on the charge of updating the entire clojure ecosystem

11:29 TimMc: I suppose you could use separate git branches...

11:29 dnolen: TimMc: core.match supports 1.2, 1.3 and ClojureScript. core.logic supports 1.2 and 1.3

11:29 patchwork: gtrak: I have not heard of noir

11:29 dnolen: but I also didn't wait around to try out 1.3

11:29 TimMc: dnolen: How do you manage it?

11:30 Raynes: It isn't really that hard to write Clojure than runs on both 1.2 an 1.3.

11:30 patchwork: TimMc: most libraries that are being maintained have both 1.2 and 1.3 support

11:30 gtrak: patchwork, http://webnoir.org/autodoc/1.2.0/index.html

11:30 cemerick: TimMc: nREPL supports 1.1, 1.2, and 1.3; same for clutch

11:30 patchwork: Raynes: I agree, really it is using contrib that is the problem

11:30 cemerick: Hrm, sorry, clutch is 1.2+

11:31 TimMc: Raynes: My question is how the sausage gets made. Separate git branches? Automatic conversion scripts that munge headers and cut releases?

11:31 patchwork: TimMc: I have seen people use lein multi-deps

11:31 cemerick: That's just for testing

11:31 It doesn't take much to make the same source files compatible with both.

11:32 patchwork: cemerick: Ah I see

11:32 cemerick: i.e. no sausage :-)

11:32 patchwork: cemerick: Yeah, the language itself really only has the ^:dynamic issue

11:32 the big problem is all the requiring of contrib that happens

11:32 cemerick: some old contrib libraries are 1.3-safe

11:33 it's a big hairball to pull in, but it's not like the whole thing is marred.

11:33 patchwork: cemerick: sure, but you still have to make the change

11:33 cemerick: What change?

11:33 patchwork: track down where the new library is (since it's not in contrib)

11:33 bsod1: how can I use clojure 1.3 with counterclockwise?

11:34 patchwork: change the require from 'clojure.contrib.* to whatever it is now

11:34 cemerick: clutch still just depends upon contrib 1.2.0; it just happens to use 1.3-safe namespaces

11:34 TimMc: patchwork: Was just referring to contrib deps, not language features.

11:34 cemerick: (a situation we'll be eliminating eventually, but it's not a huge priority)

11:34 patchwork: : (

11:36 cemerick: heh

11:36 dnolen: TimMc: I realized early on never to use anything from contrib. I rarely used binding. So supporting 1.2 and 1.3 was easy

11:36 cemerick: the most significant dependency is the http agent stuff, which has no immediate corollary

11:36 llasram`: OOC, why is `add-classpath' deprecated (and not seem to work at all in 1.3)?

11:36 dnolen: supporting ClojureScript is easy if you're library is macro-centric.

11:37 llasram`: because it's too hard to get working everywhere and noone has owned it.

11:38 cemerick: llasram`: it's very limited, and not generalized. Maybe try https://github.com/cemerick/pomegranate

11:38 llasram`: 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:39 cemerick: llasram`: by all means, file a bug, especially if you have a repeatable testcase

11:39 I'd very much like to get pomegranate working well.

11:39 llasram`: cemerick: Oh, is it supposed to work under 1.3?

11:40 I was assuming that whatever broke core/add-classpath for 1.3 was doing the same for pomegranate

11:40 cemerick: Yes, pomegranate should work under 1.2 and 1.3

11:40 * cemerick only uses 1.3 these days

11:41 llasram`: Ok, cool. I'll make sure I don't have anything funky in my environment

11:41 cemerick: Nah, 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:44 TimMc: dnolen: I see, thanks.

11:47 llasram`: 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:47 jamiltron: dnolen: 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:48 dnolen: jamiltron: hmm I never messed w/ it much, only in the context of Penumbra. I don't recall choppy display issues.

11:48 jamiltron: since that involves a lot of interop calls, probably a good idea to have reflection warnings on.

11:49 jamiltron: dnolen: I noticed that penumbra's tests often have choppy display too. And I've ran the tests on three different machines.

11:49 dnolen: good idea

11:49 dnolen: jamiltron: huh, what OS ?

11:50 jamiltron: dnolen: OSX, Arch Linux x64, and Windows 7 x64

11:50 dnolen: I would sometimes see choppiness as the JVM gets warmed up, but that would get smoothed out.

11:50 jamiltron: Pretty much everything I could get my hands on

11:50 dnolen: jamiltron: yeah I ran them on OS X, asteroids, tetris, pong were all pretty smooth.

11:51 jamiltron: Huh, that's interesting.

11:51 dnolen: jamiltron: http://ideolalia.com/creating-a-simple-game-in-clojure

11:52 it was always as smooth as the linked video.

11:52 jamiltron: dnolen: are you running it via lein?

11:52 dnolen: jamiltron: I would run via swank

11:53 jamiltron: I'm assuming you're running the JVM w/ a good chunk of memory in server mode.

11:55 jamiltron: dnolen: I actually have a poor understanding of the jvm, so I should look into that :P

11:57 dnolen: jamiltron: 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:58 jamiltron: dnolen: Are there any good articles or tutorials on running the jvm in server mode? I'm pretty green regarding all this stuff.

12:04 zilti: Are there some kind of "access modifiers" for clojure functions?

12:05 clgv: jamiltron: java -server .... ;)

12:06 "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:07 dnolen: jamiltron: http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Ftprf_tunejvm.html

12:07 jamiltron: the important thing is -server and the memory options

12:07 jamiltron: dnolen: thank you!

12:10 cemerick: Is there any justifiable use of aset-XXX rather than just using aset (along with an appropriate hint on the array in question)?

12:11 llasram`: hrm, swank may be causing an issue there…

12:11 mabes: is this the best reference documentation about 1.3's new primitive support? http://dev.clojure.org/display/doc/Documentation+for+1.3+Numerics

12:12 it doesn't talk about primitives in collections which is what I'm curious about

12:12 cemerick: There is a primitives-bearing vector implementation (see vector-of)

12:13 Beyond that, values in collections remain boxed.

12:13 mabes: oh, I guess I got the wrong impression by following a recent thread on the list

12:15 cemerick: right, aset-XXX works with multidimensional arrays

12:20 mabes: cemerick: thanks for the vector-of tip

12:20 dnolen: cemerick: there's no reason to use aset-XXX ever, it does not inline - I think its there purely for higher order usage.

12:23 mabes: so, if you wanted to sum a collection of primitives you can't use reduce... you have to write a loop, correct?

12:23 dnolen: mabes: areduce

12:23 cemerick: mabes: see areduce

12:23 heh

12:24 dnolen: but this:

12:24 ,(aset ^ints (make-array Integer/TYPE 5 5 5) 1 1 1 (int 5))

12:24 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: argument type mismatch>

12:24 cemerick: ,(aset-int (make-array Integer/TYPE 3 4 5) 1 1 1 (int 5))

12:24 clojurebot: 5

12:25 cemerick: The 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:26 dnolen: cemerick: 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:28 cemerick: right, this works:

12:28 ,(aset (make-array Integer/TYPE 5 5 5) 1 1 1 (Integer. 5))

12:28 clojurebot: 5

12:28 mbac: when i seq "1000" it becomes (\1 \0 \0 \0)

12:28 what is that representation?

12:28 cemerick: multidim aset goes through apply,

12:28 mbac: and how do i make it a string again?

12:28 cemerick: (class \c)

12:28 ,(class \c)

12:28 clojurebot: java.lang.Character

12:29 cemerick: (apply str (seq "foo"))

12:32 Raynes: mbac: That would be a sequence of characters.

12:32 jamiltron: dnolen: Thanks for all your help. I don't have my issue fixed yet but I think I'm getting closer.

13:00 ejackson: what is the accepted way to extend a protocol to clojure.lang.PersistentHashMap and clojure.lang.PersistentArrayMap with the same code ?

13:01 jcromartie: ejackson: can you implement it on a shared superclass

13:01 ?

13:02 ejackson: yeah, why not... suggestions ?

13:05 i guess that's lazy... I'll go look it up *sheepish*

13:05 cemerick: ejackson: IPersistentMap

13:06 ejackson: cemerick: you are a superhero ! I'm bringing you a cape at the conj... Thanks.

13:06 cemerick: :-)

13:06 ejackson: cemerick: btw - were you also thinking of Bayesian nets during Sussman's talk ?

13:07 cemerick: A union jack as a cape would be not bad :-P

13:07 ejackson: seemed like a node that stored a distribution and updated it on upon new distributions on its inputs would hack it.

13:08 cemerick: ejackson: 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:08 ejackson: lol. No no, we don't have supreheroes here, "overly keen".

13:08 cemerick: The thing about biological systems is that there's lots of scale-specific processing, vision being the canoncial example.

13:09 technomancy: ejackson: what about Angle Grinder Man?

13:09 ejackson: OK, the propogators was new to me, so I was tacking backwards.

13:09 technomancy: http://www.google.com/images?q=angle%20grinder%20man&ie=utf-8&oe=utf-8&aq=t&sa=X&oi=image_result_group

13:09 ejackson: technomancy: LOL !

13:09 jcromartie: the fact that you can extend an interface with a protocol implementation is really brilliant

13:10 cemerick: At 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:10 ejackson: ^

13:10 feature-isa-feature-isa-feature, etc.

13:11 ejackson: cemerick: yeah, I've not thought about scale either.

13:11 cemerick: e.g. http://en.wikipedia.org/wiki/Neocognitron

13:13 ejackson: interesting. 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:15 but the notion of updating distributions in response to fresh data and propogating that all about the place is a natural fit

13:32 cemerick: ejackson: 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:33 ejackson: cemerick: yeah, I hate to invoke Dementors, but the probability monad really seemed to be useful for that sort of thinking.

13:33 cemerick: *probably* just a pipe dream until I level up quite a lot, but oh well.

13:33 ejackson: naaaaah

13:33 cemerick: Dementors?

13:33 some harry potter thing?

13:34 * cemerick has never watched/read harry potter

13:34 ejackson: i'm not going to ask

13:35 Raynes: cemerick: You don't know what you're missing. Not sure I'd have survived a life without every flavor beans.

13:35 ejackson: for the record, dementors are nasty bits of spectral horror that suck the joy out of everything

13:35 cemerick: ejackson: 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:35 ejackson: i'm always stunned to read tutorials like "monads are like x", when x is clearly Dementors, in all cases.

13:35 or should be, but never is.

13:35 pjstadig: technomancy: with your talk recently about Dune, did you see this? http://twitter.com/#!/msimoni/status/129916820076503040

13:35 redinger: Funny, 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:36 cemerick: Raynes: My first impression that it was a kiddie LoTR, so I didn't bother.

13:36 Raynes: cemerick: 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:37 As a whole the series is good.

13:37 ejackson: cemerick: 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:37 cemerick: hah!

13:37 Makes me sad for the world.

13:40 mdeboard: Do any of the bots have github support?

13:40 blooper: what 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&lang=clojure&lang2=java)

13:41 hugod: cemerick: the stanford ai-class is covering bayesian network theory

13:42 cemerick: redinger: Whoa, that has ~70 chapters!

13:42 Not quite sure what to make of it.

13:42 redinger: Fan Fic :)

13:42 cemerick: hugod: I heard!

13:42 That means that everyone at the conj is going to own my ass when I give my talk :-P

13:43 ejackson: cemerick: I really doubt that

13:43 have I recommended this http://www.amazon.co.uk/Probabilistic-Graphical-Models-Principles-Computation/dp/0262013193/ref=sr_1_1?ie=UTF8&qid=1319823371&sr=8-1 ?

13:43 chewbranca: harry potter and the methods of rationality was a surprisingly good read

13:44 I stay away from fan fiction, but checked it out after seeing it top HN 3 times

13:44 hugod: cemerick: it was poorly explained - I think that particular lesson will be responsible for a huge drop out rate

13:44 ejackson: its solid, but I keep failing to get into it.

13:44 cemerick: ejackson: 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:44 Of course, in addition to the Pearl and such.

13:45 ejackson: so many books, so little few hours

13:47 cemerick: ejackson: 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:47 ejackson: redinger: LOL, I was just making it up, how funny.

13:48 cemerick: Also, Darwiche is at UCLA; I took the proximity to Pearl as a positive signal.

13:48 ejackson: cemerick: circuits, yes, the other thing Sussman kept invoking for me were FPGAs

13:49 cemerick: well, bayes net -> circuit -> clojure code is my roadmap :-)

13:49 * cemerick has never done any hardware hacking

13:49 technomancy: pjstadig: niiiice

13:50 ejackson: gotta hop. Its Friday in England, I have sausages and ale to find.

13:50 cheers all

13:50 dnolen: cemerick: http://okmij.org/ftp/kakuritu/index.html is pretty fascinating, mixing logic programming with probabilistic programming.

13:51 technomancy: sausages and ale... I should go to England.

13:54 gtrak: hugod, are you also taking the ml class? I think I'm going to pull back on the AI one

13:55 mdeboard: gtrak: why's that?

13:55 gtrak: also working a full-time job and having a social life :-)

13:55 mdeboard: ah

13:55 gtrak: the ml class programming assignments seems like it'll be more fun, and there's some overlap

13:56 hugod: gtrak: I am, and it is a lot less demanding than the ai class

13:57 gtrak: yea

13:57 hugod: luckily I have seen most of the maths before

13:57 gtrak: i've done some statistics, but it was a long time ago

13:59 mdeboard: ,(+ 1 2)

13:59 clojurebot: 3

13:59 mdeboard: wake up clojurebot

14:00 gtrak: 4

14:01 mdeboard: ,commits

14:01 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: commits in this context, compiling:(NO_SOURCE_PATH:0)>

14:02 mdeboard: ,commits mattdeboard/saved-search

14:02 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: commits in this context, compiling:(NO_SOURCE_PATH:0)>

14:02 mdeboard: Hm

14:25 srid: so ... (range) can't be used with *only* a "start" argument?

14:26 ,(take 5 (drop 3 (range)))

14:26 clojurebot: (3 4 5 6 7)

14:26 srid: no better way?

14:29 gtrak: whoa, ([] (range 0 Double/POSITIVE_INFINITY 1))

14:32 llasram`: To POSITIVE_INFINITY and... no further!

14:34 gtrak: it's bugged

14:34 ,(range Double/POSITIVE_INFINITY (- Double/POSITIVE_INFINITY 1))

14:34 clojurebot: ()

14:36 Raynes: srid: ##(take 5 (iterate inc 5))

14:36 lazybot: ⇒ (5 6 7 8 9)

14:36 Raynes: That's essentially range with only a start value.

14:42 gtrak: ,(+ 5 (range 5))

14:43 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.Number>

14:43 theignorati: how would I get the first part of an expression in a macro, like (first `(println "hello")) ?

14:44 jcromartie: theignorati: can you restate the question?

14:44 gtrak: ,(map (partial + 5) (range 5))

14:44 clojurebot: (5 6 7 8 9)

14:47 theignorati: heh

14:48 how would a macro look that does this: (ma (println "foo")) => (handle-name "clojure.core/println") (println "foo")

14:50 stuartsierra: ,(resolve 'println)

14:50 clojurebot: #'clojure.core/println

14:50 stuartsierra: ,(name (resolve 'println))

14:50 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.Named>

14:51 stuartsierra: ,(let [m ((resolve 'println))] (str (name (:namespace m)) "/" (name (:name m)))

14:51 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

14:51 stuartsierra: ,(let [m ((resolve 'println))] (str (name (:namespace m)) "/" (name (:name m))))

14:51 clojurebot: #<NullPointerException java.lang.NullPointerException>

14:51 stuartsierra: eh whatever

14:51 hiredman: .sym and .ns

14:52 stuartsierra: that's cheating

14:52 hiredman: thats all there is

14:52 stuartsierra: (meta (resolve 'println))

14:52 ,(meta (resolve 'println))

14:52 clojurebot: {:ns #<Namespace clojure.core>, :name println, :arglists ([& more]), :added "1.0", :static true, ...}

14:52 technomancy: yeah, it always struck me as a bit funny that namespaces aren't named

14:52 theignorati: doesn't have to be the full name, I just don't get how to get it at all in a macro

14:53 stuartsierra: (defmacro foo [form] `(do (something-with ~(first form)) ~form))

14:54 theignorati: cheers

14:54 cemerick: namespaces could use some sprucing up in general

14:55 stuartsierra: There's always tension there: adding more stuff for interactive development, removing stuff for leaner/faster production code.

14:57 cemerick: Sure.

14:57 * technomancy dreams of a world where functions have their source attached as metadata

14:57 technomancy: but I can understand reluctance to add flags for things like that

14:57 cemerick: I'm sure I'll agitate in that direction eventually

14:58 I'd really like to see namespaces become ARefs, not just AReferences.

14:59 theignorati: is there a way of checking if a something supports metadata?

14:59 cemerick: Transactional code loading would be even better, but I'm willing to be incremental. :-)

15:10 stuartsierra: The problem with transactional code loading is the same problem as Vars: every function call is a volatile read.

15:10 seancorfield: someone just tweeted that try-clojure.org is down (nginx bad gateway error)

15:10 stuartsierra: theignorati: (instance? IMeta %)

15:14 joegallo: IMeta if you want to read it, IObj if you want to write it, iirc.

15:15 jcromartie: technomancy: can functions have metadata?

15:18 stuartsierra: yes

15:19 ibdknox: they can't in CLJS right?

15:20 stuartsierra: not sure

15:20 Most runtime stuff doesn't exist in ClojureScript.

15:20 ibdknox: yeah

15:21 dnolen: ibdknox: 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:22 if there was you could just reify IMeta + IFn

15:22 ibdknox: yeah

15:22 that would be cool

15:24 moomin: Hi, I was wondering if there's a sensible way to tell whether code is running under lein-ring.

15:25 I've tried various tricks with hooks but I'm banging my head against a brick wall. :(

15:25 dnolen: ibdknox: extending IFn just needs a special meaning, implement call.

15:27 cemerick: stuartsierra: But every addition to ns-interns/aliases/publics doesn't have to be.

15:29 stuartsierra: That's the cheap part.

15:29 cemerick: gotta start somewhere

15:29 stuartsierra: Namespaces can change without changing any running code.

15:29 But if you really want hot code changes, you have to change root Var bindings.

15:31 cemerick: That's not a problem; I can already attach watches to vars.

15:32 stuartsierra: cemerick: So what is it you're looking for exactly?

15:32 cemerick: There'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:34 stuartsierra: I want my tooling to get notified of code changes in a REPL, rather than it needing to poll.

15:34 stuartsierra: ahh

15:34 cemerick: :-)

15:35 mabes: I'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:35 (I got the :static from http://www.assembla.com/wiki/show/clojure/Enhanced_Primitive_Support)

15:35 stuartsierra: :static is no longer used; it was only an experiment

15:35 Assembla is deprecated, use http://dev.clojure.org/

15:35 mabes: okay, because it didn't seem like it made a difference

15:36 cemerick: Thus, 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:37 * cemerick ponders the wisdom of putting a modified c.l.Namespace classfile on the classpath of all REPLs started from within ccw…

15:38 stuartsierra: HAHAHAHA

15:39 cemerick: stuartsierra: I was joking of course, but now that I think of it…

15:40 stuartsierra: Why not put the hook in the editor, before it gets to the Clojure compiler?

15:41 Or capture anything that returns a Var, like def/defn.

15:42 cemerick: oh, send each form one at a time?

15:42 Hrm.

15:44 This 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:44 stuartsierra: eek

15:45 ibdknox: we just need our own IDE ;)

15:46 cemerick: stuartsierra: 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:46 stuartsierra: interesting

15:46 cemerick: By the way, how far did you get with your ClassLoader thingy?

15:46 cemerick: That's how ccw is able to maintain a comprehensive namespace browser for a given project.

15:47 stuartsierra: you mean this? https://github.com/cemerick/pomegranate

15:47 stuartsierra: yes

15:47 cemerick: it works :-)

15:47 Raynes: "(I got the :static from http://www.assembla.com/wiki/show/clojure/Enhanced_Primitive_Support)"

15:47 lazybot: Assembla is deprecated. Use http://dev.clojure.org

15:47 cemerick: apparently not under swank for some reason

15:47 Raynes: stuartsierra: ^ There you go.

15:47 lazybot automates your life. Embrace it.

15:47 cemerick: ibdknox: Laurent has tossed around the notion of producing a Clojure-only Eclipse distribution.

15:48 Building an editor/IDE from scratch terrifies me.

15:48 ibdknox: eh

15:48 it's not so bad ;)

15:48 cemerick: Given resources, no. Handful of part-time-at-best volunteers? Eeek.

15:49 Raynes: cemerick: 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:49 stuartsierra: cemerick: Ha, clojure-mode highlights add-classpath in red

15:49 ibdknox: cemerick, yeah, it's an interesting thing to think through. I think you can steal the base editor from someone pretty easily

15:49 Raynes: Though, I didn't have much motivation given that I never intended to use it. Mostly just planned to look at it and smile.

15:50 cemerick: Raynes: emacs is 50MB, and that's before all the additional packages… 0.o

15:50 Raynes: (< 50 140) = true

15:50 ibdknox: Raynes, are you sure?

15:50 Raynes: &(< 50 140)

15:50 lazybot: ⇒ true

15:50 cemerick: ibdknox: The question is, from who.

15:50 ibdknox: woah

15:50 it' is

15:51 :p

15:51 cemerick, depends on the platform we target :)

15:51 Raynes: ibdknox: Also, I looked at Noir a few days ago. Fantastic. I'm moving try-clojure to it on my next round of revisions.

15:51 It's so magical.

15:51 * ibdknox waves a wand around

15:51 cemerick: ibdknox: orthogonal concern, no?

15:51 Raynes: I could have swore I saw a unicorn run through my peripheral vision.

15:52 mefesto: ibdknox: lemme +1 that... I've been messing with it the past two days. great stuff :)

15:52 ibdknox: Raynes, I've been chasing him for a while. Bastard won't stop moving.

15:52 dnolen: ibdknox: http://dev.clojure.org/jira/browse/CLJS-96

15:52 ibdknox: dnolen, thank you, sir!

15:53 cemerick, is it really orthogonal? I was considering doing it in HTML, that would change what editor was used dramatically

15:54 cemerick: ha

15:54 ibdknox: cemerick, to be clear, not as a web app, just using a webkit view or something locally

15:54 cemerick: oh, ok

15:54 *whew*

15:54 ibdknox: haha

15:54 yeah.

15:54 * cemerick almost had to mock ibdknox

15:54 ibdknox: I'm not crazy.

15:54 well

15:54 I am crazy... but not stupid. (most of the time) ;)

15:55 that 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:55 cemerick: I dunno, I think you're shaving about the same order of magnitude of goats no matter what platform you target.

15:55 ibdknox: maybe a solid java alternative exists that's even better though

16:04 tsdh: Hi. 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:05 Or even better, only for that single leiningen task.

16:06 Adding the required project to :dev-dependencies doesn't do the trick.

16:10 cgray: is there documentation for the reader macros that one generally uses in defining macros?

16:11 tsdh: You mean, ~, ~@, and `?

16:11 Raynes: Syntax quote?

16:11 cgray: tsdh: yeah

16:12 tsdh: Hm, indeed http://www.clojure.org/macros doesn't contain them...

16:13 Raynes: http://clojure.org/reader

16:13 gtrak: tsdh, could also use robert.hooke potentially, this would use your dev dependencies

16:13 Raynes: tsdh: cgray: ^

16:13 cgray: Raynes: thanks

16:16 tsdh: gtrak: 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:16 dnolen: ibdknox: 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:16 gtrak: tsdh, yea, i don't know why it doesn't work, it probably should

16:17 but just a suggestion

16:17 ibdknox: dnolen, codemirror is a bit nicer than ACE these days, but yes

16:17 dnolen, problem with Clooj is that it's starting completely from scratch

16:17 dnolen, and as cemerick said, without a few truly dedicated folks, that's a monumental undertaking

16:18 cgray: so i'm having a macro problem: http://pastebin.com/Hj53Q221

16:18 dnolen: ibdknox: is codemirror based off of Ace?

16:18 tsdh: gtrak: 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:18 ibdknox: dnolen, different effort I believe

16:18 dnolen, very active

16:19 dnolen, http://codemirror.net/mode/clojure/index.html

16:19 it does the indenting correctly and everything ;)

16:19 gtrak: do some tasks use different dependencies than the dev-dependencies? obviously test uses dev-dependencies

16:20 or possibly test uses regular dependencies, hmm

16:20 dnolen: ibdknox: 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:20 cemerick: ibdknox: Reading stuff like that about web-based code editors is exactly why I'm skeptical of the entire endeavor ;-)

16:21 technomancy: tsdh: dependencies that are needed by lein tasks need to be specified as dev-dependencies

16:22 using hooke should be a measure of last resort

16:22 tsdh: if you need access to regular dependencies you have to use eval-in-project

16:22 dnolen: cemerick: 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:23 moogatronic: I may have missed this already, but what is the problem that CodeMirror is trying to solve?

16:23 * ibdknox shields his eyes from the evil font rendering

16:23 cemerick: dnolen: font rendering?

16:23 dnolen: cemerick: yes they can't even get that right.

16:23 ibdknox: no

16:23 dnolen: much less the feature set

16:23 hiredman: maybe the javafx code dump will make it better

16:23 ibdknox: now*

16:24 cemerick: I mean, what font rendering issues are you talking about?

16:24 Raynes: cgray: Do you plan to actually use this macro, or are you just doing it for fun?

16:24 dnolen: cemerick: nuff said ;)

16:24 cgray: Raynes: I would like to use it

16:24 ibdknox: in any case

16:24 Raynes: Don't. Just catch the divide by zero exception and return nil.

16:24 ibdknox: it doesn't make sense to write an editor from scratch

16:24 so my goal would be to start with that in hand

16:24 moogatronic: Fonts look okay to me in IntelliJ on os x. I think the font rendering is platform dependent?

16:24 ibdknox: and build around it

16:25 technomancy: is jedit any good?

16:25 cemerick: moogatronic: Yeah, eclipse does quite well, too. Still not sure what dnolen means.

16:25 hiredman: http://gochev.blogspot.com/2009/08/ria-technologies-lets-compare-font.html

16:25 technomancy: I'm kind of surprised I don't hear about it more often

16:25 cemerick: technomancy: man, jedit keeps on keepin' on, all these years.

16:25 cgray: Raynes: good idea

16:25 tsdh: technomancy: Ah, stupid me. I correctly added the project as :dep-dependency, but I forgot to run "lein deps" afterwards.

16:26 technomancy: tsdh: add :checksum-deps true to project.clj

16:26 then it will happen for you whenever your dependencies change

16:26 abrooks: Anyone have experience with jswat Clojure debugging?

16:26 dnolen: technomancy: 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:26 cemerick: It's supported, and used by many, but it's sort of a death watch.

16:26 technomancy: dnolen: sure, I don't mean as a competitor to Emacs, but as a bootstrapping mechanism for something clooj-like

16:27 dnolen: technomancy: there's already a Clojure mode, but it's not as nice as Clooj at least from the parentheses matching REPL experience.

16:27 ibdknox: cemerick, 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:27 hugod: technomancy: does checksum-deps work for dev-dependencies when :local-repo-classpath is set?

16:27 tsdh: technomancy: Awesome, thank you.

16:27 technomancy: hugod: 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:27 ibdknox: cemerick, also, the sheer weight of it both in the size sense and the general baggage the platform carries with it is rather undesirable

16:27 cemerick: ibdknox: That's fair, but perhaps also a worthy discussion. :-)

16:27 moogatronic: ibdknox: 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:28 technomancy: it may only affect tasks that use eval-in-project

16:28 moogatronic: you're right about the assumptions for sure.

16:28 stuartsierra: I think to really be *better* than existing tools, a Clojure IDE would have to get away from source-code-as-text-files.

16:28 abrooks: Some 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:28 cgray: Raynes: 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:28 dnolen: stuartsierra: and replace that w/ what?

16:28 technomancy: hugod: 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:28 stuartsierra: dnolen: Code-as-data. All the way down.

16:28 hiredman: seems unlikely

16:29 ibdknox: moogatronic, we were always impressed by intelli-j when I worked on VS

16:29 moogatronic: the 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:29 hiredman: you would have to convert to text files anyway for the compiler

16:29 Raynes: (defmacro possibly-infinite [body] `(try ~body (catch ArithmeticException e# (when-not (re-find #"Divide by zero" (.getMessage e#)) (throw e#)))))

16:29 moogatronic: emacs makes it seem like i'm having fun while programming. IDEs remind me of my enterprisey days.

16:29 Raynes: cgray: ^ In any case, there is a macro that catches that error.

16:29 technomancy: hiredman: you can skip the reader

16:29 moogatronic: (as i type this, I have intelliJ loaded with java and scala code.. heh..)

16:29 technomancy: serializable-fn style

16:29 hiredman: maybe for dev

16:29 I guess

16:30 ibdknox: moogatronic, you should have seen my designs for VS-next :)

16:30 stuartsierra: hiredman: no, the compiler takes data structures.

16:30 technomancy: not saying it's a good idea, but it's probably feasible

16:30 hiredman: stuartsierra: Compiler/compile takes a LispReader

16:30 moogatronic: ibdknox: minimalized VS?

16:30 stuartsierra: easily fixed

16:30 hiredman: *shrug*

16:30 seems unlikely

16:31 ibdknox: moogatronic, very, it was much lighter weight, while being much more contextual with information when you needed it

16:31 moogatronic, the concepts would work even better for a Clojure IDE actually :)

16:31 moogatronic: my only objections to anything VS is that it requires windows to run it. =)

16:31 ibdknox: haha

16:31 that too

16:31 hiredman: there is certainly a lot of room for richer text abstractions and a bridge to clojure datastructures

16:32 drag and drop of forms

16:32 ibdknox: sounds like the makings of a structured editor ... :-p

16:33 dnolen: ClojureScript + webkit + websocket + nRepl, would be fun.

16:33 the biggest pain being webkit

16:33 cgray: Raynes: I got the original to work: all i needed to do was replace (quote ~args) with (list ~@args)

16:33 hiredman: sure, but you wouldn't want to abandon text at the bottom, you have an overlay of structure data

16:33 technomancy: yeah, I'm not eager to port git and emerge

16:33 hiredman: :)

16:34 cgray: Raynes: 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:34 ibdknox: I guess paredit is very close to the notion of a structured editor

16:34 cemerick: It 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:35 ibdknox: cemerick, the key is actually not to have it surround it :)

16:35 hiredman: cemerick: excited? bleh, sounds annoying, I'll stick with trying to decode mp3s in clojure in my spare time, thank you very much

16:35 cemerick: ibdknox: git, profiling, debugging, introspection (code completion / hinting), etc etc

16:36 hiredman: need more hooks exposed in the compiler

16:36 ibdknox: cemerick, done correctly that's all just in an editor

16:36 hiredman: clojure's compiler as a service

16:36 technomancy: "any discussion of rewriting Emacs expands until it becomes a discussion of rewriting an OS" -- some corollary to jwz's law

16:36 dnolen: cemerick: you're assuming everyone wants / needs that all in one place. Where's the $$$!

16:36 cemerick: dnolen: What's the "other place" we're all going to get it from?

16:37 ibdknox: I look forward to your becoming available in December, then. :-)

16:37 dnolen: Ruby on Rails succeeded w/ TextMate which didn't exactly work that well compared to IDEs on the surface.

16:37 cemerick: :-(

16:37 Not the kind of role model I'd like.

16:37 moogatronic: TextMate seemed sort of popular in the same way that Instragram is though.

16:38 dnolen: cemerick: people want different things.

16:38 ibdknox: cemerick, maybe I'll bring some "drawings" to the conj :)

16:38 cemerick: True enough, and they can coexist.

16:38 ibdknox: what's wrong with TextMate? other than its abandonment?

16:38 moogatronic: tho, if i could add Text Mates project drawer to my emacs setup, i'd be super happy.

16:38 ibdknox: moogatronic, that has to exist... VIM has nerdtree

16:39 dnolen: ibdknox: nothing. TextMate shows that plenty of people weren't satisfied w/ complex IDEs

16:39 zilti: If 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:39 technomancy: ibdknox: what's wrong with TM is that it can't be extended in-process

16:39 cemerick: TM is great. Having "just" a text editor doesn't cut it for real work (or, not for how I work, anyway).

16:39 moogatronic: ibdknox: i've used ECB before, but it's a bit combersome

16:39 Raynes: Sublime Text 2 is nice, but I nearly hung myself while trying to write Python plugins for it.

16:39 zilti: moogatronic: There's e.g. sr-speedbar or ECB

16:39 technomancy: you have to work through its explicit plugin interface, which by definition isn't flexible enough. no dogfooding.

16:39 dnolen: cemerick: how *you* is the key idea here :) you have something comfortable and that's what you like.

16:39 ibdknox: technomancy, that's fair

16:40 technomancy: moogatronic: why does it have to be visual?

16:40 ibdknox: fun fact: many of the devs on the VS Editor used VIM

16:40 moogatronic: technomancy: cause i am a weak minded former enterprise java developer!

16:40 technomancy: moogatronic: at least you're honest. =)

16:40 ibdknox: I've never bought the "you need and IDE" argument, ironically

16:40 cemerick: dnolen: Fully aware. :-)

16:41 zilti: I'd say that, with Java, you definitely need an IDE. But with languages like Clojure you don't

16:41 moogatronic: technomancy: honestly, i just get lost if my projects have more than a couple of directories worth of files.

16:41 my projects lately have been all over the map with respect to languages, data, etc...

16:41 currently i'm working on a Hadoop/Pig/Java/Scala/Python project.

16:42 technomancy: moogatronic: I use the "tree" shell command in combination with find-file-in-project

16:42 Raynes: I don't even use dired. I use 'ls', 'mv', 'rm', and 'cd'. :>

16:42 moogatronic: find-file-in-project… will investigate. =)

16:42 cemerick: I 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:42 technomancy: moogatronic: 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:42 moogatronic: so far all the tips I get out of #clojure have been money.

16:43 moomin: Just because you don't need an IDE doesn't mean one wouldn't be nice...

16:43 technomancy: moogatronic: 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:43 cemerick: all I know is that it was created by Slava Pestov, so I assumed it was pretty rockin' =)

16:43 moomin: e.g. refactoring to split a namespace

16:43 moogatronic: On a given day I just have to jump around a lot.. RA work, course work, actual get paid work, etc.

16:44 cemerick: technomancy: It was. Even better when paired with Verdana. :-P

16:44 moogatronic: vim has become my textmate, emacs is my happy place, and intellij makes me money.

16:45 technomancy: haha... 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:47 zilti: If 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:47 cemerick: moogatronic: Hopefully we can make eclipse more like emacs…happy capitalists all around. ;-)

16:48 Raynes: &(:arglists (meta #'println))

16:48 lazybot: ⇒ ([& more])

16:48 technomancy: zilti: 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:48 Raynes: This only works with functions defined with defn, or functions that explicitly add arglists meta.

16:49 And, like he said, you need the var.

16:49 zilti: And with a macro?

16:50 something like (defmacro get-arguments [function] ...)

16:50 moogatronic: is there an easy way to get dark backgrounds in eclipse yet?

16:52 jcromartie: moogatronic: are you on a Mac? Try Control-Option-Command-8 :)

16:52 (kidding... but not... but yeah...)

16:52 moogatronic: jcromartie: yes i know of this solution.. =)

16:52 zilti: jcromartie: Why, what does this?

16:52 moogatronic: i did actually use it for a while

16:52 it's just late nite coding on white backgrounds that hurt.

16:52 F.lux has helped a lot with that actually.

16:52 cemerick: jcromartie: That's not bad, actually.

16:53 jcromartie: yes I was going to say, moogatronic

16:53 F.lux is good

16:53 but not the total solution

16:54 moogatronic: zilti: inverse video

16:54 ibdknox: Well.. there should be lots of good discussion at the Conj about tools :)

16:54 cemerick: moogatronic: http://www.eclipsecolorthemes.org/ ?

16:54 jcromartie: it's amazing, when I hit that key combo, I can *feel* my eyes adjust

16:55 moogatronic: cemerick: awesome. did not exist at the time I switched to IntelliJ

16:55 honestly, having dark backgrounds was high on my list of reasons.. kind of lame I admit.

16:55 ibdknox: I really hate white backgrounds... so I can understand that

16:55 dnolen: moogatronic: you got stare at the damn screen all day, it better look how you want it to look ;)

16:55 jcromartie: I don't like white backgrounds

16:56 but I hate light-on-dark text rendering almost as much

16:56 moogatronic: dnolen: agreed. Each computer I setup will always have my programming fonts now, and proper color themes.

16:56 jcromartie: the letters are all thick

16:56 the sub-pixel rendering is just not right

16:56 moogatronic: <- Inconsolata fan.

16:56 ibdknox: font rendering is hard.

16:56 moogatronic: lol.= )

16:56 jcromartie: just look at the actual text in those color themes (http://www.eclipsecolorthemes.org/)

16:57 the light background ones look a lot better, typographically

16:57 Zenburn is OK

16:57 moogatronic: is that a function of the size of the text?

16:57 jcromartie: (my personal fave anyway... always count on a classic)

16:57 moogatronic: nope

16:57 * zilti loves his Consolas font in Emacs

16:58 jcromartie: moogatronic: it's just the consequences of rendering light text on a dark background... the AA is different

16:58 moogatronic: i guess that makes sense.

16:59 jcromartie: http://jcromartie.tumblr.com/post/370728317/dark-vs-light-text-smoothing-on-os-x

17:00 notice the light text, inverted, is actually heavier than the plain dark text

17:02 zerokarmaleft: i tried solarized light and dark, but went back to zenburn

17:02 moogatronic: jcromartie: 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:02 i'm sure someone has studied this.

17:02 jcromartie: possibly

17:03 zerokarmaleft: the highlight on solarized dark was the deal breaker

17:04 jcromartie: moogatronic: actually, light-on-dark can be more of an eye strain than dark-on-light

17:04 I think the key is lower overall display brightness

17:04 and color temperature

17:04 and ambient lighting

17:04 if the wall is as bright as the monitor in front of it, your eyes will be fine

17:05 moogatronic: and proper diet and exercise and ergonomic furnature. =)

17:05 jcromartie: heh sure

17:06 if you want to get really sciency abou tit

17:06 about it

17:06 you can use green text on a yellow background

17:06 with a serif font

17:07 bsod1: why 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:07 moogatronic: i need to strike a balance between looks beautiful / inspiring and hurts my face. =)

17:07 jcromartie: moogatronic: yes, minimize face-hurting where possible

17:08 moogatronic: anyone who's attening the conj a runner? (slightly ontopic…)

17:09 could possibly organize an unconference event as a reset-break between the conference and the other unconference events.

17:10 plus its like er, alan turing year next year, so theres the computational tie in.. =)

17:10 technomancy: what I want to know is when we are going to fit all these unconference events into the schedule

17:10 seems like we need another whole day

17:10 joly: I was curious about that too; seems like there's a lot lined up

17:10 moogatronic: technomancy: I was wondering what the scheduling was going to be for those!

17:10 zippy314: When 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:11 bsod1: whe .get on a java.reflect.Field needs a third parameter? (.get field) IllegalArgumentException but (.get field nil) works

17:11 cemerick: technomancy: 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:12 Besides, who sleeps at the Conj? I certainly didn't last year. :-P

17:12 moogatronic: any decent brewpubs in the area? I usually try to make it a goal to try locally produced good beer if possible.. =)

17:12 I'm a homebrewer.. it's my duty.

17:13 technomancy: cemerick: 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:13 moogatronic: you just need to chart your dependencey on caffeine with the half-life of caffeine in your system and dose appropriately.

17:14 cemerick: moogatronic: but how does alcohol fit into that protocol?

17:15 moogatronic: technomancy: 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:15 technomancy: moogatronic: economical! I like it.

17:15 moogatronic: cemerickl: yes, alcohol wrecks the equation.

17:15 at least for my system. I cant cope with the mixture of depressants and stimulants.

17:16 though, I consider beer to be a holy sacrament, not a depressant. =)

17:19 technomancy: i'm almost regretting my hotel booking now that i thnk about this more...

17:19 I would be pretty wrecked by the end.

17:19 if alive.

17:19 technomancy: but what a way to end it!

17:20 zilti: You can't stay awake 3 days in a row

17:20 technomancy: not without severe hallucinations anyway

17:20 erldave: simple 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:21 since the map entries end up appearing in the seq

17:21 bsod1: what is clojure way to build strings in a loop? (str old_string string_to_add) ?

17:21 moogatronic: zilti: yeah, and priceline wont' refund my hotel purchase anyway.

17:21 zilti: moogatronic: A win-win-situation :)

17:22 moogatronic: I could totally be that crazy dude at the conference who got arrested for running around the hotel lobby naked while battling invisble demons.

17:22 jcromartie: bsod1: build a seq of what you want to concatenate, then use clojure.string/join

17:22 bsod1: which internally uses a stringbuilder and an actual loop

17:22 but your code is better off passing a sequence to string/join

17:23 bsod1: jcromartie: thanks

17:24 cemerick: zilti: but you can crash on the roof, especially if you've been up too long enjoying moogatronic holy sacraments.

17:24 s/moogatronic/moogatronic's

17:24 zilti: lol

17:26 erldave: should I be wrapping the maps in the list inside atoms? that seems a bit odd

17:27 TimMc: erldave: What do atoms have to do with anything?

17:27 ,'({:a 1} {:b 2 :c 3}) ; erldave

17:27 clojurebot: ({:a 1} {:b 2, :c 3})

17:27 erldave: it 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:28 so if I have x and y, both maps, how do I make a list containing those two maps?

17:28 TimMc: erldave: (list x y)

17:29 erldave: ahhh, thanks

17:29 TimMc: ,(first '({:a 1} {:b 2 :c 3}))

17:29 clojurebot: {:a 1}

17:31 dnolen: erldave: also unless you really want a list, why not put them in a vector?

17:31 ,[{:foo 1} {:bar 2}]

17:31 clojurebot: [{:foo 1} {:bar 2}]

17:31 erldave: sorted, I now have what I want: (vector x y) instead of (vec x y) ;; doesn't run

17:31 thanks

17:32 zilti: How are those wrapping macros ( [] and {} ) defined anyway? Are they hardwired into the language?

17:32 Raynes: &(vec '(1 2 3 4))

17:32 lazybot: ⇒ [1 2 3 4]

17:32 erldave: oddly fn list doesn't appear to be in Joy of Clojure

17:32 Chousuke: zilti: yes

17:33 dnolen: erldave: you don't need to say vector, just [x y]

17:34 Chousuke: zilti: they're reader macros but reader macros are reserved for the implementation

17:34 dnolen: zilti: reader macros

17:34 zilti: Ah I see

17:35 erldave: dnolen: better, ta

17:35 Chousuke: I'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:35 technomancy: Chousuke: I never understood why reader macros couldn't be namespaced.

17:36 ibdknox_: what problems would they cause?

17:36 mdeboard: Can I have help with something rudimentary? How do I turn http://p.mattdeboard.net/fibowhat.html into a single fn?

17:36 Chousuke: technomancy: what do you do if you want to use two reader macros that happen to use the same characters?

17:37 technomancy: Chousuke: you'd declare which reader macros to use in the ns clause, and it would fail to compile if there was any overlap.

17:37 Chousuke: technomancy: that doesn't solve the clash though, that just avoids running code that makes no sense

17:37 you still can't use the macros together :/

17:37 zilti: That would make code much less readable

17:38 technomancy: Chousuke: well if the reader macros only apply to code in a given namespace that explicitly requires them, there would be no clash.

17:38 stuartsierra: You can get most of what you'd want reader macros for with regular macros.

17:38 ibdknox_: what reader macros would you really want?

17:38 technomancy: ibdknox_: I want regex literals that are callable

17:38 having to use re-find for conditionals is silly

17:38 ibdknox_: technomancy: I don't understand why we don't have those anyways

17:39 technomancy: (filter #"what up" ["bunch" "of" "strings"])

17:39 ibdknox_: I completely agree

17:39 technomancy: ibdknox_: "for interop" =(

17:39 Chousuke: ibdknox_: because of clojure no-wrapping policy

17:39 ibdknox_: but barring that... I can't think of anything else I'd really want

17:39 technomancy: yeah, that's pretty much it for me. =)

17:39 Chousuke: maybe someday there will be a "interop-callable" protocol or something

17:39 hiredman: well, there are multiple strategies for getting there, each one has objections

17:39 technomancy: IFn as a protocol would solve it too, but that's also been shot down.

17:39 hiredman: the cleanest path is invokedynamic

17:40 Chousuke: and you can use Patterns as functions. I just don't know how it could be done without interfering with fast function calls.

17:40 psyllo: I like the callable regex idea.

17:40 technomancy: yeah, I have never in all my years seen Patterns used in interop scenarios

17:40 ibdknox_: I suspect everyone likes the callable regex idea

17:40 Chousuke: I like it too, if we consider only the benefits

17:40 technomancy: but I see them used as predicates all the time.

17:40 Chousuke: but lets not do that :)

17:40 technomancy: (partial re-find #"yuuuuck")

17:40 psyllo: I'd like to have reader macros in Clojure. I'm for it. Arguments about legibility don't matter to me.

17:41 ibdknox_: psyllo: for what?

17:41 psyllo: Power to the user... Lisp blurs the line between user and designer.

17:41 Chousuke: psyllo: how about arguments about fragmentation

17:41 technomancy: I don't necessarily want reader macros, I just don't understand why namespacing them doesn't address the collision objections.

17:41 dnolen: psyllo: it will probably never happen. rhickey has said as much.

17:41 Chousuke: technomancy: I suppose it just doesn't solve enough of the problem

17:42 technomancy: Chousuke: because the motivation is usually "I want it to be like CL"? =)

17:42 ibdknox_: lol

17:42 dnolen: it's doesn't blur the line between user and designer. it just encourages bad taste.

17:42 technomancy: has anyone ever used #"" for interop?

17:43 cemerick: good enough for me! :-P

17:43 Chousuke: technomancy: 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:43 dnolen: the amount of awful requests for syntax in CoffeeScript is mindblowing.

17:43 ibdknox_: technomancy: nope

17:43 technomancy: Chousuke: you could say the same thing about function names

17:43 psyllo: Have reader macros fragmented CL?

17:43 Chousuke: technomancy: you can rename functions, but changing the dispatch character just creates more problems :P

17:44 ibdknox_: dnolen: haha you should've seen some of the suggestions we got for C#...

17:44 psyllo: (no they haven't)

17:44 dnolen: psyllo: CL community is too small to fragment. Their just one name among the various Lisps.

17:45 psyllo: like it or not Clojure is the only Lisp in years to generate a community from the buzz.

17:45 Chousuke: technomancy: 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:45 and that's getting a bit perlish

17:46 technomancy: Chousuke: I don't see why :reader [my.reader.macros :only [a b c] :rename {b l}] wouldn't work like :use.

17:47 Chousuke: technomancy: 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:47 psyllo: I 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:48 Chousuke: psyllo: more options usually implies more costs

17:48 psyllo: in this case Rich simply decided that the benefit from reader macros does not justify the cost

17:48 technomancy: Chousuke: 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:48 ibdknox_: I still haven't heard a concrete example other than the regex one

17:49 Chousuke: technomancy: yeah. You can cheat and hack the reader though if you REALLY want :P

17:49 technomancy: nope!

17:49 psyllo: technomancy: But that's exactly why you want reader macros.

17:49 Chousuke: technomancy: or you can figure out how to add a callable protocol without screwing up performance

17:49 technomancy: I mean I might consider a patch if I had conclusive proof that no Clojure user had ever used regexes in an interop situation.

17:49 psyllo: You've just tapped into a real legit reason to not have the restriction.

17:49 dnolen: psyllo: that's not a real reason.

17:49 psyllo: Oh?

17:49 technomancy: Chousuke: that's way more interesting. but probably beyond my skillset. =)

17:50 ibdknox_: once case does not justify something as scary as reader macros

17:50 Chousuke: psyllo: it's a reason, but not a good enough one.

17:50 dnolen: we're just talking about minor conveniences.

17:50 technomancy: psyllo: why not just fix the mistake in the reader?

17:50 psyllo: You're tending to want to make the decision for others, I'm tending to leave that door open.

17:50 Chousuke: psyllo: you need to make decisions

17:51 psyllo: technomancy: Why not just let the user do that?

17:51 Chousuke: psyllo: if you try to allow everything you end up with a mess

17:51 dnolen: psyllo: I'm not tending to do anything, I'm not in charge about reader.

17:51 ibdknox_: a language without opinion is useless

17:51 psyllo: Again, I understand where I fall on the spectrum of opinion in this.

17:51 Chousuke: psyllo: see: scala (tongue firmly in cheek :P)

17:51 ibdknox_: lol

17:51 psyllo: ibdknox: You're black-and-whiting the issue.

17:52 technomancy: psyllo: seems like an awful lot of work to fix a simple design flaw.

17:52 dnolen: in anycase, fortunately the world isn't black and white. There are other Lisps with different design decisions.

17:52 and man are they fun and useful.

17:52 psyllo: ... anyway it's fun to talk about because it's so fundamental to design.

17:52 Chousuke: technomancy: #"" not being callable is not a design flaw though, just an unfortunate consequence of the interop policy

17:53 technomancy: Chousuke: 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:54 Raynes: Rich doesn't use regexes? My hero.

17:54 dnolen: technomancy: well he uses then in the Clojure(Script) tokenizer

17:54 s/then/them

17:54 technomancy: dnolen: yeah, this was a couple years ago; I guess my info could be out of date.

17:54 Chousuke: And in the reader :P

17:54 eiro: hello

17:54 Chousuke: but that's java

17:54 dnolen: Chousuke: the tokenizer in the reader I meant

17:55 Chousuke: the ClojureScript has a reader in ClojureScript that uses regexes as well.

17:55 Chousuke: I wonder if I still have my clojure reader code somewhere

17:56 I got it working well enough that I could compile a version of Clojure with it.

17:57 but not quite in good enough shape to dare propose that someone use it :P

17:58 psyllo: If 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:58 s/you has/he has/

18:00 Chousuke: or he doesn't solve problems that involve figuring out the content of strings :P

18:00 Raynes: I don't think anybody was implying that Rich is a God because he claims to not use regexes. ;)

18:02 psyllo: Raynes: Yeah, gotcha ;)

18:02 bsod1: is there a better way to get a string's last char than (nth str (dec (count str))) ?

18:02 Raynes: &(last "foo")

18:02 lazybot: ⇒ \o

18:03 technomancy: dakrone: apparently my :insecure? branch uses connection pooling faultily.

18:03 'nother patch comin' your way

18:03 did you want to do general connection pooling for 0.2.3?

18:04 psyllo: bsod1: Also you typically don't want to use 'str' as a variable name since there is a function 'str'. Also interesting is 'butlast'.

18:05 bsod1: Raynes: isn't it O(n) ? I thought my solution is O(1) since we already know string's length(or don't we?)

18:06 Raynes: If 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:06 psyllo: Raynes: "typically don't want to use"

18:06 Raynes: I'm not the guy to talk to about performance.

18:07 But that's how you get the last of any sequence, disregarding hacky more performant solutions that I can't come up with.

18:07 psyllo: bsod1: You might want to look at the performance of 'count' in this case.

18:07 TimMc: technomancy: The problem I see is that regexen can be used for either finding or matching.

18:08 bsod1: psyllo: yeah, strings are not counted so count is linear time on string (I think)

18:09 TimMc: I 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:09 bsod1: &(counted? "str")

18:09 lazybot: ⇒ false

18:09 hiredman: no

18:10 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L509

18:10 use count

18:10 people always seem to think count most convert it's arg to a seq first, that is not the cast

18:11 case

18:11 it is fast for arrays, strings, etc

18:11 I am sick of people using alength and such, please knock it off

18:13 psyllo: bsod1: Cool. Just counted 9k characters as a string vs seq and counting a seq was 10x slower. So, yeah.

18:13 Raynes: Or else he'll shoot lightning bolts from his fingers and call upon the forces of hell to destroy your city.

18:16 psyllo: hiredman: Piper down

18:16 hiredman: psyllo: excuse me?

18:16 Raynes: psyllo: Don't bother. :\

18:17 psyllo: :D

18:17 Sorry, hiredman. I didn't see any mention of not using count.

18:17 I don't make assumption about those things. I usually look at the source or just do a simple test.

18:18 Been fun. Have a good weekend y'all

19:09 seancorfield: clj-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:21 moogatronic: seancorfield: joda is awesome. I definitely need to check out clj-time.

19:22 it saved me on a few giant ugly java projects so far.

19:22 technomancy: does it still not have a generic "figure out how this time string is formatted and parse it" function?

19:22 mdeboard: Hm 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:23 technomancy: having to pick a formatter up front is annoying

19:23 mdeboard: When I go to terminal emulator, even, and type `lein` it's runs properly.

19:23 Anyone have any idea why?

19:23 moogatronic: technomancy: 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:23 technomancy: moogatronic: oh absoultely; it's a huge improvement over anything in the JDK

19:24 moogatronic: I've considered having Leiningen issue a warning if it sees any reference to java.util.Date.

19:24 aperiodic: technomancy: as far as I'm aware, you still have to specify a formatter upfront

19:24 duck1123: there's DateTime/parse, but I'm not sure how far that goes

19:24 technomancy: mdeboard: must be a $PATH issue

19:24 moogatronic: technomancy: not a bad idea. =)

19:24 mdeboard: technomancy: Well, color me puzzled :|

19:24 hiredman: mdeboard: what happens if you try and run lein in eshell?

19:25 mdeboard: hiredman: Command not found

19:25 hiredman: or M-x shell-command

19:25 mdeboard: same

19:25 hiredman: right, so for some reason or other emacs has a different idea of PATH

19:25 how did you start it?

19:25 mdeboard: Mmkay. Huh.

19:25 hiredman: most likely fork()ed from somewhere that didn't read some shell config somewhere

19:26 technomancy: actually it should be able to figure it out by launching a shell

19:26 (defvar clojure-swank-command (if (locate-file "lein" exec-path) "lein jack-in %s" "echo \"lein jack-in %s\" | sh"))

19:26 given a new enough clojure-mode

19:26 that may not have made it into a release yet though

19:27 hiredman: why would sh have a differnt idea of PATH there?

19:27 technomancy: hmm... does sh need a special flag to source profile?

19:27 .profile, rather

19:27 man

19:28 if only unix had a standard user-writable directory on the $PATH by default. ಠ_ಠ

19:28 hiredman: most likely his PATH is set in some other shell specific file, which is why it isn't seen by emacs

19:28 Raynes: technomancy: That's in the latest release.

19:28 I saw it when I was playing with defcustom.

19:28 technomancy: Raynes: ok, must be that sh doesn't honor profile when launched like that.

19:30 seems like sh -l will source .profile on dash

19:30 mdeboard: hiredman: yeah the lein executable is on a path set in .bashrc

19:30 technomancy: anyone with a classic sh want to confirm that's portable?

19:30 mdeboard: ah yeah

19:30 that belongs in ~/.profile instead

19:30 mdeboard: I see

19:31 Raynes: Really? I put all my PATH mods and such in .bashrc.

19:31 mdeboard: Is that a change?

19:31 in emacs 24/ubuntu 11.19

19:31 11.10*

19:31 technomancy: no, .bashrc has always been for bash-specific settings

19:31 mdeboard: eh never had a problem before

19:31 Raynes: Good to know.

19:31 mdeboard: but I'll give it a go

19:31 hiredman: meh

19:32 I would just use some thing like (setenv "PATH" ...)

19:32 technomancy: mdeboard: actually before you change it

19:32 can you try (setq clojure-swank-command "echo \"lein jack-in %s\" | sh -l") ?

19:33 wait that won't actually help here since it's dash

19:33 mdeboard: lol

19:34 technomancy: but just for the record, would (setq clojure-swank-command "echo \"lein jack-in %s\" | bash -l") do it?

19:35 Raynes: technomancy: Did you know that slamhound makes Java think that your code is a Swing application?

19:35 technomancy: maybe "echo \"lein jack-in %s\" | $SHELL -l" would be better?

19:35 Raynes: I'm not sure why, but whenever I use it, I get a Swing dock icon.

19:35 (on a mac)

19:35 technomancy: heh

19:35 well it does preload every namespace on the classpath

19:35 so it could be triggering latent functionality in your codebase?

19:35 or does it happen to empty skeleton applications too?

19:36 Raynes: Not in all of them.

19:36 I've ran it against a bunch of applications.

19:40 daaku: what is the right way to trigger evaluating a seq returned form map (my deftest has a single map form)

19:40 mdeboard: well, shit, even if i run it from command line

19:41 :-|

19:41 er

19:41 even if I start emacs from the command line, that is.

19:41 technomancy: mdeboard: oh? that's really weird.

19:43 mdeboard: hiredman: Can you re-enter the elisp command you suggested?

19:43 technomancy: is that emacs launched from bash where you've confirmed the same bash instance can launch it?

19:43 hiredman: (setenv "PATH" ...)

19:45 technomancy: heh; the way "lein ring" launches a swing web browser is adorable.

19:46 ibdknox: daaku: ##(doc dorun)

19:46 lazybot: ⇒ "([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:46 daaku: ibdknox: thanks!

19:46 ibdknox: or if you need the results

19:46 ,(doc doall)

19:46 clojurebot: "([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:47 daaku: dorun worked great

19:48 dnolen: support for js literals in ClojureScript, https://github.com/clojure/clojurescript/compare/37-support-for-js-literals

19:48 who wants it?

20:11 mdeboard: So, I think now the problem is that I don't even have "jack-in" as a command. I'm missing swank-clojure, yeah?

20:12 don't answer that, my idiocy is rhetorical.

20:12 Raynes: $dict rhetorical

20:12 lazybot: Raynes: adjective: Of or relating to rhetoric.

20:12 Raynes: Man, I hate when he does that.

20:12 mdeboard: Yeah, me no talk good

20:12 Raynes: $dict rhetoric

20:12 lazybot: Raynes: noun: The art or study of using language effectively and persuasively.

20:13 mdeboard: ME AM BAD TALK

20:14 moogatronic: mdeboard: Yesterday I didn't have jack-in either. My clojure mode was just old.

20:14 mdeboard: Eh once I installed swank-clojure I was rhetorical

20:14 Working fine, now

20:14 the lesson is to never upgrade

20:14 anything

20:15 moogatronic: nah, i did a emacs 23-24 upgrade yesterday, and everything is working.

20:15 well, everything that i've tried so far. =)

20:15 mdeboard: This is all fresh/clean

20:15 so, there

20:15 moogatronic: =)

20:16 well, my upgrade method involved porting over my previous settings.el to my current one, etc.

20:18 mdeboard: got me

21:41 jacobsen: Hi 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:02 aperiodic: jacobsen: are you using leiningen or cake?

22:07 jacobsen: hi aperiodic, I wasn't using either - just "clj" plus the REPL

22:09 aperiodic: jacobsen: 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:11 jacobsen: leiningen seems to be more popular (it's what I have experience with), and it's available through macports (as well as brew)

22:12 jacobsen: aperiodic: 'lein' followed by 'lien repl' followed by the previously failing command worked — thanks!

22:13 aperiodic: jacobsen: see what i mean? ;)

22:13 jacobsen: :-)

22:13 aperiodic: glad to help!

22:13 jacobsen: thanks again

22:17 should 'lein test' on a brand-new, unmodified project fail?

22:20 aperiodic: yes, it should fail with an error message that no tests have been written

22:21 jacobsen: Cool, thanks

22:39 Next 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:39 technomancy: jacobsen: most people run tests in an existing session

22:39 either via swank or the repl

22:39 jacobsen: you can improve boot time by switching to the client JVM, but I'm not sure how to do that on macosecks.

22:40 jacobsen: I'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:40 technomancy: the other option is lein interactive. it's not terribly polished, but it's often better than relaunching the whole process.

22:41 if you're using eclipse it's probably best to just call (run-tests) in the repl

22:41 or if there's a way to trigger it on save that would be cool too

22:42 jacobsen: maybe i'll take that on as a Clojure learning project — watch for save times in files and auto-run tests when they update

22:47 technomancy: feel free to crib from clojure-test-mode

22:47 (you would have to tie into the reporting mechanism for that, which I've already implemented in clojure-test-mode)

22:47 jacobsen: I'll take a look, thanks

22:48 Hmm, maybe I'll go back to Emacs for this stuff — seems like the center of mass is (unsurprisingly) there rather than in IDEs

22:54 signing off, thanks to technomancy and aperiodic for the help

23:15 seancorfield: any windows / emacs folks around?

23:32 ThreeCups: How can I print a ratio to look like n.nnn?

23:33 archaic: whats a good way to alter *err* redirection using clojure-jack-in from the *swank* buffer to the clojure repl?

23:44 callen: technomancy: never mind, answer me here if you do so at all.

23:49 technomancy: callen: 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:50 archaic: for now you can use alter-var-root. the next version of swank should do it for you.

23:51 ThreeCups: FYI, I ended up using the (double) function to cast my ratio

23:51 technomancy: callen: there's a bug in the current ubuntu apt package, so installing by hand as per the readme is your best bet

23:51 callen: technomancy: I'll have to re-familiarize with "jack-in". Thanks, that's the use-case/design I thought I was supposed to follow.

23:51 technomancy: debian user, but I never trust apt packages for this sort of thing anyway.

23:52 technomancy: callen: yeah, apt and the JVM don't get along so well

23:52 callen: the swank-clojure and leiningen readmes are the best places to start.

23:52 callen: technomancy: shanks.

23:54 technomancy: heh; the debian version of lein actually has the fix, ubuntu just screwed it up in oneric.

Logging service provided by n01se.net