2009-09-08
| 00:09 | duck1123 | Is there any way to make stack traces give out a little more context as to what namespace a file is in? I deal with 3 files for any given name |
| 00:10 | duck1123 | I could always add -controller and -view, etc. but I'd rather not have to deal with that all the time |
| 00:10 | duck1123 | appname.controller.user-controller (or some variant) seems redundant |
| 00:31 | technomancy | duck1123: with slime you can just press v with the point over the stack trace frame to jump to that function |
| 02:53 | tomoj | whaaat aquamacs is unsupported? |
| 02:54 | tomoj | oh, that doesn't mean it doesn't wor |
| 03:10 | somnium | what is the idiomatic way to call (fn [x y z] {x (y+z)}) with (seq 1 2 3))? |
| 03:12 | cark | (apply your-func your-seq) |
| 03:12 | cark | that's if i understood your question |
| 03:13 | somnium | that did it, thanks |
| 03:13 | cark | =) |
| 03:13 | somnium | didn't realize apply used the arity of the function you call it with |
| 03:14 | cark | it doesn't |
| 03:14 | cark | apply does not know anything about arity |
| 03:14 | somnium | ? then how does it pass the right number of args? |
| 03:14 | cark | mhh that's implementation details i'm not comfortable going into |
| 03:15 | somnium | ok... well it seems to use arity :) I don't really care it does what I wanted |
| 03:15 | cark | hehe right =) |
| 03:41 | jamesp__ | Hi, I'm sure I'm missing something obvious here, but how do I expand a list into the arguments for a function? |
| 03:41 | hiredman | ,(doc apply) |
| 03:41 | clojurebot | "([f args* argseq]); Applies fn f to the argument list formed by prepending args to argseq." |
| 03:44 | jamesp__ | Perfect. Thanks hiredman, one step closer! Cheers |
| 03:50 | Fossi | eh. seems like it apply day today |
| 04:20 | somnium | are there any good resources on becoming *really* productive with slime/emacs clojure? I've gotten comfortable enough but always this feeling I'm using 5% of the features |
| 04:34 | Chousuke | somnium: heh, I have the same problem :P |
| 04:34 | Chousuke | that 5% is probably enough for now. |
| 04:34 | Chousuke | somnium: are you already using paredit.el? :) |
| 04:34 | somnium | yeah |
| 04:34 | somnium | though sometimes it irritates me |
| 04:35 | somnium | have a hard time deleting parentheses, I'm sure theres some shortcut but I havent found it on the cheat sheet yet |
| 04:35 | somnium | end up using cut and paste |
| 04:35 | somnium | ctrl + arrow keys is very handy at times though |
| 04:36 | Chousuke | you should never need to delete individual parentheses :/ |
| 04:36 | somnium | pairs of them |
| 04:36 | Chousuke | just backspace? :) |
| 04:36 | somnium | it refuses unless they're empty |
| 04:37 | Chousuke | sometimes I end up with a mismatched paren but C-q ( or ) to match it again and then deleting it works fine. |
| 04:37 | Chousuke | somnium: oh, of course. |
| 04:37 | Chousuke | somnium: use C-k to kill the entire sexp |
| 04:37 | somnium | ah, maybe that's what I've been missing |
| 04:38 | somnium | perhaps it will feel like 6% now ;) |
| 04:39 | somnium | I have the cheatsheet but nothing seems to stick, maybe I'll paste it to the wall |
| 04:39 | Chousuke | paredit has more features than that of course but I'm doing well with just C-k, paren matching and barf/slurp |
| 04:40 | Chousuke | somnium: to make it stick I guess you need to spend some time *forcing* yourself to use the more complicated functionality, even if it feels slower than the simple way. |
| 04:40 | Chousuke | once your hand learns the motions it should become a lot faster :) |
| 04:41 | somnium | yes, I only just remapped ctrl to caps-lock |
| 04:41 | Chousuke | heh |
| 04:42 | somnium | Id like to try switching to vim for a slightly simpler life, but I can't get vimclojure to work |
| 04:42 | Chousuke | you can try viper.el in emacs :P |
| 04:42 | Chousuke | I actually mapped meta to capslock and ctrl to the cmd keys |
| 04:42 | Chousuke | having two controls helps |
| 04:43 | Chousuke | and they're easy to press with the thumbs |
| 04:44 | somnium | hmm, I tried viper but I just stay in insert mode and use emacs commands out of laziness(?) |
| 04:44 | somnium | and I don't know how to configure (haven't bothered to see how yet)... configuring .vimrc compared to configuring .emacs is... night and day |
| 04:49 | Fossi | i guess everybody has that 5% margin left to go |
| 04:50 | Fossi | that's why emacs rocks so much |
| 04:50 | Fossi | oh, i misread |
| 04:51 | somnium | it would be nice if it was possible to use clojure instead of elisp |
| 04:51 | Fossi | well, that's just an emacs rewrite away ;) |
| 04:51 | somnium | ! |
| 04:51 | somnium | clojure-emacs-script |
| 04:52 | somnium | elisp-generator, how hard can it be to translate a lisp to another lisp? |
| 04:56 | Chousuke | well, Clojure has lexical scoping and immutable data structures |
| 04:56 | Chousuke | elisp has dynamic scoping and very mutable data structures :P |
| 04:58 | somnium | true... pure code-generation might not be so bad, but that would require intimately learning elisp, and by the time I did that I suspect I wouldn't want to write the program anymore |
| 04:58 | somnium | like removing parentheses from lisp or something |
| 05:00 | Chousuke | the human brain is good enough at removing the parentheses when needed :) |
| 05:01 | somnium | I find indenting my expressions so I can read them again at a glance is far more challenging than parsing parentheses |
| 05:07 | Fossi | is there something like yasnippets for clojure? a more useful slime-complete-form? |
| 05:10 | somnium | you could use yas if you write your own snippets couldn't you? |
| 05:11 | somnium | is there a standard way to combine two seqs, like (foo bar) and (nil nil nil nil) to get (foo bar nil nil) ? |
| 05:16 | somnium | I guess (take (count b) (cons a b)) isnt so bad |
| 05:19 | Fossi | sure i could, but maybe there's something useful already |
| 05:20 | somnium | macros = snippets++ ;) |
| 05:21 | somnium | (= macros (inc snippets)) #=> true |
| 05:25 | Chousuke | (defn dropcat [a b] (lazy-seq (if (seq a) (cons (first a) (dropcat (rest a) (rest b))) b))) |
| 05:28 | somnium | I wish there were more examples in some of the doc-strings |
| 05:29 | liwp | somnium: and cross references to other related fns |
| 05:29 | Chousuke | cross-refs would be more useful as separate metadata |
| 05:29 | liwp | sure |
| 05:33 | somnium | hmm, maybe a doc-string browser like gem-server would do the trick |
| 05:34 | somnium | still would need the metadata... |
| 05:34 | liwp | I guess ideally the examples would be separate metadata as well |
| 05:35 | liwp | i.e. the doc string would be multiple entries that then get compiled together when you call (doc) or for online documentation |
| 05:36 | somnium | it would be nice to have a little swing app that has a cross-referenced db of core and contrib with hyperlinks to relations |
| 05:36 | somnium | and related javadocs |
| 05:37 | somnium | ,(doc lazy-seq) |
| 05:37 | clojurebot | "([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls." |
| 05:37 | somnium | where to get doc for Iseq and Seqable? |
| 05:41 | tomoj | somnium: you could build it yourself with javadoc |
| 05:41 | tomoj | but for ISeq you might as well just look at the source |
| 05:41 | tomoj | not much there |
| 05:41 | Chousuke | There's no javadoc for the interfaces yet I think :/ |
| 05:42 | Chousuke | which is a shame. |
| 05:42 | tomoj | similarly for Seqable |
| 05:42 | tomoj | Seqable is just one method, seq(), which returns an ISeq |
| 05:42 | tomoj | ISeqs can do cons(Object), first(), more(), next() |
| 05:43 | tomoj | I guess more==rest? |
| 05:43 | tomoj | ~def rest |
| 05:43 | tomoj | yup |
| 05:44 | Fossi | somnium: well, for defn it would make sense to have a snippet |
| 05:44 | Fossi | and i guess there are other |
| 05:45 | tomoj | I guess Reversible is a contract for constant-time rseq like Counted is a contract for constant-time count? |
| 06:02 | Fossi | somnium: i'd also like a thing that's like eldoc, but with a template |
| 06:07 | cschreiner | nested #() are not allowed, how to solve? |
| 06:07 | hiredman | use fn |
| 06:07 | cschreiner | ok |
| 06:07 | cschreiner | so it's a reader-problem |
| 06:08 | hiredman | nesting #() would be a pain anyway |
| 06:08 | Chousuke | it's not that difficult to implement |
| 06:08 | hiredman | argument names all are the same |
| 06:09 | Chousuke | it just would be confusing :/ |
| 06:09 | hiredman | clojurebot: #()? |
| 06:09 | clojurebot | #() is not a replacement for fn |
| 06:09 | hiredman | clojurebot: function literals? |
| 06:09 | clojurebot | Function literals are cute, but overused |
| 06:09 | cschreiner | yes, I see the point with % in nested #() |
| 06:11 | cschreiner | I fucking love the expressivity of clojure, is it ok to say that? |
| 06:11 | liwp | can one use #() in macros? |
| 06:11 | hiredman | liwp: best not |
| 06:12 | Chousuke | ,`(do #(foo %)) |
| 06:12 | clojurebot | (do (fn* [sandbox/p1__4222] (sandbox/foo sandbox/p1__4222))) |
| 06:12 | liwp | yeah I've avoided them so far |
| 06:12 | Chousuke | that would fail I think :/ |
| 06:13 | Chousuke | yep: Can't use qualified name as parameter: user/p1__2363 |
| 06:14 | liwp | indeed |
| 06:14 | Chousuke | though you can use #() in macros as long as it's not part of the generated code. |
| 06:14 | somnium | Chousuke: thanks for that dropcat fn, its proving very handy |
| 06:15 | cschreiner | Chousuke: yep, thanks for the input |
| 06:15 | cschreiner | kitos, or whatever you say |
| 06:15 | liwp | Chousuke: yeah that's right, but I was specifically interested in the generated code case which wasn't working for me IIRC |
| 06:15 | Chousuke | cschreiner: two i's |
| 06:15 | cschreiner | :-) |
| 06:16 | Chousuke | liwp: best just use fn in those cases. |
| 06:16 | liwp | so it would seem :) |
| 06:16 | Chousuke | ,`(fn [x#] (inc x#)) |
| 06:16 | clojurebot | (clojure.core/fn [x__4226__auto__] (clojure.core/inc x__4226__auto__)) |
| 06:18 | liwp | so the difference here is that #() generates a qualified name as a param? |
| 06:18 | liwp | ,`(do #(inc %)) |
| 06:18 | clojurebot | (do (fn* [sandbox/p1__4230] (clojure.core/inc sandbox/p1__4230))) |
| 06:18 | Chousuke | liwp: the difference is that it expands at read time so ` qualifies the symbols. |
| 06:18 | liwp | ahh yes |
| 06:18 | Chousuke | ,'#(foo bar) |
| 06:18 | clojurebot | (fn* [] (foo bar)) |
| 06:18 | Chousuke | ,'#(foo bar %) |
| 06:18 | clojurebot | (fn* [p1__4237] (foo bar p1__4237)) |
| 06:18 | Chousuke | ,`(fn* [p1__4237] (foo bar p1__4237)) |
| 06:18 | clojurebot | (fn* [sandbox/p1__4237] (sandbox/foo sandbox/bar sandbox/p1__4237)) |
| 06:19 | liwp | cool, thanks |
| 06:20 | Chousuke | wonder if I should submit my syntax-quote macro for inclusion in Clojure already :/ |
| 06:22 | Chousuke | my reader is not yet ready but syntax-quote only needs a couple tweaks and it should be fine. |
| 06:23 | liwp | Chousuke: what is this reader work that you've been doing? Why are you writing your own reader? |
| 06:24 | Chousuke | liwp: well, I thought it might be a fun project, and if it turns out good enough it could replace the current reader (which is written in java) |
| 06:24 | somnium | any chance of sneaking in reader-macros? |
| 06:25 | Chousuke | not until rhickey approves of them :P |
| 06:25 | liwp | which does not seem likely ATM |
| 06:25 | Chousuke | my current reader code makes only a few direct calls to java so it could be usable from ClojureCLR and other ports too. that would be a bonus |
| 06:26 | Chousuke | though all this is just talk. I still have a lot of work to do until the reader is really usable |
| 06:26 | somnium | any talk of making a ClojureC by anyone? |
| 06:26 | Chousuke | it's mostly feature-complete already but I haven't even looked at what it would take to make Clojure actually use it. :P |
| 06:27 | liwp | Chousuke: that does sound like a nice little project. For some reason I didn't realise that the current reader was writtne in Java althought have seen LispReader.java in the source tree... |
| 06:30 | Chousuke | if you want to see what I have currently just browse http://github.com/Chousuke/clojure/tree/clojure-reader (it's src/clj/clojure/lang/reader.clj, and syntax-quote is in core.clj) |
| 06:32 | Chousuke | it should have no major omissions anymore so feel free to test. I might have forgotten something though. :P |
| 06:32 | Chousuke | but now I must hurry away |
| 06:32 | liwp | I'll have a look... |
| 06:43 | cemerick | somnium: you mean a C compile target? |
| 06:45 | somnium | yeah, a pure C implementation, seems unlikely I guess |
| 06:45 | cemerick | I think targeting chicken scheme, which emits C, is more likely |
| 06:49 | LauJensen | Good afternoon gents |
| 07:09 | cemerick | speaking of, I don't think I've ever seen a woman's name in the channel or on the group :-/ |
| 07:15 | cemerick | just how evil would it be to use an atom to control the termination of a for comprehension? Any less evil if I'm immediately consuming the comprehension? |
| 07:16 | cemerick | I've got a bit of a nasty nested loop, and I'm toying with reimplementing it using something like (last (for ...)) |
| 07:16 | clojurebot | 0 |
| 07:16 | Fossi | 0? |
| 07:18 | Fossi | out of curiosity: how do you format a number, if you don't know whether it might be a BigDecimal? |
| 07:28 | konr|afk | Is there a template system, like php's smarty or python's tenjin, for clojure? |
| 07:28 | durka42 | there are a few |
| 07:28 | durka42 | enlive is one |
| 07:29 | konr|afk | hmm, any idea which is the fastest? |
| 07:29 | durka42 | i do not know |
| 07:31 | cemerick | isn't templating the least of one's concerns, vs DB access, bandwidth/latency, etc? (when templating for a web environment, anyway) |
| 07:32 | konr|afk | I think you are right... |
| 07:32 | konr|afk | the bottleneck of my application is the DB access |
| 07:33 | konr|afk | I think - at least mysql is the most cpu-consuming app when the server gets laggy |
| 07:35 | cemerick | optimize thine queries :-) |
| 07:49 | LauJensen | cemerick: it would be very evil |
| 07:49 | cemerick | LauJensen: yeah, I know :-) |
| 07:50 | cemerick | I'm working on unifying the loop |
| 07:50 | LauJensen | good - if you fail I'll have to ban you from the group |
| 07:56 | LauJensen | Guys, have you seen 'rising links' on DZone this morning? :) |
| 07:59 | ambient | the page doesn't work for me, so paste a link |
| 08:00 | LauJensen | www.dzone.com |
| 08:00 | ambient | javascript:void(null) |
| 08:00 | ambient | i mean the rising links tab |
| 08:00 | LauJensen | oh. |
| 08:00 | LauJensen | the only way to see it is to have that js evaled, that'll give you a new tab |
| 08:00 | LauJensen | but the point was that my 'java vs clojure' post was on top |
| 08:02 | ambient | cool ;) |
| 08:03 | ambient | hmm, i wonder if i can add a macro to vimperator that adds sites to whitelist in adblock+ |
| 08:26 | LauJensen | It happend, Java vs Clojure is #2 on the frontpage of DZone :D |
| 08:27 | ambient | grats |
| 08:27 | LauJensen | Thanks :) |
| 08:53 | gerryxiao | hello |
| 08:53 | gerryxiao | what's chunks? |
| 08:54 | gerryxiao | how to make (range 0 1000) to trunks? |
| 08:58 | Chouser | ,(chunked-seq? (seq (range 0 1000))) |
| 08:58 | clojurebot | true |
| 09:01 | Chouser | gerryxiao: does that help? |
| 09:04 | gerryxiao | i want to know why use chunk,and how |
| 09:05 | Chouser | chunked seqs are an implementation detail -- you're meant to be able to ignore them. |
| 09:05 | gerryxiao | oh |
| 09:05 | Chouser | many builtins now produce chunked seqs when you call 'seq' on them, like range and vectors |
| 09:05 | gerryxiao | but it seems master branch not support it yet? |
| 09:06 | Chouser | I think it does. Did you try that snippet I showed above? |
| 09:06 | gerryxiao | why still have one chunks branch? |
| 09:07 | Chouser | just hasn't been deleted yet, I guess. Looks like all its patches are in master. |
| 09:08 | gerryxiao | it works under master |
| 09:09 | Chouser | If the chunked seq API is documented anywhere, I can't find it. For now I guess you'd have to read the code. |
| 09:10 | Chouser | ...if you want more details. |
| 09:10 | gerryxiao | how to make ant create a new dir to build another branch for clojure? |
| 09:10 | gerryxiao | ok |
| 09:10 | gerryxiao | yes, i can't find any docs about it |
| 09:11 | Chouser | I dunno. If I want different builds of clojure, I usually just check out a whole new local repo. |
| 09:11 | Chouser | maybe there's a better way I don't know about. |
| 09:11 | gerryxiao | it should work, but i have to change clj script |
| 09:12 | Chouser | yeah, the clj script I use allows aliases, so I can run clj or clj-1.0 |
| 09:12 | Chouser | but it's a bit of a pain to set up, so I haven't published it anywhere. |
| 09:13 | gerryxiao | that's problem of git? |
| 09:13 | Chouser | hm, dunno. |
| 09:13 | gerryxiao | when will 1.1 be released? |
| 09:15 | Chouser | there's no firm date. I think once the reify a.k.a. "new new" is finished, you can expect a 1.1 release. |
| 09:16 | gerryxiao | i have only one clojure git local copy, if i want another builds, just check it out and rebuilt it with ant |
| 09:17 | Chouser | sure. if you want to keep both, the only way I know is to git clone a new local copy |
| 09:26 | gerryxiao | i use Math/round in clojure, but complier complain it can't be resolved |
| 09:28 | Chouser | can take float or double, so tell it which, such as (Math/round (double x)) |
| 09:28 | ambient | try (Math/round (double 5.6)) |
| 09:29 | ambient | hmm, does this work |
| 09:29 | ambient | ,(Math/round (double 5.6)) |
| 09:29 | clojurebot | 6 |
| 09:29 | gerryxiao | i used (Math/round ( * 3 (float 4))) |
| 09:30 | Chouser | ambient: sure. But with a literal like that it's not needed. |
| 09:30 | gerryxiao | so i have to :(Math/round (float (* 3 (float 4))))? |
| 09:30 | Chouser | ambient: Clojure reads 5.6 as a Double, so it knows to generate a call with a double arg. |
| 09:31 | ambient | k |
| 09:31 | Chouser | gerryxiao: you don't actually have literals there, do you? But this will work: (Math/round (double (* 3 4.0))) |
| 09:32 | gerryxiao | Chouser: that's just one example, my code is like that |
| 09:32 | gerryxiao | i think clojure should figure it out |
| 09:33 | Chouser | gerryxiao: it does. You only need those casts if you're trying to avoid runtime reflection. |
| 09:33 | Chouser | those compiler complaints are only warnings -- it'll run fine. |
| 09:33 | gerryxiao | ok |
| 09:35 | gerryxiao | clojure need one good way for type hints |
| 09:35 | Chouser | and in real code even if you want to avoid reflection you can usually put a few hints or casts on some args or locals and be done, rather that repeating them in the body of the code. |
| 09:36 | Fossi | namespace whoes |
| 09:36 | ambient | i don't really completely get clojure namespaces either |
| 09:37 | Fossi | i thought my files are getting a little big, so i tried to refer some things |
| 09:37 | gerryxiao | sometimes, i have to repeat type hints |
| 09:37 | Fossi | but apparently i don't get ut either :) |
| 09:38 | Chouser | Fossi: 'refer' is hardly ever used anymore. |
| 09:38 | Fossi | Chouser: but 'load' is ugly :( |
| 09:38 | Chouser | Fossi: if you want multiple files for one namespace, use 'load' |
| 09:38 | gerryxiao | it seems hints in let block not work sometimes |
| 09:39 | Chouser | Fossi: if you want multiple namespaces, use 'use' or 'require' |
| 09:39 | Fossi | i want multiple files for one namespace |
| 09:40 | Fossi | for example, load wants to load auto-mail.clj |
| 09:40 | Fossi | but the rest of clojure wants me to name it auto_mail |
| 09:40 | gerryxiao | does newnew fast than proxy? |
| 09:41 | gerryxiao | why in-ns not support :use :import? |
| 09:41 | Fossi | and if i use load, the file compiles, but the symbol don't seem to be "imported" |
| 09:41 | Fossi | ah. i guess i can't use another namespace then in the other file |
| 09:42 | Chouser | gerryxiao: I would be very surprised if hints on 'let' names sometimes fails. got an example? |
| 09:43 | Chouser | Fossi: dashes in file names aren't really supported, because of Java naming rules. I'd try naming the file "auto_mail.clj" and then calling (load "auto_mail") |
| 09:43 | Chouser | gerryxiao: yes, newnew is faster than proxy |
| 09:43 | Fossi | dashes in filenames are all over the place |
| 09:43 | ol3 | (doc circle) |
| 09:43 | clojurebot | Excuse me? |
| 09:43 | ol3 | (doc circel) |
| 09:43 | clojurebot | Titim gan éirí ort. |
| 09:44 | gerryxiao | in my code, in let block [g2d #^Graphics2D g] (doseq [x y] (.drawString g2d ....)) |
| 09:44 | gerryxiao | i got .drawString not resolved |
| 09:44 | Chouser | gerryxiao: try (let [#^Graphics2D g2d g] ...) |
| 09:44 | Fossi | that has nothing to do with the type hint |
| 09:45 | Chouser | gerryxiao: so that you're hinting the name an not the value. |
| 09:45 | Chouser | Fossi: "all over the place"? |
| 09:45 | Fossi | Chouser: well, half of clojure-contrib has them |
| 09:46 | Chouser | Fossi: nope. namespace names, sure, but no dashes in file names |
| 09:46 | gerryxiao | g2d #^Graphics2D g is change g to Graphics2d |
| 09:46 | gerryxiao | type cast |
| 09:46 | gerryxiao | right? |
| 09:46 | liwp | gerryxiao: yes, but g2d is still of type Object |
| 09:47 | liwp | with [#^Graphics2d g2d ...] you've type hinted g2d as of type Graphics2d |
| 09:47 | gerryxiao | so i have type #^Graphics2D twice? |
| 09:47 | Chouser | actually, that's not the problem |
| 09:47 | Chouser | Sorry, I mislead. |
| 09:48 | liwp | gerryxiao: no, just once |
| 09:48 | Chouser | It's more likely the args to .drawString -- there may be multiple methods, so you'd have to hint one or more of the args as well, if you want to avoid reflection. |
| 09:48 | Chouser | again, reflection isn't the end of the world, it's just a runtime performance hit. |
| 09:49 | Fossi | "gerryxiao: i got .drawString not resolved" sounds to me as if you call it with the wrong parameters anyway |
| 09:49 | gerryxiao | Chouser, yes, drawString have many overide methods, and it's in Graphics |
| 09:49 | Fossi | afaik things should work without any cast |
| 09:49 | gerryxiao | that's Graphics2D supper class |
| 09:49 | Fossi | (but a little slower) |
| 09:50 | gerryxiao | Fossi: no, if parameter is wrong, i will get error not warning |
| 09:51 | Fossi | ok, i thought it was an error |
| 09:52 | Fossi | Chouser: sorry, i misread |
| 09:52 | Fossi | but still, it's ugly to have to load "auto_mail" if i would use "auto-mail" |
| 09:52 | gerryxiao | yes, it works without type hints |
| 09:53 | Chouser | Fossi: if you're using 'load', I don't think you'd ever mention 'auto-mail'. |
| 09:53 | ol3 | (doc cycle) |
| 09:53 | clojurebot | "([coll]); Returns a lazy (infinite!) sequence of repetitions of the items in coll." |
| 09:53 | ol3 | clojurebot: thanks |
| 09:53 | clojurebot | Pardon? |
| 09:53 | Fossi | and it's ugly that ns :load etc don't have the same semantics as load etc |
| 09:53 | Fossi | Chouser: can i still define a namespace in the other file? |
| 09:54 | Fossi | or do i have to use require and use directly? |
| 09:54 | Chouser | a new namespace? |
| 09:54 | gerryxiao | i want in-ns support :use :import |
| 09:54 | Fossi | point is, i might want to use some of these files diretly as well |
| 09:54 | Chouser | if the other file defines a new namespace, it should do so using 'ns' and :use/:require. Then your current file can use :use/:require instead of load. |
| 09:55 | gerryxiao | i have to use :use :import only in one file |
| 09:55 | Fossi | i have foo which wants to use 'service' which is a bunch of services |
| 09:55 | gerryxiao | i don't want use (use ) (import) |
| 09:56 | Fossi | so i thought i'd :refer auto-mail and other services into a bigger namespace |
| 09:56 | hchbaw | Fossi: actually, clj/core.clj does (load "core_proxy") and such. |
| 09:56 | Fossi | for a bar, i might refer some other things as 'service' later on |
| 09:56 | gerryxiao | first file main.clj (ns www.dfj.com (:use ..) (:import) ...) |
| 09:57 | Fossi | hchbaw: i didn't say it doesn't work, i just think it's ugly :) |
| 09:57 | hchbaw | Oh, sorry :) |
| 09:57 | gerryxiao | second file helper.clj (in-ns www.defj.com ) (import ...) ) ??? |
| 09:57 | Fossi | hchbaw: you wrote the fuzzy-complete, right? |
| 09:58 | hchbaw | Fossi: yes, almost copied from the original CL implementation. |
| 09:58 | Fossi | gerryxiao: normally, i put it in another namespace and use that from main.clj |
| 09:58 | liwp | gerryxiao: can't you use the (ns) macro in your file which does support :use etc.? |
| 09:59 | Fossi | hchbaw: almost works here now. it's a little weird what symbols it can complete and which not |
| 09:59 | liwp | ,(ns foo (:use bar)) |
| 09:59 | clojurebot | java.io.FileNotFoundException: Could not locate bar__init.class or bar.clj on classpath: |
| 09:59 | Fossi | hchbaw: i guess it's best used with hippie-complete |
| 09:59 | liwp | ,`(ns foo (:use bar)) |
| 09:59 | clojurebot | (clojure.core/ns sandbox/foo (:use sandbox/bar)) |
| 09:59 | Chouser | It's not recommended to use 'ns' for the same namespace in more than one place. |
| 09:59 | liwp | ahh, I missed that bit of the problem |
| 10:00 | liwp | how do I get the macro expansion out of clojurebot? |
| 10:00 | liwp | ,(macroexpand (ns foo (:use bar))) |
| 10:00 | clojurebot | java.io.FileNotFoundException: Could not locate bar__init.class or bar.clj on classpath: |
| 10:01 | liwp | ,(macroexpand '(ns foo (:use bar))) |
| 10:01 | clojurebot | (do (clojure.core/in-ns (quote foo)) (clojure.core/with-loading-context (clojure.core/refer (quote clojure.core)) (clojure.core/use (quote bar)))) |
| 10:01 | Fossi | i wish use would support [namespace class class2] |
| 10:01 | liwp | Chouser: so why shouldn't one use (ns) for the same namespace from more than one file? |
| 10:02 | liwp | is it that with-loading-context bit that causes problems? Or possibly refer 'clojure.core? |
| 10:03 | Chouser | liwp: well, it mostly works. :refer-clojure wouldn't do what you expect, but other than that I think it's about maintaining a clear difference between the controlling and controlled files. |
| 10:03 | liwp | ok |
| 10:04 | liwp | I was just thinking that in the repl you would do (in-ns 'foo) and then def a bunch of stuff which is sort of the same thing as using (ns) with the same namespace in multiple files... |
| 10:04 | liwp | but apparently not exactly the same thing looking at the expansion of (ns) |
| 10:07 | ol3 | hello, is it possible to escape from an doseq form, or should i use something like every? |
| 10:08 | Chouser | ol3: other than :while clauses, there's no escape. |
| 10:09 | ol3 | hm |
| 10:11 | ol3 | (every? (fn [item] (do-something-with-item) (if (continue?) true false)) seq) |
| 10:12 | Chouser | ol3: hm... I guess you could do all that in a :while clause |
| 10:12 | ambient | does there exist a list anywhere, of all the features and keybindings of clojure-mode for emacs? |
| 10:12 | ambient | or is it simply all in the clojure-mode.el file? |
| 10:13 | stuartsierra | ambient: Type "C-h m" in a clojure-mode buffer |
| 10:13 | Chouser | cgrand: I can't forget -- every time one gets a feature, I end up porting it to the other! |
| 10:14 | ambient | stuartsierra that does nothing |
| 10:14 | cgrand | "doseq, a sisyphean drama" |
| 10:15 | ambient | weird, C-h m works in repl, but not in file buffer |
| 10:15 | stuartsierra | ambient: hmm, I dunno, that's the standard describe-mode command in Emacs |
| 10:19 | Fossi | ok, i got load to work. i still think it's an ugly solution |
| 10:20 | Fossi | why is refer 'deprecated'? |
| 10:20 | Fossi | it seems like the cleaner way of doing this |
| 10:20 | Chouser | it's not deperecated, it's just usually used via 'use' instead of on its own. |
| 10:21 | Fossi | well, use doesn't do what i want |
| 10:21 | ambient | is there a way to load a java library to the repl that is not in the classpath? |
| 10:21 | ambient | like (load-jar "swt.jar") |
| 10:21 | Fossi | i want to smash multiple namespaces together |
| 10:23 | Chouser | Fossi: 'use' does a 'load' and then a 'refer' |
| 10:23 | stuartsierra | ambient: there is add-to-classpath, but it does not work in all situations and is vaguely deprecated |
| 10:23 | Chouser | 'refer' by itself doesn't do anything with files -- won't load a new one. |
| 10:23 | Fossi | hmmm. so i can call function from other namespaces in that one then? |
| 10:23 | Fossi | i thought that was what refer does |
| 10:25 | Fossi | (ns foo (:use some.service :as service)) (service/baz) - ( (ns some.service (:refer service-part)) - (ns service-part) (defn baz) |
| 10:26 | Fossi | would that work? |
| 10:27 | Chouser | that would work, though baz would not be visible in foo (using neither 'use' nor 'refer') |
| 10:27 | Chouser | oh |
| 10:27 | Chouser | sorry, wait. |
| 10:28 | Chouser | no, service/baz would not work |
| 10:29 | Fossi | hmm. too bad. |
| 10:31 | Fossi | hmmm. if i load a file then, how do i call functions of the namespace i'm being loaded into? |
| 10:31 | Fossi | or can i require it as well? |
| 10:31 | Fossi | ah, this is ugly |
| 10:31 | Chouser | some.service could say (def baz service-part/baz) to make it available to users of some.service. |
| 10:31 | Fossi | i need to find some other way |
| 10:32 | Fossi | thanks for the help so far though |
| 10:57 | ambient | this is pretty cool http://travis-whitton.blogspot.com/2009/09/hot-code-swapping-with-clojure.html |
| 10:59 | Chouser | reloading a lib is not atomic |
| 10:59 | ambient | yeah that part seemed pure conjecture for me too |
| 11:01 | ambient | how would one go about making lib reloading atomic? |
| 11:02 | ambient | 100% written with clojure? |
| 11:03 | Chouser | ambient: maybe try to load everything into a new namespace and then do a CAS swap somehow. |
| 11:20 | ol3 | Is it possible to get a sequence of all threads? |
| 11:21 | Chouser | ,(keys (Thread/getAllStackTraces)) |
| 11:21 | clojurebot | java.security.AccessControlException: access denied (java.lang.RuntimePermission getStackTrace) |
| 11:21 | Chouser | well, that'll work outside a sandbox |
| 11:22 | tmountain | hey guys, I wrote that blog post above, I'll update it to indicate that reloading isn't atomic |
| 11:23 | ol3 | Chouser: cool thanks |
| 11:24 | Chouser | tmountain: sounds good. Depending on the change you're loading, it may not matter. |
| 11:25 | Chouser | tmountain: each def (and defn) is atomic, so you won't load a half-redefined function, but if your change is in two different defn's, and those changes rely on each other, you could potentially have problems. |
| 11:25 | tmountain | Chouser: ok, good to know. I will include that in my update. |
| 11:25 | Chouser | thanks! nice post, btw. :-) |
| 11:27 | tmountain | thanks, Clojure is just too much fun! |
| 11:28 | ambient | im still having trouble in getting all the edged smoothed out in my development process :/ |
| 11:29 | ambient | netbeans is bad at building simple one-file test projects and emacs takes time to get used to |
| 11:30 | cemerick | ambient: are you using enclojure? |
| 11:31 | ambient | i tried it but had trouble managing the files in my project and connecting the repl to the files |
| 11:32 | ambient | seems there's no proper getting started for any IDE, which would explain the whole development process so it's all diving into the deep end of the pool no matter what i try |
| 11:32 | cemerick | You should just be able to right click on your project, and start a repl for it. |
| 11:32 | stuartsierra | ambient: I recommend you first get comfortable configuring your project, classpath, REPL, etc. at the command line. |
| 11:32 | stuartsierra | Then tackle the IDE integration, you'll find it much easier. |
| 11:33 | ambient | yeah, seems that's the only way to *truly* get it |
| 11:33 | cemerick | stuartsierra: is that sort of like "learn math with a pencil, then use the calculator"? |
| 11:33 | stuartsierra | cemerick: yes. Or like "learn assembly, then write C" |
| 11:34 | stuartsierra | Although I never really learned assembly. |
| 11:34 | ambient | i know both and would just stay with idiomatic K&R C first |
| 11:34 | cemerick | and I never really learned C (though I did plenty of damage with it :-P ) |
| 11:35 | ambient | perhaps more appropriate analogy would be to buy a ball before you start playing football |
| 11:35 | ambient | otherwise you're just kicking around on empty air |
| 11:35 | ambient | ..hoping to hit something |
| 11:41 | raphinou | hi, any vimclojure user here? |
| 11:49 | stuartsierra | More Maven-fu, setting up your own public repository: http://stuartsierra.com/2009/09/08/run-your-own-maven-repository |
| 11:52 | tmountain | raphinou: me |
| 11:53 | raphinou | tmountain: I have installed it successfully (I think: syntax coloring works, I can call a repl manually), but the mappings are not working. |
| 11:53 | AWizzArd | Oh funny, I found a bug in Suns regex code. |
| 11:53 | AWizzArd | ,(re-find #"(a)?123|x" "xyz") |
| 11:53 | clojurebot | ["x" nil] |
| 11:53 | AWizzArd | ,(re-find #"(a)?1234|x" "xyz") |
| 11:53 | clojurebot | nil |
| 11:54 | AWizzArd | It's already submitted to Sun. |
| 11:54 | ol3 | is it ok to construct a lazy-sequence which values depend on a ref, or is this too clever? |
| 11:55 | AWizzArd | Perl, clppcre and Co perform correctly. |
| 11:55 | tmountain | raphinou: did you define maplocalleader? |
| 11:55 | tmountain | raphinou: let maplocalleader = "," (in your vimrc) |
| 11:56 | raphinou | tmountain: not currently. tried it this morning but without success. |
| 11:56 | raphinou | I'll try again for 100% security |
| 11:56 | tmountain | raphinou: did you confirm nailgun was running? |
| 11:56 | raphinou | yes, laingun is fine, and its classpath ok |
| 11:57 | tmountain | raphinou: I've found it can be slightly challenging to get it setup, but once it's working, you'll love it |
| 11:58 | raphinou | when I press the , the screen flashes, which doesn't happen when I have a mapping defined |
| 11:58 | raphinou | tmountain: yes, that's why I'm still trying :-) |
| 12:01 | tmountain | raphinou: do you have let vimclojure#NailgunClient = "/your/path/vimclojure/ng" and let clj_want_gorilla = 1 ? |
| 12:02 | raphinou | tmountain: yes, as explained on the website and the doc |
| 12:02 | raphinou | I think the problem is more that the mappings are not available. Don't know how that comes |
| 12:05 | tmountain | raphinou: they're sourced from clojure.vim (loaded from ~/.vim/ftplugin/clojure.vim) |
| 12:06 | tmountain | raphinou: if you search that file for "vimclojure_namespace", you'll see their definitions |
| 12:07 | raphinou | tmountain: yes. But I suspect not everything is loaded correctly. the function vimclojure#EvalLine is defined and I can call it, but it gives errors: Undefined variable: b:vimclojure_namespace |
| 12:08 | tmountain | raphinou: the definitions are provided via ~/.vim/autoload/vimclojure.vim. it sounds as if that file isn't being sourced properly |
| 12:11 | tmountain | raphinou: what happens if you start vim on a new empty clojure file (i.e., vim new.clj) and then type ,sr ? |
| 12:12 | raphinou | tmountain: starts fine with syntax highlighting ok |
| 12:12 | raphinou | no error messages |
| 12:13 | raphinou | and filetype detexted is clojure |
| 12:14 | tmountain | does it start a repl, or no? |
| 12:15 | raphinou | tmountain: no |
| 12:18 | tmountain | raphinou: what operating system? |
| 12:18 | raphinou | debian linux, vim 7.1 |
| 12:19 | tmountain | raphinou: what's the output of ps aux | grep -i nail ? |
| 12:20 | hamza | hey guys, is there a revers of assoc for vectors? instead of using subvec to remove an item at a specified index. the doc dissoc does not say it is suitable for vectors? |
| 12:24 | raphinou | tmountain: martiansoftware on 127.0.0.1 |
| 12:30 | tmountain | raphinou: start vim once more on a new file (i.e., foo.clj) and try this - :call vimclojure#Repl.New() |
| 12:32 | raphinou | tmountain: I'm restarting everything from scratch now (clean environment, etc) |
| 12:33 | tmountain | raphinou: ok, if you still have issues, try the previous suggestion to determine whether vim can talk to nailgun |
| 12:34 | raphinou | tmounain: ok, repl is there now, but I don't know why it started working as it's before I restarted from scratch :( |
| 12:36 | raphinou | tmountain: still issues when opening existing file, but it's a problems with classpath. I'll investigate further. Thanks for your help! |
| 12:38 | tmountain | raphinou: no problem, best of luck |
| 12:38 | tmountain | raphinou: try opening a file without a namespace at the top, and I bet it works |
| 12:39 | raphinou | tmountain: you're right |
| 12:40 | raphinou | any idea how to fix this? |
| 12:40 | raphinou | but the mappings still arent there though :( |
| 12:42 | tmountain | raphinou: the namespace thing is a classpath issue |
| 12:43 | tmountain | basically the file has to be part of nailgun's classpath |
| 12:43 | tmountain | not your local shell classpath |
| 12:44 | raphinou | tmountain: classpath (for nail server and the vim I start) contains base directory of the clojure file's namespace |
| 12:45 | raphinou | tmountain: ok, it was the classpath env variabels that was not exported I think.... |
| 12:46 | tmountain | raphinou: yeah, it's pretty finicky |
| 12:46 | raphinou | tmountain: it's working at last! wow |
| 12:47 | tmountain | raphinou: awesome ;-) |
| 12:47 | raphinou | thanks a bunch for you help! No I'll be able to see if it was worth the effort as you said :-) |
| 12:47 | raphinou | s/No/Now/ |
| 12:47 | tmountain | it's great tool for developing without leaving your editor |
| 12:48 | tmountain | just eval a form, go into a repl, test, etc... |
| 12:48 | raphinou | yes. I already remember the evaluate line mapping :-) |
| 12:48 | raphinou | just in time as I need to go now. See you later, bye! |
| 13:17 | ambient | i find this curious: if i have music.clj and namespace foo.bar.music, and i want to extend to foo.bar.music.one and foo.bar.music.two i have to destroy music.clj, create music directory and create one and two.clj into that dir? |
| 13:18 | Chouser | you can have foo/bar/music.clj and foo/bar/music/one.clj |
| 13:18 | Chouser | for foo.bar.music and foo.bar.music.one respectively. |
| 13:18 | ambient | oh ok :) |
| 13:49 | Fossi | what was the idiom again for turning [[1 2] [1 2]] into [[1 1] [2 2]]? |
| 13:50 | Fossi | ah, interleave |
| 13:50 | Fossi | hmm. almost |
| 13:50 | Fossi | ;) |
| 13:52 | Fossi | anything better than (partition 2 (apply interleave [[1 2] [1 2]]))? |
| 13:54 | AWizzArd | stuartsierra: about clojure.contrib.profile, I may have found a bug. When you have (defn foo [x] (prof :foo (+ x 10))) and then do (profile (map foo (range 5))) ==> java.lang.IllegalArgumentException: Wrong number of args passed to: core$max |
| 13:54 | AWizzArd | clojurebot: max people |
| 13:54 | clojurebot | max people is 164 |
| 13:56 | AWizzArd | stuartsierra: but (profile (doseq [i (range 5)] (foo i))) works fine. |
| 14:00 | Fossi | actually, the solution to my problem is (let [foo (apply interleave [[[10] [20]] [[11] [21]] [[12] [22]]])] (split-at (/ (count foo) 2) foo)) :) |
| 14:00 | Fossi | but i bet there is a nicer way |
| 14:02 | stuartsierra | AWizzArd: ok I'll take a look. Could you file an Assembla ticket? |
| 14:35 | stuartsierra | Anybody have a link for the slides (not video) to rhickey's talk "Clojure for Java Programmers"? |
| 14:35 | Chouser | ,(apply map vector [[1 2] [1 2]]) |
| 14:35 | clojurebot | ([1 1] [2 2]) |
| 14:39 | stuartsierra | ah, found it on the Group Files page. |
| 14:43 | AWizzArd | stuartsierra: I need an account on Assembla to open a ticket, yes? |
| 14:43 | Chouser | AWizzArd: no, just use the "support" tab |
| 14:43 | AWizzArd | ok good, thx |
| 14:47 | AWizzArd | Chouser: hmm, on http://www.assembla.com/spaces/clojure-contrib/support/tickets it tells me "You must login or register to submit a support ticket". |
| 14:48 | AWizzArd | I will try a BugMeNot account |
| 14:49 | Chouser | hm, I wonder if that changed at some point. I guess you need an assembla account, but no special permissions. |
| 14:50 | LauJensen | Did we decide what a Clojure programmer is called? Clojurist? Clojurian ? Clabango? |
| 14:52 | stuartsierra | Cluje |
| 14:52 | drewr | LauJensen: "Clojure programmer" |
| 14:53 | stuartsierra | "Smug Java Weenie" |
| 14:53 | drewr | a "clojurian" is someone who sits around trying to think about what to call clojure programmers :-) |
| 14:53 | LauJensen | noobs :) |
| 14:55 | Chouser | Clojurian |
| 14:56 | Chouser | http://clojure-log.n01se.net/date/2008-10-17.html#08:26b |
| 14:59 | Chouser | also: http://www.computerworld.com.au/article/313989/-z_programming_languages_clojure?pp=3 |
| 14:59 | LauJensen | Its settled and documented :) |
| 15:01 | LauJensen | Perfect reference, thank you Mr. Chouser sir |
| 15:02 | Chousuke | Clabango :D |
| 15:02 | Chousuke | Maybe that could be used as the title of an experienced Clojurian. |
| 15:03 | LauJensen | Chousuke: No, its just something rhickey exclaims when he hands you your black belt |
| 15:07 | hiredman | ~suddenly rhickey hands you a belt made of fine black italian leather! |
| 15:07 | clojurebot | CLABANGO! |
| 15:07 | LauJensen | hehe |
| 15:09 | manic12 | does clojure have a test library? |
| 15:09 | Chousuke | clojure.test if you're using master, contrib.test-is if 1.0 |
| 15:10 | manic12 | ok, I'll have to try it on this arm9 that clojure seems to run on |
| 15:10 | Chousuke | note that if you're using 1.0 you need the 1.0-compatible branch of contrib |
| 15:10 | manic12 | is 1.0 the newer? |
| 15:11 | stuartsierra | 1.0 is the official release; Git master is current development, like SVN trunk |
| 15:11 | manic12 | ok |
| 15:12 | manic12 | with all the concurrency stuff, a 200mhz arm board is probably a boring target |
| 15:12 | Chousuke | heh. |
| 15:12 | Chousuke | well, it'll be an interesting experiment nonetheless |
| 15:12 | Chousuke | to see what happens :P |
| 15:13 | manic12 | it works so far |
| 15:17 | manic12 | am i supposed to git test-is or is there a tar.gz or bz2 somewhere? |
| 15:17 | technomancy | the 1.0 release is a tarbomb IIRC, so watch out. |
| 15:17 | stuartsierra | manic12: test-is can be found in the "clojure-1.0-compatible" branch of Clojure-contrib. |
| 15:18 | stuartsierra | http://github.com/richhickey/clojure-contrib |
| 15:20 | manic12 | for my workstation I do prefer git, but for this arm board, if I could find where that 1.0-compatible tarball is, it would be useful |
| 15:20 | manic12 | I guess I could make one |
| 15:20 | stuartsierra | there is no tarball |
| 15:21 | hiredman | you can download the branch as a tarball from github |
| 15:21 | stuartsierra | ture |
| 15:21 | stuartsierra | true |
| 15:22 | hiredman | actually |
| 15:22 | hiredman | can you?, I don't see a way to do that anymore |
| 15:22 | manic12 | anybody know the git clone repository name for the 1.0 compatible contribs? |
| 15:24 | Chousuke | manic12: it's in the contrib repo |
| 15:24 | Chousuke | you clone it, then just checkout the master branch in your clone. |
| 15:24 | Chousuke | er |
| 15:24 | Chouser | http://github.com/richhickey/clojure-contrib/tarball/clojure-1.0-compatible |
| 15:24 | Chousuke | the compatible branch of course. |
| 15:24 | Chouser | that's the tarball link |
| 15:24 | Chousuke | or you can do that I guess :) |
| 15:25 | manic12 | thx |
| 15:34 | manic12 | it takes about 30 seconds from the time you start clojure till the time the user=> prompt shows up on this computer |
| 15:40 | hiredman | the jvm startup times can be painful |
| 15:40 | hiredman | (but is five seconds or less here) |
| 15:43 | ambient | how can i generate character frequencies from a string into a map? |
| 15:44 | ambient | should i just write loop/recur? |
| 15:45 | hiredman | sounds like reduce |
| 15:46 | hiredman | ,(let [+i (fn [n] (inc (or n 0)))] (reduce #(update-in % [%2] +i) (seq "foo bar baz")) |
| 15:46 | clojurebot | EOF while reading |
| 15:47 | hiredman | ,(let [+i (fn [n] (inc (or n 0)))] (reduce #(update-in % [%2] +i) (seq "foo bar baz"))) |
| 15:47 | clojurebot | java.lang.ClassCastException: java.lang.Character cannot be cast to clojure.lang.Associative |
| 15:47 | hiredman | ,(let [+i (fn [n] (inc (or n 0)))] (reduce #(update-in % [%2] +i) {} (seq "foo bar baz"))) |
| 15:47 | clojurebot | {\z 1, \r 1, \a 2, \b 2, \space 2, \o 2, \f 1} |
| 15:47 | manic12 | hiredman: jamvm actually, not jvm in this case |
| 15:47 | hiredman | manic12: jamvm is a jvm :P |
| 15:48 | Chouser | ,(reduce #(assoc % %2 (inc (% %2 0))) {} "foo bar baz") |
| 15:48 | clojurebot | {\z 1, \r 1, \a 2, \b 2, \space 2, \o 2, \f 1} |
| 15:49 | ambient | ok, ty. |
| 15:49 | hiredman | Chouser: cute |
| 15:49 | hiredman | (% %2 0) |
| 15:49 | Chouser | heh |
| 15:50 | Chouser | its meaning is obvious, right? |
| 15:50 | hiredman | sure sure |
| 15:50 | ambient | you're using the key as a function? |
| 15:50 | hiredman | "obvious" |
| 15:50 | Chouser | the map as a function. |
| 15:50 | Chouser | could say (get % %2 0) |
| 15:50 | Chouser | and waste 4 chars |
| 15:50 | hiredman | that might be a little more clear |
| 15:51 | ambient | well i still need to think about that. functional style programming is just very slowly absorbing information for me |
| 15:52 | ambient | somehow it's a lot easier with scheme because it has so few core operations |
| 15:53 | ambient | i think almost all my functions exploited some kind of tail recursion, now that i can't do it, i miss it |
| 15:54 | stuartsierra | ambient: you can still do tail recursion with loop/recur |
| 15:54 | ambient | yes, but that's not the same :) |
| 15:56 | stuartsierra | Usually it is. Writing recur in a function without an enclosing loop is the same as a tail recursive call in Scheme. |
| 15:56 | stuartsierra | Clojure is just a little more restrictive regarding the definition of "tail position." |
| 15:57 | Chouser | ,(-> [a b] (fn (assoc a b (-> b (a 0) inc))) (reduce {} "foo bar baz")) |
| 15:57 | clojurebot | {\z 1, \r 1, \a 2, \b 2, \space 2, \o 2, \f 1} |
| 15:57 | ambient | yes, it might be the same semantically but i can wrap my head around scheme's way of doing things a lot better |
| 15:57 | Chouser | there, that should clear things up |
| 16:00 | ambient | now priority queue... this will be harder |
| 16:01 | manic12 | is there an apropos? |
| 16:01 | Chouser | ambient: I've got most of a priority queue working, built on finger trees. |
| 16:02 | ambient | idk, maybe i could use sorted map |
| 16:02 | Chouser | manic12: (find-doc "find-doc") |
| 16:02 | ambient | Chouser cool |
| 16:02 | ambient | i hope you blog about them that the rest of us mortals can comprehend ;) |
| 16:02 | hiredman | ,(pl (↕reduce "foo bar baz" {} λab (assoc a b (inc · a b 0 )))) |
| 16:02 | Chouser | ambient: so as long as you don't need it for a week or so, you can probably just wait 'til I'm done and then use it. |
| 16:02 | clojurebot | {\z 1, \r 1, \a 2, \b 2, \space 2, \o 2, \f 1} |
| 16:03 | ambient | i spy lambda with my little eye |
| 16:04 | ambient | clojure character support is more than ASCII? |
| 16:05 | stuartsierra | ambient: yes, it supports anything Java supports, so at least UTF-8. |
| 16:05 | hiredman | utf8 |
| 16:05 | ambient | that's nice, and weird :) |
| 16:05 | stuartsierra | Not all editors play nice with UTF-8, though. |
| 16:05 | ambient | and not all fonts |
| 16:05 | hiredman | :/ |
| 16:05 | hiredman | clojurebot: the man? |
| 16:05 | clojurebot | ☝(^_^)☝ |
| 16:05 | duck1123 | and those shall not be talked about |
| 16:06 | ambient | you made me switch to dejavu sans mono :| |
| 16:06 | hiredman | yeah |
| 16:07 | hiredman | dejavu sans mono has the best coverage of any fixed width font I've tried |
| 16:07 | duck1123 | I wonder how crazy a clojure minifier could get. I'm sure you could do some crazy tricks |
| 16:07 | ambient | but i want to use my old MS-DOS fonts :( |
| 16:07 | ambient | borland turbo c, oh yeah |
| 16:08 | ambient | duck1123 APL is pretty sweet in that regard |
| 16:10 | ambient | which will be never |
| 16:10 | duck1123 | you don't think it'll happen? |
| 16:10 | Chouser | of course it will happen |
| 16:11 | ambient | if you mean using clojure to write javascript then, yeah |
| 16:11 | duck1123 | I was talking more about clojurescript |
| 16:13 | Chouser | quite a lot was working there for a while -- persistent vectors, maps, destructuring, macros, dynamic binding, for, loop/recur, ... |
| 16:13 | Chouser | probably still works if you don't mind that it's pre-1.0 clojure. :-/ |
| 16:14 | ambient | well im looking at this: http://code.google.com/p/jc-pheap/ atm |
| 16:14 | hiredman | maybe clojurebot should export its brain as a set of rdf triples |
| 16:15 | duck1123 | I would like to be able to include a certain javascript library and have it load any text/clojurescript script elements and executes them |
| 16:15 | duck1123 | hiredman: yes please |
| 16:15 | hiredman | I'd have to learn how to do that |
| 16:16 | duck1123 | I've got some old Jena/clojure code in my archives that I threw out |
| 16:16 | duck1123 | I could dig them out and paste them if you want, but i think someone did a library |
| 16:17 | Chouser | rhickey did a library |
| 16:17 | stuartsierra | I did too |
| 16:17 | duck1123 | I gave up on actual rdf parsers/libraries when I decided to fake it |
| 17:13 | drewr | stuartsierra: do you have a way to tie in custom deserialization in c.c.json.read? |
| 17:20 | stuartsierra | not sure what you mean |
| 17:21 | stuartsierra | It just reads JSON. You can't extend its idea of what valid JSON is, if that's what you mean. |
| 17:23 | drewr | I'd like to have a fn called on a value after it's deserialized |
| 17:24 | stuartsierra | Like a callback? No, it doesn't do that. |
| 17:24 | drewr | wanted to make sure I wasn't overlooking something |
| 17:24 | stuartsierra | Just call the function directly on the deserialized object. |
| 17:26 | stuartsierra | It's not a streaming parser, some Java libraries do that. |
| 17:30 | drewr | ok, so I'd like to traverse my resulting object and convert all the Longs to Dates, trying to use walk to do it |
| 17:30 | drewr | what's wrong with this? |
| 17:30 | drewr | (walk #(if (= % "bar") :bar_was_here %) identity {:foo "bar"}) |
| 17:30 | drewr | => {:foo "bar"} |
| 17:31 | stuartsierra | don't call walk directly, use prewalk or postwalk |
| 17:32 | drewr | ah, thanks |
| 17:33 | stuartsierra | user> (prewalk #(if (= % "bar") :bar_was_here %) {:foo "bar"}) |
| 17:33 | stuartsierra | {:foo :bar_was_here} |
| 17:33 | clojurebot | foo is is Short, Self Contained, Correct (Compilable), Example http://sscce.org/ |
| 17:34 | hiredman | clojurebot: what is wrong with you? |
| 17:34 | clojurebot | Roger. |
| 17:36 | lowlycoder | has anyone written a 3d opengl game using clojure? the jogl/jni calls are really hurting me right now |
| 17:36 | stuartsierra | there are 2 JOGL wrappers in Clojure; look on the mailing list |
| 17:36 | stuartsierra | I think they're still findable there |
| 17:41 | LauJensen | I'm doing a post on PHP (typical webdev) vs Cloure/Servlets, anybody that can find 5 minz to skim, just to see if I touched on the most important stuff? |
| 17:46 | unlink | Am I missing out on a more obvious way of doing this? (reduce (fn [acc x] (assoc acc x (inc (get acc x 0)))) {} coll) |
| 17:49 | hiredman | ,(pl (↕reduce "foo bar baz" {} λab (assoc a b (inc · a b 0 )))) |
| 17:49 | clojurebot | {\z 1, \r 1, \a 2, \b 2, \space 2, \o 2, \f 1} |
| 17:49 | Chouser | that looks familiar |
| 17:49 | hiredman | Chouser: yeah, almost like you could have written it… |
| 18:15 | ambient | Chouser got that finger tree source code lying anywhere on the web? |
| 18:15 | ambient | *laying around |
| 18:20 | Chouser | ambient: http://github.com/Chouser/finger-tree |
| 18:21 | Chouser | not yet alpha, but it is what it is. |
| 18:21 | ambient | well it looks heave, something for me to parse while i listen to trance |
| 18:22 | ambient | *heavy |
| 18:22 | Chouser | heh |
| 18:22 | Chouser | oh, it needs the newnew branch of clojure |
| 18:23 | hiredman | (reify) |
| 18:50 | jbell | hey guys, can anyone show me how to make a powerset function in clojure? |
| 18:55 | Chousuke | hmm |
| 18:55 | Chousuke | (doc reductions) |
| 18:55 | clojurebot | "([f coll] [f init coll]); Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init." |
| 18:55 | Chouser | ~google clojure powerset |
| 18:55 | Chousuke | damn, no namespace. |
| 18:55 | clojurebot | First, out of 5150 results is: |
| 18:55 | clojurebot | Cribbage points counter in Clojure « Occasionally sane |
| 18:55 | clojurebot | http://gnuvince.wordpress.com/2008/10/11/cribbage-points-counter-in-clojure/ |
| 18:56 | jbell | sure, I saw that, thanks.. is that the best way to do it? it's quite different from the lisp map way I'm used to |
| 18:59 | hiredman | someone must have use'ed that namespace |
| 18:59 | Chousuke | I thought about writing a powerset with reductions but it's not quite a powerset :P |
| 18:59 | Chousuke | ,(reductions (fn [a b] (conj a b)) #{} [1 2 3 4]) |
| 18:59 | clojurebot | (#{} #{1} #{1 2} #{1 2 3} #{1 2 3 4}) |
| 19:01 | Chousuke | wait. why did I use that anonymous function. |
| 19:03 | jbell | is the reductions function/macro from another namespace? |
| 19:03 | Chousuke | I think it should be c.c.seq-utils |
| 19:03 | Chousuke | or something |
| 19:03 | jbell | cool, I'll try that |
| 19:26 | jbell | am I right to think that the clojure contrib 1.0.0 jar doesn't include seq-utils |
| 19:26 | jbell | ? |
| 19:26 | hiredman | which "the" |
| 19:27 | hiredman | as far as I know there is no "the" clojure contrib jar |
| 19:27 | jbell | I got it packaged with enclojure |
| 19:29 | Chousuke | I'm not sure if I got the namespace right, even |
| 19:29 | hiredman | jbell: and what leads you to believe it does not include seq-utils? |
| 19:29 | Chousuke | ~def reductions |
| 19:31 | jbell | thanks clojurebot |
| 19:32 | jbell | how do I get and compile the freshest version of contrib to have a jar in netbeans? |
| 19:33 | jbell | I expect I d/l from github, but then how do I compile it? |
| 19:36 | Chousuke | you can try without compiling first I suppose. |
| 19:37 | Chousuke | I mean, plain "ant" will give you a jar to use. |
| 19:37 | jbell | hmm, I think it's a maven project |
| 19:37 | Chousuke | if you actually want to compile (the pretty printer requires it) then you need to do ant -Dclojure.jar=/path/to/clojure.jar |
| 19:38 | Chousuke | and I can't give any IDE-specific advice /: |
| 19:38 | Chousuke | I don't use IDEs myself. besides emacs, which is actually the Borg |
| 19:38 | jbell | ahh right ok :) |
| 19:38 | jbell | I like vim, although I don't know how much more trouble I'd be in setting that up |
| 19:39 | Chousuke | in 50 years emacs will have become self-sufficient and develops itself through mind-washed coder drones |
| 19:41 | Chousuke | Actually, maybe that already has happened. :/ |
| 19:41 | technomancy | Chousuke: I give it five years. |
| 19:41 | Chousuke | Chouser: that's what the emacs wants you to think! |
| 19:42 | Chousuke | it's a symbiotic relationship anyway |
| 19:43 | Chouser | Chousuke: emacs codes in you!? |
| 19:43 | Chousuke | emacs takes advantage of humans but in exchange we get... emacs. |
| 19:46 | Chousuke | I wonder what it would take to compile and run some ancient version of emacs. |
| 19:46 | Chousuke | I'm kind of interested in what it was like when it was young :P |
| 19:47 | Chousuke | but maybe later. |
| 19:50 | jbell | if you can sum up emacs and its significance to your coding I'd like to know it |
| 19:51 | technomancy | jbell: simple: it's trivial to modify your environment at-will during runtime. |
| 19:51 | technomancy | http://technomancy.us/115 <= sums it up in longer format |
| 19:51 | jbell | cool will look |
| 19:52 | technomancy | in interests of full disclosure |
| 19:53 | technomancy | damned if it isn't hard for me to type "closure" correctly these days |
| 19:58 | tomoj | technomancy: +1 on emacs-starter-kit working fine in aquamacs :) |
| 19:58 | tomoj | thanks bunches |
| 19:58 | technomancy | tomoj: great! |
| 20:02 | ambient | hmm, there's must be a better way of doing this (reduce #(conj % [(get %2 1) (get %2 0)]) (sorted-set) freqs) |
| 20:05 | arbscht | ambient: what is freqs and what is your code supposed to do? |
| 20:05 | ambient | freqs is character frequency map like {\a 2, \h 5, \m 1} etc |
| 20:05 | Chouser | (into (sorted-set) (map (comp vec reverse) freqs)) |
| 20:05 | Chouser | dunno if that's better |
| 20:06 | Chouser | (into (sorted-set) (for [[k v] freqs] [v k])) |
| 20:07 | ambient | yeah, that's better :) |
| 20:08 | Chouser | (reduce (fn [s [k v]] (conj s [v k])) (sorted-set) freqs) |
| 20:08 | ambient | is that in any way better? |
| 20:09 | ambient | ah well.. time to construct the binary sequences |
| 20:09 | Chouser | (into (sorted-set) (map vector (vals freqs) (keys freqs))) |
| 20:10 | Chouser | so many ways to skin that particular cat. I guess I like the 'for' best so far. |
| 20:10 | ambient | yeah the first one is the most readable |
| 20:10 | ambient | with for |
| 20:12 | jbell | Chouser, how would you skin the powerset cat? |
| 20:12 | Chouser | Chousuke: had a nice one, didn't he? |
| 20:13 | Chouser | ,(reductions conj #{} [1 2 3 4]) |
| 20:13 | clojurebot | (#{} #{1} #{1 2} #{1 2 3} #{1 2 3 4}) |
| 20:13 | Chouser | pretty hard to beat |
| 20:14 | jbell | lol, I've only just realised what clojurebot is |
| 20:16 | jbell | that one isn't powerset function though |
| 20:17 | jbell | if clojurebot is evaluating it correctly |
| 20:17 | Chouser | oh. |
| 20:17 | Chouser | oh, indeed. |
| 20:18 | Chouser | jbell: I posted a link. the first google hit for: clojure powerset is a blog post with a code snippet |
| 20:19 | jbell | sure, I saw that, I wondered if you had a better way to skin it :P |
| 20:30 | ambient | oh, there was frequencies already in seq-utils :) |
| 20:33 | nathanmarz | hey all |
| 20:33 | nathanmarz | looking at clojure core code |
| 20:33 | nathanmarz | why is reverse defined like this: |
| 20:33 | nathanmarz | (defn reverse |
| 20:33 | nathanmarz | "Returns a seq of the items in coll in reverse order. Not lazy." |
| 20:33 | nathanmarz | [coll] |
| 20:33 | nathanmarz | (reduce conj () coll)) |
| 20:34 | nathanmarz | doesn't conj not guarantee where in the array things will get added? |
| 20:35 | rhickey_ | nathanmarz: conjing onto a list puts things at the front, so walking one seq and building a list will reverse it |
| 20:36 | nathanmarz | ah right, cool |
| 20:36 | rhickey_ | ,(conj () 1 2 3) |
| 20:36 | clojurebot | (3 2 1) |
| 20:37 | rhickey_ | ,(conj [] 1 2 3) |
| 20:37 | clojurebot | [1 2 3] |
| 20:42 | Chouser | rhickey_: I'm currently using consLeft and consRight as method names for double-headed things. How does that strike you? |
| 20:42 | Chouser | for such a thing 'cons' would call consLeft, 'conj' would call consRight |
| 20:43 | hiredman | :/ |
| 20:43 | hiredman | seems like it would be nice to be able to switch somehow from left conj to right conj |
| 20:44 | hiredman | IRightConj ILeftConj |
| 20:45 | Chouser | I tried to do that, but at least for finger-trees I couldn't find a way to switch from one way to the other in O(1) time. |
| 20:45 | hiredman | I see |
| 20:45 | rhickey_ | Chouser: sounds ok |
| 20:45 | Chouser | the problem being when you concat a forward to a reversed tree. |
| 20:51 | Chouser | ,((fn pset [c] (when-let [[f & r] c] (concat (map #(conj % f) (pset r)) (pset r) [#{f}]))) [1 2 3 4]) |
| 20:51 | clojurebot | (#{1 2 3 4} #{1 2 4} #{1 2 3} #{1 3 4} #{1 4} #{1 3} #{1 2} #{2 3 4} #{2 4} #{2 3} #{3 4} #{4} #{3} #{2} #{1}) |
| 20:52 | Chouser | that'll blow the stack for big input collections |
| 20:52 | clojurebot | for is not used enough |
| 20:52 | ambient | aw, i don't think there's sorted-set-by :( |
| 20:52 | ambient | i can't set the comparison function for sorted-set |
| 20:53 | Chouser | ambient: http://www.assembla.com/spaces/clojure/tickets/79 |
| 20:55 | jbell | cool, that's more like what I wanted to do |
| 21:00 | jbell | Chouser: I just wanted to write a quick powerset function to test something out, so I was going for natural rather than efficient |
| 21:01 | Chouser | This is slightly better: |
| 21:02 | Chouser | ,(letfn [(pset [[f & r :as c]] (when c (lazy-cat (map #(conj % f) (pset r)) (pset r) [#{f}])))] (pset [1 2 3 4])) |
| 21:02 | clojurebot | (#{1 2 3 4} #{1 2 4} #{1 2 3} #{1 3 4} #{1 4} #{1 3} #{1 2} #{2 3 4} #{2 4} #{2 3} #{3 4} #{4} #{3} #{2} #{1}) |
| 21:02 | Chouser | using lazy-cat means it can give you the head of the seq faster. |
| 21:02 | hiredman | will that work with a list instead of a set? |
| 21:02 | Chouser | yes |
| 21:03 | Chouser | just use (list f) instead of #{f} |
| 21:03 | Chouser | or [f] |
| 21:07 | jbell | I was really intrigued when Rich said about how you could do aspect/context programming by dynamically binding the functions, but my attempt failed, and I couldn't find anything online |
| 21:07 | hiredman | failed how? |
| 21:09 | jbell | I tried to use let to bind the function in context, I think I know now... you use letfn? |
| 21:09 | hiredman | now |
| 21:09 | hiredman | no |
| 21:09 | arbscht | ,(doc binding) |
| 21:09 | clojurebot | "([bindings & body]); binding => var-symbol init-expr Creates new bindings for the (already-existing) vars, with the supplied initial values, executes the exprs in an implicit do, then re-establishes the bindings that existed before." |
| 21:09 | hiredman | well, you can use let to bind a name to something else in a lexical scope |
| 21:10 | hiredman | but you most likely want dynamic scope, which would use binding |
| 21:13 | jbell | great thanks |
| 21:14 | hiredman | woa |
| 21:14 | hiredman | what is this? |
| 21:15 | jbell | does anyone else think that 'cross-cutting concerns' isn't a great name for aspects covered by AspectJ? |
| 21:16 | hiredman | rhickey is going to be on the MS campus next week, according to twitter |
| 21:20 | hiredman | rhickey: is this true? |
| 21:25 | jbell | I guess I won't have to care anymore lol |
| 21:26 | jbell | Chouser: why would you want the head of the seq faster? |
| 21:28 | Chouser | why not? |
| 21:29 | Chouser | it helps if you only need the first few items, or if you're going to process the seq in parallel with something else such as with pmap or seque |
| 21:30 | jbell | right, so is pset utilising that change? |
| 21:30 | jbell | sorry... |
| 21:30 | jbell | that was nonsense lol |
| 21:30 | Chouser | oh, good. I couldn't understand. :-) |
| 21:30 | jbell | lol, I saw p for parallel |
| 21:30 | Chouser | ah! |
| 21:31 | Chouser | yeah, sorry, bad abbreviation. |
| 21:31 | Chouser | Chousuke should have slapped me. |
| 21:32 | jbell | I just couldn't see how in this algorithm getting the head faster would make any improvement. I haven't analysed it very much, though |
| 21:32 | hiredman | clojurebot: whose job is it to make sure everyone uses good abbreviations? |
| 21:32 | clojurebot | You don't have to tell me twice. |
| 21:32 | hiredman | :/ |
| 21:32 | Chouser | clojurebot: whose job? |
| 21:32 | clojurebot | whose job is it to make sure everyone uses good abbreviations |
| 21:33 | hiredman | something is broken |
| 21:33 | hiredman | *sigh* |
| 21:33 | Chouser | Who's on first. |
| 21:33 | Chouser | jbell: it's just lazy-cat vs. concat. |
| 21:33 | Chouser | jbell: concat is a fn, so all its args are evaluated up front, even if don't need the later items until later |
| 21:34 | Chouser | jbell: lazy-cat is a macro, and it delays evalling the args until they're needed. |
| 21:34 | Chouser | not a big deal under most use cases. |
| 21:36 | Chouser | rhickey has no comment on the MS visit. :-) |
| 21:40 | duck1123 | is it possible to use flymake with clojure |
| 21:47 | Chouser | ,(inc nil) |
| 21:47 | clojurebot | java.lang.NullPointerException |
| 21:48 | Chouser | ,(first (map inc (list 0 1 2 nil))) |
| 21:48 | clojurebot | 1 |
| 21:48 | Chouser | map is lazy! |
| 21:50 | hiredman | clojurebot: whose job is it to make sure everyone uses good abbreviations? |
| 21:50 | clojurebot | that's hiredman's job |
| 21:50 | hiredman | :( |
| 21:51 | jbell | I like clojure bot... not for that reason! |
| 21:51 | hiredman | clojurebot: whose job is it to like clojurebot? |
| 21:51 | clojurebot | that's metric's job |
| 21:53 | jbell | clojurebot: does metric like you though? |
| 21:53 | clojurebot | excusez-moi |
| 21:54 | hiredman | ~scala ((x: Int) => x + 1)(2) |
| 21:54 | clojurebot | Int = 3 |
| 21:56 | jbell | clojurebot: metric vous aime, clojurebot? |
| 21:56 | clojurebot | Pardon? |
| 21:56 | jbell | he only pretends he knows french. |
| 21:56 | hiredman | clojurebot: whose job is it to deal with french? |
| 21:56 | clojurebot | that's albino's job |
| 21:57 | Chouser | it could pick names in proportion to how often the talk |
| 21:57 | hiredman | yeah, which would require collecting stats, which it should do |
| 21:58 | duck1123 | it would be funny if you had clojurebot open a ticket somewhere whenever that happens |
| 21:58 | duck1123 | not in a real ticketing system, however |
| 21:59 | hiredman | ~ticket #1 |
| 21:59 | clojurebot | {:url http://tinyurl.com/ntftnj, :summary "Add chunk support to map filter et al", :status :test, :priority :normal, :created-on "2009-06-13T14:38:41+00:00"} |
| 21:59 | duck1123 | I was saying clojurebot needs to record the fact that it's albino's job to deal with french |
| 22:00 | hiredman | yeah, but then it would have to remember it |
| 22:00 | hiredman | clojurebot: whose job is it to deal with french? |
| 22:00 | clojurebot | that's dthomas's job |
| 22:02 | duck1123 | clojurebot: whose job is it to prove P = NP |
| 22:02 | clojurebot | Ack. Ack. |
| 22:02 | jbell | lol |
| 22:03 | hiredman | oh |
| 22:03 | hiredman | you broke it |
| 22:03 | hiredman | clojurebot: whose job is <reply>that's #someone's job |
| 22:03 | clojurebot | Ack. Ack. |
| 22:04 | hiredman | you need to end a question with "is" in it with a "?" |
| 22:12 | jbell | what else can clojurebot do? |
| 22:13 | jbell | that's implemented? |
| 22:13 | hiredman | ~google clojurebot |
| 22:13 | clojurebot | First, out of 52 results is: |
| 22:13 | clojurebot | hiredman's clojurebot at master - GitHub |
| 22:13 | clojurebot | http://github.com/hiredman/clojurebot/tree/master |
| 22:14 | hiredman | clojurebot: translate to fr from en: hello |
| 22:14 | clojurebot | from en: Bonjour |
| 22:14 | hiredman | er |
| 22:14 | hiredman | clojurebot: translate to fr: hello |
| 22:14 | clojurebot | bonjour |
| 22:14 | jbell | cool |
| 22:14 | hiredman | 1d20+5 |
| 22:14 | clojurebot | 9 |
| 22:15 | jbell | lol |
| 22:16 | hiredman | ~quote JAVA |
| 22:16 | clojurebot | excusez-moi |
| 22:16 | hiredman | ~ticker JAVA |
| 22:16 | clojurebot | JAVA; +0.01 |
| 22:17 | ambient | hmm, my huffman is just 3 lines and it would need heap queue to finish :/ |
| 22:18 | ambient | quess it's time to implement O(n) insertion heapq |
| 22:20 | jbell | you could make clojurebot translate people on the fly, like clojurebot:translate user from es |
| 22:20 | ambient | or better yet, translate from english->chinese->english->spanish->english and see what comes out |
| 22:21 | ambient | technically i think it's mandarin |
| 22:25 | jbell | you could do something like run skinning challenges (after Chouser's skinning cats), and allow people to vote via clojurebot, and then clojurebot would keep track of the scores lol... yeah. |
| 22:27 | jbell | but I'm guessing from what you said before that it doesn't keep state |
| 22:45 | jbell | if clojure had a secure aspect then clojurebot could be programmable |
| 22:49 | jbell | how are generics handled in clojure? I seem to remember Rich mention them, and say that they weren't a problem..? |
| 22:50 | Chouser | right. Java uses type erasure, so you can just ignore them. |
| 22:54 | jbell | so what happens if I want to create an instance of an ArrayList<String> to pass to the Java side? |
| 22:54 | jbell | or is that not done for good reason? |
| 22:55 | Chouser | ,(java.util.ArrayList. (map str (range 10))) |
| 22:55 | clojurebot | #<ArrayList [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]> |
| 22:55 | Chouser | it just works, as long as the only thing you put in the ArrayList are Strings. |
| 22:56 | Chouser | If you break the contract, you get a runtime exception. |
| 22:56 | jbell | oh ok, I've also found a log where you explained it to someone else too! |
| 22:56 | Chouser | :-) |
| 22:58 | jbell | now I know how you can reskin so fast :P |
| 23:31 | technomancy | evening dudes |
| 23:31 | technomancy | also possibly dudettes |
| 23:33 | durka42 | evening technomancy |
| 23:48 | technomancy | any ideas what's wrong here? http://p.hagelb.org/screw%2fmaven.clj.html |
| 23:49 | technomancy | it's a direct port of code from the maven embedder unit tests |
| 23:49 | technomancy | the only difference I can think of is that the classloader it hands off to maven may be different in the context of Clojure |
| 23:49 | arbscht | 404 |
| 23:50 | technomancy | sorry: http://p.hagelb.org/maven.clj.html |
| 23:56 | technomancy | still not sure I understand how classloaders work and how Clojure interacts with it |
| 23:58 | technomancy | I suppose Clojure has its own classloader, and it's not playing nice with the other maven classes that are supposed to be loaded via plexus. |
| 23:59 | tomoj | I wish I could even begin to understand what you're talking about |
| 23:59 | tomoj | java is still a mystery to me :( |