#clojure log - Oct 26 2011

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:00 brehaut: ,(apropos #"^[^*]+\*$")

0:00 clojurebot: (list* with-bindings* bound-fn*)

0:01 brehaut: huh. less than i expected

0:01 or i screwed up my regexp

0:01 aperiodic: is the half-earmuff a common idiom? i've seen it in a few places but i'm not exactly sure what it indicates

0:02 amalloy: brehaut: well, it's not correct in the strictest sense, but i don't think it matters given the names in clojure.core

0:02 tdrgabi: ,(apropos #"\*")

0:02 clojurebot: (*compile-path* list* *3 *2 *ns* ...)

0:02 amalloy: since you'd fail to match on names like mathematical-*-function*

0:02 seancorfield_: i inherited it from c.c.sql so i didn't know whether it was idiomatic or not

0:03 miclorb_: amalloy: thanks for (list*) pointer - handy !

0:03 technomancy: seancorfield: it's fine

0:03 brehaut: ,(apropos #"^[^*].+\*$") ; amalloy, better?

0:03 clojurebot: (list* with-bindings* bound-fn*)

0:03 seancorfield_: i kinda got the impression that folks used it where they had some macro foo, that was implemented with a function foo*

0:04 but the library coding guidelines say to write functions first and add macros only where they help with use

0:04 amalloy: brehaut: yeah, though you still miss functions like f*

0:04 seancorfield_: which would speak _against_ foo* functions

0:04 brehaut: amalloy: now i have two problems

0:04 amalloy: *chuckle*

0:05 seancorfield_: ,(apropos #"^[^*].*\*$")

0:05 clojurebot: (list* with-bindings* bound-fn*)

0:05 seancorfield_: i see no f* :)

0:06 oh great, now i'm reading email in evolution and i want to press C-v to page down... *sigh*

0:07 ibdknox_: in Korma I used select* and so on for the function equivalents of macros

0:07 technomancy: seancorfield_: you were warned this might happen, right? =)

0:07 seancorfield_: I highly recommend http://conkeror.org

0:08 because a browser that doesn't have dotfiles is hardly a browser at all

0:08 ibdknox_: technomancy: lol, did you go to that link?

0:09 technomancy: [Errno 122] Disk quota exceeded:

0:09 :D

0:09 technomancy: ibdknox_: oh noes!

0:09 aperiodic: seancorfield_: i've seen it used in that general pattern, but where both foo and foo* are functions

0:10 * brehaut wishes we could use primes in symbol names

0:12 aperiodic: i dunno, primes can be overlooked much more easily than stars

0:16 jkkramer: &(let [a' 1] (inc a'))

0:16 lazybot: ⇒ 2

0:17 brehaut: jkkramer: how long has that been the case?

0:17 jkkramer: brehaut: since 1.3

0:17 brehaut: aha!

0:17 (inc jkkramer)

0:17 lazybot: ⇒ 2

0:17 jkkramer: because of ##(doc +')

0:17 lazybot: ⇒ "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Supports arbitrary precision. See also: +"

0:18 brehaut: so is +' 1.2's + ?

0:19 ##(doc +'')

0:19 lazybot: java.lang.RuntimeException: Unable to resolve var: +'' in this context

0:19 brehaut: oh. haha

0:19 ##(doc +)

0:19 lazybot: ⇒ "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"

0:37 mindbender1: please can someone recommend the best way to manage images on a website for someone who wants to operate something like a social network

0:45 technomancy: if you use the actual unicode prime mark it works in 1.3

0:45 1.2 rather

0:47 apostrophes are for weaklings

0:48 aperiodic: ,(let [☃ :frosty] (print-str ☃))

0:48 amalloy: technomancy: it's also a big savings on source-code size since you can use ⁗ instead of '''' for very-internal functions

0:48 clojurebot: ":frosty"

0:49 aperiodic: awesome

0:51 ,(let [☃ "frosty"] (print-str ☃ "the" '☃))

0:51 clojurebot: "frosty the ☃"

1:13 seancorfield_: i liked the trick posted on the ML to allow code that needs +' etc to work on both 1.2 and 1.3...

1:13 (def plus (first [+' +]))

1:13 on 1.2, that parses as [+ '+] and yields +

1:14 on 1.3, it parses as [+' +] and yields +'

1:14 helped me get clojure.math.numeric-tower passing the test suite on 1.2!

1:14 amalloy: seancorfield_: you're welcome :)

1:15 seancorfield_: sorry, couldn't remember who posted it

1:16 hope i credited you in the code :(

1:16 amalloy: heh

1:18 seancorfield_: apologies... i did not credit you... i'll add that next time i touch that code...

1:19 amalloy: seancorfield_: no worries

1:28 i signed the CA, rich probably owns any code i write for the rest of my life anyway

2:27 spoon16: best way to go from (\a \b \c \d \e \f) -> ((\a \b) (\c \d) (\e \f))

2:27 ?

2:27 amalloy: &(doc partition)

2:27 lazybot: ⇒ "([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

2:27 mbac: yeah that

2:34 hiredman: partition-all

2:34 partition will bite you

2:37 amalloy: ah, good point. i use (partition 2 1 coll) so often that i forgot (partition 2 coll) has gotchas

4:32 kzar: I'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?

4:41 Or, 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?

4:44 Best I can figure is to do do (take 200 (line-seq rdr)) and then join lines back up again, seems crap though

4:45 tsdh: Hi. 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

4:45 reimplement all the stuff using javax.xml.streams?

5:09 raek: kzar: 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)

5:10 (those classes have annoying constructors, so clojure.java.io makes it much simpler to "just get a stream")

5:10 kzar: raek: 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))))

5:10 raek: 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

5:10 raek: kzar: what kind of unit of data are you interested in? bytes, chars or lines?

5:11 kzar: raek: 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

5:12 raek: kzar: https://gist.github.com/661631

5:12 those examples give you a sequence of bytes or characters

5:14 kzar: 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

5:14 so don't be afraid to dive into the java stuff when doing IO

5:15 kzar: raek: Aha, gotya. So really I can take line-seq source and add in a limit like you've done in those examples

5:15 raek: oh, the first example has a bug...

5:16 I haven't exactly added a limit

5:16 (take n lazy-seq-of-something) would be to add a limit

5:16 kzar: raek: Oh wait, as well the thing I'm using it for expects something like a reader. Surely a lazy seq doesn't help me

5:17 raek: if 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

5:17 (plus some extra chars, depending on the buffer size it uses internally)

5:18 kzar: 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

5:19 kzar: a lazy seq is like an immutable and persistent version of a stream or iterator

5:22 kzar: so, to add a limit in clojure-land you just use 'take'. in java-land you implement a wrapper class for Reader.

5:24 kzar: raek: 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

5:26 robermann: kzar: you could use a BufferedReader

5:27 http://download.oracle.com/javase/6/docs/api/java/io/BufferedReader.html

5:27 kzar: robermann: Yea I am but I need a limit to what it reads, so I'm making a proxy of it to add the limit

5:27 robermann: Otherwise the things that uses it grabs too much and dies

5:27 raek: calling 'clojure.java.io/reader' will wrap the reder in a BufferedReader automatically

5:28 robermann: you coud call the constructor with the size limit

5:28 raek: (buffered reader is what gives you the readLine method)

5:28 robermann: and exit on the first .read

5:28 or http://download.oracle.com/javase/6/docs/api/java/io/BufferedReader.html#read%28char[],%20int,%20int%29

5:28 read just a chunk of an array

5:29 when that read returns, you can throw away your BufferedReader

5:32 probably the problem is not the bufferedreader, but the destination string which is going too long

5:32 kzar: robermann: Yea but I can't change that part

5:32 Well 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)))))

5:32 pretty shoddy I know!

5:37 Blkt: good morning everyone

5:38 kzar: raek: Defo going to do a bit of reading on proxies and things soon though, can't keep bodging my way along!

5:40 raek: kzar: well that code does what it supposed to do...

5:41 the only improvement you get from making a custom Reader implementation is more laziness

5:41 which maybe is not that big deal for a fixed size sequence

5:48 kzar: raek: 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!

6:25 Arafangion: kzar: Which html parser?

6:28 kzar: Arafangion: 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

6:29 Arafangion: 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

6:29 Arafangion: kzar: That's the trouble with html. :/

6:30 kzar: Arafangion: Yea, on the plus side though the html parser didn't bawk when the file is truncated so my hack works

6:30 Arafangion: kzar: Nasty. ;)

6:33 erldave: is this the right place to ask general programming questions on clojure? or is there a different channel?

6:36 ejackson: erldave: this is the place, although the time is often later once the US has awoken :)

6:37 erldave: my question is pretty basic: trying to work out how I should re-code this kind of java style idiom

6:37 java: class MyObjectCollection { Map<String, Object> all; public void add(String key, obj).... public Object get(String key) }

6:38 create one of those, use it to keep a big collection of objects / clojure maps

6:38 Arafangion: erldave: What's wrong with a Map?

6:38 erldave: in clojure, would you do this using atoms?

6:38 ejackson: erldave: it depends entire on your concurrency needs

6:38 erldave: where does the map live?

6:38 I have no concurrency req at the moment

6:38 ejackson: if there is no concurrency that an atom is an nice easy choice

6:39 its the closest thing that Clojure has to a 'variable'

6:39 erldave: so 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?

6:39 ejackson: yup.

6:39 erldave: cool, this is my first venture into writing any actual code, so didn't want to get step one completely wrong :-)

6:39 ta

6:39 ejackson: there is no wrong.

6:40 not on the first step anyway

6:40 erldave: really, I've seen plenty of (java) code that would indicate that statement is not accurate

6:40 ejackson: :)

6:42 erldave: 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.

6:42 no need for fancy footwork

6:43 erldave: yep, I was thinking more of the reading functions iterating over the whole map to filter the (complexish) contents

6:44 so I guess they could just work on the deref'd atom

6:45 I'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...

6:45 ejackson: zakly

6:45 enjoy, enjoy.

6:45 erldave: thanks

7:09 kzar: I'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

7:09 command that runs some part of my code in the existing java process?

7:17 erldave: do you mean you want to run your process as a daemon, i.e. in the background?

7:18 kzar: erldave: I want a shell command that runs some code in my project, in the already running process containing the webserver

7:19 erldave: have you considered using http://clojuredocs.org/swank-clojure/swank.swank/start-repl in your running code?

7:19 then you could attach to that and run your code

7:20 although it opens a big door, you'd want to be very sure that nobody else had access

7:20 cemerick: Running a repl server with an appropriate firewall and an ssh tunnel is perfectly pleasant.

7:38 kzar: erldave: Hmm but I need to trigger the code from a shell command

7:51 Hmm 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

8:39 gensym``: Moinsen

8:39 (wrong channel)

9:10 lucian: i'm spoilt by python's stack traces. is there something equivalent for clojure@

9:10 telling me there's a nullpointerexception somewhere in my program doesn't help

9:11 llasram: lucian: https://github.com/mmcgrana/clj-stacktrace can help

9:11 (I'm assuming you're running in a raw REPL and not in SLIME via swank or such?)

9:12 lucian: llasram: yeah, raw repl

9:13 hmm, it assumes a project

9:13 llasram: haven't gotten around to setting up emacs with clojure and a good vim mode

9:17 raek: lucian: in a raw repl, type (.printStackTrace *e) to get the stack trace

9:21 that should give you source file and line numbers too

9:39 Arafangion: lucian: I use vimpulse, but evil's the hot new kid.

9:40 lucian: Arafangion: i tried evil, seems nice. but it appears i'll have to learn some emacs commands for things like clojure

9:40 Arafangion: lucian: You should, but at least with vimpulse, you don't have to make a completely clean break.

9:41 lucian: Also, evil gives sane buffer switching.

9:41 lucian: with evil, you just press ctrl-z to go to emacs-mode

9:41 and i noticed i can just do alt-bla directly from insert or normal mode

9:41 Arafangion: Same - evil is basically vimpulse revised.

9:41 lucian: sane buffer switching sounds good

9:42 Arafangion: Also, unlike vim, emacs won't hang while trying to syntax colourise your text. :)

9:54 lucian: Arafangion: heh

9:55 Arafangion: it still hangs while package.el fetches things

9:57 Arafangion: I haven't gotten that far with my emacs education :)

9:57 But vim would regularly hang while editing or loading files. :(

10:00 mindbender1: please 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:01 I'm using emacs-snapshot

10:04 jweiss: I 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:05 lucian: Arafangion: oh, it's not far. i was looking for packages, and google got me to marmalade (package repo)

10:39 odd. 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:40 jweiss: lucian: i think that's because 4clojure is in a 'jail' environment where it won't let you wreak havoc with the host system

10:41 lucian: jweiss: i know that, but i can't see what i'm doing wrong

10:42 https://gist.github.com/1316540

10:42 i can't see where i'm turning vectors into maps

10:44 jweiss: lucian: me either :)

10:45 lucian: maybe card fn is being called with a single string instead of a list

10:45 or other way around

10:47 bhenry: ,(let [s (first "D5") r (last "D5")] [s r])

10:47 clojurebot: [\D \5]

10:47 lucian: jweiss: hmm. afaict it's being called with strings

10:47 jweiss: i want to split the string in two http://www.4clojure.com/problem/128

10:51 jweiss: lucian: i tried putting the calc of suit and rank in the let, and just plugging the values into the map literal

10:52 then it gives "You tripped the alarm! catch is bad!"

10:53 https://gist.github.com/1316582

10:53 sorry for ugly indenting

10:57 bhenry: jweiss that's only because it makes the catch trip the alarm before it gets to the error.

10:58 jweiss: bhenry: so the error is in constructing the map literal then?

10:58 bhenry: apparently

10:58 can't tell you why though

10:58 lucian: hmm

10:59 jweiss: maybe the catch inside the literal just hides the real problem, which is the catch

10:59 lucian: jweiss: precisely, it seems

10:59 changed to hash-map and now it tells me catch is bad

11:00 bhenry: i did it without catch and get the same error.

11:01 i just converted 2-A characters to the appropriate rank inside case, and it still did the same thing.

11:03 jweiss, lucian: my fn works in my repl, but not in 4clojure

11:04 https://gist.github.com/e4c60f16c99ea9b30bb7 works in emacs repl. fails with 4clojure error that lucian first saw

11:04 lucian: bhenry: same for mine

11:05 ok, that's just weird

11:08 it would appear that 4clojure bans returning maps

11:10 dpritchett: Has 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:11 lucian: dpritchett: they usually require migration before anything like that. but clojureql seems general enough to handle anything

11:11 dpritchett: thanks lucian

11:12 i'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:23 kzar: Can 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:24 cemerick: kzar: certainly

11:24 (defmethod other-ns/multimethod :dispatch-val …)

11:26 kzar: cemerick: Oh cool :)

11:31 pjstadig: you would still have to (require other-ns) or (use [other-ns :only multimethod])

11:32 * pjstadig <- captain obvious here

11:32 lnostdal: wierd .. enlive strips the xmlns away from the html tag here

11:35 kzar: lnostdal: I saw it mentioned somewhere that namespaces aren't supported

11:35 pjstadig: thanks, good point

11:37 lnostdal: kzar, ok, yeah, i tried loading the resource using xml-resource instead of html-resource .. that seems to not strip it away

11:38 kzar: lnostdal: Yea, just found it at the bottom of the github page: "No namespaces support (hence unsuitable for most XML)"

11:40 zilti: I 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:45 simard: is there a gain when running clojure on a 64 bits jvm instead of a 32 bits one ?

11:49 jweiss: is add-watch really still alpha? or i should ask, is it unwise to rely on it still?

11:52 duck1123: simard: there's a gain if you want to use a whole bunch of memory

11:53 jkkramer: zilti: that's map destructuring. it expects something like (custom-dialog :width 400 :height 400 :visible? true :modal? true)

11:57 llasram`: 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:10 AWizzArd2: For 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:11 scgilardi: https://github.com/technomancy/leiningen/issues/211 may have a pointer to useful info

12:15 AWizzArd2: scgilardi: 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:16 duck1123: you might also be able to pull something off with ~/.m2/settings.xml leiningen uses that, right?

12:18 AWizzArd2: I could also try to make a host entry that blocks central.

12:22 duck1123: so was :omit-default-repositories true not working for you?

12:22 https://github.com/technomancy/leiningen/blob/1.x/sample.project.clj#L122

12:28 AWizzArd2: It works for me. But I don't want it to go to central.

12:28 I want it to only go to my Artifactory repo.

12:29 But 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:30 simard: when 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:31 duck1123: AWizzArd2: Artifactory should give you some code you can put into the m2 settings, I'd start there

12:31 simard: lol, ok forget it, I'm wrong

12:35 technomancy: kzar: if you're still figuring out lein run, you can set LEIN_NO_DEV to keep dev deps and test/ off the classpath

12:37 kzar: technomancy: 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:37 technomancy: yeah, you need to start a repl listener if you want it to be in the same process

12:37 maybe jark could do that

12:38 duck1123: I 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:38 kzar: Hey 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:41 duck1123: kzar: when dealing with side effects and lazy seqs, chunking is probably going to kill you

12:41 kzar: duck1123: How do you mean?

12:42 duck1123: kzar: this might help https://github.com/duck1123/ciste/blob/master/src/ciste/routes.clj#L8

12:42 kzar: there's the posibility that more records will be realized than you actually want

12:43 although I don't know if repeatedly does that

12:45 I 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:46 llasram`: `repeatedly' doesn't appear to produce a chunked seq

12:46 ,(let [x (atom 0)] (dorun (take 10 (repeatedly #(swap! x inc)))) @x)

12:46 clojurebot: 10

12:46 llasram`: But still, probably not best practice to depend on that

12:47 daaku: is there a way to break a regex specified using #"xx"? i'm a bit pedantic about 80-col

12:47 s/break a regex/break a regex into multiple lines/

12:48 duck1123: daaku: you could str a bunch of segments together, then compile the result as a pattern

12:49 ,(doc re-pattern)

12:49 clojurebot: "([s]); Returns an instance of java.util.regex.Pattern, for use, e.g. in re-matcher."

12:50 daaku: cool, thanks duck1123

12:59 duck1123: I'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:00 ibdknox: technomancy, ping

13:00 chouser: daaku: #"(?x) .... whitespace ignored in here, should be able to line-wrap"

13:00 technomancy: ibdknox: what are the haps

13:02 ibdknox: technomancy, this issue is cropping up with people trying to do file uploads with noir: https://github.com/technomancy/leiningen/issues/262

13:02 technomancy, and I didn't fully understand what the fix was

13:02 technomancy: ibdknox: was basically fixing just that bug.

13:02 ibdknox: technomancy, awesome, so they just need to upgrade lein?

13:02 technomancy: if they're seeing it in then it means someone else is peeing in the thread pool

13:02 yeah

13:03 ibdknox: fantastic

13:03 technomancy: I'll add a comment to that specific issue

13:03 ibdknox: technomancy, thank you sir :)

13:03 technomancy: np

13:08 kzar: So 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:15 daaku: chouser: 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:17 chouser: daaku: you need the leading (?x), after which whitespace (and regex comments) are ignored

13:17 oh, sorry

13:17 llasram`: kzar: one namespace does defmulti, other namespaces defmethod, then a final namespace to pull in defmulti and defmethod namespaces?

13:17 chouser: hang on

13:20 duck1123: cyclical dependencies are clojure's way of telling you that you that you're not using enough namespaces

13:21 dnolen: duck1123: or that you have too many ;)

13:23 duck1123: kzar: 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:24 chouser: daaku: you have to escape the #'s, since they're being understood as comment-to-end-of-line

13:24 daaku: replace every # with \# and you'll be all set

13:26 daaku: chouser: you sir are awesome

13:26 chouser: thank you

13:27 chouser: daaku: np

13:28 though I have to say -- a regex being multiline is probably a little hint that you should be solving your problem a different way.

13:33 michael_campbell: jwz's quote comes to mind.

13:33 TimMc: 2 problems?

13:33 michael_campbell: exactly

14:23 zilti: I 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:23 licenser: zilti: reduce?

14:24 zilti: licenser: Thanks!

14:24 raek: (reduce f 0 [1 2 3 4]) is the same as (f (f (f (f 0 1) 2) 3) 4)

14:24 licenser: :)

14:25 zilti: :)

14:25 raek: so you might need to flip the argument order

14:26 zilti: No need for that in my case, the order doesn't matter

14:26 licenser: is fun + :)

14:26 zilti: But good to know

14:27 TimMc: zilti: What are you doing with the map?

14:27 There may be a better way to do what you want to do.

14:29 zilti: TimMc: What alternatives are there?

14:32 raek: if mp is {} and fun is (fn [m x] (update-in m [x] (fnil inc 0))), you can use frequencies instead

14:32 zilti: TimMc: 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:36 kylpo: ibdknox: Where do you work again? I don't see it on your blog.

14:37 ibdknox: kylpo, ReadyForZero

14:37 kylpo: ibdknox: thanks

14:38 ibdknox: Oooh, has it switch off of Django and onto Noir?

14:39 ibdknox: launching tomorrow :)

14:39 so yep

14:42 jodaro: nice

14:43 ibdknox: I've built several other sites with Noir though, outside of just ReadyForZero's

14:43 jodaro: oh hey, you guys are near me

14:43 i'm at 2nd and folsom

14:43 ibdknox: haha

14:43 sweet

14:44 jodaro, where do you work?

14:44 jodaro: symantec

14:44 "messaging and web security" group

14:44 or whatever the hell they've decided to call it this week

14:44 ibdknox: lol

14:45 jodaro, we're hiring, if you want to move down the road ;)

14:45 technomancy: so can someone explain to me the actual problem that your typical "clean" task is meant to solve?

14:45 (leiningen or otherwise)

14:45 jodaro: rm -rf

14:45 ibdknox: technomancy, old versions of generated files sticking around for whatever reason

14:46 jodaro: except the good parts

14:46 technomancy: ibdknox: right, but I need more detail on "for whatever reason" =)

14:46 because it seems like the kind of thing you shouldn't have to worry about

14:46 moomin: I'm a bit puzzled about the behaviour of non-dynamic vars. How come alter-var-root works, but nothing else does?

14:46 chouser: frequently clean is used to cover errors in dep rules

14:46 jodaro: makes more sense in like c/c++ builds

14:46 pjstadig: there are also packaging files generated

14:46 jodaro: remove all the .o and whatnot

14:46 technomancy: we 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:46 pjstadig: that you may want to delete

14:47 jodaro: i guess .class files too, yeah

14:47 technomancy: pjstadig: I don't understand why that should be conflated with bytecode though

14:47 it seems like they are separate issues

14:47 pjstadig: sure, but usually a clean task cleans everything

14:47 technomancy: pjstadig: yeah, right now it is totally a cargo-cult thing

14:47 "clean does this because clean has always done this"

14:48 jodaro: tradition!

14:48 technomancy: jodaro: I read that as being sung a la Fiddler on the Roof

14:48 I hope that's what you intended

14:48 jodaro: exactly what i intended.

14:48 hiredman: moomin: nothing else meaning, what? binding? that is exactly what non-dynamic means, no binding

14:48 jodaro: i even stood on my desk and yelled it in my best yiddish accent

14:49 now my coworkers are afraid

14:49 todun: help: is there a way to pass a symbol from a function to a macro? As an example, http://pastebin.com/JCg7MfUS thanks.

14:49 zilti: technomancy: 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:49 hiredman: now break in to "if I were a rich man..."

14:50 technomancy: zilti: yeah, it definitely gets confused; am working on a fix for that in 1.6.2

14:50 jodaro: extra style points for you!

14:50 jodaro: hiredman: i like to change it to "when i am a rich man ...", the power of positive thinking

14:50 moomin: Sorry, yes. I think I just don't understand why alter-var-root still works.

14:50 I'd have assumed it meant that you couldn't remap the var to anything else.

14:51 hiredman: it means you can only change the value of the var globally

14:52 moomin: Ah, so it simply means no per-thread bindings.

14:53 hiredman: well per thread bindings are dynamic scope, so removing that gives you non-dynamic vars

14:53 moomin: Ah ok.

14:53 Is there an easier way to redefine a var than alter-var-root?

14:54 hiredman: don't

14:54 duck1123: if you alter-var-root a ref while another thread is in a dosync, does that thread still get consistent values?

14:54 hiredman: alter-var-root and friends should really only be used in tests for mocking/stubbing

14:54 moomin: That's exactly what I'm trying to use them for. :)

14:55 hiredman: 1.3 comes with a with-redefs you might find useful then

14:55 ,(doc with-redefs)

14:55 clojurebot: "([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:55 pjstadig: duck1123: alter-var-root is for vars, when using a ref you would use ref-set, which is transactionally safe

14:56 moomin: Ah, perfect.

14:56 Hadn't understood the distinction between bindings and redefs. Thankyou very much.

14:58 duck1123: pjstadig: 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:59 I'm thinking no, which is all the more reason why altering vars like that can be dangerous

15:10 fdaoud: jimduey: I listened to your talk about monads. Thanks for pointing me to it, it was excellent!

15:11 jimduey: thanks for the compliment. feel free to hit me up if you have any questions.

15:11 fdaoud: I do have one question if you have a minute

15:11 jimduey: sure

15:12 fdaoud: there 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:12 when 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:13 it seems that the half-double and increase functions did have to be rewritten to use (hash-set ...) instead of (list ...)

15:13 I would have thought those functions were part of the code that wouldn't have to be changed..?

15:13 TimMc: todun: Macros rewrite syntax, they don't accept runtime values.

15:14 todun: TimMc: ok. thanks. So there is no way to achieve the same goal?

15:14 TimMc: todun: I couldn't understand your paste, so I don't know.

15:15 todun: TimMc: the code example or my question?

15:15 jimduey: fdaoud: you might be able to get a way with not changing those since both the set and the list have list interfaces.

15:16 but you're right, it would probably be more correct to change those as well.

15:16 the point I was shooting for was you didn't have to change the structure of the domonad forms.

15:17 fliebel: Is there any Clojure lib for interacting with IMAP and SMTP?

15:17 fdaoud: jimduey: understood. thanks! this is really interesting, and I am particularly intrigued by your Ring experiment.

15:18 Ring is a great example for us web developers because it gives us a concrete and practical example that we can relate to

15:18 manutter1: fliebel: do you want to read email or just send it?

15:19 jimduey: I 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:19 fliebel: manutter1: read, move, send, the whole thing.

15:20 manutter1: I've been playing with writing one, but so far only the "send email" bit actually works

15:20 duck1123: fliebel: did you see this? http://nakkaya.com/2010/04/15/using-clojure-to-connect-to-gmail-via-imap/

15:20 jimduey: fdaoud: 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:21 fliebel: duck1123: Yes. I'll save that for future reference.

15:21 manutter1: Is it on GH?

15:22 fdaoud: jimduey: excellent

15:22 manutter1: fliebel: yes, https://github.com/manutter51/nonomail

15:22 fliebel: jimduey: What do I need to read to understand Ring handlers in monadic form?

15:22 manutter1: duck1123: cool, I can use some of that info myself

15:23 nakkaya.com has some good stuff

15:24 fliebel: manutter1: Cool. I'll keep that in mind. Maybe I'll contribute a bit later, you never know.

15:24 manutter1: that would be cool

15:29 fliebel: First 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:30 jimduey: fliebel: 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:31 I talk a little about monadic Ring at the end of it.

15:32 Here's where I did some work in that direction: https://github.com/jduey/ring

15:32 fliebel: jimduey: Link?

15:32 jimduey: http://www.infoq.com/presentations/Monads-Made-Easy

15:33 fliebel: jimduey: Thanks. Where is Louisville?

15:33 manutter1: shoot it was there a second ago...

15:34 :)

15:34 Ok, actually, it's in Kentucky USA

15:35 * manutter1 watching Monads Made Easy now -- cool stuff

15:42 fliebel: &((comp inc +) 1 1)

15:42 lazybot: ⇒ 3

15:43 cemerick: FYI: Enabling rich(er) interactions in the Clojure REPL: http://wp.me/p10OJi-cc

15:43 fdaoud: manutter1: I just got your joke, ha ha :)

15:43 manutter1: :)

15:43 * cemerick would love to be beat upon by other tool developers so as to get the above up to fighting weight

15:44 Raynes: cemerick: The fact that you referenced Factor made me all tingly inside.

15:44 cemerick: :-)

15:44 Big inspiration in this area.

15:44 Raynes: Factor's documentation is insanely awesome.

15:45 cemerick: Outpaces Racket, AFAIK.

15:45 'course, the last time I used it, it was DrScheme

15:46 fliebel: cemerick: information overload! I can't learn monads and nREPL at the same time and hear about Factor still.

15:48 phf: is 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:49 ibdknox: cemerick, given my background, I'm really excited to talk about dev tools at the Conj

15:49 cemerick: fliebel: Maybe I should have implemented the new nREPL feature using monads? :-P

15:49 fliebel: cemerick: In Factor!

15:49 cemerick: ibdknox: Rock. It's going to be my primary Clojure focus for 2012, I think.

15:50 arohner: cemerick: your video/site eats my mouse cursor while the tab is open. OSX + chrome

15:50 cemerick: huh

15:50 arohner: it's wordpress.com and vimeo; I'm not sure I can do anything about it :-/

15:51 arohner: Can't replicate. Sorry, in any case.

15:52 arohner: cemerick: np. It's probably chrome + vimeo's fault

15:52 cemerick: "I'm having a problem in Chrome." "What vers…oh, nevermind."

15:52 fliebel: jimduey: Why rename all that stuff?

15:53 arohner: cemerick: true, but it is a nice experience for the user when things work

15:53 cemerick: agreed :-)

15:53 arohner: "I'm having a problem in Chrome. When will it be fixed?" who knows

15:54 Anyone have experience with "com.sun.jdi.IncompatibleThreadStateException" when trying to use CDT?

15:54 ibdknox: cemerick, my non-compete will fall out of effect in december... then I can hack on a Clojure IDE all I want :D

15:54 jimduey: fliebel: what stuff? shoot me an email and I'll get back to you later this evening.

15:54 ibdknox: cemerick, so I'd probably be very interested in helping out

15:54 cemerick: ibdknox: A non-compete that impacts Clojure tool development?

15:54 fliebel: jimduey: nvm, aliasing mapcat

15:55 ibdknox: cemerick, I was one of the primary interaction designers for VS

15:55 * amalloy looks forward to ibdmacs

15:55 cemerick: ah-ha

15:55 Raynes: ibdknox: That's one hell of a non-compete.

15:55 cemerick: ibdknox: I have some ideas for you. :-)

15:55 amalloy: it seems pretty reasonable, insofar as non-competes are ever reasonable

15:55 ibdknox: lol yeah

15:56 * cemerick thought they were completely unenforceable in CA?

15:56 ibdknox: I doubt they'd come after me

15:56 but still..

15:56 I was in Seattle

15:56 cemerick: Yeah, no point in taking a risk over 3 months

15:57 Raynes: cemerick: 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:57 ibdknox: haha

15:57 cemerick: nice

15:57 * Raynes files his fingernails.

15:57 technomancy: phf: there's not really any good way; you have to choose between being set up for CL or Clojure

15:57 amalloy: technomancy, phf: doesn't scottj claim he does this all the time?

15:57 brehaut: ibdknox: brave announcing that to the wide world ;)

15:57 cemerick: ibdknox: I got the impression you were partial to emacs though?

15:57 Raynes: Nope, Vim.

15:57 technomancy: amalloy: yes, but he doesn't claim he has a good solution. =)

15:57 ibdknox: cemerick, I use vim :D

15:58 Raynes: He is a masochist. Likes it rough.

15:58 cemerick: brave, brave mutha :-)

15:58 brehaut: Brave? VS is legendary for being the benchmark of tool usability.

15:58 (mainstream tools, anyway)

15:59 fliebel: VS?

15:59 clojurebot: http://groups.google.com/group/clojure/msg/fd0371eb7238e933

15:59 brehaut: ibdknox: that explains a lot about VS then :P

15:59 ibdknox: Visual Studio

15:59 Raynes: fliebel: Visual Studio.

15:59 ibdknox: I demand that you remove yourself from my head.

15:59 ibdknox: haha

15:59 brehaut: cemerick: its a mainstream tool for mainstream tools ;)

16:00 ibdknox: haha

16:00 well

16:00 to be fair

16:00 brehaut: cemerick: i found it clunky up to 2010

16:00 ibdknox: the stuff I worked on hasn't seen the light of day yet

16:00 brehaut: cemerick: exception being the F# stuff, thats great

16:00 ibdknox: brehaut, it's terrible IMO ;)

16:01 and they did a bastardized version of what I designed for the next version :(

16:01 brehaut: ibdknox: based on VC++ 6 or whatever, 2003 - 2008 are amazing

16:01 cemerick: I'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:01 brehaut: ibdknox: :(

16:02 ibdknox: that's ok, we can do awesome things for Clojure :D

16:02 though, that's something I definitely can't accomplish on my own.

16:02 brehaut: cemerick: 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:02 ibdknox: we'll be a far cry from VS, but even 1% the size of VS is GIGANTIC

16:03 cemerick: ibdknox: 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:03 simard: perhaps debugging for clojure would be a nice start :)

16:03 a debugger*

16:03 phf: technomancy: that's sad :( is that a permanent direction of things now?

16:03 cemerick: Of course, that doesn't help out with the client-specific, interaction types of things.

16:03 brehaut: simard: you have print‽ what more could you want!

16:03 technomancy: phf: it's an unavoidable side-effect of the fact that the slime devs refuse to make stable releases.

16:04 cemerick: simard: I think there's a lot of lower-hanging fruit that can (and should) be knocked out first.

16:04 At least, that's what I'm going to focus on.

16:04 amalloy: technomancy: s/stable//

16:04 technomancy: phf: with a lot of work we could update swank-clojure to work with upstream slime, and then it would break soon later.

16:04 amalloy: =(

16:05 chouser: nREPL is roughly in the same solution space as slime, is that correct?

16:06 technomancy: chouser: yeah, basically.

16:06 cemerick: no, it's corollary is swank

16:06 technomancy: though to be pedantic, slime is a client, so nrepl is more like swank.

16:06 heh

16:06 chouser: ah, I thought slime was the server. sorry

16:06 * fdaoud grabs some popcorn and watches the great minds joust.

16:06 simard: brehaut: 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:07 phf: technomancy: i see. i guess heller is not the easiest person to work with, but further fragmentation of lisp community is unfortunate

16:07 technomancy: yeah, it's a shame. there are things you can do; maybe scottj can comment further.

16:07 cemerick: Is there a unified lisp community? Sorta like talking about an algol community.

16:08 technomancy: he's one of the only folks still interested in CL around here

16:10 brehaut: cemerick: the rich interactions vid is great btw

16:11 cemerick: Thanks. Thought it might have been a little weak, actually.

16:11 brandel: if 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:11 cemerick: The ccw UI for it is nonexistent at the moment. :-P

16:11 phf: technomancy: ok, thank you

16:12 jodaro: brandel: the simple/easy talk?

16:12 brehaut: cemerick: mucking round with the config for the repl in the repl is pretty cool :)

16:12 cemerick: It needs a decent drop-down so you can choose among the different representations you want to opt into, at the very least.

16:12 brandel: not certainly jodaro

16:12 err certain

16:13 jodaro: http://www.infoq.com/presentations/Simple-Made-Easy

16:13 brandel: I'll watch that - I see it's on InfoQ

16:13 yep cheers

16:13 cemerick: brehaut: 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:13 brehaut: ah true

16:13 progress is progress

16:14 Raynes: cemerick: I'm on the phone with PETA. They want your address.

16:14 brehaut: i now regret jumping back into emacs; i could have jumped into new ccw!

16:14 dpritchett: anyone using M-x clojure-jack-in lately?

16:14 the last time i looked this was durendal.el

16:14 Raynes: brehaut: Bite your tongue!

16:14 dpritchett: now 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:14 Did I miss a step?

16:14 cemerick: brehaut: Just keep an eye out. I'm far from done. :-)

16:14 technomancy: dpritchett: maybe you got an older clojure-mode from elpa instead of the latest one from marmalade?

16:14 dpritchett: probably

16:15 i haev 1.7.1, i'd love to know how to fix that

16:15 cemerick: though cgrand and lpetit did a killer job on sprucing up the editor lately

16:15 dpritchett: probably shouldn't have tried elpa to begin with

16:15 Raynes: Yeah, that's definitely ancient.

16:15 technomancy: dpritchett: make sure marmalade is on your package-archives source and run M-x package-refresh-contents; then M-x package-install clojure-mode

16:15 dpritchett: i should jsut nuke emacs.d, it's not like i have anything worthwhile there

16:15 cemerick: (the subject of cgrand's talk, actually, IIRC)

16:15 technomancy: or that =)

16:15 jodaro: am i the only one that uses inferior-lisp?

16:15 brehaut: cemerick: the 0.4 release looks very compelling on its own

16:15 jodaro: is that deprecated?

16:15 fdaoud: brandel: that's a great talk for sure, but there isn't much about expressing rules in clojure

16:16 technomancy: jodaro: it's fine. it's not that much simpler than slime anymore now with M-x clojure-jack-in though.

16:16 Raynes: jodaro: Certainly not. Just that using SLIME is just as easy as using inferior Lisp now.

16:16 brehaut: cemerick: is parsley driven largely by ccw atm?

16:16 technomancy: in the past the only reason inf-lisp was supported was because slime was a huge pain to configure.

16:16 jodaro: ok

16:16 cemerick: brehaut: you mean its development?

16:16 brehaut: yeah

16:16 cemerick: I don't know all of Christophe's motivations, but yeah, I know that parsley's latest significant progress was a blocker for ccw.

16:16 jodaro: it's been working great for me so i'll leave well enough alone and keep going

16:17 Raynes: jodaro: Do you use Leiningen or cake?

16:17 jodaro: leiningen

16:17 * Raynes wonders why he was compelled to capitalize 'leiningen' but not 'cake'.

16:17 Raynes: jodaro: lein plugin install swank-clojure 1.3.3

16:18 brehaut: cemerick: one thing ive not been sure about is does ccw support lein projects?

16:18 jodaro: ok let me see

16:18 Raynes: Then, just because I said so, run M-x clojure-jack-in. Just try it once. ;)

16:18 cemerick: brehaut: 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:18 mefesto: When it comes to clojure web frameworks with routing, html templating and form validation is webnoir the place to start?

16:18 jodaro: yeah that works too

16:18 nice

16:19 * ibdknox grins

16:19 * Raynes notes that this stuff works in the latest cake develop branch as well, though you have to add swank-clojure 1.3.3 as a dev dep to your global project instead.

16:19 brehaut: mefesto: a framework is the wrong way to start; theres a handful of good options for all those

16:20 cemerick: brehaut: There's https://github.com/abrenk/lein-eclipse and http://sexp.posterous.com/poor-mans-integrating-leiningen-into-counterc

16:20 both are decidedly suboptimal

16:20 Raynes: jodaro: 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:20 jkkramer: project.clj support and an option to turn off rainbow parens might tempt me away from emacs

16:20 ibdknox: mefesto, 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:20 mefesto: brehaut: 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:21 brehaut: mefesto: have you looked at hiccup and enlive ?

16:21 mefesto: brehaut: recommendations on alternatives?

16:21 brehaut: mefesto: webnoir is a layer ontop of compojure and hiccup

16:22 mefesto: ibdknox: nice tutorial btw :)

16:22 dpritchett: i must have screwed up my marmalade install i guess

16:22 ibdknox: mefesto, thanks :)

16:22 mefesto: brehaut: yeah but it's handy that webnoir has pre-packaged these libs for me

16:23 brehaut: mefesto: if you see value in that, then perhaps it is the right choice

16:26 ibdknox: brehaut, what would make it a lesser choice?

16:27 brehaut: ibdknox: i have a strong preference for web stuff to be closer to the library end of the library / framework spectrum.

16:28 ibdknox: noir is far from a framework in the traditional sense

16:28 it's tiny

16:28 brehaut: ibdknox: indeed :)

16:28 ibdknox: and I agree

16:28 I've built sites with all the big frameworks

16:28 I hated all of it

16:28 lol

16:28 brehaut: ibdknox: i use moustache and enlive because compojure is too frameworky for my tastes ;)

16:28 ibdknox: lol

16:28 brehaut: haha yeah, i write django stuff for my day job

16:29 cemerick: brehaut: wow, that's sensitive ;-)

16:29 I have fond memories of pylons

16:30 fliebel: cemerick: I remember the state monad was mentioned in reference to your config macro. What became of that?

16:31 cemerick: fliebel: I took gfredericks up on his suggestion; it's in clutch HEAD right now.

16:32 fliebel: cemerick: What did gfredericks say?

16:32 cemerick: state (or reader) is a general solution, but isn't dynamic scope, which I still wanted to support

16:33 fliebel: see his comment on the original post (Gary Fredericks)

16:34 dpritchett: am i going to have trouble using emacs 23.1?

16:34 technomancy: dpritchett: should be fine

16:34 24 is nicer mostly since package.el is built-in, but it's not required

16:34 dpritchett: ok, i've just wiped and reinstalled elpa/marmalade about 5x and i haven't figured it out yet

16:35 never had quite such an issue, i must be screwing something up

16:35 jodaro: only 5?

16:35 technomancy: there is an open issue with marmalade that the instructions on the splash page are a bit misleading

16:35 http://code.google.com/p/marmalade/issues/detail?id=20

16:35 dpritchett: so i install elpa the traditional way, paste 5-6 lines of elisp into scratch and C-j eval right?

16:36 technomancy: no, that gives you the old version that can't support multiple sources

16:36 dpritchett: ah

16:36 technomancy: damn thing has been open forever; the marmalade maintainer is basically MIA =(

16:36 dpritchett: so how do i install from the new huge file you link to

16:36 technomancy: and it's implemented in node.js so nobody else dares to touch it

16:36 you don't really need marmalade; just install clojure-mode from git if you're having trouble

16:37 the fact that elpa and marmalade are so neglected just makes me so thankful that clojars works as well as it does.

16:42 fliebel: &(let [[&[bar :as baz]] [1 2 3]] [bar baz])

16:42 lazybot: ⇒ [1 (1 2 3)]

16:42 fliebel: Why is bar only the first value and baz the whole?

16:43 hiredman: cause thats how destructuring works

16:43 Raynes: That's what :as does.

16:43 amalloy: fliebel: because...that's what you destructured it as?

16:43 Raynes: :\

16:43 "Destructure like I just said, but go ahead and give me everything bound to this so that I can use it as well."

16:44 fliebel: ah, right... so...

16:44 &(let [[&[bar & boo :as baz]] [1 2 3]] [bar boo baz])

16:44 lazybot: ⇒ [1 (2 3) (1 2 3)]

16:45 fliebel: :as aplies to the whole thing, not just to bar.

16:45 amalloy: fliebel: what would it mean to just apply to bar?

16:45 scottj: amalloy, technomancy: the way I run slime w/ clojure and CL is pretty simple. I use a version of slime that works with both :)

16:45 hiredman: ~clojure

16:45 clojurebot: clojure is the bestest programming language available.

16:46 simard: scottj: what version is that ?

16:46 fliebel: amalloy: That it's just an alias. But that doesn't make much sense. It just reads like that, and I'm sleepy.

16:47 scottj: simard: I use 10-15-09 but the version technomancy recommends (10-04-09 I think) may work too I haven't tried

16:47 in a couple years that is

16:48 technomancy: oh well; he's gone =\

16:48 I wonder why I get so many people complaining about CL then?

16:48 scottj: I bet a lot are using latest slime

16:48 and some are possibly using swank from latest slime and old slime

16:48 brehaut: isnt that the CLers role in the lisp community ;)

16:49 technomancy: brehaut: bingo

16:49 hiredman: cemerick: http://www.thelastcitadel.com/images/Screenshot-Repl.png

16:49 scottj: and very likely there are bugs that I simply haven't encountered

16:50 cemerick: hiredman: nice :-) That looks familiar…which repl impl is that?

16:50 hiredman: mine

16:50 cemerick: that's what I thought

16:50 hiredman: https://github.com/hiredman/Repl

16:50 technomancy: scottj: actually it may come from the slime-contrib libs too

16:50 hiredman: my first lein project

16:50 cemerick: in-process, I presume?

16:50 hiredman: yes

16:50 you just launch a repl

16:51 scottj: technomancy: the elpa version? I use slime-fancy but I don't use anything from elpa

16:51 cemerick: hiredman: before your time, per usual? ;-)

16:51 scottj: technomancy: of course slime-fancy doesn't include all the sliem-contribs

16:52 hiredman: I dunno about that, the implementation launchs something like 20 threads at start up, which may be over kill

16:52 technomancy: scottj: 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:52 cemerick: ah, the joys of swing

16:52 Seems like a good REPL only needs to ramp up ~15 threads.

16:53 hiredman: the whole thing is a bit of a hack, since no one seems to make a nice simple embeddable rich terminal component

16:54 even getting an embeddable terminal component for a simple gui repl is a pain

16:54 * dpritchett is now attempting to install emacs 24 from github

16:54 cemerick: "rich terminal" is a contradiction in terms for the most part, no?

16:55 * cemerick waits for the screenshots :-)

16:55 scottj: dpritchett: make sure to do make bootstrap, that got me

16:55 dpritchett: scottj, somehow i've managed to fail at "git clone"

16:55 this is a first for me

16:55 i use git pretty regularly too

16:55 technomancy: dpritchett: what OS? it's not hard to find precompiled binaries.

16:55 dpritchett: i'm on ubuntu

16:55 brehaut: git contains traps for plays of any experience level

16:55 dpritchett: i tried the ppa and it wasn't going so well

16:56 technomancy: dpritchett: http://emacs.naquadah.org

16:56 or git clone --depth 1

16:56 hiredman: cemerick: well, a terminal like gui widget that allows for content beyond text

16:56 cemerick: right

16:56 hiredman: my repl there can embed any jcomponent

16:56 cemerick: Eclipse actually gets very close

16:56 technomancy: dpritchett: bit of a yak shave though; manual install of clojure-mode is going to be the path of least resistance

16:56 hiredman: but, well, you need all of eclipse :(

16:57 not terribly reusable

16:57 cemerick: well, for what you want, you just need swt to get the embeddable webkit view

16:57 dpritchett: and 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:57 technomancy: cemerick: are you drawing from that json-powered mac gui-ish terminal that was floating around a while ago?

16:57 fliebel: jimduey: Would there be a monad to handle the asynchronous case well? Like, websockets and stuff.

16:57 cemerick: technomancy: I don't think I saw that.

16:57 hiredman: the termkit

16:57 ~google termkit

16:57 clojurebot: First, out of 3630 results is:

16:57 technomancy: cemerick: probably relevant: http://acko.net/blog/on-termkit

16:57 clojurebot: On TermKit | Steven Wittens - Acko.net

16:57 http://acko.net/blog/on-termkit

16:57 dakrone: ugh, termkit was so ugly

16:57 hiredman: yeah

16:57 technomancy: clojurebot: too slow, bro

16:57 clojurebot: bartj: it's not broken. Unless you know the performance hit there is actually a problem, I'd recommend leaving it alone.

16:57 hiredman: well, but it the right direction

16:58 cemerick: technomancy: thank you, that looks very tasty

16:58 Certainly in the right direction.

16:58 scottj: dakrone: as ugly as xterm?

16:58 technomancy: dakrone: heh; yeah, proportional-width fonts are a real facepalm

16:59 dakrone: scottj: more ugly, at leas xterm is readable

16:59 jodaro: hrm

16:59 cemerick: hey, don't hate on my verdana!

16:59 dakrone: plus, it's built on nodejs

16:59 jodaro: wasn't there a from scratch clojure ide written in clojure?

16:59 cemerick: We'll have to see what I can do about getting the REPL view built on top of webkit in ccw.

16:59 srid: has anyone used aleph to plot real-time graphs?

16:59 technomancy: cemerick: oops; I haven't watched the video yet; it's still downloading. =)

16:59 dakrone: I think we only have to think a moment on marmalade-repo to know how bad of an idea that is

16:59 jodaro: i remember playing with it but i can't remember the name now

17:00 scottj: I 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:00 basically the effects you seen in all hollywood movies

17:00 jodaro: oh clooj

17:01 dpritchett: btw thanks technomancy et al for your patience with my emacs adventuer

17:01 cemerick: So, 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:01 dpritchett: adventure

17:02 technomancy: dpritchett: np. these are still the early days as the package manager is still in the process of getting uptake.

17:03 dpritchett: i 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:03 technomancy: never mind that package.el has been around longer than leiningen; everything just moves several orders of magnitude more slowly than clojure land.

17:07 jweiss: anyone 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:07 cemerick: jweiss: the former

17:07 the latter is the path to insanit

17:07 insanity*

17:07 jweiss: cemerick: yeah that's what I'd rather do, but by what means do i do the diff?

17:08 cemerick: jweiss: clojure.data/diff? http://clojure.github.com/clojure/clojure.data-api.html

17:08 Never used it myself, but fits the bill.

17:12 scottj: images in slime repl http://collison.ie/code/slime-repl-pics.png

17:13 technomancy: scottj: stock slime or patched?

17:13 scottj: technomancy: patched

17:13 technomancy: bummer

17:13 hiredman: oh! are you sure, it seems like the other side of slime can send back "eval in emacs" messages

17:13 so maybe a stock slime could do it

17:14 scottj: yeah, that image is from 3 years ago so something similar might be in slime now

17:14 hiredman: http://www.gnu.org/software/emacs/elisp/html_node/Showing-Images.html#Showing-Images

17:14 technomancy: hiredman: I don't see why not

17:15 hiredman: just that swank-clojure is disgusting :(

17:15 scottj: slime/contrib/slime-media.el

17:15 :display things other than text in slime buffers"

17:16 hiredman: kinda cool

17:16 scottj: s/slime-media/swank-media

17:22 jweiss: cemerick: ah, that clojure.data/diff is great, appears to be 1.3 only, maybe i should just make the move

17:23 hiredman: jump to a snapshot of 1.4

17:23 Raynes: jweiss: 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:24 * hiredman should move clojurebot over

17:24 Raynes: That'd make sense, since lazybot is running 1.3 now. Always good to have different Clojure versions between the bots.

17:24 cemerick: FWIW, I don't think inlining is so critical, if that's an issue.

17:25 jweiss: Raynes: 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:25 hiredman: at least the sandbox, the amount of work to move clojurebot over to post 1.2 is scary

17:25 cemerick: Though I guess there's no latitude for getting slime to send something useful to swank.

17:25 jweiss: i think prxml is the only lib i still need from the old contrib

17:26 cemerick: jweiss: clutch continues to use old contrib for a couple of namespaces that don't have easy corollaries.

17:26 so, it's far from verboten

17:26 * jweiss switches back to my 1.3-migration branch :)

17:26 hiredman: 1.4!

17:26 the alphas are already out

17:27 jweiss: hiredman: what do i get with 1.4 aside from an extra year before my bits rot?

17:28 hiredman: https://github.com/clojure/clojure/commit/b5f5ba2e15dc2f20e14e05141f7de7c6a3d91179 is the big one so far

17:29 using clojure's own hash function which is consistent with equiv for clojure collections

17:29 brehaut: jweiss: http://dev.clojure.org/display/design/Release.Next+Planning

17:29 hiredman: as opposed to .hashCode

17:31 jweiss: hiredman: that doesn't really entice me :)

17:32 hiredman: "this house that has had it's foundation fixed up doesn't entice me"

17:33 jweiss: hiredman: but some of the windows are stuck and cabinet doors are missing.

17:33 (it's alpha after all)

17:34 i'm happy that the foundation is fixed though

17:34 hiredman: pffft

17:34 amalloy: jweiss: it really should entice you

17:34 hiredman: it's not like they went through and trashed the rest of the house with sledge hammers

17:34 the changes are alpha

17:34 most of it is still the same as 1.3

17:34 amalloy: &(contains? 1 #{(Integer. 1)})

17:34 lazybot: ⇒ false

17:35 hiredman: wrong arg order

17:35 amalloy: &(contains? #{(Integer. 1)} 1)

17:35 lazybot: ⇒ true

17:35 amalloy: *squint* hiredman, shouldn't that say false?

17:35 ,(contains? #{(Integer. 1)} 1)

17:36 clojurebot: true

17:36 hiredman: (type #{(Integer. 1)})

17:36 ,(type #{(Integer. 1)})

17:36 clojurebot: clojure.lang.PersistentHashSet

17:37 hiredman: ,(type (first #{(Integer. 1)}))

17:37 clojurebot: java.lang.Integer

17:37 hiredman: damned if I know

17:38 dpritchett: technomancy: now i'm stuck on a weird udev/initramfs-tools apt problem in turnkey ubuntu

17:38 c'est la vie

17:53 technomancy: I'm not sure what that means, but it sounds like a hoot and a half.

18:00 seancorfield: quick emacs Q since my google fu is failing me... i ran package-list-packages - what key marks a package for installation?

18:00 Raynes: seancorfield: i

18:01 seancorfield: obvious really... *sigh*... then x to execute the staged commands...

18:01 hiredman: i maybe? dunno I haven't used the package manager in a long time

18:01 seancorfield: i'm going thru the leiningen / emacs install process on windows xp... for 'fun' :)

18:03 eipiten: Is there a way to do something like #(eval (cons 'and %&)) without using eval?

18:04 amalloy: &(doc every?)

18:04 lazybot: ⇒ "([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."

18:04 seancorfield: nice... leiningen / emacs all up and running on windows!

18:04 now i "know" what i'm doing, it's all much easier

18:04 hiredman: ^-- largly the kind of thing I am talking about when I say "don't be an idiot"

18:05 really that question has nothing to do with eval

18:05 and bringing eval in only muddies the water

18:05 really it's about and and what and does

18:05 which is return true if all the values you pass it are true

18:06 Raynes: He asked the wrong question -- I think we can forgive him just this once.

18:06 hiredman: which even if every? did not exist is simple to write

18:06 * sean_winxp running erc on my win xp vm :)

18:06 hiredman: anyway

18:07 dpritchett: ok, 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:07 seancorfield: ok, that was a success... now i need to write a blog post about it!

18:08 hiredman: please don't

18:08 ~blog post

18:08 clojurebot: make 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:08 hiredman: grr

18:08 clojurebot: Huh?

18:08 hiredman: ~blogs

18:08 clojurebot: make 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:08 hiredman: clojurebot: you suck

18:08 clojurebot: Gabh mo leithscéal?

18:08 jodaro: make it more of a challenge: tweet it.

18:09 tncardoso: hi, 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:10 eipiten: You'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:10 hiredman: eipiten: unlist?

18:10 sean_winxp: hiredman: so what were you actually trying to tell me about blogging?

18:11 hiredman: sean_winxp: people blogging about their emacs setups are the primary source of misinformation about how to setup emacs

18:11 amalloy: sean_winxp: if a blog becomes popular enough to be useful, it is already out of date by then

18:11 * Arafangion needs to set up a blog.

18:12 eipiten: hiredman: 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:12 technomancy: seancorfield: 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:12 sean_winxp: i've been good about updating old clojure blog posts to keep them up to date... at least i try :)

18:13 technomancy: good point - i wanted to ensure clojure-mode was at least in the least of packages before i installed it tho'...

18:13 hiredman: eipiten: step back and think about what you actually want, forget about and and eval

18:14 brehaut: eipiten: every time you call eval you fire up the compiler

18:14 hiredman: you have a list of true or false values and you want to check if they are all true, right?

18:15 brehaut: when you are trying to teach a man to fish the brand of tackle box is not important

18:15 sean_winxp: technomancy: 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:15 eipiten: hiredman: yes.

18:15 technomancy: sean_winxp: great. did you install from the .zip distribution?

18:15 hiredman: eipiten: so you have a list of stuff you want to do stuff with, how do you process lists?

18:15 brehaut: hiredman: what if one of the tackle boxes is labled 'dynamite' ?

18:16 eipiten: hiredman: 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:16 hiredman: brehaut: certainly a valid method of fishing in some cases

18:16 eipiten: why do you want to pass it to a macro?

18:17 I hope you are not going to mention 'and' again, as I said you should forget about it

18:18 tncardoso: hi, 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:19 hiredman: eipiten: how do you process a list of values? if you cannot answer this you are in for a world of hurt

18:19 brehaut: tncardoso: map is not the right function for changing just one function in a list

18:19 Raynes: s/function/element/

18:19 brehaut: Raynes: thanks

18:19 eipiten: hiredman: usually I'd go for some sort of reduce

18:19 amalloy: Raynes: all of brehaut's elements are functions. he's crazy about the HOFs

18:20 Raynes: amalloy: He's crazy in general.

18:20 tncardoso: brehaut: i need 2 values: the list with changed value and a flag if the list was changed or not

18:20 hiredman: eipiten: which is exactly the way to go, so why didn't you use reduce (or really every?) in the first place?

18:20 tncardoso: brehaut: i wanted to do llike this in order to avoid reading the list twice

18:20 brehaut: amalloy, Raynes: if you arent creating your tarpit from first principles of lambda calc, why even bother?

18:20 amalloy: i assume the objection here is that reduce doesn't short-circuit

18:21 sean_winxp: technomancy: with lein i downloaded the .bat file, downloaded curl.exe and did lein self-install

18:21 hiredman: then why not write a reduce that does?

18:21 gtrak`: why change an element in a list? should probably be using a vector instead

18:21 technomancy: sean_winxp: do you think it makes sense to have people do that rather than just downloading the .bat and .jar?

18:21 hiredman: solve the actual problem instead of deciding you must want 'and and eval

18:21 sean_winxp: then got emacs 24 from the emacs for windows site (i need to dbl chk my browser history for the url)

18:21 technomancy: sean_winxp: seems like curl is an unnucessary manual step.

18:22 sean_winxp: then did lein plugin install swank "1.3.2" per swank-clojure instructions

18:22 tncardoso: gtrak`: i am using a vector

18:22 gtrak`: but I dont know the element position

18:22 sean_winxp: technomancy: i needed wget or curl tho', yes?

18:22 technomancy: sean_winxp: curl/wget is only used for self-install

18:22 gtrak`: well, you can either check each one, if it's sorted do a binary search, etc...

18:22 technomancy: sean_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:22 sean_winxp: the lein wiki page doesn't explain what to do with the downloaded jar tho'...

18:22 tncardoso: gtrak`: i have to check each one

18:23 technomancy: sean_winxp: right, I'm just wondering whether the instructions should be changed.

18:23 gtrak`: tncardoso, probably worth it to do reduce conj at that point

18:23 sean_winxp: if it had told me what to do with the jar, i would have gone with that

18:24 but having curl might be useful anyway :)

18:24 tncardoso: gtrak`: 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:24 gtrak`: tncardoso, with a closure and an atom

18:24 eipiten: hiredman: 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:24 sean_winxp: so technomancy if i had downloaded the jar, where should i have put it?

18:24 tncardoso: gtrak`: dynamic biding?

18:24 gtrak`: no

18:24 hiredman: more elegant than reduce?

18:24 technomancy: sean_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:25 hiredman: *sigh*

18:25 tncardoso: gtrak`: how is that then?

18:25 gtrak`: 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:26 those concerns can be separated

18:26 hiredman: ugh

18:26 atom?

18:27 clojurebot: atom discussion is http://groups.google.com/group/clojure/msg/fd0371eb7238e933

18:27 hiredman: you can just compare

18:27 (= list result-list)

18:27 tncardoso: gtrak`: thanks

18:27 gtrak`: i will give it a try

18:27 gtrak`: that's the same speed if it didn't change, slower if it did, right?

18:28 hiredman: benchmark it

18:28 gtrak`: but i suppose you'd also have to check if you're replacing the element with the same elemnt

18:28 hiredman: why?

18:28 gtrak`: unless you don't care, in which case you'd get different results with = vs atom

18:28 clojurebot: http://clojure.org/rationale

18:29 gtrak`: hiredman, depends on what you want I guess

18:29 mrh0057: technomancy: 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:29 technomancy: mrh0057: oh, I see.

18:30 now that you mention it I have had a number of bug reports around that, especially differing between cygwin vs the JVM

18:30 hiredman: technomancy: you wouldn't have a link to your map vs. reduce tweet handy would you?

18:31 technomancy: hiredman: you mean the one about which one is better?

18:31 hiredman: yeah

18:31 technomancy: fraid not

18:31 hiredman: I suppose it doesn't matter

18:31 (if I get the link or not)

18:32 gtrak`: map's better, right?

18:32 if you can do it with map?

18:33 hiredman: map can be implemented in terms of reduce (if the lanague is lazy it will be lazy, if not strict) but not the reverse

18:34 gtrak`: hmm, you couldn't?

18:34 hiredman: well, go ahead and do it

18:34 gtrak`: if you had mutable state it seems like you can

18:35 but it won't be lazy

18:36 mrh0057: technomancy: 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:36 technomancy: mrh0057: and you can't just rely on the HOME environment variable?

18:38 amalloy: technomancy: $HOME is a recipe for sadness on windows, isn't it?

18:38 technomancy: amalloy: apparently

18:39 mrh0057: technomancy: I think the HOME environment variable gives you C:\Users\<username>\

18:39 guns: Hello. Is there a dissoc for vectors? Currently I (filter identity (apply assoc v (interleave indices (repeat nil)))); but that's pretty slow

18:40 hiredman: you can only remove elements from the end of vectors efficently

18:40 mrh0057: technomancy: However emacs looks for .emacs.d in C:\Users\<username>\App\Roaming .

18:40 guns: hiredman: mmm that's something to think about

18:40 hiredman: if you want random access for remove use a map

18:40 amalloy: hiredman: i don't think you can actually do that though, can you?

18:41 hiredman: do what?

18:41 amalloy: ,(dissoc [1 2] 1)

18:41 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IPersistentMap>

18:41 hiredman: ,(pop [1 2])

18:41 clojurebot: [1]

18:41 amalloy: well yes

18:41 technomancy: mrh0057: what if leiningen just told you where it was expecting to find the jar in the error message?

18:41 amalloy: i guess i took the question/statement too literally

18:42 mrh0057: technomancy: That would seem to work.

18:44 guns: hiredman: thanks; I had the impression that using a hash table would be less efficient for working with indices

18:44 mrh0057: technomancy: 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:44 guns: but I guess I should rethink that

18:44 technomancy: mrh0057: this should be orthogonal to emacs though

18:48 gtrak`: what's a vector do on removal that makes it slow?

18:48 mrh0057: technomancy: It may affect some of the scripts if you really on emacs for getting the home directory.

18:51 technomancy: I think it's all funneled through the .bat file

18:53 bpr: technomancy: how do you do slime/swank? via "lein swank" or M-x c-j-i?

18:53 technomancy: bpr: jack-in

18:53 bpr: with swank-clojure 1.4.0?

18:54 technomancy: bpr: I'm using 1.3.4-SNAPSHOT right now but 1.3.3 is probably best

18:54 bpr: I'm struggling to find a stable dev environment with useful debuggin utilities

18:54 ok

18:55 I'm looking forward to having cdt available :)

18:55 I can do almost everything, except debug threads very well. And I'm findind it really painful when that need crops up

18:56 anyhow, thanks for the amazing tool(s)!

19:24 seancorfield: hmm, 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:25 simard: seancorfield: what about your .emacs file, is it reading it fine ?

19:26 _ulises: seancorfield: afaik, in windows 7 emacs will read from /C/Users/username/AppData/Roaming/.emacs.d/

19:26 simard: seancorfield: try C-x d ~/ to see where it gets you

19:27 iirc this is where emacs looks for .emacs, and, I guess, .emacs.d

19:30 seancorfield: thanx... $HOME was the Application Data/ subfolder

19:30 found 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 _ulises: seancorfield: I use git for that which isn't that ... automatic :)

19:31 technomancy: yeah, I've never understood the appeal of dropbox for code

19:31 _ulises: I thought dropbox was based on svn?

19:32 simard: seancorfield: I've been using rsync/unison for years, then I found git

19:33 seancorfield: and github !

19:34 zakwilson: Doing 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:34 seancorfield: with 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:35 finding how to do symlinks on windows was a pain tho'

19:35 gtrak`: seancorfield, I use the same method, works great

19:35 simard: seancorfield: 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:35 gtrak`: does emacs work properly on windows too?

19:35 seancorfield: is there a way to get emacs to reload a file from disk if something else changed it?

19:35 gtrak`: with the same configs?

19:35 zakwilson: More or less, I think.

19:35 simard: gtrak`: not without a full cygwin behind it

19:36 seancorfield: gtrak`: so far, yes, because i'm not using full file paths anywhere

19:36 gtrak`: simard, you have to run cygwin emacs, or just have the progs available?

19:36 _ulises: seancorfield: I try to edit it; emacs asks me whether I want to reload

19:36 seancorfield: no cygwin

19:36 zakwilson: revert-buffer

19:36 seancorfield: thanx zakwilson

19:37 auto-revert-mode apparently

19:37 simard: gtrak`: not sure about that, but things will tend to fail if you don't have an ssh program etc, especially with tramp

19:37 or grep even

19:37 gtrak`: i use dropbox with hg for code

19:37 zakwilson: I always forget how much work it takes to make Windows useful.

19:37 gtrak`: free hosting

19:38 simard: zakwilson: yeah, it's a pain, I feel like I'm missing a few limbs when I have to use it

19:38 zakwilson: I more or less don't ever do anything but browser testing and gaming on Windows.

19:40 simard: there's a few damn good programs on Windows that I have to use for work as well

19:40 it's sad :)

19:40 gtrak`: though you have to use n+1 repos or risk corruption if stuff gets out of sync

19:43 seancorfield: clearly i haven't fired up my win xp vm for a while... 16 important updates to install...

19:43 simard: huh, are you running emacs from within a windows vm ?

19:44 over linux ?

19:44 sritchie: @technomancy, is there some way to trigger an uberjar from within a running project?

19:44 technomancy: I'm running into a previously reported issue where a dependency with maven ant tasks will cause an error

19:47 technomancy: sritchie: dependency or dev-dependency?

19:47 sritchie: I'm including lein as a dependency

19:47 technomancy: that's going to cause trouble

19:47 have you tried :eval-in-leiningen true in project.clj?

19:48 leiningen is not a library

19:48 stevel_: Is it possible to set a system property in leiningen?

19:48 sritchie: let me check it out

19:48 stevel_: Like a -Dfoo.bar="baz

19:49 technomancy: stevel_: you can set :jvm-opts ["-Dfoo.bar=baz"]

19:49 stevel_: awesome, thanks

19:49 sritchie: technomancy: I'm writing a script that deploys some project's uberjar up to a cluster

19:50 technomancy: so I'm trying to figure out how to get the project to package itself up during the deploy

19:51 technomancy: it sounds like you should write a plugin

19:53 sritchie: I have a plugin that does this, but the goal was to write a phase for pallet, which works as a library

19:54 the phase would accept a remote path and send the project's uberjar to that path

19:57 technomancy: hm; you can try it, but it's definitely not designed to be used that way

19:59 sritchie: okay, I'll keep thinking

20:00 hugod: sritchie: you could write a pallet task, and then make it depend on the uberjar task

20:00 sritchie: yeah, that's true;

20:01 it's easier to think about as a phase, but that will definitely work better

20:01 hugod: the pallet task can just run a phase

20:20 simard: wow these webgl javascript samples found over the web are so far from side-effect free :S

20:26 bpr: simard: haha, yeah i wrote a javascript RFB client, and was feeling dirty about all the mutation

20:27 simard: that, and functions accessing public vars all the time, read/write

21:06 _ulises: how can I create a BigInt from clojure.lang?

21:06 hiredman: why?

21:06 clojurebot: why not?

21:07 _ulises: I'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 I want to confirm it's BigInt and not, say, Long

21:07 right now I've worked around it with (int ...)

21:07 seancorfield: (bigint 42)

21:07 _ulises: ta

21:07 seancorfield: in clojure 1.3

21:07 _ulises: yup

21:08 and effectively, that was the culprit, so thanks!

21:08 * seancorfield is always happy to see people using clojure 1.3 :)

21:08 _ulises: hum that's a question I haven't answered: why should I migrate to 1.3? or even, should I?

21:09 I mean, I'm a light user of clojure, so 1.2.x serves me just fine

21:09 seancorfield: improvements in numeric performance?

21:10 _ulises: ok, what else?

21:10 zakwilson: You should migrate because the libraries have changed and eventually third-party libraries won't work with 1.2 anymore.

21:10 seancorfield: yeah, 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 _ulises: ah, 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:11 seancorfield: so it's more important to use the new libs, even if you're on 1.2

21:11 zakwilson: That's because contrib is gone, most of it having been either integrated or spun off.

21:11 _ulises: sorry, I probably sound like a moany b...

21:11 don't mean to complain, etc.

21:11 seancorfield: clojure 1.2 was very compelling in terms of features, 1.3 less so in many people's eyes

21:12 _ulises: interesting

21:12 seancorfield: but using the new - well-maintained - modular contrib libs is worthwhile, esp. if you're new to clojure

21:12 _ulises: I still need to get around doing that

21:12 I've been writing clojure code for over a year now

21:12 zakwilson: Clojure 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 _ulises: but most of my code is generally reliant on just the core stuff

21:13 zakwilson: Change because why not?

21:13 _ulises: is there any doc. I could read on the mapping between old contrib <-> new modular contrib?

21:13 zakwilson: Yes, but I don't remember where it is.

21:13 seancorfield: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

21:14 _ulises: fantastic

21:14 seancorfield: if you have any Qs, let me know since i seem to be maintaining that page :)

21:15 back in a bit, gotta go feed the kitties...

21:15 _ulises: will read it and then come back to you

21:15 need some sleep in any case, it's 2:14am over here :'(

21:20 sdeobald: Just 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:23 duck1123: sdeobald: are you using Midje?

21:24 cemerick: anyone know what happened to the git docs @ http://www.kernel.org/pub/software/scm/git/docs/ ?

21:24 OT, I know. :-|

21:31 archaic: anyone 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:48 seancorfield: cemerick: was just reading http://cemerick.com/ideal-clojure-development-environment/ - looks like it hasn't been updated in a long while?

21:48 cemerick: quite a long time, yeah

21:48 seancorfield: it links to the assembla wiki was my first hint :)

21:48 cemerick: I had it in mind to maintain a grid of all the various tools and how they fared on each criterion.

21:48 hah

21:48 seancorfield: be nice to see an updated version with your current thoughts, esp. since you're working with CCW so much now...

21:49 cemerick: Been using it full time since last fall :-)

21:49 seancorfield: it was linked from your recent blog post about richer interfaces in the repl

21:49 cemerick: I don't think a lot has changed, though I only skimmed it earlier.

21:49 Yup, I know.

21:50 Is that your gentle hinting that I should at least get rid of the assembla links? ;-)

21:50 brehaut: cemerick: what were you using before ccw?

21:50 cemerick: brehaut: Netbeans + Enclojure

21:55 seancorfield: i am liking the memory footprint of emacs compared to eclipse + ccw :)

21:56 duck1123: So those of you that use eclipse, what do you use to connect to a running clojure process?

21:57 I tried hooking up to a nrepl, but I couldn't figure out how to access my command history

22:04 cemerick: duck1123: Ctrl-up

22:04 seancorfield: I eliminated the old links, and updated the Netbeans and Eclipse sections at the bottom

22:04 duck1123: cemerick: didn't work for me on OSX

22:04 cemerick: oh, right

22:05 duck1123: Installing on Ubuntu atm

22:05 cemerick: duck1123: If you have spaces enabled, that binding conflicts with one of its keyboard shortcuts.

22:05 A fix for that is coming in the next release, IIRC.

22:06 duck1123: cemerick: 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:07 cemerick: sure

22:07 The current workaround is to disable spaces, or just change its Ctrl-up keyboard shortcut. :-|

22:07 seancorfield: we've tossed around the idea of producing a Clojure-only Eclipse distribution, which would help there.

22:08 brehaut: cemerick: i could get behind that

22:08 duck1123: cemerick: putting the update site on the project page would help

22:08 brehaut: eclipse seems even more daunting to me than emacs

22:08 cemerick: duit's the first "quick link"? http://code.google.com/p/counterclockwise/

22:09 wow, that was a bizarre typo

22:09 s/duit/it

22:10 duck1123: cemerick: what I'm saying is the eclipse update site should be listed there, I had to go to the main documentation

22:11 cemerick: duck1123: it *is* on that page…

22:11 "Update site: http://ccw.cgrand.net/updatesite"

22:12 duck1123: hmmm... missed it. I take it back

22:12 cemerick: Not to say we wouldn't all like a prettier main site. :-)

22:18 seancorfield: cemerick: thanx for the updates... "So, except for Enclojure, these are very brief impressions indeed." :)

22:18 i know, i'm never satisfied :)

22:32 cemerick: seancorfield: :-P

22:33 Fixed.

22:33 But then, that page is beyond repair in a sorts of ways anyway.

22:49 brehaut: cemerick: theres nothing like a blog for content rot

22:49 except maybe a wiki

22:50 cemerick: well, it's not a blog post, just a static page

22:50 so, it's even worse :-)

22:50 brehaut: hah :)

22:50 cemerick: Translating it to a gdocs spreadsheet shouldn't be too difficult, but I never got around to it

22:53 simard: hum socket.io or websocket, anyone ?

22:54 (vs)

22:54 it seems that chrome and firefox handle websockets differently :S

22:54 brehaut: simard: it depends which chrome and ffx probably; the spec has changed dramatically in its short life

22:55 duck1123: aleph handles websockets pretty well

22:56 simard: brehaut: and do you know about socket.io ?

22:57 brehaut: simard: its a wrapper layer right?

22:57 simard: yeah, it claims to handle websocket on all browsers.

22:57 brehaut: (designed to work with a node.js backend in particular right)

22:57 simard: in fact, it does nore than that.. it CAN use websocket, or some other protocol

22:57 (that's my reading of their website anyway)

22:58 brehaut: i presume they shim it with either long poll or browser specific backends (or flash / java fallbacks) as necessary

22:59 simard: yeah, and it's probably best like that

22:59 I had webgl working fine under firefox, and websocket working fine under chrome

22:59 :)

23:00 brehaut: simard: 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:00 simard: I need real time

23:01 duck1123: the clojure library seems a bit sparse

23:01 for socket.io, that is

23:02 brehaut: simard: http://caniuse.com/#search=websockets

23:02 simard: duck1123: hum yeah that's another good point in favor of websocket

23:03 brehaut: hum... probably the way I use them doesn't please firefox

23:03 brehaut: simard: are you on ffx6 + ?

23:03 simard: I have up to date version of both ff and chrome

23:04 duck1123: simard: fwiw, I didn't have much trouble getting my simple case working in both using Aleph

23:04 simard: ff 7.0.1-1

23:04 chromium 14.0.835.202-1

23:04 brehaut: simard: btw, for your webgl stuff are you doing browser detection or feature detection?

23:04 simard: brehaut: not at the moment, no.

23:05 I've just seen this "Moz" text in the firefox column though

23:05 that says I must use a prefix

23:23 gsymons: Hi...

23:23 I'm kinda running into a brick wall on what seems like it should be really simple...

23:25 brehaut: gsymons: just go ahead and ask your question, if someone can help they will

23:25 gsymons: What I want to do is find the first item in a collection that returns true for a predicate.

23:25 amalloy: brehaut: ibdknox tweaked ~anyone to sound less hostile, so you can probably just use that

23:25 brehaut: ~anyone

23:25 clojurebot: Just 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:26 brehaut: (inc amalloy)

23:26 lazybot: ⇒ 18

23:26 gsymons: I 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:27 * sean_netbook feels guilty at asking a "does anyone..." question the mailing list

23:27 amalloy: gsymons: you can't do that for a general predicate

23:27 if 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:27 lazybot: ⇒ "([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:30 ibdknox_: huh

23:30 never knew about subseq

23:31 gsymons: That is exactly what I was looking for... thanks.

23:32 amalloy: ibdknox_: 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:32 ibdknox_: haha

23:33 amalloy: I don't think there's a place where I've really needed to use it yet

23:34 amalloy: I bet there are some really clever solutions that would involve weirdly sorted collections though...

23:49 cemerick: So, who here has complete trust that Google Closure is something that can be relied upon to stick around over the long haul?

23:50 * cemerick is playing some FUD's advocate games

23:51 sdeobald: duck1123: not midge, just clojure.test (sorry for the slow reply... was at a meetup when I installed 1.3 for the first time)

23:55 mrh0057: cemerick: 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:56 cemerick: mrh0057: I mostly agree, though Dart is a wildcard. But still, there's Closure the compiler, and Closure the set of APIs

23:57 The 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:57 duck1123: sdeobald: np. I just saw that issue in migje, but it's fixed in the latest version

23:57 sdeobald: I assume you're using clojure-test-mode, then?

23:58 sdeobald: duck1123: yep

23:58 duck1123: There's a point in the code where it calls .getRoot, should be .getRawRoot now

23:58 I'm pretty sure it was checked in somewhere

23:59 sdeobald: duck1123: Ah. clojure-test-mode itself is calling that?

23:59 duck1123: sdeobald: yes. in the el file, there's a string that has clojure code. change it there

Logging service provided by n01se.net