#clojure logs

2010-09-27

00:39bhenry,(doc let)
00:39clojurebot"([bindings & body]); Evaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs or parts therein."
00:39bhenrydoes let have the same implicit do as defn?
00:39amalloyyes
00:39bhenrythanks. i guess i can see that from the doc now.
00:39amalloy(let [x 1] (println x) x)
00:40amalloy,(let [x 1] (println x) x)
00:40clojurebot1
00:40clojurebot1
00:46laurusHow do I manually add a library to cljr that isn't in Clojars?
00:47amalloylaurus: are you using a build tool like lein or cake?
00:47laurusamalloy, no, just cljr with the global repository.
00:47laurusI have a bit of code here that has a project.clj file, for lein I guess, and I'd like to "install it"
00:48amalloybelieve it or not, lein install will do that :)
00:48laurusBut where would I run that? I don't even have lein installed
00:48laurus~/.cljr/lib is the place with all the jars, is it bad practice to copy a src directory in there?
00:48clojurebotamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
00:48amalloywell, i don't know. i know the jar eventually winds up somewhere in ~/.m2, but this is not really my strong suit
00:49laurusOh, interesting, some of them are in .m2 as well
00:49laurusOr perhaps all of them
00:49laurusWell thanks anyway, I'll just import it manually in the REPL for now and figure this out later
00:49laurusFigure out the "right way" later I mean :)
00:49amalloyokay. that said, lein/cake are a godsend
00:50laurusWell I really like cljr for the simplicity, I tried cake but it was buggy and started up a bunch of JVMs that I didn't need
00:50laurusAnd lein was annoying because I had to have "projects"
00:50amalloyall right. suit yourself; i didn't build any of them :)
00:51laurus:) Actually I may have just answered my own question: it seems that ~/.cljr/lib/* is automatically part of the classpath!
00:51laurusSo I think if I just put the files in there it'll automatically recognize them and make them available
00:58laurusamalloy, I feel like cljr should be recommended as the starting point for people new to Clojure
00:59amalloyfortunately i'm pretty new to the community; not doing any evangelizing myself
00:59laurusOk :) I didn't know that, hehe
00:59dnolenlaurus: not if yr on os x. cljr is lame there.
00:59laurusdnolen, oh, really
01:00laurusIt's great on GNU/Linux
01:00laurusI would assume Mac is similar
01:00laurusBut I guess not :P
01:00amalloybut lein really is easy to install. download one file, lein self-install, and you're good to go - it downloads clojure and all the required stuff for you
01:00dnolenlaurus: yes, mostly because of native lib integration with Java.
01:00laurusamalloy, same with cljr, it's just that cljr you don't have to deal with these projects so it's great for people who are new and want to poke around but who also want to install other JARs.
01:01laurusdnolen, oh, wow, okay
01:01dnolenlaurus: I like lein and cake, on os x cljr is too slow and weird to be useful.
01:02laurusdnolen, wow, that's really too bad
01:02laurusYou should let them know about that
01:02laurusFor me, cake was buggy and strange
01:02dnolenlaurus: it can't be fixed, Apple's Java is the issue really.
01:02laurusdnolen, wow, I'm sorry to hear that!
01:02laurusYou can't just install OpenJDK?
01:03dnolenlaurus: I'm on OS X, why would I want to do that ;)
01:03amalloylaurus: i don't really understand the aversion to projects. it's just a directory for whatever you're fiddling around with
01:03laurusamalloy, it's just easy to be able to run cljr from any directory
01:03laurusAnd I'm kind of thinking about people who are totally new to Clojure
01:03amalloylein runs from anywhere too
01:03laurusAnd just need something simple and fast to check it out
01:04dnolenlaurus: cake is fine, though it does have it issues. persistent jvm is plus for me, and it has sane REPL history/autocompletion
01:04laurusThat's true, I'm just thinking about how to tell a new person to try Clojure out
01:04laurusdnolen, cool
01:04amalloyi think the disconnect here is that you think cljr is simpler than lein/cake. i really don't get that
01:05dnolenamalloy: it is simpler in the Python/Ruby broken sense of simpler
01:05laurusamalloy, the package management system is global
01:05dnolenglobal lib install, which for real development is a massive PITA
01:05dnolenbut cake has both
01:05dnolenglobal and project
01:05laurusdnolen, right, but I don't do "real development," I'm using Incanter mostly
01:06ninjuddlaurus: what issues did you have?
01:06ninjuddlaurus: how long ago did you try cake?
01:06laurusOh hi ninjudd
01:06laurusAbout a week ago
01:06amalloyoh good, ninjudd is here. i can stop preaching and go back to my book :)
01:06laurusPerhaps I wasn't using it correctly, but it started up JVMs that didn't eventually stop
01:06laurusSo at one point I had about six JVMs going :P
01:07amalloyheh. feature, not a bug
01:07laurusAnother thing, this is a minor nitpick, is that I had to manually create the .cake directory :P So there was an initial error message there
01:07amalloy*cedes the floor to ninjudd*
01:07laurusamalloy, hey, thanks for exchanging opinions, I appreciate it
01:08laurusThe main one was the JVMs starting and me not being able to stop them easily I suppose
01:08laurusBut again maybe that's a feature
01:08laurusIt just seemed like it was for more hardcore people
01:09dnolenlaurus: 'cake stop' for projects, 'cake kill' all when you want to shut it all down, not so bad methinks. it seemed buggy months ago, now pretty solid I think (at least on os x)
01:09ninjuddyeah auto shutting down the jvm on inactivity is on the list of things to do
01:09laurusdnolen, I see
01:09laurusninjudd, cool
01:09laurusI'm glad you guys are making it, I wasn't trying to say cljr is "better" than these other tools, I was just referring to it as a great out-of-the-box setup for people new to Clojure who want to mess around, kind of like me
01:10dnolenlaurus: cljr does see good, it just a bad experience on os x.
01:10dnolens/see/seem
01:10laurusRight :) I see
01:12laurusHave a good night everyone!
01:12ninjuddthe hope is that cake's global project can fill that role too
01:12ninjuddyou should be able to be up and running with clojure in 1 minute using cake
01:14ninjuddthe new cake motto is: cake. for hardcore people.
01:22tomojninjudd: have there been any changes to the way cake deals with the persistent jvm?
01:22tomoji.e. has it been made more robust?
01:24brehautHas anybody running a clojure website had any problem with stack overflows with many many lines of "at clojure.lang.Keyword.intern(Keyword.java:39)" in the strack trace ?
01:24ninjuddthere was a bug early on that caused it to launch many jvms per project which has been fixed
01:24tomojawesome
01:24tomojI have been scared to try it again since that happened to me
01:25ninjuddand the io handling has been improved quite a bit
01:26ninjuddtomoj: we are also planning to stop using two jvms per project and add an auto-shutdown option
01:29tomojtwo jvms per project is a bit much for me right now.. only have 1GB ram at the moment
01:30tomojhmm, so you might have auto-shutdown after a certain time of repl idleness?
01:31tomojI don't think I could use any kind of auto-shutdown
01:31tomojI leave answers to things sitting in repls
01:33tomojwhat would be nice is some way to easily see which projects have jvms running, and to easily shutdown from anywhere
01:40ninjuddcake ps and cake kill do that
01:40tomojnice
01:41ninjuddalso, it wouldn't shut down if the repl was still connected
01:41tomojah, I see
01:42amalloyninjudd: out of curiosity, what *are* the two jvms for? i think cake/bake is hilarious but i don't understand it
01:43ninjuddit is so that cake's dependencies don't pollute you project
01:43ninjuddsay you want to use a different version of some library cake uses or a different version of clojure
01:43tomojdoes lein use some fancy trick to get around that?
01:44ninjuddlein does the same thing.
01:44amalloyi see, i think. you need a jvm with cake stuff to do bootstrapping, and if you made us use the same one there'd be issues. once you're up and running, you load another jvm
01:44ninjuddbut two classloaders is the right way to solve that problem
01:45ninjuddthat's what we're working on to use just 1 jvm
01:45tomojlein uses two jvms?
01:46amalloytomoj: yes. try: $ pidof java; lein repl&; pidof java
01:46ninjuddyeah. they just aren't persistent
01:46tomojI think I read something about lein getting a persistent jvm
01:46ninjuddeval-in-project is what starts the second jvm in lein
01:46tomojso I guess with that I'll have the one persistent jvm for the project and a jvm actually running the project code
01:47ninjuddtomoj: yeah for repl only if I understand correctly
01:47tomojthinking of `lein interactive` I guess
01:48tomojthis gives me an idea
01:51amalloytomoj: this pause after your idea is ominous
01:52tomojhave emacs connect to a persistent leiningen jvm
01:52tomojthen run lein commands from project.clj or any .clj file in the project
01:58scottjyou'll want to use slime-quit-lisp to kill the swank
02:57LauJensenGood morning crew
02:57amalloymorning lau
02:58amalloyhappen to know if there's a limit to the length of a symbol?
03:01amalloynever mind, i guess there isn't. clojure is perfectly happy to give me 10000 a's in a row as a symbol
03:02quizmehttp://pastie.org/1183807 <--- I'm trying to use (ns main (:use mymessage)) but I'm getting java.io.FileNotFoundException ....
03:02quizmemy classpath has "." in it.
03:04amalloyquizme: the usual lisp problem: not enough parens :)
03:04quizmeare u serious ?
03:04quizmeholy fudge thanks
03:04amalloy(ns main (:use (mymessage)))
03:04quizmeok
03:04quizmei'm retarded
03:04quizmethan you
03:04amalloywelcome
03:05amalloythe intended usage pattern is something like (:use (super.meta.hyper sub1 sub2 sub3)); thinking of it that way helps me remember the parens
03:06quizmeamalloy ok thanks for the pneumonic
03:06quizmei mean mnemonic
03:07raekbut (ns main (:use (mymessage))) shouldn't work, right?
03:07amalloyraek: why not? works for me
03:07raekwould that use no namespaces with the prefix mymessage
03:07LauJensenamalloy: For some reason I didn't get a highlight, but by convention the limit is 74 characters
03:07amalloyLauJensen: the reason is i didn't use your whole name :P
03:08LauJensenamalloy: no, its set to hightlight many forms of my name, including 'lau'
03:08amalloyoh, neat
03:09quizmeamalloy Unable to resolve symbol: print-message
03:09amalloyokay, maybe i'm wrong
03:09quizmehehe
03:09raekquizme: I would recommend to check out some project management tool, such as leiningen or cake. managing the classpath manually is not very fun in the long term. lein and cake does this things for you automatically
03:10raek(super.meta.hyper) is the degenerate case of (super.meta.hyper sub1 sub2 sub3)
03:10raek=> no namespaces used
03:10quizmeraek. ok. leiningen then i guess.
03:11amalloyyes, you're right. clojure's namespace syntax still confuses me, i guess
03:11raekyou should be able to do it manually, of course...
03:11raekquizme: making a irc client/bot too?
03:11quizmeweird... it's working now though...
03:11quizmeraek: just doing a tutorial
03:12quizmeraek: but yeah it's possible i might make one
03:12quizmeraek: wanna put chat on my website.
03:13quizmeraek: also, I kinda wanna make a real-time interactive type of a program.
03:13raekquizme: http://github.com/raek/quirclj/ http://raek.se/quirclj/
03:13raekmy try to make an irc library
03:13quizmeraek ok thanks i'll try it out
03:13raekI mostly use Raynes' irclj myself, http://github.com/Raynes/irclj
03:14raekmost importantly, his library is fairly complete
03:14raekI have just begun on mine
03:15quizmei have a bad habit of wanting to make everything from scratch
03:15raekme too, kinda
03:15raekbut I will try to integrate whatever gets done in quirclj into irclj
03:16amalloyraek: i think my "degenerative form" still works, though
03:17raekdoesn't work for me
03:17raekjust returns nil, but nothing is used
03:17amalloyoh, here is an interesting twist
03:18amalloy(ns tmp (:use (myns.core))) doesn't work, but (ns tmp (:use [myns.core]))) seems to
03:18raekhttp://pastebin.com/kw9m6hRN
03:18raekyes, the square brackets mean a different thing
03:19raekthere should be some error reporting if one tries to use the empty prefix list, I think
03:20raekthat has cause *so many* beginner's mistakes
03:20raek*caused
03:21amalloyraek: or it should be documented, at least - (doc ns) doesn't mention square brackets
03:21amalloy(or, indeed, the lack of round parens)
03:23raekhrm, that's bad...
03:25amalloyone of these days i'll get around to filling out a contributor agreement and fix some holes in the docs
03:26amalloybut for now, it's bed time
03:26quizmeanybody have a suggestion on how to be awesome in the Clojure community and get a Clojure job?
03:28amalloyquizme: start your own business using clojure
03:29dmeadhey channel
03:29raekquizme: nothing more specific than: code. a lot. and hang around in #clojure and the group.
03:29dmeadis there a tool to show the AST for a clojure program?
03:30raekwell, in Lisps, some people would say that the code is the AST...
03:30dmeadwell yea, but the compiler still has to use it's own representation
03:32raekis there something that's not present in the lists and vectors of the code representation that you need? (just curious)
05:44mrSpecHello
05:45mrSpecI'm trying run "lein swank" but I got "That's not a task. Use "lein help" to list all tasks."
05:45mrSpecwhat am I doing wrong?
05:45LauJensenmrSpec: Add this to project.clj " :dev-dependencies [[leiningen/lein-swank "1.2.0-SNAPSHOT"]]" then run lein deps, then try again
05:46mrSpecahh, I had ::dev-dependencies :/ My mistake. Thanks!
05:54tomojI want to work with this proprietary file format which basically describes nested hashmaps and vectors
05:54mrSpecI have one more problem, when trying run slime-connect "Versions differ: 2009-08-02 (slime) vs nil (swank). Continue?" It means that my swank hasnt been installed?
05:54tomojbut for the values, it's important that I get the types right when converting back into this format
05:55tomojfor instance if the value of one field in a hashmap is a short, I need to keep it as a short when converting back
05:55tomojand I probably don't want users of my library to have to care
05:55tomojso it seems like I'm going to have to describe the types of all the fields somehow
05:55tomojany ideas?
05:56tomojmaybe I can put the types in metadata on the maps?
05:57tomojthen users just have to preserve metadata
05:57LauJensentomoj: It depends a lot on your own API, but generally speaking this would be the use-case for meta-data
05:57tomojit seems strange, though..
05:57LauJensenmrSpec: I saw a fix for that someone in the intertweet a few weeks (2 - 3?) ago. Forgot when where how
05:57tomojI need to understand better which operations preserve metadata and which don't
05:58LauJensentomoj: Are there any inconsistencies?
05:58mrSpecLauJensen: are logs available anywhere?
05:58mrSpeclogs?
05:58clojurebotlogs is http://clojure-log.n01se.net/
05:59mrSpeco :D
05:59tomojLauJensen: you mean in the way clojure treats metadata?
05:59LauJensenmrSpec: I think it was on disclojure.org
05:59LauJensentomoj: yes. As I understood it, meta data only works with clojure datatypes, and no function taking and returning one such, breaks it
05:59tomojwell..
05:59mrSpecLauJensen: ok, thanks
06:00tomoj,(meta (into {} (with-meta {:foo 1} {:bar 2})))
06:00clojurebotnil
06:00bobo_mrSpec: let me know if you find it. i get that error aswell but havent botherd to fix it
06:00mrSpecbobo_: but it works for you
06:00mrSpecwith this error?
06:00bobo_yes, just press y
06:00tomoj,(meta (seq (with-meta {:foo 1} {:bar 2})))
06:00clojurebotnil
06:00mrSpecah ok
06:00tomojyou lose metadata when you seq
06:00tomojI don't know if there are other places
06:01mrSpecI have to go afk for a wile, I'll check this in the afternoon
06:01LauJensentomoj: How odd
06:02tomojso e.g. one of the tags is a list of doubles
06:02tomojif
06:02tomojwell, actually
06:02tomojthat should be fine
06:03tomojI can store a typemap in metadata on the hashmaps
06:03tomojeven if the values are things the user will seq, they probably won't seq the hashmaps themselves
06:03tomojand metadata is retained in merge
06:31kjeldahlRegarding slime-connect version messages, if you're emacs users, this is what I have in my .emacs: (require 'slime)
06:31kjeldahl(setq slime-protocol-version 'ignore)
06:31kjeldahl Seems to work fine.
06:37neotykkjeldahl: removing compiled slime files (those with elc) helped for me
06:40kjeldahlneotyk: Ok, thanks.
06:41neotykkjeldahl: np. hth
06:49fliebelHey, I've been fighting bugs since yesterday. I'd really like a debugger now. What is the best way to get this? Google returns a little dissatisfying and contradicting results. I'd even be willing to go over to the evil side and install a huge Java IDE. I'm currently using VimClojure, but I don't think that sports a debugger.
06:52neotykfliebel: what kind of debugging?
06:53neotykfliebel: could you narrow problem to simple fns and play with them in repl?
06:53fliebelneotyk: Just figuring out what a certain variable contains at a certain point without adding println all over the place.
06:54neotykfliebel: with slime you could do slime.core/break
06:54neotykthis was ported from debug repl
06:54fliebelneotyk: That is what I've been doing, but just jumping in the middle of an fn and check some values is very helpfull :)
06:54fliebelah
06:54fliebelI'm not on Emacs, but I could have a look at the debug repl
06:55neotykso you don't need slime for it
06:55fliebelAnd I'm just reading CCW has breakpoints.
06:56neotykcould be, I have this thing against eclipse, running for years already ;-)
06:57neotykso for me anything than eclipse ide is much more attractive
07:29serp_let's say I have two threads continiously running transactions that poke the same ref. is there some mechanism that prevents one of the threads to starve?
07:37lpetitraek: once you've used (read) on your code, everything should be in the return of the (read).
08:04LauJensenfliebel: Fantastic blogpost
08:05lpetitLauJensen: link ?
08:06LauJensenhttp://pepijndevos.nl/how-reify-works-and-how-to-write-a-custom-typ
08:06fliebelLauJensen: Thanks :)
08:09fliebelLauJensen: I'm amazed by the responses I get :) I even got an email from one of the Amsterdam Clojurians if I want to give a talk at one of their meetings. But… It's chouser who did all the hard work obviously.
08:10LauJensenfliebel: You're from Amsterdam ?
08:10fliebelLauJensen: Nope, about a hour away from it.
08:11LauJensenAh ok. Well, its a good blogpost deserves some PR. We're actually considering mounting a Conj Labs in Amsterdam :)
08:13fliebelLauJensen: I would really like to come. Only need to save some money :(
08:14LauJensenYea would be cool. For a late 2010 session we've discussed London and Amsterdam and right now the arrows pointing across the sea so you might have 'good' time as the next session likely won't be before february
08:14kjeldahlLet me see if I understand: In order to be able to use postgresql with clojure (and leiningen), I need to 1) Download the jar postgresql-9.0-801.jdbc4.jar from jdbc.postgresql.org, 2) Create my own repository in ~/.m2 (make up a name, rename jar to postgresql-9.0.jar), and then finally list in project.clj as a normal dependency?
08:15LauJensenkjeldahl: I think there already exists an artifact for that driver in Maven Central, so just add that name to :dependencies, run cake deps and you're good to go
08:16kjeldahlLauJensen: Ok, and if so I do not need to manually get the jdbc stuff? I have seen org.clojars.kjw/postgresql on clojars.org, but not sure what it is.
08:17fliebelLauJensen: Bussel or Londen is also doable. I just need to find the financial resources. :) I'd better start of by buying the Joy of Clojure :)
08:17LauJensenkjeldahl: http://lmgtfy.com/?q=postgres+jdbc+driver+maven+artifact
08:18kjeldahllol
08:18LauJensen:)
08:18kjeldahlI'm clueless about the java build systems or whatever they are. That's why I'm asking all the stupid questions. I haven't typed maven once so far...
08:19LauJensenI didn't type it because I thought you were stupid, I just wanted you to know what I did, instead of just giving you the artifact name
08:20kjeldahlSo I have to step out of the leiningen kindergarden and learn about Maven and poms?
08:21kjeldahlOk, reading http://www.infoq.com/news/2009/11/clojars-leiningen-clojure
08:24LauJensenkjeldahl: not poms. Its just a matter of getting the right name for the dependency, ie follow the link above, click the first hit, click details, see
08:24LauJensen<dependency>
08:24LauJensen <groupId>postgresql</groupId>
08:24LauJensen <artifactId>postgresql</artifactId>
08:24LauJensen <version>8.4-701.jdbc4</version>
08:24LauJensen</dependency>
08:24LauJensen
08:24LauJensenIn Cake (or lein) that means [postgresql/postgresql "8.4-701.jdbc4"]
08:24LauJensenPut that in project.clj and run 'cake deps' (replace cake with lein if you prefer to use lein)
08:25kjeldahl_LauJensen: Thanks a bunch agian.
08:25LauJensennp
09:15djpowellIs there a guide anywhere about the primitive and equality features that are currently in master?
09:16LauJensendjpowell: check the assembla wiki
09:16djpowellI was there during all the experiments, but I can't remember what went in
09:16djpowellOk, cool, I'll take a look
09:19LauJensenhugod: Did you remove your demo-documentation from the pallet github site?
09:34hugodLauJensen: not intentionally
09:34LauJensenhugod: check the link on the front page of pallets repo
09:39hugodLauJensen: Fixed. Thanks for letting me know.
09:39LauJensennp
10:00fliebelIs there any way clojure.contrib.trace is going to work again, or is it just dead since 1.2?
10:02chouserdid it stop working because of the direct binding of core fns?
10:18LauJensenfliebel: ^^
10:20fliebelchouser: No idea… Someone on stack overflow said it was because of direct compilation of recursive calls or something like that.
10:30bhenry1with
10:30bhenry1(try (make-client acct-num acct-name active q-id q-title)
10:30bhenry1 (catch Exception e))
10:30bhenry1i still get:
10:30bhenry1java.lang.AssertionError: Assert failed: (string? q-title)
10:30bhenry1how can i catch my :pre conditions?
10:30fogusbhenry1: (catch AssertionError e ...
10:31bhenry1ah. so that's where that comes from. derrr moment.
10:36xkbhi
10:37xkbDoes clojure have a function like zip in haskell?
10:37mrBlissyou can use (map vector coll1 coll2)
10:37xkbok let me try that
10:37xkbaha
10:38xkbto create sublists
10:38fliebelxkb: Don't know Haskell, but there is zipmap
10:38xkbfliebel: thanks
10:38xkbI'm trying to simplify some code
10:39xkbiterating over two lists, applying a function to the element at the same index
10:39mrBliss,(map (fn [a b] (+ a b)) [1 2 3] [10 100 1000])
10:39clojurebot(11 102 1003)
10:39xkbin haskell I would solve it using zipWith, as in zipWith (+) [1,2,3] [4,5,6] => [5,7,9]
10:39fliebelxkb: That'd be what mrBliss said, but with your won function instead of vector
10:40mrBliss,(map + [1 2 3] [10 100 1000])
10:40clojurebot(11 102 1003)
10:40xkbok :)
10:40xkbnice
10:40xkbthat's what I meant
10:40xkbfunny map takes several collections
10:41mrBlissit stops as soon as one is exhausted (also works with infinite sequences)
10:41mrBliss,(map vector [4 5 6] (range))
10:41clojurebot([4 0] [5 1] [6 2])
10:42fliebelmrBliss: I heard someone say apply can also take a lazy seq, but I can't see how.
10:42mrBlissfliebel: Neither can I :)
10:45fliebelmrBliss: This could work though: (apply #(+ %1 %2) (range)) because the fn has an arity of 2, only 2 items of range would be needed, more would throw an error anyway.
10:46fliebelIs there a way to tell how many args an fn takes?
10:47mrBlissfliebel: your apply example doesn't work in my REPL (doesn't terminate)
10:47fliebelmrBliss: It doesn't but it could theoretically work.
10:50fliebelI fonly there was a more reliable way then :arglists
10:51mrBlissfliebel: I think somebody asked the same question yesterday (or the day before), but I didn't remember the answer (if there even was an answer)
10:52xkbhmm can u reload a file on the fly in repl btw?
10:52fliebelxkb: (require '[some.ms :reload])
10:53fliebel*ns
10:55fliebel d - c = b; xkcd == xkb
10:56edwUsing SLIME, I often get an error ("error in process filter: if: Wrong number of arguments: nil, 0"), e.g. when choosing a restart in the debugger. This is using `slime-connect' or when connecting to a project. Any thoughts, ideas?
10:57mrBlissedw: Emacs 23.2 and the latest slime from ELPA fixed these problems for me
11:00edwmrBliss: Hmm. I have 23.2, but have been staying away from ELPA because I can't get it to actually install swank-clojure w/o exploding. (That was before 23.2 though...)
11:01AWizzArdI am looking for a Map that can contain only up to N key/value pairs. When a new one is added, then the oldest entry gets removed. Is there already something like that, maybe something that ships with the JDK?
11:01mrBlissedw: I usually install everything (slime, slime-repl and clojure-mode) but swank-clojure. Works fine for me. Here are my dotfiles for reference: http://github.com/mrBliss/dotfiles/blob/master/.emacs.d/clojure.el
11:01AWizzArdLike: defmemo, but with a memory limit
11:01AWizzArddefmemomostcurrent
11:01edwmrBliss: Thanks for the pointer. I'll check that out.
11:02chouserAWizzArd: looks like apache commons collections has LRUMap which may be useful
11:03chouserAWizzArd: did you want persistent?
11:08chouserAWizzArd: or perhaps just java.util.LinkedHashMap
11:16cemerickAWizzArd: FWIW, some memorization utilities from back in the day, one of which uses LinkedHashMap as chouser suggested: https://gist.github.com/48f2974657cdda5f560d
11:19xkbdo we have a prefered pastebot?
11:19chouserused to be paste.lisp.org, but the bot doesn't come here anymore. anything's fine, lots of people use gist.github.com
11:20xkbhttp://gist.github.com/599202 <= why is this slower than the old version with explicit loop(s)?
11:24cemerickxkb: everything in the "new version" is being boxed
11:24chouserand boxing hurts
11:24xkbHow can I prevent that?
11:25xkbwithout resorting to the "old" code
11:25xkb:)
11:26kelsincemerick: for the curious nooby, what is "boxed"?
11:26kelsinhavn't heard that term before
11:26cemerickkelsin: google autoboxing
11:27kelsinnice, searching "boxed" and other things wasn't finding anything, thanks :)
11:27cemerickxkb: There may be a primitive-friendly reduce in the new 1.3 static/prim stuff, but I'm not up to speed there yet.
11:27cemerickAside from that, an explicit loop is the fastest approach AFAIK (but I'm not a numerics expert).
11:28xkb2 bad.. I want to demo this code to a few people new to clojure
11:28xkbso I prefer the more "functional" style using higher-order functions
11:32chouserxkb: using defn inside a defn is wrong anyway
11:32chouserdefn always defines a var in the namespace, not a local scope
11:32cemerickheh, I didn't even notice that :-/
11:32cemerickxkb: Everyone does, I think. :-) Here's what's being worked on in that department.
11:32cemerickhttp://dev.clojure.org/display/doc/Enhanced+Primitive+Support
11:32xkbchouser: I'd wanted to use an anonymous function preferably
11:33xkbchouser: ah, so how do I define a local-scoped function?
11:33chouserxkb: (let [fit (fn [a b] ... or (letfn [(fit [a b] ...
11:34xkbah, now I see
11:34xkbI had the wrong order in the let
11:34xkbpreviously
11:35xkbI'm still wrapping my haskell mind around clojure :P
11:35chouserxkb: it's going to be a while, I think before reduce/map on a seq can compete with loop/recur on arrays for raw 100% performance
11:35AWizzArdchouser and cemerick: thanks for your suggestions
11:37cemerickchouser: It probably just won't happen. seqs -> boxing, not to mention the fn invocation overhead, esp with trivial fns like +
11:37chouserseqs return boxed objects, map calls fns using their boxed invoke methods not any primitive even if it exists, and the same for reduce
11:37cemerick...unless the JVM fairy comes around to save us
11:37chousercemerick: right
11:37cemerickfixnums being the nirvana, I suppose
11:38chouserhm. I suppose some sort of advanced escape analysis during JIT might be able to do something with code like this
11:40dnolenchouser: cemerick: rhickey has mentioned several times that he wants higher order operations on primitives - I thought pods/transients were initial work in that direction.
11:40dnolenScala can do this - so Clojure had better as well ;)
11:40cemerickI'm sure they are, but they don't do anything for stuff like (reduce + seq-of-nums) AFAIK
11:41chouserdnolen: you're sure scala can do reduce/map on a lazy stream without autoboxing?
11:43dnolenchouser: your right, no not lazy - but in Clojure you can't even do it at all - lazy or no.
11:43dnolenchouser: I would imagine however it worked it would be lazy - transients aren't lazy.
11:43dnolens/would/wouldn't
11:44chousermap uses the ISeq interface to get values out of lista and listb, regardless of what sort of collections they are
11:44chouserI don't see what that has to do with transients
11:48dnolenchouser: non-lazy map/filter/reduce that that can work on primitives would be useful is all I mean. transients have to be constructed with loop/recur, there's a pattern here ... the desire for higher order w/o losing perf.
11:49chouserdnolen: oh yes, absolutely a desire.
11:50laurusIs there a way to change the font size in Incanter's view function? The data rows are so small it's hard for me to read them
11:53cemerickdnolen: the notion of a "primitive seq" given the current state of the JVM is a bit of an oxymoron
11:55chouserwell, I'm sure it could be done if everything were fully typed.
11:56dnolencemerick: but we already have gvector, whether primitive map iterates over a collection one by one using ISeq is implementation detail I think. no?
11:56chouserone could certainly imagine a IChunkedIntSeq with an IIntChunk that had an nthInt method that returned primitive ints
11:57cemerickdnolen: gvecs aren't seqs, in spirit or impl AFAIU
11:57lpetitHello
11:57laurusJTable is hilarious
11:57chouser...and a mapInt fn that used those and called the .invoke(int, int) method of the :static fn you give it
11:57chouser...etc...
11:57cemerickchouser: scary.
11:57laurusHow do I print a method's source code in Clojure?
11:58AWizzArdlaurus: typically the source cold will be compiled away. So, if you want to keep it, you should store it somewhere.
11:58@rhickeywe are well on the path to primitive leveraging HOFs
11:58dnolencemerick: ? http://github.com/richhickey/clojure/blob/master/src/clj/clojure/gvec.clj#L54
11:58chouser...and a compiler that used various bits of metadata to find these various classes and fns when properly hinted.
11:58laurusAWizzArd, I see
11:58AWizzArdlaurus: In Contrib there is a 'source' macro, I think in repl-utils
11:59laurusI want to override the view function in Incanter to change the font size for the JTable
11:59@rhickeynow that we have fns that can take/return primitives, and collections of primitives
11:59cemerickdnolen: but that VecSeq is going to box every primitive flowing out of it. rhickey's got tricks a'comin' though, I'm sure.
11:59chouserlaurus: for functions whose source .clj is on the classpath, you can use (source <fnname>) in the repl, like (source map)
12:00laurusBy golly it worked! Thanks AWizzArd and chouser!
12:00cemericklpetit: that's a good fight. I'll help if I can.
12:00chouserAWizzArd: it's in clojure.repl now
12:00@rhickeyneed an abstraction for primitive fns, a la IFn, and a protocol for communicating A) I want primitives, B) I take primitives, C) I can provide primitives, for participant fns/structures
12:00AWizzArdchouser: ah, it moved
12:01laurusAWizzArd, chouser: Unfortunately this is a defmulti, so how do I view the defmethod that I want?
12:01@rhickeycemerick: right, collections of primitives only satisfy the Object based interfaces today, but could easily do more tomorrow
12:01AWizzArdlaurus: it really is meant as a little helper tool. If you want to look at source code you are supposed to open the .clj file in your editor.
12:01@rhickeyand pods do come into play when used to avoid the internal boxing of chained laziness
12:01laurusAWizzArd, ok :)
12:02cemerickrhickey: then we might have something like lazy-seq-int in the future for when we know we're returning ints in our seq-producing code, etc?
12:02chouserrhickey: pods could replace my theoretical IChunkedIntSeq above?
12:02lpetitrhickey: how does an AOT compiled gen-class, when loaded from plain old java class (for example), initialize itself ? Specifically, is there something special concerning the classloader that will be used to load/use/require its dependent namespaces (hypothesis: those are not already loaded) ?
12:03lpetitcemerick: thks :)
12:03@rhickeysee the iterseq stuff here for a hint of pods used with seqs http://gist.github.com/306174/
12:03@rhickeycemerick: I hope not. I hope that the primitiveness can be hidden
12:03@rhickeyif everything can handle primitives, it just works
12:04chouserlaurus: I don't think the line number of defmethods is stored anywhere currently, so no way for 'source' to look it up.
12:04@rhickeybut might need some help for return values, which drive
12:04AWizzArdhmm
12:04lauruschouser, it's okay, thanks :)
12:04@rhickeye.g. reduce-long
12:05chouserhm, that's a well-forked gist
12:05lpetittoo early to twitt about the future availability of primitive handling everywhere in clojure ?
12:06@rhickeylpetit: yes, way to early
12:06@rhickeytoo
12:06lpetitrhickey: Then please answer my question about AOT compilation, so that I can dig into this problem again :-p
12:06xkb:)
12:06chouserif fns picked up the :line metadata from their forms, 'source' could be extended to help with defmethods
12:09lpetitbtw, cemerick, chouser et al., if you know the answer, you're very welcome. I'm hitting this problem since saturday night :-(
12:10chouserlpetit: every time I've tried to understand OSGi and related classpath issues, I only get a headache.
12:10chouserlpetit: I'll try again some day, but as of yet I have no answers.
12:11cemericklpetit: AFAIK, clojure-on-osgi is still an impossible needle to thread, at least in general terms.
12:12lpetitchouser: I'm close to an interesting solution for solving the "macro" issue, that is allowing bundle A to contain some clojure code, bundle B to contain clojure core, and with just the "A depends on B" declared dependency (OSGi declared), have bundle B be able to refer back to bundle's A classloader environment.
12:14chouserlpetit: interesting.
12:15lpetitBasically, here is what I'm doing in bundle B (let's name it ccw.clojure) : in the start() method, Class.forName("clojure.lang.RT") to start the initialization. And just after that, get the Compiler.LOADER var, set its root value to my own ClassLoader, which redefines findClass() by first delegating to ccw.clojure's classloader, then to each classloader of the bundles which declare depending on ccw.clojure.
12:15lpetitThis creates a "web" of bundles which share the same clojure instance, held by ccw.clojure bundle.
12:16lpetitNormally, even AOT compiled classes living e.g. in bundle A should be able to work correctly.
12:18lpetitBut I'm now in the testing phase, and I'm facing problems : my enhanced classloader I placed in Compiler.LOADER seems to be used for some use cases, but when a namespace is loaded indirectly via the loading in memory of an AOT compiled class (a namespace with a :gen-class directive in it's ns TLE), it seems like my enhanced classloader is not called.
12:18@rhickeylpetit: it just bottoms out to the normal RT.load stuff. At AOT load time however, Compiler.LOADER won't be bound, which is probably not what you want. But the correct way to drive things is with the contetClassloader, which will be used if set up
12:19lpetits/seems like/seems that/
12:19sexpbot<lpetit> But I'm now in the testing phase, and I'm facing problems : my enhanced classloader I placed in Compiler.LOADER seems to be used for some use cases, but when a namespace is loaded indirectly via the loading in memory of an AOT compiled class (a namespace with a :gen-class directive in it's ns TLE), it seems that my enhanced classloader is not called.
12:20lpetitThus my question: is there anything special concerning the "loading" of AOT compiled classes that I've not taken into account. I have the vague feeling that the classloader which is used is the classloader of the bundle of the AOT compiled class, when I thought (and I've browsed clojure code again and again) it should have been what RT.baseLoader() returns, which should *always* be my enhanced classloader once I've installed it at
12:21lpetitcemerick: I think I'm close to a working general solution, see ^^^
12:21@rhickeylpetit: you could have static init order problems
12:22cemericklpetit: I hope so.
12:22@rhickeylpetit: banging something into Compiler.LOADER is unsupportable
12:22lpetitrhickey: context classloader is unpredictable in OSGi environments.
12:23cemerickI worry that no one yet in the community has enough osgi expertise to really be able to spec out a full solution though.
12:23cemericke.g. ouch: http://twitter.com/njbartlett/status/23931383593
12:23cemerickNot that that has any bearing on practical use of it when one has control of the app in question.
12:23@rhickeylpetit: right, thus the many problems, The entire notion of webs of classloaders is outside the scope of the original definition of classloaders and every OSGi-like module environment invents their own stuff
12:24lpetitrhickey: it's just not used, and what should be in it is unspecified by the spec, and every implementation vendor is doing something slightly different with it to help "legacy" code work
12:25@rhickeybut I still rarely see coherent reports of what exactly is wrong with OSGi+Clojure, mostly just "it won't work" which it obviously will, but certain anticipated things don't, but are not specified
12:25lpetitcemerick: maybe I'll post the same content to twitter in a few days, "have been brainstorming OSGi/Clojure with cgrand lately ..." . Just hope the end will look different, though :)
12:26@rhickeyat least saying - I wan't to share a single clojure.lang namespace from multiple modules is more coherent
12:26cemerickrhickey: I have notes floating around here from a painful twitter discussion with Neil some months ago. I'll try to ping him before the conj to get an update on his thinking.
12:27lpetitrhickey: be "clojure" the name of a bundle with OSGi sources. be "client" the name of a bundle requiring bundle "clojure". Be "ns1" a ns in bundle "client". Be "ns2" a ns in bundle "client". let "ns1" (:require ns2).
12:28@rhickeylpetit: in spite of the general lack of support for context classloaders in OSGi, setting one up for the specific purpose of communicating with RT.baseLoader should still work
12:29@rhickeylpetit: you could also experiment with patching Compiler.compile()'s generated static load() method to push LOADER, RT.makeClassLoader()
12:29lpetitrhickey: now from bundle "client", require "ns1". When trying to require "ns2", we will be in a class from bundle "clojure". This class will use the context classloader (default for clojure), which will resort in most OSGi envs to use the classloader of the class's bundle as a last resort. And bundle "clojure"'s classloader has no visibility on classes and other resources in bundle "client". Thus has no visibility on the resource "
12:30@rhickeylpetit: but you can set up the context classloader, not rely on OSGi to do so
12:31lpetitrhickey: Yes. I want to share a single clojure bundle from multiple bundles. That's what OSGi can offer to me, or else I have to create a separate "world" inside OSGi, which I won't ('cause then there's absolutely no possibility for AOT classes to connect to this "separate world")
12:32lpetitrhickey: I don't want to mess with the context classloader 'cause I want to play the OSGi rules well: it's content is not guaranteed, nor is it guaranteed that if I place something in it, it will stay forever at the value I placed. And, also, context classloader should be set for each and every thread which could "hit" clojure bundle via e.g. loading of an AOT class from a declarative GUI stuff in Eclipse, and I have *no* possibili
12:33@rhickeylpetit: right, so OSGi and it's ilk really only consider dynamic use of Class.forName and patch that. They have no standard way for dynamic classloaders to attach to useful roots in their classloader-web systems
12:33@rhickeybut they usually have some way (buddies or somesuch?)
12:34@rhickeylpetit: OSGi etc don't have rules for non-static deps, that's the problem. So you play by their rules and nothing useful happens
12:34lpetitrhickey: with some limitations. I've tried playing with buddies on Eclipse, but it seems that it will not work if you do not declare all the potential interesting packages in advance as "exported packages". Will not provide an interesting dynamic experience in a repl
12:34@rhickeythey are seriously only thinking about Java and Java-like static deps
12:37@rhickeyI'd recommend this: lpetit: you could also experiment with patching Compiler.compile()'s generated static load() method to push LOADER, RT.makeClassLoader()
12:37lpetitrhickey: currently, Compiler.LOADER's root seemed free from any value. So I thought that just after clojure's initialization, where it's OK to let the default behaviour happen, since clojure only depends on itself, I could place once and for all what must be used for the lifetime of the clojure bundle. I even placed an shutdown-agents call in the bundle's (stop) method :-)
12:38@rhickeyperhaps substituting a new DynamicClassloader(osgi-loader being used right now)
12:38lpetitrhickey: ok, will leave within minutes and no time to dig into the code now. Could you explain more what you're suggesting, so that I can go ahead offline without any further tip ?
12:38@rhickeylpetit: see above about static init order
12:39lpetitI don't understood the part about static init order :-(
12:39@rhickeylpetit: the code you've written to set up Compiler.LOADER isn't being called before the static init of a class that needs it
12:40lpetitrhickey: re: perhaps substituting a new DynamicClassloader(osgi-loader being used right now) = that's what I'm doing, instanciating a DynamicClassLoader with my enhanced osgi-loader and placing it in Compiler.LOADER's root
12:40@rhickeypushing in the AOT-generated load() will ensure that, and you can root with the OSGi loader that's loading first, creating the transitive dep you want
12:41@rhickeylpetit: placing it in when, that's the problem
12:42@rhickeyAOT-generated load() will be called at static init time, a very dangerous time where only some classes are loaded and the load order depends on the dependency graph
12:42lpetitrhickey: ok, I thought that since I was pushing it way before the AOT class was really loaded (because it is loaded lazily by the Eclipse framework when I first try to open a file), it was ok.
12:44@rhickeylpetit: you might not even need your special loader
12:44@rhickeywhich is better, because you are likely to violate OSGi by doing that
12:46lpetitrhickey: unfortunately, I must leave now, I'm very late. I'll try to come back later this night. I'm surprised you think there could be a solution without violating OSGi rules (or just using the way OSGi impls currently violate OSGi rules with their context classloader solutions ?)
12:46lpetitrhickey: the solution would be in "pushing in the AOT-generated load()" ?
12:46@rhickeylpetit: try that
12:46lpetitrhickey: I don't understand what this sentence means concretely :-(
12:48@rhickeyCompiler.compile() generates the AOT class, including a static load() method that is called from the class' static init. Actually you could do the push in the static init since there's already pushing in there
12:49lpetitrhickey: ok, when you talk about push, it's "bytecode" jargon, right ? I'll look at this tonight. Thanks.
12:49lpetitbye
12:50@rhickeyhttp://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#l6631
12:50@rhickeyoh well
12:57AWizzArdHow can I enforce to get an int in the current master? At the moment I have: (class (int 50)) ==> java.lang.Long
12:58cemerick,(class (.intValue 50))
12:58clojurebotjava.lang.Integer
12:59cemerickThough I can't think off the top of my head why that would be necessary.
13:00AWizzArdcemerick: I would like to test my serializer function, which can in principle also be used from Java directly.
13:00cemerickgotcha
13:01@rhickey,(class (Integer/valueOf 42))
13:01clojurebotjava.lang.Integer
13:01@rhickeyon 1.3:
13:01@rhickeyuser=> (class (.intValue 42))
13:01@rhickeyjava.lang.Long
13:01@rhickeywant an Integer, say so
13:02@rhickeydon't rely on side effects
13:02@rhickeyimpl details
13:03AWizzArdWell, the type gets changed to Long somewhere. (def i (Integer/valueOf 100)) ... (class i) ==> Long
13:05AWizzArdIt's not that important, I am just testing to serialize different data types and now it was Integer's turn, but I am pretty sure the fns work correctly.
13:07sproustAWizzard: is this serializer part of something open source?
13:07@rhickeyAWizzArd: could you please post a bug report for that last example?
13:07AWizzArdsproust: it will be in some days
13:07AWizzArdrhickey: ok
13:07@rhickeythanks
13:08sproustAWizzard: under what name? I'm interested; have to write something with serialization/deserialization too.
13:09AWizzArdsproust: I will tell you more in some days ;)
13:10AWizzArdsproust: I tested today its speed, and it seems pretty efficient, all written in Clojure. For example, I serialized one million "Hello World 88" strings (with numbers from 1 to one mio) within about 2 seconds, and deserialized those from disk back within a bit over one second, on simple desktop hardware, no SSD
13:13sproustInteresting. Here's my use case: I have code generator for a network protocol that supports substructures, variable length lists, enums, var length strings and all the PODs. It works with C++ and Python, and I'd like to be able to connect a Clojure process to these guys. Option 1: write a Java backend and use it from Clojure, Option 2: write a backend directly in Clojure. It sounds like you've done (2).
13:14sproustDo you support unsigned integer types?
13:16aaron__trying to understand why I'm not allowed to nest anonymous functions
13:16aaron__java.lang.IllegalStateException: Nested #()s are not allowed
13:16TeXnomancyit looks like sometimes defn copies all the var's metadata to the fn and sometimes it doesn't (in clojure 1.2); is that a known bug?
13:16mrBlissaaron__: you won't know if % belongs to the inner or the outer anonymous function
13:17TeXnomancytrying to narrow down the circumstances in which it gets dropped
13:17AWizzArdsproust: I've done (2), yes. In principle everything is supported, though if you want unsigned types then a wrapper defrecord should be used.
13:17dnolenaaron__: you can nest anon fns, just not #()
13:17aaron__oh so if i just convert to (fn... syntax?
13:19dnolen,((fn [x] ((fn [y] y) x)) 1)
13:19clojurebot1
13:19dnolenaaron__: ^
13:20njbartlettcemerick: Yes, I do :-)
13:20cemericknjbartlett: nifty :-)
13:20njbartlettcemerick: Just asking Alexey if he's available
13:21cemericknjbartlett: Laurent Petit has been on a bit of an OSGi/Clojure crusade the past few days -- though he just took off....
13:21cemerickI looked into it somewhat briefly a while ago as well, if you'll remember.
13:22TeXnomancyalso: is there a reason (:name (meta (fn my-fn []))) doesn't return my-fn?
13:22njbartlettcemerick: Okay. There are a number of challenges, and Alexey seems to be quite far along. He has the advantage of knowing OSGi well for a few years before getting involved in Clojure
13:22aaron__dnolen: thnx
13:22njbartlettcemerick: I looked at it also, but I just don't know Clojure :-)
13:23cemericknjbartlett: yeah -- I have a vague notion of the issues involved, but I'm not clear enough on them to really push the issue with rhickey.
13:23aaron__mrBliss: ah yes, ambiguity. thnx for explanation
13:23njbartlettcemerick: Well as I recall, when I first looked it was impossible because Clojure used a fixed classloader. Recent versions use the Thread Context ClassLoader so that can be adapted.
13:24cemerickRight...that's where it sounds like Laurent is poking at (though perhaps there are other issues around AOT-compiled classloading as well).
13:24aavnjbartlettb: right. now it somehow possible.
13:24cemericknjbartlett: if either you or Alexey can write up the main blockers as you guys see them, that would go a long way towards bridging the divide, as it were. :-)
13:24njbartlettcemerick: But there's still significant challenges such as dynamic unloading etc, which may happen in OSGi but there doesn't seem to be any way to release the classes associated with a Clojure value. Still it won't be a disaster if that aspect is not supported.
13:25njbartlettcemerick: Looks like aav is online now
13:25cemerickYeah, unloading seemed to be the biggest challenge when I looked at it, and also possibly parallel multiple versions of the runtime.
13:25cemerickaav: nice to meet you :-)
13:26aavcemerick: Hi! :)
13:26njbartlettcemerick: Yup. I wanted to avoid multiple clojure runtimes because they seem rather slow to start, e.g. a few seconds. Maybe it's improved but you certainly don't want more than (say) 10 Clojure runtimes floating around :-)
13:26cemerickIt's a necessary evil thanks to classloading.
13:27cemerickThere's certainly value to being able to ramp up whatever modules one happens to have around, and not have to worry about one using 1.2.0 vs. another using 1.3.0, etc.
13:27njbartlettaav: Do you know how far Roman Roelofson got with his effort?
13:27aavnjbartlett: i think 1 runtime is ok. in any case we have only one jvm runtime. proper control over such things as loading/unloading could help a lot
13:28aavnjbartlett: i don't know
13:29aavnjbartlett: in fact there is a more fundamentsl question - what is clojure/osgi integration. as we discussed some days ago.
13:31cemerickaav: That's been a recurring question here as well. Some that have much more osgi experience have apparently been frustrated with clojure, but getting more formal descriptions of what was needed to smooth the way has been tough.
13:31njbartlettaav: Yes you're right. It's clear that a dynamic non-oo language doesn't need some of the service oriented features offered by OSGi. I see it as more important for interop between Clojure and non-Clojure code in a large application
13:32njbartlettaav: For example, what if I want to write an Eclipse plug-in in Clojure?
13:32njbartlettcemerick: Apologies for that. It's a lack of understanding on both sides, I believe.
13:32cemericknjbartlett: Exactly why I invited you :-D
13:32aavnjbartlett: or seeing osgi as a simply loading/modulariation tool for a pure clojure app. as I see it now with my project
13:33cemerickMy usage is always very straightforward, e.g. using RCP for a dedicated app, which is not a problem.
13:34njbartlettRight I think OSGi offers some nice features w.r.t deployment and management even in a pure Clojure app.
13:34aavnjbartlett: right. that is what i'm talking about
13:36njbartlettaav: You would know more about that, and whether those advantages are truly compelling. From my side it's a practical issue -- I'm not able to use Clojure as long as it's incompatible with my preferred runtime. And even when I do use it, it is likely to be part of a mixed language environment with lots of Java libraries
13:37cemerickTo me, it seems the big question is: are there changes to clojure itself that are necessary to get to an ideal solution (given the dynamic nature of things), or are we just looking at a good BundleActivator recipe that shows how to link up the classloaders properly?
13:37njbartlettaav: You want to summarise what you've achieved so far?
13:38njbartlettcemerick: I think we can get quite far without changes to Clojure, but dynamic unloading doesn't seem possible currently.
13:38njbartlettcemerick: And it's more likely to be an extension bundle that can be installed to enable Clojure support, rather than a BundleActivator recipe
13:39cemericknjbartlett: so the premise is only one version of clojure loaded and available per runtime then?
13:39aavnjbartlett: the main thing i have for the moment is a more or less proper loading of clojure files from different osgi bundles, that respects osgi classloading
13:40njbartlettOkay how about we state some requirements...
13:40njbartlettFirst, we should be able to ship .clj files in a bundle and have them loaded and run by the Clojure runtime
13:40aavi.e.: if a.clj from the budnle A loads b.clj from the bundle B, and b.clj refers to some java class, that is not exported from B - it will work
13:41cemerickmay I suggest a shared google doc? :-)
13:41njbartlettSecond, those .clj files should have visibility of compiled classes shipped in the same bundle, and/or the imported by the bundle
13:41njbartlettHehe good plan
13:41cemericknjbartlett, aav, /msg me your gdocs email addys :-)
13:41njbartlettnjbartlett at gmail dot com
13:42cemerickI'll rope Laurent in next time I see him as well
13:43cemericknjbartlett: https://docs.google.com/document/edit?id=11G7v_I1DMWisc5pWKWisW85rUkGk9egi_voT4Mp_vQo#
13:43njbartlettcemerick: Thanks. It's great to have you working to try to solve this....
13:43njbartlettcemerick: The OSGi Community Event is happening this week, there's likely to be a few people there interested in Clojure too
13:43cemericknjbartlett: I doubt I can contribute much, unless there actually are Clojure changes to be made. Just trying to get the right people together. :-)
13:44njbartlettcemerick: Right, which in itself is a big help
13:44aavcemerick: that's the most important thing
13:45cemericknjbartlett: Nifty; if anyone there has ideas/concerns/whatever on the topic, point them at the gdoc, and I'll add them in if they have particular points they want to push
13:46cemericknjbartlett, aav: http://bit.ly/clojureosgi
13:53ataggartDoes anyone know why bit-shift-left, when passed an int or long will resolve to Numbers.shiftLeft(long, ...), but when passed a byte it resolves to Numbers.shiftLeft(Object x, ...)?
13:56lazy2nick lazy1
13:57lazy1Sorry
14:09mrSpecI had added in project.clj ":dependencies [jung/jung "1.7.6"]", then I did $ lein deps, what should I add in core.clj to use this library? :import [edu.uci.ics.jung.graph.*] is not enough?
14:10aria42Will it be possible in 1.3 to make a map which stores primitives as values, similar to the gvec ? A lot of my slowdown from Java for statistical stuff comes from
14:10lazy1mrSpec: There's no * import in clojure (IIRC)
14:11chouseraria42: I'm not aware of anyone working on a generic hash-map type (gmap?) like gvec.
14:11dnolenaria42: why not use defrecord for that? access like map but get primitive fields
14:11aria42Wouldn't you need deftype to make it act completely like a map and override toString etc?
14:11dnolenaria42: defrecord already has all the map stuff.
14:12mrSpeclazy1: ah ok, but (:import [edu.uci.ics.jung.graph.SparseMultigraph] ) doesnt work too :(
14:12dnolen(:import [edu.uci.ics.jung.graph SparseMultigraph] )
14:12dnolenmrSpec: ^
14:12lazy1After "lein deps" how do you run clojure?
14:13mrSpeclein swank
14:13dakronelazy1, 'lein repl'
14:13aria42dnolen: Awesome thanks. It's a huge slowdown relative to Java, but might be able to move all machine learning code to Clojure
14:13mrSpecand slime-connect
14:13lazy1dakrone: That was a question for mrSpec, sorry for not being clear
14:13lazy1mrSpec: Sorry, don't know swank
14:13dakronelazy1, ahh okay, apologies
14:15aria42dnolen: I thought defrecord/deftype couldn't return primitives or use as args. at least currently
14:15mrSpeclazy1: hmm should this space change anything? it didnt for me
14:15lazy1dakrone: Never apologise for a good answer :)
14:15mrSpeclazy1: ah I see.
14:16mrSpecI got "edu.uci.ics.jung.graph.SparseMultigraph
14:16mrSpec [Thrown class java.lang.ClassNotFoundException]"
14:16lazy1mrSpec: I use "lein repl" and then (import 'edu.uci.ics.jung.graph.SparseMultigraph)
14:16mrSpeclazy1: ok, I'll try this
14:17chouseraria42: (defrecord Foo [^int i ^long j]) (clojure.contrib.repl-utils/expression-info '(.i (Foo. 1 2))) ;=> {:class int, :primitive? true}
14:17lazy1mrSpec: You can check the value of *classpath* to see if the jar is there
14:18aria42chouser: okay thanks. not sure why i thought that.
14:20chouseraria42: using (:i x) will autobox the return value I think
14:20aria42chouser: right because the ILookup interface returns object
14:21chouserright
14:21mrSpeclazy1: In lein repl : clojure.core=> *classpath* java.lang.Exception: Unable to resolve symbol: *classpath* in this context (NO_SOURCE_FILE:0)
14:21mrSpecand a line earlier I got classnotfound exception :/
14:22chouseraria42: but gvec returns autoboxed objects too. both gvec and records will store using primitives with the memory and cache savings that implies
14:22lazy1mrSpec: Which version of lein and clojure do you use?
14:23mrSpeclazy1: the newest I think, installed today ;) clojure-1.2.0.jar
14:23mrSpeclazy1: & Leiningen 1.3.1 on Java 1.6.0_20 Java HotSpot(TM) Client VM
14:25aria42chouser: gvec has to do that to satisfy ISeq though. Might be a bad idea but you could have a protocol for a double map that avoided autoboxing.
14:25lazy1mrSpec: *clojure-version*
14:25chouseraria42: vectors don't implement ISeq, but I know what you're saying.
14:26yayitsweiquick question: how do you specify compile-path in cake? in leiningen, it's :compile-path "war/WEB-INF/classes"
14:26mrSpeclazy1: {:major 1, :minor 2, :incremental 0, :qualifier ""}
14:27lazy1mrSpec: Seems OK. The only thing I see is that you're in clojure.core namespace and not in user namespace
14:28ninjuddyayitswei: cake doesn't currently support :compile-path. what are you trying to do?
14:28lazy1mrSpec: Try (ns user) and then *classpath*
14:29mrSpeclazy1: ah, I was in myproject.core package
14:29yayitsweininjudd: trying to build a webapp directory that i can deploy to google app engine (it only accepts a directory, not a war file)
14:30mrSpeclazy1: ok, I see "/lib/jung-1.7.6.jar" in this classpath string
14:30lazy1mrSpec: Then you've reached the limit of what I can help :)
14:30mrSpecoch :(
14:30mrSpecok, thanks!
14:31ninjuddyayitswei: i would add a copy to the end of compile then
14:31lazy1mrSpec: Oh, why is there "/" at the begginng of the jar, should be absolute path to the lib director inside the project
14:31clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
14:32yayitsweininjudd: good idea, thanks
14:32mrSpeclazy1: yes, it /home/mrspec/project/lib/jung
14:32ninjuddor symlinking classes within your repo would work too
14:32lazy1mrSpec: So this is the problem, however I don't know what caused it
14:32yayitsweieven better
14:32mrSpeclazy1: maybe I should import something else?
14:33lazy1mrSpec: Don't know anything about jung
14:33mrSpeclazy1: ok, I'll try find some more informations. Thanks btw!
14:35lazy1mrSpec: No worries
14:35mrSpecit is strange, cause the same import works for me in NetBeans
14:35mrSpecbut I've moved project to emacs :/
14:35mrSpecand used lein
14:37lazy1mrSpec: From the command line, try "java -Djava.ext.dirs=lib clojure.main" and then import
14:41mrSpeclazy1: (import 'edu.uci.ics.jung.graph.SparseMultigraph) ? Not found :/
14:47gcvA question for anyone familiar with the Clojure compiler: why are protocol fully-qualified names converted to use underscores instead of dashes, whereas types and record names are not?
14:50chouserI don't know. My guess is that it's an oversight.
14:50lazy1mrSpec: According to the docs, SparseMultigraph is a generic, probably need some clojure import magic I don't know
14:51chousergenerics don't require anything unusual in Clojure.
14:51chouserusing them doesn't, I mean.
14:51lazy1chouser: You know way more than me on the subject
14:52chouserif (import 'foo.Bar) says ClassNotFound, then foo.Bar must not be on the classpath clojure is using.
14:52gcvchouser: The relevant code is in core_deftype.clj: emit-deftype*, emit-defrecord, and emit-protocol, right? I want to change it to see if it makes a bizarre classloading problem go away.
14:52chouserthe possible causes of this are many and tiring.
14:57chousergcv: yeah, I think that's right.
14:58chouserlooks like the relevent parts of defprotocol may have been taken from gen-interface code which is rather older and more fully tested "in the wild"
15:01octei'm using swank/slime to develop a program, and i'm passing a function as a callback to a function and storing it
15:01octere-evaluating the passed function in slime leads to a new definition of the function, but the stored callback still refers to the old one
15:01octeis there some way to lazily call it?
15:01octenot sure if'm explaining very good :)
15:02chouserocte: you could try passing and storing the var instead
15:02chouser(set-callback #'foo) instead of (set-callback foo)
15:03chouserocte: the callback should be callable in exactly the same way as it was before
15:04mrSpecsimpliest solution is the best, I copied manually all downloaded from jung's website libraries to ./lib and it works.
15:04mrSpecthanks!
15:05octechouser, cool, thanks
15:31lpetithello again
15:38LauJensenlpetit: helloo
15:38lpetitLauJensen: Hello!
15:39lpetitI think I've understood what's the piece I missed the previous time, when Rich kept talking 'bout "push something, push something". He was referring to "pushThreadBinding", isn't it ?
15:41chouserlpetit: he posted a link right after you left: http://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#l6631
15:42lpetitchouser: oh yes, thx
15:42lpetitchouser: but bytecode generation is not (currently) in my skills
15:43lpetitchouser: so there's a lot of implicit knowledge that's just fleeting inches over me when I'm talking with Rich right now :)
15:43chouserlpetit: it is that way always with me when talking to Rich, whether about bytecode or anything else. :-)
15:43lpetitchouser: :)
15:44chouserlpetit: but I think you're right. Compiler.pushNS() does a pushThreadBindings on *ns*
15:44lpetitchouser: so now for something a bit more involved. I want to ... what exactly do I want to ? :)
15:45lpetitchouser: At first, when he talked about pushing, I thought he wanted me to move some lines of code from some init() function to some load() function
15:46raekwas there some neat way to make the repl print through pprint?
15:47chouserlpetit: I have to work hard to come up with weak guesses as to what various bits of byte-generating code do
15:48chouserlpetit: so I'm staring at that line rhickey pointed to
15:48ataggartchouser, et al.: I'm digging into the compiler to try and figure out why (bit-shift-left int int) will resolve to Numbers.shiftLeft(long, int), but (bit-shift-left byte int) will only resolve to Numbers.shiftLeft(Object, Object). Do you know of a reason Rich excluded such automatic widening conversion for bytes?
15:48lpetitchouser: and I'm starting at this sentence from him "you could also experiment with patching Compiler.compile()'s generated static load() method to push LOADER, RT.makeClassLoader() "
15:48chouserit looks like the body of some function. the static init of a class?
15:49lpetitchouser: I guess the first argument is the name of a class, the second the signature of a method.
15:49lpetitchouser: clinitgen.invokeStatic(Type.getType(Compiler.class), Method.getMethod("void pushNS()"))
15:49chouserlpetit: so, you're already pushing a thread binding for *ns* -- perhaps you could also do that for LOADER and initialize it to a new loader created with RT.makeClassLoader()?
15:50@rhickeychouser: yes, the static init of the init class for an AOT compiled file
15:50lpetitmeans invoke the static method of type Type.getType(Compiler.class) (that is of class Compiler) , and the method is pushNS()
15:50@rhickeyer, ns
15:50lpetityes,
15:50lpetitNow I'm trying to understand how to pass arguments
15:50@rhickeychouser: right, push a binding for Compiler.LOADER
15:51@rhickeyJVM bytecode is a basic stack machine
15:51lpetitI need to do something like pushTreadBindings(Compiler.LOADER, RT.makeClassLoader())
15:51lpetitSo I first push the arguments, then the method call ?
15:51lpetitprofessor Rich ? ;-)
15:52@rhickeylpetit: just parrot what is there. The compiler has a helper to do the pushNS, and just calls that. You could do something similar
15:52@rhickeypush args, invokeStatic
15:52amalloyi found this emacs function to make C-a move to the beginning of text instead of beginning of line, but sometimes i want to move to the beginning of the line. is there a built-in function to move to the beginning of text, unless it's already there in which case go to beginning of line?
15:53lpetitrhickey: ok
15:54lpetitHmm, If I do a second separate call to pushNS, then I'll have to add a second pop, right ?
15:57lpetitOMG ! All this java sugar with finally is just local gotos at bytecode level !
15:58lpetitwhile understanding that it is not java-related at all :)
15:58kotaraklpetit: well, everything boils down to that, I guess.
15:59klangamalloy: would Ctrl-up/down be acceptable?
15:59cpfrits all goto control flow at the bottom
15:59lpetitkotarak: hello ! Indeed, but still, it does something the first time you see it :)
15:59lpetitit's like seing your idol in toilets
16:00klangamalloy: what is the function called?
16:00amalloyklang: beginning-of-line-text
16:00amalloyklang: Ctrl-up/down move paragraphs. i don't mind binding it to whatever key, i'm just trying to find out if there's a function for the behavior i want or if i have to write it
16:01kotaraklpetit: sometimes it shines through: http://groups.google.com/group/clojure/browse_thread/thread/3c886a42aab88444#
16:02lpetit;)
16:04klangamalloy: Don't mind me then. It seems that you have the functions you want, but not enough keys?
16:05amalloyi suppose that's true. i was hoping to bind them both to C-a so i could just hit it twice to override the default behavior
16:05amalloyeg, the Home key in eclipse does that
16:06klangamalloy: you want cords?
16:06amalloyklang: i don't think so
16:06klangamalloy: key-chord.el --- map pairs of simultaneously pressed keys to commands
16:07amalloyi want to bind to C-a a function that does this (if (at beginning of text) (go to beginning of line) (go to beginning of text))
16:07amalloyit sounds like there isn't one, so i'll just slap it together myself
16:08klangamalloy: You almost did, just then.
16:08amalloyhaha
16:08amalloyi know. just didn't want to duplicate code
16:09klangamalloy: well, you'll know how it works, when you are done. Inventing the wheel is fine.
16:09amalloyfair enough. thanks
16:09klangno help from me ..
16:10amalloywell, you confirmed that i am not doing myself a disservice by inventing the wheel
16:12klangamalloy: heh!
16:13amalloyklang: maybe you can still help - do you know where i can find source for the built-in functions like (bolp)?
16:17klangamalloy: M-x describe-function
16:17klangamalloy: in bolp's case, it's a C function
16:19amalloyhm. that gets me a description from *Help*, but no lisp code that i can see, even for functions that are "compiled Lisp functions"
16:22klangamalloy: the source for blop is written in C .. I don't think you want to go that far, but you could if you wanted. The source is available.
16:22amalloyo
16:22amalloyer
16:22kotarakmsg LauJensen Hi! You remember the slight regression in performance of vlist against a vector?
16:22kotarakwoops
16:22amalloyi'm not actually looking for bolp; it was just an example
16:23klangwell, the example still holds .. if it's an elisp function, there will be a link to the file where it is defined and _that_ will be easily available.
16:24amalloyi see. okay
16:25lpetitWhy use with-loading-context in the definition of ns ?
16:25klanghold your horses .. something is different ..
16:25lpetitAnd why does with-loading-context push (.getClassLoader (.getClass ^Object loading#)) into clojure.lang.Compiler/LOADER ?
16:25lpetitWhat if instead, in with-loading-context, I push RT.makeLoader() into Compiler.LOADER ? ;-)
16:25klangI guess you have to have emacs elisp source files installed for that to work (I don't on this machine, it seems)
16:26lpetitDo I then solve my problem, and open a can of worms elsewhere ?
16:26klangamalloy: it works for the functions where the .el file is available somewhere..
16:28lpetitWho wrote the first ns ?
16:32lpetitchouser: hehe, when I also change with-loading-context, it works again !
16:32lpetitLet's say Hourray 'til Rich says it's not supportable ! :-/
16:34amalloyklang: okay, *now* i need help with keybindings :)
16:35amalloyhttp://gist.github.com/599774 - the function works if i call it with M-x, but i can't bind it to a key because it says Symbol's function definition is void"
16:36amalloyoh haha, never mind. i typed the wrong name :P
16:37klangwell, then the error message *does* make sense :-)
16:39klangamalloy: and yes, it does work fine, and follows your pseudo code above!
16:40amalloysure does! good ol' emacs. anyway it works like a dream now. you should try it, it's clearly better than the builtin :)
16:41klangI am trying it, I am trying it! .. it deviates from how my fingers work, though!
16:42amalloyhaha
16:43amalloyklang: mostly i found i want beginning-of-text to do editing, but beginning-of-line to make C-k more useful
16:45klangamalloy: well, that IS a compelling argument :-)
16:48klangamalloy: Laters, because it's late in my neck of the woods. .. and look into some tab completion (hippie-expand) for emacs, you woun't regret it :-)
16:50amalloythanks klang
16:50klangno problem
17:15gfodorhey all, I'm a little stumped here. I have a java static class that has a nested static interface, and I can't seem to reference the interface form closure. The static class, for example, is com.myorg.MyService and the interface is com.myorg.MyService.Iface (this is generated from thrift). when I reference com.myorg.MyService in the REPL it resolves, but com.myorg.MyService/Iface and com.myorg.MyService.Iface fail to resolve. I'm trying
17:15gfodorextend this interface via gen-class
17:15gfodors/closure/clojure
17:15chousercom.myorg.MyService$Iface
17:16gfodoryes, thank you!
17:17gfodorbtw, JoC is *awesome*
17:19chouserah, thanks. :-) Except we missed that detail? :-/
17:22gfodorprobably not -- just using chapter 10 here as a guide
17:22gfodornot in there I don't think, but probably elsewhere
17:23chouserhm, a couple examples like in chapter 5, but not explicitly called out anywhere it seems.
17:26gfodorwelp, when in doubt, try every non-alphanumeric character :)
17:26KirinDaveHey folks, are there any discussions of patterns for deftype/reify use?
17:26KirinDaveI find myself wanting something like inheritence, but I'm unsure how I should model it in cloure.
17:27KirinDaveErr, clojure.
17:27KirinDaveSpecifically I'm writing a port of webmachine to clojure, and I'm looking at how Erlang did things.
17:28KirinDaveIt seems like inheritence would actually be a very good way to model a default webmachine resource, allowing for overrides.
17:29KirinDaveOtherwise, I'm going to have to make like, what... a macro?
17:29KirinDaveOr maybe do what erlang does literally and check if a namespace has methods
17:29KirinDaveBut I don't like that very much.
17:30KirinDaveIs there a pattern for modeling a simple override (restricted 1-level inheritence) for deftype when they need it? Default implementations for definterface?
17:31kotarakKirinDave: you can have that with extend.
17:32KirinDavekotarak: Is that the right way tho?
17:32kotarakI think so.
17:32KirinDaveIf I want to, say, make complex syntax stuff on to.
17:32KirinDaveErr, on top
17:32KirinDaveUsing all the macro-let
17:39KirinDavekotarak: I guess in order to make extend do that transparently, it'd have to do a merge of a default behavior map with a map or syntax-assisted thing defined by the user.
17:42chouserKirinDave: http://kotka.de/blog/2010/08/Static_vs_Dynamic.html
17:43KirinDavechouser: I confess even a smalltalk nerd like me is having a bit of a hard time fully grokking the intended use of these primitives.
17:43chouser:-)
17:43KirinDavechouser: Which reminds me
17:44chouserextend with merge is currently the cleanest and most-recommended way to mix "default" and "specific" functionality for a single type or record
17:44KirinDaveHe says it is "faster" to use the def* route as opposed ot extend
17:44chouseryes, slightly
17:44KirinDaveIs that at the time of instantiation
17:44KirinDaveor for every method call?
17:45chouserinstantiation speed should be the same, I think. It's the method call that's different
17:45KirinDaveOh. Bummer
17:45KirinDaveI mean, they're syntactically isomorphic, so no big deal.
17:45chouserusing a protocol method on a type that defined that method "inline" will be as fast as a java method call -- that is, as fast as possible in the JVM world.
17:46KirinDaveI suppose if I am writing something to try and handle lots of data at high speed, it'd be preferrable to use that method
17:46octewhat's the syntax for type hinting that it's a string array?
17:46KirinDaveWith a syntax transformer
17:46chouserusing a protocol method on a type that it was extended to is still very fast (faster than a multimethod, for example) but not quite raw java method-call speed.
17:47chouserbbl
17:49kotarakocte: ^{:tag "[Ljava.lang.String;"} string-array
17:49kotarakocte: ^"[L....;" string array might also work.
17:50octe^"[Ljava.lang.String;" tokens
17:50octeworked
18:02bhenry,(seq? ())
18:02clojurebottrue
18:03bhenry,(seq ())
18:03clojurebotnil
18:04chouserwhat if, by default, multiple forms on the same line of the repl were eval'ed as if inside (->> ) ?
18:11lpetitchouser: Yata ! I did it !
18:14octe,(list? "asd")
18:14clojurebotfalse
18:14octe,(list? ["a" "b"])
18:14clojurebotfalse
18:14octe,(vector? ["a" "b"])
18:14clojurebottrue
18:19amalloychouser: seems like an idea worth toying with, anyway. especially if you're the one implementing it
18:20amalloythough it has the weird implication that pasting something into the REPL from a source file won't necessarily do the same thing
18:23amalloyi can't think of an example of *good* code that would have a problem, but imagine (def x 10) (def y 9); auto-coercing that into a ->> would mess things up beyond recognition
18:26rplevydoes Compojure not accept dots in route parameters?
18:26rplevyas the arguments I mean
19:36rplevyre my earlier question, just in case anyone wanted to know the answer, you can override the default regexp that partitions a section of the URI. The default is on line 93 of clout/core.
19:51charliekiloI searched and could not find where clojure.contrib.properties, esp. with-system-properties, want in 1.3.0-alpha1. Any hints are appreciated
19:51charliekilocorrection: ... went ...
20:03solussdis it not possible to dismiss a MPMoviePlayerViewController (presented modally) if it was presented inside of a modally presented view controller? It seems to just ignore my calls to dismiss it.
20:03solussdwrong channel, sorry
20:09tomojso I'm writing a parser for this simple binary format. you read a byte, that gives you the packet type. then you can look up based on the packet type a sequence of types to read from a DataInputStream. this is what I've got so far: https://gist.github.com/e0ed6482a332826e4dcd
20:10tomojfor each defpacket which defines a packet type, I alter-var-root to add a parsing fn to a map of packet type ids -> parsing fns
20:10tomojwhat I'd really like is to just expand to a case statement on the packet type id
20:11tomojbut that means I need to wait until all defpackets are done and gather them, then expand
20:11tomojwhich means they all have to be in one macro call, in one file
20:11tomojany ideas?
20:14amalloytomoj: you could require all the defpackets to be given at the same time: (defmacro defpackets [& specs]...)?
20:14tomojright
20:14tomojbut then they all have to be in the same file
20:14tomojI'm wondering if there's a decent way to do it where they don't have to be
20:15tomojactually, I will just require the user to declare which packetdefs they are using when constructing their parse fn
20:15tomojnevermind
20:45chouseramalloy: yeah, good point
20:49chouserI guess if I had paredit at the repl I wouldn't find this attractive at all?
20:50amalloychouser: caught me on my way out, actually. i'll be around in a couple hours if you still want to bounce ideas off me
20:57laurusHow does one print the header of a data-file in Incanter?
20:58laurusOh, duh
20:58laurus(col-names <datasetname>)
20:58laurus:P
21:03bhenry,(seq "")
21:04clojurebotnil
21:04bhenrylaurus, sorry not for you. just looking at something.
23:39bhenrycan anyone get me started with ring.middleware.session/wrap-session
23:41bhenryi have (wrap-session {:cookie-name "qa-session"} handler), but i don't know how to manipulate and read the session data
23:43scottjI don't use ring directly but it adds a :session key to my request for me
23:44bhenry(:session req) returns an empty map, but i can't figure out how to set that map with my values for the session.
23:45bhenryideally i'd want to manipulate data in the handler, then set the session in the response. for future access to the session data in other handlers.
23:46scottjI think your handler would return a response with something in the session key
23:46bhenryhmm. i tried that. i'll keep digging.
23:48scottjthey're functional. sandbar adds banging functions
23:50tomojhaha, my output is #<NullPointerException java.lang.NullPointerException>
23:50tomojand a usage message
23:50bhenryi saw session-put! in an example that :uses entire name-spaces. i think i actually have sandbar in my class path right now, so i'll play with it
23:50tomojthanks, really helpful hadoop!
23:57technomancysneak preview: http://p.hagelb.org/lein-mock.html