#clojure logs

2010-10-16

00:01dpritchettnow i need to get emacs not to barf on cygwin symlinks
00:16mabesdoes clojure already have a map-tree like function? Something that does something like this: http://gist.github.com/629404
00:33DanielGlauser,(reduce and (map (fn [bool] bool)) (true true true))
00:33clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.core/and
00:35mabes,(every? true? [true true true])
00:35clojurebottrue
00:36DanielGlauser,(reduce + (map (fn [n] n) [1 2 3]))
00:36clojurebot6
00:36DanielGlauserThanks mabes, I'll try that instead
00:37mabesDanielGlauser: actually, that is probably not what you want..
00:37mabes,(true? 1)
00:37clojurebotfalse
00:37mabes,(true? true)
00:37clojurebottrue
00:38mabesunless you are only dealing with booleans..
00:39DanielGlauserIn this case I am so I believe the every? example will work for me
00:39DanielGlauserIs the issue with (reduce + ...) vs. (reduce and ...) that "and" is a macro?
00:40mabesDanielGlauser: correct
00:43DanielGlausermabes: Great, that was easy. Plugged into a larger example and it works like a charm.
00:44DanielGlausermabes: Is there an easy way to query a function to find out if it is a macro?
00:45mabesif you say (doc and) it will tell you it is a macro...
00:45mabes,(doc and)
00:45clojurebot"([] [x] [x & next]); Evaluates exprs one at a time, from left to right. If a form returns logical false (nil or false), and returns that value and doesn't evaluate any of the other expressions, otherwise it returns the value of the last expr. (and) returns true."
00:45mabeswell, in the repl it will
00:46mabesI'm not sure if there is other wise.. it seems like it would be on the meta data of the var
00:46mabessorry, I don't really know
00:46DanielGlauserNo worries, thank for your help
00:50maravillas_,(:macro (meta #'and))
00:50clojurebottrue
00:51maravillas_There may be a better way, though.
00:52maravillasoh, mabes already pointed that out :)
00:56mabesI guess with #'and you could pass that to reduce as well if you really wanted to
00:57mabesapply would make more sense though
00:57mabes,(apply #'and [true 1 :foo])
00:57clojurebot:foo
01:10DanielGlauser,(reduce #'and (map (fn [bool] bool)) (true true true))
01:10clojurebotjava.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$map
01:11DanielGlauserOops, missed on the parens
01:11DanielGlauser,(reduce #'and (map (fn [bool] bool) (true true true)))
01:11clojurebotjava.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn
01:12tufflax'(true true true)
01:13zkimHey Dan, you coming to the meetup on wed?
01:14DanielGlauserzkim: It's good to see you here. Not likely, with a newborn I think I'd better stay closer to home.
01:15zkimDanielGlauser: ah yeah, priorities and all :)
01:15DanielGlausertufflax: Thanks, the problem with lists... No wonder why Rich added vectors to the language
01:15tufflax:p
01:15DanielGlauser,(reduce #'and (map (fn [bool] bool) [true true true]))
01:15clojurebottrue
01:15DanielGlauserthere we go
01:16DanielGlauserzkim: This has been my first chance to sneak off and do some coding. I feel a bit guilty. :)
01:17maravillas,(reduce #'and (map (fn [bool] bool) [true true false]))
01:17clojurebottrue
01:17zkimDanielGlauser: ah the siren's call of Clojure
01:18DanielGlauserzkim: Do you think anyone else will be in town to lead the meeting?
01:19zkimDanielGlauser: I think lee and ben are coming, I'll send you directions to post to the mailing list
01:19G0SUB,(reduce #(assoc %1 %2 (inc (%1 %2 0))) {} [:a :a :b :b :b :c :d :e :e])
01:19clojurebot{:e 2, :d 1, :c 1, :b 3, :a 2}
01:19zkimDanielGlauser: I've been putting it off trying to get ClojureDocs into beta before the conj
01:20G0SUBzkim: hey, are you the creator of ClojureDocs?
01:20DanielGlauserzkim: Roger that! Good luck with ClojureDocs. I'll ask Lee to lead the meeting and Ben/Tyler as backups.
01:20zkimG0SUB: yeah, anything I can help you with?
01:21zkimDanielGlauser: sounds good
01:21G0SUBzkim: Hi, can I PM you?
01:21zkimG0SUB: sure
01:22mabes,(frequencies [:a :a :b :b :b :c :d :e :e])
01:22clojurebot{:a 2, :b 3, :c 1, :d 1, :e 2}
01:22mabes^ G0SUB fyi..
01:23G0SUBmabes: yes, I am aware of that. thank you. I was just trying out clojurebot :)
01:23mabesam I wrong in thinking that `take` could be rewritten to use for instead of lazy-seq?
01:25mabesnm...
01:29DanielGlauserSeems like we could use a cookbook for idioms and functions...
01:30zkimDanielGlauser: yeah that would be really nice
01:30zkimDanielGlauser: maybe a future clojuredocs feature
01:40DeranderDanielGlauser: it would be really really nice
02:07defnwow. strange loop was awesome.
02:08defnbrian marick's TDD talk on clojure was cool, the cascalog talk was awesome, jim duey's conduit was really cool
02:10zkimdefn: Yeah, was following the tweets, sounded like a great conf
02:10defnchouser's talk was awesome as well
02:10zkimdefn: which testing lib did marick use?
02:10defnhe wrote his own: midje
02:10defnif you use emacs lisp, check it out
02:10defnerr emacs
02:11zkimdefn: they gonna post any slides / videos?
02:11defnit was a pretty inexpensive ticket zkim
02:11defnso they only recorded some of it
02:11zkimah
02:12defnthere's some /amazing/ stuff
02:12defna panel with alex payne, joshua bloch, douglas crockford, guy steele, and im forgetting the other guy
02:12defnabout the future of programming languages
02:12zkimawesome
02:13defndouglas crockford's talk was hillarious at times, and deadly inspiring at others
02:13defnthe nosql panel is also i think a must watch
02:13defnlots of pearls of wisdom there -- i have a lot of notes i need to convert to blog posts over the coming weeks
02:13defn@devn if you wanna know about them
02:14zkimyeah i'll check that out
02:15zkimhah 100k LOC for the mysql query parser
02:16tufflaxWhat's happening here?
02:16tufflax,(reduce #'and [true false])
02:16clojurebottrue
02:18defnzkim: yeah pretty amazing huh
02:19defnzkim: they were talking about how nosql databases have like...30k LoC for the entire package
02:19hiredmantufflax: and is not a function
02:20tufflaxSo why does it let me use it like that?
02:20hiredmanbecause you are using the var #'
02:20hiredmanclojure is not common lisp
02:20hiredman,(reduce + (range 10))
02:20clojurebot45
02:20hiredmanno #'
02:21zkim,(apply #'and [true false])
02:21clojurebottrue
02:22hiredman,(macroexpand '#'and)
02:22clojurebot(var and)
02:22hiredmanif you want to know what means read the docs
02:23shachafWait, Clojure is a Lisp_2?
02:23hiredmanno
02:23hiredmanlisp 1
02:23shachafOh.
02:23shachafAh, I didn't read up far enough.
02:24shachafzkim: Is that just the query parser or the optimizer too?
02:24zkimyou mean hiredman?
02:25shachaf23:14 < zkim> hah 100k LOC for the mysql query parser
02:25zkimah
02:25zkimone sec
02:25zkimhttp://twitter.com/#!/devn/status/27459419878
02:25zkimlooks like just the parser
02:26zkimcrazy
02:27tufflaxThanks hiredman, I'm gonna have to read more about clojure. For now my question is why doesn't reduce, apply, map, etc. allow macros as their first argument?
02:27tufflaxdon't*
02:28hiredmantufflax: because reduce is a function
02:28shachaftufflax: How would that work?
02:28hiredmanfunction application happens at run time
02:28tufflaxshachaf hehe I'm not sure...
02:28hiredmanmacro expansion happens before compile time
02:29tufflaxAh, yes, ok... thank you again.
03:05Deranderif I want to build a regex dynamically, how do I do this?
03:05Derander,(macroexpand #"")
03:05clojurebot#""
03:06DeranderI can't just do #(str "foo" var) because then it gets all functiony on me
03:07Deranderre-pattern!
03:31Raynes-> (class #"")
03:31sexpbot⟹ java.util.regex.Pattern
03:31Raynes-> (re-pattern "")
03:31sexpbot⟹ #""
03:31Raynes-> (class re-pattern "")
03:31sexpbotjava.lang.IllegalArgumentException: Wrong number of args (2) passed to: core$class
03:31Raynes-> (class (re-pattern ""))
03:31sexpbot⟹ java.util.regex.Pattern
03:32RaynesDerander: re-pattern
03:32Deranderyeah, I dug it up finally :-)
03:32Deranderthank you though
03:32DeranderI think what I really need to be using is an html/xml parsing library, though
03:44kmc#"" is a reader macro for regex literals?
03:49G0SUBkmc: yes.
03:50G0SUBkmc: #"[a-zA-Z0-9]+"
06:26fhdHi. What's the best way to convert a struct to a map?
07:07raekfhd: a struct is a map
07:08raekyou can always assoc on other keys than the special keys
07:10raekbut to get a map of another type (hash-map, sorted-map, struct, record), you can use into
07:11raek,(let [m (into {} (sorted-map :a 1, :b 2, :c 3))] [(class m) m])
07:11clojurebot[clojure.lang.PersistentArrayMap {:a 1, :b 2, :c 3}]
07:11raek,(let [m (into (hash-map) (sorted-map :a 1, :b 2, :c 3))] [(class m) m])
07:11clojurebot[clojure.lang.PersistentArrayMap {:a 1, :b 2, :c 3}]
07:12raekhrm, yeah. small hash-maps use the array-map implementation...
07:18fhdraek: I see, thanks :) I actually tried that, but there was another issue so I misinterpreted the exception :(
07:21fhdWhat's the most common name to name a Clojure port of a library x? clojure-x, clj-x, x-clojure, x-clj or make something up that starts with "clo" like clox?
07:21fhdLooking at clojars.org, it seems to be clojure-x
07:23jaleyhey guys - is it possible/easy to pass a collection to a function as its argument list vector without a macro? i.e. the same effect as an unquote splice.
07:24jaleyfor context, i want to pass an argument list to shell/sh
07:25carkh,(apply + [1 2 3])
07:25clojurebot6
07:26jaleybut won't that call + multiple times?
07:26G0SUBcarkh: use reduce instead.
07:26jaleysh has side effects - it calls the command i'm passing it
07:26carkhnope
07:26G0SUBcarkh: better perf.
07:26jaleyah ok, cool thanks
07:26carkhG0SUB: i was answering jaley's question
07:26G0SUBjaley: (reduce + [1 2 3])
07:27carkhreduce will call + several times
07:27G0SUBcarkh: sure. apply it is then.
07:27G0SUBcarkh: take a look at the definition of the + function.
07:27jaleyG0SUB: carkh: yeah got it, thanks guys
07:27carkhwell yeah it depends on the function you call =P
07:27carkhbuit it's not a property of apply to do so
07:27G0SUBcarkh: :)
07:28G0SUBcarkh: my statements are only valid for the combined usage of apply and +.
07:28carkhright
07:28carkhbut (+ 1 2 3 4 5 6) does call + several times
07:28carkhand there's no apply
07:28G0SUBcarkh: precisely.
07:28carkhi can nitpick too !
07:29G0SUBcarkh: you are right!
07:29carkh=)
08:01raichooHi, is there a good pdf on clojure you guys can recommend?
08:06lypanovraichoo: i love joy of clojure.
08:06raichoohuh?
08:06lypanovbut not free. dunno any good free ones. plenty of presentations tho
08:07lypanovthe first chapter of the various ebooks is usually available for free.
08:07raichooah ok. ^^. I'm actually just searching for an offline reference to peek a little into the language.
08:07lypanovfor device good at pdfs?
08:08lypanovif not, i'd say just wget the site or gen the documentation yourself.
08:08AWizzArdraichoo: you can download the manual (html) and code for offline fun.
08:08lypanovclojuredocs.org is great
08:10lypanovanyone bored, please upvote http://clojuredocs.uservoice.com/forums/64757-general/suggestions/896859-provide-a-way-to-create-and-be-able-to-synchronis?ref=title
08:11raichooUsually I don't need offline references, but my new apartment still lacks an internet connection :/
08:11fhdI'm still not sure what to call my Clojure mustache library: clojure-mustache, clj-mustache or clostache? What'd you suggest?
08:11lypanovyay!
08:11lypanovfhd: library-lypanov-needed
08:11fhdlypanov: :P
08:11lypanovclostache is cute
08:12fhdHm, I like it too. Not sure if it sounds silly :P
08:13lypanovtache is british slang for mustache... so yeah.. to me sounds completely normal
08:13fhdCool, then I'll take it :)
08:14fhdlypanov: Do you still need the lib? I'm finished with version 0.1, although it doesn't support all of mustache
08:14fhdlypanov: I'm ATM in the middle of extracting it from my project
08:16raekfhd: fyi, there is a pretty widely known Clojure web lib called "Moustache", so I would vote for the "clostache" name. also, it sounds funnier. :)
08:17fhdraek: Yeah that's true, the moustache lib got my hopes up that I wouldn't have to do this :)
08:17clojurebotlibraries is http://clojure.org/libraries
08:17lypanovfhd: ditto :(
08:18raekwhat is mustache for, btw?
08:18fhdraek: It's a template language
08:18lypanovlike enlive but super simple
08:18fhdhttp://mustache.github.org
08:19fhdI wanted to use the mustache.java, a Java library, but it made me sick :P
08:19lypanov;) its pretty neat tho
08:19raekneat.
08:19lypanovi'd love something like that but in clojure
08:20raichooI just downloaded the wiki, seems like a good start to dive into the language :)
08:20raichoowell actually just one page.
08:21raeksome parts of the wikibook is somewhat outdated
08:22raekoutdated, as in "out of fassion, due to recent additions", rather than "not working"
08:23raichooI just need a little bit to get a hold of the way of thinking in clojure. I'm learning way to many languages this year anyway. As long as it covers the basics I'm happy ^^
08:25jaleyshould i need to add leiningen as a dependency in my project if I want to use some functions in leiningen.compile? the guidance for making plugins says not, but the jar is definitely not on my classpath :-s
08:26raekhrm, ok. the wikibook seems to have been updated with links to the newer getting-started pages
08:26raekwow. there's really *a lot* of text about the basics...
08:28raekjaley: plugins are ran in the lein clojure instance, which already has all the lein things on the classpath
08:28raekto access lein code in the project clojure instance, you'd have to add a dependency
08:30raekI haven't tried this, but I guess you could add [leiningen "1.3.1"] as a dep
08:31raekjaley: and the things your code does cannot be made as a leinginen plugin?
08:31raek(you don't need to make a separate project for the plugin. a file in src/leiningen/my_plugin.clj is sufficient.)
08:34jaleyraek: my code is a leiningen plug-in, and it is within an existing project
08:35jaleyraek: but it might be useful to others... so when (if..) it works i'll break it out to a seperate project and stick it on clojars probably
08:35raekthen you should be able to run it with "lein my-plugin"
08:36jaleyraek: the problem isn't running it actually, it's that i want to launch a sub-process with the project classpath settings
08:36jaleyraek: leiningen.compile has a function, eval-in-project, which looks like it might work
08:37raekthe lein swank plugin does something like that
08:37raekand lein repl, of course
08:37jaleyraek: yeah it uses eval-in-project, that was hour i found it actually :)
08:38jaleyraek: my problem is (use leiningen.compile) fails, no such class ...__init
08:38jaleyraek: and i'm wondering if to fix that i have to ignore the advice about not marking leiningen as a dependency
08:39raekjaley: (use 'leiningen.compile)
08:39raekoh, but you shouldn't get the "no such class ...__init" error for that...
08:39jaleyraek: sorry, that was a typing error
08:40jaleyraek: it actually looks like (ns leiningen.axis (:use [leiningen.classpath :only [get-classpath]]))
08:41jaleyraek: same error as with compile, i mean
08:41jaleyraek: pretty sure this is what happens when the jar isn't on the classpath, right?
08:42raekyes, that error looks like a classpath error or a spelling error
08:42jaleyhmm ok, i'll try adding it to dev-dependencies and see what happens
08:44raekjaley: http://gist.github.com/629745 this works for me
08:44raekno extras in project.clj
08:44raekalso, there is a compile var in clojure.core, so you might want to require it or use+rename it instead
08:45raekit = leinginen.compile/compile
08:45raeklein foo => hello
08:45jaleyit's leiningen.compile/eval-in-project i'm after
08:46raekoh. right.
08:47jaleyyeah I pasted your gist into my repl and got the same error
08:47raekyou cannot run it from the repl
08:47raekit is meant to be ran from "lein ..."
08:47raeksince leiningen and you project might run on different clojure versions
08:49raeksorry, maybe I misunderstood the issue. you could try adding lein as a dependency and that should probably work
08:49AWizzArdWhen I have an EPL source, then I can not use GPL libs in it, cause EPL forces me to keep derivative work under the EPL, while GPL says it must be GPL. But is the other direction possible? When I have a GPLed program, can I then include EPLed code in it, for example linking libs like Clojure?
08:49raekbut it isn't the way you usually make a lein plugin
08:50jaleyraek: ah right. so I can't really develop a leiningen plug-in with swank easily?
08:51raekAWizzArd: GPL basically says that a project is a derivative work if it includes the GPL:ed code in the program code (including, using a GPL:ed library)
08:51raekand derivative works has to be under GPL, or something GPL-compatible
08:52carkhi thinkk the other way around is ok
08:52raekEPL says that a program that merely uses a EPL library is not derivative work of it
08:52AWizzArdYes.
08:52AWizzArdSo, using GPL stuff in my EPL code is no option.
08:52carkhso you can make a gpl program using clojure
08:52AWizzArdThis is the point, that carkh mentions.
08:53raekso EPL code + GPL code is not possible, because of GPL's definition of derivative work
08:53AWizzArdright
08:53AWizzArdI agree with this.
08:53raekif I have understood this correctly
08:53carkhand yes, you cannot make an EPL program using GNU readline
08:53AWizzArdBut GPL linking in EPL sounds okay.
08:53AWizzArdcarkh: clisp :-)
08:53carkh=)
08:54raekGPL does not treat linking and modifications as separate things
08:54raekbut the LGPL does
08:54AWizzArdAnd what is the difference between LGPL and the OpenJDK’s GPL+Linking Excetpion?
08:55raekI'm not aware of the latter
08:55AWizzArdThe OpenJDK is GPLed, but it makes a linking exception. That is, programs that you wrote using the OpenJDK can be licenced as you wish, I think.
08:56G0SUBAWizzArd: basically it's an exception which applies to linked .class files.
08:56G0SUBAWizzArd: so using external java libs is OK.
08:56raekthat sounds very much like the goal of LGPL
08:56G0SUBraek: yes, but made clearer in the context of java code.
08:56AWizzArdFunny that software experts today also need to be specialists in law :-)
08:57G0SUBthere are many such exceptions, font exceptions are an example.
08:57carkhthanks to dear gpl =/
08:57AWizzArdOr Open Office dictionary files, which are GPL and not distributed with OO. One manually has to download them.
08:58AWizzArdG0SUB: oh really, nice.
08:58G0SUBpeople fail to understand the importance of GPL... they think it's a virus.
08:59carkhG0SUB: so do you still support the FSF views ? (everything should be gpl)
08:59carkhit was important to get the open source movement started i think
08:59AWizzArdEPL also survives.
08:59carkhbut gpl is so restrictive =/
08:59AWizzArdIt does not infect other modules, but won't die.
08:59G0SUBcarkh: they have a strict stance because they have to.
08:59carkhand finally profiting mainly to big corporations
09:00G0SUBwhy on earth did Linux (the kernel) succeed when it was far inferior to *BSD back in the day?
09:00G0SUBwhy does Linux (the kernel) have so many awesome drivers?
09:00carkhwhy ?
09:00lypanovpragmatism
09:01fhdlypanov: I second that :)
09:01carkhwasn't it because it was selected as a base to the GNU ?
09:01G0SUBcarkh: because many big corps (who otherwise would have leeched off linux) were forced to contribute their fixes back to linux.
09:01raekG0SUB: so, what holds about GPL + EPL? is it always impossible?
09:01lypanovit was just hard work on the part of the linux devels. nothing else.
09:01G0SUBcarkh: not at all. there was no such official decision.
09:01fhdPragmatism is pretty much the reason why Linux succeeded and Hurd is being rewritten again right now
09:02G0SUBfhd: it's linux vs freebsd not hurd
09:02fhdG0SUB: Yeah, but I had to mention Hurd today :)
09:02G0SUBfhd: heh.
09:02lypanovfhd: the hurd guys don't have time to code, they have to prune their beards.
09:02fhdG0SUB: Nah, I actually saw it as Linux VS GNU while idling
09:02tensorpuddingFreeBSD and NetBSD had to be practically rewritten at the same time that Linux was getting popular
09:02carkhas a programmer (small freelance) i can't see how i would survive in a fully GPL world
09:03G0SUBfhd: rms has given up on hurd now and I agree with the decision.
09:03G0SUBcarkh: you don't have to. just thank $deity that GPL is an option.
09:03AWizzArdG0SUB: so, what if I have a GPL program and want to use clojure.jar in it? Is this allowed?
09:03G0SUBcarkh: don't use GPL if you don't like it, just don't spread the FUD.
09:04fhdFunny that you guys are discussing this right now, I was just wondering which license would be most appropriate for a Clojure lib. I usually go with LGPL
09:04carkhwell i do thank deity that GPL exists, as i said it was instrumental
09:04lypanovfhd: net bsd every time.
09:04lypanovnew* sorry
09:04lypanov(or better dual it)
09:05carkhi think rhickey made a very good decision going with EPL
09:05lpetitfhd: clojure's world is EPL's world :)
09:05lypanovthank $deity for clang and the death of gcc
09:05G0SUBAWizzArd: EPL would allow that.
09:05fhdcarkh: http://github.com/clojure/clojure says its ASM
09:06AWizzArdYes. The EPL seems to have no problems in being linked into a GPL projekt. So, from that perspective it sounds as if I may write GPLed clojure programs.
09:06lypanovfhd: it uses ASM
09:06G0SUBlypanov: I wouldn't say that. clang is owned by AAPL.
09:06lypanovoh get lost
09:06AWizzArdBut I am not sure if there is something in the GPL that stops me from using clojure.jar and thus stop me from doing GPL clojure software.
09:07G0SUBlypanov: feel free...
09:07lypanovfreaking bearded idiots.
09:07G0SUBlypanov: I just have a moustache.
09:08G0SUBwhen rms wrote about the Java Trap a few years back, people laughed at him. today all Java programmers are crapping their pants.
09:08carkhhum no
09:08G0SUBAWizzArd: please email licensing@fsf.org with your query. the fsf will answer.
09:08lypanovAWizzArd: i'd limit to apps if you use gpl.
09:08fhdlypanov: Beards are pretty essential actually http://bit.ly/3NwOp
09:09G0SUBfhd: in that case, rhickey needs to grow one (granted that he has some nice hairstyle)
09:09lypanovfhd: love this one.
09:09AWizzArdG0SUB: okay
09:09lypanovfhd: especially matz who grew a beard at one point :D
09:10AWizzArdlypanov: what do you mean by that?
09:11lypanovAWizzArd: unless there is a good reason i'd go with something more bsd like for libraries in general
09:11fhdG0SUB: The beard of the inventor of Lisp was so vast that Clojure probably inherited lots of positive energy http://bit.ly/9tL2B6
09:11G0SUBfhd: +1
09:11lypanovplenty of companies obviously can't touch gpl'ed code
09:11AWizzArdlypanov: I will EPL my Clojure libs. But I would like to know if it was possible in principle.
09:11G0SUBAWizzArd: see, it all depends on your lib.
09:12AWizzArdIF someone asks me about a GPL licence of my lib, I might do this.
09:12lypanovnothing wrong with dual licensing epl and gpl afaiu
09:12G0SUBAWizzArd: if you want widespread adoption and don't want to benefit directly from the code (but mostly from services, fame, etc.) use a very permissive license.
09:12lypanov(i'm very pro that)
09:12G0SUBAWizzArd: on the other hand, if you are creating something big and you want outside cooperation, use GPL.
09:13AWizzArdYes.
09:13carkhwell clojure has plenty cooperation with epl
09:13carkheclipse does too =)
09:13AWizzArdGit and Mercurial are GPL. Seems okay. Though it is not clear to me how there can be a java implementation of Git *not* being gpl.
09:13G0SUBcarkh: cooperation from companies?
09:13AWizzArdBut most programming language implementations are not GPL.
09:13carkhwell eclipse does yes
09:14G0SUBcarkh: who would otherwise, steal, modify and ship?
09:14G0SUBAWizzArd: languages, standards, need not be gpl. simple BSD works too.
09:14carkhyou can't steal modify ship epl
09:14AWizzArdYeah, though most have something different than bsd.
09:18raekAWizzArd: I remember that I have seen rhickey talking about Clojure and GPL in the Clojure logs (http://clojure-log.n01se.net/)
09:18G0SUBcarkh: does EPL mention anything about derivative works? (I can't remember)
09:18AWizzArdderivative works need to be EPLed
09:18AWizzArdThe definition of what is “derivative” is different though.
09:18AWizzArdLinking/Using EPLed libs is not derivative.
09:19G0SUBAWizzArd: that's a form of ``weak copyleft''.
09:19AWizzArdYes.
09:19G0SUBAWizzArd: which is OK for Clojure.
09:19raekG0SUB: the EPL does. it excplicitly says that it doesn't consider mere linking with code as derivative work
09:19raek*looks for link*
09:20AWizzArdBtw, does "linking" also include: creating an Überjar?
09:20raekhttp://www.eclipse.org/legal/eplfaq.php#DERIV
09:20raek"Some open source software communities specify what they mean by a "derivative work". Does the Eclipse Foundation have a position on this?"
09:20AWizzArdFor example, may I include clojure.jar in my commercialXYZ.jar?
09:20AWizzArdOr is that not linking and thus forces me to EPL my code?
09:20G0SUBAWizzArd: as long as you tell people how to get the source of clojure.jar
09:21carkhAWizzArd: well that's the kind of linking that doesn't infect your code
09:21raekfrom the EPL itself: "Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program."
09:21AWizzArdOne other option would be to *not* include clojure.jar in my source code and have it in the CP at my customer’s site.
09:21carkhAWizzArd: you don't need to do that
09:21AWizzArdok
09:23G0SUBbottom-line, EPL for Clojure the language is OK. If you are building FOSS apps using Clojure, choose the license that suites you. EPL doesn't restrict you as long as you are not modifying clojure itself.
09:23AWizzArdRight.
09:23AWizzArdEven *if* I would modify clojure itself, I would only have to EPL those concrete changes.
09:24G0SUBAWizzArd: yes.
09:24AWizzArdThe rest of my code can still be under licence XYZ.
09:24raekenough about licenses for me. time to write some code! :-)
09:24fhdSo a Clojure lib under LGPL is fine?
09:24fhdraek: Sorry :P
09:24G0SUBfhd: I guess so.
09:25fhdk. It's pretty permissive, but IANAL
09:25G0SUBfhd: to be 100% sure, email licensing@fsf.org
09:25jaleyfhd: dude i work for an open source foundation - we're told including LGPL code with our otherwise EPL codebase is fine by our legal team. maybe that helps you? :p
09:25G0SUBjaley: +1
09:25fhdjaley: Does :)
09:26fhdI just don't want people having to consult a lawyer if they want to use my code
09:26G0SUBfhd: don't worry too much. most of it is FUD anyway.
09:27jaleyfhd: people with enough money to do that will do so anyway for fear of losing it :)
09:52jaleywhen i run a java process from clojure.java.shell/sh there's a huuuuge delay in waiting for the process to terminate for some reason
10:01carkhjaley: maybe you have soem agetn still running ?
10:01carkhor a daemon thread ?
10:10fhdDo you guys know Polyglot Maven btw? I can't wait for it :) http://polyglot.sonatype.org/clojure.html
10:11jaleycarkh: well, i'm just calling the function, but maybe there is somewhere
10:22BahmanHi all!
10:51lypanovfhd: ah, neat.
10:51lypanovfhd: (polyglot maven)
10:54cemerickfhd: yup, it's been percolating for a year or so.
11:14KLKLLI have a question
11:15KLKLLif I do something like
11:15KLKLL(defn somefn [xlist] (fn [t] (nth xlist t)))
11:16KLKLLdoes the list I supply as a parameter get inserted into the returned function as an actual data structure?
11:16cemerickyup
11:16KLKLLso if I have a list 1 million elements long
11:16KLKLLI get a really longass fn
11:17cemericka reference to the list is retained...it's not literally inserted
11:17cemerickmight as well just do (partial nth xlist) though
11:17KLKLL,(doc partial)
11:17clojurebot"([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & more]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."
11:17KLKLLis partial any different to what I am doing
11:17Raynes-> ((partial + 3) 4)
11:17sexpbot⟹ 7
11:18cemerickno, but it's more general and simpler than having your dedicated somefn function
11:18KLKLLright...ok so a reference is passed in?
11:18RaynesUnless you're using somefn in several places, anyway.
11:19cemerickKLKLL: Yes.
11:19KLKLLI'm asking like if I am using partial with a really long list to create new fns am I burning memory like nuts with it?
11:19cemerickif the list is already allocated, no
11:20KLKLLcool
11:20cemerick,((partial nth (range Integer/MAX_VALUE)) 5000)
11:20clojurebot5000
11:20KLKLLI thought clojure actually copied the list into the returned fn as a data structure so I was worried :)
11:21cemerickThat would require a macro
11:24KLKLLI'm trying to make a repeat function but one that takes multiple arguments :)
11:25tomojwhat does it do, cycle through infinitely?
11:25KLKLLyep
11:25tomojdon't want to spoil your fun
11:26tomoj,(take 10 (cycle [1 2 3]))
11:26clojurebot(1 2 3 1 2 3 1 2 3 1)
11:26KLKLLok :)
11:26KLKLLwell I'm learning clojure :)
11:26tomojeven if that does what you want, still probably good to try to rewrite it yourself
11:26KLKLLso I have to do these little things
11:27KLKLLso basically I have to use a vector to prevent having terrible performance on nth
11:27cemericklists are very rarely used
11:27cemerickand nth is unnecessary with vectors
11:27KLKLLreally?
11:28KLKLLwhat do you use with vectors
11:28cemerick,([1 2 3] 1)
11:28clojurebot2
11:28KLKLLok
11:28KLKLLthx
11:28cemerickVectors are fns of their indexes.
11:28KLKLLforgot about that
11:28cemerickJust like maps are fns of their keys
11:28KLKLLbut what do I do if I have this param list
11:28KLKLL[x & others]
11:29KLKLLothers is a sequence I think
11:29cemerick`others` is a seq, yes
11:29KLKLLwhich probably have terrible performance on nth
11:29KLKLLso I have to convert it to vector I guess
11:29cemerickif what you want from it is in a fixed position, just destructure it
11:29cemerick[x & [a b c & rest]]
11:30KLKLLisn't descturcturing slow too?
11:30cemericknah
11:30KLKLLbtw it's funny how java varargs are packed into a fast structure like an array
11:30lpetitdid the policy of the n01se.net clojure logs change recently ?
11:30lpetitI cannot get access to past days logs anymore ...
11:30cemerickThere are *very* limited circumstances where destructuring is the bottleneck. It's not worth worrying about.
11:31cemericklpetit: ping chouser, I'm sure it's a bug
11:32lpetitcemerick: ok. Is yesterday's chat concerning defdynamic summarizable in one or two sentences ?
11:35KLKLL,(vec (seq '(1 2 3)))
11:35clojurebot[1 2 3]
11:35KLKLLok that works
11:35cemericklpetit: def becomes static by default, dynamic rebinding only provided by defdynamic vars, scoped var root substitution available and complete redefinition still available.
11:35cemerick,(vec '(1 2 3))
11:35clojurebot[1 2 3]
11:35KLKLLI was trying to see if it works with sequences
11:35cemerickah
11:35KLKLLnot just lists
11:36KLKLLthis clojure cheat sheet has it wrong then
11:36G0SUBis there any decent explanation of Pods somewhere in the tubes?
11:36cemericklink?
11:36clojurebotyour link is dead
11:36KLKLLvec [coll] Creates new vector from another collection.
11:36lpetit"scoped var root substitution available" : this part I missed. Don't totally understand what it is.
11:36KLKLLclrearly it works with seq too
11:36lpetitis it for defdynamic only ?
11:37KLKLLhttp://faustus.webatu.com/clj-quick-ref.html#vector
11:37cemerickKLKLL: "collection" and "seq" are often interchangeable terms.
11:37cemerickAt least in common parlance.
11:38RaynesAnd a list actually is a sequence.
11:38lpetitDoes this change mean that trying to do "AOP-like" stuff (e.g. dynamically enhancing some vars for timing stats & al will become harder ?)
11:38KLKLLI know list is a sequence
11:38cemericklpetit: AFAICT, think of it as alter-var-root that is reverted outside of a delimited scope. with-open-esque
11:38KLKLLbut sequence does not implement all functionality of a collection
11:39KLKLLhence my assumption that is function works with collections that it doesn't work with sequences
11:39cemerickKLKLL: seqs *are* collections
11:39KLKLLreally?
11:39lpetitcemerick: hmm, okay ... will need to read that confluence page again ... thanks!
11:40cemerick,(instance? clojure.lang.IPersistentCollection (seq [1 2 3]))
11:40clojurebottrue
11:40KLKLLok got that wrong then
11:40KLKLLthanks for clearing that up for me
11:41cemericklpetit: timing stats and such should be done with the JVM profiler, not through providing advice.
11:41lpetitcemerick: heh, was just a quick example out of my head
11:41cemerickI know :-)
11:42cemerickI actually don't think dynamically-bound vars have very many good use cases.
11:42technomancyseems like with-var-root covers most of the extensibility jobs that binding has handled so far.
11:42lpetitbut I can see plenty of reasons why doing AOP-like stuff by rebinding vars can lead to problems in big projects, though
11:42aavlpetit
11:43lpetitaav: aav
11:43lpetit:)
11:43cemerickI suspect the first utility to come around will be a fn that will redef all static vars as dynamic ones.
11:43technomancyfor the record, everyone going to conj should install http://github.com/toolmantim/bananajour in case the network gets choppy.
11:43lpetitbananajour ?
11:43technomancycemerick: heh; well if it's anything like static fns that will also necessitate a recompile of all code that uses the var, so I don't think it'd be that simple. =\
11:44technomancylpetit: for publishing and broadcasting your local git repos over bonjour/zeroconf
11:44technomancyso you don't have to rely on an external network
11:44cemericktechnomancy: source metadata! :-P
11:44KLKLLwhat's the difference between dynamic and static bound vars?
11:44KLKLLbtw finished my function :P
11:44technomancycemerick: you mean like serializable-fn?
11:45cemerickKLKLL: that's crazy bleeding-edge dev -- don't worry about it yet :-)
11:45technomancyI would love to see that in Clojure itself as an optional feature
11:46technomancyhttp://github.com/Seajure/serializable-fn
11:46lpetitcemerick, technomancy: maybe not source metadata on fns, but at least on vars (at least)
11:46cemericktechnomancy: nah, just reloading defs as necessary from source as necessary via :file and :line metadata.
11:46cemerick*way* too much work, and it probably wouldn't pan out anyway
11:46lpetit:)
11:46technomancyslime already has a "who-calls" function, but it's naieve
11:47technomancy*swank
11:47dentradoHello. If I have multiple threads that should write messages to the same output streams (that are values in a map), what's the best way to make shure that their output won't be mixed. Could I commute the writes if the map is in a ref? or can I do something equivalent to javas synchronized block?
11:47technomancydentrado: you can serialize writes through an agent
11:48cemerickdentrado: `locking` will do you nicely
11:48technomancy(let [a (agent (writer "/tmp/foo"))] (future (send a #(do (.write % "blah blah blah") %))))
11:48cemerickI dislike lifting IO into agents. The error handling isn't fun.
11:49technomancytrue
11:49KLKLL,(defn repeat2 [& coll] ((fn rep2 [n vect] (lazy-seq (cons (vect n) (if (= (inc n) (count vect)) (rep2 0 vect) (rep2 (inc n) vect))))) 0 (vec coll)))
11:49clojurebotDENIED
11:49KLKLLoh lol can't do that :P
11:49technomancyI haven't looked into the improved error queues in 1.2 though
11:49lpetittechnomancy: noob question ('cause I'm not so much used to attend confs) = where/when would the feature of sharing a local git repo be interesting ? I need to understand the "use cases" (sorry ;) )
11:49cemerickhrm, same here
11:49cemerickRegardless, if you want to serialize access to something like a stream, locking is hard to beat.
11:49technomancylpetit: at bigger confs the wifi is often pretty unusable due to saturation
11:50technomancyso if you want to share without being able to push/pull from github for conference hackfests this is quite handy.
11:50KLKLLdoesn't let me showcase my beautiful new repeat function :( :D
11:50technomancymaybe it won't be an issue at the conj; it's pretty small.
11:50cemerickIf we can get people to shut off their phone wifi, I think we'll be OK.
11:50lpetittechnomancy: ok, but I don't see why I would miss wifi, or how a github repo in an adhoc wifi of one of my mate will make me suffer less to not have wifi :)
11:50dentradoOk so locking is like synchronized?
11:51cemerickdentrado: exactly the same thing
11:51technomancylpetit: err--I should say it's not the wifi that's saturated but rather the upstream Internet connection.
11:51lpetitmm, it's probably the notion of "hackfest" that I don't get yet :)
11:51KLKLLsynchronized ties a lock to an object
11:51KLKLLa monitor basically
11:52cemerickdentrado: to be used with judicious caution. Serializing access to streams is the only reliable use case I have for it.
11:52technomancylpetit: I'm going to have a bonjour git URL in my slides so people can try the stuff I'm demoing on their own machine and see how it's implemented.
11:52KLKLLI did a paper on STM for my bachelor's degree
11:52technomancylpetit: but yeah, half the fun of a conference like this is getting together and banging out some code.
11:52KLKLLalso covered problems with locks :P
11:52cemerickKLKLL: you're in the right place, then :-)
11:53KLKLL:D
11:53KLKLLthere's a bunch of otehr STMs too :D
11:53technomancycemerick: are there any tools to serve maven repos over bonjour?
11:53cemerickMan, I've never once written a single line of code at a conf.
11:53lpetittechnomancy: interesting. So if my english is too slooow, people can always play with my repo while I'm searching the words for my next sentence :-D
11:53cemericktechnomancy: I have no idea.
11:53KLKLLevery major player's research team has one
11:53lpetittechnomancy: half the fun of this conference (for me) will be to survive to it :)
11:53KLKLLintel, microsoft, sun have their own STms
11:54technomancyactually... I looked into it, and there's not really a good zeroconf implementation on the JVM =\
11:54cemerickKLKLL: sure, but I don't care about other impls that much ;-)
11:54KLKLL:D
11:54technomancylast I checked anyway. shame since it'd be very useful on dalvik.
11:54lpetitand try not to sleep during my own talk, since my body will tell me "hey, it's past midnight, you should be sleeping" :)
11:55technomancythough activeMQ claims to be able to use it.
11:55cemerick"dalvik is not Java" :-P
11:55dentradoOk, thanks alot for the quick help, I will try with locking then.
11:56KLKLL(main problem with locking is that it doesn't compose
11:56_ulisesafternoon all
11:56KLKLLso you can't build a nice airtight system from bottom up
11:57technomancyhm; this looks new: http://jmdns.sourceforge.net/
11:58technomancyweeee; SVN!
11:58RaynesCould be worse. Could be CVS.
11:59technomancyRaynes: actually... it's the best of both worlds!
11:59technomancySVN with a CVSROOT directory checked in
11:59jaleymy axis plugin for lein totally works! i've stuck it on github, so if anyone needs soap in a clojure project soon, it might save a bit of time :p
11:59RaynesOh boy.
11:59Raynesjaley: Awesome! Now port it to cake. :>
12:00jaleyRaynes: meh. later :p
12:02KLKLLstrings behave like which coll?
12:03RaynesStrings are Java strings.
12:03Raynes-> (class "")
12:03sexpbot⟹ java.lang.String
12:03KruppeCan anyone help me understand why this doesn't work: http://paste.lisp.org/+2H77
12:03KLKLL,(count "fafaf")
12:03clojurebot5
12:03technomancyKLKLL: seq on a string is just a bunch of characters
12:05KLKLLsomehow I think that functions like count use a lot of reflection
12:06KLKLL(.length() "ff")
12:06KLKLL,(.length() "ff")
12:06clojurebotjava.lang.IllegalArgumentException: No matching method found: length for class clojure.lang.PersistentList$EmptyList
12:06Raynes,(.length "ff")
12:06clojurebot2
12:06KLKLLyeah
12:06KLKLLfricking typo
12:07KLKLLI work with java :(
12:07KLKLLmind-numbing let me tell you
12:10KLKLLwell I have to go... kids, don't get a job programming java, if you have any sort of talent it will drive you insane
12:11jaleyis ["clojars" "http://clojars.org/repo&quot;] one of the default repos in leiningen? no need to add it?
12:13technomancyjaley: no need
12:14jaleytechnomancy: ok thanks. seems version 0.6 of lein-clojars is not where the documentation claims, in that case
12:15technomancyjaley: that plugin is deprecated since there's no comprehensive SCP support for the JVM
12:15technomancyin particular it doesn't work with DSA keys; IME it's less failure-prone just to perform the scp manually.
12:15jaleytechnomancy: oh. what's the alternative? the "long way"?
12:15technomancylein pom && lein jar && scp pom.xml *jar clojars@clojars.org: # still a one-liner, kinda
12:16cemerickrhickey: am I right in thinking that Util.ret1 exist to allow one to release references to heads of lazy seqs?
12:16technomancyI haven't tried it in nearly a year, maybe it's better now.
12:16Raynestechnomancy: Cake has a release task built in. Not sure how it's accomplished though.
12:16technomancyRaynes: it probably doesn't work with DSA keys
12:16Raynestechnomancy: ninjudd uses a DSA key.
12:17jaleytechnomancy: it's a 1 liner in a 3 lined kind of sense :) thanks for the help, i'll do that instead
12:17technomancyI guess it just shells out then
12:17cemericktechnomancy: jsch is *very* comprehensive
12:17cemerickThe API is *horrible*, but it gets the job done.
12:17Raynestechnomancy: I don't think it does.
12:18technomancycemerick: this is just heresay, but that's what the author of the plugin told me when I reported it to him.
12:18ninjuddyeah, i use JSch. there is no documentation so it was a pain to figure it out
12:18ninjuddbut it works with DSA keys
12:18technomancyok, I've been misinformed
12:19cemericktechnomancy: hugod wrote clj-ssh, which wraps it
12:19technomancyand is probably better-documented; nice.
12:19ninjuddtechnomancy: i wouldn't be opposed to factoring the ssh code out into a clj-ssh library if you want to use it
12:19ninjuddoh
12:19ninjuddhehe
12:20technomancyninjudd: appreciate the thought. =)
12:20ninjuddusing that would have saved me some time ;)
12:21shanmuHi, is there a library/contrib to generate xml in clojure
12:21shanmusomewhat like prxml but generating into a string instead
12:21cemerickAll the code you've ever needed has already been written; it's just a matter of finding it. :-)
12:21shanmuor into the xml/parse tree structure
12:21Raynes-> (doc with-out-str)
12:21sexpbot⟹ "Macro ([& body]); Evaluates exprs in a context in which *out* is bound to a fresh StringWriter. Returns the string created by any nested printing calls."
12:22shanmuRaynes: thanks!
12:22Raynes-> (with-out-str (println "blah"))
12:22sexpbot⟹ "blah\n"
12:23shanmucemerick: I was considering using a version of prxml in which print is redfined to put into a global string
12:23shanmubut it seemed a bad idea
12:23ninjuddcemerick: i thought i had found it by using JSch!
12:23cemerickshanmu: yeah, raynes is spot on with with-out-str
12:25shanmucemerick: yes, thats the beauty of the community - I still a clojure n00b that I have not yet dipped into macros at all and not yet learned to navigate the clojuredocs completely
12:27ninjuddlooks like clj-ssh doesn't have scp1 support, which is necessary for clojars. maybe i'll talk to hugod about grabbing that code from cake and i'll switch to clj-ssh
12:28technomancyjaley: looks like a typo in the lein-clojars plugin readme; the version is actually 0.6.0 instead of 0.6
12:28cemerickninjudd: scp1? Is that scp over ssh v1?
12:29ninjuddno, it is scp by running the scp command over the ssh tunnel
12:29jaleytechnomancy: ah right, thanks.
12:30ninjuddas opposed to using sftp
12:30ninjuddi believe it can happen over ssh v1 or v2
12:31ninjuddclojars doesn't support sftp. i think because that would give you access to other people's files
12:31ninjuddcemerick: http://blogs.sun.com/janp/entry/how_the_scp_protocol_works
12:32ninjuddCompared to the earlier http://en.wikipedia.org/wiki/Secure_copy protocol, which allows only file transfers, the SFTP protocol allows for a range of operations on remote files – it is more like a remote http://en.wikipedia.org/wiki/File_system protocol. An SFTP http://en.wikipedia.org/wiki/Client_(computing)'s extra capabilities compared to an SCP client include resuming interrupted transfers, directory listings, and remote fil
12:32ninjuddremoval.
12:32cemerickI'm blissfully ignorant.
12:43hugodninjudd: I can trivially add an scp command to clj-ssh, in fact it is already written
12:43ninjuddhugod: you mean without using sftp?
12:43hugodI always thought scp was implemented on top of sftp though
12:43ninjuddthere are two different protocols
12:44hugodI'll have to check if jsch supports it then
12:44ninjuddhugod: it doesn't
12:44ninjuddhugod: see the upload function here http://github.com/ninjudd/cake/blob/master/src/cake/tasks/release.clj
12:45ninjuddhugod: unfortunately, i duplicated a lot of your clj-ssh work because i didn't know about it
12:46hugodI've been meaning to do a few things with clj-ssh, mainly improving the handling of input and output streams
12:48ninjuddhugod: yeah, i also have code in there to print the remote output on getExtInputStream, which is what clojars uses to print status information
12:51hugodninjudd: what is that scp command? I don't see -d -t in the man page
12:52ninjuddhugod: -t and -d are hidden options for sink mode and directory respectively
12:52ninjuddhttp://blogs.sun.com/janp/entry/how_the_scp_protocol_works
12:57hugodninjudd: thanks, looks straightforward enough
13:07ninjuddhugod: no problem. i'll switch cake to use clj-ssh once i get some extra time
13:08shanmuhi, I have a question related to clj-http
13:08shanmuhow to pass a input=value in the body of a post request?
13:15tomojI just switched from clj-http to clojure-http-client
13:16tomojbecause, I think, I needed to do x-www-form-urlencoded post bodies
13:16tomojmaybe clj-http can do it and my switch to clojure-http-client wasn't necessary...
13:38chouser_cascalog!
13:38chouser_:-)
13:44fliebel,(seq? [1 2 3])
13:44clojurebotfalse
13:44fliebel:(
13:52fliebelWhat is the correct way to determine if something can be treated as a list in a multimethod?
13:53mrBliss,(every? sequential? [[] '() {} #{}])
13:53clojurebotfalse
13:53mrBliss,(map sequential? [[] '() {} #{}])
13:53clojurebot(true true false false)
13:54fliebelmrBliss: Sets have no order
13:54mrBliss(include maps and sets for demonstration purposes)
13:54mrBlisss/include/included
13:55fliebelright, but… I'll think about it. I have a couple of more things to choose from. I'm currently just using class.
13:56fliebelI tried clojure.lang.ISeq for class, but I'll have to come up with something else.
14:02TakeVIf I'm using Lein's REPL to test out my project, is there a way to reload the REPL when I change a file, instead of just restarting it?
14:03nlogaxTakeV: there is.. but i forgot :s. something like (use foo :reload)
14:04TakeVFoo being the namespace I'm in?
14:07KruppeIs there any reason why the last two versions in http://paste.lisp.org/+2H77 would hang? I have to be missing something. Im using clojure version 1.2.0
14:12tomojcan we combine async io for lots of parallel connections to many different clients with hadoop/cascalog?
14:15mattmitchellcould someone recommend a mongo library? i'm trying to use congomongo but no luck, i just get a not found exception, even though "lein deps" pulls it in
14:19tomojmattmitchell: maybe better to just solve that?
14:19tomojwhat does the not found exception complain about
14:19mattmitchelltomoj: yeah you're probably right!
14:19tomojI don't know anything about the mongo libraries, but I've heard about congomongo a lot
14:19mattmitchelltomoj: well this is the error I get: clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: Could not locate somnium/congomongo__init.class or somnium/congomongo.clj on classpath: (indexer.clj:1)
14:20tomoj`jar tf` the congo jar in deps/
14:20mattmitchelltomoj: i'm using cake, and want to integrate congo mongo into a task
14:20tomojoh, cake, hrmm
14:20mattmitchelltomoj: ok i'll try that
14:20tomojwhy'd you run `lein deps`?
14:21mattmitchelltomoj: should i have done something else?
14:21tomojI don't know cake, so I'm not sure
14:21tomojbut I thought cake was a replacement for lein?
14:21MayDaniel_`cake deps`
14:21_ulisesI am very confused about what symbols really are. Is it fair to say that the act as "labels" to vars? AFAIK the name of the symbol is used to look up a var of the same name and then the var is resolved
14:21_ulisesbut that suggests that if a different look up mechanism was involved, one could have symbol foo which would eval to var bar
14:21_ulisesno?
14:22mattmitchelltomoj: when i run "jar tf" on the congomongo jar file, i get http://gist.github.com/630116
14:22mattmitchellMayDaniel: so i should use cake deps instead of lein when using cake?
14:22tomojmattmitchell: so that jar is not on your classpath
14:22MayDaniel_Yes.
14:22tomojcake or lein, pick one
14:23tomojdoes cake put deps in a different place?
14:23mattmitchelltomoj: oh i thought cake worked with lein, making it easier to create tasks etc..
14:23mattmitchellmy deps with lein go into lib
14:23tomojcake is pseudo-compatible with lein's project.clj
14:23tomojah, right, dunno why I said "deps/"...
14:24mattmitchelltomoj: no problem. what does "jar tf" do?
14:24tomojthe 't' says "list the contents of the archive"
14:24tomojthe 'f' says "I'm about to tell you which archive I mean"
14:24tomojsee `man jar`
14:24mattmitchelltomoj: cool ok.
14:26dm3is there an idiom to turn nil into an empty sequence?
14:27mattmitchellok so i removed my "lib" dir and used cake deps instead of lein. it pull everything in fine, but if i try to "use" congomongo in one of my namespaces i get that error
14:27mattmitchellso i thought cake/lein would automatically put things in the class path?
14:28tomojmattmitchell: have you restarted your jvm?
14:28mattmitchelltomoj: no
14:28tomojwith lein, you need to
14:28tomojsince it's not working, apparently so with cake
14:28tomojyou shouldn't have to restart the persistent cake jvm
14:28tomojbut just the project jvm
14:29mattmitchelltomoj: interesting ok, let me try that.
14:29tomojjava doesn't like the classpath changing
14:30mattmitchelltomoj: i ran "cake restart" and still getting that error, hmm.
14:31tomojcheck (System/getProperty "java.class.path") for the congo jar
14:31mattmitchelltomoj: ugh, sorry. how do i do that?
14:31mattmitchelloh duh, repl :)
14:31MayDaniel_mattmitchell: How are you running your code?
14:32mattmitchellMayDaniel_: well i've been firing up "cake repl" and playing with it like that
14:33mattmitchelltomoj: ok i do see congo mongo in the class path
14:33tomojthen you should be good
14:33tomojhmm
14:34tomojcheck that the path in the notfoundexception matches the file in `jar tf` for the congo jar you see on the classpath
14:34tomojif so, something is crazy
14:35mattmitchelltomoj: ok will try that...
14:37mattmitchelltomoj: yeah the same path is in listed in "jar tf"
14:38tomojwhat is this "indexer.clj"?
14:38Deranderdo I need to restart my swank server after I load in some new deps with lein?
14:38tomojDerander: yeah
14:38Deranderthat is sad :-(
14:38tomojif you're working on two projects back and forth you can use checkout deps
14:39tomojbut for adding new deps, no help
14:40Deranderthanks for the info
14:41mattmitchelltomoj: oh this is a file that has a namespace of "apij.indexer" it's my own file for creating tasks
14:43tomojhow are you loading the file?
14:44mattmitchelltomoj: I have this in my indexer.clj file: (ns apij.indexer
14:44mattmitchell (:use somnium.congomongo))
14:44mattmitchelltomoj: and right when i run "cake help" i get the error
14:44mattmitchelltomoj: indexer.clj is in src/apij/indexer.clj
14:44tomojthat's odd
14:45mattmitchelltomoj: yeah i thought this would just work. but i'm new to clojure so i wasn't sure
14:46tomojninjudd: ^
14:48AWizzArdrhickey: I wanted to ask you about gvec.clj. Why are IVecImpl and the ArrayManager definterfaces and not defprotocols?
14:49ninjuddmattmitchell: did you gist the error?
14:50ninjuddmattmitchell: oh, i found it
14:50ninjuddmattmitchell: if you want to access your project classpath in a task, you have to wrap it in the bake macro
14:51mattmitchellninjudd: oh ok here is the whole error: http://gist.github.com/630151
14:51mattmitchellninjudd: oh really!?
14:51tomojoh, I see, it was a task
14:51ninjuddmattmitchell: here's an example: http://github.com/ninjudd/cake/blob/master/src/cake/tasks/test.clj
14:52mattmitchellninjudd: awesome i'll have a look
14:52mattmitchelltomoj: sorry for not mentioning that
14:52ninjuddbtw, i'm seriously considering getting rid of the separate cake and project jvm. but i want to get more input on the possible ramifications before i do
14:53tomojmattmitchell: I wouldn't have understood the implications anyway, that's why I pinged ninjudd :)
14:53mattmitchelltomoj: cool ok :)
14:53tomojninjudd: I was wondering whether the separate classloader idea could cause weird behavior
14:54ninjudda separate classloader is the other option. two JVMs is not the long term plan
14:54tomojoh, and another option is to just put cake stuff right in the project jvm?
14:54ninjuddbut i'm considering just sharing a classloader and making cake itself be self-contained within the cake.* ns
14:55tomojI see
14:55ninjuddit would mean cake has to run on all versions of clojure it supports
14:55tomojah
14:55ninjuddif we switch from maven to ivy, the number of jar deps for cake itself drops from 27 to 7
14:55tomojso if you start playing with edge clojure, and edge clojure breaks cake, you're hosed
14:56ninjuddthough there could still be version conflicts with those 7
14:56mattmitchellok here is my indexer.clj file, still getting that error though: http://gist.github.com/630154
14:56mattmitchelli also listed apij.indexer in my project's "tasks" setting
14:56ninjuddtomoj: that is the downside. if edge clojure introduces breaking changes, i will have to write compatibility code in cake
14:56tomojyou need to bake congo in, not just use it like normal
14:57fhdIs there a way to test private methods with clojure.test?
14:57fhd(Although I'm still not sure if that'd be a good idea, it would make stuff simpler)
14:57mattmitchelltomoj: omg, i didn't get an error when running "cake help" :)
14:58ninjuddmattmitchell: http://gist.github.com/630157
14:58ninjuddtomoj: i do like the "bake in" lingo. that's a reason to keep them separate ;)
14:59mattmitchellninjudd: awesome! it worked!
14:59ninjuddbut the number of people who get hung up on this when writing tasks is considerable. for lein too with eval-in-project, i'm sure
14:59mattmitchellthanks to both of you for taking the time to help me, much appreciated.
14:59ninjuddmattmitchell: great!
15:00mattmitchellninjudd: so why does that work and the way i had it before doesn't?
15:00ninjuddmattmitchell: if you have more questions and i'm not around, you can try asking in #cake.clj
15:01mattmitchellninjudd: excellent, i'll go there next time
15:01ninjuddmattmitchell: bake takes ns forms to load in your project, then a set of bindings to pass over the socket to the project jvm
15:04tomojninjudd: :)
15:05mattmitchellninjudd: i'll have to think on that one :)
15:14@rhickeyso, locally I have a working version of Clojure that requires explicit (def ^:dynamic x) metadata in order to support rebinding, and denies it otherwise
15:14@rhickeythis on the path to some perf enhancements, but also opens the door to another enhancement - transactional loading of code
15:14@rhickeyany interest in that?
15:14AWizzArdtotally
15:15AWizzArdThis is important for hot updates of course.
15:15AWizzArdI am very interested in this.
15:15AWizzArdIn fact, I am working on something similar, and this sounds really good.
15:15AWizzArdabout the perf enhancements: would they target non-dynamic vars or the dynamic ones?
15:16@rhickeynon dynamic
15:16AWizzArdgood
15:16@rhickeythe whole point is that dynamic entails cost
15:16AWizzArdSo, in principle this means: I will compile my code and get errors for each binding. To fix those I tag the concrete vars with ^:dynamic. Is that correct?
15:16@rhickeythe transactional loading can't be made perfect, ad that would require code run in transactions
15:17AWizzArdsure, but this can come in very handy anyway
15:17AWizzArdeven small improvements help to get correct programs
15:17@rhickeyAWizzArd: currently it will automatically make dynamic any *earmuff-var*, with a warning, just as a bridge
15:17@rhickeyall rebinding attempts to non-dynamics will throw
15:18AWizzArdsounds fair
15:18AWizzArdEasy patching.
15:19AWizzArdNice to see that you constantly come up with more and more catchy ideas
15:19@rhickeythe semantics would be - a fn sees a fixed consistent set of fn vars throughout its duration. A subsequent call will get fresh values if available. The perf tradeoff is that a nested call might see newr values than the call that contains it (if they were updated during the call)
15:20cemerickrhickey: I've been hoping for transactional loading of namespaces for some time now; all namespaces going into a ref or something?
15:21tomojso as long as updated functions have the same semantics, there will be no problem, right?
15:21cemerickor, I should say, *each* ns going into a ref
15:21@rhickeycemerick: no, vars having refs inside. Makingthe load transactional a matter of putting it (or a set of loads) in a transaction, if not, the granularity is per def
15:23cemerickrhickey: I guess that falls just shy of making use transactional?
15:23tomojhmm, maybe "semantics" isn't the right word.. if they had the exact same semantics, would they really have been updated?
15:24@rhickeycemerick: you can't do that generally, as files can have side effects. I think this will be a consumer-selected thing
15:24cemerickdamn top-levels
15:24@rhickeytomoj: same semantics and return types should always be fine, yes
15:25@rhickeycemerick: also, you want ad hoc footprint, especially for hot patches - 2 fns from this ns and 3 from that
15:25AWizzArdcemerick: this will be possible with my DB. Soon.
15:26cemerickrhickey: does anyone track patches to that level of granularity?
15:26@rhickeycemerick: most people don't have this kind of ability
15:27cemerickThat's what I figured.
15:27@rhickeythere are many other reasons not to turn a ns into a monolith
15:28AWizzArdrhickey: will you upload your code soon (including ^:dynamic)?
15:28@rhickeyAWizzArd: I could, right now it only provides pain and no benefits, other than clearer intent IMO
15:29@rhickeybut maybe people should get started on being explicit
15:29@rhickeyI haven't had enough feedback on the other pain points for people, e.g. mockers
15:30cemerickrhickey: I guess I'm not clear about why putting the refs at the ns level restricts one's level of load granularity (preventing "ad hoc footprint", as you put it). If you only load a single def within a transaction, you've just defined your footprint, no?
15:30cemericklol @ "mockers"
15:31@rhickeycemerick: by an effect to the entire ns
15:32@rhickeycemerick: the biggest effect of which would be to turn var deref into lookup, something CLojure has avoided thus far
15:33AWizzArdIf the new version does not offer the perf enhancements but already spits out warnings it is worth it.
15:33@rhickeymaybe that will matter less with caching, but that is unclear and a big risk
15:34cemerickOK; I was thinking that static-by-default would imply that the lookup is at compile time only.
15:34@rhickeycemerick: how could it be?
15:35cemerickeh, crap, nevermind
15:35AWizzArdrhickey: btw, just a fast question about gvec.clj: why are IVecImpl and the ArrayManager definterfaces and not defprotocols?
15:36@rhickeyit should matter not at all if the vars are individual refs, the semantics of the patch transaction are the same
15:36@rhickeyAWizzArd: because they are not abstractions, just using interfaces for primitives, since pre-primitive support in fns
15:37AWizzArdok
15:39amalloy,(try (vals [1 2]) (catch Exception _ 1))
15:39clojurebotamalloy: Huh?
15:40amalloyhrm. in my repl, that throws an exception. and in clojurebot it doesn't do anything at all. why is that?
15:40LauJensenrhickey: So in your local version, a simple (defn tst [x] x) cannot be rebound dynamically without adding the ^:dynamic meta ?
15:41@rhickeyLauJensen: right
15:42LauJensenrhickey: Im thinking typically during a day of development, I rebind things constantly, but once I go into production, I do so very rarely. Couldn't this be declared in the ns or something similar? (ns testing (:development true))
15:42@rhickeyLauJensen: really, rebind? not redef?
15:42LauJensenoh right, redef
15:42@rhickeyredef is fine
15:42LauJensenah ok
15:43@rhickeythis is a new model that allows redef (without recompile of downstream callers, unlike old direct linking and static linking)
15:45AWizzArdHas "static linking" anything to do with the ^:static hint?
15:46mattmitchelli'm using cake and trying to run my own task. the task runs fine the first time, then i get basically this error: mongo_to_solr already refers to: #'apij.indexer/mongo_to_solr
15:46LauJensenAWizzArd: AFAIK its called static because its compiled to a static function
15:47@rhickeyAWizzArd: same thing
15:47AWizzArdgood
15:48ninjuddmattmitchell: hmm.. sounds like the :use in bake shouldn't complain if the symbol is already bound. you can change it to a require for now to fix it
15:49mattmitchellninjudd: bingo! thanks again.
15:58amalloyninjudd: but with just require, will it work the first time he does it?
16:03ninjuddamalloy: yeah http://gist.github.com/630157
16:05amalloyninjudd: sure, he just has to make sure to use congo/mongo! instead of plain mongo. i was pointing out that *just* changing to :require will work until he restarts his jvm, and then stop working
16:06amalloymattmitchell: ^^
16:06ninjuddamalloy: i see. except it should break right away because changing the task should trigger a restart
16:07amalloyah. well, shows what i know about cake
16:07ninjuddit's strange though because i use bake with use all the time and haven't seen a problem. could be a reload problem
16:10amalloyapologies if this goes against etiquette or something, but i'm gonna repeat my previous question since nobody seems to have noticed it:
16:10amalloy,(try (vals [1 2]) (catch Exception _ 1)) ; shouldn't this return 1?
16:10clojurebotamalloy: Excuse me?
16:13LauJensenamalloy: What a weird example
16:14amalloyLauJensen: well, i had an expr that would return either a map (whose keys were uninteresting) or a vector, and i wanted to get either the values or the vector
16:14amalloythe right solution (aside from fixing the first expr) was to use map? or similar, but i tried this first and can't see why it doesn't work
16:14LauJensen-> (supers java.lang.ClassCastException)
16:14sexpbot⟹ #{java.lang.RuntimeException java.lang.Exception java.lang.Throwable java.lang.Object java.io.Serializable}
16:15LauJensenamalloy: In either case, you'd be better of doing (if (map? x) (vals x) ..
16:15amalloyyeah, as i said above i changed to that
16:16LauJensenrhickey: Any idea why the above exception isn't caught ?
16:16LauJensen-> (try (vals [1 2]) (catch Exception _ 1))
16:16sexpbotjava.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.Map$Entry
16:16amalloy,(try 1/0 (catch Exception _ 0)) ; breaks in the reader, so i understand why *this* isn't caught
16:16clojurebotamalloy: No entiendo
16:23dpritchettdoes anyone know how i can figure out which elisp function is being invoked when i use a command i.e. C-c M-p? swank-clojure and vimpulse both use it for different things and I need to learn how to rebind one or the other.
16:24LauJensenC-h k C-c M-p
16:25dpritchettremind me to speak kindly of bestinclass if anyone ever asks :)
16:25hiredmanM-x describe-key
16:26dpritchettexcellent
16:27LauJensendpritchett: Sure, I'll remind you once in a while :)
16:37@rhickey,(class (vals [1 2]))
16:37clojurebotclojure.lang.APersistentMap$ValSeq
16:37@rhickey,(first (vals [1 2]))
16:37clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.Map$Entry
16:38@rhickeyamalloy: ^^
16:38amalloyi see. the exception isn't thrown when i call vals, it's thrown when the repl tries to display it?
16:39@rhickeybasically, (vals [1 2]) returns a seq that blows up when used, not when created
16:39@rhickeyamalloy: right
16:39amalloymakes sense
16:39amalloy(for a given value of "sense")
16:39@rhickeyvals could do more checking, ticket and patch welcome
16:39amalloyrhickey: one of these days i'll get around to filling out a CA
16:41@rhickeyamalloy: you can file a report without a CA by using the support tab in Assembla
16:42technomancyrhickey: for the record if with-var-roots goes into core that addresses my concerns well.
16:42AWizzArdrhickey: is it also possible to be able to write comments? I wanted to comment a ticket, but didn't find a way to post something.
16:42technomancy(my concerns I raised earlier about testability)
16:42technomancyshould know better than to butt into the middle of a conversation like that
16:45@rhickeytechnomancy: well, putting it in core will have to follow some thought about it, but it proves the point, that is preferable to binding for, e.g. mocking and testing
16:46technomancysure; even with binding you still need with-var-roots for integration testing.
17:26amalloyis there a convenient function that will add an object to a set, unless the object is nil?
17:56amalloy,((juxt filter remove) #{1 3 4} (range 5)) ; how cool is this?
17:56clojurebot[(1 3 4) (0 2)]
17:57raekjuxt should have its own fanclub.
17:58technomancyhttp://p.hagelb.org/juxt.html
17:58technomancy(I didn't actually use the juxt version, but I like it for its own reasons)
17:59amalloywow technomancy that saves so much typing and thinking :)
18:00raekhagelborg... sounds Swedish :)
18:00amalloyanyway i spent like ten minutes trying to find a function like partition but that would split a seq into [matches not-matches], before finally realizing it's just (juxt filter remove)
18:01technomancyamalloy: c.c.seq/separate
18:01technomancybut juxt is cooler
18:02technomancyimplemented as: [(filter f s) (filter (complement f) s)]
18:02technomancyyou should submit a patch replacing the implementation with juxt =)
18:03amalloyman, i never remember to look in c.contrib
18:03technomancyif you had you may never have developed an appreciation for juxt.
18:05amalloytechnomancy: fantastically unlikely
18:07amalloyincidentally, i found what seems like an oddity in emacs's lisp indentation style:
18:07amalloy(filter x <newline> y) ; y lines up with x
18:07amalloy((juxt filter remove) x <newline> y) ;y lines up with (
18:08amalloyis that because emacs doesn't like lisp-1's?
18:10technomancythere are lots of edge-cases that aren't well-handled like that
18:10technomancybut if you came up with a list of functions that always return functions I suppose it could be done.
18:10amalloytechnomancy: why would that matter? if it's surrounded by () and not quoted, it must be a function
18:11amalloythat is, if it's the first element of ()
18:11technomancyamalloy: oh, duh. yeah.
18:11technomancyI dunno. I just inherited this code. =)
18:12amalloytechnomancy: where's the code i would have to change to make it work?
18:13technomancyamalloy: http://github.com/technomancy/clojure-mode/blob/master/clojure-mode.el#L550
18:13technomancywould be much obliged to see improvement there
18:13technomancyfraid I can't give you much advice about it though
18:14amalloyno worries, i'll have a look
18:49lpetitIs "motivation" (the word) idiomatic english ?
18:53mabeslpetit: it is a commonly used word, yes...
18:53lpetitmabes: ok, so it doesn't feel "foreign" if one of my conj slides is called "motivations" ?
18:54mabeslpetit: no, not at all
18:54lpetitkewl, thx
18:54mabeslpetit: Looking forward to it ;)
18:54lpetit(gulp)
18:54mabesheh, don't sweat it
18:55lpetit:)
19:00lpetithelp: for each "kind of feature" (for example "Editor"), I want to split more detailed features into 3 sets : "usable features" (fully functional, no arguing), "existing features" (they're there, but they really need some more work to pretend being viewed as "usable"), "missing features"
19:01lpetitWhat would better english terms than [ "usable", "existing", "missing" ] ?
19:01carkhi'm looking into upgrading a project to 1.2, but i can't find clojure.stacktrace
19:02carkhdoes anybody know where i can find print-stack-trace in 1.2 ?
19:03amalloylpetit: [stable, unstable, unimplemented]?
19:03raekah, the doc page is broken again
19:03raekcarkh: clojuredocs.org
19:03amalloyor incomplete instead of unimplemented maybe; i'm not sure what you mean by missing
19:03raekit seems like that the docs on clojure.github.com/clojure keeps getting reverted to 1.1 every now and then the last month
19:04lpetitamalloy: mm, you help me think more abotu what I want to convey. e.g. I don't want to list all possible unimplemented features. I want to try an honest attempt at pointing one or two "crying" missing features.
19:04amalloylpetit: future work?
19:05carkhraek: ah it needs to be "required" now
19:05carkhsame place as before =P
19:05lpetitamalloy: yes, future work is good at summarizing it
19:05lpetitso [stable, incomplete, future work] ?
19:05amalloysounds good to me
19:05lpetitthx
19:06amalloyhooray! i may not be going to conj, but now i know at least four of the words that will be used :)
19:06amalloytechnomancy: blech, i give up. CL is hard enough without having to know all the ins and outs of EL
19:06lpetitchanged my mind: [stable, incomplete, around the corner] :)
19:20amalloytechnomancy: hm, wait a minute. i found a way to make it indent every function the same wrong way; i can probably invert some logic somewhere to include fewer items instead of more in that case :P
19:24amalloy,(apply assoc {} (mapcat (juxt identity inc) (range 3)))
19:24clojurebot{2 3, 1 2, 0 1}
19:24amalloy,(into {} (mapcat (juxt identity inc) (range 3)))
19:24clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Integer
19:31amalloyhiredman: ping?
21:14wakeupstickyhi all
21:14wakeupstickyi'm on ubuntu. Where can I get an example clojure application with a gui? Ideas?
21:15dharmawhat kind of application are you looking for?
21:18wakeupstickyi don't really care. i just want to see something with a decent gui written in clojure that works. preferably open source but it doesn't need to be.
21:18amalloywakeupsticky: http://clojure.googlegroups.com/web/ants.clj is a classic example, if by gui you mean "draws stuff in a window". if you want something that gets user input, it's not such a great choice
21:19wakeupstickyand how do i go from source code to app with that?
21:19amalloydo you have clojure installed/running?
21:20wakeupstickyjust a sec, i'm getting it :)
21:20amalloyyou should be able to just copy/paste that into a repl
21:21dharmasince you said your are in ubuntu, you could sudo apt-get install clojure
21:22wakeupstickypart of what i'm looking for is proof that it's fairly straightforward to deliver an application. So while I can copy/paste the source into a repl that's not what i was looking for.
21:22amalloywakeupsticky: http://mikera.net/ironclad/
21:23amalloyi've only glanced at it myself, but couple months ago someone posted this (his project) to the google group
21:23wakeupstickyamalloy, that's exactly what i was looking for
21:24amalloythere you go, then. i don't know how hard it was for him to put together, but it looks like there's a mailing group or something, so you could ask there
21:24wakeupstickyjust that i'm thinking of switching from haskell to clojure primarily because i suspect deploying a gui-app would be easier in clojure
21:25amalloywakeupsticky: i suspect that's true; do you have java experience?
21:25wakeupstickyno :\
21:25wakeupstickysupposedly it's not necessary but i don't know about reality :P
21:25bhenrywakeupsticky i'm doing webapps with clojure and i never knew java beforehand.
21:26wakeupstickycool, what sort of webapps? linky?
21:26bhenryintranet apps sorry.
21:26amalloywakeupsticky: it's not necessary, esp for webapps, but knowing your way around the java gui frameworks is a big help - you have to call out to them eventually, and not everything has a clojure wrapper yet
21:26wakeupstickyoh np
21:27wakeupstickyhmmm, that app you linked to worked but
21:27wakeupstickyon java -jar clojure.jar i get the error
21:28wakeupstickyUnable to access jarfile clojure.jar
21:28amalloyhttp://stuartsierra.com/2010/01/02/first-steps-with-clojure-swing is series of articles by a well-known clojurian about getting started with gui in clojure
21:28amalloyagain, i haven't read them
21:29amalloywakeupsticky: the java stuff underlying clojure honestly makes it a real pain to use "raw" with java-jar. check out leiningen for a tool that will manage all that stuff for you
21:29amalloyclojurebot: lein?
21:29clojurebotthe leiningen screencast is on full disclojure: http://vimeo.com/8934942
21:29amalloygrr
21:29amalloyclojurebot: lein is http://github.com/technomancy/leiningen
21:29clojurebotYou don't have to tell me twice.
21:33wakeupstickyi'm too much of a linux noob to understand the installation instructions for leiningen
21:33amalloyheh. you download the lein file, and then run lein self-install
21:33amalloyit does the rest
21:34wakeupstickyi don't need to add it to my path and make it executable?
21:34amalloyoh. well yes, i suppose you do
21:35amalloy*sheepish*
21:35wakeupstickythat's what i don't know how to do on linux
22:08dbleylanyone familiar with generating local variable tables in their byte code with :gen-class?
22:09amalloydbleyl: as in debug symbols?
22:09dbleylyeah.
22:15amalloydbleyl: it looks like http://sr3d.github.com/GithubFinder/?utm_source=bml&amp;user_id=ninjudd&amp;repo=cake# contains some logic about whether or not to include debug info
22:15dbleylusing a jar that's picky about byte code, using something like asm to instrument the gen'd classes.
22:20amalloydbleyl: actually it looks like the compile-java task in there always passes lines,source
22:21amalloyif you modify your local cake installation to pass "source,lines,vars", it should work when you run cake compile
22:24dbleylamalloy: thanks - I'm checking out defn compile-clojure, and it looks like at the end of the day, it calls (compile lib)
22:24amalloyyeah, i just noticed that too
22:27amalloydbleyl: try javap -l on the generated .class files
22:27amalloymine have local variables
22:27amalloyeg javap -l myproj.core\$myfunc
22:29amalloyi generated them with a generic call of (compile 'myproj.core), and my project doesn't even have a gen-class
22:29dbleylI was getting some in an earlier version, but not anymore.
22:30amalloyearlier version of what?
22:31dbleylof my class.
22:32amalloycurious. have you tried calling (compile) yourself?
22:35dbleylyeah, I call it from my clj file.
22:37steven_they guys
22:37amalloyallo
22:37steven_tit seems clojure has the same problem c has in terms of needing to name local vars idx instead of index because the latter is a function
22:37amalloysteven_t: not at all. you can shadow functions
22:38steven_tchapter 1 of Programming Clojure says its bad practice to shadow though
22:38steven_tjust like you can in c, but its bad practice to
22:38amalloy,(do (print index) (let [index 1] (print index)))
22:38clojurebotjava.lang.Exception: Unable to resolve symbol: index in this context
22:39amalloy,(do (print cons) (let [cons 1] (print cons)))
22:39clojurebot#<core$cons clojure.core$cons@4eb98c>1
22:39amalloyanyway, yes, you should avoid it for functions you might plan to use in the forseeable future
22:40steven_tgrr
22:40steven_truby doesnt have that problem :/
22:40amalloythat said, it's pretty rare to have a problem. and in a functional language you rarely want index
22:40amalloysteven_t: how does ruby solve it?
22:43amalloy(what i mean by the latter is, if you're looping over something using an index, you're usually writing java/ruby in clojure, instead of writing clojure)
22:43dbleylamalloy thanks for your help.
22:43amalloydbleyl: you're welcome to what little of it there is
22:57steven_tamalloy: im talking about the shadowing issue
22:57amalloyyes, and i was asking how ruby solves the shadowing issue
22:58steven_ti guess technically ruby has the same issue.. you cant name a variable puts without forcing later calls to puts in that method to be written as Kernel::puts
22:58amalloylikewise clojure.core/cons
22:58steven_tright
22:58steven_tso i guess its not a real issue. not like in C at least
22:58amalloyit's not really one in c either, in my experience
22:59steven_tokay well im on page 18.. ill be back when im not so inexperienced with cloj :)
22:59amalloyyou should avoid globals, and if you're shadowing something from your own function inside a more deeply-nested block in the same function, your code has other problems
22:59amalloyenjoy it!
23:04pdkkeeping variables within the narrowest scope appropriate for them is good practice in any language
23:04pdksave for those that don't really have a concept of scope like old versions of basic, there you're forced to make it all global
23:35amalloyninjudd: how do i set vm args for my cake tasks?
23:43RaynesThere is a section of the README on setting JVM options, if that's what you mean: http://github.com/ninjudd/cake
23:44amalloythanks Raynes. yes, i want to adjust the stack/heap sizes