#clojure logs

2015-09-02

00:38ddellacostais there a simple way to cleanly include utility functions in project.clj other than simply pasting them in at the top of the file?
00:39ddellacostaload-file has problems when used in context with other stuff, unfortunately
00:39ddellacostaI would even be happy to use "declare" at the top but that doesn't work
02:13Empperihttp://blog.getprismatic.com/schema-1-0-released/
02:35crocketWhy does (swap! server (fn [x & rest])) cause clojure to say "Unable to resolve symbol: x in this context"?
02:35crocketI just set the atom to null.
02:35crocketI just want to set the atom to null.
02:36opqdonutthe fn needs a body I guess
02:36opqdonuthmm, it seems you can skip the body
02:36crocketIt doesn't need a body.
02:36opqdonutbtw, why not (reset! server nil)
02:36crocketouch
02:37opqdonutanyway, that snippet works for me, are you sure you don't have a non-breaking space in there or something like that
02:37crocketI use clojure 1.7
02:37opqdonutoh right
02:38opqdonutI was actually on 1.5 just now
02:38crocketWhat did rich hickey do?
02:38crocketNow, it's doing something that I don't understand.
02:38crocket(swap! server (fn [x & rest])) doesn't compile
02:50Empperiyou're missing function body
02:50Empperi(swap! server (fn [x & rest] nil))
02:50Empperiwill compile
03:17crocketEmpperi, It seems that if I (swap! server (fn [x & rest] nil)) in a when-let form, clojure says "Unable to resolve symbol: x"
03:17crocketIf I put (swap! server (fn [x & rest] nil)) in a when-let form, clojure says "Unable to resolve symbol: x"
03:21TEttingercrocket: I'm guessing somewhere a paren isn't lined up
03:21Empperiyeah
03:21Empperigot to be that
03:22TEttingeralso, (constantly nil)
03:22TEttinger,(swap! (atom 0) (constantly nil))
03:23clojurebotnil
03:23TEttingeror just
03:23TEttinger,(reset! (atom 0) nil)
03:23clojurebotnil
03:26crocketTEttinger, impossible
03:26TEttinger,(swap! (atom 0) (fn [x & rest] nil))
03:26clojurebotnil
03:26crocketNow, put that in a when-let form.
03:26TEttinger(doc when-let)
03:26clojurebot"([bindings & body]); bindings => binding-form test When test is true, evaluates body with binding-form bound to the value of test"
03:27crocket,(when-let [ohayo true] (swap! (atom 0) (fn [x & rest] nil)))
03:27clojurebotnil
03:27TEttinger,(when-let [server (atom 0)] (swap! server (fn [x & rest] nil)))
03:27clojurebotnil
03:27crocketweird
03:27crocket,(version)
03:27clojurebot#error {\n :cause "Unable to resolve symbol: version in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: version in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: version i...
03:27TEttingersomething got screwed up in your REPL I imagine
03:28TEttinger,*clojure-version*
03:28clojurebot{:major 1, :minor 8, :incremental 0, :qualifier "alpha3"}
03:28TEttinger&*clojure-version*
03:28lazybot⇒ {:major 1, :minor 7, :incremental 0, :qualifier "alpha1"}
03:28TEttinger&(when-let [server (atom 0)] (swap! server (fn [x & rest] nil)))
03:28lazybot⇒ nil
03:28TEttingerin 1.7 and 1.8 alpha3, it is the same behavior. it is not a clojure bug
03:28crocketTEttinger, The problematic code is http://dpaste.com/3F22TJ7
03:29TEttingerha
03:29TEttingeryou used fn for the name
03:29lumayou're overwriting fn
03:29crocketHell
03:29lumaso your (fn [x & rest]) isn't a function
03:29lumait's not the fn macro
03:29crocketNow, it compiles.
03:29crocketHow did I not catch it?
03:30TEttingerwhy did you use fn for a name in the first place?
03:30crocketI was trying to write it fast.
03:30TEttingerwell that's a mistake that you won't make again, I bet :)
03:30crocketI thought @server evaluated to a function before.
03:31TEttingerit might
03:32TEttingerbut the binding is a name, so you would have a local (with the value of whatever @server is) called fn, and since it can't be a macro, anything that passes it [x & rest] will evaluate x
03:32crocketok
03:33crocketI didn't think twice about the name.
03:33TEttingerI feel like eastwood might catch that automatically
03:34TEttingerseems like something a linter might catch quickly
03:34TEttinger(especially if you have a much more complicated function that #clojure can't make sense of easily but a linter might)
04:58neoncontrailsAny former Schemers here? Is alter just set!, or is it different somehow?
04:58neoncontrailsThe 'transaction' component throws me off a little bit.
05:01amalloyit is super different
05:01neoncontrailsI had a hunch.
05:02amalloyyou can't just set! any old thing. most values and bindings are immutable
05:02amalloyinstead of figuring out alter, try figuring out swap!, which is much more common and also simpler
05:02neoncontrailsAre we talking Scheme or Clojure? You must mean Clojure.
05:03amalloyof course
05:04neoncontrailsInteresting. Let me see if I'm putting the pieces together correctly...
05:05neoncontrailsIn Scheme, mutation is accomplished either by changing the atomic value (if the variable is an atomic type) or else by changing the evaluation environment
05:05neoncontrailsIn Clojure, mutation is... kind of a switcheroo, followed by garbage collection?
05:06amalloymutation is mostly not done
05:06amalloybut in the particular case of objects which exist for the purpose of being mutable cells pointing to other immutable data, such as (atom 0)
05:07amalloythen we have functions that let you compute the new value for the mutable cell to point to, based on the old value
05:07neoncontrailsoh wow. I'm going to need a second to process this
05:10neoncontrailsI think this is starting to explain some things I was obliquely confused about last week
05:14neoncontrailsSo if I'm understanding you right, atoms can't arbitrarily be made to point at an anonymous function (a self-incrementing counter, for instance) because....
05:15neoncontrailsThe main difference with Scheme being the result of applying functions to objects are computed in an even lazier fashion?
05:15amalloyno, i think everything you just said is false
05:15amalloywell
05:16amalloysome confusion may arise from your use of the word "atom", which means different things in scheme and clojure
05:16neoncontrailsi'm definitely wording it quite badly, in either case
05:16neoncontrailsHuh. What's the difference?
05:16neoncontrailsScheme defines it as not a list
05:17amalloyyeah, well clojure has more than one data structure so that is not a very useful definition
05:17neoncontrailswhich clearly isn't expressive enough for a Clojure definition
05:17neoncontrailsHaha, yes
05:17amalloyclojure doesn't really have a synonym for the scheme concept of atom. there's just "values"
05:17amalloyinstead, an atom is
05:17amalloy,(doc atom)
05:17clojurebot"([x] [x & options]); Creates and returns an Atom with an initial value of x and zero or more options (in any order): :meta metadata-map :validator validate-fn If metadata-map is supplied, it will become the metadata on the atom. validate-fn must be nil or a side-effect-free fn of one argument, which will be passed the intended new state on any state change. If the new state is unacceptable, the v...
05:18amalloya box that holds a single pointer to some value, and can be made to change that pointer to some other value
05:19neoncontrailsI see. So it's not in any sense structurally a pair
05:19amalloy,(let [x 1, a (atom x)] (do (swap! a + 5) {:x x, :a @a}))
05:19neoncontrailsit's just a name with a pointer
05:19clojurebot{:x 1, :a 6}
05:19amalloynot even a name
05:19amalloyit is just a value, like the number 1
05:20amalloyin my example here, in that particular lexical environment a is bound to an atom, but that's in the environment: the atom itself has no name
05:20amalloy,(swap! (atom 5) + 10)
05:20clojurebot15
05:21neoncontrailsSo an atom with a name is not an atom then? But an 'object'?
05:21neoncontrails(what's more correct than object in this context?(
05:21amalloyobject is fine
05:22neoncontrailsClosure?
05:22amalloybut there is no such thing as an atom with a name. there are objects, including as one special case atoms. and there are names for things, in a lexical environment or the global environment
05:23amalloyneoncontrails: what is the name of the list (1 5 8)?
05:23neoncontrailsI don't suppose that it has one, does it?
05:23amalloyit doesn't have one, of course. you might choose, in some context, to create a name for the purpose of referring to it, but the list itself doesn't have a name as some internal property
05:24amalloythis is a fundamental concept of how variables work in clojure, and it's the same as how they work in scheme so i don't understand what you are confused about
05:25amalloythere are values, which don't have names, and then there are lexically-scoped names that refer to those values
05:26neoncontrailsI'm just trying to get a feel for the similarities and differences, because there's lots of both
05:27neoncontrailsIn Scheme atoms are concretely implemented as pairs, in which case a variable and its name share the same scope I think
05:27neoncontrailsSmall difference, but it seems like a difference
05:27amalloyno, in scheme an atom is literally something that is not a pair
05:28amalloyvariables and names are roughly the same thing, but that's very different from a *value*. (let ((x 1)) ...), 1 is a value, x is a variable/name
05:29neoncontrailsHmmm... you could be right
05:30amalloyyou can't talk about a name, or a variable, divorced fom the scope/context in which it's valid. but the number 1 is always going to be 1, whether i call it x or n
05:30neoncontrailsMy university really brow-beat us on the fact that everything that Scheme is ultimately represented as a pair, which in the case of atoms were just a name and a value
05:31amalloywellllllll, in a particular scheme implementation that may be how the interpreter implements the concept of an environment
05:31neoncontrailsBecause in Scheme it's appropriate to call an x defined by (define x 3) an atom
05:32amalloybut from the point of view of someone using the language, not implementing it, it's certainly not the case that everything is a pair
05:32neoncontrailsthat's a good point. We used a very particular dialect optimized for object-oriented pedagogy
05:33neoncontrailsyes that's true
05:34neoncontrailsAt a high level, how would you summarize the differences between Scheme and Clojure?
05:34amalloyuh
05:35neoncontrailsI mean, differences of JVM and datastructures aside
05:35amalloydecline to state
05:35neoncontrailsThere's probably a philosophical difference in there somewhere
05:35amalloya lot of them
05:36amalloytry watching one of rich's introductory videos, like simple made easy, or clojure for lisp programmers
05:36neoncontrailsI might do that. I've seen him speak before and it left a huge impression on me before I had any idea what he was talking about
05:37neoncontrailsI should revisit them now that I'm a little more experienced
05:40spaceplukis anybody familiar with storm? why isn't it possible to pass a predicate as a parameter to a bolt but it does work in the body?
05:48neoncontrailsNot familiar with storm, but I'm looking at the sourcecode for shits and giggles. Holy macros. Quite nice
05:49spacepluk:)
05:49neoncontrailsDoes that behavior not follow from the defmacro for bolt?
05:50neoncontrailsIt just seems like the way that function is defined, you'd be applying a predicate to a predicate
05:50spaceplukI have no idea my knowledge of both storm and clojure is still superficial :?
05:51spaceplukI have this "problem" with defbolt though
05:53spaceplukthe (if (:prepare opt) part
05:54spaceplukno sorry the (if params ...
05:55spaceplukwhen you define a bolt with params it returns a function that you can call to create a configurable bolt
05:56spaceplukI'd like to define map/reduce/filter bolts but it doesn't seem to be possible
05:56neoncontrailsooh I see. Yeah this macro syntax is above my head, I see what you mean though
05:56spaceplukI've skimmed through it but I'm not ready hehe
05:59neoncontrailsWhat if you use a for loop instead of applying a map?
05:59neoncontrails*what happens if, rather
05:59spaceplukyeah, I just implemented specialized bolts
06:00spaceplukbut I wanted the bolts to be sort of composable with the core logic functions
06:02spaceplukthen it's a lot easier to chage the computations at topology level
06:06neoncontrailstry this http://stackoverflow.com/questions/7314413/is-there-standard-foreach-function-in-clojure
06:07neoncontrailsIf I'm not mistaken, mapping over objects in a functional context really only makes sense insofar as you're trying to get the side effects
06:08neoncontrailsif it's the attribute values you want, then you need to use a forEach-like construct
06:09spacepluknow I'm lost hehehe
06:11spaceplukin storm a bolt is like a function/computation that gets applied to stream tuples that pass through it
06:12spaceplukthen you can emit new/more/less tuples (or nothing) depending on what you're trying to do and that can get piped to other bolts
06:12spaceplukso it's like operating on lists but distributed
06:13spaceplukthat's why I thought it could be useful to have map/reduce/filter bolts I think it fits
06:13spaceplukam I getting it all wrong?
06:15neoncontrailsNo I think you can still do what you're trying to do, but it's just a slightly different syntax
06:17spaceplukok, so I don't get what I should do with foreach
06:17spaceplukI mean doseq
06:17skeuomorferm, what do you folks use as a CSPRNG?
06:18TEttingerconcurrent secure pseudo RNG?
06:18skeuomorfCryptographically secure pseudo random number generator
06:18TEttinger"not mersenne twister"
06:19gilliardjava.security.SecureRandom ?
06:19skeuomorfheh
06:19TEttingerI'd be curious how Secure SecureRandom is
06:19skeuomorfgilliard: So, there isn't a native clojure thingy? I suspected so
06:20spaceplukskeuomorf: maybe /dev/random if you don't need cross-platformness :P
06:20gilliardI guess there's probably a wrapper lib somewhere? https://github.com/weavejester/crypto-random/blob/master/src/crypto/random.clj
06:20TEttingerit's not at all hard to implement the few random functions clojure has using SecureRandom
06:20TEttingershuffle, rand-nth, rand-int, rand, what else?
06:20neoncontrailsspacepluk: wish I could answer your question, I'm hesitant to answer it for fear of leading you astray :P
06:20neoncontrailsI did have a similar problem in Scheme once
06:21skeuomorfTEttinger: Well, I gave a quick look on the impl of SecureRandom just now, code is horrible, it calls sth called getProviders, and this sometimes falls back to something that starts with SHA1, I am horrified, will investigate later
06:21spaceplukneoncontrails: I appreciate any ideas you can throw at me :)
06:21skeuomorfspacepluk: Please don't use /dev/random, use /dev/urandom
06:21neoncontrailsSo you can think of map as basically acting on objects. Right?
06:21spaceplukskeuomorf: I was just checking the manual I never remember which one is the good one
06:21skeuomorfspacepluk: re: http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ and http://www.2uo.de/myths-about-urandom/
06:22gilliardTEttinger: I'd like to understand it better, too. SecureRandom's javadoc has citations.
06:22skeuomorfspacepluk: The manual is a LIE!
06:22spaceplukskeuomorf: really? wtf!
06:22neoncontrailsYou can map a typecasting operation to objects, for instance.
06:22skeuomorfspacepluk: Exactly!
06:22spaceplukskeuomorf: I'll read those, thanks for the tip
06:22skeuomorfnp
06:23neoncontrailsBut contrast that to what other languages (not Clojure apparently) call forEach(), which basically means you can control what the object does
06:23skeuomorfAfter I sleep and wake up, I will take a look at SecureRandom and assuming it's legit, I will use that
06:23skeuomorfideally, it'd use /dev/urandom on *nix and CryptGenRandom() on the horrible crap that's windows
06:23neoncontrailsso you can have it return values, and in the context of the forEach-like loop, apply your predicate
06:24skeuomorfI never have high hopes regarding Java crypto
06:24spaceplukneoncontrails: hmm, I see I'll explore that
06:24skeuomorfLast time I looked at the Android source code -a couple of months ago-, they defaulted AES to ECB mode
06:25neoncontrailsand I think in most functional languages (i.e. not Python) you actually need the latter pattern to retrieve variables from the object since its namespace is private
06:25roelofHello, Im doing the labrepl course and im stuck
06:26roelofI have made a file called student.clj with as namespace (ns student.dialect) and put it into the src directory
06:27roelofbut as soon as I open repl in the head directory and enters (use 'student.dialect) I see this error message : CompilerException java.lang.Exception: namespace 'student.dialect' not found, compiling:(NO_SOURCE_PATH:26:1)
06:27oddcullyspacepluk: Urandom as in the gUd random
06:27roelofI thought that because it's in the src dir it gets found automatical
06:27spaceplukoddcully: hahaha that's good :D
06:31oddcullyroelof: in src/student/dialect.clj right?
06:31oddcullyroelof: your binding ::0 problem fixed? what was it?
06:32roelofoddcully: wrong port I was using port 8000 where labrepl was using 8080
06:32spaceplukneoncontrails: I'm not sure if I can do that in storm because it has the control of the stream and the calls to the bolts bodies
06:32roelofnext time I will do this not just before I goto sleep
06:32spaceplukneoncontrails: also the bolts might be running in a different process/machine
06:33roelofoddcully: yep, the file is in src/student/dialect.clj
06:35roelofwierd, my cloud box rebooted and now everything is working well
06:37neoncontrailsspacepluk: I'm excited for you to dig into continuation-passing style :D because it absolutely does not seem like it should work
06:37neoncontrailsfor all of those reasons you mentioned
06:37neoncontrailshttps://en.wikipedia.org/wiki/Continuation-passing_style
06:38neoncontrailsThis is the basic mechanism of the forEach loop
06:39roelofmaybe a stupid question replace sentence #"\.$" " does replace the . with a space ?
06:40neoncontrailsI'm trying to think of a simple way to explain CPS without oversimplifying it
06:41neoncontrailsWhen mapping operations to objects, you're basically just going down the line and whacking each one with your metaphorical hammer
06:41TEttingerroelof: that doesn't look like a valid... regex on its own
06:42oddcully,(clojure.string/replace "Hello! World!" #"!$" "?")
06:42clojurebot"Hello! World?"
06:42oddcullyroelof: it replaces the last `.` in sentence with the part that you omited
06:42TEttinger,(clojure.string/replace "thanks, oddcully." #"\.$" "...")
06:42clojurebot"thanks, oddcully..."
06:43roelofoke, then I understood that part wel. The assignment is now making a pig-latinaze
06:48neoncontrailsOh, forgot to finish that thought. When using a continuation-passing style, you're literally giving the object itself as an argument
06:48neoncontrailsSo it can use its own methods
06:49neoncontrailsAnd side-effects can occur on whatever schedule those side-effects decide to happen
06:52neoncontrailsIn the context of your question, at a high level you're basically just going to have the bolts perform a predicate test on themselves, then do something if it's true
06:52neoncontrails(if I'm understanding your problem)
06:54spaceplukI want to apply the predicate on the tuples that pass through the bolts and emit new tuples (or not) based on the result of the predicate
06:54spaceplukso *do something* would be my predicate I guess
06:55spaceplukand the different map/reduce/filter bolts would have different tuple emitting behaviors
06:55spaceplukor that's the idea at least
06:56spaceplukI think that the problem is more about storm than clojure, but most people seem to be using java with storm :/
06:56spaceplukit's hard to get help
06:58spaceplukI think I see where you're going though
07:27roelofIs there a good book for a beginner to learn clojure. I like to many exercises so I can get a good hang of things ?
07:30spaceplukroelof: there's a good list here -> http://clojure.org/getting_started
07:30Kneivaroelof: Not a book but a lot of exercises: http://www.4clojure.com/
07:36roelofspacepluk: I will look in the list if there is a good book for me
07:37spaceplukI've read "clojure for the brave" and "joy of clojure" and I think they're good but I guess that's very subjective
07:38spaceplukI'm still going through the exercises in 4clojure I'm learning a lot and it's fun :)
07:38tsdhWhen a deftype has a field x-y, then you can access it either with (.x-y foo) or (.x_y foo). CIDER autocompletes the latter because the class of the deftype has an x_y field. Is there any reason to prefer one over the other?
07:39roelofoke, I tried to learn from labrepl but it seems that a lot of info is not be told. For example how to get the first letter of a word or how to check if that letter is a vowel or not
07:41spaceplukif it's anything like 4clojure I think you're supposed to check the api docs for that
07:41spaceplukdoing simple tests in the repl helps too
07:42spaceplukroelof: like (first "asdf")
07:44spaceplukroelof: or (re-matches #"[AEIOUaeiou] (first "asdf"))
07:46roelofspacepluk: thanks, I have to write a pig-latin function
07:46roelofI think I have a idea how I can do that
07:47spacepluknp :)
07:48roelofI think I can also use a few suggestions from this page : http://stackoverflow.com/questions/686375/why-does-def-vowel-set-aeiou-work
07:51spaceplukusing the set is probably faster than the regex
07:52roelofwith set you mean this part : (def vowel? (set "aeiou"))
07:53roelofsorry for much questioins but im a super beginner in clojure
07:53spaceplukyes, a set is a data structure but you can use it as a function
07:55roelofoke, thanks
07:56spaceplukroelof: for example ((set "aeiou" \a)) returns \a because it's in the set
07:57spacepluksorry ((set "aeiou") \a)
07:57spaceplukif the argument is not in the set it returns nil
07:58spaceplukhttps://clojuredocs.org/clojure.core/set
07:58roelofoke, so then if I have for example the word aap then I can get the first letter with (first "aap") but then I do not have the / before it
08:00spaceplukyes you do, it returns a char
08:00roelofso I cannot do ((set "aeiou") (first "aap")) ??
08:00lazybotroelof: Definitely not.
08:01spaceplukI think that should work
08:01oddcullyroelof: do you have leiningen installed?
08:02roelofyes, I have
08:02oddcullyroelof: then do `lein repl` and try it out
08:02spaceplukyup
08:02Rurikor better
08:02noncom,((set "aeiou") (first "aap"))
08:02clojurebot\a
08:03spaceplukand \a is truthy
08:05roelofthanks all, I will try things out and hopefully get a hang of things
08:09noncomtsdh: probably because "-" is not allowed for java variables (fields) names
08:10noncomtsdh: therefore, the process known as "munging" and its counterpart, "unmunging" are applied to names to make them valid java or clojure names
08:11tsdhnoncom: Yes, I know. My question is rather if it is ok to use the munged, underscored name from within Clojure because that's conveniently suggested by CIDER.
08:12tsdhnoncom: Or if the existence of x_y is just an implementation detail I should not rely on.
08:13spaceplukI think using the munged names doesn't make sense in the language
08:14spaceplukI would use the names as they are defined
08:14spaceplukin clojure
08:14noncomtsdh: well, it is an implementation detail... but the one that clojure tries to get away from java in. so, valid clojure would certainly be "-". IDK, i guess there cannot be a definite answer. you could 1) make a request for CIDER to manage the autocomplete for "-" names. 2) stick with "_" and just know that it is a sign of a java field..
08:14noncomspacepluk: yeah, that's closer to me too
08:15spaceplukalso using _ might break if you want to port your code to clojure-clr or clojurescript
08:15noncomgood point
08:16noncomso, the result would be: ask cider to work with "-" ?
08:16tsdhnoncom: I guess there's nothing CIDER can do because how should it know that a class has been generated for a deftype?
08:17spaceplukmaybe just replacing _ with - is good enough for real idiomatic code
08:17noncomwell... firstly i guess it can inherit something unique for a deftype, and secondly - maybe just ... ah, spacepluk already said that :)
08:17spacepluk:)
08:17tsdhspacepluk: And how would I then access Integer/MAX_VALUE?
08:18spaceplukyou'd need to type that
08:18kandinskijust a quick question: why don't 'alter' and 'ref-set' have the bang like 'swap!' and 'reset!"?
08:18spaceplukI said "good enough" hehehe
08:18tsdhspacepluk: So you say that CIDER's autocomple should suggest the Integer/MAX-VALUE which is incorrect? That would inverse the problem.
08:19kandinskithey too change the state of their respective ref, just like reset! and swap! does with an atom
08:19spaceplukyes, which one is worse?
08:19kandinskiso why didn't they get the bang?
08:19spacepluksomething like noncom sugests would be better, that's just a quick hack
08:19tsdhspacepluk: Your suggestion is worse. :-)
08:19spaceplukhehehe ok
08:19spaceplukweird
08:20noncomtsdh: here: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core_deftype.clj#L396
08:20spacepluknice
08:20spaceplukso replace only for ITypes sounds good, it might still break if somebody actually uses _
08:21noncombut that could be made a on-off thing so you can turn it off when needed
08:21tsdhnoncom: Ah, that's good!
08:24noncomkandinski: a good question
08:24kandinskinoncom: thanks, but does it have an answer? :)
08:25noncomkandinski: https://scott.mn/2014/02/09/playing_with_refs/ do ctrl+f "bang"
08:25kandinskinoncom: thanks a lot
08:26kandinskinoncom: awesome!
08:26noncom:D
08:27kandinskithanks a lot, I was definitely thinking in a scheme way
08:27spacepluktsdh: noncom: maybe it's worth taking a look at how the munging is implemented, you might find a complete solution
08:27noncomso, yeah, some fundamental stuff there. good to know
08:27kandinskinoncom: is that your weblog?
08:28noncomkandinski: nope! i just googled "alter ref-set no bang" and that was the first or second find iirc :)
08:29kandinskishame on me. I did google "atoms vs refs" but got nowhere.
08:29kandinskicheers, and thanks again
08:31noncomkandinski: np :) this place is for chatting, so that's what we're doing :D
08:35spacepluktsdh: I don't get any munged names with fireplace on vim
08:36spaceplukand it's using cider afaik
08:36noncomspacepluk: it shows "-" ?
08:37spaceplukyup
08:37noncominteresting. at this point i'm a bit sad that i'm not on vim or emacs...
08:38spaceplukit's never too late :D
08:40noncomspacepluk: haha. well, i tried some emacs.. actually i find myself pretty comfortable with it and i use it for editing some other lisp, not clojure. other lisps rarely have a support in good ides...
08:40noncomspacepluk: you're on vim? can you recommend a good setup for it? i mean, plugins and stuff.. maybe there's a ready-to-use distribution? i'd like to try it out too.
08:41spacepluknoncom: this one is very popular http://vim.spf13.com/
08:41spaceplukI'm actually on neovim now but it's pretty much the same :)
08:42spaceplukthere's also spacemacs that might be easier if you already know emacs
08:42noncomspacepluk: does spf13 have everything for clojure?
08:42spaceplukI don't think so
08:43noncomspacepluk: ok
08:43noncomspacepluk: is neovim better than just vim?
08:44spaceplukthis are my clojure plugins https://gist.github.com/spacepluk/e1dfef7af7bf1a08e209
08:44spaceplukit's better for async stuff that is the worst part of vim
08:44spaceplukyou can even open a terminal in a buffer now which is pretty cool
08:44ceruleancitycan anyone help me with clojure.tools.cli? I'm trying to accept a file path as a cmd line param and having issues. it seems my :validate function is always receiving a boolean as input
08:44spaceplukand script shit on it
08:44noncomeh, i see the list of differences, i guess i won't be able to appreciate them since i never suffered the issues they resolve. but terminal and multithreading sounds really good. does bare vim really miss htat?
08:45spaceplukthere are workarounds but they suck hehe
08:46spacepluknoncom: I'd like to try this some day https://github.com/syl20bnr/spacemacs/
08:46spaceplukI'm just too lazy to change my setup now that it works so well hehehe
08:49noncomoh spacemacs...
08:49noncomlook sinteresting
08:51spaceplukyes, it sounds like a nice middle ground
09:52troydmis it possible to use core.logic via http://www.tryclj.com/ ?
10:03wombawombaI want to launch an external (unix) process asynchronously, and stream the output to stdout. What libraries should I use, and how?
10:07troydmwombawomba: https://gist.github.com/codification/1984857
10:11galauxHi!
10:12galauxIn a clojure/lein project, I hit this bug: http://dev.clojure.org/jira/browse/CLJ-843
10:13galaux(System/loadLibrary uses the current classloader – Clojure's – instead of the parent's)
10:13galauxBut … it still does not work in clojure 1.6. Only on 1.7
10:14galauxwhich seems very strange to me
10:14wombawombatroydm: for that example, I would like to read from the :out stream line by line. Any idea how I would accomplish that?
10:17PupenoAccording to https://github.com/technomancy/leiningen/blob/master/sample.project.clj, `:bootclasspath true` will place the agent jar on the bootstrap classpath, but this doesn’t seem to be happening and I’m not sure how to debug it. Where should this jar be present?
10:23wombawombatroydm: nvm, got it; thanks
10:52ceridwenIs this the right place for a question about an algorithm in Clojure's implementation? I'm trying to figure out why some design choices were made in the zipper implementation.
10:53dstocktonceridwen: yes
10:57ceridwenI'm a Clojure novice, so if I'm wrong on my interpretation of the code, please correct me. Two starter questions: in Huet's paper, the type of a path is (in Ocaml) Top | Node of tree list * path * tree list;; . In Clojure, there are two additional fields, pnodes and changed? . What's the function of these fields? Am I right in believing that l and r correspond to the first and third entries in Huet's type, and that ppath is the second?
11:00ceridwenSecond, I notice that on https://github.com/clojure/clojure/blob/master/src/clj/clojure/zip.clj#L132 , there doesn't seem to be a reverse for l in the concatenation. In Huet's paper, it's
11:00ceridwenlet go_up (Loc(t,p)) = match p with
11:00ceridwenTop -> failwith "up of top"
11:00ceridwen| Node(left,up,right) -> Loc(Section((rev left) @ (t::right)),up);;
11:02ceridwenFor comparison, someone wrote up a zipper implementation in Clojure using deftype that does reverse the left entry: https://github.com/akhudek/fast-zip/blob/master/src/cljx/fast_zip/core.cljx#L134
11:07Bronsaceridwen: there's no reverse because l is a vector rather than a sequence
11:07roelofhow can I make these warnings away : ARNING: record? already refers to: #'clojure.core/record? in namespace: midje.parsing.0-to-fact-form.formulas, being replaced by: #'midje.clojure.core/record?
11:10ceridwenI was suspicious of that, but how does changing from a sequence (or list in the Ocaml context) to a vector make the difference?
11:16roelofno midje expert here ?
11:23justin_smithroelof: you can make that warning go away by using a version of clojure old enough so "record?" is not defined in clojure.core, or a version of midje new enough that it doesn't shadow record? with its own function of the same name.
11:23justin_smithroelof: said "version of midje new enough" may or may not actually exist in our reality
11:24roelofoke, and which version must I take then 1.6.x ?
11:24justin_smithnot sure...
11:24justin_smith(-> #'record? meta :added)
11:24justin_smith,(-> #'record? meta :added)
11:24clojurebot"1.6"
11:25justin_smithso older than 1.6
11:25justin_smiththe thing is though, the warning is just a warning - the midje authors defined that function not expecting clojure.core/record? to exist
11:26justin_smiththe idea with the warning is if you accidentally do (def count 10) and then all usage of clojure.core/count are going to be weirdly broken
11:26justin_smithbut if you were never intending to use the clojure.core version of the function, then you are fine
11:27roelofmidje is updated a long time ago , I see the last relaase on 10 nov 2011
11:32roelofI think I use a too old version. I use lein-midje 1.3.1
11:33justin_smithhttps://clojars.org/lein-midje yeah looks like you could update to 3.2-RC4
11:34justin_smithI bet recent versions have eliminated that warning
11:34roelofjustin_smith: I wil try that
11:37roelofjustin_smith: nope, the error messages stays
11:38justin_smithworthy of an issue on the repo, I'd say
11:39justin_smiththey can fix it with (:refer-clojure :exclude [record?]) in the offending namespace(s)
11:42roelofjustin_smith: oke, so adding that piece to this (ns training-day) schould do the trick ?
11:43justin_smithroelof: it needs to be done in the ns which has the warning "record? already refers to: #'clojure.core/record? in namespace: midje.parsing.0-to-fact-form.formulas
11:43justin_smith"
11:43justin_smithso they need to fix midje.parsing.0-to-fact-form.formulas
11:44roelofoke, then I have to look where that can be found ? I only have a training namespace
11:44justin_smithroelof: this is in the midje code, which is why I suggested posting it as a bug to the midje project
11:45roelofI did make a remark on the lein midje page. This is the same contribor as midje has
11:45roelofjustin_smith: but thanks for the help and the explanation
11:45justin_smithnp
11:52roelofjustin_smith: made also a report on midje: https://github.com/marick/Midje/issues/324
11:53justin_smithroelof: was 2.3-rc4 a typo? their latest is 3.2-RC4
12:02roelofyes, I m going to change that
12:02andyf_ceridwen: In answer to question you asked a while ago, in Clojure, doing ‘conj’ onto a vector adds new elements at the end, not the beginning. Doing ‘conj’ onto other kinds of sequences, e.g. lists, adds new elements at the beginning.
12:03justin_smithandyf_: or ¯\_(ツ)_/¯ ##(conj #{:a "a" 'a} \a)
12:03lazybot⇒ #{\a a "a" :a}
12:04andyf_justin_smith: I don’t consider a set a kind of sequence.
12:05justin_smithfair enough
12:06justin_smithandyf_: funny that I randomly picked an example that would add in the "front" though
12:10roelofa question for the future. Is it 'easy' to make a web app with clojure ?
12:12hfaafbit's certainly simpler!
12:12justin_smiththe fact that you can use clojure on the backend and clojurescript on the frontend is definitely handy
12:13justin_smithI can't honestly answer the question because I haven't built webapps with other languages
12:18roelofoke, before dinner what do you use for web development, justin_smith
12:19justin_smithroelof: ring, figwheel, reagent, sente, kafka, onyx are the big pieces
12:24neoncontrailsjustin_smith: interesting. Clojure and Clojurescript run on totally different VMs though, don't they?
12:24neoncontrailsHow does that work in practice?
12:25justin_smithneoncontrails: I use cljc for code that the two sides should share
12:25justin_smiththen I use sente to send vanilla clojure data structures between the two ends
12:26zerokarmaleft,(inc justin_smith)
12:26clojurebot#error {\n :cause "Unable to resolve symbol: justin_smith in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: justin_smith in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol:...
12:26justin_smithone nice thing with websockets, is either end can push data to the other at any time, you're not limited to the classic request/response cycle
12:26zerokarmaleftfor not saying isomorphic
12:26neoncontrailsinteresting. So in a sense, they don't really communicate... they just share assets. Is that right?
12:26pseudonymousClojure on the front- *and* backend.. Sounds like the promise made by the JS devs, just with a decent language this time ^^
12:26justin_smithneoncontrails: no shared assets - I push data between the two
12:26justin_smiththat's not the same as a shared asset
12:27neoncontrailsI see. My misunderstanding
12:27justin_smithpseudonymous: it is working out like a dream - especially with the help of cljc and sente
12:28justin_smithneoncontrails: in practice, I send tuples - the first half is treated as a "routing" that decides how it gets handled, the second part is the data provided to that handler
12:28justin_smithand usually, part of the data sent is another routing to send the response(s) to if any
12:30justin_smithneoncontrails: the really fun part is that we added a distributed cluster (using onyx) to the backend, which means that I provide not only a route to send a reply to, but a whole itenerary describing a series of hops to make between the backend server and the compute cluster before sending the result back to the frontend
12:30neoncontrailsOh, cool. Sounds like a register machine. Is it basically that?
12:30justin_smithbrb
12:34neoncontrailsI'd love to understand how that gets implemented in practice. The nuts and bolts of it
12:36neoncontrailsI've noticed I'm easily overwhelmed by web development stacks, even ones I might understand okay at a conceptual level. Very difficult to think about so many layers all at once
12:38pseudonymousneoncontrails: What Justin's doing sounds pretty complex. But I think the confusion is generally good argument against end-to-end solutions in general. Sure, frameworks work great, right until their design tradeoffs and your needs diverge and then you're in hell. Seems like both the Clojure and Go communities have learnt from that by arguing in favour of small to-the-point libraries which you compos
12:38pseudonymouse yourself.
12:39pseudonymous(Apologies for the novel)
12:40neoncontrailsYeah, I hear that. How eerie, I've had the very same thoughts before
12:42neoncontrailspseudonymous: What's a good starter library in Clojure/CS? Something lightweight to get one's feet wet
12:43justin_smithneoncontrails: I'd start with figwheel - it's an awesome dev tool that makes cljs dev really slick. And then use one of the react wrappers for controlling the frontend DOM (om or reagent)
12:44justin_smithfigwheel doesn't become part of the end product, it just provides things like a clojurescript repl, auto-reload of clojure and css changes, etc.
12:45pseudonymousneoncontrails: wouldn't presume to know. I'm ~8 days in myself. What I *can* tell you is that I read (and re-read) sections of "Clojure for the true and brave" and picked up "Clojure Applied". From there, I just sort of picked up ring (wrapper for..jetty?) and compojure (routing) and went from there. I think I've picked up some 15 minor libraries by now.
12:45neoncontrailscloning now. :)
12:46justin_smithpseudonymous: ring is a protocol based wrapper for various web servers (including jetty, but also a tomcat container, or http-kit, among others)
12:47justin_smithpseudonymous: it provides an easy way to make a modular webapp that can run on whatever server you end up needing to use
12:47pseudonymousjustin_smith: ahh. It's literally the only thing I just picked up from a tutorial and went on with :P
12:48justin_smithpseudonymous: by default it uses jetty if you use "lein ring"
12:48justin_smithbut the same code you run via lein ring can also be shipped to run inside tomcat, or can self-host via http-kit, or whatever
12:48neoncontrailsOh, wow. From git-clone to a working interactive Flappy Bird session in the browser in less than 60 seconds. That's pretty darn cool :)
12:48pseudonymousjustin_smith: yup, I do - hence my half-arsed assumption about it wrapping jetty in particular :)
12:49justin_smithneoncontrails: the figwheel demo?
12:49neoncontrailsyeah
12:49justin_smithneoncontrails: with "lein new figwheel" you can get the bare bones setup to make your own figwheel / cljs project too
12:50neoncontrailsThis is much less painful than when I tried to get set up with Node!
12:50justin_smithpseudonymous: this discussion reminds me, I plan on trying the ring adapter for aleph one of these days
12:51neoncontrailsls
12:51lazybothome lib64 lost+found mnt opt proc root sbin srv tmp usr var
12:52neoncontrailssigh sorry guys thought you were terminal
12:52justin_smith(inc lazybot)
12:52lazybot⇒ 37
12:53pseudonymousjustin_smith: only briefly encountered a discussion about various HTTP servers. Hoping to get back to it once the first version of this service is done - but definitely *not* now
12:54justin_smithyeah, the nice thing with ring is it lets you make the choice later
12:54justin_smithwithout having to do a major code revamp
12:54justin_smithmore things should be like that
12:54pseudonymousSeems to be a general thing of lisp, even. I'm really liking this
12:55justin_smithpseudonymous: lisp somewhat, clojure very much so
12:55justin_smithpseudonymous: see also the generic collection operations and higher order functions
12:56pseudonymousjustin_smith: hmm? What do you mean ?
12:57justin_smithpseudonymous: the whole language is built up on generic operations using a protocol that allows your custom implementation choice to be used
12:58pseudonymousOh in that sense. Yes, very much so. Played a bit with protocols too, fun times :)
12:58justin_smithpseudonymous: as opposed to multiple ad-hoc versions of the same functionality, or concrete inheretence, or generics, or any of the other silly alternatives
12:58justin_smithpseudonymous: eg every time you use filter or map you are exploiting protocols (the fact that the first arg can be any IFn, the last arg can be anything seq knows how to turn into a list)
12:59pseudonymousYup, these are basically the things I'm falling in love with, head over heels, in fact ;)
13:09noncomif i am using reagent to create html from cljs, then how do i reflect some changes in this html, produced by new data that arrived from a websocket?
13:10noncomin other words, the reagent-generated html is static, i don't know how to regenerate it when new data arrives
13:10noncomhow to sustain dynamic html
13:11justin_smithnoncom: when you get the message on the websocket, alter an ratom, and have a component that watches the value of the ratom in your page structure that reagent is rendering
13:11noncomwhen i was programming in plain coffee script, that was easy - i looked for particular objects inside my html and simply replaced their content with the new one generated upon the new data
13:11noncomjustin_smith: aaaaahhh..
13:11noncomthaath's what!
13:11noncomthank you very much :)
13:11justin_smithnoncom: so you know how to define a component inside the page structure, right?
13:12justin_smiththe rest should be straightforward
13:12noncomyes, i am still following the luminus guidelines. i think that if i add the reagent atoms, all will work just as you've described
13:12justin_smithnoncom: I'd check out the basic docs for reagent, because this is the crux of how reagent is used
13:13noncomyes, i will read them too. at least now i know the right direction
13:13justin_smithhttps://reagent-project.github.io/
13:13noncomi was really lost there
13:13justin_smiththe docs there are good ^
13:13noncomoh, yes, i see it, looks very clear
13:14noncomcool :)
13:14justin_smithafter the third example they introduce something using an ratom - once you get used to this model it is really much easier than finding and mutating elements in a page
13:15noncomsure :) that's so minimal and functional. looking at it i find it beautiful. the binding i mean. that kind of thing similar to how binding in seesaw works
13:16noncombut this one is bidirectional
13:40sdroadieHey all. I've run into an issue inserting vectors into Postgresql using yesql.
13:41sdroadieThe error I get is a little unhelpful: INSERT has more expressions than target columns.
13:42justin_smithsdroadie: well, jdbc expects your data to be inserted to be in a vector, right?
13:43justin_smiththat's how I recall it at least, and would match that error message. It's saying that the yesql statement produces a jdbc call to insert N pieces of data, and your vector contains more than N items
14:35dnolenOpportunity grants available for Clojure/conj http://clojure-conj.org/opportunity
14:51sgs03Does anyone use honeysql? How might I apply a modifier to only one column? For example, I'd like to do: `Select id, max(last_modified) from...`
15:05wombawombaI want to define a macro that automatically creates a bunch of bundings; i.e. given (my-macro [some-name some-other-name] (println some-name some-other-name)) would print two values defined by the macro. Is this possible?
15:06muhukwombawomba: `(let ...) ?
15:06wombawombaer, bindings*, not bindings
15:06wombawomba...not bundings*
15:07wombawombamuhuk: ah, so I could generate the first argument to let? good call, I guess
15:07muhukwombawomba: when you're writing macros, it helps a lot if you write expanded code by hand first.
15:09wombawombacool, thanks
15:20TimMc&(map #(re-find % "foo\n") [#"o\n$" #"o$"]) ;; why are both of these found?
15:20lazybot⇒ ("o\n" "o")
15:25wombawombamuhuk: I can't seem to get that working.. perhaps because let is a special form? e.g. (let [a ['b "c"]] (let a b)) gives 'java.lang.IllegalArgumentException: let requires a vector for its binding'
15:33muhukwombawomba: why do you have two let's there?
15:34muhukwombawomba: `(let [~'a ~a-value ~'b ~b-value] ~@body)
15:34muhukwombawomba: not sure about ~'a, maybe it was '~a
15:34wombawombamuhuk: in the macro, I want to go through the provided list, and create a binding for each item. I then want to expose those bindings to the macro body
15:36wombawombaafaik I would then have to do something like (defmacro [things & body] (let [bindings (map ... things)] `(let bindings ~@body))
15:36wombawomba...since I don't know the length of things
15:38muhukwombawomba: (defmacro [params body] (let [bindings (reduce (fn [acc x] (into acc [x (calculate-val x)]) [] params)] `(let bindings ~@body))
15:39muhukwombawomba: yes, I was confused since the 2nd let didn't have the quoting.
15:39muhukwombawomba: map doesn't work though because it would give [a b c] -> [a-val b-val c-val]
15:40muhukwombawomba: makes sense?
15:41wombawombamuhuk: that won't work though
15:42wombawombait gives 'clojure.core/let requires a vector for its binding...'
15:44muhukwombawomba: what does (reduce (fn [acc x] (into acc [x (calculate-val x)]) [] params) produce?
15:45wombawombawell, if I do
15:45wombawomba(defmacro mymacro [params body]
15:45wombawomba (let [bindings (reduce (fn [acc x] (into acc [x (str x)])) [] params)]
15:45wombawomba (prn bindings)
15:45wombawomba `(let bindings ~@body)))
15:46wombawombathen (mymacro [something] (println something)) prints [something "something"] before throwing
15:47amalloymuhuk: isn't that just an eager version of (mapcat (juxt identity calculate-val) params)?
15:48muhukamalloy: sure. I just don't want people to *share* don't do concat links with me anymore.
15:48lumawombawomba, your problem is that your macro generates a let that doesn't have a vector as its binding form
15:49amalloywombawomba: `(let ~bindings ~@body)
15:49muhukwombawomba: "~bindings", not just "bindings"
15:49lumathat code has just the symbol 'bindings, and even if you had ~bindings there it would be a lazy sequence, not a vector
15:49amalloyluma: no, it's a vector
15:49lumaoh, sorry
15:49lumai read that wrong then
15:49wombawombaamalloy: cool, thanks!
15:54pseudonymousHaving "fun" wrapping various Amazon S3 classes. Running into a situation where the docs say a method should exist but calling it from clojure fails (as in it doesn't exist). Which tools do you typically use to inspect java objects? Specifically their publicly available methods (own + inherited)
15:55Bronsaceridwen: sorry i went afk -- adding elements to a vector adds them to the tail, adding them to a seq adds them to the front
15:55Bronsaceridwen: the vector already has the elements in reverse order compared to the seq, so there's no need to reverse
16:06TimMc&(map (comp count clojure.string/split-lines) ["" "\n" "\n\n"])
16:06lazybot⇒ (1 0 0)
16:07roelofIn the book Clojure Web Development Essentials they talked about a profiles.cjl but I do not have one
16:07roelofWhere do I put this one
16:08pseudonymousroelof: you'd usually have this file if you made a project with leiningen
16:08pseudonymousroelof: https://github.com/technomancy/leiningen/ (read the "Basic Usage" guide for details)
16:10luxbockpseudonymous: you are probably thinking of project.clj
16:10luxbockroelof: you can create one in ~/.lein/
16:10luxbockhttps://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
16:12roelofluxbock: and if I create one in ~/.lein does that then count for all project or can I make one per project ?
16:12pseudonymousOh, misread (& misremembered). project.clj is the per-project file and profiles.clj is for cross-profile settings. Whoops. That said, seems like a really bad idea (tm) if you work with others
16:12amalloypseudonymous: there are plenty of things that are totally reasonable to put in profiles.clj
16:13luxbockroelof: yes profiles.clj is for all projects, and if you want per project profiles then you can add those to your project.clj's :profiles key
16:13amalloylike i have a few dependencies that are only useful to debugging/profiling stuff, which i include only in the repl profile
16:15pseudonymousamalloy: but wouldn't most people on your team probably want to use those same tools, too ? If you tell them "Oh just do x-y-z to see what's going on" they'll get an error until they go out and fetch the very same things
16:16roelofoke but then I have made a project and I could not do this : :user {:plugins [[luminus/lein-template "1.16.7"]]}
16:16roelofbecause then luminus is already installed
16:20roelofAm I right or wrong here ?
16:24amalloypseudonymous: not really. do you put a cider dependendency in the :dev profile of every clojure project you use?
16:24amalloydevelopers have their own suite of debugging tools that they're familiar with
16:31justin_smithwait, why would roelof want a template in his plugins? or do they use confusing names for things?
16:31ceridwenBronsa, andyf_: Thanks! Anyone know about my other question?
16:32pseudonymousamalloy: yes, right along with a bundled copy of '.emacs' :) (OK, I see your point)
16:47skeuomorfIf anybody was curious about our SecureRandom discussion earlier, here http://bugs.java.com/view_bug.do?bug_id=4705093
16:47skeuomorfTL;DR "What a confusing mess."
17:04neoncontrailspseudonymous: your earlier problem sounds interesting. Did you ever find a better way to inspect the properties of Java objects?
17:21pseudonymousneoncontrails: I'm sure I made a mistake (sleepy). That said, yes, clojure.reflect/reflect is *very* verbose but should have it all. I say should because I abandoned rummaging through its output because the object I applied it on is rather large.
17:22amalloypseudonymous: well you don't rummage through it by hand, you use functions to do it
17:24amalloy,(use 'clojure.reflect)
17:24clojurebotnil
17:24amalloy,(take 5 (map :name (filter (comp :public :flags) (:members (reflect String)))))
17:24clojurebot(replaceAll CASE_INSENSITIVE_ORDER codePointCount getChars regionMatches)
17:25neoncontrailsMmm. I can imagine that taking a while. The only times I've ever gotten bored waiting for a Java program to terminate have been reflective programs :)
17:25pseudonymousamalloy: had I had more time I would've begun parsing it or looking for snippets to do so. Anyway, I found my answer by other means
17:25amalloy,(take 5 (sort (map :name (filter (every-fn :return-type (comp :public :flags)) (:members (reflect String))))))
17:25clojurebot#error {\n :cause "Unable to resolve symbol: every-fn in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: every-fn in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: every-f...
17:26amalloy,(take 5 (sort (map :name (filter (every-pred :return-type (comp :public :flags)) (:members (reflect String))))))
17:26clojurebot(charAt codePointAt codePointBefore codePointCount compareTo)
17:26amalloyand so on
17:26neoncontrailspseudonymous: Can I rephrase your specific question about A3 objects as a general question, if you've already solved it?
17:27pseudonymousneoncontrails: I don't quite follow ? Rephrase it in what context ? To whom ?
17:30BronsaI find that clojure.reflect returning symbols rather than Types/Classes is really inconvenient
17:30neoncontrailsHaha, sorry. I worded that badly. I'm just curious about the general case where you have an object, possibly of some user-defined type, and possibly its methods are a black-box to you, but you need to be able to interact with it, usefully and safely. Is there's a general "Clojure strategy" for
17:30skeuomorfThere isn't a clojure log() function, right? Just Java's `java.lang.Math.log()`
17:30neoncontrails*"Clojure strategy" for this situation?
17:32justin_smithneoncontrails: generally get the class and look for the source / javadoc
17:32justin_smithwell, javadoc first
17:32justin_smithneoncontrails: also, for some objects you can get the bean
17:32justin_smith,(bean (java.util.Date.))
17:32clojurebot#error {\n :cause "denied"\n :via\n [{:type java.lang.ExceptionInInitializerError\n :message nil\n :at [java.lang.reflect.Proxy$ProxyClassFactory apply "Proxy.java" 672]}\n {:type java.lang.SecurityException\n :message "denied"\n :at [clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69]}]\n :trace\n [[clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbo...
17:32justin_smith:P
17:32justin_smith&(bean (java.util.Date.))
17:32lazybot⇒ {:day 3, :date 2, :time 1441229560282, :month 8, :seconds 40, :year 115, :class java.util.Date, :timezoneOffset 0, :hours 21, :minutes 32}
17:33neoncontrailsThat's for library-defined object types, right?
17:33neoncontrailsNot for user-defined objects?
17:33justin_smithneoncontrails: that's for any object
17:33justin_smithbean uses reflection
17:33oddcullyalso vinyasa has some inspection stuff
17:33justin_smiththere's also clojure.reflect of course
17:35neoncontrailsOh, neat. Are you always able to assume that the source code of a user-defined object is available to you?
17:35justin_smithneoncontrails: well, not always of course
17:36justin_smithneoncontrails: usually if I am writing code that deals with some non-clojure Object, I am targeting some interface
17:36justin_smithneoncontrails: if I am developing, and want to know how to interact with an object I get from some API, I check javadocs related to that API, or failing that the source code, since I am not using any closed source libs right now
17:38pseudonymousWill actually second that. I had one issue with Amazon's AWS classes to which I couldn't get an answer from either their docs, an IRC channel dedicated AWS services or blog posts - turns out it was easy enough to search through the code (it's nicely commented).
17:38neoncontrailsI see. Between having lots of surgical functions targeting some specific interface vs. trying to make a single function robust against different types of objects (using reflection, say) do you lean toward one or the other?
17:39justin_smithneoncontrails: the point of an interface is that it is an abstraction that many objects implement
17:39justin_smithneoncontrails: which is why my first choice is to develop against some interface
17:39neoncontrailsObjects of a type...
17:40justin_smithneoncontrails: if I write my code for a given interface, it should work with any object implementing that interface in a useful way
17:40neoncontrailsOh, I see what you mean
17:40amalloynobody tries to write a function that uses reflection to guess at what methods a particular object has that might be relevant
17:40amalloyexcept the EJB people and they are certifiable
17:40justin_smithright, that's going to waste a lot of time
17:40justin_smithhaha
17:41amalloyyou just say, look, here is an interface with two methods i need you to implement. pass my function something that implements that interface
17:41amalloyand a lot of java code written as classes implementing interfaces anyway, so it is simple to interop with that
17:42neoncontrailsYes, that makes a lot of sense
17:44amalloy(and if they give you something that doesn't implement that interface, you don't use reflection to try and figure out something to do. you (throw (CmonManWhatTheHeckException. "Dude gimme an IWhatever"))
17:46neoncontrailsI have a feeling that the way I've been interacting with objects in Python is somewhat clumsy and violent, and not translable to Clojure
17:50neoncontrailsSpecifically, in Python, it seems like the way variables are scoped basically contradicts the idea of private namespaces -- it's so easy just to call Foo.name rather than use getters/setters
17:50pseudonymousActually a bit curious about that - how are clojurists feeling about exceptions ? The host platform itself absolutely adore them, but what of clojure ? Is it preferred to write functions to throw a bunch of exceptions or should errors be signalled via nil or... ?
17:50neoncontrailsI had an interesting debate the other day in Python about this
17:50neoncontrails*in #Python about this
17:51pseudonymousneoncontrails: well, you can obscure the name by prefixing fields with __ and the Python mantra definitely is "We're all consenting adults, here" :)
17:52neoncontrailsHaha. I hadn't heard that mantra, but it makes a lot of sense for a scripting language.
17:53neoncontrailsBut what if you're writing software? I cannot see the justification for eliminating getters/setters. I don't think they're just a long-winded version of calling Foo.var
17:54neoncontrailsThey strike me as a design choice, and a fairly good design choice
17:59justin_smithneoncontrails: in clojure we use immutable objects instead
18:00justin_smithyou don't need getters when the fields literally cannot change
18:00justin_smith(and setters would kind of ruin the whole plan)
18:02neoncontrailsYou'll probably have to remind me of this another 4-5 times before my Pavlovian anxiety over mutable state goes away
18:02justin_smithneoncontrails: also getters/setters fit well with the OO paradigm where messy state stuff is hidden on the insides of things, but often in fp we want to push messy state stuff to the outside / boundaries between things and leave the inside side effect free
18:03neoncontrailsYou're right, of course. I see how that moots my concern, I'm just not used to having such assurances :)
18:03justin_smithneoncontrails: the horrifying thing is when you get used to it and then try to go back
18:04amalloyyou'd be surprised how many of the java classes with getters and setters you write could be replaced with: public class FooHolder {public final int a; public final int b; public final String s; public FooHolder(int a, int b, String s) {this.a = a; this.b = b; this.s = s;}}
18:05neoncontrailsHeh. I found the Scheme -> Java transition sort of soothing in a way, even though it was fun building classes from basically construction paper, macaroni shells, and paste
18:05amalloywhich is a bit wordy itself, compared to just using a generic map in clojure. but compared to writing out all the getters and setters to "abstract" over the "private" "state"
18:07justin_smithneoncontrails: I'm sure you know about CLOS and the fact that it is available for scheme and you were just re-inventing OO for fun
18:07neoncontrailsYep. Well, our instructors were too, of course, they wouldn't have made it that easy ;)
18:08justin_smithright, of course
18:09amalloyCLOS for scheme seems like it could appropriately be renamed to SOS
18:09justin_smithamalloy: if only they had your wit
18:10amalloyi think that rather i lack their discretion. it's the sort of pun you fall into without even trying, so i presume they intentionally didn't do it
18:10hiredmanamalloy: don't forget to add custom value hashing and equality
18:11amalloywell yes. those are things you should do too, if you want your objects to be able to participate in equality and hashing
18:11amalloydoes java 8 have any kind of Pair<A,B>/Triple<A,B,C> yet, or do you still have to go use one of eighty different external libraries?
18:13justin_smithshort answer appears to be no, long answer appears to be wow those people are nuts
18:14amalloyyeah
18:14amalloyi am reading about it now
18:20neoncontrailsI asked a senior CS major whether I should take the 5th (optional) SICP unit, in which the idea is basically, now that you have a CLOS-like object system, let's use it!
18:20neoncontrailsHe told me the unit was made optional because of its unusually sadistic pedagogical approach
18:22neoncontrailsWhich basically culminates in the realization that the object system you have defined is an absolute nightmare and just very crazy, all of your objects being instantiated in exactly the same global namespace, etc
18:24neoncontrailsWhich eventually you fix, and that's the last project, but the professors supposedly wanted to impress on students the obscenity of building an object system in that fashion
18:25justin_smithneoncontrails: well, if you plan on doing software professionally, one should get accustomed to creating obscene atrocities
18:26justin_smithat least there was a "fix it" stage :)
18:27neoncontrailsThat's true! There's something nice about that approach, too, I think
18:29neoncontrailsYou would be grumbling in your head about the difficulty of such things you can barely put into words, because it's brand new difficulty, and then next week, learn that your frustrations are precisely the focus of the lecture
18:34justin_smithI want to implement a function that would detect a client sending a message in a loop. I'm thinking some kind of cache could help with this? maybe this is a functionality that has a name I am ignorant of?
18:35amalloyjustin_smith: i don't really understand "detect a client sending a message in a loop"
18:35justin_smitheg. if I get more X messages in Y time period from any client that have identical contents, I want to log that fact
18:35amalloyis the client, in a loop, sending a message?
18:36neoncontrailsI can think of some ways (cycle) could help you do this
18:36justin_smithamalloy: yes, specifically in a distributed system where we want to track down where the looping is (and people's first motivation is to blame their client - we can prove someone went rapid fire but can't always prove who did it)
18:37neoncontrailstake lengthnum*2 samples from the message. if they're equal, message is in a loop right?
18:37justin_smithso it could be a server triggering itself, it could be react triggering reloads within its loading component and sending a request on each load...
18:37amalloyif you're getting a small enough number of messages that iterating over Y of them to check for dupes every time you get a new message this isn't too hard
18:37justin_smithneoncontrails: yeah, I just wonder if there is an existing thing for this
18:38justin_smithamalloy: yeah, that makes sense. I hoped someone would be like "you want message duplication via sampling, as implemented by ztellman/deus-ex-machina, very easy to use!"
18:39amalloywell the thing is, i have this vague feeling that there is something in lamina that's *related* to this, but not directly applicable
18:39justin_smithhaha, I even had the author right
18:41amalloyjustin_smith: i guess see lamina.stats/rate
18:42amalloywhere the idea, if you were going to actually use this, would be to demux your inputs into one channel per input, and check the rate of every channel to see if it's above Y? i dunno, seems like a lot of work for not much value, but this is what i was thinking of
18:42amalloythat is, one channel per equality-partition of the inputs
18:43justin_smithright, interesting
18:44neoncontrailsHey... why don't you try mergesort?
18:45neoncontrailsIf there's a cycle, it'll appear as an uninterrupted sequence of double+ letters
18:46neoncontrailswait let me think this logic through more carefully
18:50justin_smithamalloy: for my purposes I don't even need to check message equality, just having monitoring that says "client X is asking for resource Y at rate Z" is often enough to track down an issue
18:51amalloyjustin_smith: i made something that's close to that for 4clojure, lo these many years ago
18:52amalloyhttps://github.com/4clojure/4clojure/blob/develop/src/foreclojure/social.clj#L11
18:52amalloyobviously it isn't exactly a solution to your problem, and i guess it only works where N=1, but it has some useful techniques probably
18:56emautonjustin_smith: Depending on the resources you're willing to spend, perhaps you could hash the messages and check-and-update a count associated with each hash to (probably) locate rapid-fire dups.
18:57amalloyemauton: that's a little cheaper than just storing the messages themselves in a hashmap, but it's the same general approach. and it has the same problem: how do you decrement the count for a message? incrementing is easy
18:57justin_smithemauton: yeah, I would want to track rate and set thresholds based on our own design for warnings
18:59emautonamalloy: I guess ideally it'd be nice to age them out, resetting a TTL every time a message is updated, but it all sounds a bit finicky.
19:05justin_smithI think the clean way to do it would be a "grouping function" which is like a loosey-goosey hashing function that might only care about the request path and/or client id, a sample-rate that decides how often your metrics are updated, and a mutable cache that gets updated with each incoming request. The task that builds the metrics would also throw away stale input.
19:06justin_smithnow that I come to this conclusion, I will probably see that the way lamina's rate function did it was better
19:08emautonoad...
19:08emauton00:36 < amalloy> if you're getting a small enough number of messages that iterating over Y of them to check for dupes every time you get a new message this isn't too hard
19:08emauton00:36 < justin_smith> neoncontrails: yeah, I just wonder if there is an existing thing for this
19:08emautonBah, sorry.
19:09justin_smithlet me guess, erc?
19:09emautonhttps://github.com/clojure/core.cache/wiki/TTL looks usable for something like this, fwiw.
19:09justin_smithemauton: yeah, caching overlaps here I think
19:09emautonNo, just a tricky Thinkpad touchpad & irssi. :o)
19:11Bronsajust disable click on touch
19:12BronsaI did that after like 2 hours of having a laptop
20:27mordocaiAnyone know if eldoc and company-mode integration is currently broken for CIDER 0.10.0SNAPSHOT? Doesn't appear to be working for me and I want to make sure it's not me. Was working last time I checked, but that's been a bit.
20:27amalloymordocai: are you sure eldoc mode is active?
20:28amalloyi had trouble in slime where sometimes it turned itself off
20:29mordocaiActually it is just eldoc mode. Company mode is working. amalloy: Yeah, definitely active. I've toggled it a couple times.
20:29mordocaiIs there a way to manually make eldoc return what it would say in the minibuffer? Maybe something with my minibuffer is broken.
20:33mordocaiSo that's strange. It works in the repl buffer but not in the file buffer. It is supposed to work in the file buffer right?
20:34amalloyis that file associated with an nrepl session? if you have a cider connection in project A, then it won't necessarily be able to provide documentation in B
20:36BronsaI've never been able to make eldoc work on file buffer with either cider or slime :/ only in repl buffers
20:36mordocaiamalloy: I got it working by running (ns <project name>.core)
20:36mordocaiIdk why that made it work
20:36mordocaiIt was in user namespace before that
20:37mordocaiBronsa: Haven't tried slime, but it was working for for Elisp in scratch.
20:49felipedvorakHi. I'm extra dupper noob, and in my recently installed Prelude with cider installed with packages-list-packages, when I do cider-jack-in it successfully opens the repl window but with an error saying cider version 0.10-0-snapshot doesnt match cider-nrepl's version (not installed).. any ideas?
20:51mordocaifelipedvorak: Yep, see cider-nrepl docs
20:51mordocaione sec
20:52mordocaifelipedvorak: https://github.com/clojure-emacs/cider-nrepl
20:53mordocaiMake a file called ~/.lein/profiles.clj and put {:user {:plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]]}} in it
20:53mordocaiSo same as the docs but for the version
20:54mordocaiYou'll have to update that version in lockstep with cider itself in emacs or you'll get that error
20:56felipedvorakmordocai: update in lockstep you mean manually?
20:56felipedvorakI'm following a tutorial so I missed that documentation. Thanks :)
20:56mordocaifelipedvorak: Yeah, i don't know of a way to do it automatically. Doesn't take long though.
20:56mordocaiI had similar troubles when I was first setting it up, so NP.
21:05mordocaiIf I update my project dependencies in lein is there an easy way to get cider to reload or should I just close and jack-in?
21:07futuromordocai: you might be interested in clj-refactor.el, which does many things, but hot-loading is among them
21:07futurootherwise you probably want...alembic, I think it's called
21:07futuroI'll look for it
21:08futuroyeah, alembic
21:08felipedvorakmordocai: You know if I should run some install command after that? emacs isn't recognizing it..
21:08futuroclj-refactor, when used with the refactor-nrepl middleware, uses alembic to do hot-loading
21:09futuroso if you don't want to set all that up, pulling in alembic should do what you want
21:09futuro(though I've never used just alembic, so I'm not positive)
21:14mordocaifuturo: Coolness. I'll have to try out clj-refactor.
21:14mordocaifelipedvorak: So it's actually for leiningen so it should "just work". Do you kill cider and do a new cider-jack-in?
21:14futuroI've really enjoyed having it
21:14felipedvorakmordocai: yeah.. :/
21:17mordocaifelipedvorak: Looking up how to check if a middleware is installed with lein
21:19mordocaifelipedvorak: Not quite what i'm looking for, but run lein show-profiles user in terminal and pastebin the result.
21:21felipedvorakmordocai: lein show-profiles user outputs nothing, ive tried substituting user for my actual username, which also outputs nothing, and only lein show-profiles outputs base, debug, default, leiningen/default, leiningen/test, offline, uberjar, update
21:22mordocaiYeah lein isn't seeing your profiles.clj then
21:22mordocaiDouble check it is in /home/<your username/.lein/profiles.clj
21:22felipedvorakmordocai: confirmed
21:23mordocaiCan you put the contents of profiles.clj on a pastebin?
21:23mordocaiAlso check permissions
21:23mordocaiMine are 644 for that file. 600 should be fine (hell 400 should be, but idk)
21:24felipedvorakpermission is just read-write for the user, read for the rest
21:24mordocaiYeah, that should be fine
21:24mordocaiThat's what mine are
21:27felipedvorakall that it contains is {:user {:plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]]}}
21:29mordocaifelipedvorak: Weirdness. What's lein version say
21:29felipedvorakLeiningen 2.5.2 on Java 1.7.0_85 OpenJDK 64-Bit Server VM
21:30mordocaiSame as me besides build version of java VM (which shouldn't matter). I'm at a bit of a loss as to why lein isn't loading that then.
21:30mordocaiI'm thinking some small typo that isn't showing up in our communications but idk
21:31mordocaiI'm not really an expert
21:31felipedvorakmordocai: no problem, I thank you a lot for your help :)
21:36TimMcpseudonymous: org.timmc.handy.repl/show for inspection
21:38TimMchttps://github.com/timmc/handy/blob/3da099f0c1440d5a8ab31cb9d369f414067a1204/src/org/timmc/handy/repl.clj#L53
21:49mordocaiSo I'm working on a little maildir library for a project of mine and I could use some help on idiomatic clojure. Specifically looking for help with clojure-maildir.core/move-email right now. It works, but I don't see how to test my corrupted file checking properly errors and I feel it could be written better. Ideas? https://github.com/mordocai/clojure-maildir
22:14justin_smithmordocai: is comparing the hashes of the file contents even easier than just checking byte by byte equality in this case?
22:15justin_smithif you have both files on disk, and need to consume the files to check the sha1, why not just compare every byte?
22:15justin_smithit might be a different consideration if you calculated the first sha while copying the first file, saves a file read
22:17skeuomorfso, defn- makes the function accessible only within the ns it was defined in?
22:17justin_smithsort of
22:17justin_smiththere's always the @#'var trick
22:18skeuomorfjustin_smith: Why "sort of"? The docs aren't very verbose
22:18skeuomorfjustin_smith: ah, so by that I could access it
22:18justin_smith@#'var will access the value even if it is annotated :private
22:18justin_smithright
22:18skeuomorfI see
22:18justin_smithbut I guess privacy always has some caveat
22:19justin_smithdefn- will definitely make it clear to people using your lib that you intend the function to be private
22:19skeuomorfYeah
22:21skeuomorfIs there a document somewhere which lists all the available abstractions with brief but terse explanations? By abstractions, I mean (defrecord, protocols, deftype,..etc)
22:21justin_smithhttp://conj.io has that and more
22:21justin_smithalso the docs on clojure.org of course
22:22skeuomorfI skimmed the docs
22:22skeuomorfhttp://conj.io is like the cheatsheet but a little nicer
22:22justin_smithyeah
22:58mordocaijustin_smith: Theoretically i'm checking at the filesystem level that there wasn't corruption. A bit overkill, but i'm particular about my email. I was thinking of making the verification an optional flag (defaulting to on) anyway. Besides that is there anything that jumps out at you?
22:58mordocaifilesystem-ish level
22:58mordocaiOS caches and all that jazz
22:59justin_smithno, otherwise it looks fine enough
23:00mordocaiCool. The other stubbed out functions is all that I require for my little application I'm writing (clojure-mailfilter) for my personal usecase. So close!
23:03mordocaiI suppose if I really wanted to be sure I should force a fsync and reload the files then check byte equality. Not sure how to do all that in java, and definitely overkill.
23:10irctchello
23:11irctchow do you debug a classnotfound exception?
23:12mordocaiProbably post it to a pastebin, give more context, and we can try to walk you through debugging it.
23:12mordocaiEasiest way i've found to learn besides blogs/books/beating your head against the wall.
23:12justin_smithirctc: ClassNotFound is either a typo, or your deps are set up wrong
23:12justin_smithirctc: yeah, share the stack trace in a paste if you can
23:13irctc(ns web-scraper.core ;; (:gen-class) (:import [com.mohaps.xtractor Extractor] [com.mohaps.fetch Fetcher])) (defn -main "I don't do a whole lot ... yet" [& args] (println "Hello, World!")) (let [xtractor (Extractor. (Fetcher.))])
23:13irctchttp://pastebin.com/29nRbpyG
23:14justin_smithirctc: how are your deps set up?
23:14irctchttp://pastebin.com/uWz1sFw8
23:14irctcI am using this https://github.com/tobyhede/lein-git-deps
23:16justin_smithirctc: well, I know nothing about htat plugin, but ClassNotFoundException makes me think you either spelled something wrong or didn't set the plugin or dep up correctly
23:16irctcright
23:16justin_smithare you building the java code yourself?
23:16justin_smithdoes the plugin build the code?
23:19irctcI am importing it directly
23:19irctcCan cider evaluate defproject?
23:20justin_smithno, I mean, javac has to run in order to build java code, are you running the compilation or does the plugin do it for you?
23:21irctcI think it only adds the dependencies. See: https://github.com/tobyhede/lein-git-deps/blob/master/src/leiningen/git_deps.clj
23:21justin_smithOK, so did you compile the code?
23:21irctcIt was extracted from the cljscript leiningen
23:22irctchttp://pastebin.com/0H496P9Z
23:22irctcI am too sure
23:23irctcCan leiningen build it automatically?
23:23justin_smithirctc: I think with a java project you'll have to define the task if it can at all - because different java projects use different build tools
23:24irctcright
23:24irctccan cider evaluate defproject?
23:24justin_smithmaybe you'll need to figure out where lein-git-deps puts the source and compile it yourself?
23:24irctcit puts it in a folder call .lein-git-deps in the project root
23:24justin_smithirctc: I'm not sure what you mean, it can start up a repl, what are you expecting cider to do with your defproject?
23:25irctcI get this error:1. Caused by java.lang.RuntimeException Unable to resolve symbol: defproject in this context Util.java: 221 clojure.lang.Util/runtimeException
23:26irctcthis is what happens when I evaluate the defproject file
23:26justin_smithdefproject isn't for a clojure repl to load, it's for leiningen. I mean you can load the leiningen libs and use load-project to load up a project but you don't usually need that...
23:26irctcoh
23:26irctcI see
23:26irctcthanks!
23:27justin_smithleiningen uses the project.clj file to figure out how to start your repl - by the time you have your repl the defproject is usually done its work already
23:28irctcif the java library uses maven, how can I get leiningen to compile it automatically?
23:30justin_smithI guess you'll need a custom prep-task that finds the directory where the plugin did the git checkout and then runs the right maven command? seems like it would be complicated to me though, what about just cloning the git repo manually and using maven to install it to your local repo?
23:31mordocaiIdk much about maven, but this seems to suggest that maven and lein work together? http://stackoverflow.com/questions/15910567/does-leiningen-read-maven-settings-in-m2-settings-xml
23:32justin_smithmordocai: lein can use maven settings, but he is talking about auto-building a maven project with an obscure lein plugin...
23:32justin_smithI mean maybe there's an easy way to do it but... ?
23:33irctcWhat I meant is whether leiningen will automatically compile the source
23:33justin_smithirctc: the problem is the source you want compiled uses a maven setup
23:33justin_smithit's not even configured for lein
23:33justin_smithit's not part of your lein project
23:33irctcright.....
23:34felipedvorakmordocai: fixed it! hehe had to add :profiles {:dev {:plugins [[cider/cider-nrepl "0.7.0"]]}}) to the end of the projects project.clj. nothing like reading the docs, now back to the tutorial :D thanks again
23:34justin_smithhow would lein know how to build it?
23:34irctcso I will have to retrieve the dependencies using maven right?
23:34felipedvorakops, substituting 0.7.0 to 0.10.0-SNAPSHOT of course
23:34mordocaifelipedvorak: The user namespace way should have done it too but *shrug*. Glad it fixed it.
23:35irctcdoesn't leiningen use maven beneath it?
23:35justin_smithno
23:35felipedvorakmordocai: I'll make sure to investigate this further after finishing the tutorial :)
23:35justin_smithirctc: leiningen uses some of the same libs maven uses, but it doesn't use maven
23:36irctcjustin_smith: Do you know what is the command the need to be ran in order to retrieve the maven dependency?
23:36irctc*dependencies
23:36irctcWill this work: https://github.com/kumarshantanu/lein-localrepo
23:36irctc?
23:37justin_smithirctc: you have to have maven installed, and then you can run "maven compile"
23:37justin_smithhttps://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
23:38justin_smithbut I think it would be easier to just run "maven install" and then tell lein to use that jar
23:38justin_smithunless you need to frequently update to the latest version of that java code
23:40irctcnope, the development for that project has pretty much completed and I am using it from my github repo
23:43taliosjustin_smith - if that's a _real_ project and not some toy - install a repository manager, and deploy it there, so the rest of your company can use it - without having compile :)
23:47irctcI just checked the library source, the maven pom file is only used for building. All dependencies is stored in the git directory
23:47irctchttps://github.com/mohaps/xtractor/blob/master/pom.xml
23:47irctcso I don't actually **need** maven
23:49taliosmmm there not in the git repo tho... they're in a maven repo tho
23:50taliosxtractor isn't even a clojure project...
23:51justin_smithirctc: well something has to turn the .java files into .class files before you use them
23:52justin_smithusually maven would do that
23:52justin_smithtalios: exactly
23:52irctccurrently I am getting dependency errors as leiningen is trying to compile the webapp together with the library
23:52justin_smithirctc: the class isn't found because you aren't compiling it
23:53irctcleiningen cannot compile it because there's a web app
23:53justin_smithuse maven install, or do as talios says and install to a shared repo
23:53irctcas in the "library" is in the same repo as the web app
23:53justin_smithirctc: leiningen can't compile it because it's not a lein app, it's a maven app
23:53justin_smiths/app/lib
23:54justin_smithanyway I'm out for the night, good luck
23:54irctcoh
23:54irctcthanks
23:55irctcit worked
23:55irctcthanks a ton!
23:55justin_smithnp, glad you figured it out