#clojure logs

2014-01-09

00:02dsrxcerealklr: btw http://symbolhound.com/?q=clojure&l=&e=%40&n=&u= (the "@" was included in the exact phrase via advanced search)
00:02dsrx(needed to do that to not see a lot of @mention noise in github issues and stackoverflow and such)
00:08cerealklrdsrx: That's an awesome tool. Thanks!
00:21seancorfielddare i ask who here is using mongodb and what library you are using?
00:21seancorfieldcurrently evaluating options, after using congomongo for a couple of years
00:28eggheadseancorfield: i've been using congomongo for some time too, but monger looks pretty nice
00:33maravillasb
00:40seancorfieldegghead: yeah, that's where i'm leaning atm... monger would allow me to get away from dynamic global variables, and has much better documentation
00:44hiredman /win 11
00:59nopromptdnolen: if you're around i have a design question around building a generic component.
00:59abaranoskyseancorfield: I used monger a little, but honestly not enough to say much... bu tit does have nice docs
01:00nooniani'm also interested in how best to build generic components
01:02nopromptnoonian: have you any thoughts about it?
01:03seancorfieldabaranosky: anything that bothered you about monger?
01:03nooniani haven't thought too hard about it, but i have gone down a few paths that probably aren't the right way to do it
01:05nooniani've been using sablono for hiccup like syntax, and one thing you can do with that is instead of writing components at all, just right pure functions that return sablono data and call them from your components. This works fine, and allow you to just use normal function calling syntax instead of the build interface, but it wouldn't work for someone who isn't using sablono and wrapping their sablono syntax with (html ...)
01:06xpikai have lein installed but i can't find standalone clojure? Where could it be?
01:06seancorfieldxpika: what do you mean by "standalone clojure"?
01:06seancorfieldcan you do this? lein repl
01:06xpikaclojure file.clj ... *run file*
01:06nooniani have some more general questions about how you should treat your app's state; for example, should i avoid storing any mutable state there? (like objects from 3rd party js libs)
01:07seancorfieldlein expects you to use a project to run code
01:07seancorfieldlein new app myapp
01:07seancorfieldthen cd myapp; lein run
01:07seancorfieldand it will run src/myapp/core.clj
01:08seancorfield(since you said lein new _app_ to create the project)
01:08xpikaseancorfield: could it be that i have individual file running program somewhere anyway?
01:08seancorfieldyou pretty much can't run a standalone file without dependencies / classpath etc...
01:09seancorfieldbut there's probably a leiningen plugin that will let you run a standalone non-project file
01:10noonianbut as far as components go, to me it's unclear whether a component should prefer to take structure it's logic around the state of the cursor it's given, or the :opts map that you can pass in. Doing it in the cursor results in nicer calling syntax imo, but it feels weird that third party components would influence how you have to structure your apps 'state' so you can pass them the appropriate data to render themselves.
01:10abaranoskyseancorfield: there were some small warts in the api, like needing to explicitly use call to (array-map ...)
01:11ddellacostahow can I run a single clojure.test test in the repl?
01:16ddellacostaah, I see that you can run it directly, but fixtures get borked. Also, http://dev.clojure.org/jira/browse/CLJ-866?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab
01:17ddellacostalooks like it's in 1.6, huh
01:40bitemyappddellacosta: I've never actually used fixtures.
01:41ddellacostabitemyapp: I use them a fair amount with clojure.test. Very handy for some things.
01:46shaunxcodeanyone know what the status of avout is?
01:48sm0keunmaintained i would say
01:48bitemyappddellacosta: I think I accomplish the same thing via simple function calls, but it's entirely likely I could be wrong as I don't really know what people use them for.
02:03TolstoyDo you guys know what it is about this: "{:id :3fc334c0-2214-4f0f-baba-5485c11e1b1f}" that kills the clojurescript edn reader?
02:03seancorfieldddellacosta: you can run a test fn manually but it's ugly
02:03seancorfieldsee https://www.refheap.com/22653
02:03TolstoyAh, starts with a number.
02:03TolstoyJeez.
02:03seancorfieldthat runs an each fixture (each-fn) around the foo test fn
02:05TEttinger,:3
02:05ddellacostaseancorfield: thanks, that's better than nothing
02:05clojurebot:3
02:05TEttingerhm
02:06seancorfieldif you need a once fixture you'll need to improve a bit :)
02:06TEttingerTolstoy, that looks like uh... it shouldn't be a problem huh
02:06TEttingerclojure can handle it on JVM...
02:06TolstoyTEttinger: It's definitely that the keyword starts with a number. Works okay in Clojure, just not Clojurescript.
02:06TEttinger,{:id :3fc334c0-2214-4f0f-baba-5485c11e1b1f}
02:06clojurebot{:id :3fc334c0-2214-4f0f-baba-5485c11e1b1f}
02:06seancorfieldTEttinger: for EDN, keywords cannot begin with a digit - for Clojure they can
02:07TEttingerhuh
02:07seancorfieldTolstoy: use a regular clojure(script) reader instead of edn?
02:08Tolstoyseancorfield: Using cljs-ajax, decided to ditch JSON for fun.
02:08Tolstoyseancorfield: It uses cljs.reader/read-string.
02:08seancorfieldnot edn then? (you said edn earlier)
02:09TolstoyDoes clojurescript have an edn reader outside of cljs.reader?
02:09Tolstoy(I know about clojure.edn.)
02:10seancorfieldedn reader != regular clojure/cljs reader
02:10seancorfieldbut it sounds like you hit a bug in the cljs reader - you should file a bug on JIRA
02:11TolstoyYou mean it's not official that keywords can't start with a number?
02:11seancorfieldit's de facto allowed - since clojure's reader allows it - but edn does not allow it
02:12seancorfield1.6 master introduced a change to disallow it recently but then reverted that change (for clojure)
02:12seancorfieldthe thread is probably on the clojure-dev mailing list
02:12TolstoyInteresting. I use clojure.edn on the server side, and it read those keywords back in (from the file system) just fine.
02:13seancorfieldhmm, check the edn spec - pretty sure that shouldn't be legal in edn, only in clojure itself
02:13seancorfield(i may be wrong of course)
02:14shaunxcodeyeah that is a valid bug in clojure.edn/read-string
02:14Tolstoyshaunxcode: that it ALLOWS :34abc?
02:15shaunxcodeyeah that should not be allowed
02:31abaranosky /msg bbloom already found a use for map-state
02:56derek_chow do you update leiningen?
02:56derek_cah, I see a upgrade command
03:25riley526With dommy, how do you make a selection by attribute, e.g. $('tr[data-id=1]')? I tried (sel1 "tr[data-id=1]") but I got "Uncaught SyntaxError: Failed to execute query: 'tr[data-id=1]' is not a valid selector."
03:25riley526The jQuery version definitely returns the right thing.
03:25daGrevisso clojure is compiled to java byte-code?
03:27TEttingerdaGrevis, yes. clojurescript is compiled to JS
03:28TEttingerclojure is compiled to .class files
03:53logic_progthe top result on google for "clojure etags" is this so answer: http://stackoverflow.com/questions/1481842/clojure-emacs-etags -- is there a better way to use clojure / tags ? (all I want is to be able to specify a function name, and jump to that function). Node: I'm using cljx, so a nrepl-based-solution would probably jump me to the auto-generated *.clj file rather than the *.cljx file it comes from.
04:11augustllogic_prog: nrepl has this
04:11logic_progaugustl: can you point me at docs / a blog entry ?
04:13augustllogic_prog: I could google it for you :)
04:13augustldon't have anything bookmarked ^^
04:13logic_progwhat am I googling for ? "nrepl tags" ?
04:13logic_progand how do I jump back to the cljx file
04:13augustlnrepl emacs jump to implementation maybe
04:14logic_progaugustl: I don't see it on the first 3 pages of results
04:14logic_progwhy don't you google it for me? :-)
04:14logic_progmy google fu is weak
04:14augustlto jump back, C-x b RET will do that (jumps back to the previous buffer)
04:23SouthyI find having the repl in another pane makes life easier, then C-x o swithes between panes
04:25katoxc-c c-z to jump back and forth between repl and a file
04:25katoxplus I can't recommend winner-mode enough
04:25clgvSouthy: additional REPL monitor for the win ;)
04:27Southyclgv: given how muc a second monitor on my iMac would be cost, I think I will give that a miss!
04:28clgvyeah, the advantage of a non-aplle product ^^
04:28clgv*apple
04:29clgvcheaper and extensible :D
04:30SouthyI love apple stuff, but I could never convince anyone that it is better than a custom desktop with Linux, due to the cost
04:30SouthyI do a bunch of iOS development so it is a no brainer for me
04:31Southyswitching between clojure in my spare time and objective-c at work is feeling weird at the moment!
04:32kzar(Has anyone made a linux laptop comparable to the MBP yet? The pixel is the only one that looked close to me but it has a tiny hard drive.)
04:33SouthyThe specs on the MBP are really high, hence the price. Dell come close, but the price is similar, and then don't supply linux on their top end laptops
04:33ahihiSouthy: you know you can connect any display to a mac, right?
04:34SouthyYeah, but not with full thunderbolt connectivity, and there aren't many monitors less money than the apple one with the same resolution
04:36Southynot a fan of mismatched resolutions! there are some promising ones coming from china, they are the rejected apple panels put in a similar body, for half the price, if you can actually find someone selling them
04:37ahihiright, thunderbolt... my mac pro is old enough that I don't need to worry about that :P
04:38ahihiI have three displays, all with different resolutions. ;) it's not optimal, but it sure beats having only one
04:38Southyplus it is an iMac, so you need extra connectors :P my macbook is connected to a normal monitor over HDMI
04:38kzar(I want to get occulus rift when it comes otu and use a 3D window manager that would give the illusion of a wall of amazing monitors... if that's possible?!)
05:17yogsotothHi all! Using leiningen2 where should I put my .jar for the plugins?
05:18yogsotothlein install in my project dir create a local jar, but I don't know what to do with it. I can't find it by putting the information in .lein/profile.clj
05:25turbopapeHi guys,
05:25turbopapewould you recommend openjdk for production ?
05:25turbopapeor shall you strictly stick with oracle's vm ?
05:26Southythey are basically the same these days
05:26turbopapeok...
05:26Southyjava 8 is being developed by the openjdk people
05:26TEttingeris oracle more optimized in any way? or does OpenJDK have the same HotSpot JIT?
05:27turbopapeThink it's the same Engine HotSpot-wise...
05:27Southyyeah, pretty sure the compiler is the same
05:29turbopapeokay, I have another question : How many times does one have to turn back to java... I mean, to optimize calculations, etc...
05:29turbopapeOr (Hopefully) will I stay with Clojure (Hopefully) ?
05:30turbopapeI mean, these are to assess your feelings in productions, that's why I am asking ... :)
05:33oskarkvturbopape I think not a lot. The things that might be too slow sometimes is the datastructures and primitives (boxing). But one can avoid boxing a lot of the time.
05:34turbopapeoskarkv, by datastructures you mean like (defrecord) ?
05:34oskarkvare* :P
05:35oskarkvno i mean the standard ones, like vectors and maps. I don't know how fast they are, but they are doing more work than mutable ones.
05:36turbopapeokay oskarkv , so what is boxing about basically, If i may ask ? (excuse for the n00bness )
05:37oskarkvturbopape it's when primitives (int, double, etc) are put into objects (Integer, Double) to fit into certain arguments and data structures
05:37turbopapeok ...
05:37turbopapeoskarkv, so you are talking java interop ?
05:38oskarkvno
05:38oskarkvAnd boxing can happen in pure java too'
05:38turbopapeokay
05:39turbopapeSo oskarkv, If I write my whole greedy algorithm in pure clojure, can I rely on - say - map to be performant ?
05:40turbopape(map #(+ % %) vect1 vect2) for instance...
05:40turbopapewhere vect1 et vect2 would be huuuuuge :)
05:40kzar,(map + (range 10) (range 10))
05:40clojurebot(0 2 4 6 8 ...)
05:41kzar,(nth (map + (range) (range)) 1000000)
05:41clojurebot2000000
05:41turbopapeyeah, kzar, thank you
05:41turbopape:)
05:42turbopapeI suppose that if the bot handles it,that says all about it :)
05:42darthdeuswhy do i need to write (-> 5 #(/ % 3) #(+ 4 %)) like (->> 5 (#(/ % 3)) (#(+ 4 %))) ?
05:43marianoguerraI find myself using pretty offten (swap! atom-with-map #(assoc[-in]/dissoc[-in] % k [v])) is there a simple lib that provides me a "bucket" kind of thing where I can do (get bucket & ks) (set bucket & ks value) (delete bucket & ks)?
05:43marianoguerraor am I missing something?
05:43marianoguerra(I only use this when I need it, I'm not simulating mutability all over the place with this :D
05:43DerGuteMoritzdarthdeus: because #() creates a function but -> only does a code surface transformation. try (-> 5 (/ 3) (+ 4)) inst ead
05:44DerGuteMoritz*instead
05:44DerGuteMoritzdarthdeus: that is transformed to (+ (/ 5 3) 4)
05:44darthdeusDerGuteMoritz: (/ 3) doesn't do what i want, since i want 3/x and not x/3 :)
05:44darthdeusthe other way around
05:44oskarkvdarthdeus because the reader macro #() is expanded first to (fn ....)
05:44DerGuteMoritzdarthdeus: ok then use ->> instead
05:45darthdeushmhmm
05:45DerGuteMoritzthat will be transformed to (+ 4 (/ 3 5))
05:46oskarkvnote that you can write (-> 5 (/ 3) (+ 4)), and that in the case of (#(...)) it does not matter if you use -> or ->>
05:46oskarkvdarthdeus
05:46darthdeusbut how does the extra parens with #(...) help there?
05:46oskarkv,(macroexpand '(-> 1 #(+ % 1)))
05:46clojurebot(fn* 1 [p1__73#] (+ p1__73# 1))
05:47oskarkvsee the 1 after fn*?
05:47oskarkvthat's not right
05:47oskarkv,(macroexpand '(-> 1 (#(+ % 1))))
05:47clojurebot((fn* [p1__98#] (+ p1__98# 1)) 1)
05:48darthdeushmm interesting
05:48DerGuteMoritzthe extra parens result in the anonymous function created with #() to be applied
05:48oskarkvbut as i said
05:48oskarkv,(macroexpand '(-> 1 (+ 1)))
05:48clojurebot(+ 1 1)
05:48oskarkvworks
05:48DerGuteMoritzyeah no need for #()
05:49oskarkva lot of the time anyway :P
05:49DerGuteMoritz yeah :-)
05:49DerGuteMoritzunless you feel like adding a dash of perl to your code
05:49darthdeusi guess i was confused because i thought (+ 1) is a partial application
05:50Jardahey! https://github.com/mylesmegyesi/metis is a great tool for validating input. But do you know a similar that would also return the input sanitized (would remove additional properties and transform numbers from strings to numbers etc)
05:50oskarkvdarthdeus oh, but clojure does not do implicit partial application
05:51darthdeusmy brain still thinks every FP language is like haskell
05:52whilo_ibdknox: thanks for opensourcing!!!
05:52oskarkvdarthdeus also not that (+), (+ 1), (+ 1 2 3 4 5) etc are all valid expressoins
05:52oskarkvnote*
05:56oskarkvmarianoguerra you dont need #() around assoc there. (swap! atom assoc-in [:a :b] 1) works. Also, there is (reset! atom value) to just set the value without using a function
05:57oskarkvmarianoguerra and get is of course @atom
05:58oskarkv(get-in @atom [k k2])
07:30derek_cwhen you are on REPL, how do you clear the input? ctrl+c terminates the whole REPL
07:30sm0kectrl-l
07:30sm0kedepends actually on the readline config
07:30sm0keoh you said input
07:31sm0kewhaever you use in emacs i guess
07:31sm0keC-k?
07:32sm0kewell the support for readline in clojure repl sucks big time
07:32sm0keits basically the problem of jline
07:32sm0keno blame on lein
07:40sm0keis it possible to get a fully resolved name from a macro of a function
07:40sm0keso i want a macro like (weird-macro inc 1) which returns 2 and prints "clojure.core/inc"
07:42hyPiRionsm0ke: readline issues are dependent on the JVM, not packages trying to solve the issue, trust me on that
07:42sm0ke,(defmacro weird-macro [f & body] `(do (~f ~@body) (prn ~f))))
07:42clojurebot#'sandbox/weird-macro
07:42sm0ke,(weirdmacro inc 1)
07:42clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: weirdmacro in this context, compiling:(NO_SOURCE_PATH:0:0)>
07:42hyPiRionit's hard to get it working right on JVM
07:43sm0ke,(weird-macro inc 1)
07:43clojurebot#<core$inc clojure.core$inc@102e37e>\n
07:43DerGuteMoritz,(defmacro weird-macro [f & body] `(do (prn `~f) (~f ~@body)))
07:43clojurebot#'sandbox/weird-macro
07:43DerGuteMoritz,(weird-macro inc 1)
07:43clojurebot#<CompilerException java.lang.RuntimeException: No such var: sandbox/f, compiling:(NO_SOURCE_PATH:0:0)>
07:43DerGuteMoritz,(defmacro weird-macro [f & body] `(do (prn `~~f) (~f ~@body)))
07:43clojurebot#'sandbox/weird-macro
07:43DerGuteMoritz,(weird-macro inc 1)
07:43clojurebot#<core$inc clojure.core$inc@102e37e>\n2
07:43DerGuteMoritzarg
07:44sm0keDerGuteMoritz: doesnt works
07:44sm0keDerGuteMoritz: i checked on my repl
07:44DerGuteMoritznested quasiquote is tricky
07:44DerGuteMoritzjust a sec, will not spam the channel
07:44sm0kehyPiRion: no
07:44sm0kehyPiRion: i dont agree
07:44sm0kehyPiRion: python did a pretty good job man
07:44sm0keits really barebones
07:45sm0keall you had to do was wrap readline already present in unix
07:45sm0ke!!!
07:45sm0kereally!
07:46sm0ke,(defmacro weird-macro [f & body] `(vec (~f ~@body)))
07:46clojurebot#'sandbox/weird-macro
07:46sm0ke,(weird-macro inc 1)
07:46clojurebot#<RuntimeException java.lang.RuntimeException: Unable to convert: class java.lang.Long to Object[]>
07:46hyPiRion,(defmacro weird-macro [f & body] `(do (prn (var ~f)) (~f ~@body)))
07:46clojurebot#'sandbox/weird-macro
07:46sm0ke,(weird-macro inc 1)
07:46clojurebot#'clojure.core/inc\n2
07:46sm0kewhoa!
07:46sm0keyou are a genius
07:47hyPiRionI have my moments :p
07:47DerGuteMoritzvar is a good idea
07:47rurumateis there a library to do something like curl -O, i.e. streaming http (to file, or to seq)
07:48sm0kerurumate: well http libs normally return inputstreams
07:48sm0keyou can write that to file or whatever by reading chunks
07:49rurumatesm0ke: oh really? I'll chek if clj-http has that
07:50rurumateok there is {:as :stream}, thanks for the hint
07:50sm0ke,(doc var)
07:50clojurebotTitim gan éirí ort.
07:50TEttingerI'm wondering what can be accomplished with code-golf to make as short of a gcd function as possible. you have 10 chars. Can it be done?
07:50sm0kewhat!
07:51sm0kehyPiRion: hey how did you figure that out?
07:51sm0kehyPiRion: how do you 'think in macros'?
07:52hyPiRionsm0ke: first, think what you want the macro to expand to
07:52hyPiRionsecondly, use macroexpand-1 to check if the expansion you do is correct
07:52hyPiRionwell, that's essentially it for me really.
07:53sm0kehyPiRion: so you think like a compiler ?
07:53sm0kelol
07:53TEttingerBE the compiler
07:53hyPiRionsm0ke: well, sort of
07:53sm0kehmm its weird, although i know macros would work on the code a data, but its easy to forget they can also execute code normally
07:54hyPiRionexcept you just transform one piece of code to another piece of same code
07:54sm0kehyPiRion: you can have a macro just starting with (if) or (when) too right?
07:54hyPiRionyeah, sure thing
07:54sm0kethats where its sucks to reason about it
07:55sm0kei mean if it starts with `() as top level form, its really easy to reason about
07:55sm0keotherwise not so easy
07:56hyPiRionindeed. It's usually very, very smart to use macroexpand-1
07:56sm0kejoc has some complex macros
07:56sm0keyea sure thing
07:56hyPiRionor walk/macroexpand-all
07:56sm0kenah
07:56TEttingerso someone challenged me to a FizzBuzz code golf competition (I used clojure, he used Chicken Scheme), and while this works on my bot on quakenet because I pre-import a numeric tower lib, it won't here. My solution is 70 chars, his is 78.
07:56TEttinger,(map #(if-let[n({15"FizzBuzz"3"Fizz"5"Buzz"}(gcd% 15))]n%)(range 101))
07:56clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: gcd% in this context, compiling:(NO_SOURCE_PATH:0:0)>
07:57hyPiRionTEttinger: because 1.5 and onwards doesn't do read `hey%` as `hey %` anymore
07:57hyPiRionor 1.6, not sure
07:57TEttingeralso gcd isn't defined
07:58hyPiRionoh yeah
07:58TEttinger,(map #(if-let[n({15"FizzBuzz"3"Fizz"5"Buzz"}(gcd % 15))]n %)(range 101))
07:58clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: gcd in this context, compiling:(NO_SOURCE_PATH:0:0)>
07:58TEttingerso 8 chars
07:58davif I (use) a namespace A that's already (use)ing a namespace B, shoulding I see both the functions of A and B ?
07:58hyPiRion,(defn gcd [a b] (if (zero? b) a (recur b (mod a b)))) ;; TEttinger, try now
07:58clojurebot#'sandbox/gcd
07:59hyPiRiondav: no
07:59TEttinger,(map #(if-let[n({15"FizzBuzz"3"Fizz"5"Buzz"}(gcd % 15))]n %)(range 101))
07:59clojurebot("FizzBuzz" 1 2 "Fizz" 4 ...)
07:59TEttingeryep
07:59davhyPiRion: is there a way to ?
07:59TEttingerbut I'm running a lazybot and can't define
08:00hyPiRiondav: https://github.com/ztellman/potemkin has some ways of handling that
08:00derek_cwhen you are on REPL, how do you clear the input? ctrl+c terminates the whole REPL
08:00davhyPiRion: thanks.
08:00davderek_c: Ctrl+L
08:01davderek_c: then backspaces :)
08:01derek_cI mean, how do you clear the thing you already type in a line
08:01hyPiRionderek_c: C-a C-k
08:01derek_chyPiRion: that works :)
08:01davderek_c: Ctrl+C doesn't terminate the whole REPL for me btw.
08:01sm0kefking jline doesnt let me use my awesome vim bindings
08:01rurumateHow to consume and open InputStream? I usually call file-seq, but this is not a file, and it might not be newline-delimited
08:01derek_cdav: does for me
08:02sm0keand moeover it braks everything else
08:02rurumate*an open InputStream
08:02hyPiRionsm0ke: I think they would be very happy to get some contributions
08:02sm0keda da da
08:02davderek_c: http://tiswww.case.edu/php/chet/readline/readline.html#SEC4
08:04rurumateoh I see, clojure.java.io/copy may help
08:07sm0keis there a way to write a function in clojure which dispatches on type?
08:08sm0kei mean a multivariate based on type
08:08davsm0ke: you don't want to do (if (= (class.. ?
08:08sm0kemultivariate is the wrong term*
08:09sm0kedav: no
08:09davsm0ke: because it's ugly or because you have another reason ?
08:09sm0keits ugly
08:09hyPiRiondefmulti on type?
08:09davsm0ke: maybe with core.match :guards ?
08:09hyPiRionor just, you know, protocols
08:10sm0kewhat~ thats 3x ugly!!
08:10davyeah I guess that is kind of point or protocols ;-)
08:11dnolenTEttinger: (map #({15"FizzBuzz"3"Fizz"5"Buzz"}(gcd % 15) %)(range 101))
08:11dnolenTEttinger: quite a bit shorter
08:12sm0keor may be one can write a macro for me, defnt
08:12sm0kesome macro expert
08:13dnolensm0ke: multimethods
08:13dnolensm0ke: but protocols work just as well in the simple case
08:13sm0kemultiethods dispatched on types?
08:13TEttingerdnolen, maps have an else case when the lookup fails?
08:13sm0kedispatches*
08:13TEttingerwow
08:13dnolensm0ke: they can dispatch on anything the dispatch-fn returns
08:14dnolenTEttinger: yep
08:14TEttingerneat
08:14sm0kehmm weird how come i never used multimethods
08:15sm0keah nice
08:15sm0kemultimethods is the way i guess
08:15sm0kethanks
08:18sm0ke,(isa? 1 2)
08:18clojurebotfalse
08:18sm0kewhats so special about isa?
08:19sm0kewhy are multimethds using isa??
08:19lazybotsm0ke: What are you, crazy? Of course not!
08:19sm0kelol
08:20sm0keunless the whole point was to dispatch on types
08:21dnolensm0ke: ad-hoc hierarchies not connected to types
08:22sm0kewhat?
08:22clojurebotwhat is exceptions
08:23sm0keok
08:24sm0kelater!
08:27TEttinger,(map #(condp(fn[x y](= 0(mod y x)))% 15"FizzBuzz"3"Fizz"5"Buzz"%)(range 101))
08:27clojurebot("FizzBuzz" 1 2 "Fizz" 4 ...)
08:28TEttingereven without the numerics lib predefining gcd, it can be done in one less char
08:47alewdnolen: the reason maps have an else case is because it is just using get underneath, right?
08:48dnolenalew: ILookup
08:48dnolenalew: which is what get uses too
08:48oracle123what's the differnt for the following 2? one has "do" while another doesn't
08:48oracle123(defn bond [] (send b #((Thread/sleep %1) (inc %1))))
08:48oracle123(defn bond [] (send b #(do (Thread/sleep %1) (inc %1))))
08:48oracle123the one with "do" work as (await b) it will wait
08:49dnolen,(nil (inc 1))
08:49clojurebot#<CompilerException java.lang.IllegalArgumentException: Can't call nil, compiling:(NO_SOURCE_PATH:0:0)>
08:49dnolenoracle123: ^
08:49dnolenoracle123: w/o do you have function call on the result of Thread/sleep
08:50oracle123I just want to run the them one by one, so I need to use "do", correct?
08:50dnolenoracle123: sure, but you should understand why the first one doesn't work
08:50alewIt always a shock when you realize you have java interfaces underneath everything in clojure
08:51Kallikrates1Can anyone recommend some resources on workflow (excluding emacs?)
08:53oracle123understand now: without do, the first position of the out most list is (Thread/sleep 100) which is evaluated as nil, and nil is not a sepecial form or function. thanks very much
09:01jcromartieblerg
09:02jcromartiehaving an argument with a teammate about how to do "dependency injection" in Clojure
09:02jcromartiebecause he doesn't like the fact that a route handler function has to know that a database exists in order to get business objects from the database
09:02pyykkisjcromartie: partial application?
09:03jcromartiepyykkis: that's a possibility
09:04pyykkisjcromartie: this was lot's of fun to watch :) http://www.youtube.com/watch?v=ZasXwtTRkio
09:04goracihi there is there any way to update repo in maven ? any tools ? or native maven commands ?
09:04pyykkis(about scala, but with relevant topic)
09:05tbaldridgejcromartie: the more I use stuartsierra's component lib, the more I'm convinced that it does it right.
09:05jcromartieso instead of passing a db connection that the handlers use to call model functions, you pass partially-applied versions of the model functions?
09:06jcromartiethat's exactly what I advocate tbaldridge
09:06jcromartiewell, not specifically stuartsierra's component
09:07jcromartieIoC = taking arguments
09:07jcromartieand just a simple map of services
09:13goraciso any one familiar with maven here ?
09:17alewhow do you accomplish reification with stuart sierra's components if you want to work at a lower level than the interface provides?
09:18TEttingergoraci, I have some basic experience making java projects into maven projects
09:19stuartsierraalew: Not sure I understand your question.
09:19goraciTEttinger: so any way to update repos in maven repo ? with depencies
09:19katoxgoraci: st like mvn clean install -U
09:20goracikatox: it will update all the packages ?
09:21jcromartieas nice as stuart's component library is, we don't actually have any lifecycle :P they are all outside APIs
09:21jcromartiei.e. no connection pools
09:21katoxgoraci: packages in project deps
09:21alewI'm probably abusing terminology, and the question I am asking is probably a victim of any abstraction, but how would I take advantage of lower level optimizations of an underlying implementation of a component when needed?
09:21stuartsierrajcromartie: You don't have to use the Lifecycle protocol; it defaults to a no-op.
09:22katoxgoraci: transitively
09:22AeroNotixhi guys/gals. I have a Java jar I built with ant and I want to use it in my Clojure project. Any documentation on how to do that?
09:22jcromartiestuartsierra: what is the advantage over just using a map if there's no lifecycle?
09:22goracikatox: and what about lein update-in ? it will not do the thing ?
09:22AeroNotix(I'm using/learning Lein, too, so any documentation including that would be great)
09:22jcromartiestuartsierra: except the ease of adding lifecycle when the requirement inevitably comes along :)
09:23stuartsierrajcromartie: The dependency-injection part still works. You can subdivide your app into smaller components. Instead of passing one big map containing everything to every function, you can pass exactly what each component needs.
09:24vijaykiranAeroNotix: one way would be to add your jar to local maven repo, and add dependency in your project.clj
09:24AeroNotixvijaykiran: I have the .jar in my project's lib dir
09:24stuartsierrajcromartie: It's not a huge benefit for small apps, but it helps when you have 20+ components.
09:25jcromartieI see
09:25katoxgoraci: unusure, I use this http://dev.xscheme.de/2013/07/upgrade-your-projects-dependencies-using-lein-ancient-wip/
09:25alewbtw, is there any refactoring tools for clojure right now? I'm guessing not
09:25vijaykiranAeroNotix: in your lib dir do a maven install with your desired groupId and artifactId, that will install the jar into your local maven repo
09:26vijaykiranAeroNotix: then you can add a dependency
09:26AeroNotixvijaykiran: any docs on that? I'm not a java programmer so the maven stuff I don't understand
09:26stuartsierraalew: Sorry, still not understanding the question. Components are just records or maps, you can do whatever you want to them.
09:27vijaykiranAeroNotix: try http://www.elangocheran.com/blog/2013/03/installing-jar-files-locally-for-leiningen-2/
09:27edwA bit confused about this:
09:28vijaykiranAeroNotix: you need to customize the mvn install command in that post
09:28edw,(cond-> 42 even? inc)
09:28clojurebot43
09:28edwYet:
09:28alewstuartsierra: I was confusing your library with another one which worked with protocols for the actual dependencies, sorry about that
09:28stuartsierraalew: Ah, I see. No worries.
09:28edw,(cond-> 42 (even?) inc)
09:28clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core/even?>
09:28edwWhat's up with that?
09:28edwBecause:
09:29edw,(cond-> 42 (> 1) inc)
09:29clojurebot43
09:29alew,(macroexpand-1 (cond-> 42 (even?) inc))
09:29clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core/even?>
09:29alew,(macroexpand-1 '(cond-> 42 (even?) inc))
09:29clojurebot(clojure.core/let [G__127 42 G__127 (if (even?) (clojure.core/-> G__127 inc) G__127)] G__127)
09:30alew,(macroexpand-1 '(cond-> 42 even? inc))
09:30clojurebot(clojure.core/let [G__152 42 G__152 (if even? (clojure.core/-> G__152 inc) G__152)] G__152)
09:31AeroNotixvijaykiran: ok that's done, I think?
09:31vijaykiranAeroNotix: ?
09:31edwAh, I see: the tests don't get the value threaded through. I misunderstood what cond-> does.
09:31AeroNotixvijaykiran: I mean, I did that and now I have the repo in the ~/.m2 directory
09:32vijaykiranAeroNotix: ok, now you can add it as a dependency to your project
09:32edwI thought (cond-> 42 (even?) inc) would expand to (if (even? 42) (inc 42)).
09:32AeroNotixvijaykiran: done, just need to figure out how to import classes from it now.
09:33AeroNotixvijaykiran: is there a way to enumerate the available classes?
09:34vijaykiranAeroNotix: just try importing one of the known classes in repl, it should also have auto completion
09:34AeroNotixvijaykiran: hmm
09:35AeroNotixin a lein repl: (:import [local/<TAB>] == nothing
09:35stuartsierraAeroNotix: If you really don't know the pakcage/class names, you can examine the contents of the JAR file with `jar tf file.jar`
09:35AeroNotixstuartsierra: cheers, checking
09:36stuartsierraThere's no easy way to enumerate packages on the classpath, and I don't think any of the Clojure-based tools do so.
09:36vijaykiranAeroNotix: Do you know the source of the jar file ? "local" doesn't look like a plausible package name
09:37AeroNotixstuartsierra: ok I see that a class is available as "net/authorize/Market.class"
09:37AeroNotixand I'm trying to import it as: (:import [local/authnet.net.authorize Merchant]))
09:37vijaykiranAeroNotix: you don't need local/
09:37AeroNotixok trying
09:38AeroNotixvijaykiran: class not found
09:38AeroNotix(:import [authnet.net.authorize Merchant])
09:38stuartsierraIf the file name is "net/authorize/Market.class" you would import it as (ns (:import (net.authorize Market)))
09:38vijaykiranAeroNotix: use (:import [net.authorize Market])
09:38vijaykiranAeroNotix: the pacakge = folder path (with dots instead of /)
09:38AeroNotixvijaykiran: ok it RUNS
09:39stuartsierraThat is (ns foo (:import (net.authorize Market)))
09:39AeroNotixstuartsierra: ahhhh good tip
09:39AeroNotixthanks both
09:39vijaykiranyw
09:40stuartsierrayou're welcome
09:45AeroNotixso, what happens when two jars provide e.g. net.authorize?
09:46joegallofirst one on the classpath wins
09:46AeroNotixoke doke
09:48jcromartieso, for example, using stuart's component, would you build a web app with the db as a component, and with the data model as a component that depends on the db? and with a web handler as a component that depends on the data model?
09:49jcromartieobviously then I'd need a lot more protocol functions for the components
09:50jcromartieor am I misunderstanding
10:03ToBeReplacedjcromartie: your connection pool is a component. by web handler, the pure function wouldn't be, but the jetty/tomcat/whatever instance would be
10:05ToBeReplacedyour system map would include the handlers and the like, but they aren't components in the same way since they have no setup/teardown... you would be including them in the system map so that you can poke and prod easier for testing and simulation
10:11stuartsierrajcromartie: The component operations don't have to be protocols. Again, they're just records or maps, so they can just be containers for things like DB connections.
10:13jcromartieI think I grok it now stuartsierra
10:14jcromartieI'm more confused by the argument with my coworker here :P
10:14jcromartiebasically he's tired of passing dependencies to functions
10:14jcromartielike, the web app literally depends on 6 other services
10:14jcromartieoutside things
10:15jcromartieso at the top level it needs to receive all 6, and then pass down what is needed at different levels
10:15stuartsierraSure, that's a common situation.
10:15jcromartieyeah
10:15jcromartieI just don't see the problem with passing arguments
10:15jcromartienot that I want 6 arguments
10:15jcromartiebut pass a map of services
10:16jcromartieat least until you get to a function that only needs to coordinate one or two services
10:17jcromartieI don't see a lot of consistency though... the get-project function just takes the database and a key
10:17jcromartiebut the create-project function takes the database, and 3 other API connections
10:17stuartsierraYep. The 'Component' lib just helps create maps/records only include a subset of the services.
10:17stuartsierraObviously, you have to refactor your functions to take the maps as arguments, and be consistent about keys/names.
10:17clojurebotNo entiendo
10:18jcromartieI guess the question is where to draw the line at components
10:19stuartsierraYes.
10:19stuartsierraYou can go overboard and make too many small components.
10:20gfredericksthis surprised me: ##(let [^double x 4/5] (Math/abs x))
10:20lazybotjava.lang.IllegalArgumentException: No matching method found: abs
10:20gfredericksum wait
10:20stuartsierragfredericks: type hints are not casts
10:20gfredericksstuartsierra: this worked in another process
10:20gfredericksthe above result is what I expected
10:20derek_chas anyone here used lein-droid
10:20derek_c?
10:20gfredericks&*clojure-version*
10:20lazybot⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}
10:20gfredericks,(let [^double x 4/5] (Math/abs x))
10:20clojurebot0.8
10:21gfredericksstuartsierra: ^
10:21TimMc...huh
10:21stuartsierragfredericks: That's probably just an implementation side-effect.
10:21TimMcWorks By Accident?
10:21stuartsierrayep
10:21stuartsierratype hints are weird
10:22TimMcI don't see a mechanism for this to work, though.
10:22TimMcgfredericks: Might be worth compiling and disassembling it.
10:23stuartsierraFor the record, I think it should be (let [x (double 4/5)] (Math/abs x))
10:24gfredericksoh for sure
10:25gfredericks,(let [x 4/5, ^double y x] (Math/abs y))
10:25clojurebot0.8
10:31CookedGryphonderek_c: yeah, I'm using it right now
10:32edbondHello everyone, lein cljsbuild produce file with mtime Jan 1 1970. why? how to fix this?
10:32derek_cCookedGryphon: do you have to do a `lein droid doall` whenever you change something to test it out? It's quite slow
10:32edbondsimple project 'lein new mies test; lein cljsbuild once' and file date is Jan 1 1970 :(
10:33edbond(spit) creates a file with current date, java is sun 1.7.0
10:33CookedGryphonderek_c: no, it opens up a repl on port 9999
10:34CookedGryphonderek_c: so you can connect to it from emacs/your editor of choice
10:34CookedGryphonderek_c: and apply your changes without even restarting the app
10:36edbondother files have proper date, .js content is also fine. Incorrect date only
10:36derek_cCookedGryphon: sorry I'm confused. how do you do it?
10:37CookedGryphonderek_c: what's your normal setup for editing normal clojure code?
10:37CookedGryphondo you know emacs or anything?
10:38derek_cCookedGryphon: I use Sublime
10:39gfredericksis there some reason why `lein test` would fail to hang due to thread-leak?
10:40gfredericksi.e., when I do something via `lein run` it hangs because I didn't shut some things down; but doing the same thing within `lein test` exits anyways
10:40CookedGryphonor do you use lein repl?
10:40CookedGryphonderek_c: hm, I'm afraid I don't know how to set up a repl/evaluate forms in sublime....
10:41CookedGryphonyou can however do lein repl :connect 9999
10:42CookedGryphonand interact with it at least
10:43derek_cCookedGryphon: interesting.. thanks I will dig into it
10:43gfredericksah I see `lein test` uses System/exit
10:44xeqigfredericks: I would guess you have something happening on the agent thread pool. That stays alive for a bit after finishing and keeps the jvm alive
10:45derek_cCookedGryphon: are you aware of any open-source app that uses lein-droid? Wanna take a look for reference
10:46CookedGryphonderek_c: https://nightweb.net/
10:46gfredericksxeqi: I wasn't asking why it was hanging, I was asking why it didn't hang in `lein test` as well
10:47gfredericksthe answer being `lein test` uses System/exit
10:48CookedGryphonderek_c: https://github.com/oakes/Nightweb sorry
10:48derek_cCookedGryphon: got it. thanks!
10:49gfrederickswhat's the community opinion on varargs for option-maps?
10:50gfredericksI thought there was mild dislike for it
10:50nDuff...it's nasty, but it's also a widely-accepted idiom?
10:50TimMcDefinitely nasty.
10:50derek_cCookedGryphon: Is there a tutorial for setting things up like you said with Emacs?
10:51gfrederickswhat I was surprised by is that this page explicitly recommends _always_ using varargs: http://dev.clojure.org/display/community/Library+Coding+Standards
10:51TimMcLet's compromise and use a pattern like (grovel 1 2 [:foo 3] [:bar 4])
10:51TimMcand *everybody* can be angry
10:51TimMcthat's what compromise means right
10:52Southyhttp://www.braveclojure.com/ has a bunch of stuff for setting up emacs
10:52pyrtsaFWIW, it's much easier to pass a simple `opts` map on to another function, (f x opts), compared to something like (apply f x (apply concat opts)).
10:52Southyhe has a gitrepo with a bunch of pre-installed stuff, which you can cherry pick if you don't like his settings
10:52SouthyI like white text on black background but some people done
10:52Southy*don't
10:53gfrederickspyrtsa: yeah that's why I'd avoid the varargs
10:53pyrtsaLikewise.
10:53pandeiroanyone using swag to produce REST API documentation?
10:53CookedGryphonderek_c: so I'd recommend trying out the normal emacs workflow a bit, beyond that it's just a case of instead of doing nrepl-jack-in, do nrepl and enter 127.0.0.1, port 9999 when prompted
10:54gfredericksany guesses what is the best avenue for proposing changes to that page?
10:54gfredericksclojure ML? clojure-dev?
10:54derek_cCookedGryphon: I'm thinking about still using Sublime for normal editing, and use Emacs just to interact with nrepl. do you think that will work?
10:55CookedGryphonderek_c: not really, the power comes from saying "evaluate this form my cursor is on in my editor"
10:55CookedGryphonderek_c: if you want to avoid learning emacs, maybe try nightcode
10:55CookedGryphonthat's got templates for android projects and should set you up with a repl and simple evaluation keyboard shortcuts
10:56CookedGryphonin a fairly "normal" editor
11:05stuartsierragfredericks: opinion varies on varags vs maps for optional named arguments.
11:06stuartsierraIn the past, Rich has recommended varargs for optional named arguments.
11:06stuartsierraBut if a map makes more sense, for example if you're going to create a map once and reuse it, then use a map.
11:09clgvpyrtsa: gfredericks: you might be interested in https://github.com/guv/clojure.options
11:10Wild_Catwoo, just submitted a pull request for Cheshire. This marks my very first attempt at actually contributing Clojure code.
11:10hyPiRion(inc Wild_Cat) ; :D
11:10lazybot⇒ 1
11:10Wild_Cat:D
11:14derek_cCookedGryphon: I'm afraid I'm still missing something. So I got nightcode running and I got a repl. now am I suppose to type something into the repl to make the app reflect the changes I made?
11:14gfredericksstuartsierra: there's also the issue of composability
11:14gfredericksif I want to wrap a function with some partial set of options it's quite clunky
11:17stuartsierragfredericks: yes, a common complaint about that style
11:18gfredericksokay, so it's not worth suggesting a change to the "always use varargs" recommendation?
11:19stuartsierragfredericks: I don't think so.
11:19gfredericksokay, thanks
11:20stuartsierrayou're welcome
11:20CookedGryphonderek_c: oops, seems I overestimated nightcode :( sorry, it doesn't have the ability to evaluate forms, I thought it did
11:20CookedGryphonderek_c: your biggest long term payoff will come from learning the emacs toolset, as that's what most clojure stuff is geared towards
11:21derek_cCookedGryphon: I see :(
11:30pyrtsa"In the past, Rich has recommended varargs for optional named arguments." <- Gotta love that as an argument. :o)
11:37hyPiRionEmphasis on "In the past" I guess
11:41gfredericksIn the future, Rich has recommended writing all code comments in Zorblaxian to please the overlords
11:44logic_progI normally fire up lein, from a shell, via "lein pdo cljx auto, run -m server.main" and then connect to it via emacs with M-x nrepl. Is there a way to launch the nrepl directly from emacs ?
11:45justin_smithlogic_prog: do you need those exact lein args? if not you can nrepl-jack-in while visiting a file in the project
11:46justin_smithand if so there may be a way to make it happen still
11:46logic_progI need those exact args
11:47stuartsierrapyrtsa: not intended an argument, but that was the source of the recommendation on dev.clojure.org/display/community/Library+Coding+Standards
11:47justin_smithlogic_prog: to tell the truth, I prefer to run clojure in a terminal and connect, maybe a happy medium is making a shell script that runs that and putting it at the top level of your project?
11:48logic_progjustin_smith: I often find myself in the situation that something goes wrong in my clojure code,
11:48logic_progI look at teh terminal for the stack frame
11:48logic_progthen try to navigate to the location.
11:48logic_progIf all this data was in emacs, I'd be easiser to "jum pto this stack frame"
11:48logic_progperhaps there's a simpler way to solve this problem
11:50justin_smithhmm - M-x compile with the above lein command as the "compile command"? that should make any errors indicating file positions into clickable links
11:50justin_smiththat is a hack though
11:50dnolenlogic_prog: most of the development environment provide this for you
11:51logic_progdnolen: what are you referring to? I'm using clojure-mode in emacs already
11:51justin_smithdnolen: yeah, nrepl-jack-in would do what he wants, except he needs a custom set of args that runs his app, and I don't think jack-in provides for that
11:52logic_progdnolen: are you using a different ide ?
11:52dnolenlogic_prog: I use cider mostly
11:52dnolenlogic_prog: but Cursive Clojure is probably the coolest environment I've played around with
11:52logic_progdnolen: isn't that some proprietary crap with intellij ?
11:52dnolenlogic_prog: I'm just tied to Emacs for other reasons
11:52logic_progdnolen: is it that goo d?
11:52dnolenlogic_prog: "crap" lol
11:52dnolenlogic_prog: it's amazing
11:53dnolenlogic_prog: most people I know who prefer more human environment that don't care about random Emacs goodies have moved on
11:53dnolens/human/humane
11:53logic_progdnolen: I used vim for 15 years before recently switching to emacs in the past year due to clojure
11:53logic_progdnolen: you're now telling me to use something with buttons and pretty pictures?
11:54dnolenlogic_prog: no, but it's worth taking a look at
11:54dnolenlogic_prog: I've tried nearly every setup just to see what different things offer
11:54arkhare closures discouraged in clojure or just uncommon?
11:54logic_progdownloading intellij free edition now
11:54dnolenarkh: they are common
11:55dnolenlogic_prog: it's worth reading the Cursive introduction to get things setup, that's the main hurdle IntelliJ in it's default state is not that nice.
11:55logic_progdamn it
11:55logic_progit rquires java 6, so can't work on java 7?
11:55dnolenlogic_prog: you've also got light table which I have to say is a way better CLJS than Emacs today
11:55TEttingerhm?
11:56logic_progdnolen: I do mostly cljx
11:56Wild_Catso I'm reading the lib coding standards -- how exactly does one define a function with optional named arguments?
11:56dnolenlogic_prog: got it
11:56logic_progdnolen: how is light table?
11:56TEttingerjava 6 is incompatible with 7 in what ways?
11:56dnolenlogic_prog: great for CLJS, seems passable for Clojure
11:56arkhdnolen: are we talking about the same thing? Writing a function that creates local state which returns a function accessing that state? (<- I'm sure there's much better explanations ...)
11:56TEttingerlogic_prog, it's still a little rough around the edges, but it's quite nice
11:56dnolenarkh: that's not what a closure is
11:56arkhdnolen: oh
11:57dnolenarkh: the only important part is capturing the environment
11:57TEttingera closure is a kind of function that can access the environment/scope it was created in
11:57jballancTEttinger: I don't think it has to be a function...could be a data structure just as easily
11:57arkhTettinger: right - that's what I meant
11:57dnolenarkh: and no the pattern you're describing is not that common
11:58TEttingerjballanc, you could be right, though I admit I've never seen that usage
11:58logic_progdnolen: let's make a deal
11:58justin_smithit is a block of code that captures bindings
11:58jballancTEttinger: I think it's more common in scheme
11:58logic_progdnolen: for each of {cursive, cider, lighttable} I try, you write a blog post :-)
11:58justin_smithlet and fn are both closure creating
11:58dnolenlogic_prog: no deal
11:59justin_smithin some languages let is built in terms of fn
11:59TEttingerdnolen, 2 blog posts then
11:59justin_smith(or lambda or whatever they call it)
11:59dnolenTEttinger: heh
11:59TEttingerI don't even know what your blog is!
12:00logic_progdnolen: I installed cursive plugin + restart intellij
12:00logic_proghow do I create a clojure project ?
12:00logic_proghttp://cursiveclojure.com/userguide/ui.html is rather light on "how the fuc do I get started"
12:01dnolenlogic_prog: yeah it could be a little bit clearer but you can just open an existing project
12:01dnolenlogic_prog: pretty sure there's a cursive IRC channel ask there
12:03logic_progdnolen: alright, got it opened
12:03logic_progdnolen: and now I'm missing my evil-mode keys
12:04dnolenlogic_prog: it's a big world and people share your problems ;) http://plugins.jetbrains.com/plugin/164
12:04logic_progdnolen: I am out of excuses and will not spend some time investiating
12:10TimMcTEttinger: http://swannodette.github.io/
12:19pyrtsastuartsierra: Sorry, just meant to say it's probably better to point out the actual reasoning (" Callers should not have to wrap optional named arguments in a map literal") instead of who said it.
12:21pyrtsaI think the above guideline makes sense when you don't have many arguments, counting both the required and optional ones. When you do, it's better to pass in maps instead.
12:30arrdem'mornin
12:35stcredzeromy prediction from last night came true
12:35technomancynice; suddenly the percentage of clojure users using non-oss editors dropped to under 10%
12:36stcredzerotechnomancy: where are you getting the 10% from?
12:36technomancystcredzero: from cemerick's survey data
12:36technomancyhttp://cemerick.com/2013/11/18/results-of-the-2013-state-of-clojure-clojurescript-survey/
12:37technomancyspecifically http://p.hagelb.org/clojure-editors-2013.png
12:37stcredzeroOh, I thought you were referring to Light Table being GPL'd.
12:37hiredman«A proposal (by others) for some sort of Value»
12:37hiredmanwhoops
12:37hiredmanstupid pasting
12:38hiredman"A proposal (by others) for some sort of Value Types seems to be a sure thing." -- Doug Lea
12:38hiredmanyay!
12:38llasramhiredman: What does that mean?
12:40technomancystcredzero: yes, that was the "suddenly" part =)
12:41stcredzerotechnomancy: from the URL, it seems this dates from Nov 18. I thought Light Table was GPL'd more recently.
12:41technomancystcredzero: right; I'm assuming the numbers haven't changed dramatically in the last couple months
12:42stcredzerotechnomancy: so then it has nothing to do with Light table and you were being ironic
12:42hiredmanllasram: long:Long::value types:regular jvm object types basically
12:42technomancystcredzero: not really?
12:43stcredzerotechnoman: You gots some 'splainin to do.
12:43technomancyup till two days ago, there were ~18% of clojure users using non-oss editors
12:43technomancynow it is under 10%
12:43darthdeushow can i tell what's the current directory for (slurp "something") ?
12:43rukordnolen: please what's the best way of making this work? https://www.refheap.com/22727
12:44stcredzeroAh, I see, you were treating both numbers as a gauge of the same thing.
12:44dnolenrukor: gist w/o explanations of what's going on isn't very helpful :)
12:44rukordnolen: sorry
12:44stcredzeroInteresting: "more than a quarter of ClojureScript developers don?t use a REPL at all" -- from http://cemerick.com/2013/11/18/results-of-the-2013-state-of-clojure-clojurescript-survey/
12:45technomancysobering =(
12:45rukordnolen: trying to use the rhizome function to build a component from derived data
12:45technomancybut given how complicated the process is, I can't say it's surprising
12:47dnolenrukor: there's quite a few things wrong at first glance in that paste
12:47dnolenrukor: row isn't returning a component
12:47stcredzerotechnomancy: entirely agree. ClojureScript REPL has been the epitome of stovepipe software. It's way to easy for it to fall over, requiring another litany to get it running again
12:47llasramhiredman: That's what I thought. Interesting
12:47hiredmanhttp://cs.oswego.edu/pipermail/concurrency-interest/2014-January/012169.html is the email the quote is from
12:48justin_smithdarthdeus: (System/getenv "PWD")
12:48dnolenrukor: what's the point of using om component facilities at all here, nothing is really based on app state
12:48dnolenrukor: just make a function that returns React stuff
12:48darthdeusjustin_smith: i'm getting nil
12:48justin_smithdarthdeus: you can use (slurp (io/resource "something")) to look something up relative to the classpath
12:48technomancydarthdeus: also (system/getProperty "user.dir") probably more portable
12:49justin_smithtechnomancy: ahh, thanks, I didn't know PWD wasn't universal
12:49darthdeusah good, thanks :) getProperty "user.dir" works
12:49justin_smithwhere the hell do those other systems get off not being POSIX anyway
12:50darthdeusjustin_smith: i have $PWD, but i guess it's not when i launch lighttable as an .app
12:50rukordnolen: i see. Reusable components so not need to use om/component righr?
12:50dnolenrukor: nope
12:50justin_smithdarthdeus: interesting, I intended the above to be sarcastic if it wasn't clearly so
12:50dnolenrukor: unless you need to interact with app state or local state, just use React stuff
12:51rukordnolen: thanks. That solves my problem indeed.
12:51darthdeusjustin_smith: i got the sarcasm :P
12:51justin_smithdarthdeus: I just forget that anyone uses anything but a GNU/Linux stack sometimes
12:51justin_smithI mean why would anyone use a system I wouldn't use? silly people
12:51technomancyjustin_smith: ignorance: sweet sweet bliss
12:51darthdeusOS X is more posix than linux :) at least it's BSD core :P
12:52justin_smithdarthdeus: well all posix shell must provide PWD, which means whatever "shell" runs a .app is not posix
12:53technomancythere is a really great quotation I wish I could find about how posix compliance has as much to do with unix as the post-WWI restrictions on naval tonnage have to do with actual treaties
12:54stcredzerotechnomancy: there's probably an apt analogy to go with that having to do with battleships being obsoleted by aircraft carriers
12:54darthdeusjustin_smith: i'm not running it through the shell, which is why this is happening i guess
12:54justin_smithtechnomancy: well if "is it UNIX™" is the standard, your answer is based on "did they pay for and pass the cert"
12:55justin_smithdarthdeus: to me anything that launches a program is a shell - I guess that may not be a universal opinion
12:55technomancyjustin_smith: true unix is in the heart
12:55llasramI'd get that on a bumper sticker
12:55llasram(if I were inclined to bumper stickers)
12:56stcredzeroI can imagine that as alternative lyrics to "Grove Is In the Heart"
12:56technomancyI have debugged this problem so many times with Emacs users that any time someone says their PATH doesn't include their .profile customizations I am tempted to yell at them to stop using the gui
12:56technomancyespecially considering the "official fix" from apple is to edit a plist.xml file, and I don't want to have that blood on my hands
12:57bbloomtpope: apparently you're going to get rich off of cljs support
12:57justin_smithYUCK 😛
12:57technomancyllasram: http://wondermark.com/175/
12:57darthdeushow can i pass a record constructor to apply?
12:57darthdeus(apply Thing. '(1 2 3)) doesn't work
12:58llasramtechnomancy: Heh. Nice.
12:58justin_smithdarthdeus: hmm, (apply map->Thing [map]) should work
12:58dnolenjustin_smith: darthdeus: you want ->Thing
12:58justin_smithmap->Thing is automatically defined when you define the record
12:58justin_smithahh, much better :)
12:59dnolen(apply ->Thing positional-values)
12:59justin_smiththough using map->Thing may be a cleaner position to building it than apply ->Thing is, big picture
12:59justin_smithdepending on what you are doing
12:59justin_smiths/position/option
13:00darthdeushmm interesting, thanks guys
13:20logic_prog_is there any down sies to using cider vs nrepl?
13:21stcredzeroYou mean nrepl.el?
13:21stcredzeroI thought CIDER was just the new name for nrepl.el
13:21seangrovestcredzero: It is, you're right
13:21stcredzeroAt last, I'm right about something!
13:21seangrovelogic_prog_: I use cider, but I don't know if it's fully baked yet
13:22logic_progcorrect me if I'm wrong, cider is only _client/emacs side_ ... it still uses nrepl server (i.e. lein) side
13:22seangroveThe name change happened without updating it everywhere it should have been
13:22stcredzeroseangrove: shouldn't that be "fully fermented"?
13:22seangroveI use it, and it's stable enough for me, but there's no major reason to switch over yet, from what I can tell.
13:22technomancylogic_prog: ritz doesn't work with cider yet
13:22seangrovestcredzero: Well played, sir
13:22technomancylogic_prog: but yeah, same thing on the server side
13:23logic_progwtf is ritz ?
13:23logic_progoh, it'sa debugger supporter
13:23seangroveI hope clojure gets a debugger/stepper similar to ritz that's a bit easier to configure/use and clients can easily connect to, a la nrepl
13:23technomancybe the change you want to see in the world.
13:24stcredzeroHas someone named software wtf yet? That way someone can ask...
13:24pandeirotechnomancy: do you know if cider has something akin to eldoc for using inside clojure-mode buffers? didn't nrepl.el have that?
13:24seangrovetechnomancy: True, true. One thing at a time
13:24technomancynot that I know of, but there is a license named that
13:24technomancypandeiro: yeah, that works
13:24pandeirowhat's the function called, do you know?
13:24technomancyit's in the readme
13:24pandeirogah
13:25seangrovepandeiro: http://p.hagelb.org/mystery.gif
13:25technomancylots of mileage to be gotten from that gif
13:26jergasonthe things that ghost has seen
13:26pandeiromust be a new cider thing, my emacs says that function doesn't exist
13:26stcredzerojergason: if gifs can be conscious...
13:30stcredzeroSo, how would one implement a cache that only keeps the last n items in Clojure?
13:31dnolenstcredzero: you might want to look at core.cache https://github.com/clojure/core.cache
13:32edbondom/reactjs question: What does "Danger: Discarding unexpected node" means? How to fix?
13:33dnolenedbond: that's a React warning, and I haven't seen that before
13:33dnolenedbond: might want to ask in #reactjs
14:16arcatani'm running criterium benchmark for a function and during the warmup, criterium reports "classes loaded before n iterations" for almost every iteration
14:17arcatanwhat does that mean in practice? that my running my code causes classes being loaded
14:18arcatan+?
14:20arcatanhmm. i started a new repl session and it doesn't happen again.
14:21arcatanwhoops, it didn't
14:23jcromartieOK, fine, tools.namespace, you win
14:23tbaldridgearcatan: I've seen that happen if you use eval
14:24stuartsierrajcromartie: :)
14:24jcromartiewhich is to say stuartsierra wins
14:24jcromartie:P
14:25technomancydefeated by defrecord?
14:25jcromartietechnomancy: I want no part in your anti-record crusade
14:25jcromartietechnomancy: but no
14:25stuartsierrahaha
14:26technomancyjust checking
14:27gfredericks(defeated :hamburger :fries)
14:27gfredericks^ meal reporting
14:31jcromartie(->> tacos (take 3) (map al-pastor) nom)
14:32arcatantbaldridge: oh, right, we have some code generation stuff in there which i always forget about. not eval, but yeah.
14:33hadronzooWhat is the best way to eliminate Ratio operations from a namespace. I know I can insert doubles into each calculation, but I was hoping for a cleaner solution.
14:34octagonstuartsierra: what's the best reference for understanding the tools.namespace reloading? I read your blog posts but I'm having a hard time knowing how all the pieces of my app act under reloading.
14:35hadronzooProfiling has revealed that my code is spending a lot of time in Ratio division, but I don't need this additional precision--doubles are good enough.
14:35hiredmanhadronzoo: if you start with doubles you will end with doubles
14:35stuartsierraoctagon: the tools.namespace README goes into all the edge cases
14:36hiredman,(/ (+ 1.0 1) 2)
14:36clojurebot1.0
14:37hiredmanhadronzoo: if you are seeing ratios it means you aren't using floating point numbers somewhere
14:37hadronzoohiredman: I know, but many of the functions I use return Longs.
14:37justin_smithhadronzoo: also, if you have numeric bottlenecks, primitive-math and hiphip may be good options to consider https://github.com/ztellman/primitive-math https://github.com/prismatic/hiphip
14:37hadronzoojustin_smith: Perfect, I'll take a look. Thank you
14:38coventry`How can I add arguments to the lein command executed by nrepl/cider.el's nrepl-jack-in?
14:38justin_smithhadronzoo: many clojure operators are varargs, so you can change (* x y) to (* 1.0 x y) or (+ x y) to (+ 0.0 x y) to force doubles
14:39hadronzoojustin_smith: Yes, that's what I started to do, but this library is very math heavy, so it was getting ugly and tedious.
14:39justin_smithmakes sense
14:39steeriojustin_smith: isn't (* (double x) y) better? performance-wise just as well as idiomatically
14:39justin_smithand the unboxing / arrays will likely be a big gain
14:39justin_smithsteerio: probably
14:39technomancycoventry`: M-x apropos-value lein-repl
14:40steeriohadronzoo: you could create your own operators with macros that would force doubles
14:40technomancysorry, "lein repl"
14:40justin_smithsteerio: that is part of what the above referenced primitive-math does (along with unboxing etc.)
14:40steeriosorry, didn't scroll back :)
14:40hadronzoosteerio: essentially converting the arguments using (double x)? I'll check those libraries to see if that's been done already :)
14:42justin_smithhiphip doesn't even make sense without unityped arrays, and primitive-math specializes everything for each numeric type - which is needed to guarantee things staying unboxed
14:42coventry`technomancy: Thanks. That was too much output to assimilate, but I found nrepl-server-command by reading nrepl-jack-in.
14:42hadronzoojustin_smith: primitive-math is exactly what I was looking for
14:42justin_smithcool
14:42technomancycoventry`: it's the third entry for me
14:44coventry`Huh, I get clojure-inf-lisp-command early on, but nrepl-server-command is on line 5584.
14:45technomancycoventry`: inf-lisp is for simplistic comint-style work; doesn't involve nrepl
14:46coventry`I know. I just mean that's the closest reasonably positioned match I got.
14:46technomancyoh geez, line 5584 of the apropos; I see
14:47technomancyouch
14:47technomancyyeah, apropos-value must have some way to accept literal input, but I don't know it off the top of my head
14:47Wild_CatI don't know who made it so Leiningen on Windows does support bash-type keyboard shortcuts, but whoever you are, you have my deepest thanks
14:48Wild_Cat(lein repl, that is)
14:48Odin-Readline, innit?
14:48technomancyWild_Cat: that was trptcolin
14:48technomancywho is a hero of the highest order
14:48Wild_Cat,(inc trptcolin)
14:48clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: trptcolin in this context, compiling:(NO_SOURCE_PATH:0:0)>
14:48Wild_Cat(inc trptcolin)
14:48lazybot⇒ 3
14:49Wild_Catthere. ^^
14:49Wild_Cattechnomancy: nice.
14:49technomancyOdin-: can't link to readline from Clojure due to the EPL
14:49Odin-technomancy: Ah, right. 'course.
14:49Wild_Catnow the only thing that's missing is proper text selection support, but I don't think the Windows console widget can be made to work
14:49Odin-technomancy: In which case it actually is quite heroic.
14:50technomancyOdin-: well he's using an existing lib, but he's had to contribute a number of bugfixes to it from what I recall
14:50Wild_Cat(unrelated: wow, AGDQ now have the programmer of The Mask for the SNES speedrunning his very own game -- very cool)
14:50jcromartieI take it all back stuartsierra: tools.namespace blows up on my project
14:50technomancygrenchman on the other hand does link directly to libreadline
14:51technomancybut it doesn't have completion support =(
14:51mdrogalislol. I take it back! I totally hate you dude!
14:51stuartsierrajcromartie: Sorry about that. I may be able to help with some more info.
14:52jcromartiestuartsierra: the first time I call (refresh) it tries to reload everything
14:52stuartsierrajcromartie: Yes, that's how it works.
14:52jcromartieand even though it loads a certain namespace first, another namespace which relies on that one then fails to load
14:52stuartsierrajcromartie: In what way does it fail?
14:53jcromartiesay I have namespace A and B
14:53jcromartieB requires A, and (refresh) indicates that it is reloading A then B
14:53jcromartiebut it fails loading B saying that A is missing
14:54stuartsierrajcromartie: I've seen this happen in some situations, usually when there are AOT-compiled .class files on the classpath.
14:54jcromartieah, yes
14:54jcromartieit's my "main" namespace that the failing one depends on
14:54stuartsierraUnfortunately, I don't know how to fix the AOT problem. AOT does weird things to loading.
14:54jcromartieyes
14:55stuartsierraI generally restrict AOT-compilation to an :uberjar profile in Leiningen to avoid it when I'm working at the REPL.
14:55technomancyinc
14:55technomancy(inc *2) ; rather
14:55lazybot⇒ 1
14:56davidbeI'm struggling with clojure.lang.LazySeq. I read everywhere I should use doall, but that seems not to work. Any help? I map a function over a collection of hashmaps. code: https://www.refheap.com/22736
14:57davidbewhere do I have to use doall?
14:57gtrak you don't have to use doall unless you care about when the calculations actually take place?
14:58gtrakah, I see you have side-effects
14:58hiredmandavidbe: lazy-seqs don't print well with println, use pr-str and pass the result to println
14:58davidbehiredman: ok, I'll try
14:59hyPiRiondavidbe: the issue is the `str`-call, not the println itself
14:59hyPiRioninstead of str, use pr-str as mentioned
14:59hiredmanalthough, you are missing some critical bits from your example, what you are actually calling, what arguments, etc
15:00hiredmanit is hard to tell from what I assume is the example output what is printed and what is a return value returned
15:00davidbehiredman, hyPiRion : thanks alot
15:03davidbelazyness seems to be harder in Clojure than in Haskell - or I might miss a point...
15:04bitemyappdavidbe: that's an accurate sentiment.
15:04hiredman*shrug* if you are new to clojure then everything about it seems harder, no?
15:05technomancydavidbe: laziness in clojure only applies to seqs
15:05gfredericksand only the lazy ones
15:05pyrtsahiredman: Well, I guess the eager-by-default of the Clojure language is what makes the difference. You have to jump through hoops like lazy-seq to make things lazy yourself.
15:05technomancyso some things are harder and other things are easier; for instance understanding when a certain piece of code will be called is much easier
15:05pyrtsa(eager evaluation, I mean)
15:07hiredmanpyrtsa: if you say so, from the perspective of someone who has been writing lots of clojure for a few years it just is
15:07pyrtsaBesides lazy seqs, there's clojure.core/delay as well, not that it's used much.
15:07davidbeokay... good to know laziness applies only to some seqs and that clojure is eager-by-default
15:08pyrtsahiredman: From the way davidbe put it, I supposed he had played a bit with Haskell as well.
15:08hiredmanI should say from my perspective, other people with a similar amount of clojrue exposure are bound to have different perspectives
15:09pyrtsahiredman: For someone with less experience with Clojure, the laziness gets more complicated when you actually want to prevent side effects from happening eagerly.
15:09pyrtsaE.g. chunked sequences can be surprising.
15:10hiredmanchunked sequences are just gross
15:11hiredmanI am sure if rich wasn't so into preserving backwards compatibility they would be gone
15:11hiredmanwell, maybe not, but I would hope
15:11DerGuteMoritzweren't they added relatively late? 1.2 or so?
15:11pyrtsaDerGuteMoritz: I think so, yeah.
15:11tbaldridge(inc hiredman)
15:11lazybot⇒ 32
15:11hiredmanwell, 1.2 was a long time ago
15:12pyrtsaI guess reducers tried to be a better improvement.
15:12DerGuteMoritzyeah but at least past the experimentation period
15:13ivanre: ICloneable in clojurescript, what's the point of cloning immutable objects?
15:13gfrederickshiredman: gone in favor of slower unchunked seqs?
15:13stuartsierraPeople usually run into trouble when they try to mix laziness and side effects.
15:13hiredmanDerGuteMoritz: rich really does not like removing stuff once it has gone in, from what I have seen
15:13gfredericksI heard him reference java.util.Date as a good example
15:13hiredmangfredericks: right, use some other mechanism if you need performance (like reducers)
15:13gfredericksof not removing bad things
15:14technomancyhiredman: are chunked sequences part of the language semantics though?
15:15technomancyseems like the kind of thing you could safely remove without causing incompatibilities?
15:15arkhgfredericks: why is java.util.Date bad?
15:15pyrtsaMutable.
15:15hiredmantechnomancy: if someone built custom chunked sequences types
15:15technomancyarkh: voluminous tomes could be written on the subject
15:15teslanick(inc technomancy)
15:15lazybot⇒ 89
15:16gfrederickstechnomancy: man that'd be the nerdiest pile of tomes ever
15:16technomancyhiredman: ah sure. they could be removed from all call paths without the underlying classes going away though.
15:16technomancyall pure-clojure-accessible call paths
15:16gfredericksthis is the first time I've heard chunked seqs described as regretable
15:17Odin-gfredericks: Try browsing through the history section of a local library sometime.
15:17pyrtsaSpeaking of Date, it keeps surprising me every time that the JVM (and thus, Clojure) has no standard way representing durations with a single value.
15:17technomancypyrtsa: ms since epoch is not uncommon
15:17technomancy(System/currentTimeMillis) or whatever
15:17pyrtsatechnomancy: Yeah, but it's milliseconds only!
15:17hiredmangfredericks: maybe you need to get out more :)
15:18gfrederickshiredman: that would explain it
15:18arrdem2038! the doom comes!
15:18technomancypyrtsa: beggars can't be choosers
15:18pyrtsaHeh, I wrote my own already.
15:18gfredericksclojurebot: beggars |can't be| choosers
15:18technomancyAt Least It's Not j.u.Date. (tm)
15:18clojurebotAck. Ack.
15:18Ember-there is also (System/nanoTime)
15:18pyrtsaEmber-: But they both return integers which could represent anything.
15:19Ember-longs, not integers but yes
15:19pyrtsaSure.
15:19DerGuteMoritzwait, that would be like using plain maps to represent something!!
15:19arrdempyrtsa: and you expectedm them to return what...?
15:19arrdem(inc DerGuteMoritz)
15:19lazybot⇒ 1
15:19Ember-anyway, java.util.Date is just plain horrid and it only starts from it being mutable
15:19DerGuteMoritzdefrecord all the way
15:19arrdem(dec DerGuteMoritz)
15:19lazybot⇒ 0
15:20DerGuteMoritzarrdem: that was ironic, of course!
15:20technomancyhehe
15:20arrdemDerGuteMoritz: I can't tell if you're trolling me so I'm gonna stop voting.
15:20arrdem:P
15:20DerGuteMoritz:-D
15:20pyrtsaDerGuteMoritz, arrdem: Well, why not e.g. {:unit 1/1000, :value number}
15:20gfredericks(inc the fact that you can have spaces in things that you inc)
15:20lazybot⇒ 1
15:20DerGuteMoritzpyrtsa: ok!
15:20arrdem(inc roomba)
15:20lazybot⇒ 1
15:21TimMcNumbers without types or consistent expectations are fairly pernicious.
15:21Ember-pyrtsa: use clj-time, it uses jodatime internally which is great
15:21TimMcThe number of times I've seen bugs from things being off by a factor of 1000...
15:21DerGuteMoritz(inc 1)
15:21lazybot⇒ 6
15:21Ember-with java 8 we finally get good date and time api
15:21DerGuteMoritzlazybot: wrong
15:21pyrtsaEmber-: I tried to. Turned out they skipped the handling of the exact duration type that I'm after!
15:21arrdemalso lambdas...
15:21Ember-pyrtsa: which is?
15:21pyrtsa...because of overload ambiguities.
15:22pyrtsaJust a sec...
15:22Ember-I'm kinda sceptic that jodatime would have skipped that even if clj-time has
15:22pyrtsaIt exists in JodaTime, not in clj-time.
15:22Ember-and it's safe to use jodatime in clojure since all it's objects are immutable
15:22TimMcpyrtsa: Send a PR.
15:22gfredericksclojure/west is going to have a pretty short talk-submission process at this point o_O
15:23pyrtsaTimMc: It can't be fixed without either using Java reflection or adding a whole different set of functions.
15:23Ember-no reasonable java developer uses java.util.Date either, why would clojure developers use it :)
15:23pyrtsaThat's why, I guess, it isn't there.
15:23gfredericks,(type #inst "2014")
15:23clojurebot#<SecurityException java.lang.SecurityException: denied>
15:23pyrtsaPeriods and Intervals are there in clj-time, Durations not.
15:24pyrtsaAnd Duration is the type that you use for measuring the elapsed time, i.e. pretty often!
15:25Ember-pyrtsa: (Duration. (time/local-date 2014 1 1) (time/local-date 2014 2 1))
15:25Ember-assuming Duration is imported and clj-time is in time alias
15:25pyrtsaClumsy.
15:25Ember-not that much compared to (time/duration (time/local-date 2014 1 1) (time/local-date 2014 2 1))
15:26Ember-I understand where you are going to, but in this use case scenario there is pretty much no difference
15:26pyrtsaBut then how about Instant + Duration -> Instant?
15:26Ember-the difference comes when you really want that duration *function*, not a constructor
15:26Ember-http://joda-time.sourceforge.net/apidocs/org/joda/time/Duration.html
15:26Ember-there you go
15:29pyrtsaEmber-: But what good is clj-time if (time/plus instant duration) doesn't work and I must resort to something like (.plus ^Instant instant ^Duration duration) to make the Clojure compiler happy?
15:30Ember-pyrtsa: for one, what would you expect from that plus operation?
15:30Ember-to me that looks like an illegal operation
15:30pyrtsaAnother instant!
15:30Ember-you just cannot add a duration to an instant
15:30pyrtsaWat?
15:30Ember-duration is not an instant
15:30Ember-duration is what it says: a duration
15:30Ember-an instant is an instant in time
15:31pyrtsaEmber-: NO! You *cannot* add two instants. What the *** would that ever mean?
15:31Ember-what you can do, is ask for the two instants which define the range of that duration
15:31pyrtsaYeah right.
15:31TimMcPretty sure you two are talking right past eash other.
15:31pyrtsaTimMc: I guess so. Sorry.
15:32pyrtsaEmber-: What are you trying to say? Am I misunderstanding Instant?
15:32Ember-http://joda-time.sourceforge.net/apidocs/org/joda/time/ReadableInstant.html
15:32Ember-it defines a single specfic instant in time
15:32Ember-like 22:30 GMT+3
15:32Ember-if timezones are added
15:33pyrtsaYeah, and if you add a duration to it, you move the instant by that amount of time units.
15:33Ember-duration is made of two separate instants
15:33Ember-or one instant with some time added into it
15:33pyrtsaI don't think so and that's what I'm telling.
15:34pyrtsaDuration is just the number of (fractional) seconds.
15:34Ember-like that time I said earlier and for example 1000ms forward
15:34pyrtsaPeriod or Interval is more like what you're after.
15:34Ember-aww crap, you are so right
15:34Ember-<- ashamed
15:34pyrtsa:D
15:34pyrtsaAnd what I'm saying is it was stupid clj-time decided to drop Duration in favour of the other two.
15:35Ember-anyway, I think plus can handle for example Seconds
15:35Ember-or Minutes
15:35Ember-http://joda-time.sourceforge.net/apidocs/org/joda/time/Duration.html#toStandardSeconds()
15:35pyrtsaBut that's different from what a duration is .
15:37jcromartiegrrrr hiccup.form/drop-down is broken
15:37Ember-pyrtsa: you will end up into what you'd expect by using that
15:38pyrtsaConstruting Period objects is just a bit clumsy when what you need is just ms, µs or ns.
15:39Ember-(defn duration-ms [a b] (- (.getMillis b) (.getMillis a)))
15:39Ember-:P
15:39Ember-yeah, yeah... I know
15:42fgallinaHi guys, I was playing with clojure a bit and found out a weird behavior that looks like a bug to me
15:42fgallinahttps://gist.github.com/fgallina/8341562
15:43fgallinacan anyone shed some light on that thing?
15:43TimMcYes, it's Cicindella sexgutatta, the six-spotted tiger beetle.
15:43TimMcTechnically, it's a beetle, not a bug.
15:44Ember-http://geekwhisperin.files.wordpress.com/2009/09/bug-vs-feature.jpg%3Fw%3D618
15:44TimMcfgallina: What version of Clojure are you using?
15:44gfredericks,(keys [])
15:44clojurebotnil
15:44gfredericks&(keys [])
15:44lazybot⇒ nil
15:44gfredericks,(keys [1])
15:44clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry>
15:44gfredericks,(try (keys [1] :yes)
15:44clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
15:44gfredericks,(try (keys [1]) :yes)
15:44clojurebot:yes
15:45TimMcThat's pretty weird!
15:45gfredericksthat's the weirdest thing I've seen since the ^double thing this morning
15:45fgallinaTimMc: 1.5.1
15:45gfredericks&(keys [1])
15:45lazybotjava.lang.ClassCastException
15:45gfredericks&(try (keys [1]) :waaat)
15:45lazybot⇒ :waaat
15:45stuartsierraMy favorite is ##(get "foo" :thing)
15:45lazybot⇒ nil
15:45TimMc&(try (keys [1]))
15:45lazybotjava.lang.ClassCastException
15:45hiredmanthe exception is from the printing, not the actually operation
15:46TimMchiredman: Oh jeez, that's right.
15:46TimMc&(class (keys [1]))
15:46lazybot⇒ clojure.lang.APersistentMap$KeySeq
15:46TimMcThat's the laziest thing I've ever seen.
15:47fgallinauh oh
15:47fgallinadidn't thought of that one.
15:47stuartsierraHere's another one: http://dev.clojure.org/jira/browse/CLJ-1319
15:47bellkevI've seen some documentation (I think from Technomancy) that says it's not a bad idea to set :aot :all when building, say, a ring uberjar (to make the compiler check things, speed things up, etc). However, this just takes forever and hangs when I run `lein ring uberjar`, as opposed to finishing in a minute with the default :aot. Is it possible there's something obviously stupid in my project.clj that's making it hang?
15:47gfredericksTimMc: oh right because it just does (map key thing)
15:50TimMcbellkev: I wrote a script that can help debug this, hold on.
15:50bellkevTimMc: Sweet!
15:51TimMcbellkev: This script will sprinkle your codebase with print statements (stash or commit your work first!) so you can see uberjar or compile making progress through your namespaces: https://gist.github.com/timmc/7359898
15:51ucb,(try (let [a (keys [1])] :ok))
15:51clojurebot:ok
15:51ro_stdnolen: forgive the probably naive question, but why both om/transact! and set-state! ?
15:51dnolenro_st: you need component local satte
15:51dnolens/satte/state
15:51Wild_Cat,(clojure.data.json/decode "[1, 2, 3]")
15:51clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.data.json>
15:51fgallinagiven the exception is thrown at printing because this is lazy, take on that thing should bring the exception or am I missing something?
15:52ro_stok. get/set-state for local-to-compnent, transact for global state
15:52bellkevTimMc: Awesome! I'll check it out. Thanks
15:52dnolenro_st: yep
15:52fgallina,(try (take 1 (keys [1])) :ok)
15:52clojurebot:ok
15:52dnolenro_st: components local state is very useful, thinking draggable / sortable and other things that have a lot of transient state
15:52dnolenro_st: there's no point putting that stuff into the global state
15:52ro_styes - like text inputs
15:52dnolenro_st: the global state is your DB
15:52TimMcbellkev: In my case I found that compilation was just really slow. :-/
15:53ro_stok, thanks, i got it
15:53ro_stok. next one. why the async/map in the mouse example? could that not be simpler?
15:53TimMcfgallina: take is also lazy :-P
15:53bellkevTimMc:Hmm, I left mine going overnight and it never finished :P
15:53ro_st(i'm still totally green with async)
15:53dnolenro_st: yes, but core.async is a good fit in general for Om, so just wanted to illustrate how to do it
15:54ro_stok. so not for a technical reason, but for illustrative purposes. cool
15:54fgallinaTimMc: and what about the let form ucb tried?
15:54ro_sti mean, could you not have used the async code in counters to simply put on a single channel, rather than use async/map
15:54bellkevTimMc: :aot :all compiles all dependencies too, right? Is it possible that the problem could be in them? And Does your script monitor that? (I haven't quite mentally parsed your sed arguments yet :P)
15:55TimMcfgallina: The value is never used by anything that tries to ask for its elements.
15:55TimMcBasically, it's a time bomb.
15:55TimMcbellkev: This just mucks with whatever directory you point it at.
15:56fgallina,(try (let [a (keys [1])] a :ok))
15:56clojurebot:ok
15:56ro_sttbaldridge: i really enjoyed your async talk. looking forward to digging into the macro deep dives, too.
15:56bellkevTimMc:Okay, got it, thanks
15:56TimMcIt puts a println before every def or defn and makes the :require and :use clauses of ns noisy.
15:56TimMcVery basic.
15:56ro_stwriting that macro must have been quite a challenge
15:56dnolenro_st: the point of async map is to convert mouse data into a vector, it's just for fun
15:57ordnungswidrigro_st: I guess he secretly used core.logic to derive the macro from the specification :)
15:57ro_stcool dnolen. juuust checking
15:57bellkevTimMc: When you say the project you were debugging was slow to compile, was it like, hours? If so, it seems like the :aot :all is only worth it under extreme circumstances...
15:58ro_stordnungswidrig: gosh. that'd be something :-)
15:58TimMcNah, 3-4 minutes. Annoyingly long for my development loop, but not a work-stopper.
15:58mischovWhat's the difference between APersistentMap and IPersistentMap?
15:58luxbockis this the latest stable version of tools.reader? I'm trying to get CLJS repl to work and Google told me to update it
16:00bellkevTimMc: Okay must have something really screwed up somehow...
16:00ordnungswidrigmischov: IPersistentMap is a java interface while APeristentMap is an abstract base implementation
16:01luxbockoops, forgot the link
16:01luxbockhttps://clojars.org/ibdknox/tools.reader
16:02ro_stdnolen: i watched the leanpub guy's react talk. the difference in browser perf is sick
16:02dnolenro_st: it's amazing technology yes
16:02ro_streally great example, using the web audio api
16:02dnolenro_st: we'll likely send patches their way in the future which will make React even faster for the Om model
16:03stcredzeroIs there a big difference with robustness of the repl with Light Table? (Versus CIDER/nrepl.el in emacs?)
16:03ro_stthat rocks. i'm amazed you can still squeeze more out of it
16:03luxbockhttps://gist.github.com/8341931
16:04luxbockany ideas what might be causing this? I'm running Windows / Cygwin
16:04dnolenro_st: there's a lot of optimizations they don't do that we could use because they have a different design and also they have less information about what's happening
16:04dnolenro_st: in the Om model we always know exactly what data in the app state changes
16:05mischovordnungswidrig: If you were looking to match a map in an extend-protocol, would you use IPersistentMap or APersistentMap?
16:05ro_stluxbock: share your project.clj too, please
16:05seangrovero_st: What talk was this?
16:05ro_stseangrove: http://facebook.github.io/react/docs/videos.html just beneath the podcast
16:05luxbockhttps://gist.github.com/8341986
16:05ro_stsorry, the one beneath that. 4th one down
16:06seangroveOh yes, forgot that I had seen that one. It was definitely a fun presentation
16:06ro_stdnolen: so somehow, the persistent data structures kinda do most of the diffing work for them?
16:06ro_stor, it could
16:06dnolenro_st: the transact! api gives us this information we track the path
16:06ordnungswidrigmischov: it depends
16:06dnolenro_st: this means we know exactly what path in the render tree changed
16:07ro_stah - so then that makes using transact! mandatory for global state?
16:07dnolenro_st: no
16:07dnolenro_st: you just won't get rocket fuel
16:08luxbockalright, now it works after I switched to using [org.clojure/tools.reader "0.8.3"] instead
16:09ro_stdnolen: gotcha. i ask because we'll likely use om with pedestal, and pedestal will deliver deltas to om to somehow render
16:09ro_stso our state won't use transact!
16:09dnolenro_st: I don't know pedestal but I would say not to bother with whatever it provides to the front end
16:10ro_stit's a dataflow engine. messages in, transactions inside, deltas out
16:10ordnungswidrigmischov: there's also associative
16:11dnolenro_st: yes I know - I'm just unsure of the integration, it might just work
16:11dnolenro_st: or pedestal might drop the client stuff and simplify
16:11dnolenand let people use whatever they're going to use
16:11ro_stya. looking at the 0.3 walkthrough, that's likely
16:12ro_stwhat's nice is that you get a block of deltas for the whole dataflow transaction, which om/react will happily handle in a single RAF
16:13dnolenro_st: that's definitely an interesting possibility to explore, I don't intend Om to be so opinionated that you can't do what you want.
16:13logic_progin cljs, what is the best way to check "if foo a DOM element" ?
16:13mischovordnungswidrig: Thanks.
16:13logic_progerr, "is foo a DOM element" ?
16:13dnolenlogic_prog: instance? should work
16:13dnolenlogic_prog: (intance? js/Element foo)
16:14dnolener instance?
16:14logic_progdnolen: hmm, assertion passes, so it's not too tight, but not sure if it's restrictive enough
16:14dnolenlogic_prog: don't know what you're trying to do so can't much more
16:15logic_progdnolen: https://gist.github.com/anonymous/8342140
16:15logic_progdefenstve programming
16:15logic_progsetting attributes of a dom element
16:15logic_progcan I make it much more defensive than that?
16:16dnolenlogic_prog: seems OK to me, hard to say w/o checking the mainstream browsers w/ that. Might be something more robust in Google Closure too.
16:16dnolenlogic_prog: writing your own attribute setting code seems pointless and error prone to me
16:17logic_progdnolen: what should I be doing instead?
16:17logic_progi have a "virtual svg dom"
16:17logic_progwhich I'm converting to a "svg dom"
16:17dnolenlogic_prog: using Google Closure if possible
16:17dnolenlogic_prog: if you care about cross browser issues, that is
16:17logic_progno
16:17logic_progthis will run on chrome
16:17logic_progand I don't care about anything else
16:18dnolenlogic_prog: then I don't have many opinions about it
16:18logic_progdnolen: if you wrote a blog post about google closure best practices, I'd read it :-)
16:18dnolenlogic_prog: unlikely
16:19dnolenlogic_prog: I only write about stuff that doesn't bore me can't be googled :)
16:19danneuDatomic question: Imagine a private-message system where you can start Conversations where convos have many Messages and many Participants (users). What would be a sensible way to track whether a convo has unread messages for each user (to display a "new message" UI)?
16:20danneuI was thinking of some an "Ack" entity with :ack/time, :ack/entity (ref to convo), and :ack/user (ref to user that read the convo at that time).
16:21ro_styou could store an ack list of participants on each message
16:21ro_stthe tx time gives you your when
16:21stuartsierradanneu: You might be able to use a single ref attribute from convo to user. Transactions give you time.
16:21ro_st:message/acks
16:22ro_stif a user's on the list, it's read. if not, it isn't :-). assertion time is read time.
16:22technomancygdev_: hey, thanks for the package. should prove a handy addition to my coffee travel gear =)
16:26danneustuartsierra: So, when user1 clicks in to a Convo to read it, they are added to `:convo/acks #{user1}`?
16:27stuartsierradanneu: yes
16:27danneuro_st: That was my first brainstorm, but I considered attaching the acknowledgement at the convo-level instead of the message level.
16:28ro_stbut then you're forced to put a collection of collections on convo
16:28danneustuartsierra: i've never set noHistory before, but would this be a snesible case for that?
16:28ro_stbetter on the message since you care about per-message acks
16:28stuartsierradanneu: not sure. once a user has read a message, you aren't going to record that they've read it again, right?
16:29stuartsierraI'm not sure how noHistory interacts with multi-valued attributes.
16:29luxbockin the ClojureScript Windows installation instructions it says to add a few lines to setup_classpath.sh, but I don't see such a file in my cloned repo
16:29luxbockhas it been removed?
16:30RMacyHey all if you're in Nashville and want to join a clojure study group I encourage you to join #nash-clojurians
16:30danneustuartsierra: a Convo has many Messages. messages are "unread" if they were created after the last time the user ack'ed the Convo itself.
16:31luxbockClojure complains that it can't find the cljs.repl namespace, which I'm guessing is because I haven't properly set the path for it
16:31luxbockbut I'm not entirely sure how to do so
16:31stuartsierradanneu: might be easier to record acks on the messages as ro_st said.
16:32luxbockI set $CLOJURESCRIPT_HOME to the directory I cloned the repo to, but then the instructions for Windows/Cygwin talks about setting CLJSC_CP in the setup_classpath.sh file, but like I said I have no such file
16:33dnolenluxbock: there's just not many Windows ClojureScript users, you might want to ask your question on the ClojureScript mailing list
16:33dnolenluxbock: also patches for troubles or testing existing ones would be helpful
16:34luxbockalright
16:35danneustuartsierra: would this kind of thing scale if i wanted to track acks for all Posts (Topics have many Posts) in the forum?
16:35luxbockhow come installing CS is such a pita when Clojure on the JVM is simply a lein dependency
16:36technomancyluxbock: http://p.hagelb.org/mystery.gif
16:36luxbock:)
16:36danneustuartsierra: this is definitely easier than what I had in mind though. thanks.
16:37dnolenluxbock: but I'm also confused as to what you are attempting to do
16:37dnolenluxbock: ClojureScript is a JAR, you don't need to set it up locally unless you're going to dev it
16:37stuartsierradanneu: Scaling is hard to predict. This talk may help: http://www.infoq.com/presentations/datomic-use-case
16:37luxbockhmm maybe I'm missing something then
16:37dnolenluxbock: you include ClojureScript like any other dependecy with lein
16:37dnolenluxbock: done
16:38danneustuartsierra: yeah, i guess i will find out. that's a good talk.
16:38gtrakluxbock: if you're just trying to use cljs in your project, try lein-cljsbuild
16:38luxbockyeah I have included [org.clojure/clojurescript "0.0-1934"] in my project.clj file. do I also have to include cljs.repl separately? or how do I access the CLJS repl?
16:38Wild_Catdakrone: is there any specific reason why the default parse-string behavior for Cheshire is to return lazy seqs for top-level arrays?
16:39dnolenluxbock: use lein-cljsbuild as gtrak suggested that's the standard tool everyone is behind these days for CLJS dev
16:39Wild_Cats/parse-string/parse/
16:40luxbockdo I have to use either Austin or piggieback to get a working CLJS repl with nrepl.el?
16:43dakroneWild_Cat: it actually increases performance
16:45amalloyespecially for infinite streams!
16:46Wild_Catdakrone: Fair enough. Either way see my pull request for the fix to parse-string-strict, but it *is* surprising behavior still.
16:47dakroneWild_Cat: I saw that, will commit it tonight after work, thanks for finding that! (dumb mistake on my part)
16:47stuartsierraluxbock: Yes. The Browser repl included with ClojureScript only works at the command-line.
16:47Wild_Catdakrone: how do you feel about changing clj-http so that it does call parse-string-strict?
16:48Wild_Cat(yes, I know that returning top-level arrays is a terribad HTTP practice, but that's Riot's API, not mine :p )
16:48dakroneWild_Cat: I am open to it, do you have a particular use-case in mind why?
16:49Wild_Catdakrone: I'm making an HTTP request that returns a JSON array (see above) and getting a lazy seq (parsed with parse-string, not parse-stream) as a result, which I find highly surprising.
16:50eggheadwhy would my cljsbuild not output a goog/base.js file?
16:50dnolenegghead: not needed if you use a concatenating optimization setting
16:50Wild_CatI can work around it if you'd rather keep the seq behavior (it's a simple vec call), but I do feel that since JSON arrays are semantically equivalent to vectors, they should parse as such whereever possible.
16:52eggheaddnolen: ya, no such optimization, weird: https://www.refheap.com/22740
16:53dakroneWild_Cat: it makes sense, but at the same time, almost all of the abstractions for vectors will work with lazy sequences as well, is the type biting you somewhere?
16:53Wild_Cat(https://developer.riotgames.com/api/methods#!/310/1058 is the API I'm hitting, btw)
16:53dnolenegghead: you are using an optimization setting that concatenates
16:53dakrone(biting.. he's a cat... see my joke... haha...)
16:53dakrone(or she)
16:53eggheadoh, WELP
16:53luxbockstuartsierra: ah I see, thanks
16:53eggheadthanks dnolen
16:53eggheadproblem exists between keyboard and chair...
16:54dakroneWild_Cat: we could also possible add a {:as :json-strict} option to clj-http
16:55bitemyappdakrone: maybe nth'ing a large seq over and over?
16:56dakronebitemyapp: yea, that would do it, I just want to understand what particular pain point is being hit
16:56bitemyappdakrone: oh sure, I'm just contriving a reason a seq would be problematic.
16:56Wild_Catdakrone: Direct indexing is biting me, e.g. ,([1 2 3] 1)
16:56Wild_Cat,([1 2 3] 1)
16:56clojurebot2
16:57Wild_Cat,('(1 2 3) 1)
16:57clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn>
16:57dakroneWild_Cat: gotcha, that's exactly the case it would
16:57dakroneWild_Cat: I propose adding a {:as :json-strict} option to clj-http, what do you think about that?
16:57bitemyappWild_Cat: I would avoid doing that, honestly.
16:57bitemyappWild_Cat: using vectors as functions is a good way to run into a lot of hard-to-trace type errors.
16:57Wild_Catdakrone: works for me.
16:57bitemyappWild_Cat: this way lies madness and all that.
16:58Wild_Catbitemyapp: The problem also exists with get
16:58gfredericksthis is funny because I've often wanted it to be even lazier and parse maps lazily
16:58Wild_Cat,(get '(1 2 3) 1)
16:58clojurebotnil
16:59bitemyappdakrone: I'm in gfredericks's neck of the woods.
16:59bitemyappWild_Cat: oh sure, seq isn't associative. Use nth?
16:59arrdemWild_Cat: care... just go use nth unless you want a lecture on types and implicit behaviors.
16:59dakronebitemyapp: gfredericks: yes, I'd love to have more laziness (especially maps)
16:59bitemyappdakrone: seq of pairs?
16:59bitemyappdakrone: lol :)
16:59dakroneit's doing laziness while maintaining performance that's the tricky part :)
16:59gfredericksbitemyapp: there are a few lazy map impls floating around
17:00dakronebut, that's why cheshire.experimental exists
17:00bitemyappWild_Cat: you should probably follow arrdem's advice. I'm pretty close to giving a lecture on how these type errors are unnecessary if you use a refined weapon from a more civilized age.
17:00bitemyappdakrone: ahhh the old battle.
17:00Wild_Catdakrone: well, if you're planning to make things even lazier the {:as :json-strict} makes even more sense.
17:00hyPiRiongfredericks: how would you implement lazy maps?
17:00gtrakbean is a lazy map
17:00arrdemhyPiRion: lazy key updates.
17:00gfrederickshyPiRion: https://github.com/fredericksgary/lazy-map
17:01gfredericksI think ztellman might have a better one
17:01gfredericksor at least a lib that makes them easy to make
17:01dakronegtrak: bean has all kinds of issues though
17:01Cr8i didn't know bean was lazy
17:01dakronebean maps, that is
17:01gtrakyes, I've hit a few
17:02dakroneI'd probably use ztellman's potemkin to implement it
17:02bitemyapphyPiRion: Data.Map.Lazy in Haskell is strict in the keys, lazy in the values.
17:02bitemyappwhich I think is a good balance.
17:02Cr8ah
17:02Cr8well now that I (source bean)
17:02gfredericksbitemyapp: that wouldn't suffice for my json parsing use case
17:02hyPiRionbitemyapp: yeah, that makes sense, but if you can have multiple keys mapping to different values, the whole shebang goes bogo
17:03dakroneWild_Cat: can you open an issue for the :as :json-strict thing on clj-http so I don't forget?
17:03TimMcYeah, I would be pretty surprised to see a JSON array parse as anything other than vector.
17:03TimMcThere's some neat stuff you could do with streaming JSON using seqs, but that's a pretty rare use-case.
17:03gfrederickswhich is for parsing: {"foo":[1,...,100000],"bar":42}
17:03bitemyappgfredericks: Data.Map.Lazy isn't really for "parsing", it's more of a generic data structure that's designed to respect the laziness of downstream thunks.
17:04bitemyappgfredericks: you'd probably do something closer to what you have in mind for parsing. lazy association lists or something.
17:04arrdemhyPiRion: what? no. that's why it's strict in the keys, that allows you to escape a multiple keying case.
17:04bitemyappMost interestingly, the strict and lazy versions share the same "Map".
17:04hyPiRionarrdem: was referring to the gfredericks impl
17:04arrdemhyPiRion: ah.
17:05bitemyappbut I'm glad people understood why I brought up the alternative approach.
17:06squidzi'm using react with clojurescript and need to use reacts componentSetState which assigns which data is to be used. I am also using clojurescipt with core.async. Does anybody know a good way to set this state with core.async instead of using a jquery ajax call? As far as I can tell I can only call funcitons with the data inside a go block but I somehow need that data pulled into this 'react compononent'
17:07Wild_Catdakrone: done.
17:07dakroneWild_Cat: thanks!
17:07Wild_Caton a semi-related topic, is the source to clojurebot available somewhere?
17:08bitemyappsquidz: well have you used core.async in a manner such that it gets "fed" by callbacks?
17:08dnolensquidz: pass a channel to your React component
17:08nooniansquidz: you create a function that creates a channel in a let block, then call your ajax call and in the callback push the value onto that channel, then return the channel from the funtion and call the function and read from it inside a go block where you set the state
17:08bitemyappsquidz: seems to me if that if you have any callbacks flying around, you can strip them down and make them feed channels which leads to functions running into the React part.
17:08bitemyappsquidz: part of the idea behind core.async is to keep your callbacks dumb/simple and make them do "less".
17:09dakroneWild_Cat: https://github.com/hiredman/clojurebot
17:09Wild_Catthanks!
17:10Wild_Catfinal question while I'm at it, what would you consider the best way to store things like API keys, usernames and passwords that a piece of software requires to function? I'm thinking environment variables, but is there a better, commonly-accepted Clojure way?
17:10squidzdnolen: how do I work with that channel though then within react?
17:10dakroneWild_Cat: I am partial to https://github.com/sonian/carica
17:11squidzhow do I (<! chan) for example
17:11dnolensquidz: make a go loop when the component mounts that listens on that channel
17:11noonian(go (let [value (<! chan)] (.log js/console value)))
17:11dnolensquidz: the component will receive the channel as one of its props
17:11bitemyappWild_Cat: I'd like to reinforce what seangrove just said, if you're using something like Fay or ClojureScript, you probably don't need stuff like jQuery so much.
17:12bitemyappWild_Cat: I am partial to: https://github.com/weavejester/environ/
17:12bitemyappWild_Cat: environment variables > configuration files
17:12bellkevTimMc: I'm trying out your bash script now and realizing how non-portable sed is... (I'm using a mac)
17:12bitemyappWild_Cat: rigid configuration files are a terrible, terrible idea, there's already a modular solution to the problem. It's environment variables and system properties. I highly recommend you use environ.
17:13squidzdnolen: do you have an example? I am not sure how I would then take from a channel
17:13Wild_Catbitemyapp: that's what I was leaning towards, yeah. Thanks.
17:13Wild_CatCarica still looks neat, though. I'm filing it for future reference.
17:13dnolensquidz: I don't have an example handle, but you can look at the Om example and something similar should work for you.
17:13dnolens/handle/handy
17:14squidzdnolen: okay which om example is similar
17:14dnolensquidz: just look at them, there are several that use core.async
17:14bitemyappWild_Cat: I produce unified "config" namespaces with environ that are superficially similar to Carica.
17:15bitemyappWild_Cat: the difference is that individual configuration options can be overridden at will by overriding the defaults at the command-line or via an outer layer of scripting.
17:15squidzokay thanks
17:15bitemyappWild_Cat: another bonus is that since it's just "code", you can pull in a third source of configuration settings, like zookeeper if one liked, for dynamically configuring your apps.
17:15bitemyappusing "configuration files" was one of the great sins the Django community committed.
17:16bitemyappconfiguration is part of your deployment and provisioning, not your application code.
17:16sritchiecemerick: seeing a null pointer exception when I try to fire up my austin repl
17:16sritchiecemerick: are there any cljs version requirements for 0.1.3?
17:16Wild_Catnot really sure how it's done in Django (I'm more of a Pyramid guy).
17:17cemericksritchie: only >= what's in its project.clj AFAIK
17:17bitemyappWild_Cat: sigh, settings.py
17:17bitemyappWild_Cat: it's uniformly horrific.
17:17sritchiecemerick: NullPointerException clojure.core/deref-future (core.clj:2108)
17:17Wild_Catbitemyapp: settings*.py*? Oh no.
17:17cemerickoooh, yeah
17:17sritchiecemerick: that happens after I call "cljs-repl", and destroys my entire repl
17:17cemericksritchie: 2s
17:17technomancybitemyapp: it always cracks me up when I see python programs that use .ini files
17:18bitemyappWild_Cat: speaking of pyramid, I have a content negotiation middleware I use in my Ring apps that is similar to how Pyramid does tests.
17:18bitemyapptechnomancy: it's disgusting.
17:18Wild_Cat(Pyramid does the .ini thing -- it's not awesome, but it's less disgusting than having your settings as a .py file)
17:18cemericksritchie: Only place I've seen that prompted this: https://github.com/cemerick/austin/issues/37
17:18cemerickany chance you're using cljx too?
17:18bitemyappWild_Cat: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/middleware.clj#L44-L51
17:18Wild_Cat(also, more and more things are moved towards env. variables)
17:18bitemyappWild_Cat: .ini is worse.
17:18sritchiecemerick: yes
17:18bitemyappWild_Cat: you're missing the lesson here if you think .ini is better than .py
17:18Odin-22:13:16 *** shira QUIT Remote host closed the connection
17:19Odin-Uh.
17:19Odin-Sorry about that. term weirdness.
17:19technomancythat said, the fact that json explicitly refuses to support comments is the one reasonable defense there is for using .ini or .py for config
17:19bitemyapparrdem: justice.
17:19sritchiecemerick: hmmmm,
17:19sritchieI'm using "cljx" in provided, and austin in dev
17:19sritchielet me move austin over
17:19cemericksritchie: it's likely some gnarly dep order-sensitive resolution, but having the REPL die made it hard to diagnose.
17:19Cr8oh man
17:19bitemyappCr8: ?
17:19Odin-technomancy: Is there any reasoning for not allowing comments in JSON, or just someone going "because I say so"?
17:20Cr8we have some projects around here with a custom-hacked json parser that adds multiline strings and comments
17:20cemerickI'm actually hoping xeqi will take that one on, since he's the aether mofo these days. ;-)
17:20Cr8so that it could be used for configuration
17:20Wild_Catbitemyapp: there's some things in that ini file that describe part of how the application works -- most of the ini file are, actually. They'not (necessarily) credentials/deployment configuration.
17:20sritchiecemerick: this, then that other AOT compilation issue with austin… must be doing some crazy stuff
17:20bitemyappCr8: :|
17:20technomancyOdin-: as far as I know it's the latter
17:20bitemyappWild_Cat: it should just be code...
17:20Wild_Cat...and yeah, lack of comments in JSON blows.
17:20cemericksritchie: which AOT issue?
17:21cemerickoh, 23
17:21arrdembitemyapp: so that processor design post series. "Region has 821 lines, 6342 words, and 40422 characters."
17:21technomancyof course, it's up to the individual parser to honor or ignore that particular part of the spec
17:21arrdemdo I qualify for book status yet?
17:21sritchiecemerick: https://github.com/cemerick/austin/issues/23
17:21sritchieyeah
17:21Wild_Catbitemyapp: in a language like Python, with its limitations on importing mechanics, I disagree.
17:21sritchiecemerick: I did some exclusion mangling
17:22Wild_Cat(the ini file parsing produces fairly easy-to-understand errors.)
17:22bitemyappWild_Cat: there are ways to handle such things, the limited imagination of the Pyramid team not-with-standing.
17:22sritchiecemerick: I had to exclude austin from production to get it to work, leading to this: https://gist.github.com/sritchie/8343152
17:22bitemyapparrdem: that's a lot.
17:22cemericksritchie: you mean the :production profile?
17:23sritchiecemerick: yeah, from the uberjar profile
17:23TimMcbellkev: Oh, that's too bad. What's different about it?
17:23cemericksritchie: doesn't just using :dev accomplish the same thing?
17:23bellkevEeeh, lot's of stuff...
17:23Cr8oh wait
17:23Cr8i read it
17:23bellkevbrew install gnu-sed did the trick though
17:23sritchiecemerick: what I mean is, I had to add these switches into my code,
17:23Cr8it's not even a modified parser
17:23Cr8it's a preprocessor
17:23sritchiesince austin is only present in the :dev profile
17:23sritchieI didn't have to explicitly exclude in the uberjar
17:24sritchiecemerick: but because it was missing, and I still wanted it in my code (to inject the repl call in dev mode)
17:24sritchieI had to get fancy
17:25sritchiecemerick: so, that doesn't work
17:25sritchieplacing it below cljx
17:25cemerickshit
17:25bitemyappbellkev: yeah the BSD sed is a killer.
17:25bitemyappdriven me nuts many times over.
17:25cemericksritchie: have you been using cljx + austin, and it just busted, or is this all new for you?
17:26sritchieI haven't touched the cljs repl in a while
17:26sritchiebut it used to work
17:26cemerickthat's a little nuts
17:26sritchieI'm on 0.3.1 cljx...
17:26sritchiemaybe I'll try 0.3.2?
17:26cemerickmight as well
17:26cemericksritchie: can you gist your project.clj (msg if necessary)?
17:27sritchieoh, well then, it works in the OPPOSITE order as you mentioned
17:27cemerickI'm being trolled.
17:28sritchienot fucking with you
17:28sritchielet me try w/ 0.3.2
17:28sritchieas you have in the github issues
17:29cemerickthis sounds like the nondeterminism mentioned in https://github.com/cemerick/pomegranate/issues/51, but there's no version ranges
17:30bellkevTimMc: So when doing either `lein ring uberjar` or `lein uberjar` it flies through all the print statements from your script and then hangs forever as before...
17:31sritchiecemerick: you're getting hit pretty hard w/ this stuff, looks like :)
17:31bellkevMaybe I should start sniffing around at what files that jvm is reading/writing? Maybe it's getting stuck compiling some del?...
17:31bellkevdep*
17:31cemericksritchie: just chillin' @ on the shooting range
17:32AeroNotixshould I put target/ into the .gitignore of a Clojure project. Seems like I don't need that in the VCS
17:33technomancyAeroNotix: yeap
17:33bitemyappAeroNotix: yeap
17:33bitemyappdamn, you guys were all supposed to say the same thing.
17:33AeroNotixcool ok
17:33AeroNotixoh wait, lein already does this
17:33AeroNotixderp
17:34mikerod_has anyone ever encounterd "CodeCache is full. Compiler has been disabled" when dealing with AOT compilation?
17:34mikerod_"Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled."
17:34mikerod_to be more specific
17:34hiredmanmikerod_: that is a jvm thing
17:34sritchiecemerick: oh boy. does this repl work behind https?
17:34sritchiethe browser repl
17:34sritchie?
17:34hiredmanmikerod_: the codecache is where jitted code goes
17:34cemericksritchie: I have no idea
17:34cemerickshould?
17:34mikerod_hiredman: indeed, this is what I'm reading. Is this expected from AOT code?
17:35mikerod_should I expect to need to bump up the cache size?
17:35hiredmanmikerod_: it doesn't have anything to do with aot or not
17:35sritchiecemerick:
17:35sritchie[blocked] The page at 'https://local.paddleguru.com/races/MikeEatonsLaJollaCovePaddleboardRace2014/register' was loaded over HTTPS, but ran insecure content from 'http://localhost:50210/6767/repl?xpc=%7B%22cn%22%3A%22Ysu2eIXd7I%22%2C%22tp….txt%22%2C%22lpu%22%3A%22http%3A%2F%2Flocalhost%3A50210%2Frobots.txt%22%7D': this content should also be loaded over HTTPS.
17:35cemerickhoo-boy, wonder where the hardcoded scheme is
17:35cemericksritchie: issues, please. :-( Cutting out...
17:36sritchiesure
17:36mikerod_hiredman: Interesting. We encountered it when switching to AOT and then running tests. So I just figured that was the cause. That could obviously be a wrong conclusion.
17:36bitemyapphah, he has issues.
17:37hiredmanmikerod_: it is completely about the jvm jitting bytecode to native code, and clojure compiles to bytecode aot or not
17:37ordnungswidrigsritchie: did you see https://github.com/clojure-liberator/liberator/pull/97
17:37sritchieordnungswidrig: so a map can be the first option?
17:38mikerod_hiredman: that makes sense. would there be a chance that the jvm may jit some extra bytecode than normal, when the clojure code because aot-compiled. since there would be more bytecode "available upfront" in the JVM.
17:39mikerod_when the clojure code *became* aot-compiled
17:39ordnungswidrigsritchie: like that. however the proposed patch only adds this for defresource. But the idea looks good. Why did you need the advanced merge logic?
17:39sritchiedid you see my example? I wanted to add content handlers for a bunch of diff content types in the base,
17:40sritchiethen have the ability to override just one or two (but still let all the defaults work)
17:40ordnungswidrigah, I will look at it again
17:40hiredmanmikerod_: clojure does compile to byte code on demand though, when it encounters a form -> bytecode
17:41mikerod_hiredman: that was the distinction I was making. on-demand byte code vs all of it eagerly generated.
17:41hiredmanmikerod_: right, clojure doesn't do that
17:41mikerod_except, I can't imagine why there'd be excessive jitting of byte code that wasn't being used
17:42hiredmanmikerod_: everything is compiled before you start running, unless you are loading code at runtime, which would be just the same in aot
17:43mikerod_hiredman: yes, I was referring to loading new code at runtime. however, it does seem to be the same thing as in the aot case anyways.
17:43ordnungswidrigsritchie: I would solve this by having a base map for the media-typed dispatch and use (assoc base-handler "application/json" my-custom-function)
17:44mikerod_so, conclusion: This new HotSpot warning is quite mysterious
17:45ordnungswidrigsritchie: I don't see how the :success key is used in the example
17:45sritchieordnungswidrig: that's my application's return value
17:45ordnungswidrigsritchie: oh dear
17:45ordnungswidrigsritchie: :-) It's late over here
17:46sritchie:) no worries
17:46sritchieyeah, media-typed takes the map -
17:46sritchieI would just use a map,
17:46amalloymikerod_: i can't imagine that being AOT-related either. there should be the same amount of total bytecode
17:46sritchiebut I can't define custom keys,
17:46sritchieand make my handlers functions of custom keys
17:46sritchieright?
17:46sritchieordnungswidrig: I guess I could just jam some stuff into the resource,
17:46sritchieand have media-typed look up that custom key
17:47amalloyand running out of that cache space seems like it would be really hard to do. perhaps you have macros generating very large methods, or some very large constants/literals?
17:47ordnungswidrigyou can, but I want to keep the option to make liberator strict on the accepted key in the future.
17:47mikerod_amalloy: yeah, that's what it is sounding like. On repeated runs, the warning actually stopped happening. So it looks like this is a "hiccup" of the HotSpot compiler.
17:47mikerod_amalloy: no large methods. I should look into the constant/literal thing
17:48amalloyhow do you know you have no large methods? macros do surprising things sometimes
17:48mikerod_I do not believe so, but that'd make sense as problematic
17:48amalloylike, are you using midje?
17:48mikerod_no midje
17:48mikerod_*but* we do have a DSL going on
17:48hiredmanI laughed
17:48amalloyi hoped you'd appreciate that, hiredman
17:48mikerod_so you're probably right, I need to look into large methods just as well
17:49hiredmanthere are aother options to turn on to print out compilation so you can see what is being compiled
17:50mikerod_hiredman: Clojure compiler options?
17:50hiredmanjvm options
17:50mikerod_ah ok
17:50ordnungswidrigsritchie: Why would this not work? https://gist.github.com/ordnungswidrig/8343552
17:51hiredmanyou may also want to add :jvm-opts ^:replace [] to your project.clj
17:51ordnungswidrigordnungswidrig: :handle-not-acceptable would be overridden in my-resource
17:51sritchieordnungswidrig: imagine the base has 5 media types it supports
17:51sritchieordnungswidrig: and I want to override only the json
17:51ordnungswidrigsritchie: ah, I see
17:51hiredmanbecause lein doesn't pass jvm options good for long running server processes
17:51mikerod_hiredman: interesting, haven't seen that one
17:52mikerod_I'll try experimenting some with the compile-print opts. Seems like I only got the warning one time. Then again JIT may be unpredictable, I don't know enough to say.
17:52jergasonwhere does leiningen put dependencies?
17:53bitemyappjergason: leiningen doesn't put them anywhere, maven does.
17:53bitemyappjergason:
17:53bitemyappjergason: ~/.m2/
17:53jergasonthank you, that is great
17:54technomancys/maven/aether/ but yeah
17:54technomancyjergason: when in doubt, `lein classpath` will tell you
17:54bellkevTimMc: Thanks again for your script, but it looks like I was just being stupid... I had some "hello-world" style Datomic code pasted into my ring app that just did a `(def conn (connect uri))` when the namespace is loaded, which must have been preventing the compilation process from exiting... Now it finishes in about 2min
17:55jergasontechnomancy oh neato
17:56ordnungswidrigsritchie: what about this: https://gist.github.com/ordnungswidrig/8343552
17:57sritchieordnungswidrig: that'd work, though it's a little ugly
17:57sritchieordnungswidrig: but the merge-with would probably be confusing to folks
17:57sritchielgtm
17:58ordnungswidrigsritchie: oh, that should be ommited
17:59ordnungswidrigsritchie: I think this way is more explicit to the user
17:59sritchieyeah, I agree
17:59ordnungswidrigbrb
18:03bitemyappucb: http://kasperrosa.bandcamp.com/track/coronal-mass-ejection
18:04ordnungswidrigsritchie: I can also imagine this: https://gist.github.com/ordnungswidrig/8343552/57400363a3c633e7bcefd8d43d88cbd4c6e8f523
18:05sritchieyeah, that's true
18:05sritchiethat does fit the pattern
18:05ordnungswidrigsritchie: so every function that takes a map, also can optionally accept a base map for the defaults
18:16seangrove,(keyword 1)
18:16clojurebotnil
18:16seangrove,(keyword (str 1))
18:16clojurebot:1
18:16seangroveYikes.
18:17arrdem,(type :1)
18:17clojurebotclojure.lang.Keyword
18:17arrdem<::1
18:17arrdem,::1
18:17clojurebot:sandbox/1
18:17mikerod_:::1
18:17mikerod_,:::1
18:17clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::1>
18:17seangroveI think it's likely we're going to need to move over to edn. Lots of mangling happening between clojure->json->clojurescript
18:22TimMcbellkev: Ah! So it had an open thread or something?
18:22bitemyappseangrove: interesting. What I've seen Fay/Haskell users do is share data-types between server and client, and use Aeson (JSON) to keep things a safe isomorphism.
18:22bitemyappseangrove: doesn't cause any problems because the tests and types make certain it *stays* an isomorphism, no lossyness.
18:22bitemyappseangrove: bonus? non-haskell clients/peers can participate if they want.
18:22bitemyappit's just JSON after all.
18:23seangrovebitemyapp: edn would get us a bit closer in any case
18:23seangroveI was just worried because of the amount of data we load into the client, and the parsing differences between edn vs json
18:23bitemyappseangrove: that's my point about the isomorphism.
18:23bellkevTimMc: Something like that. The connection was definitely keeping compilation from finishing. The build process needing to create a database connection during compilation is obviously stupid though, so I just need to make the Datomic connection handling slightly more realistic to expect it to AOT in a sane way...
18:24bitemyappseangrove: "differences" are meaningless when it's a faithful invertible encoding.
18:24bitemyappseangrove: using edn is bringing you closer to eval rather than invertibility.
18:25bitemyappIt is true that using edn here is probably going to play nicer in an otherwise clojure-y environment. Just seems like too much pain for a simple problem.
18:30Cr8bitemyapp: what does that do with numbers?
18:31bitemyappCr8: there have been multiple rounds of enhancements to how Aeson handles numbers.
18:33bitemyappCr8: https://github.com/bos/aeson/pull/156
18:33bitemyappCr8: Haskell gets used a lot in finance, relatively speaking, so there's a strong emphasis on sane handling of precision.
18:34Cr8sure, my concern is more taking the output JSON and trucking it through some non-Haskell tool
18:34Cr8many of which are wont to handle numbers as doubles
18:34darthdeusany idea why when i use basically any clojure web framework i don't see any content in chrome, but i do see it in safari?
18:34bitemyappnon-Haskell intermediaries are what they are, they doesn't really reduce the value of a higher fidelity parser though.
18:34darthdeusfor luminus i saw it was sending weird content-length
18:35Cr8as long as that's the only parser/encoder I use
18:35gregorstocksCr8: just don't use any integers greater than like 2**52, problem solved
18:35Cr8Cr8: and never need to represent NaN or +-Infinity
18:36Cr8s/Cr8/you/
18:36gregorstocksyou can use 2**52 + 1 for NaN
18:36gregorstocksuh, well I guess 2**52 + 2
18:38bitemyappCr8: so because some shitty tools exist, we shouldn't use better tools? Are you serious man?
18:39Cr8more that that tool doesn't fit into the larger ecosystem of "JSON tools"
18:40Cr8if my data will get trashed if other tools touch it
18:40Cr8so I'd rather just.. not use JSON
18:40Cr8rather than use something that calls itself JSON and breaks when I'm not expecting it to
18:40bitemyappCr8: I think you might be missing the point
18:41bitemyappCr8: there is an ecosystem of financial tooling all using vanilla JSON but that have better designed types around the precision of the numbers.
18:41bitemyappCr8: some of those changes are focused on making Aeson one of those better JSON libraries.
18:41bitemyappCr8: nothing breaks here, I don't think you understand at all what I've shown you.
18:42Cr8so how do numbers that would get trashed get represented?
18:42bitemyappCr8: JSON is a text based format. What do you think enhancing the precision of the underlying number types means?
18:43bitemyappCr8: it doesn't change the output, it just ups the ceiling on what you can accurately represent without loss than if you used IEEE-754.
18:43Cr8sure, but assume there's some guy in the middle that parses the json, doesn't modify what's there but adds some stuff, and re-encodes it
18:43bitemyappit doesn't actually *change* anything for people use hum-drum JSON parsers.
18:43Cr8that doesn't use these tools
18:43bitemyappso don't be an idiot?
18:44Cr8hm?
18:44bitemyappit doesn't hurt anybody to up the ceiling on the precision.
18:44bitemyappIf you're *counting* on the precision then the assumption is you also care about your data pipeline.
18:44bitemyappyou either care or you don't.
18:44bitemyappyou don't get to care about precision but then ignore where your data goes like a jackass and blame it on the use of a superior tool
18:45bitemyappthat's asinine.
18:45gregorstocksif you're emitting numbers with higher precision than IEEE 754 doubles, is it even valid json any more?
18:45Cr8I think what I'm debating is whether said tool speaks what is colloquial JSON
18:45Cr8and I would say that since it *isn't*
18:45Cr8what is the value of using JSON?
18:46bitemyappAeson is a standards compliant JSON parser.
18:46Cr8Which is why I said colloquial
18:46bitemyappit even follows the standard on only allowing arrays or objects at the top level.
18:46Cr8I'll still get my data trashed if I store it in CouchDB or RethinkDB
18:47bitemyappdecode "1" :: Maybe Int returns Nothing.
18:47bitemyappCr8: fixing retarded data stores is outside the purview of Data.Aeson.
18:47Cr8sure
18:47bitemyappCr8: it bumped the precision. People are using this faculty in production happily.
18:48seangrove(meta (<!! (let [x 10] (go ^:yolo {:val x}))))
18:48bitemyappCr8: Number in Data.Aeson defaults to the precision of a Double.
18:48seangroveI love it
18:49bitemyappseangrove: is the ^:yolo a war-cry?
18:49seangrovebitemyapp: Apparently - one cannot take the repl too seriously, apparently.
18:50Cr8I think my lament is more that the JSON standard isn't well-specified enough to guarantee that everything that can call it self "compliant" will safely roundtrip all "compliant" output
18:51bitemyappCr8: yeah, JSON is dumb, but we can still do our best.
18:52technomancydoes "compliant" mean "barfs on input containing comments"?
18:52Cr8i believe you have to barf on comments to be a JSON parser yes
18:52arrdemtechnomancy: does EDN support comments? I don't think so...
18:52gregorstocksis there a decent way to diagnose "Don't know how to create ISeq from: clojure.lang.Keyword" beyond carefully rereading every single line of code that I've written since it last compiled? i'm pretty sure all my (ns) stuff is fine
18:52bitemyapparrdem: wat
18:53Cr8https://github.com/edn-format/edn#comments
18:53arrdembitemyapp: what. we only have (comment) and ;. I'd be shocked if either works in EDN.
18:53gregorstocksnever mind i found it
18:53bitemyappCr8: from the standard, "JSON is agnostic about numbers. In any programming language, there can be a variety of number types of various capacities and complements, fixed or floating, binary or decimal. That can make interchange between different programming languages difficult. JSON instead offers only the representation of numbers that humans use: a sequence of digits. All programming languages know how to make sense of digit sequences even if they disa
18:53technomancyarrdem: no idea, but if it doesn't then it's dumb
18:53Cr8arrdem: ; works in EDN, and EDN also specifies discard. #_
18:53arrdemtechnomancy: apparently it does. we may be notation snobs.
18:53bitemyappCr8: I know this because I've had shitty edn parsers choke on both recently.
18:54bitemyappCr8: thing is, you're complaining about #FirstWorldProblems with JSON and I'm losing my fucking mind getting edn stuff to work.
18:54Cr8heh
18:54Cr8true
18:54Cr8I've got a C++ project here that I'm working on that has a JSON parser in it that will only hand me doubles
18:54bitemyappCr8: ugh, just use protobufs.
18:54Cr8which is actually causing me a problem
18:55bitemyappCr8: or Cap'n Proto :P
18:55Cr8I literally fought for us to use protobuf for like
18:55Cr8two months
18:55bitemyappCr8: cry
18:55arrdembitemyapp: errytime
18:56Cr8apparently we might improve things "this year"
18:56bitemyappCr8: why is every anecdote I hear about your workplace a carnival of horror?
18:56coventry`What is the "clojure config" doing in (use '[backtype.storm clojure config])? Is it some way of accessing backtype.storm.config?
18:56arrdemcoventry`: yeah
18:56bitemyappman. use? that's old-school as fuck.
18:56arrdemcoventry`: it's shorthand for (require '[backtype.storm [clojure] [config]])
18:57coventry`Oh, I remember now. And backtype.storm.clojure. Thanks.
18:57bitemyappNathan Marz gives no fucks, brooks no fools, etc.
18:57arrdemthe various linter projects had better bitch about (use)...
18:57bitemyapparrdem: good question. I should check kibit and eastwood.
18:57bitemyappI've been banging the drum on that one for awhile.
18:57seangroveI wish technomancy would push for s simplified ns format, I don't know he's so hellbent on having 12 different ways to specify things in there
18:57bitemyapparrdem: I get mad when Haskell code does a blank import.
18:58arrdemseangrove: what bugs you about ns? I think it's pretty straightforwards...
18:58Cr8bitemyapp: I have some theories. But I think at the end of the day most of it comes down to there not being agreement on what we're trying to build.
18:59technomancyseangrove: I'm too jaded to push for anything on jira
19:00technomancyyou will have to find a younger slash less-disillusioned champion
19:00bitemyappseangrove: I jumped ship, so don't look at me. 80% of the people on JIRA hate me as it is.
19:00seangrovebitemyapp: You do have a way about you with others
19:00gregorstocksto be fair 90% of the people not on JIRA hate bitemyapp
19:01bitemyappseangrove: I take inspiration from my Greek master Diogenes :)
19:01bitemyappgregorstocks: low-ball.
19:02gregorstockswell i'm including people who don't know who you are
19:02arrdemgregorstocks: you assume that people in ignorance are neutral
19:02arrdemgregorstocks: I contend that they are hostile
19:02seangrovearrdem: I was wondering about that point as well
19:03gregorstocksthis warrants an experiment
19:03arrdemeveryone in this channel is disqualified.
19:03gregorstockslet's send 10 random people (pizza delivery folks perhaps) to bitemyapp's home and see how many of them punch him immediately upon him opening the door
19:03gregorstockssub-experiment: see how long it takes him to stop opening the door
19:04arrdemgregorstocks: this will take a while based on the ammount of take-out that bitemyapp orders.
19:05bitemyapp^^ truth.
19:07Cr8is that that bitemyapp orders very little takeout, or so much takeout that there is resource contention for his door
19:07justin_smithI am very interested to find out what the answer ends up being to this clojurescript / core.async question on SO http://stackoverflow.com/questions/21033068/core-async-and-10-000-processes-for-animation-what-is-the-actual-benefit-in-th
19:08bitemyappjustin_smith: you don't see it for yourself?
19:08arrdemCr8: resource contention I suspect...
19:09bitemyapparrdem: not even that.
19:11bitemyappucb: http://dumbsaint.bandcamp.com/album/something-that-you-feel-will-find-its-own-form
19:11bitemyappCr8: neither. I already know all the people that deliver food in SF. I've drained the pool.
19:11bitemyappresource exhaustion! not contention.
19:13danneuwhat kind of lib would help me encode ["abc" "def"] to the url params ?to[]=abc&to[]=def
19:13bitemyappdanneu: Clojure
19:14gregorstocksdanneu: you might be able to get away with just (str "?to[]=" (clojure.string/join "&to[]=" args)), if that's all you need
19:15noonian,(apply format "?to[]=%s&th[]=%s" ["abc" "def"])
19:15clojurebot"?to[]=abc&th[]=def"
19:15bitemyappI'm pretty sure there's already a way to do this.
19:16xeqicemerick: any summary of the problem?
19:17justin_smithdanneu: apache.util.codec has a url parameter encoder, if that is what you are really looking for
19:18justin_smithsorry, I mean org.apache.commons.codec.net http://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/net/URLCodec.html
19:18justin_smithhttp://docs.oracle.com/javase/6/docs/api/java/net/URLEncoder.html?is-external=true actually just use this
19:19justin_smith(if url encoding is what you want, that is)
19:19danneufor url encoding itself i was just using http://ring-clojure.github.io/ring-codec/ring.util.codec.html#var-url-encode
19:25alewhttp-kit does param encoding
19:28bitemyappdanneu: :query-params {blah [1 2]} from http://localhost:3000/api/dump/?blah=1&amp;blah=2
19:28bitemyappdanneu: alew is right, I just tested it myself.
19:29bitemyappno idea if Jetty is nearly as cool as http-kit though >:)
19:29bitemyappalew: way to beat me to the punch by being braver.
19:29technomancyjetty is pretty boring
19:30hiredmangood?
19:30technomancyhiredman: boring is good
19:30technomancyfor libraries anyway
19:32alewhttp-kit was built from the ground up to work with clojure, so it has a really nice interface
19:38danneubitemyapp: i would've expected blah[]=1&blah[]=2
19:39danneuelse i believe blah is either going to be 1 or 2
19:39danneubut i guess http-kit's decoder handles that
19:40TimMcSo you want PHP-style parameters.
19:40TimMcPHP/Ruby/I forget what else
19:41bitemyappdanneu: why would you need []? That's friggin' ugly.
19:41bitemyappif the name is provided multiple values, it's no longer scalar. Really simple.
19:45tpopesimple except on the other end where now you have a sometimes-scalar-sometimes-collection
19:45tpopeit's a not-wholy-unreasonable pragmatic compromise
19:46bitemyapptpope: you should generally not breach cardinality barriers in your application
19:46tpopewhat does that mean
19:46bitemyapppartly because if you are forced to adopt merge semantics for multiple scalars->vector, you can end up producing data splits.
19:46bitemyapptpope: scalars stay scalar and vice versa.
19:47bitemyappthis also means that any data type for which it is known that it is [], an instance of "a" should should be promoted to "[a]"
19:47bitemyappbut if you violate the defaults in either direction a scalar promotion to vector can produce a data split where a sequence of overriding scalars were intended
19:47bitemyappthat gets ugly ugly ugly
19:48tpopeso is there a clojure idiom for that?
19:48arrdem tpope: no.. it's your application
19:48bitemyapptpope: it's application and persistence semantics. Of course Clojure doesn't do anything to help you keep things straight.
19:48arrdemtpope: it's a type issue
19:48tpopeI mean I have a parameter coming in that's nil if there were zero and a string if there was one and a collection if more than one
19:49bitemyapptpope: if you had an HTTP/serialization interface in a language like Haskell it could keep things safe and handle promotion.
19:49tpopebut we don't now do we
19:49bitemyappno. *grump*
19:49bitemyapptpope: String if scalar, coll if more than one? yikes.
19:49bitemyappSeqable Strings lel.
19:50technomancyhttp://thisotplife.tumblr.com/post/58367979425/string-or-list-of-integers
19:50bitemyapp(inc technomancy)
19:50lazybot⇒ 90
19:50bitemyappchoked laughing
19:50technomancybitemyapp: that blog is a gold mine
19:51bitemyapptechnomancy: This PLT Life is too Lisp dominated and not representative of actual PLT. Sad. :(
19:51bitemyappCommon Lisper land-grab.
19:52technomancycontinual status: http://thisotplife.tumblr.com/post/68065614838/when-i-hear-about-the-newest-database-or-web-framework
19:52tpopehaha
19:52tpope(inc technomancy)
19:52lazybot⇒ 91
19:53S11001001bitemyapp: that was my impression
19:53bitemyapparrdem: Haskell or doters?
19:54bitemyappS11001001: a waste, but it's funny sometimes in spite of itself.
19:54technomancyclojurebot: mutable data structures is http://thisotplife.tumblr.com/post/63360807823/mutable-data-structures
19:54clojurebotYou don't have to tell me twice.
19:54dsrxtechnomancy: lol
19:54arrdemhahaha
19:55arrdemtechnomancy: nicely done
19:55dsrxgreat blog
19:55arrdemhttps://infosecreactions.tumblr.com
19:55eggheadhi dsrx
19:55dsrxsup egghead
19:55arrdemhttp://securityreactions.tumblr.com/
19:56eggheadeveryone, I just got the okay to write an open sores clj+cljs app at work hooray
19:56bitemyapparrdem: aloria is great.
19:58arrdembitemyapp: just finished the inteded topic range.. 8090 words.
19:58arrdembeer and dotaz.
19:58bitemyapparrdem: noice. I WFM'd today, so I'm already at my desk! yey.
19:59bitemyapptechnomancy: I don't even mind Akka for being Scala as much as I mind them seeming to have ignored half or more of the things Erlang and OTP did right.
20:00bitemyapphttp://thisotplife.tumblr.com/post/58644976599/when-your-boss-suggests-switching-to-java
20:01technomancybitemyapp: blissful ignorance on that one so far
20:01bitemyapptechnomancy: the people happiest about Clojure at work were the people that had used Java on the job before.
20:01seuberthi dsrx egghead
20:02dsrxcobol is leaking...
20:02bitemyapptechnomancy: even if they didn't intend on using it immediately, they were just happy to have a nice way to do JVM stuff.
20:06egghead:)
20:08arrdembitemyapp: position assumed
20:09bitemyapparrdem: you are not in mumbur :(
20:12coventry`If I "lein uberjar" a project with ":main clojure.main", why does "java -jar uberjar.jar clojure.main -m myns" fail with "FileNotFoundException: clojure.main"? Is there a way to work around this, so I can use clojure's main to specify different entry points to the jar?
20:13technomancycoventry`: you can't specify a main with -jar; use java -cp uberjar.jar ...
20:14coventry`Oh, right. Thanks.
20:14technomancystupid java CLI behaviour at its finest
20:25seangrovebitemyapp: Mind rsvp'ing here and mentioning the topic of your lightning talk? http://www.meetup.com/SF-Clojurescript-Meetup/events/159485492
20:42hadronzooHow does one call the "/" (division) function from a different namespace? I need to refer to two different division definitions.
20:42hadronzoo"some.namespace//" fails
20:43alewseangrove: didn't know there was a cljs meetup in SF. I'll try to make it out!
20:43technomancyhadronzoo: that's technically not a legal function name
20:44technomancyyes, clojure breaks its own rules
20:45hadronzootechnomancy: I see. I'll alias it. Thanks
20:47alewtechnomancy: thanks for slamhound, extremely useful. do you think it could serve as a basis for a good refactoring tool? or does one already exist?
20:50technomancyalew: I don't think it's a good basis for refactoring; it's much too coarse-grained for the kinds of things you'd need for that
20:51technomancy"does this explode horribly when you try to compile it? [Y\n]"
20:51alewAh I see
20:56alewis there a way to force cider to reload all namespaces?
20:57TimMctechnomancy: I think 1.6 allows you to define /
20:57S11001001alew: like clojure.core?
20:57alewor I guess just the repl
20:57alewwell, just project namespaces would be fine
20:59alewI guess tools.namespace is what I want to look at
21:03testclojha
21:03testclojc
21:03testclojwhen use required, why we need to quota it if use it standalone, but could not use quota if put it inside namespace?
21:03testclojno quota here
21:03testcloj(ns test (:require clojure.string))
21:03testclojbut need quota here
21:03testcloj(require 'clojure.string)
21:06TimMctestcloj: This is because the ns form is a macro (or similar to one) so it can do the quoting for you.
21:12technomancyTimMc: define or refer?
21:16logic_progis there a way, using core.async, to say: "resize buffer of channel if necessary, but force this message on" -- the reason I need this is as follows: ... I have a websocket, and for the "on-close" of the websocket, I need to push a message saying [:socket-is-closed-with-status status] (thus, just closing the chnanel is not enough, since I need to also give the status). Thus, I need some way to "force the message onto the channel,
21:16logic_progis there a way to do the above?
21:22ToBeReplacedi don't understand prismatic/schema -- what does this get you that :pre/:post doesn't? not including coercion
21:25ToBeReplacedlogic_prog: no... but your consumer could alt! between two channels, and your producer could only put on the second channel the "close" message before shutting both
21:27logic_progToBeReplaced: suppose I have (let [msg-chan (...) signal-chan (...)])
21:27logic_proghow do I ensure that alt! only reads from signal-chan after msg-chan is empty?
21:27ToBeReplacedclose msg-chan, put to signal-chan, have the consumer use alt!
21:28ToBeReplacedif that's not clear, PM is okay
21:29logic_progToBeReplaced: https://gist.github.com/anonymous/8345977 <- hk = org.httpkit.server
21:29logic_progthis code is clearly still broken
21:29logic_progcurrently working on lines 11-13
21:32ToBeReplacedlogic_prog: i don't have httpkit experience so i can't quite follow it, i'm sorry
21:38logic_progToBeReplaced: I think your idea works, I just need to think it through.
21:55TimMctechnomancy: Sorry, what?
21:56TimMcOh, /. Uh, I thought you could define.
22:45[Neurotic]Hey, if I'm in a ClojureScript file in which I've defined a macro (so a .clj file), how do I import in a macro from another namespace. I keep getting "No such var: clojure.core/use-macros" - but I just :use or :require it doesn't seem to work?
22:45TimMcibdknox: Congrats on the release! This is great.
22:45TimMcNow that the plugins are in place, I'll have my paredit (or write it myself.)
23:00TolstoyHow do you change the font in LightTable? :)
23:02TolstoyAh!
23:05arrdemTimMc: I think there already is one...
23:16seangroveAnyone have any guidance on clojurescript compilation failing with a heap space error? https://www.refheap.com/a0d7672674da0eb7724a10a5e
23:19seangroveActually, seeing Error occurred during initialization of VM: Too small initial heap
23:19amalloyseangrove: that stacktrace looks like it ran out of memory while trying to construct an error message for some other problem
23:20seangroveamalloy: How strange ... I wonder what I changed to cause that.
23:21amalloyyeah, seems pretty weird to me too. i don't do any cljs, so take my analysis with a grain of salt
23:21amalloybut check out lines 53-64 of your paste
23:22seangroveMaybe I just need a good restart
23:22amalloyi guess it catches all Throwables
23:23seangroveamalloy: What is the "Caused by:" telling me here?
23:23seangroveIs the error on line #5 caused by the lines referenced in #52-53?
23:23amalloyman. allocating memory to produce an error message, after you've just caught an OOM, is a pretty sad thing for a compiler to do
23:24amalloyseangrove: the exception on 53 happened, then it was caught/wrapped/thrown in the exception at 52, and then that was caught/wrapped/thrown by the one on line 5
23:24seangroveamalloy: Ahh, I was reading it backwards then
23:25amalloythe problem here is that the exception on 53 had already caught some other, more useful, error, and then OOMed before it could tell you what the message from that error was :P
23:26amalloyIMO that wrapping-errors in cljs.analyzer should really be (catch Exception e), or at least something less blunt than (catch Throwable t)
23:26bitemyappseangrove: I RSVP'd and mentioned what I was offering to give a talk on.
23:27amalloybbloom, you around?
23:27seangroveamalloy: I just bumped up the memory with :jvm-opts ["-Xmx6g"] and seems like it's working-ish, thanks
23:28seangrovebitemyapp: Awesome, looks good
23:29amalloy$mail bbloom https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L274 is catching an OOM error, then attempting to allocate more memory to display it more prettily, so that the original stacktrace is lost. see https://www.refheap.com/a0d7672674da0eb7724a10a5e for an example stacktrace
23:29lazybotMessage saved.
23:31bitemyapparrdem: really?
23:31bitemyapparrdem: I don't see it.
23:32arrdembitemyapp: editing it now
23:32arrdembitemyapp: do we have a policy on user pages?
23:32arrdems/we/you/g
23:32bitemyapparrdem: Not at all.
23:32arrdembitemyapp: kay. hiredman now has a stub page.
23:33bitemyapparrdem: I am hella confused, I don't see what you're doing on clojurewiki.com
23:33arrdembitemyapp: hold please.
23:34arrdem(inc)
23:34arrdem(inc foo)
23:34lazybot⇒ 3
23:34amalloyhuh. i just realized you can use '->> and 'let to effectively mimic haskell's "where": (->> (+ x y) (let [x 1, y 2])). like, i've seen people write that code before, and laughed at the silly trick, but only just now noticed it's the same as where
23:36tbaldridgebut....ick.....
23:37bitemyapptbaldridge: why the ick?
23:37tbaldridgeIt'd be really easy to shoot yourself in the foot with that, pick up a local from an outer scope or something.
23:39bitemyappoogly. :)
23:46arrdembitemyapp: there's your first bot page...
23:46arrdembitemyapp: sure I missed something.
23:46arrdem$google foo
23:46lazybot[Foobar - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Foobar
23:48arrdem$help
23:48lazybotYou're going to need to tell me what you want help with.
23:48clojurebotTitim gan éirí ort.
23:49arrdem~inventory
23:49clojurebotI am carrying 0) a poorly-calibrated inference engine, currently leaking 1) a well-worn copy of clojure 1.2 tucked deep away inside a classloader 2) the last shreds of what was once my sanity
23:53bitemyapparrdem: thank you :)
23:57arrdembitemyapp: so lazybot has a silly number of plugins
23:57arrdemand we never use them
23:57arrdemI will not attempt to document anything more than what I have seen used in here.
23:57arrdem&&(println "hell yes")
23:57lazybotjava.lang.RuntimeException: Unable to resolve symbol: & in this context
23:58arrdemfoo bar &(println "hell yes")
23:58arrdemis it && or ##.. I always forget...