#clojure logs

2009-06-17

00:56sverrejHow do I create a java.lang.reflect.Method from a Clojure function?
00:56sverrejI am using this Java lib that expects a Method object.
00:58hiredmanerm
00:58hiredmanclojure functions are not Methods
01:00sverrejI guess they have to be, at some level, to be able to work with Java?
01:00hiredmannope
01:01sverrejok
01:01hiredmanclojure functions are Objects
01:05cp2sverrej: perhaps the Method object you should be getting is FunctionClass.invoke(...)
01:06sverrejcp2: Yes, that's what I'm trying now.
01:24sverrejThis seems to do the trick:
01:24sverrej(.
01:24sverrej (. (fn hello [] "hello") getClass)
01:24sverrej getMethod "run" nil)
01:24sverrejthank you
03:02TheBusbyHow do you "realize" a ratio into a Double?
03:04hoeck,(float 1/4)
03:04TheBusbyhoeck: thank you!
03:05hoeckmhh, no clojurebot available :(
03:05hoeckTheBusby: np :)
03:08frodefHow can I write a macro that implicitly uses a lexical variable?
03:08hoeckTheBusby: oh, I forgot there is also: (double 1/5)
03:09frodefI.e (let [x 1] (foo)), where (foo) expands to e.g. (+ 1 x)
03:09hoeckfrodef: use ~'x in your expansion code
03:09TheBusbyhoeck: perfect, thanks!
03:10frodefhoeck: perfect, thanks!
03:10frodef:)
03:11hoeck:)
03:14TheBusbyis there anyway to "overload" the "+" operator for handing structs?
03:14TheBusbydefmethod doesn't appear to be valid
03:14zmyrgelcan clojure be used with android?
03:15TheBusbyzmyrgel: yes, http://groups.google.com/group/clojure/browse_thread/thread/cf9c928f0027836a
03:15TheBusbymore details, http://riddell.us/tutorial/clojure_android/clojure_android.html
03:16zmyrgeluh, sweet :)
03:16TheBusbysomeone on the mailing list just got the REPL working too
03:16TheBusbyIE, compile on the device
03:17zmyrgelI think coding clojure for android beats symbian c++
03:18TheBusbyI suspect clojure is *much* slower than c++
03:18TheBusbyI think android lets you compile C straight to ARM though for performance
03:19hoeckTheBusby: no, rhickey was not in favour of overloading the basic arithmetic primitives, IIRC, for perf reasons
03:20TheBusbyahh, I was hoping there might be a work around
03:20hoeckTheBusby: but you could (ns-unmap *ns* '+) and then use (defmulti + dispatch-fn) to create your own overloaded +
03:20TheBusbyI need high performance + for handing doubles
03:20TheBusbyall cake I guess
04:48vika23where can i find clojure.contrib.sql api's , it was there yesterday when i clicked the link "User Contribs" in clojure home page
04:49Carkhhttp://code.google.com/p/clojure-contrib/w/list
04:50vika23Carkh : thanks , will bookmark it :)
04:50Carkhyour one stop shop for every contrib needs =P
05:25doug_Is there any way to add type annotations to the keys of a struct?
05:26jdzwhy?
05:26doug_'cause I like type safety :-)
05:27jdzwell, #java is --> that way
05:27TheBusbyI wouldn't go that far
05:27TheBusbyI'm not aware of any way to do it, but I could certainly see why you'd want to
05:29doug_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.
05:29jdzdoug_: you can
05:29jdzyou annotate the code that uses the struct values
05:30jdzpulling out type information from structs would involve heavy type inferencing (or so it seems to me)
05:31hoeckdoug_: the :tag metadata is only for the compiler to avoid reflection calls
05:31jdzotoh, it might be easier if the struct-maps could be treated as types as well
05:32hoeckdoug_: but you could generate your own (typed) tuple class if you want to
05:32doug_alternatively, would be nice if structs could have validation functions attached to them.
05:32doug_hoeck: how would I do that?
05:33hoeckusing genclass and a constructor
05:34hoeckprobably extending c.l.APersistentMap
05:36doug_hoeck: okay, thanks.
05:38hoeckdoug_: this is a good example of subclassing a hashmap: http://bitbucket.org/kotarak/lazymap/src/tip/src/de/kotka/lazymap/LazyMap.clj
05:43doug_hoeck: thanks. very useful
05:53jdzthe 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
05:59hoeckjdz: there are functions to create lazymaps too, look for lazy-hash-map, which takes a map of keys - delays
05:59jdzlazy-hash-map looks like a macro to me...
05:59jdzor you mean lazy-hash-map*?
06:00hoeckyes, right, the trailing star functions
06:00jdzthis would actually make me even more nervous if i have to explicitly delay something, and then get it implicitly forced..
06:01jdzbut maybe i just have not seen a nice real world use case for it
06:02hoeckwell, its only forced upon retrieval via get or seq
06:03hoeckI'm using it to create indices over relations, to avoid calculating them all up front
06:04jdzwell, but why not delay/force explicitly?
06:04hoeckby using the lazymap, i have a simple interface and only if I explicitly access it an index is created
06:05hoecksimplicity? the code accessing the indices doesn't bother that they are lazy
06:07jdzwell that would be one function for me...
06:07jdzbut yeah, if that makes your code simpler then it's good
06:30ChousukeI wonder how submitting patches is going to work. doesn't look like assembla allows commenting on tickets by non-team-members :/
06:44eevar2could someone review http://pastebin.com/m7595a52c ? -- don't know enough git to know what i'm doing ;)
06:51ChousukeI have never used filter-branch either :/
06:51eevar2i tried asking on #git, but no response in there
06:56eevar2rhickey: 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
06:57eevar2just one disclaimer; my git-foo is fairly weak, it's just cobbled up from stuff i found using google
06:59rhickeyeevar2: thanks, we'll have to get someone with git-fu in contrib to own that process
07:21Chousukethe problem with filter-branch is that it changes history.
07:22Chousukeso 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. :/
07:23Chousukeeevar2: look at --subdirectory-filter in git-filter-branch
07:24Chousukeoh, wait, never mind. you did :)
07:26eevar2rewriting history sounds bad, yea
07:27eevar2as I said, my git-fu is weak :)
07:28eevar2clojureclr shouldn't be extracted from contrib, btw
07:29eevar2there are ~5 clojureclr commits in contrib, better clone from dmillers github repo
07:36frodefany guides anywhere on how to wrap up your .clj into a .jar (or .exe)?
07:36jdzone easy way would be to use NetBeans
07:36jdzlike, make a dummy project and see how id does it
07:37jdzthen you can also look at clojure/clojure-contrib
07:37jdzand to answer your question -- no i don't know of any guides :)
07:37frodefok, thanks :)
07:38cemerickfrodef: 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
07:40frodefcemerik: right, thanks.
07:41frodefhere's something antsy I think: http://www.lithinos.com/Compiling-Clojure-applications-using-Ant.html
07:42cemerickyeah, 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)
07:43frodefI just have a single .clj and a single namespace, so I'm hoping I can copy manually for now :)
07:49frodefso.. it's the case that a namespace foo.bar.baz must reside in foo/bar/baz on the file-system?
07:54achimfrodef: foo/bar/baz.clj, right
07:54achim(doc require) says foo/bar/baz/baz.clj, but that's the old way, AFAIK
07:55frodefachim: thanks.. this is the Java Way, I gather.
07:59cemerickyes, the docs for require are out of date. I think Chousuke or Chouser was fixing that.
08:00frodefI'm getting the jar wrapped up, but running it yields a NullPointerException..
08:06frodefI'm doing (ns foo.bar.baz (:gen-class)) and (defn -main ..) shouldn't that make my class have a main?
08:07hoeckfrodef: I believe you need (:genclass :main true) too in your ns-clause
08:08frodefyes, but the doc says :main true should be default.
08:08cemerickyes, :main true is the default, you don't need to specify it
08:08cemerickfrodef: paste your NPE
08:09frodefcemerick: sorry, what's that?
08:09cemerickhrm, no bot...
08:09cemerickfrodef: paste the NPE you're getting into paste.lisp.org (or some other pastebin) so we can see it in its entirety
08:10frodefright, but what's "NPE"? :)
08:10cemerickNullPointerException
08:10frodefah.. not so used to those :)
08:10cemerickfrodef: :-) From which foreign land are you coming?
08:11frodefit's a land far far away..
08:11frodef..where NullPointerExceptions don't require a TLA..
08:12cemerickheh. I can sympathize.
08:12Chouserrhickey: 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.
08:15rhickeyChouser: 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
08:16Chouseroh, great. Then I'll leave you to it. Sorry I didn't get very far.
08:16frodefamazingly, it seems cut'n paste stopped workling here..
08:20frodefhttp://paste.lisp.org/+1R9D
08:21frodefI'd be grateful for any clues..
08:21jdzlooks like something involving properties (like maybe build.properties file)?
08:22frodefI thought that was only involved at compile-time?
08:22cemerickyeah, something like...one of your imported classes loading a properties file at static init time, but the properties file isn't in the classpath?
08:22jdzwell, you are running this with ant, or so it looks
08:23frodefsame thing with java -jar app.jar
08:23frodefI don't know of anything loading properties.
08:23cemerickand your app.jar contains *everything* you want your clj file and its dependencies to use?
08:24jdzmy Java/jar fu is very limited, too, but maybe meta-inf file in the jar is missing or bad
08:24frodefwell.. can't say I know for sure.
08:24frodefjdz: it looked reasonable to me.
08:24cemerickfrodef: ah -- clojure itself is failing to init, as it can't find its clojure/version.properties file
08:25cemericklooks like the app.jar doesn't fully include clojure.jar
08:25frodefcemerick: right, there's no version.properties in there (never heard of it before..)
08:26cemerickno, 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
08:27frodefcemerick: I understood... here's the line from the build.xml I ripped: <zipfileset src="${clojure_jar}" includes="**/*.class" />
08:27cemerickthat includes means it's excluding the properties file that clojure requires
08:27cemerickI'd just remove the includes attribute
08:27cemerick(which should include everything)
08:29frodefcemerick: that did the trick! thanks so much!
08:29cemerickfrodef: np :-)
08:30frodefslightly strange that this Lithinos guy wasn't bitten by this.
08:30frodef(who wrote and blogged the build.xml)
08:30cemerickhe wrote that before clojure's jar contained properties files
08:30frodefah.. I see.. :)
08:46Chousukerhickey: 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?
08:47rhickeyChousuke: considering that right this moment
08:48Xcaliborgreetings
08:49ChousukeAssembla seems a bit confusing. I don't see any way to submit a ticket :/
08:49cemerickwhat were the incantations to emit and then apply at patch file that maintained multiple commits and authoring info?
08:49cemericks/at/a
08:49rhickeyas a watcher you can submit a ticket on the support tab
08:49Chousukegit format-patch --stdout > foo.patch
08:49Chousukegit am < foo.patch
08:49rhickeycemerick: writing that up now
08:50Chousukehm
08:50cemerickChousuke: thanks :-)
08:50Chousukeforgot the branch name from git format-patch
08:50Chousukejust add the branch you want to generate a patch against.
08:50Chousukewhy do you need to use git format-patch for that?
08:51cemerickrhickey: so the patch file approach will remain for bugfixes?
08:55Chousukeassembla permissions look a bit coarse-grained :/
08:56frodefSuddenly 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..?
08:58frodefthis error comes at run-time, when the function is being called.
08:58Chousukemaybe you're using it before it's defined.
08:59frodefdon't think so.. I compile the whole thing before I call anything.
09:00ChousukeI think the order still matters.
09:00Chousukehmm.
09:00cemerickfrodef: just because something is compiled doesn't mean it's been loaded (e.g. by require or use)
09:00frodefyes, I get compilation errors if the ordering isn't good.
09:01frodefcmerick: but everything is in the same file, this particular function is just one of many, and the others seemt to be defined ok.
09:01frodefwell, this function is recursive, but it's been like that for some time now and worked just fine.
09:02frodefthis all worked fine before the .jar venture, and I don't believe I've changed anything besides adding the :gen-class and defn -main.
09:03cemerickyou can paste the exception
09:03rhickeycemerick: 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?
09:03eevar2possible to subscribe to clojure-dev@googlegroups.com without 'being a member'?
09:04rhickeybut I want to leverage git's notion of history for bigger things
09:04cemerickrhickey: is it really not enough to require that pull requests specify a SHA?
09:04frodefVery 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.
09:05Chousereevar2: I was looking for that yesterday, and didn't see a way to get emails from the group without being a member. :-/
09:05Chousereevar2: hopefully I just missed it somehow
09:06Chousereevar2: 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.
09:06eevar2Chouser: indeed
09:07rhickeycemerick: 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
09:08rhickeyi.e. doing it right means mirroring their local branch server-side
09:08rhickeyat least that's my understanding
09:08cemerickwell, there's nothing wrong with that, is there?
09:08rhickeycemerick: with what?
09:09cemerickrequiring 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
09:10rhickeynot at all, sha into branch would be the requirement, now seems like a much higher bar than format-patch for a bugfix
09:10frodefIt 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..
09:10cemerickThere'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.
09:10cemericks/word/world
09:10frodef(with no apparent error )
09:11cemerickrhickey: that doesn't seem onerous at all, IMO
09:11rhickeycemerick: 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
09:11frodefmy goodness.. there was a missing closing paren.. :)
09:12cemerickOK; it was my understanding that merges in git were generally less prone to problems than, say, application of diffs from patch files.
09:12rhickeyas 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
09:13rhickeycemerick: definitely true, I made the exact same argument initially, and I definitely don't want to lose out on git's sophistication re: merging
09:13Chousukecemerick: Linux kernel development revolves entirely around sending patches. git is very good at handling them :)
09:14cemerickChousuke: 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 :-)
09:14Chouserif 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.
09:14Chousukegranted, at the end stuff gets pulled into the mainline from git branches set up by subsystem maintainers.
09:15Chouseroh, and contrib-collab'rs
09:15rhickeycommitters, generally
09:16Chouserah, that's a better name.
09:16rhickeyalthough git now makes everyone a local committer...
09:16Chousukeyeah
09:16Chousukeyou could call them git lords :P
09:16cemerickI'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. :-/
09:17Chouseruser; CA'ed user (?); contrib-commiter; rhickey
09:17rhickeycemerick: I certainly wouldn't want any non-trivial change as a patch
09:18cemerickrhickey: I guess that's where the worry is for me. When does a change become non-trivial? What's the levenshtein distance threshold? ;-)
09:19rhickeyuser/contributor/committer/rhickey
09:19cemerickcontinues*
09:20rhickeycemerick: 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
09:21rhickeycemerick: 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?
09:21rhickeyor check them?
09:22cemerickrhickey: wouldn't you be facing the same check when working with a patch file?
09:22cemericks/check/choice
09:22rhickeyif there weren't any merges, then the patch is rebased off master repo and there's no loss, at least with format-patch
09:23rhickeyhas commit messages and authorship
09:23cemerickI'm not following what that has to do with trusting the changes involved. *anything* can be in a patchfile.
09:23rhickeycemerick: no, because the patch recipe requires rebase first, diff off master repo
09:23cemerickhrm
09:25rhickeycontrast 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
09:26Chousukerhickey: rebasing doesn't necessarily destroy history
09:27Chousukeit 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.
09:27Chousukein the process you can merge them into one big commit, but you don't have to
09:28rhickeyChousuke: 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
09:28rhickeyit's not simply a matter of keeping commits as individuals
09:28Chousukehmm, true
09:30Chousukeso, when working on something, you should avoid rebasing. When you're done, decide whether the changes should be rebased or just merged?
09:30doug_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?
09:32Chousukeachim: originally it was.
09:32Chousukeachim: nowadays it has porcelain included :)
09:35Chousukethere are still many low-level "primitives" in $DESTDIR/libexec/git-core/
09:35Chousukeor plumbing, as the git guys call it.
09:36cemerickdoug_: (remove nil? ...) is a little more concise, but there's no built-in fn for mapping and dropping nils (AFAIK)
09:37Chousuke(remove nil? ...) is also safer if your function happens to return a Boolean false :P
09:37rhickeycemerick: 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
09:37asbjxrngen-class only does things during compilation, how would I create a dummy class from the repl for example?
09:37doug_cemerik: not much more concise, but a lot more explicit and therefore probably a preferable idiom. thanks.
09:38Chousukerhickey: I think for small things, pulls are simply a bit too heavyweight :)
09:38rhickeyChousuke: cemerick disagrees
09:39asbjxrn(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)
09:41Chousukeasbjxrn: make an anonymous function and call .getClass on it? :P
09:42Chousukeuser=> (.getClass #())
09:42Chousukeuser$eval__2625$fn__2627
09:42asbjxrnAh, sounds like a plan.
09:43cemerickrhickey: nah, I'm the one that keeps going to the well.
09:45cemerickI 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.
09:45rhickeycemerick: what about the tracking issues? the project becomes dependent on a network of repos
09:46cemerickrhickey: at a minimum, it's a network of two repos (your local + github)
09:46cemerickbut it's not like your repo is going to get affected if I decide to delete mine on github
09:46rhickeycemerick: if you delete you repo no one can try your as-yet-unapplied patch
09:47cemerickrhickey: oh, I thought you were worried about applied changesets disappearing if a repo was deleted
09:48rhickeya repo pointer is dependent on the repo, a patch isn't
09:48rhickeywhatever that dependency implies
09:48cemerickif 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
09:49cemerickI 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)
09:49yasonAt least for me, patches are as simple as it gets unless you know git inside out (I don't).
09:49rysI 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
09:50rysAccept them, sure, but I'd make a pull request the preferable way if it was me
09:51ChousukeI think most important now is to establish *some* kind of workflow to get started. it can change later if there are problems.
09:51rhickeycemerick: 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'
09:52rhickeyin the latter case I would never use patches
09:53cemerickrhickey: 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.
09:53cemerickIt's not like people would need to do local merges from multiple repos in order to get clojure.
09:54baetis-flyre: 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).
09:55Chousergithub pull requests are not good, independent of the patch/branch question.
09:55ChousukeI also have two remotes in my local clojure clone. "origin" is rhickey's public repo, and "public" is my own
09:55rhickeycemerick: 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
09:55baetis-flyChousuke: 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.
09:57cemerickrhickey: does it really come down to disappearing branches/SHAs specified in pull requests?
09:57cemerickif so, I'm not sure that's a common-enough problem to worry about
09:57rysThat'd be terribly rare. You could even automate pulling those requests into a repo just in case
10:00rhickeycemerick: 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:01rhickeyas I said, in a closed shop I would never use patches
10:02rhickeybut having a project's history depend on a network of unsupervised repos seems shaky
10:02cemerickI guess I would say that the same metaphors should apply.
10:02cemerickesp. since clojure's community is relatively small
10:02rhickeyall our ticket system will have is joe:12345, fred:w7e3h4
10:03cemerickrhickey: again, why would your repo's history depend on any other repos at any time?
10:03Chousercemerick: what's the danger again in using patches? Just the inconsitency?
10:03cemerickChouser: eh, no danger, it's a well-worn system, of course. I just have an unbridled and probably irrational hatred of patch files.
10:04cemerickI probably should just shut up, but rhickey is very accommodating. :-)
10:05rhickeycemerick: It's because I agree with your motivation, but found no one doing it that way
10:06rysWell, 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:07ryserr, make the preferred way even
10:07cemerickI yield the balance of my time to the gentleman from pixeltards.com (rys)
10:08ChouserI'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:08rhickeyso, 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:08rysYou can fetch and diff before merge
10:09ryspull is fetch + merge combined
10:09rhickeyrys: vs look at the ticket
10:09rysvs look at the commit log for the commit?
10:10rysTicket might have more info, sure, but you could just append the commit id and pull request there too
10:10rhickeyrys: that's just a message, not code
10:10rhickeythe patch is readable
10:10jackdempseyyou can get the code from the commit log
10:10jackdempseyif thats what you'd want to see?
10:10rysSo support patches :)
10:11rysBut I'd make pulls preferable if it was me. It's less grief in my experience
10:11Chousercemerick_away: come back, we're not done disagreeing!!! ;-)
10:11jackdempseyhaha
10:12achima 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:12cemerick_awayChouser: heh, we can argue more later, I've got some handball to play :-)
10:12rysWe 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:12baetis-flyachim: git branch -a
10:12jackdempseyfwiw achim its a 'git clone' to get the repo....pull is a combination of fetch+merge
10:13jackdempseyand 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:14rysIf 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:15achimjackdempsey, beatis-fly: thanks! i see, reading up on git seems inevitable ;)
10:15rysSo I'd borrow that stuff and not reinvent the wheel
10:15rhickeyrys: 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:15rysrhickey: yeah, I see where you're coming from. There's really sweet tooling to support both/either at the end of the day
10:15rhickeyImagine if instead of taking patch files we took URLs to patches. Thats what ull requests to public repos feel like to me - ephemeral
10:16baetis-flyone advantage of using patches is that people don't have to mess with github/a public repo if they don't want to.
10:16baetis-flyfor a very small contributor github does get in the way.
10:16rhickeybaetis-fly: it will still be a requirement that patches be produced by git's format-patch
10:16rysgit format-patch ftw!
10:16baetis-flyrhickey: as it should be.
10:17Chouserah, git will be required, but not github. That's a nice point.
10:17baetis-flyi 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:18rysYeah, I could host my clojure repo anywhere, as long as it's public
10:18baetis-flybecause really, github just confuses the issue for people new to github.
10:18baetis-flyer, new to git.
10:18Chouserrys: but with patches you don't even need a public place to host a repo.
10:18baetis-flyexactly.
10:20rysWell, I was somewhat assuming the project would support both, just with one preferred
10:21Chousukegitorious seems to have a bit better merge request support :/
10:21Chousuketoo bad assembla doesn't support it :P
10:22Chousukeyou can actually comment on merge requests and they stay in the system after the merge, marked as "merged"
10:22eevar2what 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:22Chousukeeevar2: it depends. if the patch is applied on the same parent, it'll work fine.
10:23rysmerging from multiple remotes is fine as long as ancestors are common
10:23Chousukeif not, you need a merge.
10:24rysmanual merge there, yes
10:25s450r1Perhaps 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:26Chousukes450r1: local commits and branches. and git actually retains authorship information
10:26Chousukeso that instead of rhickey being the committer of everything, you get the *real* committer. :P
10:27baetis-flys450r1: 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:28rysEven if they are, you just remove the commits until the point when you last committed to master
10:28Chousukeand git will catch corruption because it has hashes of everything
10:29Chousukes450r1: 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:29Chousukegit-using projects*
10:30s450r1all good points, thanks
10:33s450r1although I think the local commits and branches and backup ideas would work with "git svn". I think authorship information would too.
10:33Chousukes450r1: not really.
10:33Chousukegit svn handles local stuff fine but it's painful when you actually need to commit to the svn repo
10:34s450r1I'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:35Chousukes450r1: the debate is about whether it should be the main method of contribution I think
10:35Chousukes450r1: you'd still have separate repos for larger projects I suppose.
10:35Chousukelike clojure-in-clojure
10:35s450r1Chousuke: I'm not real knowledgeable about git, but I've been using "git svn dcommit" at work without any problems.
10:36s450r1Chousuke: sorry, I didn't mean to distract from the main debate
10:36Chousukes450r1: the problem with it is that you can't share commits or branches between two "git-svn" repos without a lot of hassle.
10:36rysYou should really only use git svn for gateways, imho
10:36Chousukesince dcommitting changes the hashes and confuses git, and everyone needs to rebase and fix their branches
10:37rys+uni-directional
10:37Chousers450r1: 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:38Chousukeyou suppose Clojure should use signed-off-by -tags? :)
10:38Chousukemaybe not.
10:38s450r1Chousuke and Chouser, excellent points
10:38rysI'd use signed-off-by if rhickey wasn't the only maintainer
10:38Chousukecontrib perhaps could though.
10:39rysIf he lets others commit to master in his stead, it's worth having some kind of signoff
10:39hiredman~scala
10:39clojurebotUnfortunately the standard idiom of consuming an infinite/unbounded resource as a stream can be problematic unless you're really careful -- seen in #scala
10:40hiredmanwhy not just do patches for month and revist the issue then?
10:40Chousukeit's only adding a -s to "git am" when applying patches anyway :)
10:51Xcaliborgreetings (again)...
10:55Xcaliborany 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:56ChouserXcalibor: if the CPU is the bottleneck, reading the lines in order like that should be fine.
10:56Xcaliborit 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:57hiredmanXcalibor: the only sequential part is reading the file, which will always be sequential
10:58hiredmanyou may want to look at seque to keep pmap running
10:58Xcaliborso if I put the file into a vector, will clojure to be able to handle it concurrently afterwards?
10:58hiredman,(doc seque)
10:58clojurebot"([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:58hiredman,(doc read-lines)
10:58clojurebot"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:59hiredmanXcalibor: it would make no difference
10:59danlarkinI love the warning at the end of the read-lines docstring
10:59arohnerhiredman: why would it make no difference if he slurped the file into memory and then used pmap?
10:59hiredmanarohner: because he is slurping the file into memory anyway with read-lines
11:00hiredmanthat is what "reading" a file does
11:00arohnerand if the calculation is expensive enough, the calculation will dominate compared to reading the file
11:00hiredmanyeah
11:00Chouserno need for seque
11:00hiredmanChouser: depends
11:00Chouser(pmap (fn [line] (Thread/sleep 1000) (.toUpperCase line)) (ds/read-lines "/tmp/tmp.txt"))
11:00Xcaliborok, i see... however if i have the file in memory i could set up concurrent agents to do the job in parallel?
11:01hiredmanXcalibor: or just pmap
11:01Chouserwith a four-line text file, that completes in slightly over 1 second.
11:01hiredmanChouser: but pmap is not completely eager
11:01Chouserhiredman: oh, I see your point.
11:04hiredmanXcalibor: pmap is built on future, and future is the samething has (send-off (agent nil) some-function)
11:04hiredman(more or less)
11:07Xcaliborhiredman: I see... so I just have to try and improve the algorithm speed, right?
11:09hiredmanXcalibor: I would compare pmap and map times, to see if pmap is really giving you a speed up
11:10XcaliborI take it that (map f coll) is the same as (doseq [x coll] (f x)) right?
11:10hiredmanno
11:11hiredmandoseq returns nil and is eager
11:11hiredmanmuch more like a for loop
11:11hiredmanmap returns a lazy-seq
11:12hiredmandoseq is very side-effecty
11:12arohnerwas that jcall / jfn thing that rich posted in IRC every checked in anywhere?
11:14Chousukearohner: I don't think so :/
11:14arohnersecond, related question, I think I need a more generic version of with-open
11:14Xcaliborwell... i'll try to make it faster tomorrow, for today, it's already churning lines.. :-)
11:15Xcaliborthanks for your help... see ya around!
11:15arohnerlike (with-proc f [name init])
11:15arohnerf is a function of one argument, calls (f name) in all cases
11:16Chouserarohner: try/finally is too verbose?
11:16arohnerI use it very often
11:16Chouseroh, you still want the 'name' bound.
11:16arohnerright
11:16arohnerI want exactly with-open, but I want to choose which function gets called, rather than (.close name)
11:17Chouseryou have a variety of other method names to call? I think I've made my own with-foo for some app or other.
11:18arohneryeah, I wrote a with-foo too, but it's not as nice as with-open's destructuring
11:18arohnerso this would let you do
11:18arohner(def with-quit (part with-proc (quit name)))
11:19arohnerand I already have a with-foo in my code, and now I'm contemplating a second
11:20Chouserah
11:20clojurebotPaul Graham is the creator of the other new lisp
11:24Chousuke~arc
11:24clojurebotPOLO! nya nya you can't see me
11:24Chousuke:D
11:24Chousukesometimes the fuzzy matching is a bit unpredictable :)
11:25Chousermore fun that way
11:25Chousukearohner: perhaps you could just look at with-open and make it more generic :)
11:25Chousukeit's not particularly complex.
11:26arohnerChousuke: that's the plan. I was just making sure I had a good idea first
11:26arohner:-0
11:26arohner:-)
11:27ChouserI think the idea is sound, but it seems to me the details could use some work.
11:28arohnerChouser: which details could use work?
11:28Chouserlike, it's a shame that the thing that happens at the end appears at the beginning of the block of code.
11:28rhickeyscopes are coming
11:28Chouserand the name doesn't really suggest 'finally' ... with- is used for lots of dynamic scope stuff.
11:30arohnerso the name change is easy. How would you suggest making the 'finally' thing happen near the end?
11:31Chouserarohner: dunno -- may not be worth it, I guess.
11:31Chousuke(on-scope-exit f [...] )?
11:31Chouser(let-finally [x (make-x)] .... (finally (.quit x))) :-/
11:31rhickeyscopes separate the scope from the action, so the whole notion of at the end/beginning is fuzzy
11:32rhickeyyou say what the cleanup is near the resource creation
11:32ChouserI think I used to know what scopes were going to do.
11:34Chouserhttp://paste.lisp.org/display/73838 -- scope blocks
11:35arohnercool
11:36Chouseralmost 5 months ago -- no wonder it's a bit hazy for me. :-)
11:36Chousukecould you use that for a lazy seq backed by a file somehow? :/
11:36Drakesonhow do you turn [:a 1 :b 2] to {:a 1 :b 2} ?
11:36rhickeyChousuke: exactly, that and many others
11:36ChousukeDrakeson: apply hash-map
11:37Drakesonthanks
11:37rhickeyfirst cut at patch guidelines - thoughts? http://clojure.org/patches
11:41Chouserperfect
11:41Chousukecan a patch contain more than one commit?
11:42Chousukeit could be useful if the changes are related
11:42baetis-flyvery good.
11:43Chouserdo 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:44arohnershouldn't the clojure regression tests be in clojure proper rather than contrib?
11:45Chouserarohner: why?
11:45arohnerso the tests stay in sync with the code
11:45arohnermaking a change to clojure proper that affects the test would require two patches
11:45arohnerthat should be applied inside a do-sync :-)
11:46Chouserarohner: as it stands, the community has easier access to updating the tests than if those changes had to go through rhickey.
11:46Chouserheh
11:46Chousukedon't the tests also depend on contrib?
11:47Chouserwell, 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:47arohnerChousuke: oh, that is a good point
11:47Chousukebut it is a bit problematic,
11:47ChouserChousuke: good point.
11:47Chousukesince contrib and clojure evolve separately, you could have clojure in a state where the tests won't work because of a change :/
11:48Chousukeand it'd be hard to tell which revision of the tests are valid for a given version of clojure.
11:51Chousukeso while the tests should be in the main repo, it'll also require accepting test-is as part of Clojure
11:51Chousukewith any dependencies it has ;/
11:52hiredman:/
11:53Chousukeapparently it depends on c.c.template and c.c.stacktrace
11:53Drakesonhow 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:54hiredmanor we could just keep it in contrib
11:54Chousukeand template depends on walk ;/
11:54ChousukeDrakeson: (zipmap keys (map keys themap))
11:54hiredman,(reduce dissoc {:a 1 :b 2 :c 3 :d 4} [:c :d])
11:54clojurebot{:a 1, :b 2}
11:55Chousukehmm
11:55Chousukethat doesn't quite work
11:55Chousukemine, that is
11:56arohner,(doc select-keys)
11:56clojurebot"([map keyseq]); Returns a map containing only those entries in map whose key is in keys"
11:56hiredmanooo
11:56Chousukeoh, cool.
11:56Chousuke,`select-keys
11:56clojurebotclojure.core/select-keys
11:56Chousukefigures :P
11:56Drakesonarohner: sweat, thanks
11:57Chousukeactually, mine would have worked if I had used (map themap keys) instead ;/
11:58Drakesonwasn't there an "apropos" function in the repl?
11:58Chouserfind-doc
12:10rhickey_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:11gnuvinceOpen 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:13hiredmangnuvince: I dunno that people frown on it, they just are not exposed to it
12:13hiredmanI think the main thing people have trouble with is letting go of mutable state
12:14gnuvincehiredman: which is one thing that lets them have flat code
12:14gnuvincethey declare an object
12:14baetis-flygnuvince: If people do frown upon it, it's because it's different. That difference could be nesting/state/whatever.
12:14gnuvincethen perform 7 operations on it to bring it to the state they want
12:15Chousukegnuvince: if you want flatter code, make a function :)
12:16gnuvinceChousuke: just wondering aloud
12:16Chousukedoesn'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:16gnuvinceI've got quite a few functions that are just a big let containing numerous bindings and one simple expression.
12:17Chousukeheh
12:17baetis-flyi end up writing functions like that whenever i need to do java interop.
12:19Chousukeone of the worst examples of this I know is destructure :P
12:19Chousuke~destructure
12:19clojurebotI don't understand.
12:19Chousuke~def destructure
12:23arohnerI 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:24Chousuke:)
12:24arohnersince it's a macro, is there any cleaner way to define new 'versions'? currently it looks like
12:24arohner(defmacro with-close [bindings & body]
12:24arohner `(with-proc (fn [x#] (jcall x# "close")) ~bindings ~@body))
12:24Chousukewhy the jcall?
12:24arohnerto call (.close x)
12:24arohnerwhich is what the current with-open does
12:25Chousukewhy not just (~'.close x#)
12:25arohneroh, good point
12:25arohnerI'm in macro-land
12:25Chousukethe ~' may even be unnecessary, actually.
12:26Chousuke`.close
12:26Chousuke,`.close
12:26clojurebot.close
12:27hiredmanscopes just need to be pushed
12:28hiredmanthen resource handling stuff can just attach to the enclosing scope
12:28Chousukeyou could even have something funky like (with-finalise {x (.close x)} [a item b another-item] ...)
12:28Chousukelooks rubyish :)
12:29arohneryeah, that's a lot of ceremony
12:30arohnerhiredman: when are scopes coming? I need a solution to this soon, and I don't mind making the change twice
12:30hiredmanarohner: you could try out "horizons"
12:31Chousukearohner: I think you should go with your custom solution for now.
12:31hiredmanwhich is what I called my implementation of scope
12:31hiredmanhttp://github.com/hiredman/clojurebot/blob/8d9f43016d388c9ee2ceeda85aa199ec56f4f7d3/hiredman/horizon.clj
12:32hiredmanI haven't really used it
12:32hiredmanbut it follows the scope teaser rhickey posted
12:32hiredman~scope
12:32clojurebotscope is at http://paste.lisp.org/display/73838
12:33hiredmanso you have a function "reader" which produces a reader, and inside reader you call (when-hrz :exits (.close rdr))
12:34hiredmaner
12:34hiredman#(.close rdr)
12:34technomancyI like how the IRC channels for Apache projects are called "user-to-user support".
12:34technomancyit's a nice euphemism for "nobody knows what they're talking about"
12:35hiredmanhey now
12:35hiredmanso whenever "reader" is called it registers the reader it produces to be closed when the enclosing scope exits
12:37hiredmanoh, it does the fn wrapping for you, so (.close rdr) would be fine
12:44ben_mHi there :) Is there a pastebin that supports Clojure?
12:46hiredmangist
12:46hiredmanbut gist doesn't let you group pastes by channel
12:47ben_mDoesn't bother me :) Thank you.
12:47rhickey_lisppaste8: url
12:47lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
12:48ben_mThanks :)
12:49hiredmanthe lisp.org pastebin is prefered for #clojure because of the above mentioned grouping feature
12:49ben_mYeah.
12:50ben_mGist is pretty cool though.
12:51lisppaste8ben_m pasted "Kiloseconds" at http://paste.lisp.org/display/82002
12:52ben_mJust learning Clojure and I'm wondering if there's a better way of doing this.
12:52ben_mMaybe more functional or in a more idiomatic way for a Lisp.
12:52hiredmanexcellent, now do it for an arbitrary date
12:53hiredmanI have been meaning to figure out how old I am in megaseconds
12:54ben_mWell, there you go.
12:54ben_mJust change the 1000 into a 1000000 :)
12:54danleiprobiers doch zuerst mal mit 1-2-3-5-motiven, hat trane auch oft gespielt ...
12:55hiredmanno, that just tells me the kiloseconds since the epoch
12:55danleiooh ... sorry guys
12:55hiredmanI need kiloseconds since my epoch
12:56ben_mOh, yeah.
13:44Georges`Hello
13:45Georges`Question about clojure and SLIME
13:45Georges`Who does the (add-classpath "file:///......./") when launching SLIME with swank-clojure ?
13:46technomancyGeorges`: sounds like you've got an older version of swank-clojure; recent versions don't do that.
13:47Georges`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:49Georges`In the video (http://vimeo.com/2419596), at 04:13, when he runs SLIME, the (add-classpath ...) pops up...
13:49technomancyyeah, that video uses an old version of swank-clojure
13:49technomancyin recent versions it gets added to the classpath in the right place so it doesn't have to happen after clojure is launched.
13:49technomancyinside the swank-clojure-cmd function
13:52Georges`Oh, I see... I defined a swank-clojure-binary in a .bat...
13:53Georges`and swank-clojure-jar-path, but swank-clojure-binary gets first priority...
13:53Georges`so I don't get all the goodies like swank-clojure-library-paths, etc...
13:55technomancyI'm not sure why you would want to use swank-clojure-binary
13:56Georges`obsolete docs :)
13:59Georges`OK, working. Thanks!
13:59technomancycool
14:00cemerickmmm, assembla is pretty good
14:02ChousukeI use swank-clojure-binary. it points to my nailgun clojure wrapper
14:02Chousercemerick: if you figure out how to turn off some of the notification emails, let me know
14:02ChouserI coulda sworn I saw an option for that, but I can't find it now.
14:02cemerickChouser: http://www.assembla.com/spaces/new_items/clojure?settings=show ?
14:02rhickey_cemerick: yeah, I think it will be nice for us, you're now a member
14:03technomancyChousuke: oh, that makes sense
14:03cemerickrhickey_: what's the status on getting the tickets out of googlecode?
14:04rhickey_cemerick: help wanted
14:04Chousukedoing it manually?
14:04cemerickyeah, it's too small of a job to bother scripting.
14:04cemerick(IMO)
14:04Chousukedo I need to be a team member to enter tickets?
14:04rhickey_I've been working on this transition for a week now, at the expense of other things
14:05rhickey_but the goal is to empower others
14:06gnuvincerhickey_: speaking of which, I recall somebody talking about an online CA form to make it easier for people wishing to contribute.
14:06gnuvinceDo you expect to have something like that?
14:07dnolenrhickey_: and you've been doing a fantastic job! twitter account, assembla, dev list, github, great stuff! this transparency is great.
14:08rhickey_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:09Chousercemerick: yeah, that's it. thanks.
14:09ChousukeIt'll deter people who would like to contribute just a patch or two to fix their issues, thoug h :/
14:09gnuvincerhickey_: ah, the Clojure-Dev litmus test, I see :)
14:09technomancyyeah, it does end up being biased against people who get turned off by busywork.
14:10rhickey_maybe
14:10pjstadigthere is a CSV export of tickets from GoogleCode
14:10cemerickhrm, it's not that hard...
14:10pjstadigis there an import of some kind for assembla?
14:11Chousukepjstadig: assembla apparently has an api for that
14:11rhickey_pjstadig: a csv of the report right?
14:11cemerickyeah, it doesn't contain the contents
14:11Chouserpjstadig: the csv doesn't include discussions or attachments... yeah
14:11pjstadigtrue
14:11pjstadigwell attachments could be migrated
14:11pjstadig(manually)
14:11pjstadigbut discussions?
14:12rhickey_on the assembla side there's:http://www.assembla.com/wiki/show/c8A2BGQEWr2RUvaaeP0Qfc/Integrate_with_Assembla
14:12Chousukeany news on the google bug about this?
14:13ChousukeI lost the URL :/
14:13cemerickit 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:13rhickey_cemerick: yes, full dump is fine
14:14ChouserChousuke: http://code.google.com/p/support/issues/detail?id=148
14:14Chouserno news
14:14Chousuketoo bad :/
14:14ChouserUnless you meant this, which is worse: http://code.google.com/p/support/issues/detail?id=1689
14:15cemericknot-not-evil, again :-/
14:16cemerickman, those default assembla alerts really are crazy
14:16rhickey_become a watcher, then ask on clojure-dev for a bump-up
14:18cemerickrhickey_: unless some better solution is immediately available, I'll volunteer to move the issues over manually
14:19technomancy"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:19Chousukecemerick: Going to do it right now? I can help.
14:20rhickey_cemerick: great - thanks! wanna ping the clojure-dev group so people don't step on each other?
14:21cemerickChousuke: yeah. I'll bet we can tag-team it within a half-hour.
14:21Chousukethough 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:21rhickey_technomancy: something I can find on http://clojure.org/contributing
14:21cemerickrhickey_: I was going to ask: does it matter if the issue IDs remain the same?
14:22ChouserChousuke: can you create a ticket via the Support tab?
14:22Chousukeah! yes I can.
14:22Chousukewasn't there earlier :)
14:23rhickey_Chousuke: http://groups.google.com/group/clojure-dev/browse_frm/thread/99e2728f665c52fa
14:23rhickey_cemerick: not sure if that's even possible, is it?
14:23rhickey_Chousuke: don't use the support tab if you have a CA
14:23cemerickrhickey_: well, if you can delete everything in assembla, and then if we add the issues in in order, that should do it
14:24Chousukehm, but that doesn't parallelise very well :P
14:24cemerickyeah, we'd have to just do it in two shifts :-)
14:25cemerickI'll bet tickets can't be deleted though
14:25rhickey_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:25technomancyoften incremental IDs don't start from zero again even if you delete everything.
14:25cemerickhrm, actually, it's better if we add them in order anyway, so we maintain the chronology
14:34cemerickChousuke: OK, I'm ready to go...shall I take the first 60?
14:36Chousukeokay
14:37ChousukeSo are we going to keep the order? :/
14:38Chousukeis it worth it? Maybe we should just add a reference to the original issue number
14:38cemerickSeems like a really good idea -- otherwise, default ordering of tickets will list prehistoric stuff next to things from 6 months ago
14:38cemerickOh, I'll be doing that too.
14:41achimmaybe 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:42cemericktickets rolling in now...
14:44cemerickrhickey_: do you want all issues assigned to you, or only ones you "accepted" in GC?
14:45rhickey_cemerick: unassigned, thanks
14:46Chousukecemerick: you'll be on the notification list for all these issues ;(
14:46hiredmanclojurebot: assembla?
14:46clojurebotNo entiendo
14:46cemerickrhickey_: just clarifying, so you don't want any issues assigned to you from GC?
14:46hiredmanclojurebot: assembla is http://www.assembla.com/spaces/dashboard/index/b4-TTcvBSr3RAZeJe5aVNr
14:46clojurebotAlles klar
14:46cemerickChousuke: oh well. I guess I'll know what's going on :-)
14:47Chousukehiredman: hm, I don't know why assembla gives that weird url by default
14:47Chousukeclojurebot: forget assembla
14:47clojurebotI forgot assembla
14:47jackdempseyhaha
14:47Chousukeclojurebot: assembla is http://www.assembla.com/spaces/dashboard/index/clojure
14:47clojurebotOk.
14:47hiredman:(
14:47hiredmanah
14:47rhickey_cemerick: no, I'll go through them again, thanks
14:48rhickey_clojurebot: assembla is http://www.assembla.com/spaces/clojure
14:48clojurebot'Sea, mhuise.
14:48cemerickI'm leaving out dupes, only adding tickets that were merged into
14:48hiredmanthis is like the fourth or fifth time I have grepped through my irc logs looking for url
14:49Chousukedoes "is" overwrite the old definition? or does it append?
14:52wy_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:53Chousukeholy crap assembla is spammy :P
14:53hiredmanChousuke: information rich
14:53Chousukewy_: many things are only documented with a single sentene :/
14:53hiredman:P
14:53wy_:(
14:54Chousukewy_: http://java.ociweb.com/mark/clojure/
14:54wy_How is the book?
14:58Chousukeseriously now, I turned off the notifications and I'm still getting spam :P
14:58Chousukemaybe it takes a while to go through.
14:59rhickey_Chousuke: yeah, I don't seem to be able to configure the stream defaults, but your individual settings should work - mine do
15:11Chousukecemerick: we're lucky there are only 120 issues :P
15:11cemerickindeed
15:12cemerickgawd, assembla spams like a blind nun
15:12cemerickand I changed my prefs to send only a daily summary :-(
15:17Chouserswitching to daily summary seemed to do it for me.
15:17rhickey_hourly is working for me
15:18cemerickunfixed issues are decidedly more pleasant to transfer than fixed ones :-P
15:18Chouserheh
15:18Chouserdo we even need fixed ones?
15:18cemerickTOO DAMN LATE CHOUSER!
15:18cemerick;-)
15:18Chousukecemerick: what's wrong with fixed ones? the need for marking them as mixed? :P
15:18Chousuke... fixed
15:19Chousukeactually, that would've been parallelisable ;/
15:19cemerickit's two additional click-load cycles
15:19Chousukeyou could just have entered the issue and I could have marked them as fixed :P
15:27cemerick...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:27cemerickI think I scared Chouser ;-)
15:28Chousukecemerick: wonder if that'd work for me :)
15:32cemerickChousuke: OK -- you're up :-)
15:33Chousukecemerick: where's issue 59? :D
15:33cemerickhuh -- there isn't one in GC....
15:33cemerickthat's interesting.
15:33Chousukemaybe it was deletet
15:33Chousuked
15:34cemerickChousuke: 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:35ataggart /msg NickServ identify passw0rd
15:35leafwataggart: such a classic
15:36leafwataggart: anda very common password, by the way.
15:36Chousukecemerick: code format?
15:36ataggartlol
15:36ataggartdamn copy paste
15:36ataggartI knew one day that'd bite me in the ass
15:37cemerickChousuke: yeah, there's a "code block" format button above the description textarea that pops in <pre><code> tags, with the cursor properly placed
15:37hiredman~ticket #1
15:37clojurebot([2009-06-13T14:38:41+00:00] [Add chunk support to map filter et al]) http://tinyurl.com/mfpa6s
15:38hiredman~ticket #19
15:38clojurebot([2009-06-17T18:58:13+00:00] [GC Issue 15: JavaDoc for interfaces]) http://tinyurl.com/nwbq77
15:38Chousuke~ticket #64
15:38clojurebot([2009-06-17T19:38:52+00:00] [GC Issue 61: Make Clojure datatype Java Serializable]) http://tinyurl.com/mggn3q
15:39Chousukeneat.
15:40cemerickugh, I've got the notification set to "daily summary", but I'm getting *everything*
15:40Chouserclojure vs. contrib project?
15:41Chousukecemerick: did you use "low" or "lowest" for the priorities?
15:51hiredman~ticket #19
15:51clojurebot{:summary GC Issue 15: JavaDoc for interfaces, :status :new, :created-on 2009-06-17T18:58:13+00:00} http://tinyurl.com/nwbq77
15:56cemerickChousuke: low and normal ("medium" in GC) were the only two I used
15:59cemerickrhickey_ seems to aggressively classify issues as "low"
15:59Chouserheh
16:01rhickey_cemerick: I hope to be able to use milestones to better partition the issues moving forward
16:02cemericksure, whatever works for you. It just became very clear when copying things over :-)
16:02Chousukeissue 70 is a handful
16:03Chousuke23 comments and a whole bunch of patches :P
16:03cemerickChousuke: Let me know if you run out of steam eventually
16:07Chousuke8 attachments :P
16:07Chousukeluckily assembla is nice and ajaxy
16:11arohner~ticket #70
16:11clojurebot{: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:12hlshipI'm struggling with a problem.
16:12hlshipI'm trying to create a new function in a namespace.
16:12hlshiphttp://paste.lisp.org/+1RAA
16:13hlshipI.e., so that the new function has access to imports and private functions of the namespace.
16:13hlshipIt works if I define it in the current namespace (the namespace containing the to-value-fn function).
16:14Chouserhlship: have you tried (binding [*ns* ...] (eval ...)) ?
16:14hlshipYes, found the (with-ns) macro
16:14hlshipI wrap the (eval) with (with-ns namespace (eval ...))
16:14hlshipGet Caused by: java.lang.Exception: Unable to resolve symbol: expression-form in this context
16:14hlshipI've tried a few variations as well
16:15hlshipsuch as moving the (with-ns) inside the (eval)
16:15hlshipand failed in other ways
16:15hlshipIt's a bit of a heresy
16:15hlshipbut in Cascade, a template file is converted into a function
16:16hlshipand the function should have access to all the same imported or private resources
16:16hlshipavailable to a function defined with the namespace's .clj file
16:17Chouserwhere's with-ns ?
16:17hlshipThe code works for simple expressions, i.e., those that only use clojure.core
16:18hlship http://paste.lisp.org/display/82018#1
16:19hiredmanwhere is the exception?
16:21hlshiphttp://paste.lisp.org/+1RAA#2
16:21hlshipThe exception is in the call to (eval) with the (with-ns) macro
16:21hiredman(doc with-ns)
16:21clojurebot"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:22hiredman~def with-ns
16:22hiredmanugh
16:22hiredmanI imagine the problem is with-ns uses eval
16:23Chouseroh, indeed.
16:23Chouserhlship: you don't need with-ns
16:23hlshipJust do the (binding [*ns*]) myself, you think?
16:23hlshipI'll give it a try.
16:23Chouserhlship: in fact, it's getting in your way, making it difficult (impossible?) to pass in your form variables.
16:24Chouserhlship: http://paste.lisp.org/display/82018#3
16:24technomancywhy does compiling this give me a No such file or directory error? (gen-class :name foo.bar.Derefer :implements [clojure.lang.IDeref])
16:24hiredmanhlship: when doing namespace stuff like that you have to watch for def
16:24Chousertechnomancy: does your "classes" dir exist?
16:25technomancyChouser: yep; and it's on the classpath
16:25technomancyerr... maybe not
16:25technomancybleh
16:25technomancymust have been overzealous in deleting
16:25technomancyChouser: any reason why it can't be created for you?
16:25hlshipthanks for the help; current tests now pass
16:25hlshipnow to add tests that exercise access to private functions, etc.
16:25clojurebotfunctions are maps
16:26Chousertechnomancy: hm, dunno.
16:27Chousukeone third done! phew, this takes time ;P
16:28Chousukeand in the mean time, assembla has sent me *46* emails
16:29lisppaste8hsuh pasted "How to express this with loop/recur" at http://paste.lisp.org/display/82020
16:30hiredmaneh?
16:30Chousukeoh crap, double post :P
16:31Chousukeno way to delete tickets it seems.
16:33hiredman~ticket #70
16:33clojurebot{: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:35cemerickhuh, 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:35hiredmanmine checked out master
16:36cemerickthat's very strange
16:40cemerick...and, http://github.com/cemerick/clojure redirects to /tree/1.0, and /tree/master doesn't exist :-/
16:40cemerickbut I have an origin/master ref
16:44devinusthere hasn't been too many updates to the clojure repo lately, is something going on?
16:44cemerickhuh, there's a "default branch" setting in the edit pane of my repo, but no master listed there, either
16:45hiredmandevinus: a lot of effort is going into migrating away from google code
16:45cemerickI've only forked repos on github that have one master branch, so this is new to me
16:45devinushiredman: so, using git perhaps?
16:45hiredmandevinus: github+assembla
16:45hiredman~github
16:45clojurebothttp://github.com/richhickey/clojure/tree/master
16:45hiredman~assembla
16:45clojurebotassembla is http://www.assembla.com/spaces/clojure
16:46technomancyso the main draw of assembla then is the fact that it supports milestones and linking tickets to them?
16:46Chousukecemerick: you were really fast at this :P
16:46Chousukecemerick: I'm only halfway through :D
16:46devinushiredman: yes, that's exactly what i was wondering thanks. i've been stuck on SVN for amost a week now without updates
16:50hiredmandevinus: it's not like you've missed a whole lot
16:50devinushiredman: what kind of work is going on right now?
16:51hiredmanwell, currently Chousuke and cemerick are transfering tickets from google code to assembla
16:52Chousukecemerick already did his part.
16:52Chousukenow it's all me :D
16:52cemerickodd, I deleted my fork, recreated, and now there's a proper master branch in my repo :-/
16:52Chousuke~ticket #102
16:52clojurebot{: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:52Chousukehm
16:52Chousukethe tabs, they're evil
16:52hiredman*shrug*
16:52Chousukeoh well, they'll only show up in there.
16:53Chousuke22 to go...
16:59devinuswhat kind of work on clojure is going on now?
16:59devinusit seems repo updates kind of tapered off
17:00hiredmanI would check out the assembla page
17:00rhickey_devinus: I'm working on chunked seqs, then 'instance', plus getting in 'scope', then clojure-in-clojure
17:01rhickey_but over the last couple of weeks a lot of time on this changeover and the JavaOne trip
17:01hiredman~ticket #2
17:01clojurebot{:url http://tinyurl.com/n24rzw, :summary "Scopes", :status :new, :priority :normal, :created-on "2009-06-15T12:35:58+00:00"}
17:01devinusrhickey_: clojure-in-clojure, as in bluebook design (minus the whole writing your own vm part)?
17:02devinus(not that i'm knowledgable about anything like that)
17:02rhickey_not sure what is implied by bluebook design
17:04rhickey_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:07cemerickrhickey_: The patches I have queued up are targeted at 1.0 -- are you ready for such things, or not yet?
17:08rhickey_cemerick: bugfixes?
17:09cemerickrhickey_: 2 definitely, one could be considered an enhancement, but I'd consider it a critical fix
17:09rhickey_which is?
17:09Chousukecemerick: are you posting new issues to the GC tracker? :P
17:09cemerickrhickey_: adding an encoding argument to slurp
17:09Chousukeoh wait, never mind
17:09cemerickno, not me
17:09ChousukeI was just confused by issue number 121
17:09Chousukebut there was one missing
17:10wy_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:11arohnerwy_: macros try to resolve 'naked' symbols to namespaces, to make them hygenic
17:11arohnerwy_: use x# rather than x
17:11arohnerand ~n rather than n
17:12arohnerx# does a gensym
17:12wy_It works. Thank you
17:14rhickey_cemerick: hrm, adding arguments isn't usually part of a bugfix release branch
17:14cemerickrhickey_: 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:15rhickey_cemerick: sounds like a fine enhancement for 1.1
17:15cemericklol yeah, OK :-D
17:18wy_Can it support nested backquotes and unquotes?
17:21wy_I'm trying to write something like: (defmacro power ([n] `(fn [x#] ~(if (= n 0) 1 `(* ~x# ~((power (- n 1)) x#))))))
17:21wy_so far it doesn't work yet
17:21hiredmanuh
17:21hiredman~x# <-- no
17:21clojurebotx is y
17:21hiredmanclojurebot: thanks!
17:21clojurebotGabh mo leithscéal?
17:21rhickey_wy_: foo# won't work in nested contexts, you'll need gensyms
17:22wy_Thanks
17:32Chousukephew
17:32Chousukethat ought to do it.
17:32Chousukerhickey_: all issues should be migrated now.
17:35cemerickI just sent the all-clear on the issue tracker.
17:39Chousukerhickey_: should I mark an issue as "ready to test" if I submit a patch for it? :)
17:42rhickey_cemerick: Chousuke: Thanks!!!
17:43rhickey_Chousuke: yes
17:43Chousukeit'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:44cemerickrhickey_: least I could do, since I don't add a lot of mojo around here :-)
17:46Chousukeoh crap, now I spotted a typo in the patch I posted :D
17:49Chousukefixed
17:49Chousukeand adding all these issues earned me 125 messages from assembla ;(
17:51cemerickdoes anyone know why 'git push origin :foo' deletes the foo remote branch?
17:53cemerickit's funny, I never thought anyone would bother with v1.0 patches, yet here I am tracking some
17:53cemerickwhoo-hoo, someone's impl a skip-tree
17:53cemerickthat's fantastic, if it's persistent -- I wouldn't have thought it possible...
17:54Chousukecemerick: I guess because you're pushing "nothing" to it
17:54Chousukeso it's removed :P
17:55cemerickoh, X:Y means push local ref X to remote ref Y. I get it now.
17:56ChousukeI use it sometimes to push branches under different names.
17:57cemerickyeah. We manage to not step on each other's toes, so I've never had to do that before.
17:58cemerickeh, the skip-tree is in Java as a replacement for PersistentTreeMap
17:59Chousukewhere is this skip-tree?
18:00cemerickChousuke: http://github.com/mspiegel/clojure/commit/baee6e122086932bd0a73b7e2ed1380a2ecfc681
18:00Chousukefrom the group: "I think of it as repo = directed graph of nodes and pointers into the graph & git = graph editor" interesting take
18:01hiredmanthat is alot of red
18:01cemerickyeah, it's a full replacement.
18:01Chousukemaybe it should not be :/
18:01Chousukeor is it better than the rb-tree in all cases?
18:02cemerickin all cases, I believe
18:03Chousukehmm.
18:03ChousukeWell, then I guess it would make sense
18:05hiredmanthat network tab sure is sweet
18:05hiredmanhttp://github.com/richhickey/clojure/graphs/languages :(
18:05cemerickis the skip-tree blessed as a PTM replacement (in concept, even)
18:06ataggarthiredman: one might read that as an indicator of the relative verbosity of java versus clojure :)
18:07cemerickI'll bet that ratio is pretty common across any language implementation (impl. language vs. hosted language)
18:15cemerickech, the sorted-set-by patch doesn't apply
18:26Chousukehm
18:26ChousukeClojure contrib issues must still be moved over ;(
18:26hiredman:|
18:27Chousukethere are only 41 of them though
18:27Chousukebut I'm not going to do it
18:29durka42manually?
18:29Chousukeyes
18:29Chousukealready did it for all the clojure issues
18:29durka42seems like someone should write a clojure program to do it
18:29Chousukecemerick moved the first half and I the rest.
18:30hiredmanI think the main issue is gc doesn't have an issues api
18:30hiredmanassembla does
18:30gnuvince_(doc *print-dup*)
18:30clojurebot"; When set to logical true, objects will be printed in a way that preserves their type when read in later. Defaults to false."
18:30gnuvince_What's the meaning of "dup"?
18:30cemerick*way* too small a job to script IMO
18:30hiredmangnuvince_: duplicate
18:30hiredmanI imagine
18:31cemerickyeah, I'm done with data entry for today :-)
18:33hiredman~ticket #123
18:33clojurebot{: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:34hiredmanhah, sure, test
18:38Chousukerhickey_: I'm taking over the test ticket on contrib. turning it into a real one. (for moving the issues from GC)
18:38ChousukeI just thought #1 is suitable for it
18:38durka42~ticket 122
18:38clojurebotGabh mo leithscéal?
18:38durka42~ticket #122
18:38clojurebot{: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:38durka42~ticket #124
18:38clojurebot{: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:38durka42~ticket #125
18:38clojurebot{: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:39durka42GC --> CG somewhere :p
18:39Chousukedamn it :P
18:39Chousukethat obviously needs to be fixed.
18:39durka42can they be edited
18:39Chousukesure.
18:40Chousukethat's what you get for editing things at midnight :P
18:43hiredmanwatch out what you watch on assembla
18:43hiredmanyou could get a few emails
18:43Chousukeyeah :P
18:44ChousukeI'm currently watching half of the tickets.
18:44Chousukebecause I added them
18:44durka42email filters :)
18:44hiredmanyeah
18:45hiredmanI have email from assembla skip my inbox
18:45Chousukeand I can't remove myself from the notifications list :((((
18:45Chousukebecause I'm the submitter
18:45Chousukethis is evil
18:45ChousukeEVIL I SAY.
18:46technomancyyou can always remove yourself from the notifications ... in your spam filter. =)
18:48ChousukeOkay, fixed the CGs as well... now I'm done for today :P
18:54mrsolohm look like aot doesn't save much
18:54Chousukesave much of what?
18:55Chousuketime? :)
18:55mrsoloright
18:55mrsolostartup time
18:55Chousukeright.
18:55Chousukejava's bad with that.
18:55mrsolo invoke via clojure.main @.. via gensum class...not whole lot of difference basically
18:55mrsolos/gensum/gensym/
18:56Chousukeif you have a java application you run often (like the clojure repl), take a look at nailgun
18:56mrsolonailgun works pretty good, yes
18:56mrsolothat is just a generally observation
18:56mrsoloso i don't know what the point of AOT is...other than not shipping the source code :-)
18:57Chousukewell, you need it for gen-class
18:57technomancymrsolo: interop with Java APIs that require Real Classes, mostly
18:58mrsoloah right
19:02mrsolowell just finish my first 'not a toy' clojure program
19:04mrsolosure took longer for me to construct comparing to my other languages..hopefully this will improve over time fast
19:09Chousukemrsolo: is clojure your first functional-programming language?
19:09Chousukemrsolo: it takes a while to get used to it :)
19:09mrsolohmm
19:09mrsolono really
19:09mrsolomore functional than rest yes
19:09mrsoloi did scheme for few months years back
19:10mrsolocurrently is mostly ruby now
19:10mrsoloit isn't functional style slowing me down anywa.. it is lack of familiarity with apis
19:10Chousukeah, well, that SHOULD improve :)
19:11Chousukeand I SHOULD be sleeping :P
19:11scgilardithanks for all the work today, chousuke and cemerick!
19:30hsuhanyone knows how to express this with loop/recur ? http://paste.lisp.org/display/82020
19:31ctdeanJust replace your call back to draw-circle with recur
19:31hsuhbut recur has to be the last statement... and there are two calls the way its written
19:31hsuhright?
19:32ctdeanyoure right
19:32ctdeanI miss-read while as if
19:33ctdeanerr, when as if
19:33Chousukehmm
19:33Chousukethere's probably no simple way to make that into a loop.
19:34Chousukeat least, it won't be nearly as elegant as the recursive version :/
19:35hsuhoh, ok. i just wanted to check that.. its not really a problem now :)
19:35Chousukectdean: can you remove the other draw-circle call and just add an ellipse call?
19:36Chousukehmm
19:36hsuhfor this solution i think so.. i could even rewrite it with level being a list do map perhaps
19:36ctdeanchousuke: nope. it's describing a tree and we're walking that tree
19:36hsuhs/do/to
19:36ctdeanI could be wrong :)
19:37hsuhbut i wanted to check because it seems like a general "divide and conquer" problem.. i guess
19:37ctdeanThe 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:38hsuhctdean: only 6 recursive calls now :) not a problem
19:38ctdeanhsuh: yea, don't worry about it
19:39ctdeanMy functional-fu is weak
19:39ctdeanYou'd think it would be better after years of scheme
19:41Chousukehmm
19:41Chousukeyou say the data structure is a tree?
19:41Chousuke,(doc tree-seq)
19:41clojurebot"([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:42ctdeanYes, that would be my appoach, or rethink the algorthim
19:42Chousuke~def tree-seq
19:43lisppaste8hsuh annotated #82020 "with doseq" at http://paste.lisp.org/display/82020#1
19:44ctdeanI'm too sleepy to tell if that's the same, sorry
19:45hsuhim tripping.. thats obviously not the same
19:45Chousukeyeah, I was wondering.
19:45hsuh:( embarassing...
19:45ctdeanlol, it's all good
19:45mrsolotree-seq is very nice :-)
19:45hsuhif i write a proper list comprehension, then i'd have a chance
19:46mrsolofile-seq however is very limited
19:46mrsoloi ended up modified the original so i can pass few functions
19:46ctdeanSO you can prune dirs ands such?
19:46mrsoloya
19:46mrsoloand depth
19:46mrsolootherwise things explode
19:46Chousukemrsolo: modified how?
19:47mrsolowrap filter fucntion around listfiles
19:47mrsoloand pass in breath? function
19:48mrsoloso i can control if a particular directory needs to be expanded and what is the result of expansion and such, simple stuff
19:48mrsolothat speed up large directory processing considerablly :-)
19:50hsuhhow can i have a lazy list of some number divided by 2 [20 10 5 ..] ?
19:51hiredmanmap
19:51ctdean(take 10 (iterate #(/ % 2) 20))
19:51ctdean~take 10 (iterate #(/ % 2) 20))
19:51clojurebotPardon?
19:51Chousukeuse ,
19:51ctdean~(take 10 (iterate #(/ % 2) 20))
19:52clojurebotExcuse me?
19:52ctdeanyea, oops
19:52ctdean,(take 10 (iterate #(/ % 2) 20))
19:52clojurebot(20 10 5 5/2 5/4 5/8 5/16 5/32 5/64 5/128)
19:52ctdeanYou always just use loop too
19:52hiredmanctdean: not lazy
19:52Chousukeor for
19:53Chousukehmm, actually, it's trickier :)
19:53ctdeanIsn't iterate lazy?
19:53hiredmanit is
19:54Chousukeyes
19:54hiredmanI meant loop/recur is not lazy
19:54ctdeanoh! yes
20:05hsuhhow can i generate this vector? [[0 5] [1 6
20:05hsuh[[0 5] [1 6] [2 7]]... using range?
20:07Chousuke,(map vector (range 3) (range 5 8))
20:07clojurebot([0 5] [1 6] [2 7])
20:08hsuhtks
20:08Chousuke,(vec (map vector (range 3) (range 5 8)))
20:08clojurebot[[0 5] [1 6] [2 7]]
20:08Chousuke:P
20:23mrsolohttp://briancarper.net/blog/five-things-that-mildly-annoy-me-in-clojure
20:23mrsoloyep.. got bitten by some heh
20:24replacamrsolo: saw that. I tend to agree with those, much as I love clojure.
20:24mrsoloi predict any? will show up :-)
20:24ctdeanFor the record: I wish java (and clojure) had TCO. No matter what he says
20:25mrsoloTCO?
20:25ctdeantail call optimization
20:25mrsoloya
20:25mrsolowell he is waiting for jvm implementation right?
20:26ctdeanThe author of that blog post said noone who uses clojure loses sleep over TCO.
20:27mrsoloyou can get aroun dit
20:27mrsolojust not as..nice
20:27ctdeanThe clojure way is an engineering compromise, seems like a good trade off to me
20:28mrsoloyou can't really do continuation passing style without tco right?
20:29ctdeanYou can always use tampolining, if that's your thing
20:30mrsolothat hash thing sure is a suprise
20:31ctdeanyea, it's annoying
21:36durka42whoa
22:09hiredman~everybody is <reply>everybody looks good in a shineheart
22:09clojurebotYou don't have to tell me twice.
22:09durka42a what now
22:10hiredmanpardon me
22:10hiredman~everybody is <reply>everybody looks good in a sheinhardt
22:10clojurebotRoger.
22:11durka42~google sheinhardt
22:11clojurebotFirst, out of 887 results is:
22:11clojurebotSheinhardt Wig Company — Blogs, Pictures, and more on WordPress
22:11clojurebothttp://en.wordpress.com/tag/sheinhardt-wig-company/
22:19arohneris there a way to control the repl prompt?
22:19arohnerlike $PS1
22:20hiredman,(doc clojure.main/prompt)
22:20clojurebot"/;nil; "
22:20hiredman,(doc clojure.main/prompt?)
22:20clojurebot"/;nil; "
22:20hiredmanoh
22:20Chouserthe contrib repl can do that I think
22:20hiredmandarn
22:20durka42,(use 'clojure.contrib.repl-ln)
22:20clojurebotnil
22:21durka42(doc repl-prompt)
22:21clojurebot"([]); Returns the current repl prompt based on this repl's prompt-fmt"
22:22arohnerhrm, slime isn't too happy with it
22:23rabidsnailIs there a way to test if a particular var is defined?
22:25arohnerI can probably just binding clojure.main/repl-prompt
22:25durka42rabidsnail: resolve
22:25durka42,(resolve 'not-defined)
22:25clojurebotnil
22:25durka42,(resolve 'print)
22:25clojurebot#'clojure.core/print
22:26rabidsnailexcellent
22:59JAS415is there a way to make clojure.contrib.http.agents return anything other than headers?
23:00arohnergrr, it appears slime hard codes the slime prompt, and doesn't work if I change the clojure.main/repl-prompt
23:38jtalanyone know the story of re-split ?
23:39jtalI've come across it in the book a few times and I dont think I saw anything that mentioned ints in str-utils
23:52arohner,(doc clojure.contrib.str-utils/re-split)
23:52clojurebot"/;nil; "
23:52arohnerhrm
23:52arohneranyways, it's there
23:53jtalyeah, I know its there
23:53hiredman,(doc re-split)
23:53clojurebot"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:53jtaljust wondering why its used in the first few chapters of the book as if it was loaded
23:53jtalmaybe I missed something that said "load this"