#clojure log - Aug 05 2010

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

1:14 zkim: anybody have a good temp directory macro?

1:17 talios: nope - even in java I don't. I tend to use File.createTempFile() - then delete it, then mkdir it.

1:18 why theres no createTempDir() method I don't no - there might be on the forthcoming java7 APIs tho

1:18 zkim: got it, thanks anyway

1:51 Slant: Is there a streaming JSON API?

1:53 hiredman: streaming in what sense?

1:53 in that it can read and write to io streams?

1:53 all json libs I know of can do that

1:54 Slant: In that it doesn't consume all the data off the stream and convert to objects in-mass.

1:54 In that I can read the objects as they come off the stream, incrementally.

1:55 hiredman: clojure-json will read one json form from a stream at a time

1:57 Slant: Is that danlarkin's github one? Or the one in contrib?

2:00 zkim: talios: ugly but works, temp directory macro: http://gist.github.com/509311

2:00 hiredman: Slant: github

2:01 the one from contrib might too, never used it

2:01 lancepantz_: member:Slant: i'd check out clj-json while you're at it's something like 20x faster than the pure clojure implementations

2:02 slyrus: lancepantz_: that's depressing

2:05 lancepantz_: i'm anxious to see if closer ever passes java in performance

2:05 Slant: Ahh, it uses Jackson.

2:05 lancepantz_: yep

2:05 is jackson native?

2:05 Slant: That's pure-Java.

2:05 slyrus: lancepantz_: closer?

2:05 Slant: No. Jackson is pure-Java.

2:05 lancepantz_: clojure :)

2:05 Slant: Also, it's incremental.

2:05 Sweet.

2:05 That might work perfectly, thanks!

2:05 lancepantz_: np

2:05 slyrus: passing is one thing, 20x worse is another

2:06 Slant: http://github.com/mmcgrana/clj-json/blob/master/src/clj/clj_json/core.clj - Small.

2:06 tomoj: why is pure-java 20x faster than clojure? :(

2:07 lancepantz_: there's a jvm folder in there too, to be fair

2:07 Bahman: Hi all!

2:07 lancepantz_: but mcgranaghan does write insanely good code

2:09 Slant: That's true.

2:10 Playing with that now.

2:10 Since its lazy seq seems to be *exactly* what I wanted.

2:29 notsonerdysunny: what is a good symbolic-math library for clojure?

2:30 I want to do basic algebra,differentiation, integration and some tensor-calculus

2:38 Slant: notsonerdysunny, free?

2:38 notsonerdysunny: free would be good .. but paid is also ok

2:47 SandGorgon: notsonerdysunny, try http://data-sorcery.org/contents/ (Incanter).

2:49 Slant: How are module constants usually defined?

2:49 notsonerdysunny, or Clojure w/ Mathematica?

2:51 (def CONSTANT value) ?

2:52 tomoj: don't use uppercase

2:52 Slant: Right.

2:52 tomoj: but, yeah

2:52 Slant: Of course. Clojure everything is immutable.

2:53 tomoj: incanter can't do any symbolic math, can it?

2:55 technomancy: ok, harmless is good :)

3:02 Slant: So only defns and not defs enter a namespace when you use?

3:03 raek: no, defs are public by default too

3:03 there is a lot of def* macros ending in a hyphen that does the same as the un-huphened, but makes them private

3:04 e.g. defn and defn-

3:04 Slant: But for variables?

3:04 raek: clojure.contrib.def has some extra macros

3:04 Slant: (def some-internal-helper-constant 1234)

3:04 raek: (defvar- internal-constant 1234 "the number of foos in bar")

3:05 you can also do this with metadata

3:05 Slant: Ahh.

3:05 raek: (def ^{:private true, :doc "some docs"} name value)

3:05 the defvar and defvar- forms are in c.c.def

3:06 Slant: Gotcha.

3:06 How are def and defvar different

3:06 ?

3:06 raek: values that are intended to be rebounded usually have *earmuffs*

3:06 defvar has a dosctring arg

3:07 but that's pretty much it :)

3:07 (def *default-something* 1)

3:07 (binding [*default-something* 2] ...)

3:08 but save the earmuffs for things that should be dynamically rebound

3:17 Slant: (Is there a way to local mirror clojuredocs or some other doc site?)

3:17 I'm going on an airplane soon and would like to take them with me. :-D

3:18 raek: the http://clojure.github.com/clojure/ is generated with autodoc

3:19 maybe there is a build task for generating the docs html in the clojure and contrib source

3:21 Slant: http://tomfaulhaber.github.com/autodoc/

3:21 you should be able to run that on the sources

3:23 I haven't tried it though... so take that witha grain of salt

3:28 Slant: ghuhughg. Lein repl.

3:28 So painful sometimes. One pair of mismatched parens, and it's crash city.

3:36 Derander: Slant: give me paredit or give me death

3:38 raek: "I’m now convinced that choosing a language based on how easy it is to read or write is a very bad idea. What if we chose musical instruments based on how easy they are to play? Everyone would playing kazoos. You can’t think deeply about music if all you know is a kazoo."

3:38 (from http://blog.fogus.me/2010/08/03/take-5-brenton-ashworth/ )

3:41 lancepantz_: i thought that was very insightful as well

3:42 anyone know of any resources for documentation on the innards of the slime protocol

3:43 it looks like i uses some type of generic sexp

3:43 but i cant find any solid docs

3:47 lpetit: lancepantz_: when I started the work on ccw (the eclipse plugin for clojure), I wanted to use the swank/slime protocol, and rewrite a client in "pure clojure". Alas, I searched very hard, but the only answers I got were: "no doc, you should reverse engineer". Since that I've turned my back to swank/slime :-( and implemented a quick proprietary solution for ccw.

3:48 lancepantz_: but maybe I've not searched hard enough, of course.

3:48 lancepantz_: :(

3:50 i suppose im kinda taking a shot at what you did

3:50 but slightly different

3:52 lpetit: yes ?

3:53 lancepantz_: i'm working on this new project that everyone hates :)

3:53 it has a persistent jvm

3:53 with the persistent jvm, one could theoretically make slime calls to it through the command line

3:54 david nolen suggested that it could be used to get clojure integration into text mate

3:54 so i'm trying to create the proper abstractions that will pass command line options into swank

3:56 lpetit: lancepantz_: I would love the idea of eventually switching to a common standard for accessing clojure envs remotely.

3:57 lancepantz_: yeah, it would work for any idea, even vim

3:57 you can see what we have at http://github.com/ninjudd/cake

3:58 a good example is just to do cake eval '(+1 1)'

3:58 you'll get 2 at your command prompt

3:58 lpetit: lancepantz_: but if it's from the command line *only*, it's a shame : will be OS dependent, more difficult to integrate into an existing IDE written in clojure/java, etc.

3:59 I'll look at it later (I'm in my workplace right now), thanks for the input

3:59 lancepantz_: what would be better?

3:59 i mean a socket would be the same thing that swank already provides

4:01 lpetit: lancepantz_: if it works via socket it's ok. But will you provide the "client" part of slime/swank ? That's what I'm interested in, not just "yet another remote text based repl implementation" ;-)

4:02 lancepantz_: well, obviously the client would have to be build for each ide

4:03 maybe i'm missing something, why do ide's not connect to swank as it exists now?

4:05 lpetit: lancepantz_: as for ccw, it's because I don't know how to speak with swank. If there was a proper documentation, it'll be ok. The only "API" for slime is in emacs lisp

4:06 lancepantz_: i see

4:06 yeah, it looks pretty hairy

4:07 state machines and automatons

4:07 maybe i should just create a simpler protocol for evals, documentation, tab completion etc

4:08 cais2002: hi, for string processing like finding occurrence of substring, should I use the java function directly or are there some library in clojure syntax?

4:09 lancepantz_: cais2002: clojure.string exists, but most of the time the java methods work best

4:09 or is it still in contrib, it may be clojure.contrib.string

4:12 cais2002: lancepantz_: I saw contrib.string, but there is even an author associated with it. a bit skeptical

4:12 there are also str-utils and str-utils2

4:12 lancepantz_: contrib.string is what you want

4:12 str-utilsx was deprecated in 1.2

4:13 and merged into contrib.string

4:13 it's maintained by the core commiters

4:14 lpetit: lancepantz_: look at what is done in enclojure for remote ccw environment invocation. In the mailing list, you'll see that Eric Thorsen posted about it: in order to allow the future unification of this for both enclojure and counterclockwise, he made a proper repository for the client and server code

4:14 lancepantz_: lpetit: oh wow, thanks for the lead, looking into it now

4:14 lpetit: lancepantz_: oh, no, it's more for REPL stuff than for "IDE-backend purpose" stuff. Or maybe I'm wrong and it can serve both

4:15 lancepantz_: we've got our repl with tab completion and readline support :D

4:15 lpetit: lancepantz_: I invite you to ask on the enclojure ml to get precisions on what they use for "IDE-backend communication purpose"

4:15 if that's the only thing you want, then yes, this part is solved for you :)

4:16 lancepantz_: so the enclojure mailing list

4:16 guess we had some duplicated work there then

4:18 oo, that repl does look nice

4:18 we don't even get syntax highlighting in the slime repl

4:25 Slant: Derander, paredit?

4:26 Derander: emacs mode that makes paren matching trivial

4:26 and lets you do operations on sexps

4:27 Slant: Ahh.

4:30 lancepantz_: Slant: you have to use paraedit

4:30 biggest single productivity boost i found for working with clojure

4:31 Derander: highlight-parenthesis-mode is my second favorite ;-)

4:31 lancepantz_: i use rainbow parens too

4:32 Slant: Sadly, I'm a vim user.

4:32 Stuck in that ghetto.

4:32 Trying out vimclojure. Trying to get the repl mode up and running.

4:32 Derander: I learned emacs for clojure

4:32 it can be done!

4:32 still love vim though.

4:33 Slant: Derander, I don't have years to commit just to get to an equal level. I think in vim, you know?

4:33 I respect emacs.

4:33 Derander: yeah.

4:33 lancepantz_: i used to be, i just bit the bullet and switched

4:33 Derander: I had that problem for like 8 months :-P

4:33 now I can work equally well in either with a few minutes to adjust fingers

4:33 lancepantz_: i dropped vim altogether

4:33 after about a week i was comfortable

4:34 Derander: I had to learn elisp so that I could get emacs to a usable state for ruby/rails coding

4:34 mumamo didn't work very well, so I had to figure out how to get rhtml-mode working, and then that was insufficient so I had to learn how to customize syntax highlighting, etc.

4:37 Slant: Too many yaks, at the moment.

4:37 I'll play with vimclojure. Get to hate it. Learn me some clojure.

4:37 Then switch. :_D

4:37 Derander: I am a professional yak shaver.

4:43 lpetit: Slant: vimclojure is good enough for a respectable number of users. No need to blame the concurrency to make your preferred choice much appealing.

4:43 Slant: e.g. chouser, one of the co-authors of "Joy of Clojure", is using vim / vimclojure, and likes it, AFAIK

4:54 cais2002: suppose I want to aggregate members of 2 different namespaces into one, is there a way to do it?

5:00 Slant: cais2002, use both?

5:00 raek: there is clojure.contrib.ns-utils/immigrate

5:00 but there are some issues

5:00 cais2002: ,(doc immigrate)

5:00 clojurebot: "clojure.contrib.ns-utils/immigrate;[[& ns-names]]; Create a public var in this namespace for each public var in the namespaces named by ns-names. The created vars have the same name, root binding, and metadata as the original except that their :ns metadata value is this namespace."

5:01 cais2002: raek: that seems to be the perfect one I need

5:01 raek: it creates new vars that are not the same vars as the immigrated ones

5:01 it works for simple cases

5:02 dynamic rebinding of the var in the ns that was immigrated to does not affect the one in the namespace that was immigrated from, and vice versa

5:30 Slant: What's wrong with this? (ns none.search

5:30 (:use [clojure.contrib.duck-streams :only reader]])

5:30 (:require (clj-json [core :as json])))

5:30 Are the vectors not correct?

5:31 (remove the excess ])

5:31 (Bad copy-pasta)

5:33 hoeck: (:use [foo.bar :only [baz]])

5:35 Slant: hoeck, only vectors? Not lists?

5:35 hoeck: not sure, but definitely something seq-like after :only :)

5:36 Slant: And to the :use ?

5:36 That is (:use ?foo.bar :only [baz]?)

5:36 It is always supposed to be a vector?

5:38 Ugh.

5:38 hoeck: Slant: yes

5:38 Slant: I keep getting these IllegalStateExceptions about defining "spit"

5:38 hoeck: at least using () dos not work for me

5:38 Slant: Just from using duck-streams.

5:38 I thought doing :only [reader] would solve it.

5:38 Apparently not.

5:39 raek: Slant: do a (ns-unmap 'you-ns 'spit)

5:39 hoeck: maybe you evaluated the ns before without the :only option?

5:39 Slant: hoeck, even after I restart the interpreter...

5:42 hoeck: which clojure are you using? for me, spit is in core

5:42 ,spit

5:42 clojurebot: #<core$spit clojure.core$spit@24fade>

5:42 hoeck: and not in duck-streams anymore

5:43 (ns foo.bar (:refer-clojure :exclude [spit]) .... ) should help then

5:44 Slant: hoeck, whatever lein pulled down.

5:45 hoeck: then its probably some snaphsot :)

5:45 Slant: Yay. :-D

5:46 hoeck: if you eval spit on the repl, and the result looks like the one from clojurebot above, use the refer-clojure :exclude form to avoid refering to spit in your namespace

5:52 Slant: Got it cleaned up.

5:52 On to the next problem. :-D

5:53 I tried doing a (drop 1 (reader ...))

5:53 But, since a reader isn't a sequence, of course that doesn't work.

5:54 Ideas on alternate ways of accomplishing the same? I'm trying to drop the first (and later, the last) bytes of a bufferedreader.

5:55 cais2002: is the naming convention to use capitalization for protocol name?

5:55 raek: Slant: you'll gave to make a sequence in some what

5:56 *way

5:56 for example

5:58 (defn byte-seq [input-stream] (lazy-seq (let [value (.read input-stream)] (if (= value -1) nil (cons val (byte-seq input-stream))))))

5:58 that takes a InputStream, not a Reader

5:58 Streams = bytes, Readers/Writers = characters

5:59 a similar thing for characters:

6:01 (defn character-seq [reader] (lazy-seq (let [value (.read reader)] (if (= value -1) nil (cons (char val) (character-seq reader))))))

6:01 s/(char val)/(char value)/

6:01 sexpbot: (defn character-seq [reader] (lazy-seq (let [value (.read reader)] (if (= value -1) nil (cons ((char value)) (character-seq reader))))))

6:02 Slant: Gotcha.

6:02 Hmm.

6:02 raek: cais2002: as far as I can tell, yes

6:03 this is probably because they generate java interfaces

6:03 hrm, sexpbot added an exta pair of parens in that substitution...

6:03 tomoj: anyone using org-babel with clojure?

6:03 Slant: raek, character-seq isn't in contrib or anything? Seems like something that must be ran into often.

6:03 tomoj: looks like it requires swank-clojure.el :(

6:05 raek: there is line-seq, but I don't think the ones I wrote are there

6:06 I'm making a small library that splits these things in two parts: Sources that kan take one thing at a time, and source-seq that lazily takes item from a Source and present them as a seqeuence

6:06 just because I find myself writing these lazy sequences every now and theen

6:09 a slightly outdated version of it http://gist.github.com/460527

6:09 and a less outdated api reference http://raek.se/stream-seq/

6:11 Slant: Very interesting. Thanks.

6:11 Good to read good code right now. :-)

6:13 raek: I don't know if this lib will simplify things in the end

6:13 but experiments are good. some of them fails, but that's fine.

6:38 LauJensen: Good morning all

6:39 esj: salute !

6:39 neotyk: 'morning

7:09 lpetit: hello

7:13 LauJensen: Hello, La-ô

7:14 LauJensen: Bonjour mon petit :)

7:14 lpetit: LauJensen: everytime Christophe pronounces your first name, I don't understand how he's talking about, 'cause I'm not used to pronounce it "La-ô" :-)

7:15 LauJensen: Well - You guys are french, so Im very forgiving when you fail to pronounce an ancient danish name :)

7:15 lpetit: :)

7:45 ~source clojure.lang.Delay

8:05 aldebrn: Good morning all

8:05 LauJensen: Morning

8:06 aldebrn: Forgive me if this is the second time I've asked this but, I'm looking for a "Java for Clojure/Lisp programmers" resource because my attempts to learn as little Java as possible to use existing Java libraries (something I only consider thanks to Clojure <3) is not working, and traditional Java pedagogy seems to be overkill for this

8:06 Advice?

8:06 clojurebot: live every week, like it is shark week!

8:10 rhudson: aldebrn: The book "Java in a Nutshell" might be a good resource. The first part of the book is a quick introduction to the language. The bulk of it (and it's bulky!) is a compact reference to the standard libraries. (When I'm trying to get the lay of the land, this is often more useful than javadocs.) There's also references to the standard tools.

8:12 I think a lot of Java intros try to tell you how to program in Java, which isn't what you want.

8:14 The indexes are also good. If you see some mention of, say, "annotations", it's easy to find the part of the book that explains what that's about.

8:16 aldebrn: Great, thanks rhudson

8:19 rhudson: The latest published edition is for Java 5, but the language and library differences between that an the current Java 6 are really minor.

8:25 aldebrn: Wow, it is a big book

8:26 'the Java language has proved popular with programmers, who typically find it a pleasure to work with Java after struggling with more difficult, less powerful languages' <-- this should be good :) thanks again rhudson

8:28 bortreb: hi everyone

8:30 anyone have a good emacs color scheme for hacking during the day? I use zenburn at night but it's not working too well in the sun.

8:32 tomoj: are you going to hook it up so that it auto-switches based on sunrise/sunset data for your current location? ;)

8:35 raek: day hacking => black on white, high contrast?

8:35 bortreb: yep

8:35 I was thinking about making it switch depending on the time :)

8:35 raek: nice

8:36 I use a variant on a scheme called something like dark-tango and the default emacs colors if I need something more bright

8:37 tomoj: I just a couple hours ago switched from my custom dark to the default emacs

8:38 sid3k: is the function named "refer" function deprecated?

8:38 tomoj: nope

8:38 bortreb: but is there an uber cool there like zenburn except light?

8:39 tomoj: -> (:deprecated (meta #'refer))

8:39 sexpbot: java.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/refer)

8:39 tomoj: oh, yeah

8:40 raek: ,(:deprecated (meta #'refer))

8:40 clojurebot: nil

8:41 raek: ,(:deprecated (meta #'add-classpath)

8:41 clojurebot: EOF while reading

8:41 raek: ,(:deprecated (meta #'add-classpath))

8:41 clojurebot: "1.1"

8:44 raek: ;;; Color theme based on Tango Palette. Based on a color theme by danranx@gmail.com

8:44 (defun color-theme-dark-clojure ()

8:44 "A color theme based on Tango Palette."

8:44 (interactive)

8:44 (color-theme-install

8:44 '(color-theme-dark-clojure

8:44 ((background-color . "#2e3436")

8:44 (background-mode . dark)

8:44 (border-color . "#888a85")

8:44 (cursor-color . "#fce94f")

8:45 (foreground-color . "#eeeeec")

8:45 (mouse-color . "#8ae234"))

8:45 ((help-highlight-face . underline)

8:45 (ibuffer-dired-buffer-face . font-lock-function-name-face)

8:45 (ibuffer-help-buffer-face . font-lock-comment-face)

8:45 (ibuffer-hidden-buffer-face . font-lock-warning-face)

8:45 (ibuffer-occur-match-face . font-lock-warning-face)

8:45 (ibuffer-read-only-buffer-face . font-lock-type-face)

8:45 (ibuffer-special-buffer-face . font-lock-keyword-face)

8:45 (ibuffer-title-face . font-lock-type-face))

8:45 (border ((t (:background "#888a85"))))

8:45 (fringe ((t (:background "grey10"))))

8:45 (mode-line ((t (:foreground "#eeeeec" :background "#555753"))))

8:45 (region ((t (:background "#555753"))))

8:45 (font-lock-builtin-face ((t (:foreground "#729fcf"))))

8:45 tomoj: bad raek

8:45 raek: (font-lock-comment-face ((t (:foreground "#888a85"))))

8:45 (font-lock-constant-face ((t (:foreground "#8ae234"))))

8:45 (font-lock-doc-face ((t (:foreground "#888a85"))))

8:45 (font-lock-keyword-face ((t (:foreground "#729fcf"))))

8:45 (font-lock-string-face ((t (:foreground "#ad7fa8"))))

8:45 (font-lock-type-face ((t (:foreground "#8ae234"))))

8:45 (font-lock-variable-name-face ((t (:foreground "#eeeeec"))))

8:45 (font-lock-warning-face ((t (:bold t :foreground "#f57900"))))

8:45 (font-lock-function-name-face ((t (:foreground "#edd400"))))

8:46 (comint-highlight-input ((t (:italic t :bold t))))

8:46 (comint-highlight-prompt ((t (:foreground "#8ae234"))))

8:46 bozhidar: grrrr

8:46 raek: (isearch ((t (:background "#f57900" :foreground "#2e3436"))))

8:46 (isearch-lazy-highlight-face ((t (:foreground "#2e3436" :background "#e9b96e"))))

8:46 (show-paren-match-face ((t (:foreground "#2e3436" :background "#73d216"))))

8:46 bozhidar: won't someone kick him already...

8:46 raek: (show-paren-mismatch-face ((t (:background "#ad7fa8" :foreground "#2e3436"))))

8:46 (minibuffer-prompt ((t (:foreground "#729fcf" :bold t))))

8:46 (info-xref ((t (:foreground "#729fcf"))))

8:46 Chousuke: eep :P

8:46 raek: (info-xref-visited ((t (:foreground "#ad7fa8"))))

8:46 )))

8:46 (provide 'color-theme-dark-clojure)

8:46 whoa!

8:46 SOOOOOORYYYY!

8:46 am I banned?

8:46 opera does not copy text when I select it every time

8:46 Chousuke: nah, :P

8:46 tomoj: heh

8:46 bozhidar: raek: haven't you heard of a paste service ;-)

8:46 tomoj: your irc client should warn you or require you to press enter after pasting

8:47 Chousuke: irssi does that. it has saved me a number of times

8:47 raek: my usual routine is: select URL in browser, middleclick in terminal

8:47 however

8:47 sid3k: opera is worse than even internet explorer

8:47 raek: opera does not always copy the text into the PRIMARY buffer

8:47 sid3k: p.s: 6

8:47 tomoj: erc just requires you to press enter, so every once in a while I'll accidentally copy some of the history, including the ERC> prompt, and then not realize that I've pasted it :(

8:48 raek: so I end up pasting what was there since the last time

8:48 well irssi does that too

8:48 but I accidentally hit the wrong key

8:48 somebody, please, revoke my IRC license...

8:48 tomoj: just cut a corner off it

8:49 AWizzArd: raek: I hope for you it was not copyrighted closed source code from your company :)

8:49 raek: man I feel so stupid...

8:50 tomoj: don't worry about it, no one was injured afaik

8:51 raek: I'm impressed that the server did not filter some of it

8:51 tomoj: looked like your client was rate-limiting?

8:51 raek: or maybe it did for you

8:51 bozhidar: I'm impressed nobody kicked you this long, this shows what a friendly environment is built around Clojure :-)

8:52 Chousuke: I haven't actually seen anyone ever get kicked from here :P

8:52 tomoj: are there even any ops?

8:52 Chousuke: maybe? I don't know.

8:52 bozhidar: I guess Rich might be an op, but he's quite busy to moderate an irc channel

8:53 raek: iirc, rich isn't an op

8:53 but the channel owner still hangs here

8:53 bozhidar: who registered the channel?

8:54 raek: some nick beginning with j, i think. maybe chanserv can tell

8:54 tomoj: jcowan? :D

8:54 bozhidar: before I came to freenode I didn't use irc for 10 years

8:54 and I don't remember most of the commands

8:54 I used to know them all back in the day...

8:54 AWizzArd: Chousuke: yes, they can not get kicked, because this channel has no operator :)

8:55 bozhidar: I cannot even remember how to check the channel info...

8:55 tomoj: yep, /q chanserv info #clojure, it was jcowan

8:55 AWizzArd: Yes, but he logs in only every 10 months or so (:

8:55 rhudson: ,seen jcowan

8:55 clojurebot: java.lang.Exception: Unable to resolve symbol: seen in this context

8:55 Chousuke: AWizzArd: chanserv can op people who have the rights though.

8:55 AWizzArd: Chousuke: yes, but it is only that one guy who registered this chan and never was seen again

8:56 Chousuke: heh

8:56 tomoj: never seen again?

8:56 AWizzArd: Okay, he joined some months ago, and for a few days chouser got ops

8:56 tomoj: I thought he was pretty active in the early days

8:56 AWizzArd: ~seen jcowan

8:56 clojurebot: no, I have not seen jcowan

8:56 AWizzArd: Yes, back in 2008

8:56 Chousuke: if the channel ever gets overrun by trolls I suppose Freenode staff can transfer ownership to someone more active.

8:56 tomoj: .i jy. jbocre .iosai

8:57 AWizzArd: Anyway, I really don't see why operators are needed. Practically zero incidents, plus what Chousuke said.

8:57 And there is always /ignore

8:57 bozhidar: it's better to be safe than sorry...

8:57 sid3k: hi all, I've upgraded my system and slime/swank doesn't work anymore. firstly it asks the "versions differ" message, if I say yes and continue, this time it doesn't execute the commands I type, when I press enter, it creates a new line

8:58 bozhidar: I remember some good forums ruined by lack of moderation

8:58 rhudson: We're all pretty moderate here

8:58 bozhidar: the community is still small, but this will certainly change

8:58 as Clojure is growing in popularity

8:59 and early adopters tend to be much more civilized ;-)

8:59 sid3k: bozhidar: I know lots of good not moderated communities, seriously

8:59 not moderated and hq

8:59 bozhidar: sid3k: I know some as well, but accidents do happen

8:59 sid3k: btw, any ideas about the question I've asked?

8:59 bozhidar: and many people are idiots

8:59 sid3k: bozhidar: don't worry

9:00 tomoj: sid3k: are you M-x slime-connect ing?

9:00 sid3k: tomoj: yeah

9:00 tomoj: and the repl is in REPL mode?

9:00 #emacs might be more help

9:00 sid3k: yeah, I see REPL, Autodoc text in the status line

9:01 arright

9:01 raek: sid3k: which version of slime do you use? a recent?

9:01 sid3k: I guess

9:02 raek: I've seen that problem some time, but it disappeared when I updated slime and swank

9:02 sid3k: raek: version of the slime I'm running is 2010-07-21

9:03 raek: which version of swank?

9:03 how did you start it? lein swank?

9:05 also, if the encodnings of swank and slime don't match, it will freeze when you enter a non-ascii char

9:06 but unless you fiddle with those settings, that should be fine

9:07 rhickey: has anyone tried the latest from git (yesterday)? esp people with custom IPersistentMap impls

9:09 raek: does one get equality-with-maps automatically whith records now?

9:09 sid3k: raek: sorry for long delay, I lost my internet connection

9:09 my wank version is 20100404

9:09 *swank

9:11 raek: sid3k: do you have [swank-clojure "1.2.0"] in you project.clj?

9:12 sid3k: raek: I've 1.2.1

9:12 raek: then I have no idea... :)

9:12 sid3k: arright

9:13 I'm trying to fetch latest version of swank from its repo

9:13 raek: using [clojure "1.2.0-RC1"] also?

9:14 my hunch is that this could be some version incompability issue

9:16 tomoj: sid3k: you're not using ELPA slime, I guess?

9:17 sid3k: elpa slime?

9:18 raek: ...instaled from M-x package-list-packages

9:18 sid3k: yeah, I've installed it from debian testing repository

9:19 raek: http://tromey.com/elpa/install.html <-- instruction on how to install elpa

9:20 sid3k: I've got elpa already, now trying to reinstall slime

9:20 raek: then simply do a M-x package-list-packages, select slime and slime-repl and install

9:20 ah, good

9:20 tomoj: if you have slime installed from somewhere else, things will go badly I think

9:21 sid3k: tomoj: bingo

9:21 elpa displays slime as disabled

9:21 but I've already remvoed slime

9:43 rhickey: aargh, the 2 Clojure talks at Java One are scheduled for the same time slot

10:06 LauJensen: :(

10:07 rhickey: perhaps a quick email to the organizers would help

10:08 rhickey: LauJensen: not likely

10:08 LauJensen: You wont know if you dont try :)

10:09 fogus: Perhaps they expect that people will attend both ... on different timelines. (groan)

10:11 sid3k: why clojure projects uses "com" in their directory names?

10:12 rhickey: LauJensen: not true: "Session Schedule is Final:

10:12 The Oracle Content Team will not be able to accommodate requests for schedule changes."

10:12 xkb: do inner functions have a different behavior regarding concurrency then "normal" defn functions?

10:12 AWizzArd: sid3k: authors following Oracles guidelines for namespace names.

10:12 LauJensen: rhickey: alright, your call

10:12 sid3k: AWizzArd: is it necessary?

10:13 AWizzArd: rhickey: and will you be the one who is supposed to give those both talks?

10:13 rhickey: AWizzArd: no

10:14 AWizzArd: Maybe this is a good sign: Oracle accepts Clojure now as one of the main langs for the JVM and says that also some Java talks are scheduled at the same time.

10:17 LauJensen: Oracle liking Clojure... I dont know if thats good or bad

10:18 bozhidar: LauJensen: Oracle likes only money, they have no respect for technology

10:18 Sun was a totally different beast, but sadly they never managed to capitalize on their great technology...

11:25 AWizzArd: Did Clojure always throw error messages for (byte 200)?

11:27 Or was byte silent in previous versions?

11:28 LauJensen: AWizzArd: try git-blame on RT.java line 904. I cant remember if its always been this way

11:30 danlarkin: it did not always

11:30 I think that has only been the case for a few months?

11:31 AWizzArd: Is there a built-in fn to convert unsigned-bytes into bytes?

11:34 sid3k: I'm reinstalling Clojure following these instructions; http://riddell.us/ClojureOnUbuntu.html

11:34 somehow, mvn package command doesn't create a jar file in clojure-contrib directory

11:35 any ideas?

11:36 lpetit: sid3k: if you're "following instructions to install clojure", then you'd better use something pre-packaged. use cljr

11:37 sid3k: lpetit: sorry but I'm not familiar with java world

11:37 raek: there are jars on http://build.clojure.org/releases/ and http://build.clojure.org/snapshots/

11:37 lpetit: sid3k: my point is that if you feel the need to "follow instruction" "to install", then you should not rebuild it yourself.

11:38 sid3k: lpetit: what do you mean? I'm trying to do what that page says?

11:38 raek: thanks

11:38 raek: a common way to get started it to get and install leiningen, lein new, tweak dependencies in project.clj, lein deps, lein swank

11:39 only requires java, I think

11:39 lpetit: sid3k: you don't need to build things yourself. There are already packaged jars, and if you don't know java world well, there are also things wrapped up if you use cljr

11:39 raek, sid3k: really, for starting to play with clojure, the easiest way today is cljr.

11:40 ~cljr

11:40 clojurebot: It's greek to me.

11:40 dpritchett: Is there a preferred way to provision Clojure instances on EC2? Crane from Flightcaster is all I've seen so far. A nice AMI would be good too.

11:40 sid3k: I'm googling it

11:40 lpetit: ~google cljr

11:40 clojurebot: First, out of 1990 results is:

11:40 CLJR - Cirrus Logic YUV 4:1:1 (vids:CLJR)

11:40 http://abcavi.kibi.ru/fourcc.php?fcc=CLJR&title=CLJR+-+Cirrus+Logic+YUV+4:1:1

11:40 lpetit: ~google cljr clojure

11:40 clojurebot: First, out of 116 results is:

11:40 liebke&#39;s cljr at master - GitHub

11:40 http://github.com/liebke/cljr

11:40 raek: yeah, cljr sounds really neat

11:40 lpetit: clojurebot: cljr is http://github.com/liebke/cljr

11:40 clojurebot: c'est bon!

11:40 lpetit: ~cljr

11:40 clojurebot: cljr is http://github.com/liebke/cljr

11:40 tcrayford: lpetit: refactoring mode has just got a working rename across multiple vars. I'll probably be introducing parsley to it tomorrow

11:40 lpetit: great

11:40 raek: haven't tried it yet, so how to get started with lein is the only simple instructions I can give

11:41 lpetit: raek, sid3k: I'm not speaking "in theory", I've installed it and use it on a regular basis

11:42 tcrayford: lpetit: renaming over a load of vars is kinda annoying when your code gets reformatted each time.

11:42 sid3k: arright, does it worth to remove current installation and start using it?"

11:42 lpetit: tcrayford: then I'll have to push my paredit.clj branch tonight.

11:42 sid3k: certainly

11:42 sid3k: it seems promising, I'm confused

11:43 then I'm removing all of the current installation

11:43 raek: there are too many complicated tutorials that havr high google rankings...

11:43 tcrayford: lpetit: my current plans with parsley is to only use it for modifying existing code. I can just my existing stuff for analysis

11:44 lpetit: sid3k: don't be confused. The path is clear: if you want to start with clojure without the hassle of having to install plugins on ideas, etc., start with cljr. When you want to write projects with dependencies, etc., enter the lein world. Then you can add an IDE to your toolkit, and you'll have a lot of choices: vim, emacs, eclipse, netbeans, intellij IDEA

11:44 tcrayford: be aware that parsley isn't very well documented currently

11:45 dnolen: sid3k: there's also cake, if you have ruby installed. I find it a far friendlier experience than cljr esp. on OS X.

11:45 tcrayford: lpetit: nor is it on clojars/etc (which means I'll probably install it to maven locally)

11:46 lpetit: sid3k, dnolen: there's a clear progression path from cljr to lein to an IDE. I don't know about cake, but I guess it does not enable this "iterative" feeling

11:46 sid3k: lpetit: some guys at here know, I installed and configured this stuff and started to learn using emacs clojure already but yesterday I got a new notebook and here I am

11:47 lpetit: sid3k: what is the IDE you're the most effective with

11:47 currently

11:47 sid3k: emacs and vim both

11:47 dnolen: lpetit: with cake those two steps are collapsed. You get a very usable REPL and a lein compat project oriented tool

11:49 lpetit: dnolen: :/ cake compat with lein compat with maven :/ :/ :/ . I'll keep this simple and just ignore cake for the sake of simplicity (one less dependency on ruby, no accumulation of project management tools and configuration files)

11:49 dnolen: sid3k: ah, then lein will work you just fine. Emacs + Lein is tasty.

11:51 sid3k: I've got lein as well

11:51 lpetit: sid3k: how to choose between cljr and lein ? The fact is you don't have to choose. cljr is for quickly opening a REPL for experiments, without having to create a project skeleton, etc. lein is for managing projects, with project dependencies, etc.

11:52 * raek adds cljr to his "what to recommend" list, after a quick try out

11:54 sid3k: lpetit: but why did you think that I need to open a repl quickly?

11:54 lpetit: sid3k: 'cause it's the simplest use case :-p

11:55 sid3k: lpetit: not funny dude, as I said, I'm reinstalling my environment, my aim is not to open a repl quickly

11:55 lpetit: sid3k: and while I'm using an IDE, I often quickly open an indenpendent REPL in my console to try out totally independent things from what I'm currently doing

11:55 sid3k: and all the stuff I've prepared is removed because of your wonderful cljr promotion

11:55 :)

11:55 lpetit: sid3k: part of my environment is being able to open a repl quickly

11:56 sid3k: thanks anyway, I'm trying cljr now

11:57 lpetit: sid3k: if you have lein and cljr installed, you don't need to follow the web page with the hints on how to compile things (unless you really want to compile your own clojure and contrib, but it's generally overrated to do so)

11:57 cemerick: dpritchett: Clojure instances?

11:58 We use pallet for EC2 provisioning and app deployment/admin.

11:58 FWIW, of course.

12:00 sid3k: lpetit: it raises "Exception in thread "main" java.lang.NoClassDefFoundError: cljr/App" for every command

12:00 but this way works: java -jar ~/.cljr/cljr.jar list

12:02 sorry, it just raises that exception for repl command

12:02 list command works in both way

12:03 dnolen: sid3k: another thing that's painful about cljr is JVM boot time for every command. I find that unbearable. but to each his own.

12:04 sid3k: dnolen: I'm removing it

12:04 lpetit: ok guys, I'll stop promoting concurrent stuff then.

12:05 dnolen: sid3k: if you're already comfortable with Emacs why not just setup SLIME? it's pretty easy now.

12:06 sid3k: I didn't say "I need clojure repl" already?

12:06 my problem was, ant didn't generate jar file for clojure-contrib

12:06 lpetit: sid3k: fact is, I didn't read when you said "I need ...".

12:07 sid3k: lpetit: np

12:08 tridd3ll: sid3k: I saw you referenced one of my tutorials a bit ago... Here is one I put together a while back but haven't blogged about: http://riddell.us/ClojureSwankLeiningenWithEmacsOnArch.html

12:08 lpetit: sid3k: so your problem is to reinstall a development environment for creating projects with clojure, that's it ?

12:08 tridd3ll: Might be more recent, replace apt-get install where necessary

12:08 sid3k: lpetit: yeah

12:09 tridd3ll: sid3k: I'm going to try today to make sure if it's actually up to date with the latest 1.2 and lein stuff

12:09 lpetit: tridd3ll: is it more accurate than what can be grapped from the clojure's wiki Getting Started page ?

12:09 sid3k: tridd3ll: thanks

12:10 tridd3ll: lpetit: well, it's much more specific... I need to preface all of these tutorials with the link to the wiki... just haven't had the time

12:12 sid3k: also, the repository locations have changed I believe... I don't think they are under /richhickey any longer but under /clojure on github

12:13 sid3k: right

12:13 tridd3ll: sid3k: of course when using lein it pulls down its own version

12:13 dpritchett: Thanks cemerick! I wanted to try something like Heroku for Clojure but since I couldn't find it I finally signed up for EC2. It helps that Amit's Runa.com docs reference EC2 as well.

12:13 cemerick: Do you have any blog posts or info on the Clojure you do on ec2?

12:14 cemerick: dpritchett: CloudFoundry is the current best bet for a java-universe heroku

12:14 Never used it myself.

12:14 technomancy: lpetit: cljr may merge with lein in the future

12:15 dpritchett: The only other thing I've seen out there is the clj-gae stuff. I could try that too but I am starting to get interested in the idea of doing some hands-on EC2 work anyway.

12:15 cemerick: dpritchett: Keep in mind, w.r.t. deployment, what works for Java works for Clojure -- so all of the solutions, servers, processes for deploying Java apps can be reused.

12:16 dpritchett: see http://muckandbrass.com/web/x/CoBZ

12:16 dpritchett: Oh hey I already had that open in another tab :)

12:16 cemerick: That is (minus a smattering of details) all that's necessary to deploy our clojure-based appllication.

12:17 lpetit: technomancy: good news

12:17 technomancy: I've been planning to add cljr-like features to lein for quite a while

12:17 cemerick: There's a lot of people rolling their own deployment stuffs...running compojure via emacs screen, homebrew scripts, etc etc. None of that makes any sense to me. *shrug*

12:18 LauJensen: cemerick: hmm, sounds interesting, got link to those scripts?

12:18 :)

12:18 dpritchett: My personal clojure work is done using a Ubuntu 10.04 VM on virtualbox. It can't be that hard to get an AMI from there I hope.

12:19 cemerick: dpritchett: Every flavour of ubuntu has an AMI already. No need to package your own.

12:20 That is, if you're using any of the deployment tools out there (e.g. pallet, chef, puppet, cap, fabric, etc)

12:20 dpritchett: There's one named 677194410155/Ubuntu 9.04 64-bit base jdk6 git-core; I guess that's close enough

12:20 cemerick: dpritchett: this is the canonical (hah!) source for ubuntu AMI info AFAIK: http://alestic.com/

12:22 Those won't have the jdk installed already, but they're official AMI builds from canonical (starting with karmic, I think). I don't trust AMIs build by random passers-by.

12:22 LauJensen: I think Brian Carper has the screen deployment stuffs in a blog post.

12:23 LauJensen: cemerick: I was just kidding - I prefer to automated approach as well

12:23 dpritchett: So I'd take one of those, quickly apt-get install the jdk and get lein/cljr/whatever, and then save that as my base Clojure AMI that I can clone for various tests?

12:24 cemerick: dpritchett: IMO, you're far better off ensuring that everything that isn't in the default AMIs is configured in at runtime, including the JDK install, tomcat/jetty/whatever, etc.

12:24 dpritchett: Meaning I'll stick with the Canonical AMI and then add install/config scripts that run at boot time for any additional AMIs?

12:26 * technomancy recommends not installing lein on production servers but rather using lein to build standalone packages (tarballs, etc) that may be repeatably deployed to production.

12:26 cemerick: Roughly, but the "scripts" aren't installed or necessarily run at boot-time. In pallet's case, it connects to the newly-provisioned server over ssh, and applies your configuration.

12:27 Chef is similar, but it has an agent that plings a Chef server for configuration changes periodically.

12:28 +1 to technomancy: you should have a CI environment that spits out war files (or whatever the appropriate deployable unit is), and then use a deployment tool to push that along with whatever other config goes into a new/updated node.

12:31 technomancy: need to blog about that...

12:34 dpritchett: So when I discover a bug in my ec2 clojure app I'll fix it locally, rebuild jars with lein, and then overwrite the old jars on ec2 and restart the jvm?

12:35 Or use pallet to kill the AMI, start a fresh one, and push my new jars automagically

12:36 In which jars are sshed and images are spun

12:36 cemerick: dpritchett: the former, yes. Going from zero to a fully configured EC2 node isn't the fastest thing in the world.

12:37 technomancy: you should be able to do it easily when you need to, but not for every deployment.

12:37 cemerick: right

12:37 dpritchett: Makes sense, thanks

12:37 I've never had the privilege of working on a CI environment

12:37 Hopefully this EC2 fun will give me the excuse to beef up in that area

12:38 cemerick: dpritchett: It's not strictly necessary, but the more automation you have in your build/deployment/rollback process, the better your life gets. :-)

12:38 FYI, there's a #pallet channel. You can bother hugod there. ;-)

12:38 dpritchett: Oh certainly I have read plenty of persuasive blog posts to that effect. IMVU -> Lean Startup stuff and the Joel test and all that

12:39 cemerick: IMVU is the modern hipster-geek example. Flickr's been doing continuous deployment for years and years.

12:41 dpritchett: Eh, the IMVU post (http://news.ycombinator.com/item?id=475017) made a big impact on me last February and I can't remember having read such an interesting thing about Flickr. I don't get practical consumer web app experience at my job so I find what I can to learn from.

12:44 cemerick: dpritchett: That was tongue-in-cheek. :-) IMVU's a great example. And yeah, flickr's never been out there talking about how they do things nearly as much as they could have.

12:46 dpritchett: I think as long as I can claim that I read it before the Lean Startup wikipedia page was created I'm safe ;)

12:46 cemerick: heh

12:47 dpritchett: http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr is a decent deck about it. I remember first seeing code.flickr.com some years ago and being floored by "...last deployed XX minutes ago, deployed YY times last month" or something like that.

12:47 dpritchett: Thank you!

12:48 hugod: dpritchett: there is also the kaching blog post http://eng.kaching.com/2010/05/deployment-infrastructure-for.html

12:53 sid3k: I'm having trouble with lein this time: Unable to resolve artifact: Missing: 1) org.clojure:clojure-contrib:jar:1.2.0-SNAPSHOT

12:53 any ideas?

12:54 dpritchett: Lein deps can't find the jar you wanted?

12:54 sid3k: exactly

12:55 I've downloaded latest jar from build.clojure.org and put [[org.clojure/clojure "1.2.0-master-SNAPSHOT"] in the project file

12:56 dpritchett: You could try [org.clojure/clojure-contrib "1.2.0-RC1"] maybe?

12:57 sid3k: same error dpritchett

12:57 dpritchett: Didja try lein clean?

12:58 That's about all I can think of. I'm sure technomancy will be along shortly

12:58 sid3k: dpritchett: trie

12:58 tried

12:59 dpritchett: Here's a bug report on the same thing - turned out to be a typo in project.clj I think: http://github.com/technomancy/leiningen/issues/issue/47#issue/47

13:01 Eh, that one wasn't about contrib

13:02 sid3k: dpritchett: thanks

13:02 good evening everyone, sid3k goes

13:10 arohner: this amuses me: http://gist.github.com/510026

13:33 notsonerdysunny: I am trying to build and get familiar with lein-build system .. I tried to build a project for the ants.clj that Rich wrote to demonstrate the power of stm. I divided the file into three peices core.clj, stm_ui.clj(contains the ui stuff) and stm_ants.clj(contains the agents and related stuff) .. http://dl.dropbox.com/u/7271654/ants.tgz

13:35 when I try to run "lein uberjar" it gives me a "JFrame" and stops the process there .. it does not complete .. can anybody help me to get this done right ..

13:36 I have been able to use lein on simpler things .. this is the first swinp-app I am trying ...

13:37 qbg: Link is broken

13:39 LauJensen: notsonerdysunny: From your description I dont know whats wrong, but if I remember correctly you can do $ export DEBUG=VERBOSE and rerun lein uberjar to get a proper error

13:39 technomancy: notsonerdysunny: move things into a -main function. having UI launched in the toplevel is ok for experiments but not the way to do it in projects.

13:41 Raynes: notsonerdysunny: uberjar only creates an executable jar when you have a namespace that is :gen-class'd, has a -main function that is the entry-point to the application, and the :main namespace is specified in the project.clj.

13:43 notsonerdysunny: qbg .. sorry .. my dropbox is still synchronizing ..

13:43 technomancy: yea .. I will try moving the creation of the JFrame into the main function ..

13:44 Raynes: I have done that ..

13:45 Raynes: The -main function, as technomancy pointed out, has to contain the code that actually *runs* the application, such as launching the UI and such.

13:51 SandGorgon: does clojure have formal specification semantics - just curious, based on a related thread on reddit

15:04 timcharper: I just ran into an issue with leiningen regarding the installation of multiple versions of the same dependency

15:04 my project.clj specifies to install clj-stacktrace 1.3

15:04 However, in one of my development dependencies, clj-stacktrace 1.2 was specified as a dependency.

15:05 In the end, I ended up with two versions of clj-stacktrace

15:06 The issue was when I started up the environment, I ended up getting the 1.3 version of clj-stacktrace/core.clj, and the 1.2 version of clj-stacktrace/utils.clj

15:07 To make even things more strange, I opened up the clj-stacktrace 1.3 jar, modified clj-stacktrace/utils.clj by adding a space, saved it (which caused the timestamp to update on it), and that small little change caused the 1.3 version of clj-stacktrace/utils.clj to be loaded instead

15:07 So:

15:07 A couple of questions

15:08 Whose responsibility is it (or should it even be a desired behavior) to prevent the installation of multiple versions of the same dependency within a project

15:08 For instance, with bundler, you can only have one version of the dependency in an instance. If, for whatever reason, there are conflict in dependencies, errors are raised

15:09 The other question: if it's desirable that multiple versions of the same dependency are installed in the same projects simultaneously, whose responsibility is it to ensure that the latest version is consistently loaded every time?

15:17 Well, I went ahead and posted a ticket:

15:17 http://github.com/technomancy/leiningen/issues/issue/90

15:17 If anybody else has run into something similar, it may be helpful to get your input on it.

15:18 technomancy: timcharper: in this case it's easy; you probably shouldn't specify clj-stacktrace as a regular dependency; it's clearly a dev-dependenciy. in general: right now duplication is possible only across dependency/dev-dependency boundaries. in this case a manual :exclude should be used. this may be able to be improved in lein.

15:18 timcharper: Additionally, is this experienced with maven? Does maven do anything to prevent you from installing conflicting versions of a dependency?

15:19 technomancy: unfortunately, I think we had to make it a production dependency because our code won't run without it (we have manually inserted places to catch an output the pretty stack trace)

15:19 I will look into what we can do to change that

15:19 (Thank you for responding :-) )

15:19 Is there any way warnings could be added? Or is there any way to predictably enforce a load order?

15:20 This issue only manifested on my machine because I was unlucky enough to get that failing combination

15:20 (Which further added to the mystery of why it was failing, as you might understand :-) )

15:24 technomancy: load precedence is defined by order on the classpath. according to leiningen/classpath.clj the regular deps should always have precedence over dev deps.

15:24 timcharper: yeah... that's what I would think.

15:25 Any idea how I got 1.3 core.clj, and 1.2 utils.clj ?

15:25 That's what caused the issue that caused us all to scratch our heads.

15:25 If I got a homogenous set of either 1.3 or 1.2, the issue would not have manifested.

15:26 also, if I got 1.2 core.clj and 1.3 utils.clj, I would've been okay. It's just that specific combination :-) 25% chance

15:26 I recorded a video of that issue manifesting, if you would like to watch it:

15:26 ^that^the

15:29 Part 1: http://screencast.com/t/NjExMDUzYjQt

15:29 Part 2: http://screencast.com/t/YjE0Nzc1OTkt

15:29 I realized at the end what the real issue was, but the manifestation is clearly captured

15:31 I can produce a more consolidated video of the issue, one second

15:41 here it is :) - http://screencast.com/t/ZmY5MjA2YjQt

15:44 (don't watch part 1 and 2... just the last video, if you decide to watch it at all)

15:59 LauJensen: timcharper: I hadn't seen jing before - amazing quality

16:01 interesting catch

16:08 timcharper: yeah... it's weird, isn't it? (the issue). Jing rocks.

16:12 LauJensen: timcharper: extremely. I cant make out what you're doing when you're selecting, are you using some kind of key which sometimes highlights the current word (up until next space) and other times something which highlights an entire function?

16:19 timcharper: c-m-space - mark-sexp

16:19 LauJensen: thanks

16:47 timcharper: technomancy: you here still?

16:57 case closed with regards to the multiple versions issue

17:01 on July 28th, clj-stacktrace-0.1.2/utils.clj was compiled and living in my classes folder.

17:01 it took preference over clj-stacktrace-0.1.3/utils.clj, because the timestamp of the compiled files was newer.

17:02 basically, this translates to: you should probably never run `lein deps` without running `lein clean` first. Ever. It creates a possibility for an unpredictable environment.

17:04 IE, consider this scenario:

17:04 you install version 1 of a jar, "core.clj" is dated July 14th, "utils.clj" is dated July 20th

17:05 technomancy: timcharper: sorry, gotta get back to work. sounds like the thread needs to continue on the lein list.

17:05 cemerick's non-transitive AOT patch will help a lot here; hope it gets applied soon.

17:05 timcharper: then on July 21, everything gets compiled

17:05 technomancy: ok

17:05 I'll finish here then send to list

17:06 ... (continued) on July 28th, say, you update to version 2 of a jar. In the jar, "core.clj" is dated July 23rd, but "utils.clj" is dated July 20th.

17:07 in this case, the compiled version 1 of utils.clj would still be used, since it's seen as newer than the version 2 utils.clj

17:07 however, the version 2 of core.clj would be used

17:07 creating a screnario not unlike the one I encountered today

17:09 LauJensen: timcharper: thanks for sharing

17:20 helino: hi everyone! is there some standard way to mark functions which has side-effects (for example reading from a socket)?

17:21 hi everyone! is there some standard way to mark functions which has side-effects (for example reading from a socket)?

17:22 timcharper: http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/io!

17:22 you can has side-effect marking like that

17:23 helino: by using an exclamation mark?

17:23 timcharper: by calling that macro

17:23 and wrapping your io side-effecty logic in there

17:24 so, if says an I/O code is called within a transaction, and is at risk of being repeated, an exception is raised (as opposed to your I/O operation occurring twice in a circumstance that would probably be very rare and hard to reproduce)

17:25 helino: timcharper: I understand, thanks for your help!

17:26 timcharper: Sure thing!

17:32 jlf`: using clojure+slime, if some-var contains an object, i'd expect user> (. some-var TAB to show me that object's methods but it does not. how can i see what methods are implemented for a given object?

17:33 tridd3ll: FYI: I've released a new tutorial for those linux users wanting to roll their own clojure, swank, leiningen and emacs environment: http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html

17:33 technomancy: jlf`: use the slime-inspector on it: C-c S-i.

17:34 raek: jlf`: this might not answer your question, but clojure.contrib.repl-utils/show lists all methods for a class or object (I don't remember which)

17:34 ooh, didn't know about that one... :)

17:34 tridd3ll: and I updated my current and older tutorial to point first to the Clojure wiki page as well as leiningen to avoid confusion for users hitting the page via google

17:35 jlf`: technomancy: thanks -- i see only fields there, no methods. am i missing them?

17:36 raek: will take a look, ty

17:36 callen-nyc: I just wrote this up for someone

17:36 http://gist.github.com/510409 does that look correct?

17:36 and just a reminder

17:36 ->> is called "The Winchester"

17:36 sexpbot: => #<core$_GT_ clojure.core$_GT_@11286929>

17:36 callen-nyc: ,->>

17:36 clojurebot: java.lang.Exception: Can't take value of a macro: #'clojure.core/->>

17:37 raek: tridd3ll: very kind of you :) your tutorials seem to be very popular

17:38 callen-nyc: tridd3ll: for clojure mode and slime, why not ELPA?

17:38 raek: ,#'->>

17:38 clojurebot: #'clojure.core/->>

17:38 raek: ,(meta #'->>)

17:38 clojurebot: {:macro true, :ns #<Namespace clojure.core>, :name ->>, :file "clojure/core.clj", :line 1284, :arglists ([x form] [x form & more]), :added "1.1", :doc "Threads the expr through the forms. Inserts x as the\n last item in the first form, making a list of it if it is not a\n list already. If there are more forms, inserts the first form as the\n last item in second form, etc."}

17:38 callen-nyc: right. the winchester.

17:39 tridd3ll: callen-nyc: I've just always done it this way (although I have tried ELPA in the past.) Works for me. Sometimes I just like to have a bit more control.

17:40 callen-nyc: tridd3ll: going the git clone route always involved more pain for me.

17:40 raek: I'm definitely for pronounceable names... "The Winchester" could work (in a more informal context, at least)

17:40 callen-nyc: tridd3ll: I'm an impatient hammer-and-go guy though.

17:40 raek: excellent. Keep telling people to call it that.

17:40 raek: the best part is the name describes what it does, in a sense :D

17:42 raek: how many of the existing build/repl/project/deps tools (like leiningen, cljr, cake) have appeared from a year ago to now?

17:42 tridd3ll: callen-nyc: well, some people are new to git even, this tutorial introduces how to use more than just the clojure stuff I think.. others might not even be familiar with the linux command line package management stuff... so for clojure, this looks complicated, but it's really outlining quite a few things

17:42 callen-nyc: tridd3ll: good point.

17:42 tridd3ll: I'm familiar, just impatent and obsessed with automation.

17:43 tridd3ll: callen-nyc: I might be the opposite... I'm obsessed with knowing how is was done, probably to the point of less productivity.

17:43 callen-nyc: tridd3ll: well, I value grokking

17:44 tridd3ll: I think you're misunderstanding what I mean

17:44 tridd3ll: I don't mean skating across a thin-ice patch of cargo cult

17:44 tridd3ll: I mean getting to a position where you're learning something valuable ASAP.

17:44 tridd3ll: I've been using emacs much longer than I've been programming in most languages I actually use these days, there's not any value in my screwing around outside of ELPA

17:45 technomancy: jlf`: you need to inspect the class rather than the instance to see the methods

17:45 arohner: macro expansion order is the same as function evaluation order, right?

17:46 jlf`: technomancy: ah, that makes sense. do you know if any plans are afoot to make tab completion dtrt in contexts such as . and .. ?

17:48 tridd3ll: callen-nyc: I'm not where you are with emacs, and I don't get to spend the time I'd want with clojure either.

17:48 callen-nyc: so this is more foundational understanding for me

17:49 callen-nyc: tridd3ll: okie dokie. was just wondering. thanks for contributing to the community :D

17:49 tridd3ll: callen-nyc: :-)

17:49 jlb: Hi all, is there a "canonical" Clojure HTTP client? (I'm looking at clojure-http-client)

17:50 callen-nyc: jlb: technomancy's

17:50 technomancy: jlf`: it would only work with top-level vars, not locals, so probably not

17:50 that said, patches welcome. =)

17:50 callen-nyc: jlb: I think you're looking at it.

17:50 jlb: callen-nyc: ok cool, thanks

17:50 * jlf` nods.. maybe at some point

17:51 callen-nyc: technomancy: what would be needed to make the http client contrib ready?

17:51 technomancy: callen-nyc: a convincing reason why contrib would be a better place for it? =)

17:51 plus a lot of copyright assignment busywork

17:52 callen-nyc: technomancy: good point, but it would be nice if it was easier to people to know what the 'canonical' http client is.

17:52 easier for

17:52 jlf`: ah, (use '[clojure.contrib.repl-utils :only (show)]) + (show some-var) = win

17:52 technomancy: contrib's a bit of a mess. I'd rather people trust something like pagerank or something for judging between libs.

17:53 callen-nyc: technomancy: mess?

18:02 mebaran151: how would one get the generated primary key in clojure.contrib.sql from an insert statement

18:11 also, if I wanted to replace a library function in clojure.contrib in just my applicaiton, is there anyway just to evilly change its internal definitions

18:15 raek: I guess you could use some combo of in-ns and def

18:15 or maybe alter-var-root

18:18 mebaran151: I'm just trying to get the generated primary key in clojure.contrib.sql

18:18 it seems like this is buried in stmt metadata somewhere

18:19 gfrlog: what's the clojure word for compose?

18:19 raek: I haven't used c.c.sql yet, but I suspect that there should be a better way

18:20 mebaran151: it's a pretty basic library

18:20 lancepantz: mebaran151: it's not possible with one sql statement in mysql

18:20 mebaran151: compose I think is comp

18:20 raek: there is a more advanced library too, I think

18:20 lancepantz: it is in postgres though

18:20 mebaran151: I'm using h2

18:20 where it definitely is

18:20 lancepantz: i don't know what that is

18:20 gfrlog: ,((comp not zero?) 8)

18:20 clojurebot: true

18:21 mebaran151: H2 is like a less broken embedded Derby

18:21 mysql doesn't return the row metadata? I feel I've used libraries that at least made it appear so

18:21 lancepantz: i looked into, php has a function for it

18:21 it actually does a second select stmnt

18:22 here's what i do in postgres http://gist.github.com/443115

18:22 mebaran151: http://dev.mysql.com/tech-resources/articles/autoincrement-with-connectorj.html

18:22 in jdbc you can

18:22 .getGeneratedKeys is your friend

18:22 if you can get a handle on the stmt object, JDBC handles the C library calls for you

18:23 lancepantz: right, looks like that is just an abstraction that fires off a second select statment though

18:23 i imagine it would do it in 1, using returning in psql

18:23 mebaran151: I think getGeneratedKeys is actually lower level than that

18:23 though it mght not be transactionally secure

18:25 lancepantz: i guess if jdbc supports it, then it would make sense for contrib.sql to support it

18:25 mebaran151: yeah

18:26 MySQL is just horribly broken 95 percent of the time

18:27 well I think that instead of closing the statements for you, it should return the statement object, or return the lazy seq with the statement object in metadata

18:27 lancepantz: well, if you put a patch together, ping me and i'll try it on my setup

18:27 mebaran151: then you could call close on it, which would look for the stmt key in the metadata

18:27 however that would break most of its design, and people might forget that come lazy-seqs need to be closed

18:28 *some

18:33 seancorfield: any bay area folks going to the clojure meetup in SF tonight?

18:34 jlf`: seancorfield: link? i see only balisp on meetup.com...

18:34 seancorfield: just a second

18:35 http://www.meetup.com/The-Bay-Area-Clojure-User-Group/calendar/13747349/

18:36 jlf`: huh, i searched clojure in SF and it didn't show up

18:36 i guess mountain view is too far to be considered relevant

18:37 seancorfield: i get lots of meetup alerts about groups in mt view et al - i'm in the east bay

18:37 so mt view is a painful commute for me for a UG, SF less so

18:37 jlf`: yeah, i'm up in the back country of sonoma county :)

18:40 seancorfield: ah, right, because the group's based in MV... but often meets in SF... gotcha

18:44 jlf`: it might make sense to base the group somewhere closer to the population center of the bay area, like san mateo or something, so it shows up in searches from SF/Oakland/etc. in additino to metro SJ

18:44 addition even

18:52 seancorfield: jlf`: yeah, i could make it to san mateo for a 6pm meeting, as i can to SF... it's just going further south that gets really hard for me

18:52 amit who runs the group is based in Mt View tho' so that's why it tends to alternate between SF and Mt View

18:53 since he moves it around, i can suggest to him tonight that he change the group's location on meetup

18:53 jlf`: i wasn't suggesting changing the actual meeting locations, just the group's location for the purposes of being close enough to show up in searches

18:54 seancorfield: right that's what i meant

18:54 better to show the group somewhere between its main two meeting locations :)

19:07 gfrlog: ,(time (do (reverse (range 1 1000000)) :ok))

19:22 slyrus: technomancy: can I make a clojure-mode request?

19:25 technomancy: slyrus: sure, but I can't promise a timely response/implementation

19:26 slyrus: oh, I was mistaken anyway. nvm... for the moment.

19:53 pdk: (doc unless)

19:53 clojurebot: No entiendo

19:54 tomoj: (doc when-not)

19:54 clojurebot: "([test & body]); Evaluates test. If logical false, evaluates body in an implicit do."

19:55 rhudson: 'unless is reserved for showing how to write macros :)

19:56 timcharper: chouser: we believe we've found a memory leak issue with fill-queue... but can't explain exactly why fill-queue would be leaking

19:56 http://gist.github.com/510601

19:56 (we being timcharper and mabes)

19:56 mabes: well, it is either a bug or our misuse of it..

19:57 timcharper: yeah :)

19:58 mabes: by memory leak, we mean that the collection (dates) that is being operated on is never released. as far as we can tell doseq and fill-queue should not be retaining the head of the seq, but something is...

20:03 timcharper: hmm.. actually... on further inspection, I'm not really sure if it has anything to do with fill-queue at all.

20:05 pdk: (doc defonce)

20:05 clojurebot: "([name expr]); defs name to have the root value of the expr iff the named var has no root value, else expr is unevaluated"

20:12 timcharper: ok, it's not an issue with fill-queue, although fill-queue inherits the problem. It appears to be an issue with doseq inside of a future

20:19 pdk: (doc unless)

20:19 clojurebot: Huh?

20:49 timcharper: ,(doc unless)

20:49 clojurebot: Titim gan éirí ort.

20:49 timcharper: ,unless

20:49 clojurebot: java.lang.Exception: Unable to resolve symbol: unless in this context

20:50 timcharper: ,(+ 1 1)

20:50 clojurebot: 2

20:50 timcharper: ,(doc "unless")

20:50 clojurebot: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol

20:50 timcharper: ,(doc unless)

20:50 clojurebot: It's greek to me.

20:50 pdk: it doesnt understand if you try to do doc on a string and you don't need , for doc

20:51 timcharper: (doc println)

20:51 clojurebot: "([& more]); Same as print followed by (newline)"

20:51 timcharper: (doc unless)

20:51 clojurebot: Pardon?

21:12 pdk: oh god

21:12 vim =% is gold

21:12 this stuff is exactly what i was looking for, something modest to edit code that still understood lisp indentation

21:16 rbarraud: meh - emacs rulz ;-)

21:17 huge learning curve if you are thrown in the deep end though

21:17 I recommend O'Reilly 'Learning GNU Emacs' book - makes sense of it all

21:17 before that it made not a lot of coherent sense for me

21:22 pdk: probably get around to learning either one of them in depth if i come up with a more ambitious project idea :p

21:22 flintf: yea, I'm talking learning Emacs and Clojure at the same time

21:23 it can be a bit much

21:30 pdk: right now im basically happy to use vim in a basic way and try to find some commands for handling indenting/forms

21:48 (doc partition)

21:48 clojurebot: "([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 complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."

23:04 pdk: ,(/ 2)

23:04 clojurebot: 1/2

23:05 pdk: ,(= (/ 2) 0.5)

23:05 clojurebot: true

23:05 pdk: ,(= (/ 3) 0.33)

23:05 clojurebot: false

23:05 pdk: ,(double (/ 3))

23:05 clojurebot: 0.3333333333333333

23:05 pdk: ,(- 1)

23:05 clojurebot: -1

23:05 pdk: ,-1

23:05 clojurebot: -1

Logging service provided by n01se.net