#clojure log - Mar 08 2014

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

0:07 dsrx: firefaux: "clojure programming" has a great section on their implementation, although I don't think it goes through the source or anything

0:08 hm, but probably not helpful for writing your own

0:29 Klaufir: I see (= (.concat "a" "b") "ab") . Where does the .concat function come from?

0:36 TravisD: Klaufir: It's actually short hand for (. "a" concat "b"), which is the calling the concat method of the java String "a" with argument "b"

0:36 So it's the concat method of java.lang.String

0:36 one extra the in there

0:51 abaranosky: I've got some carmine values in Redis encoded using Snappy. I want to thaw them out at the REPL for debugging purposes but the Clojure reader is barfing on the string printed out in the REids monitoring logs.... any ideas?

0:56 Klaufir: TravisD: thanks

1:59 muhoo: firefaux: there is also a thing, i think, called "clojure atlas" which maps all the interfaces in the datastructures, IIRC

2:03 firefaux: that's interesting, but it's not free

2:03 or at least it says you can try it for free for a little while

2:04 I can figure out what implements what pretty easily, what I want is essentially a javadoc for the datastructures

2:14 alright, I'll figure this stuff out in the morning

2:14 it's late

2:22 MattAbbott: Has anyone here used net.async?

2:22 Frozenlock: Is there a function to pause an atom watch?

2:23 MattAbbott: Not to my knowledge; is there a reason you can't just remove it and add it again later?

2:24 Frozenlock: I don't think it would cause any problem... I was just hoping for an easier approach :p

2:25 MattAbbott: I suppose you could have a boolean that the watch function checks each time it's called, but that doesn't sound any cleaner...

2:26 Frozenlock: You mean with a dynamic binding around it? (binding [*watch-enable* false] (do-some-stuff ...))

2:31 MattAbbott: or (def watch-enabled (atom true)) (add-watch _atom nil (fn [k r o n] (if (deref watch-enabled) (do-some-stuff)))

2:31 just spitballing

2:32 Frozenlock: Is one preferable?

2:38 MattAbbott: I honestly couldn't tell you. I haven't used dynamics enough to know their proper uses

2:50 mr-foobar: is there a way to read edn (with custom tags) in clojurescript ?

2:54 ddellacosta: mr-foobar: cljs.reader does it, not sure about custom tags though

2:55 mr-foobar: ah, should be possible: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/reader.cljs#L575-L580

2:55 mr-foobar: neat, didn't know that was possible until you asked the question actually

2:57 mr-foobar: ddellacosta: alright ! will try it out.

2:57 Frozenlock: Oh that's nice!

2:57 ddellacosta: yeah, cool stuff.

3:00 mr-foobar: ha ha, I think I had an empty untitled.cljs ... and lein cljsbuild auto was throwing a NullPointerException #or-at-least-thats-what-I-think-happened

3:28 SegFaultAX: What have I done? https://gist.github.com/SegFaultAX/9427306

3:28 amalloy: SegFaultAX: reimplemented google guava?

3:28 or one of the other functional-java libraries out there

3:30 SegFaultAX: amalloy: :D

3:30 amalloy: Well it's a fun demonstration anyway.

3:30 amalloy: sure. i did the same thing the first time i wrote java after learning clojure

3:31 SegFaultAX: I haven't really had a need to with Guava being a thing and all. But someone asked me what map, filter, and reduce might look like in Java-land.

3:32 So this is, I think, the minimal implementation.

3:32 chare: ok guys why does clojure not have something that can compete with rails, its really sad that we are still using imperative based languages like ruby and python, why are we not helping clojure win

3:34 SegFaultAX: chare: That's a common question. The usual answer is that the Clojure community tends to prefer small, focused libraries composed together over large monolithic frameworks.

3:36 chare: SegFaultAX: ok so then what are those libraries that you would put together to mimic rails

3:36 SegFaultAX: chare: Have you looked at luminus? It's a good starting point.

3:37 chare: SegFaultAX: no, i only have heard of compojure

3:38 SegFaultAX: chare: Ring and Compojure are at the center of any clojure web app.

3:38 I also really like liberator.

3:42 bob2: I'm getting less convinced by it - all the hooks aside from the last (ie post! etc) are racey

3:57 SegFaultAX: amalloy: Had to do it: https://gist.github.com/SegFaultAX/9427306#file-main-java-L49

3:58 amalloy: SegFaultAX: incidentally, your generic types aren't as broad as they could be

3:59 SegFaultAX: amalloy: How can I make it unify to object automatically?

3:59 Or the nearest super.

4:00 Can I just set an upper bound explicitly on U? `U extends Object` or something.

4:02 amalloy: public static <T, U, V extends U> U reduce(Function2<V, ? super T, V>, Iterable<? extends T>, V) looks vaguely right to me, although of course i haven't tried it

4:03 SegFaultAX: Oh yea, wildcards. Good call.

4:03 amalloy: U extends Object is meaningless. everything extends Object

4:03 SegFaultAX: I don't know how to get Java to unify types like that.

4:04 amalloy: i don't understand what you're asking. i know what unification is and how it applies to types, but "unify to object automatically"? what is "it"? what's automatic?

4:06 SegFaultAX: Given types A, B, and C, that share a common supertype, find the most specific super of all three. So like Integer Integer Integer would be Integer, but Integer String Boolean would be Object

4:07 amalloy: okay...so that's a function with four type args: public <R,A extends R, B extends R, C extends R> R(A a, B b, C c)?

4:08 SegFaultAX: amalloy: Yes, exactly. Thanks.

4:12 Is it possible to represent that with an arbitrary number of types?

4:15 amalloy: SegFaultAX: how could you write a function that involves an arbitrary number of types at all?

4:16 if you arbitrarily choose any N ahead of time, it's easy to write that function, so i assume that's not what you meant

4:18 (and if you don't choose the N ahead of time, the function can't possibly have a signature, which is what i meant)

4:18 SegFaultAX: Consider an call with an arbitrary number of Function<T, ? extends R>

4:19 So like juxt(Function<T, ? extends R>... fns)

4:20 amalloy: ? is fixed there, that's just one type

4:20 SegFaultAX: amalloy: I see. Do you understand what I meant, though?

4:22 amalloy: SegFaultAX: i'm not sure. that seems like the right type declaration to me

4:22 assuming reasonable bindings for T and R

4:25 SegFaultAX: Well think of the function juxt in Clojure. Juxt should return a function that takes 1 argument (eg a Function<T,U>) and returns a list of invocations on that argument. But each function could have a different return type, so you'd want to get the nearest supertype of all those return types.

4:25 I'm trying to figure out how to model that in Java generics.

4:27 amalloy: well, your collection of functions will be stored in some List<Function<X,Y>>, where X and Y are fixed (ie, not wildcards)

4:28 so whatever type is the common supertype of all the return values, will need to be a parametric type of that collection

4:28 then you just need to specify a bound for X and Y which is compatible, right?

4:29 SegFaultAX: Right.

4:29 Well the input is fixed.

4:30 It's a List<Function<T, something>> and I'll return a Function<T, List<common supertype>>

4:30 Just like juxt, we assume all functions have a compatible domain.

4:31 amalloy: you're constraining T too much there again. you want a List<Function<? super T, something>>...

4:31 ie, it's fine if one of the functions accepts any Object, they don't have to accept only String

4:32 SegFaultAX: Ah, yes.

4:32 Anyway, it's the `something` part I'm not sure how to make Java do (or if it's possible to express)

4:34 amalloy: public <I,O,In super I, Out extends O> Function<I,O> juxt(Function<In,Out>... fs) maybe?

4:35 SegFaultAX: That could work.

4:35 Let me try.

4:35 amalloy: really i'm just taking the "obvious" two-type signature and introducing a new variable for each type that needs to "bend" in one direction or the other

4:36 although what i actually wrote can be simplified to: public <I,O> Function<I,O> juxt(Function<? super I, ? extends O>... fs)

4:37 SegFaultAX: Yea, I simplified.

4:37 I took your meaning anyway :)

4:37 amalloy: does it work?

4:41 SegFaultAX: Actually the additional type parameters make it easier to type.

4:41 Erm, physically type that is. :)

4:41 amalloy: if you say so

4:47 SegFaultAX: Is <Foo super Bar> not valid?

4:47 Because when I refactored it to use a named type bound, it complained about syntax.

4:48 (extends is obviously fine)

4:48 amalloy: super and extends should fit in the same contexts. why don't you paste the actual declaration?

4:49 SegFaultAX: amalloy: Apparently not a thing http://stackoverflow.com/questions/4902723/why-cant-a-java-type-parameter-have-a-lower-bound

4:50 Because I was trying to get it to type check first, but it wouldn't.

4:50 amalloy: oh, sure. <Foo super Bar> is never needed, because you can write <Bar extends Foo>

4:50 super is only needed for ? bounds

4:50 SegFaultAX: Yea

4:51 But I didn't know super didn't work in that context.

4:51 amalloy: i didn't either

4:52 SegFaultAX: Oh switching them can't work either.

4:52 Derp.

4:54 amalloy: well, that's about the extend of my generics expertise

4:54 *extent

4:55 SegFaultAX: Yea, no forward decls of type variables or lower bounds.

5:09 ddellacosta: is it bad to use &env in a macro?

5:09 I'm not sure how else to get ahold of the values of symbols at macro evaluation time.

5:12 clgv: ddellacosta: not by default, depends what you do with it

5:13 ddellacosta: you really need the value of a symbol on macro expansion time?

5:13 ddellacosta: clgv: actually, I'm not even sure it's going to help me get at the value of the passed in symbols...totally lost as to how to do that. :-(

5:13 clgv: yeah

5:13 clgv: I suppose there are reasons that I shouldn't be doing that?

5:13 clgv: ddellacosta: are the symbols local bindings or refering to variables?

5:13 ddellacosta: referring to variables

5:14 clgv: then you can resolve them

5:14 ,(resolve 'clojure.core/inc)

5:14 ddellacosta: clgv: resolve gives me nil

5:14 clojurebot: #'clojure.core/inc

5:14 clgv: ,(resolve 'inc)

5:14 clojurebot: #'clojure.core/inc

5:14 ddellacosta: that doesn't work for local bindings

5:14 clgv: right you said variables and not local bindings. that's why I asked ;)

5:14 ddellacosta: clgv: oh, sorry

5:15 I thought you meant more...colloquially. haha

5:15 clgv: my confusion

5:15 um, anyways, yeah, they *are* local bindings

5:16 clgv: I'm wondering if actually this should just be a function.

5:16 clgv: yeah, you have to lookup values (if any) from &env - as far as I know there is no other way if you need the value on macro expansion. but maybe you dont and just should generate code that is using the value...

5:17 you'll only need the value if there is something to calculate during the macro expansion based on the value

5:18 ddellacosta: clgv: yeah, now that I'm thinking about it I think that I've been doing it all wrong...it should not be a macro I believe. Whenever I run into this kind of problem I realize I probably didn't need a macro in the first place, since I can use the reader in functions just as easily.

5:18 clgv: anyways, thanks, sorry again for the confusion...

5:19 clgv: ddellacosta: well, if you want a second opionion just post the idea of what you want to do with a small example

5:19 ddellacosta: clgv: okay, let me give this a shot first...

5:42 clgv: strange. tools.cli gives ma the value of an option that was processed in the :arguments value...

5:49 chare: Why does def have this restriction: ...you may be tempted to try to write it as a function. ...def is a special form. You must generate def at macro time; you cannot make “dynamic” calls to def at runtime.

5:51 clgv: chare: can you describe your problem with that?

5:51 chare: why can't you call def in a function???

5:51 lazybot: chare: Yes, 100% for sure.

5:52 clgv: chare: you can, but it does not make sense

5:52 chare: what do you meanL

5:53 clgv: chare: "def" is used to create a global namespace variable that is bound to some value (including functions)

5:53 chare: so why would that make calling it in a function a problem

5:53 clgv: chare: you probably want "let" since you seem to want names for "local variables" (= local bindings) in a functions

5:54 chare: NO

5:54 ddellacosta: clgv: it was all much easier as a simple function. I was making things much harder on myself by making it into a macro. :-P

5:55 clgv: ,(defn bla [x] (def y x) (inc x))

5:55 clojurebot: #'sandbox/bla

5:55 clgv: ,y

5:55 clojurebot: #<Unbound Unbound: #'sandbox/y>

5:55 clgv: ,z

5:55 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: z in this context, compiling:(NO_SOURCE_PATH:0:0)>

5:55 clgv: ,(defn bla [x] (def z x) (inc x))

5:55 clojurebot: #'sandbox/bla

5:55 clgv: ,z

5:55 clojurebot: #<Unbound Unbound: #'sandbox/z>

5:56 clgv: chare: you'll get faster to your goal, if you describe your actual problem

5:56 chare: I am just curious

5:58 clgv: as I said, "def" is just intended to define global variables in the current namespace usually functions and constants

5:58 seldomly global state - which is usually not a good idea

6:08 felher: Can I create a function that passes its [& args] to a constructor of some class? Something like (defn my-object [& args] (apply new MyClass args)). This doesn't work because (I guess) new is a macro and not a function.

6:12 clgv: felher: "new" is a special form. and no that wont work as function

6:12 felher: clgv: okay, thanks :)

6:12 clgv: felher: for a constructor invocation you need to know how many args to pass at compile time

6:13 felher: clgv: yeah, I kinda expected something like that. ty :)

8:26 sm0ke: hey any way to disable jline completely for lein repl?

8:56 llasram: sm0ke: Look in the Leiningen sample project file for the example "dumbrepl" alias

8:56 You can just use `lein run` to run the `clojure.main` REPL

9:10 sm0ke: llasram: but that wont set classpath

9:10 i can very well use java -cp clojure.jar clojure.main then

9:10 llasram: Um

9:10 The `lein run` solution does set that classpath

9:10 Otherwise how could it even find Clojure :-)

9:11 sm0ke: may be but still it wouldnt be a nrepl right?

9:12 which means i can not use it from any ide

9:12 llasram: Sure.... So, you want something that both is a dumb IO REPL, *and* a process that acts as an nREPL server?

9:12 sm0ke: well i just do not want the prompt to read through jline

9:13 everything else should be as is

9:13 llasram: Interesting

9:14 sm0ke: llasram: my point being, i can use rlwrap lein repl, and get better readline support

9:14 than jline would ever be able to provide

9:15 there was a pr for this https://github.com/technomancy/leiningen/issues/33

9:15 but it seems to be lost in time :P

9:16 llasram: wow, #33

9:16 yeah :-)

9:16 sm0ke: now specially after lein uses reply it seems impossible to disable jline

9:17 reply is tightly integrated in lein source, and asking reply to disable jline would be like a sick joke

9:18 i mean reply is nothing but jline over nrepl!

9:20 llasram: That's not really true... I mean, it has to actually be a client, and integrates with completion to provide completion

9:23 sm0ke: thats what nrepl does

9:23 provides server and client

9:26 clgv: repl-y has been much better than rlwrap in most of my use cases.

9:29 sm0ke: clgv: may be for emacs

9:29 but the vim support is eternally broken

9:31 i dont see how jline can defeat rlwrap, which is nothing but a thin wrapper on readline, readline >>> jline

9:53 clgv: sm0ke: I am using CCW and on remote machines command line ;)

10:08 gfredericks: :repl-options :init is not composable

10:25 egasimus: Hey everyone, could anyone please have a look at my issue on StackOverflow?

10:25 http://stackoverflow.com/questions/22271087/building-opencv-and-vision-dlls-to-use-with-clojure-on-windows-7

10:25 I'm trying to get Vision, a wrapper for OpenCV, to run on 64-bit Windows 7.

10:25 I'll be back shortly if anyone wants to get in touch over IRC.

10:29 thenerd2: Yourkit is awesome, and they often have a free early access program (EAP) where you can download and use a copy for a month or so

10:38 gfredericks: I guess if you wrap each use of :init with (do ...), then they'll all compose

11:15 TravisD: Can anyone think of a good naming conventions for functions with possibly random outcomes?

11:17 seangrove: TravisD: I don't, but I like the idea of marking them actually

11:19 TravisD: Yeah, seems like it would potentially save a lot of confusion. I was thinking of adding a "$" at the end, to link it to gambling or something.

11:33 mdeboard: Hi, I have a question that probably doesn't have a good answer. I'm learning Elixir and the same programming pattern called a destructuring bind in Clj is called pattern matching in Elixir.

11:34 So something like `x = [1, 2, 3]; [a, b, c] = x` is pattern matching in Elixir. Is it "powered" the same way in Clojure?

11:34 That is, is destructuring bind using pattern matching under the hood or no

11:38 TravisD: mdeboard: I don't have any experience with Elixir, but it seems like it would be odd for them to reimplement it. If the syntax is the same, my guess is that they just use destructuring binds somewhere

11:39 mdeboard: TravisD: Well, Elixir is not related to Clojure at all. Runs on different VM (OTP) and everything

11:39 TravisD: Oh, in that case, I'm not sure

11:39 mdeboard: (You should check it out)

11:39 TravisD: Are you wondering if they use the same algorithm?

11:40 mdeboard: Yeah, I guess I am

11:40 TravisD: I'm guessing it's very similar

11:41 isaacbw: pattern matching usually means something different in programming languages

11:41 well, similar

11:41 but different

11:52 mdeboard: isaacbw: You mean different things in different languages? or?

11:54 isaacbw: well, it's the same concept

11:55 but usually when a language has pattern matching, it means something more like a switch statement

11:55 http://xahlee.info/ocaml/pattern_matching.html

11:55 destructuring is sort of a rigid pattern matching I suppose

11:56 TimMc: isaacbw: Not really. Destructuring is a part of pattern matching, but it lacks the dispatch feature.

11:56 mdeboard: dispatch feature?

11:57 TimMc: With pattern matching you can say "if it matches this pattern, destructure & bind this pattern and execute this form, otherwise do this other one."

11:57 mdeboard: ahhh

11:57 right

11:58 Good distinction, thanks

12:01 TravisD: So I've been trying to get a reasonable implementation of sparse vectors. Would anyone mind giving suggestions? https://www.refheap.com/54488

12:04 Mostly, I am wondering if this is an appropriate use of a multimethod

12:04 bbloom: TimMc: although we recover a (slightly broken) variant of pattern match "dispatch" with if-let, if-some, when-let, when-some

12:08 TimMc: Hah, true.

12:09 hyPiRion: We have a so-to-say proper one with core.match

12:09 TimMc: It's kind of a degenerate case.

12:09 (if-let, not core.match)

12:11 bbloom: TimMc: yeah, the "bad" part of pattern matching is the fact that it's ordered choice like cond

12:11 cond is OK in small dosages, but too much of it is a serious issue b/c it thwarts refactoring

12:11 TimMc: Hmm, yeah.

12:11 bbloom: it's hard to reorder clauses w/o invalidating some subtle assumption about previously checked conditions

12:11 TimMc: That has not bitten me yet, thankfully.

12:11 bbloom: "pattern matching" has become synonymous with "ordered choice"

12:14 technomancy: core.match is nice, but without pattern matching in the core language you don't get a lot of its benefits around libraries

12:14 TimMc: technomancy: Lovin' that OCaml?

12:15 technomancy: like we have to use exceptions for error conditions instead of matching against [:ok, value]

12:15 TimMc: currently thinking of erlang, but sure =)

12:15 did the comma give it away?

12:16 TimMc: No, why?

12:16 Is that a thing in OCaml?

12:17 technomancy: it's a thing in everything that isn't lisp/forth afaik

12:17 TimMc: hah

12:18 Oh, you mean the comma in the thing you said after me.

12:18 * TimMc squints

12:18 TimMc: Are you time-travelling again?

12:18 * technomancy backs away slowly

12:21 mdeboard: lol

12:22 `{:ok, file} = File.open "some_file.txt"` is a pattern match

12:22 I'm really digging Elixir

12:22 Not that this is #elixir-lang

12:24 TimMc: I definitely want to give it a try.

12:26 mdeboard: unfortunately it kind of occupies the same niche as Clojure in terms of things I'd use it for, so I doubt I'd be able to use it in day-to-day work

12:27 also it's still sub-1.0 release

12:28 but it excites me in the same way clojure excited me a few years ago

12:28 seangrove: mdeboard: Raynes is also very into it

12:28 mdeboard: titillating

12:28 It's a scintillating language

12:29 seangrove: Yeah

12:41 isaacbw: god I'm so excited to be back with lisp. I've been spending way too much time with JavaScript

12:44 seangrove: "JavaScript is really Scheme in C-clothing!"

12:44 * seangrove clenches his jaw in anger

12:45 woah: just throw away like half the language and the rest is pretty good

12:45 isaacbw: ,(str "hello" "world")

12:45 clojurebot: "helloworld"

12:46 woah: (+ 2 2)

12:46 clojurebot: 4

12:46 woah: oh wow awesome

12:46 isaacbw: oh, you don't need the leading comma?

12:47 woah: guess not

12:47 isaacbw: I just wrote a new lisp for the sole purpose of powering a bot in my IRC channel XD

12:48 Umschwung: (defn [x] x)

12:48 (defn id [x] x)

12:49 So it doesn't allow function definitions, too bad. :P

12:49 hyPiRion: (+ (- 10))

12:49 (+ 2 2)

12:49 clojurebot: 4

12:49 Umschwung: (apply + '(1 2 3 4 5))

12:50 hyPiRion: Just for specifics I guess then

12:50 Umschwung: ,(apply + '(1 2 3 4 5))

12:50 clojurebot: 15

12:50 Umschwung: ,(defn id [x] x)

12:50 clojurebot: #'sandbox/id

12:50 Umschwung: (id 10)

12:50 ,(id 10)

12:50 clojurebot: 10

12:50 Umschwung: Hah, cool.

12:51 hyPiRion: (identity foobar)

12:51 lazybot: foobar has karma 0.

12:51 seangrove: (sqrt hyPiRion)

12:51 hyPiRion: heh

12:52 seangrove: (inc hyPiRion)

12:52 lazybot: ⇒ 34

12:52 Umschwung: (inc Umschwung)

12:52 lazybot: You can't adjust your own karma.

12:53 Umschwung: (/ 42 0)

12:53 ,(/ 42 0)

12:53 clojurebot: #<ArithmeticException java.lang.ArithmeticException: Divide by zero>

12:54 Umschwung: Looks like I blew up the universe again. Oh, well...

13:30 shiranaihito: I'm getting an error saying: "IllegalArgumentException: :db.error/not-an-entity Unable to resolve entity: :user/email" - but I have no clue what's wrong with this: https://www.refheap.com/2a87df6ca5c23804e2bdf42c0 -- any ideas? (i'm using Cursive Clojure with IDEA)

13:44 seangrove: $seen noprompt

13:44 lazybot: noprompt was last seen quitting 13 hours and 36 minutes ago.

13:47 muhoo: (inc inc)

13:47 lazybot: ⇒ 6

13:51 mheld: anybody here use functionaljobs.com?

13:59 bjorkintosh: yeah, why?

14:06 mheld: aww yeah http://functionaljobs.com/jobs/8692-clojure-programmer-data-scientist-at-weft

14:24 PinkPrincess: I'm having some issues with core.async. I hope linking to pastebin is not discouraged and go right ahead: http://pastebin.com/VdazyHkN

14:25 The code is rather riddled with debugging attempts, but essentially: All the expected ">!" are printed, but only a fraction (roughly 10%) of the "<!" are printed.

14:26 I'm pretty confident in all the external calls used in the code snippet.

14:26 If anyone has a suggestion as to what I'm doing wrong, I'd be very grateful.

14:27 If it's any help, the entire process takes a *long* time.

14:27 eraserhd: I'm pretty certain I'm doing it wrong, but can anyone tell me why: I'm trying to use ns-interns at ns load time (at the bottom) to capture defns with a certain meta. I'm not getting all of them.

14:27 PinkPrincess: It's fetching and parsing about 14000 HTTP requests.

14:28 isaacbw: what do you call the thing being checked in an if statement?

14:28 eraserhd: isaacbw: condition?

14:29 isaacbw: hmm, I suppose that works! I was thinking of another word, but maybe it's a false memory :P

14:30 PinkPrincess: Do you get the expected mappings if you run it at the REPL, eraserhd?

14:31 eraserhd: PinkPrincess: No.

14:31 Actually, let me reload my REPL.

14:32 Oh wow, this time I only got one of the mappings.

14:33 seangrove: Bit by circular deps.

14:33 PinkPrincess: And you really do want ns-interns (as opposed to ns-map and friends)?

14:35 eraserhd: My project actually doesn't have circular deps. That's a pet peave. I keep it acyclic.

14:36 So I extracted the collector function, and I call it after I require, and I get different results?

14:38 PinkPrincess: Can you share a small example on pastebin, eraserhd?

14:38 seangrove: eraserhd: Sorry, I meant I had just been bit ;)

14:39 eraserhd: Oh, heaha.

14:39 PinkPrincess: I figured it out. I will share for your amusement.

14:39 PinkPrincess: I am kind of curious now. ;)

14:43 eraserhd: PinkPrincess: https://gist.github.com/eraserhd/9437765

14:47 Oh, now I'm not so sure I understand. I assumed that ^{:handler ~keystroke} was being evaluated prematurely, but then I wouldn't get any.

14:49 PinkPrincess: Heh.

15:04 Well, as long as it's solved.

15:05 eraserhd: Er, not solved :(

15:05 PinkPrincess: Oh, I thought you figured it out.

15:05 eraserhd: I thought I did as well, but I didn't. :)

15:06 PinkPrincess: Ah, like that.

15:15 eraserhd: Baffled as to what I'm missing. I have a macro which expands to (do (def x ...) (alter-meta! #'x assoc ...)) and I get random results?

15:16 PinkPrincess: Couldn't you simply add the meta-data inside the (def)?

15:16 eraserhd: Probably. I'm not sure why the meta-data isn't coming trhough, but I got similar results when I tried that.

15:17 PinkPrincess: So it expands to (def #^{:some :stuff} x ...)

15:17 That does sound rather strange.

15:17 hyPiRion: eraserhd: (def ~(with-meta x metadata) ...) ?

15:17 bbloom: ~top-level

15:17 clojurebot: Gabh mo leithscéal?

15:18 bbloom: clojurebot: top-level is hopeless

15:18 clojurebot: 'Sea, mhuise.

15:18 bbloom: eraserhd: do what PinkPrincess says b/c def is weird

15:18 eraserhd: Let me try.

15:22 Works in the REPL, sort of? ...

15:23 But not when I require the file.

15:26 PinkPrincess: Ugh.

15:28 eraserhd: Aha! It is evaluating to the same symbol every time!

15:29 ,(defmacro m [] `(def x# 42))

15:29 clojurebot: #'sandbox/m

15:29 eraserhd: ,(m)

15:29 clojurebot: #'sandbox/x__25__auto__

15:29 eraserhd: ,(m)

15:29 clojurebot: #'sandbox/x__25__auto__

15:29 eraserhd: ,(m)

15:29 clojurebot: #'sandbox/x__25__auto__

15:29 PinkPrincess: Ohh.

15:29 eraserhd: Not what I expected. I might not understand x#

15:30 PinkPrincess: Maybe some gensym?

15:30 hyPiRion: go (let [x (gensym)] ...)

15:30 do*

15:31 eraserhd: I will, but first I'm going to understand why that happens...

15:31 Bronsa: eraserhd: the x# gensym is generated at read-time rather than runtime so you get the same symbol every time

15:34 PinkPrincess: ,(repeatedly 5 gensym)

15:34 clojurebot: (G__121 G__122 G__123 G__124 G__125)

15:34 PinkPrincess: Clojurebot is pretty cool.

15:35 Does it ever reset its namespace/jvm?

15:37 eraserhd: Still no go.

15:38 ,(defmacro m [] `(def ^:x ~(gensym) 42))

15:38 clojurebot: #'sandbox/m

15:38 eraserhd: ,(m)

15:38 clojurebot: #'sandbox/G__175

15:38 eraserhd: ,(:x (meta #'G__175))

15:38 clojurebot: nil

15:38 ruzu: clojurebot: I <3 U

15:38 clojurebot: No entiendo

15:39 eraserhd: Oh, but alter-meta! should work now.

15:39 hyPiRion: ,(defmacro m [] `(def ~(with-meta (gensym) {:x true}) 42))

15:39 clojurebot: #'sandbox/m

15:39 hyPiRion: (m)

15:39 ,(m)

15:39 clojurebot: #'sandbox/G__52

15:40 hyPiRion: ,(meta #'sandbox/G__52)

15:40 clojurebot: {:x true, :ns #<Namespace sandbox>, :name G__52, :column 0, :line 0, ...}

15:40 PinkPrincess: Yay! \o/

15:41 eraserhd: hyPiRion: !!!

15:45 Well, now I have a minor problem to resolve, but got to go. Thanks!

15:45 PinkPrincess: Best of luck.

15:45 Do any of you have experience with putting and taking many thousands of large data structures with core.async?

15:46 If I log all my puts and takes, everything it put onto the channel as expected, but when taking until I read nil, it seems to just... stop prematurely.

15:46 is put onto*

15:46 hyPiRion: when you put on nil, that means you close the channel, right?

15:46 PinkPrincess: So it'll log 13864 puts, but log between 1600 and 2000 takes.

15:47 Yes, but you can't actually "put" it.

15:47 It'll do that when it closes.

15:47 But supplying >! with nil is an error.

15:47 * hyPiRion doesn't know any core.async, just guessing.

15:47 PinkPrincess: So it is safe to assume it doesn't put nil itself, as this would throw an error (as far as I understand it.)

15:48 ruzu: is avout the go-to lib for distributed stuff?

15:48 PinkPrincess: It may close prematurely, I suppose.

15:49 I haven't really heard of avout, ruzu. Sorry.

15:50 seangrove: Uhg, circlural deps are making my head heurt

15:50 PinkPrincess: A perhaps related question: when does a core.async channel close if left alone?

15:50 Never?

15:50 ruzu: there's always akka i guess

15:50 seangrove: Maybe I should cheat for now and rely on js' late-binding. Just use fqn for the functions...

16:02 _Bravado: IIRC async channels don't close on their own

16:04 PinkPrincess: Then that shouldn't be the problem at least.

16:20 firefaux: what's the difference between IPersistentMap's assoc and assocEx methods?

16:46 amalloy: firefaux: assocEx is a legacy thing that's never called

16:46 firefaux: oh

16:47 so would it be ok for me to implement APersistentMap and then have assocEx throw whatever the "not implemented" exception is called?

16:48 I guess it's called NotImplementedException

16:48 amalloy: sure, UnsupportedOperationException

16:48 firefaux: oh wait, that was a 3rd party library I found with that

16:48 yeah, UnsupportedOperationException sounds familiar now

16:49 amalloy: anyway, what (.assocEx m k v) is supposed to do is the same as (.assoc m k v), except that if k already has a mapping in the map already it throws an exception

17:21 seangrove: Is there no pretty-printer for cljs?

17:22 Damn

17:23 dnolen_: seangrove: nope

17:23 seangrove: you could probably port fipp though

17:24 bbloom: seangrove: it's already ported

17:24 https://github.com/brandonbloom/fipp/pull/12

17:25 seangrove: bbloom: Oh, that looks nice

17:41 PinkPrincess: Has anyone tried making many thousand requests with http-kit? I now wonder if this is what's causing my issues.

17:41 isaacbw: does anyone here know of any material on how wolfram alpha works? Whitepapers, maybe?

17:42 _Bravado: it works mostly on ego

17:43 isaacbw: lol

17:44 _Bravado: Stephen Wolfram would give Kanye West and Paul Graham a run for their money

17:45 AimHere: Pfft. Wolfram revolutionised All Of Science. Kanye West only invented Rap Music, and Paul Graham built the internet.

17:45 _Bravado: That said, his personal area of expertise would be cellular automata, or at least thats what his early work was focused around

17:45 AimHere: Well he created Mathematica too; presumably it's better than Maple now; it wasn't when I last checked it out

17:48 _Bravado: wolfram alpha actually has some basic info on their site and iirc a blog. It actually let me down quite a bit when it was first opened

17:48 pdk: [17:43] <AimHere> Pfft. Wolfram revolutionised All Of Science. Kanye West only invented Rap Music, and Paul Graham built the internet.

17:48 it wasn't al gore?

17:49 ruzu: al gore got a bum rap

17:49 AimHere: Probably a division of labour. Gore just did the bits that weren't made out of lisp

17:50 _Bravado: so all of it

17:50 AimHere: Except Yahoo. Well Yahoo's airline thingummy. Except not now. And Reddit. Well not now either. But Hacker News is made out of Lisp, so people say.

17:50 seangrove: dnolen_: What's the way in Om to rearrange some data before passing it on to a sub-component? E.g. (def as {:numbers [0 1 2 3] :letters ["x" "y" "z"]}) (defn my-om-com [data owner opts] (om/build sub-com (om/graft {:sub-com-new-data 42, :sub-com-renamed-data (:letters data)} data))) ?

17:51 dnolen_: If I'm moving as' :letters to :sub-com-renamed-data (where sub-com expects it to be), it's a cursor, so I can't graft it.

17:51 Ah, maybe just assoc it

17:52 TimMc: pdk: Al Gore was misquoted.

17:52 pdk: did reddit have some lisp in the backend early on

17:52 seangrove: TimMc: True. He actually invented ARPANet

17:52 TimMc: :-P

17:52 pdk: Yup, used to be lisp

17:53 pdk: http://www.redditblog.com/2005/12/on-lisp.html

17:53 pdk: aptly named article

17:54 TimMc: But I get to write Clojure at work, which makes up for it plenty.

17:56 pdk: what sort of things are companies hiring for clojure looking for on a resume

17:56 ianeslick: Anyone familiar with the cause of this error: JSC_MISSING_PROVIDE_ERROR. required "orchestra.app" namespace never provided at ... when building clojurescript?

17:57 _Bravado: I need to come up with projects to raise my clojure skills and get better acquainted with the full capabilities. Maybe i'll do something with storm / trident

17:57 seangrove: _Bravado: That would be a pretty bit project. Takes a lot of work to get Storm running properly

17:58 ruzu: i wish i could write clojure at work. currently it's a top-to-bottom microsoft shop with a lot of bad c#. i tell myself not to give up hope, because then i would have nothing.

17:59 * ruzu sips more emo coffee.

17:59 dnolen_: seangrove: I don't see the problem

18:00 _Bravado: I've gotten storm to work before a couple steps past hello world heh

18:00 https://github.com/yieldbot/marceline is what i'm really interested in trying out

18:00 seangrove: dnolen_: (:sub-com-renamed data) is a subkey of the data I'm trying to graft, and it's going to be a cursor, and one cursor can't be grafted onto another

18:01 dnolen_: I've just moved it to opts for the time being, but I'll need to revisit it, I think

18:01 dnolen_: seangrove: why don't you just assoc the data you need on?

18:02 seangrove: dnolen_: I did do that, but there were some unrelated issues. No worries.

18:02 gfredericks: clojure.repl/dir should fallback to checking local aliases

18:03 ianeslick: dnolen_ Is there a particular trigger that causes a namespace to not be pulled in during CLJS compilation with the error JSC_MISSING_PROVIDE_ERROR?

18:07 dnolen_: ianeslick: it doesn't exist or misnamed

18:08 mr-foobar: in cljs, do macros have limitations ?

18:08 dnolen_: mr-foobar: can't interact w/ runtime

18:09 ianeslick: dnolen_: Very odd because the file is there in the out directory, properly compiled, and used by another file successfully.

18:12 dnolen_: ianeslick: I'm assuming it's one of your own files?

18:13 ianeslick: 2 things come to mind - make sure you're following JVM classpath conventions for your project, also make sure there isn't another auto build process running or something like that

18:13 ianeslick: Yes. I'm building a worker JS file with Pedestal and the main file, which uses app.cljs in the non-worker condition compiles fine, but the worker fails.

18:13 dnolen_: do a clean build

18:13 ianeslick: Could be some parallel builds going on.

18:13 The internals of the pedestal build tools can be odd.

18:15 TimMc: pdk: I think that varies quite a bit.

18:15 mr-foobar: dnolen_: ah, that basically means I can't ~cljs-code right ?

18:15 TimMc: pdk: Actually, a friend of mine just posted a Clojure job, but he didn't include qualifications: http://functionaljobs.com/jobs/8692-clojure-programmer-data-scientist-at-weft

18:15 pdk: neat

18:15 dnolen_: mr-foobar: no

18:16 pdk: i get emails from recruiters for clojure once in a while though i feel at this point i may be too rusty to make a good showing

18:16 TimMc: I think most companies just want someone who can learn quickly and start writing code quickly. :-P

18:16 dnolen_: mr-foobar: it just means you can interact between runtime and compile time

18:16 gfredericks: that was easy: https://github.com/fredericksgary/repl-utils/blob/master/src/com/gfredericks/repl.clj#L26

18:16 pdk: that and i have yet to actually do anything substantial with it

18:16 i learned clojure in like 2010

18:17 gfredericks: back in the wild days

18:17 when vars were vars and seqs were lazy

18:17 pdk: when you just downloaded one zip for clojure.contrib

18:18 hell i even got a recruiter for clojure who said he was from apple

18:18 not sure how legitimate that was since apple using it just made me do a double take

18:18 gfredericks: in a big enough company somebody's using it for something marginal enough

18:18 TimMc: Probably an internal project, like usability testing or intranet stuff.

18:20 gfredericks: either that or they rewrote iTunes

18:20 Null_A: pdk: clojure at apple?

18:21 pdk: from what it sounded like yes

18:21 Null_A: i wonder if it's because they're using storm-project.net

18:21 gfredericks: In the town of Lake Clojure1.0beggon, where the vars are dynamic, the seqs are fully lazy, and the arithmetic operations are autopromoting.

18:22 dnolen_: pdk: Apple has been using Clojure since the second Conj pretty sure

18:22 pdk: dayum

18:28 hiredman: there were some apple recruiters handing out бизнес cards and free itunes songs at one of the conjs

18:30 akhudek: I assumed that they were just there recruiting, would be surprised to hear they use clojure

18:30 Esp. given their stance on the jvm

18:30 hiredman: https://www.linkedin.com/jobs2/view/6669521

18:31 oh foo

18:31 dsrx: apple have a bunch of really ancient java sites using WEbObjects

18:32 hiredman: I think I just did the equivilant of "I'm feeling lucky" and just assumed the result was relevant

18:32 akhudek: hiredman: what is that? I get a login gate

18:32 dsrx: it's a job posting from a few months ago for a clojure engineer at apple

18:32 akhudek: oh, interesting

18:32 hiredman: "This is a preview of the Clojure Engineer- iTunes job at Apple. To view the full job listing, join LinkedIn - its free!"

18:33 anyway, apple has big backend services, and these days those are pretty much always on the jvm everywhere

18:33 akhudek: that's true

18:35 gfredericks: or MRI or node or the pee aitch pee virtual machine

18:35 isaacbw: all those big backends running on node and all that

18:35 TimMc: And then there are the companies that hire Clojure and Haskell developers to do Java development

18:36 just because they know these are *probably* smart devs. :-P

18:36 It's a dirty trick, and I wonder if Apple was doing that.

18:37 hiredman: That job description doesn't actually mention Clojure again. There's just one relevant qualification: "Experience developing large-scale web-based applications using Java and other object-oriented languages."

18:43 ianeslick: dnolen_ It's probably because the file in question is using ^:shared

18:50 danielszmulewicz: Trying to set a value in user session with liberator... struggling again...

18:52 ianeslick: dnolen_ Thanks for the input; it was due to a whitelist being applied within Pedestal.

19:11 dissipate: why is (or) nil and (and) true?

19:14 Jahkeup: dissipate: check out the source for or and and (lol) on the rpel

19:14 *repl

19:14 (source or) reveals that the macro defined for or returns nil when called without any args

19:15 dissipate: Jahkeup, ok, i see. but why?

19:15 Jahkeup, it seems inconsistent

19:16 Jahkeup: dissipate: tbh I do see where you're coming from, the recursion in the `and` macro makes sense with it being true with no args

19:16 TimMc: Jahkeup: More importantly, that's how Boolean logic is defined, for consistency.

19:16 Jahkeup: TimMc: yes, I didn't wanna say that so broadly though, but you're right

19:17 dissipate: Jahkeup, why isn't 'or' true with no args?

19:17 Jahkeup: dissipate: like TimMc its all boolean logical operations

19:17 dissipate: Jahkeup, what do you mean?

19:18 TimMc: https://en.wikipedia.org/wiki/Logical_disjunction#Definition

19:19 "The disjunctive identity is 0, which is to say that OR-ing an expression with 0 will never change the value of the expression. In keeping with the concept of vacuous truth, when disjunction is defined as an operator or function of arbitrary arity, the empty disjunction (OR-ing over an empty set of operands) is often defined as having the result 0."

19:19 dissipate: TimMc, but that's my point, it does not seems consistent to me

19:19 noonian: (or) returning nil makes sense to me, formal semantics aside, no truthy thing to return a truthy value for

19:19 TimMc: That is, (or a b c false) is always equal to (or a b c), so (or) is equal to (or false).

19:19 dissipate: noonian, and what about 'and' with no arguments?

19:20 noonian: that seems more ambiguous heh

19:20 ,(doc and)

19:20 clojurebot: "([] [x] [x & next]); Evaluates exprs one at a time, from left to right. If a form returns logical false (nil or false), and returns that value and doesn't evaluate any of the other expressions, otherwise it returns the value of the last expr. (and) returns true."

19:20 TimMc: noonian: De Morgan's law.

19:21 More or less.

19:21 dissipate: TimMc, are you saying clojure is consistent here?

19:22 noonian: yes he is, consistent with the semantics of or and and in boolean logic

19:23 dissipate: noonian, but (or false) is not the same as (or) in clojure

19:23 noonian: i guess it doesn't come up in a lot of other languages where or and and are always infix operators

19:24 dissipate: because false is not the same thing as nil, but both are falsey values so it doesn't usually matter, and if you care about the difference you just have to do a bit more work and use nil? or false?

19:25 dissipate: noonian, nil and false are two completely different things in my book

19:26 noonian: the only reason clojure has both of them is because java does

19:26 i don't usually care unless i'm worried about puting nil on an async channel heh

19:29 ruzu: anyone know if this is worthwhile -> http://shop.oreilly.com/product/0636920030409.do

19:31 Jabberz: style question - I have a Java API that requires you to create like 5 objects, run a bunch of setters and such, to all but call a single execute method. Should I do all the mutation in a let parameter definition, or within a let body?

19:32 most of the setters don't need to be saved, i.e. don't generate a return value, so I have a lot of "_ (.setBlah ..)" stuff going on

19:32 dissipate: noonian, i still don't think it is consistent. it makes no sense

19:32 noonian: imo if the mutating methods don't return anything go ahead and do it in the body

19:32 dissipate: what about it seems inconsistent?

19:32 Jabberz: noonian: problem is like 1/2 of them do return something, 1/2 don't, it's a bit tangled

19:33 some statics ,some objects passed around, etc

19:33 dissipate: noonian, (and) and (or) should both return nil

19:33 or rather, evaluate to nil

19:35 bob2: Jabberz, wrap it up in a function?

19:37 Jabberz: bob2: this is pretty much the function, i have the tangled mess in the let parameters, then the one method of value in the body

19:37 noonian: dissipate: idk if i agree, and evaluates it's arguments until on of them is falsey (where it returns the falsey value) or there are no remaining arguments (where it returns the last argument evaluated)

19:37 so if there are no arguments and it returns nil, it is as if it encountered a nil value

19:37 Jabberz: if it were a little less tangled, I guess putting it in the body would be good, but there's like a couple of things i gotta capture from the java setters

19:38 dpathakj: you can think of 'and' as "truthy unless at least one arg is falsy", and 'or' as "falsy unless at least one arg is truthy"

19:38 tomjack`: anyone else noticed clojure-mode ignoring clojure-backtracking-indent for names ending in "fn"?

19:39 dpathakj: and if there are no arguments, none are falsy, and none are truthy

19:39 noonian: yeah, dpathakj gives form to my thoughts

19:39 Jabberz: I guess talking through it, i've convinced myself - the java mutation mess can be in the let parameters so it can save some of the return vars it needs to use

19:40 noonian: Jabberz: yeah, nothing wrong with that, and if you don't want tons of _'s you can use one with a do block until the next value you need to keep a reference too

19:40 Jabberz: ah, nice, thanks noonian

19:43 dnolen_: Om 0.5.2 out, now easy to use with Om components from Reaget/Quiescent/plain React, also possible now to interpret local state operations - easy to force a component to write it's local state into the global application state and instance by instance basis

19:43 lots of possibilities for debugging here when coupled with :instrument

19:46 tomjack: (= b (and (and) b) (or (or) b)) ?

19:47 the zero arities make r/reduce make sense

19:47 well, they would...

19:47 :(

19:47 noonian: dnolen_: nice!

19:48 Wild_Cat: ,(and)

19:48 clojurebot: true

19:48 tomjack: wonder why they aren't inlined fns

19:49 dnolen_: noonian: pretty powerful stuff IMO. You can pick a local/global state transition strategy at instance level

19:50 tomjack: I guess you're not supposed to use those as HOFs anyway?

19:50 oops maybe sore subject :X

19:52 hyPiRion: tomjack: huh? They cannot be HOFs

19:52 functions take evaluated arguments, whereas `or` and `and` take forms, and may short-circuit

19:55 tomjack: wait, why the fuck are there zero arities?

19:55 oh, in case you macroexpand to (and) or (or), I guess?

19:55 exactly

19:56 hyPiRion: yeah, in case other macros generate such a form.

19:57 tomjack: oh

19:57 if they could also be used as HOFs, it wouldn't make sense to complain that it didn't short-circuit when you used it that way

19:58 so I don't see a problem with allowing both, except that you can't

19:58 but what puzzles me is why there is a zero arity when they can't be used as HOFs

19:59 so that people doing demo talks can do (and) and (or) after (+) to show off?

19:59 hyPiRion: Because you can macroexpand it

20:00 It turns out that monoids are great to avoid special cases, and when you're writing macros, having (and) and (or) available instead of replacing them is sensible

20:01 tomjack: or maybe just because it was easy to write..

20:01 Bronsa: tomjack: makes it possible to write `(and ~@body) without thinking about the possibility of body being empty

20:01 for example

20:02 noonian: specify! is pretty cool

20:04 tomjack: I guess that is a pretty good reason

20:05 dnolen_: noonian: incredibly useful.

20:05 noonian: i hadn't seen it before looking at your examples

20:08 mr-foobar: dnolen_: possibly a vague question, I just read om/wiki/BasicTutorial. Is there a general guideline for assigning core.async channels to components ?

20:09 dnolen_: mr-foobar: not yet, not enough generic components to understand what the best practices are yet.

20:12 mr-foobar: dnolen_: If my understanding is correct, I can bypass core.async completely by purely (swap! ...) global state just as icky javascript.

20:13 dnolen_: mr-foobar: calling swap! on the global state is not recommend unless you really know what you are doing

20:13 likely to opt out of a lot of things that Om is designed to handle / optimize

20:16 mr-foobar: dnolen_: right. still trying wrap my head around cursors :)

20:33 igorw: does core.logic have relations/constraints on types, such as 'symbolo', 'keywordo' and such?

20:40 danielszmulewicz: Anyone has played with Liberator (the REST library)?

20:40 played/worked

20:52 bob2: yes

20:53 protip: keep the giant graph open in a browser tab + enable trace

20:53 danielszmulewicz: bob2: I'm struggling with setting the value in the ring session. Would love to look at an example.

20:54 bob2: never used sessions, sorry

20:54 http://mmcgrana.github.io/ring/ring.middleware.session.html looks simple enough, though

20:55 ie return a response with :session set to whatever you want

20:55 danielszmulewicz: bob2: No problem, thanks for the tip, I'm doing that. Normally, I have a good experience with Liberator, but I always trip over the user sessions.

20:55 bob2: Yes, wrap-session is configured.

21:06 MattAbbott: so is there anyway to pull in one local clojure project without setting up a full repo?

21:06 I just want to be able to give it the path to my project dir...

21:15 TimMc: MattAbbott: What for? Are you developing against it?

21:15 Or is it like... a personal REPL tools thing?

21:16 The correct answer differs by use-case.

21:16 MattAbbott: I'm developing two projects in parallel. Indeed, I'm pulling the former out of the latter, as it will be general enough to be useful on its own. I just don't want to go through the trouble of setting up a private repo to hack this out right now

21:17 (my temporary solution has been to put a soft-link in the dependent project's src that points to the other project's src, but that's going to cause problems when its project.clj is non-trivial)

21:23 TimMc: MattAbbott: Leiningen supports "checkout dependencies", which allow you to override a stated dependency with another lein project elsewhere on disk.

21:24 That's probably what you want during development.

21:24 It's basically equivalent to what you're already doing, but better-supported.

21:26 MattAbbott: I see. I was under the impression the project had to have a slot in a repo already or else that mechanism would complain. I'll have to play with that.

21:26 TimMc: Hmm... I see.

21:27 It may require that the dependency can be otherwise resolved, yes.

21:27 In that case you might want to do a `lein install` on the dependency project first so it's at least in your m2 cache.

21:29 MattAbbott: ah that's a good idea.

21:30 TimMc: I mean, you can also just use that approach without using checkout deps, but that can slow you down a bit.

21:30 MattAbbott: right

21:30 TimMc: However, both aspects (local install and checkouts symlink) are things that can complicate debugging, because you eventually *will* forget they're in place. :-P

21:49 rufoa: <MattAbbott> ah that's a good idea. << I made a lein plugin a while back to automate this which you might find useful: https://github.com/rufoa/lein-checkout-deps

21:50 MattAbbott: cool. I'll take a look at it

22:36 mildfate: I have a function that takes 4 arguments that I'd like to map onto a list of pairs plus a "default" pair that is applied to every pair in the list. How do I do this since partial function application isn't quite built-in?

22:47 dsrx: ,(def foo [x y z a] (str x y z a))

22:47 clojurebot: #<CompilerException java.lang.RuntimeException: Too many arguments to def, compiling:(NO_SOURCE_PATH:0:0)>

22:47 dsrx: ,(defn foo [x y z a] (str x y z a))

22:47 clojurebot: #'sandbox/foo

22:48 dsrx: ,(map #(foo %1 %2 :de :fault) [[1 2] [3 4] [5 6] [7 8]])

22:48 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval72/fn--73>

22:49 noonian: ,foo

22:49 clojurebot: #<sandbox$foo sandbox$foo@87d0a5>

22:50 hyPiRion: ,(map #(apply foo :de :fault %&) (partition 2 (range 1 9)))

22:50 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: sandbox/foo>

22:51 noonian: ,(for [[e1 e2 & others] [[1 2] [3 4] [5 6] [7 8]] (apply foo e1 e2 :de :fault others))

22:51 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

22:51 chouser: Total hours: Rate: Total:

22:51 noonian: ,(for [[e1 e2 & others] [[1 2] [3 4] [5 6] [7 8]]] (apply foo e1 e2 :de :fault others))

22:51 clojurebot: ("12:de:fault" "34:de:fault" "56:de:fault" "78:de:fault")

22:52 chouser: Hm. oops.

22:52 ,(map #(apply foo :de :fault %1) (partition 2 (range 1 9)))

22:52 clojurebot: (":de:fault12" ":de:fault34" ":de:fault56" ":de:fault78")

23:01 dsrx: is there a good explanation somewhere about what the "provided" scope for leiningen/maven is?

23:07 noonian: i'm not sure what you mean

23:12 ruzu: interesting -> http://sicpinclojure.com/

23:53 isaacbw: anyone here read the oreilly or manning books on hbase? I'm wondering which one to get

Logging service provided by n01se.net