#clojure log - Aug 28 2010

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

0:12 slyrus: it took me a little while, but: (defmacro defn* [fn-name & rest] `(intern (symbol ~(namespace fn-name)) (symbol ~(name fn-name)) (fn ~(symbol (name fn-name)) ~@rest)))

0:12 seems to do what I want

0:13 (defn* chemiclj.core/make-atom ...)

0:15 yeah, that's great, except for the NPE on a clean restart. hmm ):

0:18 ah, no graceful failure if I don't provide an ns-qualified fn-name

0:18 gregh: ping

0:19 erp

0:48 slyrus: in case you want to read my writeup of the ns hackery: http://slyrus.github.com/2010/08/27/chemiclj-namespaces.html

2:00 tomoj: anyone else still getting the 'default-repos does not exist' error with native-deps 1.0.3?

2:02 oh, hmm, default-repos does exist.. strange

2:19 notsonerdysunny: what does this mean? I created the jreality-native-deps clojar.. When I fetch the library via "lein deps" I get.. [WARNING] POM for 'org.clojars.sunilnandihalli:jreality-native-deps:pom:0.1:compile' is invalid. It will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for project

2:19 can anybody tell me what this means?

2:21 I get a NullPointerException when I run "lein deps" without doing a "lein clean" .. is this expected?

2:21 tomoj: you have modelVersion 0.1 in your pom

2:21 it should be 4.0.0

2:23 notsonerdysunny: thanks tomoj

2:25 tomoj I get a NullPointerException when I run "lein deps" without doing a "lein clean" .. is this expected?

2:26 tomoj: I got that too a bit ago with overtone

2:26 it's certainly not intended behavior though..

2:27 doesn't seem to affect all projects, so I don't have a clue where the bug is

2:28 notsonerdysunny: oh ic

2:28 hmmm

3:04 bortreb: how can I make an array of chars in clojure?

3:05 nm -- it's (into-array Character/TYPE (seq "sdfasf"))

3:06 fliebel: morning

3:12 slyrus: bortreb: or (char-array "this-is-crazy")

3:14 bortreb: nice --- I like char-array

3:19 notsonerdysunny: ,(char-array "this-is-crazy")

3:19 clojurebot: #<char[] [C@793a99>

3:20 notsonerdysunny: ,(vec "this-is-crazy")

3:20 clojurebot: [\t \h \i \s \- \i \s \- \c \r \a \z \y]

3:20 slyrus: ,(aget (char-array "this-is-crazy") 0)

3:20 clojurebot: \t

3:22 notsonerdysunny: is clojars slow? I am trying to scp a clojar and been unsuccessfull... :(

3:22 clojars.org

3:42 is there an alternative to clojars.org where I can upload my jars?

3:47 seangrove: What is a ctor?

3:47 clojurebot: help?

3:47 clojurebot: http://www.khanacademy.org/

3:47 bortreb: constructor

3:47 seangrove: Thanks

3:47 bortreb: np :)

4:14 notsonerdysunny: when I searched for jogl on clojars .. I found a bunch of them .. does anybody have a suggestion as to which one to use?

4:47 seangrove: How would I generate a sequence of integers from 0 to 1000?

4:47 And yes, this is project euler related :)

4:49 got it

4:49 range

5:11 fliebel: Anyone knows a project euler challenge that does challenge my Clojure skills, but not so much my math skills? I want to warm my fingers with some Clojure without cracking my brain on math.

5:22 mrBliss: fliebel: I find these problems https://sites.google.com/site/prologsite/prolog-problems/1 most of the problems can be solved with an already existing clojure function, but try it using only recursion, first, rest and cons

5:22 s/find/like/

5:22 sexpbot: fliebel: I like these problems https://sites.google.com/site/prologsite/prolog-problems/1 most of the problems can be solved with an already existing clojure function, but try it using only recursion, first, rest and cons

5:24 fliebel: mrBliss: I'll have a look

5:30 what's the opposite of butlast?

5:32 arbscht: in which sense?

5:32 fliebel: something that returns the list except for tis first item.

5:32 mrBliss: fliebel: do you mean rest

5:33 fliebel: yea..

5:34 I really miss slices in Clojure. In python you can do all this stuff with slices.

5:35 mrBliss: fliebel: write your own slice function with concat, drop and take

5:36 fliebel: *looks up the docs* This how I'd do it in Python: range(100)[-2::-1]

5:40 mrBliss: I can see you you could do the start and lenghts part of a slice, but negative numbers and the step parameter requires some more magic.

5:40 mrBliss: ,(doc range)

5:40 clojurebot: "([] [end] [start end] [start end step]); Returns a lazy seq of nums from start (inclusive) to end (exclusive), by step, where start defaults to 0, step to 1, and end to infinity."

5:43 fliebel: mrBliss: Yea, but that is only for a generated range, not for any random seq.

5:44 mrBliss: ,(find-doc #"nth")

5:44 clojurebot: ------------------------- clojure.contrib.seq/rand-elt ([s]) DEPRECATED. Prefer clojure.core/rand-nth. Return a random element of this seq ------------------------- clojure.contrib.seq-utils/rand-elt ([s]) DEPRECATED. Prefer clojure.core/rand-nth. Return a random element of this seq ------------------------- clojure.core/nth ([coll index] [coll index not-found]) Returns the value at the index. get returns nil if index out

5:45 mrBliss: fliebel: try (find-doc #"nth") in your repl, you'll see some better functions than the ones clojurebot knows

5:45 fliebel: mrBliss: Thank you :)

5:47 muhahaha! my very inefficient palindrome list calculator

5:47 ,(let [l [1 2 3 4 5 5 4 3 2 1]] (every? #(= (first %) (last %)) (map vector l (reverse l))))

5:47 clojurebot: true

5:48 fliebel: Any better solutions?

5:49 mrBliss: (if (< (count l) 1) true

5:49 (and (= (first l) (last l)) (recur (rest (butlast l)))))

5:51 fliebel: mrBliss: Let me chew on that… if… recur… chop… lenght…. sounds like a nice solution

5:53 I can't figure out how recur works in this context...

5:54 mrBliss: fliebel: calls the same function again

5:54 fliebel: which function?

5:54 mrBliss: oh yeah, wrap it in (defn palin? [l] ...)

5:55 fliebel: ah, that was the missing part of the puzzle.

5:55 mrBliss: fliebel: sorry about that. Some microbenchmarks point out that your functions is actually faster

5:55 s/functions/function/

5:55 sexpbot: fliebel: sorry about that. Some microbenchmarks point out that your function is actually faster

5:56 fliebel: mrBliss: Mine can actually be made twice as fast by chopping l in halg

5:56 *half

5:57 mrBliss: fliebel: butlast is linear, that's probably why mine is slower

5:57 fliebel: yours is quite clojure-y, mine is more scheme-y

6:01 fliebel: mrBliss: This looks more like it:

6:01 ,(let [l [1 2 3 4 5 5 4 3 2 1]] (every? #(= (first %) (last %)) (map vector (take (/ (count l) 2) l) (reverse (drop (/ (count l) 2) l)))))

6:01 clojurebot: true

6:02 fliebel: hooray fro readability :D

6:03 mrBliss: fliebel: nice

6:04 fliebel: mrBliss: Only due to integer devision [1 2 3 4 5 666 5 4 3 2 1] also returns true.

6:04 mrBliss: fliebel: that list is palindromic

6:04 fliebel: You're right

6:05 So what I was saying… due to the fantastic integer devision this even works for odd lenght lists :DF

6:06 mrBliss: fliebel: very clever ;-)

6:17 patrkris: is there anything inherent to Vim that makes it more difficult to create a SLIME-like thing? is emacs better suited for that?

6:17 just wondering

6:21 Chousuke: As far as I know the main reasons are that 1) vimscript sucks and 2) that vim is not really designed to interact with external programs.

6:21 patrkris: ah

6:21 sad thing with vimscript

6:22 never wrote much in vimscript besides what goes in .vimrc and various ftplugin files

6:22 Chousuke: do you use emacs or vim for clojure development?

6:22 Chousuke: emacs

6:23 I mostly use vim only for quick edits nowadays.

6:24 incandenza: qq

6:24 oops

6:25 kwertii: Emacs is actually a general-purpose Lisp interpreter that happens to come with some text editing programs preloaded. Vim is "just" a text editor

6:26 patrkris: :)

6:26 Chousuke: ostensibly :P

6:27 patrkris: i have often thought about learning emacs, but I think I'm turned off by the meta-key thing

6:27 i would hate having to hold Ctrl or Alt all the time

6:27 Chousuke: There's actually a vi emulator for emacs.

6:27 patrkris: but that's probably one of the main gripes by most users

6:27 coming from vim

6:27 yeah, heard about that

6:27 fliebel: yay, next problem solved:

6:27 ,(let [l [1 1 1 2 3 3 1 1 4 4 4 4]] (reduce #(if (= (last %1) %2) %1 (conj %1 %2)) [(first l)] (rest l)))

6:27 Chousuke: Nice word to use… I learnt that word while reading an xkcd comic about lisp. (i'm dutch)

6:27 clojurebot: [1 2 3 1 4]

6:27 Chousuke: but it doesn't work so well with most plugins :/

6:28 fliebel: clojurebot: just in time ;)

6:28 clojurebot: multimethods is what separates the boys from the men.

6:28 kwertii: patrkris: if you do take the plunge, it's _far_ easier to use if you swap Ctrl and Caps Lock, like on a Sun keyboard

6:28 ssideris: good morning

6:28 fliebel: morning

6:29 patrkris: kwertii: yes, but right now I have CapsLock mapped to Esc because of Vim :)

6:29 kwertii: patrkris: ugh :)

6:29 patrkris: kwertii: actually non-trivial to get working on Apple hardware

6:30 kwertii: but essential for Vim I think


6:30 kwertii: I dream of owning a USB space cadet keyboard someday. the one with Alt, Meta, Super, Hyper, etc. keys

6:31 patrkris: hah

6:32 Luyt: You could use a Windows keyboard and relabel the Windows and Menu keys

6:33 kwertii: Luyt: It wouldn't be the same :)

6:33 and anyway I need more keys than that

6:33 Luyt: not really no... the space cadet keyboard also weighted 10 kilos and was made with steel plating

6:34 kwertii: Luyt: ... adding considerably to its awesomeness

6:35 Luyt: I still have a 25 year-old PC AT keyboard

6:35 kwertii: I wonder how much it'd cost to do a production run of ergonomic USB space cadet keyboards

6:37 fliebel: kwertii: I bet there is a huge market of vim users for them. You should do it :)

6:37 kwertii: Luyt: can you get a usb adapter for that?

6:37 Luyt: Not sure. It has a big DIN connector. Somewhere I must have an adapter cable from large DIN to small DIN.

6:40 fliebel: what? lambda is actualy a greek letter?

7:07 ssideris: sooo

7:07 I have this record:

7:07 (defrecord (point) [coords colour])

7:07 and then I have this (test) function:

7:08 (defn look-at-point [{[x y z] :coords, [r g b a] :colour}] ...

7:08 several print statements follow

7:08 is there any way to avoid putting this whole destructuring thing in every function that deals with points?

7:08 can I reuse it?

7:15 mrBliss: "Alias s already exists in namespace user, aliasing clojure.contrib.string", how do I remove an alias for a namespace without restarting my repl?

7:15 ns-unmap doesn't help

7:25 hoeck: mrBliss: ns-unalias

7:25 incandenza: ns-unalias ?

7:26 mrBliss: thanks, quite obvious

8:40 arnorhs: hey guys

8:40 I'm a n00b trying to start using clojure

8:40 And I haven't done any java development in 10 years and never any web development

8:41 I've got clojure running

8:41 so far so good

8:41 but can you recommend a good guide for doing web development in clojure

8:43 kilofu: I'm not much more than a noob myself

8:43 but I've been hearing good things about compojure

8:44 arnorhs: is that a framework?

8:44 kilofu: ya

8:44 a minimal framework

8:45 arnorhs: I come from a PHP background and I don't know what type of webserver you run clojure through or how it works

8:45 Can I use apache?

8:45 I runs as a process, right?

8:46 mrBliss: you can use different webserver for compojure, but I think jetty is the default

8:46 http://weavejester.github.com/compojure/

8:47 s/webserver/servers/

8:52 arnorhs: jetty

8:52 ok, that's what I was looking for

8:52 and lein is like gem for ruby or something?

8:53 mrBliss: not entirely

8:53 I don't fully know gem, but lein is only for your own projects

8:53 you don't install programs with it, only libraries

8:53 arnorhs: ahh ok

8:54 mrBliss: http://github.com/technomancy/leiningen

8:54 arnorhs: yeah, I've got that set up

8:55 mrBliss: I don't really know Rake, but it looks like Ruby's leiningen

8:56 arnorhs: I don't really know ruby :)

8:56 I've just dabbled around in it

8:56 didn't seem to be that much it had to offer over php

8:56 syntax wise

8:56 I've been writing really weird php code for years anyways

8:57 usually my code becomes really long lines of stuff and I'm always trying to help my self write as less code as possible

8:57 and there's just stuff in the syntax that I'm really tired of

8:57 that I can't shorten

8:57 I'm a slow typer and I hate writing a lot of code to do simple things

8:57 I'm hoping clojure will help me :P

8:58 Since clojure code looks like my php code

8:58 mrBliss: what do you mean? it looks the same?

8:59 arnorhs: I do everything in arrays in PHP

8:59 I have a lot of magical array functions that I've used and do a lot of function callback hacking and stuff like that

8:59 php's arrays are really powerful and 99% of php developers don't know how to use them right

8:59 And I'm not a big fan of OO programming

9:00 I used to, when I started out and was in school

9:00 but through the years I've gradually written fewer and fewer classes

9:00 at least smaller

9:00 mrBliss: It annoys me that you can't do get_array()[0] in PHP (till recently)

9:00 arnorhs: yeah, that's true

9:00 ssideris: arnorhs: if you like to write concise code, i think you'll like the fact that clojure has macros

9:01 arnorhs: yes, I've been looking at a lot of clojure examples

9:01 mrBliss: ever played with another lisp?

9:01 arnorhs: and they look powerful

9:01 no

9:01 I tried classic lisp, don't remember what it was, ANSI lisp maybe?

9:01 anyways

9:01 that was a long time ago

9:01 mrBliss: Exactly my experience: http://xkcd.com/224/

9:02 arnorhs: And it was horrible with all the different compilers out there and everything was just so much trouble

9:02 I got inspired to write lisp first a few years ago when I read PG's hackers and painters essay

9:02 and dabbled around

9:02 but that pretty much sucked :P

9:03 mrBliss: that's a good one :P

9:03 I've been hearing about clojure a lot lately, but I didn't realize it was a lisp

9:04 I didn't know what it was

9:04 mrBliss: I enjoyed these videos by Rich Hickey: http://clojure.blip.tv/posts?view=archive

9:05 Start with the "Clojure for {Lisp,Java} Programmers" depending on your background

9:05 arnorhs: hey, awesome

9:05 great

9:05 thanks

9:14 notsonerdysunny: Hello everybody.. I want to configure my leiningen to download http://download.java.net/maven/2/net/java/jogl/jogl/1.1.1-rc6/ .. how can I add it to the list of repositories?

9:28 arnorhs: Are you guys using jetty?

9:28 is there a lot of difference between jetty 6 and 6 ?

9:28 is there a lot of difference between jetty 6 and 7 ?

9:29 notsonerdysunny: How can I add the repository above ?

9:29 to leiningen

9:39 emh: I know you can implement protocols on interfaces (for other protocols), but this is not good if you're not dealing with Java compatibility, because interfaces is a host implementation detail, right?

9:40 and say I have a protocol for printing something, and I implement it on at Set and a Graph interface, then what happens if a type implements both Set and Graph?

9:42 best way is to always implement protocols in the concrete types, and use default mixins for things that are implemented using other protocols that the concrete type implements? just checking that my understanding is correct

9:57 raek: notsonerdysunny: http://github.com/technomancy/leiningen/blob/master/sample.project.clj see key :repositories

9:59 you probably want to add the repo root directory or something (maybe http://download.java.net/maven/2/ ), but I don't know the details

9:59 notsonerdysunny: thanks raek

10:01 arnorhs: I can't even get this jetty thing working

10:01 I think my java inabilities are holding me back

10:01 mayb clojure is just fun for java developers

10:02 it seems most of the documentations and everything is made for people moving out of java

10:02 mrBliss: did you follow this: http://weavejester.github.com/compojure/docs/getting-started.html ?

10:03 no need to install jetty

10:03 arnorhs: hmmm

10:03 ahh

10:03 mrBliss: it's not like apache and php

10:03 jetty is a server, but it's just a java process

10:04 arnorhs: ahh ok

10:04 so the clojure process itself becomes the webserer

10:05 then everything that the webserver has to be able to, must be implemented by the library or your own code?

10:05 mrBliss: java

10:05 right

10:05 imo a cleaner approach than apache+php

10:06 arnorhs: The best thing about apache is that it handles all the hard stuff about running a webserver

10:06 all the threading

10:06 and development becomes so easy when it's all request based

10:06 I do realize that this will not work the same way

10:06 mrBliss: compojure does this for you

10:06 arnorhs: it will be interesting

10:06 mrBliss: you write the routes and the request handlers

10:14 arnorhs: ok, there is a reference to jetty in the project configuration example that the compojure doc has

10:14 does that mean jetty has to be installed? because I uninstalled it ? :P

10:15 raek: no, leiningen will pull down the needed jars

10:15 since compojure has it as a dependency

10:15 arnorhs: wow, there's some magic happening

10:16 mrBliss: in your project dependencies, you'll probably have ring-jetty-adapter

10:16 these are the dependencies or ring-jetty-adapater: http://github.com/mmcgrana/ring/blob/master/ring-jetty-adapter/project.clj

10:16 raek: hrm, yes. maybe that is not a dependency of compojure anymore....

10:16 I use moustache for the routing instead of compojure nowadays

10:17 anyway, Ring does most of the stuff anyway

10:21 arnorhs: hmm

10:22 I executed: lein repl src/arnorhs/core.clj and I got this error:

10:23 arnorhs@ubuntu:/opt/clojure/projects/arnorhs$ lein repl src/arnorhs/core.clj Wrong number of arguments to repl task.

10:23 and Expected ([project])

10:24 mrBliss: are you in lein project folder (containing a project.clj)?

10:25 arnorhs: yes

10:26 wait sorry

10:27 I copy pasted the example code but it has a reference to the project name

10:27 raek: arnorhs: you don't specif the file name as an argument

10:28 -ify

10:28 lein repl

10:28 arnorhs: oh

10:28 raek: and then (require 'arnorhs.core)

10:28 and maybe (in-ns 'arnorhs.core)

10:29 arnorhs: you're right

10:29 working

10:29 raek: I've heard about a new "lein run" command that can be used to run a file as a scriåt

10:29 *script

10:29 arnorhs: the compojure guide showed it like that: http://weavejester.github.com/compojure/docs/getting-started.html

10:29 somebody needs to edit that guide

10:30 raek: hrm, maybe a new feature in leiningen

10:30 arnorhs: no wait

10:32 awesome

10:32 Hello World Wide Web!

10:32 thanks a lot raek

10:32 when I make source code modifications, do I always have to type in those two commands?

10:33 lein repl and then (require 'arnorhs.core)

10:33 mrBliss: which editor are you using?

10:33 arnorhs: currently just gedit

10:34 I can also use emacs

10:34 mrBliss: that would be perfect!

10:34 raek: arnorhs: no, just paste the updated code into the repl

10:34 you don't need to restart the server

10:34 mrBliss: install clojure-mode, slime and slime-repl

10:35 (via ELPA)

10:35 raek: if you use emacs with slime, just use C-x C-e to send the current form to evaluation

10:36 mrBliss: Or C-c C-k to compile the whole buffer

10:36 raek: or C-M-x to evaluate the top level form containing the point (usually a def)

10:37 you can do a (require 'arnorhs.core :reload) in the repl to reload the whole file

10:37 but then surround the server call in something

10:38 (defonce server (run-jetty example {:port 8080, :join? false}))

10:38 no wait, this is better (defonce server (run-jetty #'example {:port 8080, :join? false}))

10:42 (since if you would redfine example, the server would use the new one automatically)

11:10 arnorhs: my god, a lot of things to learn/install just to start programming :)

11:10 I followed the guide here: http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Emacs

11:10 and thereby configured lein repl to be the inferior lisp or whatever

11:11 and I got the clojure.core> prompt inside emacs

11:11 and could run my little application

11:11 so far so good

11:11 raek: I usually do "lein swank"

11:11 and then connect to it with "M-x slime-connect"

11:12 arnorhs: what does that do?

11:12 raek: works out of the box, no config required

11:12 lein swank starts a repl server that slime can use

11:12 arnorhs: this ? http://github.com/technomancy/swank-clojure

11:12 raek: ah, yes

11:12 arnorhs: goddamnit, so many things to learn

11:13 need to go help my brother move

11:13 brb

11:13 raek: the way you did it is build-tool independent

11:14 but when you do multiple projects which may have dependencies, you will most likely want to use some build tool (like leiningen)

11:14 Bahman: Hi all!

11:14 raek: arnorhs: my repertoire for setting up everything:

11:15 1) get emacs and install clojure-mode, slime and slime-repl through elpa

11:15 2) get leiningen

11:16 3) create a leiningen project and add :dev-dependencies [[swank-clojure "1.2.1]]

11:16 4) run lein deps and lein swank

11:16 5) start emacs and connect with M-x slime-connect

11:16 done!

11:17 (this installs clojure and contrib too, as they are added as dependencies)

11:17 (dependencies are added to the project.clj file)

11:18 (a leiningen project skeleton can be created with lein new)

11:21 this is of course opinionated towards emacs+leiningen

11:23 you can use pretty much any combo of {Netbeans, Eclipse, Idea, Emacs, Vim, Textmate} x {Leiningen, Maven, Gradle, Cake, Cljr}

11:24 qbg: Hmm. I found a typo in The Joy of Clojure

11:26 Table of contents -> Part 1 -> 2: "Firehos" should probably be "Firehose"

11:27 bobo_: qbg: they would probably be happy if you added it: http://manning-sandbox.com/forum.jspa?forumID=624 there

11:34 rosejn: anyone have advice for tracking down a java.lang.ExceptionInInitializerError?

11:34 Trying to move to 1.2, and it's coming up in code that previously loaded fine.

11:36 chouser: rosejn: can you get a stack trace?

11:37 rosejn: yeah I can, but it doesn't say much

11:37 1 sec and I'll get it

11:39 https://gist.github.com/60138f739bc0b7ebec47

11:39 That's the stack trace

11:43 raek: what's at line 2 of ugen.clj?

11:44 rosejn: http://github.com/overtone/overtone/blob/clj1.2/src/overtone/core/ugen.clj

11:44 A doc string

11:45 raek: strange

11:45 you're not using incompatible versions of, say, clojure and contrib or something?

11:45 or aot-compiled libs?

11:46 or openjdk?

11:46 rosejn: I'll check

11:46 don't think so

11:50 huh... I removed the classes directory and the error went away

11:50 not entirely comfortable that this should happen though

11:54 raek: it seems like you have done a "lein compile" at some point

11:56 rosejn: Does that happen automatically when you "lein jar"?

11:57 So the compiler doesn't recognize if code has changed it needs to reload from source?

11:58 raek: in what situation?

11:59 I'm not certain if lein jar runs lein compile

11:59 I have not used that function much

11:59 anyway, classes/ is added to the classpath

12:00 Raynes: I don't think lein jar will compile anything unless you ask it to in your project.clj

12:00 If it does, I've certainly never noticed it.

12:00 But if you have old compiled files in classes/ for whatever reason, you can definitely expect weirdness.

12:00 raek: since you might have, for example, java code that needs to be compiled and available on the classpath for the repl

12:01 rosejn: ok, so basically you have to delete classes all the time before re-running code?

12:02 as in the "classes" directory

12:03 raek: after you have AOT-compiled source, yes

12:03 which you mostly only do when you release a package

12:03 the internal clojure compiler does not output class files to the classes/ dir

12:05 for example, (fn [] "foo) is compiled and generates a class under the hood, but it isn't stored in any file

12:07 Raynes: Most of the time, you don't have to AOT compile code. The only time you really have to do that is for serious Java interop purposes (a la gen-class).

12:08 chouser: rosejn: (sorry, stepped out) That stack trace is incomplete.

12:08 (e) only returns the root cause, which is almost always insufficient for compile-time errors

12:09 Raynes: ._.

12:09 I guess we frightened him.

12:09 raek: btw, will (.printStackTrace *e) print the full stack trace?

12:09 chouser: raek: yes

12:09 opqdonut: not the causes though?

12:27 leafw: anybody knows if kotka's memoize functions made it into clojure libs? Or contrib?

14:08 chouser: opqdonut: the full stack trace and the full chain of causes. (.printStackTrace *e) prints everything

14:09 opqdonut: ok

14:09 was the behaviour different earlier or am I misremembering

14:16 arohner: opqdonut: clojure.stacktrace/print-stack-trace doesn't print causes

14:16 opqdonut: ah

14:16 arohner: but c.stacktrace/print-cause-trace does

14:17 (stupid, IMO)

14:17 opqdonut: yes

14:17 that was it

14:17 IMO too

15:05 arnorhs: slima

15:05 slime

15:09 how do I stop "lein repl" inside my emacs?

15:09 killall in command prompt? :P

15:09 LauJensen: Anybody here had problems with uberjars not being able to run, because they are not able to establish the root binding of *warn-on-reflection* ?

15:10 arnorhs: is there a command i can execute?

15:10 LauJensen: arnorhs: ,q

15:10 oh sorry, you wanted to kill the lein repl

15:10 (System/exit) ?

15:10 arnorhs: yes

15:10 and some command to execute?

15:12 raek: arnorhs: I suppose you could kill the *inferior lisp* buffer

15:12 LauJensen: arnorhs: if you hit "(System/exit 1)" in the repl, doesn't the jvm die?

15:12 raek: lein repl starts a clojure process outside emacs, so what did you mean?

15:12 arnorhs: ahh I see

15:13 raek: I recommend using slime + swank

15:13 then you can basically control everything from emacs

15:13 arnorhs: I don't know why I'd only want to control 50% from emacs

15:14 either everything or just run from command prompt

15:14 this is just confusing as hell

15:14 I'll just uninstall everything, use the syntax highlight and run clojure from the command prompt

15:15 fbru02: I want to code a simple function to emulate a python generator, what's a good way to incremente a local on each call of the generator ?

15:15 ssideris: arnorhs: you'll be missing the interactivity like that

15:15 arnorhs: ssideris: I'll have to start somewhere

15:15 LauJensen: fbru02: iterate?

15:15 ssideris: arnorhs: yeah ok start like that if the setup is too much for you right now, but keep in mind that there is more

15:15 fbru02: LauJensen: yes basicaly

15:16 raek: I find it useful to be able to edit one definition and only reevaluate that one when I'm done with it

15:16 ssideris: arnorhs: for example, if you setup swank+slime, you'll be able to re-write a function and replace it in your program without restarting your program at all

15:16 arnorhs: And so far.. with java, jetty (which I didn't have to worry about), emacs package editor, lisp syntax highlighting, installing clojure, installing leiningen, compojure...

15:16 ssideris: arnorhs: replace it as in "hot" replace

15:17 arnorhs: it's just a large chunk of stuff to eat and understand in a single afternoon

15:17 somnium: fbru02: the idiomatic way is to use a lazy sequence (like from iterate), but its possible to use atoms and closures to be purposefully mutable

15:17 ssideris: arnorhs: agreed :-)

15:17 arnorhs: I just want a simple hello world at this point

15:17 :P

15:17 fbru02: somnium: cool, i was just openning the page on that in clojure.net thanks

15:17 arnorhs: So, emacs+code highlighting, and lein is fine for me

15:17 raek: a repl in a terminal can be a good start :)

15:18 arnorhs: yes, I'll ask you guys about the emacs magic after a week

15:18 raek: but when writing longer pieces of code, the interactivity becomes very neat to have

15:18 arnorhs: I'm also using desktop linux for the first time in 8 years :)

15:19 ok, when that becomes an issue/problem, then I'll appreciate it

15:20 Thanks for all the help raek and everybody

15:20 It's been super helpful

15:20 raek: arnorhs: how far did you get? did you ever use slime-connect?

15:20 arnorhs: no, not slime

15:20 raek: how did you run things in emacs?

15:21 arnorhs: I was about to install it, I saw the lisp script needed to install on http://common-lisp.net/project/slime/doc/html/Installation.html#Installation

15:21 the inferior lisp program, I don't know the location? would that be "lein repl" or?

15:22 raek: the easiest way, I think, is to use ELPA to get clojure-mode, slime and slime-repl

15:22 it's very automatic

15:22 ssideris: arnorhs: i think the stable way to do it is to run "lein swank" from a console and then run "slime-connect" from emacs

15:22 LauJensen: raek: Last time I tried it failed

15:22 arnorhs: can you use elpa also to get slime and slime-repl?

15:22 LauJensen: arnorhs: yea

15:22 ssideris: raek: i never got as far

15:22 arnorhs: what was swank again and why do I need it?

15:23 raek: "swank" is the server that the "slime" client connects to

15:23 Bootvis: how can you use (read-line) in a repl?

15:23 raek: or "swank-clojure", more accurately

15:23 ssideris: yeah "swank" can refer to any such server (for other lisps etc)

15:23 raek: basically, you start a swank server outsite emacs with, for example, lein swank

15:24 and then connect to that with emacs (using M-x slime-connect)

15:24 arnorhs: I'm sorry but I'm reading your text but the information is just not parsing

15:25 I might be too dumb for clojure in general

15:25 what does slime do again?

15:25 raek: talk to swank

15:25 ssideris: slime is the emacs extension for developing lisp

15:26 arnorhs: I thought that was the clojure-mode I installed

15:26 raek: clojure mode is syntax highlighting and indentation

15:26 it does not give you a repl in emacs

15:26 arnorhs: ok

15:26 raek: that is what slime does

15:27 you could think of swank as a "repl server" and slime as a "repl client"

15:27 arnorhs: Ok and if slime does that, why do I need swank?

15:27 raek: but it can do more that just the repl...

15:27 arnorhs: ahhh

15:28 raek: like a web browser (client) and a web server

15:28 ssideris: swank is like an instance of clojure sitting around waiting to be send commands from slime

15:28 arnorhs: hmm.. so swank is the thing that's controlling the clojure process (somehow through lein) and slime is the client that connects to that process to insdert the new updated code into it

15:28 ssideris: yes!

15:28 arnorhs: so when I make modifications etc, I use slime to inject it into swank, the controller of the server

15:29 raek: lein is a tool for, amon other things, starting clojure processes with the right CLASSPATH stuff

15:29 arnorhs: because java is too uncomfortable to work with out of the box?

15:29 raek: swank-clojure is actually an ordinary clojure library

15:30 arnorhs: and it also generates the project files and handles dependencies etc of java/clojure libraries

15:30 raek: yes

15:30 rmarianski: i'm trying to create a simple implementation of something seqable, but i'm running into some issues

15:30 http://pastie.org/1122898

15:30 (first (FooSeq. 7))

15:30 seems to work

15:30 so does (first (next (next (FooSeq. 8)))

15:31 but, i can't use the other seq functions with it

15:31 like take

15:31 raek: when I set up emacs and stuff last time I did it like this:

15:31 rmarianski: (take 3 (FooSeq. 8))

15:31 > ([:x 8])

15:31 anyone have any ideas?

15:32 arnorhs: raek: you should make an online guide for setting everything up that you need for proper clojure web development

15:33 ssideris: rmarianski: i think that defrecord is more for map-based types, maybe deftype is more appropriate for your case

15:33 rmarianski: ssideris: when i try that, i get an error message:

15:33 No message. [Thrown class java.lang.AbstractMethodError]

15:33 raek: 1) installed emacs 2) installed elpa by pasting the code at http://tromey.com/elpa/install.html in the *scratch* buffer and evaluated with C-x C-e 3) install clojure-mode, slime and slime-repl from the M-x package-list-packages menu

15:34 arnorhs: I should probably do that...

15:34 rmarianski: maybe it's because it doesn't know how to print out the type?

15:34 (the repl that is)

15:35 i get the same error when i try to explicitly print an instance of the type

15:35 arnorhs: ah ok, you can use the package manager to set all that up.. interesting

15:35 what about swank?

15:35 you need to install that outside of emacs, right?

15:35 ssideris: arnorhs: lein takes care of that, you just list it the dev-dependencies

15:36 rmarianski: adding a toString to it doesn't seem to be help, so maybe it's something else

15:36 arnorhs: ahh, right

15:36 raek: exactly, you dont have to install it

15:36 it is a dependecy, just like clojure and contrib

15:37 lein deps will fetch the versions specified

15:37 ssideris: rmarianski: not sure, haven't worked much with records and types yet

15:37 arnorhs: so just add :dev-dependencies [[swank-clojure "1.2.1"]] to all your projects

15:37 rmarianski: ssideris: ok, thanks ... i appreciate it

15:38 raek: arnorhs: I usually start with something like this: http://gist.github.com/555485

15:39 rmarianski: ssideris: would you happen to know where in the clojure codebase the java collections are made seqable?

15:40 i figure that might give me some clues

15:40 ssideris: rmarianski: they are a different implementation

15:40 arnorhs: raek: except I also have compojure

15:40 ssideris: they are not java collections at all

15:40 arnorhs: + jetty

15:40 rmarianski: ssideris: right, but i can seq a java.util.ArrayList for example

15:40 that's very similar to what i'm trying to do

15:41 raek: just wanted to provide the minimal getting started with emacs project file...

15:41 ssideris: rmarianski: sorry, I'm new around here too :-)

15:41 raek: after doing "lein deps" you should be able to start a swank server with "lein swank" (by default on localhost and port 4005)

15:42 ssideris: raek: as far as I can tell, there have been attempts to be able to manage clojure-swank from within emacs, but that's still buggy, right?

15:43 raek: you mean clojure-mode.el=

15:43 ?

15:43 "Previous versions of Swank Clojure bundled an Elisp library called swank-clojure.el that provided ways to launch your swank server from within your Emacs process. While swank-clojure is still distributed with the project, it's a much more error-prone way of doing things than the method outlined above.

15:43 If you have configured your Emacs to use M-x swank-clojure-project then it should still work, but it's not recommended for new users."

15:43 from the swank-clojure docs

15:43 ssideris: by the way, is there a way to re-use destructuring statements?

15:44 raek: yeah, that's what i mean

15:44 raek: I think it was very hard to maintain

15:44 arnorhs: yeah, I saw that swank-clojure is listed from the packages list in emacs

15:44 so I should just ignore that

15:44 raek: yes

15:45 don't start slime with just "M-x slime". that is what's in swank-clojure.el (which is very outdated)

15:46 M-x slime-connect seems to be the way to go, nowadays

15:46 ssideris: i should automate all the questions that slime-connect asks me every time

15:48 * raek is starting to write a HTML document titled "Emacs, Slime, Swank Clojure and Leiningen - or - How to get started with Clojure in Emacs"

15:48 arnorhs: nice :D

15:49 raek: I've been thinking about writing this for a long time

15:49 arnorhs: I'll upvote that on every single site that has a vote button

15:49 ssideris: haha

15:49 gfrlog: what should I use if I like atoms but not retries?

15:49 ssideris: raek: a lot of people that haven't ever seen a lisp will not know what a repl is and they certainly wont know about slime

15:50 arnorhs: I got a 3 page error list when installing slime and slime-repl from the package list :)

15:50 raek: :(

15:50 somnium: I thought even java has a repl these days

15:50 beanshell or something?

15:50 cant imagine its very pleasant to use

15:51 raek: arnorhs: warnings or errors?

15:51 http://github.com/technomancy/swank-clojure section "Connecting with SLIME" is what I have read

15:52 arnorhs: do you have other versions of slime lying around?

15:52 arnorhs: well, hmm, I did download it with cvs

15:53 raek: does emacs know about it? :)

15:53 gfrlog: I'm going to guess agents with promises

15:53 arnorhs: it shouldn't

15:53 I didn't start installing

15:55 raek: maybe you could try with the package.el linked from the swank-clojure docs

15:56 arnorhs: I'm trying to remove it from the packages menu

15:56 there doesn't seem to be a remove command documented anywhere

15:57 why is there a sudoku game available as an emacs package?

15:57 ssideris: arnorhs: emacs is HUGE

15:57 technomancy: raek: have you thought about adding your info to the assembla wiki page instead?

15:57 ssideris: arnorhs: there are e-mail plugins, twitter clients, tetris etc for emacs

15:58 Raynes: technomancy: Rather than add to the 6 thousand old "Get started with Emacs, SLIME, and Clojure" blog posts!?!? No way man. ;)

15:58 raek: technomancy: yes

15:58 technomancy: ssideris: Emacs is a lot of things: http://p.hagelb.org/emacs-is.html

15:59 raek: it would not follow the current structure of the getting started wiki, but maybe that's a good thing

15:59 arnorhs: are there any get started with emacs, slime and clojure blog posts?

15:59 technomancy: arnorhs: tons and tons!

15:59 Raynes: The problem is that most of them are outdated.

15:59 technomancy: less than half of them have correct, useful info

15:59 arnorhs: orly

16:00 technomancy: "The great thing about standards is that there are so many to choose from."

16:00 arnorhs: like this one (top of google for get started with emacs slime and clojure):

16:00 http://nklein.com/2010/05/getting-started-with-clojureemacsslime/

16:00 ssideris: technomancy: it doesn't mention "Get things done" app

16:00 arnorhs: it ends with the sentence "What didn’t work .. i tried tried tried ... Edit: Ah, it appears that the Subversion repository for Clojure that I found is deprecated. But, I don’t have the energy to try the git repository myself at this point. Maybe next week."

16:01 so it doesn't look like the kind of guide you'd want to read

16:01 raek: whoa

16:01 Raynes: wut

16:02 And that post is recent!

16:02 technomancy: par for the course. =\

16:02 arnorhs: yes

16:02 but this one is alright http://lifeofaprogrammergeek.blogspot.com/2009/03/learning-clojure-and-emacs.html

16:02 but it doesn't explain anything

16:03 it doesn't mention swank

16:03 or lein or anything

16:03 technomancy: really the only thing to be done is try to increase the ranking of the assembla wiki and official docs

16:03 arnorhs: but this guy also wrote this: http://riddell.us/ClojureWithEmacsSlimeSwankOnUbuntu.html

16:03 no, he linked to that

16:03 what is assembla?

16:03 I've seen that wiki and read some stuff

16:04 technomancy: Clojure uses assembla as its official wiki and issue tracker

16:04 clojurebot: assembla?

16:04 clojurebot: assembla is http://www.assembla.com/spaces/clojure

16:04 technomancy: ~botsnack

16:04 clojurebot: thanks; that was delicious. (nom nom nom)

16:04 Raynes: $botsnack

16:04 sexpbot: Raynes: Thanks! Om nom nom!!

16:04 Raynes: I totally didn't steal that.

16:05 technomancy: clojurebot stole it from fsbot

16:05 fliebel: good evening

16:05 Raynes: sexpbot comes from a long line of thiefbots.

16:09 raek: test

16:09 fliebel: raek: test coming through ;)

16:10 arnorhs: The errors I get when just trying to install slime: http://pastebin.com/hKRWee87

16:11 raek: technomancy: what do you think should be mentioned (at minimum) in a getting started with emacs tutorial?

16:12 or, make that emacs and swank-clojure

16:12 arnorhs: those are actually just warnings

16:13 but here's the error I get when installing slime-repl: http://pastebin.com/y4JDdQc2

16:13 Seems like actual code errors

16:13 raek: I think it is important to have a getting started tutorial that covers the whole process, from emacs to the clojure jvm

16:14 arnorhs: yes, and one step at a time.. first just java+clojure+lein, then a seperate one for web development using compojure and then a third tutorial about installing slime, swank, slime repl, clojure highlighting etc.. , maybe?

16:15 ssideris: slime+swank etc is of general use

16:15 ti applies to non-web work

16:15 technomancy: raek: you could mention that Emacs 24 will come with an up-to-date package.el

16:15 ssideris: it

16:15 technomancy: raek: I really need to fix up my own personal package archive though

16:16 arnorhs: who manages the slime packages in emacs?

16:16 do you think there's somebody who'd like to know about the errors I'm getting?

16:16 technomancy: arnorhs: I'm the packager; upstream is really careless about releases.

16:16 arnorhs: ahh

16:17 who's upstream and where does he live?

16:17 raek: that says, this is a set of tools you may want to use. this perticular combination of tools is used as described here... etc

16:17 technomancy: arnorhs: http://common-lisp.net/project/slime/

16:19 ihodes: does anyone have any news on Enlive? I'd like to use it, but i'm a little worried it's been put on hold, and i don't want to maintain it… though it might be fine for my uses now, i'll have to test.

16:20 raek: what is the issue about the old package.el, and how do I install the new one in a simple way?

16:20 arnorhs: I was wondering about these installation instructions, since emacs install of slime is not working: http://common-lisp.net/project/slime/doc/html/Installation.html#Installation

16:20 technomancy: raek: the old one had some bugs preventing package insallation in some edge cases. it also doesn't support installing from multiple sources.

16:21 raek: there are two versions that fix those problems: the one on my github, and the one in Emacs 24. they aren't really the same

16:21 GNU adapted package.el for inclusion in Emacs 24 straight from tromey's buggy version

16:21 arnorhs: (setq inferior-lisp-program "/opt/sbcl/bin/sbcl") ; should this be just "lein repl" ?

16:21 technomancy: so I had to go back and replay my fixes on top of theirs

16:21 ihodes: technomancy: awesome. ugh.

16:22 technomancy: raek: I haven't tried the one bundled in 24 with 23, but it would be good to give that a spin and see if it works

16:22 that would simplify things quite a bit; I wouldn't have to keep my github fork around

16:22 arnorhs: yes and you would make my life sweet :)

16:22 is 24 not out yet?

16:23 tomoj: slime cvs is still broken for clojure, right?

16:23 technomancy: arnorhs: still at least a year away probably

16:23 arnorhs: ok

16:23 technomancy: tomoj: I haven't heard reports either way

16:23 maybe people just stopped using trunk; that would be nice. =)

16:24 raek: should one install elpa as usual and the replace the package.el file, or just put the package.el in .emacs.d/elpa/ and add a suitable line in .emacs?

16:24 arnorhs: so as things stand now, even though you guys say that using slime is the best way to develop... I can't install it because installaction from cvs isn't working and installaction from emacs packages are not working either?

16:24 technomancy: raek: the latter, I think

16:24 note that package.el from 24 needs an extra line of config to make it work with the elpa archive

16:25 raek: I'll try that

16:25 technomancy: raek: also would be good to make a clear distinction between package.el (the software) and ELPA (the site providing packages)

16:25 since now the FSF has their own package archive (which is basically useless since it only accepts libs with copyright assignment)

16:25 I've been guilty of conflating the two in the past

16:25 arnorhs: hmm.. what is package.el?

16:26 the script that controls the packages?

16:26 .el == emacs lisp or something?

16:26 technomancy: right

16:27 arnorhs: would that be (eq ".el" "emacs lisp") ?

16:27 lol

16:27 raek: it's a packet manager for emacs extensions

16:28 package-list-packages is a part of it

16:28 arnorhs: but for somebody starting out, this is a pretty horrible resource to start with: http://clojure.org/getting_started

16:28 raek: technomancy: it is great that you provide all this important information :)

16:28 arnorhs: yes it is

16:29 ihodes: http://data-sorcery.org/2009/12/20/getting-started/ this helped me get everything set up

16:29 arnorhs: what is incanter?

16:29 technomancy: arnorhs: that's pretty bad; it should be set up as a redirect to the assembla getting started page

16:29 that one is much better.

16:30 arnorhs: yes

16:30 ihodes: arnorhs: don't worry about incanter: this is applicable to just getting started. it's a stats library

16:30 arnorhs: ihodes: that's a great article

16:30 it starts out with just the words I wanted to hear

16:32 LauJensen: technomancy: emacs is a GUI toolkit?

16:32 ssideris: arnorhs: yeah, but given that you have no previous java experience, it's unlikely that you'll know of any of the other tools :-)

16:33 arnorhs: ssideris: yes :)

16:33 I programmed java applets in the 90's

16:33 ihodes: arnorhs: i'm so sorry

16:33 ;)

16:33 arnorhs: lol

16:33 ssideris: haha

16:34 arnorhs: I made a drawing application that you could save to files and I hated java forever after that

16:35 it was awesome

16:35 LauJensen: I once did an application that rendered text in a webrowser, I haven't been able to look at PHP since that :(

16:35 ihodes: yeah i did a stats program in Java about 5 years ago. it was gross.

16:35 had to interface with R. that was so painful.

16:36 ssideris: i write java for a living...

16:36 swing in particular

16:36 arnorhs: R the language?

16:36 Java is probably pretty awesome today

16:36 ihodes: ssideris: i made 6.95 an hour for that…but i guess i can't call it a living.

16:36 arnorhs: yes

16:36 ssideris: ihodes: and now?

16:37 ihodes: ssideris: got 12.50/hr for a summer working in Clojure. i was in high school then, so 7$ wasn't bad: didn't need to be making a living.

16:37 arnorhs: now he makes 695 an hour

16:37 ihodes: haha i wish. now i'm a poor college student.

16:40 ssideris: ihodes: so what were you working on? clojure itself? or writing something in clojure?

16:41 ihodes: ssideris: with clojure; it was/is a data analysis app for a neuroscience lab.

16:41 ssideris: was the language your choice?

16:41 or were they using it already?

16:41 ihodes: definitely mine haha

16:42 ssideris: ah ok

16:42 ihodes: their only other full-time computer engineer/programmer was using VB. and labview.

16:42 ssideris: just wondering how widely used it is already

16:42 VB! my favourite! (not)

16:42 ihodes: yeah. the program they were using crashed if you used it too quickly…

16:43 ssideris: yeah you don't want to surpise VB

16:43 *surprise

16:43 ihodes: haha yeah

16:44 raek: hrm, would you say that swank-clojure starts a "swank server" or a "slime server", btw?

16:44 ihodes: swank

16:44 swank = server, slime = client

16:44 raek: swank is the protocol, right?

16:44 arnorhs: process?

16:45 clojurebot: processing is a language/toolkit for visualizations. See the Clojure wrapper at http://github.com/rosado/clj-processing/

16:45 arnorhs: lol

16:45 ihodes: haha

16:45 arnorhs: clojure?

16:45 clojurebot: clojure is far closer to perfection then python

16:45 arnorhs: lol

16:45 python?

16:45 clojurebot: python is ugly

16:45 ssideris: hikey?

16:45 arnorhs: LOL

16:45 ihodes: it's a server–it's not like a protocol or anything (AFAIK)

16:45 hickey?

16:45 rish?

16:45 clojurebot: is_rhickey_is_a_minor_god? is yes

16:45 ihodes: rich?

16:45 excellent

16:45 arnorhs: slime?

16:46 clojurebot: slime-installer is http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560

16:46 technomancy: clojurebot: underscores? I am disappoint.

16:46 clojurebot: Excuse me?

16:46 technomancy: clojurebot: forget slime-installer

16:46 clojurebot: slime-installer is http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560

16:46 ihodes: emacs?

16:46 clojurebot: emacs is best configured for Clojure with instructions at http://technomancy.us/126

16:46 seangrove: Trying to get familiar with lazy sequences and what not - would it make sense for a lazy sequence that generates multiples of 20?

16:46 ihodes: haskell?

16:46 technomancy: clojurebot: slime-installer is deprecated

16:46 clojurebot: "you have to see features like that in the context of Haskell's community, which is something like Perl's community in the garden of Eden: detached from all shame or need to do any work." -- ayrnieu

16:46 c'est bon!

16:46 ihodes: haha so excellent

16:46 arnorhs: haskell?

16:46 clojurebot: "you have to see features like that in the context of Haskell's community, which is something like Perl's community in the garden of Eden: detached from all shame or need to do any work." -- ayrnieu

16:46 arnorhs: heh, sorry

16:47 ruby?

16:47 clojurebot: Chunky bacon!

16:47 tomoj: seangrove: that would make sense, yes

16:47 arnorhs: html?

16:47 php?

16:47 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

16:47 arnorhs: lisp?

16:47 clojurebot: "Like DNA, such a language [Lisp] does not go out of style." - Paul Graham, ANSI Common Lisp

16:48 ssideris: i saw a talk of Rich Hickey today were he apologised for teaching c++ in the past :-)

16:48 arnorhs: lol

16:48 ehhe

16:48 * raek makes a mental dependency graph of the concepts Clojure, Leiningen, Emacs, package.el, clojure-mode, SLIME and swank-clojure

16:48 arnorhs: yes

16:48 * arnorhs pats raek on the back

16:49 ssideris: raek: maybe fire up graphviz and make a real graph?

16:49 you know dot, right?

16:49 raek: I do in fact... it's nice

16:50 ssideris: i like the fact that it's almost zero effort

16:51 ska2342: Hi. Is anyone around who could help setting up compojure with maven?

16:53 ssideris: raek: are you doing this, or should I?

16:53 raek: I have done it on a piece of paper

16:53 arnorhs: maven is a lein alternative?

16:54 ssideris: arnorhs: maven is lein for the java world

16:54 arnorhs: ahh

16:54 ssideris: arnorhs: lein uses maven in the background

16:54 arnorhs: i see

16:54 ska2342: maybe I should have added "without making fun of it" :-)

16:55 arnorhs: lol

16:56 ska2342: anyway. As far as I understand things (and I am neither a Java nor a Maven guy) the 0.4.1 JAR of compojure doesn't include compojure.html anymore. When I try to :use compojure.html it can't be found and without that, I don't get the (html ...) functionality.

16:56 raek: leiningen uses maven for the whole dependency machinery

16:56 ordnungswidrig: ska2342: this has moved do hiccup

16:57 raek: ska2342: that has been split into a library called hiccup

16:57 ska2342: Ah, OK. I'll try that.

16:58 ssideris: great name

16:58 ska2342: would 0.3.0 suffice?

17:03 ssideris: raek: does this describe the situation accurately?

17:03 http://i.imgur.com/A7E7W.png

17:05 ihodes: i prefer to skip the package.el part

17:05 but thats' about right

17:07 raek: ssideris: yes! that was what I had in mind

17:08 ssideris: raek: ok, should I improve the formatting a bit and re-post it, or do you think it's unnecessary?

17:09 raek: I know how to make my own

17:10 technomancy: there should be some relationship (different from a dependency) between swank-clojure and slime

17:10 since they talk over a socket

17:11 ssideris: ok, I'm firing up inkscape

17:13 ihodes: ssideris: it'd definitely be useful. how might i contact you if i'd like ot use it in a blog post, if i may?

17:14 ssideris: ihodes: wait a few minutes for the better version and feel free to use it whenever you like...

17:14 ihodes: technomany: you suggested a java/clojure IO kind of post; i'm having trouble deciding what to cover. definitely stuff like slurp, spit and line-seq, and things like with-open and file etc. but what about things like read and PuchBackReader, BufferedRead

17:14 technomancy: see above

17:15 raek: ssideris: I think I will go with your version too

17:15 ssideris: ok... preparing shinier version, please wait

17:15 technomancy: ihodes: the basic java.io classes would be a good start, maybe followed by "best of" clojure.java.io?

17:16 PushBackReader is worth a mention too just because it's quirky and you won't be able to find much about it in the general Java literature.

17:16 ihodes: that's what i was thinking: i'd mention it along with 'read' in particular

17:17 since read's a fun deal. kind of a big deal/

17:17 raek: no hurry :)

17:18 ihodes: i'm trying to decide if i should split it up into 2 posts. but there's no great way of modularizing the content… and i'd prefer to publpish it all at once

17:20 but i have the best first line for the post, ever: It is a truth universally acknowledged, that a programmer using Clojure will want to perform IO.

17:20 technomancy: nice!

17:20 ihodes: haha gotta shove some english lit in there, right?

17:21 technomancy: that's always been my approach

17:21 LauJensen: technomancy: when you got a sec, check your query window

17:22 raek: preliminary outline: http://gist.github.com/555595

17:23 ihodes: nice. and html5, to boot ;)

17:25 raek: it follows the structure of the graph ssideris made

17:25 ihodes: technomancy: per the mailing list, seems 1.3.1 would be good to go for windows as well

17:26 darrenaustin: Hi folks, quick question: does 'lein repl' work correctly with 1.2?

17:27 ihodes: darrenaustin: it should

17:27 darrenaustin: I am running lein 1.3 and when I start the repl, it drops me in clojure.core and none of my project appears to be on the classpath.

17:27 ihodes: are you sure you're starting lein from your project's directory?

17:28 and that your project.clj has 1.2 specified for its version of clojure

17:28 darrenaustin: yes to both.

17:28 technomancy: ihodes: I saw a crazy bug on someone else's machine where the standalone install task put the shell wrapper in the wrong place and didn't even bother to get the deps

17:28 ihodes: and you're sure that you're running 1.3? are you on windows or a nix?

17:28 technomancy: but I can't repro here

17:29 darrenaustin: I am on Mac OS X

17:29 ihodes: technomancy: could that happen if they have some funky env variables set up?

17:29 technomancy: maybe

17:30 ihodes: darrenaustin: could you put in a gist or pastebin what you see after you start lein repl?

17:30 darrenaustin: if I wanted to try to reinstall lein, what do I need to delete other than the lein script itself?

17:32 ssideris: raek, ihodes: http://i.imgur.com/Z7ICw.png

17:32 also available in SVG if you prefer

17:32 ihodes: ssideris: freakin' awesome

17:32 ssideris: :-D

17:33 darrenaustin: sure thing, but there are no errors. It just starts with "REPL started; serverl listening on localhost:12610." and then dumps me into the repl in the clojure.core namespace.

17:33 ihodes: except who uses emacs without -nw? haha ;)

17:33 raek: awesome!

17:33 ihodes: darrenaustin: so instead of user=> you get clpojure.core=>

17:33 ssideris: glad you like it, feel free to use it

17:33 darrenaustin: lhodes: yeah.

17:34 raek: ssideris: found a typo... "swank-mode"

17:34 ihodes: ssideris: thanks so much. raek: good catch! should be swank-clojure

17:34 ssideris: oops

17:34 darrenaustin: and when I try to use a library from the project, it complains that it can't find the classes.

17:34 ssideris: ok let me update it

17:34 darrenaustin: Both of which work fine from swank.

17:36 I'll try reinstalling lein and see if that clears it up. Thanks for the help.

17:36 ssideris: raek, ihodes: http://i.imgur.com/ll4L2.png

17:36 ihodes: darrenaustin: please let me know–i'd like to fix this if it's a recurring issue. that's so bizarre

17:37 ssideris - i hate to ask you change it again... but maybeee instead of package.el, it should be ELPA

17:37 seangrove: Hey all, I have this: (def multiples-of-20 (iterate (fn [x] (+ x 20)) 20))

17:37 ihodes: for Emacs Lisp Package Archive, which is what package.el runs

17:37 raek: as I learned today: ELPA is the central repository

17:38 tomoj: seangrove: you'll probably want to turn that into a defn instead of a def

17:38 raek: not the project written in emacs lisp

17:38 ihodes: seangrove: you could do (iterate (partial + 20) 20) instead

17:38 tomoj: for example (defn multiples-of-20 [] ...)

17:38 ssideris: ihodes: ok ok

17:38 ihodes: ssideris haha sorry for the trouble–it really looks awesome

17:39 tomoj: as a def, multiples-of-20 will always point to the beginning of the seq, and so the beginning won't be garbage collected

17:39 seangrove: interesting

17:39 tomoj: so if you tried to do (nth multiples-of-20 100000) or something, all 100000 elements would end up in memory at once

17:39 as a function, (nth (multiples-of-20) 100000) works fine, because multiples-of-20 there refers to the function and you're not hanging on to the beginning of the seq

17:40 (called "holding the head" around here)

17:40 raek: 22:23 < technomancy> raek: also would be good to make a clear distinction between package.el (the software) and ELPA (the site providing packages)

17:40 seangrove: Very cool!

17:40 raek: 22:23 < technomancy> since now the FSF has their own package archive (which is basically useless since it only accepts libs with copyright assignment)

17:40 22:24 < technomancy> I've been guilty of conflating the two in the past

17:40 for me, the nodes in the graphs represent softwares, so would like it to remain "package.el"

17:40 seangrove: Thank you!

17:41 ihodes: raek: good call, didn't even think of it

17:42 ssideris: ok so what's the verdict?

17:42 ihodes: keep package.el :) you got it perfect

17:42 don't listen to me

17:42 ssideris: ok

17:42 * ssideris reverts the changes

17:42 ihodes: haha sorry about that

17:43 ssideris: ok, final version: http://i.imgur.com/9ZUMG.png

17:43 (i hope!)

17:44 tomoj: what do the edges represent?

17:44 ssideris: tomoj: depends on

17:44 apart from the one btween swank-clojure and SLIME

17:44 ihodes: ssideris: it looks awesome :)

17:44 ssideris: :-)

17:45 the one between swank-clojure and SLIME represents "these two things are connected with the power of thunder"

17:45 or something

17:45 Raynes: Sexy.

17:52 emh: what's a good way to set warn on reflection in a lib so that it works when I run the file for testing and when it is used/required by another file without throwing IllegalStateException?

17:52 just catch the exception?

17:53 I mean, it doesn't have to take effect when loaded from another file

18:09 LauJensen: Good night all - Here's a tip on how to unify development and production mode, so you dont have to switch around all the time: http://i.imgur.com/QbQVB.png

18:12 ssideris: haha

18:17 gfrlog: how do I check if a promise has been delivered

18:17 ?

18:19 danlarkin: what function has the prototype (f '[a b c d] '[1 2 3]) => '[[a 1] [b 2] [c 3] [d nil]]?

18:21 opqdonut: , (map vector [1 2 3] [4 5 6 7])

18:21 clojurebot: ([1 4] [2 5] [3 6])

18:21 opqdonut: almost :)

18:22 ssideris: it reminded me of zipmap

18:25 danlarkin: partition-all can do the second half, but interleave won't pair pas the end of the shorter seq

18:26 opqdonut: maybe make a version of map that follows the longest sequence and not the shortest?

18:28 Raynes: gfrlog: http://www.mail-archive.com/clojure@googlegroups.com/msg27029.html

18:28 tomoj: if you knew which arg was the longest you could lazy-cat the rest with (repeat nil), but that seems Wrong

18:28 opqdonut: it sure does

18:30 tomoj: copying map and just changing 3 things seems Wrong too :(

18:30 ssideris: it's very Perl-ish

18:31 opqdonut: how come?

18:31 ssideris: in perl you can say: my ($a, $b, $c) = (1, 2);

18:31 and $c will be undefined

18:32 i mean what you're trying to do reminds me of perl somehow

18:32 not the solution

18:34 gfrlog: Raynes: thanks

18:46 danlarkin: here's what I've come up with, http://gist.github.com/555658

18:46 change interleave to not stop at the length of the shorter seq

21:22 emh: the elegant simplicity of functional programming is ever growing on me :) . I just realized that instead of creating macros to compose protocols to create a more complex abstraction, I should just define predicate functions to check whether an object satisfies a set of protocols. OOP had me all screwed up, thinking in terms of hierarchies

21:23 ssideris: but how do you compose protocols then?

21:24 emh: I don't. it's not necessary

21:24 that's what I realized

21:25 ssideris: ah ok (don't know enough about protocols yet)

21:26 so you were creating a meta-macro of sorts?

21:26 emh: not to be confused with composing _default implementations_, or mixins, of protocols, which can be done with something like the methods a la carte library

21:26 ssideris: no, I was thinking I was going to have to

21:26 ssideris: sorry I meant meta-protocol

21:26 or super-protocol

21:27 emh: yeah, the idea was to have a protocol that had all the methods of several other protocols, and to paste it together using some macro trickery

21:27 but it's all backwards doing it that way

22:29 n2n3: ,()

22:29 clojurebot: ()

22:44 arnorhs: ihodes: http://twitter.com/ihodes/status/22403264493

22:44 ihodes: arnorhs: gotcha :) what are you hacking on now?

22:49 arnorhs: ihodes: not much. My first clojure project will be a half-baked comet implementation

22:50 I've been working on this simple (yet another) task list manager

22:50 which I only created to play around with html5 technologies

22:50 http://fridgelistapp.com/

22:51 I've got a big revision change coming up with almost a complete rewrite

22:51 and I'm doing real-time editing/updates of sharet tasklists through a lot of small ajax requests

22:52 so if you and I are editing the same tasklist in real time, you send an ajax request to edit and I have to pull it on a regular basis

22:52 I wanted to create a push mechanism by using "comet" (which isn't an actual technology but a term used to describe push through javascript)

22:53 I wanted to implement this thing in a language that is natively a process

22:53 and I've wanted to try clojure for a long time

22:53 Raynes: ->()

22:53 sexpbot: => ()

22:53 arnorhs: so, this seemed like the perfect time

22:54 I thought about using web sockets (sexy) and I should actually do that instead of the comet thing.. but it's only supported in FF4, chrome and safari 5 (no IE support yet)

23:08 ihodes: arnorhs: that sounds really interesting

23:08 arnorhs: as for sockets; are the people who'll be using your app using IE?

23:08 arnorhs: i hate waiting for a shitty browser to play catch-up, and its market char is dropping fast (though i guess it's sitll significant)

23:20 arnorhs: ihodes: It's just about everybody

23:20 I have a few regular users and there are a lot of them using ie

23:21 I might just use comet for IE and web sockets for the rest.. and then gradually throw comet out

23:22 traditional comet is done through an invisible iframe and it works crappy in safari

23:22 so web sockets+comet

23:22 anyways

23:22 gn

23:22 it's 3:20 am here in Iceland

23:24 ihodes: goodnight :)

23:24 it's just 11:30 here. plenty of time

23:37 tomoj: ihodes: websockets work in firefox?

23:38 oh, FF4, huh? cool

23:38 ihodes: yeah. can't wait to use them everywhere soon :)

23:41 * technomancy hums the miniboss theme from FF4

23:44 ihodes: haha *that* ff4 won't be seeing websockets any time soon

23:45 technomancy: not even on the DS remake?

23:45 ihodes: no, you're right. it'd really enhance the game ;)

23:45 i'm sure it makes it into the DS

23:46 stacktracer: how do I set clojure.pprint/*print-miser-width* (for repl purposes)?

23:47 slyrus: and when is *print-circle* going to be implemented?

23:48 tomoj: does the DS have opera or is that just the wii?

23:49 technomancy: tomoj: it does, but it's slooooow.

23:50 it's not built-in either; I had to order mine from Japanland

23:53 stacktracer: never mind ... *print-right-margin* is the thing I was looking for ...

Logging service provided by n01se.net