#clojure log - Nov 18 2008

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

2:29 Pupeno: Good morning!

3:52 askentasken: is clojure for concurrency or parallellism or both?

3:52 it is really a fun language, i will keep using it for personal projects

3:55 cwyang: ho

3:55 (typo)

3:57 Lau_of_DK: askentasken: both I'd say, theyre somewhat interconnected

4:12 leafw_: rhickey__: http://clojure.org/special_forms#let contains an extra semicolon ';' that creates confusion, after the third paragraph.

4:13 rhickey__: in a Clojure code example I mean.

4:14 rhickey__: happens because the code is inside a <pre ..></pre> block, but the & is present as &amp;

4:14 rhickey__: there is a second insance of the same a few lines below it.

4:15 rhickey__: ... actually, in many.

4:18 Lau_of_DK: leafw_: By browser doesnt render it like that, to me it looks squeaky clean, Firefox3

4:22 H4ns: leafw_: what browser is it that you're using?

4:23 (ie also renders &amp; correctly inside <pre>, and i think that the behavior is completely correct)

4:25 leafw_: H4ns: firefox 3.0

4:26 H4ns: leafw_: wfm

4:26 leafw_: wfm ?

4:27 H4ns: wfm == works for me, but in fact it does not

4:27 hm.

4:27 (at least chrome also screws up)

4:28 leafw_: something is werid, perhaps the css tag is doing something to the pre

4:28 H4ns: true. tomhickey is who would take care of that.

4:28 leafw_: if you can reach him please do

4:29 H4ns: it is not the css, it is the javascript colorizer that screws up.

4:29 you can see that the rendering is correct when the browser first loads the page, but then the beautifier makes the extra semicolon appear.

4:30 tomhickey: ^ you may want to read the log until here :)

5:22 askentasken: is there a java-lib for permutations?

6:01 Lau_of_DK: askentasken: Probably, but there is also one in Clojure.contrib.lazy_seqs

6:02 Although, I dont think it follows the correct formulae for permutations, so they are not (imo) produced in the correct sequence, but still all possible permutations are turned out

6:08 leafw_: anybody uses chimp for ViM? What does "Supply <chim.id> to the glue functions" mean? What/where are these glue functions?

6:15 askentasken: Lau: ok order is not important for my task

6:16 how do i get contrib?

6:18 perms xs = [(h:t) | h <- xs, t <- perms $ delete h xs]

6:18 anyone can trnslate that to clojure?

6:22 do i just import clojure-contrib to user? or it is a ajr?

6:22 jar

6:28 Lau_of_DK: I think they've made a jar, which you just put on the classpath

6:28 Otherwise just download the source to your clojure dir and (require 'clojure.contrib.lazy_seqs) if I remember correctly

6:29 The code you posted, which language is it in ?

6:30 Chousuke: looks like haskell

6:32 Pupeno: Lau_of_DK: was it you who was playing with Qt?

6:36 Lau_of_DK: Pupeno: Yes, I was one of the players

6:36 askentasken: is the paste-to clojure not working anymore?

6:36 Lau_of_DK: lisppaste8: url

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

6:37 Lau_of_DK: If you use that, it should work - If it doesnt, then you answered your own question :)

6:37 askentasken: http://paste.lisp.org/display/70635

6:37 naive and not wokring

6:37 is there already discard-val and discard-at ?

6:41 Lau_of_DK: See filter / remove

6:48 hoeck: askentasken: do you want to remove the first occurence of val in coll or every occurence of val in coll?

7:03 askentasken: first

7:15 hoeck: askentasken: there is split-whith, which takes a predicate and returns 2 seqs

7:16 askentasken: not exactly what iw ant

7:16 anyway i have my won so it sok

7:17 did perms like this: (defn perms [coll]

7:17 (if (nil? coll)

7:17 [[]]

7:17 (for [h coll t (perms (discard-val h coll))]

7:17 (conj t h))))

7:17 perhaps naive implementation but works

7:20 hoeck: or see: http://paste.lisp.org/display/70635#1

7:20 askentasken: is count O(1) for everything? lists and vectors?

7:21 Chousuke: it is for most things.

7:21 but not all seqs

7:28 askentasken: for vectors?

7:28 for lists?

7:28 (count [1 2 3 4 5]) O(1)?

7:28 (count '(1 2 3 4 5)) ?

7:28 hoeck: yes

7:28 O(1)

7:28 askentasken: is vector genera�lly preferred over lists? they seem easier to work with

7:28 hoeck: they are in fact some kind of trees to make copying cheap

7:28 askentasken: you dont have to reverse your recursive calls either(which you often have to with lists)

7:29 hoeck: vectors are good for appending stuff

7:29 lists are good for code

7:31 askentasken: lol i was writing discard-val -all but then thats obv filter...

7:31 code?

7:31 code as in lispcode?

7:31 macros'

7:33 hoeck: askentasken: yeah, expressions

7:41 askentasken: hmm could it be possible to inmplement python-like splicing with a nice macro?

7:41 a = [1,2,3,4,5]

7:41 a[2:4] _> [3,4]

7:41 but how do i define a macro using infix? is that possible?

7:41 to do that i need access to the clojure parser? or everything you can do with amcros that you can with the parser?

7:42 hmm wait i already ahve take-between

7:45 hoeck: askentasken: for vectors, there is also subvec

7:49 askentasken: you could create your own subclass of vector and implement invoke so that ([1 2 3 4] [2 4]) returns the subvector [3 4]

8:01 duck1123: that would be very confusing

8:02 askentasken: subvec is what iw ant and i almost always use vectors not lists anyway, veyr good

8:04 duck1123: It would be cool to have an index macro of some sort (#[2 4] [1 2 3 4 5]) => (3 4)

8:06 although subvec is pretty easy to write and clearer

8:07 askentasken: is there any way to make the errorsreports shorter and better. like now when i dom something wrong it jus flushes the screen, quite annoying and the error-messages are nt that help ful.

8:07 it doesnt even tell me where in the program it happened, usually jsut in some .java module

8:08 yeah that was what i wanted but subvec is ok

8:08 but something combinable liek pythons, [-x:] [x:y] etc...

8:09 duck1123: askentasken: are you working directly with the repl, or are you using some editor? (emacs, vim, netbeans)

8:09 I know with slime (emacs) it initially only shows a few lines of the trace on errors

8:10 askentasken: emacs + repl

8:10 not slime though

8:10 just the first clojure-mode

8:10 that came

8:12 hoeck: just installed a new slime version, and now its possible to throw the causing exception, which shows you at least the function name where stuff went wrong

8:12 i mean a new swank-clojure

8:15 askentasken: rhickey: what is your opinion on Python anyway?

8:16 leafw_: any chim or gorilla user in Vim? I can't get it to work

8:19 and the documentation is, unfortunately, pitiful

8:23 MarkVolkmann: Revision 1109 doesn't build for me. I get an IllegalArgumentException related to precomile.clj.

8:24 askentasken: is there concat for vector?

8:25 i dont want lists it seems athere is a lot of arbitrary type-conversion which i dont like, or am just doing it wrong :)

8:26 hoeck: askentasken: (reduce conj v1 v2)

8:28 MarkVolkmann: Has anyone done an svn update and run ant this morning?

8:29 hoeck: MarkVolkmann: me, but it works, at least it builts correctly

8:29 rhickey: askentasken: Python is ok, I had fun the few times I used it

8:30 MarkVolkmann: worked for me (pulled and working in different office today)

8:30 MarkVolkmann: did you clean?

8:30 hoeck: just made the transition from pre-AOT to AOT, and it worked fine

8:30 _deepfire: rhickey, is there some description for future direction of Clojure?

8:30 MarkVolkmann: No clean ... I'm trying that now.

8:31 Doing a clean fixed it. Thanks!

8:31 rhickey: askentasken: Python doesn't fit my mental model for some reason

8:31 gnuvince: hello

8:33 rhickey: _deepfire: not a formal one - we discuss things often on the group, I respond to community needs and my own inclinations, most of what's to come will probably be in libraries, that's been true for a while, other than AOT, which really didn't change the language model

8:35 _deepfire: there's a todo here: http://richhickey.backpackit.com/pub/1597914 which will probably move to a more formal tracker soon

8:42 askentasken: http://paste.lisp.org/display/70639

8:42 anyone good with permutations ^^

8:42 it sort of works

8:42 but to many [] and () :)

8:52 _deepfire: rhickey, thank you!

9:03 askentasken: how can i do ona map get-with-default

9:05 ah i found it

9:06 Chousuke: still working on the tic-tac-toe thing? or something else? :)

9:08 MarkVolkmann: askentaken: In your code paste, where is the discard-val function defined?

9:21 askentasken: Chousuke: other stuff but i will add minmax later

9:36 tomhickey: H4ns & leafw_: fixed the with the code highlighter & issue on the site. thanks for the heads up.

9:37 H4ns: tomhickey: looks good now, thanks!

9:40 askentasken: my head is spinnging trying to implement fibonacci with memoization. anyone seen a solution for that?

9:45 can i ahve ordered maps? ie maps that preserve input order?

9:45 if i want a Map but want several keys of th same value, what datastructure is then most suited?

9:48 Chouser: askentasken: array-map maintains original input order

9:51 askentasken: not sure about a Map with multiple same-val keys, but one option might be to use a vector as the key, with your "real" key as the first item, and some unique identifier as the second.

9:56 askentasken: yes that could work, didnt know that was allowed, cool

9:57 Chouser: yep, one of the many benefits of immutable collections is they work great as Map keys.

9:58 also, vectors sort with their first item as the most significant, next item the next, and so on. That can be useful too, such as for sorted-set s.

10:19 askentasken: can i do (sort-map (on-key-2) somemap) somehow?

10:20 without writing ym won...

10:20 own

10:21 rhickey_: askentasken: sort-by

10:24 askentasken: clojure/sort-by

10:24 ([keyfn coll] [keyfn comp coll])

10:25 i have a map a= {[4 4] 8, [1 1] 3, [2 2] 1, [3 3] 2}

10:25 and i want to sort by the second key-val

10:26 rhickey_: askentasken: not sure what you mean by "second key-val"

10:26 user=> (sort-by val {[4 4] 8, [1 1] 3, [2 2] 1, [3 3] 2})

10:26 ([[2 2] 1] [[3 3] 2] [[1 1] 3] [[4 4] 8])

10:26 Chouser: askentasken: you want a seq or a new map?

10:28 askentasken: a seq

10:29 [2 2] 1 means nbr 2 order 2 value 1

10:29 i want to sort by order

10:29 im doing a compress-function

10:30 (compress-with-info [1 1 1 2 3 3 4 4 4 4 4 4 4 4])

10:30 {[4 4] 8, [1 1] 3, [2 2] 1, [3 3] 2}

10:30 user=>

10:30 so i want to sort it and return : [[1 1] 3, [2 2] 1 etc

10:31 sortby key sorts on the first item in key, i want to sort on the second

10:31 Chouser: (sort-by #(second (key %)) coll)

10:32 but if you reverse the order of your key vectors, you can just use sort which should run faster.

10:33 rhickey_: askentasken: or structurally, each entry will be [[n o] v], so sort-by (fn [[[n o] v]] o)

10:34 _sk: hi, i have a question regarding gen-class, is there a way so that we could use the 'this' reference while defining methods?

10:35 Chouser: pretty-print is a surprisingly fuzzy operation.

10:35 rhickey_: Chouser: what's not precise about "pretty" ?

10:35 Chouser: rhickey_: :-P

10:36 _sk: the first arg passed to each method is the "this" value

10:37 askentasken: yes i did that

10:44 what happened to paste to clojure?

10:44 http://paste.lisp.org/display/70648

10:44 ^^ my compress function, any tips on improvements?

10:50 Chouser: should be able to say just (sort acc) instead of (sort-by key acc)

10:50 it's more idiomatic to say (if x b a) than (if (nil? x) a b)

10:51 _sk: thx, from the example in genclass.clj it seems we have to explicitly pass in the whole object as an argument to methods, thus it looks a bit unfamiliar

10:51 Chouser: but either way, that will only process coll up through the first nil value in the coll, which is probably not what you want.

10:53 _sk: you mean like (.methodName whole-object arg1 arg2) ?

10:53 Chousuke: _sk: in java, the object is just moved from inside the parentheses to before the dot, like so: (.method obj a b) -> obj.method(a b); :)

10:53 oh

10:53 +, :P

10:54 Chouser: heh

10:54 hm... (.method obj, a b) ?

10:54 Chousuke: no, in the java

10:55 obj.method(a,b);

10:55 Chouser: yeah, I know, but what about (.method obj, a b) ? better or worse?

10:56 _sk: Chousuke: yes, exactly :)

10:56 Chousuke: I can't say I like that better.

10:56 but I guess you could do that :P

10:56 Chouser: yeah, me neither. nm.

10:57 _sk: another question, in java, let's say we have a constructor for an object, and in this constructor we use the 'this' value for some purpose, is that possible in clojure?

10:59 Chouser: _sk: I don't think so, though rhickey_ may want to weigh in. But you shouldn't need to -- the value you return from your init fn becomes the state for you gen-class object.

10:59 You can do anything you want with that value before you return it, including passing it to functions.

11:00 _sk: hmm, in fact we can do whatever we want with it, just not the java way =)

11:00 thanks a lot

11:00 Chouser: _sk: yes. Generally, gen-class is used only for interop with existing Java libs.

11:01 askentasken: I just keep thinking I must be able to make my compress-function shorter

11:01 cant I use reduce somehow?

11:01 Chouser: It allows you to build a little adapter class, but Clojure expects you to do most of your real algorithm and application work using Clojure collections, fn, namespaces instead of building new Java classes.

11:03 askentasken: the whole (let [sorted...]) expression is run just once at the end, right? That could be moved outside your loop, which might help you see other ways of reducing it.

11:05 askentasken: that's doing a sort of run-length encoding?

11:09 askentasken: yes it preserves order and count

11:10 how would i move it outside? i still need a basecase

11:12 i can switch to (if x...) and then swithc order of that foc

11:12 ofc

11:13 Chouser: askentasken: http://paste.lisp.org/display/70648#1

11:15 askentasken: can i have if-elses anywhere?

11:15 Chouser: you can use cond

11:16 askentasken: ah, very nice :)

11:16 Chouser: hm, I didn't even use xs -- that wastes a line

11:17 ah, well, you get the idea

11:19 askentasken: yes very nice, thanks

11:22 and no tailrecursion wont be a problem?

11:22 Chouser: askentasken: correct, because of lazy-cons

11:23 lazy-cons doesn't actually evaluate with of its args, but returns a new object. So anything that walks the resulting sequence acts like a sort of iterator, not recursive at all from Java's point of view.

11:23 askentasken: is that never as in NEVER or never as probably never(like with laziness in haskell where the thunks blows the stack instead))

11:23 ok

11:24 Chouser: alternatively, you could use loop/recur or reduce and pass along an accumulator -- that would get you a non-lazy version that also would not blow the stack.

11:25 but you were on to something -- replacing lazy-cons with cons would give you a non-lazy fn that would threaten the stack.

11:38 askentasken: (defn uncompress [coll] (map #(take (second %) (repeat (first %))) coll))

11:39 returns a list of lists

11:39 Chouser: try mapcat

11:41 askentasken: lol wait i didnt even see that

11:47 http://paste.lisp.org/display/70648#2

11:47 Chouser: are those both O(n)?

11:49 Chouser: askentasken: I think so.

11:50 split-with touches every val of coll from the front through the split-point twice, so that's O(n)

11:51 the remainder b is passed in again so that should all be O(n)

11:51 the reduce version is probably faster by a constant, though.

11:53 duck1123: there should be metadata attached to each function describing what kind of performance it has

11:53 although you couldn't be sure you could trust it, it would be interesting to have as part of the docs

11:55 rhickey_: Chouser: did you see: http://groups.google.com/group/clojure/browse_frm/thread/79d07b898b2a0fde

11:55 Chouser: 100000 item seq: cmprss -> 20.734263 msecs, compress -> 16.119936 msecs

11:56 rhickey_: yes, thanks. replying now.

11:59 askentasken: how do you time?

12:01 wait fi do (Math/round (* (rand) 8) that doesnt evenly distribute between all numbers right? because 8 only has 7.5 and up will 7 has 6.5 tp 7.49

12:01 Chousuke: I'm getting some kind of an error from that thread :/

12:01 Chouser: askentasken: http://paste.lisp.org/display/70648#3

12:01 Chousuke: it says there are no messages and that they may have expired or been deleted :P

12:02 Chouser: Chousuke: I didn't like the competition, so I, uh... took care of it.

12:02 Chousuke: hah

12:03 askentasken: Chouser:what do you mean? i dont see anything added

12:03 Chouser: askentasken: you may have to shift-reload

12:04 gnuvince: The thread is no longer there

12:05 Chouser: weird. I just replied to the thread, and it says "2 messages" but only mine is visible.

12:05 tWip: has with-in-str changed? I'm now getting errors about with-open requiring a vector for bindings

12:07 Chouser: tWip: with-in-str appears to be out-of-date with the new with-open. Probably my fault, sorry.

12:07 tWip: okay, I'll work around until it is fixed

12:08 Chousuke: Chouser: I noticed a potential problem with with-open a while ago. the new binding syntax allows multiple bindings but it seems with-open will only close the first binding :/

12:11 Chouser: rhickey_: quick patch available: http://groups.google.com/group/clojure/browse_thread/thread/127081d85fb1b4bf

12:14 Chousuke: arbitrary destructuring is probably overkill for with-open but it'd be nice if with-open worked correctly with multiple bindings (like [a b, c d, e f]), which is not too difficult; *or* at least threw an error. :/

12:14 Chouser: Chousuke: yeah, the general problem of unhandled extra bindings was mentioned on the google group.

12:15 rhickey_ didn't want the extra error-handling code, but I can imagine that it'd be nice to have several things closed in a single scope.

12:15 Chousuke: that's one of the reasons I tried to write my bound-names function, but in the end I'm not sure it works for all the corner cases :/

12:15 Chouser: Chousuke: oh, I see. Interesting.

12:16 askentasken: (take 100 (repeatedly (corner-move)))

12:16 Chousuke: with something like it you could write ~@(map (memfn close) (bound-names bindings)) or something, which would be nice

12:16 askentasken: (take 100 (repeatedly (corner-move))) , why doesn that work java.lang.ClassCastException but why?

12:17 Chouser: askentasken: does calling corner-move return "a function of no args, presumably with side effects"?

12:18 askentasken: perhaps you mean (repeatedly corner-move)

12:19 askentasken: yes

12:19 ah!

12:19 Chousuke: maybe with-open should just use let* directly to disallow misuse of destructuring.

12:20 it'd still allow multiple simple bindings though, but those are pretty easy to deal with

12:22 Chouser: .close already gets mad if you try to use destructuring in with-open

12:23 so there's just the multiple-bindings issue.

12:25 askentasken: is there no builtin for assoc with defualt?

12:26 Chouser: default for what?

12:28 askentasken: (defn assoc-with [m k v]

12:28 (if (contains? m k)

12:28 (assoc m k (+ v (get m k)))

12:28 (assoc m k v)))

12:28 something like that?

12:28 i couldnt find in the docs so

12:28 that nos so general though

12:28 v should b a function perhaps

12:32 wwmorgan: askentasken: I think you want update-in

12:32 Chouser: or perhaps merge-with

12:37 askentasken: neither

12:40 Chouser: (merge-with + {:a 1} {:a 1}) ==> {:a 2}

12:40 (merge-with + {:a 1} {:b 1}) ==> {:b 1, :a 1}

12:41 (defn assoc-with [m k v] (merge-with + m {k v}))

12:46 wwmorgan: (defn assoc-with [m k v] (update-in m [k] #(+ (or % 0) v))) --- not as nice as chouser's

12:48 askentasken: not expensive?

12:48 merge-with i mean?

12:51 http://paste.lisp.org/display/70661

12:52 gnuvince: I finally finished the second part of my little Clojure tutorial. The first draft is available here: http://fornost.homeip.net:81/vince/clojure-comics2.html. Comments can be sent at vfoley at gmail dot com. Thank you.

12:52 askentasken: doing permutations and it is pissing me off

13:03 Chouser: askentasken: spoilers clojure.contrib.lazy-seqs

13:20 Chousuke: hm

13:23 askentasken: im stoopid i dont get where to download from: http://sourceforge.net/projects/clojure-contrib

13:23 Chousuke: checkout the SVN instead and use that

13:23 or use some git mirror.

13:24 * Chousuke prefers git mirrors, they're so much faster.

13:24 Chousuke: SVN checkouts take ages.

13:27 git handles local changes better too. :/ I include the .clj files in the jar for slime, but that modification is in its own branch so tracking master is easy :)

13:27 askentasken: is there a unique or nub function?

13:28 Chouser: I like git-svn, so I can pull changes immediately, but maintain local branches.

13:28 askentasken: (doc distinct)

13:29 gnuvince: askentasken: distinct I think

13:29 Oh

13:29 * gnuvince was too late.

13:34 lisppaste8: Chouser pasted "permutations using sets" at http://paste.lisp.org/display/70662

13:34 Chouser: oh, lisppaste8! welcome back

13:38 rhickey_: Chouser: I thought I had fixed with-in-str already

13:40 askentasken: how do i do doc-strings?

13:41 Chouser: rhickey_: oh, indeed you have. sorry.

13:41 rhickey_: np

13:41 askentasken: Chouser: how did u paste directly to the channel?

13:43 tWip: so with-in-str should work in latest (1109)?

13:43 Chouser: tWip: as of 1108, yes

13:44 tWip: I thought I was using 1108, oh well

13:45 It does indeed work now, thanks.

13:53 Chouser: askentasken: just choose "#clojure" from the channel list. It hasn't been working for the past couple days.

13:54 askentasken: RHickey: couldnt it be changed or added so docstrings could be between [argument] and function-body? instead of between f-name and args

13:54 Chouser: askentasken: functions can have multiple arg lists, but only one docstring.

13:55 (defn my-inc "add 1 or more" ([x] (inc x)) ([x y] (+ x y)))

13:56 askentasken: uh, why and how does that work?

13:56 Chousuke: you can overload functions.

13:56 Chouser: allows different definitions based on number of arguments passed in.

13:58 Chousuke: note that there's an extra pair of parentheses if you want multiple definitions. Sometimes that results in non-obvious error messages if you have mismatched parentheses when defining a function

14:07 askentasken: from where cna i pull contrib with git?

14:07 Chousuke: http://github.com/kevinoneill/clojure-contrib/tree/master

14:08 an unofficial mirror, but it is kept up-to-date with reasonable latency

14:19 rhickey_: It's alive - AOT/gen-class

14:19 tomhickey: now you can breathe again! ;)

14:20 rhickey_: now I have to write docs :(

14:20 tomhickey: lol

14:20 Chousuke: is the interface still the same or improved?

14:20 rhickey_: gen-and-save/load are gone

14:20 use a :gen-class clause in your ns form

14:21 Chousuke: can you still generate classes dynamically?

14:22 rhickey_: Chousuke: only via proxy, dynamic named classes are an oxymoron in some ways

14:22 * Chouser runs "git svn rebase" repeatedly and in vain

14:22 rhickey_: Chouser: not up yet, hang tight

14:22 Chouser: :-)

14:22 * Chouser puts it in a while loop

14:23 * drewr does too even though he's doesn't know what change is coming

14:23 lisppaste8: rhickey pasted "AOT/gen-class syntax" at http://paste.lisp.org/display/70665

14:24 blackdog_: and the - prefix is a method?

14:24 rhickey_: note how you don't need any quotes any more, also Java names for primitives are supported, and fns for class can use class

14:25 Chouser: nice.

14:25 rhickey_: blackdog_: these are real fns, -blah is a naming convention whereby the method can find the fn

14:25 blackdog_: ok

14:26 Chouser: all classes mentioned need to be available at compile time?

14:26 rhickey_: you can edit this and reload while instances are running as long as you don't change the signatures

14:26 kotarak: o.O cool

14:26 How do I specify the name?

14:27 rhickey_: Chouser: yes, for now - I can ease that in the future but it requires some retooling in the compiler - right now everything is done off of reflection

14:27 Chouser: kotarak: the namespace name is the class name

14:27 rhickey_: kotarak: the ns is the name

14:27 must be

14:27 If you leave out the :gen-class, you get support for main only

14:27 kotarak: Hmmm.. Are capitals allowed? From the Java side, my.Hello is probably expected, no?

14:28 rhickey_: kotarak: sure

14:28 kotarak: rhickey_: this is awesome! :)

14:29 cemerick: rhickey_: is the gen-class fn usefully callable still? Of course, I'm thinking of the road ahead for my genbean concoction.

14:29 rhickey_: with the stand-alone compiler Stuart and Steve are working on, the workflow looks like this:

14:29 Macintosh:clojure rich$ java -server -cp ./classes:./src/clj:clojure.jar clojure.compile classes my.helloCompiling 1 libs to classes

14:29 Macintosh:clojure rich$ java -server -cp ./classes:./src/clj:clojure.jar my.hello fooHello foo World!

14:29 42

14:29 erm

14:30 like this:

14:30 java -server -cp ./classes:./src/clj:clojure.jar clojure.compile classes my.hello

14:30 Compiling 1 libs to classes

14:30 java -server -cp ./classes:./src/clj:clojure.jar my.hello foo

14:30 Hello foo World!

14:30 42

14:30 Chousuke: the constructors syntax and the init function still look weird. :/

14:31 meaning my intuition can't figure out why they look like that :P

14:32 rhickey_: cemerick: right now I haven't worked through stand-alone use of gen-class, it ends up you need 2 classes to do this right, if you look after I put this up, you'll see an my.hello__init.class as well. Essentially I had to automate the 2 part work everyone was doing manually

14:34 cemerick: rhickey_: actually, I may not need access to gen-class itself, if the options provided to genclass are hanging off the namespace somewhere...

14:34 rhickey_: this lets the body se the class being defined, but means the stub generated by gen-class tries to load the __init class

14:36 cemerick: yeah, in fact, I'm sure of that, and not having to conjure up the parameters to gen-class will make my work a whole lot easier in that context, anyway

14:37 now I just need to figure out how to best generate BeanInfo classes *ech*

14:44 askentasken: where should i place contrib src? can i link to the whole folder from user.clj?

14:45 Chouser: just add clojure-contrib/src to your java classpath

14:45 Then you can use 'require' or 'use' in your .clj

14:47 askentasken: how do i add to my java-classpath?

14:47 rhickey_: ok, rev 1110 adds AOT gen-class

14:50 Chouser: askentasken: java -cp clojure.jar:...../clojure-contrib/src clojure.lang.Repl foo.clj

14:51 proxy works as-is for now?

14:51 rhickey_: Chouser: I hope so

14:52 askentasken: Caused by: java.lang.Exception: Can't take value of a macro: #'user/assoc!

14:52 (defmacro assoc! [map_ k v]

14:52 `(def ~map_ (assoc ~map_ ~k ~v)))

14:52 rhickey_: I haven't really advertised much a subgoal in this, as I'm not there yet, but it is the elimination of the need for a custom classloader when precompiling

14:52 askentasken: why? the macro works...

14:53 Chouser: askentasken: what would you do with a reference to a macro if you had one?

14:53 rhickey_: that will require some AOT support for proxy

14:54 Chouser: oh, so custom classloader is currently required with AOT even if you're not using proxy?

14:54 askentasken: Chouser: in .emacs?

14:55 rhickey_: Chouser: There are still remnants, I haven't gone after that specifically yet

14:55 Chouser: rhickey_: ok. That's probably what you were trying to tell me about applets yesterday.

14:55 askentasken: Chouser: with a ref to one? well (macroexpand-1 assoc!) i also tired calling it.

14:56 rhickey_: Chouser: right - applets and Android are the targets for that

14:56 Chousuke: askentasken: write a macro that produces a macro call form and do (macroexpand-1 (assoc!))

14:56 Chouser: askentasken: that's not how macroexpand works. try: (macroexpand-1 '(assoc! foo bar baz))

14:56 johnwayn`: rhickey_: Is there anything like proxy-super for overridden methods using :gen-class?

14:56 rhickey_: askentasken: what you are trying to do with that macro is not worth doing

14:57 askentasken: and no one should help you do it :)

14:58 (a macro for destructive re-def)

14:58 johnwayner: Oh, and of course swank breaks again :)

14:59 danlei: jup

14:59 rhickey_: johnwayner: not exactly, as the 2 use different mechanisms.

14:59 does swank use gen-class?

14:59 danlei: yes

14:59 rhickey_: interesting

14:59 johnwayner: java.lang.Exception: No such var: swank.util/gen-and-load-class (core.clj:39)

15:00 rhickey_: uh, oh, gen-and-load...

15:00 never should have existed

15:01 cemerick: eliminating the custom classloader should also simplify things in osgi, going to .NET, etc.

15:02 Chouser: I hope in all this AOT-fun, nobody loses track of how fantastic the dynamic REPL is. I care about that so much more than AOT.

15:02 Chousuke: askentasken: def'd names should in many cases be treated with the same care as global variables. you wouldn't reassign a value into a global variable in C without a *very* good reason, would you? :)

15:02 rhickey_: Chouser: what's great is you get both, for delivery AOT means a lot

15:02 askentasken: rhickey: it already works muaahaha, im just testing macroexpand but it doesnt work. how do i use macroexpand?

15:03 rhickey_: But after you;ve got stubs, you still get repl bugfixing on the fly etc

15:03 kotarak: (macroexpand '(foo-macro with args))

15:03 rhickey_: askentasken: pass the form as data - i.e. quote it

15:03 askentasken: Caused by: java.lang.IllegalArgumentException: Wrong number of args passed to: assoc-BANG-

15:03 Chouser: askentasken: I already gave you an example.

15:04 askentasken: ah

15:06 H4ns: lisppaste8: url

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

15:06 H4ns: does lisppaste8 feel well again?

15:07 Chouser: H4ns: last I checked, yes

15:07 askentasken: i saw fiex

15:07 fixed

15:07 i dont use that macro i just created it to learn macros

15:08 H4ns: Chouser: ok

15:09 askentasken: (load-file "C:/clojure_20080916/progs/oo/oo4.clj")

15:09 is in my user.clj now, can i do load-dir "C:/clojure/contrib"?

15:11 Chouser: rhickey_: any chance of getting the breaking-change to doto in?

15:12 http://groups.google.com/group/clojure/browse_thread/thread/d668c590c6cf982b

15:48 Wodin: Hi. On the 19th of September I tried out using dcm4che-2.0.15 from Clojure: http://clojure-log.n01se.net/date/2008-09-19.html . I tried first with the June release and got "No matching method found" error. Then I tried with the September release and it worked. I've just tried now again with r1109 and it failed again!

15:49 I've bisected it back to the changes in r1047 and 1048.

15:49 If I back out those changes then it works again.

15:50 i.e. r1046 works, r1047 and later give the "No matching method found" error.

15:50 duck1123: Wodin: You probably need to move the libraries to match the new locations

15:50 Wodin: duck1123: If I just revert r1047 and 1048 without changing anything else then it works.

15:51 It's a few lines in src/jvm/clojure/lang/Reflector.java

15:51 The log message for those revisions is: hardwired JDK 6 StringBuilder workaround to StringBuilder

15:53 shoover_: askentasken: no, but check out (doc ns) for ways to make a lib load other things it needs. or if you really want to you could write a load-dir using file-seq or the listFiles method in java.io.File

16:00 lisppaste8: Wodin pasted "dcm4che2" at http://paste.lisp.org/display/70670

16:03 Wodin: duck1123_: Any other ideas? :)

16:05 duck1123_: If I'm referencing a Java class inside a macro, but I'm calling that macro from within a different namespace, do I have to do an import in the calling file, or is there a way to just import it in the defining file?

16:05 Wodin: unfortunately, no

16:05 Wodin: duck1123_: OK thanks.

16:06 Chouser: Wodin: which line gives you the error?

16:07 duck1123_: which line are you getting the error on?

16:07 Wodin: Chouser: It's the getString call.

16:08 Exception in thread "main" java.lang.IllegalArgumentException: No matching method found: getString (dinfo.clj:0)

16:08 Not sure why it says it's line 0, though.

16:08 Chouser: which jar file(s) do I need to test this?

16:08 Wodin: Same error as I got in September with the June release of Clojure: http://clojure-log.n01se.net/date/2008-09-19.html

16:08 Chouser: ah, core?

16:09 Wodin: I'm using dcm4che-core-2.0.15.jar, log4j.jar, slf4j-api-1.2.jar, slf4j-log4j12-1.2.jar

16:09 Chouser: core? I don't know what you mean.

16:10 Chouser: Oh, dcm4che-core? Yes.

16:11 Chouser: ok, i've got your error

16:11 Wodin: Chouser: So if I revert revisions 1047 and 1048 then it works with r1110.

16:13 mehrheit: what would be the equivalent of expt (from, for example, scheme) in clojure?

16:13 Chouser: mehrheit: dunno what that is, sorry.

16:13 Wodin: i.e.: svn up; svn diff -r1046:1048 | patch -p0 -R

16:13 Chouser: mehrheit: what does it do?

16:13 mehrheit: Chouser: raises a number to a power

16:13 Wodin: Chouser: expt is like x to the power of y.

16:13 Hun: iirc (.pow )

16:14 or Math.pow

16:14 something like that

16:14 mehrheit: Math/pow works on doubles

16:14 something more generic would be better

16:15 Hun: that's pretty hard if one doesn't write a full numeric tower (which again is pretty hard if you want to cooperate with java)

16:16 Chouser: mehrheit: BigInteger has a .pow: (.pow 2M 10)

16:16 BigDecimal, sorry

16:18 mehrheit: Chouser: yes, that will do

16:19 Hun: but don't *, +, etc. already work on all numeric types and automatically promote big results to BitIntegers or similar?

16:20 Hun: they are implemented inside clojure. but the more mathy stuff comes from java and is pretty hard to integrate (note that i'm just estimating. i'm not an implementor)

16:20 Chouser: Wodin: looks like you're going to have to take it up with rhickey_. The method you want isBridge (whatever that means), but the class is not StringBuilder, thus Clojure's not letting you get to that method.

16:20 Wodin: I don't understand the purpose of that logic.

16:22 lisppaste8: Wodin annotated #70670 with "Exception with r1110" at http://paste.lisp.org/display/70670#1

16:23 Wodin: Chouser: OK thanks.

16:23 Chouser: Wodin: There may be a (very ugly) workaround though. hang on...

16:25 * Wodin hangs on

16:25 Chouser: (. dcm getString 0x00100010) is supposed to return a string?

16:26 gnuvince: Did anyone have time to review my draft?

16:26 Chouser: might it sometimes return nil?

16:27 Wodin: Chouser: I think it could return nil. I haven't looked at the code, but I seem to remember it being able to return nil.

16:27 djpowell: anyone figured out the new aot gen-class yet? - looks interesting

16:28 Wodin: Chouser: You said in September: (. (new org.dcm4che2.data.BasicDicomObject) getString 1234) <-- works for me (very recent version of clojure) It returns nil and doesn't throw an exception.

16:28 askentasken: can i use cond and let together?

16:29 lisppaste8: Chouser annotated #70670 with "ugly workaround" at http://paste.lisp.org/display/70670#2

16:30 askentasken: im back on my tictactoe, wirting a simple AI. i need to cond a bunch of stuff but can i di cond (let [...] and then have a local let?

16:30 Chouser: Wodin: but even if that works for you, take it up with rhickey_ either here or on the google group.

16:30 Wodin: Chouser: Don't understand it, but I agree it looks ugly :)

16:30 Chousuke: who has commit access to clojure-contrib? I think it's pretty ugly that the numbers.clj bigdec test throws an exception.

16:30 Chouser: I don't know what the logic should be for finding the right method, but clearly it's not right.

16:31 Wodin: the first line uses reflection to dig out a Method named "getString" that takes an int

16:31 rottcodd: drewc: fwiw, I don't like the derivative names either, preferring something like project.clojure.org or clojure.net

16:31 Chouser: Wodin: the second line builds up the argument array and invokes the Method.

16:32 Wodin: Chouser: OK, I see. Thanks.

16:32 Chouser: you ought to be able to bundle all that in your print-tag fn and encapsulate the ugliness

16:32 drewc: rottcodd: i registered 'projecture.net' yesterday, as it seemed to be the most agreeable. I could still be swayed by a compelling argument though :)

16:33 Wodin: Chouser: Yes, but I'd prefer not to if I don't need to. By the way, that's basically my first Clojure "program". Is it terrible? :)

16:34 Chouser: right, I provided the workaround so that you could continue working on your program. It's not acceptible as a long-term solution, and I'm sure rich would agree.

16:35 Wodin: your bug writeup is pretty good. you might include a link to the javadoc for the getString method you're trying to call.

16:35 Wodin: then just whine about it until Rich fixes it. :-)

16:36 rottcodd: drewc: no arguments here, thanks for providing the service

16:36 Wodin: Chouser: Thanks. Bed time now, though. I'll send a bug report to the Google group tomorrow.

16:36 Chouser: Wodin: the program's not terrible at all.

16:36 Wodin: ok, good night.

16:37 Wodin: Thanks for the help.

16:39 duck1123_: drewc: projecture was the best out of the names offered

16:48 blarf: (cond (let [mov (do-stuff)] mov... is that legal?

16:49 Chousuke: I don't see why not.

16:50 Though I can't think of a reason to do that.

16:53 lisppaste8: asken pasted "tictactoeAI" at http://paste.lisp.org/display/70677

16:53 blarf: Chousuke ^^

16:53 java.lang.IllegalArgumentException: Key must be integer

16:54 Chouser: ah, you want a sort of cond-let

16:54 blarf: yes

16:55 Chousuke: blarf: oh, like that.

16:55 Chouser: clojure.contrib.cond has cond-let

16:55 blarf: it compiles fine

16:55 but i get a runtimeerror as shown above, first version works, second is the problem

16:57 Chousuke: in that case your "cond" test actually ends up being (assoc brd mov 3)

16:57 Chouser: blarf: cond still requires separate 'test' and 'expr' -- putting them both into a single 'let' won't work.

16:59 Chousuke: your code nests pretty deep

17:00 to me that usually is a sign that you should be looking for an alternate way to express what you want :)

17:00 blarf: yes, so how would you do?

17:01 gnuvince_: hi

17:04 nsinghal: ;destucturing bind question

17:04 (def *defaults* {:a 1 :b 2})

17:04 (def args {:a 3})

17:04 (let [{:keys [a b]} (merge *defaults* args)] [a b]) >>> [3 2]

17:04 (defn test-fn [{:keys [a b] :or *defaults*}] [a b])

17:04 (test-fn args) >>> [3 nil]

17:04 How can i write a function where i can define the default values in a map?

17:04 gnuvince_: Chouser: can I borrow you for a few minutes?

17:04 Chouser: gnuvince_: you can try. :-)

17:06 nsinghal: to use a var like that in a destructuring form probably requires a macro

17:06 nsinghal: normally none of the pieces in a fn arg list are eval'ed

17:07 gnuvince_: Chouser: I wrote the second part of my comic fetcher tutorial. Can I interest you in reviewing language and code?

17:07 kotarak: then a macro doesn't help. The macro has no access to the value of a Var.

17:08 Chouser: kotarak: oh, I guess you're right, at least without doing the resolve stuff manually as rhickey discourages.

17:09 kotarak: right

17:09 Chouser: gnuvince_: perhaps later this evening.

17:09 nsinghal: thanks for answering - that make sense

17:10 gnuvince_: Chouser: sure. I'm in no hurry to post, but I like to make sure that what I post is accurate.

17:11 lisppaste8: chousuke annotated #70677 with "simplified (untested)" at http://paste.lisp.org/display/70677#1

17:11 Chousuke: blarf: ^^

17:12 actually, I wonder if the recur works

17:12 I'm not sure about multimethods

17:14 Chouser: Chousuke: that is interesting. I'd guess it recurs without going through dispatch again.

17:14 Chousuke: actually the (and mov is not needed either, since that's guaranteed to be non-nil

17:15 Chouser: yep, that's what it does.

17:16 Chousuke: the boolean operators are nice in that they return the actual value of the test instead of a boring boolean :)

17:18 so when you need to do "get foo, if not found, get bar, if not found, get something else" becomes just a nice (or (get-foo) (get-bar) :something-else)

17:27 blarf: Chou: thanks, nice. but lets say all those functions are expensive, does it evaluate them lazily or does it execute them all?

17:28 Chousuke: or returns the first thing that returns non-false

17:28 blarf: yes but will the functions be executed even if the first is true?

17:28 Chousuke: no

17:28 blarf: or that what u meant? it quites a ssoon as something is true?

17:28 Chousuke: yes.

17:29 try it yourself: (or nil 1 (println "oops"))

17:31 also (and (println "hello") (println "not-seen")) :) (println returns nil)

17:36 blarf: how do i get integer-division?

17:36 gnuvince_: quot

17:37 (quote 4 3) => 1

17:37 err

17:37 (quot 4 3)

17:37 sorry

17:40 Chousuke: hm

17:41 was there a function that takes a function and returns a lazy seq of ((f), (f), (f)...) ?

17:42 kotarak: maybe something like repeatedly?

17:42 Chousuke: ah, exactly that

17:42 I only tried repeat

17:46 blarf: but if find-move ir true and so id find-move 2, but the move is not valid, then it "backtracks" or takes next in the or thsat is true?

17:46 anyway it works

17:47 Chousuke: I'm assuming find-move only returns valid moves.

17:47 otherwise, that can end up in an infinite loop

17:49 if the first find-move doesn't find a valid move, it should return nil, in which case the second find-move is run

17:49 and if that doens't find a move, then one is generated

17:50 if the generation returns nil, your app should be crashing anyway :P

17:50 you could optimise it somewhat by looping the generation and valid-move? but simplicity first :)

18:00 blarf: the minlambda s using # only have one var right?

18:03 Chousuke: blarf: no. #(+ %1 %2) :)

18:03 blarf: you can't mix using just % and %n notation though.

18:06 johnwayner: Don't suppose anyone here uses Vista with GitHub?

18:06 I've got a fix for swank-clojure but can't get git to clone my fork

18:07 due to key file permission problems

18:09 MarkVolkmann: If I use (import '(java.util Date)) then I can create a Date object with (new Date) or (Date.).

18:09 Can I create a Date object without doing an import by providing the full class name?

18:10 johnwayner: user> (java.util.Date.)

18:10 #<Date Tue Nov 18 17:09:08 CST 2008>

18:10 seems like it

18:10 * kotarak wants (import 'java.util.Date)

18:14 gnuvince_: kotarak: (import '(java.util Date))

18:14 kotarak: I know, but (use 'foo.bar.baz), (require 'foo.bar.baz), but (import '(foo.bar Baz))

18:15 gnuvince_: kotarak: that would make importing more than one thing from a package longer

18:15 (import '(java.io BufferedReader InputStreamReader))

18:15 vs (import 'java.io.BufferedReader 'java.io.InputStreamReader)

18:16 kotarak: gnuvince_: ??? (require '(foo.bar baz frob)) (import '(foo.bar Baz Frob))

18:16 import does not allow both forms, require and use do. Inconsistent.

18:20 StartsWithK: what is happening here, and why does this code work? http://pastebin.com/m18d128e2

18:21 albino: are use, require, and import effectively doing the same thing?

18:21 why isn't there only one way to do that?

18:21 cooldude127: does use actually work with java classes?

18:21 isn't import the only one that does that?

18:22 kotarak: albino: require just loads a library, use "require"s a library and refers it in the namespace, import makes Java classes available.

18:22 cooldude127: there we go

18:23 kotarak: (require 'foo) => (foo/bar), (use 'foo) => (bar), (new foo.Bar) (import '(foo Bar)) => (new Bar)

18:24 cooldude127: kotarak: we need that in some docs somewhere

18:24 kotarak: (doc require), IIRC

18:24 cooldude127: oh

18:24 albino: hmm

18:25 kotarak: thanks for the description

18:25 kotarak: np

18:28 Chousuke: StartsWithK: you're defining x a function that returns a function

18:29 cooldude127: #() creates one function

18:29 then the fn form creates another

18:29 Chousuke: the curious thing is using % as the parameter

18:29 StartsWithK: yes

18:29 Chousuke: I guess it's not captured by the #()

18:29 but the fn instead

18:30 StartsWithK: isn't that (fn [1] 1)

18:30 and that should fail, but even so, why when called it return (inc 2) not (inc 1)

18:30 cooldude127: (def x (fn* [p1__1111] (fn [p1__1111] (inc p1__1111))))

18:30 is the macroexpansion

18:31 Chousuke: looks like the inner binding hides the outer one.

18:32 StartsWithK: so 1 is ignored and replaced with replaced with (gensym)?

18:32 cooldude127: evidently

18:34 Chousuke: the outer function binds the name p1_1111 to whatever, but the inner one rebinds it, and so the parameter passed to the outer function is never seen.

18:36 hiredman: http://www.thelastcitadel.com/clojure/arithmetic-mean <-- arithmatic mean using reduce

18:38 StartsWithK: cooldude127, Chousuke thanks for explaining this, looked realy strange

18:41 cooldude127: no problem

18:41 if you have trouble with stuff like that again, this is what i did in the repl

18:41 (macroexpand '(def x #(fn [%] (inc %))))

18:41 that'll show you what's going on

20:00 cwyang: There are two basic styles of implementing such a construct: http://paste.lisp.org/display/70665

20:01 Chousuke: hm?

20:07 cooldude127: cwyang: what's this?

20:16 MarkVolkmann: How can I take a string like "one two" and get a collection containing the strings "one" and "two"?

20:17 Chouser: (.split "one two" " ")

20:17 MarkVolkmann: This is close. (split-with (fn [x] (not= x \space)) "one two")

20:17 cooldude127: i like chouser's :)

20:17 MarkVolkmann: Definitely! Thanks

20:17 cooldude127: uses the java string api

20:19 MarkVolkmann: How can I take a list of strings and get a single string that concatenates all the strings together with a space between each?

20:19 I thought (str list) would do it, but no.

20:19 gnuvince_: Chouser: can I send you that link?

20:20 Chouser: gnuvince_: yes

20:20 hiredman: MarkVolkmann: maybe interpose

20:20 then str

20:20 gnuvince_: Chouser: here or email?

20:20 Chouser: hiredman: thanks, I can never think of the word interpose

20:20 (apply str (interpose " " ["one" "two" "three"]))

20:20 There's also clojure.contrib.str-utils that has some of these

20:21 gnuvince_: email I guess, and I'll reply with comments.

20:22 gnuvince_: Chouser: sent.

20:22 Thanks

20:53 MarkVolkmann: I'm confused about how to use things in clojure-contrib. Suppose I want to use the str-join function in str-utils. I start with (require 'clojure.contrib.str-utils). What else do I need to do to make the str-join function known in the current namespace?

20:53 vagif: Hello, anyone using compojure web framework ?

20:54 Chouser: if you say (require '[clojure.contrib.str-utils :as util]), then you can say (util/str-join ...)

20:54 or (require '[clojure.contrib.str-utils :only (str-join)]), and (str-join ...)

20:56 vagif: compojure comes with jetty, but i want to integrate it into my existing application which is on tomcat.

20:56 anyone done that ?

20:56 Chouser: MarkVolkmann: sorry, that's (use '[clojure.contrib.str-utils :only (str-join)])

20:57 vagif: I haven't, sorry. I haven't used compojure yet, but I think that question has come up

20:58 vagif: did you search the clojure and compojure google groups?

20:58 vagif: yes i searched both groups

20:58 Chouser: ok, well I guess your best bet would be to ask there.

21:18 blbrown: pjb3: did you just twitter me

21:18 pjb3: blbrown: I did

21:18 blbrown: hehe

21:19 pjb3: You said you bought the Clojure book, that means you are worth following :)

21:19 blbrown: I got the beta PDF, apparently, there are a lot of sections missing

21:32 candera: Stu should have Beta 2 of the book out before too long

21:32 Presumably you'll get an updated copy when he does - no idea how that works.

21:32 Although I suspect that even Beta 2 will still not have every chapter completed.

21:33 blbrown: the first part is all I need anyway. I got a good first 100 pages or so.

21:37 gnuvince_: hmmm

21:37 Steve Yegge mentioned Clojure in his latest blog post.

21:37 Do you think that's good or bad?

21:37 Chouser: how could it be bad?

21:38 albino: was he comparint it to NBL?

21:38 s/comparint/comparing

21:38 gnuvince_: albino: no, he just mentioned it in passing in his Ejacs post

21:38 cooldude127: yeah i saw that

21:38 i think what he said was mildly positive

21:38 hiredman: it's about time he mentioned it, it seems like it should be right up his alley, dynamic and on the jvm

21:38 cooldude127: he's still in love with javascript tho

21:39 hiredman: yeah, well, ok

21:39 pjb3: It's funny about Steve Yegge, I actually first heard about Clojure from people commenting on his blog

21:40 cooldude127: hehe

21:40 pjb3: Might have been the NBL post, I just remember a lot of comments about Scala and Clojure

21:40 I hadn't heard of either of those languages until then

21:40 Chouser: But Yegge doesn't actually like JavaScript. He likes what he's planning on turning JavaScript into.

21:40 cooldude127: what is he turning it into?

21:41 gnuvince_: NBL

21:41 cooldude127: that's a tad abstract

21:41 Chouser: Because I agreed with so much of what he said, I started trying to do projecteuler problems in Rhino. It was terrible. He's extended it in a bunch of ways.

21:41 gnuvince_: I think he really liked EcmaScript 4 before it was gutted

21:41 cooldude127: oh

21:42 gnuvince_: Rhino was not fun

21:42 cooldude127: lol

21:43 gnuvince_: With Clojure, I've had nothing but fun :)

21:43 hiredman: mmmmm

21:43 albino: well from reading his blog posts it was JS2 he liked

21:44 gnuvince_: albino: JS2 is EcmaScript 4

21:44 * albino still does Rhino for money on one project

21:44 albino: gnuvince_: as the different browser vendors see it or what?

21:46 johnwayner: I forked Jochu's swank-clojure and patched it to work with SVN 1110:

21:46 http://github.com/johnwayner/swank-clojure/tree/master

21:47 I had to hack on it a bit, so hopefully it works.

21:47 cooldude127: johnwayner: what has changed in 1110 from, say, 1107?

21:48 cuz i have SVN1107 and swank-clojure working together

21:48 johnwayner: The removal of gen-and-load*

21:48 cooldude127: shittttt

21:48 that sounds important ;)

21:48 johnwayner: moved into (ns (:gen-class

21:48 cooldude127: oh

21:48 johnwayner: so yeah, "removal" not the right word I guess :)

21:48 cooldude127: FAT ASS API CHANGE

21:48 is more like it ;)

21:49 johnwayner: This is a crazy time.... should be pretty much smooth sailing soon.

21:49 cooldude127: hopefully

21:50 Chouser: I hope doto gets broken soon too.

21:50 cooldude127: in what way?

21:50 mattrepl: hmm, is there a write-up on what replaces gen-and-load-class post-AOT compilation?

21:51 cooldude127: mattrepl: apparently it's part of namespaces now?

21:51 johnwayner: mattrepl: this: http://paste.lisp.org/display/70665

21:51 mattrepl: and the irc log from earlier today

21:51 hiredman: crazy

21:51 mattrepl: thanks

21:52 hiredman: defn- -main

21:52 weird looking

21:52 cooldude127: yeah wtf?

21:52 Chouser: why would you make main private?

21:53 cooldude127: i'm not totally sure i'm on board with this

21:53 Chouser: cooldude127: http://groups.google.com/group/clojure/browse_thread/thread/d668c590c6cf982b

21:53 cooldude127: Chouser: k i remember that thread

21:54 johnwayner: Chouser: perhaps it's private in the namespace but not the class? Dunno

21:54 I don't presume to know better than rhickey :)

21:55 Chouser: oh, yeah, I didn't notice that in his code. weird.

21:55 cooldude127: yeah this code needs mucho examination

21:56 johnwayner: Any elispers know how to avoid this nasty change? http://github.com/johnwayner/swank-clojure/commit/8f567775360425475df494520083f9023ffe1af1

22:00 mattrepl: johnwayner: did you already fix the defexception macro in swank-clojure?

22:00 johnwayner: mattrepl: I removed it

22:01 mattrepl: I just added the one class that was being created as a .clj file and compiled it in swank-clojure.el

22:02 mattrepl: This is probably just a hack to get it working. It doesn't really seem correct.

22:02 mattrepl: that's such a hassle just to give a typed exception

22:02 *nod* and I meant the new namespaces -> classes, not your change

22:03 johnwayner: yeah, I have a feeling we are quite done with changes in the area :)

22:03 are *not*

22:06 mattrepl: thanks for making it work, now I can get back to thesis writing. =)

22:06 johnwayner: np. :)

22:14 dms: hello..anybody know how to set up slime file name translations for connecting with a remote swank server? (or is it even possible currently?)

22:16 drewc: dms: see segv's annotation here : http://paste.lisp.org/display/32153

22:16 johnwayner: dms: You want to edit the remote files via Tramp?

22:19 dms: johnwayner: yes. i could connect slime to a remote swank but M-. doesn't work. I saw the reference about tramp via google, but didn't really know how to set it up.

22:19 drewc: thanks. I will try it out.

22:20 drewc: dms i have made it work in CL, and it's all on the elisp side AFAIK, so it should just-work.

22:32 dms: hmm.. i am connecting to my remote machine via a ssh tunnel, so i really want slime to connect to a local ip and port but still do file name translations.. this is going to take a while.

22:34 johnwayner: dms: maybe you can trick slime by putting an entry in you /etc/hosts that points to localhost

22:36 dms: good idea. will try.

22:40 wwmorgan: I just downloaded svn head and compiled it. When I ran the jar, it yelled at me because Compiler.pushNS is package-private and clojure.core was trying to access it. Making pushNS public solved the problem, apparently. Comments?

22:40 johnwayner: wwmorgan: did you clean?

22:40 wwmorgan: possibly nvm. Turns out I wasn't at head

22:41 and everything works. Crisis averted!

Logging service provided by n01se.net