#clojure logs

2010-04-24

00:00_rata_finally!! I got slime working with clojure!! ehhh!! :)
00:12_rata_thank you all :)
00:12_rata_I gotta go
00:12_rata_good bye
00:13mmarczykhm, I thought I could test update-bean with BigDecimal / .setScale
00:13mmarczykbut apparently .setScale returns a new BD
00:13mmarczyk:-)
00:13hiredmanexcellent
00:13hiredmannumbers should be immutable
00:14slyphonmmarczyk: what do you use to interact w/ scheme?
00:14mmarczykin fact, everything else should be immutable too ;-)
00:14hiredmanclojurebot: mk-bean?
00:14clojurebotmk-bean is http://gist.github.com/34229
00:14mmarczykslyphon: I used DrScheme for the largest projects
00:14slyphonyeah?
00:14slyphonhrm
00:15mmarczykoh, and I actually used Edwin for SICP
00:15mmarczykfor the repl, that is, I wrote the code in Vim
00:15slyphonheh :)
00:15slyphonhah!
00:15slyphonnice
00:15mmarczykhiredman: cool! thanks
00:15hiredmanthat code is rather old, so I dunno if it works
00:16mmarczykwe'll soon find out :-)
00:17hiredmanI suppose these days you'd be better off generating a deftype or some such
00:17mmarczykslyphon: about half of the stuff I was running in DrScheme I actually coded in Vim
00:17slyphonahh
00:18mmarczykhiredman: then I'd have to put setFoo getFoo into an interface
00:18mmarczykor protocol :-)
00:18hiredmanah
00:18hiredmanhmm
00:18slyphonmmarczyk: i've found vim-mode in emacs to be quite nice
00:18slyphonyou hardly feel the emacs
00:18mmarczyk:-)
00:19mmarczykI used viper + vimpulse for a while
00:19slyphonyeah, vim-mode > viper
00:19mmarczykI keep promising myself to configure a viper / vimpulse / paredit / clojure-mode package for use with Clojure code
00:20slyphonyou should check it out, it really makes emacs much more tolerable to get-around it
00:20slyphonin*
00:20slyphonand :w DTRT
00:20slyphon:D
00:20mmarczyk:-)
00:20mmarczykyeah, I have checked it out
00:20mmarczykI've made some customisations
00:21mmarczykit's very good overall I find, but still, some bindings need to be reconciled with those of other modes
00:21slyphonyeah
00:21mmarczykpresumably () should use paredit functions rather than viper's, for example
00:21woobya viper+paredit+clojure package would be awesome
00:21slyphonhm
00:21slyphonvim-mode doesn't conflict with ()
00:21mmarczykit definitely would :-)
00:21slyphonin insert mode, at least
00:22mmarczykoh? well, I should investigate it then
00:22mmarczykthen we'd need Lisp-aware text objects
00:22mmarczykVim has some, but we could use more
00:23mmarczykda[ to delete the enclosing Clojure vector :-)
00:23slyphon:D
00:23Raynesdeftype doesn't automagically define "setters" of sorts, does it?
00:24mmarczykRaynes: presumably not, given that fields are immutable by default
00:24Raynesmmarczyk: Well, they could return new Foos.
00:25mmarczykwould calling a "modified copy" constructor "setBar" not conflict with the good aesthetic sense one finds in Clojure? :-)
00:26mmarczykat any rate, just checked, no setters
00:27RaynesDon't know. Just sayin'.
00:31mmarczykwow, apparently a field which is declared unsynchronized-mutable is not visible from outside the object
00:32mmarczykno way to set it too -- and the docs say that set! should be possible from inside method bodies (which it is), but nothing about it being possible from outside
00:43reburgany suggested reading on using existing mutable java libraries in clojure such that they play nice with concurrency?
00:45Raynesmmarczyk: defrecord doesn't have accessors of that sort either, right? Just the normal keyword getters. I assume assoc is the best way to do that.
00:52mmarczykRaynes: actually deftype / defrecord create public fields
00:52mmarczykso if you want to access them, you can use something like (.foo obj)
00:53mmarczykexcept as mentioned above :unsynchronized-mutable and :volatile-mutable fields seem not to be public
00:53mmarczykbut they're meant to be special-purpose stuff anyway
00:55vu3rddderefs (@) do not seem to autocomplete for me in slime repl.
00:55mmarczykreburg: isolate & use sparingly
00:55vu3rddbut if I say (deref blah) it does
00:55mmarczyk(but no actual reading materials beyond that)
00:57reburgmmarczyk: i wonder if you could expound on what "isolate" means to you in that case
01:08mmarczykuse within a well-defined part of the project which really depends on such a lib
01:09mmarczykerect an api wall in clojure around it
01:10mmarczykif a lib depends mutable state, the mere fact that it is Clojure code calling into it as opposed to Java code doesn't do any good
01:12reburgmmarczyk: that last bit i'm definitely clear on, which is why i asked the question to begin with.
01:12reburgmmarczyk: thanks, you've reminded me that i haven't wrapped things up nearly as well as i could have
01:13hiredmanyou can use agents to serialize manipulation
01:15hiredmanalternatively you can just use a lock
01:19reburghiredman: is there are particular reason you say agents rather than refs?
01:19mmarczykI think agents are meant to be free to reorder their task queues
01:19hiredmanrefs don't serialize access
01:19mmarczyknot entirely sure though
01:19reburgmmarczyk: i just looked, cause i was curious myself
01:19hiredmanmmarczyk: I doubt it
01:20reburgmmarczyk: apparently they are guaranteed in-order on each thread
01:20mmarczykoh, ok
01:20carkhmmarczyk: agents process in the order they receive
01:20hiredmanit has been some months since the last time I looked at Agent.java
01:20mmarczykthanks for correcting me then :-)
01:21hiredmanreally you want cells, I think, dunno if those ever made it out of the lab
01:21reburghiredman: i guess i was basically thinking about using dosync as a half-assed lock
01:21mmarczykone more question to ask in this kind of scenario would be whether the Java lib needs to operate concurrently, or could it perform its tasks on a single thread (in total or per task) while Clojure code runs around doing lots of stuff on multiple threads
01:21mmarczykthat might not be too bad
01:22hiredmanreburg: dosync is way more than halfassed, but it is not a lock
01:22hiredmanclojurebot: cells?
01:22clojurebotI don't understand.
01:22reburgactually, i wasn't even aware you /could/ do simple locking in clojure
01:23hiredman(doc locking)
01:23clojurebot"([x & body]); Executes exprs in an implicit do, while holding the monitor of x. Will release the monitor of x in all circumstances."
01:23reburggood(?) to know
01:24hiredmanhttp://gist.github.com/306174
01:25hiredmanyou would want to stick your java object in a cell
01:26hiredmanclojurebot: cells is http://gist.github.com/306174
01:26clojurebotIk begrijp
01:28reburgi think i'll try the agent route, thanks all
01:29hiredmanyou might look at how transients are handled
01:30reburghiredman: my mutable object is long-lived; would that really be relevant? or do you mean how the transient code itself works?
01:31hiredmanhow they throw an exception if handled from the wrong thread
01:31hiredmanI mean the model of confining mutable state
01:59rdsr\
04:19cYmenHas anybody installed clojuresque for gradle and can give me some pointers? I'm new to gradle so I really have no clue where (or how) to start...
05:13borkdudeNormally, how do I start up a new project in emacs with swank-clojure-project> do I first start slime manually or not?
05:20bsteuberBorkdude: not - just M-x swank-clojure-project should be sufficient if your project contains a lib folder with clojure, contrib and swank
05:21Borkdudehmm yes
05:21Borkdudeand if I already started slime, should I kill the running process if it asks for it?
05:22bsteuberdepends on whether you want one or two slimes in parallel :) but probably yes
05:25_rata_hi
05:25Borkdudeah I think I hadn't downloaded the dependencies, I was assuming it had already done it but probably not
05:25Borkdudenow it downloads half off clojars ;-)
05:27Borkdudeah it works now, tnx
05:29BorkdudeHmm, I am using 1.2.0-master-SNAPSHOT. It should have the clojure.contrib.io namespace right?
05:34BorkdudeI have this in my project.clj:
05:35Borkdude [org.clojure/clojure
05:35Borkdude "1.2.0-master-SNAPSHOT"]
05:35Borkdude [org.clojure/clojure-contrib
05:35Borkdude "1.2.0-master-SNAPSHOT"]
05:35BorkdudeShould it have the clojure.contrib.io namespace or not?
05:36ChousukeBorkdude: yes
05:40_atoBorkdude: try "1.2.0-SNAPSHOT" for contrib
05:41_atolooking here, the master one seems out of date for some reason: http://build.clojure.org/snapshots/org/clojure/clojure-contrib/
05:41sexpbot"Index of /snapshots/org/clojure/clojure-contrib/"
05:42Borkdudeah that might explain it then
05:43Borkdude1.2.0-SNAPSNOT hasn't clojure.contrib.io either
05:48bsteuberBorkdude: does (use 'clojure.contrib.io) give an error?
05:49bsteuberI mean, don't rely on autocompletion for finding out what's there and what's not
05:50Borkdudeah it works, I was relying on autocompletion
05:50Borkdudebut it surely didn't with the master jar
05:52bsteuberyeah, the master one is outdated
05:53bsteuberthe current naming situation is a bit confusing, but it will be better with the next release :)
05:53bsteuberat least I hope so ;)
05:53BorkdudeHaving a #clojure window next to *slime-repl clojure* is a must have
05:54Borkdude;-)
05:54bsteubertrue
05:54BorkdudeMaybe it can be built in swank-clojure? ;-)
05:55bsteuberlol
05:56BorkdudeDoes it update the autocompletions after I 'use' something?
05:56BorkdudeNo idea how this works
05:56nurvHi.
06:00bsteuberBorkdude: yes, it should - same with require
06:00bsteuberof course, with require you still need namespace qualifiers
06:01BorkdudeIn this example, does it close the reader, initiated by read-lines? (take 1 (read-lines "/home/borkdude/.emacs"))
06:01BorkdudeI think yes, because the thing gets out of scope
06:03Borkdudeand probably there will be something like a destructor on it?
06:03bsteubertry (doc read-lines)
06:03bsteuberclojurebot's contrib is too old to do here :)
06:03Borkdudeyes, it closes when the stream has been entirely consumed. but what if not? you can never read from the same buffer again in this example
06:05bsteuberhm, guess you just want to use this if you want to consume it all
06:05BorkdudeThen what is the point of the -lazy- seq here?
06:06ChousukeBorkdude: memory conservation
06:06ChousukeBorkdude: with a lazy seq, you only need to keep one line in memory at a time
06:09BorkdudeChousuke, if I realize an entire lazy seq, all lines will be in memory?
06:10ChousukeBorkdude: yes, but only if you hold onto the head
06:10Borkdudeah right
06:11Borkdudethese lazy seqs keep tricking me
06:18BorkdudeSo for example: (doseq [n (read-lines "/home/borkdude/.emacs")] (print n))
06:18Chousukeyeah. that works.
06:18Borkdudeif my .emacs would be a terabyte (hypothetically... ;-), still only one line would be in memory at a time
06:19Chousukeyeah. in principle anyway
06:19Borkduderight
06:20Borkdudebut still I wonder what happends if I decide only to read the first three lines and then discard the reader
06:20Chousukethen the file remains open
06:21Borkdudeso I better not use read-lines then
06:21ChousukeIO and lazy seqs are still an unsolved problem, but apparently rhickey intends to work on it at some point
06:21Borkdudein that case I mean
06:22Chousukeyou can use with-open if read-lines supports taking a stream instead of a filename
06:22Borkdudethen there's probably something else I can use
06:22Borkdudeline-seq
06:23Chousukeline-seq has the same problem
06:24BorkdudeIf I try this: (with-open [n (reader "/home/borkdude/.emacs")]
06:24Borkdude (line-seq n))
06:24Borkdudeit says n is already closed
06:24Chousukeyou need to use the line-seq withing the with-open form
06:24Chousuke-g
06:26Borkdudehow does that change my example?
06:27Chousukejust put all the code using the line-seq within the with-open form
06:28Chousuke(with-open [n ...] (let [s (line-seq n)] (use s)))
06:28Borkdudedidn't I do that? (with-open [n ...] (line-seq n))
06:29Chousukeyou can't return the line-seq from the with-open form
06:29Chousukebecause the stream gets closed and the line-seq becomes unusable
06:29Borkdudeah sorry, I had misunderstood how line-seq works
07:17etatehas anyone managed to get lein and swank-clojure working on windows yet?
07:20Borkdudeetate, I haven't tried it, switched to ubuntu for that ;-)
07:21etateBorkdude: yeah I have ubuntu, but it would be nice if it would work on Windows too
07:21Borkdudebut yesterday it told me that I could download some jars manually
07:21Borkdudestill have to try that though
07:21etatehmm
07:21etatewell lein seems to work okay, its just swank-clojure and lein-swank that basically don't work
07:22Borkdudeaha
07:23etatei've given up on trying to do .\lein swank from the cmd line, now i'm just trying to get lein to recognize some working version of swank-clojure, so that i can start it manually from the repl
07:25BorkdudeThere's a thread on ggroups on this, I suppose you already read that?
07:25Licensermorgen
07:26BorkdudeGutenmorgen Licenser
07:26etateBorkdude: yeah, it doesn't work for me
07:27Borkdudeetate, it would be great if lein would work in windows, to be combined with ClojureBox, it would take away some pain for newcomers like me
07:28etateBorkdude: yeah, maven is an option if you're not concerned with native deps
07:29etatetbh I think this is the one thing that really sucks with Clojure
07:30Borkdudeetate: as a newcomer learning maven would also be a curve that would turn me off maybe
07:30etatethe language is great but the environment is almost unusable for windows people
07:30Borkdudeetate: I agree. I started using Eclipse + CC in Windows, but then I didn't know how to use leiningen with that
07:31etateBorkdude: yeah, leiningen is great in concept but it just doesn't work most of the time.
07:31Borkdudeso the learning curve for newcomers to have fully working environments from Windows would be: clojure + linux + emacs
07:31_atoetate, Borkdude: I don't use windows but can't you just use java -jar leiningen-standalone.jar ?
07:32etateBorkdude: there's so many issues with e.g which versions go with which other versions that its just a big mess
07:32etate_ato: the leiningen jar gets found appropriately when running the lein.bat script
07:33_atoah.. lein-swank
07:34Borkdudewhy would I use lein-swank instead of swank-clojure-project again?
07:35etate_ato: right. lein-swank is the problem, but actually the documentation on technomancy github page is also misleading for windows users.
07:35_atolooks like the bat doesn't add lib/* to the classpath
07:35LicenserBorkdude: there is also #clojure.de for the german community if you'd want to come over there as well - we're not as fit as the guys here but it's a nice group :) and we grow
07:35_atolike the shell script does
07:36BorkdudeLicenser: I'm not German, although I visit Berlin sometimes
07:36Licenser:D Woooh go berlin go!
07:36_atohmm, nope it does
07:36_atoI just fail at reading bats :p
07:36etate_ato: yeah it does add the lib dir
07:37BorkdudeLicenser: just type /whois Borkdude to find out I'm Dutch, that's how I found out you are from Germany ;-)
07:37etate_ato: e.g at the moment i have swank-clojure-1.2.0-snapshot.jar in the lib dir, but doing (use 'swank.swank) doesn't work
07:37Licenser*g*
07:37LicenserI thought the 'morgen' gave me away :P
07:37_atohmm
07:37BorkdudeLicenser: no, morgen is also Dutch, so that's why I checked
07:37Licenserah sneaky
07:38etate_ato: the weird thing is the other deps in that dir _do_ get found
07:38Licenser_ato: wow that is support!
07:40_atoah... I see what you mean about the install process being less than obvious
07:40_atohave to edit the script and set jar path and such
07:40_atohmm..
07:41_atothere's no wget equivalent on windows is there?
07:41etate_ato: well actually now the issue is this, i removed the dependency for swank-clojure-1.2.0 (which doesn't get found). I replaced it with swank-clojure-1.1.0 - however this version doesn't work in windows due to a bug which was apparently fixed in version 1.2.0 :)
07:42etate_ato: no but cygwin has wget
07:43Borkdudethere's also a gnu wget you can download without cygwin
07:43Borkdudebut you might want to install cygwin however, for git support etc anyway
07:44etate_ato: so I think the issue is that swank-clojure-1.2.0-SNAPSHOT doesn't load under windows, however I don't even get an error about this. Doing (use 'swank.swank) just says no class found exception.
07:46etateactually i mean FileNotFound rather than class not found
07:47_atoweird
07:49_atois there some special version of emacs that's best to use on windows (a la aquamacs on OS X), or will the binaries from ftp.gnu.org do?
07:50etatei use EmacsW32
07:50zakwilsonI found normal Emacs to be quite workable on Windows last time I checked. I'm not aware of a version with special Windows-native features.
07:51etatezakwilson: EmacsW32 has windows-native features
07:51zakwilsonListen to etate then. I rarely use editors on Windows.
07:53_atook I'll test with emacsw32
07:57Borkdudebtw why what are good reasons to use lein swank instead of swank-clojure-project?
08:01_atothe main reason is using it on a remote PC
08:01_atoso emacs on machine A, swank on machine B
08:07BorkdudeSuppose I want to use doseq and count the how manieth element I am using
08:08BorkdudeI tried smth like (doseq [elt some-seq n (iterate inc 0)] ...)
08:08Borkdudebut that keeps on going forever
08:09etateBorkdude: evaluating stuff at the REPL forces it maybe?
08:10Borkdudeonly if I print it right?
08:10_ato,(doseq [[i x] (indexed [:a :b :c])] (println i x ",")))
08:10clojurebot0 :a , 1 :b , 2 :c ,
08:11_atodoseq is like for, not like map
08:11_atoit does a cartesian product if you give it two seqs
08:11_atoinstead of taking them pairwise
08:11Borkdudeoh, that's good to know ;-)
08:11MrHusCan you call a macro from within a proxy?
08:13_ato,(map vector [:a :b :c] [1 2 3])
08:13clojurebot([:a 1] [:b 2] [:c 3])
08:13_ato,(for [x [:a :b :c], i [1 2 3]] [x i])
08:13clojurebot([:a 1] [:a 2] [:a 3] [:b 1] [:b 2] [:b 3] [:c 1] [:c 2] [:c 3])
08:15_atoright, I've got emacs, slime and lein running on windows xp... now to try lein swank
08:16_atohmm
08:16_ato"lein swank" just worked :/
08:17_atoand I can connect to it okay from emacs with M-x slime-connect
08:17etate_ato: how did you install lein?
08:17Borkdude,(doc indexed)
08:17clojurebot"([s]); Returns a lazy sequence of [index, item] pairs, where items come from 's' and indexes count up from zero. (indexed '(a b c d)) => ([0 a] [1 b] [2 c] [3 d])"
08:19etate_ato: are you using the leiningen-1.1.0-standalone.jar and the .bat script on the technomancy website?
08:19_atoah
08:19_atowhoops
08:19_atoI accidentally grabbed lein 1.0.1
08:19_atowill try with lein 1.1.0
08:19_atobut yes to the bat scripts, unmodified except for setting the jar paths
08:20Borkdudein which namespace does indexed live?
08:20_atoBorkdude: clojure.contrib.seq-utils
08:20Borkdudetnx
08:21BorkdudeCan I find out here by doing (some-func indexed)?
08:22_ato,indexed
08:22clojurebot#<seq_utils$indexed__697 clojure.contrib.seq_utils$indexed__697@1365e86>
08:22_ato,(:ns (meta #'indexed))
08:22clojurebot#<Namespace clojure.contrib.seq-utils>
08:23_atoetate: hmm works okay with 1.1.0 as well. All I did was take lein.bat leiningen-1.1.0-standalone.jar clojure-1.1.0.jar and chuck 'em in c:\temp\lein
08:24_atoedited lein.bat to set LEIN_JAR and CLOJURE_JAR
08:24_atoran: c:\temp\lein\lein new myproj
08:24etate_ato: hmm maybe my lein.bat is using the wrong clojure_jar, i'll try that. you're using lein-swank 1.2.0-snapshot?
08:24_atoyep
08:25_atoetate: here's my project.clj http://gist.github.com/377613
08:26kzarSo I'm writing a little program that's going to save a bunch of stuff to a MySQL database. Should I create one database connection and then share that between all my queries or should I create a new db connection each time I access the database? I'm curious because it's going to be running with multiple threads
08:26_ato"lein deps" to pull everything down and then "lein swank" and it said it was listening on port 4005 and emacs connected to it ok
08:26carkhkzar : one connection per action triggered by the user
08:27carkhthe rule is: close your connections as soon as possible
08:27carkhand a single connection per thread yes
08:27etate_ato: just trying it now
08:27kzarcarkh: OK thanks
08:28krumholt,(doc filter)
08:28clojurebot"([pred coll]); Returns a lazy sequence of the items in coll for which (pred item) returns true. pred must be free of side-effects."
08:32etate_ato: hmm still getting "swank" is not a task when running ..\lein.bat swank
08:33_atoetate: hmm and "lein deps" downloaded the swank-clojure.jar to your project's lib directory?
08:34etateswank-clojure-1.2.0-SNAPSHOT yep
08:35_atohmm, you're not trying this from a path that contains spaces right?
08:35_atojust trying to think of other things that could go wrong
08:36etate_ato: nope, c:\Users\xyz\lein
08:36etate_ato: the weird thing is that swank-clojure 1.1.0 can get loaded but doesn't work
08:37etate_ato: I should mention i'm on Windows 7 not XP
08:39etate_ato: just tried running it as admin, no difference, when using lein-swank 1.2.0-snapshot, lein swank doesn't recognize swank as a task. I can get a repl no problems, but it only loads swank-clojure 1.1.0 in that repl.
08:40etate_ato: where did you get your standalone-leiningen jar from?
08:41_atowhat if you edit the bat and put an echo in front of java (the one after :RUN) you can then see what it's setting the classpath to and make sure its putting swank-clojure jar on there correctly
08:41_atohttp://github.com/downloads/technomancy/leiningen/leiningen-1.1.0-standalone.jar
08:44etate_ato: it looks correct to me
08:48_atowell I'm stumped :(
08:48_atohere's my setup if you want to take a look: http://clojars.org/~ato/tmp/lein-1.1.0-win32.zip
08:49etate_ato: page not found :D
08:49_atoah
08:49_atohttp://meshy.org/~ato/tmp/lein-1.1.0-win32.zip
08:49_atowrong domain :p
08:49etate_ato: the only difference I can see is that the swank-clojure pathnames end in -SNAPSHOT.jar
08:50_atothat's weird
08:51_atomine has this: http://gist.github.com/377627
08:52_atoswank-clojure-1.2.0-20100308.145053-6.jar
08:53etate_ato: wt..? are you using a different lein.bat script
08:55_atothis is my lein.bat (it's in that lein-1.1.0-win32.zip as well): http://gist.github.com/377629
08:55etate_ato: http://gist.github.com/377630
08:55etatethats my lib dir after lein.bat deps
08:57etatehey your .bat script looks different
08:57_atoI think there's a maven option which changes whether it calls snapshots -SNAPSHOT or the actual number
08:57etate_ato: oh, do you think this would make a difference
08:58_atoit shouldn't matter
08:58_atoshouldn't matter at all what they're called
08:58_atoI just got lein.bat from here and modified the set LEIN_JAR bit: http://github.com/technomancy/leiningen/raw/stable/bin/lein.bat
08:58etate_ato: in your .bat file you jave %~dp0\ at the front of your LEIN_JAR, what does that mean?
08:59_ato%~dp0 means the directory the .bat file is in
09:00_atodidn't want to hard code it
09:00_atoso I googled and found that way ;-)
09:00etate_ato: :D
09:01etate_ato: apart from that I set the wrong variables it looks like
09:01etate_ato: I changed the ones under :SET_LEIN etc instead of the remmed ones
09:03etate_ato: no difference
09:04etate_ato: I'm pretty sure its a problem in swank-clojure
09:04etate_ato: since the version 1.1.0 loads correctly :/
09:05_ato:/
09:07Blktcould anyone help me with a "programming style" question?
09:13etate_ato: I used your zip and I get the same problem "swank" is not a taks
09:13etate"task
09:13BorkdudeBlkt: I'm not sure if I'm able to help, but you can just try and ask your question and see who will answer
09:14BlktBorkdude: first of all, do u know a good paste site with Clojure syntax highlight?
09:15etate_ato: when you do java -version what comes out? mine is Java Client VM 16.0-b13, mixed mode
09:16kzarSupposing I need to do a query to check if a row exists in my database before I insert a new one. I could use with-connection at the start of the checking function and use it again at the start of the insert function but it seems wasteful to connect twice like that. Is there a way to do it but only connect once? I guess I would like to write the check function in a way that can either re-use the connection that's the
09:16kzarre or if there isn't one create one
09:17BorkdudeBlkt, I don't know, but there are sites like pastebin that support a lot of programming languages, not Clojure though
09:18BlktBorkdude: I wrote it here http://clojure.pastebin.com/d2x5f85A
09:18etate_ato: Problems might also be because you have a different shell in XP than in Windows 7
09:18BlktBorkdude: that code should initialize an 8x8 board with 20 tiles, 16 representing hares and 4 representing foxes
09:19BlktBorkdude: since I don't want an already set position to be overwritten, and since coordinates are randomized
09:19etate_ato: were you using cmd.exe or command.com?
09:20BlktBorkdude: how can I make it shorter?
09:20carkhkzar : you would do that with a single connection yes
09:20BlktBorkdude: that's quite hugly
09:24_atoetate: 1.6.0_20, cmd.exe
09:24BorkdudeHmm... I don't want to be unfriendly, but I gtg do some afk work now..
09:24BorkdudeI hope someone else here can help you refactor it
09:24_atohotspot 16.3-b01 mixed mode
09:26BlktBorkdude: nvm, thanks anyway
09:27carkhBlkt: functional styl would be to return a new board
09:28carkhstyle
09:28carkhthen you may decompose a bit
09:28carkhhave a function that will find a free element
09:29carkh(get-random-free-coords board)
09:30carkhalso you have (i think) 16 hares and 4 foxes
09:30carkhthis is not directly apparent from your code
09:30kzarcarkh: This is what I mean, how would you structure it? http://paste.lisp.org/display/98272
09:31carkh(concat (repeat 16 :hare) (repeat 4 :fox))
09:31etate_ato: I give up, i'm going to try on cygwin and see if anything works better there
09:32carkhkzar : what kind of application is that ? you have a user acting on a menu ?
09:32carkhopen your connection at that level
09:33carkhand never think about it again
09:33kzarcarkh: No it's more like a scraper that is putting data into a database
09:33carkhrun time is very long ?
09:34carkhi guess you could open a connection each time you download a page
09:34carkhso that you don't loose anything that was already processd
09:34kzarcarkh: Yea it's going to be ages
09:35carkhor open a connection per thread, then a transaction per page
09:35kzarcarkh: But how would you structure that example so that you could call already-stored? from inside and outside of (with-connection
09:35carkhopen the connection at a higher level
09:36kzaroh ok I see
09:36carkhdon't open the connection inside insert-data
09:37carkhi have this pretty large application which is both a web server and connects to some telecom equipment to get the data (telephone calls)
09:37carkhso i open a database connection before processing any page
09:38carkhthere is only one place where i open a connection in all the web server part
09:39carkhthen for the part where i process the (realtime) calls, i open a connection for each call
09:39kzarcool
09:39kzarI might do something like that to get the log from my cisco router later
09:43kzarI'll just use couchdb for the stuff I'm going to use though
09:44carkhmake sure it is well suited for your task
09:44carkhgoing the nosql route can be great, as long as you don't need the relational stuff
09:45kzarYea for this thing I'm scraping it would fit a lot better but I want to share the DB with people that I know will want SQL
09:49krumholt_can someone explain to me how binding and let differ when used with inlining? for example (binding [+ -] (+ 1 1)) behaves different then (let [+ -] (+ 1 1)). is that to be expected?
09:55carkhBlkt: http://clojure.pastebin.com/WvxvbYB7
09:59patrkrisrhickey: clojure.org/reader says keywords cannot contain '.' - is that a glitch in the docs?
10:00Chousukekrumholt_: binding makes a dynamic binding, so when the function call is evaluated the binding is in effect, but since (+ 1 1) form is inlined at compile time to something that doesn't contain a call to +, the binding appears to fail to work
10:01krumholt_Chousuke, and how is that different from let?
10:01Chousukekrumholt_: with let, the + name never even refers to the + function (it refers to the - function), so it works.
10:02carkhlet is lexical
10:02carkhbinding is dynamic and work with vars
10:02carkhso the ocmpiler knows what is + in the let case
10:02carkh(i would guess)
10:03Chousukewell it knows that it will point to whatever - pointed to when the let is evaluated
10:03carkhright
10:03rhickeypatrkris: 'cannot contain' doesn't mean 'will throw an exception if you try'. Do you have a non-superficial need for '.'s in keywords? Obviously the prefix can contain, as tat is what :: does. Should be clearer I guess
10:03Chousukeif you did (binding [- +] (let [+ -] (+ 1 2))) the binding would affect the + call (except inlining would foil it again)
10:04Blktcarkh: thanks, I just read it
10:04patrkrisrhickey: nope, just stumbled upon what I thought was a mistake
10:05Blktcarkh: it looks much better
10:05carkhBlkt: you're avoiding side effects this way
10:05carkhBlkt: that's more in line with clojure
10:06krumholt_Chousuke, ok. it still seems a bit strange. thanks all
10:06Chousukekrumholt_: dynamic binding is not very intuitive
10:06Chousukekrumholt_: but the real thing at fault here is inlining
10:07Chousukekrumholt_: (+ 1 1) becomes (Numbers/add 1 1) or something so there's no way for a dynamic binding to affect it
10:07Chousukebut (+ 1 1 1) is affected because it's not inlined
10:07krumholt_yeah i think i understand now. inlining happens at compile time. while binding happens at runtime. so it never sees a + in the code at runtime
10:36raph_amiardHi there
10:36raph_amiardi have a problem with swank-clojure
10:36raph_amiardwhen i start it with the 'slime' command everything is fine
10:37raph_amiardhowever if i try 'swank-clojure-project' i just get the 'Polling ...' message
10:37raph_amiardand nothing ever happens
10:37raph_amiardi have this error on two different computers, both installed with swank-clojure through ELPA
10:38bozhidarraph_amiard: you can see exactly the problem
10:39bozhidarby looking at the inferior lisp buffer
10:40raph_amiardok i'll look at that but i'm not even sure it opens
10:40raph_amiardbozhidar: aah yeah it does
10:42bozhidarand let me guess - you're missing clojure.main
10:42bozhidaror something like this
10:43raph_amiardyeah .. :)
10:43raph_amiardsorry had to fix a real world problem
10:43raph_amiardi have a class def error because it can't find clojure/main
10:44bozhidaryou need to create the project with leiningen
10:44bozhidarso that your dependencies get handled properly
10:44raph_amiardok thanks
10:44raph_amiardlet me grab some docs about leiningen
10:44raph_amiardnever used it yet
10:45bozhidarraph_amiard: it's simple - something like maven
10:45raph_amiardok i'm installing it
10:45raph_amiardthank you very much !
10:46bozhidarhttp://github.com/technomancy/leiningen
10:46bozhidarhave a look here
10:46bozhidarthis should be enough to get you started
10:47bozhidarafterwards when you point swank-clojure-project to the root of the project everything will work fine
11:12gigiclantza(binding [inc dec] (inc 0))
11:12gigiclantza,(binding [inc dec] (inc 0))
11:12clojurebot1
11:12gigiclantzaany idea why that happens?
11:13carkhyes !
11:13gigiclantzabut this works as expected:
11:13gigiclantza,(binding [inc dec] (apply inc [0]))
11:13clojurebot-1
11:13carkhtyhis was discussed like £1hour ago =P
11:13raph_amiardi guess i have another question, how do you know all available dependencies for lein, and their name ?
11:13gigiclantzacarkh: are there logs?
11:13carkhhttp://clojure-log.n01se.net/
11:13sexpbot"#clojure log - Apr 24 2010"
11:36gigiclantzacarkh: Thanks for the info. I still have no idea why a multimethod does not dispatch like I want it to (can't rebind isa?) but this was a really informative detour
11:37carkhi didn't see your question about a multimethod
11:53technomancyraph_amiard: you can search clojars.org for clojure deps and jarvana.com for java deps
11:53technomancyraph_amiard: there's also a new lein search plugin, but I'm not sure if it's documented yet
11:53technomancyLicenser: ^ ?
11:54fro0gtechnomancy: can I send you a patch for swank-clojure?
11:54zakwilsonIs there a function for getting the position of the first element of a sequence that satisfies a predicate?
11:54technomancyfro0g: yes, but I probably won't be able to apply it promptly
11:54technomancybut I love getting patches
11:54technomancyit's a conundrum.
11:55fro0gtechnomancy: np, I'll email it to you
11:56hamzazakwilson: positions in c.c.seq-utils
11:56zakwilsonhamza: thanks
11:57technomancyzakwilson: (first (filter my-pred my-seq))
11:57technomancysince filter is lazy, it will only perform enough calculation to find a single match
11:57zakwilsontechnomancy: I don't want the match. I want its position.
11:57technomancyoh, look at me misreading the question
11:58zakwilsonJust verified that positions does what I want.
12:15fro0gtechnomancy: did you receive it? Sorry for the format, I have to setup my sendmail clone properly.
12:24technomancyfro0g: yeah, looks fine
12:24technomancyI really do want to get a new swank-clojure release out soon
12:24technomancyjust have a lot of things going on.
12:28fro0gtechnomancy: great, no worries. I guess we'd all want more time for clojure hacking :)
12:32rrc7cz-hmfor anyone using emacs, how do you delete an outter (), [], etc? for example, if you have ((x)) and want to delete the extra parens. After I installed slime/swank it wouldn't let me delete them anymore unelss they were empty
12:32BorkdudeMaybe paredit won't let you?
12:33rrc7cz-hmBorkdude: that's probably it
12:33rrc7cz-hmwhat's the solution? I can cut/paste the inner () outside, then delete the empty (), but that's not really a solution
12:34BorkdudeI turn paredit-mode off :)
12:37remleduffrrc7cz-hm: M-s
12:38DeusExPikachuto load a new jar during runtime, the only way I figured to do that is by extracting the jar (its a zip file) into a directory which was already in the classpath, anyone else come up with a different solution?
12:38rrc7cz-hmremleduff: awesome! thanks
12:39Borkduderemleduff: I am trying it now too
12:40Borkdudebut it won't do anything here
12:40Borkdudeit expects another key
12:40rrc7cz-hmworks for me
12:40remleduffrrc7cz-hm: np, have you seen http://www.emacswiki.org/emacs/PareditCheatsheet ? The only problem is, it's hard to know which ones are useful. I really like: (|) someform, then pressing C-<right> which becomes (someform)
12:40sexpbot"EmacsWiki: Paredit Cheatsheet"
12:40remleduffThe bar there represents your cursor
12:40remleduffBorkdude: You have to be within the sexp
12:41rrc7cz-hmremleduff: I was searching that as you answered. To be honest I still don't see it on here. I got 5 pages of cheat sheets and can't find anything :-D
12:42rrc7cz-hmM-( looks good too
12:42remleduffM-s is "paredit-slice-sexp" which tells you nothing until you know what it does ;)
12:42remleduffThe examples are great though
12:43technomancyslurp and raise are the ones I use all the time
12:43DeusExPikachuC-h m puts you in the documentation for all the modes in emacs, including paredit, if active, thats a very important key sequence to remember
12:43DeusExPikachu* for all modes currently active
12:44technomancyerr--splice, rather than raise
12:45remledufftechnomancy: If I'm using lein-swank 1.2.0-SNAPSHOT, it works fine the first time I start emacs and slime-connect. Is expected that I can't connect again if I quite emacs and start it again (I say yes to "Do I want to kill active processes when emacs prompts me when I quit")
12:45technomancyremleduff: since that's something I don't do myself, I can only say the behaviour is "undefined" =)
12:46technomancyI've never tried it. sounds like an annoying bug though.
12:47remleduffIt just says "connection refused" in *messages*
12:47technomancyI always launch lein swank from inside eshell, so my swank server never outlives my emacs session
12:47remleduffAh
12:48Borkdudeah it works now, paredit-mode wasn't enabled yet because I had some unmatched ones somewhere... it's really strict ;)
12:48remleduffI may look into that if I get anymore free time then. Another question then, do you happen to have any idea what combination of versions is necessary to get this clj-imports.el (http://dishevelled.net/elisp/clj-imports.el) to work?
12:49technomancyremleduff: I don't know, but I really want to get that functionality in swank itself
12:51remleduffI want it to work so badly, I'm using a java library and having to import just tons and tons of stuff manually ;)
12:52remleduffDoes slime-connect run ~/.clojure/user.clj ?
12:52technomancyremleduff: one way to find out. =)
12:53remleduffI think the answer is no for some reason, I should have asked, is it supposed to? ;)
12:53technomancyremleduff: I wrote a very basic naieve version of that a while back; I think it wouldn't be too much work to do from scratch
12:53technomancythere are already some classpath-walking functions you can build from
12:57remleduffHmm, if you slime-disconnect are you able to slime-connect after? I've just noticed that I can't, maybe that's part of my problem
12:58technomancyyeah, that would be it
13:01remleduffDo you mean that you can?
13:01technomancyI mean that's the root of the issue
13:01technomancyI have the same problem
13:01remleduffok, thanks, wondered if it was just me :)
13:05Borkdudeah I'm starting to like paredit after this cheat sheet
13:07technomancyBorkdude: see also: http://p.hagelb.org/paredit-script.html
13:07sexpbot"outline.markdown"
13:08Borkdudewhat is the reasong for having an init.el instead of a .emacs btw?
13:08technomancyBorkdude: easier if everything's in one directory
13:10Borkdudeyou mean for things like git ?
13:11technomancyja
13:12technomancyemacs config belongs in git
13:12technomancyor a dvcs at least
13:12BorkdudeI'm still trying to find out, there's much to learn all at once
13:13Borkdudetnx for the link
13:24technomancyBorkdude: well you wouldn't want to run out of things to learn now, would you?
13:24Borkdudethat's true
13:28technomancywell if you do just wait a few weeks and rhickey will invent more new concepts.
13:32Borkdudegtg, bye
13:33rsynnottHey, I'm trying to write a system which has many in-memory objects (structs) some of which contain refs or collections of refs to other objects. I'd like to be able to mark these as dirty to be written to disk at a later date when they are modified. I know I can detect that they've been modified using a watch, but at that point, is it okay to write that data somewhere else (using another dosync?)
13:34tcrayfordits ok
13:34tcrayfordnot reccomended, but ok
13:34rsynnottIn Common Lisp I'd just use a CLOS MOP setter to do this, probably (similar to how Elephant or Rucksack works) but that obviously isn't practical here
13:34tcrayfordaye
13:34rsynnottIs there a recommended way to do this sort of thing?
13:34tcrayfordfor marking stuff as dirty, metadata is great
13:35tcrayford(ie has been modified, needs to be written to disk)
13:35tcrayfordI just do a send-off in a dosync when I get data
13:35tcrayfordseems to hold up reasonably well
13:36grammati,(do (require '(clojure.contrib [io :as io])) (doc io))
13:36clojurebotjava.io.FileNotFoundException: Could not locate clojure/contrib/io__init.class or clojure/contrib/io.clj on classpath:
13:36grammatidoes doc work on a namespace?
13:36tcrayfordno
13:36tcrayforduse (:doc (meta NAMESPACE))
13:38The-KennyWhat's the best way to check if all elements in a seq are = some other thing? (every? #(= :foo %) [:foo :foo :bar])?
13:38stuarthalloway#{:foo}
13:39grammatitcrayford: you mean like (:doc (meta io)) ?
13:39a_strange_guy,(every #{2} [2 2 2 2 2])
13:39clojurebotjava.lang.Exception: Unable to resolve symbol: every in this context
13:39a_strange_guy,(every? #{2} [2 2 2 2 2])
13:39clojurebottrue
13:39The-KennyAh, perfect. Thanks
13:40tcrayfordgrammati, as I understand it should be (:doc (meta (find-ns clojure.contrib.io)))
13:40rsynnotttcrayford: ah, yes, that owuld work, I suppose
13:40tcrayfordor summat like that
13:40rsynnottmy idea is that periodically any dirty data would be collected, and written out; some data loss in the event of a crash or machine failure is tolerable
13:40rsynnottthough I suppose I could do logging, again based on the difference from a watcher
13:41grammatitcrayford: yup, find-ns is the trick. thanks
13:41tcrayforda watcher would be fine in that case, no?
13:41rsynnottyep
13:41rsynnottyep, it should work; just feels slightly messy
13:42tcrayfordaye
13:43tcrayfordI haven't really found a better solution for that myself
13:43rsynnottI suppose replication to another machine is actually a possibility that way, too
13:45rsynnottMy idea was to assign each 'object' a unique ID; when an object is being persisted and is found to contain a ref, then, that ref could be persisted as a special value containing the oid, then when the object was being recreated from disk the correct ref could be put in
13:48Blackfootis there an issue with dashes in namespace or lein project names? lein compile doesn't pick up my .clj file if it has a dash in it, it seems
13:49stuarthallowayfiles should have underscores, correlating with dashes in clojure packages
13:49stuarthallowaythat's Clojure, not just lein
13:51bsteuberstuarthalloway: do you know the reason for this? actually, I tried dashes in a maven project and it worked fine - but maybe it's still bad for e.g. portability issues
13:51stuarthallowayI know way more than I want to about the reason for it :-)
13:52stuarthallowaythe dash is not a legal char in names in Java
13:52stuarthallowayand some JVMs enforce it
13:52stuarthallowaye.g. the IBM JDK
13:52bsteuberstuarthalloway: I see - then I'll better drop it from there :)
13:53Blackfootstuarthalloway: ah thank you
13:53Blackfootand thanks for writing the book, it's a great resource
13:54stuarthallowayglad to hear it, thanks!
13:54rsynnottA dash isn't a legal filename character in Windows, is it?
13:54rsynnottthat on its own would probably be enough that it would be undesirable as a java name
13:56vu3rddstuarthalloway: I really liked the "how we work" page of your company..
13:56stuarthallowayvu3rdd: it's as fun as it sounds :-)
14:01Blackfoothadn't seen that before, these are nice. too bad you guys are over in NC
14:06vu3rddstuarthalloway: any plans to write an addendum to the book on clojure 1.2 features?
14:06tcrayfordstuarthalloway: Is the API for circumspec going to change anytime soon? I've been tempted to write something like clojure-test-mode for it, but would rather wait until the api is settled
14:06vu3rddbtw, it is a nice book. I really like it
14:06mefesto"open source fridays", what a great idea!
14:07stuarthallowayvu3rdd: thinking about recording a screencast this weekend
14:07vu3rddstuarthalloway: thanks.
14:07stuarthallowaytcrayford: I have encouraged Stuart Sierra to steal the good parts of the API and merge them into lazy-test. I believe he has done so to some degree
14:08vu3rddstuarthalloway: being not much experience in Java (I do C at work with embedded systems and clojure is purely hpbby for me), I find the new features like deftype reify etc to be a bit over my head
14:08stuarthallowayonce lazy-test gets steam I will stop maintaining circumspec
14:08tcrayfordright
14:08stuarthallowayvu3rdd: Java experience wouldn't necessarily help :-)
14:08tcrayfordI was wondering which of them to pick (for an emacs runner), so thanks for that
14:09stuarthallowaynp
14:09vu3rddstuarthalloway: right.
14:10tcrayforddoes anybody know if any of the major IDE's do clojure refactoring yet?
14:10vu3rddstuarthalloway: I mean, I don't get why they are there. In the high level, I understand they will help for clojure-in-clojure.
14:11stuarthallowayvu3rdd: don't tempt me to spew the screencast right now on IRC :-)
14:11vu3rdd:-)
14:11stuarthallowaybut in short: take a look at protocols.clj and gvec.clj in clojure itself
14:11vu3rddstuarthalloway: sure.
14:12stuarthallowaythe kinds of problems being solved there are clojure-in-clojure, as you say
14:12stuarthallowaybut those kinds of problems occur in *any* sizable software project
14:12vu3rddok
14:13vu3rddstuarthalloway: I can't wait to see your screencast.
14:15sattvikstuarthalloway: I noticed your updates to 266. Did the .compareAt actually use reflection? I tested with *warn-on-reflection* turned on, and it didn't seem to raise a flag except when test itself was calling .compareAt. Is the reflection inside the method hidden by this?
14:15stuarthallowayyou would have to have *warn-on-reflection* turned on while clojure.core was loading to see the problem that way
14:16sattvikstuarthalloway: Ah, OK. I'll keep that in mind for next time.
14:17stuarthallowayI decided it was using reflection by rubbing my head against it. Not very efficient. :-)
14:18stuarthallowaywhat does "sattvik" mean?
14:18sattvikstuarthalloway: Hmm.. although, now that I think of it. If I do a (load "clojure/gvec"), would it show up there?
14:21stuarthallowaysattvik: hmm. Having tried that, now I am wondering if my patch was unnecessary
14:22sattvikstuarthalloway: 'sattvik' is the adjective form of the Sanskrit "sattva", which essentially means "pure". Though, that doesn't quite convey the whole meaning.
14:23stuarthallowayfiled under 99.44% pure then :-)
14:24stuarthallowaysattvik: Ah, I just learned something
14:24stuarthallowaythe reflection warnings don't come in order by line number
14:24stuarthallowayand yes, by loading gvec you can see the reflection warning
14:25sattvikstuarthalloway: Ah, ok. My mistake, then.
14:25stuarthalloway(was confused a minute ago because I thought the reflection warnings didn't appear)
14:25stuarthallowaythanks for the patch! I hope you will have time for more in the future
14:26sattvikstuarthalloway: I must have been confused by the same thing. I had a function that reloaded gvec and ran the tests in one go, so I probably just missed it as I concentrated on the wrong thing.
14:27mmarczyktcrayford: grammati: actually (doc some.namespace) works, provided some.namespace has been required (checked with current HEAD)
14:32rrc7cz-hmis there any reason in particular that lein doesn't support phase chaining, like "lein clean compile uberjar"?
14:33NikelandjeloIs there a way to apply and\or to a sequence of booleans without creating functions?
14:33sattvikstuarthalloway: No problem. I hope to do more. Is there a real desire to move the ASM code out of Clojure? I noticed it was on the Clojure-in-Clojure page on Assembla. I am thinking that may be a good task to take on, since I don't like the idea of bundled libraries.
14:35mmarczykrrc7cz-hm: the reason is presumably that nobody has submitted a patch to do that yet :-)
14:35mefestoNikelandjelo: something like: (every? true? [true true false]) ?
14:36mefestoan 'or' could use this: (some true? [true true false])
14:37rrc7cz-hmmmarczyk: that's better news than it being ruled out to keep it simple
14:37Nikelandjelomefesto: Oh, thanks :)
14:38mmarczykrrc7cz-hm: I do believe that compile is superfluous in your example, though
14:38stuarthallowaysattvik: I think there will be a lot of lower-hanging fruit than ASM
14:38mmarczykiirc, afaik compiles :namespaces from project.clj
14:38mmarczyk^^ uberjar compiles
14:40rrc7cz-hmok
14:41vu3rddsattvik: debian already does that. We use the libasm3 which ships with debian.
14:41sattvikstuarthalloway: True. It's just that the ASM thing bugs me. It's generally considered a bad idea to bundle libraries, mostly for security reasons. Granted, I don't think that the use of ASM in Clojure is likely to pose a serious risk.
14:41sattvikvu3rdd: Interesing. I'll have to take a look at that for Gentoo.
14:42vu3rddsattvik: take a look at the debian package: http://packages.debian.org/sid/clojure
14:42sexpbot"Debian -- Details of package clojure in sid"
14:49sattvikvu3rdd: I like it. I'll work on porting some of these things over to Gentoo. It'd be a good idea for the ASM patch to be submitted upstream.
14:50stuarthalloway,(reduce #(and %1 %2) [true true true])
14:50clojurebottrue
14:50vu3rddsattvik: yes, I was thinking about that. I will talk to Peter who originally did that work. I maintain clojure-contrib in debian and he maintains clojure
14:56licoressemongodb or couchdb?
15:07nurvHi.
15:58_brian2_noob question> why is it in leiningen project when I change a clojure source file (under /src) even after I run lein clean it tells me "All :namespaces already compiled." and doesn't re-compile?
16:00livingstondoes the source file define any java classes? or just pure clojure?
16:00_brian2_it has java classes
16:02livingstonis clean supposed to build too? I don't think that it does, when I run lein clean it flushes the lib directory
16:02livingstonthen I need to run lein deps again to get the libraries again, then whatever else I do
16:02_brian2_no,i mean lein clean then lein compile
16:03_brian2_ok, so I need to load the deps again?
16:04_brian2_no that doesnt work
16:05livingstonwhen I run lein clean I have to reload deps, but I don't call lein compile (so perhpas that does it for you)
16:06_brian2_actually, there aren't any class files showing up
16:06_brian2_under classes
16:07livingstonunless you are generating java classes (like with gen-class, or whatever the keyword/functions are) I don't think there will be any - at least I don't have any, but i'm running pure clojure from source
16:08_brian2_yea, Im trying to generate java classes
16:09livingston_brian2_: ask technomancy
16:09_brian2_I put (:gen-class) in it
16:09_brian2_ok
16:10livingston_brian2_: not that I don't want to help but, I'll try, I just haven't done it, and I just noticed he just joined (and is the developer)
16:10_brian2_np
16:11livingstontechnomancy: _brian2_ was having trouble getting lein to generate his java classes
16:11_brian2_i'll put it in a pastebin
16:22_brian2_technomancy> I put the source and project files here: http://clojure.pastebin.com/gG6cbVrq
16:23_brian2_doesn''t seem to be generating java classes
16:24technomancywhat exactly are you expecting?
16:24_brian2_i want to generate a jar file
16:24technomancythat is, why are you expecting it to generate java classes?
16:24_brian2_i have (:gen-class) there
16:25technomancymust have removed it before pasting
16:25_brian2_hmm
16:25technomancythe :main in project.clj doesn't match up with the ns at the top
16:25_brian2_ok
16:25livingstonyeah I don't see it, you have to do more than define -main to get a class
16:25_brian2_ok
16:26technomancy~ticket #315
16:26clojurebot{:url http://tinyurl.com/37u5rdb, :summary "Add support for running -main namespace from clojure.main without AOT", :status :test, :priority :normal, :created-on "2010-04-24T12:04:43-04:00"}
16:26technomancy_brian2_: but if all you want is -main, you might be better of with that patch rather than doing AOT: ^
16:27technomancyI mean, once it's accepted into clojure
16:31hamzatechnomancy: is it possible to override clean so that it will clean artifacts created by additional plug ins?
16:32technomancyhamza: not yet
16:32technomancyI have some ideas for a hook system that will let you tie into built-in tasks
16:32hamzatechnomancy: ok thanks..
16:34technomancyif you are interested in using such a hook system I could elaborate
16:34technomancybut unless you can help out with implementation it's going to be at least a few months out
16:39hamzai have a bunch of plugins that creates executables and such for now i have my own clean that cleans my artifacts than i call leins clean plugin.
16:40_brian2_technomancy> what patch ? I looked at ur website, i dont c it
16:40technomancy_brian2_: the one clojurebot linked to
16:40patrkristechnomancy: do you know of something for leiningen that enables the use of project templates? For instance, if I want to try something out quickly in a compojure setting, you could invoke something like `lein project webproject` - if you catch my meaning?
16:40_brian2_ok
16:41patrkrispatrkris: ugh, excuse my bad English
16:41technomancypatrkris: I don't know of anything like that. it'd be pretty easy to just throw together a new one-off "new-compojure" plugin except for the fact that right now plugins only work if they are part of an existing project.
16:42technomancyagain, I have long-term plans to deal with that, but nothing concrete yet
16:43patrkristechnomancy: yeah, you'd have to change the lein-script, right?
16:43slyphonwow, so scheme is like lisp without all of those convenient "functions" and stuff
16:44technomancypatrkris: probably. I'm thinking of plugins that would activate on a per-user basis across all projects.
16:44nurvslyphon: well, no.
16:44slyphonyeah, i'm just being facetious
16:44livingstonpatrkris: you could create an empty lein project that has the core of what you wnat, then just copy the directory and change the names when you wnat to do that
16:45patrkrislivingston: yes, good idea
16:45livingstonnot as "friendly" as what you are talking about, but it would get the job done
16:47livingstonslyphon: they have major philosophical differences too
16:47slyphonyeah, i gathered that
16:49livingstonslyphon: the history and discussion on the two and how common lisp formed are quite interesting, I encourage you to look it up / read about it
17:08remleduffpatrkris: What you are asking for sounds similar to what is called a "maven archetype" for example: (http://github.com/stuartsierra/clojure-archetype)
17:09patrkrisremleduff: Oh. So I can just create a maven archetype and use mvn to "instantiate" it?
17:10remleduffyeah, that's the idea
17:10patrkrisremleduff: nice
17:10technomancysort of. you first have to get it into maven central.
17:10patrkriscan I use my local repository?
17:10technomancyand even then it's like a three-line command to create the simplest of skeletons =\
17:10patrkrisyeah, that's right :(
17:12remleduffI'm not going to defend maven by any means ;)
17:12remleduffIt's a little nice that once you've set up archetypes, they'll potentially show up in your IDE. I know they do in IDEA at least
17:13technomancyyou can't list contents of a directory on the classpath if it's in a jar, can you?
17:15fro0gtechnomancy: I sent you a second version of the patch, forget about the first one as that was against jochus repository, the new version is against you repo
17:16technomancygreat
17:19remleduff,(enumeration-seq (.. (Thread/currentThread) (getContextClassLoader) (getResources "com/sun")))
17:19clojurebotjava.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
17:20technomancyremleduff: that's for a seq of all the files with the same name on the classpath
17:20technomancyif you want to get around the "first thing on the classpath wins" rule
17:20remleduffShouldn't you be able to take that and list the files in each though?
17:22technomancyno, it just returns a seq of URLs
17:23technomancyI don't think you can get a java.io.File object for a dir inside a jar without expanding the jar
17:24livingstontechnomancy: presumably there is some way ? I would think that resources in a jar could do that, it would be silly otherwise
17:24remleduffI'm thinking you're right actually
17:24technomancyistr hearing that there was no way, would love to be proven wrong. =)
17:24livingstonextremely worst case you could get a manifest of the jar (but that also seems silly)
17:24chouseryou can get an inputstream on a file in a jar
17:26livingstonI know you can store files as resources in a jar (so you can get around locla file system path issuses), I would assume you can do that with whole directories too, but maybe not.
17:28technomancyyou can store directories, you just can't list their contents.
17:28livingstonthat's really dumb if true
17:28livingstonthere's so much good code that works by saying "load (or what ever) all the files in this dir
17:29_brian2_technomancy: this still doesn't seem to generate java classes http://clojure.pastebin.com/04h1yG4M
17:31livingstonwell, worst case you could do something like they did here: http://www.rgagnon.com/javadetails/java-0665.html and then filter for the files matching the directory you care about
17:31sexpbot"List all files in the classpath or in a Jar - Real's Java How-to"
17:32technomancy_brian2_: looks like you're using a single-segment namespace?
17:32technomancy~single-segment
17:32clojurebotsingle-segment namespaces is unsupported. (foo instead of foo.core) they may work in a few circumstances, but you shouldn't rely on them.
17:32_brian2_ok
17:33_brian2_thnks
17:33technomancybrixen: also you're using classes without importing or fully-qualifying them
17:33technomancyoops, I mean _brian2_
17:33_brian2_ok
17:34livingstonyeah, wow, the zip/jar interfaces are pretty sparse, I would not have suspected that
17:34technomancylivingston: I think that may have more to do with the underlying limitations of the format rather than shortcomings in the JDK
17:34technomancyyou can actually create a zip file that has files in directories that don't exist
17:34technomancyand it won't blow up until you try to unzip it
17:35technomancy_brian2_: works for me after fully-qualifiying the class names
17:35technomancybut surely the error messages were pointing that out?
17:36livingstonyeah I'm just surprised that jar hasn't become a superset of zip with a billion features glommed on... I guess there's something ot be said for simplicity though (for once in java)
17:36livingstonis the jar file in question under your control?
17:36_brian2_technomancy: sorry, but how do I do that?
17:37technomancylivingston: not really. in this case I'm OK with requiring the directory in question to be on the classpath on disk rather than in a jar though
17:37livingstonyou could put a resource in it in a known location that contains the list of "stuff I care about"
17:37technomancyjust thought it'd be nice to support the jar if it were easy
17:37technomancy_brian2_: File => java.io.File, etc.
17:38livingstonwell it'd be a hack, but you could do it with the manifest way, and just use anything say that matches a given prefix or something, or even take the names from the manifest/elements and run them through the File API, I don't think it would be that ugly, depending on your needs
17:39_brian2_technomancy: sorry I'm still not sure what u mean
17:39livingstonI'm glad we talked about this though, because there are some people in my office that just wnat to shove everything in jars to get around file system issues, but there be dragons, apparently
17:39technomancylivingston: heh; not worth it in this case
17:40technomancy_brian2_: you can only refer to unqualified class names without importing them if they are part of java.lang
17:40technomancyso clojure doesn't know where to find stuff like PushbackReader
17:41_brian2_ok
17:41livingstonwhat's a nice clean example of something dispatching on type like strings vs. symbols. v. default...
17:42technomancytoo bad though; it was turning out to be a nice use of ->
17:42hiredmanlivingston: an interpreter
17:44livingstonno I was just looking for some clean code to copy this is a start though: http://clojure.org/multimethods
17:44hiredmanI have this compiler which is two multimethods
17:46livingstonI'm still having a little trouble sorting out types in clojure, it's interaction with meta, and the fact that a lot of things just boil down to maps (or seem to, like defstruct)
17:46hiredmanthe first does type dispatch, and if it is a seq it passes it to the second multimethod which does dispatch on the value of the first form
17:46_brian2_technomancy> I might see these things, but lein doesnt send the errors, it just says everything already compiled for this namespace
17:46_brian2_which was my original question
17:47livingstonit's not something that's confusing to me in general, it's just coming from *a lot* of common lisp, I have some biases to overcome
17:48livingstonhiredman: makes sense, fairly straightforward recursive decent design
17:48ChousukeClojure 1.1 doesn't really have a "native" mechanism for creating types of any kind. deftype in 1.2 changes that though.
17:48technomancy_brian2_: it's probably not trying to compile it because the :main in project.clj doesn't match the file on disk
17:48Chousukebut in general, working with generic data structures is idiomatic
17:48technomancyI can't tell what you're naming the file on disk from your paste
17:49livingstonChousuke: that kinda makes sense. I'm using 1.2 though, it's coming soon and no reason to prematurely cripple my design (I also really want the par code when it becomes available)
17:50livingstonand then there is the interaction with the compiler meta data with tags #^ but that's only for type hints to the compiler, right? that's not getting burned in or used anywhere else?
17:51Chousukelivingston: a big point about defrecord (the macro you're supposed to use for your own types) is though that record types work a lot like normal maps
17:52Chousukelivingston: so ideally you'd still treat them like maps
17:54zakwilsonI want to parse a log originating from Colloquy. It looks a lot like XML, but doesn't seem to be quite legal XML, and clojure.xml/parse throws "Content is not allowed in prolog.". I'm far from an expert on XML. Any suggestions on where to start?
17:54livingstonso this: #(.intValue #^Literal %) is in the code at: http://github.com/richhickey/rdfm/blob/master/src/org/clojure/rdfm.clj
17:55livingstonChousuke: so that's just saying that the input (the %) is hinted to be of type Literal? is that right?
17:55Chousukelivingston: #^ is a construct to attach metadata to symbols at read time
17:55Chousukelivingston: #^foo bar is shorthand for #^{:tag foo} bar
17:55hiredmanto anything that supports metadata
17:55Chousukewell, yeah. most often symbols though.
17:56hiredmansure
17:56livingstoncan you have mulitple tag types?
17:56Chousukeanyway, a :tag foo metadata on a form signals the compiler that its type is *probably* foo :P
17:56hiredmanlivingston: not possibly jvm wise
17:57hiredmanyou can't cast something to be of two types
17:57livingstonso the "tag" key is specially observed by the compiler but otherwise has no magic or import attached to it
17:57technomancyopinions on using single-segment test namespaces?
17:57Chousukelivingston: the compiler generates non-reflective code if the tag is there. no other magic
17:57livingstonok this is really helping
17:58livingstonand now if I want to give things a "type" for purposes of dispatch and whatnot is there a preferred way?
17:58hiredman,(doc type)
17:58clojurebot"([x]); Returns the :type metadata of x, or its Class if none"
17:59livingstonfor example if I have defstruct ball and defstruct bat and I want them to behave differently - by default they just generate maps, right?
17:59hiredman,(type #^{:type ::blarg} (symbol "foo"))
17:59clojurebotclojure.lang.Symbol
17:59hiredmanbah
17:59livingstonlol
17:59Chousukeyou put the type on the list, not the foo symbol :)
17:59hiredman,(type (with-meta 'foo {:type ::blarg}))
17:59clojurebot:sandbox/blarg
18:00Chousukelivingston: you can just have the type as part of your data too, without any metadata trickery
18:00Chousukelivingston: the multimethod dispatch function can then look at it and determine the "type"
18:00livingstonok so I should be using the type keyword it seems...
18:00hiredmanyou can determine type by examining the key set of maps!
18:01Chousukeeg (defmulti foo :bar) <- foo dispatches on the value of :bar in a map or other associative thing
18:02hiredmanyou can make your own type multimethod and use a variety of means of determining the 'type' of something
18:02livingstonChousuke: but they I would have to put a field in all my defstructs to support that
18:02Chousukealso (defmulti foo (comp :bar meta)) <- foo dispatches on the value of :bar in the metadata map of anything
18:03Chousukebasically, how you want to dispatch is up to you
18:03livingstonI get the crazy openness of dispatch in clojure, I just was looking for the most approprate straightford type-like way
18:03Chousukeyou can even (defmulti foo (get-phase-of-moon)) :P
18:03_brian2_technomancy: could you clarify your last comment....I have under/src this: mango-01.clj and in project file :main mango-01 ; I also changed ns to mongo.mango-01 and reflect in project file
18:03Chousukelivingston: type is probably the most common way then
18:03Chousukelivingston: also see the documentation for isa?
18:04technomancy_brian2_: you need something like src/mango/core.clj with (ns mango.core [...]) and :main mango.core in project.clj
18:04Chousukelivingston: multimethods use that to determine type relationships
18:04livingstonso things should only have one "type" keyword assocaite with them
18:04technomancy_brian2_: have you tried "lein new"? you should base your project structure on that.
18:04livingstonI shouldn't type something as two things (but I could isa that into the right structure)
18:04_brian2_no, i have tried that yet
18:05hiredmanyou can dispatch on vectors of things
18:05technomancy_brian2_: I should have mentioned that earlier. saves a lot of guesswork.
18:05hiredman,(doc isa?)
18:05clojurebot"([child parent] [h child parent]); Returns true if (= child parent), or child is directly or indirectly derived from parent, either via a Java type inheritance relationship or a relationship established via derive. h must be a hierarchy obtained from make-hierarchy, if not supplied defaults to the global hierarchy"
18:05_brian2_oh, i c, ok
18:05livingstonso if I have two "types" of symbols I probably want to have them "typed" by using meta :type
18:05hiredman,(isa? [String Number] [Object Object])]
18:05clojurebottrue
18:05hiredman,(isa? [String Number] [Object Object])
18:05clojurebottrue
18:06livingstonnow for my defstructs I could do the same trick.. or maybe I should be using defrecord now? which does hold onto it's record type, right?
18:06hiredmanso you can have multiple complex types
18:06hiredmanlivingston: I would just use maps
18:06Chousukelivingston: prefer defrecord to defstruct
18:06livingstonhiredman: oh that's interesting
18:07livingston^ re the multiple isa? bit
18:07Chousukelivingston: but I suggest you do experiments. Just try to avoid falling into a "type trap" :)
18:07Chousukenot everything needs its own type
18:07hiredman,(isa? [String [Number String]] [Object [Object Charset]])
18:07clojurebotjava.lang.Exception: Unable to resolve symbol: Charset in this context
18:07livingstonok, one vote map, one vote defrecord, lol
18:07hiredman,(isa? [String [Number String]] [Object [Object Characterset]])
18:07clojurebotjava.lang.Exception: Unable to resolve symbol: Characterset in this context
18:07hiredman,(isa? [String [Number String]] [Object [Object CharacterSet]])
18:07clojurebotjava.lang.Exception: Unable to resolve symbol: CharacterSet in this context
18:07Chousukelivingston: well, a defrecord is a map, so...
18:07hiredmanbah
18:08Chousukelivingston: a plain map is the most flexible choice for prototyping though.
18:08Chousukelivingston: but if you write code that works with a map it'll most likely work with a defrecord too
18:09livingstondo the types for protocols prefer anything specific?
18:09dnolenlivingston: defrecord really only make sense if the 1) construction time is critical 2) field access time is critical 3) you'll be calling some fn on the record more than 10,000,000 a second
18:10Chousukeor if you need to implement protocols
18:10Chousukeprotocols do class-based dispatch AFAIK.
18:10livingstondnolen: possibly, but premature optimisation is bad, for sure... if I start with maps is the transfer to records transparent / trivial?
18:10Chousukewhich won't really work with maps, since they all have the same class
18:11Chousukelivingston: should be. they implement all the map interfaces
18:11livingstonWell I have 2 things needing to be built now...
18:11Chousukelivingston: if you run into problems, I'm sure rhickey would be interested
18:12livingstonone is probably a protocol based wrapper for Jena / Jena servers
18:12livingstonsome servers like AllegroGraph implement their own version of Jena which is "faster", so it has to be different under the hood, but I want to expose one API so the user doesn't care which server they are talkign to
18:13hiredmanlivingston: you might look at http://github.com/richhickey/rdfm
18:13livingstonthat's an obvious protocol choice (I think?)
18:13Chousukeyeah. or multimethods.
18:13Chousukethough protocols will be faster
18:13hiredmansome one recently did a series of blog posts about a protocol for rdf stores
18:14livingstoni'm looking at that, it's really primarily tooled for persisting clojure structures in an rdf store - neat, but not really what I need I need support for knowledge representation and reasoning
18:14hiredmanstuartsierra has a clojure-rdf lib too
18:14livingstonhiredman: I've seen some things - a pointer if you have it would be great
18:14hiredmanhttp://www.objectcommando.com/blog/2010/04/12/clojure-protocols-part-3/
18:14sexpbot"Object Commando &raquo; Clojure Protocols Part 3"
18:15livingstonthe stuartsierra stuff seems to be for implementing the store in clojure and clojure's memeory - it seemed...
18:16hiredmanok, I haven't really used any of it, just stuff I remember seeing around
18:16dnolenlivingston: converting to defrecord is not necessarily trivial. can't destructure args. no rest arguments, simple type based dispatch.
18:16livingstonbut there are other issues I don't want the Jena data classes polluting my clojure code a RDF Resource is really just a symbol, so that can be made cool - if done right
18:16livingstonhiredman: oh I wasn't trying to sound argumentative, I really apprecate the pointers
18:16livingstondnolen: good to know
18:17livingstonso it sounds like there are some serious design choices there...
18:19livingstonthe second part to my puzzle is identifying pieces of RDF, for the most part it looks like lists and symbols and strings, but there are reasons to want to have additional details about them (like if they are already fully qualified URI's or not, etc...) ...
18:19livingstonthat seems like a job for metadata then, right?
18:20dnolenlivingston: possibly. metadata seems to me to be most useful when you want to tag something without affecting equality.
18:21dnolenotherwise just assoc your own data to thing, you can't change the original anyway.
18:22livingstonright but if I want it to look like lists and read like lists, that gets uglier then
18:22dnolenlivingston: oh yeah, sorry missed that bit.
18:23livingstonI really don't want a "triple" data structure if I can avoid it, since really RDF is just '(sub pred obj) that seems *really* convienent
18:23livingstonthere's some other messiness when blank-ndes get involved though
18:26livingstonone potential problem with my appraoch to make lots of symbols is that they might live too long and create memory problems when they are no longer needed
18:31livingstoncan protocols contain multimethods?
18:32livingstonI'm guessing no, and I would just have my protocol method call a specfic multi-method for that protocol implementation
20:21Licenser technomancy|away: lein search has in program help and a (slightly outdated) one on the github page I'l update as soon as I find a feee moment (and have sleeped)
20:21Licensernight poeple
20:39lithper1_when using swank-clojure-project, is there a way to have the new project directory created, and all the necessary files moved to /lib? for now, i just modified the elisp code to create all that stuff. is there a preferred method?
21:24remleduffIs clojure mode or swank-clojure supposed to be actually offering me java class completions? Like if I type Integer/va should it offer me valueOf? I seem to only be getting buffer history completion
21:26_atoit completes for me
21:27_atoremleduff: I use M-tab (or C-c tab) which is bound to slime-complete-symbol-function
21:27remleduffAha, using the wrong completion, I am
21:27remleduffty
21:43webwandererWhat does the -> operator do?
21:43hiredmanwonderful things
21:43webwandererLike what?
21:43webwanderer:)
21:44hiredman,mexapand-all
21:44clojurebotjava.lang.Exception: Unable to resolve symbol: mexapand-all in this context
21:44webwanderer'->' macro that is
21:44cp2it gives you wings!
21:44cp2it'll buy you a new car even
21:44hiredman,m-exapand-all
21:44clojurebotjava.lang.Exception: Unable to resolve symbol: m-exapand-all in this context
21:44hiredman,m-exapandall
21:44clojurebotjava.lang.Exception: Unable to resolve symbol: m-exapandall in this context
21:44hiredmanbah
21:45hiredman,(use 'clojure.contrib.macro-utils)
21:45clojurebotnil
21:45hiredman,mexapand-all
21:45clojurebotjava.lang.Exception: Unable to resolve symbol: mexapand-all in this context
21:45hiredmanwhat the devil is it called
21:45hiredman,mexpand-all
21:45clojurebot#<macro_utils$mexpand_all__4397 clojure.contrib.macro_utils$mexpand_all__4397@b0b955>
21:45hiredmanright
21:46hiredman,(mexpand-all '(-> a (X Y) E F G (W R)))
21:46clojurebot(W (G (F (E (X a Y)))) R)
21:46hiredmanthat is what it does
21:46hiredmancompare to
21:46hiredman,(mexpand-all '(->> a (X Y) E F G (W R)))
21:46clojurebot(W R (G (F (E (X Y a)))))
21:47webwandererwhat's it good for?
21:48hiredman,(->> "foo" .getClass .getMethods (map #(.getName %)))
21:48clojurebot("hashCode" "compareTo" "compareTo" "indexOf" "indexOf" "indexOf" "indexOf" "equals" "toString" "length" "isEmpty" "charAt" "codePointAt" "codePointBefore" "codePointCount" "offsetByCodePoints" "getChars" "getBytes" "getBytes" "getBytes" "getBytes" "contentEquals" "contentEquals" "equalsIgnoreCase" "compareToIgnoreCase" "regionMatches" "regionMatches" "startsWith" "startsWith" "endsWith" "lastIndexOf" "lastIndexOf" "lastIn
21:48carkh,(-> {} (assoc :a 1) (assoc :b 3) println)
21:48clojurebot{:b 3, :a 1}
21:48hiredman,(require '[clojure.zip :as zip])
21:48clojurebotnil
21:49hiredman,(-> '(a (b c (d e) r) t) zip/seq-zip)
21:49clojurebot[(a (b c (d e) r) t) nil]
21:49hiredman,(-> '(a (b c (d e) r) t) zip/seq-zip zip/next zip/next zip/next zip/next (zip/replace F) zip/root)
21:49clojurebotjava.lang.Exception: Unable to resolve symbol: F in this context
21:49hiredman,(-> '(a (b c (d e) r) t) zip/seq-zip zip/next zip/next zip/next zip/next (zip/replace 'F) zip/root)
21:49clojurebot(a (b F (d e) r) t)
21:50hiredman,(-> '(a (b c (d e) r) t) zip/seq-zip zip/next zip/next zip/next zip/next (zip/replace 'F) zip/next zip/next (zip/replace '(M M)) zip/root)
21:50clojurebot(a (b F ((M M) e) r) t)
21:51hiredmanman, it's been a while since I've played with zippers
21:52webwandererhiredman; thanks.
21:52_atowebwanderer: the boring answer is that it's good for reducing nesting and making things readable ;-)
21:53hiredmanI got accused of being a forth programmer the other day
21:53webwanderercool
21:54carkhhiredman: there are strong similarities between functional programming and stack based programming
21:54carkhsometimes haskell code (pointfree) really looks like forth
21:54hiredmansure
21:57carkhonly instead of passing a stack between words, you pass a return value i guess
21:58cp2hiredman: hehe
22:17vu3rdd_ato: I can't seem to get the java completions to work in slime
22:18vu3rddI have slime-fuzzy enabled
22:20rlbIf I use clojure.xml/parse to grab an rss feed then emit it, clojure produces xml that chokes firefox. It looks like that's because it's not escaping the ampersands in the channel string.
22:20rlbPossible bug?
22:20vu3rddAh, I get it now. But I had to disable slime-fuzzy
22:20hiredmanemit is undocumented because it doesn't really work
22:20mmarczykrlb: use c.c.lazy-xml instead
22:21mmarczykalso see this SO question
22:21mmarczykhttp://stackoverflow.com/questions/2463129/roundtripping-xml-in-clojure-using-clojure-xml-parse-and-clojure-xml-emit
22:21sexpbot"Roundtripping xml in Clojure using clojure.xml/parse and clojure.xml/emit - Stack Overflow"
22:23rlbOK, thanks. I didn't notice that it was undocumented.
23:05technomancyanyone who's watched the peepcode care to comment on this preview of my next blog post about updating Mire to Clojure 1.2? http://p.hagelb.org/mire-1-year.html
23:05sexpbot"136.yml"
23:12vu3rddtechnomancy: looks good. I had bought the peepcode sometime last year
23:13vu3rddtechnomancy: I can see a branch 14 in the repo now.
23:29remleduffHmphh, do you think clojure should be careful when printing things at the repl? If a "bad" object with an equals method that throws an exception gets printed, my repl crashes.
23:30remleduffI wonder how careful clojure should be though
23:30remleduff,(proxy [Object] (equals [o] (.toString nil)))
23:30clojurebotjava.lang.IllegalStateException: Var null/null is unbound.
23:31remleduff,(println "I hope I'm ok")
23:31clojurebotI hope I'm ok
23:33remleduffOh, messed up my proxy syntax
23:33remleduff,(proxy [Object] [] (equals [o] (.toString nil)))
23:33clojurebotjava.lang.IllegalStateException: Var null/null is unbound.
23:33remleduff,(println "ok")
23:33clojurebotok
23:35slyphongah
23:55gstamp(partion 2 [1 2 3 4 5]) gives back ((1 2) (3 4)). Is there any easy way to get back the remaining unmatched numbers (in this case the 5)?
23:57mmarczyk(clojure.contrib.seq/partition-all 2 [1 2 3 4 5])
23:57mmarczyk,(clojure.contrib.seq/partition-all 2 [1 2 3 4 5])
23:57clojurebotjava.lang.ClassNotFoundException: clojure.contrib.seq
23:57mmarczykouch, well