#clojure logs

2012-09-06

00:00cgagline-seq comes with clojure
00:00technomancySgeo: yeah, definitely
00:00xeqiyes, and you'd have to be careful to not close the file to early
00:00technomancywell, there's line-seq, but line-seq forces you to wrap it in a with-open
00:00technomancyso you can't just treat it like any old seq
00:01devnSgeo: http://clojuredocs.org/clojure_core/clojure.core/line-seq
00:01devnnot the with-open wrapper
00:01devnnote*
00:02cgagactually i think i've been bit before by doing something like (for [line (line-seq)] ...) within a with-open
00:03cgagsince it returns the lazy seq but closes the reader, or at least that's what i thought was happening
00:07ohpauleezcgag: Not the biggest n, the biggest n for the DS
00:10cgagDS?
00:10clojurebotbcrypt. http://codahale.com/how-to-safely-store-a-password/
00:12ohpauleezData structures
00:12ohpauleezthe tries
00:15ohpauleezat least, that's what I recall
00:17yankovdo you guys think PersistentTreeMap is a good choice for something like leaderboards. How fast it sorts by keys
00:28devnyankov: once upon a time i used PersistentQueue but it was just for fun
00:35SegFaultAXI 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?
00:37SgeoAre there any good guides for making macros that write macros?
00:38casionSgeo: you scare me
00:39SegFaultAX,(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]]))
00:39clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>
00:39SegFaultAX,(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]])))
00:39clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>
00:39SegFaultAXHmm.
00:39SgeoI actually have a use-case in mind. This fact may be even scarier.
00:40SegFaultAXSgeo: Why would you want to do such a thing?
00:40Sgeowith- macros seem to be at least somewhat common and idiomatic
00:40casionSgeo: can you explain please?
00:40SgeoYet, to a degree, they're all similar
00:40SgeoSo, why not a macro that expands into a defmacro form to define a with- macro?
00:41Sgeo(defwithmacro with-something pre-function post-function) might be an example usage
00:41SgeoThe created macro could be used like (with-something somecode morecode)
00:41Sgeosomecode morecode might be surrounded by pre-function before it and post-function after it
00:42SgeoAlthough 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
00:42casionwouldn't you just use -> ->> or comp for that though?
00:42casionand that's end up more readable
00:43amalloy$google amalloy macro writing macros
00:43lazybot[Clojure: macro-writing macros - amalloy - HubPages] http://amalloy.hubpages.com/hub/Clojure-macro-writing-macros
00:43amalloyfrom back when i did a brief series of blogs
00:43SegFaultAXamalloy: Did you happen to catch my question above? Do you have any thoughts?
00:43Sgeoamalloy, cool
00:45amalloySegFaultAX: looks like (for [[i s] (map-indexed vector coll), [j x] (map-indexed vector s)] [x [i j]]) and some kind of reduce
00:46SegFaultAXI forgot about map-indexed.
00:47SegFaultAX,(map-indexed (range 3))
00:47clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$map-indexed>
00:47SegFaultAX,(map-indexed #(* % %) (range 3))
00:47clojurebot#<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox$eval102$fn>
00:47SegFaultAXArgh, I suck right now.
00:47amalloy&(reduce #(update-in %1 (fnil conj []) %2) {} (for [[i s] (map-indexed vector ["XX" XY"]), [j x] (map-indexed vector s)] [x [i j]]))
00:47lazybotjava.lang.RuntimeException: EOF while reading string
00:47SegFaultAXI need sleep.
00:47casion,(map-indexed #(* % %2) (range 3))
00:47clojurebot(0 1 4)
00:48SegFaultAX(doc fnil)
00:48clojurebot"([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."
00:49amalloySegFaultAX: https://gist.github.com/b22b208d0943ef9290c7
00:49clojureboteg, https://github.com/clojure/tools.logging is the new version of clojure.contrib.logging
00:51Sgeo<asiekierka> Sgeo: only one level of recursion?
00:51Sgeo<asiekierka> why not make macros that write macros that write macros
00:51Sgeo<oerjan> why not make fix (macros that write)
00:51Sgeooerjan's idea is the best
00:51SegFaultAXamalloy: Is fnil a new thing? I've previously been doing what you're using fnil for with get/get-in and a default value.
00:51amalloy&(:added (meta #'fnil))
00:51lazybot⇒ "1.2"
00:52casionfnil is 1.2
00:52SegFaultAXAnd lots of the code I've read uses that pattern, which is why I thought it was normalish.
00:52casionI lose the race :(
00:52Sgeo,(doc fnil)
00:52clojurebot"([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."
00:53SegFaultAXCool! Thanks :)
00:53SegFaultAX(inc amalloy)
00:53lazybot⇒ 31
00:53Sgeo...I should learn to read scrollup someday
00:53casionamalloy is just some sort of clojure genie
00:56Sgeoamalloy, the ~'& thing seems important to know about even for macros that, say, merely write functions
00:57amalloyit turns out not to matter
00:57amalloyfoo/& works just as well as &
00:57SgeoOh, huh.
01:07SgeoHmm, 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?
01:07Sgeo(I'm referring to the use of #= in http://amalloy.hubpages.com/hub/Dont-use-XML-JSON-for-Clojure-only-persistence-messaging
01:08SegFaultAXWhen should I be using (set coll) vs. (into #{} coll)?
01:09SegFaultAXOr should I always prefer (into #{} ...)?
01:09antares_SegFaultAX: just use clojure.core/set
01:10SegFaultAXSo when is into appropriate?
01:10casionSegFaultAX: I belive (set coll) is almost always faster
01:11SegFaultAX(time (do (into #{} (range 1000)) nil))
01:11SegFaultAX,(time (do (into #{} (range 1000)) nil))
01:11clojurebot"Elapsed time: 39.561528 msecs"
01:11antares_SegFaultAX: into is more generic: you can use it with non-empty collections and it also works for maps and so on
01:11antares_clojure.core/set is much more narrow in scope
01:11SegFaultAX,(time (do (set (range 1000)) nil))
01:11clojurebot"Elapsed time: 20.569105 msecs"
01:11SegFaultAXantares_: Hmm, ok. Thanks.
01:12casioninto copies everything with reduce conj
01:12SegFaultAXcasion: conj! right?
01:12SegFaultAX(source into)
01:15SegFaultAXSorry, closed the wrong window.
01:15SegFaultAXPlease repeat what you said.
01:16casionhttp://clojuredocs.org/clojure_core/clojure.core/into
01:16SegFaultAXcasion: Looks to be using conj! to me.
01:17casionSegFaultAX: in your example I think it's using conj
01:17casionI could be incorrect
01:18casionyeah, pretty sure it is
01:18SegFaultAX(instance? clojure.lang.IEditableCollection #{})
01:18SegFaultAX,(instance? clojure.lang.IEditableCollection #{})
01:18clojurebottrue
01:18SegFaultAXI see.
01:19casionwell, I'm wrong then hah
01:19SegFaultAX:)
01:19casionI for some reason thought we were talking about vectors
01:19casionit's too late for thinking clearly
01:19SgeoEditableCollection?
01:19SgeoOh, I assume that means compatible with transientness
01:20SgeoNot that the structure itself is editable
01:20SegFaultAXSgeo: Seems like a reasonable guess to me.
01:21Sgeo"If a pure function mutates some local data in order to produce an immutable return value, is that ok?"
01:21SgeoThe ST monad in Haskell allows for that
01:21SegFaultAXSo, use into when I'm copying items into an existing collection, otherwise just use the appropriate constructor function?
01:21SegFaultAXFor some reason I thought that (into ...) was preferred.
01:24Sgeo,(class {})
01:24clojurebotclojure.lang.PersistentArrayMap
01:24Sgeo,(class (transient {}))
01:24clojurebotclojure.lang.PersistentArrayMap$TransientArrayMap
01:46libierholaaa
01:48SgeoI need sleep
01:49mpanwhat does it mean that I can't resolve defn?
02:16kryftI'm trying to get started with clojure, and I noticed that swank is apparently deprecated with nrepl recommended instead.
02:17RaynesWell, your observational skills are top notch. ;)
02:17tomojhmm, is there any nice way to hack on clojure itself with leiningen, since clojure doesn't have a project.clj?
02:17RaynesWrite one, I guess.
02:18kryftRaynes: :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?
02:18RaynesNo, go with nrepl.
02:18RaynesAnd I hope you feel better.
02:19kryftThanks on both accounts!
02:19RaynesThere isn't much documentation necessary. nrepl.el's README has a list of commands.
02:19kryftI wonder if there's an emacs tutorial for people coming from vim who intend to use evil mode. :P
02:20RaynesI 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.
02:20Raynesevil-mode is amazing.
02:21wmealing_how can it not be ?
02:21kryftRaynes: "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)
02:21kryftwmealing_: Well, I was somewhat underwhelmed by viper mode back in the day
02:21RaynesYeah, vimscript is a hideous fire breathing dragon.
02:23kryftRaynes: I take it that evil-mode works nicely with SLIME and other major modes?
02:23RaynesI certainly haven't had any problems with it.
02:23kryftGreat.
02:27kryftRaynes: How much of vim does evil (not) implement? Did you miss anything?
02:55vakhi all
02:56vakare there any ubuntu ppa for clojure 1.4?
02:57scottjvak: not that I'm aware of. most people install clojure on a per app basis using leiningen
02:58vakscottj: oh... isnt this leiningen also clojure-based?.. so, first I'd need clojure anyway?..
02:59scottjvak: when you run the leiningen install command I think it downloads clojure to run itself. you just need java installed.
02:59TheBusbyRaynes: in the lazybot github plugin, where are you setting polling frequency?
02:59vak(I have two JVM implementations installed)
03:01vakscottj: but then I guess, one gets an old clojure 1.1, because it is the current one in ubuntu 12 right now
03:01scottjvak: nah. lein will install whatever version it needs, and then when you create a project you specific which version you want in project.clj
03:02vakscottj: oh, sounds cool
03:06clgvvak: go for lein2 ^^
03:07clgvvak: to be more pecise lein will not only install what it needs, it installs for you the clojure version you need in the project
03:07vakclgv: thank you!
03:10Kneferilislein new life doesn't work, I get a message: \leiningen\technomancy-leiningen-d254dae\...lein-classpath was unexpected at thi s time.
03:11ro_stanyone 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?
03:12ro_stselect @time = time where version = 5; select * from entity where time = @time; to put it in sql terms
03:12Kneferilisin windows, lein new life doesn't work, I get a message: \leiningen\technomancy-leiningen-d254dae\...lein-classpath was unexpected at thi s time.
03:13Kneferilisany ideas?
03:13ro_sti plan on storing version data for a git repo in datomic and i'm wondering how to query data for past versions
03:14KneferilisI mean, that happens with leiningen
03:14clgvKneferilis: probably faulty installation. maybe PATH issues?
03:15Kneferilisclgv: maybe, don't I only have to have path for wget?
03:15clgvKneferilis: which IDE are you using?
03:15Kneferilisclgv: no IDE, I am just trying to make a project with leinengen
03:16clgvKneferilis: which IDE do you plan to use? there might be a painless shortcut to your issue depending on the answer ^^
03:17Kneferilisclgv: I am not familiar of clojure IDEs at the moment.
03:18clgvKneferilis: 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
03:18Kneferilisclgv: I can do that at home
03:19Kneferilisthanks clgv
03:19clgvbut 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
03:20clgvKneferilis: but there are short howtos for setting up leiningen on windows. the only special things I remember are installing wget and setting paths
03:21clgvany 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
03:23tomojyou want the changes at each loc to appear in the other locs?
03:24clgvtomoj: I want to do something similar to a cartesian product but on that tree
03:25clgvguess I have to make a 4clojure task out of it to get the most elegant solution ;)
03:26tomojyou can surely return multiple locs from a recursive function of a loc
03:27clgvwell 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
03:28ro_stdo you want the same zipper to return multiple trees at once?
03:28ro_stbecause i don't think they do that
03:28clgvI want a function to return all those trees at once.
03:29ro_sti think you'll have to compose multiple calls into the zip fns
03:29clgvso my guess that it would get complicated is right? ;)
03:29ro_stafaik, the zipper makes doing a single pass of edits and returning the combined result easy
03:30clgvok. so they would be the right choice to get one edited tree
03:30ro_stwell, if you can write the zipper fn that does one iteration, then mapping that fn over some list can't be a big stretch
03:30ro_styes, i think so
03:30clgvro_st: the problem is that you have to return the tree and residual tree to be able do the next step
03:31clgvI'll try it different then
03:31ro_stplease do take what i'm saying with a pinch of salt. i'm hardly an expert :-)
03:34tomoja cartesian product of the tree with itself?
03:35clgvtomoj: nope the tree contains valuesets in its leafs
03:36tomojinteresting
03:36clgvI have an overcomplicated algorithm for it.
03:37clgvbut now I changed the data representation and have to adapt it - so the thought to rewrite it more easily occured
03:42SgeoIs it just me or is https://github.com/swannodette/enlive-tutorial/blob/master/src/tutorial/scrape1.clj rather non-functional
03:42SgeoI feel like perhaps hn-headlines and hn-points should take arguments
03:42SgeoRather than using global variables
03:43ro_stit's not a global variable
03:43ro_stit's a constant :-)
03:43ro_stif it were production code, then it'd be an arg. but in this tut, the url will only ever be HN
03:44Kneferilisclgv: 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
03:45SgeoOf course, I shouldn't be one to talk
03:46SgeoI recently wrote a Tcl script that has 3 functions that are identical in all ways but name
03:46clgvSgeo: for backup purposes? :P
03:46SgeoBecause I have a dispatcher that dispatches to a function named partially by ... long story
03:47SgeoBut in the case of these three possibilities, the code I need is the same
03:52clgvSgeo: why not one function and three dispatcher stups that call that function?
03:52SgeoGood idea, although I was thinking more "default function" because this code is sort of default, but yeah, I could do that
03:53SgeoThere are many, many other places where I need to just pull stuff out into functions
03:53SgeoBut the code is already sort of in production and hard to deploy to
03:53Sgeo(And by "production", I mean servicing one IRC channel of maybe 20 people)
04:07tomojclgv: hmm, does this really work? https://gist.github.com/d46b590ea57036f41cb5
04:08tomojprobably could be written better..
04:13tomojseems to be broken in the case where the root is a set
04:34lpetitclgv: hi
04:36lpetitThere'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?
04:43hyPiRionlpetit: It's already bound on M-s
04:44lpetithyPiRion: oh sorry, I was talking about Counterclockwise for Eclipse.
04:45hyPiRionlpetit: Oh, paredit for Eclipse? Neat.
04:46lpetithyPiRion: 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
04:55Fossiwhatwherewhat?
04:55Fossiwhere can i get paredit for eclipse?
04:56Fossiah, counterclockwise required?
04:59lpetitFossi: 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?
06:14clgvoh it's "CCW Thursday" :D
06:15clgvlpetit: btw. the leiningen hooks patched worked as expected and I love the auto completion in the beta
06:16lpetitclgv: glad to read that :-D
06:17clgvlpetit: do you have a plan what needs to be done until the next stable release?
06:17lpetitclgv: not much. Expect the next stable release today or next thursday
06:17clgvlpetit: that's the kind of information I was looking for ;)
07:03clgvlpetiti: how did you resolve #385?
07:03clgvlpetit: ^^
07:05lpetitclgv: it's not marked as "resolved"
07:05clgvlpetit: ah! just listed as to do next ^^
07:20Kneferilislein can't create projects at my work pc, is there another way to compile and run clojure code?
07:20Kneferilis(lein outputs an error message and exits)
07:23KneferilisI mean, maybe there is a lightweight ide that allows you to write clojure code and run it?
07:26KneferilisI wil give lein a shot at my virtuabox ubuntu.
07:27algernonwhat's the error message?
07:27ro_stKneferilis: light table
07:28ro_stturnkey clojure coding
07:32jowagHi, why there is a need for cljs.core.truth- in CLJS? isn't JS's "if" compatible with clojure's one?
07:35clgvKneferilis: did you follow any howtos on setting it up under windows yet?
07:35clgvwith lein 1.7 I just put the lein script in a folder alongside with wget and then added this folder to the path
07:36clgvafter that it worked with lein 1.7 - I guess with lein2 thats similar
07:37Kneferilisalgernon: \leiningenWorking\...lein-classpath was unexpected at this time.
07:37Kneferilis^^the error message
07:40clgvKneferilis: no one cant work with that ;)
07:40clgvups -t
07:42Kneferilisclgv: I installed wget, put wget's path to the PATH and downloaded and run lein.bat self-install
07:43clgvand that directly gave you that short line you posted?
07:52Kneferilisclgv: well, it installed then when I entered lein new project, I got that error and lein exited
07:53clgvthere is no exception?
07:54clgvno stacktrace?
07:54Kneferilisclgv: no, that message only
07:55clgvso you probably get the error in the bashscript already
07:55clgverr bat-script
07:59Kneferilisclgv: I am no Windows, but I will installe lein in ubuntu and hopefully it will work
07:59Kneferilis*on Windows
08:15gerry`hello
08:16gerry`how to setup local git repo as dependency in lein?
08:16gerry`or local clojure***.jar as dependency?
08:29xeqigerry`: are you building clojure from source and want to use it as a dependency in lein?
08:30gerry`xeqi: right.
08:32xeqirun `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
08:32xeqiassuming your on a recent clone
08:33xeqiand didn't change the groupId, artifactId, or version in clojure's pom.xml
08:35gerry`and use [org.clojure/clojure "1.5.0-master-SNAPSHOT"] as dependency in my project.clj file?
08:36xeqiyes
08:36gerry`ok,thx
08:40firesofmayxeqi, will this work for other libraries as well (written in clojure)? or is this only for building clojure language itself?
08:41firesofmayxeqi, and won't this conflict if I want to use the original library as well?
08:41xeqifiresofmay: 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
08:41xeqitrying to use 2 vesions of the same library in the same project would conflict anyways
08:41xeqi~repeatability
08:41clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
08:42firesofmayxeqi, 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.
08:43xeqifiresofmay: that works fine. The jars end up in ~/.m2 under a groupid/artifactid/version scheme
08:44firesofmayxeqi, okay thanks for answering.
08:44xeqiso as long as you don't use install a jar with the same version as an already installed jar, the ~/m2 cache has both
08:45firesofmayxeqi, okay.
08:49gerry`xeqi,it works,thx.
09:18mpanI'm quite happy. I've finished my first school project using Clojure and it went mostly OK.
09:18mpanThanks for your help, everyone!
09:22lnostdalhi 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?
09:23algernonlnostdal: "Functional Programming for the Object Oriented Programmer" ?
09:23clgvlnostdal: the one from brian marick?
09:23algernonif so, https://leanpub.com/fp-oo
09:27lnostdalyes, that was the one i think .. ty .. anyone read it yet?
09:30clgvdidnt he say that it's not ready yet? just preview version?
09:31firesofmaylnostdal, I read the first chapter, liked his style.
09:31firesofmaylnostdal, as a newbie to clojure, I was able to understand what reader is properly. Didn't read after that.
09:32lnostdalok
09:32clgvso it is ready?
09:33clgv*complet
09:33firesofmayclgv, its still going through revisions/modifications, but one can read it, it has enough material to read about.
09:34chronnoNot yet, from leanpub link: "The book is roughly 80% finished."
09:34clgvthx
09:45octagonhi, 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?
09:47S11001001octagon: 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.
09:48chouserit's just a shame there's no readable version of such symbols
09:48S11001001octagon: the solution, as chouser alludes, is to make all symbols roundtrip through pr/read (again notwithstanding meta)
09:48octagonS11001001: you mean (= (str (symbol x)) x) must be true for all strings x?
09:48S11001001octagon: aye
09:49octagonS11001001: why is that an important property? it's not obvious to me.
09:50S11001001octagon: 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
09:53S11001001octagon: many other invariants arise; for example, given any isomorphism "iso", (= (iso x) (iso y)) *if and only if* (= x y).
09:53octagonS11001001: Interesting, thanks, especially the last example.
09:55AWizzArdIn 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?
09:57gtrak(karma nrepl.el)
09:58hyPiRion$karma nrepl.el
09:58lazybotnrepl.el has karma 1.
09:58gtrakquick poll, is switching to nrepl.el worthwhile atm if you're used to swank? I see the swank-clojure github recommends it.
10:03clgvAWizzArd: uhh, that crying for a custom leiningen task. dont you think?
10:03chouserAWizzArd: or perhaps you can have N profiles instead?
10:05clgvchouser: with filters on the source files?
10:06chouseryeah, I don't know if it would work, just an idea I've been meaning to eventually explore.
10:07clgvotherwise a leiningen task with :data-format-files [ ... ] should be possible anyway
10:07clgvif the other idea fails, I mean
10:08cemerickAWizzArd: 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:09cemerickAWizzArd: Here's a real-world example, FWIW: https://github.com/cemerick/friend/blob/master/project.clj
10:09cemerickchouser: ^^
10:09gtrakhoow the heck do I use nrepl.el with a lein project?
10:10cemerickgtrak: M-x nrepl-jack-in
10:10hyPiRiongtrak: install nrepl as written on the github repo, and run nrepl-jack-in
10:10gtrakI 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:11gtrakah, do I need to add it to the project deps?
10:11chousercemerick: ah, neat.
10:11cemerickgtrak: sounds like an old rev of lein? What version are you using?
10:11gtrak1.7.1
10:12cemerickYou need to be on a v2.x preview.
10:12cemerickat least AFAIK, anyway
10:13gtrakI see
10:15gtrakso I'd need a little plugin or something if I wanted to use it.
10:22mpenetIs there a slime-compile-defun equivalent available in nrepl ?
10:23mpenetfrom looking at the readme it seems not
10:23mpenet(C-c C-c in slime)
10:24AWizzArdcemerick: good idea, thanks.
10:25AWizzArdchouser: also thanks for the idea :-)
10:25mpenetC-M-x seems quite similar, minus the flashing + output target I believe, anyway, I just need to try it once again
10:27clgvsomeone should start writing a bookchapter about leiningen configuration ;)
10:30naeg_what's the difference between * and *'?
10:32cemerickclgv: Leiningen could easily be its own book at this point.
10:32TimMcIt doesn't need one, luckily.
10:32clgvcemerick: I didn't dare for that statement so I chose the chapter ;)
10:32cemerickThough http://clojurebook.com *does* cover the basics of Leiningen. :-)
10:33cemerickTimMc: Dunno about that. It's a remarkably flexible and capable, but there's a *ton* of knobs.
10:35TimMcHmm, are Clojure and Lein books "complements", economically?
10:35TimMcThe 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:35OERaynes: do you have any usage examples for irclj before I dive into it?
10:36cemerickA 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:37clgvcould be an open book, though.
10:38cemerickopen book?
10:38xeqiis there a wrap-escape-params middleware for ring yet?
10:38`fogusRight. I'd pay for a LeanPub Lein book
10:38weavejesterxeqi: What would wrap-escape-params do?
10:38AWizzArd`fogus: is Marginalia already compatible with Leiningen 2?
10:39clgvcemerick: I mean someone starts a documentation project where others can participate.
10:39cemerickclgv: I think you mean https://github.com/technomancy/leiningen/tree/master/doc :-P
10:39cemerickOf course, pull reqs welcome :-D
10:40clgvcemerick: well, if it were complete you wouldnt need that book ;)
10:40cemerickPerhaps.
10:40clgvbut for basic needs it's pretty good
10:41cemerickIt's a poor book that can be replaced with technical documentation though, even good stuff.
10:41xeqiweavejester: html escape them so I wouldn't need to (h ...) all over the place and open an XSS attack when I forgot
10:41xeqipossibly with a (raw ...) for the underlieing param
10:41xeqisorta like http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/
10:42TimMcxeqi: You're talking about html-escaping querystring parameters as they come in? :-/
10:42weavejesterxeqi: 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:43weavejesterHiccup currently outputs things directly as strings, which is fast but can't distinguish between values and HTML code produced from other HTML functions.
10:43xeqiTimMc: pretty much yes
10:43weavejesterTo solve that, the compiler needs to be redesigned to output a DOM
10:44weavejesterWhich would be slower, but I think I'm resigned to that.
10:44xeqiweavejester: heh, I was trying to avoid that. I figured html escaping the params in a middleware would cover %95 of my cases
10:44xeqi... 95%
10:45xeqithough for clojars I guess alot of the strings pushed through the UI do come from the FS instead of params
10:45Kneferilishello, is there a package like XAMMP for clojure?
10:45weavejesterBut surely you only want to html-escape your params when they're inserted into the HTML
10:45KneferilisI admit that I will try lein in ubuntu at home, I was just wondering.
10:49xeqihmm, perhaps you're right
10:49xeqieven doing (raw ..) for things like putting in a db, won't help on the otherside
10:49scriptorKneferilis: I don't think so, at least haven't heard of anything bundled up like that
10:50Kneferilisscriptor: ok
10:52rodnaphhi - does anyone know of any tools for producing code coverage reports for clojure code?
11:00jaleyguys - is this an idiomatic way to implement a producer/consumer style queue? https://www.refheap.com/paste/4903
11:00jaleyI 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:02rodnaphjaley: 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:03jaleyrodnaph: won't you potentially process a job many times if the transaction is retried?
11:05rodnaphjaley: ... hmmm yes, this is what i was worried about, ack...
11:06TimMcxeqi: You really, really don't want to encode early.
11:07abaloneis LightTable open for people to write plug-ins ? or is that for later ?
11:07TimMcxeqi: Amusing consequence from a former place of employment: http://community.crutchfield.com/search/SearchResults.aspx?q=amp
11:08TimMcweavejester: If only String could carry metadata...
11:09uvtcTimMc: ouch. :)
11:11TimMcAnd there's nothing like a JSON API spewing HTML entities.
11:12senethHas 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:13jaleyseneth: yes, I particularly miss painting myself into a corner every day :)
11:13rodnaphseneth: did u see this https://github.com/frenchy64/typed-clojure
11:13nDuffseneth: Given as there are people working on Typed Clojure, the answer is pretty obviously yes, some such people exist.
11:22TimMcseneth: 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:25S11001001! Array(1,2,3): Array[Unit]
11:26S11001001wrong chan...
11:35clgvseneth: seldom. I wished in the first months with clojure. but that wish vanished over time
11:36clgvI wonder if typed-clojure will be continued after GSoC
11:43algernonclgv: 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:44clgvalgernon: I know that GSoC officially ended. we'll see whether it continues to something usable...
11:45algernonclgv: it's also the subject of his dissertation, so I expect it will evolve into something usable :)
11:47clgvah good ^^
11:55klangstarting 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:58raekklang: 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:58zakwilsonhttp://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:59cemerickI thought I saw something go by about :require-macros not being necessary anymore…not so, I guess?
11:59jcromartieCould 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:59raekin this case I think it's the :java-source-path "src/java" that needs to be changed into :java-source-paths ["src/java"]
11:59jcromartieshould I use a different repo?
12:01cemerickjcromartie: if that project doesn't publish checksums, then you'll need to disable checksum verification for the repo in question
12:01klangraek: thanks, that gives me some straws to pull.
12:04jcromartiecemerick: and how do I do that when using leiningen?
12:06mpenetjcromartie: there is an example here https://github.com/mpenet/tardis/blob/master/project.clj
12:07mpenetthat's with lein2
12:07mpenetnot sure it works the same way with 1.7*
12:08klangraek: that precate plugin really is invaluable! wow!
12:11technomancylein1 doesn't really care about checksums
12:11technomancyjcromartie: if a project is missing checksums be sure to open a bug report
12:14technomancyheh; the first comment on Marick's book is someone asking him to re-write it in scala... https://leanpub.com/fp-oo
12:14yacini'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:15deeplloydhi all
12:15S11001001yacin: defnk is useless now
12:15yacinoh?
12:15S11001001yacin: read up on the latest improvements in destructuring
12:15S11001001yacin: defnk is now an advertisement against language design by popularity contest
12:16clgvyacin: defnk was for keyword args?
12:16raek,((fn [& {:keys [a b]}] (+ a b)) :a 1 :b 2)
12:16clojurebot3
12:16clgvyacin: you can check if that lib fits you: https://github.com/guv/clojure.options
12:17raekyacin: ^
12:17yacinraek: ah interesting. i imagine having defaults is less simple?
12:17yacinhaha, thanks everyone
12:17yacinmost helpful irc channel
12:18cemericktechnomancy: leave it to the internet
12:18clgvyacin: defaults is messy by adding an :or {:a 10, :b 12} or such ^^
12:19technomancycemerick: "I like your book; could you write a different one for me?"
12:19raekyacin: you can have defaults like in ordinary map destructuring: {:keys [a b], :or {a 1, b 2}}
12:19clgvoops. symbols ^^
12:19raek,((fn [& {:keys [a b], :or {a 1, b 2}}] (+ a b)))
12:19clojurebot3
12:22yacinraek: thanks!
12:23djanatynis there a non alpha-numeric character I can use as the function #(float (/ % %%))?
12:25raekdjanatyn: are you asking for another way of writing (fn [x y] (float (/ x y)))?
12:25djanatynI'm asking if there's something convenient I could defn that to
12:26djanatynI need to use that in the repl frequently
12:26djanatynright now I'm using a function called #'$
12:26djanatynis there a way to override #'/ behavior?
12:26djanatynI'm in a seperate namespace.
12:27hyPiRion(ns namespace (:refer-clojure :exclude [/])) ... (defn / ...)
12:28hyPiRionIt's still available as clojure.core//
12:28djanatynthanks
12:29hyPiRiondjanatyn: By the way, you know about incanter, right? Just in case you want some statistics library to work with.
12:29djanatynhyPiRion: I've tried getting incanter to work on windows without much luck
12:30clgvdjanatyn: what failed?
12:30hyPiRionAre you using leiningen?
12:30djanatynclgv: mongodb, I think
12:30djanatynhyPiRion: 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:30clgvdjanatyn: oh, never used it with incanter
12:31djanatyneven clojure.org is blocked :P
12:31technomancyI can't believe incanter declares a dependency on mongo =\
12:31hyPiRionI didn't even knew it did, I must've used an old version when I used it.
12:31technomancyI guess maybe because it was created before the "complected" keynote? =)
12:32clgvtechnomancy: well it did not in a pre clojure 1.3 version.
12:32djanatynI'll work on getting Incanter running when I get home; I've wanted to try it out for a while
12:32technomancyah! no excuse then
12:33hyPiRionWhat would Incanter use mongo for anyway?
12:33technomancyyou're probably safe declaring an :exclusion on the offending mongo dep
12:33hyPiRionIn-memory db?
12:33clgvbut it had an annoying dep on parallelcolt which I never used but whose classes where used in core
12:34clgvhyPiRion: access for datasource, I guess
12:34hyPiRionhm, now I got curious.
12:37hyPiRionNeeded for incanter-mongodb. So I believe it's safe to exclude it if you're not using that package.
12:37djanatynemacs is a *really* nice environment for a statistics class
12:37djanatynclojure file on top, repl on the bottom left half, and org-mode buffer for notes on the bottom right half
12:38tanzoniteblackdjanatyn: interesting to note that you're on irc and don't mention it in that list...
12:39djanatynfor IRC I'm using a web based ssh client, shellinabox
12:39djanatynour school won't let you connect to irc network ports, so I have my irc client on another box.
12:40hyPiRionI suppose you could tunnel it over https.
12:40TimMcdjanatyn: Can you SSH?
12:40S11001001djanatyn: freenode offers stacks of alternate ports
12:41NarviusHello, I have a question about seesaw.
12:42NarviusThe 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:43NarviusSo; How can I refer to the object itself from within a listener function in seesaw?
12:43TimMcdjanatyn: Never mind, misunderstood.
12:44djanatynTimMc: 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:45djanatynanyway, back to clojure! so I can just exclude mongodb in my project.clj file when installing incanter with lein?
12:46S11001001Narvius: paste?
12:47NarviusPretty much just (progress-bar :listen [:mouse-pressed (fn [e] (.setValue this 50))]).
12:49NarviusWell, I guess I'll work around it by calling (listen) afterwards and using closures.
12:49hyPiRiondjanatyn: Yep - it will only kill the incanter-mongodb namespace.
12:54clgvdjanatyn: 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:59xeqiTimMc: heh, yeah I decided it was a bad idea. Even just the inconsitencies of whats escaped vs not-escaped would be annoying
12:59xeqiwonder 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:14ohpauleezcemerick: Thanks for the contributions!
13:25thorbjornDXhas anyone had to deal with really slow repl performance before?
13:33jcromartiethorbjornDX: when does it get slow?
13:33jcromartiethorbjornDX: because it's usually perfectly snappy until you run up against JVM memory limits
13:34thorbjornDXjcromartie: I've found it giving me input latency when typing (2-3 seconds sometimes)
13:34n4ircI'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:34jcromartiethorbjornDX: that's definitely odd… what OS/JVM?
13:34n4ircDoes anyone know what the fix is, it used to work, and I didn't make any intentional changes.
13:36n4ircon 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:36thorbjornDXjcromartie: jre 1.6.0_33-b04, rhel 4 update 8
13:37jcromartiethorbjornDX: and how are you running the repl?
13:37thorbjornDXjcromartie: 'lein repl'
13:37technomancyn4irc: did $CLASSPATH get set maybe?
13:38thorbjornDXjcromartie: using "1.4.0" in my project.clj
13:39jamieorclooking for a lightweight way to strip all html from a given String and return only the text
13:42n4irctechnomancy: 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:42technomancyn4irc: well... as you may have noticed that's fixed in 2.0 =)
13:42technomancyit's just that 1.x is quite old
13:42TimMclike, *weeks* old
13:42TimMcancient :-P
13:42technomancyscores of weeks!
13:43n4irctechnomancy: It looks like my last message was garbled. I fixed my version of 1.7.1
13:44technomancyn4irc: it's a shame that storm requires 1.x; I wonder if there's any reason preventing them from upgrading
13:45technomancyoh, that's silly; it looks like they just haven't bothered to run precate on it yet
13:45technomancythe heck, guys
13:45thorbjornDXjcromartie: could this be an issue of running in a vm?
13:46jcromartiethorbjornDX: it could be
13:46jcromartiethorbjornDX: however my Ubuntu VM is faster when running Clojure than the Mac OS X host!
13:46jcromartiethorbjornDX: what is your memory setup?
13:47technomancythorbjornDX: is this lein2? is `lein trampoline run -m clojure.main/main` also slow?
13:47thorbjornDXjcromartie: about 3GB
13:47technomancysorenmacbeth: hey, do you work on storm?
13:47russfranklearned clojure, now trying to learn scheme.. its much harder
13:48n4irctechnomancy: storm appears to have a pull request in to do this. Our group is more of a storm user than core storm developer.
13:48technomancyn4irc: oh, cool
13:49thorbjornDXtechnomancy: that seems a bit faster, but I don't have a good benchmark really
13:49thorbjornDX(I'm pprinting a hash-map :P)
13:49technomancythorbjornDX: there were some bugs involving memory usage with tons of output in the repl that should be fixed in preview10
13:51llasramIs there an nrepl client + integration for vim yet?
13:51thorbjornDXtechnomancy: 'lein repl' slams my cpu to 100% and uses up about 100MB from what I can see
13:51llasramNot that I touch the stuff myself. It's for a co-worker
13:51thorbjornDXtechnomancy: when I run a pprint, I get the same type of cpu usage
13:52technomancyllasram: supposedly in-progress
13:52bordatouehello
13:52paxannoob question: how do I execute midje test fixture straight from Emacs (using nrepl thingie)
13:52paxan?
13:52tanzoniteblackthorbjornDX: does it slam your cpu if you do it in a non-project folder (i.e. lein doesn't load any other files)
13:52yannetechnomancy: is the vim-nrepl supposedly in-progress in public?
13:52llasramYeah, everything I'm seeing with the google is from several months ago. Maybe I'll just talk him into switching to Emacs
13:53bordatouecould anyone tell me how to load clojure.contrib.repl-utils and invoke the function show from repl
13:53technomancyyanne: couldn't tell you, sorry
13:53technomancyall I know is it uses haskell
13:53llasramwheeeee
13:53bordatouei am using clojure.1.3 , it seem to fail to load repl-utils
13:53thorbjornDXtanzoniteblack: when loading the repl? yes
13:53bordatouewill IllegalstateException
13:53llasram~contrib
13:53clojurebotMonolithic 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:54llasram^^ bordatoue
13:54bordatouethen the question is which of these small libraries has show functions in it
13:54technomancyllasram: supposedly lein-tarsier is the way to go currently
13:54technomancybordatoue: show is in clojure.repl IIRC
13:55amalloytechnomancy: i don't think it exists anymore
13:55amalloyclosest is clojure.java.reflect/reflect
13:55thorbjornDXis there a way to tell lein which java to use? I want to try the (old) system java
13:55llasramtechnomancy: Ah, thank you
13:56thorbjornDXjust modify $PATH?
13:56amalloythorbjornDX: LEIN_JAVA_CMD
13:56thorbjornDXamalloy: thanks :D
13:56bordatouetechnomancy: it is not in clojure.repl
13:56technomancyoh, bummer.
13:56bordatouewhat is happening with the show
13:57thorbjornDXamalloy: that worked, but I guess java 1.4.2 is a bit too out of date
13:57bordatoueamalloy: what was wrong with show that it was removed
13:57amalloythorbjornDX: 1.5+
13:57bordatoueplease help where can i find show function
13:57ispolinllasram: 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:58bordatouei don't think i will make it
13:58amalloybordatoue: 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:00bordatoueapp http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Goologise for that
14:00thorbjornDXweird, I had a rogue ipython process taking up 17% of my RAM
14:02llasrambordatoue: I believe amalloy answered your question already, actually. "closest is clojure.java.reflect/reflect"
14:03sorenmacbethtechnomancy: I've made some code contributions, and I use it, yeah. What's up?
14:04bordatouellasram: 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:04sorenmacbethtechnomancy: (that was in response to your q about Storm)
14:04bordatoueamalloy: appologies for the rudness
14:04technomancysorenmacbeth: just wondering if there were any specific blockers around lein2 support
14:05sorenmacbethtechnomancy: Ok, I'll take a look and see. I'll ask Nathan as well
14:05technomancyeh; just curious if you knew off the top of your head
14:05technomancylein1 is really starting to show its age
14:06sorenmacbethyeah, there are a bunch of projects that I'd like to move over the lein2 actually.
14:06llasrambordatoue: 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:06technomancysorenmacbeth: definitely interested in hearing if you run into any issues with that; trying to make the migration path as smooth as possible
14:06thorbjornDX`lein help` takes almost 20 seconds, is that normal?
14:07bordatouethanks llasram
14:07technomancythorbjornDX: if you have a lot of plugins and a slow drive it's possible
14:07technomancyit has to load every single task, so it's the slowest of all possible lein tasks
14:08sorenmacbethtechnomancy: looking at the project.clj, I don't see any reason it couldn't be moved to lein2.
14:08thorbjornDXtechnomancy: no plugins, I guess nfs could slow me down
14:08technomancythorbjornDX: yeah, it's all IO-bound
14:08sorenmacbethI just recently moved `lein` on my dev box to point to lein 2 to encourage me to update my old code
14:08Kneferilishello
14:08Kneferilisnow at home pc I managed to install and create a project on Win 7 64bit and on Ubuntu 11.01
14:09Kneferilis*11.10
14:09Kneferiliswith lein
14:09Kneferilismy question now is, how do I run this project?
14:09Kneferilisfor linux, better, because I want to learn more for Linux
14:11tanzoniteblackKneferilis: within the terminal, you should be able to run "lein run" in the directory lein created for the project to run it
14:11tanzoniteblackKneferilis: or is there something else you meant?
14:12Kneferilistanzoniteblack: yes, thanks, that was what I meant
14:12Kneferilisnow I am getting error No :main namespace specified in project.clj
14:12technomancyKneferilis: it doesn't really make sense to run a newly-created project
14:12technomancyit's not going to do anything
14:13Kneferilistechnomancy: how do I make my project to print out Hello World!
14:13Kneferilis?
14:13tanzoniteblackKneferilis: 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:14technomancyagreed; repl's a better place to start
14:14technomancyat some point you'll want to read through `lein help tutorial`
14:15Kneferilisyes, thanks, I am using repl now
14:15Kneferilistechnomancy: thanks
14:17ispolinllasram: 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:17llasramispolin: Ha! No problem. :-)
14:19thorbjornDXwhat's the best way to return a nested hash-map with a few keys dissociated (down a few layers)?
14:20technomancythorbjornDX: (update-in my-map [:key1 :key2] dissoc :key3 :key4)
14:20amalloy(update-in m [a b c] (dissoc x y z))
14:20amalloyer, but like technomancy said instead of me
14:20thorbjornDX,(doc update-in)
14:20clojurebot"([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:21thorbjornDXcool, thanks technomancy, amalloy
14:27dysingeranyone 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:27dysingerhttps://www.evernote.com/shard/s17/sh/c55027ce-4236-4c3d-8b88-e396753b2e8c/ea113e6df06b5ec61a6e08668832c49c
14:29S11001001dysinger: yeah, I've jackson mapped; you might need to load the class yourself before dropping to jackson
14:29dysingerCripes ok
14:32nickmbailey jk:q
14:32nickmbaileyoops, not vim
14:34dysingeremacs, not vim
14:34casionif 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:35chousermap
14:35chouserconcat
14:35casionsay 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:35chouserrepeat
14:36chouserdo 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:36casionchouser: I know the max width. It's always 4 actually
14:37chouser(map #(concat (repeat (- 4 (count %))) %) input) ;untested
14:37chouser(map #(concat (repeat (- 4 (count %)) 0) %) input) ; still untested
14:38amalloyi kinda like ##(for [coll '([2 3] [3 4 5] [1 2 3 4] [1 2])] (take-last 4 (concat (repeat 4 0) coll)))
14:38lazybot⇒ ((0 0 2 3) (0 3 4 5) (1 2 3 4) (0 0 1 2))
14:38amalloynot efficient for sure
14:39casionthank you for the idear
14:39casionideas*
14:41casionI 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:41casionworking with variable bit rate audio files to convert to a stream of floats
14:42chousercasion: is .putInt on the ByteBuffer the wrong thing?
14:42dysingerp
14:42casionchouser: yes, I don't have the int to put
14:43casionI just get a byte-stream that I need to convert to ints then divide by 0x7fffffff
14:44casionit'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:45casionso I have to pad it then feed it into a ByteBuffer… I think
14:45casionmaybe there's another approach, but that's how you deal with it in C (except you just have a byte->float function)
14:48jparishyHi, 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:49chouserjparishy: you have to AOT compile your .clj file that contains gen-class
14:50jparishyAhh. This I did not know, thanks
14:50chouserThat'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:56nathanichello 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:57llasramjparishy: 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:58llasramjparishy: Although I still ditto the advice on avoiding gen-class when you can
14:58jparishyk, I'm looking into using deftype instead
14:59jparishyappreciate the knowledge and help :)
14:59technomancyuse reify if you can
15:04antares_dakrone: hey
15:14jparishytechnomancy: By using reify do I lose having a named class?
15:15technomancyyeah, sadly
15:16chousertechnomancy: why reify over deftype?
15:17technomancydeftype doesn't play nicely with reloading
15:19jparishySo 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:20llasramjparishy: That error means you have a `defn` where you forgot the parameter vector
15:20jparishyAh never mind, me being silly
15:20jparishyYeah :p
15:20llasramClojure has some funny ways of saying things :-)
15:20jparishyMentioning the reify through me off
15:21jparishythrew*
15:21llasramOh, 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:22llasramYou really don't care what you had there instead of a parameter vector, just that you didn't have one
15:22jparishyErm. Hm, so can reify not define new methods on the class that aren't defined in the interface it's trying to implement?
15:22jparishyYep exactly
15:23llasramjparishy: That is a feature/limitation of both `reify` and `deftype`
15:23jparishyHaha.. well can reify implement more than one interface?
15:23llasramYep!
15:23dnolenjparishy: yes, and protocols too.
15:23jparishyOkay, so I guess that works
15:36dnolencemerick: http://github.com/emezeske/lein-cljsbuild/issues/134 should probably be a ClosureScript ticket.
15:52xeqiweavejester: 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:52edwHas 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:52edw.
15:52cemerickdnolen: Yeah, I see emezeske's comment. I'll see about scrubbing together a patch.
15:54weavejesterxeqi: Well, if you have a (html …) inside a (html …) then it obviously won't work
15:55weavejesterxeqi: But if you can avoid that...
15:55xeqiheh, that would break it
15:55weavejesterThe only 100% solution is to use DOMs not strings
15:59TimMcweavejester: What if intermediate Hiccup outputs were boxed Strings (say, RawHtmlStrings) and any normal Strings were HTML-escaped?
15:59pandeiroweavejester: it is not possible to do something like (context "/api" request (let [foo (get-something request)] (GET "/bar" [] "Baz"))) right?
15:59pandeirob/c context and whatnot are macros, not fns?
16:00pandeiroi was wanting to apply a (content-type "application/clojure") to every resp to the routes under my "/api" context...
16:00weavejesterpandeiro: It is. They're macros but not magic. They all return functions.
16:01xeqiTimMc: thats the direction I was thinking as well, but could be missing something
16:02weavejesterTimMc: 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:02TimMcand then relying code could say (raw foo) to bypass escaping.
16:02weavejesterpandeiro: If you have more than one route, be aware that let only returns the last element
16:02weavejesterpandeiro: So you'd need (let […] (routes …))
16:02TimMcweavejester: Conversion of a RawHtmlString to HTML output would be a single dereference.
16:02pandeiroweavejester: ah so it won't work
16:03pandeiroyes, (routes...) got it
16:03weavejesterpandeiro: Or (let-routes […] ...)
16:03TimMcI probably don't know enough about Hiccup's architecture.
16:04weavejesterTimMc: You'd need to concatenate RawHtmlStrings though, which might be slower than a StringBuilder.
16:04xeqiheh, forgot String was final for a moment, subclassings out
16:04pandeiroweavejester: didn't know about let-routes
16:05weavejesterpandeiro: It's a common operation, so there's a macro for it. Like defroutes is just (def … (routes …))
16:06pbostromedw: 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:07weavejesterIn 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:09sprocShouldn't the size of new features drive version numbers rather than the other way around?
16:11xeqibreaking backwards compatibility should; and if you're going to do that, might as well do the right thing then a hack
16:11S11001001sproc: that would have a very unfavorable outcome from users' perspective
16:14oddprobably a newbie question, but is there any way of "undefinining" an interface or protocol after it has been defined in the working namespace?
16:16amalloyno
16:17sproc"It's time for 2.0. Let's think of a big juicy feature to include."
16:17oddif 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:17dnolenodd: hmm I wouldn't think so.
16:18TimMcsproc: 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:18sprocHopefully they were already on the to-do list though.
16:19chousera protocol is kept in a var, isn't it? if co, it could be unmapped.
16:20oddwell, 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:21danielglauserStupid Emacs question, how do you comment out a function?
16:21uvtcM-;
16:21oddalso, if you run ns-interns, the names of your interfaces are not shown in the resulting map
16:21uvtcdanielglauser: Oh, whoops. That's to comment out the current region.
16:22danielglauseruvtc: Figured that out thanks. That works for me! I can highlight a function
16:22chouseroh, 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:22oddchouser: that's what I was afraid of.
16:22S11001001let's tangle clojure nses into classloader trees!
16:22TimMcdanielglauser: #_ in front of it :-)
16:22llasramAren't definterface and protocol interfaces loaded via DynamicClassloader ?
16:23llasramTimMc: +1
16:23llasram(inc TimMc)
16:23lazybot⇒ 15
16:23llasrameven
16:23dnolenodd: 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:23dnolenodd: chouser: could be wrong about that ...
16:23chouserah, that does seem likely.
16:24odddnolen: 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:24dnolenodd: hmm, that may be true - I don't use definterface much.
16:25odddnolen: 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:26dnolenodd: ah yeah I just tried at REPL, using definterface and then defprotocol w/ the same name does blow up.
16:27sproc/part/
16:28edwpbostrom: Yeah, that seems to (still) be the case. The answer, it seems, is to use Pusher.
16:28gtrakwhat's it mean on var-set "the var must be thread-locally bound"?
16:29S11001001gtrak: you have a binding on it
16:29S11001001,(doc binding)
16:29clojurebot"([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:29gtrakoh ok
16:29odddnolen: 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:31odd22: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:31oddoops, sorry
16:31cemerickare cljs tests really supposed to be run against v8 master?
16:31pbostromedw: I went the path of least resistance (for me): lein on an AWS micro instance
16:31cemericker, trunk I suppose?
16:31dnolencemerick: you can select a tag if you like, but yes I just test against master.
16:32edwpbostrom: Did you use webbit?
16:32dnolencemerick: also it's best to test against SpiderMonkey & JavaScriptCore as well.
16:32pbostromedw: no, aleph
16:32edwAh.
16:32edwIt's all Netty down below...
16:33cemerickAnd here I thought I was some minutes away from uploading a patch. :-|
16:35cemerickdnolen: seems like this is all begging to use selenium (or webdriver anyway)?
16:38dnolencemerick: http://github.com/clojure/clojurescript/wiki/Running-the-tests
16:38dnolencemerick: not sure why we need to involve a web browser at all for most tests. For browser REPL might be useful.
16:40cemerickdnolen: It's an easy way to automate the whole thing, and eliminates a contribution hurdle.
16:41cemerickThe same thing can be accomplished by automating setup of v8, SM, and JSC, but far more work that way.
16:42dnolencemerick: if you can put something together I'll check it out.
16:45cemerickdnolen: 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:48dnolencemerick: 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:50cemerickdnolen: 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:50dnolencemerick: you only need to build V8.
16:54dnolencemerick: 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:01cemerickdnolen: is a stack trace on SM expected? JSC tests clean.
17:01dnolencemerick: all tests in all engines should pass
17:01cemerick(this is with my changes stashed, clean from master)
17:05cemerickah, didn't notice the test-compile script :-P
17:06bobbywilson0,(max (map #(reduce + (take 4 %)) '((0 1 2 3 4)(5 6 7 8 9 10))))
17:06clojurebot(6 26)
17:06bobbywilson0I want 26 :(
17:06bobbywilson0er expect* 26
17:07cemerickIf only there was some kind of convention for building and testing a codebase…
17:07bobbywilson0,(max (6 26))
17:07clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
17:07bobbywilson0,(max [6 26])
17:07clojurebot[6 26]
17:07technomancycemerick: crazy idea; it'll never work.
17:07hyPiRionbobbywilson0: ##(reduce max [6 26])
17:07lazybot⇒ 26
17:08tmciver,(apply max [6 26])
17:08clojurebot26
17:08bobbywilson0hyPiRion: ahhh, I guess I assumed that max was doing an apply/reduce like thing
17:08bobbywilson0tmciver
17:09bobbywilson0thanks
17:09hyPiRionahh, where is that apply vs. reduce comment
17:10tmciverhyPiRion: is reduce preferred there for some reason?
17:11bobbywilson0hyPiRion: this? http://stackoverflow.com/questions/3153396/clojure-reduce-vs-apply I was actually just looking at it in another tab
17:12hyPiRionIt was an irc comment made by rhickey in 2010, still relevant.
17:12bobbywilson0hyPiRion: ah ok, don't have that then :)
17:12hyPiRionWell, wherever it is - prefer reduce when you can, unless when you're concatenating strings.
17:13hyPiRion,(time (apply + (range 100000)))
17:13clojurebot"Elapsed time: 165.123472 msecs"
17:13clojurebot4999950000
17:13hyPiRion,(time (reduce + (range 100000)))
17:13clojurebot"Elapsed time: 146.009283 msecs"
17:13clojurebot4999950000
17:13dnolencemerick: I'm not sure what test-compile does, I only run ./script/test
17:13cemerickhah
17:14thorbjornDXif I want something like a matrix (multidimensional vector), should I use Incanter? Or can I use some other structure
17:14duck11232apply + does reduce + under the covers, so all apply + gives you is more overhead
17:14cemerickdnolen: well, everything passed, and things look good in my interactive testing, so I'm calling it good. :-)
17:14dnolencemerick: cool!
17:15gfredericks,(time (loop [x 0, ns (range 100000)] (if (seq ns) (recur (+ x (first ns)) (rest ns)) x)))
17:15clojurebot"Elapsed time: 61.059024 msecs"
17:15clojurebot4999950000
17:15gfredericksduck11232: ^ interesting that apply + doesn't use loop instead
17:16hyPiRionduck11232: apply using reduce under the covers? err.
17:16duck11232The vararg form of + uses reduce
17:17hyPiRionAhh.
17:18hyPiRion,(time (apply str (range 1000000)))
17:18clojurebot"Elapsed time: 472.430258 msecs"
17:18clojurebot"01234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571...
17:18hyPiRion,(time (reduce str (range 1000000)))
17:18hyPiRionI believe apply will be faster here.
17:18clojurebotExecution Timed Out
17:20amalloythe 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:24gtrakis there like an inherit-fixtures for clojure.test?
17:26gfredericksamalloy: 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:32nz-anybody know how to setup externs with clojurescript?
17:33nDuffnz-: Using cljsbuild?
17:33nz-yes
17:33nz-I have <script src="http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.js&quot; type="text/javascript"></script>
17:33nDuffOkay. And you've written an externs file for it?
17:33nz-yes
17:34nz-but the location of the file is the problem. where to put it?
17:34nDuff:cljsbuild { :builds [{ :compiler { :externs ["path/to/your/externs.js"] } }] }
17:34nDuffI put it in src/main/externs/ myself, but then, I'm following Maven conventions for this project (don't ask).
17:36hyPiRionAha!
17:37hyPiRionamalloy: http://clojure-log.n01se.net/date/2009-01-12.html#13:48
17:38nz-that helped some
17:39nz-do I need to make also externs file for my cljs code
17:40nz-now it complains about ruuvi_ui.app.load_page(); that should correspond to (ruuvi-ui.app/load-page)
17:41nz-it says that ruuvi_ui is undefined
17:42jkkramera
17:47SegFaultAX|work2I'm getting that weird timeout issue on 4clojure again.
17:48SegFaultAX|work2It takes forever to start running the tests, but then by the time it gets to the last unit test, it timesout.
17:51nz-and my load-page looks like this: (defn ^:extern load-page [] ...)
17:54nz-works fine without compiler optimizations
17:55odd(whois sonkey)
18:00nz-seems that I have undeclared forward references. cljs compiler doesn't complain about then without optimizations and the thing works
18:01nz-is there a way to make cljsbuild to give error these kinds situations?
18:06AntelopeSaladdoes anyone have a good book on functional programming that isn't necessarily tied into clojure or any 1 language?
18:07jcromartieAntelopeSalad: SICP, or The Little Schemer
18:07jcromartietied to Scheme though
18:07jcromartiebut SICP will really make your head spin
18:07AntelopeSaladthanks
18:07jcromartiethere are some great "eureka" moments in it
18:08jcromartielike when they demonstrate that if you have closures, you don't need data structures :)
18:08jcromartiethere's a new build of SICP out there too
18:08AntelopeSaladis the one on github worth reading?
18:08AntelopeSalador should i stick to the old one released from mit
18:08nz-fixing the forward references does not help
18:10jcromartiehttp://sicpebook.wordpress.com/
18:10jcromartie(that's the one on github)
18:10AntelopeSaladok thanks
18:12nz-nDuff: externs seems to work if I put the extern file to closure-js/externs directory
18:12nz-nDuff: no need to add stuff to project.clj
18:12jcromartie,(every? even? [])
18:12clojurebottrue
18:12jcromartieI guess so...
18:13nDuffnz-: *shrug*. I've preferred to consider closure-js to be a build artifact, cleanable and rebuildable at will.
18:16nz-https://github.com/emezeske/lein-cljsbuild/issues/95
18:19nz-are there any tools to create extern file from a javascript lib?
18:21gf3sjl: Ping
18:21muhoo /sb end
18:23nDuffHuh. java.util.Collections$EmptySet isn't seq-able?!
18:23cpineraHi 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:25nDuff...no, (seq java.util.Collections/EMPTY_SET) works fine...
18:25seancorfieldHow 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:26technomancyeh; swank isn't broken
18:26nDuff...but when a 3rd-party library returns #< java.util.Collections$EmptySet$1@3b2601c>, not so much.
18:26technomancyif you need a debugger or inspector, you probably shouldn't switch yet
18:26technomancyseancorfield: but nrepl.el has a nice ido-var-browse thing that slime lacks =)
18:26seancorfield'kthx technomancy i genuinely wasn't sure how far along ritz was
18:26technomancysometimes I fall back to slime for the inspector though
18:26clojurebotslime-install is an automated elisp install script at http://github.com/technomancy/emacs-starter-kit/blob/2b7678e9a331d243bf32cd8b591f826739dad2d9/starter-kit-lisp.el#-72
18:26technomancygeez
18:27technomancyseancorfield: oh, I'm talking about nrepl.el specifically
18:27technomancyI haven't used ritz but expect it's a bit further along
18:27technomancyclojurebot: 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:27clojurebotI 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:28technomancydo us all a favour and pretend it never happened, k?
18:28seancorfieldyeah, 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:28technomancyritz was designed to be used with slime
18:28technomancyoriginally
18:28seancorfieldi haven't converted my team to emacs yet (i know, heathens!) so it's not really an important decision for us yet...
18:29technomancyshouldn't need to get everyone to agree
18:29technomancywait are you guys still on lein1?
18:30llasramWell, 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:31technomancyit helps to have someone who knows where their towel is, or several people who know where various assorted towels may be found
18:31technomancycertainly less knowledge redundancy with a shared toolset =)
18:31llasramOh, 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:32technomancythat's an excellent excuse
18:32seancorfieldtechnomancy: no we moved to lein2 for everything - hence my attempts to get lein-daemon working with lein2
18:33technomancyoh right
18:33dnolencemerick: patch applied to master, thx!
18:33cemerickdnolen: great, thanks :-)
18:34thorbjornDXI 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:36technomancythorbjornDX: what did you try in the repl?
18:36seancorfieldthorbjornDX: did you (require 'clojure.math.combinatorics) in the repl first?
18:36thorbjornDXtechnomancy: 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:37thorbjornDX`lein repl` immediately gives me a stacktrace
18:37technomancythe require form is probably wrong
18:38thorbjornDXtechnomancy: (:require math.combinatorics) ?
18:38thorbjornDXoh, I probably need a 'clojure' in there somewhere
18:40thorbjornDXseancorfield: technomancy: fixed, thanks
18:43seancorfieldyay! glad you got it working... what are you using combinatorics for? always curious what folks are using mark's math libs for...
18:45thorbjornDXseancorfield: generating tiles using cartesian-product
18:48antares_why didn't I discover cheshire.custom before. Best of both cheshire and data.json's extensibility.
18:49Frozenlo`cemerick: As usual, excellent job with the podcasts! I really appreciate to hear the various clojure's voices :D
18:56nDuffShould 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:56nDuff(feels wrong, but can't quite put my finger on it...)
18:57technomancywhy not plain into?
18:57antares_,(into #{} [1 2 3])
18:57clojurebot#{1 2 3}
18:57antares_,(set [1 2 3])
18:57clojurebot#{1 2 3}
18:57technomancy(into some-set some-seq)
18:58nDuffHmm -- "why not" is a good question.
18:58nDuffAhh -- some-set can potentially be nil
18:59technomancyjust call set on it first
18:59antares_,(set nli)
18:59clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: nli in this context, compiling:(NO_SOURCE_PATH:0)>
18:59antares_,(set nil)
18:59clojurebot#{}
18:59nDuffahh!
19:02amalloytechnomancy: i think (set some-large-other-set) is expensive
19:02amalloyin the same way that (vec some-large-vector) is expensive
19:02technomancyboo
19:02technomancywell, or then
19:03antares_amalloy: is a couple of hundreds of elements large?
19:04raek(into (or some-set #{}) some-seq)
19:05frioantares_: my guess is no, but i don't know what the logic is there
19:06aperiodicamalloy: why can't it just check if the argument is already a set/vec, and return it if so?
19:06TimMcnDuff: fnil
19:06TimMcerr, I'm being silly
19:07TimMcOh, and raek already gave the right answer. :-)
19:10pobodyhello all, is anyone in here familiar with running a lazybot instance?
19:11brehaut~anyone
19:11clojurebotJust 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:11casionthat would have be so much better coming from lazybot
19:11brehautim pretty sure Raynes knows something about it
19:12pobodyi thought he might :-) but i wasn't sure if he'd be around
19:13brehautyou could also try #flatland perhaps?
19:13pobodybrehaut: thanks for the idea
19:18weavejesterIs there something in Clojure that can take a set of promises and return the first one delivered a value?
19:18weavejesterKinda like a "select"
19:19Urthwhytefilter and take first?
19:20weavejesterI mean like the C select function. Something that tells me which promise is delivered to first.
19:20wmealing_weavejester: i love the idea
19:20wmealing_weavejester: i just can't think how to implement it
19:20nDuffWhy not just have one promise?
19:20technomancyseems like you could make a promise-like macro that delivered to a shared promise first and block on that
19:21nDuffAlso curious about the use case, and how it varies from a case where a traditional queue is appropriate.
19:21hiredman1.4 lets you pass in a timeout to deref
19:21hiredmanso you could use that and a loop to roll your own
19:22hiredman,(doc delivered?)
19:22weavejesterI was considering using HTTP async to query many URLs at once, and didn't want to start a thread for each.
19:22clojurebotNo entiendo
19:22SegFaultAX|work2(doc deref)
19:22clojurebot"([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:22nDuffweavejester: What do you do with the results from the others? Are they eventually processed?
19:23weavejesternDuff: Yep
19:23nDuffweavejester: ...sounds like the right abstraction is a queue, rather than a series of promises.
19:23weavejesterYeah, but http.async.client returns a promise
19:23nDuffAhh.
19:24hiredmandoes it return a real promise, or just something like a promise?
19:24hiredmanit might return something you can attach callbacks to
19:25tanzoniteblackQuestion 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:26weavejesterhiredman: Looking at the source now...
19:27hiredmanwhatever http.async.client is built on definitely supports some kind of callback on the futures it returns
19:30weavejesterhiredman: 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:30hiredmanweavejester: *cough* really the first time you say?
19:31weavejesterhiredman: Did you have another library in mind?
19:31hiredmanno
19:31hiredmanjust lots and lots of wrappers everywhere
19:31weavejesterUsually they're all pretty good, though :)
19:32weavejesterAt least the ones I've used are.
19:32weavejesterOh wait, looks like there are callbacks… I think...
19:32djanatynhmm. I'm having trouble writing a function that determines if whatever you pass it is divisible by several numbers
19:34friowhat are you doing djanatyn?
19:34frioi can think of how to solve that easily, but idk what the clojure for it would be :)
19:34djanatynwell, I'm trying to show my brother, who asked a question :)
19:34weavejester,(div 8 2)
19:34clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: div in this context, compiling:(NO_SOURCE_PATH:0)>
19:35djanatynhe was wondering if every composite number was divisible by 2, 3, 5, and 7
19:35frio(any (eq 0) (map #(modulo numerator) denominators)) is roughly what id do
19:35djanatyns/and/or
19:35friobut idk what the actual clojure names/libraries/etc. are :)
19:35weavejesterWell, there's mod, but I thought there was also a div
19:35tomojjust show him 11*13?
19:35tanzoniteblack,(every? #(= 0 (mod 8 %)) '(2 4))
19:35clojurebottrue
19:36djanatyntomoj: it's cooler to run a functino over a big list to demonstrate why programming is cool ;)
19:36tanzoniteblack,(every? #(= 0 (mod 8 %)) '(3 4))
19:36clojurebotfalse
19:36frioah - % is an argument to a lambda in clojure?
19:37frio(i thought it had some special syntactical meaning, which is why i didn't reach for it for expressing modulo :p. /notes down)
19:37tanzoniteblackfrio: more specifically % is an argument to a lambda in clojure that's created by the #() method
19:37groovemonkeybeginner 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:37S11001001frio: %? it does in some contexts, as tanzoniteblack says
19:37friocool tanzoniteblack, thanks
19:38djanatyntanzoniteblack: I like that solution :) thanks!
19:38djanatynthe every? function is cool.
19:38tanzoniteblackfrio: we could also write that as ##(every? (fn [n] (= 0 (mod 8 n))) '(2 4))
19:38lazybot⇒ true
19:38S11001001groovemonkey: it's complicated.
19:38weavejesterIt looks like there are callbacks in http.async.client.request
19:38S11001001groovemonkey: are you a clojure beginner, or clojure intermediate just starting with STM?
19:39weavejesterI kinda wish that it used something other than promises by default though
19:39groovemonkeyS11001001: somewhere in between
19:39groovemonkeyright now I'm fiddling around with various combinations of (dosync (alter mappy conj....
19:40S11001001groovemonkey: alright, well if you want to mess with refs now, go look up longer documents on dosync usage
19:40groovemonkeyS11001001: roger.
19:40tomojweavejester: already rejected aleph?
19:40friotanzoniteblack: 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:41weavejestertomoj: Actually, I forgot aleph had a client side
19:42zerokarmaleftwhen i call gen-class, if i set :extends or :implements does that class/interface automatically get imported into the ns?
19:42S11001001groovemonkey: 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:42tomoja request returns an async result, to which can attach callbacks
19:42tomojs//you/
19:43tanzoniteblackfrio: as far as I know, there's no implicit arguments unless you use "partial".
19:43tanzoniteblack,(map (partial + 1) [1 2 3])
19:43clojurebot(2 3 4)
19:44frioOK, cheers tanzoniteblack
19:44groovemonkeyS11001001 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:44djanatynhaha, I don't think my brother enjoyed that snippet of code as much as I did
19:44djanatynthanks, tomoj :)
19:44groovemonkeyS11001001: it's just nested maps
19:45weavejestertomoj: Yeah, I might go with Aleph. Channels should be pretty nice in this case.
19:46S11001001groovemonkey: 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:46zerokarmaleftgenerate-class is a hairy method O.o
19:49groovemonkeyS11001001: 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:50weavejesterHm, I'm assuming the Lamina function "join" joins two or more channels together, but there's no docs and no docstring
19:51Frozenlo`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:52Frozenlo`It happens only when I have the browser.repl/connect in my cljs file. (Which I have reduced to the bare minimum)
19:53FrozenlockHere is the part of js where Chrome and Firefox choke https://www.refheap.com/paste/4917
19:56FrozenlockThis is my punishment for rebooting my machine. Must never do it again.
20:04thorbjornDXhow do I use '->' when I need to pass multiple arguments?
20:05scottjthorbjornDX: be more specific? (-> 1 (+ 2 3 4 5))
20:06thorbjornDXscottj: I have a fn that takes two arguments, and I want to do (-> 3 4 myfn myotherfn myfn)
20:07thorbjornDXscottj: ofc that doesn't work
20:07thorbjornDXscottj: I'd want the equivalent shorthand for (myfn (myotherfn (myfn 3 4)))
20:08scottjthorbjornDX: (-> 3 (myfn 4) myotherfn myfn)
20:08thorbjornDXscottj: ah, okay
20:13fentonwhen 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:15antares_fenton: more likely with what directories you have on classpath
20:17fentonantares_: this works fine: InputStream stream = this.getClass().getClassLoader().getResourceAsStream("test.txt");
20:17fentonantares_: the file IS in the root of my clojure library...
20:17antares_fenton: try with a clojure.lang.DynamicClassloader instance
20:18fentonantares_: could u elaborate a tad more...sorry clojure newbie here...
20:18antares_fenton: I am not sure Leiningen includes repository root to the classpath
20:18antares_fenton: replace this.getClass().getClassLoader(). with clojure.lang.DynamicClassloader()
20:18antares_new …
20:19thorbjornDXscottj: I ended up requiring my functions to take a vector as their argument, it suited my problem better
20:19antares_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:19fentonantares_: 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:19antares_fenton: how do you run your Java program?
20:20antares_it may be that classpath is set differently from how Leiningen does it
20:20fentonantares_: at the moment just inside Eclipse for testing.
20:20antares_Eclipse definitely can have different defaults w.r.t. repository root from Leiningen
20:21fentonantares_: well the file is right there smack dab at the root of the jar...
20:22fentonseems when the java code calls into the clojure code, the clojure loses it...
20:22antares_fenton: you can check that hypothesis by using a clojure.lang.DynamicClassloader instance
20:23fentonantares_: so use that from inside the clojure library?
20:24antares_fenton: from your Java program that has clojure jar available to it
20:24antares_this is what Clojure typically uses and I guess io/resource can use it, too
20:25fentonok let me give it a whirl, I'll report back later...mom has shown up for dinner same time! :)
20:35ivanzakwilson: "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:35ivanhttps://github.com/lozh
20:36ivanthe magic of googles ;)
20:44jhowarthI 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:44amalloy&(doc juxt)
20:44lazybot⇒ "([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:44jhowarththanks
20:48amalloy~juxt
20:48clojurebotjuxt is a little hard to grok but it's the best thing ever
20:48amalloyclojurebot: regale me with more tales of juxt
20:48clojurebotHuh?
21:06Hodappokay... 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:06Hodappblarg
21:07mthvedti haven't had much luck with intellij+clojure
21:07HodappIntelliJ + Clojure seems okay - can get to a REPL and everything
21:07HodappI also installed the Leiningen plugin and I have no idea how to get to it from the IDE
21:08Hodappbut it's running fine from the commandline
21:08gfrederickswhy does lein-cljsbuild need to run in a "subproject"? what does that even mean?
21:08antares_Hodapp: lein1 puts them to ./lib, lein2 to ~/.m2/repository
21:09antares_gfredericks: I used it as a regular lein plugin, w/o any subprojects
21:09Hodappahhh, I kept looking for ~/.lein-somethingorother
21:09Hodappthanks
21:09antares_Hodapp: you can make recent IDEA versions download deps from Maven
21:09antares_it's a little hard to find but it is somewhere on the Libraries "tab" in your project settings
21:09gfredericksantares_: I'm wondering wrt https://github.com/emezeske/lein-cljsbuild/issues/132#issuecomment-8286371
21:10antares_it is also a bit slow (well, Maven search is)
21:10antares_but that's what I use for key dependencies
21:10Hodappright 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:12Hodapphmm, but does ~/.m2/repository do my any good for a classpath when they're all in separate dirs?
21:14Hodappmaybe I should just use Emacs... or ignore IntelliJ...
21:15xeqigfredericks: 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:15gfredericksxeqi: but also that it runs as a separate process I presume
21:15xeqiatm yes
21:15gfredericksand this has to be done because lein's classpath won't have all the sources and whatnot on it
21:16xeqiwell, to keep leiningen and the project seperate
21:16FrozenlockAAAAAAAH I'm such an idiot! An entire evening wasted because I was including my js before my page body!
21:16gfredericksI 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:17FrozenlockMay my suffering be useful to others...
21:17gfredericksFrozenlock: I meant to tell you not to do that
21:17Frozenlockgfredericks: I know, right? Sheesh
21:17Hodapphttps://github.com/derkork/intellij-leiningen-plugin/issues/11 gaaah
21:18Hodappthis is why I sometimes want to stab IDEs in the face.
21:18xeqiHodapp: in general emacs and eclipse w/ counterclockwise have the best support, followed by vim, followed by a large large gap
21:18HodappI see
21:19Hodappwhat do you prefer?
21:19Hodappif I switch from vim to emacs, don't I have to go be re-baptized or something?
21:19FrozenlockYup.
21:19xeqiI use emacs, but I wouldn't tell you to do that if you aren't used to it
21:20FrozenlockBut you don't want to go to Hell, do you? Thus you must be baptized.
21:20xeqivim is decent I hear. lein-tarsier is suppose to make it easier to use clojure
21:20xeqithough its outside of my perview
21:21FrozenlockWell at least Emacs is in emacs-LISP, and clojure is a LISP. There is some similarities if you intend to customize it.
21:21Hodappthanks, I will check some of these out
21:21HodappEmacs is one of those programs I never learned further than C-x C-c.
21:22mthvedti use vim and tarsier, works like a charm
21:22brehautFrozenlock: elisp is regular lisp with a prion disease though
21:22xeqigfredericks: 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:23kovasbhttps://github.com/richhickey/edn
21:23Frozenlockbrehaut: prion?
21:23kovasbedn is landing
21:23brehautFrozenlock: its a protein that when it binds with an existing protien creates more of itself. causes mad cow disease
21:24gfredericksxeqi: okay I'll leave a reply to the comment and see what he says
21:24brehautFrozenlock: some people like to tell horror stories about chicken nuggets carrying prions
21:24HodappI'll check out vim-tarsier. As much as I like Eclipse for Android development, I think I might like to stay initially clear.
21:25cgagvim and tarsier is solid
21:25Frozenlockbrehaut: yeah thanks about that, now I won't be able to eat chicken :P
21:25cgagoccasionally i consider doing emacs + evil
21:25HodappI 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:26brehautFrozenlock: best not google the chicken nugget making machine
21:26FrozenlockMust... stop... myself...
21:26Hodappand with that, I'm out! enjoy your talk about... food-borne illnesses and editors
21:26antares_are there any options for generating and parsing XML better than data.xml?
21:26FrozenlockOh Nova, why do you hate my eyes? http://www.pbs.org/wgbh/nova/madcow/prions.html
21:46FrozenlockIf I watch an atom from another namespace in cljs, do I need to use ^export or something like that?
21:46gfredericksI wouldn't think so
21:48duck1123wouldn't you only need export if you wanted to access it from js?
21:48gfredericksexactly
21:48gfredericksif the name of the var of the atom gets munged, so should your use of it somewhere else
21:49duck1123munging doesn't take care of accessing it as an array, does it?
21:50duck1123I 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:51FrozenlockI tried to rely entirely on closure library for this reason. Sometimes I wonder if it's really worth all the trouble.
21:51duck1123I'm using Knockout, Jquery, and Backbone
21:52friofrom cljs duck1123?
21:52duck1123yes
21:52friointeresting
21:52frio(those are libraries i typically rely on too; i haven't tried cljs yet)
21:53duck1123https://github.com/duck1123/jiksnu/tree/pending/src-cljs/jiksnu
21:54Frozenlockduck1123: GPL and Bitcoins? Man, I love you :p
21:54duck1123still heavily in flux. I just recently got into KO
21:54duck1123lol
21:55bobbywilson0what is the major problem with this?
21:55bobbywilson0,(defn chew [series] (println (reduce * (take 4 series))) (chew (rest series)))
21:55clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
21:56bobbywilson0I get a stack overflow :-( but I didn't think I would with `rest`
21:56xeqibobbywilson0: chew calls chew. how does it know to stop?
21:56bobbywilson0xeqi: uhhh, when it hits nil?
21:57duck1123If you want TCO, use recur
21:57bobbywilson0duck1123: I don't necessarily care about TCO just trying to learn stuff now
21:57bobbywilson0xeqi: I guess I need a condition?
21:57metellus,(rest nil)
21:57clojurebot()
21:57metellus,(rest '())
21:57clojurebot()
21:58bobbywilson0so the problem is just that it will call chew on (rest nil) indefinitely I take it?
21:58xeqibobbywilson0: you need an (if (not (empty? series)) ...) type condition yes
21:58Scriptorrecur is specifically for TRO, though, just tail recursion
21:58xeqiyep
21:58duck1123(defn chew [series] (when (seq series) (println (reduce * (take 4 series))) (recur (rest series))))
21:58Scriptor(seq (rest '()))
21:58Scriptor,(seq (rest '()))
21:58clojurebotnil
21:59zakwilsonivan: thanks.
21:59ivannp
21:59bobbywilson0you guys are the best! I appreciate it. not a lot of other language rooms like this
22:02FrozenlockOh sure, use `def-' Frozenlock, and then wonder why your code doesn't work.
22:02FrozenlockI'm pretty sure there was only coffee in this mug.
22:03duck1123I'm sure we've all been there
22:11jcromartie,(doc =)
22:11clojurebot"([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:12jcromartie,(= 1 1.0)
22:12clojurebotfalse
22:12jcromartie"compares numbers … in a type-independent manner"
22:12jcromartie,(= 1.0 1.0M)
22:12clojurebotfalse
22:12amalloythat part is a cruel joke played on us by rich
22:12duck1123except for that
22:13amalloyyou have to use == for numbers
22:13duck1123that used to work, but in the end, it's for the better
22:13amalloyduck1123: really?
22:13amalloy(ie, really for the better. i know it used to work)
22:13duck1123I'm pretty sure that worked in really early versions
22:13jcromartiesounds like the docs need to be addressed then
22:13jcromartienot a big deal right?
22:14jcromartieat least there's no ===
22:14duck1123amalloy: it's not a happy trade-off, but I'll take numbers working fast over (= 1 1,0)
22:14mthvedtiirc, in java, 1 != 1.0
22:15Sgeo,(doc ==)
22:15clojurebot"([x] [x y] [x y & more]); Returns non-nil if nums all have the equivalent value (type-independent), otherwise false"
22:15jcromartieduck1123: keep your filthy communist numbers out of here… it's "1.0"
22:15FrozenlockSgeo: you should check common lisp :P
22:15amalloymthvedt: wrong
22:15mthvedtwhere one is an integer and one is a bigdecimal
22:15duck1123but really, comparing the number 1 to 1.0 is not something that should be taken lightly
22:15jcromartiemthvedt: in Java 1.0 would be a double by default
22:17jcromartie1: int, 1.0: double, 1.0f: float, 1.0M: BigDecimal
22:18duck1123,(== 1 1.0)
22:18clojurebottrue
22:18mthvedt,(= 1.0M 1M)
22:18clojurebotfalse
22:18mthvedthm
22:19AustinYunoh man
22:19duck1123interesting
22:19mthvedt,(< 1M 1.0M)
22:19clojurebotfalse
22:19mthvedt,(> 1M 1.0M)
22:19clojurebotfalse
22:19AustinYunimporting shit and class paths is so complicated
22:20duck1123AustinYun: Sometimes, but usually lein takes care of most things. What are you trying to do?
22:20jcromartie(map type [1M 1.0M])
22:20jcromartie,(map type [1M 1.0M])
22:20clojurebot(java.math.BigDecimal java.math.BigDecimal)
22:21jcromartieBigDecimal is special
22:21AustinYunlol i'm trying to add another file to a leiningen project, that's what
22:22duck1123another clojure source file? a resource?
22:22xeqi... a free floating jar?
22:22duck1123that'll do it
22:25AustinYunit's nothing, i'm just bitching
22:25yankovif 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:27jcromartie,(= (int 1) (long 1) (bigint 1))
22:27clojurebottrue
22:28jcromartiethis is the clincher: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L978
22:28jcromartiethe numbers must be in the same "category"
22:31duck1123yankov: That's a rough question. I would probably build it off of clojure's collection types, but as for the algorithm...
22:32duck1123That's a good ML question though. I look forward to reading the thread
22:35AustinYunok, when do you use :require vs :use
22:37brehautwith 1.4 you can just always use :require and :refer as needed
22:37brehautbut thats not really answering your question
22:38AustinYunok, i have a generic leiningen project skeleton
22:39metellusAustinYun: 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:39metellusI can't promise that it's completely current though
22:39AustinYunwhy 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:40brehautmetellus: its been updated for 1.4
22:41AustinYunkeeps 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:42brehautAustinYun: im guessing here, but i think you need to call the file db_setup.clj and have a namespace of db-setup
22:42AustinYun...wtf for
22:42brehauthyphens arent legal characters for java identifiers, so clojrue name munges them to underscores
22:43brehautlike i said though, im guessing.
22:43brehautbeing an arse will get you no help
22:44AustinYunthere'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:45metellus(inc irc)
22:45lazybot⇒ 1
22:46metellus(dec docs)
22:46lazybot⇒ -1
22:46akhudekhm, can you no longer add new lein tasks directly to project.clj with lein2?
22:47brehauthttp://clojure.org/libs
22:47brehautright there 'Hyphens in the lib name are replaced by underscores in the path'
22:47brehaut(inc docs)
22:47lazybot⇒ 0
22:47brehaut(dec not-reading-the-docs)
22:47lazybot⇒ -1
22:47AustinYuni didn't say it's not because i'm an idiot
22:47casionleiningen explains it in its docs as well
22:48casionthat's where I made the connection originally
22:48brehautclojure.orgs docs get a bit of grumping from the community, but if you dont read them, you are seriously disadvantaged
22:50xeqiakhudek: https://groups.google.com/forum/?fromgroups=#!topic/leiningen/jQle_S1wo7Y
22:51akhudekthanks xeqi !
23:40rbarraudYo... What was suggested Linux irc client for use over ssh + screen again? OT apologies...
23:40AustinYunis there a way to require a single function out of a namespace with :require?
23:41AustinYunrbarraud: i'm using weechat atm
23:41metellusrbarraud: irssi or weechat
23:41rbarraudThanks aus
23:41rbarraudA irssi was the one I was half remembering ... Thanks
23:42jkkramerAustinYun: (ns example.core (:require foo.bar :refer [baz])) makes baz available within example.core
23:42AustinYunfrom 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:43AustinYuni've heard architecturally weechat is more modern but it's not as if i've looked at the source for either of them
23:43AustinYunjkkramer: thanks
23:44rbarraudHmmm.... Target host is too old or something... Neither avai
23:44rbarraudAn
23:44nsxtirssi + nicklist will get you nicks if you need them
23:44rbarraudAvailable *
23:44rbarraudAny other possibly more archaic suggestions?
23:45AustinYunhm... bitchx?
23:45AustinYunor ircii
23:47AustinYuni take it you're ssh-ing into a remote system somewhere and are relying on it's package manager or something?
23:52AustinYunok so everything's working now, lol, thanks brehaut
23:53Sgeo:( at http://talkingtomachines.org/chapter/1/6 calling fn a function