#clojure logs

2011-11-28

00:20biallymHey is there a way to have a function called on or around garbage collection of an object?
00:20biallymLike an idisposable?
00:23biallymSince java doesn't support it I will take that as a no >.>
00:27mdeboardClojure does a lot of things java doesn't support
00:33biallymI know that, but clojure still uses java's gc as far as I know
00:34biallymIt may have been more appropriate to say the JVM doesn't support it
01:18quotemstrIs there a function that always returns false?
01:20quotemstrOr, rather, a built-in function of one argument that is always false --- for the default value of a predicate.
01:25hiredman,((constantly false) 1)
01:25clojurebotfalse
01:31amalloybiallym: 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
01:36amalloy(written for the clr but applies equally well to the jvm)
01:48isak_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 ...
01:50hiredmanthe cartesian bit you'll need to do yourself, but repeating can be done with repeat
01:50hiredmanpossibly it could be done with iterate
01:51isak_oh awesome
01:51isak_i got the other part figured out, thanks
01:51amalloyone of the contrib libraries has cartesian-product already though, if you'd rather use that
01:51isak_yeah, thats the one i'm using
01:52isak_the clojure version is much shorter than the ruby version i made earlier then: https://gist.github.com/1399260
01:54amalloyright, presumably it's just (apply product (repeat n letters))
01:56ambrosebsproposal for a pluggable clojure compiler, comments welcome: http://dev.clojure.org/display/design/Exposing+the+Compiler%27s+Analysis+Phase
02:04hiredmanambrosebs: 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
02:05hiredmanwell, it depends on the way binding expands and the way the compiler handles do
02:05hiredman(at least for the clojure compiler, I will admit to not being terribly familiar with the clojurescript compiler)
02:05ambrosebshiredman: interesting, I really don't know the compilation phase that well so I'm just sticking it out there
02:06hiredmanI'd suggest some kind of addition to the ns form
02:06hiredmaninstead of defing this thing
02:06hiredmaner
02:06ambrosebsah I see
02:06ambrosebsthat makes a lot of sense
02:06hiredmanwell, instead of binding things, that does mean ns level granularity
02:07ambrosebswell that was what I intended originally
02:07ambrosebs(ns level)
02:07ambrosebsit makes sense to have a single "language" in a file
02:07ambrosebssince you are changing the language by modifying the compiler
02:07ambrosebslike Racket
02:15ambrosebshiredman: do you happen to know where "ns" is defined in clojure?
02:15hiredmancore.clj
02:17ambrosebshiredman: cheers. How does core.clj itself have a 'ns' declaration?
02:17hiredmanmagic in RT.java
02:19hiredmanthere 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
02:19hiredman(I hadn't realized clojure.core had switched from in-ns
03:32biallymIs it possible to have a namespace that "forwards" another namespace?
03:32biallym(Or multiple such namespaces >.>)
03:35biallymI'll take that as another no
03:36jacortinasI'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
03:36amalloybiallym: 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
03:37amalloyit's possible to create namespaces that you might describe as forwarding, but it's not really a good idea
03:37jacortinasI keep receiving an error that says this, no matter what I do. "java.lang.IllegalStateException: Attempting to call unbound fn: #'vimclojure.nails/NamespaceOfFile"
03:38jacortinasI've been attempting to use the lein-nailgun library, does anyone else have experience with this?
03:38biallymamalloy: Sorry but the last 5 questions I have asked today haven't been answeared
03:38amalloythat's patently untrue. maybe you think that's the case because you only watch for five minutes
03:39amalloybut i answered your gc/finalizer question myself, and mdeboard hazarded a guess as well
03:39biallymI check the log >.>
03:39amalloythose 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
03:42biallymAs 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
03:42biallymwithout*
03:42biallymso 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
03:43notostracabiallym, writing heavily stateful code might be a better use for Java than Clojure
03:43amalloy"the answers i got were not what i hoped to hear" is pretty different from "none of my questions have been answered"
03:43BahmanHi all!
03:44notostracaHello Bahman, do you have a question?
03:44BahmanHi notostraca. No. Why?
03:44notostracaoh heh
03:45notostracaUsually when someone joins in and immediately starts typing, they have a question they are hoping to get help on. Not this time!
03:45amalloyhe likes to say hello when he /joins. it's a mystery
03:45notostracaMyself, I am beating my head against the wall trying to get JNA to work with SDL
03:46Bahmannotostraca: Thanks for the attention. But it's more like amalloy puts it :-)
03:46biallymnotosraca: Thats why I am wrapping it, either way the answear would be relevent to either language...
03:46biallymand I missed a t >.>
03:46notostracawait a minute, how did i miss this
03:47notostracayou are wrapping OpenGL for use on the JVM?
03:47biallymNo I am wrapping jogl for use in clojure
03:47notostracaI am wrapping SDL for use on the JVM
03:47notostracaah
03:47biallymjogl peeps already did the hardstuff for me :p
03:47notostracabiallym, yeah JNI is not something I want to struggle through right now
03:48notostracaI am hoping JNA will be better
03:48amalloyjna does look pretty sweet
03:48amalloyare you using chouser's jna wrapper?
03:49notostracaamalloy, yeah but I have no idea how to use JNA yet
03:49biallymamalloy: 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
03:49notostracachouser has a JNA wrapper?
03:50amalloybiallym: 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
03:51amalloy$google chouser clojure jna github
03:51lazybot[Chouser/clojure-jna - GitHub] https://github.com/Chouser/clojure-jna
03:52notostracaamalloy, thanks
03:52biallymamalloy: well thanks for finding the answear of telling me to google for finalizers >.>
03:52notostracaI don't understand JNA at all. how does this resolve dependencies of native libraries?
03:53notostracado I have to run JNAerator or something on the native headers before I can use them in Clojure?
03:53amalloynotostraca: it doesn't, as i understand it. it just calls out to your OS saying "plz load library with name xyz"
03:54biallymAnd If I didn't have the finalizer the memory leak would be a lot more horrendus
03:54jacortinasdon't want to be annoying, but anyone here with a working vimclojure nailgun setup on OS X?
03:54biallymnotostraca: I don't have to mess with JNI because of the way jogl is setup
03:55notostracabiallym, yeah I figured JOGL would have solved that
03:55notostracaI have no idea if there is a JNA for SDL, though I know there is a JNI one
03:55notostracaSlick IIRC
03:56biallymthank 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.
03:58amalloydid you read the article i linked to? it mentioned the word "finalizer" about a hundred times
03:58notostracachouser, Chousuke: if you are available, I would really appreciate some advice on where to start with JNA
03:58biallymyea but it just told me that I should never use them and never mentioned them in reference to java
03:59notostraca(I am asuming the chous* nicks are the same person)
03:59amalloynotostraca: no
03:59notostracaoh, coincidental?
04:00biallymI barely know anything about java, or the fact I have to oreride the finbalize method, anyways thanks
04:06notostracahmm
04:06notostracaThen I have to start Clojure with a parameter to tell Java where to find the
04:06notostracaJNA native libs, the JNA .jar, and of course Clojure and this lib.
04:06notostracaThen I have to start Clojure with a parameter to tell Java where to find the
04:06notostracaJNA native libs, the JNA .jar, and of course Clojure and this lib.
04:06notostracaoh sorry
04:07notostracaI think the clojure JNA thing needs JNA to have been run on the native libs before it can use them
04:07notostracaor not run, generated for
04:08amalloythere'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
04:09amalloynotostraca: i assume you've read the jna wikipedia page? it explains pretty simply what you have to do to use jna from java
04:09notostracaamalloy, thanks for the tip
05:15AWizzArd|workDo I need Marginalia as (dev-) dependency when I already put lein-marginalia ( https://github.com/fogus/lein-marginalia ) as dev-dependency?
05:16AWizzArd|workAs I currently understand it, it is enough to have lein-marginalia as dev-dependency, cause that already has Marginalia as dep.
05:16RaynesNo.
05:16RaynesYou don't even need that.
05:17Rayneslein plugin install lein-marginalia 0.7.0-SNAPSHOT
05:18Blktgood morning everyone
05:26AWizzArd|workRaynes: Both should work yes? Installing lein-marginalia as plugin, or have it as a dev-dependency?
05:26RaynesYes.
05:26AWizzArd|workThe thing is: in a company environment multiple devs are working on that project.
05:27AWizzArd|workThey 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.
06:01biallymSoooo amalloy_ you were probably right >.> java.lang.Object probably will cause trouble
06:01biallymwith the finalize call
06:01biallymsince apparently reify creates multiple copies of the object
06:10biallym,(do (let [foo (reify java.lang.Object (finalize [this] (println "Finalizing 1 " this)))] foo) (System/gc))
06:10clojurebotnil
06:10biallymOh thats right >.<
06:54Saturnationdamn 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. :)
07:02samaaronSaturnation: ha, that's great news :-)
07:03samaaronSaturnation: what did you get up to?
07:05samaaronlypanov: i'm not using yet, although i know people that are
07:09biallymIs there a specific meaning to clojures * syntax other than being a partial implemented version (like in common lisp)
07:10biallym(like let* vs let)
07:10biallymjust asking for idiomatic reasons
07:26Raynesbiallym: Nope. It is just a convention that usually means "x* is similar to x but isn't actually x and does something slightly different"
07:26RaynesFor example, ##(list 1 2 [1 2 3]) vs ##(list* 1 2 [1 2 3])
07:26lazybot(list 1 2 [1 2 3]) ⇒ (1 2 [1 2 3])
07:27lazybot(list* 1 2 [1 2 3]) ⇒ (1 2 1 2 3)
08:00biallymRaynes: So it is like common lisp :p
08:37biallym_,(. java.lang.reflect.Modifier isPrivate 1)
08:37clojurebotfalse
08:37biallym_,(. (identity java.lang.reflect.Modifier) isPrivate 1)
08:37clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: isPrivate for class java.lang.Class>
08:37biallym_sooo... identity isn't really an identity function >.>
08:38Saturnation,(class (identity java.lang.reflect.Modifier))
08:38clojurebotjava.lang.Class
08:39Saturnation,(class java.lang.reflect.Modifier)
08:39clojurebotjava.lang.Class
08:39Saturnationweird
08:40biallym_it's because the . macro cheats >.<
08:40biallym_And I'm trying to get it uncheated
08:41biallym_which may involve splicing in the symbol >.>
08:43biallym_it mainly has to do with the static part of the class
08:45biallym_so the mess fix is ,(eval `(. ~symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))
08:45biallym_,(eval `(. ~symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))
08:45clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
08:46biallym_except not >.>
08:46samaaronDENIED!
08:46Saturnationso identity isn't broken, the . macro is?
08:46biallym_yes, well, sort of
08:46biallym_the behavior of the . macro is misleading
08:46Saturnationthat makes more sense to me
08:46biallym_because it does special processing based on the symbol it gives you
08:47biallym_symbol you give it*
08:47biallym_,(clojure.contrib.macro-utils/macrolet [testing [] `(. ~symbol (.getName java.lang.reflect.Modifier)) isPrivate 1)] testing)
08:48clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
08:49biallym_,(clojure.contrib.macro-utils/macrolet [testing [] `(. ~symbol (.getName java.lang.reflect.Modifier)) isPrivate 1)] testing)
08:49clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
08:49biallym_Argghh darn you emacs yanking >.<
08:50biallym_,(clojure.contrib.macro-utils/macrolet [(testing [] `(. ~(symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))] (testing))
08:50clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.contrib.macro-utils>
08:50biallym_whats the other bot?
08:50biallym_&(println "test")
08:50lazybot⇒ test nil
08:50biallym_&(clojure.contrib.macro-utils/macrolet [(testing [] `(. ~(symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))] (testing))
08:50lazybotjava.lang.ClassNotFoundException: clojure.contrib.macro-utils
08:50biallym_ok so both bots suck
08:51biallym_&(require clojure.contrib.macro-utils)
08:51lazybotjava.lang.ClassNotFoundException: clojure.contrib.macro-utils
08:51tomoj,*clojure-version* ;; ##*clojure-version*
08:51clojurebot{:major 1, :minor 3, :incremental 0, :qualifier nil}
08:52biallym_anyways the solution is `(. ~(symbol (.getName java.lang.reflect.Modifier)) isPrivate 1)
08:52tomoj&*clojure-version*
08:52lazybot⇒ {:major 1, :minor 3, :incremental 0, :qualifier nil}
08:52biallym_wich is very stupid >.<
09:07Raynesbiallym_: Both bots are up to date, you mean.
09:10biallym_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)
09:15biallym_&(clojure.tools.macro/macrolet [(testing [] `(. ~(symbol (.getName java.lang.reflect.Modifier)) isPrivate 1))] (testing))
09:15lazybot⇒ false
09:17Raynesbiallym_: You should check our Marginalia. Once you go marg you never go back.
09:18biallym_Well that doesn't fix my 1.2 problem :p
09:18RaynesIt fixes your problem with compatibility with documentation tools, in any case.
09:19RaynesDoesn't fix the rest of them, sadly. :p
09:19gtrak`biallym_, what do you need to work on 1.3?
09:21biallym_gtrak` give me a moment and I'll find out what is breaking and why
09:37biallym_Ok... how do you use the new clojure contrib
09:39biallym_like in lein for the dependincies >.>
09:43biallym_OK thats freaking rediculous
09:44biallym_you should really make it clear what the latest versions are >.<
09:47biallym_Ok yea clojure contrib still not working >.>n
09:49nachtalpbiallym_: have you had a look at this page? http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
09:49biallym_Yes and it's pretty much useless
09:50biallym_Yes it tells me where each contrib thing went and how to convert it
09:50biallym_it was very useful for that
09:50ckirkendall`biallym_: ??? it has the latest release on maven and the versions.
09:50biallym_but for actually using contrib it was useless
09:50biallym_I am not a java person... what is maven and how to find the version information... completely non-obvious
09:51biallym_how do i*
09:52biallym_Ahh I see now, but how do I get the entire contrib like before?
09:52ckirkendall`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.
09:52biallym_Thats a really annoying way of adding a new library >.>
09:53biallym_or sub library, when I just want to develop with all of contrib
09:53biallym_the solution I used was [org.clojure.contrib/complete "1.3.0-alpha4"]
09:54biallym_which, by the way, is completely wrong all over the place where people were using standalone instead of complete
09:54biallym_but whatever it works
09:55biallym_except it doesn't does it >.<
09:55biallym_sigh I'll use this version each individual library thing >.>
09:55biallym_just seems excessive >.<
09:56ckirkendall`biallym_: I think that is what the direction is so that individual contribs could have different release cycles.
09:57biallym_*sigh* whatever, you should make it clearer how to find that information for the less java knowlegeable
10:00biallym_You know what, it annoyed me so much I'll go write a blog post about it >.>
10:00ambrosebs,(symbol ":")
10:00clojurebot:
10:01Saturnationwasn't contrib just a bit bucket of lots of things in different states of repair?
10:01Saturnations/bit/big
10:02SaturnationI hear your pain biallym_, but I think you might be missing the rationale behind the move?
10:02biallym_Nah I get the rationale
10:02Raynesbiallym_: It isn't like the whole contrib move has been silent.
10:02biallym_it's just not explaine dhow to move >.>
10:02Saturnationand hasn't some of contrib been sucked into core?
10:03RaynesEach contrib library is an individual maven artifact now.
10:03Saturnationthe good bits that is
10:03biallym_Find me a reasonable search that finds a good page describing how to move from 1.2.x to 1.3
10:04biallym_because I couldn't find it
10:05gtrakbiallym_, yea, that's kind of a sore point right now, but in like a year people will stop freaking out about it :-)
10:05biallym_Haha good point
10:06biallym_well I moved over it was fine and i am happy
10:06gtrakah, wonderful
10:06gtrakso you're 1.3 now?
10:06duck1123The issue with upgrading to 1.3 is you have both the 1.3 changes and the contrib changes to contend with
10:06biallym_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:07gtrakyou're using clojure for class?
10:07biallym_Literally the teacher doesn't understand what she is teaching and it pisses me off
10:07biallym_no
10:07biallym_I can just bring laptops
10:07biallym_and I would probably be better off practicing writing than paying attention
10:09biallym_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:09gtraki always have to relearn regexes anyway
10:09gtraki use them like once a year
10:09biallym_hint it takes a grammar
10:09biallym_not a regular expression
10:09biallym_and when we point that out to her
10:10gtrakwell, i thought you could have a stateful lexer
10:10gtrakthat's kind of like a weak grammar theoretically
10:10biallym_it's a much lower level class than that
10:10biallym_regular epression in the theoretical sense
10:10Wild_CatOR, you could do it the Enterprise way, with a regex that goes (ab)|(aabb)|(aaabbb) ..., up to a compile-time defined constant :p
10:11biallym_but what about baab?
10:11gtrakyou can generate the regexes with a rules engine :-)
10:11Wild_Catgenerate more patterns with an Enterprise Rules Engine! :p
10:11gtrakup to the size of the string
10:11biallym_she was very insistent you could use a regular expression, I am very insistent she doesn't have an actual ph,d
10:11Wild_Cat...and figure out at which size your regex lib dies a horrible death :D
10:19biallym_hey this marg thing is pretty nice
10:20ckirkendall`biallym_: was she implying you could do it with one regular expression or a series of regular expressions and some code?
10:20biallym_a single theoretical regular expression
10:20biallym_i.e only operators are
10:21biallym_concatenation kleen-star and or
10:21biallym_. * +
10:21biallym_basically
10:23biallym_s/or/alteration
10:23biallym_n.wikipedia.org/wiki/Regular_expression#Formal_language_theory
10:23biallym_en.wikipedia.org/wiki/Regular_expression#Formal_language_theory
10:23biallym_that one ^
10:24biallym_thats just day 2
10:24biallym_every day she makes clunders which undercut her understanding of the material even more
10:24biallym_blunders*
10:24biallym_every day I just want the class to end
10:26gtrakbiallym_, it's just a piece of paper at the end :-), I have 2, they're sitting in a closet
10:28biallym_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:28gtrakcollege is a reputation transfer engine, imo
10:29djKianooshyou get out of it what you put into it, imo
10:29gtrakif 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:30Raynesbiallym_: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
10:31gtrakconsequently, i know a lot of stuff i'll never use, but it's there :-). programming was what I did when I procrastinated
10:32biallym_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:32Saturnationhe was, but probably needs more sleep? :)
10:33gtrakmaybe it needs to mention leiningen?
10:33gtraki guess clojure the lang is not in bed with leiningen
10:34Raynesbiallym_: Why isn't it useful? What more do you need?
10:34RaynesBecause it doesn't list up-to-date versions? I remember some whining about that.
10:34biallym_I don't know anything about how a java project works and hence have no clue that maven holds the information for leiningen
10:35RaynesFor any new clojure contrib library, you can search for it here: http://search.maven.org/
10:35biallym_I honestly look at the page and go great, I can change my code, but how do I actually get the right library
10:35RaynesYou'll be able to find the current version like that.
10:35RaynesOr 'lein help search' is also useful.
10:35gtrakit makes an assumption that someone who's messed with clojure knows how to find dependencies
10:35biallym_I use clojars >.>
10:36biallym_and haven't yet run into using maven
10:36RaynesYou use clojars and maven central.
10:36RaynesLeiningen uses both of those by default.
10:36RaynesThey're both just maven repositories.
10:36biallym_yes but that doesn't mean I know how to navigate their system
10:36gtrakyou can 'use' them without knowing you're using them, that's the problem
10:36RaynesI just told you how.
10:36biallym_gtrak has the problem
10:37biallym_yes you did and the first result I got was org.clojure clojure-contrib 1.2.0
10:37RaynesWhat are you searching for?
10:37gtrakso 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:37biallym_clojure-contrib, but I know the answear is something like clojure.tools.macro
10:37biallym_I have it working now
10:38biallym_my complaint is that it's not obvious
10:38biallym_gtrak: to put it nicely, sure, on the other hand I wanted to touch as little of a build system as I could
10:38gtrakright, sometimes you just want to worry about how to get stuff done :-)
10:39biallym_Which is probably why I am having troubl packing this library I am workin gon
10:39gtrakmy border of interest right now is git and hg internals magic
10:39biallym_but I'll worry about that later
10:39biallym_because It's due wednesday and I don't care about getting off of my own repos just yet
10:40biallym_(I am using clojure for an independent study project though :P)
10:41biallym_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:41Wild_Catbiallym_: out of curiosity, what drove you to Clojure if you have no Java experience?
10:41biallym_because it has concurrency and it's a lisp
10:41biallym_it's also more modern than common-lisp
10:42biallym_I also have a decent amount of .net experience to get over a lot of the managed/heavy OO/ humps
10:43RaynesThat isn't right. lein-marginalia had a bug that caused stuff like that before, but 0.7.0-SNAPSHOT should fix it.
10:43RaynesBut no, it certainly doesn't do it on purpose. :P
10:44biallym_I am also sleep deprived.. just tried to use [lein-marginalia "0.y.1-7SHOT"]
10:44gtrakthat's brilliant
10:45Rayneso.o
10:45biallym_yea lein didn;t like that
10:45RaynesYou can also just do 'lein plugin install lein-marginalia 0.7.0-SNAPSHOT'
10:45RaynesThat would install it at the user-level so you always have it available for all of your projects.
10:47biallym_hmm that didn't fix it, i'll try the user level install instead
10:48biallym_nope still didn't fix it
10:48biallym_(defn canvas [& {:keys [capabilities]}] "Constructs an AWT canvas." (if capabilities (new GLCanvas capabilities) (new GLCanvas)))
10:48biallym_is what I am doing
10:48biallym_is that wrong?
10:48cemerickRaynes: Thanks for the mention in your post, BTW. That's one scary headshot, though. :-)
10:48nachtalpbiallym_: docstring should be the 2nd arg i believe
10:48gtrakis there some kind of error?
10:49Raynescemerick: Only one I've got. :p
10:49cemerickI mean, it's *big*.
10:49Raynesbiallym_: Right, the docstring comes before the argument list.
10:49Raynescemerick: Not sure how to control size in octopress. :P
10:49gtrakcemerick, I agree it was imposing
10:49biallym_Hmm well then >.>
10:49cemerickgtrak: much like myself :-P
10:49gtrakindeed
10:49RaynesI thought I'd just leave it there, since everybody likes that big ol' bug.
10:49Raynesmug, even
10:50biallym_Ohhh your that Raynes
10:50RaynesI think I might be.
10:50biallym_with the blog post on hacker news :p
10:50Raynes:P
10:50gtraki 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:51gtraki find it frightening
10:56Raynescemerick: Look at this way: you've had your face all over Hacker News.
10:59cemerickRaynes: does that go both ways? "Ew, I've got hacker news all over me."
10:59RaynesHeh
11:00TimMcYeah, better wash with soap.
11:00TimMc(but not SOAP)
11:10duck1123After using SOAP, I feel dirty
11:10ckirkendall`duck1123: that is the kind of SOAP that burns
11:11TimMcMore importantly, it would react explosively with any HN residues.
11:20duck1123So 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:21duck1123excluding commons-logging doesn't seem to work
11:27djKianooshduck1123: that might be happening if somehow there's another log4j.properties in your classpath, maybe packaged in another jar file
11:27joegalloare 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:28duck1123joegallo: I was using slf4j, but I tried removing it as well.
11:28duck1123shouldn't the file in my resources/ dir take precedence?
11:33duck1123This project has reached the point where a clean compile is deserving of a good sword fight
11:40antares_technomancy_: hey, do you mind a leiningen question here?
11:44TimMcantares_: Just go ahead and ask your question; if someone can help they will answer.
11:45antares_we recently upgraded from leiningen 1.6.1.1 to 1.6.2 on travis-ci.org
11:45antares_and now projects that passed previously fail with slightly obscure issues like http://travis-ci.org/#!/michaelklishin/monger/builds/350740
11:46antares_the same setup works for me locally, I am not sure where to start investigating (other than leiningen source)
11:47duck1123glad to know it wasn't my project bombing out on travis
11:47duck1123just my project
11:49cemerickantares_: presumably not all clojure projects are failing, only some?
11:49antares_cemerick: exactly
11:50cemerickantares_: That error indicates that some dependencies are being used in a Clojure 1.3 project that were AOT-compiled under Clojure 1.2.
11:50cemerickIIRC, anyway
11:51antares_cemerick: hm, this may be the case. We use standalone leiningen.
11:51antares_and it is AOT compiled for 1.2, I am guessing
11:52cemericklein itself uses Clojure 1.2 throughout — but that doesn't prevent it from being used with projects that themselves depend upon 1.3
11:53antares_yeah, my 2nd guess is that org.clojure/data.json may be the issue
11:53antares_both of my projects that fail depend on it
11:53antares_cemerick: if I only really care about 1.3 for my libraries, what would you suggest?
11:53duck1123antares_: here's another one if it helps http://travis-ci.org/#!/duck1123/clj-factory/builds/345706
11:53antares_trying to make everything pass on 1.2 may take some effort
11:54RaynesWell, the point here is that Leiningen shouldn't be causing the problems to begin with.
11:54RaynesMight have to wait for technomancy_ to hop in.
11:55cemerickThat the stack trace ends with something related to native paths makes my spidey sense tingle a bit.
11:56hiredmancemerick: nah, that is lein figuring out what arch you are running on
11:56hiredmannot native code
11:57cemerickhiredman: in that case, perhaps this has nothing to do with 1.2/1.3 at all?
11:57hiredmanI imagine it does
11:57cemerickclj-factory's only dependency is midje 1.3-alpha5, which explicitly indicates 1.2.0 and 1.3.0 compatibility…
11:58duck1123I think it's 1.3 in the dev dependencies slot, but that doesn't fail for me locally anymore
11:59tomojif the problem were with some dep, why would it work outside of travis-ci?
11:59antares_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:59tomojsomething bad stuck in the local maven repo there?
12:00antares_tomoj: that is impossible
12:00antares_tomoj: VMs are snapshotted and rolled back after each build
12:00antares_0 shared state
12:00antares_duck1123: I will let you know when we figure it out :)
12:00hiredmanthe constructor for keyword callsites changed 2010-06-10
12:01tomojantares_: ..and there's nothing in the local maven repo in the snapshot? wonder what could be different..
12:01hiredmanso it looks like the clojure version there is pre 2010-06-10 (whatever that is)
12:02hiredmanpost 2010-06-10 it takes a single keyword argument, pre it takes a keyword and a number
12:02antares_hiredman: there is no clojure at all, we are using standalone lein
12:02antares_hiredman: unless ubuntu 11.04 now comes with presintalled clojure, of course
12:02antares_10.04 did not
12:03hiredmanlein is of course written in clojure
12:03antares_tomoj: we will find it out, fortunately, I have access to the infrastructure & cookbooks ;)
12:03hiredmanso it comes with clojure
12:03antares_hiredman: which may suggest that lein standalone comes with a pretty dated clojure version?
12:04hiredmansure, it is supposed to
12:04RaynesThe version of Clojure that Leiningen uses is irrelevant.
12:04hiredmanthe project should be running in its own version of clojure
12:04antares_hiredman: that project's project.clj depends on clojure 1.3.0
12:04antares_hiredman: here's our leiningen cookbook: https://github.com/travis-ci/travis-cookbooks/blob/master/vagrant_base/leiningen/recipes/default.rb
12:05antares_hiredman: and we use default node attributes: https://github.com/travis-ci/travis-cookbooks/blob/master/vagrant_base/leiningen/attributes/default.rb
12:06duck1123ok, interesting. I'm now getting that same error again for clj-factory locally after I blew away my .m2
12:07tomojoh, the other way around? :)
12:07antares_tomoj: no, I think he has failures in both environments now
12:08duck1123yes, still investigating
12:08antares_duck1123: yup, I see it now, too
12:08antares_rm -rf ~/.m2 helped
12:08tomojso any clojure-virgin box will get this error trying to do that?
12:08antares_tomoj: correct
12:08antares_any box w/o existing maven repo :/
12:09hiredmansounds like someone did something naughty like changing a published artifact
12:09duck1123ok, I had to exclude org.clojure/clojure from my midje dependency
12:09duck1123pushing a new version
12:09cemerickhiredman: nah, that *never* happens :-P
12:09antares_duck1123: oh
12:09antares_duck1123: good idea
12:10duck1123passed
12:10cemerickduck1123: instead of adding excludes everywhere, you can just declare your project's dependency on clojure to be e.g. "[1.3.0]"
12:11duck1123cemerick: the issue was I had 1.3 in both lib and lib/dev which means that lein is running with 1.3
12:12tomojwhy does having some dep already in .m2 make that not a problem?
12:12cemerickHrm, maybe leiningen should include [org.clojure/clojure "[1.2.0]"] in the dev-dependencies resolution.
12:13cemericktomoj: hiredman is likely right: someone republished a release version
12:13cemerickMaven won't re-download a release artifact.
12:14cemerickIn an ideal world, repositories should prevent the re-deployment of release artifacts.
12:14cemericks/shoud/would
12:14jacortinasIs anyone here using vimclojure?
12:15jacortinasvimclojure and nailgun**
12:15antares_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:15luciani've found Emacs+Evil+clojure-mode to be easier to set up :)
12:16jacortinaslucian: 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:16luciani just gave up
12:16jacortinasbeen running into this -> java.lang.IllegalStateException: Attempting to call unbound fn: #'vimclojure.nails/NamespaceOfFile
12:16lucian(i have other reasons to like Emacs+Evil)
12:16jacortinasyeah of course
12:17lucian(Evil is a really good vim mode, in case you didn't know)
12:28devntechnomancy_: 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:28devngrumble grumble
12:28Raynesdevn: Please don't. :p
12:29devnRaynes: why not?
12:29RaynesBecause 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:29duck1123devn: blog posts get outdated quickly
12:30RaynesJust edit the page on dev.clojure.org or contribute to clojure-mode's README or something.
12:30devnRaynes: that's what I was planning on.
12:30devnIt'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:31RaynesOh. I thought when you said 'article' you were implying a blog post.
12:32devn*nod* no worries
12:33devnI'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:37devnlike this: http://www.ccs.neu.edu/home/matthias/HtDP2e/scope2.png <-the result of hovering over f
12:39duck1123it's just finding other instances of the var name, right?
12:39devnyeah, scoped search highlight
12:40devnit's still really cool, and awfully handy for teaching
12:40duck1123oh wait, part of my confusion comes from my inability to read scheme
12:41duck1123I was reading f in the second one as an argument, then couldn't figure out what it was called
12:41technomancy_devn: menu bars don't scale
12:42technomancy_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:42devntechnomancy_: 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:43devnI 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:43technomancy_what do you mean?
12:43devn(on OSX anyway)
12:43technomancy_oh, well that's a separate problem
12:43devnthe 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:44technomancyI actually had no idea turning off the menu bar even had any affect on mackosecks
12:45technomancyhow does it interact with fullscreen?
12:48duck1123it's a shame the menubar doesn't work with unity yet
12:49jacortinasSo no one using vim/vimclojure/nailgun to do their coding? I'm seeing a lot of comments that are basically "Use Emacs".
12:49TimMcIt *is* traditional...
12:49TimMcThere are definitely vim users though.
12:49technomancyantares_: any progress? I can take a look
12:49jacortinasI don't think it's healthy for the community to basically not even try to support other editors
12:49antares_technomancy: we resolved it, thank you
12:50jacortinasbeing so exclusionary turns people off the language.
12:50TimMcjacortinas: Well, it's a good thing we don't do that!
12:50jacortinas:)
12:50technomancyantares_: anything I should be aware of?
12:50antares_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:51technomancyantares_: so it wasn't specific to the CI runs then? you were able to repro locally?
12:51antares_technomancy: after I removed ~/.m2, yes, I reproduced it locally easily
12:52technomancyoh, so there was a screwup with a republished artifact, yuck.
12:52antares_technomancy: https://github.com/michaelklishin/monger/commit/c8fe274329d47c1181da1d1a1e3dfe665143cc3e (for the record)
12:52TimMcjacortinas: 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:54jacortinasTimMc: 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:54jacortinasI've been using vimclojure and a terminal happily, until I saw this video http://www.youtube.com/watch?v=ObR3qi4Guys
12:55TimMcIt's true, there is much better support for Emacs.
13:24SaturnationI hate my job, it keeps me from playing with Overtone...
13:33duck1123There 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:36ckirkendall`duck1123: I know that was a joke but I would love something like that.
13:39jacortinasyou could do something really simple like using ping times as multipliers for randomness or something
13:39jacortinasthe more time it takes to get a response to more chaotic the music could become
13:39duck1123is there a good way to get load averages in clojure?
13:40duck1123I was looking, but put that one on the back-burner
13:42jacortinasanyone in here have experience getting vim, vimclojure and nailgun working?
13:43nickmbaileyduck1123: 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:47nickmbaileyduck1123: also see the jmx contrib library for fairly easy jmx interaction: https://github.com/clojure/java.jmx
13:47duck1123nickmbailey: awesome, I'll check that out
14:04jacortinasone last time, anyone using vimclojure and nailgun successfully?
14:05duck1123wish I could help you, man
14:05jodarojacortinas: sorry, no experience there, either
14:05ckirkendall`ckirkendall`: I use vimclojure but have not tried nailgun sorry
14:05ckirkendall`lol I even talk to myself in IRC.
14:05jacortinaslol
14:06jacortinasthank you guys anyway :)
14:41technomancyhas anyone done a comparison between drift and lobos?
14:42technomancyas 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:43technomancylobos has marginalia docs; nice
14:47technomancyheh; the first hit for "clojure lobos vs drift": http://thelastcitadel.com:3000/?page=0&amp;q=(((channel%3Aclojure)+AND+looks)+AND+drift)+AND+lobos
14:48pjstadigwe've started using drift at work
14:49pjstadigi'm not keen on just porting stuff either, but there's also something to be said for lessons learned
14:49pjstadigdrift is actually i bit more general than just database migrations, which is nice
14:50technomancyoh, cool. have you used it for multiple migrations yet?
14:50pjstadigwe have used it for zero migrations so far
14:50pjstadigjust getting started with it
14:51technomancydid you pick it over lobos specifically because it's not tied to sql?
15:02technomancyhttp://python3wos.appspot.com/ <= how long till we need one of these for Clojure 1.3? =)
15:07apgwozhello
15:08apgwozis there a way to get ring-jetty-adapter to spit out a stack trace instead of just automatically throwing a 500?
15:11gtrakthere's probably a middleware for that
15:12gtrakpossibly ring.middleware.stacktrace
15:12apgwozgtrak: i was just about to check in the middleware, which is the only place i hadn't looked
15:12gtrakeverything in ring is middleware though :-)
15:12apgwozi thought there might be a :debug flag or something for run-server
15:13gtrakthat would smell of convention over configuration
15:13apgwozsure.
15:13apgwozi don't work with ring often enough
15:14apgwozalso, not seeing one, but looking closer
15:14apgwozah, yes. in ring-devel here we go
15:14apgwozcool
15:15gtrakconvention over configuration is like... 'we're willing to take the complexity hit to optimizefor 80% of our use-cases"
15:15apgwozi know what convention over configuration is.
15:15apgwoz:)
15:15technomancyapgwoz: noir does that fwiw
15:15gtrak'now go learn our assumptions if you want to get anything done' :-)
15:16apgwoztechnomancy: the :debug flag?
15:16amalloytechnomancy: hah that is an excellent page
15:16technomancyapgwoz: "dev" mode that does clj-stacktrace-powered 500s
15:16apgwoztechnomancy: ah, ok. cool
15:17cemerickThat's a pretty damning illustration of the state of things in Python-land.
15:18gtrakyea, I totally shut down when I tried to learn django
15:18gtrakbut that was before I hit java EE and spring even
15:19technomancyruby equivalent: http://isitruby19.com/
15:19gtrakspring 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:20djh__has anyone had any experience of using clj-redis?
15:21cemerickgtrak: what do you use instead for e.g. openid and oauth?
15:21gtrakwell, we use spring security :-), not for the clojure yet though
15:22apgwozthe state of python 3.0 for many people is "don't care, I'm fine with 2.5, 2.6, or 2.7"
15:22gtrakactually 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:23gtraksecurity is just hateful though :-), not a fan
15:24cemerickgtrak: thanks, hadn't seen shiro before
15:24gtrakyea, it looks like its got less baggage
15:24cemerickCan't say its API looks any less complicated than spring-security tho
15:26cemerickLooks like it's focussed mainly on intranet security — ldap, activedirectory, etc — but no oauth?
15:26gtraklooks like it's not there yet
15:27gtrakspring sec has oauth
15:27cemerickyeah, that's what I use now
15:28gtrakare you using the DI along with it?
15:29cemerickYeah. Leaves a bad taste, but it's better than mucking with the API, as you pointed out. :-)
15:30cemerickI've never had to stop using the namespace config for anything. (I try to avoid cleverness w.r.t. security stuff. ;-)
15:30gtrakyea, 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:31gtrakthe solution involved an AOP-injected state bean to tell something further down the line to redirect on failure
15:32gtraklike a really complicated way to approximate a closure
15:36gtraki think the ring approach is much nicer than the dispatcher-servlet
15:36gtrakor interceptors or whatever crap spring has :-)
15:37gtrakpassing around mutable servlet objects is what made it hard
15:40duck1123Is OAuth difficult to do in Clojure? I've been planning to do that for my site for a while
15:40duck1123I 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:40gtrakthere's this: https://github.com/mattrepl/clj-oauth
15:41amalloyduck1123: oauth and openid are pretty different
15:42duck1123amalloy: I know
16:05mdeboardSo, 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:08amalloyyou're printing something that's not readable, like an HTTPConnection or whatever
16:09amalloyif you look at the file yourself it should be pretty clear what's illegible; it probably starts with #< (but no guarantees)
16:11patrkris_can anyone tell me what I'm doing wrong here: http://pastebin.com/eukBQ22J
16:13gfrederickspatrkris_: well I think that particular error is your import syntax
16:14patrkris_I should use ['s instead?
16:14gfredericksif you want to import foo.bar.Baz you can (:import foo.bar.Baz) or (:import (foo.bar Baz))
16:14patrkris_ah, i have an unnecessary level of parentheses
16:14gfredericksno, [] vs () is not significant
16:14patrkris_thanks :)
16:15gfrederickspatrkris_: 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:15gfredericksthough in that case it's still only one class so you're not gaining much
16:15mdeboardamalloy_: Negative, at least not visibly. ls
16:15mdeboardoop
16:15patrkris_yes, thanks again :)
16:15mdeboardamalloy_: Starts with {:request ...
16:17gfredericksI 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:17gfredericksmaybe I need two sub-modules :/
16:17mdeboardgfredericks: lazybot uses a lazybot/.lazybot/config.clj structure
16:18mdeboardso lazybot/ has .lazybot/ and src/lazybot/stuff.clj
16:18mdeboardthat .lazybot dir doesn't get sucked up into compilation
16:18mdeboardso maybe an example to use
16:18gfredericksmdeboard: does .lazybot get on the classpath automatically somehow, or do you hardcode that dir-name?
16:19mdeboardit gets cp'd to user.home and that is hardcoded
16:20mdeboardRaynes can probably better answer your specific questions
16:20duck1123I keep a config.clj at the root of my project and then have code that seeks that file out and loads it
16:20duck1123if I package up a jar, that file is not part of the jar
16:21gfredericksduck1123: but how would that work from a jar that another project's requiring? It just checks the classpath as well?
16:21gfredericksi.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:21tolstoygfredericks: I think there's a lein setting where you can put files to exclude from the jars.
16:22duck1123well, in my case, I require the user of my lib to create their own config file
16:22tolstoygravity: jar-exclusions
16:22gfrederickstolstoy: checking. If that's the case I'll be moderately embarassed for not looking first.
16:22tolstoygfredericks: jar-exclusions is the one.
16:22gfrederickstolstoy: okay. I will slowly walk away in shame now. Thank you.
16:23tolstoygfredericks: I develop all kinds of techniques, then look in sample-project.clj and erase them all. ;) That or clojure.core.
16:26amcnamaradnolen: ambrosebs: I'd love to see how you guys would go about solving this: http://www.4clojure.com/problem/140 (minimizing boolean functions)
16:30amcnamaratackling it with core.logic might make for a neat blog post (the 4clj blog needs content)
16:31dnolenamcnamara: neat, I didn't know that 4clj had a blog
16:32amcnamaraits 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:33jodaroits funny how drastically an implementation changes from thinking about it in the shower to actually making it work in my chair
16:35blakesmithjodaro: I take long showers for exactly that reason. ;-)
16:40duck1123much better than putting your servers in the bathtub
16:41jodarodefinitely.
16:44lnostdali suppose (. some-record some-record-field) is faster than (:some-record-field some-record) ? .. this seems to be the case here
16:47dnolenlnostdal: 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:48lnostdalok, yeah
16:51duck1123is reflected field access still faster? Or does that even apply?
16:53technomancygfredericks: actually it sounds like you want to create a dev-resources/ directory
16:54technomancysorry, test-resources/
16:57pandeirois it possible for lein run to time out while it's grabbing dependencies from clojars?
16:58dnolenduck1123: field access via reflection is dog slow.
17:12gfrederickstechnomancy: I thought of that, but assumed `lein run` didn't use test-resources -- am I mistaken?
17:13technomancygfredericks: if you set LEIN_NO_DEV=y, then the test/ stuff won't be on the classpath, but otherwise you're fine
17:13gfredericksah, so it _will_ use test-resources by default
17:13gfrederickscool, thanks
17:23BahmanDoes anyone has any experience using Proguard to obfuscate Clojure programs?
17:23Bahmanhas = have
17:24gtrakBahman, I imagine you'd have to AOT everything
17:25gtrakwe built a little plugin to compiile all the dependencies of a clojure project, so it's possible
17:26gtrakBahman, but aren't the classfiles obfuscated enough already? seems like proguard would be working at the wrong level of abstraction
17:27arohnerI'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:27cemerickgtrak: No; a motivated third party could pretty easily produce very sane Clojure source files from classfiles.
17:28gtrakcemerick, how would that change with proguard though? maybe if you run the whole clojure core into it as well it would get hard
17:28cemerickYeah, that's the only way to do it.
17:29gtrakbut it wouldn't know how to obfuscate strings like var names
17:29Bahmangtrak: I used JD (an almost simple Java decompiler) and I was able to follow the program logic through decompiled code.
17:29Bahmangtrak: Thanks for the hint re AOT.
17:29gtrakBahman, yea, because everything would be plumbing into core functions :-)
17:29cemerickA source obfuscator is fairly simple and might yield the sort of results you're interested in.
17:31duck1123arohner: are you putting the start code at the top level, or in a -main?
17:31Bahmancemerick: Tried putting the whole clojure.jar into Proguard but it didn't work.
17:31gtrakyou could totally write a source obfuscator as an extension to the clojure compiler, no?
17:31cemerickBahman: What broke, specifically?
17:31arohner_duck1123: in an init function that is a dependency for several functional tests
17:31Bahmancemerick: Let me reproduce it...
17:31arohner_duck1123: I suppose a simple solution would be to just not start swank when testing...
17:32arohner_but then I need to figure whether I'm testing
17:32jaleyis anyone using recent versions of ring and compojure successfully on google app engine or is it known to be broken?
17:33cemerickgtrak: A very natural extension to a whole-program optimizer / tree-shaker
17:33duck1123arohner: have you tried running (shutdown-agents) after the tests? I do it in reverse, swank when running, but not testing
17:33cemerick(all very lofty ideas with very complicated details :-P)
17:34gtrakcemerick, right, but the whole 'read into data structures' makes that a lot easier than it could be
17:35Bahmancemerick: This is the result of running the uberjar generated by Lein: http://pastebin.com/bcq98CjD
17:35arohnerduck1123: no, but I did dump the thread list, and filtered on user threads. There are several swank related threads there
17:35BahmanNo shrinking and optimisation in Proguard...only obfuscation.
17:38cemerickBahman: either it's not finding and munging classname constants
17:39cemerickor it's not altering strings passed to Class/forName
17:39BahmanI think the latter hunch is right.
17:40cemerickIIRC, there's some configuration around that?
17:40Bahmancemerick: Checking...
17:44pandeiroi keep getting "Premature EOF" while trying to grab dependencies with lein... is that normal or is there probably something wrong on my end?
17:44RaynesWell, it obviously isn't normal.
17:46pandeiroRaynes: yeah i'm glad you confirmed that
17:46duck1123check the parens of your project.clj
17:46pandeiroi am trying to use noir and using its own plugin and then calling lein run
17:47pandeiroit is getting some deps, but taking forever, while others fail outright
17:47pandeironetwork issue i guess? clojars.org loads fine in the browser though
17:48duck1123sometimes it's helpful to write out your pom file, then use maven's dependency stuff for a bit more control
17:49duck1123lein pom && mvn dependency:tree -U
17:50pandeiroduck1123: thanks i'll try that after i see if my linode box runs into the same issue
17:55pandeiroodd, it couldn't get anything from clojars either... but could from repo1.maven.org
18:16leafwcan incanter plot a line with the std as a band of color around it?
18:24duck1123As far as the logging problem I had this morning, it was Korma that was setting everything to debug level
18:25Raynesibdknox is evil.
18:25Raynesduck1123: Were you at the conj? I kept looking for Al Borland but never found him.
18:26duck1123No, I was at home hating all your guts
18:26RaynesHeh
18:26gtrakconj was so awesome :-)
18:26RaynesI don't think so, Tim.
18:42gtraklogging just sucks in general
18:42gtraki like heroku's approach
18:44duck1123well, now I'm getting no logging at all, but it's past 6 and I've changed gears
18:45gtrakseems like it needs to work at a higher level
18:45gtrakmaybe it does, but the defaults aren't suitable
19:08alexbaranoskydoes anybody but me think it would be great to have a heredoc reader macro in Clojure?
19:12jacortinasanyone have experience of getting the latest vimclojure working with nailgun?
19:13alexbaranoskynot having a nice syntax for writing strings feels so 90'
19:13alexbaranoskys
19:14amalloyheredocs are "nice syntax"?
19:14technomancyif you use paredit it automatically escapes " inside strings
19:14technomancyFWIW
19:23brehautsimple solution; use smart quotes inside your docstrings
19:25tmciversmart quotes?
19:28brehaut“smart quotes”
19:28technomancymore like “smart” quotes
19:28tmciverlooks like curved quotes that are different from the quotes used to enclose the doc string . . .
19:28brehauttypographically correct, annoying to type quotes
19:29tmciverHow DO you type them?
19:29brehautthey are. and elipsis isnt 3 dots either ;)
19:29tmciver3 space-separated periods
19:29brehauton a mac it's opt + [ and opt + { for doubles and opt + ] and opt + } for singles
19:29brehaut
19:30hiredmanbrehaut: not on my mac
19:30brehautyou can also do those french quotes « » with opt + \ and opt + |
19:30brehauthiredman: rebound ?
19:30hiredmanhmmm, not in iterm
19:31brehauttry in textedit?
19:31hiredmanah, yes, because opt is meta
19:31brehautaha of course
19:31amalloytmciver: easy to type. fire up ms word, type some quotes, copy-paste into emacs
19:31brehautoh, and a true elipsis is opt + ; (although text substitution will also take care of it in lion)
19:32hiredmanor if you have irssi setup to do the substitution
19:33tmciveramalloy: easy-peasy!
19:33brehauti think the compose key in linux lets you do similar things
19:34brehauthttp://en.wikipedia.org/wiki/Compose_key
19:34TimMcI just memorize Unicode code points. -.-
19:36leafwis there a lazy version of reverse?
19:36leafw,(doc reverse)
19:36clojurebot"([coll]); Returns a seq of the items in coll in reverse order. Not lazy."
19:37technomancyleafw: how would that work?
19:37leafwtechnomancy: by asking for count - i ?
19:37TimMcleafw: If you have a vector, rseq is good.
19:37TimMc,(doc rseq)
19:37clojurebot"([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:37technomancyleafw: merely calling count on a lazy seq forces the entire thing
19:37leafwyes but if the seq is not lazy, the reverse can be lazy
19:37TimMc...depending on exactly what you want.
19:38technomancyoh, I see; yeah.
19:38alexbaranoskyis the dev goole group the place to ask about adding a heredoc reader macro?
19:39leafwTimMc: rseq will do, thanks
19:55sritchieambrosebs, I did some weekend work I think you might find interesting
19:55sritchieI 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:56sritchieRaynes, the template project is pretty much set, I think! https://github.com/functional-koans/koan-template
19:56sritchieand finally, a lein-koan plugin: https://github.com/functional-koans/lein-koan
20:01hiredmanso, what is the recommended way to print objects that preserves metadata and does not overly specify types?
20:02amalloyhiredman: bind *print-meta* to true?
20:03hiredmanand there is no pr* variant for it?
20:03amalloywe have too many pr* variants already imo
20:03hiredmanI suppose that'll do
20:03hiredmanoh really?
20:04hiredmanhow many are there?
20:04amalloyi'm mostly thinking of pr, pr-str, prn, prn-str, print, print-str, println, println-str
20:05hiredmanah, yes, the -strs
20:05amalloyapparently there are also print-simple, print-ctor, printf, print-dup
20:06amalloyanyway, 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:06hiredmanprint-simple and print-ctor are part of the implemention of print-method or print-dup
20:07amalloyi knew that about print-ctor, didn't know about print-simple. but they're publicly exposed in clojure.core
20:14gfredericksI just learned me some new print functions.
20:14gfredericksI don't know that I have much use for them though
20:18accelis 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:19accelI don't want to reload the jvm on every execution of Hello World
20:19cemerickIt seems like all the -strs should have been dropped once with-out-str came along.
20:20mdeboardaccel: with emacs there is for sure, I guess there might be one for vim
20:20technomancyaccel: jark is designed with that use case
20:23acceltechnomancy: jark is exactly waht I wanted; thans!
20:23accelk
20:23accel(some letters defy space time boudns)
20:23hiredmancemerick: well, pr-str is great for logging, if the thing you log might be a lazy seq
20:23hiredman,(str (range 10))
20:23clojurebot"clojure.lang.LazySeq@9ebadac6"
20:23hiredman,(pr-str (range 10))
20:23clojurebot"(0 1 2 3 4 ...)"
20:23accelso I've read http://clojure.org/getting_started ... but how do I actually install clojure and get clj?
20:24brehaut,(apropos #"-str$")
20:24clojurebot(with-in-str with-out-str print-str prn-str pr-str ...)
20:24cemerickhiredman: If logging means printing to *out* I guess?
20:24hiredmancemerick: no, no
20:24hiredman(log/info (range 10))
20:25hiredmanvs (log/info (pr-str (range 10)))
20:25cemerickoh, misread your msg
20:26hiredmanactually 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:27accelhmm, basically, I need leiningen?
20:28hiredmanaccel: no, download the clojure jar, type java -jar clojure.jar
20:28Raynessritchie: Hah. A young jedi. I haven't even seen starwars.
20:28hiredmannow you have a repl, go to town
20:28accelthat gets me a repl
20:29accelhow do I get clj
20:29acceland compiling stuff?
20:29hiredmanwhat do you want to do?
20:29RaynesJust get leiningen.
20:29acceli want to write programs in clojure
20:29accelnot just use the repl
20:29hiredmanall you need is the repl
20:29hiredmanwhat programs?
20:29accelactually; i have a bunch of haskell code I want to convert over to clojure
20:29accelI want to be able to develop in vim; use makefiles, etc ...
20:29accelthe repl is nice, but I need more
20:30hiredmanreally, none of that requires a repl, all you need is a nice editor
20:30hiredmando you have dependencies to manage?
20:31brehautis 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:31hiredmannot that I am aware of
20:32brehautthanks
20:32weavejesterLeiningen isn't necessary, but is recommended. It's useful for managing Clojure projects and dependencies.
20:32hiredman,(symbol 'foo) ;; works
20:32clojurebotfoo
20:32accelI have no dependencies to manage
20:32hiredman,(symbol 'foo 'foo)
20:32clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.String>
20:32hiredman,(symbol "foo" 'foo)
20:32clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.String>
20:32technomancyweavejester: how are you finding lobos?
20:32weavejesterUsing the Clojure jar on its own, you can either run a repl, or run a script.
20:32hiredmanaccel: then you just need an editor
20:32accelhow do I run a script? actually, where is the documentation for this?
20:33hiredmanjava -jar clojure.jar --help
20:33accelreadme.txt only says To run: java -cp clojure-${VERSION}.jar clojure.main
20:33accelhmmm
20:33hiredmansure
20:33weavejestertechnomancy: The DSL I like, the migrations not so much, but I'm thinking that migrations should be an independent library.
20:33technomancyclojure really has had no effort put into its out-of-the-box experience
20:34hiredmanthat is equivalent to what I have been saying
20:34RaynesLeiningen is the answer to life, the universe, everything.
20:34technomancyweavejester: do you see it as being complementary to korma?
20:34acceltechnomancy: I think it's a feature; to weed out the weak
20:34hiredmanaccel: sure
20:34acceltechnomancy: they should make the installation process require writing macros
20:35weavejestertechnomancy: As far as I can see, Korma only handles queries and inserts, not schema design, whilst Lobos is all about creating tables etc.
20:35technomancyweavejester: right, seems like there's not much overlap
20:35hiredmanit's really not hard at all, I don't understand why everyone wrings their hands and wails about "the noobs"
20:35weavejestertechnomancy: Migrations I think are something separate again; in theory there's nothing tying migrations to SQL.
20:35technomancyI was asking ibdknox if he had plans to add schema manipulation to korma, but it looks like lobos has it pretty well covered
20:36hiredman'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:37RaynesUntil you have dependencies and an actual project.
20:37RaynesThen you have to understand and manage the classpath.
20:37technomancyhiredman: really though, we aren't savages. line history is a requirement.
20:37brehautRaynes: acres of bash script
20:37accelRaynes: you've convinced me I need lein
20:37RaynesWhich is generally impossible without maven if you plan to distribute code.
20:37tensorpuddingyou still haven't covered how you'd make your clojure project into a .jar
20:37weavejestertechnomancy: Yeah. I think I'm going to be using Lobos to write the SQL part of my migrations.
20:37hiredmantechnomancy: how so?
20:37hiredmantechnomancy: requirement to do what?
20:37technomancyhiredman: I mean you need to at least mention rlwrap
20:37technomancya requirement to be taken seriously
20:38hiredmanby who?
20:38technomancyprogrammers?
20:38RaynesCreating jar files, executable jar files, war files, complicated build processes, etc.
20:38brehautalso, does anyone else every want an apropos that includes the namespace the symbol is found in ?
20:38Raynesclojure.jar is not going to be sufficient for much of anything, realistically.
20:38duck1123if all you have is a clojure repl and notepad, rlwrap is vital
20:38tensorpuddingjava sure is cute like that
20:38RaynesUnless, of course, all you want is a REPL with nothing but Clojure on the classpath.
20:38hiredmanduck1123: not true
20:38hiredmanat all
20:38weavejesterIt's harder to setup Clojure with the jar than Lein, IMO.
20:39RaynesIt really isn't just Java. Every language has some kind of dependency system.
20:39hiredmanweavejester: no way
20:39RaynesThey hve to.
20:39Rayneshave*
20:39hiredmanlein brings in all these maven concepts
20:39hiredmanwhich are very useful, and you will want
20:39hiredmanbut not required by any means
20:40technomancyweavejester: I wonder if drift and lobos could also be seen as complementary
20:40hiredmanit is very doable to write useful clojure code (code that delivers features) without any of that
20:41weavejesterhiredman: 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:41technomancyexcept 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:42hiredmantechnomancy: really?
20:42technomancyhiredman: for true. =(
20:42weavejestertechnomancy: Drift seems to attempt to do migrations and schema design, and Lobos does too. They're more competing, I think.
20:42technomancyat least, that's what someone reported on the mailing list
20:42hiredmantechnomancy: works for me
20:42technomancyweavejester: I didn't see any schema design in drift when I was looking at it this morning
20:42weavejestertechnomancy: Really? Oh, no, you're right, sorry.
20:43weavejestertechnomancy: I was thinking of something else.
20:43hiredmanthe readme.txt has instructions for buidling with ant and with maven, both work for me
20:43accelRaynes: is there a way to use Lein with jark?
20:43technomancyaccel: the lein integration in jark is still being developed
20:43weavejestertechnomancy: I like Drift's separation, but I don't like using multiple files for migrations.
20:44technomancyaccel: last I checked (~3 months ago) it wasn't working for running leiningen tasks
20:44technomancyit might work for simpler things though
20:44accelso basically, lein is equiv to cabal ?
20:44technomancyweavejester: I spent a while trying to get drift working using raw c.j.jdbc, but without lobos it was just too annoying
20:45hiredmansort of
20:45hiredmanit is kind of a shim on top of maven's dependency stuff
20:45technomancytotal 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:45technomancylooks like they fixed the Clojure readme; that's good.
20:46accelbtw; where the fuck did ein install everythin?
20:46weavejestertechnomancy: 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:46technomancythat was my first patch submitted to Clojure ~3 years ago; fixing busted readme insntructions
20:46technomancyweavejester: how so?
20:46alexbaranosky~/.m2 folder
20:46clojurebotPardon?
20:46alexbaranoskyaccel: ~/.m2 folder
20:47hiredmanaccel: see, you could have the jar file and a repl running and be rolling along writing code right now
20:47technomancyapparently the scala guys have a fork of jline that is actually pretty good
20:48hiredmandoesn't jruby have one too?
20:48technomancyI think jruby has real readline
20:48accelhiredman: lol
20:48tensorpuddinglein can build, lein can fetch deps, lein can run a swank server for you
20:48weavejestertechnomancy: Migrations in Ragtime are loaded from a namespace, rather than from a directory of files.
20:48accelalexbaranosky: ~/.m2 is empty
20:48accelwhere did lein put clojure though?
20:48hiredmantechnomancy: nah, they use jline
20:48accelie. "lein repl" <-- how the fuck does lein find clojure?
20:48hiredmanaccel: tone down the language a little
20:48technomancyhiredman: oh, huh. scala's has programmable completion
20:48RaynesIt comes with Clojure.
20:49technomancyaccel: why do you care?
20:49acceltechnomancy: I care how it's setup
20:49weavejestertechnomancy: They're also first class objects, which... I don't think they are in Drift?
20:49acceljust curious
20:49RaynesOr, Clojure comes with it.
20:49accelhiredman: noted
20:49accelClojure comes with lein?
20:49acceli'm confused
20:49amalloylein bundles a clojure version
20:49RaynesBecause it is... written in it.
20:49technomancyweavejester: I think in drift they're defined as just an up and down defn inside a given namespace
20:49RaynesWhich means it kind of sorta needs it.
20:49tensorpuddinglein is a standalone jar
20:49jacortinasCould someone point me to a good example of a compojure web application? Something a little more complex would be awesome.
20:50technomancyweavejester: what are migrations made of in ragtime?
20:50accelokay, so I have ~/local/bin/lein ... where is the lein.jar file and lein's versino of clojure stored?
20:50amalloyjacortinas: www.4clojure.com www.github.com/4clojure/4clojure perhaps?
20:50technomancyI kinda like the "give me a namespace that has $X and $Y defined" model in general.
20:50weavejestertechnomancy: In Ragtime they're types implementing a Migration protocol.
20:50technomancyit works really well for lein tasks
20:50jacortinasamalloy: awesome thanks :)
20:50accel~/.lein
20:50accelI am now happy
20:50clojurebotGabh mo leithscéal?
20:50RaynesThough 4Clojure will be using noir as soon as I get a chance to make it so.
20:50amalloyover my dead body, man
20:51jacortinasRaynes: Why the switch?
20:51jacortinaslol
20:51jacortinasso noir just uses compojure correct?
20:51RaynesBecause Noir is awesome and Chris Granger is my friend.
20:51jacortinasjust adds some conventions
20:51technomancyweavejester: hmm... I don't see what protocols bring to the table here
20:51technomancythere's no fancy dispatch going on; just two operations
20:51tensorpuddingwhen you build deps for a project it copies the correct version of clojure.jar into the classpath
20:51Raynesnoir is a higher-level and more put together framework on top of compojure.
20:51amalloynoir 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:51sunngjacortinas: clojuresphere could be a good demo https://github.com/jkk/clojuresphere
20:52jacortinassunng: thank you
20:52jacortinas:)
20:52Raynesamalloy: I think you'll be happy with how simplified things will be.
20:52jacortinasRaynes: I felt like the example noir blog was kind of mixing concerns
20:52weavejestertechnomancy: Well, you can create a function that returns a migration, for instance.
20:52seancorfieldi wonder what 4clojure would look like in FW/1? :)
20:53technomancyweavejester: seems like that introduces a discoverability problem too though
20:53jacortinasRaynes: 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:53sunngnoir to compojure is something like django to bottle if you are familiar with python web frameworks
20:53weavejestertechnomancy: 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:54weavejestertechnomancy: By having migrations as first-class objects, you can build abstractions around them. Also you can bundle them in a jar.
20:54technomancyyou can already put namespaces in a jar though
20:54technomancydefn is the best abstraction in all of Clojure =)
20:54hiredmanyou can also pass namespaces around
20:54hiredman,*ns*
20:54clojurebot#<Namespace sandbox>
20:55weavejestertechnomancy: But you can't search a directory for resources, right?
20:55hiredman,(find-ns 'clojure.core)
20:55clojurebot#<Namespace clojure.core>
20:55technomancyweavejester: sure; that's how "lein help" works
20:55accelhow do I install vimclojure?
20:55acceldo I place it in ~/.vim and unzip?
20:55jacortinasaccel: for the non-interactive stuff yeah
20:56jacortinasit's that simple
20:56weavejestertechnomancy: How does that work? I didn't think it was possible to iterate through resources on a classpath?
20:56hiredman"very slowly"
20:56weavejestertechnomancy: Other than explicitly checking to see if its a jar or dir and then iterating through them.
20:57technomancyweavejester: https://github.com/technomancy/leiningen/blob/master/src/leiningen/util/ns.clj
20:57headiustechnomancy, hiredman: we still use jline 1.0ish
20:57technomancyit's really slow if you don't require everything to be grouped under a prefix, if you do it's not so bad
20:57technomancyheadius: have you looked at scala's?
20:57weavejestertechnomancy: Oh, I think tools.namespace does something similar to that, right?
20:57hiredman:(
20:58headiustechnomancy: not really...there's an FFI-based wrapper around actual readline I've considered
20:58technomancyweavejester: tools.namespace does, but without allowing a prefix. see the comment at the top of the file
20:58amalloyweavejester: he has a comment in there explaining why tools.namespace is no good
20:58weavejestertechnomancy: Ahh
20:58hiredmanthis classpath walking stuff is icky, because really who cares about classpaths? the real way things are loaded is via classloaders
20:58headiusif scala's doesn't require scala, it could be an option
20:58hiredmanand classloaders don't give you a good way to iterate
20:58accelso 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:59weavejestertechnomancy: Still... if a migration is a namespace, that doesn't seem as composable as a namespace as a type.
20:59technomancyheadius: I don't think it does; someone's integrating it to Clojure here: https://github.com/trptcolin/reply
20:59technomancyweavejester: a namespace is just a fancy map of symbols to values
20:59seancorfieldaccel: if you have a -main function you can do lein run -m projname.core
21:00weavejestertechnomancy: Sure, but they don't seem to be very suited to being created on the fly.
21:00headiusthere's also a jline2 in github.com/jline
21:00hiredmana namespace is a compilation environment
21:00headiusI have no idea what all is different/improved
21:00hiredmanweavejester: very doable though
21:00technomancyI do on-the-fly creation of namespaces in slamhound; it's not bad at all
21:01technomancyplus 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:01accelseancorfield: I don't have a main function
21:01weavejesterYou'd still have the problem of discovery though. Doesn't Drift assume one file per migration?
21:01accelseancorfield: I just wrote in clojure.clj: (println "hello world")
21:01accelseancorfield: it seems like there's somethinr trivial I'm missing
21:01accelwhere am I screwing up?
21:01hiredmanaccel: see, you could have avoided all this, and just be running a nice simple repl
21:01accelsomeone please point out my idiocy
21:01accelhiredman: lol
21:01sunngaccel: add a -main function of use lein-exec plugin
21:02seancorfieldaccel: this is why most folks start with the repl :)
21:02technomancyweavejester: leiningen.util.ns/namespaces-matching basically gets you that
21:02acceli actually like lein
21:02hiredmanseancorfield: they don't though
21:02acceleven before it works
21:02technomancyweavejester: drift's does assume they're on the filesystem, which I think is bad
21:02sunngaccel: sorry, or use lein-exec plugin
21:02seancorfieldlein repl; (use 'projname.core)
21:02seancorfield:)
21:02technomancybut it's not a flaw of the migrations-as-a-namespace model, just of drift's implementation
21:02hiredmanseancorfield: 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:03hiredmanall of which is not required at all
21:03seancorfieldhiredman: how about "this is why most folks are told to start with the repl :)" ? :)
21:03technomancyheadius: it sounds like the main improvements are around flexibility with completion
21:03weavejestertechnomancy: Agreed. But you'd still use a namespace to group together a common set of functions, rather than a protocol?
21:03technomancyweavejester: yeah, definitely
21:03headiustechnomancy: well we certainly could use an updated
21:03weavejesterI mean, a protocol like:
21:03hiredmanjava -jar clojure.jar some-file-full-of-clojure-forms.clj
21:03headiusthere's just a half-dozen forks so it's hard to know which to use
21:03weavejester(defprotocol Migration (up [m]) (down [m]))
21:03seancorfieldhiredman: well, it doesn't help that clojure.org/getting_started has instructions that don't actually work now...
21:03seancorfieldclojure.jar is the wrong filename
21:04weavejesterThat's surely what protocols were made for?
21:04weavejesterDoing something like:
21:04hiredmanseancorfield: whatever
21:04weavejester(in-ns 'blah) (defn up ...) (defn down ...)
21:04accel$ cat core.clj
21:04accel(println "Hello World")
21:04acceldo I need more in my core.clj file?
21:04accelI have a ":main manip.core" in my project.clj file already
21:04weavejesterAnd then searching the namespace for up and down functions seems kinda the wrong tool for the job.
21:05hiredmanaccel: if you are using lein you must have deleted the namespace declaration
21:05hiredmanput it back
21:05seancorfieldonly 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:05technomancyweavejester: protocols are more about defining an open extension point with fast dispatch IMO
21:05accel??? lein never created a core.clj file for me
21:05accelI created it by hand
21:05seancorfieldaccel: are you using leiningen?
21:05weavejestertechnomancy: Why doesn't that apply to migrations?
21:06hiredmanaccel: did you run 'lein new'?
21:06technomancyweavejester: because you're not going to extend that protocol to another type
21:06hiredmanseancorfield: he is, against my advice, but following the advice of others who are no longer paying attention
21:06technomancythere's no data to go with it
21:06weavejestertechnomancy: Hum...
21:07weavejestertechnomancy: But how would you implement an anonymous migration? Or don't you think there's a need?
21:08seancorfieldlein 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:08technomancyweavejester: you could just call future in your up defn
21:08hiredmantechnomancy: anonymous, not async
21:08technomancyoh, gotcha
21:08accelI 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:09weavejestertechnomancy: 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:09hiredmanaccel: src/manip/core.clj
21:09seancorfieldlein run expects a -main function in the specified namespace: (defn -main [] (println "Hello World!"))
21:09weavejestertechnomancy: So you need some way of writing a function that will generate a migration for you.
21:09technomancyif 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:10technomancyweavejester: seems like ring-style middleware could have you covered there
21:10weavejestertechnomancy: With protocols, you can just reify
21:10hiredmantechnomancy: you could just extend weavejester's protocol to namespaces
21:10amalloyhaha excellent
21:11accelhiredman: $ cat core.clj
21:11accel(ns manip.core)
21:11accel(defn -main [& args] (println "Hello World"))
21:11technomancyhiredman: ahh... clever
21:12accelhttp://hpaste.org/54629 <-- my errors
21:12seancorfieldaccel: src/manip/core.clj or src/core.clj ?
21:12accelmanip = directory lein created
21:12weavejesterhiredman: That's an interesting idea :) - I'm not sure what it would accomplish though.
21:12accelthe file is in manip/core.clj
21:12technomancyweavejester: 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:12seancorfieldaccel: manip/src/manip/core.clj yes?
21:12accelARGH
21:12technomancyeveryone understands defn and namespaces; it doesn't bring any new types to the table.
21:12accelI'm an idiot
21:12accelit worked now
21:13seancorfieldyay!
21:13accelseancorfield , hiredman : I was editing manip/core.clj instead of manip/src/manip/core.clj -- thanks for your patience + help
21:13accelI'm going to go kick something ahrd with my shin now
21:13seancorfieldnp, the project structure isn't obvious unless you've had experience with that sort of structure...
21:13accelyeah; I felt it was something obvious after you get it, like hjkl movement keys in vim
21:14accelis it just me, or does this website design: http://forge.scilab.org/index.php/p/jlatexmath/ : make it look scammy?
21:14weavejestertechnomancy: Namespaces don't seem very suitable for something generated on the fly by a function.
21:15technomancyweavejester: maybe. I need to think through the concrete use cases.
21:15weavejestertechnomancy: 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:15weavejestertechnomancy: Let me know if you come up with anything good!
21:15technomancyanother option is a multimethod with :up and :down methods
21:15technomancybut what I need right now is dinner; would be happy to continue tomorrow.
21:16hiredmanI don't really understand the desire for either namespaces or types
21:16technomancya multimethod lets you group many in a single file, so I like that a lot better.
21:16duck1123I'm currently goiing the multimethod route
21:16technomancyhiredman: ask joegallo what he did with pluggable doric formatters; I think it turned out pretty well.
21:17lazybotjava.lang.RuntimeException: EOF while reading
21:17weavejestertechnomancy: Hmm...
21:17hiredmansure, I was sitting next to him while he was writing it
21:17hiredmana migration is an action for up and an action for down
21:18hiredman{:up … :down …}
21:18weavejesterhiredman: Yep. Plus an identifier.
21:18accelis 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:18hiredman{:up … :down … :id …}
21:18weavejesterSo: {:id ..., :up ..., :down ...}
21:18weavejesterYeah.
21:19hiredmanaccel: jvm startup time is a pain
21:19sunngaccel: try lein interactive
21:19weavejesterWhich maybe is better than a protocol/reify
21:19seancorfieldaccel: 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:19weavejesterIt wouldn't actually change any functions I've written if I used a hash with functions in instead.
21:20weavejesterHm...
21:20accelso 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:21weavejesterhiredman: You might have a point with just making it a map of {:up ... :down ... :id ...}
21:22weavejesterhiredman: It would be first-class... and more composable... more discoverable...
21:24weavejesterI'll sleep on it, I guess :)
21:31seancorfieldaccel: 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:32seancorfieldif 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:32seancorfieldaccel: http://icylisper.in/jark/
22:02rickrCan someone explain why I'm seeing the exception below?
22:02rickr=>(defmacro t[m] (for [k (keys m)] k))
22:02rickr=>(t {:a 1 :b 2 })
22:02rickr=>(def c {:a 1 :b 2 })
22:02rickr=> (t c)
22:02rickrIllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:487)
22:03blakesmithAnyone have a favorite cassandra client library?
22:05moogatronicAny Overtone hackers around tonight?
22:05trptcolinblakesmith: 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:06trptcolinHector is pretty badass
22:06trptcoline.g. handles failover for client connections
22:08blakesmithtrptcolin: Cool, I gave it a whurl and ran into some issues: https://gist.github.com/1403168
22:09blakesmithI didn't want to bother debugging if there was something better out there. ;-)
22:13rickrOdd, so macro args are literally replaced then? Since changing 'm' to '(eval m)' fixes it.
22:13tmciverrickr: I know almost nothing about macros but I think you need to put a quote in the macro body somewhere.
22:13trptcolinhmm, bummer. i get sl4j warnings, nothing fatal though.
22:15brehautrickr: (defmacro t[m] `(for [k# (keys ~m)] k#)) is what you want i think
22:16brehautrickr: ` to syntax quote the form , ~ to unquote the argument m, k# to get a gensym to get a symbol for the scope
22:16duck1123Has anyone else found that the newer version of korma wants to quote it's table names with \"
22:16rickrtmciver: 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:17jcrossley3rickr: brehaut: or just use defn in that case?
22:18rickrbrehaut: et. al. ty
22:18brehautjcrossley3: i presume that hes trying to understand macros, otherwise why even defn? keys is already a function
22:18blakesmithtrptcolin: What version of clojure are you running?
22:19dnolenthis is funny, http://philosecurity.org/2009/01/12/interview-with-an-adware-author
22:19brehautrickr: 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:19rickrbrehaut: i see and yes, just playing around with macros trying to understand them better.
22:21brehauthmm, i dont know if foo# is actually a gensym, the gensym function produces differently named symbols
22:21trptcolinblakesmith: looks like 1.2.1
22:23sunnghi, all. Which module is clojure.contrib.condition in ??
22:23lazybotsunng: Definitely not.
22:24G0SUBdnolen: wanted to discuss something related to ClojureScript with you...
22:24dnolenG0SUB: what's up?
22:25G0SUBdnolen: I have been using CLJS for a bit recently.
22:25G0SUBdnolen: I feel CLJS lacks a good selector engine.
22:25G0SUBdnolen: GClosure doesn't have one in the core. they have a "third-party" lib that's a port from Dojo.
22:25blakesmithtrptcolin: Rookie mistake, I put hector in :dependencies instead of :dev-dependencies.
22:27G0SUBdnolen: 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:28dnolenG0SUB: hmm, I thought that latest GClosure had something … could be wrong.
22:28G0SUBdnolen: the docs point to goog.dom.query which is "third-party" aka out-of-tree
22:30dnolenG0SUB: 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:30G0SUBdnolen: makes sense. a contrib should serve the purpose as well.
22:30dnolenG0SUB: but of course assumes there's a good lib management for CLJS which there is not.
22:31G0SUBdnolen: true, that's another problem.
22:31G0SUBdnolen: honestly, if I wish to use CLJS to build real webapps, I would need some really good DOM manipulation libs.
22:32dnolenG0SUB: personally, I have no problem w/ just putting things in jars and releasing them. works for gclosure
22:32G0SUBelse, my JS guys won't buy CLJS.
22:32G0SUBhmm
22:32G0SUBdnolen: 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:32alexbaranoskyhey guys, what's the simplest way to build my fork of Clojure locally?
22:34dnolenG0SUB: yes I think so, cljs files and compiler macros, etc
22:34G0SUBok
22:34G0SUBdnolen: right now, almost all of my CLJS code is interop, it's ugly.
22:38trptcolinalexbaranosky: ant jar?
22:38alexbaranoskytrptcolin, ok - let me install ant
22:38dnolenG0SUB: 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:39dnolenG0SUB: I haven't tried that kind of thing yet so I don't have much insight at the moment.
22:39G0SUBdnolen: thanks. I will start a discussion on the mailing list.
22:41devndnolen: do you know of any cljs code lying around that uses websockets off the top of your head?
22:41devnnvm: https://github.com/neotyk/ws-cljs/
22:42dnolendevn: also there's a halfbaked commented out version of browser repl that uses websockets
22:43dnolendevn: would be sweet to see that actually working, gclosure channel works everywhere but lots of latency.
22:45devndnolen: :\ That's too bad
22:46devndnolen: any handle on where the loose wire is? latency-wise...
22:46dnolendevn: polling iframes
22:46devnah
22:46brehaut_iframes_‽
22:46brehautthats mental
22:46devndnolen: is that a solvable problem from cljs' perspective, or are we at gclosure's mercy?
22:46dnolenbrehaut: except … it works everywhere.
22:47devn^good point
22:47brehautdnolen: so do xhrs ?
22:47dnolenbrehaut: wasn't always true, and may not even true for some strange browser clients.
22:47brehauti didnt realise gclosure was old enough for that to have been a problem
22:48dnolenbrehaut: I also think it may allow communications across different domains - haven't looked closely.
22:48brehautesp given the funny clicky events that polling iframes generate in older IEs
22:48brehautdnolen: ah, that would be it then
22:49dnolenbrehaut: but even xhr had weird limitations - FF at long ago could only have 2 inflights requests, a bunch of other goofy things.
22:49dnolena long time ago.
22:49dnolenI'm sure gclosure is a amalgamation of useful code, not all one concerted effort
22:49brehautthat limitaiton would have held for iframes too
22:49dnolenbrehaut: why?
22:50dnoleniframes have nothing to with xhr
22:50brehautbecause all browsers used to limit themselves to two inflight connections to any given scheme * domain * port
22:50brehautnomatter the resource type
22:50brehautor method of access
22:50dnolenbrehaut: I don't recall seeing that limitation at the same time across the various browsers.
22:52brehautffx was slower in upping the limit i think was all
22:52dnolenbrehaut: interesting. still had to live with it :)
22:52brehautindeed; the normal solution was a bunch of subdomains
22:54devndnolen: how slow is slow, out of curiosity?
22:54dnolendevn: it's noticeable, especially when you want to println back from browser-repl
22:55dnolennight and day from a repl connection to Node.js
22:55devndoes it increase over time? like if you were hammering the browser with updates how would it react?
22:57dnolendevn: not really, it's just the polling intervals are not particularly high from what I can tell.
22:57devndnolen: thanks for the info -- trying to rewrite something in clojure and would love to make it clojure and clojurescript if it makes sense
22:58trptcolinheadius: 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:58dnolendevn: make a lot of sense :)
22:58dnolenmakes
23:00trptcolintried 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:33gtrak``does korma do file blobs? i'm thinking about making a little cms
23:41gtrak``maybe i'll just use wordpress
23:42duck1123but then you won't be able to say "I did this"
23:42gtrak``true :-)
23:42gtrak``opportunity cost
23:49amalloyalexbaranosky: a heredoc reader macro is pretty trivial to add, but i don't especially want one (and i doubt if /core does either)