#clojure logs

2008-11-18

02:29PupenoGood morning!
03:52askentaskenis clojure for concurrency or parallellism or both?
03:52askentaskenit is really a fun language, i will keep using it for personal projects
03:55cwyang ho
03:55cwyang(typo)
03:57Lau_of_DKaskentasken: both I'd say, theyre somewhat interconnected
04:12leafw_rhickey__: http://clojure.org/special_forms#let contains an extra semicolon ';' that creates confusion, after the third paragraph.
04:13leafw_rhickey__: in a Clojure code example I mean.
04:14leafw_rhickey__: happens because the code is inside a <pre ..></pre> block, but the & is present as &amp;
04:14leafw_rhickey__: there is a second insance of the same a few lines below it.
04:15leafw_rhickey__: ... actually, in many.
04:18Lau_of_DKleafw_: By browser doesnt render it like that, to me it looks squeaky clean, Firefox3
04:22H4nsleafw_: what browser is it that you're using?
04:23H4ns(ie also renders &amp; correctly inside <pre>, and i think that the behavior is completely correct)
04:25leafw_H4ns: firefox 3.0
04:26H4nsleafw_: wfm
04:26leafw_wfm ?
04:27H4nswfm == works for me, but in fact it does not
04:27H4nshm.
04:27H4ns(at least chrome also screws up)
04:28leafw_something is werid, perhaps the css tag is doing something to the pre
04:28H4nstrue. tomhickey is who would take care of that.
04:28leafw_if you can reach him please do
04:29H4nsit is not the css, it is the javascript colorizer that screws up.
04:29H4nsyou can see that the rendering is correct when the browser first loads the page, but then the beautifier makes the extra semicolon appear.
04:30H4nstomhickey: ^ you may want to read the log until here :)
05:22askentaskenis there a java-lib for permutations?
06:01Lau_of_DKaskentasken: Probably, but there is also one in Clojure.contrib.lazy_seqs
06:02Lau_of_DKAlthough, 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
06:08leafw_anybody uses chimp for ViM? What does "Supply <chim.id> to the glue functions" mean? What/where are these glue functions?
06:15askentaskenLau: ok order is not important for my task
06:16askentaskenhow do i get contrib?
06:18askentaskenperms xs = [(h:t) | h <- xs, t <- perms $ delete h xs]
06:18askentaskenanyone can trnslate that to clojure?
06:22askentaskendo i just import clojure-contrib to user? or it is a ajr?
06:22askentaskenjar
06:28Lau_of_DKI think they've made a jar, which you just put on the classpath
06:28Lau_of_DKOtherwise just download the source to your clojure dir and (require 'clojure.contrib.lazy_seqs) if I remember correctly
06:29Lau_of_DKThe code you posted, which language is it in ?
06:30Chousukelooks like haskell
06:32PupenoLau_of_DK: was it you who was playing with Qt?
06:36Lau_of_DKPupeno: Yes, I was one of the players
06:36askentaskenis the paste-to clojure not working anymore?
06:36Lau_of_DKlisppaste8: url
06:36lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
06:37Lau_of_DKIf you use that, it should work - If it doesnt, then you answered your own question :)
06:37askentaskenhttp://paste.lisp.org/display/70635
06:37askentaskennaive and not wokring
06:37askentaskenis there already discard-val and discard-at ?
06:41Lau_of_DKSee filter / remove
06:48hoeckaskentasken: do you want to remove the first occurence of val in coll or every occurence of val in coll?
07:03askentaskenfirst
07:15hoeckaskentasken: there is split-whith, which takes a predicate and returns 2 seqs
07:16askentaskennot exactly what iw ant
07:16askentaskenanyway i have my won so it sok
07:17askentaskendid perms like this: (defn perms [coll]
07:17askentasken (if (nil? coll)
07:17askentasken [[]]
07:17askentasken (for [h coll t (perms (discard-val h coll))]
07:17askentasken (conj t h))))
07:17askentaskenperhaps naive implementation but works
07:20hoeckor see: http://paste.lisp.org/display/70635#1
07:20askentaskenis count O(1) for everything? lists and vectors?
07:21Chousukeit is for most things.
07:21Chousukebut not all seqs
07:28askentaskenfor vectors?
07:28askentaskenfor lists?
07:28askentasken(count [1 2 3 4 5]) O(1)?
07:28askentasken(count '(1 2 3 4 5)) ?
07:28hoeckyes
07:28hoeckO(1)
07:28askentaskenis vector genera�lly preferred over lists? they seem easier to work with
07:28hoeckthey are in fact some kind of trees to make copying cheap
07:28askentaskenyou dont have to reverse your recursive calls either(which you often have to with lists)
07:29hoeckvectors are good for appending stuff
07:29hoecklists are good for code
07:31askentaskenlol i was writing discard-val -all but then thats obv filter...
07:31askentaskencode?
07:31askentaskencode as in lispcode?
07:31askentaskenmacros'
07:33hoeckaskentasken: yeah, expressions
07:41askentaskenhmm could it be possible to inmplement python-like splicing with a nice macro?
07:41askentaskena = [1,2,3,4,5]
07:41askentaskena[2:4] _> [3,4]
07:41askentaskenbut how do i define a macro using infix? is that possible?
07:41askentaskento do that i need access to the clojure parser? or everything you can do with amcros that you can with the parser?
07:42askentaskenhmm wait i already ahve take-between
07:45hoeckaskentasken: for vectors, there is also subvec
07:49hoeckaskentasken: you could create your own subclass of vector and implement invoke so that ([1 2 3 4] [2 4]) returns the subvector [3 4]
08:01duck1123that would be very confusing
08:02askentaskensubvec is what iw ant and i almost always use vectors not lists anyway, veyr good
08:04duck1123It would be cool to have an index macro of some sort (#[2 4] [1 2 3 4 5]) => (3 4)
08:06duck1123although subvec is pretty easy to write and clearer
08:07askentaskenis 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.
08:07askentaskenit doesnt even tell me where in the program it happened, usually jsut in some .java module
08:08askentaskenyeah that was what i wanted but subvec is ok
08:08askentaskenbut something combinable liek pythons, [-x:] [x:y] etc...
08:09duck1123askentasken: are you working directly with the repl, or are you using some editor? (emacs, vim, netbeans)
08:09duck1123I know with slime (emacs) it initially only shows a few lines of the trace on errors
08:10askentaskenemacs + repl
08:10askentaskennot slime though
08:10askentaskenjust the first clojure-mode
08:10askentaskenthat came
08:12hoeckjust 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
08:12hoecki mean a new swank-clojure
08:15askentaskenrhickey: what is your opinion on Python anyway?
08:16leafw_any chim or gorilla user in Vim? I can't get it to work
08:19leafw_and the documentation is, unfortunately, pitiful
08:23MarkVolkmannRevision 1109 doesn't build for me. I get an IllegalArgumentException related to precomile.clj.
08:24askentaskenis there concat for vector?
08:25askentaskeni dont want lists it seems athere is a lot of arbitrary type-conversion which i dont like, or am just doing it wrong :)
08:26hoeckaskentasken: (reduce conj v1 v2)
08:28MarkVolkmannHas anyone done an svn update and run ant this morning?
08:29hoeckMarkVolkmann: me, but it works, at least it builts correctly
08:29rhickeyaskentasken: Python is ok, I had fun the few times I used it
08:30rhickeyMarkVolkmann: worked for me (pulled and working in different office today)
08:30rhickeyMarkVolkmann: did you clean?
08:30hoeckjust made the transition from pre-AOT to AOT, and it worked fine
08:30_deepfirerhickey, is there some description for future direction of Clojure?
08:30MarkVolkmannNo clean ... I'm trying that now.
08:31MarkVolkmannDoing a clean fixed it. Thanks!
08:31rhickeyaskentasken: Python doesn't fit my mental model for some reason
08:31gnuvincehello
08:33rhickey_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
08:35rhickey_deepfire: there's a todo here: http://richhickey.backpackit.com/pub/1597914 which will probably move to a more formal tracker soon
08:42askentaskenhttp://paste.lisp.org/display/70639
08:42askentaskenanyone good with permutations ^^
08:42askentaskenit sort of works
08:42askentaskenbut to many [] and () :)
08:52_deepfirerhickey, thank you!
09:03askentaskenhow can i do ona map get-with-default
09:05askentaskenah i found it
09:06Chousukestill working on the tic-tac-toe thing? or something else? :)
09:08MarkVolkmannaskentaken: In your code paste, where is the discard-val function defined?
09:21askentaskenChousuke: other stuff but i will add minmax later
09:36tomhickeyH4ns & leafw_: fixed the with the code highlighter & issue on the site. thanks for the heads up.
09:37H4nstomhickey: looks good now, thanks!
09:40askentaskenmy head is spinnging trying to implement fibonacci with memoization. anyone seen a solution for that?
09:45askentaskencan i ahve ordered maps? ie maps that preserve input order?
09:45askentaskenif i want a Map but want several keys of th same value, what datastructure is then most suited?
09:48Chouseraskentasken: array-map maintains original input order
09:51Chouseraskentasken: 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.
09:56askentaskenyes that could work, didnt know that was allowed, cool
09:57Chouseryep, one of the many benefits of immutable collections is they work great as Map keys.
09:58Chouseralso, 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:19askentaskencan i do (sort-map (on-key-2) somemap) somehow?
10:20askentaskenwithout writing ym won...
10:20askentaskenown
10:21rhickey_askentasken: sort-by
10:24askentaskenclojure/sort-by
10:24askentasken([keyfn coll] [keyfn comp coll])
10:25askentaskeni have a map a= {[4 4] 8, [1 1] 3, [2 2] 1, [3 3] 2}
10:25askentaskenand i want to sort by the second key-val
10:26rhickey_askentasken: not sure what you mean by "second key-val"
10:26rhickey_user=> (sort-by val {[4 4] 8, [1 1] 3, [2 2] 1, [3 3] 2})
10:26rhickey_([[2 2] 1] [[3 3] 2] [[1 1] 3] [[4 4] 8])
10:26Chouseraskentasken: you want a seq or a new map?
10:28askentaskena seq
10:29askentasken[2 2] 1 means nbr 2 order 2 value 1
10:29askentaskeni want to sort by order
10:29askentaskenim doing a compress-function
10:30askentasken (compress-with-info [1 1 1 2 3 3 4 4 4 4 4 4 4 4])
10:30askentasken{[4 4] 8, [1 1] 3, [2 2] 1, [3 3] 2}
10:30askentaskenuser=>
10:30askentaskenso i want to sort it and return : [[1 1] 3, [2 2] 1 etc
10:31askentaskensortby key sorts on the first item in key, i want to sort on the second
10:31Chouser(sort-by #(second (key %)) coll)
10:32Chouserbut if you reverse the order of your key vectors, you can just use sort which should run faster.
10:33rhickey_askentasken: or structurally, each entry will be [[n o] v], so sort-by (fn [[[n o] v]] o)
10:34_skhi, i have a question regarding gen-class, is there a way so that we could use the 'this' reference while defining methods?
10:35Chouserpretty-print is a surprisingly fuzzy operation.
10:35rhickey_Chouser: what's not precise about "pretty" ?
10:35Chouserrhickey_: :-P
10:36Chouser_sk: the first arg passed to each method is the "this" value
10:37askentaskenyes i did that
10:44askentaskenwhat happened to paste to clojure?
10:44askentaskenhttp://paste.lisp.org/display/70648
10:44askentasken^^ my compress function, any tips on improvements?
10:50Chousershould be able to say just (sort acc) instead of (sort-by key acc)
10:50Chouserit's more idiomatic to say (if x b a) than (if (nil? x) a b)
10:51_skthx, 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:51Chouserbut either way, that will only process coll up through the first nil value in the coll, which is probably not what you want.
10:53Chouser_sk: you mean like (.methodName whole-object arg1 arg2) ?
10:53Chousuke_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:53Chousukeoh
10:53Chousuke+, :P
10:54Chouserheh
10:54Chouserhm... (.method obj, a b) ?
10:54Chousukeno, in the java
10:55Chousukeobj.method(a,b);
10:55Chouseryeah, I know, but what about (.method obj, a b) ? better or worse?
10:56_skChousuke: yes, exactly :)
10:56ChousukeI can't say I like that better.
10:56Chousukebut I guess you could do that :P
10:56Chouseryeah, me neither. nm.
10:57_skanother 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:59Chouser_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:59ChouserYou can do anything you want with that value before you return it, including passing it to functions.
11:00_skhmm, in fact we can do whatever we want with it, just not the java way =)
11:00_skthanks a lot
11:00Chouser_sk: yes. Generally, gen-class is used only for interop with existing Java libs.
11:01askentaskenI just keep thinking I must be able to make my compress-function shorter
11:01askentaskencant I use reduce somehow?
11:01ChouserIt 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:03Chouseraskentasken: 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:05Chouseraskentasken: that's doing a sort of run-length encoding?
11:09askentaskenyes it preserves order and count
11:10askentaskenhow would i move it outside? i still need a basecase
11:12askentaskeni can switch to (if x...) and then swithc order of that foc
11:12askentaskenofc
11:13Chouseraskentasken: http://paste.lisp.org/display/70648#1
11:15askentaskencan i have if-elses anywhere?
11:15Chouseryou can use cond
11:16askentaskenah, very nice :)
11:16Chouserhm, I didn't even use xs -- that wastes a line
11:17Chouserah, well, you get the idea
11:19askentaskenyes very nice, thanks
11:22askentaskenand no tailrecursion wont be a problem?
11:22Chouseraskentasken: correct, because of lazy-cons
11:23Chouserlazy-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:23askentaskenis that never as in NEVER or never as probably never(like with laziness in haskell where the thunks blows the stack instead))
11:23askentaskenok
11:24Chouseralternatively, 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:25Chouserbut you were on to something -- replacing lazy-cons with cons would give you a non-lazy fn that would threaten the stack.
11:38askentasken(defn uncompress [coll] (map #(take (second %) (repeat (first %))) coll))
11:39askentaskenreturns a list of lists
11:39Chousertry mapcat
11:41askentaskenlol wait i didnt even see that
11:47askentaskenhttp://paste.lisp.org/display/70648#2
11:47askentaskenChouser: are those both O(n)?
11:49Chouseraskentasken: I think so.
11:50Chousersplit-with touches every val of coll from the front through the split-point twice, so that's O(n)
11:51Chouserthe remainder b is passed in again so that should all be O(n)
11:51Chouserthe reduce version is probably faster by a constant, though.
11:53duck1123there should be metadata attached to each function describing what kind of performance it has
11:53duck1123although you couldn't be sure you could trust it, it would be interesting to have as part of the docs
11:55rhickey_Chouser: did you see: http://groups.google.com/group/clojure/browse_frm/thread/79d07b898b2a0fde
11:55Chouser100000 item seq: cmprss -> 20.734263 msecs, compress -> 16.119936 msecs
11:56Chouserrhickey_: yes, thanks. replying now.
11:59askentaskenhow do you time?
12:01askentaskenwait 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:01ChousukeI'm getting some kind of an error from that thread :/
12:01Chouseraskentasken: http://paste.lisp.org/display/70648#3
12:01Chousukeit says there are no messages and that they may have expired or been deleted :P
12:02ChouserChousuke: I didn't like the competition, so I, uh... took care of it.
12:02Chousukehah
12:03askentaskenChouser:what do you mean? i dont see anything added
12:03Chouseraskentasken: you may have to shift-reload
12:04gnuvinceThe thread is no longer there
12:05Chouserweird. I just replied to the thread, and it says "2 messages" but only mine is visible.
12:05tWiphas with-in-str changed? I'm now getting errors about with-open requiring a vector for bindings
12:07ChousertWip: with-in-str appears to be out-of-date with the new with-open. Probably my fault, sorry.
12:07tWipokay, I'll work around until it is fixed
12:08ChousukeChouser: 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:11Chouserrhickey_: quick patch available: http://groups.google.com/group/clojure/browse_thread/thread/127081d85fb1b4bf
12:14Chousukearbitrary 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:14ChouserChousuke: yeah, the general problem of unhandled extra bindings was mentioned on the google group.
12:15Chouserrhickey_ 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:15Chousukethat'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:15ChouserChousuke: oh, I see. Interesting.
12:16askentasken(take 100 (repeatedly (corner-move)))
12:16Chousukewith something like it you could write ~@(map (memfn close) (bound-names bindings)) or something, which would be nice
12:16askentasken(take 100 (repeatedly (corner-move))) , why doesn that work java.lang.ClassCastException but why?
12:17Chouseraskentasken: does calling corner-move return "a function of no args, presumably with side effects"?
12:18Chouseraskentasken: perhaps you mean (repeatedly corner-move)
12:19askentaskenyes
12:19askentaskenah!
12:19Chousukemaybe with-open should just use let* directly to disallow misuse of destructuring.
12:20Chousukeit'd still allow multiple simple bindings though, but those are pretty easy to deal with
12:22Chouser.close already gets mad if you try to use destructuring in with-open
12:23Chouserso there's just the multiple-bindings issue.
12:25askentaskenis there no builtin for assoc with defualt?
12:26Chouserdefault for what?
12:28askentasken(defn assoc-with [m k v]
12:28askentasken (if (contains? m k)
12:28askentasken (assoc m k (+ v (get m k)))
12:28askentasken (assoc m k v)))
12:28askentaskensomething like that?
12:28askentaskeni couldnt find in the docs so
12:28askentaskenthat nos so general though
12:28askentaskenv should b a function perhaps
12:32wwmorganaskentasken: I think you want update-in
12:32Chouseror perhaps merge-with
12:37askentaskenneither
12:40Chouser(merge-with + {:a 1} {:a 1}) ==> {:a 2}
12:40Chouser(merge-with + {:a 1} {:b 1}) ==> {:b 1, :a 1}
12:41Chouser(defn assoc-with [m k v] (merge-with + m {k v}))
12:46wwmorgan(defn assoc-with [m k v] (update-in m [k] #(+ (or % 0) v))) --- not as nice as chouser's
12:48askentaskennot expensive?
12:48askentaskenmerge-with i mean?
12:51askentaskenhttp://paste.lisp.org/display/70661
12:52gnuvinceI 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:52askentaskendoing permutations and it is pissing me off
13:03Chouseraskentasken: spoilers clojure.contrib.lazy-seqs
13:20Chousukehm
13:23askentaskenim stoopid i dont get where to download from: http://sourceforge.net/projects/clojure-contrib
13:23Chousukecheckout the SVN instead and use that
13:23Chousukeor use some git mirror.
13:24ChousukeSVN checkouts take ages.
13:27Chousukegit 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:27askentaskenis there a unique or nub function?
13:28ChouserI like git-svn, so I can pull changes immediately, but maintain local branches.
13:28Chouseraskentasken: (doc distinct)
13:29gnuvinceaskentasken: distinct I think
13:29gnuvinceOh
13:34lisppaste8Chouser pasted "permutations using sets" at http://paste.lisp.org/display/70662
13:34Chouseroh, lisppaste8! welcome back
13:38rhickey_Chouser: I thought I had fixed with-in-str already
13:40askentaskenhow do i do doc-strings?
13:41Chouserrhickey_: oh, indeed you have. sorry.
13:41rhickey_np
13:41askentaskenChouser: how did u paste directly to the channel?
13:43tWipso with-in-str should work in latest (1109)?
13:43ChousertWip: as of 1108, yes
13:44tWipI thought I was using 1108, oh well
13:45tWipIt does indeed work now, thanks.
13:53Chouseraskentasken: just choose "#clojure" from the channel list. It hasn't been working for the past couple days.
13:54askentaskenRHickey: couldnt it be changed or added so docstrings could be between [argument] and function-body? instead of between f-name and args
13:54Chouseraskentasken: functions can have multiple arg lists, but only one docstring.
13:55Chouser(defn my-inc "add 1 or more" ([x] (inc x)) ([x y] (+ x y)))
13:56askentaskenuh, why and how does that work?
13:56Chousukeyou can overload functions.
13:56Chouserallows different definitions based on number of arguments passed in.
13:58Chousukenote 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:07askentaskenfrom where cna i pull contrib with git?
14:07Chousukehttp://github.com/kevinoneill/clojure-contrib/tree/master
14:08Chousukean unofficial mirror, but it is kept up-to-date with reasonable latency
14:19rhickey_It's alive - AOT/gen-class
14:19tomhickeynow you can breathe again! ;)
14:20rhickey_now I have to write docs :(
14:20tomhickeylol
14:20Chousukeis the interface still the same or improved?
14:20rhickey_gen-and-save/load are gone
14:20rhickey_use a :gen-class clause in your ns form
14:21Chousukecan you still generate classes dynamically?
14:22rhickey_Chousuke: only via proxy, dynamic named classes are an oxymoron in some ways
14:22rhickey_Chouser: not up yet, hang tight
14:22Chouser:-)
14:23lisppaste8rhickey pasted "AOT/gen-class syntax" at http://paste.lisp.org/display/70665
14:24blackdog_and the - prefix is a method?
14:24rhickey_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:25Chousernice.
14:25rhickey_blackdog_: these are real fns, -blah is a naming convention whereby the method can find the fn
14:25blackdog_ok
14:26Chouserall classes mentioned need to be available at compile time?
14:26rhickey_you can edit this and reload while instances are running as long as you don't change the signatures
14:26kotarako.O cool
14:26kotarakHow do I specify the name?
14:27rhickey_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:27Chouserkotarak: the namespace name is the class name
14:27rhickey_kotarak: the ns is the name
14:27rhickey_must be
14:27rhickey_If you leave out the :gen-class, you get support for main only
14:27kotarakHmmm.. Are capitals allowed? From the Java side, my.Hello is probably expected, no?
14:28rhickey_kotarak: sure
14:28kotarakrhickey_: this is awesome! :)
14:29cemerickrhickey_: is the gen-class fn usefully callable still? Of course, I'm thinking of the road ahead for my genbean concoction.
14:29rhickey_with the stand-alone compiler Stuart and Steve are working on, the workflow looks like this:
14:29rhickey_Macintosh:clojure rich$ java -server -cp ./classes:./src/clj:clojure.jar clojure.compile classes my.helloCompiling 1 libs to classes
14:29rhickey_Macintosh:clojure rich$ java -server -cp ./classes:./src/clj:clojure.jar my.hello fooHello foo World!
14:29rhickey_42
14:29rhickey_erm
14:30rhickey_like this:
14:30rhickey_java -server -cp ./classes:./src/clj:clojure.jar clojure.compile classes my.hello
14:30rhickey_Compiling 1 libs to classes
14:30rhickey_java -server -cp ./classes:./src/clj:clojure.jar my.hello foo
14:30rhickey_Hello foo World!
14:30rhickey_42
14:30Chousukethe constructors syntax and the init function still look weird. :/
14:31Chousukemeaning my intuition can't figure out why they look like that :P
14:32rhickey_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:34cemerickrhickey_: actually, I may not need access to gen-class itself, if the options provided to genclass are hanging off the namespace somewhere...
14:34rhickey_this lets the body se the class being defined, but means the stub generated by gen-class tries to load the __init class
14:36cemerickyeah, 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:37cemericknow I just need to figure out how to best generate BeanInfo classes *ech*
14:44askentaskenwhere should i place contrib src? can i link to the whole folder from user.clj?
14:45Chouserjust add clojure-contrib/src to your java classpath
14:45ChouserThen you can use 'require' or 'use' in your .clj
14:47askentaskenhow do i add to my java-classpath?
14:47rhickey_ok, rev 1110 adds AOT gen-class
14:50Chouseraskentasken: java -cp clojure.jar:...../clojure-contrib/src clojure.lang.Repl foo.clj
14:51Chouserproxy works as-is for now?
14:51rhickey_Chouser: I hope so
14:52askentaskenCaused by: java.lang.Exception: Can't take value of a macro: #'user/assoc!
14:52askentasken(defmacro assoc! [map_ k v]
14:52askentasken `(def ~map_ (assoc ~map_ ~k ~v)))
14:52rhickey_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:52askentaskenwhy? the macro works...
14:53Chouseraskentasken: what would you do with a reference to a macro if you had one?
14:53rhickey_that will require some AOT support for proxy
14:54Chouseroh, so custom classloader is currently required with AOT even if you're not using proxy?
14:54askentaskenChouser: in .emacs?
14:55rhickey_Chouser: There are still remnants, I haven't gone after that specifically yet
14:55Chouserrhickey_: ok. That's probably what you were trying to tell me about applets yesterday.
14:55askentaskenChouser: with a ref to one? well (macroexpand-1 assoc!) i also tired calling it.
14:56rhickey_Chouser: right - applets and Android are the targets for that
14:56Chousukeaskentasken: write a macro that produces a macro call form and do (macroexpand-1 (assoc!))
14:56Chouseraskentasken: that's not how macroexpand works. try: (macroexpand-1 '(assoc! foo bar baz))
14:56johnwayn`rhickey_: Is there anything like proxy-super for overridden methods using :gen-class?
14:56rhickey_askentasken: what you are trying to do with that macro is not worth doing
14:57rhickey_askentasken: and no one should help you do it :)
14:58rhickey_(a macro for destructive re-def)
14:58johnwaynerOh, and of course swank breaks again :)
14:59danleijup
14:59rhickey_johnwayner: not exactly, as the 2 use different mechanisms.
14:59rhickey_does swank use gen-class?
14:59danleiyes
14:59rhickey_interesting
14:59johnwaynerjava.lang.Exception: No such var: swank.util/gen-and-load-class (core.clj:39)
15:00rhickey_uh, oh, gen-and-load...
15:00rhickey_never should have existed
15:01cemerickeliminating the custom classloader should also simplify things in osgi, going to .NET, etc.
15:02ChouserI 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:02Chousukeaskentasken: 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:02rhickey_Chouser: what's great is you get both, for delivery AOT means a lot
15:02askentaskenrhickey: it already works muaahaha, im just testing macroexpand but it doesnt work. how do i use macroexpand?
15:03rhickey_But after you;ve got stubs, you still get repl bugfixing on the fly etc
15:03kotarak(macroexpand '(foo-macro with args))
15:03rhickey_askentasken: pass the form as data - i.e. quote it
15:03askentaskenCaused by: java.lang.IllegalArgumentException: Wrong number of args passed to: assoc-BANG-
15:03Chouseraskentasken: I already gave you an example.
15:04askentaskenah
15:06H4nslisppaste8: url
15:06lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
15:06H4nsdoes lisppaste8 feel well again?
15:07ChouserH4ns: last I checked, yes
15:07askentaskeni saw fiex
15:07askentaskenfixed
15:07askentaskeni dont use that macro i just created it to learn macros
15:08H4nsChouser: ok
15:09askentasken(load-file "C:/clojure_20080916/progs/oo/oo4.clj")
15:09askentaskenis in my user.clj now, can i do load-dir "C:/clojure/contrib"?
15:11Chouserrhickey_: any chance of getting the breaking-change to doto in?
15:12Chouserhttp://groups.google.com/group/clojure/browse_thread/thread/d668c590c6cf982b
15:48WodinHi. 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:49WodinI've bisected it back to the changes in r1047 and 1048.
15:49WodinIf I back out those changes then it works again.
15:50Wodini.e. r1046 works, r1047 and later give the "No matching method found" error.
15:50duck1123Wodin: You probably need to move the libraries to match the new locations
15:50Wodinduck1123: If I just revert r1047 and 1048 without changing anything else then it works.
15:51WodinIt's a few lines in src/jvm/clojure/lang/Reflector.java
15:51WodinThe log message for those revisions is: hardwired JDK 6 StringBuilder workaround to StringBuilder
15:53shoover_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:00lisppaste8Wodin pasted "dcm4che2" at http://paste.lisp.org/display/70670
16:03Wodinduck1123_: Any other ideas? :)
16:05duck1123_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:05duck1123_Wodin: unfortunately, no
16:05Wodinduck1123_: OK thanks.
16:06ChouserWodin: which line gives you the error?
16:07duck1123_which line are you getting the error on?
16:07WodinChouser: It's the getString call.
16:08WodinException in thread "main" java.lang.IllegalArgumentException: No matching method found: getString (dinfo.clj:0)
16:08WodinNot sure why it says it's line 0, though.
16:08Chouserwhich jar file(s) do I need to test this?
16:08WodinSame error as I got in September with the June release of Clojure: http://clojure-log.n01se.net/date/2008-09-19.html
16:08Chouserah, core?
16:09WodinI'm using dcm4che-core-2.0.15.jar, log4j.jar, slf4j-api-1.2.jar, slf4j-log4j12-1.2.jar
16:09WodinChouser: core? I don't know what you mean.
16:10WodinChouser: Oh, dcm4che-core? Yes.
16:11Chouserok, i've got your error
16:11WodinChouser: So if I revert revisions 1047 and 1048 then it works with r1110.
16:13mehrheitwhat would be the equivalent of expt (from, for example, scheme) in clojure?
16:13Chousermehrheit: dunno what that is, sorry.
16:13Wodini.e.: svn up; svn diff -r1046:1048 | patch -p0 -R
16:13Chousermehrheit: what does it do?
16:13mehrheitChouser: raises a number to a power
16:13WodinChouser: expt is like x to the power of y.
16:13Huniirc (.pow )
16:14Hunor Math.pow
16:14Hunsomething like that
16:14mehrheitMath/pow works on doubles
16:14mehrheitsomething more generic would be better
16:15Hunthat'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:16Chousermehrheit: BigInteger has a .pow: (.pow 2M 10)
16:16ChouserBigDecimal, sorry
16:18mehrheitChouser: yes, that will do
16:19mehrheitHun: but don't *, +, etc. already work on all numeric types and automatically promote big results to BitIntegers or similar?
16:20Hunthey 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:20ChouserWodin: 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:20ChouserWodin: I don't understand the purpose of that logic.
16:22lisppaste8Wodin annotated #70670 with "Exception with r1110" at http://paste.lisp.org/display/70670#1
16:23WodinChouser: OK thanks.
16:23ChouserWodin: There may be a (very ugly) workaround though. hang on...
16:25Chouser(. dcm getString 0x00100010) is supposed to return a string?
16:26gnuvinceDid anyone have time to review my draft?
16:26Chousermight it sometimes return nil?
16:27WodinChouser: 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:27djpowellanyone figured out the new aot gen-class yet? - looks interesting
16:28WodinChouser: 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:28askentaskencan i use cond and let together?
16:29lisppaste8Chouser annotated #70670 with "ugly workaround" at http://paste.lisp.org/display/70670#2
16:30askentaskenim 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:30ChouserWodin: but even if that works for you, take it up with rhickey_ either here or on the google group.
16:30WodinChouser: Don't understand it, but I agree it looks ugly :)
16:30Chousukewho has commit access to clojure-contrib? I think it's pretty ugly that the numbers.clj bigdec test throws an exception.
16:30ChouserI don't know what the logic should be for finding the right method, but clearly it's not right.
16:31ChouserWodin: the first line uses reflection to dig out a Method named "getString" that takes an int
16:31rottcodddrewc: fwiw, I don't like the derivative names either, preferring something like project.clojure.org or clojure.net
16:31ChouserWodin: the second line builds up the argument array and invokes the Method.
16:32WodinChouser: OK, I see. Thanks.
16:32Chouseryou ought to be able to bundle all that in your print-tag fn and encapsulate the ugliness
16:32drewcrottcodd: i registered 'projecture.net' yesterday, as it seemed to be the most agreeable. I could still be swayed by a compelling argument though :)
16:33WodinChouser: 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:34Chouserright, 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:35ChouserWodin: your bug writeup is pretty good. you might include a link to the javadoc for the getString method you're trying to call.
16:35ChouserWodin: then just whine about it until Rich fixes it. :-)
16:36rottcodddrewc: no arguments here, thanks for providing the service
16:36WodinChouser: Thanks. Bed time now, though. I'll send a bug report to the Google group tomorrow.
16:36ChouserWodin: the program's not terrible at all.
16:36ChouserWodin: ok, good night.
16:37WodinThanks for the help.
16:39duck1123_drewc: projecture was the best out of the names offered
16:48blarf(cond (let [mov (do-stuff)] mov... is that legal?
16:49ChousukeI don't see why not.
16:50ChousukeThough I can't think of a reason to do that.
16:53lisppaste8asken pasted "tictactoeAI" at http://paste.lisp.org/display/70677
16:53blarfChousuke ^^
16:53blarfjava.lang.IllegalArgumentException: Key must be integer
16:54Chouserah, you want a sort of cond-let
16:54blarfyes
16:55Chousukeblarf: oh, like that.
16:55Chouserclojure.contrib.cond has cond-let
16:55blarfit compiles fine
16:55blarfbut i get a runtimeerror as shown above, first version works, second is the problem
16:57Chousukein that case your "cond" test actually ends up being (assoc brd mov 3)
16:57Chouserblarf: cond still requires separate 'test' and 'expr' -- putting them both into a single 'let' won't work.
16:59Chousukeyour code nests pretty deep
17:00Chousuketo me that usually is a sign that you should be looking for an alternate way to express what you want :)
17:00blarfyes, so how would you do?
17:01gnuvince_hi
17:04nsinghal;destucturing bind question
17:04nsinghal(def *defaults* {:a 1 :b 2})
17:04nsinghal(def args {:a 3})
17:04nsinghal(let [{:keys [a b]} (merge *defaults* args)] [a b]) >>> [3 2]
17:04nsinghal(defn test-fn [{:keys [a b] :or *defaults*}] [a b])
17:04nsinghal(test-fn args) >>> [3 nil]
17:04nsinghalHow can i write a function where i can define the default values in a map?
17:04gnuvince_Chouser: can I borrow you for a few minutes?
17:04Chousergnuvince_: you can try. :-)
17:06Chousernsinghal: to use a var like that in a destructuring form probably requires a macro
17:06Chousernsinghal: normally none of the pieces in a fn arg list are eval'ed
17:07gnuvince_Chouser: I wrote the second part of my comic fetcher tutorial. Can I interest you in reviewing language and code?
17:07kotarakthen a macro doesn't help. The macro has no access to the value of a Var.
17:08Chouserkotarak: oh, I guess you're right, at least without doing the resolve stuff manually as rhickey discourages.
17:09kotarakright
17:09Chousergnuvince_: perhaps later this evening.
17:09nsinghalthanks for answering - that make sense
17:10gnuvince_Chouser: sure. I'm in no hurry to post, but I like to make sure that what I post is accurate.
17:11lisppaste8chousuke annotated #70677 with "simplified (untested)" at http://paste.lisp.org/display/70677#1
17:11Chousukeblarf: ^^
17:12Chousukeactually, I wonder if the recur works
17:12ChousukeI'm not sure about multimethods
17:14ChouserChousuke: that is interesting. I'd guess it recurs without going through dispatch again.
17:14Chousukeactually the (and mov is not needed either, since that's guaranteed to be non-nil
17:15Chouseryep, that's what it does.
17:16Chousukethe boolean operators are nice in that they return the actual value of the test instead of a boring boolean :)
17:18Chousukeso 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:27blarfChou: thanks, nice. but lets say all those functions are expensive, does it evaluate them lazily or does it execute them all?
17:28Chousukeor returns the first thing that returns non-false
17:28blarfyes but will the functions be executed even if the first is true?
17:28Chousukeno
17:28blarfor that what u meant? it quites a ssoon as something is true?
17:28Chousukeyes.
17:29Chousuketry it yourself: (or nil 1 (println "oops"))
17:31Chousukealso (and (println "hello") (println "not-seen")) :) (println returns nil)
17:36blarfhow do i get integer-division?
17:36gnuvince_quot
17:37gnuvince_(quote 4 3) => 1
17:37gnuvince_err
17:37gnuvince_(quot 4 3)
17:37gnuvince_sorry
17:40Chousukehm
17:41Chousukewas there a function that takes a function and returns a lazy seq of ((f), (f), (f)...) ?
17:42kotarakmaybe something like repeatedly?
17:42Chousukeah, exactly that
17:42ChousukeI only tried repeat
17:46blarfbut 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:46blarfanyway it works
17:47ChousukeI'm assuming find-move only returns valid moves.
17:47Chousukeotherwise, that can end up in an infinite loop
17:49Chousukeif the first find-move doesn't find a valid move, it should return nil, in which case the second find-move is run
17:49Chousukeand if that doens't find a move, then one is generated
17:50Chousukeif the generation returns nil, your app should be crashing anyway :P
17:50Chousukeyou could optimise it somewhat by looping the generation and valid-move? but simplicity first :)
18:00blarfthe minlambda s using # only have one var right?
18:03Chousukeblarf: no. #(+ %1 %2) :)
18:03Chousukeblarf: you can't mix using just % and %n notation though.
18:06johnwaynerDon't suppose anyone here uses Vista with GitHub?
18:06johnwaynerI've got a fix for swank-clojure but can't get git to clone my fork
18:07johnwaynerdue to key file permission problems
18:09MarkVolkmannIf I use (import '(java.util Date)) then I can create a Date object with (new Date) or (Date.).
18:09MarkVolkmannCan I create a Date object without doing an import by providing the full class name?
18:10johnwayneruser> (java.util.Date.)
18:10johnwayner#<Date Tue Nov 18 17:09:08 CST 2008>
18:10johnwaynerseems like it
18:14gnuvince_kotarak: (import '(java.util Date))
18:14kotarakI know, but (use 'foo.bar.baz), (require 'foo.bar.baz), but (import '(foo.bar Baz))
18:15gnuvince_kotarak: that would make importing more than one thing from a package longer
18:15gnuvince_(import '(java.io BufferedReader InputStreamReader))
18:15gnuvince_vs (import 'java.io.BufferedReader 'java.io.InputStreamReader)
18:16kotarakgnuvince_: ??? (require '(foo.bar baz frob)) (import '(foo.bar Baz Frob))
18:16kotarakimport does not allow both forms, require and use do. Inconsistent.
18:20StartsWithKwhat is happening here, and why does this code work? http://pastebin.com/m18d128e2
18:21albinoare use, require, and import effectively doing the same thing?
18:21albinowhy isn't there only one way to do that?
18:21cooldude127does use actually work with java classes?
18:21cooldude127isn't import the only one that does that?
18:22kotarakalbino: require just loads a library, use "require"s a library and refers it in the namespace, import makes Java classes available.
18:22cooldude127there we go
18:23kotarak(require 'foo) => (foo/bar), (use 'foo) => (bar), (new foo.Bar) (import '(foo Bar)) => (new Bar)
18:24cooldude127kotarak: we need that in some docs somewhere
18:24kotarak(doc require), IIRC
18:24cooldude127oh
18:24albinohmm
18:25albinokotarak: thanks for the description
18:25kotaraknp
18:28ChousukeStartsWithK: you're defining x a function that returns a function
18:29cooldude127#() creates one function
18:29cooldude127then the fn form creates another
18:29Chousukethe curious thing is using % as the parameter
18:29StartsWithKyes
18:29ChousukeI guess it's not captured by the #()
18:29Chousukebut the fn instead
18:30StartsWithKisn't that (fn [1] 1)
18:30StartsWithKand that should fail, but even so, why when called it return (inc 2) not (inc 1)
18:30cooldude127(def x (fn* [p1__1111] (fn [p1__1111] (inc p1__1111))))
18:30cooldude127is the macroexpansion
18:31Chousukelooks like the inner binding hides the outer one.
18:32StartsWithKso 1 is ignored and replaced with replaced with (gensym)?
18:32cooldude127evidently
18:34Chousukethe 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:36hiredmanhttp://www.thelastcitadel.com/clojure/arithmetic-mean <-- arithmatic mean using reduce
18:38StartsWithKcooldude127, Chousuke thanks for explaining this, looked realy strange
18:41cooldude127no problem
18:41cooldude127if you have trouble with stuff like that again, this is what i did in the repl
18:41cooldude127(macroexpand '(def x #(fn [%] (inc %))))
18:41cooldude127that'll show you what's going on
20:00cwyangThere are two basic styles of implementing such a construct: http://paste.lisp.org/display/70665
20:01Chousukehm?
20:07cooldude127cwyang: what's this?
20:16MarkVolkmannHow can I take a string like "one two" and get a collection containing the strings "one" and "two"?
20:17Chouser(.split "one two" " ")
20:17MarkVolkmannThis is close. (split-with (fn [x] (not= x \space)) "one two")
20:17cooldude127i like chouser's :)
20:17MarkVolkmannDefinitely! Thanks
20:17cooldude127uses the java string api
20:19MarkVolkmannHow can I take a list of strings and get a single string that concatenates all the strings together with a space between each?
20:19MarkVolkmannI thought (str list) would do it, but no.
20:19gnuvince_Chouser: can I send you that link?
20:20Chousergnuvince_: yes
20:20hiredmanMarkVolkmann: maybe interpose
20:20hiredmanthen str
20:20gnuvince_Chouser: here or email?
20:20Chouserhiredman: thanks, I can never think of the word interpose
20:20Chouser(apply str (interpose " " ["one" "two" "three"]))
20:20ChouserThere's also clojure.contrib.str-utils that has some of these
20:21Chousergnuvince_: email I guess, and I'll reply with comments.
20:22gnuvince_Chouser: sent.
20:22gnuvince_Thanks
20:53MarkVolkmannI'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:53vagifHello, anyone using compojure web framework ?
20:54Chouserif you say (require '[clojure.contrib.str-utils :as util]), then you can say (util/str-join ...)
20:54Chouseror (require '[clojure.contrib.str-utils :only (str-join)]), and (str-join ...)
20:56vagifcompojure comes with jetty, but i want to integrate it into my existing application which is on tomcat.
20:56vagifanyone done that ?
20:56ChouserMarkVolkmann: sorry, that's (use '[clojure.contrib.str-utils :only (str-join)])
20:57Chouservagif: I haven't, sorry. I haven't used compojure yet, but I think that question has come up
20:58Chouservagif: did you search the clojure and compojure google groups?
20:58vagifyes i searched both groups
20:58Chouserok, well I guess your best bet would be to ask there.
21:18blbrownpjb3: did you just twitter me
21:18pjb3blbrown: I did
21:18blbrownhehe
21:19pjb3You said you bought the Clojure book, that means you are worth following :)
21:19blbrownI got the beta PDF, apparently, there are a lot of sections missing
21:32canderaStu should have Beta 2 of the book out before too long
21:32canderaPresumably you'll get an updated copy when he does - no idea how that works.
21:32canderaAlthough I suspect that even Beta 2 will still not have every chapter completed.
21:33blbrownthe first part is all I need anyway. I got a good first 100 pages or so.
21:37gnuvince_hmmm
21:37gnuvince_Steve Yegge mentioned Clojure in his latest blog post.
21:37gnuvince_Do you think that's good or bad?
21:37Chouserhow could it be bad?
21:38albinowas he comparint it to NBL?
21:38albinos/comparint/comparing
21:38gnuvince_albino: no, he just mentioned it in passing in his Ejacs post
21:38cooldude127yeah i saw that
21:38cooldude127i think what he said was mildly positive
21:38hiredmanit's about time he mentioned it, it seems like it should be right up his alley, dynamic and on the jvm
21:38cooldude127he's still in love with javascript tho
21:39hiredmanyeah, well, ok
21:39pjb3It's funny about Steve Yegge, I actually first heard about Clojure from people commenting on his blog
21:40cooldude127hehe
21:40pjb3Might have been the NBL post, I just remember a lot of comments about Scala and Clojure
21:40pjb3I hadn't heard of either of those languages until then
21:40ChouserBut Yegge doesn't actually like JavaScript. He likes what he's planning on turning JavaScript into.
21:40cooldude127what is he turning it into?
21:41gnuvince_NBL
21:41cooldude127that's a tad abstract
21:41ChouserBecause 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:41gnuvince_I think he really liked EcmaScript 4 before it was gutted
21:41cooldude127oh
21:42gnuvince_Rhino was not fun
21:42cooldude127lol
21:43gnuvince_With Clojure, I've had nothing but fun :)
21:43hiredmanmmmmm
21:43albinowell from reading his blog posts it was JS2 he liked
21:44gnuvince_albino: JS2 is EcmaScript 4
21:44albinognuvince_: as the different browser vendors see it or what?
21:46johnwaynerI forked Jochu's swank-clojure and patched it to work with SVN 1110:
21:46johnwaynerhttp://github.com/johnwayner/swank-clojure/tree/master
21:47johnwaynerI had to hack on it a bit, so hopefully it works.
21:47cooldude127johnwayner: what has changed in 1110 from, say, 1107?
21:48cooldude127cuz i have SVN1107 and swank-clojure working together
21:48johnwaynerThe removal of gen-and-load*
21:48cooldude127shittttt
21:48cooldude127that sounds important ;)
21:48johnwaynermoved into (ns (:gen-class
21:48cooldude127oh
21:48johnwaynerso yeah, "removal" not the right word I guess :)
21:48cooldude127FAT ASS API CHANGE
21:48cooldude127is more like it ;)
21:49johnwaynerThis is a crazy time.... should be pretty much smooth sailing soon.
21:49cooldude127hopefully
21:50ChouserI hope doto gets broken soon too.
21:50cooldude127in what way?
21:50mattreplhmm, is there a write-up on what replaces gen-and-load-class post-AOT compilation?
21:51cooldude127mattrepl: apparently it's part of namespaces now?
21:51johnwaynermattrepl: this: http://paste.lisp.org/display/70665
21:51johnwaynermattrepl: and the irc log from earlier today
21:51hiredmancrazy
21:51mattreplthanks
21:52hiredmandefn- -main
21:52hiredmanweird looking
21:52cooldude127yeah wtf?
21:52Chouserwhy would you make main private?
21:53cooldude127i'm not totally sure i'm on board with this
21:53Chousercooldude127: http://groups.google.com/group/clojure/browse_thread/thread/d668c590c6cf982b
21:53cooldude127Chouser: k i remember that thread
21:54johnwaynerChouser: perhaps it's private in the namespace but not the class? Dunno
21:54johnwaynerI don't presume to know better than rhickey :)
21:55Chouseroh, yeah, I didn't notice that in his code. weird.
21:55cooldude127yeah this code needs mucho examination
21:56johnwaynerAny elispers know how to avoid this nasty change? http://github.com/johnwayner/swank-clojure/commit/8f567775360425475df494520083f9023ffe1af1
22:00mattrepljohnwayner: did you already fix the defexception macro in swank-clojure?
22:00johnwaynermattrepl: I removed it
22:01johnwaynermattrepl: I just added the one class that was being created as a .clj file and compiled it in swank-clojure.el
22:02johnwaynermattrepl: This is probably just a hack to get it working. It doesn't really seem correct.
22:02mattreplthat's such a hassle just to give a typed exception
22:02mattrepl*nod* and I meant the new namespaces -> classes, not your change
22:03johnwayneryeah, I have a feeling we are quite done with changes in the area :)
22:03johnwaynerare *not*
22:06mattreplthanks for making it work, now I can get back to thesis writing. =)
22:06johnwaynernp. :)
22:14dmshello..anybody know how to set up slime file name translations for connecting with a remote swank server? (or is it even possible currently?)
22:16drewcdms: see segv's annotation here : http://paste.lisp.org/display/32153
22:16johnwaynerdms: You want to edit the remote files via Tramp?
22:19dmsjohnwayner: 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:19dmsdrewc: thanks. I will try it out.
22:20drewcdms i have made it work in CL, and it's all on the elisp side AFAIK, so it should just-work.
22:32dmshmm.. 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:34johnwaynerdms: maybe you can trick slime by putting an entry in you /etc/hosts that points to localhost
22:36dmsgood idea. will try.
22:40wwmorganI 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:40johnwaynerwwmorgan: did you clean?
22:40wwmorganpossibly nvm. Turns out I wasn't at head
22:41wwmorganand everything works. Crisis averted!