#clojure log - Jul 11 2010

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

0:35 programble: does fogus ever irc?

0:37 lancepantz: programble: yeah, he's here daily

0:38 programble: but not when i need him

1:39 KevinDHaX0r: How do I use the clojurebot?

1:39 dakrone: KevinDHaX0r: prepend your statement with a comma

1:39 ,(+ 2 2)

1:39 clojurebot: 4

1:40 KevinDHaX0r: ,(defn fact (n) (if (zerop n) 1 (* n (fact (- n 1)))))

1:40 clojurebot: java.lang.IllegalArgumentException: Parameter declaration n should be a vector

1:40 KevinDHaX0r: just learning clojure. used to ANSI CL.

1:40 dakrone: the arguments to a function go in a vector

1:40 KevinDHaX0r: ,(math/sqrt -1)

1:40 clojurebot: java.lang.Exception: No such namespace: math

1:41 dakrone: (defn fact [n] (if (zero? n) 1 (* n (face (- n 1)))))

1:41 s/face/fact/

1:41 KevinDHaX0r: ,(defn fact [n] (if (zerop n) 1 (* n (fact (- n 1)))))

1:41 thank you.

1:41 sexpbot: (defn fact [n] (if (zero? n) 1 (* n (fact (- n 1)))))

1:41 clojurebot: DENIED

1:41 dakrone: unfortunately, clojurebot doesn't let you define functions so it doesn't get taken advantage of :)

1:42 KevinDHaX0r: ,(fact 5)

1:42 clojurebot: java.lang.Exception: Unable to resolve symbol: fact in this context

1:42 KevinDHaX0r: ,((fn [x] x x) (fn [x] x x))

1:42 clojurebot: #<sandbox$eval498071$fn__498074 sandbox$eval498071$fn__498074@144eef3>

1:43 KevinDHaX0r: cool,

1:48 ,(((fn [X] ((fn [procedure] (X (fn [arg] ((procedure procedure) arg)))) (fn [procedure] (X (fn [arg] ((procedure procedure) arg)))))) (fn [func-arg] (fn [n] (if (zero? n) 1 (* n (func-arg (- n 1))))))) 5)

1:48 clojurebot: 120

1:49 KevinDHaX0r: ,(((fn [X] ((fn [procedure] (X (fn [arg] ((procedure procedure) arg)))) (fn [procedure] (X (fn [arg] ((procedure procedure) arg)))))) (fn [func-arg] (fn [n] (if (zero? n) 1 (* n (func-arg (- n 1))))))) 100)

1:49 awsone. I like the bot.

1:49 clojurebot: 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

1:49 KevinDHaX0r: works without even defining a function :-) Is it ok if I do this.

1:50 or is tjhis abusing the bot. I want to play with your bot, but I don't want to piss anyone off doing this.

1:52 dakrone: is using the Y-Cominator to write annymous recusive functions ok.

1:53 ,()

1:53 clojurebot: ()

1:53 dakrone: KevinDHaX0r: it's hiredman's bot, I don't think he'd mind

1:53 I believe the limitation was there so people couldn't overwrite core methods

1:54 as long as it's not malicious :)

1:55 KevinDHaX0r: nope. just mathematical functions.

1:55 I forgot it was not like my lisp computer at my computer, you can't just restart the bot. The worse case, is that the bot runs out of stack space. but I don't see that happening.

1:56 or, at least, I hope a good compiler would not let that happen.

1:57 dakrone: it's running in a sandbox, so I believe it attempts to catch things that could harm it

1:57 ,(System/exit 0)

1:57 clojurebot: java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.0)

2:07 KevinDHaX0r: ,(((fn [X] ((fn [procedure] (X (fn [arg] ((procedure procedure) arg)))) (fn [procedure] (X (fn [arg] ((procedure procedure) arg)))))) (fn [func-arg] (fn [n] (if (or (zero? n) (= 1 n) n (+ (func-arg (- n 1)) (func-arg (- n 2))))))) 5)

2:07 clojurebot: EOF while reading

2:08 dakrone: missed a paren, looks like

2:09 KevinDHaX0r: ,(((fn [X] ((fn [procedure] (X (fn [arg] ((procedure procedure) arg)))) (fn [procedure] (X (fn [arg] ((procedure procedure) arg)))))) (fn [func-arg] (fn [n] (if (or (zero? n) (= 1 n) n (+ (func-arg (- n 1)) (func-arg (- n 2)))))))) 5)

2:09 clojurebot: java.lang.Exception: Too few arguments to if

2:10 KevinDHaX0r: caught it thanks to emacs

2:10 ,(((fn [X] ((fn [procedure] (X (fn [arg] ((procedure procedure) arg)))) (fn [procedure] (X (fn [arg] ((procedure procedure) arg)))))) (fn [func-arg] (fn [n] (if (or (zero? n) (= 1 n)) n (+ (func-arg (- n 1)) (func-arg (- n 2))))))) 5)

2:10 clojurebot: 5

2:12 KevinDHaX0r: ,(((fn [X] ((fn [procedure] (X (fn [arg] ((procedure procedure) arg)))) (fn [procedure] (X (fn [arg] ((procedure procedure) arg)))))) (fn [func-arg] (fn [n] (if (or (zero? n) (= 1 n)) n (+ (func-arg (- n 1)) (func-arg (- n 2))))))) 10)

2:12 clojurebot: 55

2:14 KevinDHaX0r: Thank you for letting me use the bot.

2:21 Good night everybody. Thanks for letting me use your bot.

3:38 LauJensen: Good morning all

4:35 Licenser: good morning my lispy friends

4:35 $(def fibs (lazy-cat [0 1] (map + fibs (rest fibs))))

4:35 sexpbot: => #'net.licenser.sandbox.box3471/fibs

4:35 Licenser: $(nth fibs 10000000000)

4:35 sexpbot: java.lang.Exception: EvalReader not allowed when *read-eval* is false.

4:36 Licenser: $(nth fibs 10000000000)

4:36 sexpbot: java.lang.Exception: EvalReader not allowed when *read-eval* is false.

4:36 Licenser: $(nth fibs 100000)

4:36 sexpbot: => 2597406934722172416615503402127591541488048538651769658472477070395253454351127368626555677283671674475463758722307443211163839947387509103096569738218830449305228763853133492135302679278956701051276... http://gist.github.com/

4:59 anonymouse89: Is there a way to access the index of an item when using map/pmap?

5:11 right, got it: (map #(func % %1) coll (range coll-size))

5:11 kib2: anonymouse89: from Programming Clojure you can use this http://prism-pastebin.heroku.com/72

5:12 Bahman: Hi all!

5:56 roblally: Hey guys, I little question: what's the correct way to determine if something is a ref? I had hoped that there would be a 'ref?' function but I can't see anything.

5:56 AWizzArd: ,(instance? clojure.lang.Ref (ref 0))

5:56 clojurebot: true

5:59 roblally: Yikes, that's not pretty. I assume since that's so ugly that I'm doing something wrong. I have some code that pulls data out of a ref, that I now want to call inside a transaction where the ref has already been derefed. I don't imagine that I'm the first person to want to do this so I guess I'm missing something.

6:02 AWizzArd: Please give more details.

6:03 mmarczyk: morning

6:03 hi AWizzArd :-)

6:03 AWizzArd: Hi mmarczyk

6:04 mmarczyk: roblally: just call your code, the fact that the ref has been deref'd doesn't matter... although you might want to deref only once, storing the result in a local, and factor out any transformations into their own functions

6:05 incidentally, normally you don't need to check whether something is a Ref or not, because you just know it beforehand -- it's part of your design :-)

6:09 roblally: An example of what I'm talking about I have some code that looks like this: (defn get-foo [bar] (:x (:y (:z @bar))) Now inside a (dosync (alter bar (fn [bar..] I want to call get-foo. I know that it is a ref when I call get-foo, outside the dosync, and I know that I have the contents of the ref inside the transaction. It seems I need to either duplicate the code or make derefing the callers responsibility.

6:10 mmarczyk: you *should* make it the caller's responsibility

6:11 AWizzArd: Indeed, the ref is just the outer container for your real object. Your fns should operate on the objects, while your transactions work on the refs.

6:11 mmarczyk: also, you could simplify it to (get-in bar [:z :y :x]) or (-> bar :z :y :x)

6:11 AWizzArd: Anyone here with a recent clojure.jar? Please test if (do (set! *warn-on-reflection* true) (defrecord Foo [])) throws a Reflection warning for you too.

6:12 mmarczyk: AWizzArd: yeah, I posted about it to the ggroup a while ago

6:13 AWizzArd: Would be great if one could have a switch that sets *w-o-r* to true during the build process of Clojure and Contirb.

6:13 roblally: That's obviously the lesser of the two evils, but making it easy for code to handle either would seem cleaner. Hence my thoughts along (defn get-foo [bar] if(ref? bar) (get-foo @bar) (....)). I'll try to stick with the idiomatic version, though. Thanks guys.

6:14 mmarczyk: hm, actually I posted a more elaborate case

6:14 not a completely empty defrecord

6:14 so this is better

6:14 AWizzArd: http://groups.google.com/group/clojure/browse_thread/thread/5d27195d45b2d214/fb51906b2f960d4c?lnk=gst&q=reflection+warning#fb51906b2f960d4c

6:14 roblally: I have exactly the opposite opinion on what is cleaner :-)

6:15 AWizzArd: roblally: given that the object in the ref is a record you can define a Protocoll and implement get-foo for Refs and your record type.

6:16 mmarczyk: you should be explicit about dealing with mutable state, not only for the sake of the prevailing idiom, but to save yourself from weird surprises

6:16 roblally: I'm avoiding 1.2 for the moment - I want to make sure that when things don't work it is my fault.

6:17 mmarczyk: (well, a multimethod would work too, but that's still just wrong :-P)

6:19 Chousuke: roblally: generally you should code functions so that they only deal with immutable data

6:20 roblally: For me, the cleaner choice is whatever makes things easier for the caller. Where easier means 1) not having to care about things, 2) fewer keystrokes. (I'd rather have ugly inside than outside. Sort of the opposite of how I choose my friends). My functions are only dealing with immutable state - except where they're not. The functions that are bothering me here are the ones that only read values.

6:20 Chousuke: roblally: the better version of get-foo is (defn get-foo [bar] (-> bar :z :y x)) which is then called as (get-foo @bar). That way, the function deals only with immutable data.

6:21 it also works with alter

6:21 AWizzArd: fewer keystrokes is good when it increases productivity

6:21 Chousuke: it's not "easier" on the user to hide the fact that bar is a ref

6:21 AWizzArd: saving to type “deref” does not improve productivity

6:21 the keystrokes that you save by having a GC is, or that you can use fully persistent datastructures.

6:21 Chousuke: refs should be explicit, and the user should be aware of them; they're the things that you need to care about

6:21 AWizzArd: That’s effective saving of keystrokes.

6:22 Chousuke: if get-foo is a pure function, then the user doesn't need to care about what it does to the ref, because it doesn't deal with the ref at all

6:23 mmarczyk: the user might be surprised to find that the bar he's been accessing through get-foo seems to have changed

6:23 Chousuke: consider the case when you actually pass the ref to the function. You need to know what the function does to be sure that it doesn't mess with the ref

6:23 mmarczyk: more likely, the code might assume that nothing changes, since there's nothing to indicate there's any mutable state involved

6:23 roblally: I want fewer keystrokes, not to save typing effort, but to reduce reading effort. (calculate-delta-path portfolio1 portfolio2) is easier than (calculate-delta-path (deref portfolio1) (deref portfolio2)) because there are fewer tokens to consider.

6:23 mmarczyk: then hilarity ensues

6:23 Licenser: hmm vectorial math isn't too bad in clojure :)

6:23 Chousuke: roblally: no

6:24 roblally: that would be @portfolio1 and @portfolio2

6:24 roblally: the thing is, *without* the @ signs you'd have to think about whether calculate-delta-path does something to the refs or not

6:24 roblally: Well, yes or no - depending on what I happened to have typed - but point taken

6:24 Chousuke: roblally: that's much more effort than reading the @ signs

6:25 with the @ signs it's immediately obvious that the function only cares about the value of the ref, not the ref itself, and it's worry-free

6:26 it might still be doing the wrong thing but at least it won't mess up the rest of the program :)

6:26 roblally: Unless the values point to other refs and then it isn't safe so you gained nothing.

6:26 Chousuke: well, yes, but that's nonidiomatic

6:26 refs shouldn't contain other refs

6:26 that breaks snapshotting

6:27 roblally: Interesting, I didn't know that.

6:27 How would one model a bi-directional relationship without that?

6:27 AWizzArd: yes, for that you will need refs in refs

6:27 Chousuke: use ids?

6:28 AWizzArd: ids is what I use in my Clojure DB system

6:29 Chousuke: of course, all advice given here is just best-practice. Sometimes it might be necessary to break the rules

6:29 but it'll often lead to more complicated code.

6:30 roblally: But if it breaks snapshotting (by which I assume you mean the transactionality of fhe system) then isn't it a major problem?

6:30 Chousuke: well no, since you can still get a consistent image in a transaction

6:30 I meant easy snapshots with just a deref

6:31 roblally: Ahh, OK. So things still work - you just end up in the ugly-code corner I've painted myself into.

6:31 AWizzArd: Clojure refs or ids are just references to some other objects. You need to deref (i.e. follow) both to arrive at the object that's referenced. In Clojure it is called deref, in sql the equivalent may be joins

6:31 Chousuke: if you have a single ref, you can just do @foo, but if you have many levels, you need to do (dosync (doall (for [thing @foo] @thing)))

6:32 AWizzArd: join ... on t1.id=t2.id ...

6:34 roblally: AWizzArd: but in a DB you get cascading deletes to help you clean up. On the JVM you'll need to manage the IDs manually to stop them kicking round long after anyone cares about them.

6:34 Or have I missed a clojure trick there?

6:35 Anyway - I don't like the code I have, so I'm going to try redoing things taking your suggestions into account. I'll see how things turn out in version 2.

7:01 cschreiner: Can someone explain why Color. balks at this? http://gist.github.com/471459

7:02 Do I need to introduce type-hinting, or is the problem more obvious?

7:02 hoeck: cschreiner: can you paste the exception too?

7:02 cschreiner: sure

7:03 there

7:03 I can (Color. 1 2 3 4) in the repl

7:04 but not from this fn

7:06 hoeck: cschreiner: maybe casting everything to a primitive int will work: (Color. (int red) (int green) (int blue) (int alpha))

7:06 Licenser: out of curiosity is this right: http://gist.github.com/471462 (A B and P are all vectors in the form of [x y z])

7:07 cschreiner: yes, I typed the return of inside-byte

7:07 that worked

7:08 hoeck: cschreiner: because java.awt.Color has many constructors, for ints, floats ..

7:08 cschreiner: hoeck: thanks

7:08 hoeck: np :)

7:08 Licenser: hmm I think it is wrong :(

7:11 hoeck: yay, geometry!!

7:12 Licenser: hoeck: I hate it especially when I don't find what I want since there is neither a simple expleation nor do I find my table collection :P

8:05 cschreiner: Darker and Lighter color-functions for use with css -> http://gist.github.com/471501

8:13 Does it look idiomatic?

8:53 mmarczyk: cschreiner: yes, it's very nice! you could do [red green blue] (map #(-> % (* fr) Math/round inside-byte) [(.getRed c) (.getGreen c) (.getBlue c)]) to make it a bit DRYer

8:53 cschreiner: mmarczyk: yes I could. Good point..

8:55 mmarczyk: cschreiner: also, you're repeating the condp form almost unchanged

8:55 hm, probably not worth refactoring though

8:55 but maybe use identical?

8:55 cschreiner: ,(doc identical?)

8:55 clojurebot: "([x y]); Tests if 2 arguments are the same object"

8:55 cschreiner: okay

8:55 I'll wrap my head around this now

8:55 mmarczyk: for 1.2, case would be nicer than condp

8:55 cschreiner: :)

8:55 mmarczyk: :-)

8:56 cschreiner: Thanks

9:02 Lajla: ,([1 1])

9:02 clojurebot: java.lang.IllegalArgumentException: Wrong number of args (0) passed to: PersistentVector

9:02 Lajla: Guess not.

9:03 mmarczyk, how are you adapting to life without legs?

10:13 cschreiner: Hopefully a little smarter, more idiomatic, with the addition of a blend fn -> http://gist.github.com/471501

10:14 technomancy: sweet; I think I killed the "idiomatic namespaces" thread.

10:39 cschreiner: I need to turn "FFF" into "FFFFFF" or "AE9" into "AAEE99", what's the most mindblowing way of doing that?

10:40 technomancy: ,(apply str (interleave ["FFF"] ["FFF"]))

10:40 clojurebot: "FFFFFF"

10:40 Hodapp: most mindblowing, or most efficient?

10:40 cschreiner: ah interleave

10:40 technomancy: ,(apply str (interleave (take 2 (repeat ["AE9"]))))

10:41 clojurebot: java.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$interleave

10:41 technomancy: ,(apply str (apply interleave (take 2 (repeat ["AE9"]))))

10:41 clojurebot: "AE9AE9"

10:41 cschreiner: Hodapp: suggestions?

10:41 technomancy: doh!

10:41 cschreiner: no dice :)

10:43 technomancy: ,(apply interleave (take 2 (repeat "AEF"))) ; oh, right

10:43 clojurebot: (\A \A \E \E \F \F)

10:44 technomancy: apply str that

10:44 mmarczyk: (defn dupl [s] (if-let [x (first s)] (cons x (cons x (dupl (next s)))))) :-P

10:44 cschreiner: technomancy: nice

10:44 mmarczyk: (apply str (dupl "AEF"))

10:44 cschreiner: ,(doc dupl)

10:44 clojurebot: Excuse me?

10:45 mmarczyk: for the above solution, (repeat 2 "AEF") could be useful :-)

10:45 cschreiner: see the defn above

10:45 cschreiner: mmarczyk: ok, I'm with you

10:45 mmarczyk: ,(->> "AEF" (repeat 2) (apply interleave) str)

10:45 clojurebot: "clojure.lang.LazySeq@a7859cc1"

10:45 mmarczyk: ,(->> "AEF" (repeat 2) (apply interleave) (apply str))

10:45 clojurebot: "AAEEFF"

10:46 mmarczyk: hm, that's really nice actually :-)

10:46 cschreiner: indeed!

10:46 technomancy: winner!

10:46 cschreiner: :-)

10:47 mmarczyk: :-)

10:47 wlangstroth: is it odd that I find (apply str (apply interleave (repeat 2 "AEF"))) easier to read?

10:47 mmarczyk: technomancy: is lein 1.2 on hold 'til the repl task gets sorted then?

10:47 technomancy: mmarczyk: no, it's waiting for a Clojure release candidate

10:47 mmarczyk: ah, I see

10:48 I'd like to get onto some of those tasty tickets, but that'll be problematic due to time constraints for a week or so...

10:48 I'm still curious about your design ideas for the standalone compile, detached (projectless) plugins etc.

10:49 with view of hopefully chipping in on the implementation in a little while :-)

10:50 technomancy: I'd love some help. I will start a brainstorming thread on the mailing list once the release goes out.

10:51 cschreiner: wlangstroth: it's not odd, we just need more training ;-)

10:53 mmarczyk: cool.

10:58 technomancy: mmarczyk: the other thing besides user-level plugins that i've been considering is writing shell wrappers to disk for when you install a project

10:59 mmarczyk: there aren't very many clojure programs right now meant to be launched from the shell... partly a cultural thing and partly a chicken/egg problem since the tools for that are crap right now.

11:02 also been thinking of a few things to help with making projects work with multiple clojure versions

11:03 first would be making it easy to recompile all your deps with the current clojure version

11:03 dsop: technomancy: is there a separation between dev-deps and normal deps in lein 1.2 so that they are not thrown into the same lib directory anymore?

11:03 technomancy: and then a multitest task that can test with multiple dependency sets

11:03 dsop: yeah, that's been implemented in 1.2

11:03 dsop: oh great. thanks!

11:03 * dsop upgrades to lein-master

11:04 technomancy: dsop: you can use self-install on 1.2.0-RC2

11:04 no need for git

11:04 dsop: ah okay, but I prefer running master. git is installed anyway.

11:05 technomancy: sure

11:15 mmarczyk: technomancy: interesting

11:15 wlangstroth: technomancy: I thought there were no clojure shell programs because it generally takes ages for the JVM to fire up

11:16 technomancy: wlangstroth: well, that's why there are no short-running clojure shell programs

11:16 but it would be convenient to have shell wrappers even for long-running server apps or web applications

11:16 mmarczyk: technomancy: recompile deps, as in, extract clj files from the jars if available and have the project's clojure.jar compile them?

11:16 technomancy: yeah

11:17 wlangstroth: technomancy: ah, true

11:19 mmarczyk: technomancy: the problem of clojure.string vs. clojure.contrib.str-utils{n} etc. remains... unless you're thinking of some automatic refactoring support for that :-)

11:21 about the shell wrappers, how about "installer bundles" comprising a jar / uberjar, a shell wrapper and a shell script to put both someplace convenient and install a symlink to the shell wrapper wherever the user wants it?

11:21 technomancy: well, the old namespaces are going to stick around a while

11:21 mmarczyk: also, I wonder how much of cljr you'd want / be willing to duplicate?

11:22 or you could not care about that, I guess

11:22 technomancy: I haven't looked into that much

11:23 I'm thinking you could just keep the shell script inside the jar so it could live in clojars

11:23 then at install-time you'd check to see if a jar had a shell script in it and place it on the path if so

11:24 rubygems has a neat wrapper script that lets you select various versions with environment variables; might be a nice idea to steal

11:26 mmarczyk: ah, I like the shell-in-a-jar thing

11:56 * cschreiner thinks he's finished now -> http://gist.github.com/471501

11:57 cschreiner: I dig the "some" fn

11:58 MAslan2010: ,()

11:58 clojurebot: ()

12:00 technomancy: good function, terrible name

12:39 anonymouse89: should pmap operate with less overhead than agents? or can I expect the same performance?

12:39 (on very cpu intensive fn's, that is)

13:06 mmarczyk: cschreiner: cool, now to make a Swing clone of 0to255.com with it :-)

13:29 cschreiner: mmarczyk: yeah, why not..

13:49 bleakgadfly: I am trying to do a (load-file) in Clojure REPL but get java.lang.IllegalArgumentException (file.clj:1). Could anyone give me a hint about what it means?

13:50 If I try to load it again, the only thing that changes is the number behind "file.clj", (file.clj:2) (file.clj:3) and it keeps going for as many times I try to do load-file.

13:50 I doubt theres an error in every single line of the code.

14:01 LauJensen: Good morning all

14:01 qbg: Good morning

14:08 chouser: bleakgadfly: It's probably an error in the ns macro at the top of file.clj. The line numbers sometimes get messed up.

14:14 samg_: I am having trouble setting up Clojure with SLIME on emacs. I get an error from swank I believe, saying progn is undefined, because it is using clojure intead of common lisp. Something is wrong wtih my .emacs file, but I am not sure what.

14:15 my .emacs: http://paste.lisp.org/display/112374

14:35 bleakgadfly: chouser: Thanks, seems like thats where the error is coming from

14:36 Going nuts trying to find out exactly what is giving me these errors

14:36 Only got (:refer-clojure :exclude [reverse replace]) (use 'clojure.string) and (use '[clojure.java.io :as io]) at the top

14:38 chouser: can you get a full stacktrace? sometimes there's a hint in there as to what's actually failing.

14:38 bleakgadfly: I only get java.lang.IllegalArgumentException

14:38 chouser: This is a plain terminal repl?

14:39 bleakgadfly: Yeah

14:39 I have run it from terminal and via Emacs shell

14:39 chouser: try (.printStackTrace *e)

14:39 bleakgadfly: Same error

14:39 Okay.

14:40 chouser: after you try the load-file that is.

14:40 bleakgadfly: Yeah

14:40 Thanks

14:40 I found the error

14:41 chouser: oh, great.

14:41 bleakgadfly: Seems like (str) didn't like to have another (str (.Date var)) in it.

15:16 cschreiner: bleakgadfly: (str (Date. ... you mean

17:23 Kjellski: ping?

17:23 clojurebot: PONG!

17:24 Kjellski: ,(contains? [\a \b \c] 1)

17:24 clojurebot: true

17:24 Kjellski: ,(contains? [\a \b \c] \a)

17:24 clojurebot: false

17:24 Kjellski: ,(doc contains?)

17:24 clojurebot: "([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constant or logarithmic time; it will not perform a linear search for a value. See also 'some'."

17:25 * nDuff supposes contains? could be less ambiguously named has-key?

17:25 Kjellski: Can someone give me a hint what to use to test wether a char is in a seq?

17:26 nDuff: *signed*

17:28 nDuff: ,(some #{\a} [\a \b \c])

17:28 clojurebot: \a

17:29 nDuff: ,(some #{\d} [\a \b \c])

17:29 clojurebot: nil

17:29 nDuff: Kjellski, ^^^

17:29 Kjellski: nDuff: thanks, thought there would be something like pythons "in" ^^

17:33 dnolen: ,(some #{\d} "abcd")

17:33 clojurebot: \d

19:34 Raynes: technomancy: Is there a way to tell lein to output something other than projectname-version-standalone.jar on uberjar?

19:47 lancepantz: Raynes: i believe i saw a ticket related to that on github

19:47 i'm not sure if it ever got implemented

19:47 Raynes: :\

19:55 mmarczyk: Raynes: yes there is

19:55 since recently

19:56 Raynes: mmarczyk: Doesn't matter, I just stole liebke's cljr code.

19:56 mmarczyk: :jar-name, :uberjar-name

19:56 in project.clj

19:56 cljr code? to do what?

19:58 (you could also say "lein jar foo.jar" / "lein uberjar foo.jar" to override the project.clj default, though uberjar still creates a regular jar first with the default name)

19:58 Raynes: mmarczyk: Installation stuff.

19:59 mmarczyk: http://github.com/liebke/cljr/blob/master/src/main/resources/cljr/main.clj#L146

19:59 He and I use a similar installation for our applications here.

19:59 mmarczyk: let's see...

19:59 Raynes: And I didn't realize that when you run a jar, it's put on the classpath.

20:00 I had the jar name hardcoded in my installer code, but the new RCs of Leiningen don't care for that.

20:00 clojurebot: the leiningen screencast is on full disclojure: http://vimeo.com/8934942

20:00 mmarczyk: ah, so you no longer care about the jar's name

20:00 Full Disclojure! it's been ages...!

20:01 since clojurebot's mentioned it.

20:26 666 Clojure questions on SO :-)

22:10 slyrus_: anyone working on other graph libraries besides clojure.contrib.graph?

22:47 thirddog: Looking for clojure library for sql work (mysql, postgres, etc) - have tried clojureql & clj-record but not really happy with either. I like iBatis so is there anything out there that just does sql mapping to records/other structs?

23:38 technomancy: woot; _ato is going to share clojars maintainership duties!

23:51 Bahman: Hi all!

Logging service provided by n01se.net