#clojure logs

2010-12-02

00:49clizzinwhat is the deal with clojure.string / clojure.contrib.string / clojure.contrib.str-utils / clojure.contrib.str-utils2? are any of these preferred over the others?
00:52brehautclizzin: clojure.string is prefered over clojure.contrib in general
00:52technomancythe others are for pre-1.2 versions of clojure
00:52brehautstuff has moved from contrib into clojure proper over time, string stuff is one of them
00:52technomancyonly kept around for backwards compatibility
00:53clizzinbrehaut, technomancy: great, thanks. that's what i suspected, but wanted to check. what are some examples of other libs that have moved into clojure proper over time?
00:53clizzini think i saw set as one of them
00:53technomancyduck-streams -> clojure.java.io is the main one
00:54technomancythere's a list in th e 1.2 release notes
01:02clizzinwhoa, that is good to know. so (line-seq (io/reader filename)) is now preferable to (duck/read-lines filename)? it seems kind of verbose.
01:04technomancyread-lines was never a good idea.
01:04technomancyit was basically asking for a resource leak to do that lazily.
01:06clizzinwould you mind explaining further? i'm not really familiar with the potential pitfalls of lazy evaluation.
01:08technomancyread-lines doesn't close the reader until the last line is consumed. it's easy to just discard the lazy seq of lines after getting what you need from it without realizing the whole thing
01:08technomancywhich would result in a resource leak
01:39BahmanHi all!
01:44Rayneshttp://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java
01:45mengu_lol
01:45mengu_Raynes: that was explained
01:45mengu_it is generated
01:45RaynesIt's still insane.
02:09Raynes$kill
02:09sexpbotKILL IT WITH FIRE!
02:27joshua__I love (source some-func).
02:28joshua__Was wondering whether a function was implemented in terms of another function.. so I checked :P
02:35joshua__Read through this article and really liked it. It is on how to use zippers: http://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip/
02:36brehautjoshua__: zippers are great
02:39brehautjoshua__: the xml-> selection operator has made my week
03:20LauJensenMorning
03:20lpetitmorning !
03:23mduerksenmorning
03:25Raynesmorning
03:47sthuebnermorning all
04:14bytecolorusing clojure.contrib why would I be able to require say, str-utils, but not combinatorics? NoClassDefFoundError
04:16bytecolorI'm using the forms: (require '[clojure.contrib.str-utils :as str-utils]) and (require '[clojure.contrib.combinatorics :as comb]), respectively
04:23bytecolorAlso, I did not build from source. I installed clojure-contrib-1.1.0.zip
04:56bytecolorhmm, the README says I don't have to do anything, but if I run ant, it works but, the two jars written are the same size where they were not in the .zip.
05:22LauJensenbytecolor: you might want to try clojure-contrib-1.2.0 instead. Pull it as a dependency for your project
05:49bytecolorLauJensen: all righty
05:50atom_think so
05:54atom_i'm so happy.. just managed to get compojure/ring and CometdServlet running in parallel on the same jetty instance
06:01lpetitccw 0.2.0 RC1 publicly announced on ccw mls
06:01Rayneslpetit: Congratulations!
06:02lpetitRaynes: thanks. But to be honest, most of this release's content is cemerick's. I've just polished things, removed some regressions.
06:02Raynescemerick: Congratulations...!
06:05cemericklpetit: Hey, snazzy :-)
06:05atom_lpetit: great, thx!
06:14Lajla&(loop [x 3] recur)
06:14sexpbotjava.lang.Exception: Unable to resolve symbol: recur in this context
06:16TordmorLajla: trying to do an infinite loop? (loop [] (recur))
06:17LajlaTordmor, no
06:17LajlaI'm trying to see if recur was a function
06:17Lajlathat could escape its original lexical environment
06:17TordmorAh, ok.
06:17LajlaThat would be pretty cool
06:17LajlaIf you could store it in a variable
06:17Lajlaand call it at random points to jump back to the original continuation
06:19atom_uhm... but that wouldn't be tail recursion...
06:20RaynesWell, recur isn't really tail recursion.
06:21TordmorLajla: maybe iterate does what you want?
06:21mduerksenlpetit: where can i get ccw 0.2.0 RC1? the last version i saw (on code.google.com) was 0.0.64 - that's a huge step!
06:23lpetitmduerksen: since it's a Release Candidate, I spoke publicly in length about it only in ccw's mls
06:23lpetit(they are open to anybody, though, of course)
06:23LajlaRaynes, recur is tail recursion, it's not tail call optimization however.
06:23lpetitmduerksen: details are on the release note wiki page of ccw
06:24LajlaTordmor, nahh, it was just a theoretical experiment to see if recur could escape its original lexical environment
06:26mduerksenlpetit: thank you, i will check it out as soon as i get home from my day job ;)
06:28cemerickLajla: even if recur was a function, it wouldn't carry a continuation with it.
06:28lpetitok, home page of ccw update
06:28lpetits/update/updated/
06:30Lajlacemerick, what do you mean with 'carry a continuation with it'?
06:30Lajlacemerick, you mean, 'can return a value'?
06:31cemerickYou were hoping that you could return recur as a fn, then invoke it in order to return flow of control to the head of the loop it was within?
06:33atom_...like the continue statement in Java?
06:33cemerickwell, continue is just a goto variant
06:34cemerickI assume Lajla was hoping that recur would allow a return to the head of the loop, even after control had escaped from that lexical context.
06:35atom_.. ahh ok
06:39Lajlacemerick, yeah
06:39LajlaBut that is not really 'carrying a continuation with it', it's just a function.
06:40Lajlabasically what recur repraesents is 'the value this loop-block would return if the variables were bound to these values'
06:40LajlaIf it was a function, at least.
06:40cemerickif it were to return flow of control, then that's a continuation
06:40cemerickright
06:40cemerickwell, it's a special form :-)
06:40LajlaI gathered.
06:40LajlaToo bad.
06:40Lajla=(
06:40cemerickIt's the only sane approach given no TCO.
06:42LajlaIs there a way by the way to nest multiple loops inside each other
06:42LajlaAnd rebind and jump to one that is not the nearest?
06:42cemerickI don't think so.
06:42cemerickThere's no reason why that wouldn't be possible.
06:43LajlaBut it's just not there?
06:43LajlaLike, you can't 'name' your recur.
06:43Lajla?
06:43cemericknope
06:44cemerickit's a worthwhile feature request
06:45atom_why the heck does this code produce no output:
06:45atom_(loop [x 0] (if (= x 10) (do (println "reset") (recur 0)) (do (println x) (recur (inc x))))
06:46atom_btw.. i'm a clojure noob
06:47cemerickatom_: you're short a closing paren
06:47atom_..ok.. *blush*
06:47atom_..thx
06:48atom_Lajla: wouldn't that kind of construct solve most of your requirements?
06:49cemerickno, that doesn't help Lajla's use case
06:50cemerickhaving to manually manage control flow sorta defeats the point
06:52Lajlacemerick, hmm
06:52LajlaI can imagine that this is an implementation thing though
06:52LajlaLike
06:52LajlaI take it that with each loop
06:52LajlaIt makes a save of some part of memory.
06:52LajlaOr some location
06:52Lajlawhich has to be rebound
06:52LajlaIf you say that it can rebind arbitrarily far back, it has to safe every instance of loop and fn
06:53cemerickit's not that complicated
06:56cemerickIf I recall, recur is just setting some fields, and then continue-ing from the head of loop (for function).
07:19RaynesCan has stability.
07:23cemerickRaynes: I wonder if sexpbot (or whatever could drive the logging) could be bottled up for redistribution. I'm sure many people would be happy to run it, really ensuring that we have a comprehensive log.
07:23cemerickPair that with automatic uploading to e.g. S3 or SDS, hashed as necessary to avoid duplicates…
07:24Raynescemerick: Yeah, I've been really lacking in real material for users since the beginning.
07:24Lajlacemerick, hmm
07:24Lajlathen requaest it
07:24Lajlaand I shall forever hug you
07:24RaynesOnce I get the protocols branch stable and redesign the privilege system, the next big step is documentation and user-friendliness.
07:24cemerickLajla: you mean the arbitrary loop-head recur thing?
07:25Lajlacemerick, yeah
07:25Lajlathat you can name it
07:26LajlaLike (loop some-random-name [cemerick 3] (if (= 0 cemerick) "done" (some-random-name (- cemerick 1)))
07:27cemerickYeah. I'd be surprised if it happens, but I'll think about it some and suggest it at some point.
08:11Raynesfliebel: Hi.
08:11fliebelhi
08:12Raynesfliebel: Go tweet "@sexpbot &(+ 1 2 3)"
08:15fliebelRaynes: What happens with output vs return value?
08:15Raynesfliebel: sexpbot on twitter is exactly the same as sexpbot on IRC, save for some commands and plugins being disabled and such because they're IRC specific.
08:16Raynes&(println "blah")
08:16sexpbot⟹ blah nil
08:16fliebelright
08:16RaynesReturn value comes after a space.
08:17fliebeloh, does mail work? :) and karma, and.. and...
08:18RaynesThose are IRC specific, so no.
08:18RaynesWell, karma isn't, but would require modification to work on twitter.
08:18RaynesSo for now, it's IRC only.
08:18Lajla&(seq "string")
08:18sexpbot⟹ (\s \t \r \i \n \g)
08:18LajlaRaynes, how does carma work?
08:18Raynesmail could work with modification, but it would be irrelevant with direct messages.
08:18fliebel(inc Raynes)
08:18sexpbot⟹ 1
08:19fliebeloh, sed would be awesome :)
08:20RaynesAye, but not very useful.
08:21Raynesfliebel: If you want to check the twitter support out, check out the protocols branch. If all goes smoothly today, I'll merge it into master.
08:21fliebelRaynes: You could implement a clojure group as a channel to provide :on-message style stuff.
08:21fliebelI will :)
08:21fliebelI love the Twitter api, and Clojure
08:21RaynesI'm going to add email support eventually.
08:21RaynesThat'll be interesting.
08:24RaynesLot of sweat, pain, and blood went into that branch over the last two weeks.
08:24fliebelRaynes: Did you rewrite plugins, or made it work transparently?
08:25RaynesIt works mostly transparently. The changes I made to the plugins reflect mostly unrelated changes.
08:31fliebelRaynes: So what it does is get mentions and execute call-all with the arguments?
08:32RaynesPretty much. It basically just implements sexpbots little communication interface.
08:33fliebelRaynes: So you could make a twitter list and implement all features that assume a 'channel', so that $seen can work
08:34RaynesI'd have to check, but possibly.
08:35fliebelNow all that remains is a nice logo :)
08:35fogus`Stop, hammock time: http://clojure.blip.tv/file/4457042/
08:37cemerickvery exciting that these are coming out :-D
08:37jolyoooh, the videos are getting posted? nice!
08:38fliebelawesome
08:38cemerickinteresting that they're on blip
08:38cemerickI thought they were going to be on infoq
08:39fliebelIt would be fun to have the pencast side by side with the video...
08:55kjeldahl_Has anybody used leiningen "checkouts" for hacking multiple projects simultaneously? Am I supposed to symlink the project directory, or the jars themselves? Any pointers to tutorials, except what's already in the faq?
08:56neotykIn clojure-mode when I do M-. it jumps to definition, is there a way to 'jump-from' location?
09:04neotykM-* does it
09:04neotykand it's a stack, so you can go multiple levels
09:07mduerksenneotyk: M-*? i thought it was M-,
09:13neotykmduerksen: M-. and M-* are from etags.el, while M-, is from sliem.el, still it works :)
09:13tonylmorning
09:13neotyks/sliem/slime/
09:14raekkjeldahl_: you symlink the project directory
09:14raekalso, you need to add that project as a dependency as usual
09:14raekno pointers, I'm afraid...
09:15raek(to tutorials etc)
09:15kjeldahl_raek: Ok, thanks. Do you know if it picks up things in "modules" as well for the dependency?
09:15raekmodules?
09:15kjeldahl_raek: My testing indicates it does not...
09:16kjeldahl_raek: Incanter. It's stuff is found as separate "incanter" modules beneath a modules directory.
09:16raekah, it's a maven project, right?
09:16kjeldahl_raek: Eh, it builds fine with "lein jar".
09:17mduerksenneotyk: ah, i see
09:18kjeldahl_raek: It simply lists it submodules as dependencies, i.e. "[incanter/incanter-core "1.2.3"], and that seems to get stuff built (I assume it is not fetching from repos..).
09:18neotykhow do I get slime-who-calls to work? any special setup needed?
09:18raekanyway, I think checkouts is an alternative to running lein install and restart the dependant clojure instance for every change
09:18raekkjeldahl_: do the modules have project.clj files too?
09:19kjeldahl_raek: Yes.
09:20raekthen I think you need to symlink each one of the interesting modules directories one by one
09:20raektechnomancy knows more about this (he's the author)
09:20kjeldahl_raek: Thanks, I will try.
09:21mfexneotyk: I installed highlight-parentheses with M-x package-list-packages, but no highlighting yet. Is there another step?
09:21raekbeware, this is just my extrapolation of how I think this works... :-)
09:22neotykmfex: sure there is :)
09:23neotyk(require 'highlight-parentheses)
09:23neotyk(add-hook 'clojure-mode-hook (lambda ()
09:23neotyk (highlight-parentheses-mode t)))
09:23mfexneotyk: M-x highlight-parenthesis
09:23Rayneshttps://gist.github.com/725372
09:23mfex?
09:23raekwhat does highlight-parentheses-mode do? I've only used the built-in show-paren-mode
09:23neotykmfex: add it to you init
09:24Raynes.emacs
09:24neotykraek: highlights parens in context Pop the edit-definition stack and goto the location.
09:24RaynesUnless you're using emacs-starter-kit
09:24neotykraek: http://www.emacswiki.org/HighlightParentheses
09:25neotykthis was supposed to be pasted before
09:25mfexneotyk: thanks, it works
09:25neotykmfex: np
09:25raekneat.
10:12cemerickhas anyone here used the google collections data structures (officially now in guava, I guess)?
10:13dreamrealyes
10:13dreamrealoh, not in clojure, sorry
10:13cemerickyeah, no, I'm not curious about using them in clojure
10:14cemerickdreamreal: am I reading the javadoc right that the immutable collections classes have no methods that return a new, "modified" instance?
10:14cemericki.e. corollary to assoc or conj in clojure?
10:30joegallocemerick: I don't think they have that.
10:30joegalloI think it's just immutable, period.
10:31joegallofoo = new SomeMutableList(immutableOne); foo.add(bar); ...
10:31joegalloI could definitely be wrong, though.
10:34cemerickjoegallo: OK, glad I'm not missing something.
10:34cemerickSeems fairly pointless in that case, but…oh well.
11:00defnSo I have a question -- the "unless" macro. How is this different from Ruby's unless? Could you write unless in Ruby?
11:01defn(defmacro unless [expr & body] `(if ~expr nil (do ~@body)))
11:01Raynesdefn: You could with blocks, right?
11:02fliebeldefn: Unless? I thought it was called wehn-not?
11:06chouserdef when_not(x) if not(x) then yield end end
11:06chouserbut the syntax for using a when_not is different from using ruby's built in unless
11:06chouserunless false then p "hi" end
11:06chouserwhen_not(false) {p "hi"}
11:10defnso i guess my next question is, why isn't unless in clojure core?
11:10chouserit's called when-not
11:10chouserin clojure core
11:10defni had no idea.
11:10raekI've heard that the name "unless" is reserved for macro tutorials ;-)
11:10chouserheh
11:11chouserdefn: or if-not
11:11chouserdepending of course on whether you need an else clause or not
11:12defnchouser: can we get an alias for when-not into core? :X
11:13defn(unless i mean) -- maybe im insane, but i really like "unless"
11:13defn(when-not) is a bit terse
11:13chouserI've heard several people express thanks for it being named "when-not" rather than "unless"
11:14chouserterse?
11:14chouserand would unless act like when-not or like if-not? :-)
11:14fliebelyea, second should also be named fnext.
11:14chousermm
11:15raekanyone who would like to see (defn in? [x coll] (contains? coll x))?
11:15fliebelraek: Why the reverse args?
11:15raekI think it looks better when writing unit test
11:16raekbut that's a very subjective opinion...
11:16raekalso, I used to program in python before I got into clojure
11:17fliebelraek: Ah, me to… I still go looking for in before I find contains?
11:17fliebelBut (in? coll x) makes more sense to me.
11:18raek(in? name #{"fred" "ethel"})
11:18cemerickum… (#{"fred" "ethel"} name)
11:19raekI'm concerned with the case where name, "fred" and "ethel" are large expressions
11:19raekas I said, personal aesthetic reasons...
11:20raekit's like if you would have the first argument in 'case' last...
11:25cemerickfogus`: how do you turn around your HN submissions so rapidly? ;-)
11:26fogus`cemerick: The magic of bookmarklets.
11:27cemerickfogus`: where can I get this amazing technology innovation? :-P
11:27fogus`It's proprietary
11:28cemerickI'm persistently 30-60m behind on the twitter (and RSS before it), so I've never been good at any submitting to any newsy site.
11:30fogus`Ahhh, the advantages of having no life... first post every time!
11:30fliebelcemerick: pubsubhubub and a streaming twitter client will get you a long way.
11:31cemerickfliebel: the fact that I've never even heard of pubsubhubub is indicative of my general circumstance.
11:33fliebelIn fact, I have toyed with the idea of setting up a google reader account and subscribing to some popular blogs, and have a deamon submit any new entries for me. How evil...
11:38jweisswhat's the idiomatic way to do this - i have a macro, let's say it take a map key as an argument. but i don't want to have to pass in the map every time, there's a lot of calls to this macro and the map is the same. But the map belongs in the caller's namespace. should the macro assume the map var exists? is there a better way?
11:52mduerksenjweiss: i don't know what your macro does exactly, but maybe you do something similar to what "memoize" does: (defn stuff [... m ] (let [mcopy m] (defn newfun [...] ....
11:53mduerkseneven though memoize is a function, not a macro, you can take that as an example
11:53jweissmduerksen: the idea here is syntactic sugar so my calls will be more concise. i think i probably just want to capture the symbol in my macro.
11:54tscheiblshouldn't ccw's clojure builder aot compilethe gen-class namespaces?
11:54jweisswith memoize, i would think i'd have to pass the map in at least once, and who knows which caller will be the first :)
11:55jweissi suppose i can deliberately set it up
11:58tscheiblcemerick: shouldn't ccw's clojure builder aot compile the gen-class namespaces?
11:59cemericktscheibl: it should if you have started a REPL for the project in question
11:59cemerickThat requirement will be going away soon.
11:59chouseranyone know about ANTLR + maven?
11:59chouserI know, way off topic, sorry...
11:59cemerickchouser: Alex Miller knows something of the combo, IIRC.
12:00mduerksenjweiss: i think i misunderstood your goal, never mind
12:03technomancythree people confused about checkout dependencies in 24 hours; time to update the docs =\
12:07tscheiblcemerick: can't get it to aot compile even with running repl
12:09tscheiblcemerick: it only copies over all the .clj from the src to the classes folder
12:09cemericktscheibl: and your source directories are configured properly in eclipse (either directly or from an e.g. maven build)?
12:09cemerickthat is, *source* directories, not resource dirs?
12:10tscheibl cemerick: did it with lein eclipse
12:10cemerickhuh, ok; didn't know about that one
12:11cemericktscheibl: in your project properties, under "Java build path" > Source, is your source directory listed there as you'd expect?
12:11tscheiblwell it's in the source tab within the java build path dialog
12:11cemerickah, ok
12:12cemericktscheibl: look under "builders" in your project properties; is the Clojure builder there and enabled?
12:12tscheiblthe gen-class ns is extending javax.servlet.http.HttpServlet
12:12tscheiblit's enabled
12:13tscheibl.. in the meantime i've configured an external builder using lein compile instead which worls as expected
12:13cemericktscheibl: ok; I've exhausted my list of quick checks. I'm no expert on the builder's impl; could you shoot a message to the users ML @ http://groups.google.com/group/clojuredev-users ?
12:14tscheiblcemerick: ok, thx
12:21chousercemerick: did you say something about dependency:list at some point?
12:23cemerickchouser: probably. why?
12:23chouserjust trying to figure out what maven's actually doing here
12:26chouser<dependencies> usually specify runtime deps, right? is there a way to specify comiple-time deps?
12:28cemerickchouser: dependencies are compile-time (and therefore runtime and test-time) by default
12:28cemerickchouser: http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
12:29chouserhm. I'm pretty sure the antlr maven plugin is using a different version of the antlr jar at compile time than what I specify in my <dependencies>
12:29Raynesfreakazoid: Candlejack was h
12:30freakazoid:D
12:30dnolenman, extend-type is amazing
12:30cemerickIf so, that's a plugin issue -- i.e. clojure-maven-plugin could (if it wanted to be broken) use some fixed version of clojure for compiles, etc, rather than what the project defined locally.
12:30cemerickchouser: perhaps it's an antlr plugin configuration option?
12:39ymasory_what are some common uses for preventing evaluation of a symbol?
12:54bartjif rational numbers are treated different in Clojure, then why is this equal?
12:54bartj,(= (/ 4 11) (float (/ 4 11)))
12:54clojurebottrue
12:54bartj, (/ 4 11)
12:54clojurebot4/11
12:54bartj(float (/ 4 11))
12:54bartjI mean:
12:55bartj, (float (/ 4 11))
12:55clojurebot0.36363637
12:55freakazoidit's probably converting them to a common type for comparison
12:55cemerickbartj: I suspect because = is implicitly dropping the rational to a float for the comparison
12:55freakazoidI bet it's the other way around
12:56freakazoidunless clojure is good at converting floats to the simplest rational that's within their error bars
12:56bartjcemerick, do you agree that is unexpected?
12:57cemerickfreakazoid: I was referring to 4/11 as the rational, sorry.
12:57freakazoidoh I read that backwards
12:57freakazoidclojure reversed my brain
12:58cemerickbartj: no; equality isn't bound to type
12:58freakazoidyou guys checked out the J1 CPU yet? That think looks neat-o
12:58cemerick,(= 1 (Float. 1))
12:58clojurebotjava.lang.IllegalArgumentException: No matching ctor found for class java.lang.Float
12:59cemerick,(= 1 (Float. 1.0))
12:59clojurebottrue
12:59cemerickbartj: ^^
12:59bartjhmm
13:00bartjby that definition
13:00bartj,(= 1 "1")
13:00clojurebotfalse
13:00bartj:)
13:00cemerickno, no
13:00bartjam I missing something?
13:00raekreminds me of perl...
13:00cemericka notion of numerical equivalence does not imply weak typing
13:00freakazoidit probably does something special for numeric comparisons
13:00bartjoh!
13:01freakazoidcan clojurebot be made to dump bytecodes?
13:01freakazoidI guess that would cause it to flood out
13:01freakazoidwe need "explain"
13:01freakazoidala sql
13:01bartjcemerick, thank you much
13:01freakazoidparticularly sqlite
13:01cemericknp :-)
13:01freakazoidalso, clojure needs an IDE as awesome as Racket's
13:02cemerickfreakazoid: you read JVM bytecodes as a matter of habit?
13:02freakazoidI can read the mnemonics.
13:02cemerickah
13:02cemerickfreakazoid: what do you like about Racket's IDE?
13:02freakazoidThe fact that it shows you dataflow and graphical stack traces
13:03freakazoidthe error reporting and code navigation are both quite awesome
13:03cemerickgraphical stack traces?
13:03freakazoidit draws arrows indicating the control flow implied by the current stack
13:04cemerickYou mean in the editor?
13:05freakazoidyeah
13:05cemerickinteresting
13:05cemerickthat could get painful in some cases, no?
13:05freakazoidI don't think it draws the whole stack
13:05freakazoidit might draw each frame separately and let you navigate up and down
13:06freakazoidI need to reinstall that and play with it more since I've become more interested in IDEs lately
13:06hiredmanfreakazoid: the byte code for a simple fn is way too verbose to dump to irc
13:07cemerickI've heard Racket is an excellent environment, but the last time I used it, it was years ago and called Dr. Scheme.
13:10bartjfreakazoid, couldn't find racket ide on google!
13:11cemerickbartj: google racket scheme
13:15bartjcemerick, thanks again; I thought it was an ide, sigh
13:15cemerickwell, it comes with an IDE *shrug*
13:21joshua__Is there a library that gives you wiki like storage in clojure?
13:21joshua__Something you could use to build the base of wikipedia of stackoverflows revision system.
13:46LauJensenIn case some of you missed it, Richs Keynote: http://clojure.blip.tv/file/4457042/
13:47hiredman,(doc clojure.set/difference)
13:47clojurebot"([s1] [s1 s2] [s1 s2 & sets]); Return a set that is the first set without elements of the remaining sets"
13:48cemerickhiredman: you have a mail in sexp bot that I presume you're not picking up because it's on your banlist?
13:48Raynescemerick: Ah, new bug.
13:49RaynesHe has had that mail for ages, but sexpbot is accidentally noticing the whole channel.
13:49RaynesHappy that was caught before I fell asleep.
13:49joegalloSo... would you say sexpbot accidentally the channel?
13:50RaynesHehe
13:51hiredmancemerick: ignore list, but yes
13:54fliebelI suppose hosting a Clojure app is normally done using a servlet container? So there is no such thing as mod_ring or whatever. It would be nice if I could us the same server for hosting some PHP and Clojure.
13:55cemerickfliebel: there are PHP runtimes for the JVM ;-)
13:55fliebelcemerick: Quercus?
13:55chouserfliebel: you can config apache to proxy for a servlet container
13:55cemerickfliebel: there are many
13:55RaynesThat is fixed. No more global mail alerts.
13:55RaynesSorry about that.
13:55chousergrr
13:55cemerickThanks :-)
13:56fliebelcemerick: Oh? I found only Quercus.
13:57fliebelchouser: I would like to avoid running 2 servers on, say, a Amazon micro instance.
13:58cemerickfliebel: there are at least two others; p8 is the only one I can remember.
13:58drewrwhy have mail in a bot anyway when freenode provides that for you?
13:59cemerickfliebel: keep in mind, I've never used any of them.
13:59fliebelcemerick: I have used Quercus, and it worked, but it's weird. p8 isn;t easily found.
14:00cemerickit's IBM kit, so almost surely not free *shrug*
14:00arohnerfliebel: set up jetty or whatever on port 8080, then use apache or nginx to proxy from 80 to 8080
14:01arohnerfliebel: similarly set up php on 8081, and then forward by url
14:01arohneri.e. foo.com:80/clojure proxies to 8080, but foo.com:80/php proxies to 8081
14:02arohnerfliebel: it's a pretty standard setup
14:02fliebelarohner: I can think of some setups that might work, but all include at least 2 servers.
14:02arohnerfliebel: two boxes, or two web servers?
14:05fliebelarohner: 2 web servers
14:05arohnerfliebel: yeah, if you want to combine clojure and PHP, that's pretty much a necessity
14:06arohnerfliebel: but apache + jetty isn't bad, and is a pretty standard deployment
14:06fliebelarohner: quercus might get them onto one server, as well as mod_ring, which unfortunately doesn't exists.
14:07arohnerfliebel: what's the problem with two web servers?
14:07cemerickwould a mod_ring simply be a bad idea?
14:07cemericks/would/wouldn't
14:07sexpbot<cemerick> wouldn't a mod_ring simply be a bad idea?
14:07fliebelarohner: double setup, double memory, double maintenance.
14:08fliebelcemerick: Why?
14:09cemerickI remember having a devil of a time with mod_python back in the day. My impression I left that world with was that running larger runtimes in apache wasn't particularly feasible.
14:10fliebelcemerick: I know that ring is quite like wsgi and the ruby equiv, which both have well respected modules.
14:10fliebelcemerick: I think they work much like fastcgi...
14:11cemerickIn terms of API, yes. But you'd have to load up a JVM into apache, or use something akin to mod_jk.
14:12fliebelcemerick: I imagine a separate JVM which has its ring handlers called directly by some jni magic.
14:13cemerickwell, if it's JNI, then it's not a separate JVM
14:13fliebelRather than via a bunch of xml and indirection called tomcat.
14:13cemerickI have here the salvation of the world. The best hackers won't touch it though, 'cause it uses XML.
14:16fliebelNothing wrong with XML, though I would rather have my ring handlers called directly rather than via a servelet container. I don't know much about it, but these containers feel like heavy to me.
14:16clojurebotXmL is case-sensitive
14:16cemerickfliebel: jetty is just as much a servlet container as tomcat is?
14:17fliebelcemerick: I told you I don't know anything about it… *last futile attempt* I just like the sound of mod_ring better than Tomcat or Jetty.
14:18cemerickheh, ok
14:19cemerickfliebel: until then: http://cemerick.com/2010/11/02/continuous-deployment-of-clojure-web-applications/ *shrug*
14:19fliebelSo now the question is, quercus in jetty, or jetty in apache :)
14:20RaynesIt wouldn't be so bad if I hadn't have somehow slipped "and stuff" into my commentary. I nearly hung myself after the talk was over.
14:21cemerickfliebel: I'd recommend tomcat instead.
14:21KirinDaveDoes anyone have some tooling to make sbt play nice with clojure projects?
14:21fliebelRaynes: What was Aaron Bedra's talk about?
14:21RaynesI can't remember. I blacked it out.
14:22RaynesHis talk didn't seem to have a real subject, but the awesomeness of the Clojure community was the framework
14:22RaynesA real single subject, I mean. His talk wasn't incoherent, just not as focused as the others, but that was the point.
14:23fliebelcemerick: Why?
14:23RaynesBecause he likes using things that nobody else around here uses. :p
14:23cemerickI use jetty daily for development
14:24RaynesWell, if you count the backend, I use maven daily for development, so we're even.
14:24cemerickIn production, tomcat provides better process/service management, more reliable hot deployment IMO, and much more accessible configuration.
14:24fliebelokay
14:25cemerickjetty is biased towards the embedded use case – which is fine – but I don't want to have to change code to modify configuration.
14:30cemerickwhat languages/runtimes provide for mutable strings by default? I know of CL, but surely there are others?
14:30cemerickalso outside of C et al., of course.
14:31technomancycemerick: ruby does =(
14:31cemerickjeez, really?
14:31cemerickbrutal.
14:31cemerickShows just how little I know about Ruby.
14:31cemericktechnomancy: is that considered a feature over there?
14:32technomancycemerick: depending on who you ask it's an embarassment or a handy trick
14:32technomancyI think the latter is more common
14:33cemerickwhee
14:34cemerickAnd to think I almost picked up Ruby for rails a while back.
14:34fliebelcemerick: If I remember correctly, you can to things like def a = "foo bar"; a[1,3] = "uu"; puts(a) => "fuu bar"
14:35cemerickglorified byte arrays, then
14:35fliebelBut last time I looked at Ruby, the tutorial assumed 1.9, so I found a'bug' in the tut right away.
14:35technomancydon't get me started on encoding and the way it dishonors peoples' ancestors
14:35cemerickpresumably, that was the source of the encoding issues that Ruby was known for for some time…
14:36fliebelRuby 1.9 iterates over words or lines rather than chars, for some reason.
14:36cemericktechnomancy: that's not fixed at this point? I thought they had gotten over their unicode hatred and standardized on something.
14:37technomancycemerick: strings have encoding now, but it's not standardized on unicode internally
14:37LOPPlulz
14:37LOPPwhen will people learn
14:37LOPPI work with non-standard codepage
14:38LOPPand I often run into problems with various software that can't handle encodings properly
14:38LaPingvinotechnomancy: it's not standardized on unicode because it's a japanese programmer; a lot of japanese systems still use alternative encodings
14:39cemerickJIS for life and all that.
14:39LaPingvinoyup
14:40LaPingvinoyou know why the Japanese pioneered in video games and the US in Business software?
14:41fliebelLaPingvino: Tell us :)
14:46rata_hi
14:46sholdenHi everyone, sorry if I'm newbing it up hard, but I'm trying to build enclojure from source but maven is raining on my parade when trying to find the swank-clojure artifact. Is anyone else having this issue? "Could not find artifact swank-clojure:swank-clojure:jar:1.2.1 in clojure-releases"
14:47LaPingvinofliebel: the alphabet is small, so typing is easy, and thus word processing etc is the first thing you think of (following typing machines)
14:48rata_could too many sends to an agent cause an stack overflow?
14:48LaPingvinofliebel: for the Japanese, software couldn't have variable text (as the memory of a computer was yet too small to contain all Japanese chars) so they put the text in images
14:48LaPingvinofliebel: you cannot do that in text editing software, but you can in games
14:48fliebelrata_: Yes, in my experience :(
14:49rata_fliebel: do you know how can I work around it?
14:49fliebelrata_: I'm not sure await is for agent, nor if release-pending-sends dos execute them ,but look a those
14:49edw`My backtraces show no local variables in SLIME; is there some Java command-line option I need to ad (or avoid) in order to get locals showing up in the debugger?
14:49edw`s/ad/add/
14:49sexpbot<edw> My backtraces show no local variables in SLIME; is there some Java command-line option I need to add (or avoid) in order to get locals showing up in the debugger?
14:50fliebelLaPingvino: Cool :)
14:50cemericksholden: why build enclojure from source?
14:52lenwhi all
14:52fliebelHi
14:53lenwanyone know of a neat way to start and stop / manage clojure servers
14:54neotyklenw: crane is ok
14:54fliebellenw: cemerick just referred me to pallet. Don;t know if it does what you need.
14:55lenw dont those guys provision ec2 instances and manage cloud storage for you
14:55cemericklenw: http://cemerick.com/2010/11/02/continuous-deployment-of-clojure-web-applications/
14:55neotyklenw: and crates in particular https://github.com/pallet/pallet-crates
14:55cemerickjclouds + pallet is sorta "all of the above"
14:55lenwcemerick: checking that out thanks
14:55rata_fliebel: the documentation of release-pending-sends says that it dispatch the functions send to an agent immediately, but I need those functions are called sequentially on each agent... does it affect the sequentiality of fn calls by the agent?
14:56lenwneotyk: do those tools allow deployment o my own server ?
14:58fliebelrata_: await tells me it will wait for all actions to finish.
14:59rata_fliebel: ok, so I should send a batch, wait for them, then send another batch and wait for them and so on?
14:59neotyklenw: don't think that crates will help with local machine
14:59neotyklenw: though crane will do the job there
15:00lenwneotyk: thanks reading and learning
15:01fliebelrata_: Better would be to modify your code so that it doesn't overflow.
15:01neotyklenw: np
15:02rata_fliebel: but it overflows just because I'm sending too many actions to an agent
15:02fliebelrata_: Then don't use an agent.
15:03neotyklenw: careful with crane though, it is still in snapshot, might change api w/o warning
15:03lenwneotyk: thanks
15:04cemericklenw, neotyk: pallet and its crates will work just fine targeting any machine, local or in the cloud
15:04neotykcemerick: good to know
15:04lrennring exists such that something like mod_ring could be written.
15:04cemerickvbox vms soon as well, or so I hear, similar to vagrant
15:04neotyklenw: than ignore my crane talk, go crates
15:05lrennthat didn't come out right, but you know what i mean.
15:05lenwcemerick: how does it stop the servers - kill ?
15:05cemericklenw: depends upon what server you're talking about
15:06rata_fliebel: why? how else would you get "indenpendent and asynchronous" state modifications in clojure?
15:06joshua__Are there any wiki engines in clojure?
15:07lenwcemerick: in one instance I have a clj file that starts up some mail polling threads ...
15:07Raynesjoshua__: Well, there is clicki, but that isn't really what you're looking for, I imagine.
15:07lenwcemerick: so just wondering what i need to do to it to play nice with something like pallet
15:07fliebelrata_: If you do asynchronous, make sure the updates are short enough so that you don't get ahead of yourself, like you do. So, cheaper updates or synchronous, I guess.
15:09rata_niether one is a possibility here... anyway, it seems that release-pending-sends solves the problem
15:09lenwcemerick: watching the video
15:09rata_mmmm... no, it doesn't
15:10sholdenrage. getting closer but now im getting an exception that my command line is too long (win). sigh
15:10joshua__No, I don't think thats what I'm looking for.
15:12fliebellrenn: What *did* you mean? Someone should write mod_ring? :D
15:13joshua__Hmm.. maybe Clojure isn't the right tool for this job. I don't want to have to write my own wiki system atm.
15:14lrennfliebel: sorry :) I thought someone said mod_ring would be a bad idea. What I meant was that ring exists for the sole purpose of allowing other webservers to implement ring and not being tide to a j2ee webapp container.
15:14lrenntied even.
15:15jweissanybody use java logging and clojure.contrib.logging and know how to fix class names like this:
15:15jweiss201012021509:54.435 - INFO: hello (clojure.contrib.logging$impl_write_BANG_.invoke)
15:16jweissthe doc for c.c.logging makes mention of this but i don't understand how they meant for me to fix it
15:16fliebellrenn: Right. But I looked at mod_wsgi, and decided it is not going to be me who will write it.
15:17lrennfliebel: yeah, i wouldn't want to be the one to write it either :)
15:28bendlasHey folks
15:45LauJensenbendlas: hey :)
15:45cemericklrenn: I think you heard me say that something like mod_ring would be a PITA / not really worth it
15:45bendlasLauJensen: just trying to reproduce an issue with cql so I'll be able to report
15:46LauJensenbendlas: ehm.. there are no issues with cql ... :)
15:47bendlasLauJensen: of course not, just instances where it might be able to forgive :)
15:48bendlasone I can tell you right away: :fn/tbl2.col gives fn(tbl1.tbl2.col)
15:49LauJensenbendlas: You should check out my latest tumblr/offtopic post, I show how to implement an Oracle SQL compiler in ClojureQL
15:49bendlaswill do
15:49LauJensenbendlas: yea you should qualify in a col-spec. It will auto qualify to the table you're working on
15:50LauJensens/should/shouldn't/
15:50sexpbot<LauJensen> bendlas: yea you shouldn't qualify in a col-spec. It will auto qualify to the table you're working on
15:50rata_what is java.util.concurrent.ThreadPoolExecutor$Worker for?
15:50bendlasok, but consider when you want to aggregate a join
15:51bendlasmight not be feasible to aggregate before, if you want to join on an aggregated col
15:52LauJensenbendlas: Have you checked out the example for joining on aggregates that are already there?
15:53bendlasthose in the README, will check the examples file
15:57LauJensenbendlas: btw, you're welcome in #clojureql :)
15:58raekrata_: probably an internal class (as it is not listed in the javadoc) used by java.util.concurrent.ThreadPoolExecutor
15:58raekClojure uses two ThreadPoolExecutor to execute the functions sent to agents (one pool for send and one for send-off)
16:00rata_raek: I'm wondering because that class is taking almost all the time in the profiling and I don't understand why
16:01raekare you using futures or agents a lot?
16:01LOPPlol because that class runs agents and futures
16:02rata_raek: yes, agents a lot
16:03raekI guess that simply means that the majority of the work in your program is done in agents, rather than in the repl thread
16:03rata_the main problem is the app seems to sleep forever, when I send more than n times to each agent
16:04LOPPmaybe too much thread switching then?
16:04raekdo you have blocking code in the functions you send to the agents?
16:04LOPPare you using send or send-off for agents?
16:05rata_I'm using send
16:05rata_and I'm not doing IO in the fn passed
16:06raekno Thread/sleep?
16:06rata_no
16:08LOPPsend has limitations
16:09LOPP&(doc send)
16:09sexpbot⟹ "([a f & args]); Dispatch an action to an agent. Returns the agent immediately. Subsequently, in a thread from a thread pool, the state of the agent will be set to the value of: (apply action-fn state-of-agent args)"
16:09LOPP&(doc send-off)
16:09sexpbot⟹ "([a f & args]); Dispatch a potentially blocking action to an agent. Returns the agent immediately. Subsequently, in a separate thread, the state of the agent will be set to the value of: (apply action-fn state-of-agent args)"
16:09LOPPanyway try with send-off
16:09LOPPit uses a separate worker pool and can take more threads at once or some such jibba-jabba
16:10raekbtw, does anyone have a program publicly available that utilizes agents in its design?
16:10LOPPI forgot what exactly was the diff
16:10LOPPrhickey's ants...
16:10raekLOPP: that's about the only program I have seen so far... :)
16:11raekthe thread-pool that send-off uses does not have a fixed size
16:11LOPPI've seen others
16:11LOPPin book about clojure
16:11LOPPcan't be arsed to copy is here
16:11raekif there is a free thread, it will be used. otherwise a new will be created.
16:16callasgunnari'm noob, i have the Stuart Halloway's book on clojure and I'm struggling. I have recursive function over a list. How do I stop ? How do I check that the message passed to me is not nil?
16:18rata_callasgunnar: (seq message)
16:19tonyl(if (seq mylist) (my process ..) (recur ...))
16:22callasgunnarrata_ and tonyl thx!
16:34rata_LOPP: send-off seems to help, but it also sleeps indefinitely :(
16:40raekrata_: sleeps indefinitely when it supposed to do stuff, or after it is done?
16:40rata_is there a way to say "wait for at least x of y agents"?
16:40rata_when it's supposed to do stuff
16:41raekdo you have some code that we can look at?
16:43rata_the code of the fn is very simple, it creates n agents, call m fns on each of them, wait for them, and then return the dereferenced values... this is the fn: https://github.com/rhz/kapjure/blob/master/src/kappa/chamber.clj#L299
16:44rata_and it's called from here: https://github.com/rhz/kapjure/blob/master/test/kappa/simple_models.clj#L17
16:45raekfor just starting off calculations in separate threads, consider 'future'
16:46rata_I'd like to use agents, because I'm planning to intercommunicate them in the future
16:47rata_anyway, thanks for the advice, I'll make a version of the fn using futures to see if that solves the problem
16:49raekas long as the function you send to the agents does not have any side-effecs, I don't se why you code, in principle, shouldn't work
16:52kjeldahlYay! Finally figured out how leiningen checkout works (relax, haven't had the time to look into it until now). It simply adds the symlink paths with "/src" and "/classes" appended. To make this work with for instance incanter, you need to build the incanter submodules with "lein javac" to get stuff in the "/classes" dir for each module.
16:52kjeldahladds the symlink paths TO THE CLASSPATH I meant.
16:54kjeldahl"lein deps" will still pull in the dependencies, so if there's nothing in the "/classes" dir, it will use the downloaded jars instead. So you need to be careful.
16:56ossareh'lo all
16:57kjeldahlleiningen CHECKOUTS, sorry, it's getting late
17:06neotykhow common are persistent data structures in other functional langs?
17:07chouserscala had immutable collections, but they weren't persistent, required internal locks, etc.
17:08neotykhow about other langs, outside of jvm land?
17:09brehautpresumably haskell does
17:10neotykI'm trying to figure out a topic for presentation to mostly academic crowd
17:10neotykthey are experts in FP
17:10rata_raek: thanks a lot! using futures the fn is much nicer and shorter now and it works (althought it presumably consumes a lot more memory)
17:10neotykbut would like to show them something that would get them interested it teaching Clojure
17:10brehautcalculating pi with a spigoted stream?
17:11neotykbrehaut: what is it/
17:12neotyklocal expert, google, doesn't help me much
17:12brehautits a very very academic haskell lecture i once sat through
17:12brehautinteresting but entirely confusing for an FP no0b ;)
17:13neotykis it really written spigoted?
17:14brehautprobably not
17:14brehauti'll see if i can find the paper
17:16brehauthttp://www.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/spigot.pdf
17:17brehaut'Unbounded Spigot Algorithms for the Digits of Pi' is the title
17:17neotykbrehaut: thank you
17:22brehautneotyk: in seriousness though, i think you might find it hard to impress expert FPers with uniqueness of any feature in clojure, but if you show how the pieces fit together in a cohesive whole you might have better luck
17:24neotykbrehaut: this is my doubt as well, I want to learn from them in first place, and share some joy I found programming clj
17:24neotykI know that real life software will not impress them, as it is not very much real for them
17:26brehautwhat will impress them vs what will leave them disappointed will also depend what school of FP they are from too; eg lispers vs ml/haskellers
17:26neotykand to be fair comparing to problems they work with is a bit lame
17:26hiredmanyou might show them something like cascalog
17:26neotykhaskell is strong there
17:27hiredmanI mean, academics love prolog, right?
17:27brehauthiredman: oh yeah good idea
17:27brehautneotyk: have you seen nathan marz introduction video to cascalog ?
17:28neotyknot yet
17:28neotyklooking now at http://nathanmarz.com/blog/introducing-cascalog-a-clojure-based-query-language-for-hado.html
17:28brehautneotyk: http://sna-projects.com/blog/2010/11/clojure-at-backtype/
17:29neotykhiredman: thanks!
17:29brehautbbl
17:29hiredmannp
17:32rata_raek: the only problem with futures is that they start one thread for each future. agents used a thread pool instead
17:32hiredmanfutures also use a threadpool
17:33hiredmaninfact futures use the same threadpool as agent actions when the action is sent via send-off
17:33hiredmansend-off (and futures) use an unbounded threadpool
17:33hiredmansend uses a threadpool that is limited to core count + 2 threads
17:34LOPPneotyke, I don't think you can impress FP nuts with clojure features
17:34LOPPhaskell is much more pure and academics love it
17:35LOPPthe advantages of clojure compared to haskell are elsewhere: concurrency-ready, wide platform, huge java api and third party libraries
17:37@rhickeyLOPP: Haskell has good concurrency support
17:38hiredmanthere is a neat video on youtube of spj talking about nest data parallelism in haskell
17:39hiredmanhttp://www.youtube.com/watch?v=NWSZ4c9yqW8
17:39@rhickeythat's different
17:39@rhickeyparallelism != concurrency
17:39KirinDaveIs there a better way to macromatically express Some.Java.Class/FIELD?
17:39KirinDaveI'm trying to clean up my scala-singleton->clojure importer
17:40KirinDaveIt seemed like ~x/~y wasn't working right for me.
17:40KirinDaveSo I settled on this: https://gist.github.com/726235
17:40hiredmanrhickey: sure
17:41hiredmanhe mentions the desire to make sure it plays well with the concurrency primitives like mvars
17:41hiredmanso you don't have to choose either or
17:42raekrata_: you could create your own thread pool and submit your fns to that
17:42raekhttp://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool(int)
17:43raekthe submit method returns a Future object (just like clojure's "future" function)
17:43rata_raek: thanks! I'll check it =)
17:45rata_raek: can I also deref what the submit method returns then?
17:45hiredmanno
17:45hiredmanyou have to call .get
17:46rata_ok, thanks
17:46hiredmanunless you implement your own threadpool and have it return clojure futures
17:53raekrhickey: There seems to be a lot of goodies in java.util.concurrent. Is the reason for that there are not many clojure wrapper functions for most of the stuff there that one is expected to interface with them directly using java interop? Could one say that Clojure does not add stuff when the the corresponding stuff in java already does the job?
17:54@rhickeyyes
17:56raekok. thanks! :)
18:02technomancyrberger: are you using the leiningen cookbook on cookbooks.opscode.com?
18:05rbergertechnomancy: Not right now I don't think
18:05rbergerShould I?
18:05technomancyrberger: well... I vaguely recall convincing you not to
18:05rbergerWe're not yet using leningen in production....
18:05technomancyor at least not to use it for deployment
18:05technomancybut it would actually be useful for vagrant VMs
18:05rbergerAh,
18:06technomancyanyway, we just created a new leiningen cookbook as part of a chef training session; was wondering if it could be merged with yours
18:09rbergerSure, please do!
18:10technomancycool; could you add me as a collaborator on cookbooks.opscode.com?
18:10rbergerOk, I'll do that now.
18:15rbergertechnomancy: Did you mean on github? Or in cookbooks.opscode.com? I made you a collaborator at https://github.com/rberger/Runa-Public-Chef-Cookbooks/tree/master/site-cookbooks/leiningen/
18:15rbergerNot sure how to add you as a collaborator on cookbooks.opscode.com...
18:18KirinDaveHey guys
18:18KirinDaveIs there a better way to compute mod-field-sym and have it defined in the namespace?
18:19KirinDaveThis code works, but it feels wrong: https://gist.github.com/726235
18:19dakronehow do people feel about the Apache License? I got an invitation for one of my projects to be part of a project in the Apache Incubator, but I'm not sure about the licensing stuff
18:19dakroneright now it's EPL-licensed
18:19technomancyon cookbooks... I'm not sure quite the trick for it since I don't have any cookbooks of my own
18:20technomancydakrone: the requirement to add a license header to every single file is really annoying
18:20rbergertechnomancy: I'll poke some more on cookbooks
18:20technomancybut the license is legally is like MIT plus patent protection.
18:20technomancydakrone: so you would lose the weak copyleft-ness
18:21dakroneI have no idea whether that would be a good move to make, library-wise
18:21technomancydakrone: IMO the bureaucracy of the apache foundation looks pretty stifling
18:21technomancyI don't really see it conveying much in terms of benefits.
18:22dakronethe only real benefit I see if that it gains the java library's "blessing" an approved API for clojure
18:23technomancyoh, if it's built on an existing Apache library then it probably makes sense.
18:23dakronewell, the library wasn't originally part of Apache, they just got invited to the ASF and offered an invitation to be part of the project to me as well
18:24dakronewell, the Apache Incubator, not the ASF
18:24technomancyrberger: thanks
18:27rbergertechnomancy: Cookbook collaboration enabled.
18:28technomancyvery nice
18:28leafwanybody using incanter? Is there a way to set the first and last values of the X axis only, for a bar-chart?
18:34zkimdakrone: is that your opennlp lib?
18:35dakronezkim: yea
18:35zkimdakrone: cool, congrats
18:36dakronethanks, not sure what to make of it yet
19:03rata_leafw: has you tried incanter.charts/set-x-range?
19:28defnhttps://github.com/harukizaemon/hamster
19:37defnCurious if anyone has checked out hamster...
19:41tomojwhoa
19:41tomojthanks to my clojure doc example, when I googled for 'clojure hamster', my old hamster's name came up, pretty surprising for a second..
19:42tomojhuh, clojuredocs seems broken
19:48defnhaha tomoj -- this is a ruby thing
19:48defnbut it's interesting nonetheless
20:00joshua__In the zipper module the make-node function is taking [loc node children].. can I please have an explanation of what the node part is for?
20:00joshua__It seems like no matter what I put as node it is ignored.
20:11tomojjoshua__: hmm
20:11tomoj,(require 'clojure.zip)
20:11clojurebotnil
20:13tomoj,(clojure.zip/make-node (clojure.zip/vector-zip [1]) (with-meta [] {:foo 3}) [])
20:13clojurebot[]
20:13tomoj,(meta (clojure.zip/make-node (clojure.zip/vector-zip [1]) (with-meta [] {:foo 3}) []))
20:13clojurebot{:foo 3}
20:13tomojthe return value of make-node inherits the metadata of the node argument
20:14tomojfor vector zips at least
20:37defnhttps://github.com/headius/cloby
20:37defnClojure Ref/STM plugin for JRuby!
20:37defnone more step towards a sane environment to program in
20:37defnmethinks that this coupled with hamster could make me actually enjoy some of the ruby i do at work
20:38tomojmultithreaded ruby?
20:39defnmostly rails work -- the persistent immutable structures hamster provides are awfully nice. With the STM there for coordination that could be cool.
20:39defnI'm not sure how feasible it is to be perfectly honest with you. Talk me down off the ledge! :)
20:43joshua__tomoj: So are you suppose to use make-node along with replace or something like that to create a branch within an existing tree?
20:43p_l|homemain issue keeping threading non-concurrent in Python and Ruby is the interpreter implementation, afaik both JRuby and Jython don't have that issue
20:50tomojjoshua__: dunno
20:56lancepantzwe use have too many native gems in our codebase for jruby to be feasible
20:57lancepantzi started down that path at one point, but it just became a mountain of work
20:58mlmhello fellow clojurians
20:58p_l|homeheh. I guess it is sometimes better to have proper FFI instead of such embedding of C code :D
22:16technomancyLeiningen 1.4.0 is out: http://bit.ly/lein-news
22:18hiredmanhuzzah
22:18cemericktechnomancy: congrats; seems like a big step forward :-)
22:20technomancycemerick: it's 0.9 better than the last release!
22:20cemerick:-D
22:20cemericktechnomancy: I keep saying, you should try your hand at tech marketing/positioning. ;-)
22:20cemerickNames, slogans, etc.
22:21cemerickIt's a one-stop-shop.
22:21brehauttechnomancy: woo :D
22:24technomancyactually this release is pretty boring; consolidating plugins and preparing the ground for a 2.0 based on maven's aether.
22:25cemericktechnomancy: did you notice the really-honestly-ready patch for 322 waiting?
22:26p_l|homehmmm... Anyone has any experience in teaching clojure to people who know Java and *uknown* set of other languages but probably no Lisp (hit-by-bus prevention)?
22:26technomancycemerick: yeah, now that this release is off my plate I hope to have a chance take a look.
22:26cemerickThat'd be great :-)
22:26cemerickThis one even has tests. :-P
22:27technomancyI actually added a workaround in lein now for people stuck on 1.2; it will clear out .class files that don't have a corresponding package in src/.
22:27technomancybut I'd much prefer to treat the problem rather than the symptoms
22:29p_l|homeSo I need to know how long it might take to teach someone enough to work on codebase written by another?
22:30cemerickHere's hoping 1.3.0 isn't *too* long in coming. I suspect that there would be broad support for a 1.2 patch release that contained a fix for 322 otherwise.
22:30brehautp_l|home: its entirely dependent on their motivation to learn something that might be perceived as unnecessary. you dont want to come across as a pushy ass
22:31p_l|homeheh
22:31technomancyit's complicated since 1.3.0 isn't backwards-compatible =\
22:31p_l|homebrehaut: I guess I might not have lots of chance there :)
22:32cemerickBreakage, thy name is progress.
22:32cemerickhrm, probably vice versa.
22:32technomancyyeah, the "=\" was perhaps not quite what I meant
22:33cemerickSurely all of human emotion can squeeze through six emoticons.
22:33p_l|homeThough the reason behind use of Java is IMHO broken ("because everyone here knows java so we won't have to mix different languages")... because we already have to mix JavaScript and quite possibly Postgres' variant of PL/SQL
22:34brehauttechnomancy: ive managed to break my basicly brand new lein install; it's telling me it cant find clojure. any pointers?
22:35technomancybrehaut: paste the details?
22:39brehautp_l|home: if you cant handle that sort of reasoning, i have some bad news for you
22:45chetttest
22:46pdknobody's expecting clojure to whisk that away pl
22:49p_l|homepdk: I know it won't remove that. It would probably make it easier to implement certain parts of it
22:50p_l|homeJust like why I'm avoiding most of the Java-based Web stuff, because I can replace quite big chunk of it with one-two JRuby files that will do the whole job the Web-facing component needs to
22:52p_l|homeand no-one in the team has any previous experience doing Web stuff in Java
22:55mlmI have a question re: use of a java.util.concurrent.Semaphore (as a ref so that multiple threads can access it) inside of a dosync block. When a thread blocks on the P operation (or acquire), it seems to be causing deadlock. How can I use semaphores between threads?
22:57headiusonce you start using java synchronization primitives, you're on your own
22:57headiusI'm not a clojure guy, but they're subject to normal java synchronization policies
22:57mlmahh
22:58headiusdosync or otherwise
22:58mlmi'm not a java guy, and i'm a very new clojure guy
22:58mlmmakes sense
22:58mlmstick to Clojure concurrency mechanisms
22:59mlmi wonder if there is a way to sort of 'break' out of a dosync block? like a break statement?
23:00chettJust getting started. I can't seem to load my project.clj when running emacs + slime and M-x lein-swank. My sample code is here : http://github.com/chett/oad. -> Unable to resolve symbol: defproject in this context. Any tips?
23:00mlmnevermind, sorry, I seem to be asking dumb questions tonight. thanksf for your help!
23:02technomancychett: project.clj runs in the context of Leiningen, not inside your project's JVM
23:02Deranderchett: see http://github.com/andymoreland/smucket for a project.clj file
23:02Deranderchett: the important part is swank-clojure down in dev-dependencies
23:03headiustechnomancy: only one remains to confirm on Mirah license
23:03headiushad to send him a Github message though...no telling
23:03Deranderchett: once you have that, run "lein deps" in the project root w/ a shell, and then "lein swank". From emacs, do slime-connect after the swank server boots
23:03technomancyheadius: cool
23:04technomancyheadius: I was able to relicense swank-clojure with ~30 contributors in a week or so; it was easier than I feared.
23:04headiusyeah, most folks are still "around"
23:04headiusrelicensing JRuby circa 2006 was a big headache
23:04p_l|homewhy relicense?
23:04technomancyhelps to have a young project
23:04Deranderchett: let me know if you run into trouble. I had a hell of a time getting clojure/emacs to work together at first
23:04headiusby 2006 there were something like 40 contribs
23:04technomancyheadius: oh, didn't realize you had already gone through that. sounds like a pain =\
23:05headiusI didn't do it :D
23:05chett:Derander ,:technomancy thanks, will keep you posted
23:05headiusenebo handled that
23:05technomancyheadius: what was the old license?
23:05headiusit was always GPL/LGPL, and we added CPL for commercial products
23:05headiuslike a month before CPL was deprecated in favor of EPL
23:05technomancyis it EPL now?
23:05headiussigh
23:05technomancyugh
23:05headiuswe haven't wanted to go through the hassle again
23:05headiusand we probably have hundreds of contribs now
23:06technomancywas there no upgrade path for cpl -> epl?
23:06headiusdunno
23:06headiusyeah
23:06headiusI don't care one way or the other but closed-source companies are terribly fearful of GPL
23:06headiusperhaps for good reason
23:06technomancyIIUC if you specify the Eclipse Foundation as the steward of the license then they can specify a successor license
23:06headiusso I'll probably be apache 2.0 forever
23:07technomancyif flaws are discovered in the EPL 1.0
23:07headiuseveryone seems fine with apache
23:07headiusbleh, one of those nights where step debugging won't step through the method you expect it to
23:09p_l|homeheadius: not really, a big chunk of the market nowadays is more than happy to ignore certain issues of GPLv2... the thing is, Common Lisp (not necessarily Clojure) code *really* doesn't like it, due to murkiness of terms like "linking", "runtime" etc.
23:09headiusp_l|home: yeah, that's what we've run into
23:09headiusno concrete fear just a general one
23:09headiusthe grayness of linking
23:10p_l|homeheadius: for example, in case of CL, GPL and LGPL are flat out if you don't want to relicense the whole thing under GPL
23:10headiusthere are conflicting opinions about whether dynamic linking constitutes linking under GPL too
23:10chettquit
23:10p_l|homeand then there's the fact of inclusion of projects that might have completely different licensing, including the implmentation (a big issue with CLISP is its license, for example)
23:11headiusif someone would make a concrete statement about that, a lot of those problems would go away
23:11headiusp_l|home: yeah, we have that problem in jruby
23:11p_l|homeheadius: heh, you have dynamic linking. CL doesn't exactly have it :D
23:11headiuswe *think* most of the libs jruby ships with are compatible with all three licenses
23:11headiusbut we don't really want to know if they're not
23:11p_l|homeloaded code in CL becomes part of the image instead of being dynamically linked
23:12headiusit's just so far removed from the problems we want to be solving
23:12headiusyeah I suppose so
23:12p_l|homeI guess Smalltalk has similar issue. Java has convenient dynamic-loading system compared to CL
23:13headiusright...but Sun et al have felt the need to have a "GPL with classpath exception" even then
23:13headiusbecause it's so murky
23:13headiustechnically every single class in Java is dynamically bound :D
23:13headiusand I'll testify to that in court
23:14headiustechnomancy: yeah, we might as well have a JPL for JRuby
23:15headiushmm, ok...what do you do when there's only one impl of a given method, and it's not getting hit for a breakpoint
23:15headiusperhaps you quit and try tomorrow
23:16headiusor you set its Ruby visibility appropriately...d'oh
23:25chett:Derander - I did the following 1) Add :dev-dependencies[[swank-clojure "1.2.0"]]) to project.clj 2) lein deps 3) from shell $lein swank & 4) Opened emacs, M-x slime-connect 5) opened project.clj 6) C-c C-l gives Symbol's function defintion is void inferior-lisp-proc
23:26Deranderchett: where'd you install slime from?
23:26Deranderchett: cvs slime or elpa slime-repl/slime?
23:27chett:Derander elpa
23:27Deranderchett: when you ran slime-connect, did it pop open an repl buffer?
23:27Derandertry C-c C-z
23:28chett:Derander Yes the repl buffer came up
23:28Derandercan you evaluate expressions in it?
23:29chett:Derander yes
23:29Deranderwhat is C-c C-l bound to? I'm not familiar with that
23:30Deranderslime-load-file?
23:30chett:Derander similar to C-c C-e, it loads the file i believe
23:31DeranderC-h c will tell you definitively the function that a keybinding is bound to
23:31DeranderDoes C-c C-k work?
23:31chett:Derander no
23:32Deranderstrange
23:32Deranderso you *can* use the repl buffer to eval clojure, but for some reason slime isn't finding the inferior lisp process?
23:33chett:Derander also on M-x slime connect i get the message : Versions differ nil (slime) vs. 20100404 (swank)
23:33DeranderI've never found that to be a problem
23:33Derander(mine does that too.)
23:33chettok
23:34Deranderdo you have swank-clojure and clojure-mode installed from elpa? not sure what it would do
23:34Deranderthey would do
23:34chettyes they were installed from elpa
23:35technomancyif you install from my package source you shouldn't get that error
23:36chettSurely I've missed something
23:36Deranderwait
23:36Deranderare you trying to load-file the project.clj file?
23:36Deranderslime-load-file*
23:37technomancyyeah, that's not supposed to work
23:37Deranderchett: ^
23:37Deranderif you are, you don't need to
23:37chettOK
23:38chettI guess I didn't ask the right question
23:38technomancyproject.clj only gets loaded by leiningen, not by your project's code
23:40chettOk If i have tests defined in myproject/test/myproject/test/myproject can i run them from a slime repl connected to lein swank
23:41technomancysure; load the file and run (clojure.test/run-tests 'myproject.test.myproject)
23:41technomancyor use clojure-test-mode for a nicer interface
23:47chett:technomacy I get clojure.test class not found
23:55chett:technomancy, :Derander thanks for steering me in the right direction. Hopefully I'll be able to field noob questions soon enough!
23:58technomancychett: yeah, will need to require clojure.test.