#clojure logs

2013-11-05

02:10luxbockis it possible to have clojure-mode syntax-highlighting available in the nrepl/cider buffer?
02:43makkalothi, i'm trying austin with clojurescript on emacs (newbie) , the C-c C-k doesn't work anymore, any ideas ?
03:15dmi3yhi, guys. I'm building a simple rest api in ring and compojure. For some reason my get handler that returns json returns it with header "application/octet-stream;charset=ISO-8859-1" while I'm expecting it to be "application/json". I'm using (wrap-json-response) as middleware. What am I missing here?
03:21ZujkisNxHi, I'm trying to start JAR file which should be a server written in clojure with all dependencies.. but no luck starting it in linux. I'm noob so maybe anyone could tell me how to do it?.. googling for a few hours and still havent figured it out.. :/
03:21dmi3yI got it, here's the explanation https://github.com/ring-clojure/ring-json
03:23ZujkisNxdmi3y: maybe you know how to run JAR as a server? :)
03:26dmi3y@ZujkisNx isn't it "lein ring uberjar" ?
03:27ZujkisNxdmi3y: ty, now trying lein uberjar. :)
03:51ZujkisNxI'm trying to run server.jar with "java -jar server.jar" and getting error: "Could not bind to port: 61221".. Any hints? :)
03:57beppuZujkisNx: Type this in your shell: lsof -i :61221
03:57beppuIt will tell you what process bound that port.
04:10ZujkisNxbeppu: thx! :) You're great! Good luck!
04:14beppuZujkisNx: glad I could help.
04:14beppu:)
04:32smilerAny idea on howto debug the cljsbuild repl-listen thingy? I get the iframe loaded into my DOM but the repl is unresponsive, (+ 1 1) just stalls the repl.
04:41beppusmiler: I wish I knew. That happens to me a lot. Sometimes, I get lucky and it works, but who knows why.
04:42smilerI had it working then it just didn't work anymore..
04:42beppui know that feeling
04:43smilerNo idea what I might have done to break it.
04:43smilerOnly thing my app is doing is a .log js/console call :)
04:45ShawnMcCoolwhat's the preferred ide/editor for clojure in linux?
04:45ShawnMcCooli'm assuming vim, if so what plugin is hot right now?
04:46beppusmiler, I got lucky and the cljs repl magically worked when I just tried it. I'm using dnolen's mies lein template to get started. http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/
04:46ucbShawnMcCool: it varies. Emacs has very good support and so does Eclipse afaik
04:47smilerbeppu: I use something similar. I'll try create a new project.
04:48ShawnMcCoolso, emacs is sorta hot in the clojure world then?
04:49beppusmiler, lein new mies wtf; cd wtf; lein trampoline cljsbuild repl-listen; thttpd -p 8888; open "http://localhost:8888/"
04:50beppuI think part of the trick is to don't open the page until repl-listen is ready to do work.
04:50beppu(replace thttpd with the local web server of your choice)
04:53smilerbeppu: No build step? And the default code dosen't have any (repl/connect) in it
04:53beppuactually, i forgot the build step. sorry about that.
04:54smiler:)
04:55beppuunfortunately, i was not so lucky this time. the cljs repl seems like such a cool thing, but I can't get it to work every time. :-/
04:55smilerDidn't work for me either.
04:58smilerHmm
04:59beppusmiler: dude, I'm an idiot.
04:59smilerIt works when I use firefox instead of chrome ;/
04:59beppuI actually added some code.
04:59beppuoh?
04:59beppuMaybe I should try ff, too.
04:59beppusmiler: https://gist.github.com/anonymous/7316593
05:00smilerYea, exactly..
05:01beppusmiler: oh wow, ff worked on the first try. weird, but good to know.
05:02smilerThat's an annoyance for sure..
05:02beppuI've grown accustomed to chrome's debugging tools.
05:02smilerDito
05:06clgv$last ztellman
05:06smilerI can execute (+ 1 1) while having a chrome window open and it stalls. Then pointing a firefox instance to the same place makes the evaluation complete.
05:06lazybotCouldn't find that user.
05:06clgv$last zachtellman
05:06lazybotCouldn't find that user.
05:06clgv$last tellman
05:06lazybottellman last listened to: Journey - Any Way You Want It [Greatest Hits]
05:06clgvup
05:07clgv$when tellman
05:08clgv$seen tellman
05:08lazybotI have never seen tellman.
05:08clgv$seen ztellman
05:08lazybotztellman was last seen quitting 5 hours and 21 minutes ago.
05:08beppusmiler, The way Chrome sends the long-polling HTTP request to localhost:9000 must be different from the way FF is doing it.
05:09smilerSounds reasonable
05:09beppuNot in the mood to debug that one. too noob at the moment at this cljs business.
05:09smilerThe repl is a part of cljsbuild, not clojurescript itself right?
05:09beppuI believe so.
05:10beppusmiler: https://github.com/emezeske/lein-cljsbuild/blob/master/plugin/src/leiningen/cljsbuild.clj#L152-L161
05:11smilerRight
05:15beppuhttps://github.com/emezeske/lein-cljsbuild/blob/master/support/src/cljsbuild/repl/listen.clj
05:16beppu(surprisingly small)
05:17smilerhttps://github.com/clojure/clojurescript/blob/master/src/clj/cljs/repl/browser.clj is the meat I think
05:18beppulooks like it.
05:23smilerI tossed up an issue at https://github.com/emezeske/lein-cljsbuild/issues/262. Maybe someone can shed some light on it.
05:26andrewmcveigh|woSay I have some clojure/edn config datastructure(s) on the server (ring/etc.), and I want the client (cljs) to be able to read it on load. What is the best way to do this? Embed edn as string in a js var? json? some other way?
05:27beppusmiler: I just came across this: https://github.com/cemerick/austin
05:27beppualternative browser repl
05:28andrewmcveigh|wosmiler: beppu: I've had better luck with austin's browser repl.
05:28smilerI'll give it a shot
05:31beppu( going to sleep now. good luck, smiler )
05:31smilerNight night
05:46sritchiesmiler: made one comment
05:46sritchiesmiler: I can get a connection by manually doing the connect at the console
05:46sritchiealways works...
05:46sritchiebut not on reload, always
05:46sritchiereally weird
05:47smilerThanks, I'll check it out after lunch.
05:47sritchielunch! I'm off to bed here in pst :)
05:47sritchiesmiler: good luck, I'll keep an eye on the ticket
05:47smiler:) Take care
05:56ubikationI'm sorry, but can someone help me with this error? thank you!
06:14dav(let [b (cons 1 b)] (take 5 b)) <= self reference not working with let while it works fine with def. Is there a trick to resolve that?
06:17andyfingerhutdav: Maybe, but not that I can think of off hand. letfn is more like Scheme's letrec, but only for binding functions, not arbitrary values.
06:17davandyfingerhut: yes :(
06:17davletfn is mutual but let isn't :-(
06:18andyfingerhutFor the particular use case you show, cycle would create the infinite lazy sequence you specify
06:18davandyfingerhut: yes I know that I have a more complex use case in mind ;-)
06:19davon top of that i assume there's no sharing if I use letfn .. :(
06:19hyPiRionno sharing?
06:19andyfingerhutdav: Sounds like our knowledge of the possibilities in this area run out at about the same place, then :-)
06:21llasramdav: Also, self-referencing lazy sequences are not really supported, even though you can make them work with vars
06:22hyPiRion,(letfn [(my-odd? [a] (not (my-even? a))) (my-even? [a] (or (zero? a) (my-odd? (dec a))))] (map my-odd? (range 0 10)))
06:22clojurebot(false true false true false ...)
06:35ubikationI'm sorry, but can someone help me with this error? thank you! https://gist.github.com/ubikation/7317317
06:36andyfingerhutubikation: Are you using Leiningen to retrieve and manage dependencies?
06:37ubikationandyfingerhut: yes
06:38andyfingerhutIs it really spelled "ative" and not "active"? Adding project.clj to your gist might help others help you.
06:51honzai have a vector of functions and want to "unroll" it so i can use it in a (->) form - so i need something like (apply) but for macros - the documentation says however that (apply-macro) is evil
06:52andyfingerhuthonza: Maybe you want ((apply comp my-fn-vec) args) ?
06:53andyfingerhuthonza: Or something near that.
06:53honzaandyfingerhut: welp, that's perfect! thanks
07:05ubikationandyfingerhut: I am sure it should be ative
07:05ubikation(use 'dk.ative.docjure.spreadsheet)
07:05ubikationand I changed my workspace in the cider repl to the one I am working on but it still doesn't work...
07:05ubikationand lein deps doesn't complain or anything
07:06andyfingerhutubikation: Are you saying that (use 'dk.ative.docjure.spreadsheet) gives no errors in the same REPL session where the gist (ns ...) expression gives an error?
07:06smilercemerick: Hey. I followed your tip and tried out austin. I got the example to work but I fail to integrate it into my minimal app. I don't get anything injected to my DOM nor do I see any connections being made to the repl. Does it need to be used from jetty instead of using my already existant apache setup?
07:06ubikationno I get an error for both forms
07:06ubikationand my project.clj is here: https://gist.github.com/ubikation/7318107
07:07cemericksmiler: austin doesn't depend upon any particular web server. Are you seeing any errors, etc?
07:08smilercemerick: No, I just don't get any response. The app is the same as in the gist linked to the bug report except for a plugin dependency on [com.cemerick/austin "0.1.1"] and :require [clojure.browser.repl]. Do need to add anything else to inject the required JS?
07:09cemericksmiler: Yes. Did you read https://github.com/cemerick/austin/tree/master/browser-connected-repl-sample
07:09smilerThat's the thing I'm trying to follow
07:09cemericksmiler: well, there's more to it than changing the dep and adding a require :-)
07:10ubikationit's weird because the error just came out of nowhere... I had a working repl with it loaded a day or so ago and then it just quit working properly
07:11andyfingerhutubikation: I tried a new project with that project.clj here, and no errors on the use. Did you perhaps wipe out your local ~/.m2 repo?
07:11smilercemerick: Ah, the [:script (cemerick.austin.repls/browser-connected-repl-js)] part
07:11smilerHmm
07:12andyfingerhutubikation: e.g. do you see any files listed from output of a command like 'find ~/.m2 | grep docjure', assuming you are on a Unix-like OS?
07:12cemerickOr similar, depending on what you're using for templating, etc
07:12smilerNothing at all atm. I'm trying to make a client side thingy as I learn this.
07:13andyfingerhutChas! So this is the time of day I have to be on channel to see you talk live?
07:14ubikationyeah I just rm -rf'd my ~/.m2 and did lein deps again... same issue
07:14smilercemerick: I'm using some slides from a presentation I attened a while ago. That thing uses domina, I guess I can use that to inject the JS into the DOM somehow.
07:15andyfingerhutubikation: You saw it re-retrieve a bunch of stuff? Try 'lein clean', too, perhaps? If that doesn't do it, I'm close to stumped.
07:15cemericksmiler: sounds like you have a static HTML page?
07:15smilercemerick: Yep
07:15andyfingerhutubikation: What lein version?
07:15cemericksmiler: you can configure austin to use a fixed port number and session ID; though, you'll be limited to just one REPL at a time
07:16ubikationlein 2.3.3
07:17cemericksmiler: https://github.com/cemerick/austin/blob/master/src/clj/cemerick/austin.clj#L28
07:17ubikationwhat is the best way to test it outside of emacs? maybe I am doing something weird in cider since I don't really get it yet
07:17andyfingerhutubikation: lein repl
07:17cemericksmiler: You can use a particular session ID by providing the corresponding keyword argument to cemerick.austin/repl-env
07:18ubikationhuh
07:18ubikationwait (use '(dk.ative.docjure.spreadsheet)) works but (:use [dk.ative.docjure.spreadsheet]) doesn't?
07:19smilercemerick: That feels a bit ugly I think. Would it work to append the result from cemerick.austin.repls/browser-connected-repl-js into a script tag?
07:19andyfingerhutcould be. It is much more common to leave off the [] around namespaces in :use statements if there is just a single namespace.
07:20cemericksmiler: that's exactly what [:script (cemerick.austin.repls/browser-connected-repl-js)] does :-)
07:22andyfingerhutubikation: I think (use '(dk.ative.docjure.spreadsheet)) doesn't work. It just doesn't give an error
07:23ubikationandyfingerhut: I get "excel-test.core=> (use '(dk.ative.docjure.spreadsheet))
07:23ubikationnil
07:23ubikation"
07:24luxbockany ideas why I'm unable to start paredit (or any of the other modes) in the cider repl?
07:24luxbockhttps://gist.github.com/luxbock/d9ed7a4ccfed8cdf7875
07:24luxbockhere is my setup
07:24andyfingerhutubikation: me, too, but (apropos "she") afterwords returns no symbols, whereas it does if I do (use 'dk.ative.docjure.spreadsheet)
07:25andyfingerhutubikation: Hence my belief that the parens around the namespace in use are causing the use to do nothing, with no error
07:29andyfingerhutubikation: I'm looking at the source for load-libs, since I've edited it recently for a proposed Clojure patch with better error messages, and it does appear that (use '(dk.ative.docjure.spreadsheet)) does absolutely nothing with no error.
07:30andyfingerhutubikation: I included something as part of my patch to catch that with an error, I believe, but it was out of scope for the ticket. Guess it is time to file another ticket.
07:30smilercemerick: Cool. I should be able to inject it then.
07:33ubikationandyfingerhut: oh... that's weird. so what is use supposed to return? also, what form are you using to load it in the lein repl?
07:33andyfingerhutubikation: To do a successful load, (use 'dk.ative.docjure.spreadsheet)
07:34andyfingerhutubikation: I think use/require/ns always return nil, if they do not throw an exception
07:36ubikationandyfingerhut: what about turning it into a namespace declaration that works in the repl? right now I am trying "(ns excel-test.core (use [dk.ative.docjure.spreadsheet :refer :all]
07:36ubikation [clojure.core.match :only (match) :refer :all]))" to no avail
07:37andyfingerhutubikation: Definitely needs :use instead of use when inside ns
07:37glosoliIsn't use some sort of deprecated ?
07:37andyfingerhutubikation: But probably more changes. I don't dream correct ns syntax yet.
07:40andyfingerhutubikation: (ns excel-test.core (:use dk.ative.docjure.spreadsheet [clojure.core.match :only (match)])) seems to work
07:40andyfingerhutubikation: Not sure what you are trying to accomplish with the :only (match) :refer :all
07:43andyfingerhutubikation: Don't mean to be rude, but time for me to crawl back into bed for 2nd sleep.
07:45smilercemerick: Aw snap. Trying to inject it using domina seems to try inject it too late. JS execution has already failed because it can't find nameToPath in cemerick.austin.repls.
07:47cemericksmiler: there is no such var in that namespace?
07:49smilerMaybe I did something stupid.
07:51smilercemerick: I added a require to that ns but that was wrong. Maybe it isn't possible to access cemerick.austin.repls/browser-connected-repl-js from within my cljs-file?
07:52WWWestHi all
07:52WWWesta quick question on node js & cljs dev environment
07:53WWWestI'm using fireplace in vim. I tried using noderepl to start a repl for my project, but fireplace still can't use the repl
07:53cemericksmiler: no, that's a Clojure function
07:53smilerHmm
07:54WWWestis there a way to get a cljs repl that works with fireplace?
07:54cemericksmiler: The connect call really needs to be in the HTML file.
07:54smilerKinda sucks when I don't want server side generated code then :/
07:54clojurebotI don't understand.
07:55cemericksmiler: well, that's where the options to fix austin's port number and session ID come into play
07:55smilerYea. I'll try to figure that out.
07:56cemerickWWWest: Nope. vim-fireplace is Clojure-only; it sends require forms to load namespaces, which doesn't work in ClojureScript.
07:56WWWestwhat do people use when working with cljs then?
07:56cemerickI have a fork of fireplace that fixes this, but does much, much more. Unfortunately, it's in a somewhat busted state at the moment. :-P
07:57cemerickWWWest: leiningen? CCW? Emacs?
07:58WWWestwhat's ccw? nothing that works with vim then?
07:58ShawnMcCoolwhat is 'cons' short for?
07:58ShawnMcCoolconcatenate sequence or something maybe?
07:58vijaykiranconstruct
07:58WWWestconstruct maybe?
07:59ShawnMcCoolthanks
07:59cemerickWWWest: Counterclockwise. Eclipse plugin.
07:59WWWestyuck, no, I'll stick to vim without a repl connection for now
08:01WWWestI'll just follow progress on your fireplace fork
08:02cemerickWWWest: haven't been working on it for a while. Vim's architecture seems incompatible with my objectives. Was segfaulting all over the place.
08:03WWWestthat doesn't sound good...
08:03cemerickWWWest: actually, the last change to the fork "fixed" that by queuing all updates to the UI. https://github.com/cemerick/vim-fireplace/tree/async-python
08:04cemerickYields asynchronous REPLs, but they update at updatetime, not in real time.
08:05WWWestI'll give it a try
08:11WWWestusing it at commit 053b980296 doesn't work, I get error detected while processing fun. fireplace#pycall...fireplace#pycallk
08:11WWWestand then more errors
08:12WWWestthanks for trying :) I don't have the time right now, but I'll try to take a look at the code in the following weeks/months
08:31smilercemerick: Hmm, actually the austin sample doesn't work for in Chrome either...
08:32smilerWorks under my firefox install.
08:33cemericksmiler: any chance you have the google voice extension installed?
08:35smilerNo, but I'll disable all extensions and try again
08:36cemericksmiler: was asking only because of https://github.com/cemerick/austin/issues/17#issuecomment-25328315
08:37smilerWow
08:38cemericksmiler: See if you can verify with a third non-chrome(ium) browser
08:38smilerhttps://chrome.google.com/webstore/detail/dictionary-of-numbers/ahhgdmkmcgahbkcbmlkpmmamemlkajaf
08:38smilerThis extension breaks it
08:38cemericksmiler: so you have a working REPL in chrome now, with that disabled?
08:38smilerYea
08:38smilerI got your sample running
08:39smilerLet me see if that's the problem with the native one
08:39cemerickman, that is totally fucked. What in the world are these extensions doing!?
08:39cemericksmiler: There's ~100% chance that your problems with the stock browser REPL were caused by it, too.
08:41smilerIndeed it does.
08:41smilerThat's beyond fucked.
08:41cemericksmiler: if you could comment on #17 with a link to the offending extension, that'd be great.
08:41smilerWill do
08:41cemerickAre you certain it's only that extension?
08:41smilerYea
08:42smilerTried them one by one and then all other except that one enabled.
08:42cemerickok; its functionality looks simple enough that the source (if it's available) could probably be understood reasonably quickly. I'd love to make it so that austin's injected js will detect when the REPL won't work.
08:43smilerI'm trying to find the source
08:49smilerDoesn't look like the author provides it but the extension isn't garbled in any way
08:50cemerickah, good to know; I figured most extensions would be optimized
08:51smilerIt's not that much code but I have no knowledge about chrome extensions
08:53borkdudewhat is the shorter form of (if x (conj y x) y)
08:54mdrogalisThat's pretty short. D:
08:55piranhaName *one* language feature would you like to see added to Clojure. - how do I answer this one, damn...
08:55manutter(conj y (or x nil)) maybe?
08:55piranhajust thought about it for a few minutes and it seems I just have no idea what's out there and not present in clojure
08:56gfredericksborkdude: (cond-> y x (conj x)) avoids repeating y
08:56mdrogalisProper predicate dispatch
08:56gfredericks*rand*
08:56borkdudemanutter that won't work
08:56manutterborkdude: actually I think (conj y x) has the same effect as (if x (conj y x) y)
08:56borkdude,(conj [1 2 3] nil)
08:56clojurebot[1 2 3 nil]
08:57manuttereh, ok, guess not then
08:57manutterI thought I remembered some scenario where adding nil to a seq returned just the seq
08:58gfredericks,(concat '(1 2 3) nil)
08:58clojurebot(1 2 3)
08:58gfredericks,(merge {2 3 4 5} nil)
08:58clojurebot{2 3, 4 5}
08:58gfredericks,(into [8 9 10] nil)
08:58clojurebot[8 9 10]
08:58manutterinto, that's the one I was thinking of
08:58borkdude,(into [1 2 3] 1)
08:58clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
08:58borkdude,(conj [1 2 3] 1)
08:58clojurebot[1 2 3 1]
08:59manutter,(into [1 2 3] (seq nil))
08:59clojurebot[1 2 3]
08:59manutter,(into [1 2 3] (seq 1))
08:59clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
08:59manutterlol, ok, ifail
08:59pjstadigi was in here the other day talking about byte vector backed utf8 strings, and i accidentally a library https://github.com/pjstadig/utf8
09:02smilercemerick: I put the code I extracted from the extension at http://www.update.uu.se/~smiler/dictionary_of_numbers_1.6.3_0.tar.bz2 if you're curious.
09:07davso I'm looking to implement a lazy prime generator that doesn't use def and that properly shares prior results.
09:07davI've got two version, one that satisfies the 1st req, and one that satisfies the 2nd
09:07davsee here: http://paste.debian.net/64105/
09:08davCan't quite get it to work using "let" rather than "def" due to lack of self-referencing in let. Any thoughts?
09:08llasramdav: There's an existing such Clojure primes generator
09:08llasramIs that of interest?
09:08llasramOr not relevant?
09:09davllasram: it doens't use def or atoms or any of that stuff?
09:09clgvllasram: there is a 4clojure problem for that, isn't there?
09:09llasramclgv: Maybe? Seems pretty intense
09:09clgvyes there is
09:10clgvrated medium difficulty. http://www.4clojure.com/problem/67
09:10llasramAh, heh
09:10MikalvHi, does any of you recommend a "non-Lisp-programmer guide" that I can read to get known with the language? (Worked with php,python,java,c++ for some years now)
09:10clgvbut not with additional requirements, just compute the first n primes
09:11llasramdav: I'm now having trouble finding it, and I unfortunately need to dash off
09:11llasramIt was somewhere in the old contrib
09:11clgvtime limit is larger enough to recompute
09:11davclgv: right. I'm trying to solve it with a less-naive generator
09:11davhttp://clojuredocs.org/clojure_contrib/clojure.contrib.lazy-seqs/primes <= this uses def
09:12davclgv: I know, I'm doing it for the sport ;-)
09:12clgvdav: well you could do pretty memory efficient with a probabilistic prime number test
09:12davclgv: kind of the point of 4clojure..
09:12davthe solution I pasted is quite efficient..
09:12davit just requires a def
09:12davit's disappointing that I can't get let to behave sufficiently like def..
09:13davsurely there is a way?
09:13clgvdav: I was shooting for constant additional memory in addition to the memory the lazyseq allocates ;)
09:15clgvdav: you could do (filter miller-rabin-test (list* 2 (map #(-> % inc (* 2) inc) (range))))
09:16clgvit's probabilistic though but you can control the error probability
09:20davgrrr bad connection in airport
09:20davi was saying..
09:20dav22:17 < dav> clgv: I did that already
09:20dav22:17 < dav> I'm not looking to changethe algo
09:20dav22:17 < dav> this is a clojure question
09:20dav22:17 < dav> not an algorithmic question..
09:20dav22:18 < dav> http://stackoverflow.com/questions/1590716/clojure-prime-numbers-lazy-sequence <= this guy has a solution involving an atom..
09:20cemerickdnolen: script/build no longer works on HEAD. I think the two sed commands need to have the first empty string args removed.
09:20cemerickAt least, that works for me here.
09:21clgvdav: ah ok, your are only toying with the language^^
09:23clgvdav: since you already use lazy-seq there is an easy possibility without an atom
09:24davclgv: ah.. how so?
09:25clgvdav: implementing it - please hold the line ...
09:25davdamn this customer service ;-)
09:25upwardindexMore idiomatic way to write (when-let [x (bar)] (foo x))?
09:26bbloom(doc some->(
09:26clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
09:26bbloom(doc some->)
09:26clojurebot"([expr & forms]); When expr is not nil, threads it into the first form (via ->), and when that result is not nil, through the next etc"
09:27bbloomthat's very similar semantically, but it's probably want you want
09:27bbloom(some-> (bar) foo)
09:27dnolencemerick: huh really? I used script/build w/o hitch yesterday while hacking on source map stuff.
09:28cemerickdnolen: as it sits, I get
09:28cemericksed: can't read s/^.def \*clojurescript-version\*.*$/(def *clojurescript-version* "0.0-2005")/: No such file or directory
09:28cemerickdnolen: maybe BSD vs. GNU sed (I'm on ubuntu)
09:29dnolencemerick: build script doesn't work for me w/o them.
09:29cemerickheh
09:29cemerickyay for build scripts
09:30cemerickdnolen: whatever, I can make do
09:31dnolencemerick: can you confirm that -ie works for you?
09:32dnolencemerick: works for me w/ -ie with "" dropped
09:32nDuffWhere's this script? (willing to provide a patch, if the portability fix is an obvious one)
09:32dnolennDuff: script/build in ClojureScript repo
09:32bbloomyeah sed's command line arguments are notoriously non-portable
09:32nDuff...err. I don't see a "build" in https://github.com/swannodette/clojurescript/tree/master/script
09:33nDuff...ahh.
09:33dnolennDuff: that's my old fork
09:33clgvdav: https://www.refheap.com/20495
09:33cemerickdnolen: yeah, -ie, no empty first arg works
09:33nDuffAhh. Yeah, sed -i is nonportable as a whole.
09:34nDuff...if we can use perl as a dependency, that's actually more uniform across platforms.
09:34nDuff(in terms of behavioral consistency)
09:34cemerickThis conversation is precious. :-D
09:34clgvdav: an optimization possibility is to check only all primes up to square root of n
09:34dnolennDuff: eh, well we'll stick w/ -ie until more people complain and/or this doesn't work on the build server
09:34nDuffcemerick: sed -i isn't specified in POSIX at all
09:35cemericknDuff: *shrug* I don't have a horse in this either way.
09:35nDuff...the other approach is to do the rename logic ourselves. sed -e '...' <foo >foo.new && mv foo.new foo
09:36clgvdav: and you could also avoid lazy-seq instances which do not yield a prime immediately by finding the next prime in one recursive call
09:36davclgv: so you're maintaing a vector on top of the list
09:36davclgv: I did the same thing with a sorted-set earlier
09:37davclgv: yes I had done that too
09:37bbloomi think perl is the clear choice
09:37clgvdav: I maintain the vector within the lazy-seq
09:37bbloomperl -pi -e s,foo,bar,g target.file
09:37dnolenCLJS users, I landed a fairly large number of enhancements to source map support in ClojureScript, clone the repo, ./script/build, update your project.clj, and verify that source maps are still working for you (and hopefully behaves more sensibly across incremental builds, auto or once)
09:38ToBeReplacedwhat is the recommendation for CLI in CLJS?
09:39ToBeReplacedi don't see anything in tools.cli that would prevent it from being CLJS compatible -- just have to do it -- wondering if people use anything else?
09:42dnolenToBeReplaced: not aware of anything, likely people that need something like that are targeting node
09:42upwardindexbbloom: thank you, I didn't know about some->
09:45ToBeReplaceddnolen: i'm targeting node as well -- you get a js array of args from process.argv -- wanted to do the parsing in clojure-land if it was readily available
09:51bbloomToBeReplaced: look for jvm-clojure libraries & propose a patch to them. it should be a *very small* interop boundary: just the name of ARGV
09:51bbloomToBeReplaced: i mean, aget and alength should work the same on java & javascript arrays for CLI purposes
09:57ljos_will (fn f [[h & tail]] (if (number? h) h (map f tail))) have the potential to blow the stack, or will the laziness of map prevent that from happening?
09:58ljos_oh a small error, that should be (fn f [t] (if (number? t) t (reduce + (first t) (map f tail))))
10:10srrubyIf I need pointers can I use atoms ?
10:10gfrederickssrruby: probably? why do you need pointers?
10:11gfredericksljos_: the overall function is eager
10:11gfredericksso if your "tree" is deep enough then you will blow the stack
10:11srrubygfredericks: I have a parse tree where one data structure needs to 'point' to another part of the tree.
10:11gfrederickssrruby: I'd consider doing something indirect with ids or something like that first
10:12gfredericksI think what you're asking about is circular/self-referential data structures
10:12srrubygfredericks: Right. That is what I've been doing but it seems clunky.
10:13AimHereIf you're pointing at bits of a tree for some reason, might that mean you're doing something that zippers would probably do in a more functional stylee?
10:13cemerickdnolen: might be worth spitting *clojurescript-version* into its own file? It's inevitable that that changed line is going to get committed and reverted over and over. :-)
10:14bbloomcemerick: it also means no need to update in place :-)
10:14bbloomecho $(get the version) > .version
10:14lazybot$(get the version) > .version
10:14cemerickbbloom: yup :-)
10:15cemerickoh, it's in two files!
10:15srrubyAimHere: I've been doing everything so far with postwalk. I'm aware of zippers and might try them in the future.
10:16bbloomversion numbers in build scripts is like THE classic example of a staging violation, cyclic dependency, broken partition between src / obj files, etc
10:17seangrovebbloom: I always wondered how one could do it, seemed a bit tough.
10:18bbloomseangrove: the problem is that people always try to do it in place or w/o creating extra files or whatever. the right thing to do is to write a build script which generates your build scripts THEN run *those*
10:19cemerickbbloom: lein is an interesting third way, where the "build script" is baked into the artifact
10:20cemerickthough, it'd be nicer if, say `lein pprint` output was included, instead of the original project.clj (which needs leiningen-core to read in the general case)
10:26ljos_gfredericks: thanks.
10:27srrubyI was watching Rich's talk on concurrency where he shows his "Ant Colony" simulation. He talks about refs, agents, and vars. Do you know why he doesn't mention atoms?
10:28llasramsrruby: Probably just because atoms aren't novel
10:29srrubyThanks everybody!
10:31gfrederickssrruby: I think that was a very early talk, and atoms might not have existed at that point?
10:33clgvsrruby: maybe because he has several stateful entities which need to be coordinated then atoms do not fit
10:38scottjhow do I change the default license for new lein projects? create a new project template?
10:39dnolencemerick: it is annoying - enhancement patch welcome, I just modified what was on the ticket as I don't see an obvious better way that won't show up as a change to the repo.
10:42cemerickdnolen: I won't jump on it straight away, but a regular properties file as with Clojure, plus a derived bit of cljs that is generated when the core cljs stuff is loaded may work
10:42justin_smithI think the ants demo does not use atoms because he wanted to demonstrate STM, and atoms are not STM
10:43dnolencemerick: ah ok, so the compiler reads the property file and compiler replaces when it compiled, good idea
10:43dnolenwhen it compiles core.cljs
10:44cemerickayup
10:44andrewmcveigh|woSay I have some clojure/edn config datastructure(s) on the server (ring/etc.), and I want the client (cljs) to be able to read it on load. What is the best way to do this? Embed edn as string in a js var? json? some other way?
10:44cemerickjust gitignore the properties file, and you're done
10:44dnolencemerick: ok that sounds good gonna apply 643
10:45cemerickdnolen: I was actually thinking of just concatenating a string onto the results of slurping "cljs/core.clj", rather than replacing anything, but whatevs
10:46dnolencemerick: hey that's good to
10:46cemerickdnolen: having it in the source is helpful from a doc perspective, so it's a tradeoff
10:47dnolencemerick: true, but honestly this enhancement was about havoc from switching compilers and stale code.
10:48cemerickdnolen: BTW, I'll eventually going to hack in something to cljs.env such that any dereferences of it when it's unbound will throw a helpful error message. Tracking down the stray areas where that's not getting bound was a PITA.
10:48dnolenbrave new world thread safe CLJS compiler, big thank you to cemerick!!!
10:48dnolenbbiab
10:49cemerickgah, clojure.lang.Var is final :-X
10:51bbloomnice
10:52clgvcemerick: well they were not thorough enough then http://steve-yegge.blogspot.de/2010/07/wikileaks-to-leak-5000-open-source-java.html
10:52bbloomcemerick: i like the idea of centralizing state in to it's own namespace. good call
10:53cemerickbbloom: Quite necessary. There's lots of little stray bits yet to be pulled in, but a lot of the rest have been around for a long time, and haven't yet caused real problems.
10:54cemerickthe constants table and the namespaces map were the two biggies
10:55justin_smithclgv: that link is hilarious
11:05ltwhi, I just tried to create a map that adds keys for vectors and experienced some different behaviours in map creation
11:05ltw,((fn [a] {"asdfasd" a}) {:account 1 :type :foo})
11:05clojurebot{"asdfasd" {:account 1, :type :foo}}
11:06ltw,(#({"asdfasd" %1}) {:account 1 :type :foo})
11:06clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentArrayMap>
11:06ltwam I misunderstanding anonymous function creation or something?
11:06justin_smithltw: that second example is applying the map to 0 arguments
11:07andrewmcveigh|woltw: You're misunderstanding what the #() reader macro does
11:07justin_smiththe first example was returning the map
11:07ltwahhh, right.
11:07ltwthanks!
11:10mdrogaliskillme2008 has starred my GitHub repo. Hm.
11:11amalloycemerick: i just tried to fill in the survey on mobile, and Q3 (order these things) was so painful i gave up: surely there's some better UI - even having the question be totally optional so i can skip it, rather than autofilled with some default answers that i don't want to give, would have been better
11:11mdrogalisNot sure how I feel about that.
11:11ToBeReplacedtbaldridge: should clojurepy -h print anything? -- i can't get clojurepy to do anything other than bring up a repl
11:11muhoomdrogalis: who is that?
11:12amalloyalso the "ordered top to bottom" hint was not at all useful, since when you're just typing in numbers there's no top or bottom
11:12mdrogalismuhoo: *Shrug* https://github.com/killme2008
11:13justin_smithmdrogalis: the juvenile user name could just be a language barrier thing
11:14cemerickamalloy: hum, ok. I didn't try it out on an ipad, etc. FWIW, the initial ordering is randomized, but the results are definitely skewing sharply, so I think the aggregate data will still be useful. I don't think changing the question at this point would be useful/fair/etc.
11:14cemerickThanks for the heads-up though, I'll make sure to test on an ipad or whatever next time :-/
11:14mdrogalisjustin_smith: That's just what he wants you to think. D:
11:14amalloythanks for putting the survey together again. filling out on desktop this time :)
11:14cemerickamalloy: a good call for just about everything IMO :-)
11:15amalloyoh, for sure
11:16amalloycemerick: i'm sure you knew this already, but i discovered today that "chasemerick" looks kinda like "chase me rick"
11:16cemerickamalloy: I hadn't thought about it :-P Unfortunately, there was already a cemerick on wordpress.com, so I had to fall back :-/
11:17mdrogalisjustin_smith: It doesn't say anything good about my maturity that I lol'ed
11:17muhooMikalv: clojurebook.com
11:20oichI am creating a class using gen-class that has several fields with get/set. Is there a way to avoid needing to write the actual functions that only get and set?
11:22amalloyoich: best recommendation is to not gen-class a bunch of pointless getters and setters
11:22muhoomdrogalis: looks like a normal enough guy, works at a startup. more interesting than the name is that a startup is using clojure, always good to see
11:22amalloyif you're just defining a boilerplate-garbage class, java/eclipse is better at that anyway; and if you're doing something meaningful it doesn't really need getters and setters
11:24sverihi, i have a list which i want to split into n lists (e.g. '(1 2 3) into (1 2) and (3) where n is 2), is there a function in clojure which does that?
11:25llasram&(doc partition)
11:25lazybot⇒ "([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complet... https://www.refheap.com/20498
11:25llasramActualyl,
11:25llasram&(doc partition-all)
11:25lazybot⇒ "([n coll] [n step coll]); Returns a lazy sequence of lists like partition, but may include partitions with fewer than n items at the end."
11:25sveriah, i read about partition, but that did not do as expected, and i have not found partition-all
11:25sverithats exactly what i am looking for
11:25sverithank you very much
11:26mdrogalismuhoo: Maybe he doesn't like his start up.
11:26mdrogalisjustin_smith: I'm sure if I follow his projects, I'll see something like "'eatmypoopfart' has opened an issue on 'killme2008's repository"
11:26mdrogalisPerhaps a GitHub first.
11:27muhoomy passwords for some services are loaded with curse words and iinvective
11:28mdrogalis*Facepalm*
11:28muhoomy fb password was perhaps the crankiest
11:28mdrogalisWell it's only funny if you can share the password.
11:28justin_smithattempt to create password -- "the character ; is illegal in passwords" -- new password: "hash your fucking passwords your db is insecure fuckhead"
11:28hyPiRionIt's only funny for NSA, in other words
11:29seangroveIs cider-repl-mode a separate package that needs to be installed?
11:29muhoojustin_smith: pretty much!
11:29justin_smithtaking for granted that not allowing certain chars means they are storing unencrypted in the db
11:29mdrogalishyPiRion: Correct.
11:30Morgawris there an alternative to and that is not a macro?
11:30amalloymdrogalis: i'm suddenly sad to discover that poopfeast420 doesn't have a github account
11:30MorgawrI need to reduce 'and' to a vector of booleans
11:30amalloyMorgawr: ##(doc every?)
11:30lazybot⇒ "([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
11:30Morgawramalloy: thanks!
11:30hyPiRionmdrogalis: obligatory XKCD: http://xkcd.com/525/
11:30mdrogalisamalloy: Is this going to be the next open source trend? Armies of offensive accounts.
11:31muhoohow did this turn into /b/ ?
11:31mdrogalishyPiRion: Hah
11:31mdrogalisI was just thinking that, muhoo.
11:32justin_smithprobably my fault, somehow I got implanted with the sense of humor of an 8 year old today
11:33justin_smithsomewhere out there a third grader is making weird esoteric jokes that none of his peers understand
11:33mdrogalisAh, those were the days..
11:33mdrogalisNot really.
11:34hyPiRionjustin_smith: only their teacher, which is amused by the vocabulary
11:35mdrogalisEven he/she is asking, what the *hell* is a monad?
11:36hyPiRion"just a monoid in the category of endofunctors"
11:37mdrogalisThe small child walks away giggling.
11:37mdrogalisPretty sure we can write a screen play about this, you guys.
11:39justin_smithmdrogalis: check if Lindsay Lohan is available, it would be a surefire hit
11:39tbaldrid_I was about to say, a Geeky Freaky Friday?
11:39mdrogalisThis is going in today's stand up for sure.
11:40seangroveSomehow nrepl/i-mode is getting turned on whenever I open a clojure file in emacs, and it's eating all the commands that should be going to cider, e.g. C-c M-n... this has not been a smooth 'upgrade' to cider.
11:40seangroveThought since it's on marmalade, it should be ready
11:40mdrogalis"Today.. I plan to work on an up and coming screen cast with #clojure. Next."
11:40justin_smiththe kid in the adult body spends his whole day playing video games, watching anime, reading comics, and trolling internet forums, nobody notices any difference
11:41muhoojustin_smith: wait for randall monroe to draw that
11:42seangroveI probably need to completely remove nrepl.el
11:43justin_smithseangrov1: also look out for any .elc files compiled when you had nrepl, they will prevent newer uncompiled .el files from being used iirc
11:44justin_smithor something like that -- I just know the elc / el interaction can lead to weird behavior
11:57iwohi, does anyone know a way to inspect the structure of a clojure function?
11:57S11001001iwo: tools.analyzer?
11:57S11001001or analyze or something
11:58S11001001core.typed uses it
11:58tbaldridgeiwo: please define inspect and structure
11:59iwoso, imagine i create this: (def f (fn [x] (if x (fn [y] 1) (fn [y] 2))))
12:00iwois it possible to inspect f in some way to find out what the structure of the code that executes when f is called is?
12:00clgvHas someone already put thought into how a diagram/chart DSL for easy usage needs to look like?
12:00clgvplease do not refer me to incanter ;)
12:00hyPiRioneasy usage?
12:01iwobasically, i'm working with automatically generated compojure routes, and i'd like to be able to somehow inspect the route & middleware that has been generated
12:01tbaldridgeiwo: yeah you probably want to look at tools.analyzer.jvm https://github.com/clojure/tools.analyzer.jvm
12:01tbaldridgeeh, then that's not what you want
12:01hyPiRionwell, I like gnuplot, but that's not easy.
12:01clgvhyPiRion: yeah especially for advanced scenarios where you build several plots and charts from one dataset
12:01bbloomclgv: http://keminglabs.com/c2/
12:02tbaldridgeiwo: that's not exactly easly/possible. compojure routes end up being closures and those are pretty hard to inspect.
12:02ToBeReplacedmdrogalis: why use slingshot instead of ex-info/ex-data in dire?
12:02clgvI just thought I ask if nothing comes up I'll rewrite my current code with the new lib and see where something is missing
12:02oichfor my avoiding getters setters with gen-class question (I have to create a class with methods getBlah setBlah, etc. because they are expected), I figured out a weird solution: create a java superclass with protected fields and then use :exposes. but, maybe it's better to write a macro that emits a series of defn expressions?
12:03bbloomclgv: kevin lynagh is working on various projects in charting. he's the guy to talk to
12:03tbaldridgeiwo: that's one of the reasons why Pedestal does this a bit differently, but that would require porting your code to a different library: http://pedestal.io/documentation/service-interceptors/
12:03justin_smithiwo: you could use something like robert-hooke to track invocation of the functions when the route is hit https://github.com/technomancy/robert-hooke/
12:04clgvbbloom: ok thanks
12:04bbloomoich: watch this: http://skillsmatter.com/podcast/scala/impromptu-rich-hickey-lightning-talk
12:05bbloomoich: rich explains how he made the java API for datomic while still preserving all the repl-goodness of clojure. short answer: just write java code and indirect through vars
12:05technomancycemerick: does "what version of the JDK do you target?" mean what you use in production deployments or what you require users of your code to have?
12:06iwojustin_smith: thanks, i'll definitely investigate that, it might be the only option
12:06sritchieis anyone doing facebook or twitter authentication in Ring apps? any "best practice" recommendations?
12:06cemericktechnomancy: Whatever is more meaningful to the respondent. Sort of a "if you had to choose just one" situation.
12:06sritchiecemerick: repl's up, got used to the workflow, it's great :)
12:07cemericksritchie: nice, good to hear :-)
12:07technomancyok
12:07sritchiecemerick: I was seeing that ""cemerick" does not exist" error when try to run clojurescript.test, but that's something to fix another day
12:07iwotbaldridge: there _must_ be a way to see something useful surely. maybe debugging with something like ritz would be an option
12:07technomancycemerick does too exist
12:07technomancyI've seen him with me own eyes
12:08sritchiehe's ascended to a higher plane of compilation
12:08cemericksritchie: sounds like a classpath situation
12:08cemericktechnomancy: sometimes I wonder
12:08sritchiecemerick: I added it as a plugin,
12:08sritchieperhaps I'll try adding it as a dep too
12:08sritchiecemerick: lein 2.3.3
12:09iwotbaldridge: my first bit of googling suggested serializable.fn
12:09technomancycemerick: kind of a http://dresdencodak.com/2011/04/19/dark-science-09/ type of situation?
12:09cemerickdnolen: maybe this is a non-starter with the powers-that-be, but maybe now would be a good time to bump the minor version number of cljs? Every time I contribute large(ish) changes, I feel bad for others that have to puzzle out the difference between effectively-arbitrary changes in a single number.
12:09iwotbaldridge: however i'm not sure the bet way to apply this so that it's used by compojure, alter-var-root is a very bad idea :)
12:10sritchiecemerick: I'm expecting a biased answer here: friend > clauth (or equiv) for oauth?
12:11dnolencemerick: I'm not against it, but I would like to get a lot more feedback first. I want incremental compilation, REPLs, and source maps to be solid
12:11dnolenxeqi: did you see my comment about your patch yesterday?
12:12devn"Name *one* language feature would you like to see added to Clojure."
12:12cemerickdnolen: a lot more feedback before a 0.1-XXXX, you mean?
12:12dnolencemerick: yes
12:12clojurebotNo entiendo
12:13cemerickOK
12:14llasramDoes "CLJS-style core-interfaces-as-protocols in JVM Clojure" count as a "language feature"
12:14cemericksritchie: I'd much rather see e.g. the stuff in clauth be turned into a friend workflow
12:15tbaldridgellasram: in the same way "full language rewrite" counts as a feature :-P
12:15amalloyllasram: i doubt cemerick will be calling the police if you ask for something he doesn't count as a language feature
12:15llasramHe might!
12:15cemerickI didn't find the examples of ring usage very compelling. ! this and ! that, etc.
12:15tbaldridgethen I'm gonna add "make Clojure statically typed so I can use monads".
12:15hyPiRionI just want faster startup time atm
12:15TimMccar and cdr for me
12:16tbaldridgejust to see if I end up getting murdered
12:16sritchiecemerick: gotcha, good to hear
12:16llasramtbaldridge: You don't think it could be done incrementally?
12:16cemericktechnomancy: eh, more of an internal confusion than lacking external validation
12:16oichbbloom thanks. that is really cool. for this case since the getters/setters just expose the field, I think it's less code just to create the java super class with protected fields (or a macro) but, that looks like a very useful technique
12:16sritchiecemerick: time to do some learning, then I'll see what I can do
12:16gfredericksllasram: it would probably break stuff...so maybe best to break everything at once rather than repeatedly?
12:16tbaldridgellasram: yeah, that's the way it has to be done, but it's still really hard. The compiler itself uses the interfaces you'd be rewriting.
12:17cemericksritchie: that's not to say that friend has a super-great oauth story. There's friend-oauth2, which definitely works, but saying friend has "oauth support" is an incredibly broad claim given the "spec", one that I don't want to make.
12:17bbloomoich: the summary of my point is: don't be afraid to write java if it's easier than writng clojure for your particular need
12:17llasramI'm not really sure why it would break anything. You could keep the existing interfaces, and extend the new protocols to those interfaces
12:17gfredericksmaybe it wouldn't break much, since defprotocol creates an interface
12:17gfredericksby hopefully the original name?
12:17llasramOr that
12:17tbaldridgegfredericks: that interface is only implemented on new classes, not old ones.
12:18gfrederickstbaldridge: I know
12:18cemerickllasram: what amalloy said, also, I don't particularly judge anything entered. I get first dibs on commentary, but that's worth about as much as the paper it's written on.
12:18gfredericksI was thinking of breakage along the lines of just (:import clojure.lang.IFn) and such
12:19llasramcemerick: Yeah, I'm not buying it. I'm pretty sure you've got a team of crack mercenaries, ready to go
12:19llasramI was mostly just curious what people were considering a "language feature"
12:21cemerickllasram: if only. That would imply that there's money to be had being a professional Clojure hatchet man. Alas.
12:21ivandev.clojure.org jira ticket pages intercept ctrl-pgup/pgdn in Firefox (why oh why do browsers let people do this)
12:22hyPiRionand it reads the super button, which is annoying.
12:22technomancyivan: wow
12:22technomancyivan: more pertinently, why do humans inflict this on other humans?
12:23ivansome people just use their clicky-mouse for everything or haven't been using browsers very hard. a month ago I found a page that used ctrl-s for search
12:24justin_smithllasram: that's easy, macros are language features
12:24mtpugh
12:24mtpi found some IRC client that used C-f for Fonts
12:24ivanheh
12:24mtpand afaict didn't have a search-the-scrollback feature at all
12:25mdrogalisToBeReplaced: Hm.. I had a reason..
12:25mdrogalisOh, right. Because Slingshot exceptions might propagate from within that try block.
12:25mdrogalisEnd-users functions, that is
12:27TimMcivan: Github intercepts / (in-page search in Firefox) and you *can't turn it off*.
12:27llasramjustin_smith: Well, that is a very specific definition
12:28ivanTimMc: the one that starts with / ? seems to be working here
12:28MorgawrI have an operation with side effects that needs to be applied to a collection of elements (like a vector) and I do not care about the return value of such operation, is there anything better than calling (doall (map func coll)) ?
12:28technomancyTimMc: is there some noscript hacks you could use to fix that?
12:28TimMcivan: Not every page.
12:28ivanFirefox 25, at least
12:28ivanah
12:29TimMc...or maybe they finally killed it?
12:29ToBeReplacedmdrogalis: so it's to deal with user functions that already use slingshot?
12:31iwoivan: ctrl-pgup/ctrl-pgdn work as usual for me when viewing a dev.clojure.org jira ticket in FF 24
12:31ivaniwo: try clicking on some ticket text, does it still work?
12:31mdrogalisToBeReplaced: Well, say you define a function that throw+'s something. And then you add a Dire hook.
12:31technomancyMorgawr: doseq is more typical for that
12:31Morgawrtechnomancy: thanks
12:31mdrogalisIf I just used "try" within the Dire hook, it would stacktrace out
12:31ToBeReplacedMorgawr: (doseq [c coll] (func c)) or (dorun (map func coll))
12:32Morgawrdoseq looks perfect, thank you :)
12:32mdrogalisToBeReplaced: I should have just answered that - yes :P
12:32MorgawrI knew there was one but I kept forgetting the name, I looked for "for", "while", "do", "doall", "dorun" etc etc
12:32Morgawrdoseq was what I was looking for :P
12:33iwoit seems to do two things, switch tabs _and_ scroll to the top or bottom of the ticket
12:33ivaniwo: you lucked out, maybe it's Windows or my FF extensions
12:34ToBeReplacedmdrogalis: that feels questionable to me -- do you have users that are asking for slingshot throw+ compatibility?
12:34justin_smithllasram: I meant it jokingly, it's kind of a pedantic normative definition of macros that they should only be made if they are creating language features
12:34mdrogalisToBeReplaced: Yeah, a bunch.
12:35ToBeReplacedmdrogalis: it feels off that your lib has to eat that dependency ... esp after inclusion of ex-info
12:35ToBeReplacedoh, interesting
12:35mdrogalisI don't mind it. If the end user never knew that Slingshot existed, his/her world would be exactly the same in the API usage
12:35ToBeReplacedi might be out of the loop -- what does slingshot buy you that ex-info/ex-data doesn't?
12:36mdrogaliscatch+ can do dispatch on predicates
12:36ToBeReplacedmdrogalis: yeah, not a deal breaker by any means... just adds an extra dep
12:37ToBeReplacedin stead of (catch RuntimeException e (condp (ex-data e)....
12:37mdrogalisI'm about to get run-time hook removal out, so Night-Vision will be a lot better.
12:37mdrogalisCorrect. ^
12:37technomancyslingshot catching is really fancy
12:37mdrogalistechnomancy: Yeah I quite like it.
12:37ToBeReplacedthe fanciness is a positive then? i haven't used it
12:38Morgawram I a monster for making this? https://gist.github.com/Morgawr/7322960
12:38Morgawrjust for syntactic sugar?
12:38Raynestechnomancy: Miss slingshot, miss slingshot, miss slingshot: are you fanceh!?!?!?!
12:38mdrogalisThe win is that the code that blows up just needs to puke up enough context for a predicate to pick the right error handling logic higher up the stack.
12:38Raynestechnomancy: (reference to https://www.youtube.com/watch?v=LUc_jXBD9DU)
12:39RaynesMorgawr: Well, you're a monster for making it a gist instead of a refheap.
12:39MorgawrRaynes: sorry, I like gists for stuff I want to keep around
12:40RaynesAnyways, I certainly wouldn't write that macro. It makes the code more confusing to readers (they now have to understand what that macro does) without much gain.
12:40technomancyToBeReplaced: for something with as limited scope as catch, I think fancy is a win =)
12:40RaynesMorgawr: I was totally joking, but I am curious as to why you'd rather use gist for things you'd like to keep around (sounds like feedback and feedback is useful for future refheap improvement)
12:41hyPiRionMorgawr: maybe you should check out common lisp. You can do (loop for n in '(1 2 3 4 5 6) do (print (* n n)))
12:41MorgawrRaynes: I have a gist client on my machine where I can collect all the gists tied to my github account, you can submit pull requests and revisions to gists (as far as I know, never did it myself though) and it is tied to your own github account
12:42MorgawrhyPiRion: nah, I don't like common lisp, I think clojure's syntax (and flexibility) is much better :P
12:42technomancyRaynes: tying it to an existing github account is kind of a brilliant lock-in move on their part =\
12:43ToBeReplacedtechnomancy: mdrogalis: thanks
12:43RaynesMorgawr: Interesting. I can add the first feature to rapture in approximately 4 seconds. Revisions exist on refheap as of about a month now. You can't submit 'pull requests', but I purposely avoided the pastes-backed-by-git gimmick.
12:43MorgawrRaynes: nice
12:43hyPiRionMorgawr: Well, I avoid syntactic sugar, because it makes it harder to read the code
12:43Morgawrhonestly I never used refheap that much, any paste service is fine in my opinion
12:43RaynesRefheap also has accounts (backed by browserid, so it's pretty easy and usually sign-in-and-forget). I'm thinking of adding github authentication, but TimMc won't pull request me. :P
12:44RaynesMorgawr: Sure, I just wanted to hear feedback and see if there was anything I could do to make the experience better. :)
12:44MorgawrhyPiRion: for clojure developers yeah, I am kind of writing a library for game development that can hopefully be used by programming newbies who never used a functional language or a lisp dialect, if I can make it easier with a first approach, I'd like it
12:44ToBeReplacedRaynes: can i get some love on my LinkOptions support in fs?
12:44RaynesToBeReplaced: No. Go away. Never.
12:45RaynesToBeReplaced: (I forgot about the pull request)
12:45dobry-denMorgawr: `doseq` itself is a signal for "this has side-effects". I don't know what that wrapper accomplishes except blur the line between things like `for` which return a sequence
12:45justin_smithI thought it was a bad joke
12:45ToBeReplacedRaynes: hence the friendly ping ... no rush or anything, just putting it back on the radar
12:45hyPiRionWell, I am not sure whether adding syntax to Clojure makes it easier to learn
12:45RaynesToBeReplaced: Hehe.
12:46Morgawryeah you guys are probably right, this doesn't make much sense
12:46Morgawrit was just fun to implement though :P
12:46rasmustoMorgawr: you could have a side-by-side comparison of a clojure doseq and a ruby foreach or something
12:46Morgawrand dobry-den raises a really good point
12:47RaynesToBeReplaced: Can you align the docstring text?
12:47RaynesIf so, I shall pull this here pull request and I shall do it with pride.
12:49ToBeReplacedwhat do you mean? i aligned it to match the other functions
12:51ToBeReplacedit might make sense to split out java 7 work into a separate namespace or separate project even
12:51RaynesToBeReplaced: Oh, I see. I must have missed it. noprompt did the other docstrings.
12:51RaynesThis is fine. I'll align them all later on.
12:51RaynesToBeReplaced: My intention was to release a new major version soon with java 6 deprecated.
12:52RaynesJava 7 just has way too much good stuff to not be used
12:52ToBeReplaceddeprecated through warnings or broken?
12:52RaynesBroken.
12:53RaynesTrying to support both versions is painful.
12:53RaynesAnd people who need java 6 support can just keep using the old version until they can upgrade.
12:53ToBeReplacedyeah, i'd vote for a separate project... java 6 has lots of life left with clojure so i think dropping it is a bad idea
12:53technomancyOracle's JDK6 has been officially EOL'd for nearly a year now
12:54technomancynot openjdk though
12:54hyPiRionhmm
12:54ToBeReplacedhow widespread is jdk6 still in the wild though?
12:54llasramMany (most?) Hadoop distros still only experimentally support Java 7 :-/
12:55hyPiRionToBeReplaced: On all debian servers I guess? At least on squeeze and wheezy
12:56justin_smithsomeone said to me that osx came with version 1.6 of the jvm - is that true? just maybe true as of the last time osx shipped with a jvm by default?
12:56hyPiRionJessie runs on 1.7, but running testing in the wild is a rare sight
12:57llasramhyPiRion: wheezy at least has an openjdk7 package, unlike squeeze :-/
12:57indigojustin_smith: OS X doesn't come with a JVM anymore
12:57indigoYou have to download one from Oracle
12:57hyPiRionllasram: what? I thought squeeze had a 1.7 package
12:57justin_smithit comes with xcode thought, right?
12:58hyPiRionwell, squeeze is old now, so people should upgrade to wheezy when they can.
12:59technomancywe'll find out more when the state of clojure survey ends
12:59llasramhyPiRion: http://packages.debian.org/search?suite=all&amp;arch=any&amp;searchon=names&amp;keywords=openjdk-7-jdk
12:59technomancythough I put 1.6 because it's the minimum requirement for lein users; I don't actually use it myself
13:00llasramhyPiRion: And yes, but does mean I need to upgrade my corporate universe to wheezy first, before even thinking about Java 7
13:00ivaniwo: this was 'fixed' in Firefox 25 ;)
13:00hyPiRionllasram: heh, yeah. I haven't bothered yet on my server either =/
13:02technomancyhttp://www.theregister.co.uk/2013/03/08/red_hat_openjdk_6_leadership/
13:02technomancyno mention of how long they plan on keeping it up
13:04ToBeReplacedclojure 1.6 drops 1.5, right?
13:04technomancyToBeReplaced: yeah
13:05technomancy1.5 was never part of openjdk though, so it's been EOL'd for longer than you can imagine
13:05hyPiRionyeah, was amazed that Clojure actually supported 1.5
13:06technomancyLeiningen has never supported it =)
13:07hyPiRionnot intentionally at least
13:07technomancythere's some j.i.File method used in compile or jar or something that makes it blow up
13:07hyPiRionTo be honest, I'm not sure of the differences between 1.5 and 1.6. It's before my time
13:07hyPiRionoh, hehe
13:08TimMcYoung 'un.
13:09hyPiRionticked*
13:10technomancyleiningen's 4th birthday is the day after the conj
13:10technomancywell, of the 0.5.0 release. the first commit was halloween.
13:13pjstadigtechnomancy: really? hmm time flies
13:13technomancyI know, right?
13:14technomancyit's like... mature software or something
13:14hyPiRionWell, it's actually post 0.x.y.
13:14joegalloBIG BUSINESS, technomancy
13:14hyPiRionThat's very unusual for any Clojure project out there.
13:14technomancyjoegallo: time for a certification program
13:15joegallothat's where the money's at
13:15justin_smithtalk to University of Phoenix, they can set up a money faucet
13:16sshackAre there any parsing tools for uri's in clojure? Want to parse a DB connect string to feed into korma/lobos.
13:17sshackjustin_smith: You laugh, but Upheonix might be the future. They have no physical buildings, deliver online so they can ab-test out the wazoo, and enough students to hire the best people.
13:17technomancyI remember my first bug report; running `mvn package` from a fresh checkout didn't actually work; turned out everyone just used ant and the readme hadn't been updated.
13:18sshackThey got clayton christensen after all.
13:18ToBeReplacedon 0.x.y -- that tilts me... i should have put that in my state of clojure survey
13:19ToBeReplacedi don't get the big deal against having version 13.1.2
13:19technomancyToBeReplaced: gotta avoid integer overflows y'know
13:20technomancyjava doesn't have unsigned ints
13:20TimMcsshack: URIs in general, or specific schemes?
13:21dnolenreiddraper: hmm, have you seen this John Hughes video on async testing with QuickCheck? http://vimeo.com/17135313
13:21bbloomcan i just say how much i appreciate the lack of interposed syntax in lists?
13:21bbloomif i ever debug another trailing slash on a path to a directory issue again,.... grumble gurmble
13:21sshackTimmc: database connection strings.
13:21sshacktimmc: korma/lobos want keywords, heroku sets an env var with a connection string.
13:22bbloomwhoever decided you need a common between array items should be shot
13:22TimMcsshack: OK, so it needs to understand how to parse specific DB connect strings.
13:23sshacktimmc: As far as I know they conform to normal urls: postgresql://user:pass@foobar.com:5432/my_database
13:24TimMcjava.net.URI will split that into non-specific parts, like host and path
13:24reiddraperdnolen: I have not, thanks
13:25technomancybbloom: I wonder if that originally stemmed from a desire to make it "like english" or something
13:25bbloomit doesn't work in english either
13:25bbloomhurray oxford comma debates
13:25dnolenreiddraper: seems like a pretty solid set of ideas easily implementable by simple-check :)
13:25sshacktimmc: I was looking at that. It looks to give me everything but the password part.
13:25hiredmanbbloom: commas in other languages drive me crazy now
13:26iamjarvoso i just looked in here an saw a mention of heroku. are there a lot of clojure apps on heroku? i was surprised they had couple awesome clojure tutorials
13:26stuartsierraCommas make it easier to distinguish separate items when written by hand.
13:26TimMcsshack: At work I've been hammering on a lib to do URI parsing, but it's just focused on http URLs right now and isn't done. :-/
13:26stuartsierraBut I agree, I dislike typing commas now. :)
13:26reiddraperdnolen: excellent, yeah, i'll give it a watch after work today
13:27technomancyiamjarvo: there's a decent number, but a lot less than scala and groovy even
13:28iamjarvoahh i see. i come from the ruby world.
13:28bbloomhiredman: i just opened a file and saw a ton of /paths/that/looked/like//this
13:28sshacktimmc: ahh. Hence your interest. Well as far as I know db connect strings are valid URL's.
13:28bbloomnote the double slash
13:28bbloom*cringe*
13:28technomancyiamjarvo: right; on heroku everything else is a rounding error compared to ruby
13:28TimMcbbloom: That should be fine, actually.
13:29bbloomTimMc: it is fine for bash, etc. but it's not fine when it's like your one primary upstream environment var that gets copied around to dozens of other config files & things
13:29bbloomsurely somewhere somebody down the line will barf on that
13:29justin_smitha posix system won't care about doubled slashes at least
13:30justin_smiththe / is interpreted on a filesystem level
13:30technomancybbloom: really? I've never run into anything that barfed on double slashes
13:30justin_smithbut // in a path is ugly, and is always obviously a mistake
13:31nDufftechnomancy: I've seen a few places where it can happen.
13:31bbloomtechnomancy: some code trying to convert a absolute path in to a relative path by stripping a prefix. result is a path with a leading /
13:31justin_smithyou can do a syscall telling the kernel to open a file with // in the path, the kernel won't care
13:31nDufftechnomancy: ...double slashes are special to some parts of the Andrew Filesystem, f'rinstance
13:31justin_smithyeah, but it is an fs level thing
13:32technomancybbloom: sure, but you should probably be normalizing that anyway to take care of symlinks and stuff
13:32bbloomtechnomancy: i didn't write this code :-P
13:33justin_smithbbloom: in other words you should avoid // for much the same reason you should avoid space in paths, because it breaks lots of bad code?
13:33bbloomjustin_smith: yes.
13:34justin_smith(alternately one could go the MS route and throw // in paths at every opportunity so that all code that can't handle it breaks constantly)
13:34bbloomjustin_smith: but it also just makes quick munging harder
13:34bbloomcut -d/ -f2- # for example, is broken
13:34bbloomsame for spaces, etc
13:39Morgawrmmm.. I have a vector of sets and I want to change the first set in that vector (change = return a copied vector with the modified set, obviously)
13:40MorgawrI'm wondering how to do that in an elegant way
13:41stuartsierraMorgawr: update-in
13:41bbloom(update-in vector-of-sets [0] conj :new-item)
13:41Morgawroh, update-in works with vectors too? great!
13:41Morgawrthanks
13:41pbostromis (:require [foo :refer :all]) not allowed in cljs?
13:41TimMcMorgawr: Yup, they're associative.
13:41TimMc~seqs and colls
13:41dnolenpbostrom: nope
13:41clojurebotseqs and colls is http://www.brainonfire.net/files/seqs-and-colls/main.html
13:56sshacktimmc java.net.url lets me down. throws an exception because of the postgres protocol in the url.
14:01TimMc&(.getHost (java.net.URI. "postgresql://user:pass@foobar.com:5432/my_database"))
14:01lazybot⇒ "foobar.com"
14:01TimMcsshack: ^
14:01TimMcRemember to use the .get___Raw version of applicable accessors.
14:02TimMc(j.u.URI will "helpfully" percent-decode stuff that it really shouldn't, otherwise)
14:03sshackHuh. Interesting.
14:05TimMcsshack: URI, not URL :-)
14:05sshackTimMc: Just noticed that.
14:06sshackGets me everything I want but user/pass are still entangled. I can live with that.
14:07TimMcYeah, you'll have to split at the first : and percent-decode the two halves (or single piece.)
14:13technomancyhas anyone implemented a generalized "watch" higher order lein task to subsume these one-off implementations coupled to things like autoexpect and cljsbould :auto?
14:14ToBeReplacedtechnomancy: pyinotify?
14:15technomancyum?
14:16ToBeReplacedtechnomancy: that was bothering me a few weeks ago.... feels like doing "watch" right is hard and it sucks that everyone tries to reimplement pyinotify
14:16technomancyToBeReplaced: doing it outside the JVM means re-invoking lein's own startup time
14:16ToBeReplacedinotify rather, heh... sorry... i use pyinotify for my watch commands
14:18ToBeReplacedtechnomancy: so you want `lein inotify -d src cljsbuild`?
14:18technomancyToBeReplaced: right
14:18technomancyhaving cljsbuild implement its own watcher is silly
14:19ToBeReplacedagreed
14:19technomancyand I'm kind of surprised this hasn't been done right yet
14:19technomancy
14:19technomancyrightly
14:19technomancycorrectly
14:19technomancywhatever
14:20TimMcwith more better doage
14:20technomancyhttp://p.hagelb.org/correct-answer.gif
14:23pjstadigtechnomancy: what am i even watching?
14:24pjstadigand why is it 5 minutes long
14:24technomancypjstadig: difficult to put in words
14:24TimMcIt is its own best explanation.
14:24bitemyappthere needs to be a name for that feeling when you see a meeting invite you don't want to go to, then realize you already agreed to it.
14:24seangroveI'd like to (I think) use multimethods that will always the same type given for the first argument, but do dispatch off of the second
14:25seangroveIs there a way to do that?
14:25TimMcI think you a verb.
14:25seangrove(run simulation 'i81) would trigger one method, (run simulation 'i85) would trigger a different one, etc.
14:26mdrogalistechnomancy: That is the weirdest thing I've seen in a while.
14:26seangroveTimMc: Quite possible.
14:26technomancymdrogalis: thanks
14:26TimMcseangrove: Multimethods can do arbitrary dispatch on the arguments.
14:26mdrogalisYeah no problem. I knew you'd take it well.
14:26TimMcYou just want to dispatch on the second?
14:26seangroveTimMc: Ideally, yes
14:27TimMcSomething like (defmulti run (fn [_ foo & _] foo))
14:27seangroveTimMc: Ok, let me try that out
14:29TimMcYou could dispatch off of whether the first argument is relatively prime to the last if you wanted to.
14:42bitemyappI'm going to just see if I can show up really late to the meeting so that the 10 out of 60 minutes that I can contribute to happen then.
14:44indigoHm, fox news got hacked
14:45Foxboronindigo: nothing of value was lost
14:45indigoYep :)
14:46bitemyappI don't particularly like Fox News or agree with their politics but should we be cheering on attacks against news organizations at a time when the NSA is running rampant?
14:46bitemyappSorry if I just ruined the fun :P
14:47indigoNot exactly cheering it on
14:47indigoBut still, I don't consider Fox News a proper "news organization"
14:47indigoMore like a propaganda machine
14:48bitemyappindigo: I'm sure Fox News feels similarly about MSNBC
14:48justin_smithindigo: do you have a link for that? or a page that shows evidence of hackage?
14:48bitemyappindigo: as frustrating as the polarization of news organizations to political extremes, do we really want fewer possible sources of information?
14:48bitemyappextremes is*
14:49technomancyit's not like they won't get the site back up
14:49justin_smithit is up and looks "normal" right now
14:49justin_smithI think
14:49indigojustin_smith: http://i.imgur.com/xviXyB1.png
14:50bitemyappjustin_smith: looks pretty hacked to me.
14:50indigoIt's still on their front page
14:50indigobitemyapp: Sure, if it would decrease the noise
14:50justin_smithoh, I thought that was what they normally looked like
14:50technomancy"stuff, yo"? lame =\
14:50bitemyappindigo: it's only noise to you because you disagree with their viewpoint.
14:51gtrakbitemyapp: I think us techies are more able to deal with noise than most folks.
14:51technomancythey could have at least added something clever
14:51mtpi am terrible at handling noise
14:51mdrogalisWeeeeeeeeeeee
14:51mtpi try to extract signal from it
14:51indigobitemyapp: It's not just fox, it's the death of real journalism in general
14:52justin_smithI'm listening to an asmr videos on youtube right now, noise gives me the head tingles
14:52mdrogalisjustin_smith: I tried it. Didn't work for me.
14:52TimMcHacked, or intern?
14:53TimMcFrom time to time fake headlines (Lorem ipsum, "headline goes here", etc.) make it out the door.
14:54justin_smith"Etaoin shrdlu" is the best (and a great lib name)
14:54indigobitemyapp: Btw, since you worked on Revise... what's your general opinion on RethinkDB?
14:54justin_smithhttp://en.wikipedia.org/wiki/ETAOIN_SHRDLU
14:55bitemyappindigo: it does a better job at what MongoDB purports to do.
14:55bitemyappindigo: I'd still use PostgreSQL or Datomic for an "important" OLTP database of record.
14:55bitemyappindigo: but if I had slightly lower value data for which I wanted a nice sharding, replicating, auto-clustering document store, RethinkDB is a solid choice.
14:55bitemyappindigo: RethinkDB also lends itself nicely to weekend hack projects.
14:56bitemyappyou could do some nifty things with analytics data roll-ups with RethinkDB too.
14:56bitemyappI sincerely hope it supplants MongoDB as the document store of choice, it's vastly superior.
14:56indigoGotcha
14:57bitemyappthe only thing I really dislike about RethinkDB is that it's specifically a JSON document store
14:57indigoWell... better than BSON
14:57bitemyappwell, I understand their reasons for using it
14:57bitemyappI just would've preferred something a little better designed schematically.
14:57bitemyappironically, the protocol isn't JSON at all, it's a custom protobuf spec.
14:58bitemyappso they're quite free to break away from JSON at any time.
14:58indigoA.k.a. edn
14:58indigoAh
14:58indigoYay protobufs
14:58bitemyappthe representation just happens to be...JSON'ish.
14:58`cbpyay protobufs!!
14:58bitemyappit's a little odd.
14:58bitemyappmakes a ton of sense though.
14:59nDuff...BaseX is wonderful until one starts to care about concurrency and locking semantics, replication, &c.
14:59bitemyappnDuff: take a look at the API: https://github.com/bitemyapp/revise/
14:59bitemyapp`cbp: you should add a note to the :durability keys what the other options are other than :soft
15:00`cbpbitemyapp removed all my protobuf swearing comments
15:00bitemyapp`cbp: I can guess :hard, but I don't know for sure because it's not in the README
15:00indigobitemyapp: No issues yet :(
15:00bitemyappindigo: sorry?
15:00bitemyappyou mean in Revise?
15:00indigoYeah
15:00indigoI might check it out this weekend :D
15:00llasramzarro boogs
15:00`cbpindigo: that means its pretty perfect right?
15:00bitemyappindigo: I'm not sweating it. `cbp knows I pimped out the library big time.
15:00bitemyapp`cbp: I kinda should look into error handling...
15:00bitemyapp*coughs*
15:00indigo`cbp: Of course
15:01indigo`cbp: Also no protobuf swearing comments because protobufs are everyone's favourite
15:01indigo>:D
15:01`cbpwait till you get messages like EXPECTED TERM BUT FOUND DATUM
15:02nDuffbitemyapp: ...hmm. Cute.
15:02indigoJust convert all error messages to EHRMEHGERD
15:02bitemyappnDuff: `cbp's nice work.
15:02bitemyappnDuff: a lot of how the lambda-based API is dictated by how RethinkDB works.
15:02`cbpbitemyapp: I'll check the docs later today
15:05bitemyapp`cbp: I'm going to add some error handling test-cases tonight or tomorrow and see what I can do to clean it up.
15:07`cbpbitemyapp: okies
15:13xeqidnolen: you're refering to using readers/indexing-push-back-reader rather than LineNumberingPushbackReader. ?
15:19dnolenxeqi: yes
15:28dnolenxeqi: patch does not apply to master, needs a rebase
15:28dnolenxeqi: also is this configurable? would be nice to enable for browser REPL but default disabled for everyone else.
15:37xeqidnolen: ack, pulling
15:39xeqiand not currently configurable. IJavaScriptEnv doesn't have a method for emitting js from a form. Is there a way to ask the repl-env if it is a browser REPL?
15:45dnolenhrm
15:47dnolenxeqi: k, don't worry about config for the patch - I'll poke around and enhancement after I apply it
15:57rbuchmannDoes anyone have an idea why this: (js->clj (.readdirSync fs path)) would return something that isn't ISeqable?
15:57rbuchmannfs is nodes fs
15:58rbuchmannIt seems to be a js array still
16:00hiredmanrbuchmann: clojurescript may not extend the protocols to native javascript stuff anymore, I seem recall there was something of a purge of that kind of stuff
16:01rbuchmannok, granted, but isn't that what js-clj is supposed to be for?
16:01rbuchmann*->
16:01hiredmanno idea, I am just guessing
16:02rbuchmannif I have to do a for [i (range (count foo))] loop I am going to cry bitter tears
16:02rbuchmanncounting and agetting the result seems to work
16:10rbuchmanninteresting, calling array? on it returns false...
16:17yeoj___is there a better way to do this? (= (str (type s)) "class java.lang.String")
16:18rbuchmannmaybe (isa? ...)
16:18technomancy,(string? "yeoj___")
16:19clojurebottrue
16:19rbuchmannor that :)
16:20yeoj___ok thanks.
16:20llasramAnd probably `instance?`, not `isa?`, for the general case
16:21rbuchmannright
16:21yeoj___i think i'm going with string? that makes sense to me.
16:24dnolenxeqi: hmm, something still wrong with that patch, trying to see how it affects Rhino REPL and I get a bunch errors about set! when testing with ./script/repljs
16:27rbuchmannno one volunteering for the node array issue? I got it working using the aforementioned loop, but it bugs the hell out of me
16:30dnolenrbuchmann: it should get converted into a vector
16:30rbuchmannwell, it definitely isn't :)
16:31rbuchmannIt's not sequable, and the output to the console is the freaky #< foo > stuff
16:31rbuchmannDoes node do anything differently with its arrays?
16:32dnolenrbuchmann: are you sure it's an array and not some weird JS Array like?
16:32rbuchmannno, although the type was given as something like "Array function() { ... }"
16:32rbuchmannAny way to find out?
16:34rbuchmann#<function Array() { [native code] }> to be precise
16:34rbuchmannand I can aget and count it
16:34rbuchmannjs is weird...
16:35dnolenrbuchmann: ok this seems like a bad predicate on ClojureScript's side, instanceof Array on the result of calling fs.readdirSync -> false
16:35dnoleneven through fs.readdirSync("./").constructor == Array
16:35dnolens/through/though
16:35rbuchmannaha
16:36rbuchmannso, what does cljs do to get a different result...? gonna look at the source...
16:37dnolenrbuchmann: the array? predicate in CLJS is not right, it appears we have to use multiple tests
16:37dnolen(x && x.constructor == Array) I think
16:38rbuchmannso it is a proper cljs bug?
16:38dnolenrbuchmann: yep
16:38arkhI'd like to learn how to use core.match but I haven't learned pattern matching previously. Google searches don't turn up much useful for learning pattern matching (and most examples are in haskell). Anyone know of a good pattern matching resource?
16:38rbuchmannhooray, my first ;)
16:38rbuchmannshould I report it?
16:39dnolenrbuchmann: yes please, should be simple to fix, but very annoying - JS really goes out of it's way to make shit slow
16:39edwHey guys. We're hiring in NYC again. <https://gist.github.com/edw/7326822&gt;
16:39rbuchmannhaha
16:39rbuchmannok, will do
16:39rbuchmannthanks!
16:40arkhedw: your gist returns a 404
16:40juxovecHi do any of you have experience with core typed?
16:41edwThat is unpossible.
16:41edwDo you include the ">"?
16:41juxoveceach time I try to use it, it throws exception: "Exception in thread "main" java.lang.AssertionError: Assert failed: (not *compile-files*), compiling:(state.clj:68:1) "
16:41arkhedw: I did ... and I've failed the pre-interview ...
16:41dnolenwhat an abomination - http://jsperf.com/isarray-vs-instanceof/7
16:42edwSense of humor (and self deprecation) is highly prized.
16:43arkhedw: ; )
16:43hiredmanjuxovec: if I had to guess, you have a call to the type checking stuff somewhere that is being evauluated when you compile your project, and it really doesn't want to be called when the project is being compiled
16:43hiredmanjuxovec: how are you running it? lein-type(d)?
16:44juxovecI have not task called lein typed
16:44hiredmanit is a plugin for lein
16:44juxovecyes I added (cf) or (check-ns) directly to namespace
16:44hiredmanhttps://github.com/frenchy64/lein-typed
16:44hiredmanjuxovec: don't do that
16:45edwFor what it's worth, I hired our second-most recent addition to the team from #clojure.
16:45bitemyappHas anybody used this generic resource pooling library for Clojure or know of something they like? -> https://github.com/robertluo/clj-poolman
16:46juxovecthanks
16:46juxovecI didnt know about that plugin
16:49rbuchmanndnolen: haha, totally straightforward
16:50dnolenrbuchmann: oh hmm ...
16:50rbuchmann-.-
16:51dnolenrbuchmann: actually going to have think about this some more, may not be a bug and a problem with JS values crossing contexts
16:51dnolenwhich I have no desire to handle
16:51rbuchmannhm, ok
16:51rbuchmanngonna file anyway, can always close it later :)
16:52dnolenrbuchmann: ok a reasonable approach for that patch.
16:52dnolenrbuchmann: would be to emit different code if the compile target is Node.js
16:53dnolenArray.isArray(x) for Node.js and everyone else will continue to use instanceof
16:53hlshipA quick question about the (ns) macro
16:53rbuchmannoh, ok
16:53hlshipFrom what I can tell, the requirement for the clauses (use / require / etc.) to be keywords was lifted back in 1.2-ish
16:53dnolenrbuchmann: so ticket welcome, it's a easy thing to patch.
16:54rbuchmannok ^^
16:54hlshipSo I prefer (ns x.yz (require [p.d.q :as q])) stile
16:54hlshipstyle
16:54hlshipthat is, symbols, not keywords
16:54dnolenrbuchmann: thanks for the report!
16:54hlshipit seems like the vast majority of the world still uses keywords
16:54rbuchmannsure, np, thanks for the help
16:54technomancyhlship: ns allows you to do all kinds of insane things. resist the temptation
16:54rbuchmannsorry for not figuring out the patch myself, not that familiar with the cljs source
16:54technomancyit is a known problem
16:55dnolenrbuchmann: pretty non-obvious I'd say :)
16:55bitemyappoh look, a new problem for which there isn't a satisfactory solution. Better write a new library.
16:55rbuchmannyeah ^^
16:55hlshiptrue; but if the ability to use symbols, not keywords, was intentionally introduced ... was that intention to move towards symbols and away from keywords?
16:56rbuchmanndnolen: oh, actually that wouldn't help me :D I use node-webkit, so the target is standard js, it just has access to node stuff
16:56rbuchmanndnolen: but that's probably a vast minority ^^
16:57ToBeReplacedbitemyapp: apache-commons?
16:57bitemyappToBeReplaced: locks, icky.
16:57bitemyappalso, java.
16:57technomancyhlship: symbols in ns actually works in 1.0.0
16:58hlshipinteresting; I looked at the source and thought the changes to support symbols was more recent
16:59ToBeReplacedwhat is the difference between (use 'foo :only [bar]) and (require 'foo :refer [bar])?
16:59hlshipSo, is the history something like "hey, require inside the ns macro is different than outside it, let's fix that by making it a keyword, e.g., :require" ?
16:59ToBeReplacedassuming there is one since the require :refer isn't available in cljs
17:00technomancyhlship: right; ns is supposed to read as being declarative
17:00technomancyeven though you can put whatever you want in it
17:00hlshipMaybe I'll change some of my code; I prefer the look using symbols rather than keywords.
17:00technomancy(ns insane.stuff (println :some :thing))
17:01hlshipBut apparently it might through people for a loop.
17:01technomancyhlship: down that road lies bracket placement wars
17:01technomancyit's just not worth it
17:02yeoj___the source says flush is simply (. *out* (flush)) ... how but if i call flush while a long-running function is happening nothing comes out at the repl when i issue a println ?
17:04indigobitemyapp: I just had the most terrible idea... ClojurePHP
17:05dnolenindigo: there have already been several attempts at that
17:08rbuchmanndnolen: You do know that Halloween is over? :D
17:08TimMcHalloween is a state of mind.
17:09indigodnolen: Thankfully none of those have been successful
17:11llasramIt sometimes seems like the most frequently-mentioned languages on this channel are Clojure, then PHP, then Java
17:12noncomwhat is the best solution for interleaved better-be-tailrec loops? here is a pseudocode: https://www.refheap.com/20503
17:12yeoj___english is often mentioned
17:13noncomi know that this look tooooo imperative and non-clojuric, but i have to put this little if-based algorithm into my program in one single tiny place...
17:13llasramnoncom: AFAIK there isn't a good one. There was some discussion of named `recur` targets on the dev list, but I don't believe has left the design-discussion stage
17:14noncomllasram: yeah, i googled into them a few minutes ago..
17:14llasramyeoj___: I'm going to call use/mention distinction on that one :-p
17:14gfredericksI thought amalloy had written something
17:14S11001001noncom: iterate, dorun
17:14S11001001er, iterate, drop-while, first
17:14noncomoh
17:15noncomi guess i will have to create an artificial mocking infinite lazy pseudo-seq for that.. right?
17:16TimMcllasram: grep counts 957 instances of \bphp\b (case-insensitive) since March 2011.
17:17indigoRuby is probably mentioned more
17:17llasramIf you go an inflate the numbers like that, sure :-p
17:18noncomso looks like (iterate) handles this sequence-creation part
17:18bitemyappother than apache commons, are there any libraries people tend to use for resource pooling?
17:18TimMcIf I filter out "java.", I still get ~15k instances of java.
17:19TimMcClojure, with word boundaries and excluding #clojure, counts to nearly 100k.
17:19TimMcRuby: 2315
17:20llasramI'm glad to know my impression in this regard is false
17:20noncomS11001001: i can't really figure how to do that.. could you refheap the main structure, somehthing like my pseudocode?
17:21seangroveI wonder if js's function.length is an artifact of implementation (I doubt it) or a special case where someone thought "Oh, we could pretend arity is length!"
17:22bitemyappseangrove: I smell a place where a type system could've saved some pain >:)
17:22bitemyappmy spidey-types are tingling!
17:22`cbpyou can do that? :/
17:22bitemyappucb: http://www.youtube.com/watch?v=a4Bb1g8k8mQ
17:23seangrovebitemyapp: Well, the pain was burned in ages ago, I know about .length now..
17:23bitemyapp`cbp: terrifying, no?
17:23TimMcseangrove: Whoa.
17:24noncomhttp://ejohn.org/blog/javascript-method-overloading/
17:25bitemyappWatching my rabbitmq socket descriptors go from "3 -> 138 (out of 138 available)" and watch it blast to "red" is way more entertaining than it should be.
17:26seangrovenoncom: Clean and neat T.T
17:26seangrovebitemyapp: What're you using rabbitmq for? We need to get off of clojure-resque, the lag is hirrific
17:27S11001001noncom: on second thought, welp, (loop [] (if a? (something) (loop [] (when-not b? (recur)))) (recur))
17:27bitemyappseangrove: that's how data gets propagated to the data warehouse I'm working on
17:27bitemyappseangrove: it's been integral to the system I'm building/have built
17:27bitemyappI'm really just hardening it up and doing some resource exhaustion whack-a-mole :)
17:28bitemyappturns out, when you use a fast language that is capable of spawning n-threads, you can exhaust resources *really* quickly compared to your coworkers' python code
17:28noncomS11001001: but won't that be nested loops instead of interleaved?
17:29noncomreally i can think of a solution where i use a couple of atoms to semaphore the correct branching but it... uh well.. smells..
17:30S11001001noncom: what you wrote was nested
17:31llasramS11001001: yeah, but the inner `loop` needs to `recur` to the outer `loop`
17:31noncomS11001001: it would be nested with current clojures loop-recur implementation. however, i put imaginary loop names there to stress the interleaving..
17:32S11001001noncom: if you want mutual recursion, put a switch in a single loop and use it to pick which path you want on each go-round.
17:32noncomyes, i think thats the only way..
17:32noncomwell at least you think so too :D
17:36llasramletfn + trampoline would be (maybe) slower, but might be more readable
17:45brainproxyanyone know what's up with ctrl-meta-... sequences in terminal emacs on mac using iterm2?
17:46brainproxyit's like iterm2 is swallowing the ctrl key
17:47bitemyappbrainproxy: it's not great, I use Emacs for Mac OS X, not the terminal.
17:48casper1I am wondering, is it possible to create a default implementation in extend-protocol? (like providing :else in a cond)
17:48llasramcasper1: Sure. Just extend the protocol to `Object`
17:49llasramEr, assuming you were talking about JVM Clojure
17:49casper1indeed i am :)
17:49brainproxybitemyapp: i prefer "graphical" emacs on mac os x too; but when pairing, it's simpler to use wemux and terminal emacs
17:50S11001001brainproxy: mess with your terminal preferences, IIRC 10.6 added the needed tweaks
17:50bitemyappbrainproxy: nuts.
17:50casper1and thanks, i'll try that one
17:50S11001001oh, iterm2, no idea
17:51ubikationhey what is it called if I want to write a function to deal with multiple kinds of arguments?
17:51abaranoskypolymorphic
17:51ubikationam I looking for dynamic dispatch or typed clojure or what?
17:51ubikationah
17:51abaranoskyubikation: you can use multimethods or protocols
17:52llasrambrainproxy: I know that for (u)xterm I needed to (re)define some of emacs' input->key mappings for my terminal settings
17:52llasramhttps://github.com/llasram/rcfiles/blob/master/basic/emacs.d/init.el#L164-L171
17:52ubikationabaranosky: which would you recommend? which has better performance?
17:52llasrambrainproxy: If you can figure out what your terminal is dishing up, it shouldn't be too hard to get emacs to accept it as the right key-combos
17:53abaranoskyubikation: it depends :)
17:53abaranoskybut protocols have better performance
17:53abaranoskybut I usually only care about performance to any degree *after* profiling
17:54llasramAnd they do have properties which I think distinguish them more than performance...
17:55llasramIt definitely makes them very different that you can extend multimethods to arbitrary non-type things, and that you can `reify` protocols
18:08j`eyTimMc: hiya
18:09j`eyTimMc: oh, maybe a case of mistaken identity
18:10TimMcPerhaps. This is Tim McCormack.
18:10j`eyTimMc: wrong Tim
18:10j`eyTimMc: sorry for the noise!
18:11akurilinIf you write a guide on iostreams for clojure cookbook, you will enjoy eternal glory.
18:11TimMcHah, no worries.
18:12indigo#include <iostream>
18:12indigo>:D
18:13akurilinindigo, :P
18:14ubikationabaranosky: which are easier to play around with?
18:35hlshipIs there a lein plugin for copying documentation to an FTP server? Right now, I'm doing that manually, producing docs via codox.
18:35hlshipDidn't see anything on the lein plugins wiki page.
18:37technomancyhlship: lein-shell+rsync?
18:41mtpwhat is ftp?
18:41technomancymtp: ask your grandpa
18:41mtpAh! a protocol that existed before TCP/IP
18:42mtpneat historical find, surely it isn't used on today's internet
18:42hlshipThat's nothing; I think I once used gopher
18:42gfrederickswhen a file and a computer love each other very much...
18:42hlshipand there was a time when I was king because I had the only 1200 baud modem
18:43TimMcEmail used to run on FTP, IIRC.
18:43hlshipI'm not sure rsync is an option for me; I'll have to see what my hosting provider allows
18:43hlshipit's really just a static site
18:43TimMchlship: If you have SSH, you have rsync.
18:43hlshipAnd I don't have SSH, so that's the issue.
18:43hlshipI can FTP, or use their web dashboard.
18:44TimMcSolution: Get a better host. :-P
18:44TimMc(Only 1/4 joking.)
18:44hlshipTrue, I just already have this one, and don't want to bother.
18:44hlshipAt some point, I should learn how to use Amazon's EC2 for this kind of stuff.
18:44hlshipIt's on my endless to do list
18:44TimMcnearlyfreespeech.net is pretty great, especially for static sites.
18:45hlshipBut I think I'd rather learn how to use Unity3d than EC2 right now
18:45TimMc(Dynamic options are limited to PHP and I think some CGI stuff, oh well.)
18:45hlshipif I had an free time
18:45hlships/an/any/ :)
18:47mtpTimMc‘ read the dates on the relevant RFCs
18:48TimMcOK, so what the crap did it use?
18:49mtps,dates on,, ???
18:49lazybotmtp: How could that be wrong?
18:49TimMcRFC 765 mentions TCP
18:50TimMcBut that's 1980, which is not what Wikipedia mentioned...
18:50TimMcWP has 1971 for FTP and 1974 for TCP.
18:51brehaut[citation needed]
18:53TimMcWell, RFC 114 (first FTP RFC) mentions https://en.wikipedia.org/wiki/Network_Control_Program
18:54brehauthuh intersting
18:55TimMcYeah. I've never dug into the pre-TCP stuff.
18:57mtp<mtp> neat historical find, surely it isn't used on today's internet
18:58mtp:)
19:01akurilinIs it fair to say that contains? cannot be used on a sequence, and you need to use something like into [] to make it work?
19:06alsoare there any good clojure parser libraries are usable with clojurescript?
19:09dnolenalso: a port of instaparse to CLJS would be awesome
19:12bitemyappakurilin: correct, but contains? on a vector is probably not what you want.
19:12bitemyappakurilin: contains? is about associative data.
19:12bitemyapp,(contains? [:a :b :c :d] :a)
19:12clojurebotfalse
19:12bitemyapp,(contains? #{:a :b :c :d} :a)
19:12clojurebottrue
19:12bitemyappyou want a set.
19:13bitemyappsets are associative by value, maps are associative by key (pointing to value), and vectors are associative by integral index (pointing to value)
19:13akurilinbitemyapp, probably explains why it's not listed under vectors in the cheatsheet
19:13bitemyappbut the "subject" of the "associative by" is what you're checking for WRT contains?
19:13bitemyappit's got a grammar/logic to it.
19:15bitemyappwhat's a verb for a basin?
19:15bitemyappI need NLP-as-a-service.
19:15akurilinbitemyapp, thanks for explaining, that's helpful.
19:15alsodnolen: yeah, that would be exactly what i wanted if it existed.
19:15bitemyappakurilin: thumbs_up.gif
19:16alsohas anyone written about porting from clojure to clojurescript? experiences or tools?
19:16dnolenalso: probably wouldn't be much work to port, probably possible to do with cljx
19:17alsodnolen: i'll give that a try
19:23bjadoes anyone know of clojure opportunities in chicago or remote?
19:23bjaI'd prefer to stay working within clojure or another functional language
19:23technomancyisn't groupon in chicago?
19:25bitemyappbja: I've seen a couple of Chicago lookin' posts on the mailing list.
19:25bitemyapptechnomancy: oh they're still in business?
19:25technomancybitemyapp: well... act fast
19:26technomancycould be a limited time employment offer
19:28gfredericksgroupon is in chicago and we have at least a dozen people writing clojure
19:28bitemyapptechnomancy: heard more good things about Seattle from some developers recently. Still concerned about the state of FP/Lisp (Clojure)/ML/Haskell out there.
19:28bitemyappgfredericks: if you can answer, what sort of things does Clojure get used for there?
19:29technomancybitemyapp: I think Bartosz Milewski (formerly of D) recently started up a haskell thing here
19:29muhoogood things are always niche
19:29muhoosturgeon's law
19:30bitemyapptechnomancy: oh god no, he's one of those Yesod people
19:30bitemyappI'd rather get flayed with a Cat o' Nine Tails covered in salt
19:30technomancyhaha
19:30bitemyappbrilliant people, but the stack is &_____&
19:31technomancyhe visited a seajure meeting once asking concurrency questions to steal ideas for D
19:31gfredericksbitemyapp: lots of data services; some storm
19:31bitemyapp~/code/basin/src/basin/holds/ya/resources/in/da/pool.clj
19:31clojurebotCool story bro.
19:31pjstadigclojurebot: botsnack
19:31clojurebotthanks; that was delicious. (nom nom nom)
19:31technomancybitemyapp: also: home of F# =D
19:32bitemyapptechnomancy: HUE HUE HUE HUE
19:32bitemyapp(╯°□°)╯︵ ┻━┻
19:33hiredmangfredericks: how is storm?
19:34technomancybitemyapp: there is a seafunc group, but they meet like 3-4x a year
19:34technomancyin grocery stores and stuff; it's really weird
19:34bitemyappo_O
19:34gfrederickshiredman: I haven't used it personally; I think the team that does has had good success on the whole
19:34bitemyapptechnomancy: they're mad category theorists?
19:35technomancybitemyapp: I only have been to one meeting
19:36brehauti managed to read one page of Basic Category Theory for Computer Scientists before my brain combusted.
19:36S11001001muhoo: naw man https://twitter.com/odersky/status/395831667333406722
19:36technomancythe one I went to didn't strike me as such; they were talking about Okasaki and how to make circular references with immutability or something
19:36technomancyS11001001: haha
19:36technomancylike he doesn't know?
19:37bitemyappbrehaut: really? http://www.cs.toronto.edu/~sme/presentations/cat101.pdf‎
19:37S11001001technomancy: I don't know
19:37S11001001technomancy: it's very confusing
19:39sritchiedo you guys have recommendations on embedding a product blog into a site?
19:39sritchieembedding a little jekyll blog seems slightly overkill,
19:39sritchiewith a redeploy for each new post
19:39brehautbitemyapp: nope. http://www.amazon.com/Category-Computer-Scientists-Foundations-Computing/dp/0262660717
19:39bitemyappsritchie: I made a micro-CMS, you could reuse the routes.
19:39bitemyapphttps://github.com/bitemyapp/neubite/ I don't know if you want to use MongoDB just for that though.
19:40bitemyappI don't know if you want to use MongoDB at all really.
19:41sritchiehmm
19:41sritchieyeah, maybe not
19:41sritchiemaybe jekyll's not too bad of an option
19:41bitemyappPedestal has a pretty useful componentization of sub-apps and routes within a global router, that would make it fairly straight-forward to make a sub-CMS thingy.
19:41bitemyappsritchie: I would tend to say jekyll's a good idea if your needs are limited.
19:42bitemyappif you need something full-blown like a Django app wedded to Django CMS, then...some work will need to be done.
19:42bitemyappyogthos: need an embeddable CMS.
19:42bitemyappyogthos: static and db-backed.
19:42bjabitemyapp: as someone who has been responsible for a django-cms-based product, you'll need to do some work on Django CMS if you want to use it too
19:43sritchieyeah, we don't really need a CMS, this is more for product announcements
19:43bitemyappbja: I know.
19:43bitemyappsritchie: jekyll / hakyll / misaki / static time then.
19:47bitemyappyogthos: also, sub-application routing.
19:47bitemyapp(in Ring)
19:56bitemyappJust found an improper resource acquisition in my code, made this gesture in front of my computer: http://i.imgur.com/v7mvMJh.jpg
20:06bjabitemyapp: any suggestions on github issues that a non-CLA-signed developer might work on in clojure land?
20:06bjaI'm bored and in a hotel room
20:06bitemyappbja: you can't contribute anything to Clojure itself as a non-signatory of the CA, but there are independent open source projects
20:06bitemyappbja: I actually have something in Revise you could work on!
20:07bitemyappthere are other libraries I could recommend if that doesn't interest you.
20:07bitemyappbja: what sort of thing do you want to work on?
20:08yogthosbitemyapp: ? :)
20:08bitemyappyogthos: what?
20:08yogthos(bitemyapp) yogthos: also, sub-application routing.
20:08bitemyappyogthos: I'm sharing ideas.
20:08bitemyappyogthos: embeddable CMS Ring app (embeddable in existing web apps) and sub-application routing.
20:09yogthosah
20:09bjabitemyapp: nothing in particular I want to work on. I'm just bored and want to make contributions on github
20:09yogthoscould work
20:10bitemyappbja: https://github.com/bitemyapp/revise/issues/2
20:16blrout of interest, is anyone building anything in pedestal that doesn't fit the 'real-time, collaborative' usecase that relevance describe the framework is ideal for?
20:56muhoois there some magick to make byte arrays in clojure without "java.lang.IllegalArgumentException: Value out of range for byte: 184" etc?
20:56brehautmuhoo: short arrays ?
20:56brehautmuhoo: or sadness?
20:57muhooi tried (-> seq-of-bytes-as-ints (map (partial bit-and 0xff)) (into-array Byte/TYPE))
20:57muhoofucking signed bytes in java
20:57brehaut,Byte/MAX_VALUE
20:57clojurebot127
20:57hyPiRionmuhoo: (partial unchecked-byte) instead
20:57hyPiRion,(unchecked-byte 255)
20:57clojurebot-1
20:57hyPiRion,(unchecked-byte 256)
20:57clojurebot0
20:58muhoohyPiRion: perfect! thanks!
20:58hyPiRionActually, you can just remove the (partial ...) wrapper, and just do unchecked-byte
20:58hyPiRionnp, been there, felt the pain
21:00blrdoes anyone have any recommendations for getting started with frp in cljs? widje looks potentially useful
21:01lynaghkblr: https://github.com/lynaghk/todoFRP
21:01lynaghkmight give you some ideas
21:01blrcool, hadn't come across that yet, thank you
21:04blrlynaghk: have you had a crack at a todo in pedestal-app?
21:12sritchietechnomancy: is there a way to force the prep tasks to occur BEFORE aot all, in the uberjar profile?
21:12sritchiegetting errors because the cljx files aren't ready yet
21:18sritchieanyone have any experience with that,
21:18sritchiewith getting prep-tasks to run before aot?
21:22lynaghksritchie: what version of cljx are you running?
21:23sritchie[com.keminglabs/cljx "0.3.1"]
21:23lynaghksritchie: I think your best bet is doing two lein invocations manually.
21:24lynaghksritchie: where you twiddle the with-profiles option as necessary.
21:24sritchiegotcha
21:24sritchieI think so - but this is on heroku, and I'm not sure how to override the uberjar task
21:24lynaghksritchie: you may need to use a custom buildpack, then
21:25lynaghkbut yeah. if you're on heroku then you definitely want to get an official answer from technomancy
21:25lynaghk= )
21:26lynaghksritchie: I really enjoyed your blog post about running Leadville, btw. That's boss.
21:26sritchiethanks, man
21:26sritchiefar, far shorter runs have been kicking my ass lately, not sure how it all came together on the day :)
21:27lynaghksritchie: yeah dude, I just did my usual run around the PDX-area volcano and my achilles is pissed. it's slowly dawning on me that I'm no longer 14 and invincible.
21:29sritchieso! my solution for that, for combating that a bit longer -
21:29sritchieI'm leaving Twitter on Friday and probably moving to Boulder around jan or feb
21:29sritchieand working full time on this clojure webapp I keep asking about, www.paddleguru.com
21:30lynaghksritchie: oh, rad! congrats dude.
21:31lynaghksritchie: I'm going to the Go conference in Denver in April, if you want to try and meet up for a beer
21:31xuserGo is bad word here
21:31lynaghkxuser: Go does a lot of stuff right, and we've taken quite a number of their good ideas.
21:32sritchieawesome, that sounds great
21:32sritchieI'll be speaking at the conj as well
21:32lynaghkxuser: e.g., core.async.
21:32lynaghksritchie: I'm missing it this year, unfortunately.
21:32sritchieah, too bad
21:32sritchieyeah, denver it is
21:32lynaghksritchie: rad. catch you in a few months, then = )
21:32sritchieboom
21:33lynaghkI've got to run for now though. Good luck with cljx
21:33sritchieI'll try to be more wizardly in cljs by then
21:33sritchietrying my custom buildpack now
21:33blrI find it disconcerting that "import 'github.com/foo'" is apparently standard practice in golang
21:34xuserlynaghk: just joking cause some here like to make fun of Go ;)
21:35xuserlynaghk: I'm still learning clojure, is core.async similar to gorotines and channels?
21:35blrxuser: actually _based_ on it iirc
21:36xuserblr: oh ok
21:36xuserI hear Haskell implements every concurrency model under the sun
21:37ddellacostawhat am I doing wrong to get "ReasonPhrase: Forbidden" when calling lein deploy clojars? I've double-checked my clojars pwd and my gpg keys, and they are correct to the best of my knowledge.
21:37ddellacosta*correct/working
21:42`cbpbitemyapp: I suck with git and probably made a mess but i improved the docs i think
21:42`cbpbitemyapp: Gonna work on providing backtraces for rql errors
21:43sritchietechnomancy: I ended up forking the buildpack and adding a call to cljx first
21:44amalloy`cbp: you're talking about https://github.com/bitemyapp/revise/commits/master ? it would be a little more polite/tidy to rebase rather than merge when it turns out upstream has moved on, but you don't seem to have made a big mess
21:45`cbpamalloy: I just did git pull and it merged automatically :-P
21:45amalloyyeah, i know
21:46amalloyi don't really like the "pull" command - it's nice when you're totally clueless, but after you get past that stage it's better to fetch, and then decide whether to merge, rebase, or something else. that's just my opinion, of course - git is *very* flexibly and there are a lot of reasonable workflows
21:54concurIs there a function like pmap which is good at iterating non-lazily with a function that has side effects?
21:55brehautdoc doall, dorun, doseq
21:55concurall I care about are the side effects
21:55concurit has to run in parallel though
21:55concurI guess I could use futures
21:55concurwithin a doseq
21:56concurwait, side-effects are a big no-no in futures, right?
21:56concurI mean, they're bad in general
21:57concurbut aren't they particularly bad with futures?
21:59seangroveconcur: (dorun (pmap ...))?
21:59MrJones98anyone here use groovy from clojure?
22:00MrJones98i'm looking at lein-groovyc and getting an NPE
22:00concurooh, dorun isn't what I expected
22:00concurthat's probably perfect
22:01seangroveconcur: It should be good for computer-intensive, vs io-bound
22:02brehaut~pmap
22:02clojurebotpmap is not what you want
22:02brehautsigh. i thought it explained that more because ive forgotten the details
22:02ddellacostawell, that's certainly definitive
22:03brehautchunking, thread pools, something something
22:03brehauthttp://blog.raek.se/2011/01/24/executors-in-clojure/ springs to mind
22:04ddellacostabrehaut: there's the standard doc too I suppose: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/pmap
22:08concurhmm, wrapping pmap in dorun didn't work on the whole sequence
22:09concurin fact it made less of the sequence get run
22:09concurmaybe it's a problem in my function
22:13concuroh
22:13concurthe side effects are working
22:13concurI'm running tests on those side effects
22:13concurand only some of the assertions are running for some reason
22:14concurthey're all passing
22:16concurI'm in essense doing this:
22:18concurI was going to write it in a more general way
22:18concurbut I'm just going to paste my code actually
22:18concur(dorun (pmap (fn [x] (rwl :write assoc x (* 2 x))) data))
22:18concur(dorun (pmap (fn [x] (is (= ((rwl :read) x) (* 2 x)))) data))
22:18concurso basically the first run populates a map
22:19concurand the second run asserts that each key is mapped to the right value
22:19concuryet for some reason it only does 970 assertions when there are 1000 items in the map
22:26`cbpbitemyapp: erm actually i have no clue what im doing so lets leave the backtrace for later...
22:38Raynesamalloy: I started using fetch about a month ago exclusively.
22:38RaynesFwiw.
22:38amalloyman, i thought you meant fetch the cljs library or whatever it is
22:39Raynesheh
22:43technomancysritchie: huh, so :prep-tasks didn't work for you?
22:43sritchiewell, aot was running pre-prep task
22:43sritchieand then my clojure.tools.reader issue came back :)
22:43sritchieso I'm o to other issues
22:44technomancysritchie: :prep-tasks runs before compilation
22:44technomancycan you provide a repro case where that doesn't happen?
22:44sritchiein the uberjar profile, that wasn't happening
22:45sritchiesure
22:47ddellacostaso, is it possible to re-deploy a jar that you've signed to clojars if you pushed it unsigned the first time? I'm having trouble figuring out how to do so.
22:48amalloyddellacosta: is there a reason you can't just deploy a new version?
22:48amalloylike, announce that version 2.1 is no good, here's 2.2
22:50technomancysritchie: I can reproduce having issues with :aot in the :uberjar profile, but all I'm seeing is that AOT is skipped entirely; prep-tasks still run
22:50ddellacostaamalloy: yah, I guess that's the easiest since it is a provisional release of someone else's library to fix a bug. But if it was a release of a real lib, it would bother me that I would have to bump the version number because the deploy went badly.
22:50sritchieokay, got a repro
22:50technomancysritchie: oh, try this: :prep-tasks ^:replace ["cljx" "javac" "compile"]
22:50sritchiehmm
22:50sritchiehttps://gist.github.com/sritchie/7330591
22:52technomancysritchie: this is really weird how I can't trigger compilation *at all* during jarring
22:53technomancysritchie: oh, you know what it is...
22:53sritchiewhat's that?
22:53technomancyfor some reason the default :prep-tasks is set to ^:displace
22:53technomancyso the existing value gets blown away when you specify your own value
22:53technomancyI have no idea why it works that way; hrm
22:53technomancyanyway, you'll need to put "compile" in :prep-tasks and it should be fine
22:54technomancyddellacosta: yeah, I'm thinking about allowing redeploys of libs that don't have signatures that check out
22:54technomancyfeel free to open an issue
22:55ddellacostatechnomancy: I guess the main thing that I'm uneasy about is, are there security issues involved with allowing re-deploys? Was that why the choice was made initially?
22:55ddellacostatechnomancy: or does it have to do more with repeatability?
22:56ddellacostathat seems like it would be a more cogent reason
22:56technomancyddellacosta: more about security; if we assume immutability by default then any change to checksums is suspicious
22:56technomancymuch easier to verify the repo in the case of a possible intrusion
22:57technomancybut maybe we can just say "hey, if it isn't signed, we shouldn't be trusting it anyway"
22:57technomancyor there could be an hour window or something
22:57ddellacostatechnomancy: yah, okay, that's what I suspected. Yeah, I suspect that it could be conditional--the obvious thing would be, if it is unsigned allow pushing a signed version. Otherwise don't allow updates.
22:58technomancyddellacosta: unfortunately it's not that simple
22:58technomancyyou have to accept one file at a time; there is no transactionality about it
22:58concuris it possible that running multiple assertions with the is macro simultaneously could shadow one of the assertions?
22:58technomancyso you can't accept a jar provisionally assuming it's followed by an .asc
22:58technomancybecause HTTP is stateless =(
22:58technomancythis is one place where scp is way better
22:59concurfor some reason, some of my assertions are not being made in my call to pmap
22:59concurand it's a random number
22:59ddellacostatechnomancy: ah, okay, I see. Hmm...so in that case allowing a window of time may make the most sense. During that time it can be considered untrusted...and after that no updates are allowed.
22:59concurI'm only seeing about 90-95% of the assertions I should be seeing
23:00technomancyddellacosta: yeah, that makes verification mostly sound without annoying package authors
23:00technomancyprobably a reasonable compromise
23:01ddellacostatechnomancy: yeah, and I would agree with your suggestion earlier that unsigned packages should be considered untrusted, definitely. But in any case allowing a window would give someone like me who fumbled their first push the option to get a signed version up (for example, I'm sure there are other good reasons to allow a bit of a window).
23:02cespareIs there something like take for a string that just returns a string?
23:03tim_cespare: http://clojuredocs.org/clojure_core/clojure.core/subs
23:03cesparetbaldridge: thanks
23:52logic_progis there something more efficient than (apply vector (concat .... ) ) ?
23:52logic_progI need something to return a vector, but concat returns a list
23:56jared314logic_prog: apply vec?
23:56jared314logic_prog: wait, that won't work
23:56hfaafbvec is apply vector
23:57logic_proghmm, good to know
23:57logic_progbut is a list still constructed "in between" ?
23:58logic_progwell wait
23:58logic_prog(apply vector 1 2 3 '(4 5 6)) is okay
23:58logic_progbut (vec 1 2 3 '(4 5 6)) is not
23:58logic_progseems like vec only takes 1 argument