#clojure log - Nov 28 2011

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

0:20 biallym: Hey is there a way to have a function called on or around garbage collection of an object?

0:20 Like an idisposable?

0:23 Since java doesn't support it I will take that as a no >.>

0:27 mdeboard: Clojure does a lot of things java doesn't support

0:33 biallym: I know that, but clojure still uses java's gc as far as I know

0:34 It may have been more appropriate to say the JVM doesn't support it

1:18 quotemstr: Is there a function that always returns false?

1:20 Or, rather, a built-in function of one argument that is always false --- for the default value of a predicate.

1:25 hiredman: ,((constantly false) 1)

1:25 clojurebot: false

1:31 amalloy: biallym: if your program depends on such a thing for its correctness, then your program is not correct, so there's not much point having it. see http://blogs.msdn.com/b/oldnewthing/archive/2010/08/09/10047586.aspx for a slightly more detailed assessment

1:36 (written for the clr but applies equally well to the jvm)

1:48 isak_: is there a way to repeat a symbol a number of times? i want to write a function that does a cartesian product on the alphabet as many times as i say. e.g., if I plugged in 3, it would do (cartesian-product letters letters letters ...

1:50 hiredman: the cartesian bit you'll need to do yourself, but repeating can be done with repeat

1:50 possibly it could be done with iterate

1:51 isak_: oh awesome

1:51 i got the other part figured out, thanks

1:51 amalloy: one of the contrib libraries has cartesian-product already though, if you'd rather use that

1:51 isak_: yeah, thats the one i'm using

1:52 the clojure version is much shorter than the ruby version i made earlier then: https://gist.github.com/1399260

1:54 amalloy: right, presumably it's just (apply product (repeat n letters))

1:56 ambrosebs: proposal for a pluggable clojure compiler, comments welcome: http://dev.clojure.org/display/design/Exposing+the+Compiler%27s+Analysis+Phase

2:04 hiredman: ambrosebs: using binding to effect compilation of forms within the binding depends on the way the binding macro expands, it will stop working if for whatever reason the form binding expands into was wrapped in a try

2:05 well, it depends on the way binding expands and the way the compiler handles do

2:05 (at least for the clojure compiler, I will admit to not being terribly familiar with the clojurescript compiler)

2:05 ambrosebs: hiredman: interesting, I really don't know the compilation phase that well so I'm just sticking it out there

2:06 hiredman: I'd suggest some kind of addition to the ns form

2:06 instead of defing this thing

2:06 er

2:06 ambrosebs: ah I see

2:06 that makes a lot of sense

2:06 hiredman: well, instead of binding things, that does mean ns level granularity

2:07 ambrosebs: well that was what I intended originally

2:07 (ns level)

2:07 it makes sense to have a single "language" in a file

2:07 since you are changing the language by modifying the compiler

2:07 like Racket

2:15 hiredman: do you happen to know where "ns" is defined in clojure?

2:15 hiredman: core.clj

2:17 ambrosebs: hiredman: cheers. How does core.clj itself have a 'ns' declaration?

2:17 hiredman: magic in RT.java

2:19 there is a minimal version of the ns form written to clojure.core/ns by clojure.lang.RT until it is overwritten by the macro in clojure.core

2:19 (I hadn't realized clojure.core had switched from in-ns

3:32 biallym: Is it possible to have a namespace that "forwards" another namespace?

3:32 (Or multiple such namespaces >.>)

3:35 I'll take that as another no

3:36 jacortinas: I've seen a lot of different tutorials for setting up vimclojure and nailgun, but I can't get it completely working no matter what I do

3:36 amalloy: biallym: seriously, have you used IRC before? five minutes is a ludicrously short time to wait before assuming nobody wants to help, especially if it's after midnight in the US

3:37 it's possible to create namespaces that you might describe as forwarding, but it's not really a good idea

3:37 jacortinas: I keep receiving an error that says this, no matter what I do. "java.lang.IllegalStateException: Attempting to call unbound fn: #'vimclojure.nails/NamespaceOfFile"

3:38 I've been attempting to use the lein-nailgun library, does anyone else have experience with this?

3:38 biallym: amalloy: Sorry but the last 5 questions I have asked today haven't been answeared

3:38 amalloy: that's patently untrue. maybe you think that's the case because you only watch for five minutes

3:39 but i answered your gc/finalizer question myself, and mdeboard hazarded a guess as well

3:39 biallym: I check the log >.>

3:39 amalloy: those are the only two questions i've seen from you in the past 9 hours, which is as long as my log goes right now

3:42 biallym: As to your gc/finalizer question answear... that doesn't help much when I am trying to wrap a stateful library like opengl, with incurring massive performence losses

3:42 without*

3:42 so I was correct in my answear of no... and just saying my program isn't corrent is not much of a way of saying that it can't be done

3:43 notostraca: biallym, writing heavily stateful code might be a better use for Java than Clojure

3:43 amalloy: "the answers i got were not what i hoped to hear" is pretty different from "none of my questions have been answered"

3:43 Bahman: Hi all!

3:44 notostraca: Hello Bahman, do you have a question?

3:44 Bahman: Hi notostraca. No. Why?

3:44 notostraca: oh heh

3:45 Usually when someone joins in and immediately starts typing, they have a question they are hoping to get help on. Not this time!

3:45 amalloy: he likes to say hello when he /joins. it's a mystery

3:45 notostraca: Myself, I am beating my head against the wall trying to get JNA to work with SDL

3:46 Bahman: notostraca: Thanks for the attention. But it's more like amalloy puts it :-)

3:46 biallym: notosraca: Thats why I am wrapping it, either way the answear would be relevent to either language...

3:46 and I missed a t >.>

3:46 notostraca: wait a minute, how did i miss this

3:47 you are wrapping OpenGL for use on the JVM?

3:47 biallym: No I am wrapping jogl for use in clojure

3:47 notostraca: I am wrapping SDL for use on the JVM

3:47 ah

3:47 biallym: jogl peeps already did the hardstuff for me :p

3:47 notostraca: biallym, yeah JNI is not something I want to struggle through right now

3:48 I am hoping JNA will be better

3:48 amalloy: jna does look pretty sweet

3:48 are you using chouser's jna wrapper?

3:49 notostraca: amalloy, yeah but I have no idea how to use JNA yet

3:49 biallym: amalloy: The reason I ignored your answear is because you are basically telling me if there was ever a time I would want to use a finalizer than I am programming wrong is a bit... not nice... to put it nicely. However I apologize for being so impatient

3:49 notostraca: chouser has a JNA wrapper?

3:50 amalloy: biallym: there's a reason finalizers are deprecated and heavily frowned upon. you're welcome to use them, but you should expect headaches down the road

3:51 $google chouser clojure jna github

3:51 lazybot: [Chouser/clojure-jna - GitHub] https://github.com/Chouser/clojure-jna

3:52 notostraca: amalloy, thanks

3:52 biallym: amalloy: well thanks for finding the answear of telling me to google for finalizers >.>

3:52 notostraca: I don't understand JNA at all. how does this resolve dependencies of native libraries?

3:53 do I have to run JNAerator or something on the native headers before I can use them in Clojure?

3:53 amalloy: notostraca: it doesn't, as i understand it. it just calls out to your OS saying "plz load library with name xyz"

3:54 biallym: And If I didn't have the finalizer the memory leak would be a lot more horrendus

3:54 jacortinas: don't want to be annoying, but anyone here with a working vimclojure nailgun setup on OS X?

3:54 biallym: notostraca: I don't have to mess with JNI because of the way jogl is setup

3:55 notostraca: biallym, yeah I figured JOGL would have solved that

3:55 I have no idea if there is a JNA for SDL, though I know there is a JNI one

3:55 Slick IIRC

3:56 biallym: thank you amalloy, I shouldn't need to justify why I need some feature, telling me I am doing it wrong is a horrible way of helpoing someone find an answear. If you had just said google finalizer I would have found it.

3:58 amalloy: did you read the article i linked to? it mentioned the word "finalizer" about a hundred times

3:58 notostraca: chouser, Chousuke: if you are available, I would really appreciate some advice on where to start with JNA

3:58 biallym: yea but it just told me that I should never use them and never mentioned them in reference to java

3:59 notostraca: (I am asuming the chous* nicks are the same person)

3:59 amalloy: notostraca: no

3:59 notostraca: oh, coincidental?

4:00 biallym: I barely know anything about java, or the fact I have to oreride the finbalize method, anyways thanks

4:06 notostraca: hmm

4:06 Then I have to start Clojure with a parameter to tell Java where to find the

4:06 JNA native libs, the JNA .jar, and of course Clojure and this lib.

4:06 Then I have to start Clojure with a parameter to tell Java where to find the

4:06 JNA native libs, the JNA .jar, and of course Clojure and this lib.

4:06 oh sorry

4:07 I think the clojure JNA thing needs JNA to have been run on the native libs before it can use them

4:07 or not run, generated for

4:08 amalloy: there's no JNA thing you have to run on native libs. JNA is a java binding for the FFI library, and it already has (say) C bindings, so it calls out to the C library you need to use

4:09 notostraca: i assume you've read the jna wikipedia page? it explains pretty simply what you have to do to use jna from java

4:09 notostraca: amalloy, thanks for the tip

5:15 AWizzArd|work: Do I need Marginalia as (dev-) dependency when I already put lein-marginalia ( https://github.com/fogus/lein-marginalia ) as dev-dependency?

5:16 As I currently understand it, it is enough to have lein-marginalia as dev-dependency, cause that already has Marginalia as dep.

5:16 Raynes: No.

5:16 You don't even need that.

5:17 lein plugin install lein-marginalia 0.7.0-SNAPSHOT

5:18 Blkt: good morning everyone

5:26 AWizzArd|work: Raynes: Both should work yes? Installing lein-marginalia as plugin, or have it as a dev-dependency?

5:26 Raynes: Yes.

5:26 AWizzArd|work: The thing is: in a company environment multiple devs are working on that project.

5:27 They should all be in sync about the exact version of lein-marginalia and Marginalia. So that's why I need to put it as a dev-dep.

6:01 biallym: Soooo amalloy_ you were probably right >.> java.lang.Object probably will cause trouble

6:01 with the finalize call

6:01 since apparently reify creates multiple copies of the object

6:10 ,(do (let [foo (reify java.lang.Object (finalize [this] (println "Finalizing 1 " this)))] foo) (System/gc))

6:10 clojurebot: nil

6:10 biallym: Oh thats right >.<

6:54 Saturnation: damn you samaaron! I did what you said and almost had too much fun with overtone last night. Hard to go to sleep and woke up thinking about it. :)

7:02 samaaron: Saturnation: ha, that's great news :-)

7:03 Saturnation: what did you get up to?

7:05 * lypanov wonders if anyone is using clojurescript

7:05 samaaron: lypanov: i'm not using yet, although i know people that are

7:09 biallym: Is there a specific meaning to clojures * syntax other than being a partial implemented version (like in common lisp)

7:10 (like let* vs let)

7:10 just asking for idiomatic reasons

7:26 Raynes: biallym: Nope. It is just a convention that usually means "x* is similar to x but isn't actually x and does something slightly different"

7:26 For example, ##(list 1 2 [1 2 3]) vs ##(list* 1 2 [1 2 3])

7:26 lazybot: (list 1 2 [1 2 3]) ⇒ (1 2 [1 2 3])

7:27 (list* 1 2 [1 2 3]) ⇒ (1 2 1 2 3)

8:00 biallym: Raynes: So it is like common lisp :p

8:37 biallym_: ,(. java.lang.reflect.Modifier isPrivate 1)

8:37 clojurebot: false

8:37 biallym_: ,(. (identity java.lang.reflect.Modifier) isPrivate 1)

8:37 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: isPrivate for class java.lang.Class>

8:37 biallym_: sooo... identity isn't really an identity function >.>

8:38 Saturnation: ,(class (identity java.lang.reflect.Modifier))

8:38 clojurebot: java.lang.Class

8:39 Saturnation: ,(class java.lang.reflect.Modifier)

8:39 clojurebot: java.lang.Class

8:39 Saturnation: weird

8:40 biallym_: it's because the . macro cheats >.<

8:40 And I'm trying to get it uncheated

8:41 which may involve splicing in the symbol >.>

8:43 it mainly has to do with the static part of the class

8:45 so the mess fix is ,(eval `(. ~symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))

8:45 ,(eval `(. ~symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))

8:45 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

8:46 biallym_: except not >.>

8:46 samaaron: DENIED!

8:46 Saturnation: so identity isn't broken, the . macro is?

8:46 biallym_: yes, well, sort of

8:46 the behavior of the . macro is misleading

8:46 Saturnation: that makes more sense to me

8:46 biallym_: because it does special processing based on the symbol it gives you

8:47 symbol you give it*

8:47 * Saturnation is in backporting hell

8:47 biallym_: ,(clojure.contrib.macro-utils/macrolet [testing [] `(. ~symbol (.getName java.lang.reflect.Modifier)) isPrivate 1)] testing)

8:48 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>

8:49 biallym_: ,(clojure.contrib.macro-utils/macrolet [testing [] `(. ~symbol (.getName java.lang.reflect.Modifier)) isPrivate 1)] testing)

8:49 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>

8:49 biallym_: Argghh darn you emacs yanking >.<

8:50 ,(clojure.contrib.macro-utils/macrolet [(testing [] `(. ~(symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))] (testing))

8:50 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.contrib.macro-utils>

8:50 biallym_: whats the other bot?

8:50 &(println "test")

8:50 lazybot: ⇒ test nil

8:50 biallym_: &(clojure.contrib.macro-utils/macrolet [(testing [] `(. ~(symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))] (testing))

8:50 lazybot: java.lang.ClassNotFoundException: clojure.contrib.macro-utils

8:50 biallym_: ok so both bots suck

8:51 &(require clojure.contrib.macro-utils)

8:51 lazybot: java.lang.ClassNotFoundException: clojure.contrib.macro-utils

8:51 tomoj: ,*clojure-version* ;; ##*clojure-version*

8:51 clojurebot: {:major 1, :minor 3, :incremental 0, :qualifier nil}

8:52 biallym_: anyways the solution is `(. ~(symbol (.getName java.lang.reflect.Modifier)) isPrivate 1)

8:52 tomoj: &*clojure-version*

8:52 lazybot: ⇒ {:major 1, :minor 3, :incremental 0, :qualifier nil}

8:52 biallym_: wich is very stupid >.<

9:07 Raynes: biallym_: Both bots are up to date, you mean.

9:10 biallym_: Yea yea >.> I'm just a 1.2 holdout because nothing works for 1.3 yet (autodoc being one of the most annoying ones, but there are other things that have subtle compatibility problems)

9:15 &(clojure.tools.macro/macrolet [(testing [] `(. ~(symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))] (testing))

9:15 lazybot: ⇒ false

9:17 Raynes: biallym_: You should check our Marginalia. Once you go marg you never go back.

9:18 biallym_: Well that doesn't fix my 1.2 problem :p

9:18 Raynes: It fixes your problem with compatibility with documentation tools, in any case.

9:19 Doesn't fix the rest of them, sadly. :p

9:19 gtrak`: biallym_, what do you need to work on 1.3?

9:21 biallym_: gtrak` give me a moment and I'll find out what is breaking and why

9:37 Ok... how do you use the new clojure contrib

9:39 like in lein for the dependincies >.>

9:43 OK thats freaking rediculous

9:44 you should really make it clear what the latest versions are >.<

9:47 Ok yea clojure contrib still not working >.>n

9:49 nachtalp: biallym_: have you had a look at this page? http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

9:49 biallym_: Yes and it's pretty much useless

9:50 Yes it tells me where each contrib thing went and how to convert it

9:50 it was very useful for that

9:50 ckirkendall`: biallym_: ??? it has the latest release on maven and the versions.

9:50 biallym_: but for actually using contrib it was useless

9:50 I am not a java person... what is maven and how to find the version information... completely non-obvious

9:51 how do i*

9:52 Ahh I see now, but how do I get the entire contrib like before?

9:52 ckirkendall`: biallym_: I can help with that. lein can pull dependecies from maven and from clojars so you just put the versions for each item you need in your dependecies with the artfact and group ids.

9:52 biallym_: Thats a really annoying way of adding a new library >.>

9:53 or sub library, when I just want to develop with all of contrib

9:53 the solution I used was [org.clojure.contrib/complete "1.3.0-alpha4"]

9:54 which, by the way, is completely wrong all over the place where people were using standalone instead of complete

9:54 but whatever it works

9:55 except it doesn't does it >.<

9:55 sigh I'll use this version each individual library thing >.>

9:55 just seems excessive >.<

9:56 ckirkendall`: biallym_: I think that is what the direction is so that individual contribs could have different release cycles.

9:57 biallym_: *sigh* whatever, you should make it clearer how to find that information for the less java knowlegeable

10:00 You know what, it annoyed me so much I'll go write a blog post about it >.>

10:00 ambrosebs: ,(symbol ":")

10:00 clojurebot: :

10:01 Saturnation: wasn't contrib just a bit bucket of lots of things in different states of repair?

10:01 s/bit/big

10:02 I hear your pain biallym_, but I think you might be missing the rationale behind the move?

10:02 biallym_: Nah I get the rationale

10:02 Raynes: biallym_: It isn't like the whole contrib move has been silent.

10:02 biallym_: it's just not explaine dhow to move >.>

10:02 Saturnation: and hasn't some of contrib been sucked into core?

10:03 Raynes: Each contrib library is an individual maven artifact now.

10:03 Saturnation: the good bits that is

10:03 biallym_: Find me a reasonable search that finds a good page describing how to move from 1.2.x to 1.3

10:04 because I couldn't find it

10:05 gtrak: biallym_, yea, that's kind of a sore point right now, but in like a year people will stop freaking out about it :-)

10:05 biallym_: Haha good point

10:06 well I moved over it was fine and i am happy

10:06 gtrak: ah, wonderful

10:06 so you're 1.3 now?

10:06 duck1123: The issue with upgrading to 1.3 is you have both the 1.3 changes and the contrib changes to contend with

10:06 biallym_: and I will write a blog post in my formal automata class about how to move for the people who arn't java geniuses because we learn nothing else there >.>

10:07 gtrak: you're using clojure for class?

10:07 biallym_: Literally the teacher doesn't understand what she is teaching and it pisses me off

10:07 no

10:07 I can just bring laptops

10:07 and I would probably be better off practicing writing than paying attention

10:09 just as an example day 2: what's the regular expressions which parses the string with an equal number of a's and b's

10:09 gtrak: i always have to relearn regexes anyway

10:09 i use them like once a year

10:09 biallym_: hint it takes a grammar

10:09 not a regular expression

10:09 and when we point that out to her

10:10 gtrak: well, i thought you could have a stateful lexer

10:10 that's kind of like a weak grammar theoretically

10:10 biallym_: it's a much lower level class than that

10:10 regular epression in the theoretical sense

10:10 Wild_Cat: OR, you could do it the Enterprise way, with a regex that goes (ab)|(aabb)|(aaabbb) ..., up to a compile-time defined constant :p

10:11 biallym_: but what about baab?

10:11 gtrak: you can generate the regexes with a rules engine :-)

10:11 Wild_Cat: generate more patterns with an Enterprise Rules Engine! :p

10:11 gtrak: up to the size of the string

10:11 biallym_: she was very insistent you could use a regular expression, I am very insistent she doesn't have an actual ph,d

10:11 Wild_Cat: ...and figure out at which size your regex lib dies a horrible death :D

10:19 biallym_: hey this marg thing is pretty nice

10:20 ckirkendall`: biallym_: was she implying you could do it with one regular expression or a series of regular expressions and some code?

10:20 biallym_: a single theoretical regular expression

10:20 i.e only operators are

10:21 concatenation kleen-star and or

10:21 . * +

10:21 basically

10:23 s/or/alteration

10:23 n.wikipedia.org/wiki/Regular_expression#Formal_language_theory

10:23 en.wikipedia.org/wiki/Regular_expression#Formal_language_theory

10:23 that one ^

10:24 thats just day 2

10:24 every day she makes clunders which undercut her understanding of the material even more

10:24 blunders*

10:24 every day I just want the class to end

10:26 gtrak: biallym_, it's just a piece of paper at the end :-), I have 2, they're sitting in a closet

10:28 biallym_: yea but at the same time I could spend my time on much more productive things. I came here to learn, not zone out as the teacher tries to figure out what she is teachning.

10:28 gtrak: college is a reputation transfer engine, imo

10:29 djKianoosh: you get out of it what you put into it, imo

10:29 gtrak: if you can get reputation another way, the only other thing that it's good for is meeting people and giving you a broad base of things you might not otherwise have learned

10:30 Raynes: biallym_: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

10:31 gtrak: consequently, i know a lot of stuff i'll never use, but it's there :-). programming was what I did when I procrastinated

10:32 biallym_: Raynes: I've seen that already >.> And I've already stated my opinions on how it wasn't useful... I thought you were here for that ?

10:32 Saturnation: he was, but probably needs more sleep? :)

10:33 gtrak: maybe it needs to mention leiningen?

10:33 i guess clojure the lang is not in bed with leiningen

10:34 Raynes: biallym_: Why isn't it useful? What more do you need?

10:34 Because it doesn't list up-to-date versions? I remember some whining about that.

10:34 biallym_: I don't know anything about how a java project works and hence have no clue that maven holds the information for leiningen

10:35 Raynes: For any new clojure contrib library, you can search for it here: http://search.maven.org/

10:35 biallym_: I honestly look at the page and go great, I can change my code, but how do I actually get the right library

10:35 Raynes: You'll be able to find the current version like that.

10:35 Or 'lein help search' is also useful.

10:35 gtrak: it makes an assumption that someone who's messed with clojure knows how to find dependencies

10:35 biallym_: I use clojars >.>

10:36 and haven't yet run into using maven

10:36 Raynes: You use clojars and maven central.

10:36 Leiningen uses both of those by default.

10:36 They're both just maven repositories.

10:36 biallym_: yes but that doesn't mean I know how to navigate their system

10:36 gtrak: you can 'use' them without knowing you're using them, that's the problem

10:36 Raynes: I just told you how.

10:36 biallym_: gtrak has the problem

10:37 yes you did and the first result I got was org.clojure clojure-contrib 1.2.0

10:37 Raynes: What are you searching for?

10:37 gtrak: so you get into a situation where you cared about the build system enough to get something working, then something changed and you don't know how to fix it since you don't know the first principles

10:37 biallym_: clojure-contrib, but I know the answear is something like clojure.tools.macro

10:37 I have it working now

10:38 my complaint is that it's not obvious

10:38 gtrak: to put it nicely, sure, on the other hand I wanted to touch as little of a build system as I could

10:38 gtrak: right, sometimes you just want to worry about how to get stuff done :-)

10:39 biallym_: Which is probably why I am having troubl packing this library I am workin gon

10:39 gtrak: my border of interest right now is git and hg internals magic

10:39 biallym_: but I'll worry about that later

10:39 because It's due wednesday and I don't care about getting off of my own repos just yet

10:40 (I am using clojure for an independent study project though :P)

10:41 So I may be missing something about marg but only the ns docstring seems to get parsed and stripped from the source code is that on purpose?

10:41 Wild_Cat: biallym_: out of curiosity, what drove you to Clojure if you have no Java experience?

10:41 biallym_: because it has concurrency and it's a lisp

10:41 it's also more modern than common-lisp

10:42 I also have a decent amount of .net experience to get over a lot of the managed/heavy OO/ humps

10:43 Raynes: That isn't right. lein-marginalia had a bug that caused stuff like that before, but 0.7.0-SNAPSHOT should fix it.

10:43 But no, it certainly doesn't do it on purpose. :P

10:44 biallym_: I am also sleep deprived.. just tried to use [lein-marginalia "0.y.1-7SHOT"]

10:44 gtrak: that's brilliant

10:45 Raynes: o.o

10:45 biallym_: yea lein didn;t like that

10:45 Raynes: You can also just do 'lein plugin install lein-marginalia 0.7.0-SNAPSHOT'

10:45 That would install it at the user-level so you always have it available for all of your projects.

10:47 biallym_: hmm that didn't fix it, i'll try the user level install instead

10:48 nope still didn't fix it

10:48 (defn canvas [& {:keys [capabilities]}] "Constructs an AWT canvas." (if capabilities (new GLCanvas capabilities) (new GLCanvas)))

10:48 is what I am doing

10:48 is that wrong?

10:48 cemerick: Raynes: Thanks for the mention in your post, BTW. That's one scary headshot, though. :-)

10:48 nachtalp: biallym_: docstring should be the 2nd arg i believe

10:48 gtrak: is there some kind of error?

10:49 Raynes: cemerick: Only one I've got. :p

10:49 cemerick: I mean, it's *big*.

10:49 Raynes: biallym_: Right, the docstring comes before the argument list.

10:49 cemerick: Not sure how to control size in octopress. :P

10:49 gtrak: cemerick, I agree it was imposing

10:49 biallym_: Hmm well then >.>

10:49 cemerick: gtrak: much like myself :-P

10:49 gtrak: indeed

10:49 Raynes: I thought I'd just leave it there, since everybody likes that big ol' bug.

10:49 mug, even

10:50 biallym_: Ohhh your that Raynes

10:50 Raynes: I think I might be.

10:50 biallym_: with the blog post on hacker news :p

10:50 Raynes: :P

10:50 gtrak: i think the best glamour shot I've seen is this one, though https://thestrangeloop.com/sessions/have-your-cake-and-eat-it-too-meta-programming-java

10:51 i find it frightening

10:56 Raynes: cemerick: Look at this way: you've had your face all over Hacker News.

10:59 cemerick: Raynes: does that go both ways? "Ew, I've got hacker news all over me."

10:59 Raynes: Heh

11:00 TimMc: Yeah, better wash with soap.

11:00 (but not SOAP)

11:10 duck1123: After using SOAP, I feel dirty

11:10 ckirkendall`: duck1123: that is the kind of SOAP that burns

11:11 TimMc: More importantly, it would react explosively with any HN residues.

11:20 duck1123: So does anyone know what I should do if my project isn't using my log4j.properties? It was working before, but now it wants to use commons-logging and it's logging the debug level.

11:21 excluding commons-logging doesn't seem to work

11:27 djKianoosh: duck1123: that might be happening if somehow there's another log4j.properties in your classpath, maybe packaged in another jar file

11:27 joegallo: are you using slf4j as a bridge to log4j? if so, then you need the log4j implementation of slf4j (and you probably also want the jcl over slf4j jar, too)

11:28 duck1123: joegallo: I was using slf4j, but I tried removing it as well.

11:28 shouldn't the file in my resources/ dir take precedence?

11:33 This project has reached the point where a clean compile is deserving of a good sword fight

11:40 antares_: technomancy_: hey, do you mind a leiningen question here?

11:44 TimMc: antares_: Just go ahead and ask your question; if someone can help they will answer.

11:45 antares_: we recently upgraded from leiningen 1.6.1.1 to 1.6.2 on travis-ci.org

11:45 and now projects that passed previously fail with slightly obscure issues like http://travis-ci.org/#!/michaelklishin/monger/builds/350740

11:46 the same setup works for me locally, I am not sure where to start investigating (other than leiningen source)

11:47 duck1123: glad to know it wasn't my project bombing out on travis

11:47 just my project

11:49 cemerick: antares_: presumably not all clojure projects are failing, only some?

11:49 antares_: cemerick: exactly

11:50 cemerick: antares_: That error indicates that some dependencies are being used in a Clojure 1.3 project that were AOT-compiled under Clojure 1.2.

11:50 IIRC, anyway

11:51 antares_: cemerick: hm, this may be the case. We use standalone leiningen.

11:51 and it is AOT compiled for 1.2, I am guessing

11:52 cemerick: lein itself uses Clojure 1.2 throughout — but that doesn't prevent it from being used with projects that themselves depend upon 1.3

11:53 antares_: yeah, my 2nd guess is that org.clojure/data.json may be the issue

11:53 both of my projects that fail depend on it

11:53 cemerick: if I only really care about 1.3 for my libraries, what would you suggest?

11:53 duck1123: antares_: here's another one if it helps http://travis-ci.org/#!/duck1123/clj-factory/builds/345706

11:53 antares_: trying to make everything pass on 1.2 may take some effort

11:54 Raynes: Well, the point here is that Leiningen shouldn't be causing the problems to begin with.

11:54 Might have to wait for technomancy_ to hop in.

11:55 cemerick: That the stack trace ends with something related to native paths makes my spidey sense tingle a bit.

11:56 hiredman: cemerick: nah, that is lein figuring out what arch you are running on

11:56 not native code

11:57 cemerick: hiredman: in that case, perhaps this has nothing to do with 1.2/1.3 at all?

11:57 hiredman: I imagine it does

11:57 cemerick: clj-factory's only dependency is midje 1.3-alpha5, which explicitly indicates 1.2.0 and 1.3.0 compatibility…

11:58 duck1123: I think it's 1.3 in the dev dependencies slot, but that doesn't fail for me locally anymore

11:59 tomoj: if the problem were with some dep, why would it work outside of travis-ci?

11:59 antares_: Raynes: right, I figured it but I am not sure what I should do if I don't want/cannot quickly add 1.2 support everywhere

11:59 tomoj: something bad stuck in the local maven repo there?

12:00 antares_: tomoj: that is impossible

12:00 tomoj: VMs are snapshotted and rolled back after each build

12:00 0 shared state

12:00 duck1123: I will let you know when we figure it out :)

12:00 hiredman: the constructor for keyword callsites changed 2010-06-10

12:01 tomoj: antares_: ..and there's nothing in the local maven repo in the snapshot? wonder what could be different..

12:01 hiredman: so it looks like the clojure version there is pre 2010-06-10 (whatever that is)

12:02 post 2010-06-10 it takes a single keyword argument, pre it takes a keyword and a number

12:02 antares_: hiredman: there is no clojure at all, we are using standalone lein

12:02 hiredman: unless ubuntu 11.04 now comes with presintalled clojure, of course

12:02 10.04 did not

12:03 hiredman: lein is of course written in clojure

12:03 antares_: tomoj: we will find it out, fortunately, I have access to the infrastructure & cookbooks ;)

12:03 hiredman: so it comes with clojure

12:03 antares_: hiredman: which may suggest that lein standalone comes with a pretty dated clojure version?

12:04 hiredman: sure, it is supposed to

12:04 Raynes: The version of Clojure that Leiningen uses is irrelevant.

12:04 hiredman: the project should be running in its own version of clojure

12:04 antares_: hiredman: that project's project.clj depends on clojure 1.3.0

12:04 hiredman: here's our leiningen cookbook: https://github.com/travis-ci/travis-cookbooks/blob/master/vagrant_base/leiningen/recipes/default.rb

12:05 hiredman: and we use default node attributes: https://github.com/travis-ci/travis-cookbooks/blob/master/vagrant_base/leiningen/attributes/default.rb

12:06 duck1123: ok, interesting. I'm now getting that same error again for clj-factory locally after I blew away my .m2

12:07 tomoj: oh, the other way around? :)

12:07 antares_: tomoj: no, I think he has failures in both environments now

12:08 duck1123: yes, still investigating

12:08 antares_: duck1123: yup, I see it now, too

12:08 rm -rf ~/.m2 helped

12:08 tomoj: so any clojure-virgin box will get this error trying to do that?

12:08 antares_: tomoj: correct

12:08 any box w/o existing maven repo :/

12:09 hiredman: sounds like someone did something naughty like changing a published artifact

12:09 duck1123: ok, I had to exclude org.clojure/clojure from my midje dependency

12:09 pushing a new version

12:09 cemerick: hiredman: nah, that *never* happens :-P

12:09 antares_: duck1123: oh

12:09 duck1123: good idea

12:10 duck1123: passed

12:10 cemerick: duck1123: instead of adding excludes everywhere, you can just declare your project's dependency on clojure to be e.g. "[1.3.0]"

12:11 duck1123: cemerick: the issue was I had 1.3 in both lib and lib/dev which means that lein is running with 1.3

12:12 tomoj: why does having some dep already in .m2 make that not a problem?

12:12 * hiredman blames that midje guy

12:12 cemerick: Hrm, maybe leiningen should include [org.clojure/clojure "[1.2.0]"] in the dev-dependencies resolution.

12:13 tomoj: hiredman is likely right: someone republished a release version

12:13 Maven won't re-download a release artifact.

12:14 In an ideal world, repositories should prevent the re-deployment of release artifacts.

12:14 s/shoud/would

12:14 jacortinas: Is anyone here using vimclojure?

12:15 vimclojure and nailgun**

12:15 antares_: duck1123: thanks so much! I excluded clojure dependency for clojure.data.json and it passes now: http://travis-ci.org/#!/michaelklishin/monger/builds/350863

12:15 lucian: i've found Emacs+Evil+clojure-mode to be easier to set up :)

12:16 jacortinas: lucian: I have had nothing but an awesome experience with vimclojure, without nailgun. Now that I am trying to set up nailgun and the interactive feature though, it's giving me issues.

12:16 lucian: i just gave up

12:16 jacortinas: been running into this -> java.lang.IllegalStateException: Attempting to call unbound fn: #'vimclojure.nails/NamespaceOfFile

12:16 lucian: (i have other reasons to like Emacs+Evil)

12:16 jacortinas: yeah of course

12:17 lucian: (Evil is a really good vim mode, in case you didn't know)

12:27 * devn notes that I should probably spend some time on a reasonable article for a new user setting up emacs with clojure

12:28 devn: technomancy_: I think it's kind of a bummer that emacs-starter-kit is now all hidden away in marmalade. It's less accessible. Also, what gives with it being a starter-kit and turning off the menubar? It's nice to be able to pull down a menu and peek at a keybinding here and there.

12:28 grumble grumble

12:28 Raynes: devn: Please don't. :p

12:29 devn: Raynes: why not?

12:29 Raynes: Because that blog post will be outdated at some point and will add to the list of confusing unofficial outdated documentation on the internet. Why not just contribute to official docs?

12:29 duck1123: devn: blog posts get outdated quickly

12:30 Raynes: Just edit the page on dev.clojure.org or contribute to clojure-mode's README or something.

12:30 devn: Raynes: that's what I was planning on.

12:30 It's going to be its own article though. You can go as far as you want with it, but a full setup is more than a little time consuming.

12:31 Raynes: Oh. I thought when you said 'article' you were implying a blog post.

12:32 devn: *nod* no worries

12:33 I'm really excited that clooj looks like it might try and implement the DrRacket/DrScheme feature that draws arrows for you to show you where things come from

12:37 like this: http://www.ccs.neu.edu/home/matthias/HtDP2e/scope2.png <-the result of hovering over f

12:39 duck1123: it's just finding other instances of the var name, right?

12:39 devn: yeah, scoped search highlight

12:40 it's still really cool, and awfully handy for teaching

12:40 duck1123: oh wait, part of my confusion comes from my inability to read scheme

12:41 I was reading f in the second one as an argument, then couldn't figure out what it was called

12:41 technomancy_: devn: menu bars don't scale

12:42 the choice of what commands are in the menu bar is always arbitrary since it's such a small subset of the total commands, so using the menu bar will mean you miss out on lots of other functionality. better to just learn how describe-mode and apropos work

12:42 devn: technomancy_: no disagreement, just sharing what my experience was when I first picked up emacs. The menu bar helped me get to the places I wanted to go. I needed it less and less, but even today I sometimes like to peek at the org-mode menubar here and there.

12:43 I agree it is not a long-term solution, but for a starter kit it doesn't seem like a terrible thing to keep around. That real estate is going to be taken up regardless of whether it's turned on or not.

12:43 technomancy_: what do you mean?

12:43 devn: (on OSX anyway)

12:43 technomancy_: oh, well that's a separate problem

12:43 devn: the menubar is going to be a big white block, or it could contain things related to emacs. perhaps it should stay on in OSX as a default? It doesn't seem like there's any harm in it.

12:44 technomancy: I actually had no idea turning off the menu bar even had any affect on mackosecks

12:45 how does it interact with fullscreen?

12:48 duck1123: it's a shame the menubar doesn't work with unity yet

12:49 jacortinas: So no one using vim/vimclojure/nailgun to do their coding? I'm seeing a lot of comments that are basically "Use Emacs".

12:49 TimMc: It *is* traditional...

12:49 There are definitely vim users though.

12:49 technomancy: antares_: any progress? I can take a look

12:49 jacortinas: I don't think it's healthy for the community to basically not even try to support other editors

12:49 antares_: technomancy: we resolved it, thank you

12:50 jacortinas: being so exclusionary turns people off the language.

12:50 TimMc: jacortinas: Well, it's a good thing we don't do that!

12:50 jacortinas: :)

12:50 technomancy: antares_: anything I should be aware of?

12:50 antares_: technomancy: clojure.data.json dragged in clojure 1.2.0 in my case, excluding it helped. It was a real issue I did not notice because my ~/.m2 had all kinds of old junk in it.

12:51 technomancy: antares_: so it wasn't specific to the CI runs then? you were able to repro locally?

12:51 antares_: technomancy: after I removed ~/.m2, yes, I reproduced it locally easily

12:52 technomancy: oh, so there was a screwup with a republished artifact, yuck.

12:52 antares_: technomancy: https://github.com/michaelklishin/monger/commit/c8fe274329d47c1181da1d1a1e3dfe665143cc3e (for the record)

12:52 TimMc: jacortinas: However, I do think it is reasonable to discourage the use of editors that cannot be made s-expression-aware. Emacs, vim, and Eclipse can all at least be made to highlight matching parens.

12:54 jacortinas: TimMc: I agree with that, all of those editors also run reasonably well on Windows. I'm just trying to get some help setting up vim and nailgun, and I'm realizing there are not many good resources.

12:54 I've been using vimclojure and a terminal happily, until I saw this video http://www.youtube.com/watch?v=ObR3qi4Guys

12:55 TimMc: It's true, there is much better support for Emacs.

13:24 Saturnation: I hate my job, it keeps me from playing with Overtone...

13:33 duck1123: There needs to be an Overtone/Nagios plugin so that the auto-generated music becomes more and more intense as services start failing and databases catch fire

13:36 ckirkendall`: duck1123: I know that was a joke but I would love something like that.

13:39 jacortinas: you could do something really simple like using ping times as multipliers for randomness or something

13:39 the more time it takes to get a response to more chaotic the music could become

13:39 duck1123: is there a good way to get load averages in clojure?

13:40 I was looking, but put that one on the back-burner

13:42 jacortinas: anyone in here have experience getting vim, vimclojure and nailgun working?

13:42 * Saturnation just wants to mashup overtone and core.logic...

13:43 nickmbailey: duck1123: you mean cpu load? you can get it over jmx: http://docs.oracle.com/javase/6/docs/api/java/lang/management/OperatingSystemMXBean.html#getSystemLoadAverage()

13:47 duck1123: also see the jmx contrib library for fairly easy jmx interaction: https://github.com/clojure/java.jmx

13:47 duck1123: nickmbailey: awesome, I'll check that out

14:04 jacortinas: one last time, anyone using vimclojure and nailgun successfully?

14:05 duck1123: wish I could help you, man

14:05 jodaro: jacortinas: sorry, no experience there, either

14:05 ckirkendall`: ckirkendall`: I use vimclojure but have not tried nailgun sorry

14:05 lol I even talk to myself in IRC.

14:05 jacortinas: lol

14:06 thank you guys anyway :)

14:41 technomancy: has anyone done a comparison between drift and lobos?

14:42 as a rule I'm a bit wary of libraries that just do a literal port of functionality from (say) rails, but I don't have any specific gripes with rails migrations.

14:43 lobos has marginalia docs; nice

14:47 heh; the first hit for "clojure lobos vs drift": http://thelastcitadel.com:3000/?page=0&q=(((channel%3Aclojure)+AND+looks)+AND+drift)+AND+lobos

14:48 pjstadig: we've started using drift at work

14:49 i'm not keen on just porting stuff either, but there's also something to be said for lessons learned

14:49 drift is actually i bit more general than just database migrations, which is nice

14:50 technomancy: oh, cool. have you used it for multiple migrations yet?

14:50 pjstadig: we have used it for zero migrations so far

14:50 just getting started with it

14:51 technomancy: did you pick it over lobos specifically because it's not tied to sql?

15:02 http://python3wos.appspot.com/ <= how long till we need one of these for Clojure 1.3? =)

15:07 apgwoz: hello

15:08 is there a way to get ring-jetty-adapter to spit out a stack trace instead of just automatically throwing a 500?

15:11 gtrak: there's probably a middleware for that

15:12 possibly ring.middleware.stacktrace

15:12 apgwoz: gtrak: i was just about to check in the middleware, which is the only place i hadn't looked

15:12 gtrak: everything in ring is middleware though :-)

15:12 apgwoz: i thought there might be a :debug flag or something for run-server

15:13 gtrak: that would smell of convention over configuration

15:13 apgwoz: sure.

15:13 i don't work with ring often enough

15:14 also, not seeing one, but looking closer

15:14 ah, yes. in ring-devel here we go

15:14 cool

15:15 gtrak: convention over configuration is like... 'we're willing to take the complexity hit to optimizefor 80% of our use-cases"

15:15 apgwoz: i know what convention over configuration is.

15:15 :)

15:15 technomancy: apgwoz: noir does that fwiw

15:15 gtrak: 'now go learn our assumptions if you want to get anything done' :-)

15:16 apgwoz: technomancy: the :debug flag?

15:16 amalloy: technomancy: hah that is an excellent page

15:16 technomancy: apgwoz: "dev" mode that does clj-stacktrace-powered 500s

15:16 apgwoz: technomancy: ah, ok. cool

15:17 cemerick: That's a pretty damning illustration of the state of things in Python-land.

15:18 gtrak: yea, I totally shut down when I tried to learn django

15:18 but that was before I hit java EE and spring even

15:19 technomancy: ruby equivalent: http://isitruby19.com/

15:19 gtrak: spring security is the worst i've seen for it yet, if you want to do anything clever, you have to ditch the namespace config or learn the whole api at once

15:20 djh__: has anyone had any experience of using clj-redis?

15:21 cemerick: gtrak: what do you use instead for e.g. openid and oauth?

15:21 gtrak: well, we use spring security :-), not for the clojure yet though

15:22 apgwoz: the state of python 3.0 for many people is "don't care, I'm fine with 2.5, 2.6, or 2.7"

15:22 gtrak: actually right now we're just letting apache handle the security for the clojure apps, I was considering an integration with spring sec or shiro if required

15:23 security is just hateful though :-), not a fan

15:24 cemerick: gtrak: thanks, hadn't seen shiro before

15:24 gtrak: yea, it looks like its got less baggage

15:24 cemerick: Can't say its API looks any less complicated than spring-security tho

15:26 Looks like it's focussed mainly on intranet security — ldap, activedirectory, etc — but no oauth?

15:26 gtrak: looks like it's not there yet

15:27 spring sec has oauth

15:27 cemerick: yeah, that's what I use now

15:28 gtrak: are you using the DI along with it?

15:29 cemerick: Yeah. Leaves a bad taste, but it's better than mucking with the API, as you pointed out. :-)

15:30 I've never had to stop using the namespace config for anything. (I try to avoid cleverness w.r.t. security stuff. ;-)

15:30 gtrak: yea, I had to implement a redirect on invalid authentication, and associate a user to smartcard cert in a spring mvc app, it was god-awful :-)

15:31 the solution involved an AOP-injected state bean to tell something further down the line to redirect on failure

15:32 like a really complicated way to approximate a closure

15:36 i think the ring approach is much nicer than the dispatcher-servlet

15:36 or interceptors or whatever crap spring has :-)

15:37 passing around mutable servlet objects is what made it hard

15:40 duck1123: Is OAuth difficult to do in Clojure? I've been planning to do that for my site for a while

15:40 I had OpenID working for one of the previous sites I did, but it's so old I doubt I'll be able to salvage much

15:40 gtrak: there's this: https://github.com/mattrepl/clj-oauth

15:41 amalloy: duck1123: oauth and openid are pretty different

15:42 duck1123: amalloy: I know

16:05 mdeboard: So, I'm spitting an HTT request payload to a .txt file, then trying to read it via (read-string (slurp "file.txt")) but am getting an "Unreadable form" error. Is there something I'm missing? the HTTP request is in the form of a clojure map. Is it just that i Need to spit it to "file.clj" instead?

16:08 amalloy: you're printing something that's not readable, like an HTTPConnection or whatever

16:09 if you look at the file yourself it should be pretty clear what's illegible; it probably starts with #< (but no guarantees)

16:11 patrkris_: can anyone tell me what I'm doing wrong here: http://pastebin.com/eukBQ22J

16:13 gfredericks: patrkris_: well I think that particular error is your import syntax

16:14 patrkris_: I should use ['s instead?

16:14 gfredericks: if you want to import foo.bar.Baz you can (:import foo.bar.Baz) or (:import (foo.bar Baz))

16:14 patrkris_: ah, i have an unnecessary level of parentheses

16:14 gfredericks: no, [] vs () is not significant

16:14 patrkris_: thanks :)

16:15 gfredericks: patrkris_: right, the parens as you have them are usef for importing multiple classes in the same package, which you do correctly in the first import

16:15 though in that case it's still only one class so you're not gaining much

16:15 mdeboard: amalloy_: Negative, at least not visibly. ls

16:15 oop

16:15 patrkris_: yes, thanks again :)

16:15 mdeboard: amalloy_: Starts with {:request ...

16:17 gfredericks: I have a library which requires a config file that I don't want distributed with `lein deploy`, but I do want to be able to `lein run` while developing. Is there any place I can put the config file where `lein run` sees it but I don't have to worry about it slipping into the jar? Am I doing something wrong altogether?

16:17 maybe I need two sub-modules :/

16:17 mdeboard: gfredericks: lazybot uses a lazybot/.lazybot/config.clj structure

16:18 so lazybot/ has .lazybot/ and src/lazybot/stuff.clj

16:18 that .lazybot dir doesn't get sucked up into compilation

16:18 so maybe an example to use

16:18 gfredericks: mdeboard: does .lazybot get on the classpath automatically somehow, or do you hardcode that dir-name?

16:19 mdeboard: it gets cp'd to user.home and that is hardcoded

16:20 Raynes can probably better answer your specific questions

16:20 duck1123: I keep a config.clj at the root of my project and then have code that seeks that file out and loads it

16:20 if I package up a jar, that file is not part of the jar

16:21 gfredericks: duck1123: but how would that work from a jar that another project's requiring? It just checks the classpath as well?

16:21 i.e., I want it to work from lein run, but if my jar is being used in some other project it should find the config file on the classpath there

16:21 tolstoy: gfredericks: I think there's a lein setting where you can put files to exclude from the jars.

16:22 duck1123: well, in my case, I require the user of my lib to create their own config file

16:22 tolstoy: gravity: jar-exclusions

16:22 gfredericks: tolstoy: checking. If that's the case I'll be moderately embarassed for not looking first.

16:22 tolstoy: gfredericks: jar-exclusions is the one.

16:22 gfredericks: tolstoy: okay. I will slowly walk away in shame now. Thank you.

16:23 tolstoy: gfredericks: I develop all kinds of techniques, then look in sample-project.clj and erase them all. ;) That or clojure.core.

16:26 amcnamara: dnolen: ambrosebs: I'd love to see how you guys would go about solving this: http://www.4clojure.com/problem/140 (minimizing boolean functions)

16:30 tackling it with core.logic might make for a neat blog post (the 4clj blog needs content)

16:31 dnolen: amcnamara: neat, I didn't know that 4clj had a blog

16:32 amcnamara: its suffering from neglect, I want to start making posts that are related to questions, esp ones that expand on the core and introduce people to new libs

16:33 jodaro: its funny how drastically an implementation changes from thinking about it in the shower to actually making it work in my chair

16:35 blakesmith: jodaro: I take long showers for exactly that reason. ;-)

16:40 duck1123: much better than putting your servers in the bathtub

16:41 jodaro: definitely.

16:44 lnostdal: i suppose (. some-record some-record-field) is faster than (:some-record-field some-record) ? .. this seems to be the case here

16:47 dnolen: lnostdal: well one is field access, the keyword access is optimized over doing the same thing with a plain map but you'll still see a perf hit.

16:48 lnostdal: ok, yeah

16:51 duck1123: is reflected field access still faster? Or does that even apply?

16:53 technomancy: gfredericks: actually it sounds like you want to create a dev-resources/ directory

16:54 sorry, test-resources/

16:57 pandeiro: is it possible for lein run to time out while it's grabbing dependencies from clojars?

16:58 dnolen: duck1123: field access via reflection is dog slow.

17:12 gfredericks: technomancy: I thought of that, but assumed `lein run` didn't use test-resources -- am I mistaken?

17:13 technomancy: gfredericks: if you set LEIN_NO_DEV=y, then the test/ stuff won't be on the classpath, but otherwise you're fine

17:13 gfredericks: ah, so it _will_ use test-resources by default

17:13 cool, thanks

17:23 Bahman: Does anyone has any experience using Proguard to obfuscate Clojure programs?

17:23 has = have

17:24 gtrak: Bahman, I imagine you'd have to AOT everything

17:25 we built a little plugin to compiile all the dependencies of a clojure project, so it's possible

17:26 Bahman, but aren't the classfiles obfuscated enough already? seems like proguard would be working at the wrong level of abstraction

17:27 arohner: I'm starting swank in my app in source, i.e. (swank.swank/start-server ..). When testing, it appears swank is keeping the jvm from exiting. Is there a clean way to mark the swank threads as daemon threads?

17:27 cemerick: gtrak: No; a motivated third party could pretty easily produce very sane Clojure source files from classfiles.

17:28 gtrak: cemerick, how would that change with proguard though? maybe if you run the whole clojure core into it as well it would get hard

17:28 cemerick: Yeah, that's the only way to do it.

17:29 gtrak: but it wouldn't know how to obfuscate strings like var names

17:29 Bahman: gtrak: I used JD (an almost simple Java decompiler) and I was able to follow the program logic through decompiled code.

17:29 gtrak: Thanks for the hint re AOT.

17:29 gtrak: Bahman, yea, because everything would be plumbing into core functions :-)

17:29 cemerick: A source obfuscator is fairly simple and might yield the sort of results you're interested in.

17:31 duck1123: arohner: are you putting the start code at the top level, or in a -main?

17:31 Bahman: cemerick: Tried putting the whole clojure.jar into Proguard but it didn't work.

17:31 gtrak: you could totally write a source obfuscator as an extension to the clojure compiler, no?

17:31 cemerick: Bahman: What broke, specifically?

17:31 arohner_: duck1123: in an init function that is a dependency for several functional tests

17:31 Bahman: cemerick: Let me reproduce it...

17:31 arohner_: duck1123: I suppose a simple solution would be to just not start swank when testing...

17:32 but then I need to figure whether I'm testing

17:32 jaley: is anyone using recent versions of ring and compojure successfully on google app engine or is it known to be broken?

17:33 cemerick: gtrak: A very natural extension to a whole-program optimizer / tree-shaker

17:33 duck1123: arohner: have you tried running (shutdown-agents) after the tests? I do it in reverse, swank when running, but not testing

17:33 cemerick: (all very lofty ideas with very complicated details :-P)

17:34 gtrak: cemerick, right, but the whole 'read into data structures' makes that a lot easier than it could be

17:35 Bahman: cemerick: This is the result of running the uberjar generated by Lein: http://pastebin.com/bcq98CjD

17:35 arohner: duck1123: no, but I did dump the thread list, and filtered on user threads. There are several swank related threads there

17:35 Bahman: No shrinking and optimisation in Proguard...only obfuscation.

17:38 cemerick: Bahman: either it's not finding and munging classname constants

17:39 or it's not altering strings passed to Class/forName

17:39 Bahman: I think the latter hunch is right.

17:40 cemerick: IIRC, there's some configuration around that?

17:40 Bahman: cemerick: Checking...

17:44 pandeiro: i keep getting "Premature EOF" while trying to grab dependencies with lein... is that normal or is there probably something wrong on my end?

17:44 Raynes: Well, it obviously isn't normal.

17:46 pandeiro: Raynes: yeah i'm glad you confirmed that

17:46 duck1123: check the parens of your project.clj

17:46 pandeiro: i am trying to use noir and using its own plugin and then calling lein run

17:47 it is getting some deps, but taking forever, while others fail outright

17:47 network issue i guess? clojars.org loads fine in the browser though

17:48 duck1123: sometimes it's helpful to write out your pom file, then use maven's dependency stuff for a bit more control

17:49 lein pom && mvn dependency:tree -U

17:50 pandeiro: duck1123: thanks i'll try that after i see if my linode box runs into the same issue

17:55 odd, it couldn't get anything from clojars either... but could from repo1.maven.org

18:16 leafw: can incanter plot a line with the std as a band of color around it?

18:24 duck1123: As far as the logging problem I had this morning, it was Korma that was setting everything to debug level

18:25 Raynes: ibdknox is evil.

18:25 duck1123: Were you at the conj? I kept looking for Al Borland but never found him.

18:26 duck1123: No, I was at home hating all your guts

18:26 Raynes: Heh

18:26 gtrak: conj was so awesome :-)

18:26 Raynes: I don't think so, Tim.

18:42 gtrak: logging just sucks in general

18:42 i like heroku's approach

18:44 duck1123: well, now I'm getting no logging at all, but it's past 6 and I've changed gears

18:45 gtrak: seems like it needs to work at a higher level

18:45 maybe it does, but the defaults aren't suitable

19:08 alexbaranosky: does anybody but me think it would be great to have a heredoc reader macro in Clojure?

19:12 jacortinas: anyone have experience of getting the latest vimclojure working with nailgun?

19:13 alexbaranosky: not having a nice syntax for writing strings feels so 90'

19:13 s

19:14 amalloy: heredocs are "nice syntax"?

19:14 technomancy: if you use paredit it automatically escapes " inside strings

19:14 FWIW

19:23 brehaut: simple solution; use smart quotes inside your docstrings

19:25 tmciver: smart quotes?

19:28 brehaut: “smart quotes”

19:28 technomancy: more like “smart” quotes

19:28 tmciver: looks like curved quotes that are different from the quotes used to enclose the doc string . . .

19:28 brehaut: typographically correct, annoying to type quotes

19:29 tmciver: How DO you type them?

19:29 brehaut: they are. and elipsis isnt 3 dots either ;)

19:29 tmciver: 3 space-separated periods

19:29 brehaut: on a mac it's opt + [ and opt + { for doubles and opt + ] and opt + } for singles

19:29

19:30 hiredman: brehaut: not on my mac

19:30 brehaut: you can also do those french quotes « » with opt + \ and opt + |

19:30 hiredman: rebound ?

19:30 hiredman: hmmm, not in iterm

19:31 brehaut: try in textedit?

19:31 hiredman: ah, yes, because opt is meta

19:31 brehaut: aha of course

19:31 amalloy: tmciver: easy to type. fire up ms word, type some quotes, copy-paste into emacs

19:31 brehaut: oh, and a true elipsis is opt + ; (although text substitution will also take care of it in lion)

19:32 hiredman: or if you have irssi setup to do the substitution

19:33 tmciver: amalloy: easy-peasy!

19:33 brehaut: i think the compose key in linux lets you do similar things

19:34 http://en.wikipedia.org/wiki/Compose_key

19:34 TimMc: I just memorize Unicode code points. -.-

19:36 leafw: is there a lazy version of reverse?

19:36 ,(doc reverse)

19:36 clojurebot: "([coll]); Returns a seq of the items in coll in reverse order. Not lazy."

19:37 technomancy: leafw: how would that work?

19:37 leafw: technomancy: by asking for count - i ?

19:37 TimMc: leafw: If you have a vector, rseq is good.

19:37 ,(doc rseq)

19:37 clojurebot: "([rev]); Returns, in constant time, a seq of the items in rev (which can be a vector or sorted-map), in reverse order. If rev is empty returns nil"

19:37 technomancy: leafw: merely calling count on a lazy seq forces the entire thing

19:37 leafw: yes but if the seq is not lazy, the reverse can be lazy

19:37 TimMc: ...depending on exactly what you want.

19:38 technomancy: oh, I see; yeah.

19:38 alexbaranosky: is the dev goole group the place to ask about adding a heredoc reader macro?

19:39 leafw: TimMc: rseq will do, thanks

19:55 sritchie: ambrosebs, I did some weekend work I think you might find interesting

19:55 I pulled the macros behind clojure-koans out into its own project, so you can write koans for any clojure library: https://github.com/functional-koans/clojure-koan-engine

19:56 Raynes, the template project is pretty much set, I think! https://github.com/functional-koans/koan-template

19:56 and finally, a lein-koan plugin: https://github.com/functional-koans/lein-koan

20:01 hiredman: so, what is the recommended way to print objects that preserves metadata and does not overly specify types?

20:02 amalloy: hiredman: bind *print-meta* to true?

20:03 hiredman: and there is no pr* variant for it?

20:03 amalloy: we have too many pr* variants already imo

20:03 hiredman: I suppose that'll do

20:03 oh really?

20:04 how many are there?

20:04 amalloy: i'm mostly thinking of pr, pr-str, prn, prn-str, print, print-str, println, println-str

20:05 hiredman: ah, yes, the -strs

20:05 amalloy: apparently there are also print-simple, print-ctor, printf, print-dup

20:06 anyway, we have three main "options" for printing, and 2^3 print functions. this is why i argue strongly against people who beg for def-

20:06 hiredman: print-simple and print-ctor are part of the implemention of print-method or print-dup

20:07 amalloy: i knew that about print-ctor, didn't know about print-simple. but they're publicly exposed in clojure.core

20:14 gfredericks: I just learned me some new print functions.

20:14 I don't know that I have much use for them though

20:18 accel: is there a way to use somethign like nailgun and keep a constantly running clojure server that I just "telnet" to whenever I need to execute a piece of code?

20:19 I don't want to reload the jvm on every execution of Hello World

20:19 cemerick: It seems like all the -strs should have been dropped once with-out-str came along.

20:20 mdeboard: accel: with emacs there is for sure, I guess there might be one for vim

20:20 technomancy: accel: jark is designed with that use case

20:23 accel: technomancy: jark is exactly waht I wanted; thans!

20:23 k

20:23 (some letters defy space time boudns)

20:23 hiredman: cemerick: well, pr-str is great for logging, if the thing you log might be a lazy seq

20:23 ,(str (range 10))

20:23 clojurebot: "clojure.lang.LazySeq@9ebadac6"

20:23 hiredman: ,(pr-str (range 10))

20:23 clojurebot: "(0 1 2 3 4 ...)"

20:23 accel: so I've read http://clojure.org/getting_started ... but how do I actually install clojure and get clj?

20:24 brehaut: ,(apropos #"-str$")

20:24 clojurebot: (with-in-str with-out-str print-str prn-str pr-str ...)

20:24 cemerick: hiredman: If logging means printing to *out* I guess?

20:24 hiredman: cemerick: no, no

20:24 (log/info (range 10))

20:25 vs (log/info (pr-str (range 10)))

20:25 cemerick: oh, misread your msg

20:26 hiredman: actually I use pr-str like that by reflex and have been for some time, possibly tools.logging does a better job logging lazy seqs these days

20:27 accel: hmm, basically, I need leiningen?

20:28 hiredman: accel: no, download the clojure jar, type java -jar clojure.jar

20:28 Raynes: sritchie: Hah. A young jedi. I haven't even seen starwars.

20:28 hiredman: now you have a repl, go to town

20:28 accel: that gets me a repl

20:29 how do I get clj

20:29 and compiling stuff?

20:29 hiredman: what do you want to do?

20:29 Raynes: Just get leiningen.

20:29 accel: i want to write programs in clojure

20:29 not just use the repl

20:29 hiredman: all you need is the repl

20:29 what programs?

20:29 accel: actually; i have a bunch of haskell code I want to convert over to clojure

20:29 I want to be able to develop in vim; use makefiles, etc ...

20:29 the repl is nice, but I need more

20:30 hiredman: really, none of that requires a repl, all you need is a nice editor

20:30 do you have dependencies to manage?

20:31 brehaut: is there a better way of taking a symbol without a namespace and creating a new symbol with the same name but a different namespace than (symbol "ns" (name old-sym)) ?

20:31 hiredman: not that I am aware of

20:32 brehaut: thanks

20:32 weavejester: Leiningen isn't necessary, but is recommended. It's useful for managing Clojure projects and dependencies.

20:32 hiredman: ,(symbol 'foo) ;; works

20:32 clojurebot: foo

20:32 accel: I have no dependencies to manage

20:32 hiredman: ,(symbol 'foo 'foo)

20:32 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.String>

20:32 hiredman: ,(symbol "foo" 'foo)

20:32 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.String>

20:32 technomancy: weavejester: how are you finding lobos?

20:32 weavejester: Using the Clojure jar on its own, you can either run a repl, or run a script.

20:32 hiredman: accel: then you just need an editor

20:32 accel: how do I run a script? actually, where is the documentation for this?

20:33 hiredman: java -jar clojure.jar --help

20:33 accel: readme.txt only says To run: java -cp clojure-${VERSION}.jar clojure.main

20:33 hmmm

20:33 hiredman: sure

20:33 weavejester: technomancy: The DSL I like, the migrations not so much, but I'm thinking that migrations should be an independent library.

20:33 technomancy: clojure really has had no effort put into its out-of-the-box experience

20:34 hiredman: that is equivalent to what I have been saying

20:34 Raynes: Leiningen is the answer to life, the universe, everything.

20:34 technomancy: weavejester: do you see it as being complementary to korma?

20:34 accel: technomancy: I think it's a feature; to weed out the weak

20:34 hiredman: accel: sure

20:34 accel: technomancy: they should make the installation process require writing macros

20:35 weavejester: technomancy: As far as I can see, Korma only handles queries and inserts, not schema design, whilst Lobos is all about creating tables etc.

20:35 technomancy: weavejester: right, seems like there's not much overlap

20:35 hiredman: it's really not hard at all, I don't understand why everyone wrings their hands and wails about "the noobs"

20:35 weavejester: technomancy: Migrations I think are something separate again; in theory there's nothing tying migrations to SQL.

20:35 technomancy: I was asking ibdknox if he had plans to add schema manipulation to korma, but it looks like lobos has it pretty well covered

20:36 hiredman: 'java -jar clojure.jar' and you have a repl, being a programmer you already have an editor, so now you have a repl and an editor, and you are set

20:37 Raynes: Until you have dependencies and an actual project.

20:37 Then you have to understand and manage the classpath.

20:37 technomancy: hiredman: really though, we aren't savages. line history is a requirement.

20:37 brehaut: Raynes: acres of bash script

20:37 accel: Raynes: you've convinced me I need lein

20:37 Raynes: Which is generally impossible without maven if you plan to distribute code.

20:37 tensorpudding: you still haven't covered how you'd make your clojure project into a .jar

20:37 weavejester: technomancy: Yeah. I think I'm going to be using Lobos to write the SQL part of my migrations.

20:37 hiredman: technomancy: how so?

20:37 technomancy: requirement to do what?

20:37 technomancy: hiredman: I mean you need to at least mention rlwrap

20:37 a requirement to be taken seriously

20:38 hiredman: by who?

20:38 technomancy: programmers?

20:38 Raynes: Creating jar files, executable jar files, war files, complicated build processes, etc.

20:38 brehaut: also, does anyone else every want an apropos that includes the namespace the symbol is found in ?

20:38 Raynes: clojure.jar is not going to be sufficient for much of anything, realistically.

20:38 duck1123: if all you have is a clojure repl and notepad, rlwrap is vital

20:38 tensorpudding: java sure is cute like that

20:38 Raynes: Unless, of course, all you want is a REPL with nothing but Clojure on the classpath.

20:38 hiredman: duck1123: not true

20:38 at all

20:38 weavejester: It's harder to setup Clojure with the jar than Lein, IMO.

20:39 Raynes: It really isn't just Java. Every language has some kind of dependency system.

20:39 hiredman: weavejester: no way

20:39 Raynes: They hve to.

20:39 have*

20:39 hiredman: lein brings in all these maven concepts

20:39 which are very useful, and you will want

20:39 but not required by any means

20:40 technomancy: weavejester: I wonder if drift and lobos could also be seen as complementary

20:40 hiredman: it is very doable to write useful clojure code (code that delivers features) without any of that

20:41 weavejester: hiredman: Lein's pretty easy to setup. You just download and run a script, IIRC. Running the Clojure jar is pretty much the same thing.

20:41 technomancy: except with the clojure jar you will probably end up downloading the clojure.zip file, which has a readme that contains instructions that don't work.

20:42 hiredman: technomancy: really?

20:42 technomancy: hiredman: for true. =(

20:42 weavejester: technomancy: Drift seems to attempt to do migrations and schema design, and Lobos does too. They're more competing, I think.

20:42 technomancy: at least, that's what someone reported on the mailing list

20:42 hiredman: technomancy: works for me

20:42 technomancy: weavejester: I didn't see any schema design in drift when I was looking at it this morning

20:42 weavejester: technomancy: Really? Oh, no, you're right, sorry.

20:43 technomancy: I was thinking of something else.

20:43 hiredman: the readme.txt has instructions for buidling with ant and with maven, both work for me

20:43 accel: Raynes: is there a way to use Lein with jark?

20:43 technomancy: accel: the lein integration in jark is still being developed

20:43 weavejester: technomancy: I like Drift's separation, but I don't like using multiple files for migrations.

20:44 technomancy: accel: last I checked (~3 months ago) it wasn't working for running leiningen tasks

20:44 it might work for simpler things though

20:44 accel: so basically, lein is equiv to cabal ?

20:44 technomancy: weavejester: I spent a while trying to get drift working using raw c.j.jdbc, but without lobos it was just too annoying

20:45 hiredman: sort of

20:45 it is kind of a shim on top of maven's dependency stuff

20:45 technomancy: total chicken/egg problem since you have to have a table in which to store your schema version number, but you can't use drift to create that table yet.

20:45 looks like they fixed the Clojure readme; that's good.

20:46 accel: btw; where the fuck did ein install everythin?

20:46 weavejester: technomancy: I've been working on a migration library called Ragtime that'll rely on Lobos for any schema building. It takes a different approach to Drift.

20:46 technomancy: that was my first patch submitted to Clojure ~3 years ago; fixing busted readme insntructions

20:46 weavejester: how so?

20:46 alexbaranosky: ~/.m2 folder

20:46 clojurebot: Pardon?

20:46 alexbaranosky: accel: ~/.m2 folder

20:47 hiredman: accel: see, you could have the jar file and a repl running and be rolling along writing code right now

20:47 technomancy: apparently the scala guys have a fork of jline that is actually pretty good

20:48 hiredman: doesn't jruby have one too?

20:48 technomancy: I think jruby has real readline

20:48 accel: hiredman: lol

20:48 tensorpudding: lein can build, lein can fetch deps, lein can run a swank server for you

20:48 weavejester: technomancy: Migrations in Ragtime are loaded from a namespace, rather than from a directory of files.

20:48 accel: alexbaranosky: ~/.m2 is empty

20:48 where did lein put clojure though?

20:48 hiredman: technomancy: nah, they use jline

20:48 accel: ie. "lein repl" <-- how the fuck does lein find clojure?

20:48 hiredman: accel: tone down the language a little

20:48 technomancy: hiredman: oh, huh. scala's has programmable completion

20:48 Raynes: It comes with Clojure.

20:49 technomancy: accel: why do you care?

20:49 accel: technomancy: I care how it's setup

20:49 weavejester: technomancy: They're also first class objects, which... I don't think they are in Drift?

20:49 accel: just curious

20:49 Raynes: Or, Clojure comes with it.

20:49 accel: hiredman: noted

20:49 Clojure comes with lein?

20:49 i'm confused

20:49 amalloy: lein bundles a clojure version

20:49 Raynes: Because it is... written in it.

20:49 technomancy: weavejester: I think in drift they're defined as just an up and down defn inside a given namespace

20:49 Raynes: Which means it kind of sorta needs it.

20:49 tensorpudding: lein is a standalone jar

20:49 jacortinas: Could someone point me to a good example of a compojure web application? Something a little more complex would be awesome.

20:50 technomancy: weavejester: what are migrations made of in ragtime?

20:50 accel: okay, so I have ~/local/bin/lein ... where is the lein.jar file and lein's versino of clojure stored?

20:50 amalloy: jacortinas: www.4clojure.com www.github.com/4clojure/4clojure perhaps?

20:50 technomancy: I kinda like the "give me a namespace that has $X and $Y defined" model in general.

20:50 weavejester: technomancy: In Ragtime they're types implementing a Migration protocol.

20:50 technomancy: it works really well for lein tasks

20:50 jacortinas: amalloy: awesome thanks :)

20:50 accel: ~/.lein

20:50 I am now happy

20:50 clojurebot: Gabh mo leithscéal?

20:50 Raynes: Though 4Clojure will be using noir as soon as I get a chance to make it so.

20:50 amalloy: over my dead body, man

20:51 jacortinas: Raynes: Why the switch?

20:51 lol

20:51 so noir just uses compojure correct?

20:51 Raynes: Because Noir is awesome and Chris Granger is my friend.

20:51 jacortinas: just adds some conventions

20:51 technomancy: weavejester: hmm... I don't see what protocols bring to the table here

20:51 there's no fancy dispatch going on; just two operations

20:51 tensorpudding: when you build deps for a project it copies the correct version of clojure.jar into the classpath

20:51 Raynes: noir is a higher-level and more put together framework on top of compojure.

20:51 amalloy: noir is better than what we're doing now, i'm fairly sure. but i'm not excited to rewrite everything to use noir instead

20:51 sunng: jacortinas: clojuresphere could be a good demo https://github.com/jkk/clojuresphere

20:52 jacortinas: sunng: thank you

20:52 :)

20:52 Raynes: amalloy: I think you'll be happy with how simplified things will be.

20:52 jacortinas: Raynes: I felt like the example noir blog was kind of mixing concerns

20:52 weavejester: technomancy: Well, you can create a function that returns a migration, for instance.

20:52 seancorfield: i wonder what 4clojure would look like in FW/1? :)

20:52 * Raynes promises to never find out. ;)

20:53 technomancy: weavejester: seems like that introduces a discoverability problem too though

20:53 jacortinas: Raynes: maybe it's my OO rails background, but I hated seeing form validation stuff in the namespace that is pretty much reserved for db interactions

20:53 sunng: noir to compojure is something like django to bottle if you are familiar with python web frameworks

20:53 weavejester: technomancy: So you could have a `create-table` function or macro that would return a migration that would create the table when (up migration) is executed, and drop the table when (down migration) is executed.

20:54 technomancy: By having migrations as first-class objects, you can build abstractions around them. Also you can bundle them in a jar.

20:54 technomancy: you can already put namespaces in a jar though

20:54 defn is the best abstraction in all of Clojure =)

20:54 hiredman: you can also pass namespaces around

20:54 ,*ns*

20:54 clojurebot: #<Namespace sandbox>

20:55 weavejester: technomancy: But you can't search a directory for resources, right?

20:55 hiredman: ,(find-ns 'clojure.core)

20:55 clojurebot: #<Namespace clojure.core>

20:55 technomancy: weavejester: sure; that's how "lein help" works

20:55 accel: how do I install vimclojure?

20:55 do I place it in ~/.vim and unzip?

20:55 jacortinas: accel: for the non-interactive stuff yeah

20:56 it's that simple

20:56 weavejester: technomancy: How does that work? I didn't think it was possible to iterate through resources on a classpath?

20:56 hiredman: "very slowly"

20:56 weavejester: technomancy: Other than explicitly checking to see if its a jar or dir and then iterating through them.

20:57 technomancy: weavejester: https://github.com/technomancy/leiningen/blob/master/src/leiningen/util/ns.clj

20:57 headius: technomancy, hiredman: we still use jline 1.0ish

20:57 technomancy: it's really slow if you don't require everything to be grouped under a prefix, if you do it's not so bad

20:57 headius: have you looked at scala's?

20:57 weavejester: technomancy: Oh, I think tools.namespace does something similar to that, right?

20:57 hiredman: :(

20:58 headius: technomancy: not really...there's an FFI-based wrapper around actual readline I've considered

20:58 technomancy: weavejester: tools.namespace does, but without allowing a prefix. see the comment at the top of the file

20:58 amalloy: weavejester: he has a comment in there explaining why tools.namespace is no good

20:58 weavejester: technomancy: Ahh

20:58 hiredman: this classpath walking stuff is icky, because really who cares about classpaths? the real way things are loaded is via classloaders

20:58 headius: if scala's doesn't require scala, it could be an option

20:58 hiredman: and classloaders don't give you a good way to iterate

20:58 accel: so I'm following https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md : after I have written code in core.clj ... how do I run it?

20:59 weavejester: technomancy: Still... if a migration is a namespace, that doesn't seem as composable as a namespace as a type.

20:59 technomancy: headius: I don't think it does; someone's integrating it to Clojure here: https://github.com/trptcolin/reply

20:59 weavejester: a namespace is just a fancy map of symbols to values

20:59 seancorfield: accel: if you have a -main function you can do lein run -m projname.core

21:00 weavejester: technomancy: Sure, but they don't seem to be very suited to being created on the fly.

21:00 headius: there's also a jline2 in github.com/jline

21:00 hiredman: a namespace is a compilation environment

21:00 headius: I have no idea what all is different/improved

21:00 hiredman: weavejester: very doable though

21:00 technomancy: I do on-the-fly creation of namespaces in slamhound; it's not bad at all

21:01 plus you can recompile at will without having to think about bizarre equality issues that come from recompiling a deftype and wondering about whether the old one has been GC'd yet

21:01 accel: seancorfield: I don't have a main function

21:01 weavejester: You'd still have the problem of discovery though. Doesn't Drift assume one file per migration?

21:01 accel: seancorfield: I just wrote in clojure.clj: (println "hello world")

21:01 seancorfield: it seems like there's somethinr trivial I'm missing

21:01 where am I screwing up?

21:01 hiredman: accel: see, you could have avoided all this, and just be running a nice simple repl

21:01 accel: someone please point out my idiocy

21:01 hiredman: lol

21:01 sunng: accel: add a -main function of use lein-exec plugin

21:02 seancorfield: accel: this is why most folks start with the repl :)

21:02 technomancy: weavejester: leiningen.util.ns/namespaces-matching basically gets you that

21:02 accel: i actually like lein

21:02 hiredman: seancorfield: they don't though

21:02 accel: even before it works

21:02 technomancy: weavejester: drift's does assume they're on the filesystem, which I think is bad

21:02 sunng: accel: sorry, or use lein-exec plugin

21:02 seancorfield: lein repl; (use 'projname.core)

21:02 :)

21:02 technomancy: but it's not a flaw of the migrations-as-a-namespace model, just of drift's implementation

21:02 hiredman: seancorfield: someone goes "oh, you need lein" then someone elses says "oh you need X" and someone else says "oh you need to do W and Z with namespaces" etc etc

21:03 all of which is not required at all

21:03 seancorfield: hiredman: how about "this is why most folks are told to start with the repl :)" ? :)

21:03 technomancy: headius: it sounds like the main improvements are around flexibility with completion

21:03 weavejester: technomancy: Agreed. But you'd still use a namespace to group together a common set of functions, rather than a protocol?

21:03 technomancy: weavejester: yeah, definitely

21:03 headius: technomancy: well we certainly could use an updated

21:03 weavejester: I mean, a protocol like:

21:03 hiredman: java -jar clojure.jar some-file-full-of-clojure-forms.clj

21:03 headius: there's just a half-dozen forks so it's hard to know which to use

21:03 weavejester: (defprotocol Migration (up [m]) (down [m]))

21:03 seancorfield: hiredman: well, it doesn't help that clojure.org/getting_started has instructions that don't actually work now...

21:03 clojure.jar is the wrong filename

21:04 weavejester: That's surely what protocols were made for?

21:04 Doing something like:

21:04 hiredman: seancorfield: whatever

21:04 weavejester: (in-ns 'blah) (defn up ...) (defn down ...)

21:04 accel: $ cat core.clj

21:04 (println "Hello World")

21:04 do I need more in my core.clj file?

21:04 I have a ":main manip.core" in my project.clj file already

21:04 weavejester: And then searching the namespace for up and down functions seems kinda the wrong tool for the job.

21:05 hiredman: accel: if you are using lein you must have deleted the namespace declaration

21:05 put it back

21:05 seancorfield: only today / yesterday someone tried to follow the getting started instructions and it didn't work - we shouldn't then be surprised when folks ask basic questions (when java -jar clojure.jar ... is not the correct answer :) )

21:05 technomancy: weavejester: protocols are more about defining an open extension point with fast dispatch IMO

21:05 accel: ??? lein never created a core.clj file for me

21:05 I created it by hand

21:05 seancorfield: accel: are you using leiningen?

21:05 weavejester: technomancy: Why doesn't that apply to migrations?

21:06 hiredman: accel: did you run 'lein new'?

21:06 technomancy: weavejester: because you're not going to extend that protocol to another type

21:06 hiredman: seancorfield: he is, against my advice, but following the advice of others who are no longer paying attention

21:06 technomancy: there's no data to go with it

21:06 weavejester: technomancy: Hum...

21:07 technomancy: But how would you implement an anonymous migration? Or don't you think there's a need?

21:08 seancorfield: lein new someproj; cd someproj; edit src/someproj/core.clj; add (println "Hello World!"); lein repl; (use 'someproj.core) -- that should load the file and print Hello World! yes?

21:08 technomancy: weavejester: you could just call future in your up defn

21:08 hiredman: technomancy: anonymous, not async

21:08 technomancy: oh, gotcha

21:08 accel: I did the following: (1) lein new manip (2) cd manip (3) edit core.clj // (ns manip.core) (println "hello world") (4) edit project.clj // :main mainp.core (5) lein run (6) get error about main class not found.

21:09 weavejester: technomancy: I mean... there's a lot of repetition in migrations. For instance, if your "up" function creates an index, your "down" function is going to remove it.

21:09 hiredman: accel: src/manip/core.clj

21:09 seancorfield: lein run expects a -main function in the specified namespace: (defn -main [] (println "Hello World!"))

21:09 weavejester: technomancy: So you need some way of writing a function that will generate a migration for you.

21:09 technomancy: if you need to create a migration at runtime, I suspect create-ns would have you covered, but I haven't thought it all the way through

21:10 weavejester: seems like ring-style middleware could have you covered there

21:10 weavejester: technomancy: With protocols, you can just reify

21:10 hiredman: technomancy: you could just extend weavejester's protocol to namespaces

21:10 amalloy: haha excellent

21:11 accel: hiredman: $ cat core.clj

21:11 (ns manip.core)

21:11 (defn -main [& args] (println "Hello World"))

21:11 technomancy: hiredman: ahh... clever

21:12 accel: http://hpaste.org/54629 <-- my errors

21:12 seancorfield: accel: src/manip/core.clj or src/core.clj ?

21:12 accel: manip = directory lein created

21:12 weavejester: hiredman: That's an interesting idea :) - I'm not sure what it would accomplish though.

21:12 accel: the file is in manip/core.clj

21:12 technomancy: weavejester: it depends on the reasons you want anonymous migrations in the first place I guess. Haven't thought it through myself, I just have a strong preference for using defn for everything if at all possible.

21:12 seancorfield: accel: manip/src/manip/core.clj yes?

21:12 accel: ARGH

21:12 technomancy: everyone understands defn and namespaces; it doesn't bring any new types to the table.

21:12 accel: I'm an idiot

21:12 it worked now

21:13 seancorfield: yay!

21:13 accel: seancorfield , hiredman : I was editing manip/core.clj instead of manip/src/manip/core.clj -- thanks for your patience + help

21:13 I'm going to go kick something ahrd with my shin now

21:13 seancorfield: np, the project structure isn't obvious unless you've had experience with that sort of structure...

21:13 accel: yeah; I felt it was something obvious after you get it, like hjkl movement keys in vim

21:14 is it just me, or does this website design: http://forge.scilab.org/index.php/p/jlatexmath/ : make it look scammy?

21:14 weavejester: technomancy: Namespaces don't seem very suitable for something generated on the fly by a function.

21:15 technomancy: weavejester: maybe. I need to think through the concrete use cases.

21:15 weavejester: technomancy: I want migrations to be composable, generated by higher-order functions, and although you can do those things with namespaces, it seems easier to do with types and protocols.

21:15 technomancy: Let me know if you come up with anything good!

21:15 technomancy: another option is a multimethod with :up and :down methods

21:15 but what I need right now is dinner; would be happy to continue tomorrow.

21:16 hiredman: I don't really understand the desire for either namespaces or types

21:16 technomancy: a multimethod lets you group many in a single file, so I like that a lot better.

21:16 duck1123: I'm currently goiing the multimethod route

21:16 technomancy: hiredman: ask joegallo what he did with pluggable doric formatters; I think it turned out pretty well.

21:17 * technomancy &

21:17 lazybot: java.lang.RuntimeException: EOF while reading

21:17 weavejester: technomancy: Hmm...

21:17 hiredman: sure, I was sitting next to him while he was writing it

21:17 a migration is an action for up and an action for down

21:18 {:up … :down …}

21:18 weavejester: hiredman: Yep. Plus an identifier.

21:18 accel: is there anythign I can do to reduce lein startup time? for example, "time lein help" returns: lein help 5.96s user 0.15s system 219% cpu 2.790 total ... which is kind of ridiculous

21:18 hiredman: {:up … :down … :id …}

21:18 weavejester: So: {:id ..., :up ..., :down ...}

21:18 Yeah.

21:19 hiredman: accel: jvm startup time is a pain

21:19 sunng: accel: try lein interactive

21:19 weavejester: Which maybe is better than a protocol/reify

21:19 seancorfield: accel: depends on your workflow - i tend to leave a lein repl open all the time and if you're running tests etc, you can use lein interactive

21:19 weavejester: It wouldn't actually change any functions I've written if I used a hash with functions in instead.

21:20 Hm...

21:20 accel: so I have 16GB of RAM. Is there a way to tell lein to buidl a jar of everything it needs, and shove it in RAM?

21:21 weavejester: hiredman: You might have a point with just making it a map of {:up ... :down ... :id ...}

21:22 hiredman: It would be first-class... and more composable... more discoverable...

21:24 I'll sleep on it, I guess :)

21:31 seancorfield: accel: as you may guess from the lack of responses, you can't really put a JAR in RAM - except thru Java's normal class loading process, of course... which I suspect doesn't help you...

21:32 if you want to just run clojure code without the jvm startup, you might look at the jark project which uses persistent (long-running) jvms and sends code to them to be executed...

21:32 accel: http://icylisper.in/jark/

22:02 rickr: Can someone explain why I'm seeing the exception below?

22:02 =>(defmacro t[m] (for [k (keys m)] k))

22:02 =>(t {:a 1 :b 2 })

22:02 =>(def c {:a 1 :b 2 })

22:02 => (t c)

22:02 IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:487)

22:03 blakesmith: Anyone have a favorite cassandra client library?

22:05 moogatronic: Any Overtone hackers around tonight?

22:05 trptcolin: blakesmith: i wrote a crappy one. if i was going to do stuff w/ cassandra i'd check out https://github.com/pingles/clj-hector

22:06 Hector is pretty badass

22:06 e.g. handles failover for client connections

22:08 blakesmith: trptcolin: Cool, I gave it a whurl and ran into some issues: https://gist.github.com/1403168

22:09 I didn't want to bother debugging if there was something better out there. ;-)

22:13 rickr: Odd, so macro args are literally replaced then? Since changing 'm' to '(eval m)' fixes it.

22:13 tmciver: rickr: I know almost nothing about macros but I think you need to put a quote in the macro body somewhere.

22:13 trptcolin: hmm, bummer. i get sl4j warnings, nothing fatal though.

22:15 brehaut: rickr: (defmacro t[m] `(for [k# (keys ~m)] k#)) is what you want i think

22:16 rickr: ` to syntax quote the form , ~ to unquote the argument m, k# to get a gensym to get a symbol for the scope

22:16 duck1123: Has anyone else found that the newer version of korma wants to quote it's table names with \"

22:16 rickr: tmciver: ty ..correct the quote would be needed if I didn't want to eval the result, but in my contrived example i was focusing on the arg treatment.

22:17 jcrossley3: rickr: brehaut: or just use defn in that case?

22:18 rickr: brehaut: et. al. ty

22:18 brehaut: jcrossley3: i presume that hes trying to understand macros, otherwise why even defn? keys is already a function

22:18 blakesmith: trptcolin: What version of clojure are you running?

22:19 dnolen: this is funny, http://philosecurity.org/2009/01/12/interview-with-an-adware-author

22:19 brehaut: rickr: if you are reaching for eval as a beginner, chances are you are reaching for the wrong tool (same goes for macros probably, but less so)

22:19 rickr: brehaut: i see and yes, just playing around with macros trying to understand them better.

22:21 brehaut: hmm, i dont know if foo# is actually a gensym, the gensym function produces differently named symbols

22:21 trptcolin: blakesmith: looks like 1.2.1

22:23 sunng: hi, all. Which module is clojure.contrib.condition in ??

22:23 lazybot: sunng: Definitely not.

22:24 G0SUB: dnolen: wanted to discuss something related to ClojureScript with you...

22:24 dnolen: G0SUB: what's up?

22:25 G0SUB: dnolen: I have been using CLJS for a bit recently.

22:25 dnolen: I feel CLJS lacks a good selector engine.

22:25 dnolen: GClosure doesn't have one in the core. they have a "third-party" lib that's a port from Dojo.

22:25 blakesmith: trptcolin: Rookie mistake, I put hector in :dependencies instead of :dev-dependencies.

22:27 G0SUB: dnolen: I also feel that a lot of DOM classes don't implement crucial protocols. Element & NodeList comes to my mind. do you think such protocol implementations would be solicited for CLJS core?

22:28 dnolen: G0SUB: hmm, I thought that latest GClosure had something … could be wrong.

22:28 G0SUB: dnolen: the docs point to goog.dom.query which is "third-party" aka out-of-tree

22:30 dnolen: G0SUB: I'm not keen on DOM stuff in core, seems out of scope, but others might disagree. Would rather see a CLJS contrib lib for that.

22:30 G0SUB: dnolen: makes sense. a contrib should serve the purpose as well.

22:30 dnolen: G0SUB: but of course assumes there's a good lib management for CLJS which there is not.

22:31 G0SUB: dnolen: true, that's another problem.

22:31 dnolen: honestly, if I wish to use CLJS to build real webapps, I would need some really good DOM manipulation libs.

22:32 dnolen: G0SUB: personally, I have no problem w/ just putting things in jars and releasing them. works for gclosure

22:32 G0SUB: else, my JS guys won't buy CLJS.

22:32 hmm

22:32 dnolen: I don't know how to accomplish that with CLJS code. is that just a simple Clojure like jar that can be put in the classpath?

22:32 alexbaranosky: hey guys, what's the simplest way to build my fork of Clojure locally?

22:34 dnolen: G0SUB: yes I think so, cljs files and compiler macros, etc

22:34 G0SUB: ok

22:34 dnolen: right now, almost all of my CLJS code is interop, it's ugly.

22:38 trptcolin: alexbaranosky: ant jar?

22:38 alexbaranosky: trptcolin, ok - let me install ant

22:38 dnolen: G0SUB: a contrib that provides more idiomatic access to the DOM would be great, plus that would be a good testing ground for putting things in jars and using them from CLJS projects.

22:39 G0SUB: I haven't tried that kind of thing yet so I don't have much insight at the moment.

22:39 G0SUB: dnolen: thanks. I will start a discussion on the mailing list.

22:41 devn: dnolen: do you know of any cljs code lying around that uses websockets off the top of your head?

22:41 nvm: https://github.com/neotyk/ws-cljs/

22:42 dnolen: devn: also there's a halfbaked commented out version of browser repl that uses websockets

22:43 devn: would be sweet to see that actually working, gclosure channel works everywhere but lots of latency.

22:45 devn: dnolen: :\ That's too bad

22:46 dnolen: any handle on where the loose wire is? latency-wise...

22:46 dnolen: devn: polling iframes

22:46 devn: ah

22:46 brehaut: _iframes_‽

22:46 thats mental

22:46 devn: dnolen: is that a solvable problem from cljs' perspective, or are we at gclosure's mercy?

22:46 dnolen: brehaut: except … it works everywhere.

22:47 devn: ^good point

22:47 brehaut: dnolen: so do xhrs ?

22:47 dnolen: brehaut: wasn't always true, and may not even true for some strange browser clients.

22:47 brehaut: i didnt realise gclosure was old enough for that to have been a problem

22:48 dnolen: brehaut: I also think it may allow communications across different domains - haven't looked closely.

22:48 brehaut: esp given the funny clicky events that polling iframes generate in older IEs

22:48 dnolen: ah, that would be it then

22:49 dnolen: brehaut: but even xhr had weird limitations - FF at long ago could only have 2 inflights requests, a bunch of other goofy things.

22:49 a long time ago.

22:49 I'm sure gclosure is a amalgamation of useful code, not all one concerted effort

22:49 brehaut: that limitaiton would have held for iframes too

22:49 dnolen: brehaut: why?

22:50 iframes have nothing to with xhr

22:50 brehaut: because all browsers used to limit themselves to two inflight connections to any given scheme * domain * port

22:50 nomatter the resource type

22:50 or method of access

22:50 dnolen: brehaut: I don't recall seeing that limitation at the same time across the various browsers.

22:52 brehaut: ffx was slower in upping the limit i think was all

22:52 dnolen: brehaut: interesting. still had to live with it :)

22:52 brehaut: indeed; the normal solution was a bunch of subdomains

22:54 devn: dnolen: how slow is slow, out of curiosity?

22:54 dnolen: devn: it's noticeable, especially when you want to println back from browser-repl

22:55 night and day from a repl connection to Node.js

22:55 devn: does it increase over time? like if you were hammering the browser with updates how would it react?

22:57 dnolen: devn: not really, it's just the polling intervals are not particularly high from what I can tell.

22:57 devn: dnolen: thanks for the info -- trying to rewrite something in clojure and would love to make it clojure and clojurescript if it makes sense

22:58 trptcolin: headius: saw your earlier questions about jline2 - this is the one i'm using (it's what scala uses): https://github.com/paulp/jline2 - mostly additive on top of the jline/jline2 project. There's some stuff that hasn't gotten upstream (I haven't asked why yet)

22:58 dnolen: devn: make a lot of sense :)

22:58 makes

23:00 trptcolin: tried the latest changes from jline/jline2 out just now, looks like they just started back up in the last week. looks much better. one small problem, probably fixable though now that the project is active. it'd be nice to not have to have [org.scala-lang/jline "2.9.1"] in my dependency list, even with its "can't we all get along" good vibes ;)

23:33 gtrak``: does korma do file blobs? i'm thinking about making a little cms

23:41 maybe i'll just use wordpress

23:42 duck1123: but then you won't be able to say "I did this"

23:42 gtrak``: true :-)

23:42 opportunity cost

23:49 amalloy: alexbaranosky: a heredoc reader macro is pretty trivial to add, but i don't especially want one (and i doubt if /core does either)

Logging service provided by n01se.net