#clojure logs

2011-06-19

00:02stirfoohow do you document a defrecord? I'm assuming it's (defrecord ^{:doc "foo"} foo [x]) which evaluates OK, but how to I access that docstring?
00:05hiredmanseancorfield: in my mind it would start with a walk through of the compiler, what it does, what it supports, how it supports it, then the datastructures, then the reader
00:06hiredmanpossible some kind of dive into the reference types following the compiler, the stm, agents, how they interact, are implemented, etc
00:07hiredman1.3.4 Vars, what the hell?
00:08hiredmanseancorfield__: https://gist.github.com/1033748
00:12seancorfield__thanx... reading...
00:14seancorfield__hiredman: so, not a book about the language so much as the machinery behind it?
00:15hiredmanthe implementation
00:19hiredmanI am serious, why vars? common lisp doesn't have vars by default (symbols actually provide storage), neither does scheme, or ml or haskell, so why? and the book would critique the choice of using vars and their implementation
00:20hiredmanpossibly for 1.3 some examination of the method of binding conveyence, and pitfalls of the same
00:29seancorfield__who would your audience be for such a book? just curious
00:30hiredmanseancorfield__: me
00:30technomancydear apache ant: http://www.poojee.co.uk/images/2010/02/i_wish_i_could_hate_you_to_death_01.jpg
00:32technomancyman you don't even have to visit that link; the url says it all
00:32hiredmanseancorfield__: and of course I think all clojure programmers should read such a book
00:32davekongtechnomancy: I was a little disapointed when I did :(
00:32technomancydavekong: sorry I guess?
00:33technomancy60% of the links I paste are from webcomics
00:33technomancyfair warning
00:33hiredmanhttp://cdn.someecards.com/someecards/usercards/1299543184590_8002436.png
00:33davekongthat's better
00:34hiredmanpa is generally not what you would call understated
00:35hugodtechnomancy: switch to aether
00:35technomancyhugod: I'll get to it
00:36technomancythere's just one more stupid thing I have to do in 1.6
00:36technomancybuggered thing simply does not have a way to turn off its logging output
00:37technomancy.removeBuildListener: no-op. .setMessageOutputLevel: no-op
00:37technomancydavekong: is this better? it has blood: http://www.penny-arcade.com/comic/2007/4/9/
00:38technomancybasically you can set :local-repo-classpath true in project.clj, which is awesome
00:39technomancysince it just doesn't bother creating lib/ at all, it just constructs the classpath straight out of .m2
00:39hugodthe aether home page is out of date, this works for me with aether 1.11 https://gist.github.com/1033762
00:39technomancywhich you could argue it should have done all along; whatever. hysterical reasons.
00:39davekongtechnomancy: yea
00:39technomancybut "lein classpath" will give you all this crap about Downloading: janino/janino/2.5.15/janino-2.5.15.jar from central blah blah blah even though all you want it to do is output the classpath
00:40technomancyhugod: switching is in the cards for the next version. but I just want to get 1.6 out the door soon. =\
00:40hugod:)
00:43technomancyI think I may just have to tag it with a warning =(
00:44technomancyI do not want to spend another minute digging through ant's source
00:44technomancyespecially when its docs are wrong
00:57carllercheI've been messing with clojure, class loaders, and hot deploying (new to this), it seems that clojure defaults to the "Compiler"'s class loader (not sure exactly what that is), does that mean that it isn't possible to create a classloader in clojure to load other clojure jars?
00:59hiredmancarllerche: the compiler uses the classloader that is held in the LOADER field (which in turn holds a var, and the var holds the classloader) of the Compiler class
00:59hiredmancarllerche: it is possible and very easy to do if you are loading clojure source files, more complicated if loading jvm bytecode
00:59carllerchehiredman: Hmm, i missed the loader, it seemed to me that it went straight to compiler...
01:00hiredmanhuh?
01:00hiredmanthat doesn't make sense
01:00hiredmananyway this is what I do in clojurebot to load plugins https://github.com/hiredman/clojurebot/blob/master/src/clojurebot/plugin.clj
01:00carllerchehiredman: sorry, i was just reading the clojure source wrong :P
01:02carllerchehiredman: ah, that seems simple enough... does clojure care about the current thread context class loader?
01:03hiredmancarllerche: it depends, there are some vars you can set but it is all a rather tangled mess
01:04carllerchehiredman: So, I believe that the answer is yes, but just in case, unloading clojure code by disposing of classloaders is a sane thing to do?
01:05hiredmanno
01:05hiredmanunloading is not really possible
01:05carllerchewhy not? does clojure keep global references to stuff?
01:05hiredmanand I am unsure what you mean by "disposing of classloaders"
01:05carllerchejust losing the reference to it and have the GC clean it up
01:06hiredmanI don't believe that is sane
01:06carllerchehmm... it works w/ java and at least jruby :-/ (w/ some caveats)
01:07hiredmancarllerche: no doubt there are some caveats
01:07carllerchei'll play around with it.... I think that as long as I don't import crazy libraries, it should work...
01:08carllercheI'm building a simple proxy on top of netty and would like to deploy new code w/o having to reboot the JVM process
01:26seancorfield__carllerche: one thing to watch out for is running out of permgen if you keep loading new classes
01:26carllercheseancorfield__: in theory, the GC should clean up classes if the classloader gets GCed
01:27seancorfield__if you really want a long-lived process, you will have to manage classloaders directly and ensure you throw them away (unreference them)
01:27hiredmanit is, in fact, the reverse
01:27hiredmanclassloaders only get gc'ed if the classes it loaded have been gc'ed
01:27seancorfield__if a class is referenced, the classloader tha... yes, what hiredman said
01:27hiredmansince all classes hold a reference to their classloader
01:28seancorfield__you need to ensure that every class loaded by a classloader is no longer referenced
01:28carllerchetrue...
01:28seancorfield__for the railo project, we hit that exact problem
01:29carllercheseancorfield__: I'm trying to write a simple tool that loads a jar in a URLClassLoader and when the jar changes, discards it and starts a new one passing some state between them (netty channels)
01:30carllercheI know there are a few libraries that cause trouble w/ holding on to references
01:30seancorfield__that will require that no instances to any loaded classes still exist too
01:31carllercheseancorfield__: yeah... I think it should be possible
01:33carllercheworst case scenario, i can just increase permgen and do a full JVM restart 1/10th of the time
01:34seancorfield__like everyone else using java :)
01:34carllercheheh
01:34carllerchei'm still fairly new to the JVM in general
01:34hiredmanyou can also just avoid the whole classloader mess by reloading clojure code using load-file or require + :reload-all etc
01:35carllerchehiredman: how would you reload clojure code in a production system?
01:36seancorfield__how does clojure handle that internally? i mean, it must have a class loader associated with all the compled clojure code?
01:36carllerchehiredman: would you not build a jar and watch the files individually and reload them?
01:36hiredman4.3.5 What Is With All This DynamicClassloader Thing Clojure Uses
01:37hiredmancarllerche: watch?
01:37seancorfield__if you keep reloading clojure code, it will keep compiling new classes and eventually it'll hit the same problem - and run out of permgen?
01:37hiredmanseancorfield__: the old classes will loose references and get gc'ed eventually
01:37carllerchehiredman: dunno, some script that watches last modified times on the file :P
01:37hiredmangenerally the roots in clojure are vars, reloading clojure code will result in the vars holding on to different objects
01:37seancorfield__hiredman: probably more likely in a functional system than an oo one i guess...
01:38hiredmancarllerche: doesn't need to be a jar
01:39hiredmanyou could do it something very like the code I linked above, which uses a url classloader, but you could use any kind of custom loader
01:39seancorfield__hiredman: good point re: vars... yes, that would resolve most hanging references
01:39carllerchehmm, interesting. I'll play around with that. Thanks for the tip
01:40seancorfield__biab... netbook needs a reboot to fix flaky network
01:41u35tpusgood morning, is it right place to ask whether I had to expect from lein to include all libs into uberjar? The thing is my very simple web app crashs with Base64 class not found on startup whereas I expected it to have all libs inside jar
01:41u35tpusI even included directive :keep-non-project-classes (set to true) inside project.clj
01:41hiredman which Base64?
01:42u35tpusorg.apache.commons.codec.binary.Base64
01:42hiredmanand you have commons codec in your project.clj?
01:42hiredmanand you have it imported in the namespace you are using it?
01:42u35tpusits implicitly called from ring.util.codec$loading__4414__auto__.invoke
01:43u35tpusI use ring and ring implicitly uses Base64
01:43u35tpusit all works from repl
01:43hiredmanare you sure? have you restarted your repl recently?
01:44u35tpusyes, it works from repl, also I tried to update lein to 1.6.0-snapshot
01:44u35tpusit also didin;t help
01:45u35tpusfrom repl it really works - I tried to access web server , it shows hello workd page
01:45u35tpuswhen I look inside uberjar created - should I expect to see Base64.class there?
01:46hiredmanare you sure you are deploying the uberjar?
01:46hiredmanyes
01:47u35tpusI guess so - I use the following command line java -jar feed-1.0.0-SNAPSHOT-standalone.jar
01:47seancorfield__back... hopefully with a more stable network connection :)
01:47u35tpusI presume standalone.jar is that uberjar
01:47u35tpusand it really has a lot of code inside including my sample code and ring libs but no Base64 there...
01:48u35tpusalthough Base64 is present in lib/dev/commons-codec-1.4.jar
01:49u35tpuswhich was resolved by lein successfully from project.clj and is loaded gracefully in "lein repl"
01:49hiredmanare you using all the correct buts of ring?
01:49hiredmanthe latest release?
01:50u35tpusgood tip...
01:50u35tpus[ring/ring-core "0.2.5"]
01:50u35tpus [ring/ring-devel "0.2.5"]
01:50u35tpus [ring/ring-jetty-adapter "0.2.5"]
01:50seancorfield__if you need Base64 in the finished app, shouldn't it be a primary dependency, not a dev-dependency?
01:50hiredmanlib/dev/ is for dev dependencies which don't go in the uberjar, so either ring is not declaring the dependency correctly or …
01:50seancorfield__ring is 0.3.8 now?
01:50u35tpuspotentially I am using old ring (that version was from some old tutorial I was looking into)
01:53u35tpusok, now trying newer ring, thanks...
01:53hiredmanspeaking of ring, I was trying to play around with client side certificates for auth, and the run-jetty from the jetty adapter doesn't let me set the required bits on the jetty connector to do it, so I wrote https://github.com/hiredman/ring-jetty--adapter/blob/master/src/ring/adapter/jetty+.clj which is kind of neat, using reflection to turn the options map into calls to setters, makes it possible to use all the available opt
01:53hiredman(I think it's kind of cool)
01:58u35tpussuper! what really helped is moving from dev-dependencies into dependencies. Many thanks!
01:59seancorfield__yay :)
02:19jonasenFeedback request: https://github.com/jonase/mlx/wiki/A4
02:22hiredmanthe use of floating point is unfortunate, but wow
03:43halfprogrammertechnomancy, Followed instructions in your video and I was able to set up a new emacs/clojure configuration in under 15 mins. Great work!
03:45seancorfield__hmm, i had eclipse/ccw up and running in under five minutes :)
03:47halfprogrammerI still think eclipse or some other IDE is the way to go for someone totally new clojure/emacs
03:47seancorfield__it's really about what you already use
03:47halfprogrammerseancorfield, but I can chat in #clojure from emacs, but u can't. he he
03:47halfprogrammeryup
03:48seancorfield__i've been using eclipse for years... for groovy, scala... cfml... and now clojure
03:48seancorfield__halfprogrammer: emacs is an operating system :)
03:49seancorfield__for irc i use colloquy on mac, and konversation on ubuntu
03:49halfprogrammerThe general complaint is eclipse is memory hungry. Does it really use so much memory?
03:49seancorfield__no, not really
03:50seancorfield__i use it on a tiny netbook quite happily
03:50halfprogrammereclipse on a netbook, that's fantastic
03:51seancorfield__i run eclipse, tomcat, mysql and a bunch of other processes on my little netbook
03:52halfprogrammerIf your netbook had tiny eyes, you could see tears in them
03:53seancorfield__i present from it too, running live demos :) i love my system76 starling!
03:56halfprogrammerI use a E6510, a giant monkey; you could do weight-lifting with it. also spits out very hot air
03:56halfprogrammer:(
03:58seancorfield__ok, bedtime... 'nite
06:06bsod1hi, I just installed counterclockwise for eclipse but having some problems
06:06bsod1when I run my .clj file, it always starts a new repl instead of using the old repl, do you know why?
06:17bsod1can anyone help me?
06:19bsod1how can I disable rainbow parens in counterclockwise?
06:30raekbsod1: vagely recall that you use the right click menu to send stuff for evaluation ("run" seems to be to start an entierly new repl)
06:31bsod1raek: thanks, and do you know how can I disable rainbow parens?
06:31raekI'm not a counterclockwise user, so I don't know much of the workflow...
06:31raekbsod1: sorry, no idea :-)
06:32raekbsod1: you may have better luck asking the same question after some hours when it is day the US
06:33bsod1raek: ok, thanks
06:39clgvbsod1: you can set a shortcut for "Load file in REPL" or maybe it's already set. I have it on CTRL+ALT+S
06:40clgvbsod1: why would you want to disable rainbow parens?
06:40bsod1clgv: yeah I found it, it's already set, thanks
06:40bsod1clgv: they look horrible
06:40clgvbsod1: but they are really usefull when you forgot a paren somewhere
06:41bsod1clgv: eclipse already intents my code according to open parens
06:42clgvbsod1: that doesnt help in all cases. but it's personal taste I guess. if you dont find anything in the options you probably cant turn it off...
06:43bsod1clgv: the problem is, there isn't any options about rainbow parens
06:43clgvthere arent that much accessible options, so you should find it out pretty fast
06:48bsod1so are you all using emacs?
07:08Useful-Hey folks. Under what condition does Clojure's STM retry the transaction? If I have two threads associating a value to a map, does a transaction retry after *any* change to the map, or only if they changed the same key?
07:08Useful-And is there any recommended place to teach me about this stuff? :)
07:11raekUseful-: actually, you can't change maps at all. what you do is to have a map wrapped in a ref: (def r (ref {:a 1, :b 2}))
07:12raekassoc returns a _new_ map and the old one remains as it is
07:12raeka ref just points to the current value
07:12raekand it is the refs that you can change in a transaction
07:12Useful-Ok, so any change is considered a conflict, since it's a whole new map?
07:13raekyes
07:13raekif you need to change different parts independently, you can wrap the changing parts in refs individually
07:13raekyou use reference primitives to model stuff that changes
07:14raek(also, I think there is some kind of mechanism that favors long transaction)
07:14raekUseful-: this article is really good: http://java.ociweb.com/mark/stm/article.html
07:15Useful-Cool, thanks.
07:15raekUseful-: there's also this classic: http://blip.tv/clojure/clojure-concurrency-819147
07:18Useful-Looks good -- I'll devour the two. I assume the basics haven't changed since 2008: Is there anything big I should be aware of that's changed since the talk was filmed?
07:21raekmaybe that rest can return something empty that is not nil
07:21raekUseful-: this article explains how it works now very well: http://kotka.de/blog/2011/06/On_types.html
07:45shtutgartHello! I need to find all identical elements in two arrays, and it takes a lot of time. I've tried to parallelize it in the following way: first vector is splitted in some chunks, and comparison function that searches elements in the second vector is runned for every chunk
07:46bsteubershtutgart: maybe turning one of them into a set makes it faster
07:46shtutgartI've experimented with chunk size, but perfomance remains neraly the same (or even becomes worst)
07:47shtutgartbsteuber: haven't thought about it, thanks! let me test it...
07:47bsteuberor is ordering or how often an element is there important?
07:48bsteuberbut using a set should be O(m+n)
07:48bsteuberat least roughly
07:49shtutgartno, i think i can ignore frequency of occurrences
07:49shtutgartbut how can I make it parallel?
07:51Useful-After creating the set, you can divide the work of the comparisons. Choose the smaller array as the set.
07:54Useful-It depends on the size of the array as to whether it's worth it.
08:03shtutgartUseful-: I've cast both vectors to the sets and it increased perfomance by ~25%. Arrays can be pretty big (up to 500k elements)
08:05bsod1java -cp clojure.har clojure.main --help gives me Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main, can anyone help me?
08:05bsteubershtutgart: the second set makes no sense I think
08:05bsteuberbecause one of it has to be processed in order anyways
08:06bsteuberbsod1: try clojure.jar :)
08:06shtutgartbsteuber: hm, I'm using clojure.set/intersection to find identical elements
08:06bsteuberah
08:07bsod1bsteuber: hehe thanks, I'm trying to install stank-clojure via lein, but when I run lein plugin install swank-clojure 1.3.1 I get same exception Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main
08:07raekbsod1: if you use lein, you shouldn't need to call java directly
08:08raekphooey: posta såsen sen!https://github.com/technomancy/swank-clojure
08:08bsod1raek: I'm not calling anything, I just run a command from swank-clojure's github page, but didn't work for me
08:08raekwhich command?
08:10bsod1raek: lein plugin install swank-clojure 1.3.1
08:10bsteubershtutgart: instead of intersection, (filter (into #{} shorter-array) bigger-array) should also work
08:10bsteuberbut not sure which is faster
08:11raekbsod1: which leiningen version do you have?
08:11bsod1raek: latest
08:12raekweird
08:13the-kennyBtw.: Great work on latest swank-clojure. I *love* M-x clojure-jack-in
08:13the-kennys/swank-clojure/clojure-mode/
08:13sexpbot<the> Btw.: Great work on latest clojure-mode. I *love* M-x clojure-jack-in
08:13raekbsod1: could the clojure.jar file be corrupt or something?
08:13bsod1raek: first time I run this command, it was downloading something but I had to cancel it
08:13bsteuberthe-kenny: I love the cdt support :)
08:14raekbsod1: ok, one way could be to remove your .m2 directory and then run lein self-install
08:14bsod1raek: already tried it
08:14bsod1raek: wait wait, something happened
08:15bsod1raek: great, I installed swank-clojure
08:15bsod1now must figure out how to use SLIME for clojure
08:16raekbsod1: check the docs for github.com/technomancy/clojure-mode or the video at http://technomancy.us/149
08:16the-kennyJust run M-x clojure-jack-in on a leiningen project :)
08:16raekall you need to do from the emacs side is to install clojure-mode.el. the matching version of slime for swank-clojure is bundled with swank-clojure
08:17bsod1raek: I alredy did it, now I'm trying to setup SLIME for clojure
08:18raekbsod1: just use M-x clojure-jack-in
08:18the-kennyraek: I'd recommend not to bother with that. Just start with M-x clojure-jack-in. It'll do everything for you
08:18the-kenny(It will use a bundler version of slime, you don't need to install anything)
08:19the-kennyand it doesn't fight with other slime installations
08:22bsod1raek: I get "repl unexpectedly closed" error(or something like that), is it because of my SLIME version?
08:23bsod1lisp connection closed unexpectedly: connection closed by remote peer
08:24raekbsod1: if you have installed slime with your OS package system (e.g. apt-get), that can cause trobles
08:27the-kennyalso make sure to have *only* swank-clojure 1.3.1 in your CLASSPATH
08:27the-kenny(check lib/ and lib/dev/)
08:27the-kennyThat was a problem in one of my project: Lazytest included swank-clojure 1.2.1 or so. That broke M-x clojure-jack-in
08:31shtutgartbsteuber: yeah, i've tried that too, it's a little faster with one set
08:36raekwhat was the key for displaying the message of a failing test line clojure-test-mode again?
08:54bsod1SLIME and normal buffer indents same code differenet, do you know why=
08:54bsod1?*
09:24bsod1when I try to run code with C-c C-c, I get No such namespace exception, can anyone help me?
09:28halfprogrammerDid you set the correct namespace in the REPL?
09:33bsod1halfprogrammer: I have no idea, how can I do that
09:34raekbsod1: the code and its surrounding would help...
09:35raek,(foo/bar 1 2 3)
09:35clojurebotjava.lang.Exception: No such namespace: foo
09:35halfprogrammerbsod1: as raek suggested could you please paste your snippet somewhere?
09:35raekso the question is what is your "foo"
09:36raekand what do you have in your ns form?
09:36bsod1halfprogrammer: it's just hello word program
09:36the-kennyIs there a way to add custom jars to lein deps *without* having them in my local repository? I want to have everything which isn't available with lein deps etc. bundled in my git project
09:36bsod1halfprogrammer: there's no source code, just (str "hello world")
09:37halfprogrammer,(println "hello world")
09:37clojurebothello world
09:37halfprogrammerbsod1: You would have declared a namespace for the file right
09:38raekbsod1: so the file only contains that line? that's really odd...
09:38halfprogrammerbsod1: in emacs, copy paste that namespace declaration in the slime-repl buffer
09:38halfprogrammerbsod1: I hope you have declared a namespace
09:41shtutgartbsod1: also, you can hit C-x C-e if if you just wnat to execute current line
09:41bsod1I get up 5 hours ago, starting learning clojure, but I couldn't setup emacs + slime + whatever yet... goddammit
09:41bsod1whatever...
09:43halfprogrammerbsod1: that's okay. It's a one time thing for anybody.
09:45halfprogrammerbsod1: http://halfprogrammer.wordpress.com/2011/06/19/setting-up-emacs-clojure-and-swank-in-15-minutes/
09:45halfprogrammerbsod1: Wrote a reminder to myself reg. how to setup clojure dev environment in ubuntu.
09:46halfprogrammersee if it ^ is of use to you.
09:46raekhalfprogrammer: no need to copy and paste. just eval the ns form (with C-c C-c or C-M-x) and then emacs knows the namespace of that file (and subsequent evals in that file will happen in the right namespace)
09:47raekbsod1: the problems you have sound very strange. first, what happens if you enter (str "hello world") in the repl?
09:47bsod1raek: it prints the string
09:47raekhalfprogrammer: and then C-c M-p can be used to do the equivalent to (in-ns 'the-ns)
09:48raekbsod1: and when you have the same line in a file (where clojure-mode is active) and press C-c C-c it throws an exception?
09:48halfprogrammerraek: that is strange, if i do it in my setup i get "no such namespace" exception :(
09:48bsod1raek: yes
09:49raekhalfprogrammer: the C-c M-p? it requires the namespace to exist first. I usually start with evaluating the whole file with C-c C-k and the do the C-c M-p
09:49halfprogrammerraek: no. I am talking abt doing a C-c C-c on namespace declaration.
09:50raekhalfprogrammer: hrm. it doesn't do that for me
09:51halfprogrammerraek: interesting
09:51mrBlisshalfprogrammer: try C-x C-e after the last paren of the ns declaration
09:51halfprogrammerraek: I dint know abt C-c M-p. thx for the tip
09:52raekC-c C-c and C-M-x are both equivalent to doing C-x C-e after the last paren of the top level paren pair surrounding the point
09:52halfprogrammermrBliss: raek, If i do a C-c C-k on the file and at some point after that if i do C-c C-c things are working okay
09:53raekhalfprogrammer: ah, I get the same behaviour...
09:53raekhalfprogrammer: but C-M-x does not have the problem
09:53raekeven for a previosly non-loaded file
09:54halfprogrammeroh. That would be useful. I am having to copy paste the namespace name every single time. Thx again :)
09:56the-kennyWhoa, C-x M-p was the combination. Thank you!
09:56the-kennyI forgot the key combination some days ago :)
09:59raekit has a good list for these commands
11:45gfrlogdo pre/post constraints still exist?
11:45gfrlogah yes, nevermind
11:45gfrlogwrong syntax
11:49gfrlogAre constraints not well-regarded? Somehow I've hardly heard anything about them at all.
11:50pdkthey're covered in tjoc
11:50pdkif anything it's probably since they could use a bit more flexibility
11:51gfrlogpdk: what sort of flexibility?
11:51pdkit logical and's all of the pre/postconditions so you don't get very fine grained control if you want only some of them to be true
11:51pdkor to change the behavior depending on other factors
11:51gfrlogI would figure that being able to use arbitrary functions would give you all the flexibility you need
11:53pdkthere's that much
11:54gfrlogWell. I think I will start using them.
12:41duck1123in 1.3, what do I need to do if I need to convert my literal to an int? (class (int 5)) says it's still a long
12:41duck1123,(class (int 5))
12:41clojurebotjava.lang.Integer
12:42bsteuber,(Integer. 5)
12:42clojurebot5
12:43bsteuber,(class (Integer. 5))
12:43clojurebotjava.lang.Integer
12:43bsteuberthat sucks
12:43bsteuberbut I think there's no better way
12:43bsteuberif you really need ints for java-interop
12:43duck1123ok. (class (Integer/parseInt "5")) is also long
12:43raekduck1123: if you need to convert it to an int for java interop (i.e. a method accepts a primitive int) just use 'int'
12:44duck1123yeah, this is for java interop, otherwise I wouldn't care
12:44bsteuberI think boxing is the only way
12:44raekwhen you call class on the result, it is boxed into a Long again, since all boxed integers are boxed the same
12:44duck1123raek: int wasn't working for me in 1.3, that's why I asked
12:45raekduck1123: well, it works if the receiver accepts primitives
12:45bsteuberraek: I think you're wrong
12:46lucianjava does auto-unboxing since 1.5
12:46duck1123There may be something up with the java method I'm trying to call
12:46raekthis is unrelated auto-boxing
12:46bsteuberexactly, that's why using (Integer. 5) will do the job
12:47bsteuberit will get passed to java boxed and unboxed on the java side
12:47bsteuberwithout clojure's evil to-long-conversion kicking in
12:48raekmy point is that (.method-that-accepts-primitive-int obj (int some-number)) should not box the number
12:48bsteuberit shouldn't but it does
12:48bsteuberso maybe worth a ticket
12:49duck1123bah, the method I'm trying to call isn't public. That explains a lot of things. I was going down the wrong path
12:49bsteuberI'm afraid the same will happen with a public one
12:52duck1123are there any good libraries for cryptography in clojure?
12:52duck1123something that'll make the java libraries a little easier
12:59pdkdoesn't contrib have a crypt library
13:01raekhrm, these primitive things are a bit weird
13:01raekmade a method with overloaded int and long args
13:02raekclojure calls the int version both when calling (.foo f (int 1)) and (.foo f (long 1))
13:02bsteuber1.3?
13:02raekyup
13:02raekalpha8
13:03bsteubermy last test was with 6 or so, so maybe it changed
13:03bsteuberbut there I couldn't call the int methods without boxing
13:04raek(.foo f 1) also calles the (primitive) int version
13:05bsteuberso maybe they did a fix and now it's the other way :)
13:06bsteuberI'll try this, too...
13:16bsteuberraek: you're right, something must have changed
13:16bsteuberand I guess the two-overload-version is just too much
13:17bsteubermaybe that's worth a ticket
13:19bsteuberduck1123: so which alpha did you use for your int/long tests?
13:40duck1123alpha7
13:41duck1123we're up to 8 now, right?
14:59jhicknerwill java's file locks work correctly from clojure?
15:06void_hi there
15:06void_in compojure ...
15:06void_(GET "/foo" [] (println request))
15:06void_how do I get the request
15:06void_this doesn't work
15:10void_ok so adding {request :request} helps
15:10void_but request is nil
15:12void_ohhh I recall now
15:12void_it's (GET "/foo" [] request ...)
15:39raekvoid_: https://github.com/weavejester/compojure/wiki/Destructuring-Syntax
16:37gfrlogI think the pre-post-constraint syntax is unfortunate
17:53Useful-Anyone know where the slides are for Rich's concurrency talk? Blip doesn't have them anymore: http://blip.tv/file/812787
17:54Useful-Unless I've overlooked them on that page
18:14void_hey guys
18:15void_so I installed emacs on mac (from http://emacsformacosx.com/) ... I installed starter kit, then installe clojure-mode package. Now when I restart, clojure-mode is not there, and I can't install it, because it's not in package list anymore
18:23sritchievoid_: is it at the bottom, now, listed in red?
18:23void_sritchie: oh, yeah
18:23sritchievoid_: success!
18:23void_it worked at first
18:23void_not after restart though
18:23void_so I saw syntax hilighting if I opened clj file before restarting, but not after
18:23sritchieyou mean it's not showing up in red, or it's not loading for clojure files?
18:24void_it's showing up in red, but it's like it's not there
18:24void_when I do M-x, type cloj and press tab, nothing autocompletes for example
18:24sritchieI wonder if you have a .emacs file that's in the way of your .emacs.d directory
18:24sritchie~/.emacs
18:24clojurebotExcuse me?
18:25void_this is in emacs
18:25void_(add-to-list 'load-path "~/.emacs.d/")
18:25void_(require 'package)
18:25void_(add-to-list 'package-archives
18:25void_ '("marmalade" . "http://marmalade-repo.org/packages/&quot;))
18:25void_and yay, moving that file works!
18:26sritchie(package-initialize)
18:26sritchie(require 'starter-kit-elpa)
18:26sritchiedo you have those two?
18:26void_no
18:26sritchiehttps://gist.github.com/1034850
18:26sritchietry lines 5 through 10, and see if the problem's solved
18:27void_ohhh it works now :)
18:27void_thanks for the link
18:27sritchieno problem
18:27sritchieemacs and paredit mode are great, you'll have fun
18:29tomoj+1
18:32devnhello all
18:33devnparedit and swank are really the big selling points for me with emacs, but the more I see other people's setups the more I begin to think I spend too much of my time fiddling with BS in emacs
18:36justinkodevn: "other people's setups" < - please elaborate
18:42devnjustinko: I see people who are incredibly productive who have setups that are not emacs, not configured to within an inch of their life, without a color theme, without pretty much everything ive grown accustomed to
18:43devnand they trounce me in terms of productivity, so I wonder if most of the time I've spent has been for naught
18:43justinkowhat do they use if not emacs?
18:44devnthey could write in notepad. the editor is just something that generally gets in their way.
18:44devnterminal + any editor seems to work for them.
18:45justinkoalso, yes, the editor is very rarely the bottle-neck for productive output
18:45devn*nod*
18:46devnI mean, I value the stuff Emacs can do, but I think we spend too much time as programmers tinkering with our editor instead of writing code
18:46devnI didn't used to think that, but lately it seems obvious
18:46justinkoI used Vim for 2 weeks, then switched back to Textmate. The level of "text surgery" that you can perform is just ridiculous IMO
18:47justinko"5j" <- to move down 5 lines, wtf
18:47justinkowhy do you need that level of precision?
18:48devnI understand why people like it. You can do small miracles, but I also watch people who haven't spent 10 years with an editor accidentally hit a key in command mode and delete half of their file.
18:48devnand I understand the precision -- it's nice to be able to make a quick macro, for instance.
18:48devnSometimes it's almost a requirement.
18:49devnbut you can do that with some fancy command line magic, too
18:49devnsed, awk, etc.
18:54justinkodevn: we'll see how long clojure with textmate will take me, if I start getting frustrated, I'll give emacs a try
18:54justinkodevn: emacs doesn't have modal/multi-window editing, right?
18:58devnclojure with textmate isnt bad IIRC -- I think someone rolled out some decent support for it
18:58devnI mean, it has syntax hilighting and I think it lets you send stuff to the REPL, what more do you need?
18:59devnjustinko: you can have modal editing in emacs if you want, but it's not a defautl
18:59devndefault*
19:00justinkodevn: exactly, currently I don't need any more than that.
19:34LajlaChousuke, I think than and and or can be usde as control structures
20:54gtrak`you guys ever consider using clojure for the view layer in a web app?
20:57Useful-Yep. There's a few libraries out there for producing markup / css
20:58gtrak`also, does it know how to cache results of pure functions? it seems this would be a great fit
20:59Useful-Enlive or Hiccup are probably the two most popular HTML/Templating libraries
20:59Useful-This is an overview of the most common clojure web stack components: http://brehaut.net/blog/2011/ring_introduction
21:04gtrak`neato
23:33fbru02hi all, stupid question, most of the stuff i use is either on clojars or in source code inside a given project, if i want to include a own jar inside a project i just do uberjar with the dependencies of that separate project and add it to my current project, any drawbacks on this aproach?
23:34sritchiefbru02: one other way would be to run "lein install" in the directory of the project you want to include, and the just add a line to project.clj like usual
23:35scottjis uberjar necessary?
23:37tomojjars uberjars on classpath aren't on the classpath, are they?
23:37tomojs/^jars/jars in/