#clojure logs

2014-07-15

00:00elbenI meant “do”, but I also use corea.sync and go blocks, so still useful
00:01kristofelben: In go, if you've got 10000 go procs running on a 4 core machine and just 4 of those goroutines have no function-calls and no channel ops (just tight loops), they will starve every other proc on the system until they're done.
00:01elbenok, that’s what i would expect
00:02elbenright, because in clojure go uses some small number of threads i I’m correct
00:02elbenMy question was in the context of clojurescript, which does not use threading
00:03elbenso a tight loop would indeed starve everyone else
00:04kristofYes. But if it's a tight loop, why is it in a go block? :P
00:06elbenyou’re the one who first mentioned a tight loop :)
00:06kristofelben: Anyway I would think no. Your do block would hold up everyone else until somewhere in the do block you put or take.
00:06elbeni was trying to understand how clojurescript, om and core.async function in a non-threaded, async, single-process world i.e. a browser :)
00:06nathan7elben: JS has an event loop
00:07nathan7well, it's not part of the JS spec presently, but every JS runtime has an event loop
00:07nathan7only once things hit the event loop, events are dispatched
00:08nathan7so no, your code won't ever be interrupted in the middle
00:08kristof^
00:08elbenthank you, that’s the original question :)
00:08kristofErlang does some interesting pre-emption
00:09elbenyes, i recall taht. they have some kind of counter for actiosn per threadlet?
00:09kristofBut minimizing latency through pre-emption throttles throughput!
00:09kristofelben: Yeah, like a running total of "ops" fired. I can't remember if BIFs count.
00:09nathan7I'm still getting used to thinking with threads around
00:10nathan7I'm mostly a JS programmer, I can read you the ES5 spec backwards from memory and all, so I normally just get to assume everything just runs to completion without interruption
00:10elbenkristof, makes sense. there’s always context switch overhead, even for “green” threads.
00:10nathan7unless I'm firing off something async
00:11technomancykristof: it's considered a bug if any call gets missed by those counts IIUC
00:11elben“unless”?
00:11elbennathan7 ^ in what circumstances would the event loop “take over” control?
00:11nathan7elben: well, if I hand something a callback, that'll of course run in a future turn of the event loop
00:11elbeni assume the user program must give up contorl to the event loop
00:11nathan7yes
00:11nathan7the event loop lives at the bottom of the stack
00:12kristoftechnomancy: I know that there's something related to BIFs... or perhaps it was calling C routines... that one has to be careful of.
00:12nathan7well, right below the JS stack
00:12elbenI see, just making srue
00:12nathan7in any real program you'll do stuff async
00:13nathan7because blocking the event loop is highly undesirable
00:13nathan7well, any program doing I/O
00:14kristofelben: The cost of context switching would mostly come from stuff like cache misses, actually
00:14kristofelben: Want to know what an erlang actor is? (lambda () (;; loop and match message with dispatch function))
00:14elbenhmm i remember a go lang paper talking about that. basically the “secret sauce” of the go scheduler is dealing w/ cache misses
00:15kristofActually, just ignore the "loop" part. At the end of a single receive it'll get scheduled!
00:15elben^ don’t take my word for it though, was just skimming
00:15kristof*scheduled out
00:30technomancykristof: oh yeah, there was a bug where NIFs weren't tracked correctly in R14 or something.
00:34kristofelben: Secret sauce? They do avoid cache misses by trying to keep the same goroutines on the same processor.
01:08_1_anggaaustralia
01:19benkayindochina?
01:24benkayi've got :uberjar {:aot [van.main]} (the ns with my the main function for my app) in the :profiles map in project.clj and yet when I run lein uberjar and then java -jar van_standalone.jar, java complains that it cannot find or load class van.main. thoughts?
01:25benkay:gen-class in the main ns?
01:26benkayspammers in #clojure again...
01:26benkaykasmoin, for the record.
01:29kegundI made the switch to ERC on day 4 of clojure (from freenode HTML). It feels great!
01:33benkayhow much of your life have you poured into your .emacs so far?
01:33benkaykegund?
01:35kegundyeash... 13 years
01:36benkayerc is really what made me serious about honing my .emacs. i haven't lost much time to it...yet.
01:37kegundI've hardly been serious... though a dozen years of emacs kind of adds up.
01:37kegundI just cleared my .emacs last Friday when clojure wasn't working right in emacs.
01:38hellofunkbenkay what kind of erc stuff do you have in your .emacs?
01:38kegundabout ""
01:38kegundexactly ""
01:39kegundhellofunk: sorry... I'm new
01:46deadghostmy emacs is 800 lines
01:46deadghost~8 months in
01:46clojurebotexcusez-moi
01:47deadghoststill haven't put in erc because it seems like a pain to get it to xchat functionality
01:50hellofunkif you live inside emacs and have a large monitor, it is quite useful to have your irc as a window inside emacs
01:51deadghosthellofunk, when you say useful
01:51deadghostyou mean distracting right
01:51hellofunkno, i consider those two words to have different meanings
02:52FrozenlockEspecially for Clojure, because the official doc is #clojure
03:05razum2umi'd like to use foundation library (in my foss) inside of https://github.com/JetBrains/intellij-community/blob/master/platform/util/src/com/intellij/ui/mac/foundation/Foundation.java is there any way to pack it apart as a lib? why isn't it separeted already?
03:06razum2umis it permitted by Apache License?
03:08johnwalkertechnomancy: do you sign the books in your dotfiles?
03:08johnwalker;)
03:18jack_rabbitrazum2um, you might try reading the Apache 2.0 license. It's not too long or difficult to understand.
03:18jack_rabbitrazum2um, in short, you can probably use it for whatever you want. There are certain conditions laid out in the license that you should read and be aware of.
03:19razum2umjack_rabbit: btw is there any another lib to invoke objc methods?
03:21jack_rabbitrazum2um, not sure, but objective-C has C interoperability. Once it's object code, you should be able to call into it with JNI. That said, I've never done it, so there might be complications I'm not aware of.
04:46daGrevis,(map #(* % %) range(2))
04:46clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
04:46daGreviswhoops
04:46daGrevis,(map #(* % %) (range 2))
04:46clojurebot(0 1)
05:09hellofunkin Om I can log a vector that contains both clojure as well as js numerals, such as [12 #<455>] however if I attempt to place the second of these in a dom/td cell, it prints onscreen as 4550. is this some sort of js->cljs issue?
05:09hellofunklike adding a 0 to the end of things, why would that happen?
05:13boxedhave you looked at the DOM? is it just one text node for “4550”?
05:15hellofunkboxed ahh good catch.
05:15boxedno problem :P
05:16boxedhellofunk: are you happy with Om otherwise? I had a lot of trouble with getting it to do what I wanted, so I gave up and went to Reagent instead which I am very happy with
05:16hellofunkboxed: yes, Om is quite amazing.
05:16hellofunknot having any problems at all
05:17boxedI could never figure out when you had to add #js and when not to… and I got annoyed at the sprinkling of “nil” all over the place
05:18hellofunkboxed you could have removed both of those concerns if using Om with Sablano (which I'm not doing)
05:18boxedah, did not know that
05:19boxedReagent is pretty damn nice I must say… I think it deserves as much hype as Om
05:19nathan7it's everything I was hoping Om would be
05:19nathan7just Clojure data types and pure functions
05:20hellofunknathan7 well that's what Om is as well, no?
05:20boxedyea, I still don’t get the whole cursors thing, and I’ve read the docs several times :(
05:20nathan7hellofunk: with Sablono it's close to what I'd like
05:21nathan7with Reagent's reactive atoms it's 100% there
05:21boxedhellofunk: I’ve never written a single #js or nil in Reagent, without adding another lib :P
05:21hellofunkboxed the #js is there because sometimes you do want to pass a pure javascript notation for any number of things, but you don't have to if you don't want to.
05:21boxedplus reagent worked first time… had loads of trouble getting Om to do anything
05:22hellofunkOm is a bit complicated but it worked out of the box for me
05:22nathan7it means binding your every component quite strongly to it
05:22nathan7with all the om/blah
05:23nathan7well, dom/blah
05:23hellofunkI guess I'd have to see Reagent in action to understand the distinction
05:24nathan7[:h1 "this is how we do it in Reagent"]
05:24nathan7and just @blah
05:24hellofunknathan7 that's not reagent, that's sablono, no?
05:24nathan7well
05:25nathan7hellofunk: well, yes, I just realised I picked the wrong difference
05:25hellofunkYou can get that same syntax with Om just fine if you use Sablono there too
05:25nathan7it's been over 24 hours since I awoke
05:25nathan7my brain is slightly off
05:25boxedhellofunk: good defaults count though…
05:26nathan7hellofunk: when you dereference an atom while rendering, it remembers that
05:26nathan7hellofunk: and it knows to rerender that when the atom changes
05:26hellofunkOm seems pretty well thought out and very highly performance so I'd have to see better examples to agree that there was a better alternative right now
05:27hellofunknathan7 and what gives you the impression that Om's engine is not watching state changes as well? Because of course that is the entire point behind Om and React
05:27nathan7hellofunk: I can have as many atoms as I want
05:28mi6x3mclojure
05:28mi6x3mwhy is the doc comment not included in the meta
05:28the-kennynathan7: You can have as many different states in Om too. Either nested, or via different om/roots.
05:28mi6x3mif I specify custom stuff with ^{...}
05:28nathan7the-kenny: I don't have to have extra roots for Reagent, however
05:28the-kennyWhy do you need multiple atoms then anyway?
05:29hellofunkI'm still waiting to here a good example of what Reagent does that Om does not.
05:29the-kennyOne root, one "application", one single consistent state over the whole application
05:29boxedhellofunk: It’s not about what features Reagent has that Om does not imo, it’s about the ease of use of the features either has
05:29nathan7I have a homebaked DB that has live-updating documents
05:30boxedperl has all the features, it sucks :P
05:30nathan7I wrap my JS-land DB documents in an atom that gets reset when the DB document gets updated
05:30nathan7I don't have to tell Reagent shit
05:31nathan7and the set of documents that is displayed varies of course
05:31the-kennynathan7: Om works the same.
05:31nathan7I don't have to maintain a set of Om roots or whatever
05:31nathan7or have a global map that everything lives in
05:31the-kennyWhat's wrong about a map containing multiple DBs?
05:31nathan7I can just read from an atom and everything automagically updates
05:32nathan7and I intend to extend the atoms a little more so my DB stuff can see what atoms are actually being watched
05:32nathan7so unused documents are dropped
05:32nathan7and I can use my DB as if it's entirely local
05:32the-kenny*shrug* I don't really want to discuss the differences in detail. I'm a pretty happy Om user in multiple projects :)
05:33nathan7the-kenny: basically, I get to write reactive UI as if it's not
05:33the-kennynathan7: It's the same in Om...
05:34hellofunkThe only thing nathan7 has mentioned that I don't understand is the "atom getting reset when DB document gets updated" -- in Om, I have a separate core.async go block that investigates outside changes and then delivers anything necessary to the Om atom on a channel.
05:34hellofunkand then of course Om automatically reacts to whatever new state is has
05:34the-kennyhellofunk: That's the preferred way iirc. You can also just modify the atom outside om. Works fine too.
05:34the-kennyWhat brings me to my question: Anyone got an idea to selectively *disable* a portion of code (in my case weasel-repl) when I build the application with :optimization :advanced? I need Closure to fully *strip* the code, as our security policies won't allow eval() in the generated JS.
05:35hellofunkthe-kenny it is not advised that you modify the Om atom outside Om. For high performance, you should let Om schedule all updates only inside an Om render cycle
05:35the-kennyI know
05:35nathan7hellofunk: This means my UI stuff has to handle it differently from regular code though
05:36hellofunkOm is very much a strong MVC reactive system, so I can only suspect that you weren't using it as designed if you felt it wasn't doing these things.
05:36the-kennynathan7: Well. The performance is quite good even when modifying the atom from the outside.
05:36nathan7derefing an atom handles all — even if that's inside some function that's entirely unaware of that
05:36hellofunkIt's important to note that while React is a very fast JS library, Om has been benchmarked to be another 2 - 3X faster than React because of how it schedules state updates. I'd be very surprised if Reagent has that sort of implementation going on, but maybe it does (which I doubt).
05:37nathan7hellofunk: It re-renders if atom values aren't identical?
05:37hellofunkwhat?
05:37clojurebotwhat is a better one i think: https://github.com/michaelklishin/neocons
05:37nathan7hellofunk: so Om might be doing something faster there, yes
05:37hellofunkNathan7 the entire point of React is to re-render things that have changed, so both Om and Reagent would be doing this
05:38nathan7hellofunk: mhm
05:38boxedhellofunk: pretty sure the whole “immutable data structure” thing gives a lot of speed advantages to Om and Reagent equally, compared to normal React
05:38the-kennyboxed: Yup, that sounds right.
05:38locksisn't Reagent basically bindinds to ReacT?
05:39nathan7hellofunk: But Om might be doing something smarter than just identity comparison
05:39nathan7hellofunk: by using cursors and all
05:39the-kennyOn the plus side for Om: It might know *which* subtree(s) changed without even comparing them to the last state, so it can optimize even further by telling React only those differences
05:39the-kennyThat's a big plus, brought by the cursors.
05:39hellofunknathan7 Om has some quite sophisticated source code worth looking at, it is doing some very interesting things
05:41boxedthe-kenny: you’d have to have a pretty huge tree of state for that to make much difference though right? I mean, if a subpart has changed it should be at worst binary search type time complexity to find that subtree?
05:41michihubercould somebody help me out with a silly java issue (never did java stuff before)?
05:41michihuber$ jar tf ./some.jar | grep ragtime/main
05:41michihuberragtime/main$_main.class
05:41michihuber
05:41michihuberragtime/main$migrate.class
05:41michihuber
05:41michihuberragtime/main__init.class
05:41michihuberragtime/main.clj
05:41michihuber$ java -cp ./some.jar ragtime.main migrate
05:41michihuberError: Could not find or load main class ragtime.main
05:41the-kennymichihuber: Aww don't paste code here please.
05:42michihubersorry
05:44mi6x3mhow does clojure abbreviate clojure.string?
05:44mi6x3mstrng?
05:44the-kennyboxed: Yes, that's right. Still I find it more pleasant to have constant-time diffing in case of transact! or update!
05:45the-kennymi6x3m: I usually use [clojure.string :as s] or just :refer [...], if that's what you're asking
05:45mi6x3mthe-kenny: i also only refer usually
05:45mi6x3mbut recently thought i might start to abbreviate
05:45mi6x3mtnx
05:46nathan7mi6x3m: :as str perhaps?
05:46nathan7(str/join …) reads nicely
05:46mi6x3mnathan7: shadows str
05:46nathan7mi6x3m: that doesn't really matter
05:46nathan7mi6x3m: namespaces don't shadow vars
05:47mi6x3mnathan7: ah, then str is indeed better :)
05:47mi6x3mdidn't know that
05:47nathan7I do it all the time
05:47nathan7I have a type called Metric, vars containing it usually called metric
06:06Glenjaminthey make it sound simple, but there's some serious work gone into efficient tree diffs and IE8 support
06:06mtrimpeThe big advantage of a Clojure version would be that it wouldn't need to do tree diffs of course...
06:06kerneisOm more or less directly translates React's idea of a single global state flowing through
06:07Glenjaminmtrimpe: you still need tree diffs to decide what to do to the DOM
06:07kerneisbut while it is important in javascript to ease design and immutability, I'm not sure it's necessary to keep it in cljs
06:07Glenjaminand if you have any derived data being passed to child components, identity checks aren't particularly useful anymore
06:08Glenjamineg (map func coll) will never pass an identity check
06:08mtrimpeGlenjamin: An idiomatic Clojure clone would be closer to what e.g. Hoplon does...
06:09Glenjaminah, hoplon seems neat
06:09mtrimpeGlenjamin: Track changes in the data and then figure out the optimal way to reflect how that affects the DOM
06:11mtrimpeYeah; except Hoplon doesn't really buy into the React philosophy of only keeping visible elements in the DOM
06:12mtrimpeA Clojure react clone could be something like a source atom with a function that builds a UI from that data…
06:12mtrimpeand then have a macro that memoizes that function graph and applies changes only when needed...
06:15the-kennyI don't really see the point in rewriting React in Clojure(Script). Way too much work, and (as far as I can see) it already integrates quite fine
06:17mtrimpeYeah that's the thing… React gets you 80% of the way there with 20% of the effort.
06:18mtrimpeWould still love a pure Clojure version though… I'm pretty sure you would end up with something simpler…
06:20the-kennylikely. Still I would never even want to think about re-implementing the event system in a *correct* way over all the browser implementations ;)
06:22mtrimpeYeah; that's the biggie React handles under the hood...
06:23mtrimpeStill; even a version that doesn't paper over those problems (yet) could already be valuable…
06:31nathan7the-kenny: It's mostly "hey that seems fun and interesting to do"
06:57martinklepschwhen using projectile in emacs it somehow uses my src/projectname directory as root rather tan the one that contains project.clj
06:57martinklepschanyone had that problem as well?
06:59hellofunkthe-kenny i'm curious how Om handles the situation where you write over an entire vector but only one of the items in the vector changes; is it smart enough (or perhaps this is on the React side) to not update other items that did not change?
07:00the-kennyhellofunk: I think so. build-all uses the index as :react-key, iirc.
07:00the-kennyhellofunk: You can also provide your own react-key.
07:01hellofunkthe-kenny okay so if I completely replace [1 2 3] with [1 5 3], there would be the advantage of the persistent data structure not change the 1 and 3 and then the additional advantage of React not seeing any changes on the 1 and 3 even if they were actually recreated?
07:01the-kennyI think so
07:02the-kennyI'm not sure if Om will trigger the component-function for each val in the vector though.
07:03the-kennyhellofunk: the key-stuff also makes sure that components don't get destroyed and recreated if their index changes.
07:03hellofunkI wonder if it makes a difference for performance if you use om/update! on a deep cursor passed as an arg to a component, or if you use a path of korks in an update to the main parent app-state, each of these should be equally as fast?
07:04the-kennyNot sure, but the API would allow to optimize both
08:01sharpsNeed help: working with File i/o, but I want my clojure CLI to open current user's $EDITOR the same way Git opens it for messages. How would i go about doing that?
08:05luxbockhttps://github.com/hhutch/om-bootstrap/blob/master/src/om_bootstrap/dom.clj
08:05luxbockI'm trying to figure out why `(gen-react-dom-inline-fns)` is needed at all in this code but I can't wrap my head around it
08:06luxbockI know it's needed as if I comment it out then the thing stops working
08:06luxbockbut I just don't see where the macros that get created from that call are ever used
08:07kerneissharps: copy the file to a temporary location, exec $EDITOR temp-file, wait for editor to return, copy modified file back
08:07kerneis(or exec editor directly on the original file)
08:08kerneissharps: http://clojure.github.io/clojure/clojure.java.shell-api.html should be useful
08:09Glenjaminluxbock: https://github.com/hhutch/om-bootstrap/blob/master/src/om_bootstrap/dom.cljs#L2
08:09Glenjaminit makes more sense in the real om source
08:15luxbockGlenjamin: sorry what do you mean in the real Om source?
08:17xavierrileyWhat's the best option for jumping between tests and code in emacs?
08:18bob2clojure-test-mode
08:18luxbockmy trouble in understanding this is that I don't see how the call to `gen-react-dom-fns` in dom.cljs invokes any of the macros created by `(gen-react-dom-inline-fns)`
08:18bob2unless technomancy 's fancy thing is working now
08:19xavierrileythanks - I think I'm setting up at a point where I fall between the cracks of fancy thing working and test-mode being deprecated
08:21twiceadaycan i paste
08:21twiceadayhere really short example of the source code in clojure that i am trying to understand ?
08:21twiceadayit is solution to this
08:21twiceadayhttp://www.4clojure.com/problem/28
08:27vyorkinhi everyone! i'm trying to solve a very simple task in clojure, its http nested parameters parsing, here is my solution http://pastebin.com/xNHG3ha0
08:28vyorkinit almost works, but i'm doing smth wrong because if i have a nested array it'll be overriden by the next hashmap
08:29vyorkine.g. a need to get a "d" ["1" "2"] not just "d" ["2"]
08:29vyorkinwhat am i doing wrong?
08:30kerneistwiceaday: if its a one-liner it's fine, otherwise use a pastebin service
08:30vyorkin(by overriden i mean overwritten, sorry)
08:31bob2do you mean "I'm trying to parse php-style GET parameters"?
08:31vyorkinit's a rails-style also as far as i know
08:31vyorkinrack-style, excuse me
08:38kerneisvyorkin: notwithstanding your bug, you miss a "w" in your expected result
08:38kerneis(or I don't understand what you are trying to do)
08:40vyorkinkerneis: oh, sorry, i right, but unfortunately thats not the main problem(
08:40vyorkinkerneis: i expect to get {"x" ["1" "2" "3"], "a" {"b" {"w" {"y" "3"}}, "c" "2", "d" ["1" "2"]}}
08:41vyorkinkerneis: but i've got {"x" ["1" "2" "3"], "a" {"b" {"w" {"y" "3"}}, "c" "2", "d" ["2"]}}
08:42vyorkinkerneis: i right = you are right
08:45kerneisvyorkin: your problem is that:
08:45kerneis,(into {"d" ["1"]} {"d" ["2"]})
08:45clojurebot{"d" ["2"]}
08:46kerneisbecause:
08:47kerneis,(conj {"d" ["1"]} {"d" ["2"]})
08:47clojurebot{"d" ["2"]}
08:47kerneisnamely, conj does not do what you have in mind
08:48kerneis(and into uses conj implicitly)
08:48vyorkinomg, thanks, didn't know about this
08:48vyorkini can see now this (reduce conj to from)
08:49vyorkinnow i wonder how to implement this correcty (%
08:49mercwithamoutho_O;
08:49kerneiswell you should try and write a function to use instead of into
08:50kerneiswhen you are done, maybe you'll notice this is an already existing function (but I don't think so at first sight)
08:50vyorkinwhen to you think about my solution? i've just started to learn clojure
08:51vyorkinso may be there is a better way to solve this? how bad my code is? (%
08:53kerneisI don't have much clue about the whole problem, because I don't know what the original specification is exactly
08:53kerneisthe format since very crappy to be honnest
08:53kerneisbut in any case, you might be interested in this function:
08:54kerneis,(update-in {"d" ["1"]} ["d"] conj "2")
08:54clojurebot{"d" ["1" "2"]}
08:54vyorkinkerneis: thanks!
08:54kerneis,(update-in {"a" {"d" ["1"]}} ["a" "d"] conj "2")
08:54clojurebot{"a" {"d" ["1" "2"]}}
08:57kerneisif you are smart enough, I believe you can get rid of transform, and directly (reduce #(update-in ...) {})
08:58vyorkinkerneis: thanks for your feedback
08:58xavierrileyI'm just trying a code kata and leiningen seems to be holding onto some previous version. I run `lein test` and it says 1 test containing 0 assertions when I have 4 assertions and I've definitely saved the file. Any suggestions as to how I sort this out?
08:59vyorkinkerneis: i'll try to do this by myself, cuz i need to learn
08:59kerneis(I have an almost solution, don't hesitate to ask if you need more details)
08:59kerneis(but you are right, it's better if you dig it by yourself)
09:00Glenjaminxavierriley: try lein clean
09:01xavierrileyno difference with lein clean
09:17xavierriley`lein clean` thing turns out to be PEBCAK - I didn't use (is ..) in the tests
09:28impermanHi, does anybody know any Clojure HDL DSL (for digital design FPGA/ASIC)? I found PIplin (https://github.com/dgrnbrg/piplin) but it's not longer in development.
09:29mr-foobarseangrove: is there a protocol for undo/redo/state ?
09:31impermanmr-foobar: maybe try to add a watcher function. http://stackoverflow.com/questions/9847245/pattern-for-implementing-undo-redo-in-clojure
09:33gfredericks,(def a (doto (atom nil) (add-watch :x (fn [_ a old new] (alter-meta! a update-in [:history] (fnil conj []) old)))))
09:33clojurebot#'sandbox/a
09:33gfredericks,(swap! a (constantly 12))
09:33clojurebot12
09:33gfredericks,(swap! a inc)
09:33clojurebot13
09:33gfredericks,(swap! a inc)
09:33clojurebot14
09:33gfredericks,(swap! a + 5)
09:33clojurebot19
09:34gfredericks,(:history (meta a))
09:34clojurebot[nil 12 13 14]
09:36mr-foobarneat, thx gfredericks, imperman !
09:46mr-foobarhttps://i.imgur.com/1ZuiGic.jpg :)
09:48impermanmr-foobar: http://aphyr.com/data/posts/314/monads.jpg ;)
09:52razum2umI'm trying to release to clojars but signing fails like this https://gist.github.com/razum2um/87ec980408ad1c77a55b (using mac 10.9) why i'm not asked for gpg passphrase?
09:52mr-foobarimperman: that's it, if I ever have a pet I will call it state and put it in a box :)
09:54Faremr-foobar: with all those monadic combinators starting with m- I read your name as m-foobar and was wondering what kind of combinator you were.
09:55FareAnyone going to the International Lisp Conference 2014 in Montreal (Aug 15-17) ?
09:55mr-foobarFare: i am the unrepairable kind :)
09:57jdkealyi have been using om to build a tab component, onclick it sets the state of the tab component as some key, and then calls om/build function on the appropriate passed in component, however i'm finding that if i click on tab, then another, then go back to the first, IDidMount appears to never be called the second time I build it. I tried passing in a new react key every time, but still.
09:58ambrosebsFare: yes
10:00mr-foobarjdkealy: if tab-component is rendered once, the IDidMount is also called once.
10:00Glenjaminif the key is different it should cause a did-mount
10:02impermanFare: hm... to far away from Ukraine :(
10:03nathan7razum2um: do you have a gpg agent configured at all?
10:03jdkealyyeah it's strange, i'll debug some more try try to figure out what's going on
10:03Fareimperman, it's a small world. $ not km is the distance that matter.
10:05impermanFare: course, it's far away in $ at now ))
10:06jdkealyso hypothetically, if you don't pass in a react key, it should call IDidUpdate when you om/build the component again ?
10:07Glenjaminjdkealy: if shouldUpdate was true, yeah
10:07jdkealyi thought in the docs, it basically said "never use shouldUpdate"
10:08Glenjaminin om you probably don't need to touch it, this is true
10:22michaelr525Hi
10:22michaelr525I'd like to do the basic Om tutorial here: https://github.com/swannodette/om/wiki/Basic-Tutorial
10:23michaelr525Using Emacs and cider instead of lighttable
10:23michaelr525How should I go about it?
10:24nullptr`michaelr525: the easy way is to skip the live brower repl and just hit refresh
10:24michaelr525nullptr`: i see
10:39boxedam I missing something? I can’t find how to do named groups in regexes…
10:40michaelr525nullptr`: why go the easy way when we can go the hard way :)
10:41michaelr525nullptr: what's the shortest route for adding a brepl?
10:42nullptronce upon a time it was https://github.com/cemerick/austin
10:43michaelr525nullptr: 10x
10:43cbpmichaelr525: use weasel
10:43michaelr525weasel?!
10:43cbpit's faster and easier than austin
10:44cbpand not as buggy
10:44cbp$google clojure weasel
10:44lazybot[tomjakubowski/weasel · GitHub] https://github.com/tomjakubowski/weasel
10:45michaelr525cbp: i'll check it thanks!
10:47michaelr525it's readme is definitely shorter
10:47hhenkelHi all, is there a way to use mapcat in a way that I can give one collection that is applied and a second collection is given as one whole thing?
10:48Glenjaminhhenkel: can you give an example input/output please?
10:49hhenkelGlenjamin: I'll try, omething like (mapcat my-func [ 1 2 3 ] [ a b c]) where the [a b c] should handed over completly.
10:49borkdudewhat is up with Uncaught ReferenceError: goog is not defined app.js:1 (anonymous function) in a compiled clojurescript js file?
10:51Glenjaminhhenkel: so (my-func 1 [ a b c ]) ?
10:52hhenkelGlenjamin: yes, and so on for the other values
10:52Glenjamin(mapcat #(apply my-func % others) [ 1 2 3])
10:54nullptralt: (mapcat my-func [1 2 3] (repeat [a b c]))
10:55hhenkelGlenjamin: nullptr: I think I'll go with the alternative version as % is allready in use in my code.
10:55kerneisborkdude: <script src="out/goog/base.js" type="text/javascript"></script>
10:55kerneisor something like that?
10:56kerneisat least that's what Om tutorial does
10:56borkdudekerneis Thanks. I wonder why this html doesn't have it: https://github.com/ckirkendall/kioo/blob/master/example/om/index.html
10:57vermaborkdude, it depends on the optimization level you use
10:57vermaYou need those explicit includes for :optimizations :none
10:57vermabut can avoid those for :whitespace and :advanced
10:58borkdudeverma ah, thank you
10:59hhenkelnullptr: Glenjamin: Thanks a lot, seems to work just fine!
11:00kerneis,(into #clojurescript #clojure)
11:00clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
11:03ambrosebsarrdem: nice work with grimoire.
11:03vermainside a clojure macro, is there a way to request a random variable name? I know about hello#, but I need to ask clojure for a random variable the same way hello# does
11:04ssiderisverma: gensym
11:04Glenjamin,(doc gen-sym)
11:04clojurebotexcusez-moi
11:04Glenjamin,(doc gensym)
11:04clojurebot"([] [prefix-string]); Returns a new symbol with a unique name. If a prefix string is supplied, the name is prefix# where # is some unique number. If prefix is not supplied, the prefix is 'G__'."
11:04vermathanks ssideris, Glenjamin :)
11:07jdkealyi'm stuck on an issue in om. i built tabs, where onClick they call om/build on the appropriate component. i click one tab, and fine, i go back, and it does not render correctly. I wanted to be sure that the component mounts before I make call to a function in the render state, so I call (om/set-state! owner :mounted true) inside the DidMount call, however even though (did-mount) does get called, IRenderState never renders
11:07jdkealywith the state :mounted true...
11:09vermajdkealy, some code would be nice
11:09clojurebotexcusez-moi
11:09jdkealyok making a gist
11:09bteuberjdkealy: not so familiar with om, but why do you render from the on-click?
11:09hhenkelnullptr: Glenjamin: Do you know if the return values may change when using mapcat with repeat?
11:09bteuberwhen I build tabs without om, I just toggle display:none
11:10bteuberso if I would build them with, I would do the same and render on the outside of that
11:10bteuberI guess
11:10jdkealyi'm debating doing just that :)... I just thought it will make unnecessary http calls
11:11bteubertrue probably better let om take care of which one is visible
11:11vermaI just try to keep my renders just about rendering and nothing else
11:12hhenkelI'm expecting something like "portal1, portal2" but instead I get a lazy seq that looks like this: ( \p \o \r \t \a \l \1\p \o \r \t \a \l \2)
11:12hhenkelFrom within my code I see with trace that I get strings
11:13cbpthat happens when you concat 2 strings
11:13cbpjust add (apply str ..) to that
11:14cbpor use clojure.string/join
11:15hhenkelcbp: I don't use concat (I would say). I'll give the line of code.
11:15bteubermapcat calls concat
11:16hhenkelcbp: (mapcat get-replacements (distinct (re-seq #"\$\{.+?\}" %)) (repeat collection))
11:16bteuberhhenkel: (clojure.string/join (map get-replacements ...)) should do the job
11:16bteuberor (apply str (map ...)
11:18hhenkelbteuber: okay, I'll try. Thought I tested it and got stuff I was expecting though...
11:20quangquachIs there anyway to use update-in to update a value in a map w/o passing an anonymous function? (as I am a Clojure beginner)
11:20kerneisthis is the main issue with dynamically-typed languages
11:20quangquachfor example: (update-in {:a 3} [:a] (fn [_] 4))
11:20cbpquangquach: assoc-in
11:20quangquachah, just checked that, thanks
11:21rkneufeldquangquach: (fn [_] 4) is also equivalent to (constantly 4), but cbp's suggestion is most appropriate
11:22bteubernote that (assoc-in m [x y z] 42) == (update-in m [x y] assoc z 42)
11:23quangquachthey're really helpful, thanks.
11:23arrdemwhich is really (update m x update y update z assoc 42)...
11:24hhenkelbteuber: Okay, my mistake I tested it in a short example before I implented it within my code and there I was returning a vector not a plain string...
11:24quangquachWhile trying Clojure, I see many ways to do one task at a time.
11:25jdkealyverma: here's my gist https://gist.github.com/jdkealy/217f56e10349642c3996
11:25jdkealyyou could see the first component mounts the first time, but the second time, it fails the if clause, and the state never updates appropriately
11:29vermajdkealy, taking a look
11:30gfrederickshow do I convince leiningen to not try to sign git tags?
11:33gfredericksapparently leiningen does not want to be convinced of this
11:34vermajdkealy, I don't think you need to explicitly call om/get-state in IRenderState since the state is being passed to you already
11:34jdkealyok, but all the same, the state object doesn't have the :mounted property either
11:34vermajdkealy, don't think that'd fix the issue, but just a thought
11:34gfrederickstime for lein-shell
11:35gfrederickswait nevermind
11:37jdkealyverma, so om/set-state :mounted true does get called, but iRenderState never picks it up
11:37cbp:-o
11:46angusiguessDoes anyone have a link to something containing the <? macro?
11:48arrdemangusiguess: <? isn't a macro, it's a special symbol that the go macro looks for and compiles.
11:48angusiguess@arrdem I was under the impression it wasn't in core.async yet.
11:52jdkealyso in my gist, if you click "tab 1" twice, it will render appropriately, but one click will render it without that state property even though i can see the call to set-state! is indeed being made
11:52seangroveOf course <? is un-googleable. Does it take only non-nil values off of a channel?
11:53angusiguessI found this: http://martintrojer.github.io/clojure/2014/03/09/working-with-coreasync-exceptions-in-go-blocks/
11:53angusiguessWhich describes <?
11:53gfredericksseangrove: you can't put nil values onto a channel in the first place
11:54seangrovegfredericks: Yeah, thought that immediately after writing that
11:54angusiguessIt's a pattern for exception handling.
11:54Frozenlo`seangrove: sometimes this works http://symbolhound.com/
11:55seangroveangusiguess: Got it, thanks. Looks interesting
11:55angusiguessseangrove np!
11:55andyf_ /whois arrdem
11:55arrdemsome random asshat
11:55seangrove~arrdem
11:55clojurebotTitim gan éirí ort.
11:55andyf_Ugh. How did my client just send that to the channel
11:56vermajdkealy, sorry was away, I am going to try and run this
11:56seangroveclojurebot: arrdem is on the edge, and best left alone
11:56clojurebotAck. Ack.
11:56jdkealythanks verma!
11:57arrdemhum.. I used to have a couple clojurebot entries... I guess that's part of my hellban. *shrug*
11:58jeremyheilerandyf_: think you put a space before teh command
11:58andyf_Yeah, probably so.
12:02andyf_Is there a story to who taught the bots Celtic curses, and why?
12:03gfredericksclojurebot: why?
12:03clojurebotwhy is the ram gone
12:05vermajdkealy, I am seeing what you're seeing I think
12:05jdkealycool!
12:05jdkealyso i'm not crazy!
12:06jdkealyi mean... i could go the show/hide route, but that would mean me conceding that i have no idea how to control how om re-renders a component, which is sad
12:07vermano, I don't think you'd have to do that, may be some re-ordering is in order, what do you intend to do with the :mounter property
12:09jdkealywell... there's another call which is inside component one, which requires me to detect the width of component one, without the mounted property it's buggy, sometimes detects the width, sometimes doesn't
12:09vermajdkealy, I changed the call to (js/setTimeout #(om/set-state! owner :mounted true) 100)) and it seems to notice it
12:10jdkealyhmmmm... that's interesting, but is that really a fix ?
12:10jdkealyi mean... i could work with that
12:12vermayeah, with a timeout of 0 :) .. but I guess I would try to understand the exact semantics behind this and why state updates in did-mount don't work
12:12vermaeither dig through om or have dnolen_ take a look
12:14jdkealywhat's the best way to have him look? I see a lot of people putting crap issues on the issues list on github, i don't wanna get flagged as a chump :)
12:14jdkealythink this qualifies for github issues ?
12:21jdkealywell anyway, the timeout thing appears to work fine, i'll just chalk it up to too many updates at once and some asynchronicity issues
12:23vermajdkealy, I don't think I understand what you're trying to do with that prop, so may be once you have it worked out with this hack may be we can take a look at it, issue would be the best way, but do some research before you post it I would guess.
12:29vermajdkealy, Om does some stuff here: https://github.com/swannodette/om/blob/master/src/om/core.cljs#L324
12:42TimMc,(.next (.iterator (vec ())))
12:42clojurebot#<NullPointerException java.lang.NullPointerException>
12:42TimMcI think that's the wrong exception...
12:43TimMc,(.next (.iterator #{}))
12:43clojurebot#<NoSuchElementException java.util.NoSuchElementException>
12:45andyf_TimMc: vote for CLJ-1453, assuming it is the same issue
12:47andyf_Full link: http://dev.clojure.org/jira/browse/CLJ-1453
12:49tbaldridgeanyone here have some experience with test.check?
12:50tbaldridgeI'm trying to write a generator that creates values that are based on previous values generated.
12:50reiddrapertbaldridge: me me!
12:50tbaldridgehey, I was looking for you ;-)
12:51tbaldridgegot an example of that? I'm generating a list of commands to run against my API. the return values of some commands I need to use as parameters to other generated commands.
12:51gfredericksbind
12:51reiddraperindeed, bind is your friend there,
12:51gfrederickstbaldridge: allow me to plug this for macro I created
12:52gfrederickstbaldridge: https://github.com/gfredericks/test.chuck#for
12:52reiddraperhttps://github.com/clojure/test.check/blob/master/doc/intro.md#bind
12:52reiddraperi might recommend playing with bind before the macro, but that's just me
12:52dnolen_jdkealy: a minimal example w/ no extra context and I will take a look.
12:52gfredericksreid and I are competitors in the test.check business
12:55tbaldridgeI'll think about bind a bit, this could get interesting....
12:55FrozenlockGoogle, stop sending me to clojuredocs for v1.2!!
12:55arrdemhttp://grimoire.arrdem.com/1.6.0/
12:56arrdemyeah not sure what to do about clojuredocs unfortuate pagerank score...
12:56bbloomarrdem: needs a more "official" sounding domain & everybody has to link to that, so that google learns it's fucking lesson
12:56Frozenlockarrdem: Ah right
12:56bbloomits*
12:56arrdembbloom: you saw my clojure@googlegroups post about an "official" domain, right?
12:56andyf_And give it more Google juice by whatever means works for that. Link to it somehow?
12:57bbloomarrdem: nope
12:57reiddrapertbaldridge: dunno if you'll find this helpful,but the type of bind is: bind :: Generator a -> (a -> Generator b) -> Generator b
12:57arrdemFrozenlock: hard coded HTML ftw. the sidebar never unhides itself
12:57technomancyFrozenlock: sponsored UI elements (mcdonalds)
12:57cbpim lovin it
12:58FrozenlockWasn't there a search field?
12:58tbaldridgereiddraper: yeah, I understand how it works, but what I'm doing is a bit more complex. Imagine that "testing clojure collections" thing but while testing multiple types of collections at once.
12:58cbpFrozenlock: home page
12:58arrdembbloom: https://groups.google.com/d/msg/clojure/ctNJUvhhkPg/rOpWO5UYrg0J
12:59Frozenlockcbp: Ah thansk
12:59Frozenlockthanks even
12:59reiddrapertbaldridge: i'll be shocked if what you want to do can't be done with some combination of fmap and bind
12:59bblooma more important question is how come your hamburger menu has different spacing between the top and bottom lines?
12:59tbaldridgereiddraper: right, I think it can be done, I just need to play around with it a bit
12:59tbaldridgethanks for the help everyone.
12:59reiddrapertbaldridge: i've got a call in a couple of minutes, but will be around after and can try and help
13:00TimMcreiddraper: I wrote an Iterable tester using simple-check.
13:00arrdembbloom: 5/5 would take github issue for your ocd
13:00TimMcTurns out myimpl is correct, but vector's is not. :-P
13:00andyf_Hamburger menu?
13:00arrdemandyf_: the hamburger button in the top left
13:00TimMcandyf_: Thanks!
13:00cbpandyf_: 3 horizontal lines make a hamburger
13:01Frozenlockandyf_: http://s.mlkshk.com/r/LOQQ
13:01luxbockI'm trying to get Weasel to work, but after I start the the CLJS-repl via cemerick.piggieback/cljs-repl and try connecting to ws://localhost:9001 nothing happens
13:01bbloomor in this case, an underlined equals sign?
13:01luxbockI'm using this: https://github.com/jacksonja/clj-cljs-weasel-template
13:01TimMcbbloom: I thought it was struck through!
13:01luxbockif I try to access localhost:9001 without the ws:// protocol then I get a message telling me to connect with web-socket
13:02bbloomTimMc: i haven't found the source yet, so i'll let you know what i discover, heh
13:02cbpluxbock: use the ws:// then?
13:02jdkealyHi dnolen_! I stripped down my example a little bit. https://gist.github.com/jdkealy/f8b6db5829406fc2030d... Interestingly, if I skip "app-view" and set tabs to be the root, the issue does not occur. Basically the issue being that render-state (in component one) does not have the state changes made in DidMount https://gist.github.com/jdkealy/f8b6db5829406fc2030d
13:02luxbockcbp: nothing happens when I use that
13:03jdkealy(btw, dnolen_, i went to your kitchen table coders event 3 months ago... great stuff!)
13:04andyf_TimMc: Please do comment on that ticket, or provide a better patch, if you find any issues with it
13:05cbpluxbock: are you using (ws-repl/connect "ws://localhost:9001" :verbose true) ?
13:06bbloomTimMc: arrdem: it's magic
13:06bbloomi have no idea where the hamburger is coming from
13:06bbloomapparently i don't know how to use computers
13:06arrdemhamburgers |are| magic
13:07luxbockcbp: from the cljs-repl? I didn't try that but it doesn't appear to work either
13:07luxbockI was trying to use my browser to connect to the address
13:07bbloomholy crap
13:07bbloomit's made out of borders...
13:07bbloom*cringe*
13:07cbpluxbock: thats the cljs that creates the js that connects to your repl
13:08cbpluxbock: as in you compile that and then load that from your browser
13:08arrdembbloom: er... ew. okay. definitely issue worthy then.
13:08bbloomboom: https://github.com/arrdem/grimoire/pull/47
13:09bbloomcss/html/js are all stupid
13:09cbpi know right
13:09luxbockcbp: yeah I've compiled it, and I've tried opening the index.html file that ships with the template, though now that I'm looking at the console it's telling me that goog is not defined
13:10luxbockso maybe there's something wrong with the cljsbuild-settings of the project, hmm
13:10cbpluxbock: you need to do the <script> tags for goog.base.js or whatever
13:10Frozenlockhttp://grimoire.arrdem.com/1.6.0/clojure.core/ I can't search the page if I didn't click to expand. :-(
13:10arrdemFrozenlock: yeah known issue
13:11cbpI don't know if there's a decent clojurescript tutorial around
13:11arrdemFrozenlock: I don't have a good fix for that yet.
13:11luxbockyeah it doesn't appear that this project, generated via that clj-cljs-weasel template, has base.js at all
13:11cbpI know it was a pain to get it all to work the first time
13:11arrdemFrozenlock: pls can have gh issue for that? one doesn't exist yet.
13:11Frozenlocksure
13:11arrdemthanks
13:11luxbockI've had a working Austin repl before but I read somewhere that this is the new thing to use
13:11FrozenlockI like to criticize without doing any work :-p
13:12FrozenlockBtw, why are those hidden away?
13:12cbpluxbock: it is a much better experience than austin
13:12arrdemwell as bbloom is ample proof my real strategy is to commit only the set of errors sufficiently egregious to motivate someone else to fix them for me..
13:12cbpit's like fast and doesn't randomly break!
13:13luxbockgood to hear, then it's worth figuring out why this template is not working :)
13:13bbloomarrdem: i only fixed it b/c i was incredulous that i couldn't find the source of the problem within 5 seconds in the inspector
13:13bbloomhave i mentioned that css/html/js are stupid?
13:14bbloomtook me 11 damn minutes
13:14cbpyou also don't need a freaking server to use cljs on a local html file
13:14arrdemnew build is deployed. enjoy bbloom's hamburger everyone.
13:14FrozenlockOooooh
13:15Frozenlockmuch nicer
13:15bbloomit's glorious
13:15cbpi want an actual hamburguer
13:15FrozenlockI still have to use the mouse to open the menu.
13:15Glenjaminan actual hamburger would be hilarious
13:15GlenjaminFrozenlock: i intend to put a JS-based search on all the pages soon
13:16Glenjaminprobably with a shortcut key to focus it
13:16cbpoh?
13:16arrdemGlenjamin: if I had a way to map your user-agent string to your IRC handle I would totally support per-user customization
13:16Glenjamincbp: i haven't started yet
13:16Glenjaminbeyond raising the issue on github for discussion
13:17cbpluxbock: https://github.com/tomjakubowski/weasel#usage That works for me
13:17Glenjaminarrdem: JS can set cookies, that's probably good enough
13:17technomancyweird that the hamburger isn't considered a click target by hit-a-hint
13:17technomancyno idea what it uses as a heuristic
13:17Glenjaminoh wow, it's a label
13:18Frozenlockjoys of webdev
13:18arrdemthere's a reason I lurk in the compiler..
13:19Glenjaminbut yeah, JS powered site search is vaugely on my "i should add that" list
13:19Glenjaminbasically the cheatsheet's search, but on every page
13:19cbpoh
13:19cbpi was gonna do an autocomplete thing where you type clojure.string/join and press enter and switch to the page
13:20arrdemone possible "real answer" is to flatten this thing into a single page webapp so that rather than linking to another page, clicking a cheathseet link or entering a fully qualified var replaces the cheatsheet body with the symbol documentation body
13:20arrdemthen you only have to have "search" in one place because the whole thing becomes flat
13:20arrdembut idk how that'd play with my existing structure. probably badly.
13:20Glenjamini was gonna do https://twitter.github.io/typeahead.js/ + JSON list of all symbols
13:21Glenjaminor similar
13:21arrdemthat'd work.
13:21dnolen_jdkealy: sorry by minimal I really mean nothing but Om - maybe core.async if there's a weird interaction happening
13:21dnolen_no domina, sablono, etc
13:22jdkealygotcha
13:22luxbockcbp: at what point and with what address are you accessing the index.html file that has the goog.require script statements?
13:23cbpluxbock: i do lein repl. Type in the (require 'weasel..) and (cemerick.piggiback/..)
13:23cbpwhich turns it into a cljs repl
13:23cbpluxbock: then I make sure my cljs file has those 3 lines (ns my.cljs.core..) and (ws-repl/connect..)
13:24cbpluxbock: then I compile, make an html file with all the <scripts>, load that file in the browser and thats it
13:28jdkealydnolen_ can i use gdom to set the om/root ?
13:31luxbockhmm yeah it appears that this template is a bit mungled up
13:34puredanger hey all, just a friendly reminder that the CFP for the Conj is open till Aug 1st http://clojure-conj.org/call-for-proposals
13:34puredangercarry on with your awesomeness
13:34luxbockcbp: thank you for your patience
13:35luxbockI got it working
13:40jdkealysorry about that, dnolen_, now just using OM https://gist.github.com/jdkealy/14bc7181039ddef20367
13:48cbpluxbock: awesome
14:03zanesI’m trying to make a bunch of HTTP requests in parallel, process the results, and do an insertion into a database for each retrieved record. The tool I reached for for this was reducers, but the reducers documentation cautions against using reducers with operations that trigger I/O.
14:10arrdemwell crud clojure/conj conflicts with SC14..
14:10ludwig`zanes: reducers aren't intended for your goal.
14:10zanesludwig`: That’s the sense I’m getting.
14:11zanesludwig`: core.async? I saw a thread on the Google Group about this.
14:11ludwig`zanes: it depends on whether you have synchronization constraints
14:11zanesNo synchronization constraints.
14:11zanesBut I’m kind of interested in both answers.
14:12ludwig`it depends on what exactly you want to parallelize
14:12_alejandrozanes: I've used core.async for similar things, but there's still some trouble around I/O esp if you want to parallelize say thousands of request
14:12_alejandros
14:13zanesludwig`: I mean, all of the operations can be done in parallel. There needn’t be any synchronization at all.
14:13dnolen_jdkealy: what am I supposed to be looking for again?
14:14ludwig`zanes: are the results of the operation necessary to respond to the request?
14:15jdkealydnolen_: when you click on tab2 and go back to tab1, render-state does not pick up the (om/set-state) call in did-mount
14:15zanesludwig`: Yes. I’m retrieving JSON via HTTP, transforming the JSON a bit and then doing a database insertion.
14:15ludwig`zanes: ah ok, I misunderstood you the first time and thought you were working on a request handler
14:16ludwig`zanes: I'd just start a bunch of Threads
14:17ludwig`or, if you have all the responses, you could run a pmap for the transformations
14:18amalloyif these requests are all against the same server, launching thousands of requests against it in parallel could reasonably be characterized as an attack. you want to regulate things more than opening all the threads at once
14:18ludwig`amalloy: agree
14:18amalloyeven if they're different servers, thousands of requests at once will not be so great for your own machine
14:19dnolen_jdkealy: did you try implementing IUnmount to see if unmount is invoked?
14:20jdkealyno i did not. What would I do with that?
14:22zanesamalloy: Yes. I had imagined doing it in batches.
14:22amalloyzanes: you probably want a ThreadPoolExecutor
14:23jdkealyyes, i see unmount is called when you click on tab2
14:23trptcolinbbloom: do you have anything written up anywhere (or know of anyone else writing anything up) about why you don’t like the idea of doing something Rx-like on top of core.async, as you mention in https://github.com/brandonbloom/asyncx ?
14:24bbloomtrptcolin: you're like the third person to ask me about that in the past week :-P
14:24trptcolinlol
14:24bbloomthe summary of it is that i don't particularly think that linear async streams are that useful. most interesting async use cases involve multiplexing
14:24trptcolini’ve heard dnolen_ say similar stuff but couldn’t find references. just looking for concrete reasons other than “do not want” :)
14:25bbloomit makes it too easy to do stuff that isn't worth doing
14:25bbloomi just had an email thread w/ ztellman too, he's working on some new thing
14:25dnolen_jdkealy: just covering bases before actually spending time debugging this myself :)
14:26dnolen_jdkealy: does tab one get unmounted that's the real question
14:26jdkealyyes
14:26trptcolinbbloom: what distinguishes multiplexing from something like an Observable of Observables?
14:27bbloomtrptcolin: as i told ztellman, my experience w/ async stuff falls in to one of 3 buckets: GUI, single-machine services, and big distributed systems
14:27bbloomin the first case, i rather just have a global message pump instead of callbacks and/or pervasive async
14:27bbloomin the second case, i rather just have a few top level queues and some state machines each on a thread
14:27PigDudeok is somebody here actually working with core.async
14:27PigDudethe lack of tracebacks is crippling
14:27PigDudeor even error line numbers
14:27bbloomin the last case, i haven't ever felt a need for intraprocess asynchronity and parallelization, etc
14:28bbloomso i'm not the right guy to ask if you're interested in server use cases
14:28amalloyPigDude: you could fork core.async and remove the one line that's taking away your backtraces, until clojure/core gets around to fixing it for real
14:28bbloomor maybe i am, and the answer is "don't do that"
14:28PigDudea.malloy referred me to this as the source of the trouble https://github.com/clojure/core.async/commit/9fcae99576c0735a804bbd4cbec81307e2d34d90#diff-2193dd8597437d6454bb74edd2f15e00L26
14:28dnolen_jdkealy: you should also implement the will mount methods
14:28PigDudeamalloy: it just feels like a joke, isn't this killing people?
14:28PigDude(not literally)
14:28dnolen_jdkealy: this is how I would debug this
14:28PigDudei mean, is anybody using core.async, or do they just use a version before this was introduced?
14:29bbloomtrptcolin: about the observable of observables thing
14:29amalloymaybe core.async users are all amazingly good programmers who don't write bugs, and therefore never get exceptions
14:29bbloomtrptcolin: the stream abstraction is kinda insufficient for thinking about scheduling and resource consumption
14:29PigDudehaha
14:30bbloomtrptcolin: if you look at the .net rx stuff, you'll see tons of crazy shit about schedulers and things
14:30ToxicFrogPigDude: I'm using core.async and I don't recall seeing this issue at all
14:30ToxicFrogWhat version are you using? I'm on 0.1.301
14:30bbloomtrptcolin: http://www.introtorx.com/content/v1.0.10621.0/15_SchedulingAndThreading.html
14:31PigDudeToxicFrog: any exception in a go block/loop just shows the error message, like #<NullPointerException java.lang.NullPointerException>
14:31ToxicFrogWow, that's incredibly useless
14:31PigDudeToxicFrog: i'm on "0.1.303.0-886421-alpha"
14:31bbloomtrptcolin: maybe i'm just an old crumudgen, but i prefer a few top level loops w/ queues and shared state
14:31ToxicFrogPigDude: but I'm also not using go-blocks, I'm using true threads.
14:31PigDudeToxicFrog: i've gotten pretty far, considering. async log store working :)
14:31bbloomtrptcolin: also, talk to ztellman b/c he knows more about this shit than me :-P
14:31PigDudei'll try with your version maybe
14:31ztellmanhaha
14:31PigDudeis that the full version in your dependency?
14:32ToxicFrogPigDude: so if there's a problem specific to go-blocks, then I wouldn't be seeing it regardless.
14:32PigDudehm ok
14:32ToxicFrogPigDude: [org.clojure/core.async "0.1.301.0-deb34a-alpha"]
14:32ztellmanI agree with bbloom that multiplexing is a fundamental design consideration
14:32ztellmanas is the resource management that comes with it
14:33trptcolinthis is probably because i’m not experienced enough with it, but i guess i’m just not getting what about the Rx model disallows multiplexing & resource management
14:33ztellmantrptcolin: it doesn't disallow it, it just doesn't help much
14:33PigDudehey trptcolin it says on clojars you're the last guy to push core.async, do you know abotut his?
14:34PigDudeoh maybe this is just a bad search engine result that led to your fork
14:34amalloyPigDude: the official core.async release is not on clojars
14:34PigDudewhere would i find it?
14:34trptcolinok, so on the flip side: what is it about core.async that makes these easy
14:34amalloymaven central
14:34amalloyer
14:34amalloymaybe? i forget. they probably put it there
14:34PigDudeah, got it
14:34PigDudethanks amalloy
14:34bbloomtrptcolin: ztellman: one of my favorite microsoftisms is the "pit of success" coined by Rico Mariani
14:35bbloomthe idea is that you design stuff that makes you kinda fall in to the right approach
14:35bblooma good design with respect to this principal is one that makes the path of least resistance the correct one
14:35bbloomi feel that Rx doesn't meet that criteria
14:35technomancyI like that metaphor
14:35bbloomit makes it easy to do stuff that will be giant resource leaks and complexity bug farms
14:36technomancycompelled to correctness by gravity
14:36bbloomrighto
14:36bbloomRx makes the wrong things easy
14:36trptcolinPigDude: uh weird i don’t remember doing anything to core.async. must have been some bug i had to patch real quick before the new version came out.
14:36bbloomand doesn't make the right things simple
14:36bbloombut for that matter, i think core.async almost makes the right things too easy ;-)
14:37PigDudeprobably
14:37bbloomthat is, people use a lot more core async than they probably should
14:37PigDudethanks to amalloy's sleuthing i've got real-life error line numbers tracebacks, by using 0.1.262.0-151b23-alpha, released dec 9 2013
14:37bblooma giant graph of channels and goroutines is not much better than a big pile of callbacks
14:37amalloyhaha, you rolled back to an older snapshot?
14:37PigDudehaha yea
14:38bbloombest part of core.async is that you get 1) an emulation of threads and 2) multiplex-able channels
14:38ztellmanbbloom: isn't that just because the graph's opaque, though?
14:38PigDudeamalloy: professional: develop w/ this version, then make sure they pass w/ latest :)
14:38bbloomztellman: that's a big part of it, but not the only part
14:38bbloomthat opaque graph also contains local state
14:39ztellmanok, granted
14:39bbloomand of course http://awelonblue.wordpress.com/2012/10/21/local-state-is-poison/
14:39ztellmanha, haven't seen that before
14:39platzproblem comes when the "pit" is used beyond it's initial context. e.g. ActiveRecord/RoR
14:39bbloomand that includes the immutable values used as loop control variables too!
14:39Glenjamini always assumed the idea was to use go-blocks + channels to make erlang style processes
14:39platzsuccess can have disadvantages too
14:39ztellmanGlenjamin: erlang-style processes aren't the easiest thing to reason about
14:39Glenjaminyou send off a message to a little worker part of your app, and it sends you back some data later
14:40ztellmanand that's with orders of magnitude more tooling to help you understand them, too
14:40bblooma telling problem w/ actors is how hewett talks about "orgs" like human organizations, set up hierarchically
14:40bbloombut actor orgs have the same problems as human orgs: lack of transparency, redundancy, competition for resources, etc
14:41Glenjaminmakes sense
14:41bbloomthat's not to say it's a useless model
14:41platze.g. conway's law
14:41Glenjaminan efficient org has a few small teams that don't get in each other's way
14:41bbloomsometimes lots of stuff gets done despite large amounts of waste
14:41Glenjamini can see how that metaphor holds
14:41amalloyPigDude: well, i recommended instead forking the latest version and making the one change you need. now, if anything important has happened in the last half a year, you don't get those changes
14:41bbloomconway's law is so fucking true it's crazy
14:42hiredmanactors aren't closed under composition either, the lack of symmetry is sad
14:42bbloomhiredman: which properties are not closed under which composition operators?
14:42hiredmanbbloom: I mean, if you build a system out of actors, what you get is not an actor
14:43bbloomhiredman: i mean, it *can* be
14:44ztellmanbbloom: but that's fundamentally a more limited model, rigth?
14:44ztellmanright*
14:44hiredmanbbloom: I think that distiction leads to the tarpit
14:44bbloomztellman: which model is more limited?
14:44ztellmanan actor model where all systems of actors are an actor
14:44platzthis is part of the interest in the recent push of SOA (so-called microservices), actually it's more optimizing for the human factors rather than the technical ones
14:44bbloomztellman: i mean, if you buy in to hewitt's crazy idea, everything is actors all the time and actors are the only thing that actually represent all of computation
14:44PigDudeamalloy: yea, you're right, it's just another thing to do :\
14:44bbloomztellman: but he's crazy
14:45bbloomhe's also right, but not in a useful way :-P
14:45ztellmanok, it's been a while since I've read the original paper, but there is some concept of ordering, right?
14:45bbloomno
14:46ztellmaneven messages from a single actor?
14:46bbloomthe theoretical model only says that the message will get there in some unbounded finite time, where the probability of delivery follows some asymtotic probability or something like that
14:47bbloomno promise of ordering
14:47ztellmanoh, huh
14:47platzin akka we have 'or a given pair of actors, messages sent from the first to the second will not be received out-of-order'
14:47bbloomyeah, i think erlang promises order... (right?)
14:47ztellmanright, which also holds true in Erlang
14:47platzbut between any other two, no
14:47ztellmanso if you have a system of actors 'acting' as a single actor, that guarantee goes out the window
14:47ztellmanwhich is where I figured the composition broke down
14:48ztellmanbut I guess it depends on what definition of actor you use
14:48bbloomthe problem is that hewitt needs a student to sit over his shoulder and copy edit for him when he posts on the internet
14:49bbloomsomehow he has managed to piss off every single respected poster on lambda the ultimate :-P
14:49bbloomso if you try to read about the actual theoretical model, you just get angry at all the misinformation and confusion
14:49bbloomanyway, the wikipedia is pretty good: https://en.wikipedia.org/wiki/Actor_model
14:49bbloomalso, it's totally pointless to talk about, b/c we don't program turing machines, why should we program theoretical actor models?
14:50bbloomturns out promises, such as order, are useful
14:54reiddrapertbaldridge: back, you having any luck?
14:56PigDudeamalloy: done, that stuff is just a pain ... setting up git submodule, install in checkouts ...
14:56amalloyPigDude: gross, why would you do any of that? just clone it, change the groupid in project.clj, and deploy to clojars. like trptcolin did
14:57amalloyor maybe in pom.xml; i guess clojure/core stuff often has no project.clj
14:58PigDudeamalloy: i'd do that if i were working alone
15:07gfredericksman clojure sucks at SQL: https://www.refheap.com/88196
15:07wkellyhaha
15:08wkellythis is where we need some reader macros
15:08stuartsierraPigDude: you can always find latest releases of org.clojure projects on http://search.maven.org/
15:08gfredericksreader macros that query your database
15:08wkellyexactly. what could possibly go wrong?
15:09gfredericksclojurebot: what |could| possibly go wrong
15:09clojurebotIn Ordnung
15:10MC-Escherichiaamalloy is that a courtesy thing...for example I use lein idefiles to hide clojure from my java colleagues
15:10arrdemclearly java.lang.String should be IFn and when applied execute as an SQL query against *connection*.
15:10MC-Escherichiaand lein 2.4.0 broke it, the original author and technomancy haven't sorted it out yet, so I forked and patched in a different way than the author wants
15:11MC-Escherichiaso now I tell my colleagues clone my version of lein idefiles, lein install, and then we're good
15:11gfredericksarrdem: plz make a jira ticket
15:13arrdemgfredericks: naw man lets just hard fork clojure it'll be great
15:13PigDudethanks stuartsierra
15:14amalloynext april fools day joke: everyone in #clojure opens a new jira ticket asking for java.util.regex.Pattern to be IFn
15:14stuartsierraOh please no.
15:14trptcolinput them in https://github.com/clojure/clojure/pulls
15:14arrdemstuartsierra: it's on the official todo list :P
15:15trptcolin;)
15:15stuartsierraDo you have any idea how hard it is to search JIRA?
15:15nobodyzzzIFn all the things!!1
15:15ivana few days ago I was tempted to fork Clojure for literal strings / pretty-printed byte arrays / \xNN in strings
15:16stuartsierraYou could get pretty-printed byte arrays by overridding print-method, I think.
15:16amalloyivan: that has got to be the second-worst reason for forking clojure i've ever heard of
15:16PigDudeivan: pp byte arrays would be nice
15:16puredangerstuartsierra: I just committed all of them to memory
15:16ivanstuartsierra: yeah, but what would you print them as? (.getBytes "awful string with \u escapes")?
15:17amalloyivan: hex, of course. not strings
15:17stuartsierraivan: I dunno, you're the one who wanted it. :)
15:17ivanamalloy: well, that would be spectacularly useless for humans
15:17ivanworking at the REPL
15:17PigDudeerlang does a good job w/ <<>>
15:17stuartsierra,(seq (byte-array [1 2 3 4]))
15:17PigDude(soemtimes)
15:17clojurebot(1 2 3 4)
15:18amalloyuhhhh. i'm now convinced your idea is even worse, if you wanted to print as anything but hex, or possibly as a sequence of numbers from -128 to 127
15:18PigDudeand sometimes it just spits numbers at you
15:18amalloyattempting to interpret byte[] as a string as the default behavior is awful
15:19PigDudeit was a big problem w/ large binary data in erlang logs but i think lager fix this
15:19stuartsierra,(apply str (map #(format "%z" %) (.getBytes "hello")))
15:19clojurebot#<UnknownFormatConversionException java.util.UnknownFormatConversionException: Conversion = 'z'>
15:19stuartsierra(apply str (map irc://chat.freenode.net:6667/#(format "%x" %) (.getBytes "hello")))
15:19stuartsierradammit!
15:20amalloystuartsierra: i think that would print poorly for characters needing more than 7 bits
15:20trptcolinCLJ-1454: symbols starting with an HTTP protocol should implement IFn
15:21trptcolindammit i ruined that one s/HTTP/some-kind-of/
15:21trptcolinoh also that 1454 is a real ticket
15:23amalloyoh, interesting. i assumed %x would upcast to integer, but i guess it doesn't. that's what i get for assuming java is c
15:26stuartsierra,(clojure.string/join " " (map #(format "%x" %) (.getBytes "hello\uffff")))
15:26clojurebot"68 65 6c 6c 6f ef bf bf"
15:27stuartsierraWelcome to UTF-16.
15:27arrdemUTF-23 only please
15:28gfredericks23 bits ought to be enough for anyone.
15:29arrdem16 + 5 for tag + 2 for GC amirite?
15:29andyfPerl is pretty interesting with its strings - you can treat then as if they are arrays of Unicode chars, 1 index per Unicode char, but they store them as UTF8 to save memory (I think)
15:29gfredericksif your string encoding doesn't contain GC flags you're doing it wrong
15:30andyfMust make some of their implementation code interesting
15:34TimMcztellman: Basic iterator testing: https://github.com/timmc/collection-check/compare/iterators?expand=1 -- already found a bug. :-P
15:34TimMcI can't get it to do an informative fail for some reason, though.
15:34tbaldridgeandyf: there was something I was reading the other day that showed that scanning a UTF-8 string on modern processors is actually very fast
15:35gfredericks"look I hit enter and it was done immediately"
15:38tbaldridgehere we go, strlen utf8 optimization http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html
15:41arrdemnice!
15:43augustlsorta off topic.. Any graph processing libraries and/or databases around? Only one I know about is neo4j, but I don't need disk durability, in memory processing is enough
15:43augustland I don't mind interop ;)
15:43arrdemaugustl: loom is pretty good.. there are some others
15:43augustlarrdem: looking it up, tnx :)
15:44augustlarrdem: hmm, got a link? I get all sorts of hits on google
15:45arrdemhttps://github.com/aysylu/loom
15:46arrdemit's the "obvious" DG implementation using Clojure maps that you'd build if you just sat down and started hacking. more than fast enough for everything I've thrown it at, some of which was pretty big.
15:46puredangerhttps://www.youtube.com/watch?v=wEEutxTYQQU
15:54mthvedtwhat’s the difference between coll-reduce and internal-reduce
15:55augustlarrdem: I need some very specific graph, uhm, "thingies" :)
15:56augustlsuch as finding everything that moves the same direction in a group of paths within the next 30 minutes, and what not
15:57magopianwhen doing some web development, if you need a database (say postgres, h2, ...), I see that you can use Korma, but how do you create the schemas? I mean, create the tables and all?
15:58magopianshould you resort to using clojure.java.jdbc as I saw in the luminus example?
15:58augustlmagopian: for schemas I've used liquibase for a long time, for clojure apps as well
15:58augustlI don't mind the xml, it's just pointy lisp after all
15:59augustlarrdem: tnx for the link btw :)
16:00bbloomaugustl: with a weird attribute/element dichotomy and all sorts of strange rules about text nodes, but yeah, juuuust a pointy lisp :-/
16:00augustldifficult to google for graph processing libs, most of the results are about drawing graphs, not querying them :)
16:00magopianaugustl: ok, i see
16:00bbloomsuch that you may trip and impale yourself
16:01MC-Escherichiamagopian there's a library called lobos that I used once to write a simple SQL schema
16:02magopianMC-Escherichia: thanks, i'll read on that too
16:02augustlI should probably just suck it up and use neo4j
16:06insamniacAny of you nerds going to DEF CON?
16:07arrdemdid last year, 5/5 would recommend but not going this year
16:07kristian-augustl: http://titanium.clojurewerkz.org
16:07insamniacarrdem: Did you stay at the Rio or wherever it was hosted last year?
16:08arrdeminsamniac: rio or go home
16:08insamniacthere is no room at the inn
16:08xk05aint that just the way? soon as i decide my rdf application wants to be in org i come across serious discussion and code examples for clojure
16:09puredangermthvedt: their protocols are defined https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/protocols.clj#L13 but I believe internal-reduce is not used anymore
16:10cljbeginnerHey, I'm having trouble getting the quoting/unquoting of a macro right. I've tried to reduce it to the simplest possible case
16:10xk05if Fredric Giasson lurks here, Thanks for the article, very instructive
16:10cljbeginnerThe form would be (test = (person "name") "bob"), where this macro returns a function that takes one argument
16:11cljbeginnerI want person to have the value of this argument
16:11augustlkristian-: :D tnx
16:13cljbeginnerI tried something like this http://pastebin.com/nUK4NeM5 but obviously item gets namespace qualified
16:15augustlcljbeginner: so you want to rewrite (test = (person "name") "bob") to (= (person "name") "bob")?
16:16augustlif you want op and body as separate args, you have to make sure body (which is basically args to op?) is treated as such
16:16augustlcljbeginner: for example, `(apply ~test ~@body)
16:16cljbeginner@augustl: I removed a bunch of other stuff happening there, but i want to rewrite (test = (person "name") "bob") to (fn [person] (= (person "name") "bob"))
16:17augustlcljbeginner: so tat means the 2nd argument to test has to be a list, and the first item in that list should be what's passed into the fn?
16:17cljbeginner@augustl: so that person is actually the arguments passed to the function, and I could say ((test = (person "name") bob) (hash-map "name" "bob"))
16:17augustlthis sounds like a job for #(= (% "name") "bob") to me :)
16:18augustlunless you want to do it for the exercise of writing a macro ofc
16:18cljbeginner@augustl: it is a little bit of an exercise, yeah - I want to use the syntax (person "name) to describe the attribute I'm accessing, but person isn't defined yet
16:19cljbeginner@augustl: I agree that your solution makes sense :) I'm trying to go through an exercise of creating a DSL
16:19augustlthe problem is the magic value "person" imo
16:19augustlthe macro would either have to be very specific about its args, or hardcode 'person'
16:19augustlthat's why the #() macro uses %
16:20augustlwriting a macro for ((test = (% "name") "bob") {"name" "bob"}) probably makes more sense
16:20hiredmantbaldridge: "while giving a wonderful example of using a goto to jump from the middle of one loop into the middle of another:" lol
16:21tbaldridge?
16:21hiredmantbaldridge: from the utf8 link
16:21augustlcljbeginner: or create a binding with something like (test [person] = (person "name") "bob")
16:21tbaldridgelol yeah
16:21ucbso apparently you can conj onto a map and get a map back: https://gist.github.com/ulises/ffb0895335ab04af1a1a
16:21augustlcljbeginner: but then you're dangerously close to (#(= (% "name") "bob") {"name" "bob"}) ofc :)
16:22cljbeginner@augustl: correct
16:23Frozenlockucb: It acts like 'merge'?
16:23ucbFrozenlock: apparently so
16:24ucbthough I suspect there are differences I have not explored yet
16:24Frozenlockucb: Yeah, I was suspecting the same, but I made some tests in my repl and they seem identical.
16:24FrozenlockWhich brings the question 'whyyyyyy?'
16:25puredangerconj = "add an element to a collection in whatever way is natural for the collection"
16:25puredangerwith maps, an "element" is a key-value pair
16:25Frozenlockpuredanger: I understand that, but why do we have merge then?
16:26hiredman,(conj {} {:a 1})
16:26puredangermerge is map-specific so handles a nil coll better
16:26clojurebot{:a 1}
16:27puredanger,(merge nil {:a 1})
16:27clojurebot{:a 1}
16:27puredanger,(conj nil {:a 1})
16:27clojurebot({:a 1})
16:28FrozenlockAh nil, always ruining my day.
16:30puredangermight be a perf difference too. merge uses reduce which may be faster than the loop/recur in conj. but I would not wager on that without a test.
16:31augustl,(conj {} [:a 1])
16:31clojurebot{:a 1}
16:31augustloh hey
16:32Frozenlock,(merge {} [:a 1])
16:32augustlconvenient in some cases :)
16:32clojurebot{:a 1}
16:32augustlah, well there you go
16:35gfredericks,(merge nil [:a 1])
16:35clojurebot{:a 1}
16:36gfredericks,(merge [:a 1] nil)
16:36clojurebot[:a 1 nil]
16:36gill_arrdem: loom has an a* test, that's a cool library. maybe I can use that for AI pathfinding in a game :)
16:47TimMcreiddraper: simple-check is sneaky and mean. Thanks!
16:48reiddraperTimMc: ha, i might co-opt that tagline!
16:52bars0Hi all. I try to make use of lein-exec plugin on windows 7 but I encounter something strange. I have lein-exec plugin entry in my ~/.lein/profiles.clj. When I fire up command prompt and type `lein` I see `exec` entry. But when I change direcotry and repeat lein command, `exec` entry is missing. What is going on?
16:53TEttingerwhere were you running lein before, when you could see it?
16:53bars0TEttinger: My HOME directory
16:53technomancybars0: what are you using lein-exec for?
16:54TEttingeris there a project.clj there?
16:54amalloyTimMc: :.hasNext? are you a monster?
16:54technomancyit's mostly-redundant afaik
16:54bars0TEttinger: no
16:54bars0technomancy: actually I wanted just try it :)
16:55technomancybars0: you should be able to just use lein run
16:58gfredericksTimMc: it's mean?
16:58technomancydoes it make fun of you when you make mistakes?
16:58technomancylike that sudo hack where you can get it to call you names if you get the wrong password?
16:58gfredericksTimMc: also simple-check is old hat; all the cool kids have moved on to test.check, which has better beer
16:59technomancygfredericks: whatever, test.check is too mainstream
16:59bob2or slay killing all your processes if you forget to run it as root
16:59nullptrpfft, i used quickcheck before it was cool
17:00gfrederickstechnomancy: it has its own package manager and a super active community and three different syntax highlighting plugins for light-table
17:00bars0TEttinger: yes, you were right I double check directory where I wanted run clj file and I found project.clj in there... Sorry, I'm a dummy and I am learning the tooling.
17:01amalloyalso, TimMc, you should typehint this stuff to avoid reflection. not because of performance, but because of privacy and accessibility. for example, this should throw an IllegalAccessError if you try to test (.iterator (.entrySet (java.util.HashMap. {1 2})))
17:02TimMcamalloy: Just following orders^Wexisting code conventions.
17:03amalloyTimMc: huh?
17:03TimMcre: :.hasNext
17:03amalloywhat existing convention is that?
17:04TimMcStuff elsewhere in collection-check. :conj! and the like.
17:04amalloythere's no :. anywhere. i'd expect :hasNext
17:05TimMc*shrug* It's a keyword version of the symbol normally found at the head.
17:05TimMcI think there are way bigger things to complain about in that code. :-P
17:06amalloywell, i did! reflection
17:07TimMcYeah, can you expand on that a bit?
17:08amalloyTimMc: you can't use reflection to work with non-public classes, even to call their public methods
17:09TimMcAh, OK.
17:09amalloy(.iterator (.entrySet (java.util.HashMap. {1 2}))) returns a java.util.HashMap$EntryIterator, which is a private class
17:09amalloyso you have to hint it as ^Iterator in order to call things on it, via its public interface
17:09TimMc,(.next (.iterator (.entrySet (java.util.HashMap. {1 2}))))
17:09clojurebot#<Entry 1=2>
17:09TimMc,(.next (identity (.iterator (.entrySet (java.util.HashMap. {1 2})))))
17:09clojurebot#<Entry 1=2>
17:09amalloyhm
17:10amalloyafaik that shouldn't work. i wonder why it does
17:10zaneshttps://github.com/halgari/clojure-conj-2013-core.async-examples/blob/master/src/clojure_conj_talk/core.clj#L361...L368
17:10zanesIs doall necessary there?
17:11hiredmanamalloy: I think it is if the class the method comes from isn't public or something
17:12hiredmanzanes: it is complicated, but basically yes, if you want the http-gets to be run in parallel
17:12zanesCan you help me understand why?
17:13hiredmanzanes: for is lazy, so the result is computed as needed, in this case the result happens to kick off some other computations
17:13hiredmanif you don't force it all, you end up forcing one at a time
17:13zanesI guess I kind of assumed merge had an implicit doall, but that doesn’t make sense.
17:14tbaldridgezanes: merge may force it, it may not I don't know, I just found it easier to put the doall in there and not worry about it
17:14zanesCool.
17:15tbaldridgezanes: more correctly merge uses alts! and that would most likely force it. But I would hate for this code to break if the definition of merge changes
17:15zanesRight on. Better to be explicit!
17:15hiredmanand technically, I think range produces a chunked seq, and for respects chunking, so you'll 32 at a time instead of one at a time, but it is best to try and pretend that train wreck doesn't exist
17:16tbaldridge(inc hiredman)
17:16lazybot⇒ 50
17:16gfredericksclojurebot: chunked seqs |are| sunked cheeks
17:16clojurebotOk.
17:19amalloyhiredman: right, but java.util.HashMap$EntryIterator is indeed private
17:20hiredmanamalloy: but the iterator method is declared in some public class/interface no?
17:21hiredmanwe could be talking about different things
17:21amalloywe might be. i'm thinking that what TimMc is doing should be roughly equivalent to http://stackoverflow.com/questions/5184284/illegalaccessexception-on-using-reflection, and not work
17:22hiredmansomething like http://dev.clojure.org/jira/browse/CLJ-1243
17:23hiredmanoh, you are talking about reflection in general then, not clojure's reflector
17:23amalloyso for example, https://www.refheap.com/6a4cdda1e4b3c5a927bb89d60 doesn't work, and i don't know what clojure's reflector does that seems to get around that
17:23puredangerhiredman: stuartsierra loves that ticket
17:24hiredmanpuredanger: like, he has a shrine too it in his locker and the cognocave?
17:24puredangerhiredman: exactly
17:25hiredmanit is an odd one
17:25amalloyi guess it has a special case to avoid this issue. it checks to see if you're falling into exactly this case, and then looks around for public interfaces or superclasses it can use instead
17:25puredangerbut the summary is that Java doesn't even tell you useful stuff in this case because generic bridge methods are blech
17:26hiredman:/
17:27puredangergeneric bridge methods are the bucket under the leaking abstraction of generics
17:28tbaldridgegenerics, the one thing that .NET does so much better.
17:29bob2because it doesn't erase?
17:30tbaldridgebob2: yeah
17:31FrozenlockIs there an official way to take a spot in the :session ring request?
17:31Frozenlock:my-lib-name ?
17:31puredangerFrozenlock: namespaced keyword?
17:31tbaldridgeFrozenlock: perhaps even consider namespaced keywords
17:31tbaldridge,::foo
17:31clojurebot:sandbox/foo
17:31amalloyFrozenlock: assert your dominance by removing everything else in the :session
17:32martinklepschare there any graph databases that are easy to understand coming from a sql/nosql background that are also great to use from clojure?
17:32tbaldridgeamalloy: bad idea, instead replace it with randomly generated data
17:32Frozenlockpuredanger, tbaldridge : Sounds perfect, thanks!
17:32Frozenlockamalloy: Right? As an alpha male, I should just (assoc :session my-stuff) every time!
17:35zanesI don’t suppose there’s a core.async-based interface to java.jdbc?
17:35tbaldridgejava.jdbc isn't async is it?
17:36puredangerno
17:36puredangerexcept for the kind of weird case of reading blobs and clobs, stuff like that
17:37nobodyzzzShould I know "Java stack" well to be a good clojure programmer?
17:38brehautnobodyzzz: initally you dont need to, but in the long term, learning some portions of it will be useful (IO, concurrency lib)
17:38puredangernobodyzzz: it is useful to know certain parts of the standard library (java.lang, java.util, java.io) and to have a general understanding of things like the classpath
17:38zanestbaldridge: I suppose not? I’m trying to understand how exactly :result-set-fm works.
17:39Jaoodnobodyzzz: to be practical I would say yes, this tutorial has all you need: http://docs.oracle.com/javase/tutorial/index.html
17:41nobodyzzzugh, there are a lot of tutorial =)
17:41nobodyzzz*tutorials
17:41Jaoodnobodyzzz: you don't need most of it
17:42arrdemnobodyzzz: you can write working clojure without knowing Java, but much of Clojure's value comes from being able to interact nicely with Java
17:42nobodyzzzso I guess I should get a copy of "The Java Tutorial" and try to force myself read it?
17:42Jaoodnobodyzzz: read learing the language, the essentials clases and collections part
17:43hiredmanI doubt it covers the useful bits
17:44hiredmanthis is a java language variable, this is how you declare it, this is how you set it, this is how you set it again, here is an array, etc etc etc
17:44technomancynobodyzzz: know where to look when you need to; don't start with java material
17:44puredangernobodyzzz: just go do Clojure. If you run into a Java question, come back here. :)
17:44amalloyi wonder how well it would work to start out by assuming that java is exactly like python (or c#, or whatever language you happen to already know), and then just filling in the gaps in that "knowledge" as they come up
17:45amalloythen you only end up learning things that matter to you as a clojure programmer
17:45Jaoodamalloy: java is easy to learn if you know oop and some Cish syntax
17:46amalloyokay, but the point is, why would you? you don't need to know anything about java; you need to know about the jvm and the classes included in the jre
17:46nobodyzzzyeah java is easy but toooo verbose. imo
17:46technomancyamalloy: it's just like you're in a new house and the silverware is in a different drawer
17:46hiredmanwatch as I use generics to remove the need to insert casts everywhere!
17:47puredangertechnomancy: and you're wearing giant foam hands
17:47hiredmangawk in wonder as I capture a (final) variable in an inner class
17:47technomancypuredanger: hah, that's if you're writing java; I meant just the jdk IO classes
17:47amalloy(inc hiredman)
17:47lazybot⇒ 51
17:48puredangertechnomancy: ah, yes :) actually now it seems like what I want is split between .io and .nio is fairly arbitrary ways
17:48puredangerI assume .nnio is up next
17:49technomancyn2io, n3io, etc
17:49Jaoodamalloy: sure, he doesn't need how to "write" Java but instead how to read it well
17:49hiredmanmio
17:49TimMcreiddraper: Ever seen generative testing of HTTP APIs?
17:49puredangerTimMc: I've done that for testing a clojure lib wrapping an access lib
17:49reiddraperTimMc: yep!
17:49Jaoodnobodyzzz: don't write any java just learn how to read it
17:50reiddraperTimMc: not sure it's anything public, but quite a few folks i know have done it
17:50hiredmangaze captivated in to your teletype as I iterate over the contents of an array and am unable to iterate past the bounds of the array!
17:50TimMcHmm. Well, if we end up doing it, I'll make sure to try real hard to make it open-sourceable!
17:51TimMcpuredanger: Anything public?
17:51brehautamalloy: knowing how java does overload mangling to jvm methods is probably useful for clojure programmers too
17:51puredangerTimMc: nope, sorry.
17:52TimMcI'm thinking of making our server accept pathod specs as headers so we can mock out backend/gateway calls to other servers fron the front end.
17:52amalloybrehaut: sure. obviously you need to know some things. i was just proposing that it would be interesting to start from "java is exactly like [language x]" and refine that understanding gradually as flaws appear, rather than starting from "i know nothing about java" and having to learn everything whether or not it's relevant
17:52hiredmantry and contain your gasps of disbelief as I continue to use memory without bothering to free it once I am finished with it!
17:52TimMcI'd like to be able to write invariants against the entire request + backend responses vs. response.
17:54technomancyhiredman: http://wifflegif.com/gifs/4326-the-hunchback-of-notre-dame-gif
17:54hiredmantechnomancy: perfect
17:56martinklepschdoes "embedded Datomic Datalog" in Datomic free mean it's persistent?
17:57hiredmanmartinklepsch: I think they mean you can use the datalog to reason over in memory values
17:57hiredmanmartinklepsch: but persistence requires a transactor, which you don't have when "embedded"
17:57martinklepschhiredman, so datomic free is memory only?
17:58hiredmanmartinklepsch: I don't think so
17:58puredangermartinklepsch: no, it is not memory only
17:58hiredmanmartinklepsch: I am pretty sure datomic free lets you run a transactor
17:58martinklepschI'm confusing things, sorry
18:00puredangermartinklepsch: in all of the Datomic editions, queries run in the "peer" (not the "transactor"). The peer is in *your app*, thus the datalog is "embedded" in your process.
18:01puredangerqueries always run in memory of your app
18:01martinklepschbasically I have a set of 4 mio records and I'm wondering if Datomic Free would allow me to manage/store that but I find it a bit hard to distinguish the editions
18:02puredangerwhat's a mil record?
18:02FrozenbotIs Datomic FOSS yet?
18:02martinklepschpuredanger, 4.000.000
18:03technomancytoo many editions, huh http://www.penny-arcade.com/comic/2007/02/02/
18:03amalloywe know that was you, Frozenlock. switching to Frozenbot to ask your question was a clever ploy, but we all saw through it
18:04Frozenlockgasp, my evil ploy was discovered
18:04Jaoodamalloy: how did you know? ;)
18:04technomancynot me, I have nick changes off
18:04hyPiRionme too.
18:04amalloytechnomancy: you'd have to turn off your whole brain to not guess who Frozenbot is
18:05technomancysorry what?
18:07puredangermartinklepsch: Free uses a lightweight db (H2) colocated in the transactor process. if you are storing serious data, you'll probably instead want to use Datomic Pro Starter (also no cost) which will let you use an external storage like Postgres, DynamoDB, Riak, etc
18:08martinklepschpuredanger, what means serious? could it lose data or are you refering to a lot of content
18:08puredangerjust size
18:10martinklepschpuredanger, is that somehow quantifiable? what is the bottleneck
18:10puredangerfor most uses, Datomic Pro Starter is a better choice than Free. there is a #datomic room btw if that makes more sense :)
18:11FrozenlockI'll just leave this here... "The freenode IRC network has some very specific goals and objectives, and it’s intended primarily for developers of free and open source software." :-p
18:11TimMchaha
18:12TimMcWe've got them now; they'll have to change the license to keep the channel!
18:12puredangermartinklepsch: Free uses an embedded lightweight database. With Pro Starter you can use Oracle, Postgres, Riak, etc for storage
18:12zanesAm I really barking up the wrong tree here?
18:12zaneshttps://gist.github.com/zane/304863e3f9157a4236ca
18:13FrozenlockTimMc: That, and Clojars!
18:14amalloyzanes: yes
18:14amalloyyou can only use <! and >! in the go scope; lambdas are separate functions
18:14martinklepschpuredanger, I understood that but I wonder what the consequences of that "lightweight database" are. Datomic Free seems easier to deploy right now (because I just drop it into my clojure app) so I'd like to understand if it might be enough for the stuff I'm doing
18:15Jaoodmartinklepsch: you should consult the docs of the DB storage in question then
18:15Jaoodnot datomic
18:15amalloyit's not really clear what you're trying to do, but core.async with result-set-fn is gonna be hard to get working together
18:16zanesamalloy: So, even though it’s the same lexical scope it’s not going to work?
18:16amalloyright. go can't look inside lambdas
18:16amalloyit's not all lexical
18:16zanesamalloy: I’m trying to feed the results of the query into a channel, and have the result set realized as the channel is consumed from.
18:16TimMcztellman, reiddraper: I think I'm just going to write a general-purpose behavioral equivalence testing lib based on test.check.
18:17martinklepschJaood, right but what's the storage in the Free edition from that list? http://docs.datomic.com/storage.html
18:19Jaoodmartinklepsch: whatever it is that comes bundle in the jdk, I think is derby
18:20TimMcThe extra features I need: 1) Massage return values to match (e.g. compare sorted values, not ordered seqs -- or ignore differences based on *which* exception was thrown)
18:20TimMc2) Compare things that don't actually behave the same way (e.g. mutable vs. persistent) by giving corresponding versions of operators.
18:20reiddraperTimMc: neat
18:21martinklepschJaood,I'll take this to #datomic
18:21amalloyi don't think there's any way you can make that work, zanes, or at least not any that will make you happy
18:21Jaoodmartinklepsch: I'm not sure but I don't think openjdk has a DB include, you need the one from oracle
18:21TimMc3) Maybe even try to automatically generate lists of operations based on reflection... :-D
18:22TimMc[fin]
18:22zanesamalloy: What’s the issue exactly?
18:22zanesamalloy: The next thing I tried was using core.async.lab/spool as the :result-set-fm.
18:22zanesI feel like there’s a gap in my understanding.
18:23martinklepschJaood: I find it somewhat frustrating that it's so hard to figure out what's the storage when using Datomic Free, shouldn't that be very clearly documented somewhere?
18:23zanesIs the connection is closed as soon as result-set-fn returns?
18:23amalloyzanes: yes, that's the whole idea of result-set-fn
18:23zanesGot it.
18:25amalloydatabase clients hate to keep server connections open any longer than necessary. if you *really* want to keep the result-set open indefinitely, there are probably things you could do
18:25amalloyfor example, like (fn [rows] (<!! (go (doseq [r rows] (>! c r)))))
18:26amalloybut that is probably super-fragile, like if something goes wrong you leak a database connection forever
18:30amalloyalso, as usual i have never written any core.async code so it may just be totally broken
18:34Jaoodmartinklepsch: probably, I guess its obvious for java programmers
18:52tjd_is there a more concise way to say: (if (= 1 (count x)) (first x) x) ? [x is always a vector or seq]
18:54amalloytjd_: i hope x is never (range)
18:55tjd_amalloy: hah. x is a vector from an upstream api. fully realized seq.
18:55amalloy(that is, you should be really careful with counting unknown sequences)
18:56amalloyanyway, there's no particularly nice way to write that. treating one-element vectors the same as non-vectors is kinda tacky, so it's not made super-easy
19:02scape_tjd_: maybe this:
19:02scape_,(let [x (range 5)] (if (rest x) x (first x)))
19:02clojurebot(0 1 2 3 4)
19:02amalloyscape_: (rest x) never returns falsey ever. you mean (next x)
19:03scape_,(let [x (range 1)] (if (rest x) x (first x)))
19:03clojurebot(0)
19:03scape_yes
19:03scape_true
19:03scape_:D
19:03amalloyyou also don't handle empty collections
19:03scape_he didn't specify that
19:03scape_always a realized seq
19:03amalloyhe compared (count x) with 1. 0 is not 1
19:04amalloyand [] is an empty collection, with count 0
19:05tjd_im going to hell for this: (reduce (comp flatten vector) x)
19:06tjd_,(let [x (range 1)] (reduce (comp flatten vector) x))
19:06clojurebot0
19:06tjd_,(let [x (range 5)] (reduce (comp flatten vector) x))
19:06clojurebot(0 1 2 3 4)
19:07tjd_but amalloy is right. i talked myself out of doing this in the first place.
19:07amalloytjd_: that's cute, although quite wrong if x contains any collections inside it
19:07amalloy~flatten
19:07clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
19:08amalloystill, a novel approach i would not have thought of, on account of it being evil
19:09scape_lol
19:09tjd_some men just want to watch the world burn
19:09Frozenlock(flatten the-world)
19:09scape_i found concat over flatten to be ideal
19:09tjd_i'll take that as a compliment, though.
19:10amalloy(reduce (comp (partial apply concat) list) x) probably works as well, without the issue of nested collections
19:10amalloy&(for [x '(() (1) (1 2 3))] (reduce (comp (partial apply concat) list) x))
19:10lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
19:10amalloywelp, guess not. whatever
19:11tjd_this problem is no longer just a snack, it's a meal
19:12scape_tjd_: just curious why do you want the one element itself if it's only length of 1 but seq otherwise?
19:14tjd_i'm querying an upstream product attribute database, it returns data like <property> <name>Title</name> <value>Apple iPad</value> </property>, but also multi-valued attributes in a terrible way like <property> <name>Networking Type</name> <value>WiFi</value> <value>Bluetooth</value> </property>
19:14tjd_it doesn't distinguish well between single and multi-valued attributes
19:14numbertenis there a core function for this? (fn [f g] (fn [x y] (f (g x y) y))) ?
19:14scape_oh okay
19:14tjd_scape_: ebay internal ickyness :{
19:15amalloytjd_: but the solution to that is to just always work with a seq
19:15tjd_amalloy: well, sort of. i want to present this data in a nicer format to an API caller. so i'd like to give them JSON like {"title": "Apple iPad"} not {"title": ["Apple iPad"]}
19:16tjd_of course there is no schema provided for this mess, so i'm stuck guessing what's multi-valued
19:16scape_I would try and work with values being in a seq, even if it's just one. if possible some how
19:17TEttinger&(for [x '(() (1) (1 2 3))] (reduce (partial apply concat) [x]))
19:17lazybot⇒ (() (1) (1 2 3))
19:17amalloynumberten: no
19:17TEttingerhm
19:17tjd_scape_: if you were an API consumer, would you prefer to consume seqs, like my example above?
19:17scape_since I work in clojure, yes :D
19:17amalloyi would much rather receive something that's always a seq than something that might be a seq
19:18amalloyif it might be a seq, i have to write the opposite of this stupid (= (count x) 1) function just to deal with it
19:18Frozenlockamalloy: But isn't he always only taking the first element?
19:18tjd_Frozenlock: only if it's a single-value seq
19:19Frozenlockugh
19:19tjd_yeah.
19:19scape_hah
19:19tjd_and there's the chance that upstream will mess with me and start sending stuff like [["iPad"]]
19:19tjd_in which case i'll quit and go live in a trailer in the woods
19:20amalloytjd_: ebay is providing you with a perfectly nice api, which is just a map of tagged sequences. don't make it gross by guessing at which things are really not sequences
19:20tjd_alright, i'll keep to seqs. consistency, i suppose.
19:20amalloynot unless you have a dtd or xsd or something promising it'll never have multiple instances of the same tag
19:21tjd_nope, no dtd
19:21tjd_back-of-the-napkin dtd
19:48ztellmanTimMc: I've thought about doing that for a while
19:49ztellman(he replied an eternity later)
19:49ztellmanI'm interested to see what you come up with
19:54twiceadaywould someone explain me if this
19:54twiceaday(= __ (filter #(> % 5) '(3 4 5 6 7)))
19:54twiceadayanswer to this
19:54twiceaday'(6 7)
19:55twiceadaycontains
19:55twiceaday' <- this character just so it isn't executed as function (or code) ?
19:55amalloywell, "just", but yes
19:58doritostainslein ring uberjar seems to be including ring/ring-devel from the dev profile. When I remove it everything works fine. Otherwise it tries to use ns_tracker, which fails somehow, as it’s not including tools.namespace which is also in the dev profile. Anyone have this problem before?
20:15twiceadayamalloy: is there any other reason for that ? '() ?
20:16scape_,(type '())
20:16clojurebotclojure.lang.PersistentList$EmptyList
20:16scape_,(type '(1))
20:16clojurebotclojure.lang.PersistentList
20:26ssutchhello!
20:27ssutchi have a pretty basic clojurescript/om question if anyone could help with that
20:28Frozenlock,anyone
20:28clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: anyone in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:29Frozenlock#anyone
20:29Frozenlockcmon bots
20:29Frozenlockssutch: Just ask your question
20:29amalloy~anyone
20:29clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
20:30amalloy~ask
20:30scape_fancy
20:30clojurebotThe Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.
20:30amalloy(depending on your personal taste)
20:30ssutchi may have gotten it (investigating cursors)
20:30brehautamalloy: depends if you are in #tcp or not i guess
20:30ssutchessentially i have to switch on some binary state in the global map
20:31ssutchand update the UI based on that (ie user logged in or out?)
20:31amalloybrehaut: i thought of a tcp counter-joke this morning
20:31amalloyfor use when someone tells you one of those terrible tcp jokes
20:31brehautamalloy: i cannot garuntee i will get it, but send it anyway
20:32amalloyafter the punchline, you stare blankly at them for a moment, and then say "ACK 0"
20:32scape_heh
20:32brehauthaha great
20:35amalloyit's harder to pronounce "FIN ACK", but you can try that too
20:40eraserhdIf I have evidence that filter-indexed is something I actually use, would I reopen http://dev.clojure.org/jira/browse/CLJ-670 for consideration or start a new ticket?
20:41joegallohope springs eternal
20:41ssutchsolved my problem by not overthinking it, thanks folks.
20:46amalloyeraserhd: i would not expect anything productive to happen from reopening that ticket or from opening another one which is a duplicate of it
20:47eraserhdNo?
20:49amalloyit was turned down 3 1/2 years ago, and everyone has seemed to do fine without it, so it's probably neither exciting to rich nor critical. and clojure 1.6 seems to include a focus on functions that treat only nil as falsey, eg some?, if-some, and so on
20:50amalloyespecially given that you can implement it yourself in like two lines, i don't know why it would be in core. plus, there's the problem that rich brought up: filter returns the original input item, not the result of (f x). what is the "original item", when f is called like (f 10 x)? if that returns true, what goes into the sequence? true? x? 10? [10 x]?
20:53vermaI am trying to reify an interface defined inside a class in Java, com.firebase.client.Transaction.Handler, not sure how to specify that in clojure com.firebase.client.Transaction.Handler says ClassNotFound,
20:54eraserhdHrmm
20:55eraserhdIt's strange, though. I've never found a safe place to use keep-*, does anyone use them?
20:55brehaut,(apropos 'keep)
20:55clojurebot(keep-indexed keep)
20:55brehautamalloy, eraserhd: sounds like a job for keep-indexed?
20:56brehaut[bloody lag]
20:56amalloybrehaut: he's claiming that keep-indexed is no good for him and he wants filter-indexed
20:56brehautamalloy: suspicious
20:58eraserhdThe semantics of keep seem hard for me to deal with. It maps and filters, but won't work with predicates.
20:58eraserhdI'm curious why they are there, which is why I was asking whether anyone uses them.
20:59amalloyeraserhd: a quick grep suggests i've used keep in three projects
20:59amalloythat's just the ones that i've cloned onto my most recent work desktop, though
20:59brehautive used keep a bunch althoguh i dont have anything handy to grep
21:00amalloyfor a more obvious example, it's used in clojurescript, to look up protocol implementations
21:00eraserhdI just realized keep is kind of like mapcat for onesies. That helps.
21:00amalloy(keep fast-path-protocols (something)), where fast-path-protocols returns the fast path protocols for some object, if any exists, and we're just looking for any such fast-path
21:02eraserhdSo what would be the idiomatic way to say, take the odd elements of a lazy sequence in a ->>?
21:02amalloy(->> xs (take-nth 2))
21:02amalloyand a (rest), depending on what you mean by "odd"
21:03eraserhdWow, did not understand what take-nth did.
21:04TEttinger(doc take-nth)
21:04clojurebot"([n coll]); Returns a lazy seq of every nth item in coll."
21:04eraserhdYeah, just saw.
21:04TEttingerhuh, how would you offset it
21:04TEttinger(->> (rest xs) (take-nth 2))
21:04TEttingerI guess
21:04scape_,(->> (range 6)(partition 2)(map #(second %)))
21:04clojurebot(1 3 5)
21:05FrozenlockAm I missing something here? Why not just use `odd?'?
21:05Frozenlock,(->> (range 10) (filter odd?))
21:05clojurebot(1 3 5 7 9)
21:05TEttinger(->> (rest (range 10)) (take-nth 2))
21:05TEttingerthe reason is for any seq
21:06TEttinger(->> (rest (map #(char (+ 64 %)) (range 26))) (take-nth 2))
21:06TEttinger##(->> (rest (map #(char (+ 64 %)) (range 26))) (take-nth 2))
21:06lazybot⇒ (\A \C \E \G \I \K \M \O \Q \S \U \W \Y)
21:06amalloyFrozenlock: "items in xs whose index is odd", not "items in xs which are odd"
21:06amalloyhe didn't ask very clearly; the context was implied from earlier questions
21:06FrozenlockAh, shame on me for not ready the backlog I suppose.
21:07Frozenlock"So what would be the idiomatic way to say, take the odd elements of a lazy sequence in a ->>?" Seemed like a direct question...
21:07Frozenlock*reading
21:13TimMcztellman: I've backed off somewhat from the idea of generating actions based on reflection. (I was starting to gibber slightly. Gibbering is a bad sign.)
21:17vermaA function signature like: (fn [root korks f & args]) will not match (f a b c)?
21:18amalloy~tias
21:18clojurebottias is try it and see
21:18verma,(fn [a & args]) 1)
21:18clojurebot#<sandbox$eval25$fn__26 sandbox$eval25$fn__26@1450a6c>
21:18amalloyc'mon, clojurebot, i know you have a more fun-sized factoid for that
21:18verma,((fn [a & args]) 1)
21:18clojurebotnil
21:18vermadafuq, why am I getting an exception here
21:19vermaok checking
21:20vermamy bad :P
23:00TimMcandyf: I did find one thing that iterator patch missed. Updating ticket.
23:01andyfExcellent!
23:07doritostainslein ring uberjar keeps adding ring-devel/reload even through ring-devel only appears in the dev profile. anyone else had this problem?
23:08amalloydoritostains: lein ring is a separate task from lein uberjar. it does not run in the uberjar profile
23:09technomancyamalloy: I think lein-ring has an uberjar subtask
23:09amalloyyou could try lein with-profile uberjar ring uberjar, i suppose, although i'm not sure how well that would work
23:09technomancydoritostains: I would just get rid of lein-ring though
23:09amalloytechnomancy: right, but does it run in lein's uberjar context?
23:09technomancyit's full of weird little quirks like this that are difficult to debug
23:09technomancyamalloy: it might. old versions wouldn't though.
23:12amalloyyeah. i was guessing he has a version that doesn't, since it apparently is in fact including dev
23:13doritostainstechnomancy, amalloy: thanks, I was about to give up on lein-ring so I’ll go ahead and do that
23:13doritostainsamalloy: what’s weird is that it’s only including ring-devel, nothing else from dev. If i remove ring-devel from dev everything works fine