#clojure logs

2015-02-08

00:00julianlevistonOCCAM is an ugly language. It’s not self-similar enough. Function calls (and therefore value passing) would need to be along the same kind of chan idea. I need to think about this more.
00:01alex1yo fuck bois
00:02alex1anyone there?
00:03montyxcantsindon't let syntax obscure the essence
00:03julianlevistonmontyxcantsin: syntax is what I’m talking about.
00:03julianlevistonmontyxcantsin: the essence is good. Same as core.async.
00:04julianlevistonmontyxcantsin: the issue I have is with default syntax of most programming languages and the time models they encapsulate.
00:04julianlevistonmontyxcantsin: what we do often should be easier to do than what we do rarely.
00:05julianlevistonmontyxcantsin: and as it stands, we consistently bind instructing the computer that we want sequential processing with the same instruction as when we don’t care because we don’t have any other way to do it.
00:06vasjulianleviston: your approach makes all the more sense as we approach the ability to quantum compute / settle a multitude of dissonant states into a harmony in a blink
00:07montyxcantsinyeah the essence I speak of with occam wrt your statement is that you have to explicitly declare SEQ if you want sequential execution PAR for parallel
00:07julianlevistonThe weird thing is, most people start out thinking that this way I’m describing *is* the way it works… we have to be “educated” that we’re giving the computer sequential instructions...
00:11julianlevistonfor example, in this: (let [a 10 b 20] (doall (doseq [num [a b]] (println num)))) I don’t happen to care what order the let binds its values. In fact, say I have 500 values to bind… then I’m quite happy for it to do it in parallel if it can… what I *do* care about is that the results are then printed in order, so I choose a vector for order, and execute a sequential operation over that vec. Say those values arnâ€
00:11julianlevistonstatic, and they’re all the result of getting http requests, then I have different concerns such as contention, throttling, etc., which are expessible via core.async today, but the code to write it is clumsier than it *could* be. A better, more first-class syntax would make expressing the patterns and shapes of computation vastly easier.
00:13hueypis pipe the correct method to apply a transducer to a channel? e.g. (async/pipe in (chan 1 xf))
00:13hueypultimately I want to do into ... but async/into doesn't appear to take a transducer?
00:14julianlevistonhueyp: I think it depends what you’re trying to do.
00:14hueyphere is the full ... (async/into [] (async/pipe in (chan 1 xf)))
00:15julianlevistonhueyp: map?
00:15julianlevistoninto with map?
00:15julianlevistonhueyp: don’t treat my comments as authoratitive, tho.
00:16julianlevistonhueyp: having said that, I would use into and map.
00:16julianlevistonhueyp: just the same as normal programming.
00:17julianlevistonjustin_smith: what do you think?
00:19justin_smithhueyp: in this case, pipe will be taking in, running f on each element, and putting it on an anonymous channel that nobody can ever read because it has no binding anywhere
00:19justin_smithhueyp: I doubt that is what you were intending to do
00:19hueyppipe returns the out chan
00:19justin_smithoh, it does? I didn't realize
00:20hueypya, it works ... just seems weird that async/into doesn't take a transducer like core into
00:20justin_smithhueyp: but why not just async/map ?
00:20hueypxf = (comp (drop 10) (take 50) (map :id))
00:20justin_smith(async/into [] (async/map xf in))
00:20hueypsweet, lemme do that
00:21justin_smithoh, map takes a coll of chans
00:21justin_smithso it would be [in]
00:22justin_smithI still think (async/map xf [in]) is clearer than (async/pipe in (chan 1 xf))
00:22julianlevistonjustin_smith: that struck me as weird that it doesn’t follow the core map signature exactly.
00:23julianlevistonjustin_smith: as in one or more colls / (colls/chans)
00:23hueypneed to read async/map a bit, it is returning not what I would have expected ;p
00:24justin_smithhueyp: extra layer of colls around each element?
03:06julianlevistonalandipert: ping?
03:37julianlevistonhehe throwaway line in Micha’s part of the hoplon talk they did at clojure/west 2014: “Sequences get spliced in as children”… that’s what I’ve wanted in Om for ages.
03:38julianlevistonhttps://www.youtube.com/watch?v=wVXjExRiFy0#t=1105
03:50michaelr`hmm hmm hmm
03:51michaelr`i don't get it, how are circle in their frontend code updating the state atom directly and getting the ui to refresh?
03:51michaelr`circleci
03:55julianlevistonmichaelr`: give me a context?
03:56julianlevistonmichaelr`: ie what are you looking at that you don’t get?
04:03michaelr`julianleviston: hi
04:05michaelr`If you start from here: https://github.com/circleci/frontend/blob/master/src-cljs/frontend/core.cljs#L302
04:05michaelr`continue through here: https://github.com/circleci/frontend/blob/master/src-cljs/frontend/core.cljs#L222
04:08ggherdovHi. Say I have a PersistentTreeMap. I turn it into a PersistentArrayMap with sorted-map-by. Then, how do I get the first (top ranked) 10 key-val pairs?
04:08ggherdovHi. Say I have a PersistentTreeMap. I turn it into a PersistentArrayMap with sorted-map-by. Then, how do I get the first (top ranked) 10 key-val pairs?
04:08ggherdovHi. Say I have a PersistentTreeMap. I turn it into a PersistentArrayMap with sorted-map-by. Then, how do I get the first (top ranked) 10 key-val pairs?
04:09michaelr`julianleviston: and then here: https://github.com/circleci/frontend/blob/master/src-cljs/frontend/core.cljs#L133
04:10michaelr`julianleviston: they update the app-state atom directly and not through Om's transact! or update!, when you do it like that it won't trigger a refresh of the component tree.
04:11michaelr`So I wonder what's the trick they are using to do that and also get the screen refreshed?
04:11julianlevistonggherdov: can’t you just take 10?
04:11ggherdovsorry for repeating the question above, client problem
04:11julianlevistonggherdov: or am I misunderstanding?
04:11ggherdovjulianleviston: ah probably
04:12julianlevistonmichaelr`: won’t it?
04:13julianlevistonmichaelr`: I didn’t realise they were using Om.
04:13julianlevistonoh yeah, right :)
04:13michaelr`hmm
04:14julianlevistonmichaelr`: they don’t have an observer on it or something?
04:15julianlevistonmichaelr`: I thought transact! was for cursors.
04:16michaelr`no observers
04:16julianlevistonmichaelr`: and cursors maintain their own view into an atom, therefore updating the underlying atom should update the display too, right?
04:16michaelr`i think not..
04:17michaelr`if you use Om's interface through cursors to update the state then you get Om's functionality but otherwise not IMHO
04:18michaelr`I think maybe this is their trick: https://github.com/circleci/frontend/blob/master/src-cljs/frontend/components/app.cljs#L98
04:20michaelr`maybe not
04:20michaelr`:)
04:23julianlevistoncould it be nav-con/post-navigated-to! ?
04:27michaelr`i don't there anything which is supposed to trigger a refresh..
04:27julianlevistonmichaelr`: well there’s a put on some chan there…
04:28julianlevistonmichaelr`: I’m not familiar enough with the architecture to really know what I’m talking about
04:30michaelr`yes, it calls someting which calls something else, but I didn't find anything which causes a refresh of the ui :) the state updates are in the handler functions in the core namespace using swap!
04:31julianlevistonmichaelr`: but this is for the setup, so maybe it’s not sufpposed to update the ui>?
04:31julianlevistonmichaelr`: just guessing
04:32julianlevistonmichaelr`: what’s that main fn’s alt! doing?
04:33michaelr`waiting for stuff to arrive on multiple channels
04:34julianlevistonmichaelr`: yeah I know what alt! does lol… but you’re assuming a lot unless you know loads about the underlying architecture aren’t you?
04:34julianlevistonmichaelr`: you’re assuming they’re using cursors to update the ui, for example....
04:34julianlevistonmichaelr`: and yet, there’s a websocket channel involved…
04:35julianlevistonmichaelr`: I know in my app, I don’t use cursors to update the state… I update it with component local state over channels… the components themselves update it, based on input from channels.
04:36julianlevistonmichaelr`: so go look at one of their stateful components and see what it’s doing.
04:41julianlevistonmichaelr`: this might be a bit telling? https://github.com/circleci/frontend/blob/master/src-cljs/frontend/components/app.cljs#L97
04:44julianlevistonmichaelr`: I don’t really understand it.
04:44julianlevistonmichaelr`: sorry if I wasn’t any help.
04:49Glenjamini can't seem to see anything which makes the app re-render when the state atom changes :s
04:50Glenjaminunless everything just calls reinstall-om!
04:56Glenjaminthe app seems to just swap! the state atom, does om watch the atom you tell it to render?
04:58Glenjaminmichaelr`: https://github.com/omcljs/om/blob/master/src/om/core.cljs#L1161
05:06ggherdovI have a function with side effects that takes a number as argument. I want to evaluate the function as the body of an infinite loop, with the argument increased by one at each iteration. What's an idiomatic way to do it? I am not sure if reduce, list comprehension (for) over the list of numbers, while...
05:06michaelr`Glenjamin: hmm
05:07julianlevistonggherdov: try it out, then ask the question.
05:08ggherdovfair enough
05:11julianlevistonGlenjamin: it calling reinstall-om! every time it needs to update seemed to be what it was doing to me, too… that seems very hackish tho… surely that’s not what they’re doing…
05:13Glenjaminjulianleviston: reinstall is just for a full-rebuild, otherwise it relies on the add-watch in Om combined with swap! on the state
05:17julianlevistonGlenjamin: ah ok...
05:18julianlevistonGlenjamin: ah ok cool… I *thought* updating the state atom re-rendered. Good to know I wasn’t insane :)
05:27kirwondering if anyone can recommend some reading on the rational of declarative programming ?
05:29kirThe more theoratical the better, until now I've been let down by authors trying to 'save' me from the details
05:32michaelr`re
05:32michaelr`julianleviston: I think that this is exactly what Glenjamin is saying.. though I could not get it to work for me
05:33julianlevistonmichaelr`: ah… you’ve got the atom connected to the root?
05:33Glenjaminkir: try "out of the tar pit" perhaps
05:34michaelr`julianleviston: yes of course, is there any other way?
05:34GlenjaminThe main desire with declarative is to separate "what" from "how"
05:34julianlevistonmichaelr`: and where are you doing the swapping? in or out of the render loop?
05:34julianlevistonmichaelr`: just wondering, I suppose. I have some swapping, which I do outside of it.
05:36julianlevistonmichaelr`: doesn’t the basic tutorial actually start with this? (goes to look)
05:36kirGlenjamin: Thx.
05:36michaelr`oh wait, I think I messed it all up
05:36julianlevistonooh it’s all different now! :) cool using figwheel…
05:37michaelr`ohh it was stupid me all this time ;)
05:37julianlevistonyeah… herer’s the relevant section: “ If you change the value of the atom via swap! or reset! this will always trigger a re-render of any Om roots attached to it”
05:37julianlevistonmichaelr`: ah, ok phew :)
05:37michaelr`so updating the state atom directly does rerender the component tree
05:38michaelr`I was passing the state map instead of the state atom
05:38julianlevistonmichaelr`: it’s the first thing that it goes in to in this: https://github.com/omcljs/om/wiki/Basic-Tutorial
05:38michaelr`yeah I know, I just messed up the variables
05:38julianlevistonsoz :)
05:40michaelr`hmm, the tutorial has been updated some since I took it..
05:40michaelr`anyways, I think that doing the update/rerender thing this way might be a bit more expensive than when doing the same through transact! or update!
05:41michaelr`I think I read something about it somewhere simetime
05:47sveriHi, anyone here using the system library from danielsz? I wonder how you declare the dependancy hierarchy? There is no example for this that I can find.
05:50michaelr`sveri: using component/system-using
05:50michaelr`system is a very thin wrapper around component
05:51michaelr`check the component docs
05:53sverimichaelr`: yea, I used component already, just wanted to make sure that I am not missing anything, thanw you
05:55sveriTBH I am not sure what the system library provides then besides prebuilt componentss
05:55sveri?
05:56kirGlenjamin: 5.2.2 - re:"functionals" - this is what interests me. Thx for the valid reference.
06:04expezI want to search for <thing> followed by a \\b, this worked fine until <thing> started containing regexp meta characters. How can I combine the regex quoting of <thing> with the word boundary?
06:05expezif I just do the quoting with java.util.regexp.Pattenr/quote and then append \\b before calling re-pattern it doesn't work
06:07julianlevistonjava.util.regex.Pattern/quote ?
06:07julianlevistonexpez: oh, sorry…
06:08julianlevistonexpez: are you using re-pattren?
06:08julianlevistonexpez: re-pattern
06:08expezjulianleviston: (re-find (re-pattern "\\Q?>\\E\\b") "foo ?> bar") => nil
06:09expezI'd like to match ?> but not foo?>
06:10TEttinger,(re-find (re-pattern #"\Q?>\E\b") "foo ?> bar")
06:10clojurebotnil
06:10TEttingerhm
06:10TEttingeroh
06:10TEttinger,(re-find #"\b?>\b" "foo ?> bar")
06:10clojurebotnil
06:10TEttingeroh!!!
06:10TEttinger,(re-find #"\b\?>\b" "foo ?> bar")
06:10clojurebotnil
06:11julianleviston,(re-find (re-pattern "/?>") "foo ?> bar")
06:11clojurebot">"
06:12TEttingerwoah, weird
06:12TEttinger,(re-find #"\b\?\>" "foo ?> bar")
06:12clojurebotnil
06:12julianlevistonhm
06:12TEttingerit works if it doesn't need the \b before a ?
06:12TEttinger,(re-find #"\?\>" "foo ?> bar")
06:12clojurebot"?>"
06:13TEttingerI think it may be because ? itself counts as non-word, so " ?" is uninterrupted non-word
06:14julianleviston,(re-find (re-pattern "\\?>") "foo ?> bar")
06:14clojurebot"?>"
06:14julianlevistonstupid double-escapes
06:14expezwell, I really need to regex quote that stuff because it can really be whatever combining the quote with word boundaries is beyond me
06:15AeroNotix> Wake up
06:15AeroNotix> Regexp flood
06:15AeroNotix> Go back to bed
06:15julianlevistonAeroNotix: hehe soz :)
06:15AeroNotixjulianleviston: jk :)
06:16julianlevistonexpez: This might help? ##(re-find (re-pattern (java.util.regex.Pattern/quote "?>")) "foo ?> bar")
06:16lazybot⇒ "?>"
06:16TEttinger,(re-find #"(?<!\w|\b)\?\>" "foo ?> bar")
06:16clojurebot"?>"
06:17julianlevistonTEttinger: yeah but he wants to quote it, because the string isn’t under his control
06:17TEttingeryah
06:17julianlevistonif I understand correctly
06:17expez^
06:17TEttingerI have never used pattern quotes
06:18julianlevistonI’m not really sure I understand them.
06:18TEttingernegative lookbehind may help too
06:18expez,(re-find #"\b\Qqux\E\b" "foo qux bar")
06:18clojurebot"qux"
06:18TEttingerhttp://www.regular-expressions.info/lookaround.html
06:18expez,(re-find #"\b\Q?>\E\b" "foo ?> bar")
06:18clojurebotnil
06:18TEttingerwhat is \Q...
06:18expezTEttinger: start literal text \E is end literal text
06:19julianlevistonwow I’ve never heard of that before
06:19expezso it works when the literal text isn't something that would actually need escaping lol
06:19expezit's what Pattern/quote produces
06:20julianlevistonexpez: um… why doesn’t it work then?
06:20expezjulianleviston: indeed!
06:20julianlevistonoh… coz of the \b
06:22julianlevistonYou want \B
06:23julianlevistonmaybe. lol
06:23julianlevistonyou prolly want whitespace, actually.
06:23expezyeah I think that's the problem because ?> aren't word characters
06:23julianleviston\b is word boundary, which assumes what’s inside it is a word
06:23julianlevistonexacty
06:23expezya
06:24TEttinger,(map #(re-find #"(?<!\w|\b)\?\>" %) ["?> bar" "foo ?> bar" "foo?> bar" " ?> bar"])
06:24clojurebot("?>" "?>" nil "?>")
06:24julianlevistonexpez: this site is quite useful, I always find myself there when doing regexp’s… http://www.regular-expressions.info/wordboundaries.html
06:24TEttingerthis finds the ?> if it isn't preceded by a word character or a boundary character, which may be redundant
06:25TEttinger,(map #(re-find #"(?<!\w)\?\>" %) ["?> bar" "foo ?> bar" "foo?> bar" " ?> bar"])
06:25clojurebot("?>" "?>" nil "?>")
06:25TEttingeryup, not needed
06:25TEttingerfor the other side...
06:27TEttingerah, here we go
06:27TEttinger,(map #(re-find #"(?<!\w)\Q?>\E(?!\w)" %) ["?> bar" "foo ?> bar" "foo?> bar" " ?> bar" "foo?>bar" "foo ?>bar"])
06:27clojurebot("?>" "?>" nil "?>" nil ...)
06:27TEttinger##(map #(re-find #"(?<!\w)\Q?>\E(?!\w)" %) ["?> bar" "foo ?> bar" "foo?> bar" " ?> bar" "foo?>bar" "foo ?>bar"])
06:27lazybot⇒ ("?>" "?>" nil "?>" nil nil)
06:28TEttingeryou may actually want \S instead of \w there if you expect unicode
06:29julianleviston. /Everybody stand back/
06:30TEttingerhaha
06:31hejkifor some reason I just got painful flashback from the days I worked as a fulltime Perl developer
06:33TEttingerit's really as close as programming comes to writing out magical formulae
06:34julianlevistonBACK! ARCANE MAGE!
06:34TEttinger...since you only have so many prepared spells a day, and re-reading regexes wasn't one of them
06:39expezgoing with this for now (re-pattern (str "(\\(?|\\s+)" (java.util.regex.Pattern/quote macro) "(\\)?|\\s+)"))
06:41expezbleh, that's probably gonna miss a ton
07:47imanc_flattened nested sets - is this the optimal way of doing it? (set (flatten (map vec #{ #{1 2} #{2 3} #{3 4}})))
07:48imanc_,(set (flatten (map vec #{ #{1 2} #{2 3} #{3 4}})))
07:48clojurebot#{1 4 3 2}
07:55shiranaihitois this wrong: https://www.refheap.com/97043 .. ? -i'm getting a mysterious "nth not supported on this type: Symbol" .. but have no idea why
07:59wjlroeshiranaihito: the 4096 - is that supposed to be an argument to the Buffered Input Stream constructor?
08:18krat0sprakhari have this question - how bad is it to loop/recur? Whenever I get frustrated with a problem on 4clojure, i just check map/reduce/etc and just use loop/recur to finish it.. but after that i end up feeling guilty.. :|
08:21krat0sprakhar*is it to use loop/recur
08:28shiranaihitoany idea what's wrong with this: https://www.refheap.com/97044 ? i get the same exception that happens when trying to extend a protocol to a byte array (in the same extend-protocol call as other types): "UnsupportedOperationException: nth not supported on this type: Symbol" - and it supposedly happens on line 16 (which is the first extend-protocol call)
08:29shiranaihitoi don't see a problem, and i've tried running it without the following byte-array extension, and without either one of InputStream or BufferedInputStream
08:29shiranaihito( sorry, my shit connection keeps dropping me :/ )
08:32fnordsenseiimanc_: perhaps (apply clojure.set/union #{#{1 2} #{2 3} #{3 4}}) => #{1 2 3 4}
08:32imanc_fnordsensei: looks a lot neater
08:32imanc_thanks
08:32fnordsenseiNo worries
08:39shiranaihito(nevermind, my syntax was messed up)
09:17AeroNotixuhm, how do you compile a jar for submission to a storm cluster?
09:18AeroNotixThe tutorials mention to keep the Storm jars as dev dependencies, but then I can't seem to compile the jar since storm is not available.
09:26tcrayford____krat0sprakhar: depends. I've only ever needed to use loop/recur for performance stuff, other than that I think you can do nearly everything with map/reduce/filter etc, but that might just be the problems I've run into
09:26gfredericksAeroNotix: perhaps you're using AOT and are not meant to be?
09:27AeroNotixgfredericks: Even the `lein new cookbook-storm-project` bare project doesn't create jars.
09:28AeroNotixand the template project uses AOT on the Topology namespace.
09:28gfredericksI'm not very stormy so can't speculate beyond that
09:29AeroNotixrokay
09:29AeroNotixI'll persevere
09:40IntegralistHi everyone. Any one know how I could resolve the following issue: https://github.com/mcohen01/amazonica/issues/119#issuecomment-73412979 I'm trying to access a AWS namespace but seemingly can't load it?
09:43michaelr`AeroNotix: you should put it in a provided profile
09:44michaelr`AeroNotix: like that: https://www.refheap.com/97045
09:46AeroNotixmichaelr`: this gets me a bit further. Why is this not in any documentation?
09:48AeroNotixmichaelr`: could you show me the rest of the project.clj that your above paste comes from, please?
09:49michaelr`AeroNotix: https://www.refheap.com/97046
09:50AeroNotixthanks
09:50michaelr`AeroNotix: I think that's because the number of Clojure users of Storm is much smaller than Java users.
09:51AeroNotixmichaelr`: that's a shame because Marz seems to be a big Clojure fan.
09:51michaelr`It's kind of a mainstream tool these days, and most of mainsteam is Java. Just the reality.. :)
09:52AeroNotixFor sure
09:58AeroNotixnow it seems to try to load in the jar, but then crashes with: https://gist.github.com/AeroNotix/dd38afddfed2e16d8f44
10:00michaelr` make sure your version of storm is the same as the one you are using for development
10:00michaelr`also maybe look at nimbus logs
10:01michaelr`it fails to upload your jar
10:02AeroNotixcool, thanks
10:21ggherdovHi. I need to profile a clojure program; what is the first tool I should try?
10:22allenIs it possible within a week to learn clojure web dev to the point where I can create a web app with thousands of pages with pdfs?
10:23allensort of like a comprehensive e-library project, but simple in design. The pages are part of a tree heirarchy and there are pdfs and articles categorized in each page
10:23allenIf I can do it in less than a week and have time to test it, then i'll proceed, or else i'll stick to rails and use clojure for another project
10:26IntegralistHi everyone. Any one know how I could resolve the following issue: https://github.com/mcohen01/amazonica/issues/119#issuecomment-73412979 I'm trying to access a AWS namespace but seemingly can't load it?
10:26opqdonutggherdov: jvisualvm sampler/profiler
10:27ggherdovopqdonut: thanks, googling that
10:27opqdonutggherdov: or if you can isolate the thing to profile into one function call, just use (time ...) in the repl
10:28opqdonutggherdov: a fancier alternative to the time macro is the criterium library: https://github.com/hugoduncan/criterium
10:28opqdonutggherdov: but jvisualvm can connect to a running application, which might be useful
10:30ggherdovopqdonut: I see
10:31NewToCljI there I have some java code which i struggle with to translating to clojure... it should be really simple with "doall" I guess? could you help me? http://pastebin.com/36hdfb17
10:32gfredericksNewToClj: doseq
10:43opqdonutggherdov: indeed
10:47NewToCljgfredericks: I'm so confused... because if I want to cal a java method repeatedly in clojure i have to carry arround the instance im refereing to, all the way *_* , in my example case the "modelData" one, how do I do that?
10:52gfredericksNewToClj: (defn add-data-to-list [jl data] (let [model-data (DefaultListModel.)] (doseq [data-line data] (.addElement modelData data-line)) (.setModel jl model-data)))
10:52gfredericksi.e., use let
10:52NewToCljgfredericks: ah i see so i need acombination of let and doseq!
10:53gfredericksyep
11:00michaelr`anyone is sharing Bidi routes between Clojure and ClojureScript?
11:01dnolenggherdov: Java Mission Control Flight Recorder is much nicer than JVisualVM in my experience and
11:01michaelr`I'm not sure how I could use the same routes to match requests in clj and generate service paths in cljs
11:01dnolenggherdov: for serious profiling I haven't found anything better than YourKit
11:04michaelr`dnolen: hi, what are the downsides of updating the state atom directly with swap! instead of using transcat! in Om?
11:05dnolenmichaelr`: less visibility about changes is all, at one point was thinking about deeper integration for transact!
11:05dnolenmichaelr`: however I'm pretty excited about the conceptual simplifications offered by Facebook Relay/GraphQL architecture
11:06dnolenif the implementation difficulties to be sorted out Om will probably migrate to it instead
11:06michaelr`dnolen: no performance hits?
11:06dnolenmichaelr`: in this future swap! vs. transact! becomes non-issue, because Om will likely not be involved in that question at all
11:07dnolenmichaelr`: no perf hit out of the box no, but transact! is a protocol, so it could have implications in more complicated contexts since someone may have introduced smarter logic and hid it behind transact!
11:08michaelr`dnolen: do you think that the API in Om would mostly stay the same?
11:09dnolenmichaelr`: unlikely, but I'm not interested in breaking existing apps, so the new functionality will likely come along w/ a new API, probably in the form of a new type of compoents
11:09dnolens/compoent/component
11:09michaelr`I was actually thinking of a performance hit in the swap! case because of a full rerender instead of rerendering just what has been transacted. But I guess you are handling it in both cases with immutable data..
11:14Glenjamindnolen: are you imagining some sort of "managed component" that delcares its data and lets the runtime go fetch/provide it & re-render as needed?
11:15dnolenGlenjamin: the intention is for the overall design to just be the same as that described by Facebook, with the details swapped out
11:15dnolenGlenjamin: datalog for query lang, immutable entities for query results etc.
11:16Glenjamindo you intend to provide the normalisation/collapsing of queries into a single request payload, or will that be left to the implementor?
11:16dnolenGlenjamin: that part is trivial w/ datalog
11:16Glenjaminoh cool
11:17Glenjaminand then implementing a server that speaks datalog is up to the user?
11:18Glenjaminor would you aim to support datomic specifically?
11:18dnolenGlenjamin: the model is still useful locally, i.e. DataScript or any client side datalog-y thing
11:19dnolenGlenjamin: the server side bit is really just out of scope, same as it is for FB
11:19Glenjaminmakes sense
11:20Glenjaminon an unrelated note, are you aware of any write-ups on clj/cljs/closure.clj aside from the inline comments?
11:20dnolenGlenjamin: writeups, like how it works?
11:21Glenjaminyeah - i'm thinking about an experiment to allow importing of commonjs modules
11:21dnolenGlenjamin: no closure.clj isn't documented beyond comments/docstrings, but it's also pretty simple
11:21ggherdovdnolen: thanks for the suggestions, will check Java Mission Control Flight Recorder and YourKit
11:22Glenjaminyeah, it seems fairly straightforward so far, i just need to get a handle on closure compiler itself
11:22Glenjaminthen hope that http://www.nonblocking.io/2011/12/experimental-support-for-common-js-and.html and http://javadoc.closure-compiler.googlecode.com/git/com/google/javascript/jscomp/ProcessCommonJSModules.html are still accurate
11:22dnolenGlenjamin: Closure has support for CommonJS Modules and AMD style modules, I've never looked at it, would be nice for someone to see how hard it would be to get it work work.
11:22Glenjaminthat's my plan, yes
11:23dnolenGlenjamin: those are definitely still accurate, AMD & CommonJS support exists to this day, and I believe ES6 Modules also already work
11:23Glenjaminmy current end-goal is to make it easy to use npm modules for browser-targetting cljs
11:24Glenjaminhopefully i'll find out how feasible that is
11:25Glenjaminvia some sort of mapping of npm module -> namespace in the build config
11:25dnolenGlenjamin: that mapping should probably just be provided by :foreign-deps
11:26dnolenGlenjamin: probably the only thing you want to do is supply additional :module-format #{:commonjs :amd}
11:26dnolenGlenjamin: if this is supplied then move it into the build and configure Closure correctly
11:27Glenjaminsounds sensible, are foreign libs currently always included, or does the compiler wait until it sees a require for the provided namespace?
11:28dnolenGlenjamin: if you don't require it won't be part of the build
11:29Glenjaminok, thanks
11:30dnolenGlenjamin: note not interested in anything actually to do w/ Bower/NPM here. Just CommonJS, AMD, ES6 Module compilation support
11:30Glenjaminyeah, would be compiler support for commonjs, then some lein plugin to bridge to npm
11:31Glenjaminthe tricky bit might be the node_modules/package.json assumptions in node-flavoured commonjs
11:32dnolenGlenjamin: cool a module enhancement patch would be extremely welcome
11:32dnolenGlenjamin: yeah I'm personally not a fan of anything NPM-like for dependency management, it just doesn't work for ClojureScript or ClojureScript style libraries
11:33Glenjaminyou mean the nested dependency tree stuff?
11:33dnolenGlenjamin: yes, because it doesn't solve any of the hard problems. In ClojureScript we've embraced custom data structures and these get passed around
11:34dnolenGlenjamin: the NPM dep model doesn't fix anything at all here
11:34dnolenin fact it's more busted
11:34dnolensince it hides the depedency conflicts
11:34dnolenand Maven won't let you pretend they don't exist
11:35Glenjaminwell, if you stick to maps/vecs its fine - but yeah, Records/protocols won't work at all
11:36Glenjaminhaving to do stuff like https://github.com/moment/moment/blob/develop/moment.js#L2151 is not great
11:36shiranaihitoshould i be worried about using protocols too much? :)
11:37dnolenGlenjamin: the NPM model is just an abomination, especially for any library that embraces custom data structures and uses them as currency
11:37dnolenwhich is what Clojure does!
11:37Glenjamini agree with the latter half of that statement :)
11:37Glenjaminit also doesn't play nicely with lisp-style late-binding
11:38dnolenGlenjamin: there really isn't anything good about it IMO. I woud kill it in a fire if I could.
11:39Glenjaminthe rough idea is produce something conceptually like "window.moduleA = require('moduleA'); window.moduleB = require('moduleB')"
11:39Glenjaminexpand that
11:39Glenjaminthen cljs can use the exported bits
11:39Glenjaminso the what type of dependency-tree lives behind that should be irrellevant
11:43paulswilliamsesqHi all, hopefully a quick question - how are people using selenium in clojure these days? It appears clj-webdrive hasn't had much activity over the last few months, and is at least incompatible with recent Firefox versions?
11:43dnolenGlenjamin: in anycase I commend the desire to open up more of the JS world to CLJS. But I suspect the CLJSJS model is likely going to win out in the end simply due to a lack of bundled externs for Bower/NPM and an inferior compression story.
11:44gfredericksdnolen: I haven't used npm but I've heard it lets you distinguish between public and private deps -- doesn't that resolve the "data structures as currency" tension? (i.e., use public deps for that)
11:44gfredericksand libraries that don't have those kinds of requirements can be "private" and thus have multiple versions at runtime
11:44dnolengfredericks: no because you could still pass a data structure in
11:45dnolengfredericks: if everybody communicates with strings maybe you won't have this problem
11:45gfredericks:)
11:45bbloomdnolen: everyone communicates with json
11:45bbloomand they still have this problem!
11:45dnolenlol
11:45gfredericksI'm not sure I understand the objection though -- how does this fall over if you "pass a data structure in"?
11:45bbloomnpm is extra broken mascarading as fixed
11:45Glenjaminstrings is a fairly good analog - npm modules are a bit like unix tools in that they have to communicate at a lowest-common-denominator interface
11:46bbloomgfredericks: it's like reloading a namespace in clojure w/ a typedef in it
11:46bbloomer deftype in it
11:46clojurebotExcuse me?
11:46dnolengfredericks: because that library uses a different version of the data structure via private dep
11:46bbloomyou get two different versions of the type that respond to different instance? checks
11:46dnolengfredericks: but it's interface doesn't prevent getting something that is actually a different version
11:46Glenjaminso you have to "just" not do instance? checks
11:46gfredericksdnolen: bbloom: so you don't use this approach for libs that define data types, is what I was suggesting
11:46Glenjaminand instead rely on structural typing
11:47bbloomwell instanceof is just the case where you're going to break in an obvious and strong way
11:47dnolenGlenjamin: except immutable data structures don't have any structure you can rely on
11:47bbloomdnolen: Glenjamin: you'd have to add a "tag" field
11:47dnolenGlenjamin: structural typing only works if you like have both hands & feet tied to paraphrase Sam Tobin-Hochstadt
11:47bbloomlike function PHM(...) { this.tag = 'PHM-v1'; ...
11:48dnolenbbloom: and pay for string comparisons
11:48dnolenbbloom: and agree on tag name
11:48Glenjaminwhat is {:keys [a b c]} if not structural typing?
11:48bbloomyup
11:48dnolenGlenjamin: the structure of the underlying type isn't a part of that
11:48bbloomGlenjamin: explicit use of the associative/lookup type :-)
11:48Glenjaminif you use numbers, strings, vectors and maps only, it can work - i can see the argument that this is not enough
11:50dnolenGlenjamin: and we don't, we use sorted-sets, sorted-maps, priority-maps, AVL trees, RRB-Trees, CTries, 64 bit ints, BigDecimal ...
11:50bbloomit's even a problem if you use a closed set of types
11:50bbloomyou still have an open set of schemas
11:50Glenjaminright, but the schemas become your contracts
11:50bbloomand now you have to version your contracts!
11:51gfredericksis there a clear way to characterize what sort of library is safe to have multiple versions of?
11:51bbloomi'm not saying these problems aren't solvable. i'm just saying maven is doomed
11:51bbloomand npm is double doomed
11:51Glenjamini'm not saying its necessarily a better model, but i do think it's a tradeoff that has some benefits over one-version-of-each=lib
11:51Glenjamins/=/-/
11:51bbloomgfredericks: no, you'd have to characterize dataflow paths
11:52gfredericksbbloom: dataflow paths relative to a particular library in question?
11:52Glenjaminany lib that only takes core types and returns core types is "safe" i'd have said
11:52Glenjaminand by "safe" i mean, won't break when you add another version elsewhere
11:52bbloomthe problem is when some data from lib A goes to lib B and there's a dependency on the shape or type of that data
11:52gfredericksGlenjamin: I thought that too but it depends on usage of the things it returns and expects
11:53bbloomgfredericks: so you can use a lib in isolation & everything is fine
11:53Glenjamin^^ yes, that
11:53bbloom... until you pass a value returned from that lib to another lib that uses a different version
11:53bbloomso there are ways you can say "this lib will never have a version problem"
11:53gfredericksbbloom: right; and if Lib A --depends--> Lib B, then Lib A should know whether its usage of B is safe & private, right?
11:53bbloombut to do so would be so restrictive as to be silly
11:53dnolengfredericks: in theory with discipline data lib vs. "regular" lib (whatever that meanas) could work, but life is too short. By not using a NPMlike dep model you just don't think about it.
11:54dnolenanyways, this solving problems you have created for yourself
11:54Glenjaminbut in return, you have to think about your dependency tree more
11:54bbloomgfredericks: right but B is supposed to be abstract, so what if B uses A?
11:54dnolenGlenjamin: too bad there aren't really good tools for that?
11:54gfredericksdnolen: you're saying transitive dependency conflicts are not a problem?
11:55Glenjaminso for instance, you can't depend on any version of https://github.com/flatland/useful/
11:55bbloombrb
11:55Glenjaminor any sort of "generally useful" lib
11:55dnolengfredericks: I can't remember the last time I used a dependency where I had this problem
11:55Glenjaminso as a result these don't exist
11:55dnolengfredericks: but I'm also a heathen, every dependency is a liability
11:55dnolengfredericks: I hate dependencies
11:55gfredericksdnolen: we had an http dependency conflict at work just last week
11:55bbloomdnolen: that's not heretical to me
11:56Glenjaminmy theory is that "i hate dependencies" is a symptom of the problem that npm attempts to solve
11:56gfrederickswe just picked the older version and crossed our fingers
11:56dnolenGlenjamin: no I hate dependencies in NPM too
11:56bbloombut dnolen already knows i prefer manually vendoring jars and .min.js files
11:56Glenjaminhaha
11:56dnolenI simply hate dependencies
11:56dnolenI don't what language what tool what system
11:56dnolens/what/care what
11:57Glenjaminthe only think i hate more than dependencies is large slow moving core libraries :D
11:57dnolento mean the correctly model is the Global Namespace where you just use shit all locked to one version
11:57dnolenaka Google Closure Library
11:57AeroNotixIf you really want to hate dependencies you should try being an Erlang developer.
11:57AeroNotixreally get that hatred bubbling away
11:57Glenjamini hear cabal hell is pretty bad also
11:58gfredericksdnolen: when you say "I hate dependencies" you're not saying "The solution is for us to stop using libraries" are you?
11:58Glenjamindnolen: "correct" as in, "the best possible", or "the best today" ?
11:58bbloomgfredericks: more like "start copy pasting libraries"
11:59gfrederickshaha I was just imagining tools for that
11:59Glenjaminisn't the npm-model just automatic copy-pasting?
11:59hyPiRiongit commit -am "checked in source for lib x"
11:59gfredericksyeah what Glenjamin just said
11:59AeroNotixthis is what Erlang does as well, effectively.
11:59AeroNotixwell, rebar.
11:59AeroNotixit's tyranny, but mostly because rebar is dumb as a bag of rocks.
11:59Glenjaminhttps://github.com/jonase/eastwood/tree/master/copy-deps-scripts
12:00Glenjaminhttps://github.com/jafingerhut/dolly specifically
12:00Glenjamincopy-paste tooling
12:00bbloomgfredericks: gfredericks: no, b/c it copy/pastes multiple versions of the same lib
12:01bbloomer gfredericks & Glenjamin
12:01bbloomyou both match /^g/
12:01gfredericksbbloom: don't you get the same effect if lib B and C both paste different version of lib D?
12:01Glenjaminwell, at most 1 per "thing that depended on it"
12:01bbloomgfredericks: not if you copy paste in to the root
12:02AeroNotixopam tries to use a SAT solver to know whether the dependency graph is sound.
12:02Glenjaminbbloom: but only the application knows it is the root
12:02Glenjaminor are you describing a tool we don't have yet?
12:02bbloomwhat you're doing when you depend on A and B and B both depend on C is you have a choice. you can say "i now depend on C" or you can rename C to A/C and B/C
12:02bbloomthe former is what maven does
12:03bbloomand the later is what npm does
12:03Glenjaminright
12:03hyPiRionrelevant: http://leiningen-vs-ant-manual.tumblr.com/post/107990906420/with-a-curse-he-dropped-the-spade-into-the-ditch
12:03gfredericksright, and copypasta can only do one of those two, right? can it do a third thing?
12:03bbloomgfredericks: copy paste can do any mix of either of those two things, but yeah, it can also do other things
12:04Glenjaminlike lose the relationship between the source and result :D
12:04hyPiRiondependency resolution just seems to be a hard problem
12:04gfredericksbbloom: so what are you advocating for? being able to choose which you're doing, or for the third thing?
12:04GlenjaminhyPiRion: that's the part i think we can all agree on
12:04bbloomgfredericks: i have two positions: 1 for existing languages/ecosystems and another for some hypothetical design that doesn't exist yet
12:04gfredericksGlenjamin: hyPiRion: I dunno it sounded like dnolen thought it wasn't a hard problem and I was trying to figure out why
12:05bbloomin a perfect world, you'd have fucking considered versioning in your VM's binary interface
12:05Glenjamini think because it is a hard problem we build libraries that skirt it, and if we had a better solution we'd have more smaller libs
12:05bbloombut basically the CLR is the only thing i know that even attempts to get binary compatability right beyond the JVM's "we won't break the byte code level"
12:05bbloomaaanyyway
12:06gfredericksyes back to the first position
12:06bbloomfor existing systems: i'm advocating taking dependencies via a package manager
12:06bbloomand if anything goes wrong at all
12:06bbloomvendor with predjudice
12:06bbloomprejudice*
12:06bbloombasically, do the simplest thing until it's annoying, then copy paste until your problem is solved
12:06gfredericksvendor in the app or in a library with its own deps?
12:07Glenjamini guess in the maven model, you find out about clashes at "add-to-project" time, and in npm model you probably never find out
12:07gfredericksmy understanding was that npm let you pick which style of dependency you wanted
12:07Glenjamingfredericks: sort-of
12:07gfredericksand I say that with the least amount of authority possible
12:07dnolengfredericks: hyPiRion: my point wasn't that it wasn't hard, rather when I find myself taking on a non-trivial dependency I nearly always a) audit it's dependency graph b) audit the source c) determine if it's wiser to just write this myself on existing JDK functionality
12:07GlenjaminpeerDependencies doesn't work that well, and is being deprecated
12:07gfredericksoh
12:08Glenjamindnolen: i think that's the most sensible approach, but i wish there were some mythical "better way"
12:08dnolengfredericks: hyPiRion: my experience as Ruby & Node.js dev is that people include dependencies willy-nilly
12:08dnolenand it just always leads to some kind of infernal hell
12:08gfredericksdnolen: is this when you're writing libs/tools/languages and not when writing apps?
12:09dnolengfredericks: in both cases
12:09gfredericksnot that auditing isn't important but rewriting/pasting isn't so useful at the app level is it?
12:10dnolengfredericks: I didn't say anything about copy-pasting. Manual copy-pasting is fine by me.
12:11AeroNotix((resolve (symbol "map")) println [1 2 3])
12:11AeroNotix,((resolve (symbol "map")) println [1 2 3])
12:11clojurebot(1\n2\n3\nnil nil nil)
12:11AeroNotixhow does rewriting allow for the above to still work?
12:12AeroNotiximagine a much more complex symbol than "map"
12:12gfredericksdnolen: okay I think I understand, thanks
12:12justin_smithAeroNotix: rewriting?
12:12Glenjaminhttps://github.com/jafingerhut/dolly i think
12:12AeroNotixas far as I understood rewriting would need to change the symbols/namspaces of things
12:13gfredericksAeroNotix: this is related to the deps discussion?
12:13AeroNotixgfredericks: yeah
12:13gfredericksAeroNotix: what does "much more complex symbol" mean?
12:14AeroNotix,((resolve (symbol "clojure.core/map")) println [1 2 3])
12:14clojurebot(1\n2\n3\nnil nil nil)
12:14AeroNotixgfredericks: like that^
12:14Glenjaminany creation of a symbol name at runtime is hard / impossible to auto-transform to the new generated name
12:14bbloomso this dependency thing is actually yet another area where OOP seems like a solution, but really masks the problem
12:14Glenjamineg. when using browserify it can detect require("abc") - but not require("a" + "bc")
12:15bbloomif you package up your objects w/ their code, you can get away w/ multiple versions of that object's type for a whole heck of a lot longer than you could otherwise
12:15gfredericksGlenjamin: when would this happen?
12:15Glenjamingfredericks: var models = require.glob("models/*.js")
12:15Glenjaminto which the solution is "don't do that"
12:15AeroNotixewww it lets you glob requires?
12:15AeroNotixHow gross
12:16Glenjaminno, i made that up
12:16AeroNotixoh ok
12:16Glenjaminbut you can write your own with readdir + require
12:18felherHey folks. I know that most of the time keywords are used when other languages call for enumerations. My problem is that I have to write hundreds of lines of data of the form (SomeRecord. :type-a :group-b :attribute-c), (SomeRecord. :type-b :group-a :attribute-f) ... now keywords have the big problem as opposed to enumerations in languages like, say, java, that a typo (which surely will happen in a few
12:18felherhundred lines) will not be caught because :type-a is as valid a keyword as :tpye-a is. Im currently using (def type-a "type-a"), (def type-b "type-b"), ... to get clojure to complain if I make a typo, but I wonder if that is the best approach. Any thoughts?
12:18gfredericksfelher: I think the eastwood linter can help with that
12:19gfredericksit can check for keywords only used once
12:19Glenjaminunless you typo twice :p
12:19gfredericksyep
12:19gfredericksalso: testing
12:19Glenjaminanother option is to have some macro check names in dev mode
12:19justin_smithfelher: you could have a wrapper on SOmeRecord. that has a whitelist of keywords and errors on invalid ones
12:19gfredericksadd a contract so the constructor fns
12:20gfredericks(and don't use the record constructors directly)
12:20Glenjamini quite like replacing the built-in ->SomeRecord
12:20gfredericksadd a before-hook to it
12:20felherOkay, I like the eastwood-linter and contract constructor ideas both, thanks. :)
12:21justin_smith(defn make-some [& ks] (assert (every? #(contains #{:type-a :type-b etc.} %) ks) (apply ->SomeRecord ks))
12:26Glenjaminso, i did a quick bit of analysis on an npm-based JS project i have that contains an HTTP server and a React client application
12:26Glenjaminhttps://www.refheap.com/97048
12:26Glenjamini'm unsure if that tells a good or a bad story dependency-wise
12:33dnolenGlenjamin: argh
12:33felherOkay, I think i'll use eastwood. Seems like it will give me a decent protection from typos in my case and doesn't require any new code on my part. Great, thanks. :)
12:35Glenjamindnolen: yeah, this app is internal facing and we're optimising for "less code written", if it was customer facing I'd have been more careful when adding
12:36GlenjaminI'm definitely not claiming everyone should do deps like that
12:50dnolencfleming: Cursive macroexpander is nice thanks
13:28ul_did anybody use fsm/automata not only for parsing, but as app logic basis, with clojure?
13:31fizbinSo I'm about to ask the standard most annoying question on any language's IRC channel: where can I go to get a taste of clojure that will excite me and make me want to learn more?
13:33fizbinI'm an experienced java programmer who's been getting paid to develop python and haskell for the past year or two. I've also done a passable bit of scala, and lisp (well, scheme) back in college. Didn't ever work with CL or a lisp2 though.
13:33justin_smithfizbin: between java / haskell / scheme you'll pick it up very fast
13:33dnolenfizbin: if you liked Scheme & Haskell then you'll probably find Clojure plenty exciting - it borrows heavily from both
13:34fizbinThe thing I liked most about scheme was call/cc...
13:35justin_smithfizbin: depends what you are interested in / what would motivate you. There are amazing things happening with cljs and native stuff via om/react on IOS for example
13:35justin_smithfizbin: yeah, we don't have that :)
13:38amalloyfizbin: for an interactive low-setup taste of the language, you can try 4clojure.com
13:42apiologyfizbin: These might be relevant: http://thechangelog.com/rich-hickeys-greatest-hits/
14:14imanc_,(Math/sin 1)
14:14clojurebot0.8414709848078965
14:14imanc_,(Math/atan2 90)
14:14clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: atan2, compiling:(NO_SOURCE_PATH:0:0)>
14:14justin_smith,(Math/atan2 90.0)
14:14clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: atan2, compiling:(NO_SOURCE_PATH:0:0)>
14:14justin_smithhrmph
14:14imanc_how come the java docs show an atan2 method, but I can't acces it?
14:15imanc_http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html
14:15justin_smithoh
14:15justin_smith,(Math/atan2 90.0 0.0)
14:15clojurebot1.5707963267948966
14:15imanc_oh
14:15imanc_I'm seeing: No matching method: atan2, compiling:
14:15justin_smithconverts x/y coords to angle theta
14:15gfredericks,(Math/atan2 90.0 0)
14:15clojurebot1.5707963267948966
14:15gfredericks,(Math/atan2 90 0)
14:15clojurebot1.5707963267948966
14:16gfredericksI dunnos
14:16justin_smithimanc_: how many args are you providing to atan2?
14:17imanc_justin_smith: that was it! I had the args wrapped in a list, for some reason
14:17justin_smithaha
14:17imanc_So presumably it checks the arity of the func or something? But surely that would give a "incorrect arity" error hmm
14:17gfredericksit gives the same error no matter what sort of problem it is
14:18justin_smithimanc_: I have never seen "incorrect arity" as an error for a java method call
14:18imanc_so the arity error only happens for clojure based funcs?
14:18justin_smithimanc_: and think of how hard that would be in general - how do you know the arg count is wrong, instead of the type?
14:18gfredericksimanc_: yes
14:18justin_smithI mean you could do reflection but these things get complicated
14:18imanc_yeh, agreed
14:19gfredericksif it showed all the possible sigs that'd be nice
14:19gfrederickscould do that with ex-info
14:19justin_smithin clojure we only do overloading of functions on arity
14:19justin_smithso that's easy to establish
14:19gfredericksI too often have issues with ex-info display though :/
14:19justin_smithgfredericks: yeah, do some reflection on error...
14:19gfredericksjustin_smith: well I think this exception happens when it's already doing reflection
14:20gfrederickseither that or it happens at compile-time
14:20justin_smithhmm, yeah
14:20gfredericks"No matching method" is always thrown from some kind of reflecty context I believe
14:22imanc_I find clojures errors quite challenging at times
14:22justin_smithimanc_: yeah, they are really weird until you learn more about the implementation
14:22gfredericksthere are a variety of causes for that feeling
14:22justin_smithand even then they can still be weird sometimes...
14:23justin_smithand it doesn't help that some errors have bugs in the error message generation
14:23imanc_ha ha
14:23imanc_jeez
14:23justin_smith,(into {} '(([1 2])))
14:23clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry>
14:23imanc_hopefully things will improve
14:23justin_smiththat message is buggy^
14:23justin_smithin fact, PersistentVector is the one thing that could have worked, but it got a listy thing instead
14:24justin_smith,(into {} '([1 2]))
14:24clojurebot{1 2}
14:24imanc_so does tracing these errors sometimes involve devling into clojures java code?
14:24justin_smithimanc_: more often just having a good idea of what clojure was doing when it hit that error
14:45justin_smitheg. with the vector cast error, into {} will expect the arg to be a sequencable where each element is a two element map$entry, or a vector which can be cast to map$entry
14:47can-of-beeshi all. i'm hung up on getting xml written to a file. i have a pastebin (http://pastebin.com/z67S8xbM).
14:48can-of-beesi can get (xml/emit (tagsoup/parse-xml "my-file.xml")) to print the corrected XML to the REPL but the function i've tried writing (@ line 8 in the paste) doesn't seem to work.
14:49can-of-beesapologies if you're seeing this question again :)
14:51justin_smithcan-of-bees: can you use (.getStackTrace *e) after the NPE on line 21 so we can see the actual stack trace?
14:51can-of-beessure thing justin_smith
14:51can-of-beesthank you
14:53can-of-beesjustin_smith: i probably did this wrong but here's the output from the REPL: => #<StackTraceElement[] [Ljava.lang.StackTraceElement;@4aeb8b6c>
14:53gfredericksgood ole' error code 4aeb8b6c
14:53justin_smithoh, sorry
14:54justin_smithI meant (.printStackTrace *e)
14:54justin_smiththat will work as long as that error was the last one
14:54justin_smith(inc gfredericks)
14:54lazybot⇒ 117
14:55gfredericksclojurebote: 4aeb8b6c is java.lang.WingsFellOffException
14:55gfredericksclojurebot: 4aeb8b6c is java.lang.WingsFellOffException
14:55clojurebotA nod, you know, is as good as a wink to a blind horse.
14:55justin_smithgfredericks: clojurebote is clearly clojurebot in doge form
14:55gfredericksagreed
14:56can-of-beesi just updated the pastebin: http://pastebin.com/z67S8xbM
14:56justin_smithsuch sandbox, many exception, wow
14:58amalloyisn't the problem that .emit writes to *out*, returning nil, and then you try to .write nil to that writer?
14:59justin_smithamalloy: oh, that would do it, and also explain all that xml printing
14:59justin_smithweird
14:59justin_smithso you could do (binding [*out* wrt] (xml/emit ...))
15:00justin_smithhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/xml.clj#L111
15:00justin_smith(inc amalloy)
15:00lazybot⇒ 223
15:01can-of-beesyeah, sorry. i'm kinda jumping in head first here and so i don't know exactly what i'm doing. the (defn write-xml-file...) is based off of another "write a file in clojure" thing i found from Beacon Hill.
15:01can-of-beesso i'm floundering around in maps and vectors and whatnot.
15:01justin_smithcan-of-bees: amalloy is right, emit prints to *out*, so if you use binding *out* as above, or use with-out-str to capture the string, that should work
15:01can-of-beesno, wait. those are just vectors.
15:02can-of-beesjustin_smith & amalloy - thanks for the pointers. i'll try again.
15:02justin_smithcan-of-bees: that's why your xml was being printed, I should have thought more about that weird part of it
15:03can-of-beesyeah well :) i thought it was great when i got it to print.
15:03justin_smithhaha
15:07r7shi, I have a problem with cljfmt: I added it to my ~/.lein/profiles.clj (and to my project.clj, too) as a plugin, but it's not in the classpath and when I try to use vim-cljfmt, it throws "FileNotFoundException Could not locate cljfmt/core__init.class or cljfmt/core.clj on class path: clojure.lang.RT.load (RT.java:443)"
15:07r7swhat am I doing wrong?
15:07justin_smithr7s: can you share the relevant part of your profiles.clj?
15:08r7sjustin_smith: sure, do you mind if I paste it here? it's four lines long
15:08justin_smithehh, I have no idea what the cutoff is
15:09r7sI'll just use gist then ;)
15:09r7shttps://gist.github.com/ravicious/21f526ce43a2734a2ab7
15:10justin_smithr7s: are you able to call the plugin directly from the command line inside your project?
15:10justin_smitheg. "lein cljfmt check"
15:10r7syes, I can run `lein cljfmt check some_file.clj` and it works just fine
15:11justin_smithr7s: aha, vim-cljfmt wants to do the formatting from the repl
15:12justin_smithr7s: so it needs to be added under dependencies, not plugins, for that to work
15:14r7sjustin_smith: you're right! it works now, thanks
15:14r7sbut doesn't that mean that I have to add it as a dependency to each project I want to use it with?
15:14justin_smithr7s: :dependencies in profiles.clj
15:14r7soh, cool
15:15r7sthanks once again! :)
15:15justin_smith(this is where I put pallet/alembic for adding deps at runtime)
15:15justin_smithwhich I highly recommend :)
15:15r7sI just started doing Aphyr's guide and I was struggling with one of the exercises from 6th post and I thought that having a good code formatting may help a little
15:18justin_smithr7 which post is that?
15:22r7sjustin_smith: https://aphyr.com/posts/306-clojure-from-the-ground-up-state
15:32danielsz`dnolen: I've been playing with the mixin example. It looks like you need a backing component, right?
15:33dnolendanielsz`: I don't know what you're talking in this context
15:33danielsz`dnolen: https://github.com/omcljs/om/blob/master/examples/mixins/src/core.cljs
15:34danielsz`dnolen: MyComponent looks like the backing component.
15:35dnolendanielsz`: ah right, I haven't tried that example in a long time, hopefully works
15:36danielsz`dnolen: It works. But what I can't figure out is how to call a function defined on the mixin from a child.
15:36dnolendanielsz`: it'll be on the owner
15:37dnolendanielsz`: there is no mixin bridging, but things are decoupled enough you should be able to solve that problem yourself
15:39can-of-beesjustin_smith & amalloy - folks, thanks again for your help. i don't think i would have ever figured that out by myself.
15:39can-of-beesthe (with-out-str...) works great, at least in my little test.
15:39can-of-beesreally appreciate the help.
15:41danielsz`dnolen: If I may step back a little bit. React has no story for touch events. There is tap event plugin, but I have no idea how to integrate it with om. https://github.com/zilverline/react-tap-event-plugin
15:41danielsz`dnolen: I thought maybe mixins would help.
15:42dnolendanielsz`: I can't really help much here, I've never tried that
15:42danielsz`dnolen: I've been trying out all sorts of things for the last two days. I haven't made much progress.
15:43dnolendanielsz`: I don't know anything about that plug, nor how it works etc.
15:43danielsz`dnolen: I saw one approach that looked promising. It's the last answer on a stack overflow page. http://stackoverflow.com/questions/24335821/can-i-fastclick-reactjs-running-in-cordova
15:43danielsz`dnolen: It involves mixins.
15:43dnolendanielsz`: I also thought React Addons had some utilities for touch events
15:44danielsz`dnolen: Nope.
15:44dnolendanielsz`: ok, then yeah I have no suggestions really
15:44dnolendanielsz`: you might just want to drop down to the real touch events
15:46danielsz`dnolen: Yes, that would work. But then mixin bridging would be helpful.
15:47danielsz`dnolen: Would a custom descriptor work instead?
15:48sveriHi, Is there a way to combine the components reloaded workflow with dynamic vars? I explained this in more detail here: https://groups.google.com/forum/#!topic/clojure/9oAxIhBzW0Y
15:49dnolendanielsz`: probably, but again you're asking someone who has never tried what you attemped
15:49dnolendanielsz`: you might want to ask on the ClojureScript mailing list for other approaches
15:50danielsz`dnolen: Will do, thanks.
16:56cflemingdnolen: Great. I need to implement it for CLJS next.
17:34tickinghey has anybody experience with the boot build tool? I wonder if the build.boot name is hardcoded for the default build script. I'd like to rename it to something.clj so that the tools I use recognize it as clojure
17:41martinklepschticking: I don't think that's possible right now. you can track this issue for now: https://github.com/boot-clj/boot/issues/105
17:41martinklepschticking: I'd recommend setting up your editor to recognize .boot as clojure files
17:41tickingmartinklepsch: yeah after looking into the source I realized that as well
18:18notbrenthey folks, i recently started to help organize the vancouver clojure meetup (canada, not the washington one beside portland), and i'm trying to bring it back to life after two years without events. if anyone is interested in giving a talk over google hangouts sometime we'd love to have you. our first meetup since the revival was on thursday and had about 25 attendees, plenty of people who are passionate about clojure for a smal
18:19notbrentfeel free to send me an email at brentvatne@gmail.com if you might be interested. unfortunately we don't have any sponsorship at the moment so we can't really offer any kind of reimbursement, but it could be a great way to get your project some exposure or get feedback on some ideas you're working on
18:19notbrentor just message me here, that works too
18:40underplankHi all. Im doing some unit tests with clojure.test, and I need to compare a list of maps, but one of the keys I want to ignore. Is there a generic way to do this?
18:41martinklepschunderplank: dissoc before comparing?
18:41martinklepschdon't think there's a generic way
18:42underplankright. That might have to do. dammit, its a couple of levels deep and in a couple of different places.. grrr.
18:43martinklepschunderplank: update-in & dissoc then I guess
18:44underplankyeah… Just seems like a handy function to have “Hey compare these two complex data structures but ignore these keys”..
18:45amalloythat is a pretty specific thing to want. an alternative possibiility, if you control creation of hese things, would be to smuggle in whatever you don't want counted for equality as metadata
19:21AeroNotixgrr my previously working protobuf stuff now mysteriously fails to compile
19:35ggzmaskis there any AABB collision library for clojure?
19:52justin_smithggzmask: wouldn't it need to be very specific to a particular data structure representing the data, and thus more likely to be bundled as a more general 3d geometry package?
19:52justin_smithalso, I doubt a clojure version exists, but a java one is probably out there somewhere
19:53ggzmaskyea, I know things like Jbullet etc. are there... too lazy I guess... Will just work the interop :<
19:57underplankSo I ave two components (in the stuart Sierra component sense). The top level one creates multiple bottom level ones. The bottom level all rely on a common atom to keep a counter and increment it. This causes a circular dependency AFAICT, which I dont like. Any tips of removing this dependency?
20:00underplankThis causes the Circular dependency because at instansiation time at the moment they get the atom from the top level component. So top instansiates-> bottom which requires something from -> top
20:00justin_smithhow is that circular?
20:01underplankyeah I think I just worked it out that it isnt. They do rely on each other, but because it isnt something requiring something which requires somethig from the first, then its actually ok.
20:09justin_smithone is on a "higher level" - can both pass something to the lower level, and have a reference to that lower level created with that parameter
20:11justin_smithnow if they each needed full reference to the other, that would be circular
21:48sdegutisDoes ClojureScript run on node.js yet?
21:48sdegutisI mean the compiler.
21:49julianlevistonhttps://github.com/clojure/clojurescript/wiki/Quick-Start#running-clojurescript-on-nodejs
21:50sdegutisThat's what I found, which makes it look like the answer is "yes", but I remember reading that it's not yet supported the other day in IRC?
21:50sdegutisSomething about how there's still some work to be done?
21:50sdegutisSo I'm confused by the conflicting things.
21:51julianlevistonsdegutis: did you try it?
21:51sdegutisNo, I am researching to see if there are any unfinished aspects of it first which I wouldn't notice by trying it.
21:52sdegutisSo far, I can't really tell if there would be any difference between running it this way vs running it via `lein cljsbuild once`
21:52sdegutis*between compiling it
21:52sdegutisetc
21:52clojureboatisn't that link about just using node at runtime?
21:52sdegutisOh. I don't know.
21:52julianlevistonclojureboat: no.
21:53clojureboatoh hey I'm still clojureboat
21:53sdegutisuh
21:53julianlevistonsdegutis: http://clojurescript.net
21:54sdegutisjulianleviston: I remember hearing that REPL is broken or something?
21:54gfredericksjulianleviston: it uses cljsc, which is the script that launches the jvm afaik
21:54sdegutisAh.
21:55gfredericksthe only reference I see on that page to compiler platform mentions the jvm
21:55julianlevistongfredericks: thanks
21:57julianlevistonI’d be surprised if macros didn’t still require CLJ tho
21:58gfredericksjulianleviston: which is because the compiler is still on the jvm
21:59sdegutisI really really liked how my ClojureScript ReactJS app is turning out, but I really don't like that it depends on the JVM. So that's why I'm looking into this node thing.
22:00julianlevistonsdegutis: but it doesn’t, does it? just the dev process depends on it
22:01julianlevistonsdegutis: yeah, you’re right. It still depends on clojure, ergo the jvm: https://github.com/clojure/clojurescript/blob/master/project.clj
22:01sdegutisjulianleviston: okay
22:02julianlevistonsdegutis: Why are you so jvm averse?
22:02julianleviston(for dev)
22:02sdegutisjulianleviston: I probably don't have good reasons
22:02julianlevistonhaha :) ok.
22:11ibashsdegutis: what are you using for your clojurescript reactjs app — om?
22:11sdegutisreagent ibash