#clojure log - Jun 17 2009

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

0:56 sverrej: How do I create a java.lang.reflect.Method from a Clojure function?

0:56 I am using this Java lib that expects a Method object.

0:58 hiredman: erm

0:58 clojure functions are not Methods

1:00 sverrej: I guess they have to be, at some level, to be able to work with Java?

1:00 hiredman: nope

1:01 sverrej: ok

1:01 hiredman: clojure functions are Objects

1:05 cp2: sverrej: perhaps the Method object you should be getting is FunctionClass.invoke(...)

1:06 sverrej: cp2: Yes, that's what I'm trying now.

1:24 This seems to do the trick:

1:24 (.

1:24 (. (fn hello [] "hello") getClass)

1:24 getMethod "run" nil)

1:24 thank you

3:02 TheBusby: How do you "realize" a ratio into a Double?

3:04 hoeck: ,(float 1/4)

3:04 TheBusby: hoeck: thank you!

3:05 hoeck: mhh, no clojurebot available :(

3:05 TheBusby: np :)

3:08 frodef: How can I write a macro that implicitly uses a lexical variable?

3:08 hoeck: TheBusby: oh, I forgot there is also: (double 1/5)

3:09 frodef: I.e (let [x 1] (foo)), where (foo) expands to e.g. (+ 1 x)

3:09 hoeck: frodef: use ~'x in your expansion code

3:09 TheBusby: hoeck: perfect, thanks!

3:10 frodef: hoeck: perfect, thanks!

3:10 :)

3:11 hoeck: :)

3:14 TheBusby: is there anyway to "overload" the "+" operator for handing structs?

3:14 defmethod doesn't appear to be valid

3:14 zmyrgel: can clojure be used with android?

3:15 TheBusby: zmyrgel: yes, http://groups.google.com/group/clojure/browse_thread/thread/cf9c928f0027836a

3:15 more details, http://riddell.us/tutorial/clojure_android/clojure_android.html

3:16 zmyrgel: uh, sweet :)

3:16 TheBusby: someone on the mailing list just got the REPL working too

3:16 IE, compile on the device

3:17 zmyrgel: I think coding clojure for android beats symbian c++

3:18 TheBusby: I suspect clojure is *much* slower than c++

3:18 I think android lets you compile C straight to ARM though for performance

3:19 hoeck: TheBusby: no, rhickey was not in favour of overloading the basic arithmetic primitives, IIRC, for perf reasons

3:20 TheBusby: ahh, I was hoping there might be a work around

3:20 hoeck: TheBusby: but you could (ns-unmap *ns* '+) and then use (defmulti + dispatch-fn) to create your own overloaded +

3:20 TheBusby: I need high performance + for handing doubles

3:20 all cake I guess

4:48 vika23: where can i find clojure.contrib.sql api's , it was there yesterday when i clicked the link "User Contribs" in clojure home page

4:49 Carkh: http://code.google.com/p/clojure-contrib/w/list

4:50 vika23: Carkh : thanks , will bookmark it :)

4:50 Carkh: your one stop shop for every contrib needs =P

5:25 doug_: Is there any way to add type annotations to the keys of a struct?

5:26 jdz: why?

5:26 doug_: 'cause I like type safety :-)

5:27 jdz: well, #java is --> that way

5:27 TheBusby: I wouldn't go that far

5:27 I'm not aware of any way to do it, but I could certainly see why you'd want to

5:29 doug_: jdz: I've just come from there :-) Seems an unnecessary restriction that I can annotate function parameters with types but not other points in the code.

5:29 jdz: doug_: you can

5:29 you annotate the code that uses the struct values

5:30 pulling out type information from structs would involve heavy type inferencing (or so it seems to me)

5:31 hoeck: doug_: the :tag metadata is only for the compiler to avoid reflection calls

5:31 jdz: otoh, it might be easier if the struct-maps could be treated as types as well

5:32 hoeck: doug_: but you could generate your own (typed) tuple class if you want to

5:32 doug_: alternatively, would be nice if structs could have validation functions attached to them.

5:32 hoeck: how would I do that?

5:33 hoeck: using genclass and a constructor

5:34 probably extending c.l.APersistentMap

5:36 doug_: hoeck: okay, thanks.

5:38 hoeck: doug_: this is a good example of subclassing a hashmap: http://bitbucket.org/kotarak/lazymap/src/tip/src/de/kotka/lazymap/LazyMap.clj

5:43 doug_: hoeck: thanks. very useful

5:53 jdz: the lazy-map thing looks nice as a clojure coding exercise, but all the interface consists of macros; i think i'd prefer to use delay/force explicitly

5:59 hoeck: jdz: there are functions to create lazymaps too, look for lazy-hash-map, which takes a map of keys - delays

5:59 jdz: lazy-hash-map looks like a macro to me...

5:59 or you mean lazy-hash-map*?

6:00 hoeck: yes, right, the trailing star functions

6:00 jdz: this would actually make me even more nervous if i have to explicitly delay something, and then get it implicitly forced..

6:01 but maybe i just have not seen a nice real world use case for it

6:02 hoeck: well, its only forced upon retrieval via get or seq

6:03 I'm using it to create indices over relations, to avoid calculating them all up front

6:04 jdz: well, but why not delay/force explicitly?

6:04 hoeck: by using the lazymap, i have a simple interface and only if I explicitly access it an index is created

6:05 simplicity? the code accessing the indices doesn't bother that they are lazy

6:07 jdz: well that would be one function for me...

6:07 but yeah, if that makes your code simpler then it's good

6:30 Chousuke: I wonder how submitting patches is going to work. doesn't look like assembla allows commenting on tickets by non-team-members :/

6:44 eevar2: could someone review http://pastebin.com/m7595a52c ? -- don't know enough git to know what i'm doing ;)

6:51 Chousuke: I have never used filter-branch either :/

6:51 eevar2: i tried asking on #git, but no response in there

6:56 rhickey: not sure if you like the idea, but I wrote up some recipes for separating clojurescipt into a new repo and removing it + clojureclr from contrib -- http://pastebin.com/m7595a52c

6:57 just one disclaimer; my git-foo is fairly weak, it's just cobbled up from stuff i found using google

6:59 rhickey: eevar2: thanks, we'll have to get someone with git-fu in contrib to own that process

7:21 Chousuke: the problem with filter-branch is that it changes history.

7:22 so while it's okay for extracting ClojureCLR and ClojureScript into their own repos, it shouldn't be used to modify contrib, because contrib is already public. :/

7:23 eevar2: look at --subdirectory-filter in git-filter-branch

7:24 oh, wait, never mind. you did :)

7:26 eevar2: rewriting history sounds bad, yea

7:27 as I said, my git-fu is weak :)

7:28 clojureclr shouldn't be extracted from contrib, btw

7:29 there are ~5 clojureclr commits in contrib, better clone from dmillers github repo

7:36 frodef: any guides anywhere on how to wrap up your .clj into a .jar (or .exe)?

7:36 jdz: one easy way would be to use NetBeans

7:36 like, make a dummy project and see how id does it

7:37 then you can also look at clojure/clojure-contrib

7:37 and to answer your question -- no i don't know of any guides :)

7:37 frodef: ok, thanks :)

7:38 cemerick: frodef: you can either just jar up your source directory (if you're going to be loading .clj files from the jar using clojure), or you can compile everything (say, using clojure.lang.Compile from ant), and then jar up the resulting classes-dir

7:40 frodef: cemerik: right, thanks.

7:41 here's something antsy I think: http://www.lithinos.com/Compiling-Clojure-applications-using-Ant.html

7:42 cemerick: yeah, that's the basic idea. I keep meaning to write up our ant process, which is nice insofar as it automatically determines what namespaces are available to be compiled (what you linked to and other things I've seen require one to manually track that somewhere)

7:43 frodef: I just have a single .clj and a single namespace, so I'm hoping I can copy manually for now :)

7:49 so.. it's the case that a namespace foo.bar.baz must reside in foo/bar/baz on the file-system?

7:54 achim: frodef: foo/bar/baz.clj, right

7:54 (doc require) says foo/bar/baz/baz.clj, but that's the old way, AFAIK

7:55 frodef: achim: thanks.. this is the Java Way, I gather.

7:59 cemerick: yes, the docs for require are out of date. I think Chousuke or Chouser was fixing that.

8:00 frodef: I'm getting the jar wrapped up, but running it yields a NullPointerException..

8:06 I'm doing (ns foo.bar.baz (:gen-class)) and (defn -main ..) shouldn't that make my class have a main?

8:07 hoeck: frodef: I believe you need (:genclass :main true) too in your ns-clause

8:08 frodef: yes, but the doc says :main true should be default.

8:08 cemerick: yes, :main true is the default, you don't need to specify it

8:08 frodef: paste your NPE

8:09 frodef: cemerick: sorry, what's that?

8:09 cemerick: hrm, no bot...

8:09 frodef: paste the NPE you're getting into paste.lisp.org (or some other pastebin) so we can see it in its entirety

8:10 frodef: right, but what's "NPE"? :)

8:10 cemerick: NullPointerException

8:10 frodef: ah.. not so used to those :)

8:10 cemerick: frodef: :-) From which foreign land are you coming?

8:11 frodef: it's a land far far away..

8:11 ..where NullPointerExceptions don't require a TLA..

8:12 cemerick: heh. I can sympathize.

8:12 Chouser: rhickey: I've been assuming we wanted to stick with the currect process of getting approval before creating a ticket for a bug or feature, but realized last night that's not the rails process at all.

8:15 rhickey: Chouser: thanks for getting that started! I was just tweaking it. Yeah, we'll need to add a reference to https://www.assembla.com/spaces/clojure-contrib/support/tickets, which has those guidelines

8:16 Chouser: oh, great. Then I'll leave you to it. Sorry I didn't get very far.

8:16 frodef: amazingly, it seems cut'n paste stopped workling here..

8:20 http://paste.lisp.org/+1R9D

8:21 I'd be grateful for any clues..

8:21 jdz: looks like something involving properties (like maybe build.properties file)?

8:22 frodef: I thought that was only involved at compile-time?

8:22 cemerick: yeah, something like...one of your imported classes loading a properties file at static init time, but the properties file isn't in the classpath?

8:22 jdz: well, you are running this with ant, or so it looks

8:23 frodef: same thing with java -jar app.jar

8:23 I don't know of anything loading properties.

8:23 cemerick: and your app.jar contains *everything* you want your clj file and its dependencies to use?

8:24 jdz: my Java/jar fu is very limited, too, but maybe meta-inf file in the jar is missing or bad

8:24 frodef: well.. can't say I know for sure.

8:24 jdz: it looked reasonable to me.

8:24 cemerick: frodef: ah -- clojure itself is failing to init, as it can't find its clojure/version.properties file

8:25 looks like the app.jar doesn't fully include clojure.jar

8:25 frodef: cemerick: right, there's no version.properties in there (never heard of it before..)

8:26 cemerick: no, the properties file is included in clojure.jar -- you need to either have clojure.jar on your classpath, or it needs to be merged into your application's jar

8:27 frodef: cemerick: I understood... here's the line from the build.xml I ripped: <zipfileset src="${clojure_jar}" includes="**/*.class" />

8:27 cemerick: that includes means it's excluding the properties file that clojure requires

8:27 I'd just remove the includes attribute

8:27 (which should include everything)

8:29 frodef: cemerick: that did the trick! thanks so much!

8:29 * cemerick oh so wishes that the jar file spec allowed for nested jars, so bundling things up into a single file weren't so error prone :-(

8:29 cemerick: frodef: np :-)

8:30 frodef: slightly strange that this Lithinos guy wasn't bitten by this.

8:30 (who wrote and blogged the build.xml)

8:30 cemerick: he wrote that before clojure's jar contained properties files

8:30 frodef: ah.. I see.. :)

8:46 Chousuke: rhickey: do you intend to add every person with a CA as a member to the clojure assembla space? or is that possible without giving git push privileges?

8:47 rhickey: Chousuke: considering that right this moment

8:48 Xcalibor: greetings

8:49 Chousuke: Assembla seems a bit confusing. I don't see any way to submit a ticket :/

8:49 cemerick: what were the incantations to emit and then apply at patch file that maintained multiple commits and authoring info?

8:49 s/at/a

8:49 rhickey: as a watcher you can submit a ticket on the support tab

8:49 Chousuke: git format-patch --stdout > foo.patch

8:49 git am < foo.patch

8:49 rhickey: cemerick: writing that up now

8:50 Chousuke: hm

8:50 cemerick: Chousuke: thanks :-)

8:50 Chousuke: forgot the branch name from git format-patch

8:50 just add the branch you want to generate a patch against.

8:50 * cemerick is moving his local patches to a github clone

8:50 Chousuke: why do you need to use git format-patch for that?

8:51 cemerick: rhickey: so the patch file approach will remain for bugfixes?

8:55 Chousuke: assembla permissions look a bit coarse-grained :/

8:56 frodef: Suddenly I'm getting "java.lang.IllegalStateException: Var no.selvaag.housedesigner.viewer/component-swing-tree-node is unbound." after I've compiled my .clj into a fresh clojure (in my emacs IDE). Same thing seems to happen with the ant build. This goes away if I manually compile that function (again) in emacs..?

8:58 this error comes at run-time, when the function is being called.

8:58 Chousuke: maybe you're using it before it's defined.

8:59 frodef: don't think so.. I compile the whole thing before I call anything.

9:00 Chousuke: I think the order still matters.

9:00 hmm.

9:00 cemerick: frodef: just because something is compiled doesn't mean it's been loaded (e.g. by require or use)

9:00 frodef: yes, I get compilation errors if the ordering isn't good.

9:01 cmerick: but everything is in the same file, this particular function is just one of many, and the others seemt to be defined ok.

9:01 well, this function is recursive, but it's been like that for some time now and worked just fine.

9:02 this all worked fine before the .jar venture, and I don't believe I've changed anything besides adding the :gen-class and defn -main.

9:03 cemerick: you can paste the exception

9:03 rhickey: cemerick: we need to get some experience with the ticket system. I don't like that github pull requests go nowhere useful, so they are definitely out. We might be able to point to branches/tags in other repos as patch sources, but it leave the dev history at risk, as a ticket might point at a repo someone has pulled down - what was their patch?

9:03 eevar2: possible to subscribe to clojure-dev@googlegroups.com without 'being a member'?

9:04 rhickey: but I want to leverage git's notion of history for bigger things

9:04 cemerick: rhickey: is it really not enough to require that pull requests specify a SHA?

9:04 frodef: Very weird, now the error occurs even when I do the exact same thing I did before the jar stuff, and at that point I'm rather sure it all worked well. hmpf.

9:05 * cemerick is likely just being dense

9:05 * frodef too

9:05 Chouser: eevar2: I was looking for that yesterday, and didn't see a way to get emails from the group without being a member. :-/

9:05 eevar2: hopefully I just missed it somehow

9:06 eevar2: there is an RSS feed that could be leveraged by a feed-to-email tool of some sort, but it would seem weird if that's the only way.

9:06 eevar2: Chouser: indeed

9:07 rhickey: cemerick: a sha in their root implies they've folded their patch into whatever their root notion is, including any other merging they've done - at risk of being a lot less clean then a branch from some master repo baseline

9:08 i.e. doing it right means mirroring their local branch server-side

9:08 at least that's my understanding

9:08 cemerick: well, there's nothing wrong with that, is there?

9:08 rhickey: cemerick: with what?

9:09 cemerick: requiring that people create a branch for a particular bugfix (based on a recent mainline), push that branch to github, and then send the pull request with the SHA into that branch

9:10 rhickey: not at all, sha into branch would be the requirement, now seems like a much higher bar than format-patch for a bugfix

9:10 frodef: It seems there are 3-4 functions in the middle of my (single) .clj that doesn't get compiled/loaded at all the first time I load the file..

9:10 cemerick: There's a lot of customs to adopt there, but surely not more than pushing plain text files around, and we end up keeping everything in the git-word.

9:10 s/word/world

9:10 frodef: (with no apparent error )

9:11 cemerick: rhickey: that doesn't seem onerous at all, IMO

9:11 rhickey: cemerick: really, format-patch does keep the commits and identity, the only difference is that the history is the master repo's history, i.e. the patch happened when it was applied on master

9:11 frodef: my goodness.. there was a missing closing paren.. :)

9:12 * frodef was dense indeed.

9:12 cemerick: OK; it was my understanding that merges in git were generally less prone to problems than, say, application of diffs from patch files.

9:12 rhickey: as bug fixes aren't long-running development efforts that require intervening coordinated merges (i.e. they just get rebased before submission), there isn't any loss to patches AFAICS

9:13 cemerick: definitely true, I made the exact same argument initially, and I definitely don't want to lose out on git's sophistication re: merging

9:13 Chousuke: cemerick: Linux kernel development revolves entirely around sending patches. git is very good at handling them :)

9:14 cemerick: Chousuke: well, patch management is an entirely separate topic of expertise in that community from what I gather, which scares the living hell out of me :-)

9:14 Chouser: if those applying patches to the repos (that is, rhickey) find there are frequently merge issues with patch files, the policy can certainly be changed later.

9:14 Chousuke: granted, at the end stuff gets pulled into the mainline from git branches set up by subsystem maintainers.

9:15 Chouser: oh, and contrib-collab'rs

9:15 rhickey: committers, generally

9:16 Chouser: ah, that's a better name.

9:16 rhickey: although git now makes everyone a local committer...

9:16 Chousuke: yeah

9:16 you could call them git lords :P

9:16 cemerick: I'm sure I'm far from "normal" in that I've *never* really trusted patch files, which is why I keep beating this dead horse. :-/

9:17 Chouser: user; CA'ed user (?); contrib-commiter; rhickey

9:17 rhickey: cemerick: I certainly wouldn't want any non-trivial change as a patch

9:18 cemerick: rhickey: I guess that's where the worry is for me. When does a change become non-trivial? What's the levenshtein distance threshold? ;-)

9:19 rhickey: user/contributor/committer/rhickey

9:19 * cemerick continue the pedantic pursuit of general applicability

9:19 cemerick: continues*

9:20 rhickey: cemerick: I don't know, there's not going to be a hard rule - if we get a huge scary patch, there's nothing stopping us from saying give me a repo pointer, and it should be easy to produce or the submission is suspect anyway

9:21 cemerick: I think you have to flip it over - for a simple change from a less well-known source, do you want to trust all of their prior merges?

9:21 or check them?

9:22 cemerick: rhickey: wouldn't you be facing the same check when working with a patch file?

9:22 s/check/choice

9:22 rhickey: if there weren't any merges, then the patch is rebased off master repo and there's no loss, at least with format-patch

9:23 has commit messages and authorship

9:23 cemerick: I'm not following what that has to do with trusting the changes involved. *anything* can be in a patchfile.

9:23 rhickey: cemerick: no, because the patch recipe requires rebase first, diff off master repo

9:23 cemerick: hrm

9:25 rhickey: contrast with, say, the chunks stuff I'm doing in a branch, might pull bugfixes across several times while working over time, I wouldn't want to rebase that and trash its history, creating a big patch

9:26 Chousuke: rhickey: rebasing doesn't necessarily destroy history

9:27 it just takes your commits that are on top of the original parent and applies them like a patch series on top of the new parent.

9:27 in the process you can merge them into one big commit, but you don't have to

9:28 rhickey: Chousuke: sure it does, because when you made those edits the world was different, and your decision-making process can no longer be observed, rebasing pretends you made them later

9:28 it's not simply a matter of keeping commits as individuals

9:28 Chousuke: hmm, true

9:30 so, when working on something, you should avoid rebasing. When you're done, decide whether the changes should be rebased or just merged?

9:30 doug_: I'm frequently finding that I am mapping a collection and then dropping any nils in the resulting collection using (filter identity (map fn coll)). Is there a function or macro that encapsulates this or am I missing some other approach?

9:31 * achim gets the impression of git being more of a low level support layer for implementing SCMs than an actual SCM, following this discussion ...

9:32 Chousuke: achim: originally it was.

9:32 achim: nowadays it has porcelain included :)

9:35 there are still many low-level "primitives" in $DESTDIR/libexec/git-core/

9:35 or plumbing, as the git guys call it.

9:36 cemerick: doug_: (remove nil? ...) is a little more concise, but there's no built-in fn for mapping and dropping nils (AFAIK)

9:37 Chousuke: (remove nil? ...) is also safer if your function happens to return a Boolean false :P

9:37 rhickey: cemerick: anyway, I'm not trying to beat a horse, or you :), but it is interesting to me. My first inclination was definitely - yay - no patches, do pulls, merges etc, yet what I see in public projects is a lot of patch-driven stuff

9:37 asbjxrn: gen-class only does things during compilation, how would I create a dummy class from the repl for example?

9:37 doug_: cemerik: not much more concise, but a lot more explicit and therefore probably a preferable idiom. thanks.

9:38 Chousuke: rhickey: I think for small things, pulls are simply a bit too heavyweight :)

9:38 rhickey: Chousuke: cemerick disagrees

9:39 asbjxrn: (Context: the java.util.prefs api requires a class passed to it when creating a preferences object. I thought of creating a my.namespace.foo class and passing that)

9:41 Chousuke: asbjxrn: make an anonymous function and call .getClass on it? :P

9:42 user=> (.getClass #())

9:42 user$eval__2625$fn__2627

9:42 asbjxrn: Ah, sounds like a plan.

9:43 cemerick: rhickey: nah, I'm the one that keeps going to the well.

9:45 I generally think that any plain-text-driven process is ripe for improvement, though, and I see something (git) that offers a different path, so unless the end goals aren't obtained, then I'll always prefer that different path.

9:45 rhickey: cemerick: what about the tracking issues? the project becomes dependent on a network of repos

9:46 cemerick: rhickey: at a minimum, it's a network of two repos (your local + github)

9:46 but it's not like your repo is going to get affected if I decide to delete mine on github

9:46 rhickey: cemerick: if you delete you repo no one can try your as-yet-unapplied patch

9:47 cemerick: rhickey: oh, I thought you were worried about applied changesets disappearing if a repo was deleted

9:48 rhickey: a repo pointer is dependent on the repo, a patch isn't

9:48 whatever that dependency implies

9:48 cemerick: if someone deletes their repo, or rebases it so the SHA indicated in a pull request is gone, whatever, then their patch doesn't get applied

9:49 I guess I'm not tuned into the repercussions of not being able to accrue patches (*especially* if there's an expectation that they be up to date w.r.t. your repo's mainline)

9:49 yason: At least for me, patches are as simple as it gets unless you know git inside out (I don't).

9:49 rys: I think that problem is likely to be very rare, and solved by discipline. Patches work for bigger projects because they're usually also offered in a manner of ways along with git. So tarballs, .debs with source, or whatever, so a patch to a mailing list is sometimes most appropriate

9:50 Accept them, sure, but I'd make a pull request the preferable way if it was me

9:51 Chousuke: I think most important now is to establish *some* kind of workflow to get started. it can change later if there are problems.

9:51 rhickey: cemerick: I guess as much as I also hate text files and diffs, I am wary of a project being constituted of a network of repos not under its supervision, vs say in a shop, where all devs' repos were 'owned'

9:52 in the latter case I would never use patches

9:53 cemerick: rhickey: I'm still not grokking the network-of-repos thing. There's your repo, which is authoritative, and a bunch of others. There would be some pile of pull requests, which you can take (or not) at your discretion, apply, and now your repo includes those changesets.

9:53 It's not like people would need to do local merges from multiple repos in order to get clojure.

9:54 baetis-fly: re: workflow. I use a modified version of http://blog.mhartl.com/2008/10/14/setting-up-your-git-repositories-for-open-source-projects-at-github/ to (barely) contribute to compojure. Would work equally well if using patches or pull requests. I branch for each fix/feature though. It's more complex, but it matches the command line experience more (origin is the project, not you github fork).

9:55 Chouser: github pull requests are not good, independent of the patch/branch question.

9:55 Chousuke: I also have two remotes in my local clojure clone. "origin" is rhickey's public repo, and "public" is my own

9:55 rhickey: cemerick: but the contributions won't have been made until they are pulled, if they disappear you can't go back to them (although with git you might be able to recreate them), you can't directly examine them - a lot of times I can look at a diff and say - no way, now I'll have to branch, pull and diff myself first

9:55 baetis-fly: Chousuke: that's the way I do it was well, but I'm not sure that's how most people use it. It's certainly not what the github docs would have you do.

9:57 cemerick: rhickey: does it really come down to disappearing branches/SHAs specified in pull requests?

9:57 if so, I'm not sure that's a common-enough problem to worry about

9:57 rys: That'd be terribly rare. You could even automate pulling those requests into a repo just in case

10:00 rhickey: cemerick: I'm not sure anyone has any idea at this point, being so early with git and no large projects doing what you are advising

10:01 as I said, in a closed shop I would never use patches

10:02 but having a project's history depend on a network of unsupervised repos seems shaky

10:02 cemerick: I guess I would say that the same metaphors should apply.

10:02 esp. since clojure's community is relatively small

10:02 rhickey: all our ticket system will have is joe:12345, fred:w7e3h4

10:03 cemerick: rhickey: again, why would your repo's history depend on any other repos at any time?

10:03 Chouser: cemerick: what's the danger again in using patches? Just the inconsitency?

10:03 cemerick: Chouser: eh, no danger, it's a well-worn system, of course. I just have an unbridled and probably irrational hatred of patch files.

10:04 I probably should just shut up, but rhickey is very accommodating. :-)

10:05 rhickey: cemerick: It's because I agree with your motivation, but found no one doing it that way

10:06 * cemerick , always the pioneer *snort*

10:06 rys: Well, there's no harm in supporting more than one way to get code into a repo. It just seems sane to make that via the git infrastructure you just chose, to take advantage of the change in dev model it affords you

10:07 err, make the preferred way even

10:07 cemerick: I yield the balance of my time to the gentleman from pixeltards.com (rys)

10:08 Chouser: I've never had a problem with patch files, and the (perhaps remote) possibility of trying to merge from a repo only to find it doesn't work (the repo's gone, the service is down, the user has been kicked out of the system, whatever) seems to outweigh any strikes against attaching git-formatted patches to tickets.

10:08 rhickey: so, here are some of the drawbacks to pulls again: I can't see what the patch is proposing without going through the hassle of applying it, outstanding patches really aren't in the system, there's no record of the actual contribution in the ticket system

10:08 rys: You can fetch and diff before merge

10:09 pull is fetch + merge combined

10:09 rhickey: rys: vs look at the ticket

10:09 rys: vs look at the commit log for the commit?

10:10 Ticket might have more info, sure, but you could just append the commit id and pull request there too

10:10 rhickey: rys: that's just a message, not code

10:10 the patch is readable

10:10 jackdempsey: you can get the code from the commit log

10:10 if thats what you'd want to see?

10:10 rys: So support patches :)

10:11 But I'd make pulls preferable if it was me. It's less grief in my experience

10:11 Chouser: cemerick_away: come back, we're not done disagreeing!!! ;-)

10:11 jackdempsey: haha

10:12 achim: a git noob qeustion: i issued a "git pull" and now have the clojure repo. "git branch" says there's just a master branch, while github shows me a "chunked" branch, among others. how to get that?

10:12 cemerick_away: Chouser: heh, we can argue more later, I've got some handball to play :-)

10:12 rys: We use the pull model where I work, on projects where the maintainer is in your position in terms of the number of repos he's likely to get requests from (not a huge amount), and it's less effort than automating patch infrastructure (again, in my experience)

10:12 baetis-fly: achim: git branch -a

10:12 jackdempsey: fwiw achim its a 'git clone' to get the repo....pull is a combination of fetch+merge

10:13 and if you want to work on a branch locally that's based off a remote branch, you can do "git checkout -b my_chunked origin/chunked"

10:14 rys: If you do go down the patches route, there's a bunch of extra tooling to support that available from many places (to support auto extract of patches from an inbox, signoff support, split patches etc)

10:15 achim: jackdempsey, beatis-fly: thanks! i see, reading up on git seems inevitable ;)

10:15 rys: So I'd borrow that stuff and not reinvent the wheel

10:15 rhickey: rys: I would use the pull model where I work too, as I said, but this is a public project where contributors are likely to come and go, as I must presume will their repos, leaving the ticket system with dead references to joe:1h2a7s

10:15 rys: rhickey: yeah, I see where you're coming from. There's really sweet tooling to support both/either at the end of the day

10:15 rhickey: Imagine if instead of taking patch files we took URLs to patches. Thats what ull requests to public repos feel like to me - ephemeral

10:16 baetis-fly: one advantage of using patches is that people don't have to mess with github/a public repo if they don't want to.

10:16 for a very small contributor github does get in the way.

10:16 rhickey: baetis-fly: it will still be a requirement that patches be produced by git's format-patch

10:16 rys: git format-patch ftw!

10:16 baetis-fly: rhickey: as it should be.

10:17 Chouser: ah, git will be required, but not github. That's a nice point.

10:17 baetis-fly: i didn't mean to say they didn't have to mess with git, just that they don't need to setup a github account and do a fork.

10:18 rys: Yeah, I could host my clojure repo anywhere, as long as it's public

10:18 baetis-fly: because really, github just confuses the issue for people new to github.

10:18 er, new to git.

10:18 Chouser: rys: but with patches you don't even need a public place to host a repo.

10:18 baetis-fly: exactly.

10:20 rys: Well, I was somewhat assuming the project would support both, just with one preferred

10:21 Chousuke: gitorious seems to have a bit better merge request support :/

10:21 too bad assembla doesn't support it :P

10:22 you can actually comment on merge requests and they stay in the system after the merge, marked as "merged"

10:22 eevar2: what happens when two forks apply the same patch? will git deal gracefully with that? what happens if the changes are pulled instead, any difference?

10:22 Chousuke: eevar2: it depends. if the patch is applied on the same parent, it'll work fine.

10:23 rys: merging from multiple remotes is fine as long as ancestors are common

10:23 Chousuke: if not, you need a merge.

10:24 rys: manual merge there, yes

10:25 s450r1: Perhaps I'm really confused, but what are the advantages to using a DVCS if you don't pull from other repos? Using patches for contributing would work fine with Subversion.

10:26 Chousuke: s450r1: local commits and branches. and git actually retains authorship information

10:26 so that instead of rhickey being the committer of everything, you get the *real* committer. :P

10:27 baetis-fly: s450r1: Another is that you've immediately got hundreds of pristine backups of your tree (as long as people aren't working on master, and they shouldn't be).

10:28 rys: Even if they are, you just remove the commits until the point when you last committed to master

10:28 Chousuke: and git will catch corruption because it has hashes of everything

10:29 s450r1: witness the recent savannah.gnu.org breakdown. git-using were basically unaffected, while SVN and CVS users had to go through hoops to get their data restored from a backup :P

10:29 git-using projects*

10:30 s450r1: all good points, thanks

10:33 although I think the local commits and branches and backup ideas would work with "git svn". I think authorship information would too.

10:33 Chousuke: s450r1: not really.

10:33 git svn handles local stuff fine but it's painful when you actually need to commit to the svn repo

10:34 s450r1: I'm all in favor of using git, but it seemed that not pulling from other repos is ignoring the main advantage a DVCS gives you.

10:35 Chousuke: s450r1: the debate is about whether it should be the main method of contribution I think

10:35 s450r1: you'd still have separate repos for larger projects I suppose.

10:35 like clojure-in-clojure

10:35 s450r1: Chousuke: I'm not real knowledgeable about git, but I've been using "git svn dcommit" at work without any problems.

10:36 Chousuke: sorry, I didn't mean to distract from the main debate

10:36 Chousuke: s450r1: the problem with it is that you can't share commits or branches between two "git-svn" repos without a lot of hassle.

10:36 rys: You should really only use git svn for gateways, imho

10:36 Chousuke: since dcommitting changes the hashes and confuses git, and everyone needs to rebase and fix their branches

10:37 rys: +uni-directional

10:37 Chouser: s450r1: I do that too. One interesting difference is that the people with rights to commit to a git repo can be small, and yet when they approve a change from some other author, that authorship gets recorded directly in the official repo.

10:38 Chousuke: you suppose Clojure should use signed-off-by -tags? :)

10:38 maybe not.

10:38 s450r1: Chousuke and Chouser, excellent points

10:38 rys: I'd use signed-off-by if rhickey wasn't the only maintainer

10:38 Chousuke: contrib perhaps could though.

10:39 rys: If he lets others commit to master in his stead, it's worth having some kind of signoff

10:39 hiredman: ~scala

10:39 clojurebot: Unfortunately the standard idiom of consuming an infinite/unbounded resource as a stream can be problematic unless you're really careful -- seen in #scala

10:40 hiredman: why not just do patches for month and revist the issue then?

10:40 Chousuke: it's only adding a -s to "git am" when applying patches anyway :)

10:51 Xcalibor: greetings (again)...

10:55 any advice about how to process a file (not necessarily too big, about 3000 lines).. I have a fairly expensive calculation to do over every line, but I guess clojure.contrib.duck-streams/read-lines is sequential even if I use pmap: (pmap myfoo (read-lines "file.txt"))

10:56 Chouser: Xcalibor: if the CPU is the bottleneck, reading the lines in order like that should be fine.

10:56 Xcalibor: it takes several seconds to do each line, it would be nicer if I could do it concurrently... can slurp handle such a file into an array?

10:57 hiredman: Xcalibor: the only sequential part is reading the file, which will always be sequential

10:58 you may want to look at seque to keep pmap running

10:58 Xcalibor: so if I put the file into a vector, will clojure to be able to handle it concurrently afterwards?

10:58 hiredman: ,(doc seque)

10:58 clojurebot: "([s] [n-or-q s]); Creates a queued seq on another (presumably lazy) seq s. The queued seq will produce a concrete seq in the background, and can get up to n items ahead of the consumer. n-or-q can be an integer n buffer size, or an instance of java.util.concurrent BlockingQueue. Note that reading from a seque can block if the reader gets ahead of the producer."

10:58 hiredman: ,(doc read-lines)

10:58 clojurebot: "clojure.contrib.duck-streams/read-lines;[[f]]; Like clojure.core/line-seq but opens f with reader. Automatically closes the reader AFTER YOU CONSUME THE ENTIRE SEQUENCE."

10:59 hiredman: Xcalibor: it would make no difference

10:59 danlarkin: I love the warning at the end of the read-lines docstring

10:59 arohner: hiredman: why would it make no difference if he slurped the file into memory and then used pmap?

10:59 hiredman: arohner: because he is slurping the file into memory anyway with read-lines

11:00 that is what "reading" a file does

11:00 arohner: and if the calculation is expensive enough, the calculation will dominate compared to reading the file

11:00 hiredman: yeah

11:00 Chouser: no need for seque

11:00 hiredman: Chouser: depends

11:00 Chouser: (pmap (fn [line] (Thread/sleep 1000) (.toUpperCase line)) (ds/read-lines "/tmp/tmp.txt"))

11:00 Xcalibor: ok, i see... however if i have the file in memory i could set up concurrent agents to do the job in parallel?

11:01 hiredman: Xcalibor: or just pmap

11:01 Chouser: with a four-line text file, that completes in slightly over 1 second.

11:01 hiredman: Chouser: but pmap is not completely eager

11:01 Chouser: hiredman: oh, I see your point.

11:04 hiredman: Xcalibor: pmap is built on future, and future is the samething has (send-off (agent nil) some-function)

11:04 (more or less)

11:07 Xcalibor: hiredman: I see... so I just have to try and improve the algorithm speed, right?

11:09 hiredman: Xcalibor: I would compare pmap and map times, to see if pmap is really giving you a speed up

11:10 Xcalibor: I take it that (map f coll) is the same as (doseq [x coll] (f x)) right?

11:10 hiredman: no

11:11 doseq returns nil and is eager

11:11 much more like a for loop

11:11 map returns a lazy-seq

11:12 doseq is very side-effecty

11:12 arohner: was that jcall / jfn thing that rich posted in IRC every checked in anywhere?

11:14 Chousuke: arohner: I don't think so :/

11:14 arohner: second, related question, I think I need a more generic version of with-open

11:14 Xcalibor: well... i'll try to make it faster tomorrow, for today, it's already churning lines.. :-)

11:15 thanks for your help... see ya around!

11:15 arohner: like (with-proc f [name init])

11:15 f is a function of one argument, calls (f name) in all cases

11:16 Chouser: arohner: try/finally is too verbose?

11:16 arohner: I use it very often

11:16 Chouser: oh, you still want the 'name' bound.

11:16 arohner: right

11:16 I want exactly with-open, but I want to choose which function gets called, rather than (.close name)

11:17 Chouser: you have a variety of other method names to call? I think I've made my own with-foo for some app or other.

11:18 arohner: yeah, I wrote a with-foo too, but it's not as nice as with-open's destructuring

11:18 so this would let you do

11:18 (def with-quit (part with-proc (quit name)))

11:19 and I already have a with-foo in my code, and now I'm contemplating a second

11:20 Chouser: ah

11:20 clojurebot: Paul Graham is the creator of the other new lisp

11:24 Chousuke: ~arc

11:24 clojurebot: POLO! nya nya you can't see me

11:24 Chousuke: :D

11:24 sometimes the fuzzy matching is a bit unpredictable :)

11:25 Chouser: more fun that way

11:25 Chousuke: arohner: perhaps you could just look at with-open and make it more generic :)

11:25 it's not particularly complex.

11:26 arohner: Chousuke: that's the plan. I was just making sure I had a good idea first

11:26 :-0

11:26 :-)

11:27 Chouser: I think the idea is sound, but it seems to me the details could use some work.

11:28 arohner: Chouser: which details could use work?

11:28 Chouser: like, it's a shame that the thing that happens at the end appears at the beginning of the block of code.

11:28 rhickey: scopes are coming

11:28 Chouser: and the name doesn't really suggest 'finally' ... with- is used for lots of dynamic scope stuff.

11:30 arohner: so the name change is easy. How would you suggest making the 'finally' thing happen near the end?

11:31 Chouser: arohner: dunno -- may not be worth it, I guess.

11:31 Chousuke: (on-scope-exit f [...] )?

11:31 Chouser: (let-finally [x (make-x)] .... (finally (.quit x))) :-/

11:31 rhickey: scopes separate the scope from the action, so the whole notion of at the end/beginning is fuzzy

11:32 you say what the cleanup is near the resource creation

11:32 Chouser: I think I used to know what scopes were going to do.

11:32 * arohner does not know what scopes are going to do

11:34 Chouser: http://paste.lisp.org/display/73838 -- scope blocks

11:35 arohner: cool

11:36 Chouser: almost 5 months ago -- no wonder it's a bit hazy for me. :-)

11:36 Chousuke: could you use that for a lazy seq backed by a file somehow? :/

11:36 Drakeson: how do you turn [:a 1 :b 2] to {:a 1 :b 2} ?

11:36 rhickey: Chousuke: exactly, that and many others

11:36 Chousuke: Drakeson: apply hash-map

11:37 Drakeson: thanks

11:37 rhickey: first cut at patch guidelines - thoughts? http://clojure.org/patches

11:41 Chouser: perfect

11:41 Chousuke: can a patch contain more than one commit?

11:42 it could be useful if the changes are related

11:42 baetis-fly: very good.

11:43 Chouser: do we want "fixes #42" in the original commit msg? I think that would make it so when a committer pushes it to master, assembla would close the ticket automatically.

11:44 arohner: shouldn't the clojure regression tests be in clojure proper rather than contrib?

11:45 * Chousuke applies for clojure-dev membership

11:45 Chouser: arohner: why?

11:45 arohner: so the tests stay in sync with the code

11:45 making a change to clojure proper that affects the test would require two patches

11:45 that should be applied inside a do-sync :-)

11:46 Chouser: arohner: as it stands, the community has easier access to updating the tests than if those changes had to go through rhickey.

11:46 heh

11:46 Chousuke: don't the tests also depend on contrib?

11:47 Chouser: well, what you're describing is a breaking change -- it may actually be more useful to know that contrib depends on that set of tests passing.

11:47 arohner: Chousuke: oh, that is a good point

11:47 Chousuke: but it is a bit problematic,

11:47 Chouser: Chousuke: good point.

11:47 Chousuke: since contrib and clojure evolve separately, you could have clojure in a state where the tests won't work because of a change :/

11:48 and it'd be hard to tell which revision of the tests are valid for a given version of clojure.

11:51 so while the tests should be in the main repo, it'll also require accepting test-is as part of Clojure

11:51 with any dependencies it has ;/

11:52 hiredman: :/

11:53 Chousuke: apparently it depends on c.c.template and c.c.stacktrace

11:53 Drakeson: how would you restrict a hash-map to a set or coll of keys? (?? {:a 1 :b 2 :c 3} [:a :b]) -> {:a 1 :b 2}

11:54 hiredman: or we could just keep it in contrib

11:54 Chousuke: and template depends on walk ;/

11:54 Drakeson: (zipmap keys (map keys themap))

11:54 hiredman: ,(reduce dissoc {:a 1 :b 2 :c 3 :d 4} [:c :d])

11:54 clojurebot: {:a 1, :b 2}

11:55 Chousuke: hmm

11:55 that doesn't quite work

11:55 mine, that is

11:56 arohner: ,(doc select-keys)

11:56 clojurebot: "([map keyseq]); Returns a map containing only those entries in map whose key is in keys"

11:56 hiredman: ooo

11:56 Chousuke: oh, cool.

11:56 ,`select-keys

11:56 clojurebot: clojure.core/select-keys

11:56 Chousuke: figures :P

11:56 Drakeson: arohner: sweat, thanks

11:57 Chousuke: actually, mine would have worked if I had used (map themap keys) instead ;/

11:58 Drakeson: wasn't there an "apropos" function in the repl?

11:58 Chouser: find-doc

12:10 rhickey_: Chouser: I was wondering about 'fixes #42' - we don't really have a separate acceptance test phase, but fixes in the patch commit will close the ticket with no option for another workflow. Could we put that on the merge, or is that not guaranteed to generate a commit?

12:11 gnuvince: Open question for you guys: do you think that the fact that functional code is usually a lot more nested than flat imperative code one of the reason why many programmers frown upon it?

12:13 hiredman: gnuvince: I dunno that people frown on it, they just are not exposed to it

12:13 I think the main thing people have trouble with is letting go of mutable state

12:14 gnuvince: hiredman: which is one thing that lets them have flat code

12:14 they declare an object

12:14 baetis-fly: gnuvince: If people do frown upon it, it's because it's different. That difference could be nesting/state/whatever.

12:14 gnuvince: then perform 7 operations on it to bring it to the state they want

12:15 Chousuke: gnuvince: if you want flatter code, make a function :)

12:16 gnuvince: Chousuke: just wondering aloud

12:16 Chousuke: doesn't always help I guess, but if you're nesting a lot, then perhaps it'd help to break up the nesting parts into a separate function

12:16 gnuvince: I've got quite a few functions that are just a big let containing numerous bindings and one simple expression.

12:17 Chousuke: heh

12:17 baetis-fly: i end up writing functions like that whenever i need to do java interop.

12:19 Chousuke: one of the worst examples of this I know is destructure :P

12:19 ~destructure

12:19 clojurebot: I don't understand.

12:19 Chousuke: ~def destructure

12:23 arohner: I got with-proc working. I just replaced one line in with-open, and I'm able to define with-open in terms of with-proc

12:24 Chousuke: :)

12:24 arohner: since it's a macro, is there any cleaner way to define new 'versions'? currently it looks like

12:24 (defmacro with-close [bindings & body]

12:24 `(with-proc (fn [x#] (jcall x# "close")) ~bindings ~@body))

12:24 Chousuke: why the jcall?

12:24 arohner: to call (.close x)

12:24 which is what the current with-open does

12:25 Chousuke: why not just (~'.close x#)

12:25 arohner: oh, good point

12:25 I'm in macro-land

12:25 Chousuke: the ~' may even be unnecessary, actually.

12:26 `.close

12:26 ,`.close

12:26 clojurebot: .close

12:27 hiredman: scopes just need to be pushed

12:28 then resource handling stuff can just attach to the enclosing scope

12:28 Chousuke: you could even have something funky like (with-finalise {x (.close x)} [a item b another-item] ...)

12:28 looks rubyish :)

12:29 arohner: yeah, that's a lot of ceremony

12:30 hiredman: when are scopes coming? I need a solution to this soon, and I don't mind making the change twice

12:30 hiredman: arohner: you could try out "horizons"

12:31 Chousuke: arohner: I think you should go with your custom solution for now.

12:31 hiredman: which is what I called my implementation of scope

12:31 http://github.com/hiredman/clojurebot/blob/8d9f43016d388c9ee2ceeda85aa199ec56f4f7d3/hiredman/horizon.clj

12:32 I haven't really used it

12:32 but it follows the scope teaser rhickey posted

12:32 ~scope

12:32 clojurebot: scope is at http://paste.lisp.org/display/73838

12:33 hiredman: so you have a function "reader" which produces a reader, and inside reader you call (when-hrz :exits (.close rdr))

12:34 er

12:34 #(.close rdr)

12:34 technomancy: I like how the IRC channels for Apache projects are called "user-to-user support".

12:34 it's a nice euphemism for "nobody knows what they're talking about"

12:35 hiredman: hey now

12:35 so whenever "reader" is called it registers the reader it produces to be closed when the enclosing scope exits

12:37 oh, it does the fn wrapping for you, so (.close rdr) would be fine

12:44 ben_m: Hi there :) Is there a pastebin that supports Clojure?

12:46 hiredman: gist

12:46 but gist doesn't let you group pastes by channel

12:47 ben_m: Doesn't bother me :) Thank you.

12:47 rhickey_: lisppaste8: url

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

12:48 ben_m: Thanks :)

12:49 hiredman: the lisp.org pastebin is prefered for #clojure because of the above mentioned grouping feature

12:49 ben_m: Yeah.

12:50 Gist is pretty cool though.

12:51 lisppaste8: ben_m pasted "Kiloseconds" at http://paste.lisp.org/display/82002

12:52 ben_m: Just learning Clojure and I'm wondering if there's a better way of doing this.

12:52 Maybe more functional or in a more idiomatic way for a Lisp.

12:52 hiredman: excellent, now do it for an arbitrary date

12:53 I have been meaning to figure out how old I am in megaseconds

12:54 ben_m: Well, there you go.

12:54 Just change the 1000 into a 1000000 :)

12:54 danlei: probiers doch zuerst mal mit 1-2-3-5-motiven, hat trane auch oft gespielt ...

12:55 hiredman: no, that just tells me the kiloseconds since the epoch

12:55 danlei: ooh ... sorry guys

12:55 hiredman: I need kiloseconds since my epoch

12:56 ben_m: Oh, yeah.

13:44 Georges`: Hello

13:45 Question about clojure and SLIME

13:45 Who does the (add-classpath "file:///......./") when launching SLIME with swank-clojure ?

13:46 technomancy: Georges`: sounds like you've got an older version of swank-clojure; recent versions don't do that.

13:47 Georges`: Well, in my version (taken from Git), it actually doesn't do the (add-classpath ...), but this leads to swank being unable to connect to clojure, so I have to manually patch swank-clojure.el's swank-clojure-init to append the (add-classpath ...).

13:49 In the video (http://vimeo.com/2419596), at 04:13, when he runs SLIME, the (add-classpath ...) pops up...

13:49 technomancy: yeah, that video uses an old version of swank-clojure

13:49 in recent versions it gets added to the classpath in the right place so it doesn't have to happen after clojure is launched.

13:49 inside the swank-clojure-cmd function

13:52 Georges`: Oh, I see... I defined a swank-clojure-binary in a .bat...

13:53 and swank-clojure-jar-path, but swank-clojure-binary gets first priority...

13:53 so I don't get all the goodies like swank-clojure-library-paths, etc...

13:54 * technomancy only sets swank-clojure-jar-path and swank-clojure-extra-classpaths

13:55 technomancy: I'm not sure why you would want to use swank-clojure-binary

13:56 Georges`: obsolete docs :)

13:59 OK, working. Thanks!

13:59 technomancy: cool

14:00 cemerick: mmm, assembla is pretty good

14:02 Chousuke: I use swank-clojure-binary. it points to my nailgun clojure wrapper

14:02 Chouser: cemerick: if you figure out how to turn off some of the notification emails, let me know

14:02 I coulda sworn I saw an option for that, but I can't find it now.

14:02 cemerick: Chouser: http://www.assembla.com/spaces/new_items/clojure?settings=show ?

14:02 rhickey_: cemerick: yeah, I think it will be nice for us, you're now a member

14:03 technomancy: Chousuke: oh, that makes sense

14:03 cemerick: rhickey_: what's the status on getting the tickets out of googlecode?

14:04 rhickey_: cemerick: help wanted

14:04 Chousuke: doing it manually?

14:04 cemerick: yeah, it's too small of a job to bother scripting.

14:04 (IMO)

14:04 Chousuke: do I need to be a team member to enter tickets?

14:04 rhickey_: I've been working on this transition for a week now, at the expense of other things

14:05 but the goal is to empower others

14:06 gnuvince: rhickey_: speaking of which, I recall somebody talking about an online CA form to make it easier for people wishing to contribute.

14:06 Do you expect to have something like that?

14:07 dnolen: rhickey_: and you've been doing a fantastic job! twitter account, assembla, dev list, github, great stuff! this transparency is great.

14:08 rhickey_: gnuvince: there's something about someone bothering to print, sign and mail the CA that serves as a small indication to me that they are seriously interested in participating

14:09 Chouser: cemerick: yeah, that's it. thanks.

14:09 Chousuke: It'll deter people who would like to contribute just a patch or two to fix their issues, thoug h :/

14:09 gnuvince: rhickey_: ah, the Clojure-Dev litmus test, I see :)

14:09 technomancy: yeah, it does end up being biased against people who get turned off by busywork.

14:10 rhickey_: maybe

14:10 pjstadig: there is a CSV export of tickets from GoogleCode

14:10 cemerick: hrm, it's not that hard...

14:10 pjstadig: is there an import of some kind for assembla?

14:11 Chousuke: pjstadig: assembla apparently has an api for that

14:11 rhickey_: pjstadig: a csv of the report right?

14:11 cemerick: yeah, it doesn't contain the contents

14:11 Chouser: pjstadig: the csv doesn't include discussions or attachments... yeah

14:11 pjstadig: true

14:11 well attachments could be migrated

14:11 (manually)

14:11 but discussions?

14:12 rhickey_: on the assembla side there's:http://www.assembla.com/wiki/show/c8A2BGQEWr2RUvaaeP0Qfc/Integrate_with_Assembla

14:12 Chousuke: any news on the google bug about this?

14:13 I lost the URL :/

14:13 cemerick: it seems like it'd be acceptable for each ticket to have just a full dump of the discussion -- unless rhickey_ really cares, splitting each comment out into an assembla comment seems unnecessary (and probably pretty complicated w.r.t. matching users, etc)

14:13 rhickey_: cemerick: yes, full dump is fine

14:14 Chouser: Chousuke: http://code.google.com/p/support/issues/detail?id=148

14:14 no news

14:14 Chousuke: too bad :/

14:14 Chouser: Unless you meant this, which is worse: http://code.google.com/p/support/issues/detail?id=1689

14:15 cemerick: not-not-evil, again :-/

14:15 * rhickey_ clarified how to become a member of the assembla spaces: http://clojure.org/patches

14:16 cemerick: man, those default assembla alerts really are crazy

14:16 rhickey_: become a watcher, then ask on clojure-dev for a bump-up

14:18 cemerick: rhickey_: unless some better solution is immediately available, I'll volunteer to move the issues over manually

14:19 technomancy: "Just get an Assembla login (please use a recognizable name)" <= does that mean a real name, or a name that's consistent with your usernames on other systems?

14:19 Chousuke: cemerick: Going to do it right now? I can help.

14:20 rhickey_: cemerick: great - thanks! wanna ping the clojure-dev group so people don't step on each other?

14:21 cemerick: Chousuke: yeah. I'll bet we can tag-team it within a half-hour.

14:21 Chousuke: though rhickey_ needs to make me a member of the clojure (and -contrib) space first, apparently. Seems like there's no way to post issues if you're not a member :/

14:21 rhickey_: technomancy: something I can find on http://clojure.org/contributing

14:21 cemerick: rhickey_: I was going to ask: does it matter if the issue IDs remain the same?

14:22 Chouser: Chousuke: can you create a ticket via the Support tab?

14:22 Chousuke: ah! yes I can.

14:22 wasn't there earlier :)

14:23 rhickey_: Chousuke: http://groups.google.com/group/clojure-dev/browse_frm/thread/99e2728f665c52fa

14:23 cemerick: not sure if that's even possible, is it?

14:23 Chousuke: don't use the support tab if you have a CA

14:23 cemerick: rhickey_: well, if you can delete everything in assembla, and then if we add the issues in in order, that should do it

14:24 Chousuke: hm, but that doesn't parallelise very well :P

14:24 cemerick: yeah, we'd have to just do it in two shifts :-)

14:25 I'll bet tickets can't be deleted though

14:25 rhickey_: cemerick: I'm not sure deleting them would free the number (I'd hope it didn't actually), but if you want to start from wherever we are, I'll avoid adding others - can't say other people won;t submit though

14:25 technomancy: often incremental IDs don't start from zero again even if you delete everything.

14:25 cemerick: hrm, actually, it's better if we add them in order anyway, so we maintain the chronology

14:34 Chousuke: OK, I'm ready to go...shall I take the first 60?

14:36 Chousuke: okay

14:37 So are we going to keep the order? :/

14:38 is it worth it? Maybe we should just add a reference to the original issue number

14:38 cemerick: Seems like a really good idea -- otherwise, default ordering of tickets will list prehistoric stuff next to things from 6 months ago

14:38 Oh, I'll be doing that too.

14:41 * rhickey_ hates nicks

14:41 achim: maybe it's a good idea to start the ticket summaries with their original numbers, so you can get the original ordering back by sorting Backlog alphabetically

14:42 cemerick: tickets rolling in now...

14:44 rhickey_: do you want all issues assigned to you, or only ones you "accepted" in GC?

14:45 rhickey_: cemerick: unassigned, thanks

14:46 Chousuke: cemerick: you'll be on the notification list for all these issues ;(

14:46 hiredman: clojurebot: assembla?

14:46 clojurebot: No entiendo

14:46 cemerick: rhickey_: just clarifying, so you don't want any issues assigned to you from GC?

14:46 hiredman: clojurebot: assembla is http://www.assembla.com/spaces/dashboard/index/b4-TTcvBSr3RAZeJe5aVNr

14:46 clojurebot: Alles klar

14:46 cemerick: Chousuke: oh well. I guess I'll know what's going on :-)

14:47 Chousuke: hiredman: hm, I don't know why assembla gives that weird url by default

14:47 clojurebot: forget assembla

14:47 clojurebot: I forgot assembla

14:47 jackdempsey: haha

14:47 Chousuke: clojurebot: assembla is http://www.assembla.com/spaces/dashboard/index/clojure

14:47 clojurebot: Ok.

14:47 hiredman: :(

14:47 ah

14:47 rhickey_: cemerick: no, I'll go through them again, thanks

14:48 clojurebot: assembla is http://www.assembla.com/spaces/clojure

14:48 clojurebot: 'Sea, mhuise.

14:48 cemerick: I'm leaving out dupes, only adding tickets that were merged into

14:48 hiredman: this is like the fourth or fifth time I have grepped through my irc logs looking for url

14:49 Chousuke: does "is" overwrite the old definition? or does it append?

14:52 wy_: Where can I find a complete documentation of Clojure? I can't seem to find more than one-sentence documentations for lots of things

14:53 Chousuke: holy crap assembla is spammy :P

14:53 hiredman: Chousuke: information rich

14:53 Chousuke: wy_: many things are only documented with a single sentene :/

14:53 hiredman: :P

14:53 wy_: :(

14:54 Chousuke: wy_: http://java.ociweb.com/mark/clojure/

14:54 wy_: How is the book?

14:58 Chousuke: seriously now, I turned off the notifications and I'm still getting spam :P

14:58 maybe it takes a while to go through.

14:59 rhickey_: Chousuke: yeah, I don't seem to be able to configure the stream defaults, but your individual settings should work - mine do

15:11 Chousuke: cemerick: we're lucky there are only 120 issues :P

15:11 cemerick: indeed

15:12 gawd, assembla spams like a blind nun

15:12 and I changed my prefs to send only a daily summary :-(

15:17 Chouser: switching to daily summary seemed to do it for me.

15:17 rhickey_: hourly is working for me

15:18 cemerick: unfixed issues are decidedly more pleasant to transfer than fixed ones :-P

15:18 Chouser: heh

15:18 do we even need fixed ones?

15:18 cemerick: TOO DAMN LATE CHOUSER!

15:18 ;-)

15:18 Chousuke: cemerick: what's wrong with fixed ones? the need for marking them as mixed? :P

15:18 ... fixed

15:19 actually, that would've been parallelisable ;/

15:19 cemerick: it's two additional click-load cycles

15:19 Chousuke: you could just have entered the issue and I could have marked them as fixed :P

15:27 cemerick: ...or I could have been ever-so-slightly-less-stupid, and just searched for "Fixed" among the issues I entered, and closed them all in one shot :-(

15:27 I think I scared Chouser ;-)

15:27 * Chouser cowers

15:28 Chousuke: cemerick: wonder if that'd work for me :)

15:32 cemerick: Chousuke: OK -- you're up :-)

15:33 Chousuke: cemerick: where's issue 59? :D

15:33 cemerick: huh -- there isn't one in GC....

15:33 that's interesting.

15:33 Chousuke: maybe it was deletet

15:33 d

15:34 cemerick: Chousuke: Couple of things: (a) I've been prefixing everything with "GC ", as you've seen (b) make sure you use the "code format" style, otherwise some of the text that gets copy-pasted out of google code produces crazy styles (which I need to fix in the first 5 issues or so I created)

15:35 ataggart: /msg NickServ identify passw0rd

15:35 leafw: ataggart: such a classic

15:36 ataggart: anda very common password, by the way.

15:36 Chousuke: cemerick: code format?

15:36 ataggart: lol

15:36 damn copy paste

15:36 I knew one day that'd bite me in the ass

15:37 cemerick: Chousuke: yeah, there's a "code block" format button above the description textarea that pops in <pre><code> tags, with the cursor properly placed

15:37 hiredman: ~ticket #1

15:37 clojurebot: ([2009-06-13T14:38:41+00:00] [Add chunk support to map filter et al]) http://tinyurl.com/mfpa6s

15:38 hiredman: ~ticket #19

15:38 clojurebot: ([2009-06-17T18:58:13+00:00] [GC Issue 15: JavaDoc for interfaces]) http://tinyurl.com/nwbq77

15:38 Chousuke: ~ticket #64

15:38 clojurebot: ([2009-06-17T19:38:52+00:00] [GC Issue 61: Make Clojure datatype Java Serializable]) http://tinyurl.com/mggn3q

15:39 Chousuke: neat.

15:40 cemerick: ugh, I've got the notification set to "daily summary", but I'm getting *everything*

15:40 Chouser: clojure vs. contrib project?

15:41 Chousuke: cemerick: did you use "low" or "lowest" for the priorities?

15:51 hiredman: ~ticket #19

15:51 clojurebot: {:summary GC Issue 15: JavaDoc for interfaces, :status :new, :created-on 2009-06-17T18:58:13+00:00} http://tinyurl.com/nwbq77

15:56 cemerick: Chousuke: low and normal ("medium" in GC) were the only two I used

15:59 rhickey_ seems to aggressively classify issues as "low"

15:59 Chouser: heh

16:01 rhickey_: cemerick: I hope to be able to use milestones to better partition the issues moving forward

16:02 cemerick: sure, whatever works for you. It just became very clear when copying things over :-)

16:02 Chousuke: issue 70 is a handful

16:03 23 comments and a whole bunch of patches :P

16:03 cemerick: Chousuke: Let me know if you run out of steam eventually

16:07 Chousuke: 8 attachments :P

16:07 luckily assembla is nice and ajaxy

16:11 arohner: ~ticket #70

16:11 clojurebot: {:url http://tinyurl.com/n8y2eq, :summary "GC Issue 67: clojure.lang.Compile doesn't provide a way to control *warn-on-reflection*", :status :new, :priority 4, :created-on "2009-06-17T19:57:04+00:00"}

16:12 hlship: I'm struggling with a problem.

16:12 I'm trying to create a new function in a namespace.

16:12 http://paste.lisp.org/+1RAA

16:13 I.e., so that the new function has access to imports and private functions of the namespace.

16:13 It works if I define it in the current namespace (the namespace containing the to-value-fn function).

16:14 Chouser: hlship: have you tried (binding [*ns* ...] (eval ...)) ?

16:14 hlship: Yes, found the (with-ns) macro

16:14 I wrap the (eval) with (with-ns namespace (eval ...))

16:14 Get Caused by: java.lang.Exception: Unable to resolve symbol: expression-form in this context

16:14 I've tried a few variations as well

16:15 such as moving the (with-ns) inside the (eval)

16:15 and failed in other ways

16:15 It's a bit of a heresy

16:15 but in Cascade, a template file is converted into a function

16:16 and the function should have access to all the same imported or private resources

16:16 available to a function defined with the namespace's .clj file

16:17 Chouser: where's with-ns ?

16:17 hlship: The code works for simple expressions, i.e., those that only use clojure.core

16:18 http://paste.lisp.org/display/82018#1

16:19 hiredman: where is the exception?

16:21 hlship: http://paste.lisp.org/+1RAA#2

16:21 The exception is in the call to (eval) with the (with-ns) macro

16:21 hiredman: (doc with-ns)

16:21 clojurebot: "clojure.contrib.with-ns/with-ns;[[ns & body]]; Evaluates body in another namespace. ns is either a namespace object or a symbol. This makes it possible to define functions in namespaces other than the current one."

16:22 hiredman: ~def with-ns

16:22 ugh

16:22 I imagine the problem is with-ns uses eval

16:23 Chouser: oh, indeed.

16:23 hlship: you don't need with-ns

16:23 hlship: Just do the (binding [*ns*]) myself, you think?

16:23 I'll give it a try.

16:23 Chouser: hlship: in fact, it's getting in your way, making it difficult (impossible?) to pass in your form variables.

16:24 hlship: http://paste.lisp.org/display/82018#3

16:24 technomancy: why does compiling this give me a No such file or directory error? (gen-class :name foo.bar.Derefer :implements [clojure.lang.IDeref])

16:24 hiredman: hlship: when doing namespace stuff like that you have to watch for def

16:24 Chouser: technomancy: does your "classes" dir exist?

16:25 technomancy: Chouser: yep; and it's on the classpath

16:25 err... maybe not

16:25 bleh

16:25 must have been overzealous in deleting

16:25 Chouser: any reason why it can't be created for you?

16:25 hlship: thanks for the help; current tests now pass

16:25 now to add tests that exercise access to private functions, etc.

16:25 clojurebot: functions are maps

16:26 Chouser: technomancy: hm, dunno.

16:27 Chousuke: one third done! phew, this takes time ;P

16:28 and in the mean time, assembla has sent me *46* emails

16:28 * technomancy temporarily unsubscribed to the twitter guy

16:29 lisppaste8: hsuh pasted "How to express this with loop/recur" at http://paste.lisp.org/display/82020

16:30 hiredman: eh?

16:30 Chousuke: oh crap, double post :P

16:31 no way to delete tickets it seems.

16:33 hiredman: ~ticket #70

16:33 clojurebot: {:url http://tinyurl.com/n8y2eq, :summary "GC Issue 67: clojure.lang.Compile doesn't provide a way to control *warn-on-reflection*", :status :new, :priority 4, :created-on "2009-06-17T19:57:04+00:00"}

16:35 cemerick: huh, when I checked out rhickey's clojure repo from github, it created a local branch for 1.0 and checked it out, instead of master...

16:35 hiredman: mine checked out master

16:36 cemerick: that's very strange

16:40 ...and, http://github.com/cemerick/clojure redirects to /tree/1.0, and /tree/master doesn't exist :-/

16:40 but I have an origin/master ref

16:44 devinus: there hasn't been too many updates to the clojure repo lately, is something going on?

16:44 cemerick: huh, there's a "default branch" setting in the edit pane of my repo, but no master listed there, either

16:45 hiredman: devinus: a lot of effort is going into migrating away from google code

16:45 cemerick: I've only forked repos on github that have one master branch, so this is new to me

16:45 devinus: hiredman: so, using git perhaps?

16:45 hiredman: devinus: github+assembla

16:45 ~github

16:45 clojurebot: http://github.com/richhickey/clojure/tree/master

16:45 hiredman: ~assembla

16:45 clojurebot: assembla is http://www.assembla.com/spaces/clojure

16:46 technomancy: so the main draw of assembla then is the fact that it supports milestones and linking tickets to them?

16:46 Chousuke: cemerick: you were really fast at this :P

16:46 cemerick: I'm only halfway through :D

16:46 devinus: hiredman: yes, that's exactly what i was wondering thanks. i've been stuck on SVN for amost a week now without updates

16:50 hiredman: devinus: it's not like you've missed a whole lot

16:50 devinus: hiredman: what kind of work is going on right now?

16:51 hiredman: well, currently Chousuke and cemerick are transfering tickets from google code to assembla

16:52 Chousuke: cemerick already did his part.

16:52 now it's all me :D

16:52 cemerick: odd, I deleted my fork, recreated, and now there's a proper master branch in my repo :-/

16:52 Chousuke: ~ticket #102

16:52 clojurebot: {:url http://tinyurl.com/mncnbf, :summary "GC Issue 98: \t proxy emits bytecode improperly referring to 21- & 22-arg overloads of IFn.invoke (Regression?)", :status :new, :priority :normal, :created-on "2009-06-17T20:52:20+00:00"}

16:52 Chousuke: hm

16:52 the tabs, they're evil

16:52 hiredman: *shrug*

16:52 Chousuke: oh well, they'll only show up in there.

16:53 22 to go...

16:59 devinus: what kind of work on clojure is going on now?

16:59 it seems repo updates kind of tapered off

17:00 hiredman: I would check out the assembla page

17:00 rhickey_: devinus: I'm working on chunked seqs, then 'instance', plus getting in 'scope', then clojure-in-clojure

17:01 but over the last couple of weeks a lot of time on this changeover and the JavaOne trip

17:01 hiredman: ~ticket #2

17:01 clojurebot: {:url http://tinyurl.com/n24rzw, :summary "Scopes", :status :new, :priority :normal, :created-on "2009-06-15T12:35:58+00:00"}

17:01 devinus: rhickey_: clojure-in-clojure, as in bluebook design (minus the whole writing your own vm part)?

17:02 (not that i'm knowledgable about anything like that)

17:02 rhickey_: not sure what is implied by bluebook design

17:04 but removing the few things that require recourse to Java (instance a big part of that), then rewriting the compiler in Clojure, getting better access to the analyzed syntax tree for tools etc, better modularity...

17:07 cemerick: rhickey_: The patches I have queued up are targeted at 1.0 -- are you ready for such things, or not yet?

17:08 rhickey_: cemerick: bugfixes?

17:09 cemerick: rhickey_: 2 definitely, one could be considered an enhancement, but I'd consider it a critical fix

17:09 rhickey_: which is?

17:09 Chousuke: cemerick: are you posting new issues to the GC tracker? :P

17:09 cemerick: rhickey_: adding an encoding argument to slurp

17:09 Chousuke: oh wait, never mind

17:09 cemerick: no, not me

17:09 Chousuke: I was just confused by issue number 121

17:09 but there was one missing

17:10 wy_: Can I write macros that produce functions, like: (defmacro m ([n] `(fn [x] (* x n)))). When this is called, I got error: java.lang.Exception: Can't use qualified name as parameter: user/x

17:11 arohner: wy_: macros try to resolve 'naked' symbols to namespaces, to make them hygenic

17:11 wy_: use x# rather than x

17:11 and ~n rather than n

17:12 x# does a gensym

17:12 wy_: It works. Thank you

17:14 rhickey_: cemerick: hrm, adding arguments isn't usually part of a bugfix release branch

17:14 cemerick: rhickey_: yeah, that's what I figured you'd say. :-) Not permitting the specification of a read encoding is badly broken IMO (not to put too fine a point on it).

17:15 * cemerick has a long history with text encodings

17:15 rhickey_: cemerick: sounds like a fine enhancement for 1.1

17:15 cemerick: lol yeah, OK :-D

17:18 wy_: Can it support nested backquotes and unquotes?

17:21 I'm trying to write something like: (defmacro power ([n] `(fn [x#] ~(if (= n 0) 1 `(* ~x# ~((power (- n 1)) x#))))))

17:21 so far it doesn't work yet

17:21 hiredman: uh

17:21 ~x# <-- no

17:21 clojurebot: x is y

17:21 hiredman: clojurebot: thanks!

17:21 clojurebot: Gabh mo leithscéal?

17:21 rhickey_: wy_: foo# won't work in nested contexts, you'll need gensyms

17:22 wy_: Thanks

17:32 Chousuke: phew

17:32 that ought to do it.

17:32 rhickey_: all issues should be migrated now.

17:35 cemerick: I just sent the all-clear on the issue tracker.

17:39 Chousuke: rhickey_: should I mark an issue as "ready to test" if I submit a patch for it? :)

17:42 rhickey_: cemerick: Chousuke: Thanks!!!

17:43 Chousuke: yes

17:43 Chousuke: it's only a doc fix so there's not much to "test", but I guess it's a nice indicator that there's a patch

17:44 cemerick: rhickey_: least I could do, since I don't add a lot of mojo around here :-)

17:46 Chousuke: oh crap, now I spotted a typo in the patch I posted :D

17:49 fixed

17:49 and adding all these issues earned me 125 messages from assembla ;(

17:51 cemerick: does anyone know why 'git push origin :foo' deletes the foo remote branch?

17:53 it's funny, I never thought anyone would bother with v1.0 patches, yet here I am tracking some

17:53 whoo-hoo, someone's impl a skip-tree

17:53 that's fantastic, if it's persistent -- I wouldn't have thought it possible...

17:54 Chousuke: cemerick: I guess because you're pushing "nothing" to it

17:54 so it's removed :P

17:55 cemerick: oh, X:Y means push local ref X to remote ref Y. I get it now.

17:56 Chousuke: I use it sometimes to push branches under different names.

17:57 cemerick: yeah. We manage to not step on each other's toes, so I've never had to do that before.

17:58 eh, the skip-tree is in Java as a replacement for PersistentTreeMap

17:59 Chousuke: where is this skip-tree?

18:00 cemerick: Chousuke: http://github.com/mspiegel/clojure/commit/baee6e122086932bd0a73b7e2ed1380a2ecfc681

18:00 Chousuke: from the group: "I think of it as repo = directed graph of nodes and pointers into the graph & git = graph editor" interesting take

18:01 hiredman: that is alot of red

18:01 cemerick: yeah, it's a full replacement.

18:01 Chousuke: maybe it should not be :/

18:01 or is it better than the rb-tree in all cases?

18:02 cemerick: in all cases, I believe

18:03 Chousuke: hmm.

18:03 Well, then I guess it would make sense

18:05 hiredman: that network tab sure is sweet

18:05 http://github.com/richhickey/clojure/graphs/languages :(

18:05 cemerick: is the skip-tree blessed as a PTM replacement (in concept, even)

18:06 ataggart: hiredman: one might read that as an indicator of the relative verbosity of java versus clojure :)

18:07 cemerick: I'll bet that ratio is pretty common across any language implementation (impl. language vs. hosted language)

18:15 ech, the sorted-set-by patch doesn't apply

18:26 Chousuke: hm

18:26 Clojure contrib issues must still be moved over ;(

18:26 hiredman: :|

18:27 Chousuke: there are only 41 of them though

18:27 but I'm not going to do it

18:29 durka42: manually?

18:29 Chousuke: yes

18:29 already did it for all the clojure issues

18:29 durka42: seems like someone should write a clojure program to do it

18:29 Chousuke: cemerick moved the first half and I the rest.

18:30 hiredman: I think the main issue is gc doesn't have an issues api

18:30 assembla does

18:30 gnuvince_: (doc *print-dup*)

18:30 clojurebot: "; When set to logical true, objects will be printed in a way that preserves their type when read in later. Defaults to false."

18:30 gnuvince_: What's the meaning of "dup"?

18:30 cemerick: *way* too small a job to script IMO

18:30 hiredman: gnuvince_: duplicate

18:30 I imagine

18:31 cemerick: yeah, I'm done with data entry for today :-)

18:33 hiredman: ~ticket #123

18:33 clojurebot: {:url http://tinyurl.com/lese6n, :summary "CG Issue 119: require doc out of date", :status :test, :priority :low, :created-on "2009-06-17T21:23:16+00:00"}

18:34 hiredman: hah, sure, test

18:38 Chousuke: rhickey_: I'm taking over the test ticket on contrib. turning it into a real one. (for moving the issues from GC)

18:38 I just thought #1 is suitable for it

18:38 durka42: ~ticket 122

18:38 clojurebot: Gabh mo leithscéal?

18:38 durka42: ~ticket #122

18:38 clojurebot: {:url http://tinyurl.com/lmuevk, :summary "GC Issue 118: Patch to add :svn to *clojure-version*", :status :new, :priority :low, :created-on "2009-06-17T21:22:20+00:00"}

18:38 durka42: ~ticket #124

18:38 clojurebot: {:url http://tinyurl.com/nnxh74, :summary "CG Issue 120: Determine mechanism for controlling automatic shutdown of Agents, with a default policy and mechanism for changing that policy as needed", :status :new, :priority :low, :created-on "2009-06-17T21:24:22+00:00"}

18:38 durka42: ~ticket #125

18:38 clojurebot: {:url http://tinyurl.com/lyy9mk, :summary "CG Issue 121: slurp should accept an encoding name", :status :new, :priority :low, :created-on "2009-06-17T21:25:14+00:00"}

18:39 durka42: GC --> CG somewhere :p

18:39 Chousuke: damn it :P

18:39 that obviously needs to be fixed.

18:39 durka42: can they be edited

18:39 Chousuke: sure.

18:40 that's what you get for editing things at midnight :P

18:40 * durka42 should submit a CA and join assembla

18:43 hiredman: watch out what you watch on assembla

18:43 you could get a few emails

18:43 Chousuke: yeah :P

18:44 I'm currently watching half of the tickets.

18:44 because I added them

18:44 durka42: email filters :)

18:44 hiredman: yeah

18:45 I have email from assembla skip my inbox

18:45 Chousuke: and I can't remove myself from the notifications list :((((

18:45 because I'm the submitter

18:45 this is evil

18:45 EVIL I SAY.

18:46 technomancy: you can always remove yourself from the notifications ... in your spam filter. =)

18:48 Chousuke: Okay, fixed the CGs as well... now I'm done for today :P

18:49 * durka42 hires Chousuke as a typist

18:54 mrsolo: hm look like aot doesn't save much

18:54 Chousuke: save much of what?

18:55 time? :)

18:55 mrsolo: right

18:55 startup time

18:55 Chousuke: right.

18:55 java's bad with that.

18:55 mrsolo: invoke via clojure.main @.. via gensum class...not whole lot of difference basically

18:55 s/gensum/gensym/

18:56 Chousuke: if you have a java application you run often (like the clojure repl), take a look at nailgun

18:56 mrsolo: nailgun works pretty good, yes

18:56 that is just a generally observation

18:56 so i don't know what the point of AOT is...other than not shipping the source code :-)

18:57 Chousuke: well, you need it for gen-class

18:57 technomancy: mrsolo: interop with Java APIs that require Real Classes, mostly

18:58 mrsolo: ah right

19:02 well just finish my first 'not a toy' clojure program

19:04 sure took longer for me to construct comparing to my other languages..hopefully this will improve over time fast

19:09 Chousuke: mrsolo: is clojure your first functional-programming language?

19:09 mrsolo: it takes a while to get used to it :)

19:09 mrsolo: hmm

19:09 no really

19:09 more functional than rest yes

19:09 i did scheme for few months years back

19:10 currently is mostly ruby now

19:10 it isn't functional style slowing me down anywa.. it is lack of familiarity with apis

19:10 Chousuke: ah, well, that SHOULD improve :)

19:11 and I SHOULD be sleeping :P

19:11 scgilardi: thanks for all the work today, chousuke and cemerick!

19:30 hsuh: anyone knows how to express this with loop/recur ? http://paste.lisp.org/display/82020

19:31 ctdean: Just replace your call back to draw-circle with recur

19:31 hsuh: but recur has to be the last statement... and there are two calls the way its written

19:31 right?

19:32 ctdean: youre right

19:32 I miss-read while as if

19:33 err, when as if

19:33 Chousuke: hmm

19:33 there's probably no simple way to make that into a loop.

19:34 at least, it won't be nearly as elegant as the recursive version :/

19:35 hsuh: oh, ok. i just wanted to check that.. its not really a problem now :)

19:35 Chousuke: ctdean: can you remove the other draw-circle call and just add an ellipse call?

19:36 hmm

19:36 * Chousuke is too tired to think everything through, making wild guesses :P

19:36 hsuh: for this solution i think so.. i could even rewrite it with level being a list do map perhaps

19:36 ctdean: chousuke: nope. it's describing a tree and we're walking that tree

19:36 hsuh: s/do/to

19:36 ctdean: I could be wrong :)

19:37 hsuh: but i wanted to check because it seems like a general "divide and conquer" problem.. i guess

19:37 ctdean: The way I would approach it is either leave as is and hope that level isn't too big, or describe the problem as a sequence and evaluate the sequence

19:38 hsuh: ctdean: only 6 recursive calls now :) not a problem

19:38 ctdean: hsuh: yea, don't worry about it

19:39 My functional-fu is weak

19:39 You'd think it would be better after years of scheme

19:41 Chousuke: hmm

19:41 you say the data structure is a tree?

19:41 ,(doc tree-seq)

19:41 clojurebot: "([branch? children root]); Returns a lazy sequence of the nodes in a tree, via a depth-first walk. branch? must be a fn of one arg that returns true if passed a node that can have children (but may not). children must be a fn of one arg that returns a sequence of the children. Will only be called on nodes for which branch? returns true. Root is the root node of the tree."

19:42 ctdean: Yes, that would be my appoach, or rethink the algorthim

19:42 Chousuke: ~def tree-seq

19:43 lisppaste8: hsuh annotated #82020 "with doseq" at http://paste.lisp.org/display/82020#1

19:44 ctdean: I'm too sleepy to tell if that's the same, sorry

19:45 hsuh: im tripping.. thats obviously not the same

19:45 Chousuke: yeah, I was wondering.

19:45 hsuh: :( embarassing...

19:45 ctdean: lol, it's all good

19:45 mrsolo: tree-seq is very nice :-)

19:45 hsuh: if i write a proper list comprehension, then i'd have a chance

19:46 mrsolo: file-seq however is very limited

19:46 i ended up modified the original so i can pass few functions

19:46 ctdean: SO you can prune dirs ands such?

19:46 mrsolo: ya

19:46 and depth

19:46 otherwise things explode

19:46 Chousuke: mrsolo: modified how?

19:47 mrsolo: wrap filter fucntion around listfiles

19:47 and pass in breath? function

19:48 so i can control if a particular directory needs to be expanded and what is the result of expansion and such, simple stuff

19:48 that speed up large directory processing considerablly :-)

19:50 hsuh: how can i have a lazy list of some number divided by 2 [20 10 5 ..] ?

19:51 hiredman: map

19:51 ctdean: (take 10 (iterate #(/ % 2) 20))

19:51 ~take 10 (iterate #(/ % 2) 20))

19:51 clojurebot: Pardon?

19:51 Chousuke: use ,

19:51 ctdean: ~(take 10 (iterate #(/ % 2) 20))

19:52 clojurebot: Excuse me?

19:52 ctdean: yea, oops

19:52 ,(take 10 (iterate #(/ % 2) 20))

19:52 clojurebot: (20 10 5 5/2 5/4 5/8 5/16 5/32 5/64 5/128)

19:52 ctdean: You always just use loop too

19:52 hiredman: ctdean: not lazy

19:52 Chousuke: or for

19:53 hmm, actually, it's trickier :)

19:53 ctdean: Isn't iterate lazy?

19:53 hiredman: it is

19:54 Chousuke: yes

19:54 hiredman: I meant loop/recur is not lazy

19:54 ctdean: oh! yes

20:05 hsuh: how can i generate this vector? [[0 5] [1 6

20:05 [[0 5] [1 6] [2 7]]... using range?

20:07 Chousuke: ,(map vector (range 3) (range 5 8))

20:07 clojurebot: ([0 5] [1 6] [2 7])

20:08 hsuh: tks

20:08 Chousuke: ,(vec (map vector (range 3) (range 5 8)))

20:08 clojurebot: [[0 5] [1 6] [2 7]]

20:08 Chousuke: :P

20:23 mrsolo: http://briancarper.net/blog/five-things-that-mildly-annoy-me-in-clojure

20:23 yep.. got bitten by some heh

20:24 replaca: mrsolo: saw that. I tend to agree with those, much as I love clojure.

20:24 mrsolo: i predict any? will show up :-)

20:24 ctdean: For the record: I wish java (and clojure) had TCO. No matter what he says

20:25 mrsolo: TCO?

20:25 ctdean: tail call optimization

20:25 mrsolo: ya

20:25 well he is waiting for jvm implementation right?

20:26 ctdean: The author of that blog post said noone who uses clojure loses sleep over TCO.

20:27 mrsolo: you can get aroun dit

20:27 just not as..nice

20:27 ctdean: The clojure way is an engineering compromise, seems like a good trade off to me

20:28 mrsolo: you can't really do continuation passing style without tco right?

20:29 ctdean: You can always use tampolining, if that's your thing

20:30 mrsolo: that hash thing sure is a suprise

20:31 ctdean: yea, it's annoying

21:36 durka42: whoa

21:36 * durka42 understands the term "assembla email deluge"

22:09 hiredman: ~everybody is <reply>everybody looks good in a shineheart

22:09 clojurebot: You don't have to tell me twice.

22:09 durka42: a what now

22:10 hiredman: pardon me

22:10 ~everybody is <reply>everybody looks good in a sheinhardt

22:10 clojurebot: Roger.

22:11 durka42: ~google sheinhardt

22:11 clojurebot: First, out of 887 results is:

22:11 Sheinhardt Wig Company — Blogs, Pictures, and more on WordPress

22:11 http://en.wordpress.com/tag/sheinhardt-wig-company/

22:19 arohner: is there a way to control the repl prompt?

22:19 like $PS1

22:20 hiredman: ,(doc clojure.main/prompt)

22:20 clojurebot: "/;nil; "

22:20 hiredman: ,(doc clojure.main/prompt?)

22:20 clojurebot: "/;nil; "

22:20 hiredman: oh

22:20 Chouser: the contrib repl can do that I think

22:20 hiredman: darn

22:20 durka42: ,(use 'clojure.contrib.repl-ln)

22:20 clojurebot: nil

22:21 durka42: (doc repl-prompt)

22:21 clojurebot: "([]); Returns the current repl prompt based on this repl's prompt-fmt"

22:21 * durka42 is afraid to start a sub-repl within clojurebot

22:22 arohner: hrm, slime isn't too happy with it

22:23 rabidsnail: Is there a way to test if a particular var is defined?

22:25 arohner: I can probably just binding clojure.main/repl-prompt

22:25 durka42: rabidsnail: resolve

22:25 ,(resolve 'not-defined)

22:25 clojurebot: nil

22:25 durka42: ,(resolve 'print)

22:25 clojurebot: #'clojure.core/print

22:26 rabidsnail: excellent

22:26 * durka42 goes to bed

22:59 JAS415: is there a way to make clojure.contrib.http.agents return anything other than headers?

23:00 arohner: grr, it appears slime hard codes the slime prompt, and doesn't work if I change the clojure.main/repl-prompt

23:38 jtal: anyone know the story of re-split ?

23:39 I've come across it in the book a few times and I dont think I saw anything that mentioned ints in str-utils

23:52 arohner: ,(doc clojure.contrib.str-utils/re-split)

23:52 clojurebot: "/;nil; "

23:52 arohner: hrm

23:52 anyways, it's there

23:53 jtal: yeah, I know its there

23:53 hiredman: ,(doc re-split)

23:53 clojurebot: "clojure.contrib.str-utils/re-split;[[pattern string] [pattern string limit]]; Splits the string on instances of 'pattern'. Returns a sequence of strings. Optional 'limit' argument is the maximum number of splits. Like Perl's 'split'."

23:53 jtal: just wondering why its used in the first few chapters of the book as if it was loaded

23:53 maybe I missed something that said "load this"

Logging service provided by n01se.net