#clojure logs

2015-03-05

00:01tomjack75% using transduce over a line-seq
00:01tomjackI expect that not having any seq at all (transducing over a lines reducer) would be even better
00:02tomjack(transducers do not make reducers entirely obsolete, just the reducer transformer functions)
00:03justin_smithyeah
00:03justin_smith75% sounds about right for that change, yeah
00:03justin_smith(inc transducers)
00:03lazybot⇒ 2
00:04tomjack(inc justin_smith)
00:05lazybot⇒ 205
01:00rpaulo_any ideas when the final 1.7.0 is going to be released?
02:03tomjackrpaulo_: no, but I think a beta usually comes after the alphas? so probably not very soon, I suppose
05:14gphilipp@hi
05:15gphilippI'd like to create a dynamic var which I could change with set! (similar to *print-length*)
05:15gphilippwhen I do so, i have the following error : IllegalStateException Can't change/establish root binding of: *auto-layout* with set clojure.lang.Var.set (Var.java:221)
05:16gphilippwhat am I doing wrong ?
05:20nsjphoh
05:20nsjphneed to set it to be dynamic
05:20nsjphbut
05:20nsjphyou might prefer to use an atom instead
05:20nsjphtry something like (def myvar (atom "blah"))
05:20nsjph(reset! myvar "somethingelse")
05:22nsjphyou can also use swap! on an atom
05:27hyPiRiongphilipp: you need to do (binding [*auto-layout* value] ... (set! *auto-layout* value2))
05:28hyPiRionIf you wonder why: My guess is that it's because setting a root binding isn't thread-safe. Setting a non-root is, because it's a thread local.
05:28nsjphdynamic vars was one of the very first things i tried to do in clojure
05:29nsjphi rapidly learnt that was probably an indication i was approaching it wrong
05:34dysfunIME there's usually an easier way
05:34nsjphyep
05:34nsjphclojure's immutability means you have to Think Different
05:40gphilipphyPiRion : why don't you need to use (binding...) while using (set! *print-lenght* n) ?
05:42gphilippi'm about to submit a patch to https://github.com/razum2um/aprint because it does auto layout which gets in the way. I would like to make it an option (using a dynamic var).
06:00hyPiRiongphilipp: because Clojure by default puts those in your thread locals
06:01hyPiRionIt's a bit magic, I agree.
06:08Viestihum, it's a convention to use ? at the end of predicate functions, but what about boolean function argument names?
06:09ro_stalso conventional
06:10ro_st(fn update-users [users with-password-only?] …)
06:10ro_stalso conventional to pass a keyword rather than true at call-sites (update-users […] :with-password-only)
06:12Viestiyep, was about to ask that too
06:13Viestipassing true doesn't tell much but a keyword has a better chance :)
06:18Viestiro_st: thanks! :)
06:18ro_stany time
06:19razum2um1gphilipp: PRs are welcome :)
06:21michaelr`oh aprint, nice to meet you.. looks awesome ;)
06:21michaelr`where have you been all this time..
06:21ro_stwossat michaelr`?
06:23michaelr`expressing my happiness of finding out of aprint's existence :)
06:23ro_stright. so what is aprint? :-)
06:24michaelr`https://github.com/razum2um/aprint
06:24ro_stoh nice
06:24ro_stcritical question : can i make that my pprinter in emacs/cider?
06:26michaelr`i don
06:27ro_sti guess i could if i did some (do (in-ns 'clojure.core) (def pprint aprint.core/aprint)) crazy
08:13noncomis there a more concise way to write (if (and (sequential? a) (sequential? b)) (concat a b) b)) ?
08:13noncom* i am creating a fn for (merge-with)
08:20Bronsanoncom: you can rewrite that and as (every? sequential? [a b])
08:21noncomBronsa, so there is nothing like juxt, but for arguments..
08:21noncomessentially, map is like that, but it requires constructing a sequence out of args..
08:21noncomwhich you have just proposed..
08:35agarmanI'm getting an NPE and all I have to go on in the stack trace is user/eval12077 form-init2559650194012227051.clj: 1
08:36agarmanI'm at a loss as to how to figure out what's causing the NPE
08:40Bronsaagarman: (.printStackTrace *e)
08:42agarmanthat helped...I was using (pst)
08:45brkpntthere is a way to know a all the available methods of a type. Like (type? [1 2]) => clojure.lang.PersistentVector. This beacause how can i know for example the mothod .length? I am using Emacs (:
08:47TEttingerbrkpnt, likely using reflection yes
08:47Bronsabrkpnt: try for example (seq (.getMethods (class [1 2])))
08:49TEttinger,(seq (.getMethods (class [1 2])))
08:49clojurebot(#<Method public java.lang.Object clojure.lang.PersistentVector.nth(int)> #<Method public java.lang.Object clojure.lang.PersistentVector.nth(int,java.lang.Object)> #<Method public java.lang.Object[] clojure.lang.PersistentVector.arrayFor(int)> #<Method public clojure.lang.IPersistentMap clojure.lang.PersistentVector.meta()> #<Method public clojure.lang.PersistentVector clojure.lang.PersistentVecto...
08:49TEttingeragh
08:51brkpntjap
08:51brkpntthanks
08:51TEttinger,(clojure.reflect/reflect (.getMethods (class [1 2])))
08:51clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.reflect>
08:51brkpntperfect!
08:51TEttingergreat!
08:51Bronsa,(require 'clojure.reflect)
08:51TEttinger(inc Bronsa)
08:51clojurebotnil
08:51lazybot⇒ 94
08:51Bronsa,(clojure.reflect/reflect [1 2])
08:51clojurebot{:bases #{clojure.lang.APersistentVector clojure.lang.IReduce clojure.lang.IObj clojure.lang.IEditableCollection}, :flags #{:public}, :members #{#clojure.reflect.Method{:name empty, :return-type clojure.lang.IPersistentCollection, :declaring-class clojure.lang.PersistentVector, :parameter-types [], :exception-types [], ...} #clojure.reflect.Method{:name iterator, :return-type java.util.Iterator, :...
08:52TEttinger,:members (clojure.reflect/reflect [1 2]))
08:52clojurebot:members
08:52TEttinger,(:members (clojure.reflect/reflect [1 2]))
08:52clojurebot#{#clojure.reflect.Method{:name empty, :return-type clojure.lang.IPersistentCollection, :declaring-class clojure.lang.PersistentVector, :parameter-types [], :exception-types [], ...} #clojure.reflect.Method{:name iterator, :return-type java.util.Iterator, :declaring-class clojure.lang.PersistentVector, :parameter-types [], :exception-types [], ...} #clojure.reflect.Method{:name newPath, :return-ty...
08:53TEttinger,(:name (first (:members (clojure.reflect/reflect [1 2]))))
08:53clojurebotempty
08:53TEttinger,(map :name (:members (clojure.reflect/reflect [1 2])))
08:53clojurebot(empty iterator newPath arrayFor NOEDIT ...)
08:53TEttingercool
08:53TEttinger,(clojure.string/join " " (mapv :name (:members (clojure.reflect/reflect [1 2]))))
08:53clojurebot"empty iterator newPath arrayFor NOEDIT assocN reduce withMeta tail create create nth shift count access$000 cnt reduce EMPTY_NODE kvreduce seq pop nth asTransient clojure.lang.PersistentVector create root popTail clojure.lang.PersistentVector meta asTransient chunkedSeq pop cons tailoff cons rangedIterator EMPTY assocN doAssoc _meta cons pushTail withMeta"
08:54TEttingerno length?
08:54TEttinger,(re-find #"length"(clojure.string/join " " (mapv :name (:members (clojure.reflect/reflect [1 2])))))
08:54clojurebotnil
08:54Glenjamincnt?
08:54Glenjaminsounds like an abbreviation for count to me
08:55TEttingeror something not work appropriate
08:56Bronsa(re-find #"length"(clojure.string/join " " (mapv :name (:members (clojure.reflect/reflect [1 2] :ancestors true)))))
08:56Bronsa,(re-find #"length"(clojure.string/join " " (mapv :name (:members (clojure.reflect/reflect [1 2] :ancestors true)))))
08:56clojurebot"length"
08:56BronsaGlenjamin: cnt is an internal field used in the implementation of PV
08:57Bronsait's public to allow stuff like data.avl to hook into the implementation
08:57Bronsanevermind, it's not even public
08:58TEttingerdamn, nice Bronsa
08:58TEttingeranother!
08:58TEttinger(inc Bronsa)
08:58lazybot⇒ 95
09:25tomjackjustin_smith: I think my previous results were spurious
09:25tomjackI ran the transducer version in a fresh JVM, and it also brought RES up to 30G according to htop
09:25tomjackand also was only 10% faster
09:26tomjack13min instead of 15mn
09:26tomjackThe 3min time must have been due to JVM warmup or something... not sure
09:56justin_smithtomjack: interesting
09:57justin_smithtomjack: criterium.core/bench will probably be enlightening
09:57tomjackI'm wondering whether doing just "-Xmx50G" without an Xms is a problem
09:58tomjacksince the biggest observable difference so far was that, on the fast transducer run in the first jvm, the RES was already at ~30G, where on both of the slow runs, it started at ~1-2G
09:58justin_smithinteresting
09:59tomjackbut, unfortunately I got the answer I wanted, so I probably won't investigate further :/
10:00justin_smith#clojure: "unfortunately I got the answer I wanted"
10:03xemdetiathe new form of correctness
10:08tbaldridgetomjack: of course the other answer is to measure via a profiler and go from there. Depending on how you translated your original code to transducers, there could be still quite a bit of room for improvement
10:09tbaldridgetomjack: for example: (fnil conj #{}) does a fair amount of allocation for a tight loop, moving that outside of the reduce and into a local could help
10:09tbaldridgeAs well as using transients, etc.
10:11tomjackI thought of trying yourkit, but assumed that if the problem was heap-related, it would be hard to spot
10:12justin_smithtomjack: I don't know yourkit, but jvisualvm definitely profiles heap allocation, and the amount of allocated heap that is in use
10:12tomjack"profiles" as in "how much time did that take"? that would be easy enough for me to interpret, I think, thanks
10:14justin_smithit shows a graph of usage and allocation, I don't know about a straight up "time spent allocating heap", but that's often not the slow thing (except maybe when you first get the heap space from the OS)
10:15tomjackI don't think I have the expertise to (in all cases) correlate what profilers show with what actually matters to me (wall clock runtime)
10:15tomjackbut I guess I have to look at profilers more to get that :)
10:18tbaldridgeyeah, there are memory profilers as well. So in this case, if you see something like "100,000 allocations of fnil_foo_fn42_" you could probably infer that something from fnil was causing allocations
10:18tbaldridgein this case, its the fact that (fnil conj #{}) allocates a new function on every allocation.
10:19justin_smithalso, if you do a CPU profile, and the issue is too much allocation, what would show up is the functions that do allocation being slow
10:19{0}grantIs toxme.se a trustworthy service?
10:19{0}grantOh, sorry ... thought this was #tox. :^I
10:21justin_smithalso, CPU profiling reveals how deep the stack of abstractions we use goes
10:21justin_smithwhich can be fascinating, and very overwhelming
10:21justin_smithlike revealing the massive amount of code the nrepl is running
10:25justin_smithtomjack: other things that can be done include graphing CPU usage and GC activity, and that can show you where allocation churn is a factor in your performance
10:25tbaldridgeYeah, so it may not be worth it for you tomjack, personally, when I see 10 lines of code and someone saying "why is this slow?" I start to get excited.
10:26justin_smithtomjack: jvisualvm comes with the sun jdk (and I think it may come with the openjdk version? not as sure), and it's also a free download
10:36owl-v-what graphic library is there for clojure?
10:36tbaldridgeowl-v-: depends on what you need
10:37owl-v-so.. this guy drawing nodes of ANN and weights of the connections. https://www.youtube.com/watch?v=QJ1qgCr09j8
10:38zeroDivi1guys (assuming that I'm a Clojure newbie), I started playing with https://github.com/danielsz/system (which is just a handy wrapper arounds stuartsierra/component), but I'm having hard time wrapping my mind around some of the stuff there. Would you know any bigger examples or apps coded using this approach or library?
10:38cpmcdanielowl-v-, maybe look at Quil?
10:38profilHey guys. How do I catch the event when a connection is closed is aleph using tcp?
10:41profilin*
10:50tomjacktbaldridge: not sure I understand this: "(fnil conj #{}) allocates a new function on every allocation"
10:50tomjackooh
10:50tomjacknow I understand what you said before about a local, thanks
10:50tomjackhaha
10:56tbaldridgetomjack: yeah, it's a general thing to look for, any sort of function composition causes an allocation, so keep an eye out for (fn..), comp, partial, fnil, juxt, etc. inside tight loops.
10:57H4nsI have a some functions that perform various checks on a data structure and that need to return true or false based on the validity of the structure. if a rule fails, a message needs to be generated, the first failure should return from the function. I'm using catch/throw right now to do the non-local exit but that seems fishy. Is there some library which makes this pretty?
10:59justin_smithH4ns: if you need unconditional exit plus a message, that's pretty much what exceptions are for. I would consider another approach if this is a common code path, since exceptions are slower than a conditional, but for handling invalid input this seems fine
10:59justin_smithH4ns: sounds almost like a :pre condition
10:59justin_smith,((fn [a] {:pre [(even? a)]} (inc a)) 1)
10:59clojurebot#<AssertionError java.lang.AssertionError: Assert failed: (even? a)>
11:00H4nsjustin_smith: i need custom messages - does :pre have that?
11:01H4nsjustin_smith: my coworker just said that preconditions will not be checked when assertions are switched off, so that's probably not the right tool here.
11:01justin_smithH4ns: no, but you can use assert (and I really do wish pre had custom messages)
11:01justin_smithH4ns: oh, so this is for runtime data validation from a third party?
11:01justin_smithI would check out prismatic/schema
11:02H4nsjustin_smith: i'll have a look at schema, thanks!
11:06H4nsnot quite what i was looking for either. i'll just write a with-rule-checking macro to remove the clutter from the checking functions
11:15justin_smithH4ns: what sorts of things are you checking for?
11:16H4nsjustin_smith: these are internal consistency checks and database lookups
11:24arav93Hi
11:36arav93Any idea about gsoc stuff?
11:40vasHi
11:40vasWhat's a gsoc?
11:41arav93Google Summer of Code!
11:41hlprmnkygoogle summer of code, most likely
11:41arav93:)
11:41vascan't wait to put my devbox in a bikini...
11:41vas:D
11:52gfrederickshelp I am writing a named version of clojure.core/format
11:56gfredericks(named-format "You have %amount~d dollars" {:amount 20}), e.g.
11:56gfredericksplease tell me this exists somewhere already so I can stop
12:05pjstadig,(str (map println (range 1 5)))
12:05clojurebot1\n2\n3\n4\n"clojure.lang.LazySeq@e1781"
12:06pjstadig^ has this ever come up before? the fact that calling toString on a lazyseq realizes it because it has to calculate the hashCode?
12:06gfredericksthere's a ticket I think
12:06pjstadiggfredericks: i did i search but couldn't find anything
12:06gfredericksI've definitely discussed it before
12:06mbacis there a standard library version of this (defn array-init [len f] (float-array len (map f (range len))))
12:07gfrederickspjstadig: also coulda been a ML thread
12:08chousergfredericks: maybe https://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/strint.clj
12:08puredangerthis has come up before
12:08gfrederickschouser: yeah I've thought about that, but I don't really want general eval, and I like having all the other features of format
12:09gfrederickschouser: I'm thinking this can be a pretty simple parse that defers to c.c/format
12:10gfredericksI have a buggy POC already
12:11whiddengfredericks: have you looked at cl-format? Its a port of the CL format to clojure and supports a lot of 'interesting' directives
12:11tomjackif str on a lazy-seq realizes it, why don't we just return a good str?
12:12tomjackI could understand "we don't want to realize it" as an excuse if you didn't realize it :)
12:12pjstadigtomjack: yeah
12:12tomjackI guess one response is still "hashCode in the str is a bug, we shouldn't realize"
12:12pjstadigalternatively have a toString impl that defers to System.identityHashCode instead of hashCode
12:13tomjackyeah. incidentally I always assumed that thingy _was_ identityHashCode
12:16puredangerI can't find a ticket for this either but seems reasonable to have one to me
12:17gfrederickswhidden: is named parameters one of them?
12:18gfredericksI just made https://www.refheap.com/98133 /cc whidden chouser
12:25whiddengfredericks: the quick answer is no.
12:26gfredericksif nobody dissuades me I will probably make this into a library and then add a helper macro to catch-data for throwing ex-info objects whose err messages can reference the attached data
12:27justin_smithgfredericks: is there a reason not to use one of the less featureful mustache libs?
12:27gfredericksprobably not
12:27gfredericksI'm not very know about mustache libs
12:27gfredericksclostache?
12:28mnngfltgI've had bad experiences with clostache
12:28justin_smithstencil is decent
12:28gfredericksit looks HTML oriented
12:28gfredericksautomatically escaping html would be a downside
12:28justin_smith{{}} turns of html escape
12:29justin_smitherr, I mean {{{}}} does
12:29mnngfltgstencil is better
12:29gfredericksand having all the features of c.c/format seems useful
12:29gfredericksthough with the code I just wrote there are drawbacks like not being able to access nested maps
12:29justin_smiththat's a good reason not to use a mustache
12:30gfredericksnow I just have to name the library
12:31mnngfltgmaybe `selmer`, that seems inspired by python's jinja2
12:32mnngfltgwhich is used in ansible (i.e. not for html templating)
12:32hiredmanhttps://github.com/gfredericks/one-weird-trick
12:33Glenjaminhttps://github.com/gfredericks/taking-names
12:34gfrederickshiredman: lol; that works for a lot of different hypothetical libs :)
12:34hiredmanI know, that is the problem
12:34hiredmanwhat if you have more than one weird trick?
12:35gfrederickswhich I do
12:35mnngfltgthey don't want you to know about it
12:35gfredericksthe mustache people hate me
12:35gfredericksadd this to your project.clj to find out why
12:37H4nsis there a way to access the defined methods of a multimethod?
12:37hiredman,(doc methods)
12:37clojurebot"([multifn]); Given a multimethod, returns a map of dispatch values -> dispatch fns"
12:37H4nsthanks!
12:40noncomi am writing in clojure for like 2+ years already, and i did not use multimethods, records and protocols at all, as they make me feel like they are a little constraining and not too lispy. what do you think?
12:41H4nsi like multimethods
12:41noncomdo i lose something not using them?
12:41cap10morganIs it possible to extend a constructor-less base class (with proxy or gen-class or anything else) from Clojure? Everything seems to want to call a superclass ctor.
12:41H4nsi don't care about lispy, and i've written a lot of lisp in my life.
12:41H4nsnoncom: you loose the expressiveness that they provide.
12:42noncomh4ns: right.. i have to start to use them..
12:42noncomis there a separate chat for core.async as of now, or do i ask questions here ?
12:43mnngfltgnoncom, I see them as a way to refactor (cond (= :a obj-type) (do-a) (= :b obj-type) (do-b))
12:43H4nsnoncom: i did not want to say that. there is plenty of tools in clojure, so if you feel that you can express your ideas clearly without multimethods, you can ignore them safely.
12:44gfrederickscap10morgan: is that possible in java?
12:44mnngfltgit's totally possible that you siple didn't run into any situations where you needed multimethods
12:44cap10morgangfredericks: yes, the base class is abstract
12:44noncomh4ns: well, you see, i tend to agree with you... and with mnngfltg too.
12:44noncom:)
12:45cap10morgangfredericks: specifically this class: https://github.com/jknack/handlebars.java/blob/master/handlebars/src/main/java/com/github/jknack/handlebars/io/URLTemplateLoader.java
12:45gfrederickscap10morgan: oh interesting; I don't know actually
12:45noncomcap10morgan: why dont you just try? :)
12:46gfredericksnoncom: try what?
12:46cap10morgannoncom: I have been trying for the past hour, and can't get it to work. "No matching ctor found" errors abound.
12:46noncomwell, extend the class
12:46noncomhmm i see... let me try too :D
12:46cap10morganpresumably when trying to call the non-existent base class constructor
12:46cap10morgannoncom: cool, thanks
12:49TimMc,(def life-with-newborn (repeatedly #(condp > (rand) 0 "laundry" 0.4 "feed baby" 0.7 "change diaper" 0.8 "misc" 1 "feed self")))
12:49clojurebot#'sandbox/life-with-newborn
12:49TimMc,(apply println (take 20 life-with-newborn))
12:49clojurebotchange diaper feed baby change diaper change diaper feed self change diaper change diaper change diaper change diaper feed baby change diaper feed baby misc change diaper change diaper feed self feed baby feed baby feed baby feed baby\n
12:50gfredericksTimMc: do you have a babby?
12:50TimMcyep
12:50TimMcas of Saturday
12:51TimMchmm
12:51TimMcs/misc/sleep/
12:51gfredericksTimMc: congrats
12:52tbaldridgenoncom: you can ask core.async questions here
12:54noncomtbaldridge: cool! :) well, i am making a gui system. currently i am having a channel per gui element. the gui element can post messages to it, exclusively to be consumed by its hierarchical children. so, is it ok to have a channel per gui element, or do i better make a common bus and make each element look at it to pick messages related to it?
12:55tbaldridgeThe more ui I work I do, the more I like the common bus pattern perhaps even with a pub/sub. IMO it makes wiring everything much simpler.
12:55tbaldridgeYou simply look for messages of a given type, or id, instead of having to attach to a specific instance of a channel.
12:55noncomright. that's the point!
12:56noncomok, so nice to hear this from your experience
13:00justin_smithtbaldridge: hmm, that makes me think you could even use derive / isa? to do your propagation (each thing knows the superclass(es) of what it is interested in)
13:00justin_smithnot propagation, I mean selection
13:01tbaldridgeyou certainly could
13:01N8DawgHi All, wondered if theres any AOT Lein experts here, got a problem which is really frustrating
13:01justin_smith~aot
13:01clojurebothttp://i.qkme.me/3vb225.jpg
13:01tbaldridge~AOT
13:01clojurebotAOT is kinda broken already
13:02N8DawgI'm trying to create an uberjar
13:02N8Dawgideally i just want the main entry point compiled
13:02N8Dawgand leave the rest as clj
13:02tbaldridgejustin_smith: noncom: I've also been experimenting with a model that was pioneered in Pedestal App, where the messages from your UI component's aren't in the form of "Button 1 clicked" in in the form of "Action: Add User, Name: John Doe"
13:03N8Dawgis that possible? I specified :aot [mynamespace.main] in project.clj
13:03tbaldridgeSo you don't so much listen to ui events as you do write your whole app in a model that looks a bit like CQRS. Commands to a data-model, updates to the data model propagate to the UI via views.
13:04aperiodicN8Dawg: by default AOT transitively compiles all required namespaces. I believe it is possible to achieve this with some indirection; I'm trying to find an example right now.
13:04aperiodicN8Dawg: so this is how trapperkeeper achieves that: https://github.com/puppetlabs/trapperkeeper/blob/master/src/puppetlabs/trapperkeeper/main.clj
13:04noncomcap10morgan: well... https://www.refheap.com/98134 :)
13:04noncomis there anything wrong?
13:05noncomN8Dawg: what's the lein ver?
13:06cap10morgannoncom: interesting... I'll play around w/ it and see where I went wrong.
13:06N8Dawgnoncom: 2.3.4
13:06N8Dawgaperiodic: Thanks i will give a go
13:06noncomN8Dawg: well, i have the same scenario, and i just have (:gen-class) in the main ns, and i have :main [my-main-ns] in project.clj
13:06noncomthat's all
13:07aperiodicN8Dawg: keep in mind, though, that by keeping the majority of code dynamically compiled, you're losing a fair amount of the performance benefit of AOT. I think that the above namespace is basically what clojure.main does, so perhaps you should just use that.
13:07noncomeach time i uberjar, lein threatens me that in version 3.0.0 things will change, but..i am on 2.x now..
13:07aperiodicN8Dawg: https://clojure.github.io/clojure/clojure.main-api.html
13:07aperiodicN8Dawg: check out the documentation for the `main` function
13:08aperiodicnoncom: the only thing that will change is that you'll need to add `:aot [my-main-ns]` to your project.clj
13:08noncomtbaldridge: interesting
13:08noncom* sorry, i have :main my-main-ns, not :main [my-main-ns]
13:10N8Dawgaperiodic: I want uberjar not for performance but for deployment / running as a server
13:10noncomaperiodic: so, the workaround in lein 3+ will be the way that trapperkeeper does ?
13:11aperiodicN8Dawg: yeah, just call clojure.main with the appropriate arguments, then
13:12aperiodicnoncom: no, it's not a workaround. lein will just stop acting like you put the :main namespace in the list of namespaces to AOT; you'll have to do that yourself
13:31cap10morgannoncom: I had created a red herring for myself. Thanks for helping me back to path of simplicity. :)
13:43noncomcap10morgan: ;)
13:44N8DawgIs Zach Tellman online?
13:44N8Dawgthink i've found an odd bug with aleph + clojure 1.7 alpha 5
13:44noncomN8Dawg: can't see him in the list
13:45noncomi think there was a command...
13:45noncom,seen ztellman
13:45clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: seen in this context, compiling:(NO_SOURCE_PATH:0:0)>
13:45noncomumm.. not that
13:45aperiodic$seen ztellman
13:45lazybotztellman was last seen quittingQuit: Computer has gone to sleep. 2 hours and 16 minutes ago.
13:46noncomthats it!
13:49N8Dawg$seen ztellman
13:49lazybotztellman was last seen quittingQuit: Computer has gone to sleep. 2 hours and 20 minutes ago.
13:56puredangerN8Dawg: I'm curious even if ztellman's not around :)
13:57N8Dawgpuredanger: so the problems in manifold
13:58N8Dawgpuredanger: used by aleph, says cant resolve a symbol. symbol points to a macro, bizarre thing is symbols before and after are read find
13:58N8Dawgfine, almost as if the entire defmacro form is commented out
13:58puredangercan you put the actual error somewhere refheap etc
13:58justin_smithN8Dawg: does lein deps :tree show any conflicts?
13:59puredangerand how does 1.7 play in?
13:59N8Dawgjustin_smith: there are conflicts, but dont think they're related
13:59justin_smithN8Dawg: so you mean there is no manifold conflict at all?
14:00justin_smithbecause if one lib expects to see a macro in another lib, that is present, my first assumption is versions
14:00N8Dawgjustin-smith: thats correct
14:01N8Dawgso the form its not reading is here
14:01N8Dawghttps://github.com/ztellman/manifold/blob/master/src/manifold/utils.clj#L64
14:01N8Dawgfuture-with
14:01N8Dawgmax-depth and without-overflow 'are' being read
14:01N8Dawgwhich are the forms before and after
14:02N8Dawgso in the repl I require the namespace
14:02N8Dawgi see everything but future-with
14:03justin_smithN8Dawg: if I browse the history of that file, there was a version from Jan 29th that does not define that funciton
14:03justin_smith*macro
14:03justin_smiththe simplest explanation is that is the version in your release
14:03justin_smithtry opening the source inside the jar that lein puts on the classpath
14:03justin_smithlein cp will show you the path to that jar
14:03N8Dawghmmm you think it might have an old version cached somewhere
14:03justin_smithno, it's not about caching
14:03justin_smithit's about the version that is resolved
14:03justin_smithopen the jar that lein cp shows for manifold
14:04justin_smithbrowse that source
14:04justin_smithif that is not the version you need, edit your project.clj
14:04N8Dawgjustin_smith: occams razors suggests thats the most probable explanation
14:04justin_smitha good editor can open a jar as if it were a directory (both emacs and vim can do this)
14:09arav93Hi!!
14:09N8Dawgjustin-smith:
14:10N8Dawgjustin-smith: sorry, accidental return, so i did lein cp, looked for the manifold jar, extracted it, and yes the macro IS defined
14:10justin_smithOK, that's weird
14:17N8Dawgjustin-smith: so whats really bizarre is if I run (ns-publics (find-ns 'manifold.utils))
14:17N8Dawgi see all the vars, except future-with
14:17N8Dawgi also see future defined
14:18N8Dawgits as if future-with has been renamed to future
14:18justin_smithand you are sure that the repl where you look at this has the same version of the dep as was reported by lein cp? no edit to project.clj in the meantime?
14:19justin_smiththere is a trick to finding the jar that some namespace was loaded from, but I am forgetting how it works
14:20N8Dawgi ran lein repl
14:20N8Dawgyeah sure is the answer
14:21AeroNotixif I defprotocol will java be able to implement it no probz?
14:23justin_smithAeroNotix: defprotocol will create an interface, but you may want to directly use definterface if the goal is for it to be usable from java
14:25N8Dawgjustin-smith: i have an old version kicking around somewhere which is causing issues
14:25N8Dawgjust need to find where, thanks for the pointers
14:27justin_smithN8Dawg: this should be handled by project.clj / lein. Just removing the version from ~/.m2/ will not fix anything, because if lein thinks you need that version it will just download it again. The solution is to make sure the precise version you need is specified.
14:28justin_smithsometimes there is the issue that some lib was aot-compiled so you get the version of one of its deps that it compiled in, the solution to that is generally not to aot libs, and not use libs that have been aot compiled
14:31gfrederickswelp https://github.com/gfredericks/like-format-but-with-named-args
14:55winkgit clone .../not-good-with-names :P
14:56surrealanalysisI’m having some trouble with reagent, where a style element isn’t being updated when I think it should be. Offending line is here: https://github.com/KevinGreene/color-eyes/blob/master/src/cljs/color_eyes/color_selector.cljs#L29
14:57surrealanalysisAnd it stays at what “color-map” was initialized to
14:57surrealanalysisBut the line below is updated as changes are made
14:57surrealanalysisAny ideas?
15:37AeroNotixjustin_smith: thanks mate
16:01turbofailwelp. bought my clojure/west ticket
16:02turbofailnow i need to figure out how i'm getting there
16:03aconbere:'( I'm running into a bizarro bug in either pigpen or prismatic/graph where if I try to run a function in pigpen that calls a graph function it fails to find the graph-record generated for the definition :(
16:07aconbereraises a class not found error
16:07aconbereoh the tears
16:47AeroNotixdid any one implement a UUID type with buffy?
16:47AeroNotixI can do it, just wanted to see if someone else had done so first.
17:02AeroNotixhow do I express a constructor that takes a [B?
17:23justin_smithAeroNotix: do you mean how to do that type hint, or how to pass one in?
17:28AeroNotixjustin_smith: for ctors in a gen-class you need to specify the types.
17:28AeroNotixHow do I specify a byte-array?
17:28justin_smith^"[B" is a valid type hint
17:29AeroNotixso I'm guessing that "[B" would be fine?
17:29justin_smithyeah
17:29AeroNotixsince you don't seem to need the ^ for ctor types
17:29AeroNotixcool, ok. I'll try thi
17:29AeroNotixthis
17:29AeroNotixthanks!
17:30aperiodicyou can also just use the `^bytes`
17:30aperiodicthe `^bytes` alias
17:31aperiodichttp://clojure.org/java_interop#Java%20Interop-Aliases
17:31AeroNotixaperiodic: thanks
17:49aconberehey all, I'm struggling with an error I'm experiencing in the pigpen library, and it has taken me down a rabbit hole of macros
17:49aconbereI'm curious about what I should expect from the *ns* value in a macro
17:50aconberewould it be evaluated when the file is parsed and thus always have the ns of the file it's in?
17:50aconbereor...
17:50amalloyaconbere: the namespace of the code calling it
17:50aconbereconfusing
17:50aconbereamalloy: gotcha
17:51aconbereamalloy: so I think my questions start with this function
17:51aconberehttps://gist.github.com/aconbere/e1a2f003bfc1f6d6d782
17:52aconberewhich seems fairly straightforward, it appears to execute f in the ns provided
17:53aconbereit's used in this set of macros/functions
17:53aconberehttps://gist.github.com/aconbere/e1a2f003bfc1f6d6d782#file-gistfile2-clj
17:54aconbereand basically what I'm seeing is that I have another library that's got a macro that's generating a symbol (gensym?) in a namespace
17:54aconbereand when I try to call a function from that namespace using the functions I linked
17:54aconberethey can't find the generated symbol
17:54aconbereand it hurts my brain even to say all that
17:54aconbereoof
17:55lvhI have some (blocking or core.async chan returning) functions. I have a bunch of work items for them to do, with (limited) parallelism. Is that what pipeline and pipeline-* are for? If so, I guess I get to write a transducer
18:03martinklepschwhy is there [incanter "1.9.0"] on clojars but the Github repo is at 1.5.6 ?
18:04martinklepschnvm. Seems that everthing is happening in "develop" branch
18:29brkpntAny link of how to debug a clojure application? Is posible to step a function via cider?
18:35justin_smithbrkpnt: the best debugging setup is probably using cursive with intellij at this point
18:37AeroNotixso with Buffy how do I just get a [B of my type? Seems non-trivial
18:43AeroNotixah you can just pass in your own buffer
18:43AeroNotixnvm
18:46turbofail33
18:47AeroNotix54
18:47justin_smiththat's numberwang!
18:48justin_smithlet's rotate the board
18:48AeroNotixhaha
18:48TEttinger$google herringbone wang tiles
18:49lazybot[Herringbone Wang Tiles] http://nothings.org/gamedev/herringbone/
18:49TEttingerspeaking of boards by Wang
18:49justin_smithTEttinger: I assume you've seen the numberwang sketches
18:49TEttingernope
18:50justin_smithhttps://www.youtube.com/watch?v=qjOZtWZ56lc
18:50TEttingermy C# generator of a grid of these herringbone wang tiles is much more concise than my clojure one, to be honest. it's a very suitable problem for 2d arrays
18:50justin_smithinteresting
18:52TEttingerheh
18:52clojurebotI don't understand.
18:52TEttingeryou wouldn't, clojurebot
18:52justin_smithnumberwang gets funnier when you see more episodes
18:53justin_smithnumberwang, that is
18:54TEttingerI liked Homonym on 30 Rock, the parody of game shows used as part of a ploy to make NBC fail
18:54justin_smith~that |is| numberwang
18:54clojurebot'Sea, mhuise.
18:55TEttingerhttps://www.youtube.com/watch?v=3cStRdYg3Wk
18:57vashey party people
18:58vasi'm trying to match a compojure route up with some methods... it seems fine, i pass a datomic entity ID and get back info about the entity.. but trying to invoke the same method from my handler tells me that the "processing rule" Cannot resolve key
19:01vasactually the stack trace is huuge, but i don't know why it "can't resolve key" via the URL parameter even though it works when i directly invoke the func
19:06jhngiven that i have a collection as follows: (map vector '(1 2 3) '(4 5 6))
19:06jhn=> ([1 4] [2 5] [3 6])
19:07jhnhow do I pass that into a function like this: (defn signs [[first second]] (if (> first second) first second))
19:07jhnbasically i want this to work: (map signs [1 2]), but I get
19:08jhnuh wait
19:08jhnnvm
19:08jhn:-)
19:09vas:-)
19:13jhnok so here's the actual question
19:13jhngiven that i have this function
19:14jhn(defn zipit [col] (map vector col (rest col)))
19:14jhnand this other one
19:14jhn(defn bigger [[first second]] (if (> first second) first second))
19:15jhnhow do I map bigger to the result of zipit?
19:16chouser(map bigger (zipit some-collection))
19:16AeroNotixfor real I can't actually see a good way to retrieve the bytes from a Buffy spec.
19:17chouserjhn: or: (map max coll (rest coll))
19:24AeroNotixI think I found it, dumb interface.
19:24AeroNotixhttps://gist.github.com/AeroNotix/5f1428945cd90ca736b9
19:59NoCreativityHello!
20:00NoCreativityDoes anyone have tips on how to use clojure.test with leiningen? I can't (run-tests) like my tests are never loaded into my classpath.
20:08hiredmanclojure.test is how leinigen assumes you are writing tests
20:08hiredmanlein test will run them
20:09NoCreativityLet me test with lein test first then
20:09hiredmanif you want to run tests from the repl you need to load the tests first, via require, load, whatever load-file thing your editor does, etc, etc
20:14quxanyone seesaw friendly :
20:15quxi would like a button to be enabled based on the value of a text field
20:15quxis seesaw.binding the right-way to do this ?
20:16NoCreativityhiredman: thank you!
20:16NoCreativityhiredman: it worked!
20:49timvisheranyone aware of something like this in core? `(fn [ y pred xform ] (if (pred y) y (xform y)))`?
20:50amalloywell, if you include flatland/useful that's (fixing (! pred) xform). in core, you can slap it together with cond->
20:51amalloyer, i guess to-fix, not fixing. i always get the conjugations of those things wrong
20:51amalloyor if you want it not point-free, (fn [y] (fix y (! pred) xform))
20:52MorgawrI'm trying to do some clojurescript testing for my stuff (first time I do testing in clojure) and this is the output I get when doing (is (= tree-1 tree-2)) (where tree-1 and tree-2 are two data structures I need to compare) https://www.refheap.com/235c06db9ee7d439c55dd854b
20:53MorgawrIt's SO hard to understand what is going on.. is there a better way to do this? :/
20:53MorgawrI mean, I have no idea where to even begin to parse this monster
20:56MorgawrThere must be a better way to do this...
21:02nuwanda_i mean, a pretty printer will help, but the data structure is huge
21:03Morgawrnuwanda_: it's jus a very small tree...
21:03Morgawrjust*
21:04chouserdata.diff may help you find the diference
21:04Morgawrchouser: can I use that in clojurescript?
21:04chouseroh! hm, no idea.
21:05dnolenMorgawr: yes data.diff exists there
21:06dnolenthe only major namespace missing is clojure.pprint
21:07Morgawrdnolen: Alright, I'll check it out thanks.