#clojure log - Aug 01 2008

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

7:23 rhickey: Could someone verify I did the right change in pom.xml to match the latest build.xml?

7:25 cemerick: I'm afraid I don't know a damn thing about maven. More of an ivy fellow, myself. :-)

7:26 rhickey: me neither

7:26 cemerick: rhickey: I think there's a bug in MultiFn.findAndCacheBestMethod -- it's tossing an exception at line 115, which prevents .getFn from returning any default method.

7:27 rhickey: cemerick: given what input?

7:28 cemerick: given any input that doesn't satisfy isa? in the methodTable -- i.e. :default will never be returned by .getFn

7:28 or, the :default fn

7:29 rhickey: ah

7:29 cemerick: I stumbled across this while trying to use contrib/test-is, which uses some multimethods in its 'is' macro.

7:30 ...and the compiler was ditching because it wasn't finding the :default method impl

7:30 * cemerick clearly hasn't become self-aware, given the half-thoughts he's sputtering

7:33 rhickey: cemerick: fixed - thanks

7:35 cemerick: rhickey: no, thank you :-)

7:36 rhickey: random Q: do you have much of a notion of a "roadmap" in mind, in terms of releases and such?

7:39 rhickey: getting this inheritance stuff (multimethods), and directories/lib stuff in are two biggies for me. Just looking forward now to Oct, which marks 1 year of Clojure in the wild, I'd like to finesse what I have and maybe call it 1.0?

7:39 cemerick: Sounds good

7:40 do you have a test plan in mind leading up to that and afterwards?

7:41 rhickey: what I would love is a community supplied test suite - I would happily run it before every checkin. Being written by others would be an essential second check on the logic and fn description accuracy

7:42 also a community supplied example suite

7:46 cemerick: The former is pretty critical, I think -- though I don't think any existing code-contribution model would work (too many tests would need to come from too many people for there to be only a handful of test committers). Maybe we can set something up so that tests can be pulled from a wiki.

7:46 ...which might be able to double as the example suite?

7:46 rhickey: also on my todo - JavaDoc for the Clojure Java library, and docs for Clojure hosting/interop scenarios

7:47 cemerick: not sure if tests could do both, but would for sure be a start

7:48 around 400 functions in Clojure namespaces

7:49 cemerick: yeah, a test wiki certainly wouldn't be polished as one would like for tutorial material, but there should be plenty of material for people to look at, and absorb idioms from

7:49 rhickey: testing the Java...

7:51 cemerick: yeah a wiki approach wouldn't work for the Java (although one would hope that clojure-based tests would exercise the Java bits thoroughly anyway)

7:52 rhickey: cemerick: yes, the Clojure tests would shake out the Java pretty well

7:54 One concern I have about the Wiki is it being broken, accidentally or maliciously

7:55 cemerick: yeah, it's a tradeoff. Wiki's can always be rolled back, though. A test repo in svn is fine, but managing that would be a bear (assuming we want to be getting tests from as many people as possible)

8:01 rhickey: we could develop a convention for posting tests to the group with a public domain comment

8:02 ;Written by John Doe and released to the public domain, as explained at

8:02 ;http://creativecommons.org/licenses/publicdomain

8:03 cemerick: rhickey: sure -- but who's going to snip all of those submissions out and put them into a repo? I don't think we want to scrub the group every time we run a regression test.

8:04 rhickey: I'll add any submitted tests to a test.clj in SVN

8:11 cemerick: well, OK -- I figured you wouldn't want to take on more work

8:34 rhickey: I'm happy to try the wiki approach

8:38 it would allow for easier tweaking/enhancement of tests by everyone

9:03 drewr: Is there a name for this pattern? (apply foo (apply bar args))

9:04 ISTR there being a function which does a double APPLY.

9:05 rhickey: drewr: not as far as I know

9:09 Chouser: you'd want lots of separate wiki pages so people don't step on each others changes.

9:09 and you'd want the test to be run at the moment of submission or something to prevent typos from generating false negatives

9:10 rhickey: Chouser: hmmm... how would you pull the test suite to run it?

9:11 Chouser: I guess the wiki pages for tests could have a common prefix or something.

9:12 rhickey: ugh

9:12 Chouser: I'm not exactly championing the idea here -- I'm trying to think through how it would work.

9:13 rhickey: I understand

9:13 Chouser: I think I might prefer another svn repo to a wiki. You'd have the same kind of thing -- lots of test files to reduce check-in conflicts.

9:14 rhickey: the Clojure wiki seems to have per-section edit granularity, but it could be an illusion

9:15 Chouser: having a clojure-test svn repo would solve the authentication/licensing issue and would be easy to pull.

9:15 rhickey: Any SF project needs membership maintenance

9:16 * rhickey presumes the 4 current clojure-contrib members don't want to write 100 tests each

9:16 rhickey: :)

9:17 Chouser: heh

9:17 well, if the wiki lets people add sections simultaneously, you could have one section per test...

9:20 rhickey: public domain submissions to a test.clj maintainer/guardian seems more solid. If I don't end up with a single test.clj I'll be disinclined to run them, and I don't see a way to validate submissions to a wiki

9:21 Chouser: test-czar sounds like a lousy job though. you don't want it.

9:21 rhickey: yeah, if I was into tests, Clojure would have them

9:21 Chouser: heh

9:22 I'm deeply into the idea of tests, but ...

9:36 * rhickey added TransactionalHashMap, an implementation of java.util.ConcurrentHashMap that works in/with transactions

9:36 rhickey: java.util.concurrent.ConcurrentMap

9:42 Chouser: cool

10:04 cemerick: I was thinking of the test-wiki as being: one test per page, with an automated script to suck down every test and drop it into a local regression test suite. I was suggesting that simply because no one wants to be point-man on a test svn repo.

10:34 albino: writing tests seems like a good way to learn clojure, are you guys building a list of testcases in english that people could then pick up and write?

11:18 Chouser: it's be easier to write the test in clojure than in english

11:18 but reading the docs for the functions would point you in the right direction.

11:24 albino: well test specifications are usually written in a human language

13:52 drewr: Again, I feel like I'm missing something obvious. What's the clojure FUNCALL equivalent?

13:53 rhickey: drewr: thosecaps are killing me

13:53 drewr: Haha, well in this case I'm actually referring to a CL function. :-)

13:53 rhickey: no need for funcall in Clojure, because first arg is evaluated, also, vars implement IFn

13:53 Lisp-1 and all

13:55 so just remove the funcall from CL code and it should work

13:55 drewr: OK, I figured it was something like that. I guess my code has a different problem.

13:55 rhickey: BTW, I sent in my CA a couple days ago.

13:56 rhickey: Cool, thanks!

13:57 * rhickey looks forward to more CAs than Pennysavers in his Clojure PO box...

14:37 drewr: Is (not (not-any?)) the shortest way to implement any? ?

14:38 rhickey: what is any?

14:38 drewr: If any (pred x) are true in coll.

14:38 rhickey: (doc some)

14:39 returns the true value found

14:39 so not technically a ? predicate

14:40 drewr: OK.

14:45 albino: drewr: you pulling that from python? any(x % 2 == 0 for x in range(10))

14:46 drewr: albino: Yeah, I guess that's why my brain wanted to call it that. :-)

14:47 rhickey: any? would be the logical name if it returned true/false

14:48 albino: I do appreciate all() and any() in python, even if they can be written as calls to reduce()

14:48 rhickey: CL's wordsmiths distinguished some from any/notany

14:49 albino: python's reduce can bail early, for any()?

14:49 drewr: I had to use (some #(identity %) [....]) to get a single value.

14:49 albino: rhickey: I don't think so

14:50 rhickey: drewr: (some #{x} [...])

14:51 until we get find/member

14:53 drewr: Remind me how the reader interprets #{}.

14:54 rhickey: it's a set, and sets are functions of their 'keys', so a set can be used as a predicate for some, as long as what you are looking for isn't false/nil

14:55 user=> (some #{2 4} [3 4 5 6])

14:55 4

14:56 * drewr needs to do (some #{#"foo" #"bar"} ["xxfooxx" "sbarro"])

14:57 rhickey: you can't use a set unless you are looking for values in the set

14:58 just covers your identity case earlier

18:18 Chouser: looks like I lost my connection there for a while -- no logs for that part. :-/

18:20 dkf: um.. you didn't miss anything

Logging service provided by n01se.net