#clojure logs

2010-05-06

00:32vIkSiThmm. slyphon, MadWombat - is there an equivalent of re-sub that will replace not just the first match?
00:33slyphonre-gsub
00:33vIkSiTah
00:33vIkSiT,doc re-gsub
00:33clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.core/doc
00:33vIkSiT,(doc re-gsub)
00:33clojurebot"clojure.contrib.str-utils/re-gsub;[[regex replacement string]]; Replaces all instances of 'pattern' in 'string' with 'replacement'. Like Ruby's 'String#gsub'. If (ifn? replacment) is true, the replacement is called with the match. "
00:33vIkSiTthx slyphon
00:33slyphonsure
00:33slyphon:)
00:39_brian2_noob question> how true is this from stuart's book : " (exception handling )... simply is not required." ?
00:40_brian2_Like a url fetch , which crashes
00:52Blackfootare there characters not allowed in (comment) forms? i'm using 1.1.0 and getting Invalid token errors in a long (comment) form
00:52slyphonBlackfoot: (comment) must be readable
00:53slyphonby the compiler
00:53slyphonnot true for ;; comments
00:53Blackfootah interesting
00:53Blackfootok, thanks
00:53slyphonsure
00:54hiredmancomment is a macro
00:55hiredmanand things inside (comment ...) must be readable by the *reader*
00:55hiredman,(doc comment)
00:55clojurebot"([& body]); Ignores body, yields nil"
00:55Blackfootah i see. i thought it would just evaluate anything, haven't had much experience with the read
00:55Blackfooter
00:55Blackfootjust NOT evaluate
00:56Blackfootmakes sense, though, and i'll just use ;
01:18alexykare things supposed to be faster when ran stand-alone vs. from repl?
01:19chousernah
01:20alexykgood
01:21MadWombatseems like compojure 0.4.0 is acutally nothing more than some macros to make ring routes
01:33defnnothin wrong with that really
01:36replacaif there's less, maybe they can take the time to write some decent documentation
01:46defnthat'd be nice
01:52defnwho was talkin about cupboard?
02:09LauJensenMorning all! :)
02:10mabes__need to go to bed.. it is midnight here. :)
02:19maravillasand a good middle of the night to you, LauJensen
02:19LauJensenthanks :)
02:29slyrusevening
02:30slyrusi don't suppose anyone ever fixed the slime/swank-clojure problem that cropped up back in october?
02:36tomojwhat problem was that
02:37tomojedge slime?
02:39slyrusslime changed the way it was passing some symbols around and now (then?) tries to evaluate something that isn't a valid clojure symbol
03:04LauJensenRaynes: You there?
05:14defncschreiner: ?
05:15defnalso could someone explain a situation where you'd use nil?
05:15defnerr (comment)
05:15cschreinerdefn: I get this: [INFO] Repository 'clojars' will be blacklisted when lein deps
05:16defnweird
05:16defnwhat version of lein
05:16cschreiner1.1.0
05:16cschreinermaybe an upgrade is due
05:16defnim still running 1.1.0
05:16defnno issues
05:17cschreinermaybe my project.clj contains some odd pieces
05:17defngist it and ill look if you like
05:19cschreinerdefn: http://gist.github.com/391956
05:20defnfirst off, cool project
05:20defn:)
05:20cschreinerwell, it could be cool, if I finish it
05:20cschreiner;-)
05:20defndoes clojure "1.2.0
05:21cschreinerI guess I need some snapshot adding
05:21defn"1.2.0" work? I've been using 1.2.0-SNAPSHOT for clojure
05:21defnand master-SNAPSHOT for clojure-contrib
05:21defnsorry reverse those
05:21defn1.2.0-master-SNAPSHOT for clojure, 1.2.0-SNAPSHOT for contrib
05:22cschreinerhow about swank?
05:22defnlein-swank is right
05:22defnswank-clojure is 1.2.0-SNAPSHOT
05:22cschreinerah
05:22cschreinercool
05:22defnlemme know if that helps
05:23cschreinerI will
05:23cschreinerfails with 1.2.0-master-SNAPSHOT on clojure
05:24cschreinersame with contrib
05:24cschreinerseems like lein just times out on those entries
05:25_atostrange
05:25defnare you behind a proxy or something?
05:25defnmaybe at work?
05:25_atobuild.clojure.org is up
05:25defnyeah i just pulled from it
05:25cschreinerno proxy, but I'll try sudo again
05:25LauJensencschreiner: http://www.mail-archive.com/clojure@googlegroups.com/msg22248.html
05:25sexpbot"Re: Renaming 1.1.0-alpha-SNAPSHOT is causing problems with projects on"
05:26cschreinerLauJensen: interesting...
05:26defncschreiner: another thing to do just to be sure is to lein clean
05:26cschreinerdefn: always does this
05:26defnyou might also consider blowing away ~/.m2
05:26cschreinerdefn: yeah, I have considered reinstalling lein
05:28cschreinerLauJensen: Those error msg's are the same I get, but I'm not behind a proxy
05:28cschreinerweird
05:28defncschreiner: not that you know of...
05:28defn:)
05:28LauJensencschreiner: They were caused by the rename, are you sure "1.2.0" is up as an artifact?
05:29defnLauJensen: he changed to mast-SNAPSHOT and no dice
05:29LauJensenoh
05:29cschreinerthe thing is, my lib is properly populated now, but still having those error messages
05:29LauJensencschreiner: rm ~/.m2 && lein self-install
05:29cschreinerdefn: yeah, not that I know of, hehe
05:30cschreinerLauJensen: yeah, it's time for that now!
05:30LauJensensometime .m2 is all thats standing between me and the bleeding edge
05:30defnyeah, happens often
05:30defni wish there was a way with lein to say in project.clj "this is bleeding edge, keep pulling and replacing no matter what"
05:31LauJensenhehe, /me doesnt make any sense in that sentence :)
05:31LauJensendefn: shouldn't be hard to make, its easy with Gradle/Clojuresque
05:31_atohttp://old.nabble.com/Repository-Blacklist-td15234875.html
05:31sexpbot"Old Nabble - Maven - Users - Repository Blacklist"
05:31_ato"It doesn't remember the blacklist. It does remember individual plugin download failures by virtue of writing incomplete metadata files into the local repo"
05:32defnbingo
05:32_atoso clearing ~/.m2 should fix it
05:32_atostupid maven
05:32defn:)
05:32_atoany sane person downloads under a different name and atomically moves to the final name
05:32_ato;-)
05:32LauJensenwe're mostly an insane crowd
05:33defn5/7 things im using in one of my projects are getting updated daily
05:33_atoso it could have gotten a failed download when build.clojure.org was down the other day
05:34defnyeah
05:34_atoah yeah... by person I meant programmer (so maven should be doing that, not you doing it manually)
05:35cschreinerlein still use a looong time checking for updates from central, didn't do that earlier, still gives me blacklist messages, and populates the lib properly...
05:36cschreinerhorseshit
05:36LauJensenWhat good would that do ?
05:37_atolousy
05:37cschreinersomething is good though, lein swank works now, for the first time in a couple of weesk
05:37cschreinerthanks for the .m2 removal hint
05:38cschreinerguess I just have to trust the system, even if I don't understand it
05:38LauJensencschreiner: You could try Clojuresque instead, see if that works
05:38defnyou /could/ understand it. there's github ;)
05:39cschreinerdefn: need more hours for that
05:39cschreinerwell, lein swank saved the day
05:39cschreinernow I can get rid of the swank-clojure-project habbit
05:40cschreiner(or whatever it's called)
05:41defna habbit is what nuns wear
05:41cschreinerso, I am a nun?
05:41defnheh, i take that back
05:42defni guess it's habit
05:42_mstand they wear them habitually!
05:42defnindeed!
05:42cschreineror hobbit?
05:42cschreinerah, the polling for ever
05:42defnyour curiosity is reminiscent of mr. baggins
05:43cschreinerwhen lein swank, it is correct to use slime-connect ?
05:44_atoyes
05:44cschreinerI get a message about: "Versions differ: 20091016 (slime) vs. nil (swank). Continue?"
05:45cschreinerwhen Yes, it polls forever, needs some updates I guess
05:45cschreinernot true; when Yes, I get a Java Exception about an unmatched delimiter: )
05:46_atosounds like you're not having a great day. :/
05:46_atoare you using swank-clojure 1.1.0 in emacs?
05:47defndon't use swank-clojure anymore
05:47defnit mangles the classpath and stuff
05:47cschreiner_ato: 1.2
05:47_atodefn: swank-clojure is the slime adapter, you need to use it
05:48_atoto use slime with clojure
05:48cschreinerdefn: so I should just remove the dev-dep on swank-clojure "1.2.0-SNAPSHOT"??
05:48_atomaybe you mean M-x swank-clojure-project
05:48cschreinernah
05:48_atocschreiner: I mean swank-clojure.el -- the emacs part
05:49cschreiner_ato: okay, I'll remove that from my init.el
05:49_atono don't remove it
05:49_atojust check the version
05:49_ato(it's listed in the comment at the top of swank-clojure.el)
05:50_atoor if you installed via ELPA M-x package-list-packages should tell you what version you have
05:50cschreiner_ato: 1.1.0
05:50_atoweird
05:50_atoI have 1.1.0 .el talking to the 1.2.0 snapshot jar fine
05:51_atohmm
05:51LauJensensame here
05:52cschreinerrestarting emacs does wonders :)
05:52LauJensen?
05:53LauJensenrestarting emacs??
05:53cschreinerit's okay now
05:53_atoah, cool
05:53cschreinerLauJensen: Yeah, waht?
05:54cschreinervery cool, thanks a bunch
05:58nurvMorning.
06:06cschreinermorning
06:12defnyay for clojure!
06:12cschreiner~max
06:12clojurebotmaxine is http://research.sun.com/projects/maxine/
07:06sparievwhat key-val stores do you guys use with Clojure ?
07:07sparievI need to store byte arrays with string keys, a lot of them
07:07sparievtried mongodb, it uses too much memory IMO, thinking Berkeley DB JE now
07:07AWizzArdspariev: how much ram do you have available?
07:08sparievI'd like to fit in 2Gb
07:09sparievMongoDb uses memory mapping, and it ate about 6-7Gb with my workload
07:11AWizzArdspariev: you want the db to consume 2gb, but the data you will insert is more like +/- 5gb?
07:11GeoffSKnewbie - why does this fail to print - (map println '(1 2))
07:11AWizzArd,(map println '(1 2))
07:11clojurebot(nil nil)
07:11AWizzArddidn't fail
07:12GeoffSK..when its in a one line file
07:12AWizzArd,(let [x (println "hello")] x)
07:12clojurebothello
07:12AWizzArdok, the clojurebot does not show the return value here
07:12AWizzArdbut: println returns nil
07:13sparievAWizzArd: yep, but data does not have to be in memory
07:13GeoffSKit works at the REPL, but not in a file..what am i missing?
07:13AWizzArdGeoffSK: in what way does it fail?
07:13AWizzArdWhat is the error message
07:13AWizzArdspariev: yes, I understood, just wanted to have more details
07:13GeoffSKno printed output
07:13AWizzArdGeoffSK: and how did you run this file?
07:14GeoffSKrlwrap java -cp /home/geoffrey/projects/clojure/clojure.jar:/home/geoffrey/projects/clojure/clojure-contrib.jar test.clj
07:15GeoffSKoops that was the wrong line..i have clojure.main in there to.
07:15AWizzArdhmm, I would more expect a "class not found" exception
07:15AWizzArdcould you show that one please?
07:16GeoffSKrlwrap java -cp /home/geoffrey/projects/clojure/clojure.jar:/home/geoffrey/projects/clojure/clojure-contrib.jar clojure.main test.clj
07:16hoeckGeoffSK: (map println '(1 2)) is a lazy sequence, just loading the file will not cause the sequence to be evaluated
07:16AWizzArdyes, that is expected to output nothing
07:16shifty3spariev: bdb should work for that, I have used it to store much more data than that. you can tune the in-memory buffer size to cap its memory usage
07:16GeoffSKi wondered about it being lazy. printing doesn't force eval?
07:16AWizzArdprint yes
07:17hoeckGeoffSK: on the repl it works, because it is eager to evaluate the result of that (map println ...), so you see 1nil or so
07:17hoeckGeoffSK: but you are not printing the result
07:17AWizzArdexactly
07:17zmila,(- 999999999999999999 (bit-shift-left 999999999999999999 0))
07:17clojurebotjava.lang.ExceptionInInitializerError
07:17AWizzArdGeoffSK: put a second line (println "hi") into the file
07:17zmilapff
07:17sparievshifty3: thanks, I'll try. Did you use any Clojure APIs for bdb ?
07:18hoeckGeoffSK: you are printing each element at each step of the lazy-seq evaluation
07:18GeoffSKthe "hi" is printed nothing else
07:18shifty3no, didn't use it with clojure, actually, just java
07:18AWizzArdGeoffSK: good, then your Clojure installation is working correctly :)
07:18hoeckGeoffSK: (doall (map println '(1 2))) will force the lazy-seq
07:18hoeckor (println (map ...)) will print it additionally
07:18AWizzArdor (count (map ..))
07:19GeoffSKas u expected it prints. but i dont understand
07:19sparievshifty3: oh, ok. just having difficulties with cupboard dbd api, looking for alternatives
07:19shifty3bdb also has jmx mbeans that allow you to change the buffer size while the program is running (using jconsole or visualvm). can be a lifesaver in long-running processes ;)
07:20sparievbdb looks much more mature than stuff like mongo and tokyo cabinet
07:21GeoffSKhoeck: is it because the (map ) is never evaluated and thus nor is the print?
07:21hoeckGeoffSK: exactly
07:21GeoffSKnicely functional. Thanks AWizzArd, hoeck
07:22shifty3yes, it is pretty stable. you may have to tune the default parameters, though. depending on your workload, the log cleaner may have trouble keeping up
07:26AWizzArdGeoffSK: technically speaking the map is evaluated, but the object that it returns isn't.
07:26cemerickreplaca: that set pprint issue was resolved with a full cleanse of the snapshots
07:27GeoffSKAWizzArd: that makes sense.
07:43defnnot the c.contrib version, but their own
09:52replacacemerick: makes sense. I wasn't able to reproduce it here
09:53cemerickyeah, sorry for the goose chase
09:53replacacemerick: no worries, I only spent about 5 minutes :-)
10:22lpetitis my idea (posted on the ml) of getting rid of refer-clojure flawed ?
10:22lpetitrhickey: ^^
10:22chouserlpetit: I failed to find the thread where refer-clojure was originally proposed
10:23rhickeylpetit: all proposals to change Clojure are best left to post 1.2
10:23chouserI seem to recall that idea coming up. If it did, it'd be interesting to see why it wasn't chosen.
10:24lpetitrhickey: ok, but that could be made backward compatible, that's why I talked about it before feature freeze
10:24lpetitchouser: sure
10:25stuartsierraDoes anyone have a link to rhickey's "or-nil" function?
10:26rhickeyhttp://groups.google.com/group/clojure/msg/f251cfd9baab440a
10:26stuartsierrarhickey: thanks
10:27rhickeythat never made ii into contrib eh?
10:30stuartsierrarhickey: dunno, I'd forgotten the name
10:30lpetitstuartsierra: implement your protocol on nil :-p
10:31stuartsierraI actually wanted something simpler: (defn or-nil [pred value] (or (nil? x) (pred value))
10:31stuartsierraI mean (defn or-nil [f x] (or (nil? x) (f x))
10:31clojurebotexecutable jar is a sample executable jar build using ant : http://github.com/cark/clj-exe-jar/tree/master
10:34lpetitstuartsierra: that's -?> , no ?
10:34chouserwell, here's the conversation that led to :refer-clojure http://clojure-log.n01se.net/date/2008-09-03.html#10:56
10:34sexpbot"#clojure log - Sep 03 2008"
10:37lpetitchouser: so I don't see a strong point against my proposed simplification, or did I overlook smth ?
10:37chouserno, I don't see it either
10:38stuartsierralpetit: I guess -?> would have the same effect
10:40lpetitstuartsierra: (or-nil f x) vs (-?> x f) :)
10:41stuartsierralpetit: I prefer or-nil in this particular case (argument checking)
10:41chouserlpetit: ah, here it's actually suggested here, but nobody on this thread seems to take it up (pro or con): http://groups.google.com/group/clojure/browse_thread/thread/1c5cddb04a2e6c1d/d1f3c2a842896b6e?#d1f3c2a842896b6e
10:46lpetitchouser: I don't understand everything, that would take more time I can devote to. I am unable to see whether what I proposed is in contradiction with one of the points raised in this ^^^ thread :-(
10:56stuartsierraWhere do :pre/:post go in a multiple-arity function?
10:57stuartsierranever mind, found it on http://clojure.org/special_forms
11:07RaynesLauJensen: ohai
11:07LauJensenhey
11:07RaynesI'm 8 hours late, but I'm here.
11:07Raynes$mail
11:09RaynesLauJensen: I couldn't do it exactly that way, but I could just include ping with sexpbot or something.
11:09RaynesThe problem is cross-platformness.
11:10LauJensenoh
11:10LauJensenYou described a security issue that sounded specific to *nix
11:10jfieldsis there a better way to do this? (swap! an-atom-with-a-map #(merge-with + a-map %))
11:11RaynesIt is *nix specific, but it doesn't work on Windows regardless. On windows, it always falls back to opening port 7.
11:11RaynesBut shelling out would kill it completely.
11:11Raynes$ping localhost
11:11sexpbotRaynes: Ping completed in 0 seconds.
11:11RaynesIt at least works for some things. :p
11:12nurvHi.
11:12RaynesHello.
11:13chouserjfields: I can't think of anything substantially better.
11:13jfieldschouser: thanks.
11:14jfieldsI'm getting by with what I know, but the occasional tip on idiomatic syntax has been very helpful :)
11:15chouserjfields: many uses of swap! don't require #() like that because many collection functions take the collection first.
11:16chouser(swap! an-atom merge a-map)
11:16jfieldschouser: yep, I've been doing that for sure. I just wanted to make sure I knew the idiomatic way when the first arg isn't a coll.
11:16chouserbut since merge-with takes another function first, this convenient simplicity breaks down and you have to do something to get the args in the right order. #() or partial
11:18chouser(swap! an-atom (partial merge-with + a-map)) should work, but isn't necessarily better than what you have.
11:22RaynesLauJensen: $ping actually works for a lot of sites, it appears.
11:27dnolenmatchure + pre/post is pretty slick.
11:36gilescbhi all, newbie question: is there a way to supply the args to a function when I have the args as a list but the function requires varargs; eg. Python's *args?
11:36puredangerin our drunken wanderings around the clojure design space we have hit on this pattern of using s-expressions as the data structure and creating macros that evaluate an s-expression to itself so that you don't have to worry about eager/delayed evaluation
11:36puredangermy belief is that this is surely a well-explored pattern in clojure/lisp world
11:37puredangerand there are probably explored pros/cons to it
11:37puredangerplease point me in the direction of that information, oh great interwebs of clojure love
11:37Raynes$(apply + [1 2 3 4 5])
11:37sexpbotresult: 15
11:37gilescbthey've failed me for about the last hour and a half :(
11:37Raynesgilescb: ^
11:38dnolen,(str "a" "b" "c")
11:38clojurebot"abc"
11:38dnolen,(apply str ["a" "b" "c"])
11:38clojurebot"abc"
11:38Raynesdnolen: I win. You're late. ;)
11:38gilescbah... many thanks
11:39dnolenRaynes: an extra example never hurt anyone ;)
11:39Raynes;p
11:39chouserpuredanger: I'm not quite sure what you mean, but it sounds interesting.
11:39chouserpuredanger: I hope you don't actually mean calling eval inside a defmacro
11:39puredangerso to give a specific use case, we (by which I mean people sitting in the same room as me) are building a performance testing framework in clj
11:39Raynesgilescb: Anyway, apply applies the function to everything in the sequence as if they were individual arguments. It's magics.
11:39puredanger(no not eval)
11:40puredangerwe could build a representation of a test definition as a data structure, say with vectors
11:40puredangeror records, etc
11:40puredangerand then write code to read that data structure, persist it to a db, evaluate it, etc
11:40puredangerOR we could just say that an s-expr IS the data structure
11:41puredangerbut then you have to worry about it being evaluated at the point of definition
11:41puredangerso we are using a macro like: (defmacro test-def
11:41puredanger "Expand into a list which is itself"
11:41puredanger [label fixture fixture-map & test-points]
11:41puredanger `(list 'test-def ~label '~fixture ~fixture-map ~@(map test-point-as-list test-points)))
11:42puredangerand a test like: (test-def "demo-test" sample-fixture {:x 2}
11:42puredanger (sample-test-fcn {:x 1 :y 2 :z 3})
11:42puredanger (throw (RuntimeException.))
11:42puredanger (sample-test-fcn {:x 10 :y 20 :z 30}))
11:43chouserpuredanger: well, I'm no lisp veteran, but that seems like a perfectly natural thing to do.
11:43puredangerwe then have functions that know how to take an s-expr in this form and import, persist, evaluate it, etc
11:43chouserIt's only a slight specilization of syntax-quote itself, in a way.
11:44puredangeryeah
11:44puredangersurely there is prior art on this as an idea though, right????
11:46puredangerchouser: btw, nice article in infoq http://www.infoq.com/articles/in-depth-look-clojure-collections
11:46sexpbot"InfoQ: An In-Depth Look at Clojure Collections"
11:47chouserpuredanger: thanks!
11:47chouserfogus thanks you too. :-)
11:47puredanger yes, him too
11:48foguspuredanger: Indeed. Thank you
12:01bsteuberis there some default directory java applications should use to store their data?
12:01AWizzArdbsteuber: no.
12:02AWizzArdbsteuber: best thing to use are command line args or environment vars or data coming from a config file.
12:02bsteuberyeah, but then I have to decide where to store my config file :)
12:02bsteuberso same problem
12:03AWizzArdbsteuber: (System/getProperty "user.home")
12:04bsteuberhm, but e.g. on windows I guess it's expected to use "Application Data"?
12:04AWizzArdYour application must have requirements. It can ask the user to provide command line args, set env vars or put something into his home.
12:05AWizzArdbsteuber: on my Windows: "C:\\Dokumente und Einstellungen\\bsteuber"
12:06AWizzArdfogus: that would be another option, yes
12:06bsteuberI'm just looking for a reasonable default per OS that users don't complain about
12:06AWizzArdThe installer with which bsteuber ships his app can setup the right entries in the Registry.
12:07AWizzArdbsteuber: home then. And the manual can reflect this.
12:07bsteuberbut maybe user.home/.my-app is not that bad for a start
12:07AWizzArdAnd you can offer a command line arg/env var which can override this
12:07bsteuberok, thx
12:29tufflaxWhat does the number 1M mean in Clojure?
12:29stuartsierra(type 1M)
12:29stuartsierra,(type 1M)
12:29clojurebotjava.math.BigDecimal
12:29tufflaxah ok, thanks
12:38slyphonso, i ran into an interesting problem trying out 1.2 last night, i have a piece of code that does (bindings [c.c.sql.internal/transaction* (fn [f] (f))] ...) and under that doesn't "stick"
12:39slyphon"under 1.2"
12:40chouserhm. I can't think of a reason why it shouldn't...
12:40slyphonyeah, it's very confusing
12:41slyphonthe sql.clj code doesn't see the binding i established
12:53stuartsierraDoes the &env special argument make any guarantees about the order of its keys?
12:54LauJensen$ping www.bestinclass.dk
12:54sexpbotLauJensen: Ping completed in 0 seconds.
12:54stuartsierraE.g., will (keys &env) return locals in the order in which they were bound?
13:00chouserstuartsierra: no, pretty sure not.
13:01stuartsierraok
13:01chouserstuartsierra: the current implementation probably calls 'assoc' in order, so as long as it's short it probably is an arraymap in the expected order, but as soon as it is long enough to become a hash-map the order would no longer be useful.
13:01stuartsierraright
13:01stuartsierraso, in other words, an implementation detail that I cannot depend on
13:01chouserright
13:05fogusOH on the Intertweets: Q: "What's hot in Groovy these days?" A: "Clojure"
13:05chouserheh. nice.
13:06slyphonhah!
13:06ataggartlol
13:07slyphonwhole buncha languages came along and just ate Groovy's lunch
13:16mabesslyphon, fogus: yeah, I remember seeing a quote from groovy's creator saying that he would have not created it if something like scala existed at the time
13:16slyphonyeah
13:16slyphoni saw that too
13:16fogusmabes: That speaks volumes
13:17chousergroovy's still more dynamic than scala, isn't it?
13:17slyphonyeah, it's just not that "cool"
13:17mabesit is slower though
13:17slyphoncompared to JRuby even, i mean, why would you mess w/ it?
13:18LauJensenchouser: define 'more' ?
13:18mabesyeah, I wonder if he would have created it if jruby was mature back then.. my guess is not
13:18headiusgroovy was originally intended to be a ruby-like language on the jvm
13:18LauJensenmabes: I think it was the maker of Groovy who said, that had Scala existed he wouldn't have bothered
13:18headiusit's been altered drastically since then
13:19mabesLauJensen: heh, yeah, just said that :)
13:19LauJensenhaha
13:19mabesheadius: are does it compare speedwise with JRuby these days?
13:19LauJensenright you are, sorry
13:19mabeser.. s/are/how/
13:27fogusLauJensen: Scala's pretty good at dynamic
13:27LauJensenfogus: Yea, my understanding was that Groovy was up to par
13:28fogusLauJensen: I know next to nothing about Groovy unfortunately
13:28slyphonfogus: eh? it's a statically typed language through and through?
13:29LauJensenfogus: its great for build scripts :)
13:29fogusslyphon: I guess I should caveat that buy saying, Scala's pretty good at appearing dynamic, in certain ways
13:29slyphonhah, agreed
13:29foguss/buy/by
13:29RaynesHe said he "probably" never would have bothered creating Groovy.
13:29Raynesprobably
13:30RaynesAnd that is what Groovyists hang their hat on. :p
13:30slyphonhahaha
13:30LauJensenThats funny
13:30LauJensenDidn't Martin Odersky say that he wouldn't have invented Scala if C++ had been on the JVM already?
13:31LauJensen(j/k)
13:31Licenserda da da
13:33thearthurhow do i write the type of an array of bytes in a defmethod?
13:34thearthurthat dispatches on type
13:35jfieldswhat's the name of the ->> operator?
13:35slyphondouble arrow?
13:35chouserthearthur: I'd recommend (class (byte-array []))
13:35LauJensenjfields: often referred to as the threading operator
13:35LauJensenand -> is thrush I think
13:35jfieldsisn't -> the threading?
13:35jfieldsah, ok, thanks.
13:35slyphonLauJensen: ah, yeah that sounds right
13:36kwertiiHas anyone done (or looked into doing) an Eclipse Rich Client Platform app in Clojure? Googled, nothing obvious.
13:36LauJensenhmm
13:36chouser-> is threading, ->> is piping. But I don't really like those names.
13:36LauJensenNo wait, I think its the other way around
13:36fogusI like arrows
13:36LauJensen$google thrush in clojure
13:36sexpbotFirst out of 141 results is: Ruminations of a Programmer: Thrush in Clojure
13:36sexpbothttp://debasishg.blogspot.com/2010/04/thrush-in-clojure.html
13:36RaynesI like arrows.
13:36LauJensenGo check that out :)
13:36Raynes->>>>>>>>> <-- We need this.
13:37wlangstroth"threading" is an unusual term in a language focused on concurrency
13:37slyphonhahahaha
13:37chouserwlangstroth: yeah, unfortunate
13:37LauJensenSomething I often need, is a threading operator which creates anonymous functions and deferences their results (which are objects) and then finally constructs the return, its calld -@#()>.
13:37wlangstrothLauJensen: hahaha!
13:37slyphon"threading" makes snese in a lexical context though
13:37slyphonhahaha
13:38wlangstrothdoesn't -> chain functions?
13:38cgrandLaujensen, the name for -@#()> is" brochette"
13:38fogusI don't like threading as a name. It implies a connection to Thread
13:39fogusI'd rather say the stich operator, or arrows
13:39LauJensencgrand: oh yea, its already in contrib I see :)
13:39slyphonfogus: eh, i always thought of it as "needle and.."
13:39wlangstroth(it /looks/ like it does)
13:39slyphonfor hash key lookup you're supposed to put the keyword first?
13:39slyphon(:key map) ?
13:40cgrandkwertii: I think lpetit or Gaetan Morice may have tried Eclipse RCP+Clojure
13:41LauJensenslyphon: There was mixed oppinion about that on the ML, but you can do both ofc
13:41headiusmabes: jruby should be faster for ruby code or I'll eat my hat...groovy is probably still faster for calling java from groovy because we have to wrap incoming objects in an IRubyObject wrapper
13:41slyphonhm, yeah i read the style guide, and i was a little confused as to why a distinction was made
13:41headiusI mean jruby running ruby code should be faster than groovy running groovy code
13:42headiuslargely because we don't have multimethod dispatch in ruby
13:42SynrGheadius: did i mention that little issue with jline is solved by a patch provided by the debian maintainer? and in any event, i find rlwrap is nicer :)
13:42slyphonheadius: *sigh*
13:42headiusSynrG: oh really? since I'm supposedle jline admin I should probably know that
13:42kwertiicgrand: Thanks, I'll look for them
13:43SynrGheadius: i *hope* he sent it upstream ...
13:43headiusI don't think I saw it on jline ML, but maybe in issues
13:43SynrGshame on him if he didn't
13:43headiussomehow I got added as an admin on that project
13:43SynrGor maybe he was waiting for me for feedback that it works?
13:43SynrGhmm
13:44SynrGor maybe peter isn't one of the maintainers ...
13:44SynrGhttp://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576814
13:44sexpbot"#576814 - libjline-java: left-arrow, up-arrow adds null to retrieved history line - Debian Bug report logs"
13:49LauJensenslyphon: I think some people felt that (fn :word) was safer than (:word fn) IIRC
13:50slyphoninteresting
13:52LauJensen$google clojure group coding standards
13:52sexpbotFirst out of 1350 results is: clojure.lib coding standards: initial draft brain dump - Clojure ...
13:52sexpbothttp://groups.google.com/group/clojure-dev/browse_thread/thread/d090b5599909497c
13:54LauJensenGreat work sexpbot, slyphon check out Chas Emericks first reply
13:54slyphonah, willdo
14:00jfieldsis there a function that will return {:a 1} from {:a 1 :b 2}?
14:01ipostelnikjfields, select-keys
14:01slyphonselect-keys
14:01jfieldsipostelnik, slyphon: thanks
14:01dermatthiasI want to use the (normal mu sigma) function from contrib.probabilities.monte-carlo, but I have no idea what to do with the result of, for example, (normal 0 1). As far as i can tell, it's a function and has something to do with monads....but that's where I get lost....
14:01slyphon(anyone not familiar with Sesame Street will not get that, but what the heck...)
14:04slyphondermatthias: yeah, weird
14:15dermatthias:)
14:15SynrGslyphon: good article, but yes, taxing :)
14:15dermatthiasself-made solution: (defn normal [mu sigma]
14:15dermatthias (let [r (Random.)]
14:15dermatthias (+ mu (* sigma (.nextGaussian r)))))
14:29MoominpapaThis may sound like a stupid question (possibly because it is) but how do you run the tests for circumspec?
14:30Moominpapalein test definitely doesn't work. Running it in the repl gets the wrong version of clojure.
14:31technomancyMoominpapa: the repl task works in lein 1.2 (dev build); could try that.
14:31MoominpapaThanks, I will.
15:02DeusExPikachuw00t! figured out custom classloading
15:11ataggartDeusExPikachu: Don't forget to account for permgen space
15:14wlangstrothDeusExPikachu: what did you end up doing?
15:18arkahnAre there any queue-like data structures besides clojure.lang.PersistentQueue and seque? I'm looking for a FIFO
15:19chouserPersistentQueue is FIFO
15:19hiredmanthose are called "stacks"
15:19arkahnhiredman: ; ) yes
15:19chouserstacks are FILO
15:19hiredmanright
15:19hiredman<-- reversed
15:19chouser:-)
15:19arkahnchouser: do you know why PersistentQueue isn't more 'public'?
15:20hiredman,(first (conj '() 1 2))
15:20clojurebot2
15:20hiredman,(first (conj clojure.lang.PersistentQueue/EMPTY 1 2))
15:20clojurebot1
15:35dakronewhen extending a protocol with a record, is there a way to mark some of the methods "private" so nothing other than the record can call them?
15:51fogus_Whoops... clojure.lang.PersistentQueue/EMPTY no longer prints as () in v1.2
15:51fogus_That is, PersistentQueues no longer print with parens
15:52fogus_Intentional?
15:52AWizzArdfogus_: how do they now print?
15:52fogus_AWizzard: #<PersistentQueue clojure.lang.PersistentQueue@0>
15:53AWizzArdoh hmm
15:53fogus_Not that it matters, just curious if this was by design
15:54fogus_I always wished they printed out a queue fish: <-(1 2 3)-< :p
15:54AWizzArdyes, exactly what i thought
15:58hiredmanfogus_: print-method …
15:58fogus_hiredman: understood. Just came across it while writing some code and wondered out loud.
15:59hiredmanI'm just saying, if we want fish, we can have fish
15:59hiredmanit does kind of make sense, because a queue isn't a list
15:59hiredman(or a seq)
16:00fogus_hiredman: Ah yes. Maybe I'll add my fish-method to my user file. ;-)
16:00sbtis there a standard way of picking a random element from a set?
16:02hiredman,(defmethod print-method clojure.lang.PersistentQueue [q, w] (print-method "#Q" w) (print-method (seq q) w))
16:02clojurebotDENIED
16:02hiredmanclojurebot: your mother wears army boots
16:02clojurebotMy mother? I'll tell you about my mother
16:03hiredman,(conj clojure.lang.PersistentQueue/EMPTY 1 2)
16:03clojurebot"#Q"(1 2)
16:03hiredmangah
16:03fogus_whoa!
16:03fogus_I didn't think that would work
16:04hiredman,(conj clojure.lang.PersistentQueue/EMPTY 1 2)
16:04clojurebotWrong number of args passed to: core$fn
16:04hiredman,(conj clojure.lang.PersistentQueue/EMPTY 1 2)
16:04clojurebot<-(1 2)-<
16:05hiredman,(pop (conj clojure.lang.PersistentQueue/EMPTY 1 2))
16:05clojurebot<-(2)-<
16:06fogus_Much better. :-)
16:09MadWombatwhere can you get docs on clojure.lang.PersistentQueue?
16:13chousersbt: (rand-nth [:a :b :c :d])
16:18hiredman,Q
16:18clojurebot<-nil-<
16:18hiredman:D
16:18hiredmannil fish
16:18chouserheh
16:18chouser,(conj Q 1 2 3)
16:18clojurebot<-(1 2 3)-<
16:18chousersee, what's wrong with that? nothing!
16:18stuartsierra,(conj Q (list) (list) (list))
16:18clojurebot<-(() () ())-<
16:18stuartsierrafish skeleton
16:19chouser,(read-string (pr-str (conj Q 1 2 3)))
16:19clojurebot<-
16:19stuartsierra,(conj Q (list (list (list))))
16:19clojurebot<-(((())))-<
16:19stuartsierrathat's better
16:19chouser,(conj Q Q Q)
16:19clojurebot<-(<-nil-< <-nil-<)-<
16:19chouserno-longer-hungry fish
16:19hiredmanhaha
16:20MadWombat,(conj 'CLOJURE)
16:20clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$conj
16:21MadWombat(conj Q ('CLOJURE))
16:21MadWombat,(conj Q ('CLOJURE))
16:21clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: Symbol
16:21MadWombatheh
16:22chouserso close.
16:22chouser,(conj Q 'CLOJURE)
16:22clojurebot<-(CLOJURE)-<
16:25chouser,(-> (partial conj Q) (iterate 0) (nth 3))
16:25clojurebot<-(<-(<-(0)-<)-<)-<
16:27lpetitany ccw user here ?
16:28fogus_,(conj Q Q Q) ;; empty calories
16:28clojurebot<-(<-nil-< <-nil-<)-<
16:28lpetitany emacs user here ? :)
16:30chouserPeristentQueue stopped printing as () with 1b8d5001ba094053b24c55829994785be422cfbf
16:30chouserso I'd guess it was unintentional.
16:32lpetitchouser: congrats, you were the first to write something on #clojure. You won the right to review the feature list of keyboard shortcuts of the ccw editor: http://code.google.com/p/counterclockwise/wiki/EditorKeyBindingsFeatures ;)
16:32sexpbot"EditorKeyBindingsFeatures - counterclockwise - This page details keybindings and other feature of the editor - Project Hosting on Google Code"
16:32lpetitwhat is sexpbot ? what did trigger it ?
16:32chouserlpetit: the url triggered it
16:32chouserhttp://google.com/
16:32sexpbot"Google"
16:33lpetitchouser: isn't that a little bit too invasive ?
16:33lpetit,http://google.com would be less invasive, wouldn't it ?
16:33clojurebotjava.lang.Exception: No such namespace: http:/
16:33sexpbot"Google"
16:33chouserI haven't formed an opinion
16:33lpetit:)
16:34lpetitchouser: If by chance you really look at the page I provided, notice that the "split" between "basic edition mode" and "structural edition mode" is not done yet (that is you are in ccw either in paredit, either not)
16:35lpetitchouser et al: I'm currently working on "polishing" the documentation of the port of paredit to ccw, and also "easing the use of newbies" by providing a basic mode and an "advanced" mode
16:35chouserwhat's <Suppr .>
16:36dnolenso how long before Code Quarterly interviews rhickey ? :)
16:36lpetitOh, maybe it's some french : it's the "forward delete". How do you write that in french ?
16:36lpetits/in french/in english/
16:36sexpbotOh, maybe it's some french : it's the "forward delete". How do you write that in english ?
16:36lpetitwow
16:36chousermeh
16:37lpetitwho wrote sexpbot ?
16:37chouserRaynes, I believe.
16:37lpetitsexpbot: identity please
16:37chouserlpetit: maybe Delete or Del instead of Suppr? I'm not sure.
16:38lpetitchouser: Let's go with <Delete> ?
16:38chouserlpetit: it's not a modifier, right? you don't usually press it along with something else?
16:38lpetitchouser: right. why asking ?
16:39chouserjust making sure we're communicating successfully. :-)
16:39lpetitchouser: is there a convention of *only* placing modifier keys between <> ?
16:39chouserno
16:40lpetitchouser: done for <Delete>. Other remarks ?
16:41chouserI want to use it! But I don't want to use Eclipse.
16:44lpetitchouser: When I think ccw is ready to *globally* impress emacs users, I'll say it on the clojure ml :). Anyway, thanks for the kind words.
16:44chouserMaybe if I were an emacs user I'd be content with paredit there.
16:44lpetitchouser: note that the underlying features for the basic and structural edition modes is pure clojure, depending only on clojure and clojure.contrib, and is available in an independent (from ccw) github repo
16:45lpetitchouser: you're a user of ... which editor ?
16:45chouseryeah, I've heard you say that. If I ever pick up textjure again, I'll be certain to look into using your code there.
16:45chouserlpetit: vim
16:46lpetitchouser: I'm not proud of the way I've written the code, but it's guarded by a bunch of unit tests, so at least it works :)
16:46chouser:-)
16:46lpetitchouser: oh vim, ok, so you're in Meikel's team :-)
16:46lpetitMust go to bed, thanks for the chat, cu
16:46chouserg'night
16:47Licenserbed is a good idea, night people!
16:49riddochcI've also broke down and started using 'rake' for dealing with building stuff...
16:50chouseranything that helps you write clojure code is a good thing. :-)
16:52riddochcchouser: Pretty much, yeah. I've been working on implementing a wiki that uses git as its storage backend in clojure + compojure.
16:53riddochcJust playing around, really.
16:54chouserexcellent. That's the one thing I'm sure wave got wrong -- not building on something with complete revision semantics.
16:55riddochcWave? How so?
16:55chouserwaves have linear history. no forking, branching, merging...
16:55chouseryour wiki will not be so constrained. :-)
16:56riddochcWaves as in Google Waves?
16:56chouseryeah
16:57riddochcAhh, I see. Well, you also can commit more energy to your project... Have no fear of serious competition from me. :)
16:57rfgAs opposed to linear wave theory.
16:59riddochcliner wave. Not an oxymoron?
17:00rfgNot in this context, no.
17:01riddochcOkay.
17:04tufflaxHm, how can I remove a specific element from a collection? I would like something that works like this: (delete 1 '(9 6 1 3 1)) -> (9 6 3 1) but after some looking I can't find anything like that.
17:06chouser,(remove #{1} '(9 6 1 3 1))
17:06clojurebot(9 6 3)
17:06chouserbut that got rid of both. is that not what you wanted?
17:06tufflaxno hehe
17:08DuneManYou want to remove the first item?
17:08DuneManfirst occurance of an item?
17:08tufflaxI was trying to fix the all-permutations example found at the bottom here http://kyle-burton.livejournal.com/14970.html
17:08sexpbot"kyle_burton: List Comprehensions in Clojure"
17:08tufflaxyes duncanm
17:08tufflaxoh, DuneMan
17:08DuneMan(next (take-while #(not (= % 1)) s)) ; ??
17:08riddochcWell, I might start with (take-while (comp pred) list) to get everything up to the 1...
17:09DuneManer, yeah, mine is broken, riddoch is right ":-)
17:09DuneManyou can use ... split-at or whatever
17:09riddochcAh, yeah.
17:10tufflaxHm, any particular reason that there isn't a simple functionfor this? :P
17:10DuneManbecause you haven't written it!
17:10DuneMan:-)
17:10tufflaxhehe
17:10riddochcBecause usually people seem to want to remove *all* instances of something from a collection?
17:11riddochcWhich is what filter is for.
17:11tufflaxhm ok
17:12DuneManso yeah
17:12DuneManuse (split-with
17:12tufflaxok, thanks
17:13riddochc(let [[a b] (split-with #(not (= 1 %)) '(9 6 1 3 1))] ...)
17:13riddochcAlmost there...
17:13DuneMan(let [[before after] (split-with #(= % 1) col) rest (next after)....
17:14riddochcThen we want a new sequence...
17:14DuneMan(flatten [before res]))
17:14DuneManor chain
17:14DuneMan(I'm still learning the clojure lib)
17:14riddochcMe too.
17:15MadWombat(concat (take-while #(not= 3 %) (list 1 2 3 1 2 3)) (rest (drop-while #(not= 3 %) (list 1 2 3 1 2 3))))
17:15MadWombatbut yes, the version with let is a bit more concise
17:15DuneManconcat is the way to go. and yes, that does exactly the same thing without the let
17:16riddochcAh, concat.
17:16DuneManOf course, this is problematic if you're collection is potentially very large because you'll be holding onto the head
17:17DuneManyour*
17:17MadWombat(defn split [e col] (let [[x y] (split-with #(not= e %) col)] (concat x (rest y))))
17:18MadWombatshould call it something else
17:18MadWombator better yet
17:18DuneManfilter-first
17:18riddochcConcat doesn't return a lazy seq? I don't see where we're holding on to the head yet...
17:18kotarakconcat is lazy
17:19DuneManah yes, indeed.
17:20MadWombat(defn filter-first [pred col] (let [[x y] (split-with pred col)] (concat x (rest y))))
17:21kotarakThis holds onto col until you start consuming y in the concat.
17:22MadWombatprobably a good usability idea is to negate the pred value, so you have to pass #(= x %1) not #(not= x %1)
17:22riddochcSo...
17:22riddochc,(defn filter-first [pred s] (let [[a b] (split-with pred s)] (concat a (next b))))
17:22clojurebotDENIED
17:22DuneManindeed kotarak
17:22MadWombatkotarak: hmm... yes, that is what you get with lazy sequences... lemme think
17:23DuneManyou need to consume the "drop-while" sequence in step with the "take-while" sequence
17:23riddochcOkay, fine...
17:23riddochc;(let [filter-first (fn [pred s] (let [[a b] (split-with pred s)] (concat a (next b))))] (filter-first #(= 1 %) '(9 6 1 3 1)))
17:23riddochc,(let [filter-first (fn [pred s] (let [[a b] (split-with pred s)] (concat a (next b))))] (filter-first #(= 1 %) '(9 6 1 3 1)))
17:23clojurebot(6 1 3 1)
17:23riddochcThere we go.
17:23riddochcUm...
17:23riddochcOops.
17:24MadWombatriddochc: #(not= 1 %)
17:24MadWombatriddochc: this is not a bug, this is a feature :)
17:24DuneMan,(let [filter-first (fn [pred s] (let [[a b] (split-with (comp not pred) s)] (concat a (rest b))))] (filter-first #(= 1 %) '(9 6 1 3 1)))
17:24clojurebot(9 6 3 1)
17:25MadWombatDuneMan: Ah! I was looking for a way to negate the pred
17:25DuneMan"compose"
17:25riddochcOr, it could take the thing you want to filter at, instead of a predicate.
17:25riddochc,(let [filter-first (fn [at s] (let [[a b] (split-with #(not (= at %)) s)] (concat a (next b))))] (filter-first 1 '(9 6 1 3 1)))
17:25clojurebot(9 6 3 1)
17:26tomojshouldn't that be called remove-first ?
17:26riddochctomoj: Even better.
17:26DuneMantomoj: much better name
17:26DuneManHonestly, in all my years of programming, one of the hardest things for me to do has always been naming thing
17:26DuneMans
17:26kotarak,(let [filter-first (fn filter-first [pred coll] (lazy-seq (when-let [s (seq coll)] (let [fst (first s)] (if (pred fst) (next s) (cons fst (filter-first pred (rest s))))))))] (filter-first #(= 1 %) [9 6 1 3 1]))
17:26clojurebot(9 6 3 1)
17:27kotarakThis does not hold unto the head.
17:27DuneManhell, yesterday I needed to write a clojure function to turn a unix-timestamp-containing-string into a java Calendar.... I just stole CL's "decode-universal-time" :-P
17:27DuneMankotarak: nice.
17:28DuneManI've been worrying about head-holding a lot recently, because my app takes an infinite stream of data as the input......
17:28DuneManbadness if you accidentally pass that to a function that takes [& more]
17:28slyphonwhat's that emacs feature that lets you project specific settings in a dotfile ?
17:28slyphonin emacs-23
17:29tomoj,((fn [[& more]] (take 3 more)) (iterate inc 0))
17:29clojurebot(0 1 2)
17:30riddochckotarak: lazy-seq + cons to the rescue, it seems.
17:30kotarakriddochc: low-level but flexible. Trying to press everything in higher order stuff is similar wrong as throwing lazy-seq at everything. :)
17:31tomojwhat's the badness?
17:31kotaraktomoj: (apply (fn [& more] ...) ..) holds the head.
17:31riddochckotarak: A good lesson for me, as I read 'real world haskell' last year before deciding I preferred clojure.
17:32tomojah
17:32DuneManwhich is the case I ended up with
17:32technomancyslyphon: .dir-locals.el
17:32slyphontechnomancy: thank you!
17:32DuneManbecause I used "partial"
17:32DuneManwhich does (apply ....)
17:32technomancynp
17:32DuneManand thus I ate up many gigs of memory in short order and was very confused for a long time where my leak was
17:33DuneManbut in the process tuned the garbage collector for my data profile! so... it was sorta worth it...
17:33riddochcIs there a good way to tell when the head's being held? 'apply' holding the head really doesn't seem an obvious thing.
17:34tomojI think the head is held there simply because you've got a handle to more?
17:34DuneManI noticed it because my data was big enough, and my call chain structured in such a way, that no memory was getting freed
17:34tomojsince you can say (first more), the head is held
17:34DuneManso I watched the memory with jconsole...
17:35DuneMantomoj: yes. I also ran into problems with the clojure runtime not getting rid of references and thus creating leaks
17:35DuneManbut upgrading to 1.2 fixed that
17:35DuneManand created this REALLY annoying problem that (hash-map ....) now throws DuplicateKeyException
17:35DuneManwhcih makes me want to kill someone.
17:35tomojanyone else happen to have played with clojure+solr yet?
17:36DuneManno, but I might soon... we have a project that we'd like to try with it.
17:36kotarakDuneMan: well, people always complained, that it is possible to create maps with duplicate keys
17:37DuneManjconsole is nice.
17:39DuneMankotarak: I ended up writing my own function that does the (apply merge (map (partial apply hash-map) (take-nth 2 s)))
17:40kotarakDuneMan: you probably mean partition instead of take-nth
17:40DuneManyes, I do mean partition
17:42DuneManbut yeah, I suppose it's better to have the more restrictive behavior built in
17:42DuneMan'cause its easy enough to write the function
17:42DuneManbut it annoyed me int he moment :-D
17:42kotarak,(-> [:a 1 :a 2 :a 3] (partition 2) (map vec) (into {}))
17:42clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core$vec__4296
17:42kotarak,(->> [:a 1 :a 2 :a 3] (partition 2) (map vec) (into {}))
17:42clojurebot{:a 3}
17:43alexykhey guys -- I have a let [x blah] where blah needs to be measured; in repl with (time blah). How can I assign x and still print the time it took to blah?
17:43DuneManOh that's much simpler...
17:44kotarak,(let [s [:a 1 :a 2 :a 3]] (zipmap (take-nth 2 s) (take-nth 2 (next s)))
17:44clojurebotEOF while reading
17:44kotarak,(let [s [:a 1 :a 2 :a 3]] (zipmap (take-nth 2 s) (take-nth 2 (next s))))
17:44clojurebot{:a 3}
17:44kotarak,(time 5)
17:44clojurebot5
17:45clojurebot"Elapsed time: 0.067 msecs"
17:45kotarak,(let [x (time 5)] x)
17:45clojurebot5
17:45clojurebot"Elapsed time: 0.066 msecs"
17:46hoeckkotarak: (apply assoc {} [:a 1 :a 2 :a 3])
17:46hircusalexyk: as kotarak shows, the time macro prints but then return the result of the expression it measures. a more interesting challenge will be if you want to capture both the time taken and the expression result; you'd have to capture the start and end time manually in that case
17:46tomojthe source of time shows how
17:46kotarakhoeck: viele wege führen nach Rom (und wieder zurück)
17:47tomoj,(System/currentTimeMillis)
17:47clojurebot1273182679109
17:47DuneManhoeck: but if the sequence is infinite... you will hold onto the head with the apply
17:47DuneManwell, nevermind
17:47DuneMandoesn't matter in this case
17:47DuneManthat looks simplest.
17:47kotarakDuneMan: (reduce #(apply assoc %&) {} s)
17:48alexykkotarak: hircus: thx!
17:48tomojwhoa
17:48hoecka creating a map from an infinite seq isnt a good idea either
17:48tomojI never knew about %&
17:48alexyktomoj: thx too!
17:48DuneManhoeck: indeed :-)
17:48kotarakDuneMan: a quark. nevermind
17:48kotarakpartition is missing
17:48alexykwhat's %&?
17:48hoeckkotarak: just wanted to be shure you are not missing a nice way (to rome) :)
17:49tomojI assumed it's just like & more in a function
17:49tomoj,(#(seq %&) 1 2 3 4 5)
17:49clojurebot(1 2 3 4 5)
17:49hoeckDuneMan: although it would be possible with lazy maps :)
17:49kotaraktomoj: alexyk right. like %1 %2 but for & more.
17:50DuneManis there any reason why just (apply assoc {} s) isn't good?
17:50BorkdudeBut what if Rome is Java?
17:50tomojcool
17:50tomoj,(#(vector %1 %2 %3 %&) 1 2 3 4 5 6)
17:50clojurebot[1 2 3 (4 5 6)]
17:51alexykcool
17:52kotarakDuneMan: since s is better finite, I think it's ok.
17:54tufflaxMadWombat: (complement pred) also works.
17:57riddochcHmm. Looks like clojure-contrib's .pom isn't making maven very happy: [WARNING] The expression ${artifactId} is deprecated. Please use ${project.artifactId} instead. @ org.clojure:clojure-contrib:1.2.0-SNAPSHOT, /home/socket/src/clojure/clojure-contrib/pom.xml
18:04DeusExPikachuwlangstroth, I found out clojure has like 5 classloaders up, it was a matter of picking the right one, and the right one seems to change, so far, using the one given by clojure.lang.RT/baseLoader seems to work, add URLs to that and everything should just work
18:05DuneMan.... grrr why isn't (apply assoc {} mySequence) worrrrrking.... "wrong number of arguments passed to assoc"
18:06DuneManI also hate that exception. Why doesn't it tell me how many parameters were passed and how many were expected?
18:06DuneMan*smacks java*
18:07DeusExPikachuDuneMan, (doc assoc)?
18:07DuneMan(apply assoc {} [:a 1 :b 2 : a 3 :c 1}) works aight
18:07BorkdudeDuneMan: what does mySequence look like?
18:08DuneMan(flatten <sequence returning [key value]>)
18:09BorkdudeAnd when evaluated?
18:10DuneManI'm having trouble at the moment because leiningen is v 1.1 and clojure is v1.2
18:10alexykI need to pmap a big list with expensive fn. When I do pmap, I see CPU load gradually raising from 100% to 800% on my 8-core box, then dropping to 100%. Manually launching 8 agents for another job keeps it at 800% steady. Is there a way to tell pmap to just split it 8-ways and run on 8-agents? Why dips?
18:11DuneManso my repl and the code are at different versions
18:11DuneMan*wonders how to make leiningen use 1.2*
18:11alexykDuneMan: checl out from git
18:11alexykcheck
18:11alexykthat uses 1.2
18:12alexyksee Hacking on leiningen
18:12DuneManBork: Ostensibly it must be something different, but I don't see how. the whole s-exp is (apply assoc {} (flatten (map (fn [[_ k v]] [(keyword (urldecode k)) (urldecode v)] s)))))...
18:12tomojanyone happen to know the right <scope> to use for swank-clojure when using clojure-maven-plugin
18:13DuneManwhere "s" is the result of a re-seq with 3 capture groups
18:13frodwith,(apply assoc (seq {:foo "bar", :baz "qux"}))
18:13clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$assoc
18:13frodwith,(into {} (seq {:foo "bar", :baz "qux"}))
18:13clojurebot{:foo "bar", :baz "qux"}
18:14kotarakseq is not necessary
18:14alexykis "qux" the lisp thing?
18:14frodwithno, it isn't
18:14kotarak,(into {} {:foo :bar :baz :bob})
18:14clojurebot{:foo :bar, :baz :bob}
18:14frodwithhe just has a seqence
18:14technomancytomoj: you need it to be compile-scoped, which is the default
18:14tomojdarn
18:14alexykfrodwith: isn't it from "great quux"?
18:14technomancytomoj: yeah, it's a very-long-standing clojure-maven-plugin bug
18:15technomancyone of many. =\
18:15frodwithalexyk: I have no idea. I picked it from The Art of Unix Programming.
18:15technomancytomoj: but swank isn't GPL'd anymore, so at least now compile-scoping it is legal.
18:15alexyk~ google great quux
18:15clojurebotFirst, out of 1560 results is:
18:15tomojI wonder what java developers working on one of these maven projects with clojure and java intertwined would think about adding the deps for clojure-maven-plugin to the poms
18:15clojurebotGuy L. Steele, Jr. - Wikipedia, the free encyclopedia
18:15clojurebothttp://en.wikipedia.org/wiki/Guy_L._Steele,_Jr.
18:16frodwithso anyway, DuneMan: try using into instead of applying assoc.
18:16tomojmaybe I can add them in an extra file which is gitignored somehow.. hmm
18:16technomancytomoj: speaking of jclouds?
18:16tomojyeah
18:16technomancytomoj: yeah, that struck me as weird. not going to complain though. =)
18:16DuneMan(into {} [:a 1 :b 2]) -->> Cannot create ISeq from keyword
18:16kotarakbingo
18:17DuneManso then you'd need the partition
18:17kotarak,(into {} [[:a 1] [:b 2]])
18:17clojurebot{:a 1, :b 2}
18:17kotarakDuneMan: and a map vec, IIRC
18:17DuneManor use into for the case where I'm getting pairs
18:17kotarak,(into {} (partition 2 [:a 1 :b 2]))
18:17clojurebotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry
18:17DuneManand apply assoc when I just have a seq
18:17tomojoh, I found the deps in project/pom.xml
18:18kotarakDuneMan: into only works with map entries or vectors. partition is not enough
18:18DuneManI actually have vectors coming out, so it works
18:19tomojbut swank-clojure only gets test scope
18:19DuneManbecause I'm basically mapping a vector of 3 elements to a vector of 2 elements with transformations
18:19DuneManand then I can just use into {}
18:19DuneManwhich is quite readable.... and I didn't know about until today
18:19clojureboteveryday is Rich Hickey Appreciation Day
18:19DuneManso thanks!
18:19frodwith:)
18:21tomojbut the classpath is all fucked up there, hmm
18:21DuneManThis is a wonderful place
18:23DuneManworks like a charm
18:23DuneManawesome
18:24tomojhugod: ping
18:24hugodtomoj: hi
18:24tomojhey, do you happen to be the one who stuck swank-clojure in one of the jclouds poms?
18:25hugodcould well be
18:25tomojsomeone's apparently done something to try to set up a clojure dev env, but I can't see how it's supposed to work
18:25hugodmvn clojure:swank
18:25tomojyeah, in project/?
18:26hugodexcept there's a bug in clojure-maven-plugin
18:26tomojaha
18:26hugodhttp://github.com/talios/clojure-maven-plugin/issues#issue/11
18:26tomojswitching it to compile-scoped didn't seem to help
18:26tomojwell, it got me to different problems at least
18:27tomojswank started but now the classpath isn't right for the clojure sources, so you have to go and load them manually in the right order, and eventually I hit a missing dep
18:27tomojwonder how the clojure code already here was written
18:31hugodtomoj: which sub-project?
18:31tomojtrying to work in the clojure stuff in aws/core
18:32hugodcemerick wrote that
18:32tomojwhich requires some clj file from compute to be loaded, which requires a file from core to be loaded, which dies because of some missing google dep
18:33tomojah, thanks
18:46MadWombatseems like there are at least a few clojure projects running out there using google app engine, but all the directions are either outdated or cryptic.
18:47DuneManhere
18:47DuneManHow the heck can I use the "catch" special form in a macro?
18:48DuneManif I have `( ..... (catch Exception e)) it complains "can't bind qualified form user/e"
18:49AWizzArd,(try (+ "a" 2) (catch Exception e (println e)))
18:49clojurebotAWizzArd: excusez-moi
18:49MadWombatAWizzArd: I think that is WTF in french :)
18:50AWizzArdyes yes, something like that.. don't know, was supposed to print something about a casting exception
18:52DuneManthe macroexpand gives me: (try (+ "2" 1) (catch Exception user/e nil))
18:52DuneManso, yeah, 'e' becomes user/e... which is wrong
18:55DuneManAh, since I don't reference 'e' in my expression.... if I use _ it works
18:56DuneManwait no, I'm wrong
18:59DuneManWhy isn't catch mirroring a let form?
18:59DuneMan(catch [e Exception] ....)
19:01arohnerDuneMan: macros try to resolve symbols, unless quoted
19:01DuneMandoing 'e generates a macro with (quote e) in it.
19:02DuneManer, (quote user/e)
19:02DuneManSo it resolves it...... then quotes that.
19:03arohnerthat 'e' should either be 'e#', which will generate a random name for the variable, or '~'e', which will use the literal symbol e, stomping on another symbol in the environment (if present)
19:03arohneryou probably want to use e#
19:03DuneManoh you have to quote the ~
19:04DuneManThanks again!
19:04arohnerDuneMan: np
19:06MadWombatwhat is the clojure equivalent of wildcard import? If I have several files in a directory, how do I require or use all of them?
19:06arohnerMadWombat: there's nothing built in to do that
19:07arohnerMadWombat: you could (doseq [..] (require ...))
19:07tomojdid you mean for clojure files or java classes?
19:07MadWombatclojure files
19:07tomojoh, it doesn't matter anyway
19:08MadWombathmm... this is somewhat inconvenient :(
19:10arohnerMadWombat: if you know their names, you can (doseq [file ['dir.foo 'dir.bar' 'dir.baz]] (require file))
19:10arohneroops, extra '
19:11MadWombatyes, the point was to import without knowing names
19:11technomancyaka "timebomb use"
19:12arohnerMadWombat: as technomancy implies, it's unlikely to ever be a part of clojure proper
19:12arohnerMadWombat: but writing it isn't bad
19:12arohnerjust slurp* the directory, and filter by "*.clj"
19:15MadWombat"timebomb use"?
19:15MadWombatah! breaks when someone creates a file in that directory that clobbers namespace?
19:16MadWombatdired
19:17MadWombatwrong window :)
19:18AWizzArdarohner: why not file-seq ?
19:18arohnerAWizzArd: I forgot about it :-)
19:19arohnerAWizzArd: file-seq is a better solution
19:19AWizzArdk
19:36Rayneschouser: You should totally form an opinion on the URL title scraper. :P I've put a lot of work into making it suitable (useful) for a channel like #clojure. Pretty sophisticated blacklisting going on.
19:36Raynes(:
19:38MadWombatis there a way in emacs to open the file containing the namespace under point?
19:39MadWombatlike point to (:use com.wombat.something) and open the file containing the something namespace
19:39MadWombator switch to the buffer
19:39technomancyMadWombat: there's not one that knows about clojure :use clauses, but find-file-at-point will do it for regular filenames
19:40technomancyyou could probably teach it about clojure, but M-. works just as well for that
19:41MadWombathmm M-. gives me ClassNotFound exception
19:41technomancyoh, you need to do it with a var from the desired namespace, not on :use itself
19:48alexyklancepantz: ping
19:50lancepantzhey alexyk
19:50lancepantzsup?
19:51alexyklancepantz: what happens if you do db-add with tokyocabinet without a transaction? Does it roll any write in its own transaction?
19:52ninjuddalexyk: yes, if i understand your question correctly
19:53alexykninjudd: hey man! so you guys won't believe the comparison results vs BDB JE cupboard
19:54alexykI had 5 min write and 20 min read with JE
19:55alexyknow I have 1.5 hrs write and 3 min read with TC
19:55ninjuddnice!
19:55alexykwith the adjacency list done as protobufs
19:55ninjudd1.5 hours?
19:55alexykbut, I didn't do transactions for TC write
19:55MadWombat,(contains? (keys (ns-publics 'clojure.core)) 'apply)
19:55clojurebotfalse
19:55MadWombatwtf?
19:55alexykyep, 6400 secs
19:55ninjuddthat doesn't sound right
19:56alexykout of which, if I pmap my graph with protobufs, 900 secs are spent protobuffing
19:56MadWombat(contains? (map str (keys (ns-publics 'clojure.core))) "apply")
19:56alexykI'm not using jiraph, only jiraph.tc
19:56MadWombat,(contains? (map str (keys (ns-publics 'clojure.core))) "apply")
19:56clojurebotfalse
19:56alexykI put node, protobuf adjacency list -- those Repliers I emailed earlier
19:57alexykso 900 secs are spent just serializing the adjacency lists, before any writing to TC
19:57alexykwhile reading is superfast
19:57lancepantzalexyk: do you know the size of the adjacency list?
19:58MadWombatah!
19:58MadWombat,(contains? (ns-publics 'clojure.core) 'apply)
19:58clojurebottrue
19:58ninjuddthere may be room for improvement in protobuf, but still, that is 5600 secs to write
19:58alexykbut my lists are ranging from 1 to 10000 in each adjacency iist, much bigger than yours
19:58alexykso the beauty is, TC read is superfast
19:58alexykeven at 100% CPU; vs. JE at 800%
19:58ninjuddoh, do you add each edge one at a time?
20:00alexykninjudd: no, I write a node and all its adges in value protobuffed
20:00alexyk3 million nodes and protobufs
20:00alexykbut, without transaction surrounding the whole write; need to test with that
20:01ninjuddhmm, can you send me some sample code so i can try it on my machine?
20:02alexykninjudd: sure, will github it soon
20:02ninjuddin my experience, it is slower to write than read, but the difference seems much larger than i would expect
20:03alexykduring TC write CPU is at abysmal 14%, I guess due to lack of transactions; the default db-init and db-open don't any bzip2, do they?
20:04ninjuddno
20:05ninjuddbased on this, i would think writes should be fast too: http://1978th.net/tokyocabinet/benchmark.pdf
20:06alexykninjudd: so when you write a protobuf, you just (ad-add key (protobuf Foo fields)), it emits the bytestring as is, correct?
20:06alexykdb-add
20:08ninjuddyeah, are you still using defgraph to create the layer?
20:08ninjuddand then using the layer directly in your benchmark?
20:10alexykninjudd: no, I don't use any of jiraph except jiraph.tc, and: db-init, db-open, (doseq [[k v] ...] db-add key (protobuf ... v ...))
20:10alexykand db-close
20:10alexyknow am gonna add (db-transaction (doseq ... db-add))
20:10alexykis db-add slower than db-set?
20:11ninjuddalexyk: are you passing :load and :dump to db-init
20:11alexykninjudd: umm, not... should I? :)
20:12alexyksounds like I should, right
20:12ninjuddthat is what causes it to auto-load/dump protobufs
20:12ninjuddtake a look at the code for defgraph
20:13alexykninjudd: hmm; perhaps they're automerged by default?
20:13alexykbecause they "just work"
20:13ninjuddor just call defgraph and then use the layer
20:13alexykprotobufs I mean
20:13alexykare there any options to db-init affecting speed?
20:13ninjuddyes, but it uses pr-str and read-string for serialization still
20:14alexykninjudd: ah! so that slows things down?
20:14ninjuddyes
20:15alexykkk, will stick :load and :dump to db-init... it just takes a map, so I'd just do (db-init {:path ... :load :dump}) right?
20:15ninjuddyes
20:16alexykin defgraph, it also sets :proto proto?
20:17ninjudd:dump protobuf-dump :load (partial protobuf-load Foo)
20:17ninjuddor you can use defgraph and pass :proto to a layer and it will do that for you
20:18alexykdo I need :proto-fields as well?
20:19ninjuddno
20:20MadWombathttp://blog.mitechki.net/2010/05/06/namespace-trickery-in-clojure/
20:20sexpbot"Namespace trickery in Clojure « Angry UNIXoid’s Humble Abode"
20:28alexyksexpbot: and who are you?
20:29alexykclojurebot: who the heck is sexpbot?
20:29clojurebotthat's cool
20:30MadWombat:)
20:40Raynesalexyk: Clojurebot speaks the truth.
20:46slyphonwow, java's Formatter is retarded
20:48DuneMans/Formatter/*/
20:48sexpbotwow, java's * is retarded
20:48slyphonheh
20:49replacaslyphon: why do you say that?
20:49slyphonbecause it's frustrating me and i don't want to blame my own stupidity
20:49replacawhat are you formatting?
20:49slyphonoh, gah
20:50slyphon,(format "%0.2f" 3.142)
20:50clojurebotjava.util.MissingFormatWidthException: 0.2f
20:50slyphon,(format "%.2f" 3.142)
20:50clojurebot"3.14"
20:50slyphonin ruby the 0.2 is acceptable
20:50replacaahh.
20:51slyphonso you see, it's totally java's fault for not being ruby
20:51replacaI did a version of common lisp format, but if you're used to printf-style formatting, it's probably not what you want either
20:51slyphonhah
20:51slyphonyeah, i don't need to display this stuff in roman numerals, fortunately
20:51slyphon;)
20:52replacanever know when latin will be back!
20:52slyphon:D
20:52replacagood to be ready
20:55slyphonit would be really funny if we got bought out an all of our timestamps were in roman numerals, come to think of it
20:56slyphoneveryone on the team just acting like it's totally normal
20:56ninjuddis there a way to write a custom constructor with deftype?
20:57Raynesninjudd: You can write a make-<type> function.
21:00ninjuddRaynes: so make-Store if my type is called Store?
21:18slyphonjeez, when you hook mysql connector/j up to log4j, the name of its logger is "MYSQL"
21:19slyphonthere's something very "TIMMAH!" about that
21:25powr-tocif I want to extend a class that requires some state manipulation/constructor overloading, what's the best way to do it in 1.2? It seems reify is out, can I use extend or extend-type, or do I need to use gen-class?
21:26powr-toctbh it looks like proxy is the best bet, but that's slower than other options, right?
21:27maravillasand incidentally, i'm wondering just how to define constructor overloads with gen-class, in 1.1 :)
21:28maravillascoincidentally, that is
21:30powr-tocyeah, gen-class gets a little hairy, I want to be sure I need it before biting the bullet and requiring an AOT compile step
21:32slyphonman
21:32slyphonthank god for clojars
21:32slyphonlife would truly suck that much more if i had to set up a maven repo
22:16thearthurhow many times will a transaction retry?
22:17slyphonthearthur: what do you mean?
22:20thearthurim asking about dosync transactions on refs
22:21_ato,clojure.lang.LockingTransaction/RETRY_LIMIT
22:21clojurebot10000
22:21_atothearthur: ^
22:21thearthurthanks: )
22:22slyphoni guess the question then is, what happens when it reaches the retry limit?
22:23_atoit throws an exception
22:24_atohttp://github.com/richhickey/clojure/blob/1.1.0/src/jvm/clojure/lang/LockingTransaction.java#L381
22:26slyphonah, figures
22:26slyphon:)
22:39livingstonI like using emacs/swank with clojure, but I need to setup some java developers to work with me, and they like eclispe, is counterclockwise the best route for them?
22:42cemerickthat's the eclipse plugin
22:42cemerickor, that is, I don't know of any others
22:43cemerickI really need to take it and intellij out for a spin and see how they do.
22:43livingstonok, so I'll take that as a yes then ;) do you know if it does or will support 1.2 I'm poking around but haven't figured that out yet
22:43cemerickno idea
22:43cemerickthere's a list for it I think....
22:46livingstonalso, anyone have any suggestions on books, tutorials, class material type stuff for bringing java developers up to speed on clojure (/ functional programming) ?
22:47cemericklivingston: "Programming Clojure" is good. The Joy of Clojure MEAP is stellar so far.
22:47livingstonwhat's a MEAP ?
22:48cemerickhrm
22:48RaynesManning Early Access Preview
22:48cemerickyeah, that's it
22:48cemerickpre-release ebook
22:48mikemlivingston: I found "Practical Common Lisp" good reading for LISP background: http://gigamonkeys.com/book/
22:48sexpbot"Practical Common Lisp"
22:48livingstonI have Programming Clojure, and like it pretty well, but that's good I hadn't heard of the other one yet.
22:48RaynesThe first 6 chapters of Joy have been written, and if you buy the ebook, you get those chapters and all subsequent updates (with more chapters) until the book is released, and then you get the final book.
22:49livingstonYeah, I've been thinking about working them though the exercises in Paul Graham's book, but just do them in Clojure
22:49cemerickmikem: really? CL is very different from clojure philosophically.
22:49Licenseronly thing about programming clojure might be that with 1.2 it gets a bit outdated
22:49livingstonLicenser: I was thinking about that, but for the basics its all mostly there
22:50Licenserit still is (no question) a good book but exspecially for newcomers 'why isn't this working' might be a frustrating experience
22:50mikemcemerick: sure, but it helps to understand some of those differences. it was interesting to see how one would solve problems in a functional language
22:50RaynesWe have books now: people can stop recommending Common Lisp books for Clojure.
22:50Raynes:p
22:50mikemi found it helpful :)
22:51livingstonI do think Graham's exercises are more oriented toward learning an FP approach (even if it's in common lisp)
22:51cemerickIn hindsight, I don't really like PCL. It has a very narrow perspective.
22:52cemerickOn Lisp is my bar for judging lisp books, which might not be fair.
22:53livingstonYes I like Graham's On Lisp and have tought out of it before
22:54livingstonRaynes: yes there is Halloway's book, but it doesn't have exercises and it's oriented around teaching FP, per-say.
22:54RaynesThere is The Joy of Clojure.
22:54RaynesWhich is more of what I was aiming for.
22:56livingstonmaybe that is good for people coming from the java side, but one particular thing I found annoying aobut Programming Clojure is it would say you can do it this way, and my face would cringe, then it would say this way is better, and I'd still be annoyed, and then it would say, but if you want a more FP way do this - and I would say, "why didn't you tell me that in the first place" (but I know common lisp very well so...)
22:56livingstonI'll take a look at Joy..
22:56mikemthere's another MEAP, "Clojure in Action"
22:56mikemhaven't heard nearly as much about it, though, as "Joy"
22:56cemericklivingston: PC is definitely meant to be a step-by-baby-step approach
22:57cemerickmikem: Seems pretty stalled, really.
22:57cemerickcompared to JoC, anyway
23:00livingstonthese are some good suggestions - thanks.
23:01Licenserwell work time for me, take care people
23:01livingstonI just wish one of them had exercises
23:08livingstonwow Ch1 of Joy of Clojure kinda runs the gamut - kinda sticks you right in front of the fire hydrant
23:09cemerickit's definitely for grownups :-)
23:10ninjuddi asked about how to define a custom constructor for deftype earlier, but didn't have time to stick around and understand the answer
23:10ninjuddRaynes, you said add a method called make-<type>
23:10RaynesFunction.
23:10RaynesYou can just write your own constructor function that wraps creating the type the way you want.
23:11livingstoncemerick: yeah, although I don't know that that's the best way to ease some java programmers in? don't want to waste time, but don't want to make it hard either
23:11RaynesAs far as I know, there is no way to define special constructor functions in the type.
23:11ninjuddoh, i see
23:11ninjuddso that's just a convention
23:12cemericklivingston: depends on the caliber of the programmers. If they've not looked outside of the box they're in for years, then it'll probably lead to shell-shock.
23:13cemericklivingston: Clojure is formally and demonstrably simpler than Java, so it shouldn't be too rough for anyone who doesn't get hung up on cosmetics.
23:14cemerickThe persistent data structure thing takes a shift in perspective, but...well, that's just the way it is. Certainly no harder than grokking the nightmare that is DI or something.
23:14livingstonI agree, they want to look at it and take it seriously, but at the same time I'd like to guide them into it, and by-in-large FP will be new too
23:15livingstonwhat's DI ?
23:15cemerickdependency injection
23:15livingstonoh right
23:17livingstonyeah I find Stuart's book a little slow, but Joy seems way to fast, where's the one that's "just right" ;) we have copies of Stuart's book though, so we might just start there
23:18cemerickI clearly don't get around much. The notion of using a book as the primary source for learning a language is so foreign to me at this point.
23:19livingstonI kinda just started "doing it", but I'm looking to help at least 3 people learn at once, so it's good to have something to focus on and foster discussion for regular meetings
23:19cemerickyeah
23:20joshua-choiclojurebot: What do you think of Clojure?
23:20clojurebotclojurebot is not a benchmarking platform
23:21livingstonI also programmed in java a long time ago in a galaxy far far away, and spent the last 5 years writing some serious common lisp, so I'm pretty cool with clojure - I have my hangups, and miss some functions and expect some lisp stuff, but I'm embracing it
23:22cemerickI used CL for ~8 months some years ago. It just seems baroque at this point.
23:23cemerickJava has changed so much since I started using clojure exclusively. I hardly recognize modern java code anymore.
23:23livingstonnah it's great (CL), concurrency is an issue though, depending on your compiler but I loved it
23:24livingstonthat's something I miss, I'd like to be able to make a reader macro, for example
23:24cemerickit's a remarkable thing that Rich has pushed back on that so consistently. Gives me great hope for the future.
23:25livingstonthe STM is what got me looking seriously at Clojure though, I think one needs to embrace concurrency wholesale moving into the future
23:25livingstonpushed back on what?
23:26cemerickreader macros. It's been lobbied for pretty hard from some corners, but no one's been able to propose an approach that would cleanly integrate with namespaces, etc.
23:26cemerickIt would have been a lot easier for him to just cut an implementation and not hear about it anymore.
23:27livingstonI don't necessary want them for everyday code, but for building DSLs they can make a world of difference.
23:28livingstonI'll have to look more at that debate sometime... but that'll have to be for another day
23:29replacalivingston: what do you miss from CL?
23:29cemerickthe mailing list archive is chock-full of the discussions :-)
23:29replacaI missed clos for a long time, but I'm over it now
23:29livingstonreplaca: keyword parameters is one (although I hear we are getting that now)
23:30livingstonI understand the reasons it's needed but two nils and two falses are a pain.
23:30cemerickyup, in the bag
23:30replacalivingston: well, you've always been able to do it, you just had to use a different defining form or do it yourself with destructuring
23:31cemericktwo nils?
23:31livingstonreplaca: no you needed to have all these squigglies crud up your code
23:31livingstoncemerick: nil and the empty list being different
23:31replaca?? what do you mean
23:32cemericklivingston: right, well, the latter isn't nil :-) That's necessary in order to make properly lazy sequences FYI.
23:32livingstoncemerick: I know, i get why it just makes the code uglier
23:33livingstonreplaca: yeah but you can't just con's the stuff together and then call apply, your keywords need to be separate in a map from non-optional args at the front
23:34replacaoh, yeah, a little bit simpler version, but with c.c.def/defnk it was pretty close
23:34replacano {}
23:34cemericklivingston: that's also a necessary tradeoff *shrug*
23:35cemerickit also simplifies things significantly -- the same set of destructuring operations regardless of context.
23:36livingstoncemerick: yes, but I could write some really pretty stuff in CL, I'm not saying there aren't clear advantages to the affordance of Clojure that would have been a pain in CL, but until I get up to speed I'll naturally miss what I had
23:37cemericksure
23:37livingstonhey, I gotta roll,.. (promised a coworker a ride home) thanks for all the ideas everyone...