#clojure logs

2011-10-26

00:00brehaut,(apropos #"^[^*]+\*$")
00:00clojurebot(list* with-bindings* bound-fn*)
00:01brehauthuh. less than i expected
00:01brehautor i screwed up my regexp
00:01aperiodicis the half-earmuff a common idiom? i've seen it in a few places but i'm not exactly sure what it indicates
00:02amalloybrehaut: well, it's not correct in the strictest sense, but i don't think it matters given the names in clojure.core
00:02tdrgabi,(apropos #"\*")
00:02clojurebot(*compile-path* list* *3 *2 *ns* ...)
00:02amalloysince you'd fail to match on names like mathematical-*-function*
00:02seancorfield_i inherited it from c.c.sql so i didn't know whether it was idiomatic or not
00:03miclorb_amalloy: thanks for (list*) pointer - handy !
00:03technomancyseancorfield: it's fine
00:03brehaut,(apropos #"^[^*].+\*$") ; amalloy, better?
00:03clojurebot(list* with-bindings* bound-fn*)
00:03seancorfield_i kinda got the impression that folks used it where they had some macro foo, that was implemented with a function foo*
00:04seancorfield_but the library coding guidelines say to write functions first and add macros only where they help with use
00:04amalloybrehaut: yeah, though you still miss functions like f*
00:04seancorfield_which would speak _against_ foo* functions
00:04brehautamalloy: now i have two problems
00:04amalloy*chuckle*
00:05seancorfield_,(apropos #"^[^*].*\*$")
00:05clojurebot(list* with-bindings* bound-fn*)
00:05seancorfield_i see no f* :)
00:06seancorfield_oh great, now i'm reading email in evolution and i want to press C-v to page down... *sigh*
00:07ibdknox_in Korma I used select* and so on for the function equivalents of macros
00:07technomancyseancorfield_: you were warned this might happen, right? =)
00:07technomancyseancorfield_: I highly recommend http://conkeror.org
00:08technomancybecause a browser that doesn't have dotfiles is hardly a browser at all
00:08ibdknox_technomancy: lol, did you go to that link?
00:09ibdknox_technomancy: [Errno 122] Disk quota exceeded:
00:09ibdknox_:D
00:09technomancyibdknox_: oh noes!
00:09aperiodicseancorfield_: i've seen it used in that general pattern, but where both foo and foo* are functions
00:12aperiodici dunno, primes can be overlooked much more easily than stars
00:16jkkramer&(let [a' 1] (inc a'))
00:16lazybot⇒ 2
00:17brehautjkkramer: how long has that been the case?
00:17jkkramerbrehaut: since 1.3
00:17brehautaha!
00:17brehaut(inc jkkramer)
00:17lazybot⇒ 2
00:17jkkramerbecause of ##(doc +')
00:17lazybot⇒ "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Supports arbitrary precision. See also: +"
00:18brehautso is +' 1.2's + ?
00:19brehaut##(doc +'')
00:19lazybotjava.lang.RuntimeException: Unable to resolve var: +'' in this context
00:19brehautoh. haha
00:19brehaut##(doc +)
00:19lazybot⇒ "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"
00:37mindbender1please can someone recommend the best way to manage images on a website for someone who wants to operate something like a social network
00:45technomancyif you use the actual unicode prime mark it works in 1.3
00:45technomancy1.2 rather
00:47technomancyapostrophes are for weaklings
00:48aperiodic,(let [☃ :frosty] (print-str ☃))
00:48amalloytechnomancy: it's also a big savings on source-code size since you can use ⁗ instead of '''' for very-internal functions
00:48clojurebot":frosty"
00:49aperiodicawesome
00:51aperiodic,(let [☃ "frosty"] (print-str ☃ "the" '☃))
00:51clojurebot"frosty the ☃"
01:13seancorfield_i liked the trick posted on the ML to allow code that needs +' etc to work on both 1.2 and 1.3...
01:13seancorfield_(def plus (first [+' +]))
01:13seancorfield_on 1.2, that parses as [+ '+] and yields +
01:14seancorfield_on 1.3, it parses as [+' +] and yields +'
01:14seancorfield_helped me get clojure.math.numeric-tower passing the test suite on 1.2!
01:14amalloyseancorfield_: you're welcome :)
01:15seancorfield_sorry, couldn't remember who posted it
01:16seancorfield_hope i credited you in the code :(
01:16amalloyheh
01:18seancorfield_apologies... i did not credit you... i'll add that next time i touch that code...
01:19amalloyseancorfield_: no worries
01:28amalloyi signed the CA, rich probably owns any code i write for the rest of my life anyway
02:27spoon16best way to go from (\a \b \c \d \e \f) -> ((\a \b) (\c \d) (\e \f))
02:27spoon16?
02:27amalloy&(doc partition)
02:27lazybot⇒ "([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to compl... https://gist.github.com/1315613
02:27mbacyeah that
02:34hiredmanpartition-all
02:34hiredmanpartition will bite you
02:37amalloyah, good point. i use (partition 2 1 coll) so often that i forgot (partition 2 coll) has gotchas
04:32kzarI'm scraping a webpage that's massive (about 7 megs at the moment), so I just want to grab the first part of the page. I'm going to be parsing it lazily as it comes in and I want to avoid waiting for the whole thing to download first. Is java.io.reader the right thing to use to grab the page?
04:41kzarOr, actually I've realised I can't parse it lazily because xml library doesn't like the badly written html and the html parsing libraries aren't designed for massive files. Is there a way to say (head rdr 200) or something to just grab the first 200 lines?
04:44kzarBest I can figure is to do do (take 200 (line-seq rdr)) and then join lines back up again, seems crap though
04:45tsdhHi. I've taken clojure.xml and adapted it to create another output structure. It works pretty well, except that it doesn't recognize attributes as IDs or IDREFs. I've set the SAXParserFactory to create a validating parser, but that seems to do the trick only for DTDs. Ok, I could use SAXParserFactory/setSchema, but I want it to get the declared schemas automagically. Is there something like that, or do I need to
04:45tsdh reimplement all the stuff using javax.xml.streams?
05:09raekkzar: to answer the original question: yes, Readers (text) and InputStreams (binary) are Java's stream abstractions. I you open a stream for a file, the data will be read incrementally (i.e. not in one big blob)
05:10raek(those classes have annoying constructors, so clojure.java.io makes it much simpler to "just get a stream")
05:10kzarraek: It's working great, I just need to figure out a way to do a head on the reader now. my first (simplistic) attempt was (defn head [rdr lines] (apply str (take lines (line-seq rdr))))
05:10kzarraek: But ideally I don't want to do it like that, I want to keep the buffered reader but just have it stop after x lines or x characters
05:10raekkzar: what kind of unit of data are you interested in? bytes, chars or lines?
05:11kzarraek: I'm interested in lines but ideally I don't want to mess up the formatting, my example above strips the newlines unless I try and put them back in
05:12raekkzar: https://gist.github.com/661631
05:12raekthose examples give you a sequence of bytes or characters
05:14raekkzar: you can use the java methods directly to a byte, line, or char. clojure does only have a function to make a lazy seq of the lines
05:14raekso don't be afraid to dive into the java stuff when doing IO
05:15kzarraek: Aha, gotya. So really I can take line-seq source and add in a limit like you've done in those examples
05:15raekoh, the first example has a bug...
05:16raekI haven't exactly added a limit
05:16raek(take n lazy-seq-of-something) would be to add a limit
05:16kzarraek: Oh wait, as well the thing I'm using it for expects something like a reader. Surely a lazy seq doesn't help me
05:17raekif you just look at the first n lines of the result of (line-seq ..), you will only read enough to get you those n lines
05:17raek(plus some extra chars, depending on the buffer size it uses internally)
05:18raekkzar: you can implement your own Reader (e.g. with proxy) that reads from another Reader, but stops at a given number of chars, or something similar
05:19raekkzar: a lazy seq is like an immutable and persistent version of a stream or iterator
05:22raekkzar: so, to add a limit in clojure-land you just use 'take'. in java-land you implement a wrapper class for Reader.
05:24kzarraek: Yea gotya, I'm thinking taking x lines, joining them and then converting back into a reader is a bit ugly. I'm having a look at doing your proxy idea
05:26robermannkzar: you could use a BufferedReader
05:27robermannhttp://download.oracle.com/javase/6/docs/api/java/io/BufferedReader.html
05:27kzarrobermann: Yea I am but I need a limit to what it reads, so I'm making a proxy of it to add the limit
05:27kzarrobermann: Otherwise the things that uses it grabs too much and dies
05:27raekcalling 'clojure.java.io/reader' will wrap the reder in a BufferedReader automatically
05:28robermannyou coud call the constructor with the size limit
05:28raek(buffered reader is what gives you the readLine method)
05:28robermannand exit on the first .read
05:28robermannor http://download.oracle.com/javase/6/docs/api/java/io/BufferedReader.html#read%28char[],%20int,%20int%29
05:28robermannread just a chunk of an array
05:29robermannwhen that read returns, you can throw away your BufferedReader
05:32robermannprobably the problem is not the bufferedreader, but the destination string which is going too long
05:32kzarrobermann: Yea but I can't change that part
05:32kzarWell I had a change of heart, after looking into the proxy thing it seemed to be a bit tricky so I've done this (defn head [rdr lines] (java.io.StringReader. (apply str (take lines (line-seq rdr)))))
05:32kzarpretty shoddy I know!
05:37Blktgood morning everyone
05:38kzarraek: Defo going to do a bit of reading on proxies and things soon though, can't keep bodging my way along!
05:40raekkzar: well that code does what it supposed to do...
05:41raekthe only improvement you get from making a custom Reader implementation is more laziness
05:41raekwhich maybe is not that big deal for a fixed size sequence
05:48kzarraek: Yea, it has to all get read for the html parser which isn't lazy anyway. I didn't have time to dick around with it too much today so it's a good solution for now. Don't like taking the easy way out though, would prefer to do it right but nevermind!
06:25Arafangionkzar: Which html parser?
06:28kzarArafangion: I'm using enlive, the html-resource function. So now instead of passing it (URL. "url..") I pass it a Stringreader that's made from taking the first x lines from a clojure.java.io.reader of the url
06:29kzarArafangion: https://github.com/marktriggs/xml-picker-seq let's you handle this sort of thing better but it is for XML so badly formed HTML is a no-go
06:29Arafangionkzar: That's the trouble with html. :/
06:30kzarArafangion: Yea, on the plus side though the html parser didn't bawk when the file is truncated so my hack works
06:30Arafangionkzar: Nasty. ;)
06:33erldaveis this the right place to ask general programming questions on clojure? or is there a different channel?
06:36ejacksonerldave: this is the place, although the time is often later once the US has awoken :)
06:37erldavemy question is pretty basic: trying to work out how I should re-code this kind of java style idiom
06:37erldavejava: class MyObjectCollection { Map<String, Object> all; public void add(String key, obj).... public Object get(String key) }
06:38erldavecreate one of those, use it to keep a big collection of objects / clojure maps
06:38Arafangionerldave: What's wrong with a Map?
06:38erldavein clojure, would you do this using atoms?
06:38ejacksonerldave: it depends entire on your concurrency needs
06:38erldavewhere does the map live?
06:38erldaveI have no concurrency req at the moment
06:38ejacksonif there is no concurrency that an atom is an nice easy choice
06:39ejacksonits the closest thing that Clojure has to a 'variable'
06:39erldaveso put the map into an atom, wrap it with a few functions to add and get from whatever version of the map that is in the atom?
06:39ejacksonyup.
06:39erldavecool, this is my first venture into writing any actual code, so didn't want to get step one completely wrong :-)
06:39erldaveta
06:39ejacksonthere is no wrong.
06:40ejacksonnot on the first step anyway
06:40erldavereally, I've seen plenty of (java) code that would indicate that statement is not accurate
06:40ejackson:)
06:42ejacksonerldave: if its just a map you're storing remember that you can use the keys as 'accessors'. so (:key @my-map-containing-atom) will give you the current value of :key in the map.
06:42ejacksonno need for fancy footwork
06:43erldaveyep, I was thinking more of the reading functions iterating over the whole map to filter the (complexish) contents
06:44erldaveso I guess they could just work on the deref'd atom
06:45erldaveI've read a lot about clojure, just never actually written any code, so lots of concepts floating around in my head, I think now I need to get in there, and was stuck at first hurdle...
06:45ejacksonzakly
06:45ejacksonenjoy, enjoy.
06:45erldavethanks
07:09kzarI've got a lein project that's a noir webserver, when I type `lein run` the webserver launches. I now need to add a command to run a background job, my first approach was to add a lein plugin called cron that ran my code. Two problems though, it's a bit ugly adding loads of dependencies into dev-dependencies and worse a new clojure process is started when you run `lein cron`. Is there a way another way to add a shell
07:09kzar command that runs some part of my code in the existing java process?
07:17erldavedo you mean you want to run your process as a daemon, i.e. in the background?
07:18kzarerldave: I want a shell command that runs some code in my project, in the already running process containing the webserver
07:19erldavehave you considered using http://clojuredocs.org/swank-clojure/swank.swank/start-repl in your running code?
07:19erldavethen you could attach to that and run your code
07:20erldavealthough it opens a big door, you'd want to be very sure that nobody else had access
07:20cemerickRunning a repl server with an appropriate firewall and an ssh tunnel is perfectly pleasant.
07:38kzarerldave: Hmm but I need to trigger the code from a shell command
07:51kzarHmm well I found that lein -run let's you specifc the namespace and function, so at least I can use that to run the code quite easily. No idea how to get it in the same process though
08:39gensym``Moinsen
08:39gensym``(wrong channel)
09:10luciani'm spoilt by python's stack traces. is there something equivalent for clojure@
09:10luciantelling me there's a nullpointerexception somewhere in my program doesn't help
09:11llasramlucian: https://github.com/mmcgrana/clj-stacktrace can help
09:11llasram(I'm assuming you're running in a raw REPL and not in SLIME via swank or such?)
09:12lucianllasram: yeah, raw repl
09:13lucianhmm, it assumes a project
09:13lucianllasram: haven't gotten around to setting up emacs with clojure and a good vim mode
09:17raeklucian: in a raw repl, type (.printStackTrace *e) to get the stack trace
09:21raekthat should give you source file and line numbers too
09:39Arafangionlucian: I use vimpulse, but evil's the hot new kid.
09:40lucianArafangion: i tried evil, seems nice. but it appears i'll have to learn some emacs commands for things like clojure
09:40Arafangionlucian: You should, but at least with vimpulse, you don't have to make a completely clean break.
09:41Arafangionlucian: Also, evil gives sane buffer switching.
09:41lucianwith evil, you just press ctrl-z to go to emacs-mode
09:41lucianand i noticed i can just do alt-bla directly from insert or normal mode
09:41ArafangionSame - evil is basically vimpulse revised.
09:41luciansane buffer switching sounds good
09:42ArafangionAlso, unlike vim, emacs won't hang while trying to syntax colourise your text. :)
09:54lucianArafangion: heh
09:55lucianArafangion: it still hangs while package.el fetches things
09:57ArafangionI haven't gotten that far with my emacs education :)
09:57ArafangionBut vim would regularly hang while editing or loading files. :(
10:00mindbender1please I'm getting error in process filter: Symbol's value as variable is void: Listening when trying to clojure-jack-in to a project
10:01mindbender1I'm using emacs-snapshot
10:04jweissI have a map of test names to the result of the test. The results are promises that are delivered when the test completes. I need the blocking behavior of the promise to delay dependent tests until their deps have completed. But I'd also like to use watchers so I can use callbacks to notify others about tests failing/skipping/whatever. any suggestions for how to get both features?
10:05lucianArafangion: oh, it's not far. i was looking for packages, and google got me to marmalade (package repo)
10:39lucianodd. 4clojure gives me "java.security.PrivilegedActionException: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.MapEntry ", but it works in the repl just fine
10:40jweisslucian: i think that's because 4clojure is in a 'jail' environment where it won't let you wreak havoc with the host system
10:41lucianjweiss: i know that, but i can't see what i'm doing wrong
10:42lucianhttps://gist.github.com/1316540
10:42luciani can't see where i'm turning vectors into maps
10:44jweisslucian: me either :)
10:45jweisslucian: maybe card fn is being called with a single string instead of a list
10:45jweissor other way around
10:47bhenry,(let [s (first "D5") r (last "D5")] [s r])
10:47clojurebot[\D \5]
10:47lucianjweiss: hmm. afaict it's being called with strings
10:47lucianjweiss: i want to split the string in two http://www.4clojure.com/problem/128
10:51jweisslucian: i tried putting the calc of suit and rank in the let, and just plugging the values into the map literal
10:52jweissthen it gives "You tripped the alarm! catch is bad!"
10:53jweisshttps://gist.github.com/1316582
10:53jweisssorry for ugly indenting
10:57bhenryjweiss that's only because it makes the catch trip the alarm before it gets to the error.
10:58jweissbhenry: so the error is in constructing the map literal then?
10:58bhenryapparently
10:58bhenrycan't tell you why though
10:58lucianhmm
10:59jweissmaybe the catch inside the literal just hides the real problem, which is the catch
10:59lucianjweiss: precisely, it seems
10:59lucianchanged to hash-map and now it tells me catch is bad
11:00bhenryi did it without catch and get the same error.
11:01bhenryi just converted 2-A characters to the appropriate rank inside case, and it still did the same thing.
11:03bhenryjweiss, lucian: my fn works in my repl, but not in 4clojure
11:04bhenryhttps://gist.github.com/e4c60f16c99ea9b30bb7 works in emacs repl. fails with 4clojure error that lucian first saw
11:04lucianbhenry: same for mine
11:05lucianok, that's just weird
11:08lucianit would appear that 4clojure bans returning maps
11:10dpritchettHas anyone here ever heard of an ORM that automatically detects the structure of a SQL table so that it can handle writes to tables with arbitrary compound key structures?
11:11luciandpritchett: they usually require migration before anything like that. but clojureql seems general enough to handle anything
11:11dpritchettthanks lucian
11:12dpritchetti'm trying to figure out how to get from a json object to an "update x set values a b c d where keys are j k l m" sort of a statement
11:23kzarCan you use defmethod between namespaces? Say if I have a different namespace for each seperate parser and I want each one to add a method to the parse multimethod for it's type of file. (I could just add them all in the place I've made the multimethod but then I have to require/use all the parser namespaces + it seems a bit crap.)
11:24cemerickkzar: certainly
11:24cemerick(defmethod other-ns/multimethod :dispatch-val …)
11:26kzarcemerick: Oh cool :)
11:31pjstadigyou would still have to (require other-ns) or (use [other-ns :only multimethod])
11:32lnostdalwierd .. enlive strips the xmlns away from the html tag here
11:35kzarlnostdal: I saw it mentioned somewhere that namespaces aren't supported
11:35kzarpjstadig: thanks, good point
11:37lnostdalkzar, ok, yeah, i tried loading the resource using xml-resource instead of html-resource .. that seems to not strip it away
11:38kzarlnostdal: Yea, just found it at the bottom of the github page: "No namespaces support (hence unsuitable for most XML)"
11:40ziltiI have some problems with the custom-dialog from seesaw. It says "usage: (custom-dialog & {:keys [width height visible? modal? on-close size], :or {width 100, height 100, visible? false}, :as opts})" But I don't know how to read that stuff. (custom-dialog {:keys [:width 400 :height 200 :visible? true :modal? true]} ;content here; does not seem to work
11:45simardis there a gain when running clojure on a 64 bits jvm instead of a 32 bits one ?
11:49jweissis add-watch really still alpha? or i should ask, is it unwise to rely on it still?
11:52duck1123simard: there's a gain if you want to use a whole bunch of memory
11:53jkkramerzilti: that's map destructuring. it expects something like (custom-dialog :width 400 :height 400 :visible? true :modal? true)
11:57llasram`duck1123, simard: I think there'd also be a big gain with Clojure 1.3 for primitive math ops, since they're all in terms of (64-bit) longs
12:10AWizzArd2For Leingen I saw some days ago an example of how to block it from checking the maven repo. It was a combination of setting :omit-default-repositories to true and a manual :repositories entry. Does anyone have a link?
12:11scgilardihttps://github.com/technomancy/leiningen/issues/211 may have a pointer to useful info
12:15AWizzArd2scgilardi: ah hmm yes, I may have read this in one of the issues. So, perhaps I could just configure the repo "central" and point it to a bogus URL. I will try that.
12:16duck1123you might also be able to pull something off with ~/.m2/settings.xml leiningen uses that, right?
12:18AWizzArd2I could also try to make a host entry that blocks central.
12:22duck1123so was :omit-default-repositories true not working for you?
12:22duck1123https://github.com/technomancy/leiningen/blob/1.x/sample.project.clj#L122
12:28AWizzArd2It works for me. But I don't want it to go to central.
12:28AWizzArd2I want it to only go to my Artifactory repo.
12:29AWizzArd2But before I tell it about this repo I first want to make sure that my minimal showcase project.clj file can not successfuly download anything. From that point on I will try to get it using my own repo.
12:30simardwhen typing "lein repl" it says "REPL started; server listening on localhost port 4005" but "netstat -a" doesn't list port 4005 as being listened to, what's wrong ?
12:31duck1123AWizzArd2: Artifactory should give you some code you can put into the m2 settings, I'd start there
12:31simardlol, ok forget it, I'm wrong
12:35technomancykzar: if you're still figuring out lein run, you can set LEIN_NO_DEV to keep dev deps and test/ off the classpath
12:37kzartechnomancy: I'm OK thanks, I realised lein run has an optional parameter for ns/function. So I've used that to launch my worker. It works OK but doesn't start in same java process, still good enough for now anyway
12:37technomancyyeah, you need to start a repl listener if you want it to be in the same process
12:37technomancymaybe jark could do that
12:38duck1123I just open up a nrepl and a swank connection inside of my -main. that way I can just lein run and I'm all ready to go
12:38kzarHey if I want a lazy-seq of the result of running a function with side-effects is this the cleanest way? (take-while identity (repeatedly side-effect-fn))
12:41duck1123kzar: when dealing with side effects and lazy seqs, chunking is probably going to kill you
12:41kzarduck1123: How do you mean?
12:42duck1123kzar: this might help https://github.com/duck1123/ciste/blob/master/src/ciste/routes.clj#L8
12:42duck1123kzar: there's the posibility that more records will be realized than you actually want
12:43duck1123although I don't know if repeatedly does that
12:45duck1123I think the 'next' in that fn is actually supposed to be 'rest' I saw someone else post roughly the exact same thing the other day
12:46llasram``repeatedly' doesn't appear to produce a chunked seq
12:46llasram`,(let [x (atom 0)] (dorun (take 10 (repeatedly #(swap! x inc)))) @x)
12:46clojurebot10
12:46llasram`But still, probably not best practice to depend on that
12:47daakuis there a way to break a regex specified using #"xx"? i'm a bit pedantic about 80-col
12:47daakus/break a regex/break a regex into multiple lines/
12:48duck1123daaku: you could str a bunch of segments together, then compile the result as a pattern
12:49duck1123,(doc re-pattern)
12:49clojurebot"([s]); Returns an instance of java.util.regex.Pattern, for use, e.g. in re-matcher."
12:50daakucool, thanks duck1123
12:59duck1123I'm looking for something like DaemonKit's exception logger in Clojure. Something that can take an exception and log the stack trace in a log-friendly manner. Does anyone know of something like that already? http://rdoc.info/github/kennethkalmer/daemon-kit/master/DaemonKit/AbstractLogger:exception
13:00ibdknoxtechnomancy, ping
13:00chouserdaaku: #"(?x) .... whitespace ignored in here, should be able to line-wrap"
13:00technomancyibdknox: what are the haps
13:02ibdknoxtechnomancy, this issue is cropping up with people trying to do file uploads with noir: https://github.com/technomancy/leiningen/issues/262
13:02ibdknoxtechnomancy, and I didn't fully understand what the fix was
13:02technomancyibdknox: 1.6.1.1 was basically fixing just that bug.
13:02ibdknoxtechnomancy, awesome, so they just need to upgrade lein?
13:02technomancyif they're seeing it in 1.6.1.1 then it means someone else is peeing in the thread pool
13:02technomancyyeah
13:03ibdknoxfantastic
13:03technomancyI'll add a comment to that specific issue
13:03ibdknoxtechnomancy, thank you sir :)
13:03technomancynp
13:08kzarSo I've got a multimethod in one namespace, I've got methods for it in other namespaces. I tried to do something like this http://goo.gl/z3RNU to require all the other namespaces but I get a cyclical dependency error. I understand why but equally if I can't force the other namespaces to be loaded none of the methds for my multimethod will be avaliable for use
13:15daakuchouser: can't seem to figure out how to make it work. here's what i've tried: https://gist.github.com/34cc0f9b5076ebac3f2b -- i seem to get exceptions in parsing the regex if i try to split it up
13:17chouserdaaku: you need the leading (?x), after which whitespace (and regex comments) are ignored
13:17chouseroh, sorry
13:17llasram`kzar: one namespace does defmulti, other namespaces defmethod, then a final namespace to pull in defmulti and defmethod namespaces?
13:17chouserhang on
13:20duck1123cyclical dependencies are clojure's way of telling you that you that you're not using enough namespaces
13:21dnolenduck1123: or that you have too many ;)
13:23duck1123kzar: If you're willing to use Ciste's config and environment system, you could use definitializer to defer loading some parts of your code. https://github.com/duck1123/ciste/blob/master/src/ciste/config.clj#L82
13:24chouserdaaku: you have to escape the #'s, since they're being understood as comment-to-end-of-line
13:24chouserdaaku: replace every # with \# and you'll be all set
13:26daakuchouser: you sir are awesome
13:26daakuchouser: thank you
13:27chouserdaaku: np
13:28chouserthough I have to say -- a regex being multiline is probably a little hint that you should be solving your problem a different way.
13:33michael_campbelljwz's quote comes to mind.
13:33TimMc2 problems?
13:33michael_campbellexactly
14:23ziltiI have a collection of items, a map and a function. Now I basically want to (fun (nth coll 0) (fun (nth coll 1) (fun (nth coll 2) mp))) recursively apply the function to the result of the previous call. Is there some "for"-like way to do this or do I have to use loop or recursion with manual end-of-collection-detection?
14:23licenserzilti: reduce?
14:24ziltilicenser: Thanks!
14:24raek(reduce f 0 [1 2 3 4]) is the same as (f (f (f (f 0 1) 2) 3) 4)
14:24licenser:)
14:25zilti:)
14:25raekso you might need to flip the argument order
14:26ziltiNo need for that in my case, the order doesn't matter
14:26licenseris fun + :)
14:26ziltiBut good to know
14:27TimMczilti: What are you doing with the map?
14:27TimMcThere may be a better way to do what you want to do.
14:29ziltiTimMc: What alternatives are there?
14:32raekif mp is {} and fun is (fn [m x] (update-in m [x] (fnil inc 0))), you can use frequencies instead
14:32ziltiTimMc: Actually each entry in the collection is a collection itself, containing four booleans. The map contains, besides other stuff, :vspeed and :hspeed. Those are set to zero if certain booleans are true (it's a collision detection for a small game)
14:36kylpoibdknox: Where do you work again? I don't see it on your blog.
14:37ibdknoxkylpo, ReadyForZero
14:37kylpoibdknox: thanks
14:38kylpoibdknox: Oooh, has it switch off of Django and onto Noir?
14:39ibdknoxlaunching tomorrow :)
14:39ibdknoxso yep
14:42jodaronice
14:43ibdknoxI've built several other sites with Noir though, outside of just ReadyForZero's
14:43jodarooh hey, you guys are near me
14:43jodaroi'm at 2nd and folsom
14:43ibdknoxhaha
14:43ibdknoxsweet
14:44ibdknoxjodaro, where do you work?
14:44jodarosymantec
14:44jodaro"messaging and web security" group
14:44jodaroor whatever the hell they've decided to call it this week
14:44ibdknoxlol
14:45ibdknoxjodaro, we're hiring, if you want to move down the road ;)
14:45technomancyso can someone explain to me the actual problem that your typical "clean" task is meant to solve?
14:45technomancy(leiningen or otherwise)
14:45jodarorm -rf
14:45ibdknoxtechnomancy, old versions of generated files sticking around for whatever reason
14:46jodaroexcept the good parts
14:46technomancyibdknox: right, but I need more detail on "for whatever reason" =)
14:46technomancybecause it seems like the kind of thing you shouldn't have to worry about
14:46moominI'm a bit puzzled about the behaviour of non-dynamic vars. How come alter-var-root works, but nothing else does?
14:46chouserfrequently clean is used to cover errors in dep rules
14:46jodaromakes more sense in like c/c++ builds
14:46pjstadigthere are also packaging files generated
14:46jodaroremove all the .o and whatnot
14:46technomancywe established one reason .class files would stick around longer than necessary was due to a shortcoming of leiningen's handling of a certain condition
14:46pjstadigthat you may want to delete
14:47jodaroi guess .class files too, yeah
14:47technomancypjstadig: I don't understand why that should be conflated with bytecode though
14:47technomancyit seems like they are separate issues
14:47pjstadigsure, but usually a clean task cleans everything
14:47technomancypjstadig: yeah, right now it is totally a cargo-cult thing
14:47technomancy"clean does this because clean has always done this"
14:48jodarotradition!
14:48technomancyjodaro: I read that as being sung a la Fiddler on the Roof
14:48technomancyI hope that's what you intended
14:48jodaroexactly what i intended.
14:48hiredmanmoomin: nothing else meaning, what? binding? that is exactly what non-dynamic means, no binding
14:48jodaroi even stood on my desk and yelled it in my best yiddish accent
14:49jodaronow my coworkers are afraid
14:49todunhelp: is there a way to pass a symbol from a function to a macro? As an example, http://pastebin.com/JCg7MfUS thanks.
14:49ziltitechnomancy: Is it possible that leiningen gets delivered with swank-clojure 1.3.2? I found out that the reason why on my two PCs the swank task wasn't available was because I had both swank-clojure 1.3.2 and 1.3.3. It worked fine after uninstalling one of them
14:49hiredmannow break in to "if I were a rich man..."
14:50technomancyzilti: yeah, it definitely gets confused; am working on a fix for that in 1.6.2
14:50technomancyjodaro: extra style points for you!
14:50jodarohiredman: i like to change it to "when i am a rich man ...", the power of positive thinking
14:50moominSorry, yes. I think I just don't understand why alter-var-root still works.
14:50moominI'd have assumed it meant that you couldn't remap the var to anything else.
14:51hiredmanit means you can only change the value of the var globally
14:52moominAh, so it simply means no per-thread bindings.
14:53hiredmanwell per thread bindings are dynamic scope, so removing that gives you non-dynamic vars
14:53moominAh ok.
14:53moominIs there an easier way to redefine a var than alter-var-root?
14:54hiredmandon't
14:54duck1123if you alter-var-root a ref while another thread is in a dosync, does that thread still get consistent values?
14:54hiredmanalter-var-root and friends should really only be used in tests for mocking/stubbing
14:54moominThat's exactly what I'm trying to use them for. :)
14:55hiredman1.3 comes with a with-redefs you might find useful then
14:55hiredman,(doc with-redefs)
14:55clojurebot"([bindings & body]); binding => var-symbol temp-value-expr Temporarily redefines Vars while executing the body. The temp-value-exprs will be evaluated and each resulting value will replace in parallel the root value of its Var. After the body is executed, the root values of all the Vars will be set back to their old values. These temporary changes will be visible in all threads. Useful for mockin...
14:55pjstadigduck1123: alter-var-root is for vars, when using a ref you would use ref-set, which is transactionally safe
14:56moominAh, perfect.
14:56moominHadn't understood the distinction between bindings and redefs. Thankyou very much.
14:58duck1123pjstadig: right, but you store refs in a var. My question was if you redef that var in the middle of a dosync, then it will read that var as a different ref. I was wondering if you still get that consistency.
14:59duck1123I'm thinking no, which is all the more reason why altering vars like that can be dangerous
15:10fdaoudjimduey: I listened to your talk about monads. Thanks for pointing me to it, it was excellent!
15:11jimdueythanks for the compliment. feel free to hit me up if you have any questions.
15:11fdaoudI do have one question if you have a minute
15:11jimdueysure
15:12fdaoudthere was just one thing I wasn't clear on (ok a few things, but most of them are just a matter of sitting down, trying stuff, and figuring it out)
15:12fdaoudwhen you said you could easily go from the list monad to the set monad, so that you could have unique values without changing any other code
15:13fdaoudit seems that the half-double and increase functions did have to be rewritten to use (hash-set ...) instead of (list ...)
15:13fdaoudI would have thought those functions were part of the code that wouldn't have to be changed..?
15:13TimMctodun: Macros rewrite syntax, they don't accept runtime values.
15:14todunTimMc: ok. thanks. So there is no way to achieve the same goal?
15:14TimMctodun: I couldn't understand your paste, so I don't know.
15:15todunTimMc: the code example or my question?
15:15jimdueyfdaoud: you might be able to get a way with not changing those since both the set and the list have list interfaces.
15:16jimdueybut you're right, it would probably be more correct to change those as well.
15:16jimdueythe point I was shooting for was you didn't have to change the structure of the domonad forms.
15:17fliebelIs there any Clojure lib for interacting with IMAP and SMTP?
15:17fdaoudjimduey: understood. thanks! this is really interesting, and I am particularly intrigued by your Ring experiment.
15:18fdaoudRing is a great example for us web developers because it gives us a concrete and practical example that we can relate to
15:18manutter1fliebel: do you want to read email or just send it?
15:19jimdueyI didn't pursue that much farther since I doubt people would change. But I did enough to satisfy myself that Ring would be easily written in a monadic form.
15:19fliebelmanutter1: read, move, send, the whole thing.
15:20manutter1I've been playing with writing one, but so far only the "send email" bit actually works
15:20duck1123fliebel: did you see this? http://nakkaya.com/2010/04/15/using-clojure-to-connect-to-gmail-via-imap/
15:20jimdueyfdaoud: you might take a look at https://github.com/jduey/appraiser/blob/master/src/appraiser/scripter.clj for a monadic DSL for testing Ring handlers.
15:21fliebelduck1123: Yes. I'll save that for future reference.
15:21fliebelmanutter1: Is it on GH?
15:22fdaoudjimduey: excellent
15:22manutter1fliebel: yes, https://github.com/manutter51/nonomail
15:22fliebeljimduey: What do I need to read to understand Ring handlers in monadic form?
15:22manutter1duck1123: cool, I can use some of that info myself
15:23manutter1nakkaya.com has some good stuff
15:24fliebelmanutter1: Cool. I'll keep that in mind. Maybe I'll contribute a bit later, you never know.
15:24manutter1that would be cool
15:29fliebelFirst I need to study the javax.mail API. But if I survive that... I'm not sure what's more complicated*, IMAP or Java. * I don't dare to say complicated anymore, maybe it's just hard :(
15:30jimdueyfliebel: I'd say that presentation I did at CodePaLOUsa would be a good place to start if you don't already have a grasp of monads.
15:31jimdueyI talk a little about monadic Ring at the end of it.
15:32jimdueyHere's where I did some work in that direction: https://github.com/jduey/ring
15:32fliebeljimduey: Link?
15:32jimdueyhttp://www.infoq.com/presentations/Monads-Made-Easy
15:33fliebeljimduey: Thanks. Where is Louisville?
15:33manutter1shoot it was there a second ago...
15:34manutter1:)
15:34manutter1Ok, actually, it's in Kentucky USA
15:42fliebel&((comp inc +) 1 1)
15:42lazybot⇒ 3
15:43cemerickFYI: Enabling rich(er) interactions in the Clojure REPL: http://wp.me/p10OJi-cc
15:43fdaoudmanutter1: I just got your joke, ha ha :)
15:43manutter1:)
15:44Raynescemerick: The fact that you referenced Factor made me all tingly inside.
15:44cemerick:-)
15:44cemerickBig inspiration in this area.
15:44RaynesFactor's documentation is insanely awesome.
15:45cemerickOutpaces Racket, AFAIK.
15:45cemerick'course, the last time I used it, it was DrScheme
15:46fliebelcemerick: information overload! I can't learn monads and nREPL at the same time and hear about Factor still.
15:48phfis there a recommended strategy for running slime with both clojure and common lisp? i've not worked with clojure in a while, and i see that clojue-swank now forks slime.el. is that version eventually synced with upstream, and does it work with cl?
15:49ibdknoxcemerick, given my background, I'm really excited to talk about dev tools at the Conj
15:49cemerickfliebel: Maybe I should have implemented the new nREPL feature using monads? :-P
15:49fliebelcemerick: In Factor!
15:49cemerickibdknox: Rock. It's going to be my primary Clojure focus for 2012, I think.
15:50arohnercemerick: your video/site eats my mouse cursor while the tab is open. OSX + chrome
15:50cemerickhuh
15:50cemerickarohner: it's wordpress.com and vimeo; I'm not sure I can do anything about it :-/
15:51cemerickarohner: Can't replicate. Sorry, in any case.
15:52arohnercemerick: np. It's probably chrome + vimeo's fault
15:52cemerick"I'm having a problem in Chrome." "What vers…oh, nevermind."
15:52fliebeljimduey: Why rename all that stuff?
15:53arohnercemerick: true, but it is a nice experience for the user when things work
15:53cemerickagreed :-)
15:53arohner"I'm having a problem in Chrome. When will it be fixed?" who knows
15:54arohnerAnyone have experience with "com.sun.jdi.IncompatibleThreadStateException" when trying to use CDT?
15:54ibdknoxcemerick, my non-compete will fall out of effect in december... then I can hack on a Clojure IDE all I want :D
15:54jimdueyfliebel: what stuff? shoot me an email and I'll get back to you later this evening.
15:54ibdknoxcemerick, so I'd probably be very interested in helping out
15:54cemerickibdknox: A non-compete that impacts Clojure tool development?
15:54fliebeljimduey: nvm, aliasing mapcat
15:55ibdknoxcemerick, I was one of the primary interaction designers for VS
15:55cemerickah-ha
15:55Raynesibdknox: That's one hell of a non-compete.
15:55cemerickibdknox: I have some ideas for you. :-)
15:55amalloyit seems pretty reasonable, insofar as non-competes are ever reasonable
15:55ibdknoxlol yeah
15:56ibdknoxI doubt they'd come after me
15:56ibdknoxbut still..
15:56ibdknoxI was in Seattle
15:56cemerickYeah, no point in taking a risk over 3 months
15:57Raynescemerick: He is my technical reviewer, btw. Did your book get tech reviewed by a guy who worked on VS? No? Well, not all of us can be me.
15:57ibdknoxhaha
15:57cemericknice
15:57technomancyphf: there's not really any good way; you have to choose between being set up for CL or Clojure
15:57amalloytechnomancy, phf: doesn't scottj claim he does this all the time?
15:57brehautibdknox: brave announcing that to the wide world ;)
15:57cemerickibdknox: I got the impression you were partial to emacs though?
15:57RaynesNope, Vim.
15:57technomancyamalloy: yes, but he doesn't claim he has a good solution. =)
15:57ibdknoxcemerick, I use vim :D
15:58RaynesHe is a masochist. Likes it rough.
15:58cemerickbrave, brave mutha :-)
15:58cemerickbrehaut: Brave? VS is legendary for being the benchmark of tool usability.
15:58cemerick(mainstream tools, anyway)
15:59fliebelVS?
15:59clojurebothttp://groups.google.com/group/clojure/msg/fd0371eb7238e933
15:59brehautibdknox: that explains a lot about VS then :P
15:59ibdknoxVisual Studio
15:59Raynesfliebel: Visual Studio.
15:59Raynesibdknox: I demand that you remove yourself from my head.
15:59ibdknoxhaha
15:59brehautcemerick: its a mainstream tool for mainstream tools ;)
16:00ibdknoxhaha
16:00ibdknoxwell
16:00ibdknoxto be fair
16:00brehautcemerick: i found it clunky up to 2010
16:00ibdknoxthe stuff I worked on hasn't seen the light of day yet
16:00brehautcemerick: exception being the F# stuff, thats great
16:00ibdknoxbrehaut, it's terrible IMO ;)
16:01ibdknoxand they did a bastardized version of what I designed for the next version :(
16:01brehautibdknox: based on VC++ 6 or whatever, 2003 - 2008 are amazing
16:01cemerickI've always been able to do what I needed, even though I don't know *anything* about .NET fundamentally. That's pretty remarkable to me.
16:01brehautibdknox: :(
16:02ibdknoxthat's ok, we can do awesome things for Clojure :D
16:02ibdknoxthough, that's something I definitely can't accomplish on my own.
16:02brehautcemerick: its default project is sensible, its text editing widget is pretty powerful, and the debugger just works, but ocne you step outside of that its a quagmire
16:02ibdknoxwe'll be a far cry from VS, but even 1% the size of VS is GIGANTIC
16:03cemerickibdknox: there's a *lot* of pieces laying around; a ton of progress could be made just by gathering them up and beating the bushes a bit.
16:03simardperhaps debugging for clojure would be a nice start :)
16:03simarda debugger*
16:03phftechnomancy: that's sad :( is that a permanent direction of things now?
16:03cemerickOf course, that doesn't help out with the client-specific, interaction types of things.
16:03brehautsimard: you have print‽ what more could you want!
16:03technomancyphf: it's an unavoidable side-effect of the fact that the slime devs refuse to make stable releases.
16:04cemericksimard: I think there's a lot of lower-hanging fruit that can (and should) be knocked out first.
16:04cemerickAt least, that's what I'm going to focus on.
16:04amalloytechnomancy: s/stable//
16:04technomancyphf: with a lot of work we could update swank-clojure to work with upstream slime, and then it would break soon later.
16:04technomancyamalloy: =(
16:05chousernREPL is roughly in the same solution space as slime, is that correct?
16:06technomancychouser: yeah, basically.
16:06cemerickno, it's corollary is swank
16:06technomancythough to be pedantic, slime is a client, so nrepl is more like swank.
16:06technomancyheh
16:06chouserah, I thought slime was the server. sorry
16:06simardbrehaut: seriously, not much hehe.. that, combined with being connected to the repl through slime, modifying as you go some functions in an already running program
16:07phftechnomancy: i see. i guess heller is not the easiest person to work with, but further fragmentation of lisp community is unfortunate
16:07technomancyyeah, it's a shame. there are things you can do; maybe scottj can comment further.
16:07cemerickIs there a unified lisp community? Sorta like talking about an algol community.
16:08technomancyhe's one of the only folks still interested in CL around here
16:10brehautcemerick: the rich interactions vid is great btw
16:11cemerickThanks. Thought it might have been a little weak, actually.
16:11brandelif anyone recalls, yesterday someone mentioned that Rich Hickey gave a talk recently about expressing rules in clojure, does anyone have a link to that?
16:11cemerickThe ccw UI for it is nonexistent at the moment. :-P
16:11phftechnomancy: ok, thank you
16:12jodarobrandel: the simple/easy talk?
16:12brehautcemerick: mucking round with the config for the repl in the repl is pretty cool :)
16:12cemerickIt needs a decent drop-down so you can choose among the different representations you want to opt into, at the very least.
16:12brandelnot certainly jodaro
16:12brandelerr certain
16:13jodarohttp://www.infoq.com/presentations/Simple-Made-Easy
16:13brandelI'll watch that - I see it's on InfoQ
16:13brandelyep cheers
16:13cemerickbrehaut: yup, it's wide open. That actually makes things a little tricky if you have multiple clients connecting to the same REPL server, but we'll skin that cat when we get to it.
16:13brehautah true
16:13brehautprogress is progress
16:14Raynescemerick: I'm on the phone with PETA. They want your address.
16:14brehauti now regret jumping back into emacs; i could have jumped into new ccw!
16:14dpritchettanyone using M-x clojure-jack-in lately?
16:14dpritchettthe last time i looked this was durendal.el
16:14Raynesbrehaut: Bite your tongue!
16:14dpritchettnow I have a new emacs-nox install on ubuntu and i ran elpa/marmalade and got clojure-mode but M-x isn't finding a clojure-jack-in yet
16:14dpritchettDid I miss a step?
16:14cemerickbrehaut: Just keep an eye out. I'm far from done. :-)
16:14technomancydpritchett: maybe you got an older clojure-mode from elpa instead of the latest one from marmalade?
16:14dpritchettprobably
16:15dpritchetti haev 1.7.1, i'd love to know how to fix that
16:15cemerickthough cgrand and lpetit did a killer job on sprucing up the editor lately
16:15dpritchettprobably shouldn't have tried elpa to begin with
16:15RaynesYeah, that's definitely ancient.
16:15technomancydpritchett: make sure marmalade is on your package-archives source and run M-x package-refresh-contents; then M-x package-install clojure-mode
16:15dpritchetti should jsut nuke emacs.d, it's not like i have anything worthwhile there
16:15cemerick(the subject of cgrand's talk, actually, IIRC)
16:15technomancyor that =)
16:15jodaroam i the only one that uses inferior-lisp?
16:15brehautcemerick: the 0.4 release looks very compelling on its own
16:15jodarois that deprecated?
16:15fdaoudbrandel: that's a great talk for sure, but there isn't much about expressing rules in clojure
16:16technomancyjodaro: it's fine. it's not that much simpler than slime anymore now with M-x clojure-jack-in though.
16:16Raynesjodaro: Certainly not. Just that using SLIME is just as easy as using inferior Lisp now.
16:16brehautcemerick: is parsley driven largely by ccw atm?
16:16technomancyin the past the only reason inf-lisp was supported was because slime was a huge pain to configure.
16:16jodarook
16:16cemerickbrehaut: you mean its development?
16:16brehautyeah
16:16cemerickI don't know all of Christophe's motivations, but yeah, I know that parsley's latest significant progress was a blocker for ccw.
16:16jodaroit's been working great for me so i'll leave well enough alone and keep going
16:17Raynesjodaro: Do you use Leiningen or cake?
16:17jodaroleiningen
16:17Raynesjodaro: lein plugin install swank-clojure 1.3.3
16:18brehautcemerick: one thing ive not been sure about is does ccw support lein projects?
16:18jodarook let me see
16:18RaynesThen, just because I said so, run M-x clojure-jack-in. Just try it once. ;)
16:18cemerickbrehaut: There's a very low-tech way at the moment. project.clj support for ccw is very high on my list of things to do next.
16:18mefestoWhen it comes to clojure web frameworks with routing, html templating and form validation is webnoir the place to start?
16:18jodaroyeah that works too
16:18jodaronice
16:19brehautmefesto: a framework is the wrong way to start; theres a handful of good options for all those
16:20cemerickbrehaut: There's https://github.com/abrenk/lein-eclipse and http://sexp.posterous.com/poor-mans-integrating-leiningen-into-counterc
16:20cemerickboth are decidedly suboptimal
16:20Raynesjodaro: You don't have to use it. Just wanted to demonstrate the simplicity of the thing. I didn't use it either until I was floored by it the first time I used it.
16:20jkkramerproject.clj support and an option to turn off rainbow parens might tempt me away from emacs
16:20ibdknoxmefesto, in terms of starting quickly, I believe Noir is the fastest start->finish solution. But I wrote it, so take what I say with a grain of salt
16:20mefestobrehaut: well i've been using plain ring with moustache for some restful apis. now i need more of a typical web app framework a user facing app
16:21brehautmefesto: have you looked at hiccup and enlive ?
16:21mefestobrehaut: recommendations on alternatives?
16:21brehautmefesto: webnoir is a layer ontop of compojure and hiccup
16:22mefestoibdknox: nice tutorial btw :)
16:22dpritchetti must have screwed up my marmalade install i guess
16:22ibdknoxmefesto, thanks :)
16:22mefestobrehaut: yeah but it's handy that webnoir has pre-packaged these libs for me
16:23brehautmefesto: if you see value in that, then perhaps it is the right choice
16:26ibdknoxbrehaut, what would make it a lesser choice?
16:27brehautibdknox: i have a strong preference for web stuff to be closer to the library end of the library / framework spectrum.
16:28ibdknoxnoir is far from a framework in the traditional sense
16:28ibdknoxit's tiny
16:28brehautibdknox: indeed :)
16:28ibdknoxand I agree
16:28ibdknoxI've built sites with all the big frameworks
16:28ibdknoxI hated all of it
16:28ibdknoxlol
16:28brehautibdknox: i use moustache and enlive because compojure is too frameworky for my tastes ;)
16:28ibdknoxlol
16:28brehauthaha yeah, i write django stuff for my day job
16:29cemerickbrehaut: wow, that's sensitive ;-)
16:29cemerickI have fond memories of pylons
16:30fliebelcemerick: I remember the state monad was mentioned in reference to your config macro. What became of that?
16:31cemerickfliebel: I took gfredericks up on his suggestion; it's in clutch HEAD right now.
16:32fliebelcemerick: What did gfredericks say?
16:32cemerickstate (or reader) is a general solution, but isn't dynamic scope, which I still wanted to support
16:33cemerickfliebel: see his comment on the original post (Gary Fredericks)
16:34dpritchettam i going to have trouble using emacs 23.1?
16:34technomancydpritchett: should be fine
16:34technomancy24 is nicer mostly since package.el is built-in, but it's not required
16:34dpritchettok, i've just wiped and reinstalled elpa/marmalade about 5x and i haven't figured it out yet
16:35dpritchettnever had quite such an issue, i must be screwing something up
16:35jodaroonly 5?
16:35technomancythere is an open issue with marmalade that the instructions on the splash page are a bit misleading
16:35technomancyhttp://code.google.com/p/marmalade/issues/detail?id=20
16:35dpritchettso i install elpa the traditional way, paste 5-6 lines of elisp into scratch and C-j eval right?
16:36technomancyno, that gives you the old version that can't support multiple sources
16:36dpritchettah
16:36technomancydamn thing has been open forever; the marmalade maintainer is basically MIA =(
16:36dpritchettso how do i install from the new huge file you link to
16:36technomancyand it's implemented in node.js so nobody else dares to touch it
16:36technomancyyou don't really need marmalade; just install clojure-mode from git if you're having trouble
16:37technomancythe fact that elpa and marmalade are so neglected just makes me so thankful that clojars works as well as it does.
16:42fliebel&(let [[&[bar :as baz]] [1 2 3]] [bar baz])
16:42lazybot⇒ [1 (1 2 3)]
16:42fliebelWhy is bar only the first value and baz the whole?
16:43hiredmancause thats how destructuring works
16:43RaynesThat's what :as does.
16:43amalloyfliebel: because...that's what you destructured it as?
16:43Raynes:\
16:43Raynes"Destructure like I just said, but go ahead and give me everything bound to this so that I can use it as well."
16:44fliebelah, right... so...
16:44fliebel&(let [[&[bar & boo :as baz]] [1 2 3]] [bar boo baz])
16:44lazybot⇒ [1 (2 3) (1 2 3)]
16:45fliebel:as aplies to the whole thing, not just to bar.
16:45amalloyfliebel: what would it mean to just apply to bar?
16:45scottjamalloy, technomancy: the way I run slime w/ clojure and CL is pretty simple. I use a version of slime that works with both :)
16:45hiredman~clojure
16:45clojurebotclojure is the bestest programming language available.
16:46simardscottj: what version is that ?
16:46fliebelamalloy: That it's just an alias. But that doesn't make much sense. It just reads like that, and I'm sleepy.
16:47scottjsimard: I use 10-15-09 but the version technomancy recommends (10-04-09 I think) may work too I haven't tried
16:47scottjin a couple years that is
16:48technomancyoh well; he's gone =\
16:48technomancyI wonder why I get so many people complaining about CL then?
16:48scottjI bet a lot are using latest slime
16:48scottjand some are possibly using swank from latest slime and old slime
16:48brehautisnt that the CLers role in the lisp community ;)
16:49technomancybrehaut: bingo
16:49hiredmancemerick: http://www.thelastcitadel.com/images/Screenshot-Repl.png
16:49scottjand very likely there are bugs that I simply haven't encountered
16:50cemerickhiredman: nice :-) That looks familiar…which repl impl is that?
16:50hiredmanmine
16:50cemerickthat's what I thought
16:50hiredmanhttps://github.com/hiredman/Repl
16:50technomancyscottj: actually it may come from the slime-contrib libs too
16:50hiredmanmy first lein project
16:50cemerickin-process, I presume?
16:50hiredmanyes
16:50hiredmanyou just launch a repl
16:51scottjtechnomancy: the elpa version? I use slime-fancy but I don't use anything from elpa
16:51cemerickhiredman: before your time, per usual? ;-)
16:51scottjtechnomancy: of course slime-fancy doesn't include all the sliem-contribs
16:52hiredmanI dunno about that, the implementation launchs something like 20 threads at start up, which may be over kill
16:52technomancyscottj: could be it. for the most part they are not too keen letting things like details get in the way of telling me how broken the current situation is. =)
16:52cemerickah, the joys of swing
16:52cemerickSeems like a good REPL only needs to ramp up ~15 threads.
16:53hiredmanthe whole thing is a bit of a hack, since no one seems to make a nice simple embeddable rich terminal component
16:54hiredmaneven getting an embeddable terminal component for a simple gui repl is a pain
16:54cemerick"rich terminal" is a contradiction in terms for the most part, no?
16:55scottjdpritchett: make sure to do make bootstrap, that got me
16:55dpritchettscottj, somehow i've managed to fail at "git clone"
16:55dpritchettthis is a first for me
16:55dpritchetti use git pretty regularly too
16:55technomancydpritchett: what OS? it's not hard to find precompiled binaries.
16:55dpritchetti'm on ubuntu
16:55brehautgit contains traps for plays of any experience level
16:55dpritchetti tried the ppa and it wasn't going so well
16:56technomancydpritchett: http://emacs.naquadah.org
16:56technomancyor git clone --depth 1
16:56hiredmancemerick: well, a terminal like gui widget that allows for content beyond text
16:56cemerickright
16:56hiredmanmy repl there can embed any jcomponent
16:56cemerickEclipse actually gets very close
16:56technomancydpritchett: bit of a yak shave though; manual install of clojure-mode is going to be the path of least resistance
16:56hiredmanbut, well, you need all of eclipse :(
16:57hiredmannot terribly reusable
16:57cemerickwell, for what you want, you just need swt to get the embeddable webkit view
16:57dpritchettand to think, a month ago i was in here wondering aloud about ipython-grade Clojure repls to use with vim and i was told to bite the bullet and use emacs
16:57technomancycemerick: are you drawing from that json-powered mac gui-ish terminal that was floating around a while ago?
16:57fliebeljimduey: Would there be a monad to handle the asynchronous case well? Like, websockets and stuff.
16:57cemericktechnomancy: I don't think I saw that.
16:57hiredmanthe termkit
16:57hiredman~google termkit
16:57clojurebotFirst, out of 3630 results is:
16:57technomancycemerick: probably relevant: http://acko.net/blog/on-termkit
16:57clojurebotOn TermKit | Steven Wittens - Acko.net
16:57clojurebothttp://acko.net/blog/on-termkit
16:57dakroneugh, termkit was so ugly
16:57hiredmanyeah
16:57technomancyclojurebot: too slow, bro
16:57clojurebotbartj: it's not broken. Unless you know the performance hit there is actually a problem, I'd recommend leaving it alone.
16:57hiredmanwell, but it the right direction
16:58cemericktechnomancy: thank you, that looks very tasty
16:58cemerickCertainly in the right direction.
16:58scottjdakrone: as ugly as xterm?
16:58technomancydakrone: heh; yeah, proportional-width fonts are a real facepalm
16:59dakronescottj: more ugly, at leas xterm is readable
16:59jodarohrm
16:59cemerickhey, don't hate on my verdana!
16:59dakroneplus, it's built on nodejs
16:59jodarowasn't there a from scratch clojure ide written in clojure?
16:59cemerickWe'll have to see what I can do about getting the REPL view built on top of webkit in ccw.
16:59sridhas anyone used aleph to plot real-time graphs?
16:59technomancycemerick: oops; I haven't watched the video yet; it's still downloading. =)
16:59dakroneI think we only have to think a moment on marmalade-repo to know how bad of an idea that is
16:59jodaroi remember playing with it but i can't remember the name now
17:00scottjI think a term (and emacs) with these two features would be cool. 1: don't move the cursor block all at once, have it slide to the new position. 2: fade/slide in new text.
17:00scottjbasically the effects you seen in all hollywood movies
17:00jodarooh clooj
17:01dpritchettbtw thanks technomancy et al for your patience with my emacs adventuer
17:01cemerickSo, for those that have seen what I'm trying to do: anyone want to try to convince me that we should swallow mime types to identify different representations?
17:01dpritchettadventure
17:02technomancydpritchett: np. these are still the early days as the package manager is still in the process of getting uptake.
17:03dpritchetti can tell! a year ago this process was actually *easier* because all of you bright chaps were targeting the emacs23 that ubuntu was giving me ;)
17:03technomancynever mind that package.el has been around longer than leiningen; everything just moves several orders of magnitude more slowly than clojure land.
17:07jweissanyone have advice on whether it's easier to add-watch on a ref for a large tree structure, and then do a diff to find out what changed, OR, use refs on bits of the tree, and apply the same watch fn to all of them?
17:07cemerickjweiss: the former
17:07cemerickthe latter is the path to insanit
17:07cemerickinsanity*
17:07jweisscemerick: yeah that's what I'd rather do, but by what means do i do the diff?
17:08cemerickjweiss: clojure.data/diff? http://clojure.github.com/clojure/clojure.data-api.html
17:08cemerickNever used it myself, but fits the bill.
17:12scottjimages in slime repl http://collison.ie/code/slime-repl-pics.png
17:13technomancyscottj: stock slime or patched?
17:13scottjtechnomancy: patched
17:13technomancybummer
17:13hiredmanoh! are you sure, it seems like the other side of slime can send back "eval in emacs" messages
17:13hiredmanso maybe a stock slime could do it
17:14scottjyeah, that image is from 3 years ago so something similar might be in slime now
17:14hiredmanhttp://www.gnu.org/software/emacs/elisp/html_node/Showing-Images.html#Showing-Images
17:14technomancyhiredman: I don't see why not
17:15hiredmanjust that swank-clojure is disgusting :(
17:15scottjslime/contrib/slime-media.el
17:15scottj:display things other than text in slime buffers"
17:16hiredmankinda cool
17:16scottjs/slime-media/swank-media
17:22jweisscemerick: ah, that clojure.data/diff is great, appears to be 1.3 only, maybe i should just make the move
17:23hiredmanjump to a snapshot of 1.4
17:23Raynesjweiss: Please, for the love of God, make the move. Otherwise I'm doomed to have to update one of your projects at some point.
17:24RaynesThat'd make sense, since lazybot is running 1.3 now. Always good to have different Clojure versions between the bots.
17:24cemerickFWIW, I don't think inlining is so critical, if that's an issue.
17:25jweissRaynes: ok ok :) i WANT to move. i'll just have to add a bunch of ^{:dynamic true} or whatever the syntax is, and some libs that are stuck in the contrib blob means i'll have to keep using it
17:25hiredmanat least the sandbox, the amount of work to move clojurebot over to post 1.2 is scary
17:25cemerickThough I guess there's no latitude for getting slime to send something useful to swank.
17:25jweissi think prxml is the only lib i still need from the old contrib
17:26cemerickjweiss: clutch continues to use old contrib for a couple of namespaces that don't have easy corollaries.
17:26cemerickso, it's far from verboten
17:26hiredman1.4!
17:26hiredmanthe alphas are already out
17:27jweisshiredman: what do i get with 1.4 aside from an extra year before my bits rot?
17:28hiredmanhttps://github.com/clojure/clojure/commit/b5f5ba2e15dc2f20e14e05141f7de7c6a3d91179 is the big one so far
17:29hiredmanusing clojure's own hash function which is consistent with equiv for clojure collections
17:29brehautjweiss: http://dev.clojure.org/display/design/Release.Next+Planning
17:29hiredmanas opposed to .hashCode
17:31jweisshiredman: that doesn't really entice me :)
17:32hiredman"this house that has had it's foundation fixed up doesn't entice me"
17:33jweisshiredman: but some of the windows are stuck and cabinet doors are missing.
17:33jweiss(it's alpha after all)
17:34jweissi'm happy that the foundation is fixed though
17:34hiredmanpffft
17:34amalloyjweiss: it really should entice you
17:34hiredmanit's not like they went through and trashed the rest of the house with sledge hammers
17:34hiredmanthe changes are alpha
17:34hiredmanmost of it is still the same as 1.3
17:34amalloy&(contains? 1 #{(Integer. 1)})
17:34lazybot⇒ false
17:35hiredmanwrong arg order
17:35amalloy&(contains? #{(Integer. 1)} 1)
17:35lazybot⇒ true
17:35amalloy*squint* hiredman, shouldn't that say false?
17:35amalloy,(contains? #{(Integer. 1)} 1)
17:36clojurebottrue
17:36hiredman(type #{(Integer. 1)})
17:36hiredman,(type #{(Integer. 1)})
17:36clojurebotclojure.lang.PersistentHashSet
17:37hiredman,(type (first #{(Integer. 1)}))
17:37clojurebotjava.lang.Integer
17:37hiredmandamned if I know
17:38dpritchetttechnomancy: now i'm stuck on a weird udev/initramfs-tools apt problem in turnkey ubuntu
17:38dpritchettc'est la vie
17:53technomancyI'm not sure what that means, but it sounds like a hoot and a half.
18:00seancorfieldquick emacs Q since my google fu is failing me... i ran package-list-packages - what key marks a package for installation?
18:00Raynesseancorfield: i
18:01seancorfieldobvious really... *sigh*... then x to execute the staged commands...
18:01hiredmani maybe? dunno I haven't used the package manager in a long time
18:01seancorfieldi'm going thru the leiningen / emacs install process on windows xp... for 'fun' :)
18:03eipitenIs there a way to do something like #(eval (cons 'and %&)) without using eval?
18:04amalloy&(doc every?)
18:04lazybot⇒ "([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
18:04seancorfieldnice... leiningen / emacs all up and running on windows!
18:04seancorfieldnow i "know" what i'm doing, it's all much easier
18:04hiredman^-- largly the kind of thing I am talking about when I say "don't be an idiot"
18:05hiredmanreally that question has nothing to do with eval
18:05hiredmanand bringing eval in only muddies the water
18:05hiredmanreally it's about and and what and does
18:05hiredmanwhich is return true if all the values you pass it are true
18:06RaynesHe asked the wrong question -- I think we can forgive him just this once.
18:06hiredmanwhich even if every? did not exist is simple to write
18:06hiredmananyway
18:07dpritchettok, so i got ubuntu fixed (sort of) and since i've failed to get the ppas working for a second consecutive hour i'm trying git clone emacs again :P
18:07seancorfieldok, that was a success... now i need to write a blog post about it!
18:08hiredmanplease don't
18:08hiredman~blog post
18:08clojurebotmake a note of http://scienceblogs.com/goodmath/2006/11/the_c_is_efficient_language_fa.php it is yet another article about picking c or c++ for performance being naive
18:08hiredmangrr
18:08clojurebotHuh?
18:08hiredman~blogs
18:08clojurebotmake a note of http://scienceblogs.com/goodmath/2006/11/the_c_is_efficient_language_fa.php it is yet another article about picking c or c++ for performance being naive
18:08hiredmanclojurebot: you suck
18:08clojurebotGabh mo leithscéal?
18:08jodaromake it more of a challenge: tweet it.
18:09tncardosohi, I want to use map to change one value in a given list and i want to return [list true] in case of changes. (for efficiency sake) so I should do a dynamic bind or is there a better way?
18:10eipitenYou're right: I guess my real question is about how to manipulate structure. I don't really understand how to un-list a bunch of elements elegantly.
18:10hiredmaneipiten: unlist?
18:10sean_winxphiredman: so what were you actually trying to tell me about blogging?
18:11hiredmansean_winxp: people blogging about their emacs setups are the primary source of misinformation about how to setup emacs
18:11amalloysean_winxp: if a blog becomes popular enough to be useful, it is already out of date by then
18:12eipitenhiredman: the difference between #(eval (cons 'and %&)) and #(and %&). I'm afraid I don't have the vocab to really explain what I mean. The first function has the desired effect; the second doesn't.
18:12technomancyseancorfield: I used to recommend M-x list-packages, but in most cases M-x package-install is simpler if you know what you're looking for
18:12sean_winxpi've been good about updating old clojure blog posts to keep them up to date... at least i try :)
18:13sean_winxptechnomancy: good point - i wanted to ensure clojure-mode was at least in the least of packages before i installed it tho'...
18:13hiredmaneipiten: step back and think about what you actually want, forget about and and eval
18:14brehauteipiten: every time you call eval you fire up the compiler
18:14hiredmanyou have a list of true or false values and you want to check if they are all true, right?
18:15hiredmanbrehaut: when you are trying to teach a man to fish the brand of tackle box is not important
18:15sean_winxptechnomancy: on windows, i hit a problem that my classpath var had a bad path in courtesy of quicktime (gee, thanx QT!) but otherwise the whole leiningen / emacs install process was pretty slick
18:15eipitenhiredman: yes.
18:15technomancysean_winxp: great. did you install from the .zip distribution?
18:15hiredmaneipiten: so you have a list of stuff you want to do stuff with, how do you process lists?
18:15brehauthiredman: what if one of the tackle boxes is labled 'dynamite' ?
18:16eipitenhiredman: so the catch-all paramter returns a list, and I want to pass all of the elements of the list to a macro. If it were a function, I guess append would work?
18:16hiredmanbrehaut: certainly a valid method of fishing in some cases
18:16hiredmaneipiten: why do you want to pass it to a macro?
18:17hiredmanI hope you are not going to mention 'and' again, as I said you should forget about it
18:18tncardosohi, I want to use (map) to change one value in a given list and i want to return [list true] in case of changes (for efficiency sake). I should do a dynamic bind or is there a better way?
18:19hiredmaneipiten: how do you process a list of values? if you cannot answer this you are in for a world of hurt
18:19brehauttncardoso: map is not the right function for changing just one function in a list
18:19Rayness/function/element/
18:19brehautRaynes: thanks
18:19eipitenhiredman: usually I'd go for some sort of reduce
18:19amalloyRaynes: all of brehaut's elements are functions. he's crazy about the HOFs
18:20Raynesamalloy: He's crazy in general.
18:20tncardosobrehaut: i need 2 values: the list with changed value and a flag if the list was changed or not
18:20hiredmaneipiten: which is exactly the way to go, so why didn't you use reduce (or really every?) in the first place?
18:20tncardosobrehaut: i wanted to do llike this in order to avoid reading the list twice
18:20brehautamalloy, Raynes: if you arent creating your tarpit from first principles of lambda calc, why even bother?
18:20amalloyi assume the objection here is that reduce doesn't short-circuit
18:21sean_winxptechnomancy: with lein i downloaded the .bat file, downloaded curl.exe and did lein self-install
18:21hiredmanthen why not write a reduce that does?
18:21gtrak`why change an element in a list? should probably be using a vector instead
18:21technomancysean_winxp: do you think it makes sense to have people do that rather than just downloading the .bat and .jar?
18:21hiredmansolve the actual problem instead of deciding you must want 'and and eval
18:21sean_winxpthen got emacs 24 from the emacs for windows site (i need to dbl chk my browser history for the url)
18:21technomancysean_winxp: seems like curl is an unnucessary manual step.
18:22sean_winxpthen did lein plugin install swank "1.3.2" per swank-clojure instructions
18:22tncardosogtrak`: i am using a vector
18:22tncardosogtrak`: but I dont know the element position
18:22sean_winxptechnomancy: i needed wget or curl tho', yes?
18:22technomancysean_winxp: curl/wget is only used for self-install
18:22gtrak`well, you can either check each one, if it's sorted do a binary search, etc...
18:22technomancysean_winxp: so if you are going to have to manually download curl, you might as well just manually download the jar and skip the entire self-install process
18:22sean_winxpthe lein wiki page doesn't explain what to do with the downloaded jar tho'...
18:22tncardosogtrak`: i have to check each one
18:23technomancysean_winxp: right, I'm just wondering whether the instructions should be changed.
18:23gtrak`tncardoso, probably worth it to do reduce conj at that point
18:23sean_winxpif it had told me what to do with the jar, i would have gone with that
18:24sean_winxpbut having curl might be useful anyway :)
18:24tncardosogtrak`: the vector is not the right structure, I will change it later. My question is more a clojure one.. if I reduce and conj the list, how do I set a flag if the list was changed?
18:24gtrak`tncardoso, with a closure and an atom
18:24eipitenhiredman: I'm afraid I'm just learning right now. I haven't actually used every? before (although it looks like it is exactly what I need). As for reduce, I was hoping for something more elegant. Thanks for your help.
18:24sean_winxpso technomancy if i had downloaded the jar, where should i have put it?
18:24tncardosogtrak`: dynamic biding?
18:24gtrak`no
18:24hiredmanmore elegant than reduce?
18:24technomancysean_winxp: I'm not sure quite where it goes on windows, but what I'm getting at is that maybe documenting that would be simpler than the current instructions.
18:25hiredman*sigh*
18:25tncardosogtrak`: how is that then?
18:25gtrak`tncardoso, bind an atom at the caller, that's your flag, pass in a function that replaces it to your work function that actually performs the search and replace to swap it out
18:26gtrak`those concerns can be separated
18:26hiredmanugh
18:26hiredmanatom?
18:27clojurebotatom discussion is http://groups.google.com/group/clojure/msg/fd0371eb7238e933
18:27hiredmanyou can just compare
18:27hiredman(= list result-list)
18:27tncardosogtrak`: thanks
18:27tncardosogtrak`: i will give it a try
18:27gtrak`that's the same speed if it didn't change, slower if it did, right?
18:28hiredmanbenchmark it
18:28gtrak`but i suppose you'd also have to check if you're replacing the element with the same elemnt
18:28hiredmanwhy?
18:28gtrak`unless you don't care, in which case you'd get different results with = vs atom
18:28clojurebothttp://clojure.org/rationale
18:29gtrak`hiredman, depends on what you want I guess
18:29mrh0057technomancy: Its probably easier to download curl and let lein put it in the correct place. Microsoft keeps changing around were the home directory is and where applications specific files go.
18:29technomancymrh0057: oh, I see.
18:30technomancynow that you mention it I have had a number of bug reports around that, especially differing between cygwin vs the JVM
18:30hiredmantechnomancy: you wouldn't have a link to your map vs. reduce tweet handy would you?
18:31technomancyhiredman: you mean the one about which one is better?
18:31hiredmanyeah
18:31technomancyfraid not
18:31hiredmanI suppose it doesn't matter
18:31hiredman(if I get the link or not)
18:32gtrak`map's better, right?
18:32gtrak`if you can do it with map?
18:33hiredmanmap can be implemented in terms of reduce (if the lanague is lazy it will be lazy, if not strict) but not the reverse
18:34gtrak`hmm, you couldn't?
18:34hiredmanwell, go ahead and do it
18:34gtrak`if you had mutable state it seems like you can
18:35gtrak`but it won't be lazy
18:36mrh0057technomancy: On Windows 7 the config are either in C:\Users\<username>\ or C:\Users\<username>\AppData\Roaming\ . The path depends on what you use to get the user's home directory.
18:36technomancymrh0057: and you can't just rely on the HOME environment variable?
18:38amalloytechnomancy: $HOME is a recipe for sadness on windows, isn't it?
18:38technomancyamalloy: apparently
18:39mrh0057technomancy: I think the HOME environment variable gives you C:\Users\<username>\
18:39gunsHello. Is there a dissoc for vectors? Currently I (filter identity (apply assoc v (interleave indices (repeat nil)))); but that's pretty slow
18:40hiredmanyou can only remove elements from the end of vectors efficently
18:40mrh0057technomancy: However emacs looks for .emacs.d in C:\Users\<username>\App\Roaming .
18:40gunshiredman: mmm that's something to think about
18:40hiredmanif you want random access for remove use a map
18:40amalloyhiredman: i don't think you can actually do that though, can you?
18:41hiredmando what?
18:41amalloy,(dissoc [1 2] 1)
18:41clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IPersistentMap>
18:41hiredman,(pop [1 2])
18:41clojurebot[1]
18:41amalloywell yes
18:41technomancymrh0057: what if leiningen just told you where it was expecting to find the jar in the error message?
18:41amalloyi guess i took the question/statement too literally
18:42mrh0057technomancy: That would seem to work.
18:44gunshiredman: thanks; I had the impression that using a hash table would be less efficient for working with indices
18:44mrh0057technomancy: If people are having problems with emacs on windows, it expects config files to be C:\Users\<username>\App\Roaming . I had problems setting up erlang with emacs because it was looking in the wrong spot for the cookie.
18:44gunsbut I guess I should rethink that
18:44technomancymrh0057: this should be orthogonal to emacs though
18:48gtrak`what's a vector do on removal that makes it slow?
18:48mrh0057technomancy: It may affect some of the scripts if you really on emacs for getting the home directory.
18:51technomancyI think it's all funneled through the .bat file
18:53bprtechnomancy: how do you do slime/swank? via "lein swank" or M-x c-j-i?
18:53technomancybpr: jack-in
18:53bprwith swank-clojure 1.4.0?
18:54technomancybpr: I'm using 1.3.4-SNAPSHOT right now but 1.3.3 is probably best
18:54bprI'm struggling to find a stable dev environment with useful debuggin utilities
18:54bprok
18:55bprI'm looking forward to having cdt available :)
18:55bprI can do almost everything, except debug threads very well. And I'm findind it really painful when that need crops up
18:56bpranyhow, thanks for the amazing tool(s)!
19:24seancorfieldhmm, my windows xp emacs install doesn't seem to be reading from .emacs.d in my home folder... so i wonder where it thinks it should be looking for that?
19:25simardseancorfield: what about your .emacs file, is it reading it fine ?
19:26_ulisesseancorfield: afaik, in windows 7 emacs will read from /C/Users/username/AppData/Roaming/.emacs.d/
19:26simardseancorfield: try C-x d ~/ to see where it gets you
19:27simardiirc this is where emacs looks for .emacs, and, I guess, .emacs.d
19:30seancorfieldthanx... $HOME was the Application Data/ subfolder
19:30seancorfieldfound junction which creates symlinks on windows so now my .emacs.d folder is sync'd via dropbox between mac / win / ubuntu on three separate systems...
19:31_ulisesseancorfield: I use git for that which isn't that ... automatic :)
19:31technomancyyeah, I've never understood the appeal of dropbox for code
19:31_ulisesI thought dropbox was based on svn?
19:32simardseancorfield: I've been using rsync/unison for years, then I found git
19:33simardseancorfield: and github !
19:34zakwilsonDoing a project in Rails for the first time in a while makes me want to write a batteries-included web framework in Clojure... and not have it be anything like Rails.
19:34seancorfieldwith dropbox and symlinks, i can keep config stuff in one place and it auto-shares changes across all machines... i don't have to do anything
19:35seancorfieldfinding how to do symlinks on windows was a pain tho'
19:35gtrak`seancorfield, I use the same method, works great
19:35simardseancorfield: git allows you to keep track of changes you made to configs, for times when you go "I wish I hadn't deleted that line"
19:35gtrak`does emacs work properly on windows too?
19:35seancorfieldis there a way to get emacs to reload a file from disk if something else changed it?
19:35gtrak`with the same configs?
19:35zakwilsonMore or less, I think.
19:35simardgtrak`: not without a full cygwin behind it
19:36seancorfieldgtrak`: so far, yes, because i'm not using full file paths anywhere
19:36gtrak`simard, you have to run cygwin emacs, or just have the progs available?
19:36_ulisesseancorfield: I try to edit it; emacs asks me whether I want to reload
19:36seancorfieldno cygwin
19:36zakwilsonrevert-buffer
19:36seancorfieldthanx zakwilson
19:37seancorfieldauto-revert-mode apparently
19:37simardgtrak`: not sure about that, but things will tend to fail if you don't have an ssh program etc, especially with tramp
19:37simardor grep even
19:37gtrak`i use dropbox with hg for code
19:37zakwilsonI always forget how much work it takes to make Windows useful.
19:37gtrak`free hosting
19:38simardzakwilson: yeah, it's a pain, I feel like I'm missing a few limbs when I have to use it
19:38zakwilsonI more or less don't ever do anything but browser testing and gaming on Windows.
19:40simardthere's a few damn good programs on Windows that I have to use for work as well
19:40simardit's sad :)
19:40gtrak`though you have to use n+1 repos or risk corruption if stuff gets out of sync
19:43seancorfieldclearly i haven't fired up my win xp vm for a while... 16 important updates to install...
19:43simardhuh, are you running emacs from within a windows vm ?
19:44simardover linux ?
19:44sritchie@technomancy, is there some way to trigger an uberjar from within a running project?
19:44sritchietechnomancy: I'm running into a previously reported issue where a dependency with maven ant tasks will cause an error
19:47technomancysritchie: dependency or dev-dependency?
19:47sritchieI'm including lein as a dependency
19:47technomancythat's going to cause trouble
19:47technomancyhave you tried :eval-in-leiningen true in project.clj?
19:48technomancyleiningen is not a library
19:48stevel_Is it possible to set a system property in leiningen?
19:48sritchielet me check it out
19:48stevel_Like a -Dfoo.bar="baz
19:49technomancystevel_: you can set :jvm-opts ["-Dfoo.bar=baz"]
19:49stevel_awesome, thanks
19:49sritchietechnomancy: I'm writing a script that deploys some project's uberjar up to a cluster
19:50sritchietechnomancy: so I'm trying to figure out how to get the project to package itself up during the deploy
19:51technomancyit sounds like you should write a plugin
19:53sritchieI have a plugin that does this, but the goal was to write a phase for pallet, which works as a library
19:54sritchiethe phase would accept a remote path and send the project's uberjar to that path
19:57technomancyhm; you can try it, but it's definitely not designed to be used that way
19:59sritchieokay, I'll keep thinking
20:00hugodsritchie: you could write a pallet task, and then make it depend on the uberjar task
20:00sritchieyeah, that's true;
20:01sritchieit's easier to think about as a phase, but that will definitely work better
20:01hugodthe pallet task can just run a phase
20:20simardwow these webgl javascript samples found over the web are so far from side-effect free :S
20:26bprsimard: haha, yeah i wrote a javascript RFB client, and was feeling dirty about all the mutation
20:27simardthat, and functions accessing public vars all the time, read/write
21:06_uliseshow can I create a BigInt from clojure.lang?
21:06hiredmanwhy?
21:06clojurebotwhy not?
21:07_ulisesI'm seeing a bug with Math/abs whereby my code is passing different types and one of them is making the reflection fail
21:07_ulisesI want to confirm it's BigInt and not, say, Long
21:07_ulisesright now I've worked around it with (int ...)
21:07seancorfield(bigint 42)
21:07_ulisesta
21:07seancorfieldin clojure 1.3
21:07_ulisesyup
21:08_ulisesand effectively, that was the culprit, so thanks!
21:08_uliseshum that's a question I haven't answered: why should I migrate to 1.3? or even, should I?
21:09_ulisesI mean, I'm a light user of clojure, so 1.2.x serves me just fine
21:09seancorfieldimprovements in numeric performance?
21:10_ulisesok, what else?
21:10zakwilsonYou should migrate because the libraries have changed and eventually third-party libraries won't work with 1.2 anymore.
21:10seancorfieldyeah, the monolithic contrib 1.2.0 is no longer maintained - there are new modular contrib libs that work with 1.2 and 1.3
21:11_ulisesah, that's a good point, I can't find any of the contrib stuff I generally use (not that before it was any easier)
21:11seancorfieldso it's more important to use the new libs, even if you're on 1.2
21:11zakwilsonThat's because contrib is gone, most of it having been either integrated or spun off.
21:11_ulisessorry, I probably sound like a moany b...
21:11_ulisesdon't mean to complain, etc.
21:11seancorfieldclojure 1.2 was very compelling in terms of features, 1.3 less so in many people's eyes
21:12_ulisesinteresting
21:12seancorfieldbut using the new - well-maintained - modular contrib libs is worthwhile, esp. if you're new to clojure
21:12_ulisesI still need to get around doing that
21:12_ulisesI've been writing clojure code for over a year now
21:12zakwilsonClojure is a new language. Breaking changes are expected in point releases, and I think that's a good thing. The language shouldn't stop evolving in big ways this early.
21:12_ulisesbut most of my code is generally reliant on just the core stuff
21:13zakwilsonChange because why not?
21:13_ulisesis there any doc. I could read on the mapping between old contrib <-> new modular contrib?
21:13zakwilsonYes, but I don't remember where it is.
21:13seancorfieldhttp://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
21:14_ulisesfantastic
21:14seancorfieldif you have any Qs, let me know since i seem to be maintaining that page :)
21:15seancorfieldback in a bit, gotta go feed the kitties...
21:15_uliseswill read it and then come back to you
21:15_ulisesneed some sleep in any case, it's 2:14am over here :'(
21:20sdeobaldJust installed 1.3 for the first time. Is running tests within swank broken now? Getting "No matching field found: getRoot for class clojure.lang.Var" when I try to run my tests in emacs.
21:23duck1123sdeobald: are you using Midje?
21:24cemerickanyone know what happened to the git docs @ http://www.kernel.org/pub/software/scm/git/docs/ ?
21:24cemerickOT, I know. :-|
21:31archaicanyone use org-babel-mode with clojure recently? the org page is out of date and im getting 'org-babel-execute not found for clojure'
21:48seancorfieldcemerick: was just reading http://cemerick.com/ideal-clojure-development-environment/ - looks like it hasn't been updated in a long while?
21:48cemerickquite a long time, yeah
21:48seancorfieldit links to the assembla wiki was my first hint :)
21:48cemerickI had it in mind to maintain a grid of all the various tools and how they fared on each criterion.
21:48cemerickhah
21:48seancorfieldbe nice to see an updated version with your current thoughts, esp. since you're working with CCW so much now...
21:49cemerickBeen using it full time since last fall :-)
21:49seancorfieldit was linked from your recent blog post about richer interfaces in the repl
21:49cemerickI don't think a lot has changed, though I only skimmed it earlier.
21:49cemerickYup, I know.
21:50cemerickIs that your gentle hinting that I should at least get rid of the assembla links? ;-)
21:50brehautcemerick: what were you using before ccw?
21:50cemerickbrehaut: Netbeans + Enclojure
21:55seancorfieldi am liking the memory footprint of emacs compared to eclipse + ccw :)
21:56duck1123So those of you that use eclipse, what do you use to connect to a running clojure process?
21:57duck1123I tried hooking up to a nrepl, but I couldn't figure out how to access my command history
22:04cemerickduck1123: Ctrl-up
22:04cemerickseancorfield: I eliminated the old links, and updated the Netbeans and Eclipse sections at the bottom
22:04duck1123cemerick: didn't work for me on OSX
22:04cemerickoh, right
22:05duck1123Installing on Ubuntu atm
22:05cemerickduck1123: If you have spaces enabled, that binding conflicts with one of its keyboard shortcuts.
22:05cemerickA fix for that is coming in the next release, IIRC.
22:06duck1123cemerick: good to know. I was trying to test it out for a co-worker that I'm trying to get to learn clojure and won't make the jump to emacs
22:07cemericksure
22:07cemerickThe current workaround is to disable spaces, or just change its Ctrl-up keyboard shortcut. :-|
22:07cemerickseancorfield: we've tossed around the idea of producing a Clojure-only Eclipse distribution, which would help there.
22:08brehautcemerick: i could get behind that
22:08duck1123cemerick: putting the update site on the project page would help
22:08brehauteclipse seems even more daunting to me than emacs
22:08cemerickduit's the first "quick link"? http://code.google.com/p/counterclockwise/
22:09cemerickwow, that was a bizarre typo
22:09cemericks/duit/it
22:10duck1123cemerick: what I'm saying is the eclipse update site should be listed there, I had to go to the main documentation
22:11cemerickduck1123: it *is* on that page…
22:11cemerick"Update site: http://ccw.cgrand.net/updatesite&quot;
22:12duck1123hmmm... missed it. I take it back
22:12cemerickNot to say we wouldn't all like a prettier main site. :-)
22:18seancorfieldcemerick: thanx for the updates... "So, except for Enclojure, these are very brief impressions indeed." :)
22:18seancorfieldi know, i'm never satisfied :)
22:32cemerickseancorfield: :-P
22:33cemerickFixed.
22:33cemerickBut then, that page is beyond repair in a sorts of ways anyway.
22:49brehautcemerick: theres nothing like a blog for content rot
22:49brehautexcept maybe a wiki
22:50cemerickwell, it's not a blog post, just a static page
22:50cemerickso, it's even worse :-)
22:50brehauthah :)
22:50cemerickTranslating it to a gdocs spreadsheet shouldn't be too difficult, but I never got around to it
22:53simardhum socket.io or websocket, anyone ?
22:54simard(vs)
22:54simardit seems that chrome and firefox handle websockets differently :S
22:54brehautsimard: it depends which chrome and ffx probably; the spec has changed dramatically in its short life
22:55duck1123aleph handles websockets pretty well
22:56simardbrehaut: and do you know about socket.io ?
22:57brehautsimard: its a wrapper layer right?
22:57simardyeah, it claims to handle websocket on all browsers.
22:57brehaut(designed to work with a node.js backend in particular right)
22:57simardin fact, it does nore than that.. it CAN use websocket, or some other protocol
22:57simard(that's my reading of their website anyway)
22:58brehauti presume they shim it with either long poll or browser specific backends (or flash / java fallbacks) as necessary
22:59simardyeah, and it's probably best like that
22:59simardI had webgl working fine under firefox, and websocket working fine under chrome
22:59simard:)
23:00brehautsimard: yes and no i think; if you just want bidirection messaging, you are probably fine, but i would expect some fun bugs if you were trying to do fast (near real timeish) communication over something that silently picked up a long polling shim
23:00simardI need real time
23:01duck1123the clojure library seems a bit sparse
23:01duck1123for socket.io, that is
23:02brehautsimard: http://caniuse.com/#search=websockets
23:02simardduck1123: hum yeah that's another good point in favor of websocket
23:03simardbrehaut: hum... probably the way I use them doesn't please firefox
23:03brehautsimard: are you on ffx6 + ?
23:03simardI have up to date version of both ff and chrome
23:04duck1123simard: fwiw, I didn't have much trouble getting my simple case working in both using Aleph
23:04simardff 7.0.1-1
23:04simardchromium 14.0.835.202-1
23:04brehautsimard: btw, for your webgl stuff are you doing browser detection or feature detection?
23:04simardbrehaut: not at the moment, no.
23:05simardI've just seen this "Moz" text in the firefox column though
23:05simardthat says I must use a prefix
23:23gsymonsHi...
23:23gsymonsI'm kinda running into a brick wall on what seems like it should be really simple...
23:25brehautgsymons: just go ahead and ask your question, if someone can help they will
23:25gsymonsWhat I want to do is find the first item in a collection that returns true for a predicate.
23:25amalloybrehaut: ibdknox tweaked ~anyone to sound less hostile, so you can probably just use that
23:25brehaut~anyone
23:25clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
23:26brehaut(inc amalloy)
23:26lazybot⇒ 18
23:26gsymonsI looked at some, but it seems that that does a linear search. I'd really prefer to use an ordered collection or map and do a binary search.
23:27amalloygsymons: you can't do that for a general predicate
23:27amalloyif you have an ordered set or ordered map, and you want to look for keys in the right "range", you can use ##(doc subseq)
23:27lazybot⇒ "([sc test key] [sc start-test start-key end-test end-key]); sc must be a sorted collection, test(s) one of <, <=, > or >=. Returns a seq of those entries with keys ek for which (test (.. sc comparator (compare ek key)) 0) is true"
23:30ibdknox_huh
23:30ibdknox_never knew about subseq
23:31gsymonsThat is exactly what I was looking for... thanks.
23:32amalloyibdknox_: it's kinda funny using subseq on a coll that's sorted weirdly. like, i have a set sorted in descending order, so to find the first item less than x, it's like (first (subseq coll > x))
23:32ibdknox_haha
23:33ibdknox_amalloy: I don't think there's a place where I've really needed to use it yet
23:34ibdknox_amalloy: I bet there are some really clever solutions that would involve weirdly sorted collections though...
23:49cemerickSo, who here has complete trust that Google Closure is something that can be relied upon to stick around over the long haul?
23:51sdeobaldduck1123: not midge, just clojure.test (sorry for the slow reply... was at a meetup when I installed 1.3 for the first time)
23:55mrh0057cemerick: I don't see them using anything else for now. I think the real questions when will they wise up and create a VM spec for the browser with all of the major players agreeing on it.
23:56cemerickmrh0057: I mostly agree, though Dart is a wildcard. But still, there's Closure the compiler, and Closure the set of APIs
23:57cemerickThe latter seem particularly vulnerable to a degree of churn that many people wouldn't expect/appreciate, compared to precedents set by e.g. jquery, extjs, etc.
23:57duck1123sdeobald: np. I just saw that issue in migje, but it's fixed in the latest version
23:57duck1123sdeobald: I assume you're using clojure-test-mode, then?
23:58sdeobaldduck1123: yep
23:58duck1123There's a point in the code where it calls .getRoot, should be .getRawRoot now
23:58duck1123I'm pretty sure it was checked in somewhere
23:59sdeobaldduck1123: Ah. clojure-test-mode itself is calling that?
23:59duck1123sdeobald: yes. in the el file, there's a string that has clojure code. change it there