#clojure log - Aug 14 2009

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

0:18 eyeris: I just installed vimclojure from bitbucket

0:18 :scriptnames shows it loaded the scripts

0:18 However the mappings, such as \ef, do not work.

0:19 They are not displayed by :map <LocalLeader>

0:20 mikem`_: eyeris: i think those are only mapped when the nailgun server is running

0:21 eyeris: It is running

0:21 NGServer started on, port 2113.

0:25 mikem`_: eyeris: ah yes, you also need to open a .clj file

0:25 s/file/buffer/

0:25 eyeris: I did.

0:26 mikem`_: and your ~/.vimrc has the relevant entries? clj_want_gorilla et al?

0:27 eyeris: I have the clj_want_gorilla set

0:27 mikem`_: ok, at this point I'm not sure. sorry

0:28 eyeris: np

0:46 When I try to use the ng client from the cmd line I get

0:46 clojure.contrib.pprint.PrettyWriter

0:46 That exception is right on the vimclojure page.

0:47 The explanation is that I didn't AOT compile clojure-contrib, but I did and the .jar is in my CP

0:51 Fixed that.

0:52 durka42: what was it?

0:53 eyeris: clojure-contrib wasn't actually AOT compiling. It was just silently failing

0:53 Though now I am CP hell...

0:55 Yay! it works now!

1:24 clojure: i really like vimclojure, since it saves me from using emacs/slime

1:46 lrenn: i was just thinking how emacs + slime + paredit + clojure is the most fun I've ever had coding in my entire life.

1:51 albino: pretty bold statement there

3:25 lowlycoder: after typing in 'ant' in the clojure dir; it builds clojure for me ... however, how do I install clojure?

3:25 I want it in /usr/local/whatever

3:30 arbscht: lowlycoder: I don't believe there is a standard way to do that. I set mine up roughly according to the debian java package conventions, and with a custom clj launcher

3:37 eevar2: lowlycoder: here's my install, stuffing all jars of interest in /opt/clojure-libs: http://pastebin.org/8749

3:38 (except the compojure deps)

3:40 tomoj: so far I've just been unzipping clojure, clojure-contrib, and any jars a project depends on into project/target/dependency for clojure-project

3:40 getting pretty annoying

3:41 mikem`_: eevar2: what do you put in your CLASSPATH variable then? how do you start the clojure REPL or clojure apps?

3:43 cschreiner: wish there was a one-click-installer for clojure

3:43 eevar2: mike: java -cp "/opt/clojure-libs/*" clojure.lang.Repl # should work, assuming you have java1.6+

3:44 iirc 1.5 doesn't like * in the class path

3:46 mikem`_: eevar2:

3:46 eevar2: ok, cool, thanks for sharing :)

3:46 eevar2: http://pastebin.org/8946 # my real/current/working .emacs config. the one i pasted earlier might have been bogus

3:47 * mikem`_ is still a bit new to the Java ecosystem

3:47 eevar2: i.e. not setting the class path correctly

3:48 tomoj: eevar2: if you have project-specific dependencies, do you add to swank-clojure-extra-classpaths for that project?

3:49 eevar2: neh, i just stuf the jars into my global library

3:49 tomoj: ah

3:49 eevar2: if for whatever reason you need to work with different versions of the same library, that might be an issue

3:49 tomoj: that would mean you never have to create special slime repls for different projects with different classpaths like clojure-project does... sounds like a good idea

4:00 JesterMonkey: Hello ?

4:02 tomoj: hello

4:14 eevar2: tomoj: working with multiple files gets a bit hairy if you dont make sure you're in the correct dir. and you'll want '.' in your classpath as well, which the crap i posted earlier doesn't include ;)

4:19 tomoj: hmm

4:19 maybe I'll stick with clojure-project for now

5:04 DrJoke: (life restart)

5:11 seths: is there a historical reason why (inc Integer/MAX_VALUE) overflows?

5:11 (+ 1 Integer/MAX_VALUE) just automatically promotes to Long

5:11 and Long/MAX_VALUE to BigInteger

5:13 cark: might be worth making a post about it on the mailing list

5:19 febeling: how often are the irc logs posted? I can only see the ones from a couple of days ago

5:27 tomoj: it seems like the intention is for (inc Integer/MAX_VALUE) to not overflow

5:28 the inc method in IntegerOps checks whether the first operand is less than Integer.MAX_VALUE

5:30 seths: I am putting together a quick post to the mailing list

5:31 (dec Integer/MIN_VALUE) also over (under?) flows

5:32 tomoj: weird, because the dec method in IntegerOps does a similar check there

5:32 s/first operand/argument/

5:33 seths: I haven't checked in the source, but I just updated from Github

5:34 "checked in" the source = read it :-)

5:35 tomoj: maybe it's something to do with inlining?

5:35 I dunno

5:42 Fossi: i guess if it's intended behaviour, it should be documented

5:42 but i doubt it

5:42 at least it's not what i would expect

5:43 tomoj: from the source code it looks to me like it's not intended

5:44 but that was my first dip into the java source

5:45 seths: I was sort of expecting (inc) and (dec) to be macros

5:45 expanding to (+) and (-)

5:46 tomoj: then (iterate inc 1) wouldn't work, would it?

5:47 seths: haven't used iterate yet :-)

5:50 neat

5:52 tomoj: also stuff like

5:52 ,(map inc [3 4 5])

5:52 clojurebot: (4 5 6)

5:53 seths: I am seeing the limits of my clojure-fu :-)

5:54 I don't understand why this hangs: (take 10 (iterate (fn [val] (+ 1 val)) 1)

5:55 but this works: (defn bad-inc [val] (+ 1 val)) (take 10 (iterate bad-inc 1))

5:55 tomoj: the first doesn't hang for me

5:55 did you really forget the extra ) at the end?

5:55 _mst: am I going mad or are you missing a right paren on both of those?

5:56 yeah :)

5:56 seths: GAAAAAHHHHHH

5:56 sorry

5:56 tomoj: slime tells you "[input not complete]" in the minibuffer

5:57 and the auto-indentation gives a hint too

5:57 Fossi: highlight-parentheses-mode ftw

5:58 seths: I'm ashamed to say the repl is not running in Emacs

5:58 unlike IRC

5:58 Fossi: eh, for me it's the other way round ;)

5:58 seths: I really need to stop being lazy about slime

5:59 tomoj: it's very much worth it imo

5:59 * Fossi couldn't write a single line of clojure without emacs anymore :)

5:59 tomoj: once you have slime installed you can just use the clojure-install function from clojure-mode to set most everything up

6:00 Fossi: tomoj: i should've known that

6:00 seths: cool, thanks

6:01 ah, good post on the overflow on the newsgroup

6:01 Integer.MAX_VALUE is an int, not an Integer

6:02 tomoj: ah, that explains why the checks in java didn't work

6:03 seths: ,(inc (+ 1 Integer/MAX_VALUE))

6:03 clojurebot: 2147483649

6:03 seths: ,(.getClass Integer/MAX_VALUE)

6:03 clojurebot: java.lang.Integer

6:03 seths: hmm

6:04 tomoj: the distinction between int and Integer is somewhat hidden

6:04 I don't understand it myself yet

6:05 ah, I think I may see the problem

6:05 integers are boxed on function calls

6:05 but inc is inlined

6:06 so the inc(int x) in clojure.lang.Numbers is called

6:06 which does throwIntOverflow if x is Integer.MAX_VALUE

6:12 seths: tomoj: that would be a great addition to the posting on the newsgroup

6:13 tomoj: ,(inc (identity Integer/MAX_VALUE))

6:13 clojurebot: 2147483648

6:13 mikehinchey: that's what should promote instead of throw

6:13 tomoj: is there a clearer way to box besides identity?

6:14 mikehinchey: unchecked_inc should be used if you want the exception

6:15 tomoj: also, is there a way to check whether a certain value is boxed or not?

6:15 (class foo) won't work because foo gets boxed

6:16 mikehinchey: I think it's assumed you know what you're doing when you use java interop

6:16 tomoj: unfortunately I don't :(

6:17 ie. I don't understand how to use unboxed ints for performance

6:17 and I can't really investigate it because (class <int>) is still Integer

6:18 mikehinchey: like I said, I think the inc behavior is wrong, so you wouldn't have to know for this case

6:19 tomoj: right, but for performance optimization, I'd like to know

6:19 mikehinchey: I suppose that would require a new special form, since a fn or macro can't know if something is primitive or not

6:20 Chousuke: the compiler does know though.

6:20 mikehinchey: right

6:20 Chousuke: but arguments to function calls are always boxed.

6:20 tomoj: well

6:20 Chousuke: if you want primitive math, you need a (loop ...)

6:21 tomoj: I saw something in here the other day about using (int ..) in binding forms

6:21 I don't see that explained anywhere on clojure.org

6:21 mikehinchey: inlined fns can avoid boxing

6:21 Chousuke: well, yeah, but that's because the function is never really called :/

6:22 tomoj: should be in the java interop section

6:22 tomoj: Chousuke: ah, hadn't looked there. thanks

6:23 yup, I see it now. cool

6:29 ,(+ 1 Integer/MAX_VALUE)

6:29 clojurebot: 2147483648

6:29 tomoj: ,(+ (int 1) Integer/MAX_VALUE)

6:29 clojurebot: java.lang.ArithmeticException: integer overflow

6:33 rsynnott: aren't Java integers 64bit these days?

6:33 or is that just Long?

6:34 tomoj: apparently they are 32bit

6:35 otherwise there would be no overflow there

6:35 right?

6:35 rsynnott: yep, they seem to be :)

6:35 I must have imagined the 64bit thing

6:35 ,(+1 Long/MAX_VALUE)

6:35 clojurebot: java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn

6:35 rsynnott: ,Long/MAX_VALUE

6:35 clojurebot: 9223372036854775807

6:35 rsynnott: ah

6:35 tomoj: we don't have a +1

6:36 rsynnott: yep, that's 64bit :)

6:36 ooh, missed a space, yes

6:59 seths: 06:58 *** banisterfiend JOIN

7:33 Fossi: what's the keybinding for getting the repl again?

7:33 in emacs that is

7:34 Chousuke: M-x slime? :/

7:35 I don't quite understand the question :P

7:35 Fossi: there is a keybinding to get the buffer with the open repl somehow

7:35 Chousuke: hmmh

7:35 Fossi: instead of having to go through M-x b *sl TAB r TAB

7:36 Chousuke: heh.

7:37 arbscht: C-c C-z does slime-switch-to-output-buffer

7:38 Chousuke: I have fuzzy completion in the minibuffer from some addon. I'm not sure which, I cloned some set of emacs customisations from github and just tweaked them. :P

7:38 rsynnott: doesn't slime have fuzzy completion anyway?

7:39 oh, fuzzy completion in emacs itself?

7:39 Chousuke: I can just got C-x b slre<tab> and it switches

7:39 arbscht: emacs yeah - I use icicle

7:39 Chousuke: I think it might be that. or just ido.el? :/

7:39 clojurebot: that is not what I wanted

7:39 Chousuke: I'm not sure what, but it's nice :D

7:39 Fossi: yeah, i need to get that as well

7:40 C-c C-z almost does what i want, only that it opens the buffer in another window

7:40 Chousuke: I also have rather nice tabcompletion in clojure-mode buffers.

7:41 again, not sure which part of my .emacs.d does it but it's also nice :P

7:42 Fossi: damn ctrl-w

7:42 i need to disable that for pidgin :(

7:43 Chousuke: heh

7:43 I would hate that. I'm pretty used to deleting words with ctrl-w

7:44 the one nice thing about the mac command key is that it doesn't interfere with application shortcuts using control

7:45 the downside is the lack of an alt gr, making emacs somewhat less pleasant :P

7:45 Fossi: well, remapping should be trivial

7:45 i think i might switch ctrl and alt/meta when i go back to dvorak

7:45 Chousuke: well, yeah, but using cmd as meta then makes emacs unable to utilise the commmon mac shortcuts.

7:46 Fossi: ah, ok

7:46 Chousuke: -m

7:46 :P

7:46 though for now, that doesn't matter much.

7:47 it's a bit annoying sometimes though, because Cocoa emacs has some cmd-shortcuts in its menus and I'm not sure what the traditional emacs equivalents are.

7:48 andyfingerhut: Out of curiosity, does anyone happen to know what is stored in the 8 bytes (32-bit system) or 16 bytes (64-bit system) of every java.lang.Object? Reflection on fields doesn't seem to give me the answer for that class like it does for others.

7:48 Chousuke: hm, though, problems like that are easily solved with f1 k :P

8:01 Neronus: andyfingerhut: I know at least that its default constructor does nothing (not setting any fields, no nothing)

8:04 Fossi: hmm. doesn't work

8:07 tomoj: hmm.. I get tab-completion in the repl but not in my source buffers

8:12 Fossi: "gtk-key-theme-name = "Emacs" " hmmmm

8:13 in source buffers i have dabbrev-expand on M-/

8:13 kinda sufficient

8:13 fsm: Hello everyone. My raytracer is improving: http://tu.be/graphics/teapot2.png

8:15 Neronus: andyfingerhut: I suggest: One pointer to the super object (which is null for object, or the object itself, I don't know what the jvm does) and one pointer pointing somewhere denoting the type of the instance

8:16 andyfingerhut: Neronus: thanks. sounds plausible. I'll keep Google searching. Trying to figure out where all those 48 bytes go on my 64-bit machine for each clojure.lang.Cons and clojure.lang.LazySeq.

8:16 Chousuke: keybindings with / in them always cause problems to me

8:16 Fossi: fsm: nice

8:17 Chousuke: I use a Finnish layout so there's no single key that gives me /

8:17 fsm: thanks

8:17 Fossi: Chousuke: that's why i use an us-altgrintl layout (typematrix 2030)

8:18 worst is comment-region on a german keyboard

8:18 meta alt-gr ctrl -

8:18 Chousuke: :P

8:19 Fossi: although there's still a possibility for shift in there ;)

8:19 apart from (), the layout is pretty nice

8:19 but those suck on most layouts

8:20 Chousuke: maybe I should tell emacs to output parentheses from å instead of the useless letter

8:20 * Chousuke does not write code in swedish

8:20 Fossi: with paredit you rarely need ) anyway

8:20 Chousuke: paredit doesn't work with viper too well though :/

8:20 Fossi: so one letter or å Å would be sufficient

8:21 Chousuke: viper overrides paredit's parentheses deletion protection and then completely confuses paredit

8:21 Fossi: but i also like the intl layout for letting me type all those characters easily :D

8:21 Chousuke: to the point that with paredit mode enable, I can't even re-balance the s-exprs because paredit thinks things are unbalanced.

8:22 enabled*

8:22 I suppose I could just tell emacs to use a US layout.

8:23 Fossi: well, that's kinda a mood point about paredit

8:23 never c&p

8:23 or you will have to go through hell to fix it

8:23 Chousuke: it's not about cut'n'paste though.

8:24 if I just delete a line with viper, it will confuse paredit if it happens to cause the parens to become unbalanced.

8:24 Fossi: you can always rebalance them by pasting a ")"

8:24 well, that's more or less cutting

8:25 AWizzArd: http://www.csd.uwo.ca/staff/magi/personal/humour/Computer_Audience/Boot%20It.html

8:25 Fossi: you should use paredit-kill for deleting anyway

8:27 Chousuke: I need a better keyboard anyway :/

8:27 Fossi: typematrix rocks

8:27 Chousuke: the macbook keyboard is very much not emacs-friendly

8:27 Fossi: haven't found a better one and i searched quite some

8:28 it's a little strange at first, but it pays

8:29 Chousuke: mmh

8:29 control key seems to be in a bad position :/

8:29 Fossi: a real small downside is that the backspace is so close to the enter key

8:30 so sometimes i send messages in irc/im that i wanted to correct, but that's prolly because i don't touch type correctly

8:30 that's why i thing i'll switch alt and ctrl when i go dvorak again

8:30 Chousuke: I read some advice for buying a keyboard for emacs use, and it said that the control key should be pressable with the palm

8:30 Fossi: *think

8:31 Chousuke: which makes a lot of sense.

8:31 Fossi: the right control key is kinda nice thoughand the inline cursor keys

8:31 Chousuke: I don't use enter that much actually

8:31 just ctrl-m

8:32 often it doesn't work though :(

8:32 Fossi: ah, didn't know that one yet

8:33 Chousuke: in irssi it seems ctrl-j works too

8:33 Fossi: well, th etypematrix is not really emacs centric

8:33 Chousuke: hmm, and in a regular shell

8:33 two different linechars I guess

8:34 Fossi: prolly cr lf

8:34 Chousuke: in slime ctrl-j seems to just add a line, and ctrl-m actually sends input

8:35 Fossi: newline-and-indent is great

8:35 i guess i should bind that to RET in clojure-mode

8:36 Chousuke: I need to get over my current tiredness

8:36 then I might write regexp pattern support for my reader!

8:37 It's really fun to write.

8:38 I think of the simplest method to accomplish something, write it out, and then test it, and most of the time it just works :P

8:39 I guess it helps a lot that I'm not working with a stateful stream. writing a small function to add a bit of functionality and then testing it is really easy. no need to reset the stream or anything :)

8:40 though I thing that might turn out to be a problem later on :/

8:41 But I think I'll worry about it after I have a working reader for non-stateful input.

9:08 cemerick: wow, clojure is the 21st most popular language on github. That's sort of amazing, IMO.

9:08 AWizzArd: cemerick: and the number of chatters here in the channel is increasing again

9:09 next January we will have a new peak

9:09 cemerick: heh, maybe

9:09 #clojure is a far less important indication, I think

9:09 LauJensen: cemerick: Whats #1 and #2 ?

9:09 cemerick: ruby and javascript

9:09 http://github.com/languages

9:10 definitely the web-2.0 crowd

9:11 clojurebot: popularity-on-github is <reply>Clojure ranked #21 on 8/14/2009

9:11 clojurebot: Alles klar

9:11 LauJensen: Ok - Am I evil for hoping Clojure will never get above #15? :)

9:11 andyfingerhut: Anybody here use github commercially? I only have a free account. It is darned convenient.

9:11 cemerick: andyfingerhut: we looked at it very briefly, but it's *incredibly* expensive

9:11 LauJensen: andyfingerhut: None that Ive heard of, Im even migrating my freebies off Github to Gitorious

9:12 Chouser: "I'm very envious of the attention [arc] gets" --rhickey http://clojure-log.n01se.net/date/2008-02-12.html#12:08a

9:12 has anyone heard arc mentioned anywhere recently? I haven't.

9:13 what a difference 18 months can make

9:13 LauJensen: Arc compiles to native though? *jealous*

9:14 cemerick: LauJensen: can gitorious be set up on a server by a mere mortal now? It was simply impossible IMO when I tried it some months back.

9:14 LauJensen: cemerick: Dunno, I just use their webservice, havent set anything up myself

9:14 cemerick: Chouser: I talked with a couple of MIT folks a few weeks ago that are using it actively. The Graham connection explains that, I think.

9:14 LauJensen: And that only took < 2 minutes

9:15 Chouser: cemerick: huh. ok.

9:15 cemerick: I wouldn't look to random researchers at MIT for trend datapoints ,tho :-)

9:20 rsynnott: wow, people are using arc? Amazing

9:20 I thought it just died

9:21 cemerick: I'm starting a new project, probably going to push it to github. Do folks prefer clj-dbm or cljdbm? I was trying to get a sense of whether there's a naming convention to these things at the moment, but it seems not.

9:22 Fossi: didn't even know it was released

9:24 arbscht: clj-dbm. to me, cljdbm risks implying cl-jdbm

9:26 there's precedent in clj-html, clj-android etc. from clojure.org/libraries

9:26 Fossi: i also like clojure- or clj- better

9:33 LauJensen: cemerick: Whats the full name of the project?

9:34 cemerick: LauJensen: clj-dbm, or some variant

9:34 it's a wrapper for the jdbm library

9:34 LauJensen: Does dbm not stand for something?

9:34 cemerick: (with lucene integration)

9:35 database manager

9:35 LauJensen: I'd probably go with clojure-dbm, but it would be nice to get consensus on a convention

9:35 cemerick: the DBM model has been around for a long, long time http://en.wikipedia.org/wiki/Dbm

9:35 LauJensen: We've been happy with ClojureQL

9:35 cemerick: jdbm happens to be a java impl

9:44 tomoj: I was thinking about doing something with agent watchers and automatic json conversion with couchdb

9:53 LauJensen: I recently implemented an ajax chat using compojure/json/clojureql. Quite nice way to develop

10:10 andyfingerhut: anyone have some quick hints for a Java newbie on how to run a Clojure program with the right options so that a Java debugger can get all the info it needs to be useful? I'm trying out a free eval of jDebugTool. Not sure if that tool is any good or not. Recommendations for something free or with a trail eval period are welcome.

10:14 I'm currently starting the java process with these debug-enabling options: -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

10:14 clojurebot:

10:15 andyfingerhut: And then I run jDebugTool separately and attach to that process.

10:31 Fossi: somebody *really* needs to write an elisp script to clean up imports ;D

10:41 mblinn: sonofcim michael vick

10:41 oops

10:41 sorry, carryon

10:58 Anniepoo: clojurebot: paste

10:58 clojurebot: lisppaste8, url

10:58 lisppaste8: To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.

11:00 Anniepoo pasted "RT/ROOT_CLASSLOADER" at http://paste.lisp.org/display/85380

11:01 Chouser: heh

11:02 I guess that's what I get for recommending you look at my own code...

11:02 LauJensen: Anniepoo: Sweet with the title :)

11:02 Anniepoo: it's urping at this location. I take it you're doing some deep magic getting the class loader

11:02 Chouser: the interface has changed

11:02 Anniepoo: LJ, yah, thanks for the tip, and I quit marking them one hour too

11:04 yah, it's private now

11:04 Chouser: Try this instead: (RT/baseLoader)

11:04 or wait for me to commit an update

11:04 Anniepoo: lol

11:05 that didn't work

11:05 Unable to find static field: baseLoader in class clojure.lang.RT (textjure.clj:323)

11:05 Chouser: you need the parens

11:06 Anniepoo: ah

11:07 Chouser: tested and pushed.

11:10 Anniepoo: pasting throws exception

11:10 lisppaste8: Anniepoo annotated #85380 "pasting throws exception in textjure" at http://paste.lisp.org/display/85380#1

11:12 Anniepoo: this is better than being rubbed with a brick, that's for sure!

11:13 what's the upper and middle panels for?

11:13 (sorry, the upper - you've set a max size)

11:22 Chouser: the upper panel is meant to be a text editor

11:22 nothing useful there yet though.

11:23 Anniepoo: ah, ok

11:23 Chouser: huh, I don't know anything about that paste error.

11:23 Anniepoo: dunno, could be related to me running in IntelliJ

11:24 I'm insanely tempted to ignore everything I have to do for the next week and build my own tiny IDE in Clojure

11:29 Chouser: Anniepoo: I understand the temptation. textjure demostrates how for I got before returning to my senses.

11:29 Anniepoo: LOL

11:30 well, I should know the language better before doing it

11:30 Fossi: i guess a native editor would be nice

11:30 then again, emacs is just so damn effective

11:31 Chouser: I got bogged down trying to write a general "parser" for multi-keystroke vi-like command sequences.

11:31 Anniepoo: ah, Cl port of YACC?

11:31 cemerick: Fossi: ...at causing madness and general mayhem? ;-)

11:32 Neronus: At being a mail client

11:32 Fossi: cemerick: apparently, that lasts only a few years ;)

11:32 Anniepoo: I could write something saner in the time it'd take me to memorize the emacs commands for the third time in my life

11:33 Fossi: i thought so too

11:34 now i miss things like forward-delete-word in other programs

11:34 Chouser: Fossi: dW

11:34 sorry

11:34 I should restrain myself. But that's an example of what I wanted to be able to parse.

11:35 Anniepoo: sure - and I've got them memorized for IntelliJ - it's ctrl shift right arrow del

11:36 Fossi: Anniepoo: exactly my point.

11:36 cemerick: I've never understood the attraction of arcane stuff like dW and all the emacs-isms. Visual feedback is always good, incantations are always bad.

11:36 Chouser: vim apparently has a giant C switch statement that munges global variables as you type. bleh

11:36 Anniepoo: I'm with cemerick

11:36 cemerick: Programmers are more like civilians than we generally like to think.

11:36 Anniepoo: I've been programming since Unix was an interesting new OS

11:37 Fossi: well, just from my experience from the last two month of clojure with emacs compared to eclipse and java, the editing feels much faster

11:37 Knekk: Incantations are merely useful shortcuts

11:37 LauJensen: cemerick: Emacs is very transparent, speedy and flexible. I'd get annoyed just from the 5 second start up time of Eclipse

11:38 Anniepoo: and fail to understand the fascination in some quarters for stuff that went out with pin matrix printers

11:38 Fossi: then again, you prolly can't do things like paredit does them with more syntax

11:38 * Knekk hugs his Emacs.

11:38 cemerick: LauJensen: speedy and flexible, but only for a particular definition of those terms. The notion of transparency is laughable though (IMO, of course)

11:38 Anniepoo: I'd agree with Fossi, most ANY decent editor that you have memorized the keys for is better than

11:39 any other editor you haven't

11:39 LauJensen: cemerick: Laughable?

11:39 Fossi: Anniepoo: well, i have them down for eclipse i think

11:39 * Chouser is laughing, for what that's worth.

11:39 Fossi: it's just that it's not or only barely possible to kill things in the current scope for example

11:39 * Knekk hugs his vim

11:39 Anniepoo: ah, that's interesting

11:40 Fossi: and ctrl-shift-right del is rediculous from the amount of finger movement compared to meta-d

11:40 Anniepoo: well, yes, and I'm on IntelliJ, which knows about and is wonderful for Java, but won't, for example, double click highlight str-utils as one identifier

11:40 cemerick: LauJensen: emacs does lots of the same kind of stuff that vim does, except it's user-extensible, so bindings can be changed by things other than user action.

11:41 LauJensen: So how is that laughable ?

11:41 cemerick: chorded keybindings, basic lack of visual feedback, etc etc etc.

11:41 Knekk: elisp is way easier to use than vim macros

11:41 Fossi: Anniepoo: i wouldn't even think of using emacs for java

11:41 cemerick: LauJensen: it's not what I would consider "transparent"

11:42 Anniepoo: OK, Fossi, you're making a more convincing argument

11:42 LauJensen: By transparent I meant - I dont have to worry about 6 different windows I rarely use and an abundance of tools that are unnecessary for editing .clj files. Perhaps I used the wrong word

11:42 Fossi: i guess it would be really cool to have a seperate editor for clojure, it's just going to be hard to be as effective as emacs is for lisps

11:43 that was my whole point :)

11:43 tomoj: +1 for slime/paredit

11:43 Knekk: how many times do you reach for the mouse when you are using your IDE? Learn to love keyboard shortcuts, a.k.a. incantations

11:43 cemerick: yeah, it's totally a personal preference, likely not with much of a defensible basis.

11:44 Anniepoo: Fossi, I suspect the solution is to effectively wrap emacs in something

11:45 Fossi: dunno

11:45 * Knekk hops off the train and drags his ass to the office.

11:45 Anniepoo: but you've convinced me to try it, I'll get set up to do emacs and I'll make myself a set of flashcards and spend a few hours memorizing keystrokes

11:46 cemerick: Knekk: IRC'ing from the train?

11:46 Fossi: i just edited away and took a look at a new keystroke every few days

11:46 Knekk: cemerick: aint' technology grand? brb

11:46 * Knekk loves editor discussions.

11:46 Anniepoo: yes, but I've found when I change editors it's well worth it to make a stack of index card flashcards

11:46 find a coffee house somewhere

11:47 a couple mocha's later I'm a lot more productive

11:47 LauJensen: Whats the attraction of this IntelliJ people are talking about?

11:47 * cemerick hopes he's found his last language + development environment

11:47 Anniepoo: Lau, for Java it's wonderful

11:48 it has incredibly intelligent refactoring

11:48 it's in many ways another approach to dealing with the ceremony of Java

11:48 LauJensen: Looking at the site now. Cemerick whats your editor of choice?

11:48 Anniepoo: Anything Clojure-specific for it?

11:49 Anniepoo: you can do most refactorings as single keystrokes

11:49 cemerick: NetBeans. IntelliJ is very, very nice for Java, but NB has a much richer plugin ecosystem (for what I care about, I suppose), and a very good clojure environment.

11:49 rsynnott: 'ceremony of Java' - I am imagining people sacrificing explicit casts to the gods, here

11:50 Anniepoo: yes, there's a (not all that hot, but OK) La Clojure plugin

11:50 LauJensen: Anniepoo: Refactoring - I've never tried it - Is that where you editor is smarter than you in dividing your code into logical factions ?

11:50 cemerick: It's Java capabilities are good, but not close to IntelliJ. If I were dedicated to programming in Java for many years to come, I'd probably buy it.

11:50 bah, its*

11:51 Anniepoo: Lau, it's where my editor is a darn sight faster than me in doing something like

11:52 Chouser: If I couldn't use vim, I'd definitely use emacs. I've never tried an IDE that didn't end up annoying me, while I got quite far with emacs once.

11:52 Anniepoo: adding a parameter to a method call and propagating it everywhere

11:52 tomoj: unfortunately I think clojure will never have that kind of thing

11:52 LauJensen: k

11:53 * rsynnott is perfectly happy with slime

11:53 Anniepoo: tomoj, why not? it's be a lot easier to write for Clojure, and with it's Lisp heritage, there's lots of AI/NLP oriented programmers around to do that sort of thing

11:53 brb

11:53 tomoj: hmm

11:53 but clojure is dynamic

11:54 there are no good refactoring editors for ruby because it's dynamic

11:54 cemerick: tomoj: I've heard very good things about the NB ruby environment and its refactoring

11:54 (never used it myself, tho)

11:54 tomoj: it's nothing compared to intellij, from what I've heard

11:55 Chouser: I think if you accept that even in Java refactoring is perfect 100% of the time, then you can make progress on a dynamic language like Clojure.

11:55 tomoj: e.g. in ruby if you see foo.some_method, there's no way to know what foo is, so you can't rename or add parameters to some-method

11:56 Anniepoo: IntelliJ has it's weaknesses - the module/project system is obscure, and the GUI builder is weak

11:56 cemerick: has anyone heard of plans to add contrib.def to clojure itself (core, or some other ns)?

11:57 Anniepoo: oh, yeah, the GUI builder. That thing is *horrible*.

11:57 directly generates classfiles, last time I tried it *ugh*

11:57 andyfingerhut: any jswat users here?

11:57 Anniepoo: cemerick, you can set that

11:57 it's in project settings

11:57 cemerick: ahha

11:58 the fact that it's an option at all makes me question the entire product top-to-bottom

11:58 Anniepoo: JBuilder from Borland has a lovely, lovely GUI builder

11:58 cemerick: generating classfiles that are *intended* to be added to source control is insanity

11:58 rsynnott: Borland always was good at GUI builders

11:58 Knekk: what did I miss?

11:58 Anniepoo: cemerick, forcing users to do what you think is good for them is probably more insane

12:00 cemerick: Anniepoo: is there any use case for versioning the artifacts of code generation? In this neck of the woods, that's what build processes are for.

12:00 * cemerick better lay off the snark. Not enough sleep last night.

12:01 Chousuke: cemerick: maybe you should prompt it on the group. core could use a def- and defmacro- at least, if not defvar and defvar-

12:01 Anniepoo: actually, I can indeed think of a few. I mostly do graphics related stuff, and often work with asset pipelines

12:01 Chousuke: cemerick: I think it's somewhat counterintuitive to have defn- but no def- :/

12:02 cemerick: Chousuke: OK, I will. Any idea why it's defvar- and not def-?

12:02 Anniepoo: it's not uncommon to have odd semi-automated processes

12:02 Chousuke: cemerick: it supports a docstring

12:03 cemerick: Anniepoo: yeah, I'll definitely grant you the asset case. But UI layouts aren't graphical assets.

12:03 Anniepoo: hmm....

12:03 I currently have a project that has a bunch of wood workshop files

12:03 I assume if I pass you my project you have wood workshop installed and configured correctly?

12:04 ;c)

12:04 cemerick: Chousuke: Oh, I see. Yeah, a regular def- would be good

12:04 Chousuke: I'd like the defvar macros too though.

12:05 actually, having them but not def- would be enough I guess.

12:05 def could remain the low-level special form it is :)

12:13 Fossi: +1 for def- and defmacro-

12:14 cark: i use defonce quite a bit too

12:14 in clojure.contrib.def

12:14 and its variant defonce-

12:14 Fossi: i rarely use any of them because i can't be bothered to import them

12:15 which is a shame

12:15 especially generating docs without the private things would be pretty useful

12:30 drewr: I hate spending 3 hours debugging a fn with lazy-seq only to discover I wasn't recurring correctly

13:01 is there a lazy flatten somewhere?

13:01 I thought the one in seq-utils would be

13:01 Chousuke: ~def flatten

13:02 * Drakeson` cannot type "closure" correctly. Got embarassed in front of my boss when I had to search something for him.

13:02 Chousuke: seems lazy to me.

13:02 drewr: ,(flatten [[1 2 3] [4 5 6] [7 8 (iterate inc 0)]])

13:03 clojurebot: Execution Timed Out

13:03 drewr: ,(flatten [[1 2 3] [4 5 6] [7 8 9]])

13:03 clojurebot: (1 2 3 4 5 6 7 8 9)

13:03 drewr: whoops

13:03 cark: but clojurebot tries to print it

13:03 drewr: ,(take 4 (flatten [[1 2 3] [4 5 6] [7 8 (iterate inc 0)]]))

13:03 clojurebot: (1 2 3 4)

13:03 drewr: hm

13:03 ,(firt (flatten [[1 2 3] [4 5 6] [7 8 (iterate inc 0)]]))

13:03 clojurebot: java.lang.Exception: Unable to resolve symbol: firt in this context

13:03 drewr: ,(first (flatten [[1 2 3] [4 5 6] [7 8 (iterate inc 0)]]))

13:03 clojurebot: 1

13:04 drewr: I guess it is. Interesting.

13:08 cemerick: it's too bad that one cannot import an inner class; e.g. (import 'org.apache.lucene.document.Field$Store), then use Store/YES

13:09 drewr: ~import-static

13:09 clojurebot: Excuse me?

13:09 drewr: ~def import-static

13:10 maybe not

13:10 cemerick: yeah, that won't help

13:10 totally not a big deal

13:14 drewr: flatten doesn't act lazily with side effects perhaps

13:14 I'm returning batches of data from a database with lazy-seq

13:15 if I do (take 1 (flatten (get-batches ...))) it hits the database for all matching batches

13:15 but if I do (take 1 (get-batches ...)), it only hits the db to get the first batch

13:16 cemerick: whoa, doseq supports the same filtering as for!

13:16 * cemerick needs to pay more attention

13:18 abedra: got a strange question if anyone is around to help

13:19 I have some code http://gist.github.com/167970

13:19 that produces an error

13:19 but if I copy the top function into the repl and just paste the innards of the second funtion to the repl it works

13:19 Chousuke: defn is missing the parameter list

13:19 abedra: oh good lord

13:20 mudphone: it happens to everyone

13:20 abedra: wow

13:20 time for sleep

13:20 thanks

13:20 mudphone: (or maybe just me)

13:20 Raynes: Never happened to me. >_>

13:20 abedra: lol

13:20 mudphone: just me then :)

13:21 Raynes: Of course, I had several embarrassing mistakes that seemed equally stupid. Just not this particular one.

13:21 :)

13:21 mudphone: last night I tried to use defn, without calling it...

13:21 defn... instead of (defn

13:21 oh boy

13:21 lrenn: happened to me last night. writing lots of deftests can do that.

13:22 mudphone: the interesting thing is the error

13:22 java.lang.Exception: Can't take value of a macro:

13:23 ... anyway...

13:24 Chousuke: ,def

13:24 clojurebot: java.lang.Exception: Unable to resolve symbol: def in this context

13:24 mudphone: in my case it was

13:24 ,defn

13:24 Chousuke: that's rather interesting

13:24 clojurebot: java.lang.Exception: Can't take value of a macro: #'clojure.core/defn

13:24 Chousuke: ,(def def 0)

13:24 clojurebot: DENIED

13:24 Chousuke: damn.

13:24 cemerick: better than when I first started learning clojure, and was doing (filter #(nil? %) ...), etc.

13:24 :-(

13:25 Chousuke: well, that's quite normal :P

13:25 abedra: :)

13:25 Chousuke: eventually you grow to notice such redundancy and eliminate it.

13:25 cemerick: that's what I get for being away from scheme for so long

13:26 Chousuke: and filtering nils is interesting too. :)

13:27 mudphone: some people like their nils

13:27 Chousuke: heh.

13:31 cemerick: Chousuke: yeah, I was just tossing out an example, and nil? came to mind first

13:33 Chousuke: heh.

13:46 jwhitlark: Does anyone know if "The Little Schemer" has anything to offer for working in clojure? Is it lisp focused or scheme focused?

13:46 osaunders: I don't understand. There's not-any? but no any? Is that right?

13:47 mblinn: scheme

13:47 but it's very enjoyable

13:47 stuartsierra: osaunders: "any?" is effectively "some"

13:48 cemerick: not-any? probably should have been none?

13:48 osaunders: stuartsierra: Thanks. Can't help being annoyed by that naming inconsistency though.

13:48 technomancy: is "some" a CL-ism?

13:48 mudphone: jwhitlark: I'm currently reading "The LIttle Schemer"

13:48 technomancy: that would certainly explain the annoying inconsistency

13:48 mudphone: jwhitlark: I think it's worth checking out, if you're new to lisp

13:48 stuartsierra: "some" is slightly different, it returns the thing found, instead of true/false

13:48 jwhitlark: I'm just trying to figure out if has a wider applicability to lisp.

13:48 technomancy: jwhitlark: definitely worth a read.

13:48 stuartsierra: The predicates ending in "?" usually return a boolean.

13:49 osaunders: Ah.

13:49 stuartsierra: I believe it's also a CL function.

13:49 jwhitlark: mudphone: I've been using lisp off and on for a while, but I'm really aiming for a deeper understanding now that I'm trying to do production work in clojure.

13:50 stuartsierra: You could (defn any? [pred coll] (if (some pred coll) true false))

13:51 correction: "some" returns the first logical true value returned by the predicate.

13:51 mudphone: jwhitlark: rich hickey has a clojure bookshelf on Amazon

13:52 jwhitlark: clojure bookshelf: http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH

13:53 stuartsierra: that's one comprehensive list!

13:53 jwhitlark: ohhh. Christmas time!

13:53 stuartsierra: If you can plow through every one of those books, you'll be a rockstar programmer for sure.

13:55 jwhitlark: I'm working through On Lisp at the moment. I've got a month's vacation to get caught up on the things I've been missing.

13:55 gko: Is there already a FTP clojure library ?

13:56 mudphone: jwhitlark: there are three books in "The Little Schemer" series... in case the first one is too basic for you

13:57 stuartsierra: let's see if I can plow through AND understand them :)

13:57 osaunders: stuartsierra: Thanks for the any? def but I think some will do fine. Probably why any? isn't defined.

13:58 stuartsierra: exactly

13:58 osaunders: Is a bookshelf the books his owns?

13:58 *he owns

13:58 The list author says: "Books that influenced Clojure, in no particular order

13:59 ^ answered my own q.

13:59 mudphone: actually, first heard of the list from technomancy's blog

14:00 osaunders: 36 programming books is a lot of work.

14:00 I get through probably little over 6 programming books a year.

14:01 I read something once that suggested the best ratio for programming awesomeness was 70% programming 30% reading.

14:01 Of course the time you spend programming should be on stuff that challenges you,

14:01 clojurebot: that is not what I wanted

14:03 osaunders: (print pie),

14:03 mudphone: ravi_n = ravi_nemani ???

14:22 drewr: stuartsierra: do you want patches for c.c.http.agent, or is it still a work in progress?

14:23 actually, c.c.http.connection

14:23 stuartsierra: drewr: happy to have corrections/bugfixes

14:24 but I wouldn't bother with assembla patches, it's still a work in progress

14:24 I've actually been wondering if I should remove it from contrib altogether until I'm satisfied it's finished.

14:24 drewr: works well for me with a couple of bugfixes

14:25 stuartsierra: hit me, then

14:25 technomancy: stuartsierra: I'm of that opinion. it's not difficult to create new repositories for experimental or in-progress code.

14:25 as long as you've got mechanisms for dependency resolution, of course.

14:25 stuartsierra: It doesn't depend on much, just duck-streams.

14:26 technomancy: stuartsierra: right, I mean for code depending on http.agent

14:26 stuartsierra: oh, right

14:26 lisppaste8: drewr pasted "c.c.http.connection fixes" at http://paste.lisp.org/display/85390

14:26 technomancy: good thing corkscrew is around! </self-promotion>

14:26 stuartsierra: how's that coming, by the way?

14:27 drewr: I'm using jdk6; not sure if that makes a difference with regard to setting streaming mode before connecting

14:27 technomancy: stuartsierra: it's done. as much as I need is done anyway.

14:27 drewr: but that's why I had to move .connect around

14:27 stuartsierra: cool

14:27 technomancy: just waiting for the vast throngs of users to tell me how they like it. =)

14:27 drewr: s/move/copy/

14:28 stuartsierra: drewr: I think you're right.

14:28 the streaming mode should be set before .connect, always

14:34 cemerick: a generalized dependency resolution utility and linker would be great

14:34 * stuartsierra is applying drewr's patch

14:34 * cemerick is totally willing to use other people's code! </charity> ;-)

14:34 technomancy: cemerick: what's a linker?

14:36 cemerick: technomancy: broadly, given a program, it determines all transitive dependencies, and produces "object code" (in our case, just a merged jar, etc) that contains only what you need to run the given program

14:37 technomancy: cemerick: gotcha. yeah, if you've got dependency resolution down, then that's pretty trivial.

14:37 cemerick: which we don't, yet (AFAIK)

14:37 technomancy: cemerick: take a look at corkscrew. =)

14:37 cemerick: technomancy: I saw maven and ran away. Sorry. :-(

14:38 drewr: stuartsierra: thanks

14:38 technomancy: cemerick: heh; the whole point of corkscrew is that you don't have to use maven.

14:38 drewr: ah, you broke the typo out into a separate commit, good

14:38 stuartsierra: yeah, someone posted that on the list

14:38 cemerick: technomancy: "It currently requires that Maven be installed to work. This requirement should be removed in future versions."?

14:39 technomancy: you don't have to interact with it is what I mean.

14:39 cemerick: ah

14:40 technomancy: once I get it so you don't need maven installed I will be sure to hide any references to that word deep away in the code so it doesn't frighten people away.

14:40 cemerick: right now we're using git submodules for dependencies. I'm hoping subtree merging gets into the git mainline eventually, as that would be a nearly-ideal scenario.

14:41 technomancy: I'm highly allergic to maven. It's one of those tools that demands that it own your entire world.

14:42 technomancy: cemerick: maybe in Java that's true

14:42 in Clojure you can use it only for dependency resolution and it's very simple

14:42 lrenn: technomancy: did you consider ivy since you're only using the dependency resolution?

14:43 technomancy: lrenn: I considered it. they both support maven's repository format... when in doubt, choose the tool that doesn't consider XML to be a programming language.

14:43 greenspun's tenth and all

14:44 cemerick: technomancy: that's interesting. I may take another look if git subtrees don't materialize.

14:44 technomancy: I mean, when you consider the fact that the creator of ant has publicly apologized for it and decided to give up his career in programming... that says a lot.

14:44 Chousuke: subtree merging?

14:45 technomancy: and it's a good thing too; he's much better at photography.

14:45 lrenn: technomancy: agreed re: xml and ant, but you could have used ivy just to fetch the deps, no xml required (i think anyway).

14:46 technomancy: lrenn: corkscrew is 200 lines of code. if someone wants to rewrite it to use ivy I would be fine with that.

14:46 cemerick: Chousuke: http://navarra.ca/?p=520 and http://github.com/apenwarr/git-subtree/tree/master

14:49 Chousuke: hmm

14:49 git submodules aren't that bad once you get used to them, but they're not very flexible.

14:49 you can't follow a "moving target"

14:50 cemerick: That's not my real gripe with them. The real issue IMO is that the submodule dir (that contains the hash to be checked out) is a constant source of merge conflict.

14:54 Chousuke: cemerick: interesting

14:54 I hope it gets merged.

14:54 cemerick: one step closer to svn:externals, which is the only thing I miss from svn

14:55 weissj: anybody know how to use jline? how do you go back to history?

15:13 cemerick: does proxy not support implementing overloads with different arities?

15:14 Chouser: it does

15:14 cemerick: (e.g. even with -byte<>-int-int-style names?)

15:14 hrm

15:14 Chouser: I can never remember how, though. you might have to overload all the arities and handle them inside the one fn

15:14 cemerick: Oh, right. I remember now. :-P

15:19 Chouser: yup, thanks for the reminder :-)

15:21 Chouser: I'm not sure I've ever had to do it myself, or at least so rarely I always forget.

15:23 cemerick: this was precipitated by proxying an abstract class that had a writeBytes(byte[], int, int) method, but provided a (byte[], int) default impl -- and I figured I could leave the latter to do its thing

15:24 Anniepoo: I can't believe it, I was loving this language before, and having to go through a compile cycle. Now I'm altering the code as it runs! A-freeeking mazing!!!!

15:26 Whooo HOOOO!!!!!

15:26 Chousuke: :D

15:33 weissj: i was using clojure-dev in eclipse but the repl sucks so bad there bc jline doesn't work in eclipse. so now i'm using a plain repl in linux console. what do i call to load a file and run it? that's what the eclipse env does behind the scenes. load-file just loads it

15:35 er, maybe my previous environment would switch ns, this one doesn't

15:36 * Chouser has become a fan of Ring

15:36 weissj: what's that

15:37 Chouser: http://github.com/mmcgrana/ring

15:37 (defmulti app :uri) (ring.jetty/run {:port 8080} app) ; whee!

15:38 Chousuke: heh

15:39 github is slow :(

15:39 I hear they're working on it though. I wish them success :)

15:40 hiredman: indeed

15:49 lrenn: technomancy: after looking at corkscrew, ivy is of no use to you since you use it to build.

15:49 technomancy: i think you might have some issues with a few of you shell scripts as well.

15:49 technomancy: other than that, pretty neat.

15:50 technomancy: lrenn: well that's basically my first non-joke shell script, so no surprises there.

15:50 lrenn: technomancy: yeah, while trying to debug it I saw the comment :)

15:50 technomancy: using corkscrew to build is just bonus though; it'd be pretty easy to move that out of maven.

15:50 stuartsierra: Are agent actions dispatched with "send-off" queued in the order they are sent?

15:50 technomancy: well, so says me anyway since I have yet to encounter a non-trivial build process modulo dependency resolution.

15:50 weissj: what's wrong with (-> @testscript getClass getDeclaredMethods) ? -> doesn't work like ..?

15:51 Chousuke: weissj: you need .getClass and .getDeclaredMethods

15:51 weissj: oh right

15:51 stuartsierra: i.e. if I write (do (send-off a one) (send-off a two) (send-off a three)) do I know that the actions will execute in the order one,two,three?

15:52 technomancy: stuartsierra: pretty sure it will; you can double check what class is used for queueing in Agent.java if you want to be sure.

15:52 stuartsierra: ok

15:53 It appears to work.

15:58 ,(let [a (agent [])] (dotimes [i 1000] (send a conj i)) (await a) (apply < @a))

15:58 clojurebot: true

16:09 weissj: is there a compliment to nil?

16:09 i mean a compliment to (nil?) ?

16:09 Chouser: (complement nil?)

16:09 :-)

16:10 weissj: i know there's (not nil?)

16:10 but i mean one fn

16:10 Chouser: Yeah, I understand. I don't think so.

16:10 weissj: k

16:11 Chouser: #(not (nil? %)) or (complement nil?)

16:11 cemerick: there's always if-not and when-not, too

16:11 Chouser: many higher level things have their own complementes

16:11 right, if-not, when-not, remove instead of filter

16:17 drewr: I have a doseq that is traversing a lazy-seq of stuff from a db that's somehow running out of heap

16:17 if I babysit it and run System/gc periodically, it frees memory up

16:18 but I shouldn't have to do that

16:19 I can count the whole stream and it doesn't run out of memory

16:19 Chouser: ew

16:19 sorry

16:19 drewr: I guess I'm doing something in the doseq that's holding onto the head

16:20 Chouser: if you're actually holding the head, I don't thing a System/gc would help.

16:20 drewr: right, that's what I thought

16:20 of course me calls to .freeMemory are completely unscientific

16:20 it may just be illusory

16:21 tomoj: why is it unscientific?

16:21 too many other variables?

16:21 drewr: just randomly hitting it from the repl

16:21 to see if it's rising or falling

16:37 Chousuke: Chouser: heh, I should've used #() in my golfing attempt :(

16:47 hiredman: :D

16:48 clojurebot responded to ~def + in a xmpp muc

16:49 ~ping still gets me a NPE

16:50 technomancy: hiredman: you got clojurebot on xmpp?

17:03 osaunders: java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Integer

17:03 That means I'm trying to execute a number right?

17:03 ,(1)

17:03 clojurebot: java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn

17:04 osaunders: Can that exception occur for any other reason?

17:05 hiredman: those are the same exception but for different reasons

17:05 java.lang.ClassCastException means something is trying to cast something to something it isn't

17:05 osaunders: Oh wait, I worked it out.

17:06 ,(conj 1 [])

17:06 clojurebot: java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IPersistentCollection

17:06 osaunders: ,(conj [] 1)

17:06 clojurebot: [1]

17:06 osaunders: :-)

17:19 When do you use let? I haven't yet needed it.

17:20 tomoj: all the time? :)

17:21 osaunders: Why?

17:22 hiredman: for local names

17:22 osaunders: You don't need that though.

17:22 Right?

17:23 tomoj: I assume clojure is still turing complete without it

17:23 Chousuke: you do, unless you want to do a lot of unnecessary typing/computation

17:23 technomancy: osaunders: you never _need_ it. you use it sometimes to cache values in order to avoid calculating them twice, and sometimes just to give a value a more readable name.

17:23 tomoj: but it can be useful

17:23 here's a simple example: I'm matching a string against a regex with re-matches

17:23 well.. guess that's not a really good example

17:24 Chousuke: I mean, which is better: (let [x (first s)] (+ x x x)) or (+ (first s) (first s) (first s))?

17:24 tomoj: that's a good example :)

17:24 osaunders: (apply + (repeat (first s)))

17:24 3 in there

17:24 Chousuke: you forgot take 3

17:24 but that's contrived

17:25 never mind that (* 3 (first s)) is even better :P

17:25 tomoj: I have some code here where I have to do some conditionals based on a string, but it needs to be parsed to an int before I can check it

17:25 Chousuke: but still, let is not something you'd want to do without.

17:25 tomoj: rather than reparse it in every single conditional, I use let to bind it to a local name

17:25 Chousuke: especially because it has destructuring

17:25 osaunders: Hm.

17:25 I don't think I get this language at all sometimes.

17:26 Chousuke: what, specifically?

17:26 technomancy: is it a common pattern to have properties that need to get set before a given class loads?

17:27 I was assuming they were getting checked at runtime, but that was not the case.

17:27 Chousuke: osaunders: let is like temporary variables in other languages.

17:27 weissj: if i'm calling a java method that has a vararg String... i can't pass it ["hi" "there"], how do i give it a type hint

17:27 osaunders: Chousuke: I'm not saying that just because of let.

17:27 hiredman: god

17:27 technomancy: ~doc into-array

17:27 clojurebot: I don't understand.

17:27 Chousuke: osaunders: though of course, let bindings are not variable at all :P

17:27 hiredman: osaunders: your code isn't full of calls to defs is it?

17:28 def

17:28 tomoj: ,(let [[match? month day year] (re-matches #"(\d+)-(\d+)-(\d+)" "08-14-2009")] [match? month day year])

17:28 clojurebot: ["08-14-2009" "08" "14" "2009"]

17:28 Chousuke: tomoj: durr.

17:28 * Chousuke goes to fix his reader

17:29 Chousuke: I forgot the existence of re-matches completely.

17:29 tomoj: is there something better?

17:29 * Chousuke did (let [m (re-matcher par)] (.matches m) (dostuff (re-groups m)))

17:29 osaunders: hiredman: Hm, yeah I guess it is.

17:29 Chousuke: pat*

17:30 hiredman: osaunders: :(

17:30 Chousuke: osaunders: then you're most likely doing it wrong :/

17:30 hiredman: very very wrong

17:30 Chousuke: though hopefully not.

17:30 tomoj: the fact that clojure can be used that way is somewhat scary

17:30 Chousuke: osaunders: are those defs inside functions?

17:30 osaunders: Actually no, in this case I don't think I am.

17:30 hiredman: def is only ever for global names, and you should never be re-defing stuff

17:30 technomancy: tomoj: it's a side-effect of allowing interactive development

17:30 osaunders: But I can see that it will be unsustainable.

17:31 tomoj: technomancy: I guess it's not really all that scary. I've just been reading "Out of the Tar Pit" today

17:31 technomancy: hehe

17:31 tomoj: I wouldn't be averse to a warning when using def in a non-toplevel context

17:32 hiredman: so clojurebot is also in clojure@conference.thelastcitadel.com if anyone wants to play with him via xmpp

17:33 tomoj: so does that mean I can evaluate clojure in gmail now?

17:33 :)

17:33 hiredman: sure

17:34 tomoj: not sure when I would want to do that really, but cool

17:34 clojurebot: that is not what I wanted

17:34 hiredman: I think getting into a mutiluser chat with gmail is weird

17:34 tomoj: oh, I see

17:35 osaunders: What did clojurebot just say that?

17:35 *Why did

17:35 Chousuke: it does that sometimes.

17:36 osaunders: lol

17:37 Like a swearing uncle... "Oh he does that sometimes."

17:37 Chousuke: ~want

17:37 clojurebot: It's greek to me.

17:37 Chousuke: hmm

17:37 osaunders: ~uncle

17:37 clojurebot: Gabh mo leithscéal?

17:37 Chousuke: I wonder which word he reacted to

17:38 ~that

17:38 clojurebot: that is not what I wanted

17:38 osaunders: want something

17:38 that

17:38 Chousuke: clojurebot: forget that

17:38 clojurebot: I forgot that

17:38 osaunders: want that

17:39 clojurebot: forget want

17:39 clojurebot: I forgot want

17:39 Chousuke: hm

17:39 osaunders: clojurebot: your own head

17:39 clojurebot: Gabh mo leithscéal?

17:39 osaunders: clojurebot: forget your own head

17:39 clojurebot: I forgot your own head

17:39 Chousuke: how did he forget want when he had no definition for it? :P

17:39 osaunders: don't abuse the bot please.

17:39 osaunders: Aww :(

17:39 Chousuke: it'll really forget some useful factoid if you keep that up :P

17:40 osaunders: lol OK

17:40 lrenn: I don't suppose there is a way to add a jar to the classpath at runtime eh? I just wrote some wrappers around ivy and it'd be supper nifty to not only download the files, but add them to the classpath as well.

17:41 Chousuke: anyway, clojurebot is programmed to randomly respond to some statements with a factoid, using a fuzzy matching algorithm :P

17:41 lrenn: add-classpath

17:41 lrenn: but that's supposed to be repl-only :P

17:42 lrenn: you should instead make it print out the proper classpath invocation so it can be configured at startup.

17:42 technomancy: lrenn: the only way to do that is to unpack the jars into a directory and have that directory on the classpath at JVM boot.

17:42 managing a dynamic classpath is just asking for trouble

17:43 lrenn: Chousuke: I'm fine with it being repl only. Now I can do (rezolve "org" "name" "version") and have it available at the repl.

17:43 Chousuke: you should rename that function :P

17:43 lrenn: technomancy: agreed, but using it with emacs/slime wouldn't be too much trouble. if it blows up i'll just restart slime :)

17:43 Chousuke: I should, but clojure already has a resolve :)

17:43 Chousuke: lrenn: ivy-find? :P

17:44 lrenn: "gimme"? :D

17:44 lrenn: Chousuke: was thinking of prefixing it all. I'm just screwing around right now. I'll probably got that route. Find will be reserved for searching (which is in ivy as well).

17:52 lowlycoder: how do I actually install clojure into /usr/local; rahter than something like java -cp ~/build/clojure/clojure.jar clojure.main

17:52 Chousuke: short answer: you don't. but you can put a launcher script in some bin directory.

17:53 lowlycoder: got it; question 2: how do I get openGL in clojure? perferably with access to opengl 3.0 functions

17:53 Chousuke: hmmh

17:53 there are java opengl libraries. through them I suppose.

17:53 then there was that clojure opengl library, ...

17:53 but I forgot what it's called.

17:54 ah, http://github.com/ztellman/penumbra/tree/master

17:54 lowlycoder: cloggle?

17:54 Chousuke: cloggle was the other one. but penumbra looks neater :)

17:55 I've never done anything with opengl so I'm not fit to judge :P

17:58 lowlycoder: it appears penumbra has GLSL support

17:58 nice :-)

18:02 okay, it looks very very strongly like glsl support is in there

18:02 i'm convincd this is the right library

18:02 thanks :-)

18:35 andyfingerhut: If I've got a possible performance bug to tell Clojure developers about, is it best to send it to the Clojure Dev group, or is there some other preferred method?

18:36 Hmm, maybe not, since the info for that Google group says only members can post.

18:36 hiredman: the google group is moderated

18:36 or at least it was

18:36 your first post had to be ok'ed by rich

18:36 andyfingerhut: So the regular Clojure group, then?

18:37 hiredman: I think that may be best

18:37 I am kind of curious to hear about this performance bug

18:38 andyfingerhut: I had a little test program for allocating different kinds of data structures, and one created 500K PersistentVectors.

18:39 I used jmap -histo:live to see what objects were live at the end of that, and there were 500K instances of java.util.concurrent.atomic.AtomicReference still around, live.

18:39 This was purely sequential code.

18:39 Chousuke: you can also use the support system on assembla I guess.

18:40 andyfingerhut: My guess is that those should be temporarily allocated while creating a vec, but the references to them should perhaps be set to null after the (vec ...) call is finished.

18:40 hiredman: well, gc doesn't happen in the blink of an eye

18:40 andyfingerhut: True. But is it true that "jmap -histo:live" actually searches out and only reports live objects, as the documentation implies?

18:40 hiredman: no idea

18:41 yeah take it to the group

18:41 Chousuke: no-one will fault you even if it happens to be a false alarm. :)

18:41 at least, I hope no-one will

18:41 andyfingerhut: If they do, I can live with it :)

18:42 Chousuke: The group behaves quite well usually. :P

18:42 andyfingerhut: Yeah, I hope I haven't stirred up trouble by starting these benchmarks. Certainly wasn't my intent to cause trouble.

18:44 jnudie: andyfingerhut: trouble maker...

18:45 Chousuke: I think benchmarks are fine as long as they are done to accomplish some objective.

18:46 andyfingerhut: Well, I've given my objective -- figure out what styles of Clojure code give what kind of performance. I certainly don't deal with large data sets all the time, but when I do, I don't want to give up a big constant factor in time or space.

18:47 Chousuke: but you really may have found a memory leak here, so it's worth discussing on the group.

18:47 andyfingerhut: I will send it soon.

18:48 Chousuke: and most times it *is* rather difficult to squeeze the best performance out of Clojure.

18:48 andyfingerhut: I may even end up with a few additional tips to add to Rich's list of how to improve Clojure performance in inner loops.

18:48 Chousuke: using arrays is no pleasant.

18:48 not*

18:48 andyfingerhut: but his current list is pretty darn good.

18:51 Chousuke: Rich once said that he'd rather work on "fundamental" performance than micro-optimisations. I should find the quote from the logs I guess :/

18:51 hiredman: Chousuke: architectual

18:52 Chousuke: right.

18:52 we have transients, chunked seqs and new new already coming up in the next version. And I guess primitive vectors and non-boxing functions are possible too.

18:53 hiredman: :2009:May:25:17:45:54 rhickey : other than that, things are so simple, architectural things (like the chunked seqs we are discussing) yield much more bang for the buck than micro-optimization

18:54 dnolen: Chousuke: non-boxing functions? has much been said about that?

18:54 Chousuke: dnolen: more than about primitive vectors :P

18:54 hiredman: just rhickey dropping hints I think

18:54 "I think I have way to do this"

18:54 or something like

18:55 dnolen: which probably means it will happen :)

18:55 Chousuke: dnolen: I think he plans on adding overloads to IFn for a certain number of long and double arguments

18:55 dnolen: wow that's cool.

18:55 andyfingerhut: So my examining the memory utilization was initiated by the "Uncle Bob looking for Clojure help" message a couple days ago.

18:56 dnolen: andyfingerhut: I have a version of his code now that runs in 500ms instead of +25000ms.

18:56 Chousuke: I think one of the primary difficulties in making clojure code performant is telling when boxing and unboxing happens.

18:56 andyfingerhut: (def r (java.util.Random.))

18:56 (defn rands [] (repeatedly #(.nextGaussian r)))

18:56 (defn points [] (take 400000 (partition 2 (rands))))

18:56 (let [hull-points (time (hull (points)))]

18:56 hiredman: :(

18:56 andyfingerhut: Woops. Didn't mean to do all those lines like that.

18:56 But it is fairly short.

18:56 hiredman: lisppaste8: url?

18:56 lisppaste8: To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.

18:57 Chousuke: that, and I suppose using arrays can lead to reflection that *warn-on-reflection* doesn't report :/

18:57 andyfingerhut: If you realize the list returned by defn points, guess how much memory is used per 2d coordinate (all 400K of them) on a 64-bit JVM

18:57 Chousuke: which of course kills performane.

18:57 +c

18:57 dnolen: andyfingerhut: for that example using vectors is pointless

18:57 vectors are wrong for that kind of iteration heavy code over primitives

18:58 even creating an empty vector in a loop that tight is expensive

18:58 even creating an object is expensive

18:58 http://github.com/swannodette/convex-hull/tree/master

18:58 andyfingerhut: Every one of the 400K points, in a fully realized list, allocates 2 Doubles (expected), 3 Cons's (expected), and *4* LazySeq's (surprised me at first. I know why 3 of them, but the 4th is still a mystery)

18:59 Chousuke: dnolen: that's very ugly though :/

18:59 andyfingerhut: And on a 64-bit machine, each Cons and each LazySeq is 48 bytes of mem

18:59 So for 2 8-byte doubles, on a 64-bit machine we are spending 384 bytes of mem.

19:00 dnolen: Chousuke: exactly. optimization is not pretty.

19:00 andyfingerhut: I'm not saying that this program ought to be coded this way, but when you look at his code, it looks fairy reasonable and natural.

19:00 s/fairy/fairly/

19:00 dnolen: also I have a sneaking suspicion now that javac does certain high level byte code optimizations for the JVM that the Clojure compiler currently does not do.

19:01 everything in my version is inlined and optimized, and the Java version is still about 6 times faster.

19:01 andyfingerhut: On a 32-bit JVM, it's better, but still 200 bytes per 2d point.

19:02 Chousuke: dnolen: maybe because not everything in the java version is inlined?

19:02 or is it?

19:02 remember, too much inlining can hurt performance too

19:03 dnolen: Chousuke, javac doesn't crazy kinds of analysis. if you have a for loop with no operation, that code actually gets removed!

19:03 basically, it'll be some time before you can compete with javac.

19:03 hiredman: dnolen: I'm pretty sure the jit does that

19:03 Chousuke: Clojure pretty much depends entirely on hotspot for optimisation

19:03 JAS415: when is there gonna be a GCC frontend for clojure :-p

19:03 dnolen: hiredman: not as far as I could tell, this doesn't happen in clojure for example. empty loop/recur with no ops takes up time.

19:04 Chousuke: if hotspot fails to optimise, you just get unoptimised gode :P

19:04 ... code.

19:04 JAS415: hotspot is really good

19:04 especially if you run a function more than once

19:04 Chousuke: JAS415: yeah, it is. but probably optimised for java...

19:04 JAS415: it'll get faster and faster

19:04 code is code :-P

19:05 Chousuke: but code patterns are not identical between languages.

19:06 konr: what clojure tutorial do you guys recommend me reading?

19:07 andyfingerhut: what's your background in other prog languages?

19:07 Chousuke: konr: here is some good stuff http://java.ociweb.com/mark/clojure/

19:07 konr: I did some cool things with lisp, know a bit about python and c and web things, but nothing about java

19:08 tomoj: uhh

19:08 that page plays a soundclip, lol?

19:08 Chousuke: it does?

19:08 tomoj: I thought we stopped doing that several years ago

19:09 Chousuke: oh it does.

19:09 * Chousuke did not notice, due to noscript

19:09 andyfingerhut: I've got some Lisp/Scheme background before coming to Clojure, too, and I wouldn't call it a tutorial, but I really enjoyed the "Clojure for Lispers" on clojure.blip.tv. About 3 hours long between 2 videos.

19:09 tomoj: <embed> with autostart

19:09 hiredman: haha

19:09 is that friends?

19:09 tomoj: isn't that like 10 years ago stuff

19:10 Chousuke: oh, yeah.

19:10 Watch all of Rich's talks.

19:10 if that doesn't sell you clojure, nothing will.

19:10 tomoj: where are they? youtube?

19:10 hiredman: ~blip.tv

19:10 clojurebot: blip.tv is http://clojure.blip.tv/

19:10 tomoj: nice

19:10 does he defend against no tests in one of those?

19:11 hiredman: http://www.artima.com/designtechniques/hotspot2.html some of these tips seem to be at odds with clojure

19:11 no'

19:11 andyfingerhut: Not in the Clojure for Lispers one, at least. I haven't watched them all. He does definitely mention functional code being easier to test.

19:11 hiredman: there is another video somewhere of the talk where I think someone asked about that

19:12 but I forget where that video is

19:12 tomoj: I read technomancy say that he mentioned the paper Out of the Tar Pit while defending

19:12 I'd be interested to hear what else he said about it

19:12 hiredman: I imagine he just said "there is a great paper about that: Out of the Tar Pit"

19:13 Chousuke: hiredman: yeah, and it does say on the page that this "lore" is outdated by hotspot :)

19:13 or supposed to be, anyway

19:13 technomancy: tomoj: that was the bay area clojure meeting.

19:14 and he didn't defend against "no tests" he defended against "you should be the one writing the tests"

19:14 big difference

19:14 andyfingerhut: Chousuke: "lore" about "JVM is slow", or lore about testing?

19:14 Chousuke: andyfingerhut: lore about how to make java programs fast.

19:14 tomoj: technomancy: I see

19:15 test-first vs test-later ?

19:15 hiredman: http://kotka.blip.tv/file/2286313/ is the bay area clojure meetup

19:15 technomancy: test-first vs regression tests, yeah.

19:16 tomoj: I'm glad the question wasn't "no tests?"

19:16 that scared me

19:16 hiredman: thanks

19:19 JAS415: testing?

19:23 tomoj: wow, I never realized this

19:23 multimethods are like a duckier version of duck-typing

19:24 instead of "does it quack like a duck?" you get to pick whatever question you want.. cool :)

19:25 andyfingerhut: Reminds me of a line from a weird Monty Python sketch: "Maurice, you haven't got something a little less _ducky_, have you?"

19:25 hiredman: it's dispatch as it's own thing without being part of a type system

19:25 tomoj: wonder if someone has thought of a cute name for it

19:43 lowlycoder: if comma is white space, what's unquote?

19:44 the cond change seems really stupid

19:48 tomoj: unquote is ~

19:49 Carkh: what cond change ?

19:49 tomoj: ,`(foo ~(inc 3))

19:49 clojurebot: (sandbox/foo 4)

19:49 tomoj: cond is different from CL

19:49 I think arc made the change too

19:49 Carkh: oh i was worried for a second =P

19:50 it doesn't make a whole lot of a difference from cl

19:50 tomoj: seems sensible to me

19:50 why do you need those extra parens?

19:51 Carkh: so you can have pultiple statements

19:51 multiple

19:51 but cl is not as functional as clojure so that make sense for cl

19:51 tomoj: ah, implicit progn

19:51 yeah

19:52 Carkh: so i would disagree that the change is stupid

19:52 tomoj: I think do is meant to me very explicit in clojure

19:52 you want to be easily able to see anytime something is nonfunctional

19:52 Carkh: it is not mere syntactic easing, it conveys a meaning

19:54 tomoj: wow, arc's `if` is anaphoric

19:55 according to graham, mccarthy said he got cond wrong and it had too many parens :)

19:55 Carkh: well i still beleive it makes perfect sense to have those extra parens for CL

19:56 whatver mccarthy might think about it =)

20:09 lowlycoder: at the clojure repl, C-C and C-D both terminate, the repl, but C-h gives me ^H rather than deleting the previous char; how do I fix this (C-h works fine at the zsh shell, so I think it's java/clojure specific)

20:10 technomancy: lowlycoder: you'll want to run your repl inside the rlwrap tool

20:10 java's console IO is crapforbrains

20:11 lowlycoder: nice; thanks!

20:33 user=> (require 'quoted-namespace-symbol)

20:33 java.io.FileNotFoundException: Could not locate quoted_namespace_symbol__init.class or quoted_namespace_symbol.clj on classpath: (NO_SOURCE_FILE:0)

20:33 user=>

20:33 clojure was started with: "rlwrap java -cp clojure.jar clojure.main"

20:34 user=> (require quoted-namespace-symbol)

20:34 java.lang.Exception: Unable to resolve symbol: quoted-namespace-symbol in this context (NO_SOURCE_FILE:8)

20:36 technomancy: lowlycoder: most likely "quoted-namespace-symbol" was intended as a placeholder for the name of a real namespace.

20:36 what are you trying to do

20:36 ?

20:36 lowlycoder: page 37 of the clojure book

20:36 technomancy: right.

20:37 you want to replace that with the name of the library you want to require.

20:42 mebaran151: that could really screw somebody up, if somebody actually named a library that

20:43 tomoj: if it's a grey block with blue text, you're not supposed to type it

20:43 you're supposed to type the reddish text that looks like it's at a repl

20:48 lowlycoder: to use clojure.contrib ... do I use clojure-1.0.0 or clojure from git?

20:49 hiredman: clojure contrib is a seperate package

20:49 lowlycoder: right, but it depends on a version of clojure

20:49 hiredman: sort of

20:49 there is a branch of contrib to maintain 1.0 compat

20:50 lowlycoder: hmm, i just built clojure-contrib.jar

20:50 how do I get (require 'clojure.contrib.str-utils) to work?

20:50 hiredman: then you should be fine

20:50 the jar needs to be in your classpath

20:52 lowlycoder: rlwrap java -cp ~/clojure/clojure/clojure.jar:~/clojure/clojure-contrib/clojure-contrib.jar clojure.main

20:52 Clojure 1.0.0-

20:52 user=> (require 'clojure.contrib.str-utils)

20:52 java.io.FileNotFoundException: Could not locate clojure/contrib/str_utils__init.class or clojure/contrib/str_utils.clj on classpath: (NO_SOURCE_FILE:0)

20:54 hiredman: ,(require 'clojure.contrib.str-utils)

20:54 clojurebot: nil

20:54 hiredman: works here

20:54 *shrug*

20:54 lowlycoder: how do you start clojure?

20:55 _mst: lowlycoder: your second ~/ in the above command line might not be expanding

20:55 hiredman: java -cp etc:etc clojure.main

20:58 lowlycoder: hmm, it appears that i'm not building clojure-contrib properly

20:58 ls -l ~/clojure/clojure/clojure.jar

20:58 -rw-r--r-- 1 x x 1502501 2009-08-14 17:41 /home/x/clojure/clojure/clojure.jar

20:58 ant -Dclojure.jar=~/clojure/clojure/clojure.jar

20:58 still gives me:

20:58 [echo] WARNING: You have not defined a path to clojure.jar so I can't compile files.

20:58 [echo] This will cause some parts of clojure.contrib not to work (e.g., pretty print).

20:58 [echo] To enable compiling, run "ant -Dclojure.jar=<...path to clojure.jar..>"

20:58 _mst: yeah, it's your ~'s

20:59 start using $HOME instead of ~ and it should be alright

20:59 lowlycoder: yeah, it is apparently

20:59 Carkh: the contrib warning is only for c.c.pprint

21:00 lowlycoder: is there some var I can export in my ~/.zshrc to make my life easier?

21:00 woot, rinally got: (require 'clojure.contrib-str-utils) to work

21:03 hiredman: lowlycoder: you running jdk1.6?

21:03 1.6 can have * in the classpath

21:03 lowlycoder: yes

21:03 i'm running 1.6

21:03 hiredman: so you puts all your jars in ~/.jars/

21:04 and CLASSPATH="$HOME/.jars/*" in your .zshrc

21:04 lowlycoder: symlinks okay?

21:04 hiredman: sure

21:04 .jars or where ever

21:05 lowlycoder: export CLASSPATH="$HOME/*.jars/*"

21:05 do i need something else?

21:05 hiredman: setopt allexport

21:06 woa

21:06 that won't work

21:06 * in the classpath is not the samething as the shell glob

21:07 konr: these clojure videos are so cool <3

21:08 the video is not synchronized, though. Is there a way to download them?

21:09 hiredman: on blip.tv?

21:09 konr: yes

21:09 hiredman: yeah you go down on the right side

21:09 there should be a "files" menu or something

21:09 lowlycoder: how do I take a clj file and turn it into a *.jar ?

21:09 hiredman: I forget exactly

21:09 lowlycoder: a jar is just a zip file

21:10 so it kind of depends

21:10 if you just want to bundle clojure files up, you can just jar them up and put the jar on the classpath

21:10 if you actually want to AOT compile the clojure files to class files the process is slightly more involved

21:11 lowlycoder: i can just jar up a bunch of *.clj files?

21:11 hiredman: sure

21:11 as long as they have the correct namespace stuff

21:11 durka42: that will not do what you expect though, doesn't a jar have a bunch of hidden files

21:11 i mean a jar that can be run with java -jar

21:11 hiredman: depends

21:12 durka42: you don't know what he expects

21:13 durka42: this is true

21:13 i made a baseless assumption

21:14 lowlycoder: i want to build jar files that operate kinda like *.so files

21:15 i.e. things other clojure apps can load up and use functions from

21:15 hiredman: clojurebot: the point of moby dick is "be yourself"

21:15 clojurebot: Alles klar

21:15 hiredman: lowlycoder: yeah, you can just jar up the files and directory structure

21:15 lowlycoder: just jar up the *.clj files?

21:15 they aren't even compiled ....

21:15 hiredman: yep

21:15 no problem

21:15 lowlycoder: so what, java automatically loads up teh source, runs clojure, then converts them to jvm byte code?

21:16 how does java even know how to handle clojure files?

21:16 hiredman: nope

21:16 you need the clojure.jar

21:17 lowlycoder: when you require namespaces the clojure runtime searchs the classpath for the implementation of the namespace

21:17 ~classpath

21:18 clojurebot: hello?

21:18 crap, I left a debugging println in somewhere

21:18 clojurebot: classpath is (System/getProperty "java.class.path")

21:19 BUENOS DING DONG DIDDLY DIOS, fRaUline hiredman

21:20 hiredman: ~namespaces

21:20 clojurebot: namespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it

21:20 hiredman: ~compile

21:20 clojurebot: the unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation

21:21 hiredman: share and enjoy

21:59 _hrrld: Does anyone know where I can find an example of using clojure.contrib.logging successfully? I'm calling trace, but it's not clear where the log output is going.

Logging service provided by n01se.net