#clojure log - Sep 06 2012

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

0:00 * adu <3 Haskell

0:00 cgag: line-seq comes with clojure

0:00 technomancy: Sgeo: yeah, definitely

0:00 xeqi: yes, and you'd have to be careful to not close the file to early

0:00 technomancy: well, there's line-seq, but line-seq forces you to wrap it in a with-open

0:00 so you can't just treat it like any old seq

0:01 devn: Sgeo: http://clojuredocs.org/clojure_core/clojure.core/line-seq

0:01 not the with-open wrapper

0:01 note*

0:02 cgag: actually i think i've been bit before by doing something like (for [line (line-seq)] ...) within a with-open

0:03 since it returns the lazy seq but closes the reader, or at least that's what i thought was happening

0:07 ohpauleez: cgag: Not the biggest n, the biggest n for the DS

0:10 cgag: DS?

0:10 clojurebot: bcrypt. http://codahale.com/how-to-safely-store-a-password/

0:12 ohpauleez: Data structures

0:12 the tries

0:15 at least, that's what I recall

0:17 yankov: do you guys think PersistentTreeMap is a good choice for something like leaderboards. How fast it sorts by keys

0:28 devn: yankov: once upon a time i used PersistentQueue but it was just for fun

0:35 SegFaultAX: I have a vector of strings ["XX" "XY"] which I want to convert into a dict like {\X [[0 0] [1 0] [1 0]] \Y [[1 1]]}. What's the best way to do it?

0:37 Sgeo: Are there any good guides for making macros that write macros?

0:38 casion: Sgeo: you scare me

0:39 SegFaultAX: ,(let [b ["XX" XY"]] (group-by first (for [y (range (count b)) x (range (count (get b y)) :let [v (get-in b [y x])] [v [x y]]))

0:39 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>

0:39 SegFaultAX: ,(let [b ["XX" XY"]] (group-by first (for [y (range (count b)) x (range (count (get b y)) :let [v (get-in b [y x])] [v [x y]])))

0:39 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>

0:39 SegFaultAX: Hmm.

0:39 Sgeo: I actually have a use-case in mind. This fact may be even scarier.

0:40 SegFaultAX: Sgeo: Why would you want to do such a thing?

0:40 Sgeo: with- macros seem to be at least somewhat common and idiomatic

0:40 casion: Sgeo: can you explain please?

0:40 Sgeo: Yet, to a degree, they're all similar

0:40 So, why not a macro that expands into a defmacro form to define a with- macro?

0:41 (defwithmacro with-something pre-function post-function) might be an example usage

0:41 The created macro could be used like (with-something somecode morecode)

0:41 somecode morecode might be surrounded by pre-function before it and post-function after it

0:42 Although the idea would require a bit more work in order to be useful, since you tend to want the result of the pre-function, in both the body and the post-function

0:42 casion: wouldn't you just use -> ->> or comp for that though?

0:42 and that's end up more readable

0:43 amalloy: $google amalloy macro writing macros

0:43 lazybot: [Clojure: macro-writing macros - amalloy - HubPages] http://amalloy.hubpages.com/hub/Clojure-macro-writing-macros

0:43 amalloy: from back when i did a brief series of blogs

0:43 SegFaultAX: amalloy: Did you happen to catch my question above? Do you have any thoughts?

0:43 Sgeo: amalloy, cool

0:45 amalloy: SegFaultAX: looks like (for [[i s] (map-indexed vector coll), [j x] (map-indexed vector s)] [x [i j]]) and some kind of reduce

0:46 SegFaultAX: I forgot about map-indexed.

0:47 ,(map-indexed (range 3))

0:47 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$map-indexed>

0:47 SegFaultAX: ,(map-indexed #(* % %) (range 3))

0:47 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox$eval102$fn>

0:47 SegFaultAX: Argh, I suck right now.

0:47 amalloy: &(reduce #(update-in %1 (fnil conj []) %2) {} (for [[i s] (map-indexed vector ["XX" XY"]), [j x] (map-indexed vector s)] [x [i j]]))

0:47 lazybot: java.lang.RuntimeException: EOF while reading string

0:47 SegFaultAX: I need sleep.

0:47 casion: ,(map-indexed #(* % %2) (range 3))

0:47 clojurebot: (0 1 4)

0:48 SegFaultAX: (doc fnil)

0:48 clojurebot: "([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."

0:49 amalloy: SegFaultAX: https://gist.github.com/b22b208d0943ef9290c7

0:49 clojurebot: eg, https://github.com/clojure/tools.logging is the new version of clojure.contrib.logging

0:50 * Sgeo decides to give everyone nightmares by just saying ~~

0:51 Sgeo: <asiekierka> Sgeo: only one level of recursion?

0:51 <asiekierka> why not make macros that write macros that write macros

0:51 <oerjan> why not make fix (macros that write)

0:51 oerjan's idea is the best

0:51 SegFaultAX: amalloy: Is fnil a new thing? I've previously been doing what you're using fnil for with get/get-in and a default value.

0:51 amalloy: &(:added (meta #'fnil))

0:51 lazybot: ⇒ "1.2"

0:52 casion: fnil is 1.2

0:52 SegFaultAX: And lots of the code I've read uses that pattern, which is why I thought it was normalish.

0:52 casion: I lose the race :(

0:52 Sgeo: ,(doc fnil)

0:52 clojurebot: "([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."

0:53 SegFaultAX: Cool! Thanks :)

0:53 (inc amalloy)

0:53 lazybot: ⇒ 31

0:53 Sgeo: ...I should learn to read scrollup someday

0:53 casion: amalloy is just some sort of clojure genie

0:56 Sgeo: amalloy, the ~'& thing seems important to know about even for macros that, say, merely write functions

0:57 amalloy: it turns out not to matter

0:57 foo/& works just as well as &

0:57 Sgeo: Oh, huh.

1:07 Hmm, defining methods on print-dup should always output code that the reader will read in as the target class, rather than code that's just a list but will evaluate to an object?

1:07 (I'm referring to the use of #= in http://amalloy.hubpages.com/hub/Dont-use-XML-JSON-for-Clojure-only-persistence-messaging

1:08 SegFaultAX: When should I be using (set coll) vs. (into #{} coll)?

1:09 Or should I always prefer (into #{} ...)?

1:09 antares_: SegFaultAX: just use clojure.core/set

1:10 SegFaultAX: So when is into appropriate?

1:10 casion: SegFaultAX: I belive (set coll) is almost always faster

1:11 SegFaultAX: (time (do (into #{} (range 1000)) nil))

1:11 ,(time (do (into #{} (range 1000)) nil))

1:11 clojurebot: "Elapsed time: 39.561528 msecs"

1:11 antares_: SegFaultAX: into is more generic: you can use it with non-empty collections and it also works for maps and so on

1:11 clojure.core/set is much more narrow in scope

1:11 SegFaultAX: ,(time (do (set (range 1000)) nil))

1:11 clojurebot: "Elapsed time: 20.569105 msecs"

1:11 SegFaultAX: antares_: Hmm, ok. Thanks.

1:12 casion: into copies everything with reduce conj

1:12 SegFaultAX: casion: conj! right?

1:12 (source into)

1:15 Sorry, closed the wrong window.

1:15 Please repeat what you said.

1:16 casion: http://clojuredocs.org/clojure_core/clojure.core/into

1:16 SegFaultAX: casion: Looks to be using conj! to me.

1:17 casion: SegFaultAX: in your example I think it's using conj

1:17 I could be incorrect

1:18 yeah, pretty sure it is

1:18 SegFaultAX: (instance? clojure.lang.IEditableCollection #{})

1:18 ,(instance? clojure.lang.IEditableCollection #{})

1:18 clojurebot: true

1:18 SegFaultAX: I see.

1:19 casion: well, I'm wrong then hah

1:19 SegFaultAX: :)

1:19 casion: I for some reason thought we were talking about vectors

1:19 it's too late for thinking clearly

1:19 Sgeo: EditableCollection?

1:19 Oh, I assume that means compatible with transientness

1:20 Not that the structure itself is editable

1:20 SegFaultAX: Sgeo: Seems like a reasonable guess to me.

1:21 Sgeo: "If a pure function mutates some local data in order to produce an immutable return value, is that ok?"

1:21 The ST monad in Haskell allows for that

1:21 SegFaultAX: So, use into when I'm copying items into an existing collection, otherwise just use the appropriate constructor function?

1:21 For some reason I thought that (into ...) was preferred.

1:24 Sgeo: ,(class {})

1:24 clojurebot: clojure.lang.PersistentArrayMap

1:24 Sgeo: ,(class (transient {}))

1:24 clojurebot: clojure.lang.PersistentArrayMap$TransientArrayMap

1:46 libier: holaaa

1:48 Sgeo: I need sleep

1:49 mpan: what does it mean that I can't resolve defn?

2:16 kryft: I'm trying to get started with clojure, and I noticed that swank is apparently deprecated with nrepl recommended instead.

2:17 Raynes: Well, your observational skills are top notch. ;)

2:17 tomoj: hmm, is there any nice way to hack on clojure itself with leiningen, since clojure doesn't have a project.clj?

2:17 Raynes: Write one, I guess.

2:18 kryft: Raynes: :D Sorry, I have a fever, so I'm not very coherent. I meant to ask whether I should go with swank anyway because all other docs still talk about swank+SLIME?

2:18 Raynes: No, go with nrepl.

2:18 And I hope you feel better.

2:19 kryft: Thanks on both accounts!

2:19 Raynes: There isn't much documentation necessary. nrepl.el's README has a list of commands.

2:19 kryft: I wonder if there's an emacs tutorial for people coming from vim who intend to use evil mode. :P

2:20 Raynes: I use evil-mode. Not really coming from Vim though. I went from Emacs to Vim for a while and then back to Emacs with evil-mode for the best of both worlds.

2:20 evil-mode is amazing.

2:21 wmealing_: how can it not be ?

2:21 kryft: Raynes: "Best of both worlds" is precisely what I'm thinking of. I really love the vim interface, but the lispy customizability of emacs is also very appealing (both for the mwahahaha the editor is my oyster and for things like SLIME)

2:21 wmealing_: Well, I was somewhat underwhelmed by viper mode back in the day

2:21 Raynes: Yeah, vimscript is a hideous fire breathing dragon.

2:23 kryft: Raynes: I take it that evil-mode works nicely with SLIME and other major modes?

2:23 Raynes: I certainly haven't had any problems with it.

2:23 kryft: Great.

2:27 Raynes: How much of vim does evil (not) implement? Did you miss anything?

2:55 vak: hi all

2:56 are there any ubuntu ppa for clojure 1.4?

2:57 scottj: vak: not that I'm aware of. most people install clojure on a per app basis using leiningen

2:58 vak: scottj: oh... isnt this leiningen also clojure-based?.. so, first I'd need clojure anyway?..

2:59 scottj: vak: when you run the leiningen install command I think it downloads clojure to run itself. you just need java installed.

2:59 TheBusby: Raynes: in the lazybot github plugin, where are you setting polling frequency?

2:59 vak: (I have two JVM implementations installed)

3:01 scottj: but then I guess, one gets an old clojure 1.1, because it is the current one in ubuntu 12 right now

3:01 scottj: vak: nah. lein will install whatever version it needs, and then when you create a project you specific which version you want in project.clj

3:02 vak: scottj: oh, sounds cool

3:06 clgv: vak: go for lein2 ^^

3:07 vak: to be more pecise lein will not only install what it needs, it installs for you the clojure version you need in the project

3:07 vak: clgv: thank you!

3:10 Kneferilis: lein new life doesn't work, I get a message: \leiningen\technomancy-leiningen-d254dae\...lein-classpath was unexpected at thi s time.

3:11 ro_st: anyone using datomic who can tell me if it's possible to identify a particular time when an attribute on an entity was a particular value?

3:12 select @time = time where version = 5; select * from entity where time = @time; to put it in sql terms

3:12 Kneferilis: in windows, lein new life doesn't work, I get a message: \leiningen\technomancy-leiningen-d254dae\...lein-classpath was unexpected at thi s time.

3:13 any ideas?

3:13 ro_st: i plan on storing version data for a git repo in datomic and i'm wondering how to query data for past versions

3:14 Kneferilis: I mean, that happens with leiningen

3:14 clgv: Kneferilis: probably faulty installation. maybe PATH issues?

3:15 Kneferilis: clgv: maybe, don't I only have to have path for wget?

3:15 clgv: Kneferilis: which IDE are you using?

3:15 Kneferilis: clgv: no IDE, I am just trying to make a project with leinengen

3:16 clgv: Kneferilis: which IDE do you plan to use? there might be a painless shortcut to your issue depending on the answer ^^

3:17 Kneferilis: clgv: I am not familiar of clojure IDEs at the moment.

3:18 clgv: Kneferilis: if you like to use eclipse you can install Counterclockwise which has builtin leiningen support and works out of the box after installing counterclockwise plugin in eclipse

3:18 Kneferilis: clgv: I can do that at home

3:19 thanks clgv

3:19 clgv: but sooner or later you will have to revisit the leiningen install when you want to build jars or uberjars of your project. that's not supported by CCW, yet

3:20 Kneferilis: but there are short howtos for setting up leiningen on windows. the only special things I remember are installing wget and setting paths

3:21 any clojure.zip expert here? I have a tree structure which I want to edit recursively but the result shall be multiple trees generated from the starting one. is that possible. currently I doubt it from what I read

3:23 tomoj: you want the changes at each loc to appear in the other locs?

3:24 clgv: tomoj: I want to do something similar to a cartesian product but on that tree

3:25 guess I have to make a 4clojure task out of it to get the most elegant solution ;)

3:26 tomoj: you can surely return multiple locs from a recursive function of a loc

3:27 clgv: well the question is, if zipeprs are the mean to express it easily. currently, I think the solution using zippers will be really complicated. but maybe I dont understand them that well

3:28 ro_st: do you want the same zipper to return multiple trees at once?

3:28 because i don't think they do that

3:28 clgv: I want a function to return all those trees at once.

3:29 ro_st: i think you'll have to compose multiple calls into the zip fns

3:29 clgv: so my guess that it would get complicated is right? ;)

3:29 ro_st: afaik, the zipper makes doing a single pass of edits and returning the combined result easy

3:30 clgv: ok. so they would be the right choice to get one edited tree

3:30 ro_st: well, if you can write the zipper fn that does one iteration, then mapping that fn over some list can't be a big stretch

3:30 yes, i think so

3:30 clgv: ro_st: the problem is that you have to return the tree and residual tree to be able do the next step

3:31 I'll try it different then

3:31 ro_st: please do take what i'm saying with a pinch of salt. i'm hardly an expert :-)

3:34 tomoj: a cartesian product of the tree with itself?

3:35 clgv: tomoj: nope the tree contains valuesets in its leafs

3:36 tomoj: interesting

3:36 clgv: I have an overcomplicated algorithm for it.

3:37 but now I changed the data representation and have to adapt it - so the thought to rewrite it more easily occured

3:42 Sgeo: Is it just me or is https://github.com/swannodette/enlive-tutorial/blob/master/src/tutorial/scrape1.clj rather non-functional

3:42 I feel like perhaps hn-headlines and hn-points should take arguments

3:42 Rather than using global variables

3:43 ro_st: it's not a global variable

3:43 it's a constant :-)

3:43 if it were production code, then it'd be an arg. but in this tut, the url will only ever be HN

3:44 Kneferilis: clgv: thanks for the help, I will try installing lein again at home, I don't know why it doesn't install correctly at work pc

3:45 Sgeo: Of course, I shouldn't be one to talk

3:46 I recently wrote a Tcl script that has 3 functions that are identical in all ways but name

3:46 clgv: Sgeo: for backup purposes? :P

3:46 Sgeo: Because I have a dispatcher that dispatches to a function named partially by ... long story

3:47 But in the case of these three possibilities, the code I need is the same

3:52 clgv: Sgeo: why not one function and three dispatcher stups that call that function?

3:52 Sgeo: Good idea, although I was thinking more "default function" because this code is sort of default, but yeah, I could do that

3:53 There are many, many other places where I need to just pull stuff out into functions

3:53 But the code is already sort of in production and hard to deploy to

3:53 (And by "production", I mean servicing one IRC channel of maybe 20 people)

4:07 tomoj: clgv: hmm, does this really work? https://gist.github.com/d46b590ea57036f41cb5

4:08 probably could be written better..

4:13 seems to be broken in the case where the root is a set

4:34 lpetit: clgv: hi

4:36 There's a new paredit command submitted. Namely "paredit splice sexpr", where "(foo (bar | baz) quux)" -> splice sexpr -> "(foo bar | bad) quux)". On OSX, it's been bound to the "Ctrl + S" keyboard shortcut. If you're using Windows or Linux, would you pleas check what an appropriate keybinding could be used?

4:43 hyPiRion: lpetit: It's already bound on M-s

4:44 lpetit: hyPiRion: oh sorry, I was talking about Counterclockwise for Eclipse.

4:45 hyPiRion: lpetit: Oh, paredit for Eclipse? Neat.

4:46 lpetit: hyPiRion: yeah. Been there since a long time. Recently Tom Hickey submitted a patch for adding one of the commands which remained to be ported : splice sexpr

4:55 Fossi: whatwherewhat?

4:55 where can i get paredit for eclipse?

4:56 ah, counterclockwise required?

4:59 lpetit: Fossi: paredit.clj is integrated in counterclockwise. Works for Clojure files in Eclipse, once you've installed paredit. Is there something preventing you from doing so?

6:14 clgv: oh it's "CCW Thursday" :D

6:15 lpetit: btw. the leiningen hooks patched worked as expected and I love the auto completion in the beta

6:16 lpetit: clgv: glad to read that :-D

6:17 clgv: lpetit: do you have a plan what needs to be done until the next stable release?

6:17 lpetit: clgv: not much. Expect the next stable release today or next thursday

6:17 clgv: lpetit: that's the kind of information I was looking for ;)

7:03 lpetiti: how did you resolve #385?

7:03 lpetit: ^^

7:05 lpetit: clgv: it's not marked as "resolved"

7:05 clgv: lpetit: ah! just listed as to do next ^^

7:20 Kneferilis: lein can't create projects at my work pc, is there another way to compile and run clojure code?

7:20 (lein outputs an error message and exits)

7:23 I mean, maybe there is a lightweight ide that allows you to write clojure code and run it?

7:26 I wil give lein a shot at my virtuabox ubuntu.

7:27 algernon: what's the error message?

7:27 ro_st: Kneferilis: light table

7:28 turnkey clojure coding

7:32 jowag: Hi, why there is a need for cljs.core.truth- in CLJS? isn't JS's "if" compatible with clojure's one?

7:35 clgv: Kneferilis: did you follow any howtos on setting it up under windows yet?

7:35 with lein 1.7 I just put the lein script in a folder alongside with wget and then added this folder to the path

7:36 after that it worked with lein 1.7 - I guess with lein2 thats similar

7:37 Kneferilis: algernon: \leiningenWorking\...lein-classpath was unexpected at this time.

7:37 ^^the error message

7:40 clgv: Kneferilis: no one cant work with that ;)

7:40 ups -t

7:42 Kneferilis: clgv: I installed wget, put wget's path to the PATH and downloaded and run lein.bat self-install

7:43 clgv: and that directly gave you that short line you posted?

7:52 Kneferilis: clgv: well, it installed then when I entered lein new project, I got that error and lein exited

7:53 clgv: there is no exception?

7:54 no stacktrace?

7:54 Kneferilis: clgv: no, that message only

7:55 clgv: so you probably get the error in the bashscript already

7:55 err bat-script

7:59 Kneferilis: clgv: I am no Windows, but I will installe lein in ubuntu and hopefully it will work

7:59 *on Windows

8:15 gerry`: hello

8:16 how to setup local git repo as dependency in lein?

8:16 or local clojure***.jar as dependency?

8:29 xeqi: gerry`: are you building clojure from source and want to use it as a dependency in lein?

8:30 gerry`: xeqi: right.

8:32 xeqi: run `mvn install` in your local clojure checkout. That will put [org.clojure/clojure "1.5.0-master-SNAPSHOT"] into your local ~/.m2 cache which lein can then use

8:32 assuming your on a recent clone

8:33 and didn't change the groupId, artifactId, or version in clojure's pom.xml

8:35 gerry`: and use [org.clojure/clojure "1.5.0-master-SNAPSHOT"] as dependency in my project.clj file?

8:36 xeqi: yes

8:36 gerry`: ok,thx

8:40 firesofmay: xeqi, will this work for other libraries as well (written in clojure)? or is this only for building clojure language itself?

8:41 xeqi, and won't this conflict if I want to use the original library as well?

8:41 xeqi: firesofmay: if the dependency is a maven or lein project `mvn install` or `lein install` will work. otherwise if you just have a free floating jar something like lein-localrepo will be needed

8:41 trying to use 2 vesions of the same library in the same project would conflict anyways

8:41 ~repeatability

8:41 clojurebot: repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability

8:42 firesofmay: xeqi, i mean in different projects. if i want to test my new version in a new project and still use old version in other project i.e.

8:43 xeqi: firesofmay: that works fine. The jars end up in ~/.m2 under a groupid/artifactid/version scheme

8:44 firesofmay: xeqi, okay thanks for answering.

8:44 xeqi: so as long as you don't use install a jar with the same version as an already installed jar, the ~/m2 cache has both

8:45 firesofmay: xeqi, okay.

8:49 gerry`: xeqi,it works,thx.

9:18 mpan: I'm quite happy. I've finished my first school project using Clojure and it went mostly OK.

9:18 Thanks for your help, everyone!

9:22 lnostdal: hi guys, there was a new book/pdf on functional programming posted (reddit? clojure group?) recently, but i can't seem to find it .. anyone remember?

9:23 algernon: lnostdal: "Functional Programming for the Object Oriented Programmer" ?

9:23 clgv: lnostdal: the one from brian marick?

9:23 algernon: if so, https://leanpub.com/fp-oo

9:27 lnostdal: yes, that was the one i think .. ty .. anyone read it yet?

9:30 clgv: didnt he say that it's not ready yet? just preview version?

9:31 firesofmay: lnostdal, I read the first chapter, liked his style.

9:31 lnostdal, as a newbie to clojure, I was able to understand what reader is properly. Didn't read after that.

9:32 lnostdal: ok

9:32 clgv: so it is ready?

9:33 *complet

9:33 firesofmay: clgv, its still going through revisions/modifications, but one can read it, it has enough material to read about.

9:34 chronno: Not yet, from leanpub link: "The book is roughly 80% finished."

9:34 clgv: thx

9:45 octagon: hi, i'm curious why (symbol "#foo") does not produce an exception or error? also is there a built-in function to test whether a string can be converted to a valid (readable) symbol?

9:47 S11001001: octagon: symbol->string conversion and vice versa is isomorphic (i.e. roundtrippable), notwithstanding meta; making that be an error would throw out that nice property. No.

9:48 chouser: it's just a shame there's no readable version of such symbols

9:48 S11001001: octagon: the solution, as chouser alludes, is to make all symbols roundtrip through pr/read (again notwithstanding meta)

9:48 octagon: S11001001: you mean (= (str (symbol x)) x) must be true for all strings x?

9:48 S11001001: octagon: aye

9:49 octagon: S11001001: why is that an important property? it's not obvious to me.

9:50 S11001001: octagon: if you're working with data, and in some situations you need it in one form, and in some another, you know you can apply isomorphisms willynilly, secure in the knowledge you're not throwing out data

9:53 octagon: many other invariants arise; for example, given any isomorphism "iso", (= (iso x) (iso y)) *if and only if* (= x y).

9:53 octagon: S11001001: Interesting, thanks, especially the last example.

9:55 AWizzArd: In one of my projects I have multiple input formats for data. I want to compile them all into separate modules. Will I need N (Leiningen 2) project.clj files when I want to produce N jars? Or can I instruct Leiningen to compile N .clj source files each into their own single .jar?

9:57 gtrak: (karma nrepl.el)

9:58 hyPiRion: $karma nrepl.el

9:58 lazybot: nrepl.el has karma 1.

9:58 gtrak: quick poll, is switching to nrepl.el worthwhile atm if you're used to swank? I see the swank-clojure github recommends it.

10:03 clgv: AWizzArd: uhh, that crying for a custom leiningen task. dont you think?

10:03 chouser: AWizzArd: or perhaps you can have N profiles instead?

10:05 clgv: chouser: with filters on the source files?

10:06 chouser: yeah, I don't know if it would work, just an idea I've been meaning to eventually explore.

10:07 clgv: otherwise a leiningen task with :data-format-files [ ... ] should be possible anyway

10:07 if the other idea fails, I mean

10:08 cemerick: AWizzArd: Yes, multiple profiles will work (probably with an alias as well, so as to make the `lein` incantation to run all of them easy to remember).

10:09 AWizzArd: Here's a real-world example, FWIW: https://github.com/cemerick/friend/blob/master/project.clj

10:09 chouser: ^^

10:09 gtrak: hoow the heck do I use nrepl.el with a lein project?

10:10 cemerick: gtrak: M-x nrepl-jack-in

10:10 hyPiRion: gtrak: install nrepl as written on the github repo, and run nrepl-jack-in

10:10 gtrak: I get REPL started; server listening on localhost port 45228 \n Exception Unsupported option(s) supplied: :headless clojure.core/load-libs (core.clj:5293) \n clojure.core=>

10:11 ah, do I need to add it to the project deps?

10:11 chouser: cemerick: ah, neat.

10:11 cemerick: gtrak: sounds like an old rev of lein? What version are you using?

10:11 gtrak: 1.7.1

10:12 cemerick: You need to be on a v2.x preview.

10:12 at least AFAIK, anyway

10:13 gtrak: I see

10:15 so I'd need a little plugin or something if I wanted to use it.

10:22 mpenet: Is there a slime-compile-defun equivalent available in nrepl ?

10:23 from looking at the readme it seems not

10:23 (C-c C-c in slime)

10:24 AWizzArd: cemerick: good idea, thanks.

10:25 chouser: also thanks for the idea :-)

10:25 mpenet: C-M-x seems quite similar, minus the flashing + output target I believe, anyway, I just need to try it once again

10:27 clgv: someone should start writing a bookchapter about leiningen configuration ;)

10:27 * clgv didn't know :aliases before

10:30 naeg_: what's the difference between * and *'?

10:32 cemerick: clgv: Leiningen could easily be its own book at this point.

10:32 TimMc: It doesn't need one, luckily.

10:32 clgv: cemerick: I didn't dare for that statement so I chose the chapter ;)

10:32 cemerick: Though http://clojurebook.com *does* cover the basics of Leiningen. :-)

10:33 TimMc: Dunno about that. It's a remarkably flexible and capable, but there's a *ton* of knobs.

10:35 TimMc: Hmm, are Clojure and Lein books "complements", economically?

10:35 The author of a Lein would want Clojure info to be as available as possible, and vice versa, since each adds value to the other.

10:35 OE: Raynes: do you have any usage examples for irclj before I dive into it?

10:36 cemerick: A Leiningen book would be even less economically viable than a Clojure one. I imagine it'll be years before we ever see one, if ever.

10:36 * cemerick can't type reasonable sentences, apparently

10:37 clgv: could be an open book, though.

10:38 cemerick: open book?

10:38 xeqi: is there a wrap-escape-params middleware for ring yet?

10:38 `fogus: Right. I'd pay for a LeanPub Lein book

10:38 weavejester: xeqi: What would wrap-escape-params do?

10:38 AWizzArd: `fogus: is Marginalia already compatible with Leiningen 2?

10:39 clgv: cemerick: I mean someone starts a documentation project where others can participate.

10:39 cemerick: clgv: I think you mean https://github.com/technomancy/leiningen/tree/master/doc :-P

10:39 Of course, pull reqs welcome :-D

10:40 clgv: cemerick: well, if it were complete you wouldnt need that book ;)

10:40 cemerick: Perhaps.

10:40 clgv: but for basic needs it's pretty good

10:41 cemerick: It's a poor book that can be replaced with technical documentation though, even good stuff.

10:41 xeqi: weavejester: html escape them so I wouldn't need to (h ...) all over the place and open an XSS attack when I forgot

10:41 possibly with a (raw ...) for the underlieing param

10:41 sorta like http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/

10:42 TimMc: xeqi: You're talking about html-escaping querystring parameters as they come in? :-/

10:42 weavejester: xeqi: That wouldn't be Ring, that would be Hiccup. The problem is that would require a fairly major redesign of Hiccup, which is ongoing but not finished.

10:43 Hiccup currently outputs things directly as strings, which is fast but can't distinguish between values and HTML code produced from other HTML functions.

10:43 xeqi: TimMc: pretty much yes

10:43 weavejester: To solve that, the compiler needs to be redesigned to output a DOM

10:44 Which would be slower, but I think I'm resigned to that.

10:44 xeqi: weavejester: heh, I was trying to avoid that. I figured html escaping the params in a middleware would cover %95 of my cases

10:44 ... 95%

10:45 though for clojars I guess alot of the strings pushed through the UI do come from the FS instead of params

10:45 Kneferilis: hello, is there a package like XAMMP for clojure?

10:45 weavejester: But surely you only want to html-escape your params when they're inserted into the HTML

10:45 Kneferilis: I admit that I will try lein in ubuntu at home, I was just wondering.

10:49 xeqi: hmm, perhaps you're right

10:49 even doing (raw ..) for things like putting in a db, won't help on the otherside

10:49 scriptor: Kneferilis: I don't think so, at least haven't heard of anything bundled up like that

10:50 Kneferilis: scriptor: ok

10:52 rodnaph: hi - does anyone know of any tools for producing code coverage reports for clojure code?

11:00 jaley: guys - is this an idiomatic way to implement a producer/consumer style queue? https://www.refheap.com/paste/4903

11:00 I got the query-and-alter fn from a planet.clojure.com blog. I'd be surprised if there's not a more straight-forward way of doing it...?

11:02 rodnaph: jaley: i did a similar thing recently just doing first/rest in a dosync - https://github.com/rodnaph/weare/blob/master/src/weare/jobs/core.clj#L18 - not sure how idiomatic/correct it is tho

11:03 jaley: rodnaph: won't you potentially process a job many times if the transaction is retried?

11:05 rodnaph: jaley: ... hmmm yes, this is what i was worried about, ack...

11:06 TimMc: xeqi: You really, really don't want to encode early.

11:07 abalone: is LightTable open for people to write plug-ins ? or is that for later ?

11:07 TimMc: xeqi: Amusing consequence from a former place of employment: http://community.crutchfield.com/search/SearchResults.aspx?q=amp

11:08 weavejester: If only String could carry metadata...

11:09 uvtc: TimMc: ouch. :)

11:11 TimMc: And there's nothing like a JSON API spewing HTML entities.

11:12 seneth: Has anyone moved from a staticaly typed language to clojure and now wishes clojure would have types and all good things that come with them?

11:13 jaley: seneth: yes, I particularly miss painting myself into a corner every day :)

11:13 rodnaph: seneth: did u see this https://github.com/frenchy64/typed-clojure

11:13 nDuff: seneth: Given as there are people working on Typed Clojure, the answer is pretty obviously yes, some such people exist.

11:22 TimMc: seneth: Sure. I miss having static typing every time I end up passing a value of the wrong type through a chain of 5 functions, then spend 20 minutes adding preconditions to everything.

11:25 S11001001: ! Array(1,2,3): Array[Unit]

11:26 wrong chan...

11:35 clgv: seneth: seldom. I wished in the first months with clojure. but that wish vanished over time

11:36 I wonder if typed-clojure will be continued after GSoC

11:43 algernon: clgv: considering GSoC pencil's down already happened, and the repo still has comits - I'd think it is safe to say: yes, it will be

11:44 clgv: algernon: I know that GSoC officially ended. we'll see whether it continues to something usable...

11:45 algernon: clgv: it's also the subject of his dissertation, so I expect it will evolve into something usable :)

11:47 clgv: ah good ^^

11:55 klang: starting at https://github.com/quephird/mixing-java-and-clojure a "lein170 uberjar" will give the expected result, but creating the uberjar with lein200 will result in a ClassNotFoundException where java complains about not being able to find main .. I have overlooked something ..

11:58 raek: klang: that is a lein 1.x project. you can run the "lein200 precate" plugin on it to see what you need to change in order to make it a lein 2.x project

11:58 zakwilson: http://pastebin.com/auqEvM7J <-- I found this Sobel edge detection library on pastebin and can't find it anywhere else. Does it belong to anybody here?

11:59 cemerick: I thought I saw something go by about :require-macros not being necessary anymore…not so, I guess?

11:59 jcromartie: Could not transfer artifact net.sf.json-lib:json-lib:pom:2.4 from/to central (http://repo1.maven.org/maven2): Checksum validation failed, no checksums available from the repository

11:59 raek: in this case I think it's the :java-source-path "src/java" that needs to be changed into :java-source-paths ["src/java"]

11:59 jcromartie: should I use a different repo?

12:01 cemerick: jcromartie: if that project doesn't publish checksums, then you'll need to disable checksum verification for the repo in question

12:01 klang: raek: thanks, that gives me some straws to pull.

12:04 jcromartie: cemerick: and how do I do that when using leiningen?

12:06 mpenet: jcromartie: there is an example here https://github.com/mpenet/tardis/blob/master/project.clj

12:07 that's with lein2

12:07 not sure it works the same way with 1.7*

12:08 klang: raek: that precate plugin really is invaluable! wow!

12:11 technomancy: lein1 doesn't really care about checksums

12:11 jcromartie: if a project is missing checksums be sure to open a bug report

12:14 heh; the first comment on Marick's book is someone asking him to re-write it in scala... https://leanpub.com/fp-oo

12:14 yacin: i've been away from clojure for a bit but is defnk still around? i'm not sure how to find replacements after the restructuring of clojure-contrib

12:15 deeplloyd: hi all

12:15 S11001001: yacin: defnk is useless now

12:15 yacin: oh?

12:15 S11001001: yacin: read up on the latest improvements in destructuring

12:15 yacin: defnk is now an advertisement against language design by popularity contest

12:16 clgv: yacin: defnk was for keyword args?

12:16 raek: ,((fn [& {:keys [a b]}] (+ a b)) :a 1 :b 2)

12:16 clojurebot: 3

12:16 clgv: yacin: you can check if that lib fits you: https://github.com/guv/clojure.options

12:17 raek: yacin: ^

12:17 yacin: raek: ah interesting. i imagine having defaults is less simple?

12:17 haha, thanks everyone

12:17 most helpful irc channel

12:18 cemerick: technomancy: leave it to the internet

12:18 clgv: yacin: defaults is messy by adding an :or {:a 10, :b 12} or such ^^

12:19 technomancy: cemerick: "I like your book; could you write a different one for me?"

12:19 raek: yacin: you can have defaults like in ordinary map destructuring: {:keys [a b], :or {a 1, b 2}}

12:19 clgv: oops. symbols ^^

12:19 raek: ,((fn [& {:keys [a b], :or {a 1, b 2}}] (+ a b)))

12:19 clojurebot: 3

12:22 * djanatyn is building up a personal library to use in his statistics class

12:22 yacin: raek: thanks!

12:23 djanatyn: is there a non alpha-numeric character I can use as the function #(float (/ % %%))?

12:25 raek: djanatyn: are you asking for another way of writing (fn [x y] (float (/ x y)))?

12:25 djanatyn: I'm asking if there's something convenient I could defn that to

12:26 I need to use that in the repl frequently

12:26 right now I'm using a function called #'$

12:26 is there a way to override #'/ behavior?

12:26 I'm in a seperate namespace.

12:27 hyPiRion: (ns namespace (:refer-clojure :exclude [/])) ... (defn / ...)

12:28 It's still available as clojure.core//

12:28 djanatyn: thanks

12:29 hyPiRion: djanatyn: By the way, you know about incanter, right? Just in case you want some statistics library to work with.

12:29 djanatyn: hyPiRion: I've tried getting incanter to work on windows without much luck

12:30 clgv: djanatyn: what failed?

12:30 hyPiRion: Are you using leiningen?

12:30 djanatyn: clgv: mongodb, I think

12:30 hyPiRion: yes. I'm sorry, I can't run lein right now; the school network has a lot of restrictions and will probably not let lein through

12:30 clgv: djanatyn: oh, never used it with incanter

12:31 djanatyn: even clojure.org is blocked :P

12:31 technomancy: I can't believe incanter declares a dependency on mongo =\

12:31 hyPiRion: I didn't even knew it did, I must've used an old version when I used it.

12:31 technomancy: I guess maybe because it was created before the "complected" keynote? =)

12:32 clgv: technomancy: well it did not in a pre clojure 1.3 version.

12:32 djanatyn: I'll work on getting Incanter running when I get home; I've wanted to try it out for a while

12:32 technomancy: ah! no excuse then

12:33 hyPiRion: What would Incanter use mongo for anyway?

12:33 technomancy: you're probably safe declaring an :exclusion on the offending mongo dep

12:33 hyPiRion: In-memory db?

12:33 clgv: but it had an annoying dep on parallelcolt which I never used but whose classes where used in core

12:34 hyPiRion: access for datasource, I guess

12:34 hyPiRion: hm, now I got curious.

12:37 Needed for incanter-mongodb. So I believe it's safe to exclude it if you're not using that package.

12:37 djanatyn: emacs is a *really* nice environment for a statistics class

12:37 clojure file on top, repl on the bottom left half, and org-mode buffer for notes on the bottom right half

12:38 tanzoniteblack: djanatyn: interesting to note that you're on irc and don't mention it in that list...

12:39 djanatyn: for IRC I'm using a web based ssh client, shellinabox

12:39 our school won't let you connect to irc network ports, so I have my irc client on another box.

12:40 hyPiRion: I suppose you could tunnel it over https.

12:40 TimMc: djanatyn: Can you SSH?

12:40 S11001001: djanatyn: freenode offers stacks of alternate ports

12:41 Narvius: Hello, I have a question about seesaw.

12:42 The standard Clojure proxy has an implicit "this" for the fns defined in the proxy, but using "this" in conjunction with seesaw tells me there is no such thing as "this".

12:43 So; How can I refer to the object itself from within a listener function in seesaw?

12:43 TimMc: djanatyn: Never mind, misunderstood.

12:44 djanatyn: TimMc: Not really; I'm actually running a web server on my host that spits out a web interface when you connect with a browser :) (shellinabox)

12:45 anyway, back to clojure! so I can just exclude mongodb in my project.clj file when installing incanter with lein?

12:46 S11001001: Narvius: paste?

12:47 Narvius: Pretty much just (progress-bar :listen [:mouse-pressed (fn [e] (.setValue this 50))]).

12:49 Well, I guess I'll work around it by calling (listen) afterwards and using closures.

12:49 hyPiRion: djanatyn: Yep - it will only kill the incanter-mongodb namespace.

12:54 clgv: djanatyn: you can only install the single subprojects of incanter that you really need. e.g. for me this is incanter-core and incanter-charts

12:59 xeqi: TimMc: heh, yeah I decided it was a bad idea. Even just the inconsitencies of whats escaped vs not-escaped would be annoying

12:59 wonder if I could do something to https://github.com/weavejester/hiccup/blob/master/src/hiccup/util.clj#L19 and make it work, worth experimenting with later

13:14 ohpauleez: cemerick: Thanks for the contributions!

13:25 thorbjornDX: has anyone had to deal with really slow repl performance before?

13:33 jcromartie: thorbjornDX: when does it get slow?

13:33 thorbjornDX: because it's usually perfectly snappy until you run up against JVM memory limits

13:34 thorbjornDX: jcromartie: I've found it giving me input latency when typing (2-3 seconds sometimes)

13:34 n4irc: I'm having difficulty getting leiningen 1.7.1 to start on Opensuse 12.1. It used to work, but now I get numerous problems loading, etc. as seen at http://pastebin.com/UKUJYu9a.

13:34 jcromartie: thorbjornDX: that's definitely odd… what OS/JVM?

13:34 n4irc: Does anyone know what the fix is, it used to work, and I didn't make any intentional changes.

13:36 on a side note leiningen 2.0 worked fine when I tried it but I've got a project (twitter storm) that is not 2.0 compatible I need to build.

13:36 thorbjornDX: jcromartie: jre 1.6.0_33-b04, rhel 4 update 8

13:37 jcromartie: thorbjornDX: and how are you running the repl?

13:37 thorbjornDX: jcromartie: 'lein repl'

13:37 technomancy: n4irc: did $CLASSPATH get set maybe?

13:38 thorbjornDX: jcromartie: using "1.4.0" in my project.clj

13:39 jamieorc: looking for a lightweight way to strip all html from a given String and return only the text

13:42 n4irc: technomancy: Interesting, unset CLASSPATH and then lein appears to help. If lein is so sensitive to user's CLASSPATH and it wants to set it itself, why doesn't it just unset that value in the script or clobber it with the desired value?

13:42 technomancy: n4irc: well... as you may have noticed that's fixed in 2.0 =)

13:42 it's just that 1.x is quite old

13:42 TimMc: like, *weeks* old

13:42 ancient :-P

13:42 technomancy: scores of weeks!

13:43 n4irc: technomancy: It looks like my last message was garbled. I fixed my version of 1.7.1

13:44 technomancy: n4irc: it's a shame that storm requires 1.x; I wonder if there's any reason preventing them from upgrading

13:45 oh, that's silly; it looks like they just haven't bothered to run precate on it yet

13:45 the heck, guys

13:45 thorbjornDX: jcromartie: could this be an issue of running in a vm?

13:46 jcromartie: thorbjornDX: it could be

13:46 thorbjornDX: however my Ubuntu VM is faster when running Clojure than the Mac OS X host!

13:46 thorbjornDX: what is your memory setup?

13:47 technomancy: thorbjornDX: is this lein2? is `lein trampoline run -m clojure.main/main` also slow?

13:47 thorbjornDX: jcromartie: about 3GB

13:47 technomancy: sorenmacbeth: hey, do you work on storm?

13:47 russfrank: learned clojure, now trying to learn scheme.. its much harder

13:48 n4irc: technomancy: storm appears to have a pull request in to do this. Our group is more of a storm user than core storm developer.

13:48 technomancy: n4irc: oh, cool

13:49 thorbjornDX: technomancy: that seems a bit faster, but I don't have a good benchmark really

13:49 (I'm pprinting a hash-map :P)

13:49 technomancy: thorbjornDX: there were some bugs involving memory usage with tons of output in the repl that should be fixed in preview10

13:51 llasram: Is there an nrepl client + integration for vim yet?

13:51 thorbjornDX: technomancy: 'lein repl' slams my cpu to 100% and uses up about 100MB from what I can see

13:51 llasram: Not that I touch the stuff myself. It's for a co-worker

13:51 thorbjornDX: technomancy: when I run a pprint, I get the same type of cpu usage

13:52 technomancy: llasram: supposedly in-progress

13:52 bordatoue: hello

13:52 paxan: noob question: how do I execute midje test fixture straight from Emacs (using nrepl thingie)

13:52 ?

13:52 tanzoniteblack: thorbjornDX: does it slam your cpu if you do it in a non-project folder (i.e. lein doesn't load any other files)

13:52 yanne: technomancy: is the vim-nrepl supposedly in-progress in public?

13:52 llasram: Yeah, everything I'm seeing with the google is from several months ago. Maybe I'll just talk him into switching to Emacs

13:53 bordatoue: could anyone tell me how to load clojure.contrib.repl-utils and invoke the function show from repl

13:53 technomancy: yanne: couldn't tell you, sorry

13:53 all I know is it uses haskell

13:53 llasram: wheeeee

13:53 bordatoue: i am using clojure.1.3 , it seem to fail to load repl-utils

13:53 thorbjornDX: tanzoniteblack: when loading the repl? yes

13:53 bordatoue: will IllegalstateException

13:53 llasram: ~contrib

13:53 clojurebot: Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

13:54 llasram: ^^ bordatoue

13:54 bordatoue: then the question is which of these small libraries has show functions in it

13:54 technomancy: llasram: supposedly lein-tarsier is the way to go currently

13:54 bordatoue: show is in clojure.repl IIRC

13:55 amalloy: technomancy: i don't think it exists anymore

13:55 closest is clojure.java.reflect/reflect

13:55 thorbjornDX: is there a way to tell lein which java to use? I want to try the (old) system java

13:55 llasram: technomancy: Ah, thank you

13:56 thorbjornDX: just modify $PATH?

13:56 amalloy: thorbjornDX: LEIN_JAVA_CMD

13:56 thorbjornDX: amalloy: thanks :D

13:56 bordatoue: technomancy: it is not in clojure.repl

13:56 technomancy: oh, bummer.

13:56 bordatoue: what is happening with the show

13:57 thorbjornDX: amalloy: that worked, but I guess java 1.4.2 is a bit too out of date

13:57 bordatoue: amalloy: what was wrong with show that it was removed

13:57 amalloy: thorbjornDX: 1.5+

13:57 * technomancy reminds himself to port the slime inspector to nrepl

13:57 bordatoue: please help where can i find show function

13:57 ispolin: llasram: there's also a nailgun server plugin for lein. Haven't tried getting it to work over a network yet though: http://bit.ly/uoBsDh

13:58 bordatoue: i don't think i will make it

13:58 amalloy: bordatoue: on irc, it's rude to ask the same question once a minute. if someone has help, they will answer the first instance, when they get around to it

14:00 bordatoue: app http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Goologise for that

14:00 thorbjornDX: weird, I had a rogue ipython process taking up 17% of my RAM

14:02 llasram: bordatoue: I believe amalloy answered your question already, actually. "closest is clojure.java.reflect/reflect"

14:03 sorenmacbeth: technomancy: I've made some code contributions, and I use it, yeah. What's up?

14:04 bordatoue: llasram: where is it mentioned based on the above link it says clojure.contrib.repl-util is migrated to clojure.repl , how did you know that show function is deprecated , is it documented any where.

14:04 sorenmacbeth: technomancy: (that was in response to your q about Storm)

14:04 bordatoue: amalloy: appologies for the rudness

14:04 technomancy: sorenmacbeth: just wondering if there were any specific blockers around lein2 support

14:05 sorenmacbeth: technomancy: Ok, I'll take a look and see. I'll ask Nathan as well

14:05 technomancy: eh; just curious if you knew off the top of your head

14:05 lein1 is really starting to show its age

14:06 sorenmacbeth: yeah, there are a bunch of projects that I'd like to move over the lein2 actually.

14:06 llasram: bordatoue: Migrated apparently doesn't necessarily mean migrated entirely. I don't know why it was rejected, but you can get most of the same functionality from `reflect`, or add it to a personal utility library if you want exactly what it provided

14:06 technomancy: sorenmacbeth: definitely interested in hearing if you run into any issues with that; trying to make the migration path as smooth as possible

14:06 thorbjornDX: `lein help` takes almost 20 seconds, is that normal?

14:07 bordatoue: thanks llasram

14:07 technomancy: thorbjornDX: if you have a lot of plugins and a slow drive it's possible

14:07 it has to load every single task, so it's the slowest of all possible lein tasks

14:08 sorenmacbeth: technomancy: looking at the project.clj, I don't see any reason it couldn't be moved to lein2.

14:08 thorbjornDX: technomancy: no plugins, I guess nfs could slow me down

14:08 technomancy: thorbjornDX: yeah, it's all IO-bound

14:08 sorenmacbeth: I just recently moved `lein` on my dev box to point to lein 2 to encourage me to update my old code

14:08 Kneferilis: hello

14:08 now at home pc I managed to install and create a project on Win 7 64bit and on Ubuntu 11.01

14:09 *11.10

14:09 with lein

14:09 my question now is, how do I run this project?

14:09 for linux, better, because I want to learn more for Linux

14:11 tanzoniteblack: Kneferilis: within the terminal, you should be able to run "lein run" in the directory lein created for the project to run it

14:11 Kneferilis: or is there something else you meant?

14:12 Kneferilis: tanzoniteblack: yes, thanks, that was what I meant

14:12 now I am getting error No :main namespace specified in project.clj

14:12 technomancy: Kneferilis: it doesn't really make sense to run a newly-created project

14:12 it's not going to do anything

14:13 Kneferilis: technomancy: how do I make my project to print out Hello World!

14:13 ?

14:13 tanzoniteblack: Kneferilis: if you're just starting with clojure, it might make more sense to run "lein repl"; this will pull up a repl that you can use to experiment with clojure a bit

14:14 technomancy: agreed; repl's a better place to start

14:14 at some point you'll want to read through `lein help tutorial`

14:15 Kneferilis: yes, thanks, I am using repl now

14:15 technomancy: thanks

14:15 * tanzoniteblack needs to remember to read that himself, rather than the ad-hoc way he's been learning it

14:17 ispolin: llasram: my bad, i'm also using lein-tarsier now. Apparently i switched over to it at one point and completely forgot that i did X_X

14:17 llasram: ispolin: Ha! No problem. :-)

14:19 thorbjornDX: what's the best way to return a nested hash-map with a few keys dissociated (down a few layers)?

14:20 technomancy: thorbjornDX: (update-in my-map [:key1 :key2] dissoc :key3 :key4)

14:20 amalloy: (update-in m [a b c] (dissoc x y z))

14:20 er, but like technomancy said instead of me

14:20 thorbjornDX: ,(doc update-in)

14:20 clojurebot: "([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."

14:21 thorbjornDX: cool, thanks technomancy, amalloy

14:27 dysinger: anyone here experienced with Jackson Mapper? I created a gen-class which I thought I had working yesterday. Today I'm stumped. Jackson won't load it https://www.evernote.com/shard/s17/sh/59e3893e-7f39-4687-9767-3d30fe07d282/cd395acb15e4351f4e72314b5d63a26a but clojure and javap do just fine https://www.evernote.com/shard/s17/sh/29c6a25e-ad1b-4e48-830c-03a99e27e744/6696b91c0fbbcdc35ced971174821ca2

14:27 https://www.evernote.com/shard/s17/sh/c55027ce-4236-4c3d-8b88-e396753b2e8c/ea113e6df06b5ec61a6e08668832c49c

14:29 S11001001: dysinger: yeah, I've jackson mapped; you might need to load the class yourself before dropping to jackson

14:29 dysinger: Cripes ok

14:32 nickmbailey: jk:q

14:32 oops, not vim

14:34 dysinger: emacs, not vim

14:34 casion: if I have a seq of vectors of < n size, what's would perhaps be the best way to right align them into a lazy-seq of vectors of n-size?

14:35 chouser: map

14:35 concat

14:35 casion: say turn ([2 3] [3 4 5] [1 2 3 4] [1 2]) into ([0 0 2 3] [0 3 4 5] [1 2 3 4] [0 01 2])

14:35 chouser: repeat

14:36 do you know the max width initially, or must the input seq be fully realized to figure that out and return the first output vector?

14:36 casion: chouser: I know the max width. It's always 4 actually

14:37 chouser: (map #(concat (repeat (- 4 (count %))) %) input) ;untested

14:37 (map #(concat (repeat (- 4 (count %)) 0) %) input) ; still untested

14:38 amalloy: i kinda like ##(for [coll '([2 3] [3 4 5] [1 2 3 4] [1 2])] (take-last 4 (concat (repeat 4 0) coll)))

14:38 lazybot: ⇒ ((0 0 2 3) (0 3 4 5) (1 2 3 4) (0 0 1 2))

14:38 amalloy: not efficient for sure

14:39 casion: thank you for the idear

14:39 ideas*

14:41 I think perhaps this is the wrong way to approach the problem. I'm trying to fill a java.nio.ByteBuffer with padded values so I can reliably .getInt on the buffer

14:41 working with variable bit rate audio files to convert to a stream of floats

14:42 chouser: casion: is .putInt on the ByteBuffer the wrong thing?

14:42 dysinger: p

14:42 casion: chouser: yes, I don't have the int to put

14:43 I just get a byte-stream that I need to convert to ints then divide by 0x7fffffff

14:44 it's much simpler when working with linear PCM because I always get to know how big each frame is, but with variable bit rate, I get frame size on the fly

14:45 so I have to pad it then feed it into a ByteBuffer… I think

14:45 maybe there's another approach, but that's how you deal with it in C (except you just have a byte->float function)

14:48 jparishy: Hi, so if I implement a java interface using gen-class, how do I instance it? For example, if I do so with a :name of TestClass, and then in the same file I run (TestClass.) I get a class not found exception

14:49 chouser: jparishy: you have to AOT compile your .clj file that contains gen-class

14:50 jparishy: Ahh. This I did not know, thanks

14:50 chouser: That's one of the reasons to use things other than gen-class, when possible. For implementing a Java interface I'd recommend reify or deftype.

14:56 nathanic: hello folks, is anyone around here familiar with running their own lazybot? i've been trying to run my own instance from github and it always gets a ping timeout after about 4 minutes.

14:57 llasram: jparishy: As far as I can tell, the need-to-AOT-the-file thing is an implementation detail rather than a necessity. If you check out https://github.com/llasram/shady, I have a version of gen-class which hooks into the dynamic classloading features used by deftype and reify

14:58 jparishy: Although I still ditto the advice on avoiding gen-class when you can

14:58 jparishy: k, I'm looking into using deftype instead

14:59 appreciate the knowledge and help :)

14:59 technomancy: use reify if you can

15:04 antares_: dakrone: hey

15:14 jparishy: technomancy: By using reify do I lose having a named class?

15:15 technomancy: yeah, sadly

15:16 chouser: technomancy: why reify over deftype?

15:17 technomancy: deftype doesn't play nicely with reloading

15:19 jparishy: So trying to use reify like the docs say gives me "Parameter declaration reify should be a vector" and google can't find that string :S

15:20 llasram: jparishy: That error means you have a `defn` where you forgot the parameter vector

15:20 jparishy: Ah never mind, me being silly

15:20 Yeah :p

15:20 llasram: Clojure has some funny ways of saying things :-)

15:20 jparishy: Mentioning the reify through me off

15:21 threw*

15:21 llasram: Oh, I think it's a terrible error. The eye jumps to the called out value ("reify") vs the context which expresses the common error pattern

15:22 You really don't care what you had there instead of a parameter vector, just that you didn't have one

15:22 jparishy: Erm. Hm, so can reify not define new methods on the class that aren't defined in the interface it's trying to implement?

15:22 Yep exactly

15:23 llasram: jparishy: That is a feature/limitation of both `reify` and `deftype`

15:23 jparishy: Haha.. well can reify implement more than one interface?

15:23 llasram: Yep!

15:23 dnolen: jparishy: yes, and protocols too.

15:23 jparishy: Okay, so I guess that works

15:36 dnolen: cemerick: http://github.com/emezeske/lein-cljsbuild/issues/134 should probably be a ClosureScript ticket.

15:52 xeqi: weavejester: first approximation to safe strings: https://www.refheap.com/paste/4910; over compensates for html5, javascript-tag, etc. Can you think of any other problems?

15:52 edw: Has anyone tried deploying a webbit-based (WebSockets) app to Heroku? My Clojure app runs fine locally but takes down Safari when I try to use the Herokuinstance

15:52 .

15:52 cemerick: dnolen: Yeah, I see emezeske's comment. I'll see about scrubbing together a patch.

15:54 weavejester: xeqi: Well, if you have a (html …) inside a (html …) then it obviously won't work

15:55 xeqi: But if you can avoid that...

15:55 xeqi: heh, that would break it

15:55 weavejester: The only 100% solution is to use DOMs not strings

15:59 TimMc: weavejester: What if intermediate Hiccup outputs were boxed Strings (say, RawHtmlStrings) and any normal Strings were HTML-escaped?

15:59 pandeiro: weavejester: it is not possible to do something like (context "/api" request (let [foo (get-something request)] (GET "/bar" [] "Baz"))) right?

15:59 b/c context and whatnot are macros, not fns?

16:00 i was wanting to apply a (content-type "application/clojure") to every resp to the routes under my "/api" context...

16:00 weavejester: pandeiro: It is. They're macros but not magic. They all return functions.

16:01 xeqi: TimMc: thats the direction I was thinking as well, but could be missing something

16:02 weavejester: TimMc: You'd need a final outer part to convert it back into a string, and it would impact speed. I suspect that if we're going to solve the html-escaping problem, the best approach is to do it properly rather than trying to patch the existing code.

16:02 TimMc: and then relying code could say (raw foo) to bypass escaping.

16:02 weavejester: pandeiro: If you have more than one route, be aware that let only returns the last element

16:02 pandeiro: So you'd need (let […] (routes …))

16:02 TimMc: weavejester: Conversion of a RawHtmlString to HTML output would be a single dereference.

16:02 pandeiro: weavejester: ah so it won't work

16:03 yes, (routes...) got it

16:03 weavejester: pandeiro: Or (let-routes […] ...)

16:03 TimMc: I probably don't know enough about Hiccup's architecture.

16:04 weavejester: TimMc: You'd need to concatenate RawHtmlStrings though, which might be slower than a StringBuilder.

16:04 xeqi: heh, forgot String was final for a moment, subclassings out

16:04 pandeiro: weavejester: didn't know about let-routes

16:05 weavejester: pandeiro: It's a common operation, so there's a macro for it. Like defroutes is just (def … (routes …))

16:06 pbostrom: edw: I tried to deploy an aleph/websockets app to Heroku a few months ago, at the time Heroku did not support websockets, not sure if that's changed since then

16:07 weavejester: In general, my thought is that if we're going to write a Hiccup 2.0.0, it should be more than a rough patch of the existing code.

16:09 sproc: Shouldn't the size of new features drive version numbers rather than the other way around?

16:11 xeqi: breaking backwards compatibility should; and if you're going to do that, might as well do the right thing then a hack

16:11 S11001001: sproc: that would have a very unfavorable outcome from users' perspective

16:14 odd: probably a newbie question, but is there any way of "undefinining" an interface or protocol after it has been defined in the working namespace?

16:16 amalloy: no

16:17 sproc: "It's time for 2.0. Let's think of a big juicy feature to include."

16:17 odd: if you have wrongly defined it as an interface and you want to redefine it as a protocol with the same name... you have to clear the whole namespace and start over then?

16:17 dnolen: odd: hmm I wouldn't think so.

16:18 TimMc: sproc: The idea is that if you're going to make *one* breaking change, it's a good time to make a bunch of them.

16:18 sproc: Hopefully they were already on the to-do list though.

16:19 chouser: a protocol is kept in a var, isn't it? if co, it could be unmapped.

16:20 odd: well, it seems as if you define an interface, its name no longer refers to a var, and as such it cannot be rebound or changed in any way.. at least no way I am aware of. But I am a beginner in Clojure (although having a bit of experience with CL)

16:21 danielglauser: Stupid Emacs question, how do you comment out a function?

16:21 uvtc: M-;

16:21 odd: also, if you run ns-interns, the names of your interfaces are not shown in the resulting map

16:21 uvtc: danielglauser: Oh, whoops. That's to comment out the current region.

16:22 danielglauser: uvtc: Figured that out thanks. That works for me! I can highlight a function

16:22 chouser: oh, once you've defined an interface you may have trouble. I don't know how to get rid of an interface without exiting the JVM

16:22 odd: chouser: that's what I was afraid of.

16:22 S11001001: let's tangle clojure nses into classloader trees!

16:22 TimMc: danielglauser: #_ in front of it :-)

16:22 llasram: Aren't definterface and protocol interfaces loaded via DynamicClassloader ?

16:23 TimMc: +1

16:23 (inc TimMc)

16:23 lazybot: ⇒ 15

16:23 llasram: even

16:23 dnolen: odd: chouser: but it shouldn't matter for interactive dev I think if you switch to a protocol, since you're going through the protocol and not the interface.

16:23 odd: chouser: could be wrong about that ...

16:23 chouser: ah, that does seem likely.

16:24 odd: dnolen: well, problem is, once defined as an interface, you *cannot* reuse the name to define a protocol. You will have to name it something else.

16:24 dnolen: odd: hmm, that may be true - I don't use definterface much.

16:25 odd: dnolen: ok. It's not a serious problem. I am just learning the language and thought I might have missed some obvious way of doing it.

16:26 dnolen: odd: ah yeah I just tried at REPL, using definterface and then defprotocol w/ the same name does blow up.

16:27 sproc: /part/

16:28 edw: pbostrom: Yeah, that seems to (still) be the case. The answer, it seems, is to use Pusher.

16:28 gtrak: what's it mean on var-set "the var must be thread-locally bound"?

16:29 S11001001: gtrak: you have a binding on it

16:29 ,(doc binding)

16:29 clojurebot: "([bindings & body]); binding => var-symbol init-expr Creates new bindings for the (already-existing) vars, with the supplied initial values, executes the exprs in an implicit do, then re-establishes the bindings that existed before. The new bindings are made in parallel (unlike let); all init-exprs are evaluated before the vars are bound to their new values."

16:29 gtrak: oh ok

16:29 odd: dnolen: it's interesting to note, though, that if you define a *protocol*, its name *does* show up among interned symbols, and I guess it would be no problem to unintern it. Interfaces do not even show up among interned symbol. So I guess they are a somewhat different beaste entirely.

16:31 22:26 <odd> dnolen: it's interesting to note, though, that if you define a *protocol*, its name *does* show up among interned symbols, and I guess it would be no problem to unintern it. Interfaces do not even show up among interned symbol. So I guess they are a somewhat different beaste entirely.

16:31 oops, sorry

16:31 cemerick: are cljs tests really supposed to be run against v8 master?

16:31 pbostrom: edw: I went the path of least resistance (for me): lein on an AWS micro instance

16:31 cemerick: er, trunk I suppose?

16:31 dnolen: cemerick: you can select a tag if you like, but yes I just test against master.

16:32 edw: pbostrom: Did you use webbit?

16:32 dnolen: cemerick: also it's best to test against SpiderMonkey & JavaScriptCore as well.

16:32 pbostrom: edw: no, aleph

16:32 edw: Ah.

16:32 It's all Netty down below...

16:33 cemerick: And here I thought I was some minutes away from uploading a patch. :-|

16:35 dnolen: seems like this is all begging to use selenium (or webdriver anyway)?

16:38 dnolen: cemerick: http://github.com/clojure/clojurescript/wiki/Running-the-tests

16:38 cemerick: not sure why we need to involve a web browser at all for most tests. For browser REPL might be useful.

16:40 cemerick: dnolen: It's an easy way to automate the whole thing, and eliminates a contribution hurdle.

16:41 The same thing can be accomplished by automating setup of v8, SM, and JSC, but far more work that way.

16:42 dnolen: cemerick: if you can put something together I'll check it out.

16:45 cemerick: dnolen: We'll see what comes together. I'll be a bit though, I can't justify digging into it just for CLJS-373. Would using lein be acceptable?

16:48 dnolen: cemerick: I don't see any issues with lein project.clj if it makes contributing easier. But seriously I wouldn't bother unless it really actually makes it easier. If the user has to go and download all three browsers anyway I don't really see the point.

16:50 cemerick: dnolen: The typical cljs contributor probably has all three (or, two anyway, since safari isn't available for windows anymore?) anyway. If they don't, installing a browser's a lot easier than cloning and building three different js engines.

16:50 dnolen: cemerick: you only need to build V8.

16:54 cemerick: but as i said if you have a solution that can easily use the browsers already on a users machine - I'm all for it.

17:01 cemerick: dnolen: is a stack trace on SM expected? JSC tests clean.

17:01 dnolen: cemerick: all tests in all engines should pass

17:01 cemerick: (this is with my changes stashed, clean from master)

17:05 ah, didn't notice the test-compile script :-P

17:06 bobbywilson0: ,(max (map #(reduce + (take 4 %)) '((0 1 2 3 4)(5 6 7 8 9 10))))

17:06 clojurebot: (6 26)

17:06 bobbywilson0: I want 26 :(

17:06 er expect* 26

17:07 cemerick: If only there was some kind of convention for building and testing a codebase…

17:07 bobbywilson0: ,(max (6 26))

17:07 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

17:07 bobbywilson0: ,(max [6 26])

17:07 clojurebot: [6 26]

17:07 technomancy: cemerick: crazy idea; it'll never work.

17:07 hyPiRion: bobbywilson0: ##(reduce max [6 26])

17:07 lazybot: ⇒ 26

17:08 tmciver: ,(apply max [6 26])

17:08 clojurebot: 26

17:08 bobbywilson0: hyPiRion: ahhh, I guess I assumed that max was doing an apply/reduce like thing

17:08 tmciver

17:09 thanks

17:09 hyPiRion: ahh, where is that apply vs. reduce comment

17:10 tmciver: hyPiRion: is reduce preferred there for some reason?

17:11 bobbywilson0: hyPiRion: this? http://stackoverflow.com/questions/3153396/clojure-reduce-vs-apply I was actually just looking at it in another tab

17:12 hyPiRion: It was an irc comment made by rhickey in 2010, still relevant.

17:12 bobbywilson0: hyPiRion: ah ok, don't have that then :)

17:12 hyPiRion: Well, wherever it is - prefer reduce when you can, unless when you're concatenating strings.

17:13 ,(time (apply + (range 100000)))

17:13 clojurebot: "Elapsed time: 165.123472 msecs"

17:13 4999950000

17:13 hyPiRion: ,(time (reduce + (range 100000)))

17:13 clojurebot: "Elapsed time: 146.009283 msecs"

17:13 4999950000

17:13 dnolen: cemerick: I'm not sure what test-compile does, I only run ./script/test

17:13 cemerick: hah

17:14 thorbjornDX: if I want something like a matrix (multidimensional vector), should I use Incanter? Or can I use some other structure

17:14 duck11232: apply + does reduce + under the covers, so all apply + gives you is more overhead

17:14 cemerick: dnolen: well, everything passed, and things look good in my interactive testing, so I'm calling it good. :-)

17:14 dnolen: cemerick: cool!

17:15 gfredericks: ,(time (loop [x 0, ns (range 100000)] (if (seq ns) (recur (+ x (first ns)) (rest ns)) x)))

17:15 clojurebot: "Elapsed time: 61.059024 msecs"

17:15 4999950000

17:15 gfredericks: duck11232: ^ interesting that apply + doesn't use loop instead

17:16 hyPiRion: duck11232: apply using reduce under the covers? err.

17:16 duck11232: The vararg form of + uses reduce

17:17 hyPiRion: Ahh.

17:18 ,(time (apply str (range 1000000)))

17:18 clojurebot: "Elapsed time: 472.430258 msecs"

17:18 "01234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571...

17:18 hyPiRion: ,(time (reduce str (range 1000000)))

17:18 I believe apply will be faster here.

17:18 clojurebot: Execution Timed Out

17:20 amalloy: the answer to "should i use reduce or apply, in a scenario where they give the same results" is "it doesn't matter, just pick one"

17:24 gtrak: is there like an inherit-fixtures for clojure.test?

17:26 gfredericks: amalloy: obviously there should be a stateful function that tries reduce and apply a few times each and tracks the execution times and eventually settles on the faster one

17:32 nz-: anybody know how to setup externs with clojurescript?

17:33 nDuff: nz-: Using cljsbuild?

17:33 nz-: yes

17:33 I have <script src="http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.js" type="text/javascript"></script>

17:33 nDuff: Okay. And you've written an externs file for it?

17:33 nz-: yes

17:34 but the location of the file is the problem. where to put it?

17:34 nDuff: :cljsbuild { :builds [{ :compiler { :externs ["path/to/your/externs.js"] } }] }

17:34 I put it in src/main/externs/ myself, but then, I'm following Maven conventions for this project (don't ask).

17:36 hyPiRion: Aha!

17:37 amalloy: http://clojure-log.n01se.net/date/2009-01-12.html#13:48

17:38 nz-: that helped some

17:39 do I need to make also externs file for my cljs code

17:40 now it complains about ruuvi_ui.app.load_page(); that should correspond to (ruuvi-ui.app/load-page)

17:41 it says that ruuvi_ui is undefined

17:42 jkkramer: a

17:47 SegFaultAX|work2: I'm getting that weird timeout issue on 4clojure again.

17:48 It takes forever to start running the tests, but then by the time it gets to the last unit test, it timesout.

17:51 nz-: and my load-page looks like this: (defn ^:extern load-page [] ...)

17:54 works fine without compiler optimizations

17:55 odd: (whois sonkey)

18:00 nz-: seems that I have undeclared forward references. cljs compiler doesn't complain about then without optimizations and the thing works

18:01 is there a way to make cljsbuild to give error these kinds situations?

18:06 AntelopeSalad: does anyone have a good book on functional programming that isn't necessarily tied into clojure or any 1 language?

18:07 jcromartie: AntelopeSalad: SICP, or The Little Schemer

18:07 tied to Scheme though

18:07 but SICP will really make your head spin

18:07 AntelopeSalad: thanks

18:07 jcromartie: there are some great "eureka" moments in it

18:08 like when they demonstrate that if you have closures, you don't need data structures :)

18:08 there's a new build of SICP out there too

18:08 AntelopeSalad: is the one on github worth reading?

18:08 or should i stick to the old one released from mit

18:08 nz-: fixing the forward references does not help

18:10 jcromartie: http://sicpebook.wordpress.com/

18:10 (that's the one on github)

18:10 AntelopeSalad: ok thanks

18:12 nz-: nDuff: externs seems to work if I put the extern file to closure-js/externs directory

18:12 nDuff: no need to add stuff to project.clj

18:12 jcromartie: ,(every? even? [])

18:12 clojurebot: true

18:12 jcromartie: I guess so...

18:13 nDuff: nz-: *shrug*. I've preferred to consider closure-js to be a build artifact, cleanable and rebuildable at will.

18:16 nz-: https://github.com/emezeske/lein-cljsbuild/issues/95

18:19 are there any tools to create extern file from a javascript lib?

18:21 gf3: sjl: Ping

18:21 muhoo: /sb end

18:23 nDuff: Huh. java.util.Collections$EmptySet isn't seq-able?!

18:23 cpinera: Hi all. Has anyone had any experience running ritz-nrepl? I must be missing something in my Emacs setup, because I cannot seem to be able to reach the debugger at all.

18:25 nDuff: ...no, (seq java.util.Collections/EMPTY_SET) works fine...

18:25 seancorfield: How solid is nrepl.el / ritz-nrepl? Is it ready for prime time yet or is it just a lot of "peer pressure" to move to it b/c swank-clojure is no longer being maintained?

18:26 technomancy: eh; swank isn't broken

18:26 nDuff: ...but when a 3rd-party library returns #< java.util.Collections$EmptySet$1@3b2601c>, not so much.

18:26 technomancy: if you need a debugger or inspector, you probably shouldn't switch yet

18:26 seancorfield: but nrepl.el has a nice ido-var-browse thing that slime lacks =)

18:26 seancorfield: 'kthx technomancy i genuinely wasn't sure how far along ritz was

18:26 technomancy: sometimes I fall back to slime for the inspector though

18:26 clojurebot: slime-install is an automated elisp install script at http://github.com/technomancy/emacs-starter-kit/blob/2b7678e9a331d243bf32cd8b591f826739dad2d9/starter-kit-lisp.el#-72

18:26 technomancy: geez

18:27 seancorfield: oh, I'm talking about nrepl.el specifically

18:27 I haven't used ritz but expect it's a bit further along

18:27 clojurebot: forget slime-install |is| an automated elisp install script at http://github.com/technomancy/emacs-starter-kit/blob/2b7678e9a331d243bf32cd8b591f826739dad2d9/starter-kit-lisp.el#-72

18:27 clojurebot: I forgot that slime-install is an automated elisp install script at http://github.com/technomancy/emacs-starter-kit/blob/2b7678e9a331d243bf32cd8b591f826739dad2d9/starter-kit-lisp.el#-72

18:28 technomancy: do us all a favour and pretend it never happened, k?

18:28 seancorfield: yeah, i sort of view nrepl.el + ritz as a package since i do rely on the debugger and i'm happy with slime/swank and jack-in / slime-connect right now

18:28 technomancy: ritz was designed to be used with slime

18:28 originally

18:28 seancorfield: i haven't converted my team to emacs yet (i know, heathens!) so it's not really an important decision for us yet...

18:29 technomancy: shouldn't need to get everyone to agree

18:29 wait are you guys still on lein1?

18:30 llasram: Well, it helps with getting people up to speed. I've got several new people getting going at my job too, and it'd be nice to present a uniform common toolset for people to start with

18:31 technomancy: it helps to have someone who knows where their towel is, or several people who know where various assorted towels may be found

18:31 certainly less knowledge redundancy with a shared toolset =)

18:31 llasram: Oh, not complaining. Just er. Ok, I guess it was close to complaining :-). I'm advising people to use nrepl.el, but haven't switched yet myself because I don't want to restart Emacs

18:32 technomancy: that's an excellent excuse

18:32 seancorfield: technomancy: no we moved to lein2 for everything - hence my attempts to get lein-daemon working with lein2

18:33 technomancy: oh right

18:33 dnolen: cemerick: patch applied to master, thx!

18:33 cemerick: dnolen: great, thanks :-)

18:34 thorbjornDX: I have a lein question, I'm trying to add a dependency to my project, so I put [org.clojure/math.combinatorics "0.0.2"]. When I launch a repl it says that it can't find its __init.class. Do I have to take another step to install it?

18:36 technomancy: thorbjornDX: what did you try in the repl?

18:36 seancorfield: thorbjornDX: did you (require 'clojure.math.combinatorics) in the repl first?

18:36 thorbjornDX: technomancy: nothing, actually, I modified one of my source files to require clj.math.combo, and that's the one that I have set up as :main

18:37 `lein repl` immediately gives me a stacktrace

18:37 technomancy: the require form is probably wrong

18:38 thorbjornDX: technomancy: (:require math.combinatorics) ?

18:38 oh, I probably need a 'clojure' in there somewhere

18:40 seancorfield: technomancy: fixed, thanks

18:43 seancorfield: yay! glad you got it working... what are you using combinatorics for? always curious what folks are using mark's math libs for...

18:45 thorbjornDX: seancorfield: generating tiles using cartesian-product

18:48 antares_: why didn't I discover cheshire.custom before. Best of both cheshire and data.json's extensibility.

18:49 Frozenlo`: cemerick: As usual, excellent job with the podcasts! I really appreciate to hear the various clojure's voices :D

18:56 nDuff: Should I be doing something simpler rather than (reduce into [#{} some-set some-seq]) to get a set containing the members of some-set and some-seq?

18:56 (feels wrong, but can't quite put my finger on it...)

18:57 technomancy: why not plain into?

18:57 antares_: ,(into #{} [1 2 3])

18:57 clojurebot: #{1 2 3}

18:57 antares_: ,(set [1 2 3])

18:57 clojurebot: #{1 2 3}

18:57 technomancy: (into some-set some-seq)

18:58 nDuff: Hmm -- "why not" is a good question.

18:58 Ahh -- some-set can potentially be nil

18:59 technomancy: just call set on it first

18:59 antares_: ,(set nli)

18:59 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: nli in this context, compiling:(NO_SOURCE_PATH:0)>

18:59 antares_: ,(set nil)

18:59 clojurebot: #{}

18:59 nDuff: ahh!

19:02 amalloy: technomancy: i think (set some-large-other-set) is expensive

19:02 in the same way that (vec some-large-vector) is expensive

19:02 technomancy: boo

19:02 well, or then

19:03 antares_: amalloy: is a couple of hundreds of elements large?

19:04 raek: (into (or some-set #{}) some-seq)

19:05 frio: antares_: my guess is no, but i don't know what the logic is there

19:05 * frio has a horrible memory of a similar case where the merge was O(n**3) of DB queries...

19:06 aperiodic: amalloy: why can't it just check if the argument is already a set/vec, and return it if so?

19:06 TimMc: nDuff: fnil

19:06 err, I'm being silly

19:07 Oh, and raek already gave the right answer. :-)

19:10 pobody: hello all, is anyone in here familiar with running a lazybot instance?

19:11 brehaut: ~anyone

19:11 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 ..."

19:11 casion: that would have be so much better coming from lazybot

19:11 brehaut: im pretty sure Raynes knows something about it

19:12 pobody: i thought he might :-) but i wasn't sure if he'd be around

19:13 brehaut: you could also try #flatland perhaps?

19:13 pobody: brehaut: thanks for the idea

19:18 weavejester: Is there something in Clojure that can take a set of promises and return the first one delivered a value?

19:18 Kinda like a "select"

19:19 Urthwhyte: filter and take first?

19:20 weavejester: I mean like the C select function. Something that tells me which promise is delivered to first.

19:20 wmealing_: weavejester: i love the idea

19:20 weavejester: i just can't think how to implement it

19:20 nDuff: Why not just have one promise?

19:20 technomancy: seems like you could make a promise-like macro that delivered to a shared promise first and block on that

19:20 * nDuff nods.

19:21 nDuff: Also curious about the use case, and how it varies from a case where a traditional queue is appropriate.

19:21 hiredman: 1.4 lets you pass in a timeout to deref

19:21 so you could use that and a loop to roll your own

19:22 ,(doc delivered?)

19:22 weavejester: I was considering using HTTP async to query many URLs at once, and didn't want to start a thread for each.

19:22 clojurebot: No entiendo

19:22 SegFaultAX|work2: (doc deref)

19:22 clojurebot: "([ref] [ref timeout-ms timeout-val]); Also reader macro: @ref/@agent/@var/@atom/@delay/@future/@promise. Within a transaction, returns the in-transaction-value of ref, else returns the most-recently-committed value of ref. When applied to a var, agent or atom, returns its current state. When applied to a delay, forces it if not already forced. When applied to a future, will block if computation not complete. When applied to

19:22 nDuff: weavejester: What do you do with the results from the others? Are they eventually processed?

19:23 weavejester: nDuff: Yep

19:23 nDuff: weavejester: ...sounds like the right abstraction is a queue, rather than a series of promises.

19:23 weavejester: Yeah, but http.async.client returns a promise

19:23 nDuff: Ahh.

19:24 hiredman: does it return a real promise, or just something like a promise?

19:24 it might return something you can attach callbacks to

19:25 tanzoniteblack: Question about nrepl for you guys. If I load a very large map into memory (~6 gigs) and want to refresh nrepl to clear the memory (not important to me if the functions and such I have loaded get kept around). Is there a better way than just closing out the nrepl buffers and restarting them?

19:26 weavejester: hiredman: Looking at the source now...

19:27 hiredman: whatever http.async.client is built on definitely supports some kind of callback on the futures it returns

19:30 weavejester: hiredman: It does. But http.async.client seems to abstract that away. I think this is the first time I've seen a Clojure library that's less useful than the Java library it wraps, but maybe I'm being unkind.

19:30 hiredman: weavejester: *cough* really the first time you say?

19:31 weavejester: hiredman: Did you have another library in mind?

19:31 hiredman: no

19:31 just lots and lots of wrappers everywhere

19:31 weavejester: Usually they're all pretty good, though :)

19:32 At least the ones I've used are.

19:32 Oh wait, looks like there are callbacks… I think...

19:32 djanatyn: hmm. I'm having trouble writing a function that determines if whatever you pass it is divisible by several numbers

19:34 frio: what are you doing djanatyn?

19:34 i can think of how to solve that easily, but idk what the clojure for it would be :)

19:34 djanatyn: well, I'm trying to show my brother, who asked a question :)

19:34 weavejester: ,(div 8 2)

19:34 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: div in this context, compiling:(NO_SOURCE_PATH:0)>

19:35 djanatyn: he was wondering if every composite number was divisible by 2, 3, 5, and 7

19:35 frio: (any (eq 0) (map #(modulo numerator) denominators)) is roughly what id do

19:35 djanatyn: s/and/or

19:35 frio: but idk what the actual clojure names/libraries/etc. are :)

19:35 weavejester: Well, there's mod, but I thought there was also a div

19:35 tomoj: just show him 11*13?

19:35 tanzoniteblack: ,(every? #(= 0 (mod 8 %)) '(2 4))

19:35 clojurebot: true

19:36 djanatyn: tomoj: it's cooler to run a functino over a big list to demonstrate why programming is cool ;)

19:36 tanzoniteblack: ,(every? #(= 0 (mod 8 %)) '(3 4))

19:36 clojurebot: false

19:36 frio: ah - % is an argument to a lambda in clojure?

19:37 (i thought it had some special syntactical meaning, which is why i didn't reach for it for expressing modulo :p. /notes down)

19:37 tanzoniteblack: frio: more specifically % is an argument to a lambda in clojure that's created by the #() method

19:37 groovemonkey: beginner question: if I have (def mappy {:one []}), I can add to the vector inside with (conj (mappy :one) :something). But if it's (def mappy (ref {:one []})), how do I do it?

19:37 S11001001: frio: %? it does in some contexts, as tanzoniteblack says

19:37 frio: cool tanzoniteblack, thanks

19:38 djanatyn: tanzoniteblack: I like that solution :) thanks!

19:38 the every? function is cool.

19:38 tanzoniteblack: frio: we could also write that as ##(every? (fn [n] (= 0 (mod 8 n))) '(2 4))

19:38 lazybot: ⇒ true

19:38 S11001001: groovemonkey: it's complicated.

19:38 weavejester: It looks like there are callbacks in http.async.client.request

19:38 S11001001: groovemonkey: are you a clojure beginner, or clojure intermediate just starting with STM?

19:39 weavejester: I kinda wish that it used something other than promises by default though

19:39 groovemonkey: S11001001: somewhere in between

19:39 right now I'm fiddling around with various combinations of (dosync (alter mappy conj....

19:40 S11001001: groovemonkey: alright, well if you want to mess with refs now, go look up longer documents on dosync usage

19:40 groovemonkey: S11001001: roger.

19:40 tomoj: weavejester: already rejected aleph?

19:40 frio: tanzoniteblack: if you don't specify an argument, is it implicit/does clojure do partial application? (ie. in haskell I can do map ((+) 1) myList for incrementing)

19:41 weavejester: tomoj: Actually, I forgot aleph had a client side

19:42 zerokarmaleft: when i call gen-class, if i set :extends or :implements does that class/interface automatically get imported into the ns?

19:42 S11001001: groovemonkey: at this point I will note that I was on a small team maintaining a large (few hundred source files) clojure app, for which we used, maybe, 8 refs total, and I mean live instances of ref; we weren't as a rule particularly attached to immutability, it was just easier

19:42 tomoj: a request returns an async result, to which can attach callbacks

19:42 s//you/

19:43 tanzoniteblack: frio: as far as I know, there's no implicit arguments unless you use "partial".

19:43 ,(map (partial + 1) [1 2 3])

19:43 clojurebot: (2 3 4)

19:44 frio: OK, cheers tanzoniteblack

19:44 groovemonkey: S11001001 OK, so maybe refs are the wrong thing. I'm just looking for a place to keep a player's inventory for a small game.

19:44 djanatyn: haha, I don't think my brother enjoyed that snippet of code as much as I did

19:44 thanks, tomoj :)

19:44 groovemonkey: S11001001: it's just nested maps

19:45 weavejester: tomoj: Yeah, I might go with Aleph. Channels should be pretty nice in this case.

19:46 S11001001: groovemonkey: then perhaps the functions that need to update inventory, should include an inventory->inventory function in their result, and at the loop level you could run all these functions before continuing? Or they could just include the updated inventory in their return values.

19:46 zerokarmaleft: generate-class is a hairy method O.o

19:49 groovemonkey: S11001001: thanks, I'm going to rethink this tomorrow. It's almost 2AM here, so I'm just going to make things worse if I keep going now :-D. I'll try your advice tomorrow -- thanks!

19:50 weavejester: Hm, I'm assuming the Lamina function "join" joins two or more channels together, but there's no docs and no docstring

19:51 Frozenlo`: I'm getting a weird error since yesterday when trying to start a cljs browser repl: Uncaught TypeError: Cannot call method 'appendChild' of null. Rings a bell for anyone?

19:52 It happens only when I have the browser.repl/connect in my cljs file. (Which I have reduced to the bare minimum)

19:53 Frozenlock: Here is the part of js where Chrome and Firefox choke https://www.refheap.com/paste/4917

19:56 This is my punishment for rebooting my machine. Must never do it again.

20:04 thorbjornDX: how do I use '->' when I need to pass multiple arguments?

20:05 scottj: thorbjornDX: be more specific? (-> 1 (+ 2 3 4 5))

20:06 thorbjornDX: scottj: I have a fn that takes two arguments, and I want to do (-> 3 4 myfn myotherfn myfn)

20:07 scottj: ofc that doesn't work

20:07 scottj: I'd want the equivalent shorthand for (myfn (myotherfn (myfn 3 4)))

20:08 scottj: thorbjornDX: (-> 3 (myfn 4) myotherfn myfn)

20:08 thorbjornDX: scottj: ah, okay

20:13 fenton: when i use (clojure.java.io/resource "test.txt") in my clojure library, java using the jar complains: FileNotFound... does this have something to do with using the wrong ClassLoader?

20:15 antares_: fenton: more likely with what directories you have on classpath

20:17 fenton: antares_: this works fine: InputStream stream = this.getClass().getClassLoader().getResourceAsStream("test.txt");

20:17 antares_: the file IS in the root of my clojure library...

20:17 antares_: fenton: try with a clojure.lang.DynamicClassloader instance

20:18 fenton: antares_: could u elaborate a tad more...sorry clojure newbie here...

20:18 antares_: fenton: I am not sure Leiningen includes repository root to the classpath

20:18 fenton: replace this.getClass().getClassLoader(). with clojure.lang.DynamicClassloader()

20:18 new …

20:19 thorbjornDX: scottj: I ended up requiring my functions to take a vector as their argument, it suited my problem better

20:19 antares_: fenton: it's not a bad idea to use :resource-paths (lein2) and a separate directory: https://github.com/michaelklishin/pantomime/blob/master/project.clj#L8

20:19 fenton: antares_: sorry, the thing i said works, was java code calling from my java program...it works okay...just when i try to find the file from within the library itself is there an issue.

20:19 antares_: fenton: how do you run your Java program?

20:20 it may be that classpath is set differently from how Leiningen does it

20:20 fenton: antares_: at the moment just inside Eclipse for testing.

20:20 antares_: Eclipse definitely can have different defaults w.r.t. repository root from Leiningen

20:21 fenton: antares_: well the file is right there smack dab at the root of the jar...

20:22 seems when the java code calls into the clojure code, the clojure loses it...

20:22 antares_: fenton: you can check that hypothesis by using a clojure.lang.DynamicClassloader instance

20:23 fenton: antares_: so use that from inside the clojure library?

20:24 antares_: fenton: from your Java program that has clojure jar available to it

20:24 this is what Clojure typically uses and I guess io/resource can use it, too

20:25 fenton: ok let me give it a whirl, I'll report back later...mom has shown up for dinner same time! :)

20:35 ivan: zakwilson: "lozh: wondering if I can optimize this any further: original: http://clojure.pastebin.com/7fczyeXy optmizied attempt: http://clojure.pastebin.com/auqEvM7J java version (2000 times quicker) http://pastebin.com/BECUCmqH ."

20:35 https://github.com/lozh

20:36 the magic of googles ;)

20:44 jhowarth: I have several functions I want to apply to a map and return an array of the results. Right now I am doing (map (fn [f] (f item)) [f1 f2 f3 ...]). Is there a more idiomatic way of doing this in clojure?

20:44 amalloy: &(doc juxt)

20:44 lazybot: ⇒ "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"

20:44 jhowarth: thanks

20:48 amalloy: ~juxt

20:48 clojurebot: juxt is a little hard to grok but it's the best thing ever

20:48 amalloy: clojurebot: regale me with more tales of juxt

20:48 clojurebot: Huh?

21:06 Hodapp: okay... I see that Leiningen automagically downloaded a bunch of dependencies, but I don't know where the hell it put them so that I can set up my class path in IntelliJ accordingly

21:06 blarg

21:07 mthvedt: i haven't had much luck with intellij+clojure

21:07 Hodapp: IntelliJ + Clojure seems okay - can get to a REPL and everything

21:07 I also installed the Leiningen plugin and I have no idea how to get to it from the IDE

21:08 but it's running fine from the commandline

21:08 gfredericks: why does lein-cljsbuild need to run in a "subproject"? what does that even mean?

21:08 antares_: Hodapp: lein1 puts them to ./lib, lein2 to ~/.m2/repository

21:09 gfredericks: I used it as a regular lein plugin, w/o any subprojects

21:09 Hodapp: ahhh, I kept looking for ~/.lein-somethingorother

21:09 thanks

21:09 antares_: Hodapp: you can make recent IDEA versions download deps from Maven

21:09 it's a little hard to find but it is somewhere on the Libraries "tab" in your project settings

21:09 gfredericks: antares_: I'm wondering wrt https://github.com/emezeske/lein-cljsbuild/issues/132#issuecomment-8286371

21:10 antares_: it is also a bit slow (well, Maven search is)

21:10 but that's what I use for key dependencies

21:10 Hodapp: right now, I don't know much about leiningen and I'm trying to work with quil, so I am just sticking with their given procedures

21:12 hmm, but does ~/.m2/repository do my any good for a classpath when they're all in separate dirs?

21:14 maybe I should just use Emacs... or ignore IntelliJ...

21:15 xeqi: gfredericks: the "subproject" is a misnomer. The eval-in-project reference means it runs with the classpath for the project, instead of say, the classpath for leiningen

21:15 gfredericks: xeqi: but also that it runs as a separate process I presume

21:15 xeqi: atm yes

21:15 gfredericks: and this has to be done because lein's classpath won't have all the sources and whatnot on it

21:16 xeqi: well, to keep leiningen and the project seperate

21:16 Frozenlock: AAAAAAAH I'm such an idiot! An entire evening wasted because I was including my js before my page body!

21:16 gfredericks: I still don't understand why emezeske says you therefore can't set dynamic vars...why couldn't you (eval-in-project '(binding [*some-var* some-value] ...))?

21:17 Frozenlock: May my suffering be useful to others...

21:17 gfredericks: Frozenlock: I meant to tell you not to do that

21:17 Frozenlock: gfredericks: I know, right? Sheesh

21:17 Hodapp: https://github.com/derkork/intellij-leiningen-plugin/issues/11 gaaah

21:18 this is why I sometimes want to stab IDEs in the face.

21:18 xeqi: Hodapp: in general emacs and eclipse w/ counterclockwise have the best support, followed by vim, followed by a large large gap

21:18 Hodapp: I see

21:19 what do you prefer?

21:19 if I switch from vim to emacs, don't I have to go be re-baptized or something?

21:19 Frozenlock: Yup.

21:19 xeqi: I use emacs, but I wouldn't tell you to do that if you aren't used to it

21:20 Frozenlock: But you don't want to go to Hell, do you? Thus you must be baptized.

21:20 xeqi: vim is decent I hear. lein-tarsier is suppose to make it easier to use clojure

21:20 though its outside of my perview

21:21 Frozenlock: Well at least Emacs is in emacs-LISP, and clojure is a LISP. There is some similarities if you intend to customize it.

21:21 Hodapp: thanks, I will check some of these out

21:21 Emacs is one of those programs I never learned further than C-x C-c.

21:22 mthvedt: i use vim and tarsier, works like a charm

21:22 brehaut: Frozenlock: elisp is regular lisp with a prion disease though

21:22 xeqi: gfredericks: hmm, I would lean towards yes, but I don't understand anything about the cljs compiler. also I've only written one eval-in-project plugin and I forgot how it worked...

21:23 kovasb: https://github.com/richhickey/edn

21:23 Frozenlock: brehaut: prion?

21:23 kovasb: edn is landing

21:23 brehaut: Frozenlock: its a protein that when it binds with an existing protien creates more of itself. causes mad cow disease

21:24 gfredericks: xeqi: okay I'll leave a reply to the comment and see what he says

21:24 brehaut: Frozenlock: some people like to tell horror stories about chicken nuggets carrying prions

21:24 Hodapp: I'll check out vim-tarsier. As much as I like Eclipse for Android development, I think I might like to stay initially clear.

21:25 cgag: vim and tarsier is solid

21:25 Frozenlock: brehaut: yeah thanks about that, now I won't be able to eat chicken :P

21:25 cgag: occasionally i consider doing emacs + evil

21:25 Hodapp: I feel like a great many of the features Eclipse provides that speed up Java development are unnecessary when you are using a more dynamic / less dynamic but better-statically-typed / more concise language.

21:26 brehaut: Frozenlock: best not google the chicken nugget making machine

21:26 Frozenlock: Must... stop... myself...

21:26 Hodapp: and with that, I'm out! enjoy your talk about... food-borne illnesses and editors

21:26 antares_: are there any options for generating and parsing XML better than data.xml?

21:26 Frozenlock: Oh Nova, why do you hate my eyes? http://www.pbs.org/wgbh/nova/madcow/prions.html

21:46 If I watch an atom from another namespace in cljs, do I need to use ^export or something like that?

21:46 gfredericks: I wouldn't think so

21:48 duck1123: wouldn't you only need export if you wanted to access it from js?

21:48 gfredericks: exactly

21:48 if the name of the var of the atom gets munged, so should your use of it somewhere else

21:49 duck1123: munging doesn't take care of accessing it as an array, does it?

21:50 I haven't been able to get advanced mode working for me. I tried last night, but I rely on too many closure-unfriendly libs

21:51 Frozenlock: I tried to rely entirely on closure library for this reason. Sometimes I wonder if it's really worth all the trouble.

21:51 duck1123: I'm using Knockout, Jquery, and Backbone

21:52 frio: from cljs duck1123?

21:52 duck1123: yes

21:52 frio: interesting

21:52 (those are libraries i typically rely on too; i haven't tried cljs yet)

21:53 duck1123: https://github.com/duck1123/jiksnu/tree/pending/src-cljs/jiksnu

21:54 Frozenlock: duck1123: GPL and Bitcoins? Man, I love you :p

21:54 duck1123: still heavily in flux. I just recently got into KO

21:54 lol

21:55 bobbywilson0: what is the major problem with this?

21:55 ,(defn chew [series] (println (reduce * (take 4 series))) (chew (rest series)))

21:55 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

21:56 bobbywilson0: I get a stack overflow :-( but I didn't think I would with `rest`

21:56 xeqi: bobbywilson0: chew calls chew. how does it know to stop?

21:56 bobbywilson0: xeqi: uhhh, when it hits nil?

21:57 duck1123: If you want TCO, use recur

21:57 bobbywilson0: duck1123: I don't necessarily care about TCO just trying to learn stuff now

21:57 xeqi: I guess I need a condition?

21:57 metellus: ,(rest nil)

21:57 clojurebot: ()

21:57 metellus: ,(rest '())

21:57 clojurebot: ()

21:58 bobbywilson0: so the problem is just that it will call chew on (rest nil) indefinitely I take it?

21:58 xeqi: bobbywilson0: you need an (if (not (empty? series)) ...) type condition yes

21:58 Scriptor: recur is specifically for TRO, though, just tail recursion

21:58 xeqi: yep

21:58 duck1123: (defn chew [series] (when (seq series) (println (reduce * (take 4 series))) (recur (rest series))))

21:58 Scriptor: (seq (rest '()))

21:58 ,(seq (rest '()))

21:58 clojurebot: nil

21:59 zakwilson: ivan: thanks.

21:59 ivan: np

21:59 bobbywilson0: you guys are the best! I appreciate it. not a lot of other language rooms like this

22:02 Frozenlock: Oh sure, use `def-' Frozenlock, and then wonder why your code doesn't work.

22:02 I'm pretty sure there was only coffee in this mug.

22:03 duck1123: I'm sure we've all been there

22:11 jcromartie: ,(doc =)

22:11 clojurebot: "([x] [x y] [x y & more]); Equality. Returns true if x equals y, false if not. Same as Java x.equals(y) except it also works for nil, and compares numbers and collections in a type-independent manner. Clojure's immutable data structures define equals() (and thus =) as a value, not an identity, comparison."

22:12 jcromartie: ,(= 1 1.0)

22:12 clojurebot: false

22:12 jcromartie: "compares numbers … in a type-independent manner"

22:12 ,(= 1.0 1.0M)

22:12 clojurebot: false

22:12 amalloy: that part is a cruel joke played on us by rich

22:12 duck1123: except for that

22:13 amalloy: you have to use == for numbers

22:13 duck1123: that used to work, but in the end, it's for the better

22:13 amalloy: duck1123: really?

22:13 (ie, really for the better. i know it used to work)

22:13 duck1123: I'm pretty sure that worked in really early versions

22:13 jcromartie: sounds like the docs need to be addressed then

22:13 not a big deal right?

22:14 * Sgeo wants to hug Haskell, where there's just one kind of equality

22:14 jcromartie: at least there's no ===

22:14 duck1123: amalloy: it's not a happy trade-off, but I'll take numbers working fast over (= 1 1,0)

22:14 mthvedt: iirc, in java, 1 != 1.0

22:15 Sgeo: ,(doc ==)

22:15 clojurebot: "([x] [x y] [x y & more]); Returns non-nil if nums all have the equivalent value (type-independent), otherwise false"

22:15 jcromartie: duck1123: keep your filthy communist numbers out of here… it's "1.0"

22:15 Frozenlock: Sgeo: you should check common lisp :P

22:15 amalloy: mthvedt: wrong

22:15 mthvedt: where one is an integer and one is a bigdecimal

22:15 duck1123: but really, comparing the number 1 to 1.0 is not something that should be taken lightly

22:15 jcromartie: mthvedt: in Java 1.0 would be a double by default

22:17 1: int, 1.0: double, 1.0f: float, 1.0M: BigDecimal

22:18 duck1123: ,(== 1 1.0)

22:18 clojurebot: true

22:18 mthvedt: ,(= 1.0M 1M)

22:18 clojurebot: false

22:18 mthvedt: hm

22:19 AustinYun: oh man

22:19 duck1123: interesting

22:19 mthvedt: ,(< 1M 1.0M)

22:19 clojurebot: false

22:19 mthvedt: ,(> 1M 1.0M)

22:19 clojurebot: false

22:19 AustinYun: importing shit and class paths is so complicated

22:20 duck1123: AustinYun: Sometimes, but usually lein takes care of most things. What are you trying to do?

22:20 jcromartie: (map type [1M 1.0M])

22:20 ,(map type [1M 1.0M])

22:20 clojurebot: (java.math.BigDecimal java.math.BigDecimal)

22:21 jcromartie: BigDecimal is special

22:21 AustinYun: lol i'm trying to add another file to a leiningen project, that's what

22:22 duck1123: another clojure source file? a resource?

22:22 xeqi: ... a free floating jar?

22:22 duck1123: that'll do it

22:25 AustinYun: it's nothing, i'm just bitching

22:25 yankov: if you were to implement sorted sets (with scores) like this http://redis.io/commands#sorted_set in clojure, what solution would you pick? finger trees or skip list, clojure built-in sorted-map, or … ?

22:27 jcromartie: ,(= (int 1) (long 1) (bigint 1))

22:27 clojurebot: true

22:28 jcromartie: this is the clincher: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L978

22:28 the numbers must be in the same "category"

22:31 duck1123: yankov: That's a rough question. I would probably build it off of clojure's collection types, but as for the algorithm...

22:32 That's a good ML question though. I look forward to reading the thread

22:35 AustinYun: ok, when do you use :require vs :use

22:37 brehaut: with 1.4 you can just always use :require and :refer as needed

22:37 but thats not really answering your question

22:38 AustinYun: ok, i have a generic leiningen project skeleton

22:39 metellus: AustinYun: http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html I found this to be pretty helpful

22:39 I can't promise that it's completely current though

22:39 AustinYun: why does using the same (ns (:use... statement at the top of my test script not work in a different src file also in the src directory

22:40 brehaut: metellus: its been updated for 1.4

22:41 AustinYun: keeps telling me it can't find myproj/db-setup.clj in the classpath on line 1 of compiling when it's in the same folder as the main file, which is obviously in the classpath

22:42 brehaut: AustinYun: im guessing here, but i think you need to call the file db_setup.clj and have a namespace of db-setup

22:42 AustinYun: ...wtf for

22:42 brehaut: hyphens arent legal characters for java identifiers, so clojrue name munges them to underscores

22:43 like i said though, im guessing.

22:43 * AustinYun commits suicide

22:43 brehaut: being an arse will get you no help

22:44 AustinYun: there's a 90% chance i would have spent hours flailing around with various permutations of ns, in-ns, :use, :require, and :import without ever finding that out

22:45 metellus: (inc irc)

22:45 lazybot: ⇒ 1

22:46 metellus: (dec docs)

22:46 lazybot: ⇒ -1

22:46 akhudek: hm, can you no longer add new lein tasks directly to project.clj with lein2?

22:47 brehaut: http://clojure.org/libs

22:47 right there 'Hyphens in the lib name are replaced by underscores in the path'

22:47 (inc docs)

22:47 lazybot: ⇒ 0

22:47 brehaut: (dec not-reading-the-docs)

22:47 lazybot: ⇒ -1

22:47 AustinYun: i didn't say it's not because i'm an idiot

22:47 casion: leiningen explains it in its docs as well

22:48 that's where I made the connection originally

22:48 brehaut: clojure.orgs docs get a bit of grumping from the community, but if you dont read them, you are seriously disadvantaged

22:50 xeqi: akhudek: https://groups.google.com/forum/?fromgroups=#!topic/leiningen/jQle_S1wo7Y

22:51 akhudek: thanks xeqi !

23:40 rbarraud: Yo... What was suggested Linux irc client for use over ssh + screen again? OT apologies...

23:40 AustinYun: is there a way to require a single function out of a namespace with :require?

23:41 rbarraud: i'm using weechat atm

23:41 metellus: rbarraud: irssi or weechat

23:41 rbarraud: Thanks aus

23:41 A irssi was the one I was half remembering ... Thanks

23:42 jkkramer: AustinYun: (ns example.core (:require foo.bar :refer [baz])) makes baz available within example.core

23:42 AustinYun: from a user's perspective weechat is basically irssi with a more xchat looking default UI (it's got the bar separating nicks and what is said for example)

23:43 i've heard architecturally weechat is more modern but it's not as if i've looked at the source for either of them

23:43 jkkramer: thanks

23:44 rbarraud: Hmmm.... Target host is too old or something... Neither avai

23:44 An

23:44 nsxt: irssi + nicklist will get you nicks if you need them

23:44 rbarraud: Available *

23:44 Any other possibly more archaic suggestions?

23:45 AustinYun: hm... bitchx?

23:45 or ircii

23:47 i take it you're ssh-ing into a remote system somewhere and are relying on it's package manager or something?

23:52 ok so everything's working now, lol, thanks brehaut

23:53 Sgeo: :( at http://talkingtomachines.org/chapter/1/6 calling fn a function

Logging service provided by n01se.net