#clojure log - Nov 13 2012

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

0:00 amalloy: dangit, brainproxy, it's hard to even tell you what filterM's arg/return types are without haskell type notation, and iirc you don't know any haskell

0:01 Raynes: Give him a less in Haskell type signatures.

0:01 It isn't that hard.

0:02 lesson

0:03 amalloy: well, filterM has type: filterM :: (a -> m Bool) -> [a] -> m [a]. so it takes a list of Things, and a way to turn a Thing into a boolean wrapped in a monadic value, and produces a list of Things wrapped in a monadic value

0:04 Raynes: Don't quit your day job.

0:04 amalloy: choke on a bucket of slugs

0:06 mattmoss: amalloy: He doesn't know Haskell. He's also on the phone at the moment, so give him a few to get back to you.

0:07 amalloy: are you two in the same room?

0:08 mattmoss: He's in the next room, but his voice isn't... soft. ;)

0:08 ToxicFrog: I'm saving "choke on a bucket of slugs" for later, thanks.

0:11 amalloy: ToxicFrog: well, i toned it down a bit for #clojure. google for sebastian droge if you're interested in the original

0:11 ToxicFrog: I'm familiar with the original, but I like this version

0:12 amalloy: enjoy, then!

0:12 Raynes: That's strange.

0:12 mattmoss: Where are you people?

0:13 mattmoss: Raynes: brainproxy and I share an apartment. In fact, I work for him. St Louis

0:13 Raynes: That's pretty hot.

0:13 I mean, cool.

0:13 mattmoss: o_O

0:16 Raynes: mattmoss: Are you wanting to stop reading after you get to a certain line?

0:16 Also, sorry for the innuendo. I'm that kind of person.

0:17 mattmoss: Raynes: I want to start up a server, see that a certain line of output has passed (to know the server is fully initialized), run some other code against the server, then send input to the server/process to cleanly shutdown the process.

0:17 Raynes: No worries. ;)

0:18 Raynes: I'm trying let-programs, but I get the same results... it's basically hanging in there somewhere. If I add :background, then the program returns a future immediately, but that future never realizes.

0:18 Raynes: Reason I was asking is because conch.sh will always consume all output and will hold it in memory, so you have to be careful if it's going to be dumping a lot of stuff you don't care about. You don't have to read it all, but it stays in memory until you do.

0:19 It's hanging with {:seq true}?

0:19 If so, are you doing this at the repl and trying to print the seq?

0:20 mattmoss: Yes to hanging with :seq true. Yes, at repl.

0:21 As to consuming output... there shouldn't be too much, and I can deal with that.

0:22 I'll try to not dump the seq to the repl immediately, see if it doesn't hang.

0:23 Okay, ya, that seems like the issue.

0:23 Raynes: Yeah, if you try to print the seq you wont see any output at all until the whole program is done.

0:23 You can do something like (take 2 ..).

0:23 mattmoss: Right....

0:24 Cool, looks good. I'll rewrite my stuff using that and try the whole again. Thanks!

0:25 brainproxy: mattmoss: are you listening to my phone conversations again??

0:25 lazybot: brainproxy: What are you, crazy? Of course not!

0:25 brainproxy: for shame

0:25 mattmoss: I have a love/hate relationship with laziness. :)

0:25 Raynes: Hope it works. If not, open an issue with some code that breaks and I'll try to sort it out.

0:25 mattmoss: brainproxy: Yes. Yes I am. I can't help not.

0:26 Raynes: Thanks.

0:26 brainproxy: amalloy: no worries, tbh filterM is a bit of distraction at this moment, but I'll get to it

0:26 Raynes: i agree, i need to learn me some Haskell

0:26 Raynes: brainproxy: Haskell was my first language, but I hadn't used it until a week ago for like 4 years. So much fun now that I'm not stupid.

0:26 s/stupid/as stupid/

0:26 brainproxy: in fact, I've started in on the "learn you a haskell..." book, but still in the early parts of the book

0:27 Raynes: I skipped to the typeclass chapter and read up through monads.

0:27 I'm like king of the Haskells now.

0:27 brainproxy: :p

0:28 Raynes: Look, I wrote some JSON parsing code that makes use of applicative functors and liftM: https://www.refheap.com/paste/6612

0:28 Obviously I win all future contests.

0:31 mattmoss: get-drunk, lol

0:40 brainproxy: so satisfies? is only for protocols? is there a similar test for interfaces?

0:43 dnolen: brainproxy: instance?

0:43 brainproxy: instance? is the way to go?

0:43 dnolen: cool, thanks

0:43 dnolen: brainproxy: satisfies? is also a performance killer on Clojure JVM - use wisely.

0:44 brainproxy: dnolen: there use will only come into effect when a certain runtime flag is set

0:44 i.e. one which is for dev purposes, not prod code

0:44 so should be okay

0:44 but thanks for the tip

0:56 Raynes: mattmoss: Bahaha, I suck at names.

0:56 mattmoss: lol

0:58 So... one last Q. It seems that the lazy-seq of the process output can't be released until the process is finished, correct? Because of the queue-stream stuff....

0:59 Raynes: Released?

0:59 mattmoss: So,... I can (take 5 ...) to get the first five lines, but a subsequent (take 5 ...) will get me those same 5 lines.

0:59 Raynes: Yes, of course. It isn't a queue.

0:59 There is a queue underneath the hood. I should probably expose it somehow, if I don't already.

1:00 mattmoss: Right. Just making sure my head is on straight.

1:00 I'm using the :verbose option so I can feed the input and shut the process down cleanly.

1:01 Whiel still watching the output

1:01 Raynes: FWIW, if things don't work it's because I haven't actually used this library for anything yet and thus you're currently a Guinea pig.

1:02 mattmoss: Well, I didn't see many other options aside from clojure.java.shell and conch, and the former wouldn't accomplish any of this.

1:02 Raynes: I want conch.sh to be the go-to library for this, so thanks for working with it.

1:04 Anyways, in case you're wondering why I'm doing all the queue crap behind the scenes, it's because Java is the devil and the process API does not allow you to read unread data from a process if that process has been destroyed, so for timeouts to work properly and allow you to get any data you haven't yet consumed after the process is destroyed you have to make sure you process that output in real-time. So I queue it up and you get a lazy-seq of

1:04 that queue.

1:04 If the process gets killed and there is unread output, you can get at it with conch.sh.

1:05 mattmoss: Also, http://amoffat.github.com/sh is where the whole concept comes from.

1:05 In case you were curious.

1:05 mattmoss: cool

1:08 Raynes: mattmoss: Also sorry for shoving it down your throat, I just haven't had anyone who cared enough to let me do so until now. :D

1:09 mattmoss: Raynes: Not at all... Hey, I need more control than simply (sh "ls"), so I'm happy to help get conch more stable/usable/whatever.

1:09 Raynes: Beats me trying to figure out all sorts of Java nonsense.

1:09 lol

1:10 Raynes: <3

1:20 mattmoss: Woot!

1:20 Raynes: I think I've got what I need... awesomeness.

1:21 Raynes: In any case, my brain is fried, and I need to chill for the night. Tomorrow, I can gist up some sample code for you to see.

1:22 Raynes: Cooool

1:22 mattmoss: Night.

1:24 mattmoss: Seeya.

1:34 tomoj: hmm (defn wrap-dispatch [app dispatch] (fn [req] ((dispatch app req) req)))

1:50 amalloy: does anyone know if a decent parser-combinator library exists for clojure? i know about fnparse, but i think that's stuck in monolithic-contrib, and i've heard of parsley but don't know if it's any good

1:51 noidi: znDuff, re: my question regarding the += operator yesterday, I needed it for JS interop

1:52 I ended up writing a macro that expands (+= foo.bar baz) to (set! foo.bar (+ foo.bar baz)), which results in foo.bar = foo.bar + baz in the generated JS

2:04 Raynes: amalloy: I think parsley is kinda the only option. I have a sneaking suspicion that the library is probably one big version range though.

2:05 Sigh

2:07 amalloy: noidi: when i was building some transients in jvm-clojure, i wrote a macro change!, such that you could write (change! (.bar foo) + baz)

2:07 you might do the same rather than use a special-purpose +=

2:09 ivenkys: folks - is there a preferred _style_ of declaring datastructures - i.e. shorthand #{} or (set {})

2:10 ro_st: the shorthand is reader sugar for the longhand. presumably it's there for a reason :-)

2:10 having said that, i do find myself using (list …) quite a lot

2:10 emezeske: Well (list ...) is much prettier than '(~x ~y ~z)

2:11 But I think #{x y z} is generally prettier than (set x y z)

2:11 amalloy: emezeske: (set x y z) is also broken, isn't it?

2:11 you mean hash-set

2:11 emezeske: amalloy: Yeah that

2:11 ivenkys: ro_st: emezeske : hmm just getting into clojure and converting a project from Java to Clojure at work - so its one of those best practices thing -

2:11 ro_st: ivenkys: you'll quickly find that it doesn't matter much.

2:12 Raynes: ivenkys: You usually have a reason for using one or the other.

2:12 emezeske: ivenkys: I am not an authority on the subject, but I say use the literals unless you have a reason not to (e.g. you're building up a set of unknown size, etc)

2:12 ro_st: clojure is so concise that most decisions are small and easy to change

2:13 Raynes: For example, why would you do (some (hash-set \x \y) ..) instead of (some #{\x \y} ..)

2:13 If you had a vector instead of a literal, it'd make sense to do (some (set myvec) ..)

2:14 ro_st: yeah. or (fn [& args] (apply hash-map args)) to get all the named args. if i'm correct, you can only gather them like this, and you can't use a literal {}

2:15 ivenkys: Raynes: in some cases you cant use a literal - but in other places you get both versions - the reader sugar and the literal - i am sort of not sure whats considered better , i prefer the literal simply because its more readable -

2:16 ro_st: then that's the right thing to do

2:16 generally, literal for declaring new data, fns for converting one collection type to another

2:17 ivenkys: ro_st: which is what i have gone with at the moment - i am sure someone in the team might have a different idea - but lets see how it rolls

2:17 ro_st: that's how things have settled for me

2:17 ivenkys: ro_st: Raynes :emezeske : amalloy : gents thanks for the help

2:18 ro_st: again - it's very easy to change this decision later. the thing to realise with clojure is that it's actually just getting out of your way and you can focus on solving the problems you're working on

2:20 ivenkys: ro_st: thats hopefully the plan - very early stages yet - taken a small "DSLish" component of a large high volume, low latency transaction engine (think trading engine)

2:26 brainproxy: hmmm, I want to call `and` on a collection which is being generated programatically... but `and` is a mcro

2:26 *macro

2:26 tyring to cook up a way to work around that, but maybe I'm missing something

2:27 amalloy: &(doc every?)

2:27 lazybot: ⇒ ------------------------- clojure.core/every? ([pred coll]) Returns true if (pred x) is logical true for every x in coll, else false. nil

2:27 ro_st: ahh it's a macro so that eval is lazy

2:28 brainproxy: amalloy: yeah, but every? isn't quite what I wanted, but maybe it will have to do

2:28 amalloy: brainproxy: every? is exactly what you wanted, given your initial question

2:28 (every? identity coll) ~= (apply and coll)

2:29 brainproxy: yeah, just realized I could use identity with it to nice effect

2:29 thanks

3:16 maleghast: Morning All...

3:16 * maleghast tips hat

3:16 maleghast: Anyone in here had any experience with SpyGlass?

3:17 I may be "letting my n00b show", but I can't work out from the docs how to handle the memcached server(s) configured in the connection I define being down.

3:17 Any ideas?

3:57 ollivera: anyone knows a clojure bluetooth api?

3:58 maleghast: Sorry, no...

3:58 This might be of some help to you though -> https://github.com/samaaron/serial-port

4:00 augustl: ollivera: I tend to look for Java libraries for that sort of thing

4:01 a lot of clojure libraries like that are just wrappers on top of java anyway ;)

4:04 ollivera: augustl, so I just need to create a wrapper to the java api ... isn't it?

4:04 _ulises: ollivera: if there's nothing else around, I'd say yes

4:04 ollivera: make sure you release it too! \o/

4:05 augustl: yeah

4:05 ollivera: _ulises, yes, I will do it

4:06 augustl: I generally don't find small clojure wrappers to be very useful

4:07 since calling Java from Clojure is generally very terse

4:08 _ulises: "terse"

4:08 augustl: can I use that word there? :)

4:08 _ulises: you can, but not in the same sentence as the word Java

4:08 ;)

4:09 augustl: good enough for me! https://www.refheap.com/paste/6618

4:09 _ulises: augustl: how about this http://clojure.org/jvm_hosted

4:13 augustl: or this, omnomnom https://www.refheap.com/paste/6534

4:13 _ulises: that one's not too bad

4:14 augustl: obviously, if the Java API is verbose then your java interop will be too ;)

4:14 _ulises: indeed

4:14 augustl: and given the swing example you linked to, I too would probably prefer a clojure wrapper of some sort

4:14 _ulises: that's why I prefer if somebody else writes a wrapper around it, even if it's a super-thin one

4:15 augustl: so we seem to have a unique case here on whether or not to wrap: "it depends"

4:15 no silver bullet :(

4:15 _ulises: indeed not

4:15 amalloy: that's not necessarily true, though. you can actually remove a lot of the rubbish verbosity just by writing in a better language, especially with doto and -> when creating new objects

4:15 _ulises: I personally prefer to always wrap

4:15 I used to use memfn a lot

4:17 augustl: amalloy: Clojure is the best Java I've seen :)

4:17 amalloy: (doto (Person.) (.setName "frank") (.setFriends (doto (FriendList.) (.add x) (.add y)))) is a good example

4:17 you don't have to repeat anything, or invent names for the intermediate objects just so you can repeat those names

4:19 augustl: been using Lucene's Java APIs with no probs at all

4:19 and in another project I'm mixing amd matching the Java APIs Jetty and CometD, also works great

4:20 amalloy: it's even a better example of clojure's power to trim out mess if you give the object a really awful API for working with friends: (doto (Person.) (.setName "frank") (-> (.getFriends) (doto (.add x) (.add y))))

4:22 augustl: another pretty nice example imo: https://www.refheap.com/paste/6619

4:22 Sgeo_: What's that do on line 38 for?

4:23 augustl: Sgeo_: I like to be explicit about doing imperative calls with side effects

4:23 so it's not for technical reasons

4:23 amalloy: is Document a Collection? it'd be nice to use .addAll once instead of .add zillions of times, if you can

4:24 _ulises: amalloy: I don't think Lucene Documents are Collections

4:24 could be wrong though

4:24 amalloy: nope, apparently not

4:24 augustl: http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/document/Document.html

4:25 it's Iterable

4:25 does that mean it's a Collection?

4:25 amalloy: no

4:25 augustl: I see

4:27 amalloy: fwiw, i think it's a little nicer to do it something like (doseq [field (cons (StringField. ...) (for [[attr value] data] (field-for-data ...))) (.add document field))

4:27 you get to spend more cognitive time in pure functions that way

4:28 augustl: TIL something new about doseq at least :)

4:29 amalloy: eh?

4:29 augustl: TIL = internet speak for today I learned

4:29 amalloy: i know. i don't think i said anything interesting about doseq

4:30 it's just...it takes a collection, and you can use cons to build that collection

4:30 augustl: ah I misread it

4:30 clgv: amalloy: let's build you a shrine anyway ;) :D

4:31 augustl: so does `for` return a collection? I would probably have used map there

4:31 clgv: augustl: yes for does return a lazy seq

4:31 augustl: s/collection/seq

4:31 clgv: I see

4:31 Sgeo_: ,(class (for []))

4:31 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (1) passed to: core$for>

4:31 Sgeo_: ,(class (for [] (do)))

4:31 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: >

4:32 Sgeo_: ,(class (for [_ []] (do)))

4:32 clojurebot: clojure.lang.LazySeq

4:32 clgv: ,(source for)

4:32 clojurebot: Source not found

4:32 clgv: ah right. the bots have none...

4:33 Sgeo_: The bots have no class?

4:33 >.>

4:34 amalloy: $source for

4:34 lazybot: for is http://is.gd/hqDKdS

4:34 amalloy: i warn you now, shield your eyes

5:05 clgv: amalloy: yeah, evil code generation with loops afair ;)

5:09 augustl: amalloy: haha, wow

5:26 fckw: Buongiorno. Does anyone know whether there exist any databases that are homoiconic?

5:27 foodoo: fckw: interesting question. What would be the consequence of a homoiconic database? All database schema can be contents of other tables?

5:28 fckw: @foodoo: I have something in mind how this might look like. But before trying to write my own database, I wanted to hear whether such a thing exists already.

5:29 And yes, basically there would be no separation between the "database schmea" and the data.

5:29 maleghast: There is some weird shit going on in my IRC client today...

5:29 foodoo: on Freenode at least

5:30 Raynes: maleghast: It's just netsplits. It happens to everybody.

5:30 $google netsplit

5:30 lazybot: [Netsplit - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Netsplit

5:31 maleghast: Raynes: Thanks - that would indeed explain it :-)

5:31 Raynes: I aim to please.

5:34 babilen: maleghast: freenode staff is sorting out routing issues (check your global notices)

5:35 maleghast: babilen: global notices (my n00b is showing again)

5:36 babilen: maleghast: notices sent to everyone on the network (10:00 [GLOBAL NOTICE] - In a few minutes there will be some network disruption whilst we sort out some internal routing issues. It shouldn't take too long, but could be a bit noisy. Thank you for your patience.) -- But this is rather off-topic in here, so lets drop it :)

5:37 fckw: @foodoo: Sorry, some idiot seems to be flooding the chat.

5:37 Raynes: Eh

5:38 It is the middle of the night for most of the US and nobody cares about mild offtopic chatter in here if it isn't disrupting Clojure discussion.

5:38 fckw: So, again: Does anyone know of the existence of a "homoiconic database"?

5:38 Raynes: So you're okay.

5:38 Also, nobody is flooding the room if you're talking about here.

5:38 It was a netsplit.

5:39 fckw: Ah, ok. I was thrown out anyway multiple times.

5:41 Oh, and another question: Does anyone know whether there exists a Java/Clojure implementation of HashMap or HashTable using longs as keys?

5:42 (Well, maybe it does not make so much sense in Clojure.)

5:43 maleghast: fckw: Were you asking about homiconic database(s) before the Netsplit sent everything a bit funny?

5:43 fckw: Yes.

5:44 maleghast: Have you looked at Datomic -> https://github.com/Datomic

5:45 fckw: Nope, thanks. I'll have a look.

5:45 maleghast: I'm not certain that it's what you are looking for, but it stands a good chance of being some of what you are looking for.

5:45 ;-)

5:48 fckw: I am neither certain what I am looking for. :D

5:48 Do you happen to also know some answer to my other question: A HashMap with the possibility of using longs as values?

5:49 maleghast: fckw: I have to be honest I have no idea - bit of a beginner at the ole Clojure myself, and I've not had to do what you describe, so I've not investigated it...

5:49 fckw: maleghast: Ok, no problem. It's honestly not so much a Clojure question but more a Java one.

5:58 terom: fckw: couldn't you just use HashMap<Long, Object> or something similar?

5:59 _ulises: terom: not sure you can check equality on Longs, and hence you can't really retrieve (k,v) from such hashmap

5:59 fckw: Using a Long as a key is internally changed to an int value, as far as I know.

5:59 * _ulises could be wrong though

6:00 terom: ah, ok...

6:01 rcg-work: hi

6:02 i got a question with respect to "objects" in clojure...

6:02 i want to do this: http://pastebin.com/m0Pc3m3s

6:02 but all the conds etc. look a little strange.. also dispatching an action based on a keyword looks awkward

6:02 i am sure there is a better (more idiomatic) solution

6:03 could please point me into the right direction?

6:03 augustl: why not different methods altogether?

6:03 scheduler-stop, scheduler-stop-now, etc

6:04 _ulises: rcg-work: you have cond with single cases, better use if, also what augustl and for the [k] version, you have two branches which do exactly the same, I'd combine them with (or ...)

6:04 augustl: s/methods/functions

6:05 another thing, won't (scheduler :stop) just stop the newly created scheduler?

6:05 i.e. do nothing? I'm not familiar with the Executors stuff though

6:05 rcg-work: augustl, yep (scheduler :stop) would do nothing, but this i would assume the programmer to handle

6:06 augustl: I tend to use methods with different dispatches based on arguments be methods that does the same thing

6:06 rcg-work: the point is that i want to encapsulate the executor object while still providing convenient access to it with functions and at the same time want to keep my code concise

6:06 augustl: like (def my-func ([thing] (my-func thing {})) ([thing opts] ... actual impl...))

6:07 Chiron: Hi, I have a seq that contains maps . every map has the key :x . how to find the min :x ?

6:07 augustl: in that case, having an optional "opts" argument

6:07 rcg-work: your method seems to do completely different things though, I personally find that a bit weird

6:07 bah, I need to stop calling functions methods

6:07 _ulises: Chiron: (reduce min (map :x your-seq))

6:07 augustl: good idea ;)

6:08 Chiron: _ulises: wicked :)

6:09 _ulises: ,(reduce min (map :x '({:x 1} {:x 2} {:x -1 :y -10})))

6:09 clojurebot: -1

6:09 _ulises: phew

6:09 it does work :)

6:09 Anderkent: o ye of little faith

6:09 rcg-work: augustl, well, my function creates a function.. that then, depending on how it is called does different things, yes

6:09 Chiron: _ulises: what if i want to the map that holds the min :x ?

6:10 rcg-work: my idea was to encapsulate the executor via a clojure and then access it via the inner fn

6:10 Chiron: _ulises: i mean i want to get the map that holds the min :x

6:10 rcg-work: and dispatch in the inner fb based on number of args and keywords

6:10 *fn

6:10 augustl: rcg-work: you can still encapsulate it with multiple functions :)

6:10 rcg-work: can i?

6:10 foodoo: rcg-work: If you have only one condition, it may make sense to use (when) instead of (if) because the lack of an else-clause is then more obvious

6:11 _ulises: Chiron: what if you have two maps with the same min?

6:12 Chiron: _ulises: then one of them is ok

6:12 rcg-work: i found this http://pastebin.com/dM2pfvH5 by stuart halloway

6:12 _ulises: Chiron: if you don't care, you can reduce with your own fn along the lines of (fn [m1 m2] (if (< (m1 :x) (m2 :x)) m1 m2))

6:12 rcg-work: there he uses a map to select the appropriate function

6:12 would this be more idiomtic

6:12 ?

6:13 _ulises: Chiron: keep in mind that that fn assumes :x is in the map, so you probably need to actually (get m1 :x Integer.MAX_VALUE) but that assumes you're dealing with integers, etc.

6:13 Chiron: but you see where I'm coming from

6:13 rcg-work: foodoo, i just used a cond with a single statement there in case i want to extend it later

6:13 augustl: rcg-work: http://pastebin.com/xmZtu0jr and so on

6:14 it does the same thing (except I changed the stop methods to take an executor), but it does it with multiple functions instead of manual dispatch based on arguments

6:14 rcg-work: augustl, but this way i expose the object to my user

6:14 augustl: rcg-work: your original function probably doesn't do what you think it does, then ;)

6:14 rcg-work: aint that considered bad? as now the user can do arbitrary, possibly dangerous things, with the object?

6:14 augustl: it will create a new executor object every time you call it

6:14 Chiron: _ulises: will try, thanks

6:14 _ulises: ,(reduce (fn [m1 m2] (if (< (m1 :x) (m2 :x)) m1 m2)) '({:x 1} {:x 2} {:x -1 :y -10}))

6:14 clojurebot: {:x -1, :y -10}

6:15 _ulises: Chiron: ^^^

6:15 Anderkent: Chiron: alternatively, (first (sort-by :x [{:x 1} {:x 13} {:x -1}]))

6:15 rcg-work: augustl, only when i call (scheduler) this gives me function which i would use then

6:15 _ulises: ,(reduce (fn [m1 m2] (if (< (m1 :x) (m2 :x)) m1 m2)) '({:x 1} {:x 2} {:x -1 :y -10} {:y 5}))

6:15 clojurebot: #<NullPointerException java.lang.NullPointerException>

6:15 _ulises: Chiron: ^^^^

6:15 augustl: rcg-work: doh I misread it

6:15 Anderkent: ,(first (sort-by :x [{:x 1} {:x 13} {:x -1}]))

6:15 clojurebot: {:x -1}

6:15 augustl: rcg-work: nvm :)

6:15 _ulises: Anderkent: thanks :)

6:15 rcg-work: sorry bbl

6:15 * _ulises knew there would be a less-homegrown way

6:16 Anderkent: it's a little less efficient so if your map array is huge you might want the reduce approach

6:16 Chiron: cool ! thanks fellas

6:18 augustl: rcg-work: interesting problem, my clojure-fu is low but I'm trying to think of something

6:24 rcg-work: the only alternatives i can find return a map that contains the functions you can call, so it becomes ((:stop-all my-executor))

6:25 rcg-work: in general I wouldn't have worried that much about encapsulation. For portability and future proof-ness you could always make your own defrecord that you put the executor object in. It'll be accessible, but it allows you to change what it is composed of without affecting the users of your API

6:26 rcg-work: also, from http://clojure.org/datatypes, "Encapsulation of information is folly" ;)

7:08 tgoossens: Did factorial on 4clojure. how can i usefully compare the quality of both snippets? http://pastebin.com/vQZ3ZfBP

7:12 rcg-work: augustl, right, i see.. thanks

7:13 augustl: rcg-work: keep in mind that I'm no expert though ;)

7:13 Anderkent: tgoossens: what do you want to compare? First one's obviously better just because it uses the proper recursion constructs

7:14 tgoossens: i was mindblown about the result that someone else produced. That i asked myself the question: "has this other more difficult code an advantage over my solution?"

7:14 Anderkent: No, they just didn't know about recur I asume

7:15 they're doing recursion themselves if I'm reading it correctly

7:16 Raynes: tgoossens: The first one is better simply because it isn't completely hideous like the second one.

7:16 ludston: Anyone in this room do Clojurescript?

7:17 thorwil: does it matter if functions of 1 argument are wrapped in () or not, inside a (->) form? so far i thought i t doesn't, but wonder about examples i see

7:17 ludston: (#clojurescript is a bit ghetto)

7:17 Anderkent: thorwil: no, -> makes its args a list if they're not

7:17 ,(source ->)

7:17 clojurebot: Source not found

7:17 Anderkent: ,(doc ->)

7:17 clojurebot: "([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."

7:20 thorwil: ty

7:22 hyPiRion: You can check it out by using macroexpand-1

7:23 ,(macroexpand-1 '(-> foo (bar baz) bbq))

7:23 clojurebot: (clojure.core/-> (clojure.core/-> foo (bar baz)) bbq)

7:24 alexnixon: tgoossens: looks like the second one is using the y combinator, so not very readable but cool from a first-principles point of view

7:25 tgoossens: what do you mean "first-principles " ?

7:25 Anderkent: tgoossens: lambda calculus

7:25 thorwil: kinda using lego blocks, not lego assemblies

7:26 Anderkent: more like making the lego blocks yourself instead of buying them

7:27 tgoossens: ok

7:27 Anderkent: Honestly it looks like they just took the lisp example from http://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combinator

7:28 and changed define->def lambda -> fn and some brackets ;P

7:28 (i ment scheme not lisp actually)

7:29 tgoossens: do you believe it necessary to study lambda calculus in order to really understand functional programming

7:29 ?

7:30 Anderkent: not at all, but it's pretty interesting how much you can do with such a limited syntax

8:02 ivenkys: Any suggestions on documentation to _really_ understand HOF in Clojure ?

8:04 stevenfx: ivenkys: http://goo.gl/YXsgO

8:04 I have not read it tough

8:05 just searching about...

8:05 babilen: ivenkys: I like the way in which they are introduced in Clojure Programming (http://www.clojurebook.com/) -- In particular the logging example is wonderful (as is the rest though)

8:06 ivenkys: stevenfx: i saw that one - i "sort of" understand HOF's but when it comes to actual development i tend to not use them even when they finally turn out to be the best way - i guess i want to try and understand them in a bit more depth

8:07 babilen: heard good things about that book - its time to order it i guess

8:07 Anderkent: ivenkys: sounds more like pattern matching issue than understanding - there's not that much to understand in HOF, but you need to match your problem to a suitable HOF

8:07 ivenkys: babilen: stevenfx : thanks gents

8:08 Anderkent: i.e. you need to know and easily recall the functions available in clojure, which I guess mostly comes from practice

8:08 babilen: ivenkys: I like it a lot. It certainly is my favourite together with Joy of Clojure among the current lot .. (well have read the old "Programming Clojure" and "Clojure in Action" as well, so can't really compare it to many)

8:09 ivenkys: I am also looking forward to https://leanpub.com/fp-oo

8:10 stevenfx: babilen: That looks interesting

8:14 ivenkys: ~ping

8:14 clojurebot: PONG!

8:15 * ivenkys (= "unstable" "tor+freenode")

8:15 ivenkys: babilen: that book looks interesting - thanks

8:16 stevenfx: Has anyone here read the book?

8:16 maleghast: stevenfx: Which book?

8:16 stevenfx: https://leanpub.com/fp-oo

8:19 maleghast: stevenfx: Thanks - looks interesting, I may well pick it up - I loved his book about everyday scripting with Ruby

8:19 stevenfx: maleghast: babilen suggested it

8:20 maleghast: Yeah I am also looking into maby getting it

8:20 Mr_Bond: stevenfx: awesome!

8:20 maleghast: Thanks babilen

8:20 babilen: maleghast: No problem -- I am currently debating if I want to buy it right now ....

8:52 thorwil: how's (defn logout [r] /friend/logout (ring.util.response/redirect "/") wrong

8:52 that it triggers cemerick.friend$logout$fn__1347 cannot be cast to clojure.lang.IPersistentMap ?

8:52 ToBeReplaced: it returns the function, wrap another set of parens

8:52 clgv: thorwil: that's no valid clojure: /friend/logout you probably forgot ""

8:53 Anderkent: thorwil: you're also missing a closing paren

8:53 thorwil: (defn logout [r] (friend/logout (ring.util.response/redirect "/"))

8:53 so much for retyping it to not paste linebreaks :)

8:54 clgv: ;)

8:54 seems there is some anonymous function created in logout that accidently is casted to IPersistentMap

8:55 so probably some wrong parameter type.

8:55 Anderkent: it should be

8:55 (-> r

8:55 oh nvm

8:56 thorwil: my first thought was that i should def logout, relying on friend/logout delivering a handler. but with that, i get a 404

8:56 Anderkent: friend/logout takes a handler and gives you back a handler, you need to apply the result to the request

8:57 i.e. (defn logout [r] ((friend/logout (ring.util.response/redirect "/")) r)), i think.

9:00 thorwil: Anderkent: that's 404

9:00 Anderkent: are your routes defined correctly?

9:01 (is it 404 on trying to logout or on the redirect/)

9:01 thorwil: it's 404 still on /logout

9:02 Anderkent: and what's your route definition for /logout?

9:03 thorwil: Anderkent: https://www.refheap.com/paste/6620

9:04 as if i just say '["logout"] h/logout' that is rather lacking in context

9:06 Anderkent: right, I don't know moustache at all, so can't help you there, sorry.

9:06 thorwil: thanks for looking! :)

9:11 cgrand: thorwil: need help w/ moustache?

9:13 thorwil: cgrand: well, the intersection of moustache and friend, i guess

9:14 cgrand: without friend, your routing works?

9:14 thorwil: cgrand: that h/login called in https://www.refheap.com/paste/6620

9:15 the handlers https://www.refheap.com/paste/6621

9:15 cgrand: yes, everything prior to introducing friend was a non-issue

9:16 now logout fails with cemerick.friend$logout$fn__1347 cannot be cast to clojure.lang.IPersistentMap

9:17 Anderkent: that's because you're returning a handler as if it was a response

9:18 cgrand: what is v/login?

9:19 thorwil: cgrand: delivers a hiccup generated login form. that part works

9:20 cgrand: v/login is a response map or a function returning a response map?

9:21 thorwil: cgrand: function returning a response map

9:21 Anderkent: https://github.com/cemerick/friend/blob/master/src/cemerick/friend.clj#L81 as you can see friend/logout wants you to give it a handler, it then returns a function that you call with the request

9:22 try something like

9:22 (defn- logout- [r] (redirect "/"))

9:22 (defn logout [r] ((friend/logout logout-) r))

9:22 cgrand: throwil: so some parenthesis are missing around v/login: you are returning the function

9:26 thorwil: cgrand: my answer was not appropriate then. view.clj: https://www.refheap.com/paste/6622

9:26 cgrand: ok

9:29 thorwil: cgrand, Anderkent: thank you, Anderkent's 2 definitions do the trick

9:30 * thorwil wonders if he will ever gain a firm understanding of nesting and code equivalence

9:33 cgrand: thorwil: or (def logout (app friend/logout (fn [r] (redirect "/"))))… or bubble the friend/logout application up to the routes def

9:33 thorwil: logout handling seems cleaner in https://github.com/marianoguerra/immutant-recipes/blob/master/friend-acl/immutant.clj

9:34 Anderkent: thorwil: yeah, that's what cgrand suggested. You can have logout just call (redirect "/"), and then do the (friend/logout h/logout) in your routes

9:34 I would have suggested that but was too lazy to modify both files ;P

9:35 cgrand: https://gist.github.com/4066032

9:35 Anderkent: (is that really [friend/logout logout] instead of (friend/logout logout)? Bizzare.)

9:36 cgrand: it is, but it's a moustache trick

9:36 thorwil: Anderkent: moustache's app macro is ... wicked :)

9:36 cgrand: à la -> but in reverse: you can apply several middle wares that way [mw1 (mw2 arg1 arg2) … handler]

9:37 Anderkent: makes sense

9:37 cgrand: and in lieu of handler you can also have a route or method dispatch

9:38 thorwil: i hope i can put all friend stuff in routing, then. so far my plan had been to have it solely in handlers

9:39 Anderkent: you should be able to, it's middleware

9:59 ro_st: anyone done remember-me for a ring web app yet?

10:04 Raynes: any idea how to get noir to write Secure cookies?

10:07 i want to set both of these for my ring-session cookies: http://en.wikipedia.org/wiki/HTTP_cookie#Secure_and_HttpOnly. how?

10:10 Anderkent: call put! with a map that has :secure and/or :http-only set

10:11 ro_st: thanks. where did you see that?

10:11 Anderkent: doc for put! says 'to set custom attributes provide a map', doc for ring.middleware.cookies says which attributes are accepted

10:11 (noir.cookies just wraps ring.middleware.cookies)

10:12 ro_st: ahh, the middleware

10:12 thank you -bow-

10:13 ok,so, i don't write the session cookie, ring or noir does

10:13 ok i see ring's wrap-session has :cookie-attrs

10:15 ah of course. noir's server start has a key for it

10:47 gauravag: what are the built in macros in clojure?

10:49 vijaykiran: gauravag: http://clojure.org/macros

10:51 algernon: git grep defmacro in clojure/src is also a reasonable estimate

10:53 gauravag: algernon: thanks

11:07 S11001001: ,(-> #'defn meta :macro)

11:07 clojurebot: true

11:07 S11001001: gauravag: loop over ns-publics of clojure.core accordingly :)

11:08 gauravag: ,(-> #'defn meta :macro)

11:08 clojurebot: true

11:21 gauravag: (println "is anyone able to see the fun in this?")

11:29 clgv: &(println ",(println \"I do see the fun in this!\")")

11:29 lazybot: ⇒ ,(println "I do see the fun in this!") nil

11:29 clgv: ,(println "&(println \"I do see the fun in this!\")")

11:30 clojurebot: &(println "I do see the fun in this!")

11:30 lazybot: ⇒ I do see the fun in this! nil

11:30 tgoossens: lol

11:30 this is funny :p

11:30 wingy: lol

11:31 clgv: ,(println "lazybot, do you like that???")

11:31 clojurebot: lazybot, do you like that???

11:31 lazybot: clojurebot: Yes, 100% for sure.

11:31 tgoossens: wtf

11:32 clojurebot: What is seq

11:32 tgoossens: wtf did just happen :p

11:33 sw1nn: hi, any emacs+clojure-mode+auto-complete experts around?

11:33 I have autocomplete working in emacs+clojure-mode. but the documentation popup isn't working

11:33 in elisp mode it does work. any idea what the key setting is?

11:37 i'm using nrepl if that makes a difference

11:46 mudge: I need to replace a java switch statement with something in clojure, what in clojure should I use in place of a java swtich statement? a conp?

11:46 condp?

11:46 technomancy: pattern matching

11:47 mudge: technomancy: I should use pattern matching?

11:47 technomancy: maybe

11:47 pjstadig: case

11:47 mudge: technomancy: like write a function that uses destructuring?

11:47 pjstadig: mudge: an example might help

11:47 clgv: mudge: probably `case`

11:49 mudge: pjstadig, clgv, technomancy: here's the java code I'm replacing with clojure: https://gist.github.com/b5a54b7ea9e14edba5fa

11:49 clgv: mudge: you want `case` then

11:50 * algernon would do a multimethod, but perhaps that's an overkill

11:50 technomancy: whatever you do, follow your heart

11:50 mudge: the problem with case and condp is that they work on the first matching thing --- well I have two possible things that could match and I want the same result

11:50 clgv: technomancy: feeling romantic today? ;)

11:51 mudge: two cases expressions -> runs one result

11:51 technomancy: clgv: no just smart-alecky

11:51 clgv: mudge: case can have more than one value: (case x (2 4) :this 4 :that :default)

11:51 mudge: don't know how to do that using clojure case or condp

11:51 clgv: ,(case 4 (2 4) :this 5 :that :default)

11:51 clojurebot: :this

11:52 clgv: ,(case 2 (2 4) :this 5 :that :default)

11:52 clojurebot: :this

11:53 mudge: clgv: interesting, I see

11:53 clgv: I thought everything within parentheses would cause a function call unless preceded by '

11:54 unless a macro was used

11:54 raek: mudge: that's almost always the case

11:54 by convention

11:54 but there are exceptions

11:54 clgv: mudge: no, `case` is a macro which handles lists as more than one value

11:54 mudge: clgv: gotcha, thanks!

11:54 raek: thanks

11:55 clgv: mudge: in case you ever want to match something sequential, you can use a vector in case.

11:55 raek: ah, well macros and special forms are where those exceptions happen, so you seem to understand this already

11:55 mudge: raek: is it the case that anything in parentheses is a function call unless it is a macro?

11:56 raek: oh i see, yes in special forms too

11:56 raek: so in macros and special forms then

11:56 raek: yeaj

11:56 *yeah

11:57 mudge: raek: I guess that's one way to immediately tell if you are working with a macro and not a function

11:57 raek: and everything inside a macro or a special form can potentially behave specially

11:57 mudge: raek: yes, I wonder how much clojure programmers write their own macros for things

11:57 raek: well, it can be hard to tell.

11:58 generally you avoid macros if you can express the same thing with "the usual" syntax

11:59 mudge: reak: what if you can express the same thing with "the usual" syntax, but it is just shorter and nicer to use a macro?

11:59 babilen: that is: use a function if possible

12:00 raek: mudge: then write a function as a base, and then provide the macro as well

12:00 so that if you need the "underlying" function, you can use it

12:00 mudge: raek: okay, cool

12:00 raek: one example is bound-fn and bound-fn* in clojure.core

12:01 the one with the asterisk is the function variant

12:01 (bound-fn [x] some-expression) is equivalent to (bound-fn* (fn [x] some-expression))

12:02 in the latter you can provide the function dynamically at runtime, but in the first you are restricted to a "literal"

12:03 mudge: raek: cool

12:31 devn: ,(:macro (meta #'defn))

12:31 clojurebot: true

12:55 actsasgeek: For some reason, lein cljsbuild auto started crashing with a "Too many arguments to def (core.clj:46)" exception. Has anyone seen this behavior before? It's not "inside" cljsbuild (it's not the colored stack trace). It was working just fine until I accidentally killed the JVM. http://pastebin.com/KvY0up7J

13:12 dnolen: acagle: did you try a lein cljsbuild clean?

13:12 oops

13:12 actsasgeek: ^

13:15 Licenser: hmm can anyone give me a hint what 'Exception in thread "main" java.lang.NullPointerException, compiling:(login.clj:1)' means?

13:15 something is ugly in login.clj but nullpoointer exception isn't really helping much :(

13:15 actsasgeek: dnolen: yes.

13:15 Anderkent: Licenser: can you post your login.clj somewhere?

13:16 dnolen: actsasgeek: and you're sure it's not some code change in your own code?

13:16 actsasgeek: like a macro file?

13:17 Licenser: Anderkent https://gist.github.com/4067414 :) thanks

13:18 actsasgeek: dnolen: I have just one simple main.cljs file that I've been compiling…I tried emptying it of everything except the namespace and leon cljsbuild still crashes.

13:18 (spell checker is determined that lein is leon)

13:19 dnolen: actsasgeek: did you try starting a new project to see if the issue is actually local to that project?

13:19 actsasgeek: dnolen: yeah, that's my next test. I went into a different project with clojurescript and lein cljsbuild works there.

13:21 Anderkent: Licenser: sorry, no clue :P

13:21 Licenser: Anderkent that was my reaction too ^^

13:21 Anderkent: are you using lein?

13:21 or mvn/

13:21 Licenser: lein of cause :)

13:22 Anderkent: you can run DEBUG= lein compile i think

13:22 for the full stack trace

13:23 Licenser: https://gist.github.com/4067453 is the stack

13:23 Anderkent: AFAIK null pointer exceptions in compiling happen when a namespace you import shadows some core functions and gen-class gets confused

13:23 Licenser: I don't really get smart form it so

13:23 Anderkent: yeah

13:23 that list shadowing

13:23 Licenser: ohhhhh

13:23 Anderkent: in .user

13:23 do :refer-clojure :except list

13:23 Licenser: but it's a waring not a i go and die a horrible unintelligable death

13:23 Anderkent: (dont remember the syntax but that will fix it)

13:24 it's a warning unless you're compiling and gen-class uses it

13:24 Licenser: Anderkent it's not clojurescript

13:24 Anderkent: probably a bug

13:24 yes, and?

13:24 refer-clojure is not clojure script either :)

13:24 Licenser: okay because you said refer-clojure thought that's for scriptish stuff

13:24 Anderkent: ,(doc refer-clojure)

13:24 clojurebot: "([& filters]); Same as (refer 'clojure.core <filters>)"

13:25 Anderkent: what you want is (ns <w/e> (:refer-clojure :exclude [list]))

13:25 in your .user ns

13:25 Licenser: I just renamed list into list-users ;)

13:26 sneakyer solution

13:26 what confuses the hell out of me is that the same thing was working yesterday, perhaps the null pointer exception was still to groggy from the weekend to show up for work

13:28 Anderkent thanks mate that did the trick :) all the sadowy functions killed

13:53 aaelony: tinkering with clj-ssh.ssh and clj-ssh.cli attempting to tunnel to a server that has a mysql database I'd like to query via clojure.java.jdbc.

13:53 Does anyone have an example from clojure that can set up the tunnel then issue one or more queries ?

13:55 solussd: is there a predicate that tests if something is a map entry?

13:56 znDuff: solussd: whether the map has something as a key, you mean?

13:56 solussd: I'm walking a map of maps and need to know if the current form is a map entry

13:56 actually, nevermind, I might as well do this at the map level. ;)

13:56 thanks

13:57 actsasgeek: dnolen: it would seem that I somehow managed to get a configuration of clojure, jayq, crate, fetch, noir and cljsbuild all working and lost it. If I use cljsbuild 0.2.1 it was working but now I get that weird error. If I use cljsbuild 0.2.9, I get an error that it can't find macros for crate on the classpath.

13:57 gfredericks: ,(ancestors (first {3 4}))

13:57 clojurebot: nil

13:57 gfredericks: ,(ancestors (class (first {3 4})))

13:57 clojurebot: #{clojure.lang.IMapEntry java.lang.Runnable clojure.lang.Counted java.lang.Iterable clojure.lang.AFn ...}

13:58 gfredericks: map entries are runnable?

13:58 dnolen: actsasgeek: yes my other suspicion was that you have some kind of problem in your dependencies.

13:58 gfredericks: ,(filter #(re-find #"java" (str %)) (ancestors (class (first {3 4}))))

13:58 clojurebot: (java.lang.Runnable java.lang.Iterable java.util.List java.util.Map$Entry java.util.Collection ...)

13:59 gfredericks: solussd: for your no-longer-a-problem, java.util.Map$Entry might be an answer

13:59 solussd: gfredericks: yeah, there's also clojure.lang.MapEntry, but I wanted something implementation agnostic

14:05 andrewmcveigh: anyone know where cljs' "satisfies?" is declared?

14:07 nevermind, found it.

14:26 robinkraft: Hey all, I'm looking for a way to string format a double to have a max of 7 decimal places, but without adding padding if it's actually shorter. So 3.4 -> 3.4, but 3.44444444444444 -> 3.4444444. Any suggestions?

14:27 Or rather, 3.4 -> "3.4", and 3.4444444444444 -> "3.4444444"

14:28 gfredericks: ,(format "%.7f" 3.4)

14:28 clojurebot: "3.4000000"

14:28 gfredericks: ,(->> (format "%.7f" 3.4) reverse (drop-while #{\0}) reverse (apply str))

14:28 clojurebot: "3.4"

14:29 gfredericks: robinkraft: ^ that at worst :)

14:29 robinkraft: haha nice!

14:32 is there a round function I'm not aware of that handles rounding to a specific number of digits? round in numeric-tower only rounds to nearest integer

14:33 amalloy: $javadoc Math

14:33 lazybot: http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html

14:35 metellus: I'm surprised there isn't a format string that can do what robinkraft wanted

14:35 gfredericks: ,(Math/nextUp 3.4)

14:35 clojurebot: 3.4000000000000004

14:35 aaelony: is this still valid? http://stackoverflow.com/questions/10751638/clojure-rounding-to-decimal-places

14:35 gfredericks: there's some weird stuff there

14:36 metellus: robinkraft: I don't know that there isn't. Wouldn't surprise me.

14:36 metellus: I've been looking at the Java Formatter docs and I can't find one

14:37 amalloy: i don't think there is, in java or c

14:38 gfredericks: oh crap mine borks on integers

14:38 robinkraft: what should it do when given "3.00000"?

14:38 robinkraft: python has a handy 'round' function: http://stackoverflow.com/a/10505705/699026

14:39 I care most about not adding digits where there weren't any before, and truncating anything after 7 digits

14:39 so 3.000000 could stay as it is

14:39 but in an ideal world it'd go to 3.0 :)

14:41 amalloy: "not adding digits where there weren't any before"?

14:41 robinkraft: i.e. 3.4 -> "3.4" rather than "3.4000000"

14:43 amalloy: floating point numbers (indeed, any numbers inside a computer) don't have [decimal] digits in any meaningful sense. 3.0 is the same as 3.000000, so if you're happy with the latter staying as is, it doesn't make sense to require that 3.400000 print as 3.4

14:43 AKFLOW: hey

14:44 need some advice

14:44 new to the clojure thing

14:44 robinkraft: fair enough … hmmm, well the 3.4 case is the driving force here, so then I guess it's not ok for 3.000000 to stay as is either

14:44 AKFLOW: is their like a noob section

14:45 or this is it???

14:45 lazybot: AKFLOW: How could that be wrong?

14:45 amalloy: (inc lazybot)

14:45 lazybot: ⇒ 8

14:45 znDuff: AKFLOW: We don't bite. :)

14:45 AKFLOW: ...well, not in #clojure. Over in, say, #bash, the rule is tough love... but this isn't there. :)

14:46 AKFLOW: I am tryng to convert matlab files to clojure files

14:48 is there a way you could do it with a script

14:48 technomancy: no

14:48 AKFLOW: or are there any good pharsing example out there using clojure???

14:48 lazybot: AKFLOW: Oh, absolutely.

14:50 znDuff: AKFLOW: Lots of tools and frameworks for parsing, yes.

14:50 AKFLOW: sweet

14:50 technomancy: though... maintained parsers, not so much

14:50 AKFLOW: ok

14:50 znDuff: Hmm. Indeed, http://www.clojuresphere.com/?query=parser has lots of things which haven't been updated in a while.

14:51 AKFLOW: SWEET !!!! let me go there and be right back thank you znDuff

14:51 amalloy: yeah, i was thinking that the other day, technomancy. someone has actually quietly updated fnparse for 1.4

14:52 oh hey, and he works at factual? sweet, maybe i can actually go bop him on the head if there's something i want from fnparse

14:52 technomancy: amalloy: huh; unofficial fork?

14:52 amalloy: yeah. https://github.com/joshua-choi/fnparse/network

14:52 technomancy: that's cool

14:52 is fnparse based on parser combinators too?

14:53 amalloy: "too"? from a brief read of parsley's docs, i'd say fnparse is the only one that is

14:53 technomancy: parsatron is

14:53 amalloy: $google clojure parsatron

14:53 lazybot: [youngnh/parsatron · GitHub] https://github.com/youngnh/parsatron

14:54 technomancy: he gave a great talk at strangeloop last year

15:00 mudge: why doesn't this work: (condp some #(= kind %)

15:01 getting this error: Exception in thread "main" java.lang.IllegalArgumentException: Don't know how to create ISeq

15:04 gfredericks: mudge: the form you pasted is incomplete

15:06 mudge: gfredericks: the full code snippet is here: https://gist.github.com/4068032

15:06 amalloy: so's the stacktrace :P

15:07 not that this stacktrace is terribly important. the args to condp just don't make any sense here

15:07 mudge: amalloy: the stacktraces in clojure/leiningen/nrepl are not very good, is there a way to get better stacktraces in clojure?

15:08 amalloy: i think you are right

15:08 amalloy: mudge: the stacktraces are imposing if you're not used to them, but they provide a wealth of important information. one would have to be very, very careful (ie, more careful than clj-stacktrace is) to change them for the better rather than the worse

15:09 mudge: amalloy: makes sense, thanks

15:35 ls

15:35 lazybot: etc home lib lost+found mnt root selinux srv swap sys tmp var

15:48 brehaut: oh look at that, its #clojure tumbleweed season again

15:48 danlarkin: brehaut: are you coming this time?

15:49 brehaut: danlarkin: sadly the combination of international travel and buying a house prevent it

15:49 danlarkin: :/

15:49 bummer

15:49 brehaut: indeed

15:50 hopefully i'll finagle some clojure work in the next year and be able to justify it as a business expense

15:50 Clemens: help

15:50 brehaut: you'll need to be more specific

15:51 danlarkin: where do you live?

15:51 Clemens: yeah, i meant /help...

15:51 brehaut: New Zealand

15:55 danlarkin: so far!

15:56 AKFLOW: znDuff hey

15:57 brehaut: danlarkin: yup, probably not too many places that are farther

16:01 AKFLOW: are there any ruby2clj parsers???

16:01 lazybot: AKFLOW: Yes, 100% for sure.

16:02 AKFLOW: la

16:02 brehaut: AKFLOW: what do you mean by that?

16:02 (though the answer is probably no in anycase)

16:11 boodle: I'm having a chicken/egg problem on returning a Java.io.File as a value (works great) but also want to delete the file inside the calling function. Any way I can get a final call after a return value?

16:11 technomancy: boodle: doto

16:12 boodle: technomancy: tyvm!

16:12 technomancy: no problem

16:13 znDuff: AKFLOW: if by "parser" you mean "converter"... well, you're not going to find many straight-across code translators for _any_ nontrivial language.

16:13 callen: boodle: generally speaking anytime you need to do a bunch of things to an object in sequence, especially when interfacing with Java, doto is what I see people doing

16:13 znDuff: that's not true...unless by straight-across you mean, "looks like a human wrote it"

16:14 technomancy: with a little imagination you could consider mirahc's java output human-written

16:14 also depending on your opinion of the human race

16:15 znDuff: callen: I did say "many", as opposed to "any".

16:15 technomancy: coffeescript, stalin, parenscript

16:15 callen: coffeescript's javascript output makes sense once you understand the scope-magic they're doing.

16:15 znDuff: Notably, all of those have a built-to-purpose source language

16:15 technomancy: sorry, chicken

16:16 znDuff: ...which makes a particularly big difference when translating between the different available library sets is part of the work.

16:16 technomancy: oh, chicken and stalin

16:16 znDuff: (which is certainly the case from Ruby to Java)

16:16 callen: chicken does a damn decent job too.

16:17 mudge: what's the best way to find out of a vector contains a certain value?

16:18 Raynes: &(some #{1} [2 3 4 1 4 5])

16:18 lazybot: ⇒ 1

16:18 Raynes: (first (filter ..)) also works.

16:21 mudge: Raynes: looks good, thanks

16:21 callen: I usually just use first filter because that's what I do in Python anyway.

16:22 technomancy: callen: ...?

16:22 that idiom doesn't make sense without laziness

16:23 callen: technomancy: I have a weird assortment of idioms in Python that are vaguely related to things I do in Haskell and Clojure

16:23 technomancy: it's best not to take the semantics literally.

16:23 brehaut: technomancy: generaetors in python are lazy

16:23 callen: and yes, yield/generators are always there.

16:24 but more realistically it has a lot more to do with my extensive abuse of maybe monads.

16:24 technomancy: oh, gotcha

16:24 callen: technomancy: the laziness isn't really key here, IMo.

16:24 is there some element of the idiom I'm not understanding? I don't doubt that that could be the case.

16:26 technomancy: callen: it's just wasteful

16:27 mattmoss: technomancy: Leiningen is your baby, yes? If so, does :scope "test" on a dependency do what it sounds like -- limit that dependency to "lein test"? Or do I need to not limit the scope like that if I (run-tests) from the repl?

16:27 brehaut: technomancy: hows that different from any other python code ;)

16:27 callen: technomancy: non-set composite type presence tests in Python usually are.

16:28 amalloy: hah. fine criticism, from a user of the language that generates piles and piles of garbage instead of just modifying stuff in place, brehaut

16:28 mattmoss: ...if I *also* (run-tests) from the repl...

16:28 technomancy: mattmoss: you probably want profiles

16:28 I have no idea why Leiningen supports :scope TBH

16:28 mattmoss: heh, ok

16:28 technomancy: someone probably talked me into it, but I forget the motivation. it's only used in pom output

16:29 mattmoss: ok, gotcha

16:29 thanks

16:29 technomancy: sure

16:29 brehaut: amalloy: lol. i also use python too. its not fast

16:31 kilon: unless you cheat with cython

16:33 rcg: anyone here who can help with clojars.org?

16:33 i accidentally uploaded something under a wrong name

16:34 brehaut: kilon: or my preference: F# ;)

16:34 kilon: damn lucky man, you have a preference, i still have not make up my mind :D

16:35 i think i need to frankestein some languages together

16:35 brehaut: kilon: i still write python for my day job, but i prefer other languages

16:36 kilon: nothing wrong with that, i love lisp , smalltalk and clojure

16:36 most of my coding is in python

16:37 brehaut: ive been quite excited about F#3 and fsharp.org moving toward making F# more independant of MS

16:38 kilon: haskell look scary but fun too

16:38 mattmoss: I dare you to write a web service in befunge.

16:38 brehaut: ahaha

16:41 kilon: currently trying to learn the abomination of the lisp world, elisp

16:42 brehaut: brave

16:42 kilon: and expand emacs to make it a bit more better python ide

16:43 clojure could help there too, to leverage some java libraries

16:43 since it has good emacs integration

16:44 man so many choices

16:44 i will probably end up doing nothing as always :D

16:44 brehaut: nothing is better than implementing a metaweblog backend :P

16:45 kilon: "meta" i hate that world, its always covered in mystery

16:45 *word

16:45 brehaut: this mystery is doubled by the amount of link rot involved

16:45 its always a bad sign when wordpress is an authoritative source

16:46 * kilon pretend he understand by nodding his head

16:47 brehaut: ha

16:50 kilon: short version: implementing nothing is better than implementing a stupid thing

16:51 callen: When creating the context for various its of data in stencil templates, I find myself repeating a lot of redundant bits for the sake of kicking data backwards either to a direct template renderer or to a partial.

16:51 how do I keep from having to repeatedly kick back chunks of the request context to stencil templates in a ring web app?

16:59 amalloy: hate to be 'that guy', but why not Kyoto Cabinet for jiraph?

17:00 amalloy: as opposed to tokyo cabinet? i dunno, decision made long before i arrived

17:00 callen: amalloy: kyoto is generally what most people were supposed to migrate to. I don't know how compatible the APIs are.

17:03 AKFLOW: sorry ppl, I am trying to convert ruby code to clojure code, are there any scripts available ???

17:03 lazybot: AKFLOW: How could that be wrong?

17:05 ohpauleez: AKFLOW: There are no automated scripts to convert ruby code to Clojure code that I'm aware of. The paradigms differ between Ruby and Clojure, so you're going to have to do a mental port as well more than likely

17:05 technomancy: AKFLOW: you have to use your little grey cells

17:06 AdmiralBumbleBee: if there was a script to do that, then there'd be no reason to do that

17:06 danlarkin: technomancy: +1

17:07 AKFLOW: ok

17:07 pjstadig: i have a script

17:07 AKFLOW: ok

17:07 can I get a link ????

17:07 pjstadig: it's written in haskell though

17:07 danlarkin: yeah paul

17:07 share your script

17:08 technomancy: 1. find a programmer that knows Ruby and Clojure. 2. Give him the code. 3. Pay him.

17:08 4. Profit?

17:08 danlarkin: you forgot ????

17:08 technomancy: danlarkin: yeah I'm not good at memes sorry

17:08 AdmiralBumbleBee: the pay him must've been the ????

17:08 scriptor: try this script, AKFLOW, https://github.com/richhickey

17:08 AKFLOW: shure

17:08 let me give it a try

17:09 callen: technomancy: there's work to be had where one can get paid to replace filthy Ruby with glorious Clojure? Sign me up.

17:10 AKFLOW: thank you

17:10 really scriptor

17:11 blahhh

17:12 pjstadig: AKFLOW: if a script exists to convert Ruby to Clojure, it probably means that Clojure is so similar to Ruby that it is not worth learning

17:12 use JRuby

17:12 scriptor: AKFLOW: on a serious note, what do you need it for?

17:19 TimMc: My wife is using a script to convert Matlab to R code. :-P

17:19 Well, it mostly works. She has to keep adding regexen.

17:20 sunkencityryleh: ,(doc deftype)

17:20 clojurebot: "([name [& fields] & opts+specs]); Alpha - subject to change (deftype name [fields*] options* specs*) Currently there are no options. Each spec consists of a protocol or interface name followed by zero or more method bodies: protocol-or-interface-or-Object (methodName [args*] body)* Dynamically generates compiled bytecode for class with the given name, in a package with the same name as the curren...

17:22 sunkencityryleh: can I create a subclass of PersistentList in clojure? I'd like to subclass to change some behaviour in a protocol i'm extending for a particular case and then send in the subclass. Would that be a good or bad idea?

17:23 balint: how could I make this work: (get (dorun (for [x (range 7)] x)) 2)

17:24 brehaut: TimMc: mostly works but adding regexp sounds like the worst kind of works to me :S

17:24 balint: how about you describe your problem first?

17:24 gfredericks: brehaut: stand back, I'm going to add some regexp

17:24 balint: it should return 2 since the sequence the for generates gets force-evaulated by dorun I'd think

17:24 brehaut: :)

17:24 TimMc: brehaut: Sometimes that's all you need.

17:25 gfredericks: TimMc: wat??!! but two problems!

17:25 TimMc: inorite

17:25 balint: brehaut: my problem is that a for loop generates a "maze" in a challenge in which I then use 'get-in' to find a certain element

17:25 brehaut: so why do you need to force evaluation?

17:25 balint: the element is there but since the maze is lazily generated the get-in returns nil and my code breaks

17:25 TimMc: balint: get isn't going to work on a seq.

17:26 gfredericks: probably nth instead of get?

17:26 s/instead/nthstead/

17:27 TimMc: &(get (vec (range 10)) 5)

17:27 lazybot: ⇒ 5

17:27 TimMc: &(get (range 10) 5)

17:27 lazybot: ⇒ nil

17:27 balint: TimMc: is this the distinction between seq and coll?

17:28 TimMc: Specifically, get is for sublinear-time lookup, which seqs don't support.

17:28 balint: ah, ok

17:28 dnolen: balint: you probably want to represent the maze w/ a different data structure if you need quick access to elements in the maze.

17:28 TimMc: ~seqs and colls

17:28 clojurebot: seqs and colls is http://www.brainonfire.net/files/seqs-and-colls/main.html

17:29 balint: dnolen: I don't need it to be fast but since originally it's represented as an array of strings, get-in seemed a good choice

17:29 TimMc: get-in is correct, but you need a different data structure for it to work.

17:30 balint: that's the challenge: http://www.4clojure.com/problem/117#prob-title :)

17:30 mycelloandi: ,(doc get)

17:30 clojurebot: "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

17:30 TimMc: I don't know why ##(get (range 5) 2) doesn't throw an exception.

17:30 lazybot: ⇒ nil

17:31 balint: so I should probably convert the original data structure to something more amenable to quick/simple lookups

17:32 gfredericks: &(get "foo" 3)

17:32 lazybot: ⇒ nil

17:32 gfredericks: &(get :WAT 7)

17:32 lazybot: ⇒ nil

17:33 balint: &(get "foo" 2)

17:33 lazybot: ⇒ \o

17:33 gfredericks: &(get (Object.) 42)

17:33 lazybot: ⇒ nil

17:33 gfredericks: &(get (Object.) :akey)

17:33 lazybot: ⇒ nil

17:33 gfredericks: huh;

17:33 balint: gfredericks: it works for strings

17:33 mycelloandi: why does get return nil for that -- wouldn't it be better to throw an exception?

17:33 TimMc: $def get

17:34 gfredericks: maybe clojure only throws type exceptions if there's a specific interface it can require?

17:34 and if it's going to work for strings then that's obviously not the case

17:35 * gfredericks speculates wildly

17:35 TimMc: It *does* have the contract that if the index is out of bounds, nil is returned, but that's still not really an excuse.

17:35 balint: "Returns the value mapped to key, not-found or nil if key not present."

17:35 dnolen: get doesn't ever throw, it just tests a bunch of interfaces - see RT.java

17:36 TimMc: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L634

17:36 I guess that's useful if you don't know if *either* the collection or key is bad.

17:36 gfredericks: (defprotocol IGettable ...)

17:36 amalloy: dnolen! i asked a question about core.match last night, but you were gone: anyone know if there's a good way in core.match to match a seq like "at least three elements, the second of which is :foo"? i've tried ([x :foo y & more] :seq), but as of 0.2.0-alpha10 that matches even with only two elements, binding y to nil and more to ()

17:37 balint: thank you guys, I'll sort this out

17:38 dnolen: amalloy: huh ... yeah just seems like a bug. perhaps I can convince people start helping me out with core.match during the conj :)

17:38 amalloy: that should just work

17:40 amalloy: that said, I'm pretty sure I'm going to retire seq matching

17:45 amalloy: oh no, retire seq matching? it's the only thing i use core.match for! how would i do something like that without seq matching?

17:47 dnolen: amalloy: vector matching would support the very same thing - albeit the algorithm may favor vectors perf wise.

17:47 Clemens: &*ns*

17:47 lazybot: ⇒ #<Namespace sandbox7657>

17:48 amalloy: dnolen: i'd have to do like (match (vec x) ...) rather than (match x), and then vector matching would work? that's fair enough, i suppose

17:48 since i don't have to worry about infinite seqs for the moment

17:50 dnolen: amalloy: no change really, vector matching will probably now match on sequential, so no need to convert your data.

17:50 amalloy: oh good

17:51 dnolen: amalloy: the neat thing about seq matching was it was very optimized for seqs - so that's all that going out the door. getting rid of seq matching will eliminate a lot of surprises. people were running into a lot of weird things if they mixed vector matching /w seq matching because of interface overlap.

17:54 callen: dnolen: it's good that you're willing to remove things that didn't work out.

17:54 dnolen: too many projects let the albatross just hang around their necks instead.

17:54 JamesBorden: good evening

17:54 callen: JamesBorden: good afternoon.

17:55 JamesBorden: I have a question about something I am seeing in ring.middleware.json

17:55 at: https://github.com/ring-clojure/ring-json/blob/master/src/ring/middleware/json.clj

17:55 ynniv: I bet this already exists… I want to apply a series of keywords to a map, like ,(-> { :x { :y { :z 5 } } } :x :y :z) but where :x :y :z are a seq and not forms

17:55 JamesBorden: it is line 17

17:55 ynniv: wow, that looks rather angry in colloquy

17:55 JamesBorden: [handler & [{:keys [keywords?]}]]

17:55 (defn wrap-json-body

17:55 "Middleware that parses the :body of JSON requests into a Clojure data

17:55 structure."

17:55 [handler & [{:keys [keywords?]}]]

17:55 (fn [request]

17:55 what is keywords?

17:55 TimMc: JamesBorden: Please don't paste to the channel -- use a pastebin such as refheap.com or gist.github.com

17:56 JamesBorden: it seems to me like it is a test for a keyname keywords maybe?

17:57 muhoo: ,(doc keyword) ;; JamesBorden

17:57 clojurebot: "([name] [ns name]); Returns a Keyword with the given namespace and name. Do not use : in the keyword strings, it will be added automatically."

17:57 brehaut: JamesBorden: if you click on the line numbers, github will update the #anchor in the url

17:57 eh https://github.com/ring-clojure/ring-json/blob/master/src/ring/middleware/json.clj#L14-21

17:57 JamesBorden: brehaut: thanks

17:57 dnolen: callen: I have no problem getting of stuff that doesn't work :) As usual, I just wish I had seen it earlier.

17:57 ynniv: muhoo: he's asking about a destructuring directive, not a function

17:58 metellus: ynniv: ##(get-in { :x { :y { :z 5 } } } [:x :y :z]) is that what you want?

17:58 lazybot: ⇒ 5

17:58 callen: dnolen: hey, recognition and rectification puts you ahead of 99.9% of the crowd. Never sweat something like that.

17:58 JamesBorden: https://github.com/ring-clojure/ring-json/blob/master/src/ring/middleware/json.clj#L12 has json/parse-string

17:58 ynniv: metellus: that is *exactly* what I want

17:58 JamesBorden: which I would like to give the extra parameter "true"

17:59 metellus: great

17:59 ynniv: (inc metellus)

17:59 lazybot: ⇒ 1

18:00 callen: (inc metellus)

18:00 lazybot: ⇒ 2

18:00 callen: I learned something too.

18:00 ynniv: I'm also going to use :x as an example in colloquy more often

18:41 TylerGillies: whats the best way to auto download java deps in my leiningen project?

18:43 rcg: TylerGillies, are the java deps available via maven?

18:43 TylerGillies: rcg: yes

18:43 rcg: great, then you can simply specify these as dependencies in your project.clj

18:44 this works, essentially, the same way you specify clojure dependencies

18:44 Raynes: Because they're the same thing.

18:45 TylerGillies: rcg: so just [name.space "version"] ?

18:45 rcg: Raynes, ;)

18:45 TylerGillies, yep

18:45 Raynes: No.

18:45 TylerGillies: rcg: brilliant, thanks

18:45 er...

18:45 no?

18:45 clojurebot: no is tufflax: there was a question somewhere in there, the answer

18:45 Raynes: You need the group id and artifact id.

18:45 rcg: Raynes, ?

18:45 Raynes: What are you trying to depend on? Give me an example.

18:45 Just one example will do.

18:46 rcg: [com.espertech/esper "4.6.0"] <- i use this for esper

18:46 TylerGillies: nothing yet, its a theoretical, i was thinking about adding one but wanted to figure out how to do it first

18:46 https://github.com/fusesource/leveldbjni

18:46 this is the one im thinking about

18:46 Raynes: Maven search will tell you what the group id and artifact id are. It might look like what rcg just showed.

18:46 mattmoss: Raynes: BTW, here's the basic code I'm doing with conch. Stripped of all incriminating evidence. ;)

18:47 TylerGillies: so group if the first part and artifact id is the second part?

18:47 Raynes: [org.fuseresource/fuseresource-pom "1.9"]

18:47 Yes.

18:47 TylerGillies: ah

18:47 thats what i meant

18:47 Raynes: Er.

18:47 That's the parent.

18:47 mattmoss: Hmm, url is good too: https://gist.github.com/4068423/

18:47 TylerGillies: i thought that those terms were synonymous

18:47 my bad

18:47 Raynes: [org.fuseresource.leveldbjni/leveldbjni-project "99-master-SNAPSHOT"] for example.

18:48 mattmoss: I refuse to look at gists out of principle. Put it on refheap and we'll talk.

18:48 TylerGillies: Raynes: thanks

18:48 <dogma/>

18:48 heh

18:49 mattmoss: oops, gotta run... back later

18:49 Raynes: I was kidding.

18:49 * Raynes is reading the codeses.

18:49 Raynes: Good stuff.

19:02 TimMc: TylerGillies: Figuring out that namespaces had nothing to do with Maven coordinates was definitely one of confusing points in my early learning of Clojure. (cc: clojure-doc folks)

19:08 TylerGillies: Raynes: [INFO] Unable to find resource 'org.fuseresource.leveldbjni:leveldbjni-project:jar:99-master-SNAPSHOT' in repository clojars (http://clojars.org/repo/)

19:09 looks like its looking in clojars, and then failing

19:10 Apage43: lein is quite noisy, and will report -every place- that it looks even if a later repo succeeds

19:11 TylerGillies: ah

19:11 its still in the process

19:11 i thought it teminated

19:11 prolly still looking

19:11 Apage43: thnx

19:11 Apage43: yeah

19:11 technomancy: Apage43: not on master actually

19:12 Apage43: technomancy: nice. Will make a lot of folks a lot less confused a lot of the time.

19:12 technomancy: yeah, the default you get from aether is rubbish

19:16 TylerGillies: is it normal for lein deps to hang for awhile? i got some exceptions because it couldn't find jar in clojars and then.... just hangs i think it might be working

19:16 * TylerGillies checks system monitor for process activity

19:22 technomancy: TylerGillies: it can happen on unstable connections

19:23 TylerGillies: technomancy: thnx

19:30 brehaut: https://twitter.com/plt_hulk/status/268508480481157120

19:31 TylerGillies: lawl

19:43 mattmoss: Raynes: https://www.refheap.com/paste/6650

19:47 nickik: When I use nRepl in Emacs, how can I use reuse the last expression I evaluated.

19:47 It used to be just hitting enter on the expression (in swank)

19:48 technomancy: nickik: *1 is typically used

19:49 nickik: ok, then I will have to get used to that.

19:53 technomany, ist it often the problem that I have to change some little things and then reevalute things? That I cant handly with *1.

19:53 technomancy: oh, you mean like M-p?

20:02 holo: hi

20:03 i'm having a "Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.string" when i remove an unneeded dependency from the namespace of a script executed with lein exec -p <script>

20:04 i tried lein clean

20:04 technomancy: don't use lein exec

20:05 it only exists because the run task used to be less powerful

20:05 TimMc: gfredericks: Looks like someone was reading the "get" discussion: http://dev.clojure.org/jira/browse/CLJ-1107

20:07 nickik: technomany, thats what I wanted thx.

20:08 holo: technomancy, ok, i'm going to forget this debugging and run it with "run". thanks

20:12 TimMc: &(long \a)

20:12 lazybot: java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number

20:12 TimMc: &(long (int \a))

20:12 lazybot: ⇒ 97

20:12 TimMc: hmmmm

20:33 gfredericks: &(doc int)

20:33 lazybot: ⇒ ------------------------- clojure.core/int ([x]) Coerce to int nil

20:33 gfredericks: &(doc long)

20:33 lazybot: ⇒ ------------------------- clojure.core/long ([x]) Coerce to long nil

20:34 TimMc: Oh, looks like it is fixed in 1.5.0-beta1

20:36 http://dev.clojure.org/jira/browse/CLJ-977

21:19 yedi: has anyone done anything with clojurescript and appjs?

21:28 TimMc: ~anyone

21:28 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

21:28 TimMc: llasram: Currently working on grokking your lein-otf v2 changes.

21:32 yedi: i don't have a question, I was just curious if anyone had

23:39 TylerGillies: how do i add a resource to leiningen project to add jars?

23:39 the repo i want to download from is located at http://repo.fusesource.com/nexus/content/groups/public-snapshots

23:39 can i add a repo manually?

23:40 Sgeo__: You're.... not supposed to, but I think that that's annoying, here's what I did I don't know if lein jar will actually package it properly though

23:40 https://github.com/Sgeo/clj-vp/blob/master/project.clj

23:40 I put it on resource-paths

23:41 TylerGillies: Sgeo__: thanks

23:41 Sgeo__: yw, but... there are probably more elegant ways

23:41 But I have no idea what they are

23:45 technomancy: TylerGillies: you can add it to :repositories in project.clj

23:45 TylerGillies: technomancy: thanks

23:45 i found a link but it was the wrong syntax

23:45 amalloy: huh? adding repos manually is exactly what you're supposed to do

23:46 TylerGillies: https://github.com/technomancy/leiningen/blob/master/sample.project.clj helped

23:46 Sgeo__: I sort of thought TylerGillies was talking about adding a .jar

23:46 TylerGillies: nope

23:47 Sgeo__: Ah, ok

23:47 TylerGillies: i added it, but its not showing when in do lein deps... odd

23:48 ah there it goes n/m

23:55 hrm getting: Could not find artifact org.fuseresource.leveldbjni:leveldbjni-all:jar:99-master-SNAPSHOT in fuse community snapshot (http://repo.fusesource.com/nexus/content/groups/public-snapshots)

23:55 but i see it on http://repo.fusesource.com/nexus/content/groups/public-snapshots/org/fusesource/leveldbjni/leveldbjni-all/99-master-SNAPSHOT/

23:56 Sgeo__: Is there a way to call some arbitrary code when it's time to do dependency resolution?

23:56 Or... otherwise have the code be part of a build process?

23:56 I'm wrapping a C API with the help of JNAerator...

23:57 hiredman: there is no reason to run jnaerator more than once

23:57 Sgeo__: If the C API changes...

23:57 antares_: Sgeo__: using Leiningen hooks

23:57 TylerGillies: must be because of the filenames..

23:57 im assuming its because of the datestamp appended to jar filename?

23:58 Raynes: antares_: I wish you were going to the conj?

23:58 conj.

23:58 Question marks suck.

23:59 I want us to argue about the priorities of the Clojure community in person. Perhaps engage in fisticuffs over a slab of meat or something.

Logging service provided by n01se.net