#clojure logs

2013-12-16

00:00SegFaultAXv4n: Mind gisting your impl?
00:00v4nSegFaultAX: Sure, one second.
00:07v4nSegFaultAX: https://gist.github.com/anonymous/7982574
00:15SegFaultAXv4n: Cheers
00:31andreiWhat's the clojure equivalent of exact? and inexact? ?
00:34hyPiRionwhat are those to begin with?
00:35andreiThey're from scheme. Some representations for numbers are exact like ints, longs, rationals. Others are inexact, like floats and doubles
00:38coventryWhen are those useful?
00:39v4n,(/ 2 4)
00:39clojurebot1/2
00:40bbloomandrei: we have big ints & decimals, but no predicates builtin. use clojure.core/instance?
00:40bbloomandrei: ratios too
00:40v4n,(double 2/4)
00:40clojurebot0.5
00:40v4n,(rationalize 0.5)
00:40clojurebot1/2
00:40coventryv4n: I'm aware. I'm curious about contexts where you have to care.
00:41andreibbloom: Ah, ok. I was hoping to avoid having to write a big branch to do this
00:43andreicoventry: Basically you always care if you're doing anything related to math. The semantics of all math operations change drastically depending on the representation of the numbers.
00:44bbloomandrei: thats why such predicates aren't that useful :-)
00:45andreibbloom: Right, but I expect my inexacts to generally be IEEE doubles or floats, and my exacts to be.. well exact
00:45andreibbloom: In which case those predicates are useful
00:46andreiAlso, has anyone discussed a patch to fix the (/ 1.0 0.0) behaviour?
00:46coventryandrei: Are you doing math which requires both types of represenation? Sounds interesting.
00:46andreiIs this something people actually want?
00:46andreicoventry: Yup. You definitely don't want to mix the two. For example, you never want to compare two inexacts for equality. Something that people do all the time
00:47andreiI'm happy to write the patch, but I went through this whole discussion with the chicken scheme people and in the end they want their non-IEEE-compliant behaviour
00:47andreiI'd rather save the effort of writing the patch :)
00:48coventryWhat kind of math are you doing?
00:48coventry(If you don't mind/are interested in talking about it. I'm just curious.)
00:49andreicoventry: Sure. I do lots of machine learning in computer vision, ai, robotics and neuroscience
00:50andreicoventry: I've been doing everything in Scheme for a long time
00:51andreicoventry: But I'm hoping to move over to clojure
00:54coventrySo what's an example in your scheme code where you use the exact?/inexact? distinction?
01:05petehuntdnolen: yt?
01:05echo-areaIs it a feature that the installed multimethod can share only the required arguments but have different other arguments?
01:06echo-areaI find this makes it easier to create a single dispatch function for a group of multimethods
01:06echo-areaI'm not sure if I should make use of it though
01:16mlb-I see three clojure libraries wrapping Apache POI: docjure, clj-excel, and spreadmap. Does anyone here have any experience/opinions on them? I can't seem to see significant shortcomings in one another addresses
01:37petehuntbbloom: yt?
01:42eggnogginyt?
01:43eggnogginhey petehunt thanks for your work on react looking forward to using it on some upcoming projects
01:46dnolenpetehunt: hy
01:46dnolener hey
01:53petehunteggnoggin: thanks! hope you find it useful!
01:53petehuntdnolen: hey, i was wondering how to override the sorting of sorted_set
01:53petehuntdnolen: also, been working on this guy today: https://github.com/petehunt/morimodel
01:54dnolenpetehunt: there's sorted_set_by (probably not documented?)
01:54dnolenpetehunt: and sorted_map_by too
01:55petehuntdnolen: ah, sorted_set_by sounds interesting. so i can put anything in there (like a hashmap) and sort it by one of the keys in it?
01:55hyPiRionpetehunt: yes
01:56dnolenpetehunt: first arg to both is a comparator function
02:01petehuntah i see... mori is just clojure.core
02:08jph-is there a functional bash-equivalent?
02:12hyPiRionjph-: https://github.com/alandipert/gherkin ?
02:14hyPiRionNot sure if there is a serious functional bash equivalent though
02:14hyPiRionthere is any*
02:14jph-hyperboreean: cool
02:14jph-i was just writing a bash function and thought... why not functional?
02:14jph-ie a lispy bash
02:15hyPiRionwell, that's a lisp, implemented in bash
02:15jph-yep
02:15jph-i also havent yet ventured into tuning jvm/cloj to make it more usable for command line tools
02:17logic_progwhat are functaioal data structures similar to the zipper?
02:17logic_progi'm trying to write a "structured' -editor, i.e. something like paredit, but stronger guarantees
02:17logic_progI'm trying to figure out if I should use functional zippers, or if there is something better
02:20petehuntdnolen: hrm, looks like conj() isn't causing my comparator to be called
02:20petehunti guess map() removes the sorted_set from it
02:41beppujph-: to avoid the slowness of jvm startup times, I think a good strategy for CLI apps would be to daemonize themselves. https://github.com/icylisper/jark
02:42jph-beppu: interesting approach
02:53beppujph-: Another approach would be to run ClojureScript on top of node.js. Then, you wouldn't need to daemonize, because startup times are relatively fast.
03:08mindbender1,(clojure.string/split "abc.def" #"\\.")
03:09clojurebot["abc.def"]
03:10hyPiRion,(clojure.string/split "abc.def" #"\.")
03:10clojurebot["abc" "def"]
03:10hyPiRionregex doesn't need escaping in clojure
03:11gunsreader macros ftw
03:11gunswhat a nice little piece of design
03:12mindbender1hyPiRion: emacs refused me doing #"\."
03:13mindbender1But at least I know the problem now, thanks
03:15mindbender1Changing the buffer coding system now to utf-8 solves that
05:17sm0kewhy is ring named so?
05:17sm0kei fail to understand middlewares
05:27clgvsm0ke: maybe a lord of the rings reference? "one to bind them all..." or such ;)
05:28RaynesIt is 100% a LOtR reference.
05:28clgvthere you go ;)
05:28clgvbut in contrast to "friend" there is no quote in the "ring" readme ;)
05:35sm0keclgv: Raynes i think this is better http://i.imgur.com/6zAYD.jpg
05:47seriously_randomhow to create vectors inside vector recursively? http://pastebin.com/C1mpc94w
06:00ddellacostaseriously_random: what is compartmentalize meant to do? I don't understand the output you've got there.
06:01supersymsay can anyone tell me the notation for Java class like GoogleAuthorizationCodeFlow.Builder in Clojure
06:02seriously_randomddellacosta, a sequence of elements grows in length while condition is true, e.g. [1 3] and then stops if condition is false (4 is not odd)
06:03ddellacostaseriously_random: and then stops at that point and throws the rest away?
06:03ddellacostaare you doing it for practice or need to solve a specific problem?
06:04seriously_randomddellacosta, no it skips until it finds another element at which point new vector is created
06:04seriously_randomddellacosta, practice.
06:04ddellacostaseriously_random: ah, okay
06:05supersymah $ notation ofc
06:06seriously_randomddellacosta, how about this: filter [1 2 3] to (1 3) and then use (1 3) to create [[1] [3]] out of [1 2 3]
06:06dsrxI wouldn't say you *never* want to compare values of inexact types, you just shouldn't compare the results of two arbitrary computations resulting in inexact types
06:06ddellacostaseriously_random: what about [1 3 4 5], like in your example?
06:06dsrxoh god i was lost in scrollback land. sorry
06:07ddellacostadsrx: I expected your next comment to be, "discuss"
06:07ddellacostaheh
06:07seriously_randomddellacosta, doesn't matter. let's say I can filter any vector for any condition I want.
06:09seriously_randomddellacosta, so basically I don't know how to start and close a vector, neither do I know how to put it inside the main vector
06:10ddellacostaseriously_random: sorry, I'm confused--are you trying to just create a vector from filter's output? Or do you want something like you specified above, from your example?
06:10ddellacostaIf it's the former, you can just do
06:10ddellacosta,(into [] (filter odd? [1 3 4 5]))
06:10clojurebot[1 3 5]
06:10carka rather ugly solution : http://pastebin.com/dRBWq41Y
06:12seriously_randomddellacosta, continuous sequences that meet the condition. Filter use is not allowed (I have another function that can filter)
06:12seriously_randome.g. if condition is odd [1 3 4 5] becomes [[1 3] [5]].
06:18seriously_randomcark, what if I have prefiltered list, e.g (1 3) for [1 3 2] and function that creates [[1 3] 2] out of it is not recursive?
06:18seriously_random*[[1 3]] (without 2 obviously)
06:18fredyrseriously_random: you can use partition-by perhaps
06:19fredyr,(partition-by odd? [1 3 4 5])
06:19clojurebot((1 3) (4) (5))
06:19fredyrand filter out the appropriate seequences
06:20seriously_randomfredyr, no filter, no partition-by
06:21fredyrwell im talking about the concepts anyway
06:22fredyrseems like you're doing homework assignments
06:23seriously_randomsort of :)
06:24fredyrthe impl of partition-by might give you a hint on how to implement what you're after anyways
06:39ddellacostaseriously_random: does it have to be vectors?
06:39ddellacostaseriously_random: this will do it: (defn compart [pred s] (let [[n1 n2] (split-with pred s)] (if (seq n2) (concat [n1] (compart pred (rest n2))) [n1])))
06:41carkwith an accumulator you can make this not blow the stack
06:42ddellacostayeah, my solution is not good, nevermind
06:45ddellacostaseriously_random: just added a (remove #(nil? (seq %)) ... ) and that did it though. Not saying it's good for much else than being concise though, as cark says, you could blow the stack if your input is too big
06:49carkanyways i'm off, byebye
06:50ddellacostacheers
07:07Morgawrperforming a send operation inside a swap! won't result in multiple send operations in case the swap! is re-tried, right?
07:34TimMcMorgawr: swap! is an atom operation, right? I think you only get that feature with refs.
07:35MorgawrTimMc: so if I send something inside a swap it could be sent multiple times?
07:54TimMcMorgawr: I believe so, yes.
07:55Morgawraw shucks.. thanks
08:19clgvMorgawr: in an atom it might be sent multiple times. transcations on refs guarantee that it is sent only once
08:36edwHow does one let Clojuresphere know about one's project?
08:37mdrogalisedw: You do nothing. But it hasn't been indexed in about a year.
08:37edw:(
08:37mdrogalisIt's kind of a shame for how cool it is.
08:38edwmdrogalis: Totally. People shouldn't even bother doing awesome stuff if they don't have a plan for handling bit rot. I suppose someone could fork it and run their own.
08:39edwmdrogalis: BTW, you're in Philly? I'm from Philly.
08:39mdrogalisedw: I don't know if I agree with that, but yes. Could always do it yourself.
08:39mdrogalisI am, how'd you know? :P
08:39edwYour hostname.
08:39edwmdrogalis: `phlapa`
08:40mdrogalisAh, eh I never noticed.
08:40mdrogalisWhere're you working?
08:41edwWas asking because I'm on a recruiting binge for my co. I'm in NYC. In SoHo right now.
08:41edwLive in the E Village.
08:41edwUsed to live in Old City.
08:42mdrogalisedw: Ah, got'cha. I work in center city. Living out in Manayunk.
08:42mdrogalisOld City's nice. I really like it over there.
08:43edwYeah, I couldn't live anywhere else. I had a big loft for $725/mo. I've ridden past Manayunk many times on the SRT.
08:43mdrogalisThat's a really awesome price.
08:44mdrogalisNYC is just too crowded for me.
08:45edwI got here and I thuoght, "Huh, seems kinda empty, maybe I should move to Tokyo." But your typical NYC street is busier at 2am than Market St at noon.
08:45mdrogalisYeah, that's just too much. Haha.
08:48edwIt changes you. You start getting comfortable shoulder checking people on the sidewalk. Of course I once had a skate rat bounce off of me on the sidewalk at 9th and Market.
08:48mdrogalisInternet on the fritz in our office. Possibly brb.
10:03instilledhello. anybody uses lein-cloverage plugin? The plugin never returns to the shell but hangs at 'Produced output' (the last step). The generated report is complete. Any idea?
10:23rkneufeldHey folks, anyone know of a Clojure-based library to programmatically wrap and indent strings of Clojure code?
10:25tbaldridgepprint :-P
10:26rkneufeldThanks for pointing out my ignorance timothy.
10:29tbaldridgeany time, any time.....
10:40eigenricktbaldridge: I built a multi-room message routing system with websockets over the weekend. multi made it trivial. Nice work.
10:40eigenrickmulti
10:40eigenrickmult
10:40stuartsierrarkneufeld: pprint takes an optional formatter function, there's one specifically for formatting source code.
10:41eigenrickthe downside is I felt more like a plumber than a programmer.. :)
10:47rkneufeldstuartsierra: fantastic, that was something I was looking for
10:49rkneufeldI'm mulling over creating an nrepl middleware to pretty print things by default
10:50stuartsierrarkneufeld: Resist the urge.
10:50rkneufeldlol
10:50rkneufeldstuartsierra: many lives lost on this path before?
10:51stuartsierraNot personally, but I wouldn't trust it. pprint is slow on large collections, and it doesn't print records properly.
10:55tbaldridgerkneufeld: you might look at bbloom's printer as well.
10:55tbaldridgerkneufeld: https://github.com/brandonbloom/fipp
10:56tbaldridgeand hey, it has a nrepl plugin
10:56rkneufeldNice!
10:57stuartsierraI wonder if it would be possible to make a "dumb" pretty-printer that always adds line breaks for collections, and if that would be useful?
10:58rkneufeldThat's closer to what I am looking for, really. I don't *need* crazy pretty printing, just *somewhat* more readable output.
11:00clgvstuartsierra: at least you'd need to track the nesting levels for indentation in the dumb printer. otherwise its usefulness is very limited
11:00stuartsierrayeah, that's easy
11:03zachallauncemerick: Is it possible to load external JavaScripts into an austin REPL session?
11:05cemerickzachallaun: There's a new-ish :prelude compiler arg, right? That should work, and probably shouldn't require any special support from austin.
11:05zachallauncemerick: Ah, great. Thanks, I'll check that out.
11:22daydreamtr
11:22daydreamtsorry, typo
11:23supersymjava.lang.Exception: The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)
11:23`cbpsupersym: (defmulti foo type)
11:23`cbp&& (defmethod foo String [x] "tis a string")
11:23`cbpbut if youre dispatching on type you might as well use protocols
11:23lazybotjava.lang.RuntimeException: Unable to resolve symbol: & in this context
11:23supersym2 arguments
11:24supersymyeah... sigh, perhaps I should later on
11:24`cbpwell then (defmulti foo (fn [x y] (type x)))
11:24supersymI'm rushing against a deadline and no one has made a decent library of those google-libs yet
11:24`cbpand (defmethod foo String [x y] "tis a string")
11:25supersymah
11:25supersymI see what the problem was
11:26supersymLightTable memory refushed to change the functions after re-eval... changed the name and it does work
11:26supersymthanks
11:28`cbpi think theres a bug in nrepl that doesnt let you redefine defmulti signatures but im not sure
11:32pjstadigthat's not an nrepl issue, it's more a clojure
11:32pjstadigissue
11:32pjstadigand by "issue" i mean conscious decision
11:37raekI filed a bug about the defonce-like behavior of defmulti ages ago... I wonder what happened to it
11:37stuartsierraIf I recall, that was a decision to avoid the opposite problem, that re-evaluating the defmulti destroys existing defmethods.
11:38raekyeah, either way is bad in some way
11:41joegallo_if only there were some way that i could eat this cake, and yet still be able to have it...
11:41joegallo_because i want both, you see
11:41TimMcjoegallo_: You want to have your cake, and eat it, and have it be performant.
11:42joegallo_but of course
11:42eric_normand`(doc ==)
11:42eric_normand,(doc ==)
11:42clojurebot"([x] [x y] [x y & more]); Returns non-nil if nums all have the equivalent value (type-independent), otherwise false"
11:44pjstadigjoegallo_: you could maybe have your cake and eat it, too, if the cake was decomplected
11:45pjstadig(def (multi-fn dispatch-fn)) or (defonce (multi-fn dispatch-fn)) take your pick
11:45pjstadignot sure how possible that would actually be
11:46pjstadigi guess you could write the macros yourself and just instantiate the multi method classes manually or something
11:47stuartsierraRedefinition of multimethods & protocols is one reason I wrote tools.namespace.
11:49logic_progby default, when clojure gets an error, it seems to throw an exception. By default, when cljs gets an error, does it return an error object instead of throw an exception?
11:53Raynestechnomancy: tentacles supports code search now, thanks to elobato.
11:55gdev__using lein uberjar, get "javac: invalid flag: -Dclojure.compile.path=<my compile path>"
11:56gdev__what have I done wrong?
11:57mdrogalisgdev__: Related to Clojure, or just in general?
11:57mdrogalisWe can talk about it, you know.
11:57gdev__mdrogalis, why has javac forsaken me?
11:57justin_smithgdev__: is there an illegal character or improperly quoted one in that path?
11:58Rayneslol
11:58mdrogalisgdev__: She's a cold, cold lady.
11:58nDuff...eh? Is lein not using System.exec(String[]) (in which case things aren't parsed through a shell, so no quoting is necessary)?
11:59Rayneshuh
11:59gdev__justin_smith, my project name has a dash in it, so not sure if that is causing issues
11:59RaynesThat's a thing? You can make args not get processed by the shell?
11:59justin_smithRaynes: totally
12:00nDuffRaynes: the execv syscall is what the shell uses to start other programs, but you can/should use it yourself directly when possible.
12:01nDufferr, it's Runtime.exec(String[]), not System
12:01justin_smithnDuff: my thought was a character that fucked up javac's arg parsing, so it would not recognize that valid argument
12:02hiredman*/win 21
12:02nDuffjustin_smith: well, the thing is that parsing out a string into an argument list happens before a program is ever started, either in the shell (if there is one) or by the parent process passing a literal argument array. As for the value side of -Dkey=value, it would be really abominable if the JVM did anything with that other than pass it through literally w/o any kind of parsing or unescaping.
12:03nDuffjustin_smith: ...because if that *were* the case, things would need to be written to survive two layers of parsing -- one by the shell, one by the JVM. That would be silly.
12:03gdev__it compiles the files, but it won't jar them up
12:03justin_smithjust wondering why the hell it would think -D... would ever be invalid
12:04justin_smithpretty much assuming there is a javac bug
12:04nDuffjustin_smith: ...well, I'd start by using strace to look at the actual argument list.
12:04nDuffstrace -e trace=exec -s 2048 -f lein uberjar
12:04nDuff## ...and look at how it invokes javac.
12:05deadghost_http://pastebin.com/CaTND18j
12:05deadghost_I'm screwing up recur or korma
12:05deadghost_maybe clojure in general
12:06nDuff!pastebin.com > deadghost_
12:06nDuff...oh, wrong channel for that factoid.
12:07justin_smithdeadghost_: map does nothing if you don't consume the values returned
12:07justin_smithit is lazy
12:08deadghost_ok
12:08deadghost_so how do I yell at it
12:08justin_smithby reading everything that comes back
12:08justin_smithdo something with the return value
12:08justin_smithor use doall
12:09philandstuffoften doseq is more appropriate, though the syntax is a bit different from map
12:09justin_smithanother option is to generate the values with map, and use them in something non-lazy like reduce or doseq
12:09justin_smithdepending on what you intend to do with the returned values of course
12:09philandstuff(map (fn [x] ..x..) coll) => (doseq [x coll] ..x..)
12:13silasdavisis there destructuing syntax for getting at metadata of arguments?
12:14gdev__Okay, I think its a java 6 issue
12:14justin_smithsilasdavis: metadata is on vars, arguments usually show up as values
12:14gdev__I just uberjarred on a box with java 7
12:14silasdavisah
12:15pjstadigsome values can have metadata, too, but there's no destructuring syntax for it
12:15justin_smith((juxt (fn [x] (meta x)) meta) clojure.core/+)
12:15justin_smith,((juxt (fn [x] (meta x)) meta) clojure.core/+)
12:15clojurebot[nil nil]
12:15justin_smitherr...
12:15justin_smithahh of course
12:17justin_smithpjstadig: interesting, what is an example of a non-var value I would run into that has a metadata?
12:17pjstadig,((juxt (fn [x] (meta x)) meta) ^:meta {:foo :bar})
12:17clojurebot[{:meta true} {:meta true}]
12:18pjstadigsymbols can have metadata, all the collection types
12:18pjstadigjava objects (Strings, Integers, etc.) cannot, and keywords cannot
12:18justin_smithinteresting
12:26silasdavisDoes anyone know of tool for analyzing unused clojure code?
12:26silasdavisin the first instance just finding unused declarations would be useful
12:29Bronsasilasdavis: https://github.com/jonase/eastwood
12:32technomancysilasdavis: radagast can find unused vars
12:32technomancynothin' to it
12:33technomancyhttps://github.com/technomancy/radagast/blob/master/src/radagast/coverage.clj
12:33silasdavisBronsa, technomancy thanks
12:33AnderkentI've only now came in, so not sure what the question is, but if it's code coverage then I must plug cloverage
12:35silasdaviswill take a look, thanks
12:36technomancyjust a binary y/n over a set of vars is pretty trivial. real code coverage has to be a lot more complicated with branch analysis.
12:36AnderkentI do branch analysis! I agree it's pretty complicated though.
12:37Anderkent(and because printing out clojure code is too hard, it's transformed into line analysis on output. Bah)
12:37technomancyyeah, just saying it might be overkill
12:37Anderkentright, of course.
12:39technomancyradagast is more interesting as a proof of concept for how trivial stuff like that can be if you don't care beyond the granularity of a var
13:50pcnDoes anyone have a moment to tell me why this would fail? https://gist.github.com/pcn/7992191
13:51logic_progwhat is the motivationb behind :require and :require-macros, rather than a single unified approach ?
13:52amalloypcn: that is just a big old blob of code. "why doesn't this work" is not an easy question to answer; you don't even say what goes wrong
13:54llasramlogic_prog: Because CLJS macros are actually implemented in JVM Clojure
13:55pcnamalloy: You're absolutely correct. I've updated the gist and I can provide more context if you'd like.
13:55logic_progllasram: ah, so we need :require-macros in order to tell cljs "hey, look for a *.clj file, not a *.cljs file"?
13:55llasramlogic_prog: Something like that. I've only dabbled in CLJS, so I can't comment an details
13:55amalloyokay, so you're trying to call .write on a Writer, and passing it two arguments
13:56amalloybut .write only accepts one arg; you probably meant (str (write-json) "\n")
13:59pcnWhups
13:59pcnLet's try that
14:01dnolenlogic_prog: that's more or less it. 2120 has some nicer sugar if you're CLJS source file and macro file have the same name and only a differing extension
14:01pcnOK, that's completely correct! I was afraid I was doing something much more subtly wrong.
14:01pcnamalloy: thanks a lot. I've been staring at that for too long.
14:05TimMcIt's not so much that macros are implemented in JVM Clojure as that the referenced macros need to be marked as compile-time only, right?
14:16justin_smithwhat does it mean for a macro not to be compile-time only?
14:17TimMcThat's not the distinction I was trying to draw.
14:21justin_smithit was a legitimate question, I still don't understand what you were saying
14:24TimMcjustin_smith: Well, couldn't the compiler just as well use CLJS for the macro language?
14:25TimMcBut then you'd still need to distinguish the compile time and runtime namespaces.
14:26justin_smithwell cljs doesn't run in the compiling process, does it? maybe I don't understand the series of compile stages for clojurescript
14:26TimMcWell, *I* sure as heck don't. :-P
14:38bitemyap1I need to stay away from HN.
14:39bitemyappRaynes: how are you doing?
14:42Raynesbitemyapp: Splendidly. Yourself?
14:46bitemyappRaynes: likewise! Met a founder of a really nifty analytics company today. Had some nice cafe au lait.
14:46bitemyappTaught some Haskell on Saturday. Feeling a bit carpe diem.
14:47RaynesNice.
14:47bitemyappRaynes: how's your learnings of the muggle languages going?
14:47RaynesPretty well. I finished up the Go refheap client.
14:48RaynesWas fun.
14:49pyykkisfds
15:00paulmooringanyone mind giving a newbie some advice on how to make this more "clojure-like": https://gist.github.com/paulmooring/7993298
15:00seubertRaynes: is that public? (the golang client)
15:00Raynesseubert: Yep.
15:00Rayneshttps://github.com/Raynes/goheap
15:01seubertoh somehow i totally missed that on your github
15:01seubertthanks!
15:03bitemyappseubert: could just use curl too.
15:04rkneufeldpaulmooring: I would consider using filter on (range x) and using (reduce + ...) on the filtered range.
15:04Raynesbitemyapp: httpie is really cool for stuff like that.
15:05seubertbitemyapp: right, the reason i asked is because i'm learning Go and was just curious
15:05seubertwoah i totally forgot about httpie
15:06paulmooringrkneufeld more like: (reduce + (filter (fn [x] (or (= 0 (rem x 3)) (= 0 (rem x 5)))) (range 1000)))
15:07rkneufeldpaulmooring: Yeah! You could fiddle with the filter predicate a little if you liked, but that should get the job done.
15:07paulmooringthanks very much, this takes a little brain re-wiring :D
15:12OscarZwhy is this not working: (map (math/expt) (take 3 (primes)) '(2 2 2)) ... primes is a lazy infinite sequence.. im getting arityexception
15:13RaynesYou guys.
15:13OscarZah crap.. i got it :(
15:13RaynesInstaparser is cool.
15:13RaynesJust sayin'
15:13RaynesWell, instaparse. No 'r' at the end.
15:13OscarZextra parentheses again..
15:13justin_smithOscarZ: (primes) :)
15:15OscarZjustin_smith: it was the (math/expt) parentheses..
15:15RaynesOscarZ: What is your editor of choice friend?
15:15OscarZand it was missing those arguments too
15:15OscarZim using Sublime Text atm
15:15RaynesHeh.
15:16OscarZjust a simple text editor :)
15:16RaynesThat's like the one editor where I can't shove paredit down your throat.
15:16RaynesYou've lucked out.
15:16OscarZheeh.. i can change :)
15:16OscarZwhat do you recommend
15:16Rayneswait
15:16RaynesYes I can.
15:16RaynesOscarZ: https://github.com/odyssomay/paredit
15:16tbaldridgeemacs, emacs, emacs....
15:16RaynesOscarZ: This is the best way to edit Lisp code imo. There is a learning curve.
15:17r4viemacs+clojure is quite the learning curve
15:17justin_smithOscarZ: oh, you said primes was an infinite lazy seq, so (primes) would be invalid in that case
15:17RaynesOscarZ: It keeps your parens balanced. Does not let you have unbalanced parens.
15:17RaynesIf this is done properly, anyways.
15:17justin_smithso you mean primes *generates* an infinite lazy seq
15:17OscarZjustin_smith: yes i suppose that was inaccurate
15:18RaynesOscarZ: Instead of adding closing parens at the end, they appear when you type ( and when you need to move code around, there are commands to shift the parens around code and such. It's quite beautiful once you get the hang of it.
15:18RaynesAnyways, something to consider.
15:18Raynes:)
15:18OscarZok..
15:20OscarZI tried Light Table too.. it was pretty cool
15:21dsrxparedit is great
15:22r4viand rainbow parens
15:23schmirdoes anyone have experience with smartparens?
15:23schmir(https://github.com/Fuco1/smartparens)
15:23OscarZoh yeah.. colors would be nice
15:24jballancI hear it's even better than paredit...but I don't use emacs
15:24nDuff...hmm, so smart-parens is in the clojure pack for Emacs Prelude
15:24nDuff...or is it Emacs Live?
15:25nDuff...okay, definitely in Emacs Live.
15:25nDuffhaven't checked Prelude.
15:25jballancto be perfectly honest, after using paredit in Vim, I'm not sure how the Emacsians out there get by with the Emacs version of paredit
15:26RaynesIn what ways is the vim version better?
15:27RaynesI've always preferred the emacs version.
15:27nDuffjballanc: I've wondered something similar every time I used a non-emacs one, but then, I haven't used vim for clojure recently.
15:28noncomis anyone here familiar with CCW and nrepl at the same time?
15:28jballancRaynes: in the Vim version, most of the more complicated operations are <leader> combinations
15:28RaynesOh.
15:28jballancso, you get so save the three- and four-finger combinations
15:28Raynesjballanc: Well, I could have done that with evil-mode.
15:29RaynesI frankly don't understand why people use Emacs without evil-mode.
15:29jballancyeah, not so much a criticism of the package specifically
15:29RaynesIt's so good, is basically harmless.
15:29noncomi have a strange case where requiring clojure.tools.nrepl.server namespace hangs the CCW repl itself..
15:29RaynesInsert mode is basically normal emacs, and there is an actual normal emacs mode.
15:29RaynesText objects are quite lovely.
15:30jballancRaynes: oh, there is another thing...Vim paredit has a very easy way to move parens
15:30jballancstill haven't figured out a good way to do that in Emacs paredit
15:31nDuffjballanc: that's very easy. ctrl+shift+left/right arrows.
15:31nDuffjballanc: (re: moving parens)
15:31jballanc...and that's why I never figured it out ;-)
15:31jballanc(in Vim version it's <leader>-"<")
15:31RaynesInterestingly, iirc Emacs actually moves the text whereas vim moves the parens instead.
15:32jballancyeah, vim moves the parens
15:32OscarZheh.. installed now.. weird :)
15:32jballancOscarZ: give it time
15:32OscarZsure
15:32Raynesjballanc: I had a C-left/rightarrow command in Emacs for that.
15:32jballanconce you get used to it, the parens begin to melt away
15:32jballancall you'll see is forms
15:32OscarZin a matrix scene?
15:33jballancpretty much
15:33OscarZk :)
15:33jballancI think I can safely say that I'm not sure I could write Clojure without paredit
15:34OscarZheh.. i need to rtfm
15:35OscarZhad some trouble deleting some brackets :)
15:36noncomi guess that CCW hangs because it internally usies another version of nrepl, 0.2.1 and the one i'm requiring is 0.2.3 ...
15:46jballancOscarZ: keep this handy for the first week or so -- http://pub.gajendra.net/src/paredit-refcard.pdf
15:47augustlhmm, how do I check if an exception is a clojure.lang.ExceptionInfo? (isa? e clojure.lang.ExceptionInfo) doesn't work it seems
15:47eric_normand,(doc isa?)
15:47clojurebot"([child parent] [h child parent]); Returns true if (= child parent), or child is directly or indirectly derived from parent, either via a Java type inheritance relationship or a relationship established via derive. h must be a hierarchy obtained from make-hierarchy, if not supplied defaults to the global hierarchy"
15:48eric_normand,(doc instance?)
15:48clojurebot"([c x]); Evaluates x and tests if it is an instance of the class c. Returns true or false"
15:48eric_normandaugustl: looks like you want instance?
15:48eric_normandisa? is for types
15:48eric_normand(isa? (class e) clojure.lang.ExceptionInfo)
15:52augustleric_normand: instance? did the trick :)
15:53noncomis there a programmatic way to know the version of a required library?
15:58justin_smithnoncom: maybe at startup time (ie. lein classpath) but not introspecting within the process itself afaik
15:58noncomdid anyone experience project repl hang when requiring nrepl in one of project namespaces?
15:59noncom(assuming your client uses nrepl too... i think...)
16:24justin_smithin clojure.java.jdbc, if you add a :datasource to your db map for a connection pool, is there a way to verify that clojure.java.jdbc is using that datasource rather than creating connections based on the rest of the map?
16:44bitemyappjustin_smith: read the code
16:45bitemyappnot trying to be a PITA, that's legitimately the way to understand c.j.j
16:45bitemyappif you figure out a better way, let us know.
16:47joegallo_or, ya know, http://clojuredocs.org/clojure_core/clojure.core/select-keys
16:47bitemyappjustin_smith: in fact, document it in clojurewiki.com !
16:47joegallo_which is to say, don't have those other keys :)
16:47bitemyappjoegallo_: this is Lisp you mad-man, no common sense allowed.
16:47joegallo_my apologies, i meant "write a macro" :D
16:48bitemyappthere we go.
16:54justin_smithI am using a tool that uses the other keys of the database map - but I think I can work around that...
16:55bitemyappjustin_smith: metadata
16:55justin_smithyes, I can change my tool to use metadata, but one thing at a time, I just want to know this pool is being used within this setup
17:20bitemyappthere's something deeply satisfying about monkey-patching Python to use immutable collections.
17:22augustlthere's a way to create multi-arity anon fns that call themselves, but I can't find or recall how.. I.e. (fn ([a] (call-myself a nil)) ([a b] (do-stuff a b)))
17:23tbaldridgeaugustl: you have to use recur, or simply give it a name (such as self) and call that.
17:24`cbp(fn f ([x] ..))
17:24justin_smith(fn self ([a] ...))
17:24justin_smithetc.
17:24justin_smithyeah
17:24augustlyay, thanks :)
17:33RaynesSometimes I regret showing trailing whitespace
17:34Rayneshttps://dl.dropboxusercontent.com/s/68d18cjrj8o9fxh/2013-12-16%20at%202.32%20PM.png
17:34Raynesx_x
17:36justin_smithouch
17:38Pupeno_wHello.
17:39Pupeno_wAnybody using luminus in production?
17:41bitemyappRaynes: if you were using a real editor, it'd have automatic whitespace cleanup.
17:41bitemyappRaynes: (def real-editors #{:emacs})
17:41bitemyappM-x whitespace-cleanup
17:42Raynesbitemyapp: I have a :FixWhitespace command, but I don't want to fix the whitespace of all of instaparse at the moment.
17:42noncomsorry for the offtopic but what is the irc for common lisp?
17:42bitemyappnoncom: #lisp
17:42noncomthanks!
17:42technomancytrue to form, they don't consider any non-common lisps valid =P
17:44bitemyapp^^ accurate.
17:44seangrov`Love it.
17:45technomancywhen in reality everyone knows there are two lisps: the Lisp of Commons and the Lisp of Lords
17:45TEttingerArc?
17:46technomancyleft as an exercise to the reader
17:46TEttingerheh is Arc even usable now?
17:46noncomwow, #lisp is far less populated than #clojure !
17:46SegFaultAXTEttinger: Define "usable"
17:46SegFaultAXnoncom: That wasn't always the case. :(
17:47AimHerenoncom > Lisp is for beardy old people from the 1970s. Clojure is for beardy old people from 2010
17:47bitemyapp~lisp is for beardy old people
17:47clojurebotIn Ordnung
17:47bitemyapp~haskell is for beardy awesome people
17:47clojurebotIn Ordnung
17:47bitemyapp~clojure is for beardy nice people
17:47clojurebotAck. Ack.
17:49noncomis common lisp community a subject for extinction?
17:49AimHereNah
17:49AimHereIt's no deader than usual
17:50bitemyappnoncom: CL lurks like Cthulhu. Under the depths.
17:50ystael"Hybrid children watch the sea, pray for cdr roaming free..."
17:55nopromptbitemyapp: RWH jumps around way to fucking much.
17:55nopromptbitemyapp: it's an irritating book.
17:55nopromptbitemyapp: LYH is better.
17:55nopromptbitemyapp: and by "better" i mean "it's preferable to me"
17:57nopromptbitemyapp: and by "it's preferable to me" i mean "that's cool if you think otherwise."
18:04bitemyappnoprompt: I didn't care for RWH
18:05bitemyappI see how it's "practical" but it's too many islands of recipes rather than integrative knowledge building.
18:05bitemyappI use LYAH as a handy-dandy reference.
18:05nopromptbitemyapp: yeah, RWH is messy. some parts are really great but then it turns in to a train wreck.
18:06seangrov`dnolen cemerick: Maybe cljsbuild should give a warning about using known-bad builds, e.g. cljsbuild auto <profile with any optimizations other than :none>
18:06bitemyappbetter to just hack-hack-hack on personal projects IMO.
18:07bitemyappnoprompt: speaking of, want to do some Haskell pairing this week?
18:07nopromptbitemyapp: one thing i do not like about haskell which is amplified by the fact it's a language with syntax are the weirdo operators (.&., .|., etc)
18:07nopromptthat shit looks ugly
18:07bitemyappnoprompt: there are names for those
18:07bitemyappI don't know why people don't use them.
18:08nopromptbitemyapp: i do. i just gonna start working a version of frak in hs.
18:08bitemyappnoprompt: cool. I like that idea.
18:10cljHi guys, is there any technique to have symbol evaluated in macro body ?
18:11cljI'm trying to do something like this:
18:11clj(defmacro method-call [^String method] (let [m (with-meta (gensym "_m") {:tag 'java.util.Date})] `(fn [~m] (.. ~m ~(symbol method)))))
18:11cljcalling it with literal works fine
18:11clj((method-call "getTime") (java.util.Date.))
18:12cljbut not with symbol - (def met "getTime")
18:12clj((method-call met) (java.util.Date.)) IllegalArgumentException No matching field found: met for class java.util.Date clojure.lang.Reflector.getInstanceField (Reflector.java:271)
18:13noncommaybe you should remove the ^String type annotation and then ~met in the macro?
18:13cljI'll give it a try
18:14noncomi meant ~method sorry
18:14cljstill the same
18:15noncomsame exception? strange..
18:16cljyes
18:16noncommaybe you (eval method) ?
18:17cljtried that as well
18:17noncomoh these macros..
18:17nopromptbitemyapp: if you wanna pair on frak that might be good.
18:19bitemyappnoprompt: I'd be up for that. I'm terrible at regex though :)
18:19bitemyappand haven't really done any regexing in Haskell
18:20amalloyclj: that's not really something you should do. your macro only receives the symbol 'met, it doesn't receive any value bound to that symbol
18:20nopromptbitemyapp: it's not that bad. frak only emits a subset of regex anyhow. what i'm hoping is that frak will highlight more of structural aspects of the problem.
18:20cljamalloy: thx - is there a way to achieve same functionality ?
18:21nopromptbitemyapp: sorry *haskell will highlight it.
18:21cljamalloy: i was trying to resolve the symbol at run-time
18:21bitemyappnoprompt: *nods*
18:22cemerickseangrov`: There is a facility for doing that; do you know of a bad cljsbuild/clojurescript combo?
18:22amalloywell you can't do that, since the macro gets expanded at compile time
18:22amalloyi mean, you just call (.getTime (java.util.Date.)). or you define a function that calls getTime, if those seven characters are too much: (defn t [^Date d] (.getTime d))
18:23seangrov`cemerick: Specifically using sourcemaps + auto build with any level of optimization. People are continually asking about it in here and on the ml.
18:23amalloyyou're asking for alternative ways to do (this macro that is evil); but that's just a solution you've half-figured out for whatever your real problem is. instead, try to get answers on better ways to solve your problem
18:24seangrov`Missed him...
18:24cljamalloy: I'm avoiding to use reflection, and I have method name as a string - and I'm trying to create a function which would call it on a given object
18:25eric_normandclj: having a method name as a string and wanting to call a java method is reflection
18:25amalloyyou cannot avoid reflection if you have a method-name string at runtime (except by calling clojure's eval, which is probably more expensive still)
18:25cljamalloy: yes, but I would do it only once - then call that function multiple times
18:26amalloymmm. you can save the Method object that reflection gives you; i think most of the cost is in finding it
18:27amalloyor you can (eval ...) some code that produces a type-hinted function
18:27cljeric_normand: agree - I just thought there is some easier way with macros :)
18:28cljamalloy: thank you - I had no luck with eval - I'll resort to reflection now :)
18:29bbloompetehunt: catching up now. to answer your question/statement about map & sorted-set: any obviously O(N) operation will return a seq. No attempt is made to preserve the data structure's type. Use clojure.core/into to slurp up the seq and recreate the type you want as efficiently as possible
18:29petehuntok, thanks
18:30amalloyi mean, it's like (defn method-handle [method arg-count] (let [obj (with-meta (gensym) {:tag `Date}), sym (symbol method), args (repeatedly arg-count gensym)] (eval `(fn [~obj ~@args] (. ~obj ~sym ~@args))))), right?
18:31amalloyyou can do more clever stuff to adjust typehints on the object and the args, but that's the idea
18:34eric_normandclj: Does this not do the trick? (eval `(fn [d#] (. d# ~(symbol met))))
18:35cljamalloy: thanks !
18:36cljeric_normand: thank you ! that works too !
18:36eric_normandclj: just use it as a function, not as a macro
18:37cljeric_normand: right - will give it a try in real setting. thanks !
18:38amalloyeric_normand: that version doesn't avoid reflection at all
18:38eric_normandamalloy: you're right.
18:39eric_normandamalloy: I thought he meant he didn't want to do reflection himself, just wanted to pass it on to Clojure
18:41eric_normandamalloy: now I see that you had already responded. Just ignore what I wrote.
18:41amalloyyour version is good if he was just trying to punt on the reflection, though
18:42cshellDoes anyone here know how to configure TeamCity to build leiningen projects?
18:52AeroNotixwhy the hell does `some' return nil?
18:52AeroNotixclojurebot: (some true? '(false))
18:52clojurebotIt's greek to me.
18:52AeroNotixclojurebot: ,(some true? '(false))
18:53clojurebotNo entiendo
18:53AeroNotix ,(some true? '(false))
18:53clojurebotnil
18:53AeroNotix^^
18:53technomancybecause it's not a predicate
18:54hiredman,(if nil true false)
18:54clojurebotfalse
18:54AeroNotix,(= nil false)
18:54clojurebotfalse
18:54AeroNotixtechnomancy: what is Clojure's definition of a predicate?
18:55`cbpa predicate returns true or false
18:55hiredmanfeh
18:55hiredmanAeroNotix: some people who use clojure make the distiction
18:55technomancysome returns the first truthy value
18:55AeroNotixoh it actually returns the value
18:56technomancywhat would you expect here?
18:56AeroNotix,(some seq? :banana [1 2 3])
18:56clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core/some>
18:56AeroNotix,(some seq? '(:banana [1 2 3]))
18:56clojurebotnil
18:56hiredmanAeroNotix: clojure treats nil and false as logically false, and true and any other non-nil value as logically false
18:56S11001001hiredman: :)
18:56seangrov`technomancy: You might have answered this, but any ideas about improving `heroku run lein repl`?
18:57bitemyapphiredman: as logically true, you mean?
18:57AeroNotixtechnomancy: the detail I was missing is that it *returns* the truthy value. Not returns true if the value is truthy.
18:57seangrov`Just avoid it and do something with drawbridge?
18:57bitemyappseangrov`: fire up an nrepl instance inside your app
18:57bitemyappseangrov`: tunnel into it.
18:57technomancyseangrov`: that's pretty vauge; do you have something in mind?
18:58seangrov`technomancy: Just the bootup experience of downloading all deps every time you invoke `heroku run lein repl`, and the instability that goes with it if clojars or maven are having issues
18:59seangrov`bitemyapp: How do you tunnel into a heroku dyno?
18:59technomancyseangrov: well that's the tradeoff of uberjars
18:59bitemyappseangrov`: well if you're constrained to HTTP and not TCP, then you'll need to route it over HTTP.
18:59hiredmanbmag
19:00technomancysmaller slugs vs having everything there
19:00AeroNotixhttps://github.com/clojure/core.match in the fizzbuzz example here why doesn't the [0 _] match *before* the [_ 0] ?
19:00AeroNotixdoes it not short-circuit?
19:00AeroNotixor does it find a 'better' match?
19:00seangrov`technomancy: I suppose, seems pretty sub-optimal to me, but maybe that's just because no one uses it, and goes the nrepl + drawbridge route instead
19:00AeroNotixin Erlang, matches are essentially short-circuit.
19:00technomancyagreed that not having tcp access is a huge drag
19:01technomancywish i could do something about that
19:01technomancybut yeah if you want access to the dyno itself, you use drawbridge
19:03hiredmanAeroNotix: why do you think it doesn't?
19:03bitemyappoh dear god this Python library hashes keywords to the same values as their inner strings
19:03bitemyappfucking madmen.
19:04AeroNotixhiredman: well, they implemented fizzbuzz like that. As an example I'd expect it to be 'correct'?
19:04amalloyAeroNotix: it is correct. hiredman is asking why you think it's not
19:04technomancyseangrov`: downloading jars on the dyno is less o fa problem when a human is directly involved
19:05AeroNotixamalloy: because how does [0 _] not match *before* [_ 0] ?
19:05AeroNotixis it not short-circuiting matching?
19:05amalloythat just doesn't make any sense as a question. it does exactly what you're asking why it doesn't
19:05hiredmanAeroNotix: it could only match if both were 0, which is covered by the first case
19:06amalloyAeroNotix: there's a [0 0] case before both of them, so there's no overlap
19:06AeroNotixRemove the [0 0] case and what happens?
19:06seangrov`technomancy: Adds 1.) a few minutes overhead to booting up an app (probably need to start explicitely excluding versions of clojure we're not using so we don't download every single version) and more importantly 2.) intermitten failures. I couldn't run it at all over the weekend because clojars and/or maven were returning 503's while downloading the jars, causing the process to bail after a minute or two
19:07AeroNotixjust trying to understand which *kind* of pattern matching it is.. some use short-circuit and some use 'best fit'
19:07amalloyfirst match
19:07AeroNotixcool ok
19:07AeroNotixcheers
19:07seangrov`technomancy: Also, I *am* doing the uberjar compile, should it still be downloading all the deps on `heroku run lein repl`?
19:07hiredmanif you click around in the wiki there is a link to the paper it is based on
19:08technomancyseangrov`: worst case you fall bacx to `rlwrap heroku run java -cp ... clojure.main`
19:08AeroNotixsure, bedtime now though
19:11technomancyseangrov`: yeah, you should still download the kj
19:11technomancythe jars
19:11technomancysince the uberjar leaves out m2 to speed up deploys
20:04cemerickdnolen: I don't know what to make of this; maybe I'm just doing something badly wrong with prototypes...? https://gist.github.com/cemerick/7998162
21:52levinmfrom [#{'A 'B} #{'B}], how do I use clojure.set/union to get #{'A 'B}
21:54justin_smithlevinm: (apply clojure.set/union sets)
21:54justin_smithif they are in a collection
21:55levinmthanks justin
22:02logic_proghow do peopel in merger & acquisations profit? what percent of the sale/purchase price do they get?
22:12logic_progso for example, what does qatalyst partenrs do, and how do they profit from it?
22:16SegFaultAXlogic_prog: What does this have to do with Clojure?
22:16logic_progI'm in the wrong channel.
22:47amalloyfwiw levinm, [#{'A 'B} #{'B}] can be more concisely written as '[#{A B} #{B}]. there's nothing wrong with writing it either way, but i bring it up because writing it the first way often indicates confusion about what ' means: rather than being a prefix that means "this is a symbol", it means "quote the next whole object"
22:50levinmThank you amalloy - yes that is helpful to me.
22:52rovarI'm not sure if I hate paredit mode or really really fucking hate paredit mode
22:52eggnogginparedit is amazing
22:52eggnogginstructural editing forever
22:53rovarexcept when I'm trying to fix broken parens
22:53rovarwriting new code is pretty nice
22:55rovaralso, it insists on matching up a ( and a ]
22:55rovarso I can't provide the correct [ for the ]
22:56rovarbecause it thinks it's already balanced.
22:56rovari mean wtf?
22:56hiredmanrovar: stop typing unbalanced expressions
22:57rovari kill/yanked an expression, and didn't get the entire thing
22:57SegFaultAXThat shouldn't even be possible with paredit
22:57rovarmissed a [
22:57rovarnow I can't re-add it
22:57hiredmanrovar: are you using a recent version of paredit?
22:57seancorfieldrovar: you can copy another [ from somewhere else and paste it in
22:57amalloyrovar: C-q prefix always means "insert the next character, ignoring weird rebindings"
22:57rovaryea.. just loaded today
22:57SegFaultAXOr just temporarily disable paredit mode.
22:58amalloyseancorfield: that's a fairly gross way to do it
22:58seancorfieldamalloy: ah, that's even easier ;)
22:58rovarC-q [ did the trick
22:58amalloyi did it that way for years, but now i know better (in the rare instances where i need to do it at all)
22:58rovarthanks
22:58amalloyC-q DEL deletes the next character unconditionally, as well
22:58seancorfieldthe great thing about emacs - you learn something new every day :)
22:58hiredmanrovar: I've seen glitchs like that happen, but they tend to be few and far between, and if you undo and re-kill it gets it right
22:59amalloywait, what do you guys mean, paredit won't let you kill/yank unbalanced exprs? i guess i'm on an oldish version, but it doesn't act that way for me
22:59SegFaultAXAs a vim user, I have a hard time learning emacs because my fingers start hurting after 10 minutes of heavy usage.
22:59SegFaultAXI must be using C- wrong.
23:00amalloySegFaultAX: yeah, if you don't remap capslock to control, you'll be sad
23:00seancorfieldamalloy: i've managed to kill chunks of text with unbalanced parens
23:00amalloysure, i do that all the time
23:00hiredmanamalloy: sometimes when I kill an expression weird things happen
23:00SegFaultAXamalloy: Meta seems fairly important too
23:00hiredmanthen I undo, and do it again and it is fine
23:00amalloySegFaultAX: yeah, but at least for me that one was never hard. you just use your thumb
23:00rovari need foot pedals for ctrl and mod
23:00rovarerr meta
23:00SegFaultAXIn vim you can just find the outer-most matching brace and use d% to kill the entire thing.
23:01amalloyrovar: i got myself some foot pedals for that reason
23:01hiredmansometimes the entire file from the point to the end vanishes leaving unbalanced expressions
23:01rovarI've been a vim user for the last 7 years
23:01hiredmanbut, it is very rare
23:01rovarjust cut the habit on friday
23:01amalloynever really wound up using them much - too hard to break finger habits, and also hard to coordinate as quickly between finger/foot as between finger/finger
23:01SegFaultAXIs there something wrong with your editor if you have to get specialized hardware just to use it without seriously being at risk for a repetitive motion strain?
23:01rovarheh
23:02seancorfieldhiredman: doesn't that happen when you've set a mark and later accidentally kill-to-mark?
23:02SegFaultAXI really really want to like emacs, but I just can't get over how hard it is on my hands.
23:02rovarSegFaultAX: I use dvorak, so it balances out
23:02hiredmanseancorfield: you mean am I doing that? could be, but not to my knowledge
23:03rovaractually.. with dvorak, the : key is at the qwerty z key
23:03SegFaultAXrovar: That doesn't help the awkward placement of ctrl and meta.
23:03rovarso it's almost as annoying as ctrl
23:03hiredmanI wonder if I just don't type enough/fast enough
23:03SegFaultAXrovar: But for qwerty it's just right there on the neutral pinky. Great for vim. :D
23:04amalloySegFaultAX: really i think vim's modal scheme is probably better than emacs's modeless. but emacs is so much easier to program, and a single key remapping fixes the only noticeable physical-pain issue
23:04rovarthat's why I switched.. the nrepl and the clojurescript browser nrepl
23:05SegFaultAXamalloy: vimscript is /horrible/. I'll give you that.
23:05rovarI got tired of switching back and forth between windows because I needed by browser, terminal and editor
23:05SegFaultAXBut for editing lisp, emacs has always been superior. vim is getting better all the time to be sure, but emacs has no equal.
23:05rovarno I stay in 1 window with my browser and editor
23:06rovarso you either alt-tab or change workspaces.. or you type a few extra ctrls
23:06rovarI think I will remap caps to ctrl though.
23:06SegFaultAXamalloy: bitemyapp has tried on a number of occasions to get me to use evil mode, but I've found it doesn't work well with most plugins.
23:08amalloyyeah, that's been my experience when trying to use Raynes's laptop
23:08RaynesLike what plugins?
23:08Raynes(amalloy in particular)
23:09RaynesI never came across a single thing that evil-mode broke when I used Emacs.
23:09amalloyi forget what in particular, but i remember you didn't notice them because you don't use a lot of the emacs builtins
23:09amalloyor something
23:10LuminousMonkeyI'm considering moving back to vim, but just because I've moved to an AwesomeWM, tmux config on my work machine.
23:11SegFaultAXRaynes: Do you use paredit for vim?
23:11LuminousMonkeyMovement in vim feels much nicer, but I still move to Emacs for Clojure editing.
23:11RaynesYeah.
23:11rovarLuminousMonkey: I use i3, but why would a new wm effect your editor choice?
23:13LuminousMonkeyHave to make sure there's no collisions when using Tmux, etc. I'm using Ctrl-F at the moment, which is what I use for moving the cursor forward in Emacs.
23:13rovarfor i3 I use windowkey for everything.. for tmux.. yea.. you'll need to find a free key.
23:13LuminousMonkeyMoving between windows in AwesomeWM I have mapped to vim movement keys, but with Modkey.
23:14rovarI always used mod+number
23:14rovarnever liked relative movement
23:14LuminousMonkeyDual screen?
23:14rovarbecause I map all my processes to fixed windows
23:14SegFaultAXNo xmonad love?
23:14joshheadI just realized it's legal to use contractions with apostrophes in clojure symbols. Is it bad style to do so? e.g. I am building a tic tac toe game, I could (defn cat's-game? [game] ...)
23:15rovareven when I was coding haskell professionally I couldn't handle writing haskell to config my wm
23:15SegFaultAXjoshhead: Please don't do that :(
23:15LuminousMonkeyI've never tried Xmonad.
23:15rovarjoshhead: do it
23:15SegFaultAXjoshhead: But in general yes, Clojure is very lenient with symbol names.
23:15rovarimo i3 is a bit easier to config and use than awesome.. even though awesome has been around a bit longer and has more utils for it..
23:16joshheadI've never seen it before, though I have seen it used like (let [a' (somefn a)] ...)
23:16SegFaultAXjoshhead: Well that's not the same thing.
23:16rovara prime
23:16rovarthat's a common idiom
23:16SegFaultAXYup
23:16amalloythe support for ' was added to allow symbols like a', not like don't
23:16joshheadSegFaultAX: just because it's lenient doesn't mean I should abuse the power
23:16SegFaultAXjoshhead: Correct
23:17SegFaultAX(inc amalloy)
23:17rovarjoshhead: do it.. abuse said power
23:17lazybot⇒ 80
23:17joshheadbut I was wondering if symbol as apostrophe instead of prime would constitute abuse :)
23:17rovarit might have unintended consequences later.. like when you're testing or porting to the web..
23:17rovarbut do it anyways
23:17rovarlet the apostrophe flow through you.
23:17joshheadrovar you just like chaos don't you
23:17joshheadlol
23:18hyPiRionSegFaultAX: xmonad <3
23:18rovarya
23:18joshheadI'm planning to use this code as an example to teach some Clojure. I don't want to instill too many bad habits
23:19rovarhmm.. elscreen looks kind of cool
23:19rovarI like tabs
23:19rovarso far.. switching between buffers is not as fast as I'd like..
23:19rovarfinding by name gets old..
23:19rovarI want to assign numbers..
23:23rovarooh.. I wonder if I could map meta-tab to switch-to-previous-buffer
23:24rovaroh well, enough meta optimization, back to work.
23:24indigo4clojure makes me feel dumb... so many good solutions
23:26andyfIndigo: try to draw knowledge and inspiration instead. E.g. Next time my solution will be just a bit more clever than last time
23:26indigoandyf: Oh yeah I know
23:26indigoI like that it makes me feel dumb; it means I'm learning :P
23:27kandinskiindigo: sometimes they make me feel smart because I understand them
23:27kandinskiwhoever amcnamara is, he wins at codegolf
23:27eggnogginlol
23:28eggnogginand chouser
23:28andyfCode golf solutions usually (but not always) makes me glad I don't write code that way.
23:29indigokandinski: Yeah, I'm following him
23:29indigoSo good
23:29eggnogginseeing stuff like ` ~@ inside of for comprehensions makes my head hurt
23:29kandinskiyeah, I only started last weekend
23:29levinmcan you see solutions from people you don't follow - I just chose people at random to follow, is there some smarter way?
23:29kandinskiI mean, three days ago. So I get what you mean.
23:30kandinskiI picked the top users
23:30kandinskisoome of which are the developers of 4clojure
23:30kandinskiso people who know it well
23:31joshheaddo you have to solve a problem before you can see other solutions?
23:31kandinskialways
23:32rovaralso clojurescriptkoans.com has a very nice ui
23:32rovarfor doing said koans
23:32indigojoshhead: You can search for solutions on other people's githubs but that takes away the fun
23:32rovarspeaking of clojurescript, does anyone know how I'd go about using dommy macros inside of a clojurescript nrepl?
23:34joshheadyeah it would kind of take away the challenge
23:34amalloykandinski: amcnamara contributed to 4clojure for a few months. added some pretty sweet features, although i'd have to read the commit log to remember what
23:35kandinskiamalloy: what I meant to say is that he knows clojure very well
23:35kandinskihis solutions are not only codegolf-y, but also reasonably so
23:36amalloythe code-golf champion IMO was always youz
23:36amalloyhis stuff is nuts
23:36kandinskiI'll avoid him then :)
23:36amalloyi usually tried for idiomatic and readable rather than golf
23:36kandinskiI have jumped straight into 4clojure to teach myself the language. I'm using that and the cheatsheet at (defn removeDuplicates [arg]
23:36kandinski (loop [chars arg, acc []]
23:37kandinski (if (empty? chars) acc
23:37kandinskioops, sorry about that
23:37amalloylol
23:37kandinskimispaste
23:37amalloykandinski: remove-duplicates is the Lisp Way, since you mention it
23:37kandinskiamalloy: I have done a bit of scheme, so all my solutions are the classroom-standard recursive bit
23:37kandinskithat wasn't even my code
23:37SegFaultAXamalloy: I start with something completely readable and idiomatic, then work backwards to something golfed down to a reasonable size.
23:37rovarI tend to go for point-free if I can get it without making things too obtuse
23:37kandinskimine had a non-obvious error, so I googled for a solution and compared both
23:37rovarI use -> and comp a lot, I've found.
23:38kandinski(I was using into when I should have been using conj)
23:38amalloythat's one of the things i love about 4clojure. everyone uses it to practice something different
23:38rovarI'm still finding parts of the stdlib that shorten my code drastically.
23:38SegFaultAXOn a side note, I wish "comp" was shorter.
23:38indigoI try to use as many stdlib functions as I can
23:38rovarI agree
23:38SegFaultAXIt's really convenient being able to do eg `foo . bar`
23:38kandinskiindigo: not as few?
23:38indigoAnd I also try to avoid for
23:38indigokandinski: You know what I mean :P
23:39amalloySegFaultAX: for sure. lisp gives up some stuff that is really nice in haskell
23:39SegFaultAXamalloy: "comp" just feels really obtuse for some reason, though.
23:40SegFaultAXI don't know what I would rather it be (that isn't already used by something else)
23:40SegFaultAXI also really hate identity not being just id
23:40amalloyi'm reasonably happy with identity
23:40amalloyit reads so much better out loud
23:41SegFaultAXThe name of the function is almost as long as the thing it names
23:41SegFaultAXLonger even.
23:41amalloywell, longer since it's #(do %)
23:41hiredmansomeone had a pretty neat emacs setup that mapped lots of function names to mathy unicode symbols
23:41indigoSegFaultAX: You can redefine function names
23:41SegFaultAXI thought it was (fn [x] x)
23:41eggnoggincould use idiot instead of identity and bluebird instead of comp but not sure...
23:42indigoFor example I redefined map as ♫
23:42SegFaultAXEwwie.
23:42indigo(♫ inc '(1 2 3))
23:42indigo;P
23:43kandinskigreat
23:43kandinskiyou could also redefine '(' as '[' and vice-versa
23:43SegFaultAXThat'd be a great way to mess with your co-workers though. Re-map the top 25 most common function to glyphs.
23:43kandinskibecause, why not?
23:43kandinski"it works on my machine"
23:43indigoHehe
23:44indigoMake Clojure into APL
23:47SegFaultAXWow, crazy valuation: http://sfbay.craigslist.org/sfc/cpg/4247279322.html
23:49amalloyis "established startup" an oxymoron, or am i just not hip to the jive?
23:49kandinskiSegFaultAx, if you have one cent, I'll sell you 0.00000001 of my million-dollar-valuated company
23:49kandinskiwhich will ve so valuated by the fact that you gave me that cent
23:49SegFaultAX400,000 isn't cool. You know what is cool? 1,000,000.
23:50hiredmanhttps://github.com/Bronsa/.emacs.d/blob/master/config/hooks.el#L10-L37
23:50SegFaultAXI've never met an entrepeneur with expectations that reasonable.
23:57amalloyspeaking of making clojure into APL, i wonder what a clojure version of "under" would look like
23:57amalloyas explained at http://prog21.dadgum.com/121.html
23:57kandinskiit's a context manager, isn't it?
23:58kandinskiI read it, and it looked like an advanced version of "with" or DSU
23:58kandinskipython's "with", I mean, or "Decorate, Sort (or summate, or whatever) and Undecorate"