#clojure log - Dec 16 2013

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:00 SegFaultAX: v4n: Mind gisting your impl?

0:00 v4n: SegFaultAX: Sure, one second.

0:07 SegFaultAX: https://gist.github.com/anonymous/7982574

0:15 SegFaultAX: v4n: Cheers

0:31 andrei: What's the clojure equivalent of exact? and inexact? ?

0:34 hyPiRion: what are those to begin with?

0:35 andrei: They're from scheme. Some representations for numbers are exact like ints, longs, rationals. Others are inexact, like floats and doubles

0:38 coventry: When are those useful?

0:39 v4n: ,(/ 2 4)

0:39 clojurebot: 1/2

0:40 bbloom: andrei: we have big ints & decimals, but no predicates builtin. use clojure.core/instance?

0:40 andrei: ratios too

0:40 v4n: ,(double 2/4)

0:40 clojurebot: 0.5

0:40 v4n: ,(rationalize 0.5)

0:40 clojurebot: 1/2

0:40 coventry: v4n: I'm aware. I'm curious about contexts where you have to care.

0:41 andrei: bbloom: Ah, ok. I was hoping to avoid having to write a big branch to do this

0:43 coventry: 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.

0:44 bbloom: andrei: thats why such predicates aren't that useful :-)

0:45 andrei: bbloom: Right, but I expect my inexacts to generally be IEEE doubles or floats, and my exacts to be.. well exact

0:45 bbloom: In which case those predicates are useful

0:46 Also, has anyone discussed a patch to fix the (/ 1.0 0.0) behaviour?

0:46 coventry: andrei: Are you doing math which requires both types of represenation? Sounds interesting.

0:46 andrei: Is this something people actually want?

0:46 coventry: 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

0:47 I'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

0:47 I'd rather save the effort of writing the patch :)

0:48 coventry: What kind of math are you doing?

0:48 (If you don't mind/are interested in talking about it. I'm just curious.)

0:49 andrei: coventry: Sure. I do lots of machine learning in computer vision, ai, robotics and neuroscience

0:50 coventry: I've been doing everything in Scheme for a long time

0:51 coventry: But I'm hoping to move over to clojure

0:54 coventry: So what's an example in your scheme code where you use the exact?/inexact? distinction?

1:05 petehunt: dnolen: yt?

1:05 echo-area: Is it a feature that the installed multimethod can share only the required arguments but have different other arguments?

1:06 I find this makes it easier to create a single dispatch function for a group of multimethods

1:06 I'm not sure if I should make use of it though

1:16 mlb-: 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

1:37 petehunt: bbloom: yt?

1:42 eggnoggin: yt?

1:43 hey petehunt thanks for your work on react looking forward to using it on some upcoming projects

1:46 dnolen: petehunt: hy

1:46 er hey

1:53 petehunt: eggnoggin: thanks! hope you find it useful!

1:53 dnolen: hey, i was wondering how to override the sorting of sorted_set

1:53 dnolen: also, been working on this guy today: https://github.com/petehunt/morimodel

1:54 dnolen: petehunt: there's sorted_set_by (probably not documented?)

1:54 petehunt: and sorted_map_by too

1:55 petehunt: dnolen: 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?

1:55 hyPiRion: petehunt: yes

1:56 dnolen: petehunt: first arg to both is a comparator function

2:01 petehunt: ah i see... mori is just clojure.core

2:08 jph-: is there a functional bash-equivalent?

2:12 hyPiRion: jph-: https://github.com/alandipert/gherkin ?

2:14 Not sure if there is a serious functional bash equivalent though

2:14 there is any*

2:14 jph-: hyperboreean: cool

2:14 i was just writing a bash function and thought... why not functional?

2:14 ie a lispy bash

2:15 hyPiRion: well, that's a lisp, implemented in bash

2:15 jph-: yep

2:15 i also havent yet ventured into tuning jvm/cloj to make it more usable for command line tools

2:17 logic_prog: what are functaioal data structures similar to the zipper?

2:17 i'm trying to write a "structured' -editor, i.e. something like paredit, but stronger guarantees

2:17 I'm trying to figure out if I should use functional zippers, or if there is something better

2:20 petehunt: dnolen: hrm, looks like conj() isn't causing my comparator to be called

2:20 i guess map() removes the sorted_set from it

2:41 beppu: jph-: 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

2:42 jph-: beppu: interesting approach

2:42 * jph- bookmarks

2:53 beppu: jph-: 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.

3:08 mindbender1: ,(clojure.string/split "abc.def" #"\\.")

3:09 clojurebot: ["abc.def"]

3:10 hyPiRion: ,(clojure.string/split "abc.def" #"\.")

3:10 clojurebot: ["abc" "def"]

3:10 hyPiRion: regex doesn't need escaping in clojure

3:11 guns: reader macros ftw

3:11 what a nice little piece of design

3:12 mindbender1: hyPiRion: emacs refused me doing #"\."

3:13 But at least I know the problem now, thanks

3:15 Changing the buffer coding system now to utf-8 solves that

5:17 sm0ke: why is ring named so?

5:17 i fail to understand middlewares

5:27 clgv: sm0ke: maybe a lord of the rings reference? "one to bind them all..." or such ;)

5:28 Raynes: It is 100% a LOtR reference.

5:28 clgv: there you go ;)

5:28 but in contrast to "friend" there is no quote in the "ring" readme ;)

5:35 sm0ke: clgv: Raynes i think this is better http://i.imgur.com/6zAYD.jpg

5:47 seriously_random: how to create vectors inside vector recursively? http://pastebin.com/C1mpc94w

6:00 ddellacosta: seriously_random: what is compartmentalize meant to do? I don't understand the output you've got there.

6:01 supersym: say can anyone tell me the notation for Java class like GoogleAuthorizationCodeFlow.Builder in Clojure

6:02 seriously_random: ddellacosta, 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)

6:03 ddellacosta: seriously_random: and then stops at that point and throws the rest away?

6:03 are you doing it for practice or need to solve a specific problem?

6:04 seriously_random: ddellacosta, no it skips until it finds another element at which point new vector is created

6:04 ddellacosta, practice.

6:04 ddellacosta: seriously_random: ah, okay

6:05 supersym: ah $ notation ofc

6:06 seriously_random: ddellacosta, how about this: filter [1 2 3] to (1 3) and then use (1 3) to create [[1] [3]] out of [1 2 3]

6:06 dsrx: I 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

6:06 ddellacosta: seriously_random: what about [1 3 4 5], like in your example?

6:06 dsrx: oh god i was lost in scrollback land. sorry

6:07 ddellacosta: dsrx: I expected your next comment to be, "discuss"

6:07 heh

6:07 seriously_random: ddellacosta, doesn't matter. let's say I can filter any vector for any condition I want.

6:09 ddellacosta, 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

6:10 ddellacosta: seriously_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?

6:10 If it's the former, you can just do

6:10 ,(into [] (filter odd? [1 3 4 5]))

6:10 clojurebot: [1 3 5]

6:10 cark: a rather ugly solution : http://pastebin.com/dRBWq41Y

6:12 seriously_random: ddellacosta, continuous sequences that meet the condition. Filter use is not allowed (I have another function that can filter)

6:12 e.g. if condition is odd [1 3 4 5] becomes [[1 3] [5]].

6:18 cark, 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?

6:18 *[[1 3]] (without 2 obviously)

6:18 fredyr: seriously_random: you can use partition-by perhaps

6:19 ,(partition-by odd? [1 3 4 5])

6:19 clojurebot: ((1 3) (4) (5))

6:19 fredyr: and filter out the appropriate seequences

6:20 seriously_random: fredyr, no filter, no partition-by

6:21 fredyr: well im talking about the concepts anyway

6:22 seems like you're doing homework assignments

6:23 seriously_random: sort of :)

6:24 fredyr: the impl of partition-by might give you a hint on how to implement what you're after anyways

6:39 ddellacosta: seriously_random: does it have to be vectors?

6:39 seriously_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])))

6:41 cark: with an accumulator you can make this not blow the stack

6:42 ddellacosta: yeah, my solution is not good, nevermind

6:45 seriously_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

6:49 cark: anyways i'm off, byebye

6:50 ddellacosta: cheers

7:07 Morgawr: performing a send operation inside a swap! won't result in multiple send operations in case the swap! is re-tried, right?

7:34 TimMc: Morgawr: swap! is an atom operation, right? I think you only get that feature with refs.

7:35 Morgawr: TimMc: so if I send something inside a swap it could be sent multiple times?

7:54 TimMc: Morgawr: I believe so, yes.

7:55 Morgawr: aw shucks.. thanks

8:19 clgv: Morgawr: in an atom it might be sent multiple times. transcations on refs guarantee that it is sent only once

8:36 edw: How does one let Clojuresphere know about one's project?

8:37 mdrogalis: edw: You do nothing. But it hasn't been indexed in about a year.

8:37 edw: :(

8:37 mdrogalis: It's kind of a shame for how cool it is.

8:38 edw: mdrogalis: 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.

8:39 mdrogalis: BTW, you're in Philly? I'm from Philly.

8:39 mdrogalis: edw: I don't know if I agree with that, but yes. Could always do it yourself.

8:39 I am, how'd you know? :P

8:39 edw: Your hostname.

8:39 mdrogalis: `phlapa`

8:40 mdrogalis: Ah, eh I never noticed.

8:40 Where're you working?

8:41 edw: Was asking because I'm on a recruiting binge for my co. I'm in NYC. In SoHo right now.

8:41 Live in the E Village.

8:41 Used to live in Old City.

8:42 mdrogalis: edw: Ah, got'cha. I work in center city. Living out in Manayunk.

8:42 Old City's nice. I really like it over there.

8:43 edw: Yeah, I couldn't live anywhere else. I had a big loft for $725/mo. I've ridden past Manayunk many times on the SRT.

8:43 mdrogalis: That's a really awesome price.

8:44 NYC is just too crowded for me.

8:45 edw: I 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.

8:45 mdrogalis: Yeah, that's just too much. Haha.

8:48 edw: It 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.

8:48 mdrogalis: Internet on the fritz in our office. Possibly brb.

10:03 instilled: hello. 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:23 rkneufeld: Hey folks, anyone know of a Clojure-based library to programmatically wrap and indent strings of Clojure code?

10:25 tbaldridge: pprint :-P

10:26 rkneufeld: Thanks for pointing out my ignorance timothy.

10:29 tbaldridge: any time, any time.....

10:40 eigenrick: tbaldridge: I built a multi-room message routing system with websockets over the weekend. multi made it trivial. Nice work.

10:40 multi

10:40 mult

10:40 stuartsierra: rkneufeld: pprint takes an optional formatter function, there's one specifically for formatting source code.

10:41 eigenrick: the downside is I felt more like a plumber than a programmer.. :)

10:47 rkneufeld: stuartsierra: fantastic, that was something I was looking for

10:48 * clgv learned something new since he didn't know about the optional function

10:49 rkneufeld: I'm mulling over creating an nrepl middleware to pretty print things by default

10:50 stuartsierra: rkneufeld: Resist the urge.

10:50 rkneufeld: lol

10:50 stuartsierra: many lives lost on this path before?

10:51 stuartsierra: Not personally, but I wouldn't trust it. pprint is slow on large collections, and it doesn't print records properly.

10:55 tbaldridge: rkneufeld: you might look at bbloom's printer as well.

10:55 rkneufeld: https://github.com/brandonbloom/fipp

10:56 and hey, it has a nrepl plugin

10:56 rkneufeld: Nice!

10:57 stuartsierra: I 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:58 rkneufeld: That's closer to what I am looking for, really. I don't *need* crazy pretty printing, just *somewhat* more readable output.

11:00 clgv: stuartsierra: at least you'd need to track the nesting levels for indentation in the dumb printer. otherwise its usefulness is very limited

11:00 stuartsierra: yeah, that's easy

11:03 zachallaun: cemerick: Is it possible to load external JavaScripts into an austin REPL session?

11:05 cemerick: zachallaun: There's a new-ish :prelude compiler arg, right? That should work, and probably shouldn't require any special support from austin.

11:05 zachallaun: cemerick: Ah, great. Thanks, I'll check that out.

11:22 daydreamt: r

11:22 sorry, typo

11:23 supersym: java.lang.Exception: The syntax for defmulti has changed. Example: (defmulti name dispatch-fn :default dispatch-value)

11:23 `cbp: supersym: (defmulti foo type)

11:23 && (defmethod foo String [x] "tis a string")

11:23 but if youre dispatching on type you might as well use protocols

11:23 lazybot: java.lang.RuntimeException: Unable to resolve symbol: & in this context

11:23 supersym: 2 arguments

11:24 yeah... sigh, perhaps I should later on

11:24 `cbp: well then (defmulti foo (fn [x y] (type x)))

11:24 supersym: I'm rushing against a deadline and no one has made a decent library of those google-libs yet

11:24 `cbp: and (defmethod foo String [x y] "tis a string")

11:25 supersym: ah

11:25 I see what the problem was

11:26 LightTable memory refushed to change the functions after re-eval... changed the name and it does work

11:26 thanks

11:28 `cbp: i think theres a bug in nrepl that doesnt let you redefine defmulti signatures but im not sure

11:32 pjstadig: that's not an nrepl issue, it's more a clojure

11:32 issue

11:32 and by "issue" i mean conscious decision

11:37 raek: I filed a bug about the defonce-like behavior of defmulti ages ago... I wonder what happened to it

11:37 stuartsierra: If I recall, that was a decision to avoid the opposite problem, that re-evaluating the defmulti destroys existing defmethods.

11:38 raek: yeah, either way is bad in some way

11:41 joegallo_: if only there were some way that i could eat this cake, and yet still be able to have it...

11:41 because i want both, you see

11:41 TimMc: joegallo_: You want to have your cake, and eat it, and have it be performant.

11:42 joegallo_: but of course

11:42 eric_normand: `(doc ==)

11:42 ,(doc ==)

11:42 clojurebot: "([x] [x y] [x y & more]); Returns non-nil if nums all have the equivalent value (type-independent), otherwise false"

11:44 pjstadig: joegallo_: you could maybe have your cake and eat it, too, if the cake was decomplected

11:45 (def (multi-fn dispatch-fn)) or (defonce (multi-fn dispatch-fn)) take your pick

11:45 not sure how possible that would actually be

11:46 i guess you could write the macros yourself and just instantiate the multi method classes manually or something

11:47 stuartsierra: Redefinition of multimethods & protocols is one reason I wrote tools.namespace.

11:49 logic_prog: by 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:53 Raynes: technomancy: tentacles supports code search now, thanks to elobato.

11:55 gdev__: using lein uberjar, get "javac: invalid flag: -Dclojure.compile.path=<my compile path>"

11:56 what have I done wrong?

11:57 mdrogalis: gdev__: Related to Clojure, or just in general?

11:57 We can talk about it, you know.

11:57 gdev__: mdrogalis, why has javac forsaken me?

11:57 justin_smith: gdev__: is there an illegal character or improperly quoted one in that path?

11:58 Raynes: lol

11:58 mdrogalis: gdev__: She's a cold, cold lady.

11:58 nDuff: ...eh? Is lein not using System.exec(String[]) (in which case things aren't parsed through a shell, so no quoting is necessary)?

11:59 Raynes: huh

11:59 gdev__: justin_smith, my project name has a dash in it, so not sure if that is causing issues

11:59 Raynes: That's a thing? You can make args not get processed by the shell?

11:59 justin_smith: Raynes: totally

12:00 nDuff: Raynes: the execv syscall is what the shell uses to start other programs, but you can/should use it yourself directly when possible.

12:01 err, it's Runtime.exec(String[]), not System

12:01 justin_smith: nDuff: my thought was a character that fucked up javac's arg parsing, so it would not recognize that valid argument

12:02 hiredman: */win 21

12:02 nDuff: justin_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:03 justin_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:03 gdev__: it compiles the files, but it won't jar them up

12:03 justin_smith: just wondering why the hell it would think -D... would ever be invalid

12:04 pretty much assuming there is a javac bug

12:04 nDuff: justin_smith: ...well, I'd start by using strace to look at the actual argument list.

12:04 strace -e trace=exec -s 2048 -f lein uberjar

12:04 ## ...and look at how it invokes javac.

12:05 deadghost_: http://pastebin.com/CaTND18j

12:05 I'm screwing up recur or korma

12:05 maybe clojure in general

12:06 nDuff: !pastebin.com > deadghost_

12:06 ...oh, wrong channel for that factoid.

12:07 justin_smith: deadghost_: map does nothing if you don't consume the values returned

12:07 it is lazy

12:08 deadghost_: ok

12:08 so how do I yell at it

12:08 justin_smith: by reading everything that comes back

12:08 do something with the return value

12:08 or use doall

12:09 philandstuff: often doseq is more appropriate, though the syntax is a bit different from map

12:09 justin_smith: another option is to generate the values with map, and use them in something non-lazy like reduce or doseq

12:09 depending on what you intend to do with the returned values of course

12:09 philandstuff: (map (fn [x] ..x..) coll) => (doseq [x coll] ..x..)

12:13 silasdavis: is there destructuing syntax for getting at metadata of arguments?

12:14 gdev__: Okay, I think its a java 6 issue

12:14 justin_smith: silasdavis: metadata is on vars, arguments usually show up as values

12:14 gdev__: I just uberjarred on a box with java 7

12:14 silasdavis: ah

12:15 pjstadig: some values can have metadata, too, but there's no destructuring syntax for it

12:15 justin_smith: ((juxt (fn [x] (meta x)) meta) clojure.core/+)

12:15 ,((juxt (fn [x] (meta x)) meta) clojure.core/+)

12:15 clojurebot: [nil nil]

12:15 justin_smith: err...

12:15 ahh of course

12:17 pjstadig: interesting, what is an example of a non-var value I would run into that has a metadata?

12:17 pjstadig: ,((juxt (fn [x] (meta x)) meta) ^:meta {:foo :bar})

12:17 clojurebot: [{:meta true} {:meta true}]

12:18 pjstadig: symbols can have metadata, all the collection types

12:18 java objects (Strings, Integers, etc.) cannot, and keywords cannot

12:18 justin_smith: interesting

12:26 silasdavis: Does anyone know of tool for analyzing unused clojure code?

12:26 in the first instance just finding unused declarations would be useful

12:29 Bronsa: silasdavis: https://github.com/jonase/eastwood

12:32 technomancy: silasdavis: radagast can find unused vars

12:32 nothin' to it

12:33 https://github.com/technomancy/radagast/blob/master/src/radagast/coverage.clj

12:33 silasdavis: Bronsa, technomancy thanks

12:33 Anderkent: I've only now came in, so not sure what the question is, but if it's code coverage then I must plug cloverage

12:35 silasdavis: will take a look, thanks

12:36 technomancy: just 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:36 Anderkent: I do branch analysis! I agree it's pretty complicated though.

12:37 (and because printing out clojure code is too hard, it's transformed into line analysis on output. Bah)

12:37 technomancy: yeah, just saying it might be overkill

12:37 Anderkent: right, of course.

12:39 technomancy: radagast 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:50 pcn: Does anyone have a moment to tell me why this would fail? https://gist.github.com/pcn/7992191

13:51 logic_prog: what is the motivationb behind :require and :require-macros, rather than a single unified approach ?

13:52 amalloy: pcn: 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:54 llasram: logic_prog: Because CLJS macros are actually implemented in JVM Clojure

13:55 pcn: amalloy: You're absolutely correct. I've updated the gist and I can provide more context if you'd like.

13:55 logic_prog: llasram: ah, so we need :require-macros in order to tell cljs "hey, look for a *.clj file, not a *.cljs file"?

13:55 llasram: logic_prog: Something like that. I've only dabbled in CLJS, so I can't comment an details

13:55 amalloy: okay, so you're trying to call .write on a Writer, and passing it two arguments

13:56 but .write only accepts one arg; you probably meant (str (write-json) "\n")

13:59 pcn: Whups

13:59 Let's try that

14:01 dnolen: logic_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:01 pcn: OK, that's completely correct! I was afraid I was doing something much more subtly wrong.

14:01 amalloy: thanks a lot. I've been staring at that for too long.

14:05 TimMc: It'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:16 justin_smith: what does it mean for a macro not to be compile-time only?

14:17 TimMc: That's not the distinction I was trying to draw.

14:21 justin_smith: it was a legitimate question, I still don't understand what you were saying

14:24 TimMc: justin_smith: Well, couldn't the compiler just as well use CLJS for the macro language?

14:25 But then you'd still need to distinguish the compile time and runtime namespaces.

14:26 justin_smith: well cljs doesn't run in the compiling process, does it? maybe I don't understand the series of compile stages for clojurescript

14:26 TimMc: Well, *I* sure as heck don't. :-P

14:38 bitemyap1: I need to stay away from HN.

14:39 bitemyapp: Raynes: how are you doing?

14:42 Raynes: bitemyapp: Splendidly. Yourself?

14:46 bitemyapp: Raynes: likewise! Met a founder of a really nifty analytics company today. Had some nice cafe au lait.

14:46 Taught some Haskell on Saturday. Feeling a bit carpe diem.

14:47 Raynes: Nice.

14:47 bitemyapp: Raynes: how's your learnings of the muggle languages going?

14:47 Raynes: Pretty well. I finished up the Go refheap client.

14:48 Was fun.

14:49 pyykkis: fds

15:00 paulmooring: anyone mind giving a newbie some advice on how to make this more "clojure-like": https://gist.github.com/paulmooring/7993298

15:00 seubert: Raynes: is that public? (the golang client)

15:00 Raynes: seubert: Yep.

15:00 https://github.com/Raynes/goheap

15:01 seubert: oh somehow i totally missed that on your github

15:01 thanks!

15:03 bitemyapp: seubert: could just use curl too.

15:04 rkneufeld: paulmooring: I would consider using filter on (range x) and using (reduce + ...) on the filtered range.

15:04 Raynes: bitemyapp: httpie is really cool for stuff like that.

15:05 seubert: bitemyapp: right, the reason i asked is because i'm learning Go and was just curious

15:05 woah i totally forgot about httpie

15:06 paulmooring: rkneufeld more like: (reduce + (filter (fn [x] (or (= 0 (rem x 3)) (= 0 (rem x 5)))) (range 1000)))

15:07 rkneufeld: paulmooring: Yeah! You could fiddle with the filter predicate a little if you liked, but that should get the job done.

15:07 paulmooring: thanks very much, this takes a little brain re-wiring :D

15:12 OscarZ: why is this not working: (map (math/expt) (take 3 (primes)) '(2 2 2)) ... primes is a lazy infinite sequence.. im getting arityexception

15:13 Raynes: You guys.

15:13 OscarZ: ah crap.. i got it :(

15:13 Raynes: Instaparser is cool.

15:13 Just sayin'

15:13 Well, instaparse. No 'r' at the end.

15:13 OscarZ: extra parentheses again..

15:13 justin_smith: OscarZ: (primes) :)

15:15 OscarZ: justin_smith: it was the (math/expt) parentheses..

15:15 Raynes: OscarZ: What is your editor of choice friend?

15:15 OscarZ: and it was missing those arguments too

15:15 im using Sublime Text atm

15:15 Raynes: Heh.

15:16 OscarZ: just a simple text editor :)

15:16 Raynes: That's like the one editor where I can't shove paredit down your throat.

15:16 You've lucked out.

15:16 OscarZ: heeh.. i can change :)

15:16 what do you recommend

15:16 Raynes: wait

15:16 Yes I can.

15:16 OscarZ: https://github.com/odyssomay/paredit

15:16 tbaldridge: emacs, emacs, emacs....

15:16 Raynes: OscarZ: This is the best way to edit Lisp code imo. There is a learning curve.

15:17 r4vi: emacs+clojure is quite the learning curve

15:17 justin_smith: OscarZ: oh, you said primes was an infinite lazy seq, so (primes) would be invalid in that case

15:17 Raynes: OscarZ: It keeps your parens balanced. Does not let you have unbalanced parens.

15:17 If this is done properly, anyways.

15:17 justin_smith: so you mean primes *generates* an infinite lazy seq

15:17 OscarZ: justin_smith: yes i suppose that was inaccurate

15:18 Raynes: OscarZ: 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:18 Anyways, something to consider.

15:18 :)

15:18 OscarZ: ok..

15:20 I tried Light Table too.. it was pretty cool

15:21 dsrx: paredit is great

15:22 r4vi: and rainbow parens

15:23 schmir: does anyone have experience with smartparens?

15:23 (https://github.com/Fuco1/smartparens)

15:23 OscarZ: oh yeah.. colors would be nice

15:24 jballanc: I hear it's even better than paredit...but I don't use emacs

15:24 * nDuff hugs Emacs Live

15:24 nDuff: ...hmm, so smart-parens is in the clojure pack for Emacs Prelude

15:24 ...or is it Emacs Live?

15:25 ...okay, definitely in Emacs Live.

15:25 haven't checked Prelude.

15:25 * nDuff is running Live at work, Prelude at home; wasn't remembering which was which for a moment.

15:25 jballanc: to 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:26 Raynes: In what ways is the vim version better?

15:27 I've always preferred the emacs version.

15:27 nDuff: jballanc: I've wondered something similar every time I used a non-emacs one, but then, I haven't used vim for clojure recently.

15:27 * nDuff uses vim for everything but Clojure and Java right now -- Python, shell, &c.

15:28 noncom: is anyone here familiar with CCW and nrepl at the same time?

15:28 jballanc: Raynes: in the Vim version, most of the more complicated operations are <leader> combinations

15:28 Raynes: Oh.

15:28 jballanc: so, you get so save the three- and four-finger combinations

15:28 Raynes: jballanc: Well, I could have done that with evil-mode.

15:29 I frankly don't understand why people use Emacs without evil-mode.

15:29 jballanc: yeah, not so much a criticism of the package specifically

15:29 Raynes: It's so good, is basically harmless.

15:29 noncom: i have a strange case where requiring clojure.tools.nrepl.server namespace hangs the CCW repl itself..

15:29 Raynes: Insert mode is basically normal emacs, and there is an actual normal emacs mode.

15:29 Text objects are quite lovely.

15:30 jballanc: Raynes: oh, there is another thing...Vim paredit has a very easy way to move parens

15:30 still haven't figured out a good way to do that in Emacs paredit

15:31 nDuff: jballanc: that's very easy. ctrl+shift+left/right arrows.

15:31 jballanc: (re: moving parens)

15:31 jballanc: ...and that's why I never figured it out ;-)

15:31 (in Vim version it's <leader>-"<")

15:31 Raynes: Interestingly, iirc Emacs actually moves the text whereas vim moves the parens instead.

15:32 jballanc: yeah, vim moves the parens

15:32 OscarZ: heh.. installed now.. weird :)

15:32 jballanc: OscarZ: give it time

15:32 OscarZ: sure

15:32 Raynes: jballanc: I had a C-left/rightarrow command in Emacs for that.

15:32 jballanc: once you get used to it, the parens begin to melt away

15:32 * rkneufeld If you're in the mac in iTerm + Emacs arrow keys can be a little funky: https://gist.github.com/rkneufeld/5126926#a-special-note-for-mac-users

15:32 jballanc: all you'll see is forms

15:32 OscarZ: in a matrix scene?

15:33 jballanc: pretty much

15:33 OscarZ: k :)

15:33 jballanc: I think I can safely say that I'm not sure I could write Clojure without paredit

15:34 OscarZ: heh.. i need to rtfm

15:35 had some trouble deleting some brackets :)

15:36 noncom: i 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:46 jballanc: OscarZ: keep this handy for the first week or so -- http://pub.gajendra.net/src/paredit-refcard.pdf

15:47 augustl: hmm, how do I check if an exception is a clojure.lang.ExceptionInfo? (isa? e clojure.lang.ExceptionInfo) doesn't work it seems

15:47 eric_normand: ,(doc isa?)

15:47 clojurebot: "([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:48 eric_normand: ,(doc instance?)

15:48 clojurebot: "([c x]); Evaluates x and tests if it is an instance of the class c. Returns true or false"

15:48 eric_normand: augustl: looks like you want instance?

15:48 isa? is for types

15:48 (isa? (class e) clojure.lang.ExceptionInfo)

15:52 augustl: eric_normand: instance? did the trick :)

15:53 noncom: is there a programmatic way to know the version of a required library?

15:58 justin_smith: noncom: maybe at startup time (ie. lein classpath) but not introspecting within the process itself afaik

15:58 noncom: did anyone experience project repl hang when requiring nrepl in one of project namespaces?

15:59 (assuming your client uses nrepl too... i think...)

16:24 justin_smith: in 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:44 bitemyapp: justin_smith: read the code

16:45 not trying to be a PITA, that's legitimately the way to understand c.j.j

16:45 if you figure out a better way, let us know.

16:47 joegallo_: or, ya know, http://clojuredocs.org/clojure_core/clojure.core/select-keys

16:47 bitemyapp: justin_smith: in fact, document it in clojurewiki.com !

16:47 joegallo_: which is to say, don't have those other keys :)

16:47 bitemyapp: joegallo_: this is Lisp you mad-man, no common sense allowed.

16:47 joegallo_: my apologies, i meant "write a macro" :D

16:48 bitemyapp: there we go.

16:54 justin_smith: I am using a tool that uses the other keys of the database map - but I think I can work around that...

16:55 bitemyapp: justin_smith: metadata

16:55 justin_smith: yes, 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:20 bitemyapp: there's something deeply satisfying about monkey-patching Python to use immutable collections.

17:22 augustl: there'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:23 tbaldridge: augustl: you have to use recur, or simply give it a name (such as self) and call that.

17:24 `cbp: (fn f ([x] ..))

17:24 justin_smith: (fn self ([a] ...))

17:24 etc.

17:24 yeah

17:24 augustl: yay, thanks :)

17:33 Raynes: Sometimes I regret showing trailing whitespace

17:34 https://dl.dropboxusercontent.com/s/68d18cjrj8o9fxh/2013-12-16%20at%202.32%20PM.png

17:34 x_x

17:36 justin_smith: ouch

17:38 Pupeno_w: Hello.

17:39 Anybody using luminus in production?

17:41 bitemyapp: Raynes: if you were using a real editor, it'd have automatic whitespace cleanup.

17:41 Raynes: (def real-editors #{:emacs})

17:41 M-x whitespace-cleanup

17:42 Raynes: bitemyapp: I have a :FixWhitespace command, but I don't want to fix the whitespace of all of instaparse at the moment.

17:42 noncom: sorry for the offtopic but what is the irc for common lisp?

17:42 bitemyapp: noncom: #lisp

17:42 noncom: thanks!

17:42 technomancy: true to form, they don't consider any non-common lisps valid =P

17:44 bitemyapp: ^^ accurate.

17:44 seangrov`: Love it.

17:45 technomancy: when in reality everyone knows there are two lisps: the Lisp of Commons and the Lisp of Lords

17:45 TEttinger: Arc?

17:46 technomancy: left as an exercise to the reader

17:46 TEttinger: heh is Arc even usable now?

17:46 noncom: wow, #lisp is far less populated than #clojure !

17:46 SegFaultAX: TEttinger: Define "usable"

17:46 noncom: That wasn't always the case. :(

17:47 AimHere: noncom > Lisp is for beardy old people from the 1970s. Clojure is for beardy old people from 2010

17:47 bitemyapp: ~lisp is for beardy old people

17:47 clojurebot: In Ordnung

17:47 bitemyapp: ~haskell is for beardy awesome people

17:47 clojurebot: In Ordnung

17:47 bitemyapp: ~clojure is for beardy nice people

17:47 clojurebot: Ack. Ack.

17:49 noncom: is common lisp community a subject for extinction?

17:49 AimHere: Nah

17:49 It's no deader than usual

17:50 bitemyapp: noncom: CL lurks like Cthulhu. Under the depths.

17:50 ystael: "Hybrid children watch the sea, pray for cdr roaming free..."

17:55 noprompt: bitemyapp: RWH jumps around way to fucking much.

17:55 bitemyapp: it's an irritating book.

17:55 bitemyapp: LYH is better.

17:55 bitemyapp: and by "better" i mean "it's preferable to me"

17:57 bitemyapp: and by "it's preferable to me" i mean "that's cool if you think otherwise."

18:04 bitemyapp: noprompt: I didn't care for RWH

18:05 I see how it's "practical" but it's too many islands of recipes rather than integrative knowledge building.

18:05 I use LYAH as a handy-dandy reference.

18:05 noprompt: bitemyapp: yeah, RWH is messy. some parts are really great but then it turns in to a train wreck.

18:06 seangrov`: 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:06 bitemyapp: better to just hack-hack-hack on personal projects IMO.

18:07 noprompt: speaking of, want to do some Haskell pairing this week?

18:07 noprompt: bitemyapp: 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:07 that shit looks ugly

18:07 bitemyapp: noprompt: there are names for those

18:07 I don't know why people don't use them.

18:08 noprompt: bitemyapp: i do. i just gonna start working a version of frak in hs.

18:08 bitemyapp: noprompt: cool. I like that idea.

18:10 clj: Hi guys, is there any technique to have symbol evaluated in macro body ?

18:11 I'm trying to do something like this:

18:11 (defmacro method-call [^String method] (let [m (with-meta (gensym "_m") {:tag 'java.util.Date})] `(fn [~m] (.. ~m ~(symbol method)))))

18:11 calling it with literal works fine

18:11 ((method-call "getTime") (java.util.Date.))

18:12 but not with symbol - (def met "getTime")

18:12 ((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:13 noncom: maybe you should remove the ^String type annotation and then ~met in the macro?

18:13 clj: I'll give it a try

18:14 noncom: i meant ~method sorry

18:14 clj: still the same

18:15 noncom: same exception? strange..

18:16 clj: yes

18:16 noncom: maybe you (eval method) ?

18:17 clj: tried that as well

18:17 noncom: oh these macros..

18:17 noprompt: bitemyapp: if you wanna pair on frak that might be good.

18:19 bitemyapp: noprompt: I'd be up for that. I'm terrible at regex though :)

18:19 and haven't really done any regexing in Haskell

18:20 amalloy: clj: 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:20 noprompt: bitemyapp: 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:20 clj: amalloy: thx - is there a way to achieve same functionality ?

18:21 noprompt: bitemyapp: sorry *haskell will highlight it.

18:21 clj: amalloy: i was trying to resolve the symbol at run-time

18:21 bitemyapp: noprompt: *nods*

18:22 cemerick: seangrov`: There is a facility for doing that; do you know of a bad cljsbuild/clojurescript combo?

18:22 amalloy: well you can't do that, since the macro gets expanded at compile time

18:22 i 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:23 seangrov`: cemerick: Specifically using sourcemaps + auto build with any level of optimization. People are continually asking about it in here and on the ml.

18:23 amalloy: you'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:24 seangrov`: Missed him...

18:24 clj: amalloy: 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:25 eric_normand: clj: having a method name as a string and wanting to call a java method is reflection

18:25 amalloy: you 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:25 clj: amalloy: yes, but I would do it only once - then call that function multiple times

18:26 amalloy: mmm. you can save the Method object that reflection gives you; i think most of the cost is in finding it

18:27 or you can (eval ...) some code that produces a type-hinted function

18:27 clj: eric_normand: agree - I just thought there is some easier way with macros :)

18:28 amalloy: thank you - I had no luck with eval - I'll resort to reflection now :)

18:29 bbloom: petehunt: 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:29 petehunt: ok, thanks

18:30 amalloy: i 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:31 you can do more clever stuff to adjust typehints on the object and the args, but that's the idea

18:34 eric_normand: clj: Does this not do the trick? (eval `(fn [d#] (. d# ~(symbol met))))

18:35 clj: amalloy: thanks !

18:36 eric_normand: thank you ! that works too !

18:36 eric_normand: clj: just use it as a function, not as a macro

18:37 clj: eric_normand: right - will give it a try in real setting. thanks !

18:38 amalloy: eric_normand: that version doesn't avoid reflection at all

18:38 eric_normand: amalloy: you're right.

18:39 amalloy: I thought he meant he didn't want to do reflection himself, just wanted to pass it on to Clojure

18:41 amalloy: now I see that you had already responded. Just ignore what I wrote.

18:41 amalloy: your version is good if he was just trying to punt on the reflection, though

18:42 cshell: Does anyone here know how to configure TeamCity to build leiningen projects?

18:52 AeroNotix: why the hell does `some' return nil?

18:52 clojurebot: (some true? '(false))

18:52 clojurebot: It's greek to me.

18:52 AeroNotix: clojurebot: ,(some true? '(false))

18:53 clojurebot: No entiendo

18:53 AeroNotix: ,(some true? '(false))

18:53 clojurebot: nil

18:53 AeroNotix: ^^

18:53 technomancy: because it's not a predicate

18:54 hiredman: ,(if nil true false)

18:54 clojurebot: false

18:54 AeroNotix: ,(= nil false)

18:54 clojurebot: false

18:54 AeroNotix: technomancy: what is Clojure's definition of a predicate?

18:55 `cbp: a predicate returns true or false

18:55 hiredman: feh

18:55 AeroNotix: some people who use clojure make the distiction

18:55 technomancy: some returns the first truthy value

18:55 AeroNotix: oh it actually returns the value

18:56 technomancy: what would you expect here?

18:56 AeroNotix: ,(some seq? :banana [1 2 3])

18:56 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core/some>

18:56 AeroNotix: ,(some seq? '(:banana [1 2 3]))

18:56 clojurebot: nil

18:56 hiredman: AeroNotix: clojure treats nil and false as logically false, and true and any other non-nil value as logically false

18:56 S11001001: hiredman: :)

18:56 seangrov`: technomancy: You might have answered this, but any ideas about improving `heroku run lein repl`?

18:57 bitemyapp: hiredman: as logically true, you mean?

18:57 AeroNotix: technomancy: the detail I was missing is that it *returns* the truthy value. Not returns true if the value is truthy.

18:57 seangrov`: Just avoid it and do something with drawbridge?

18:57 bitemyapp: seangrov`: fire up an nrepl instance inside your app

18:57 seangrov`: tunnel into it.

18:57 technomancy: seangrov`: that's pretty vauge; do you have something in mind?

18:58 seangrov`: 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:59 bitemyapp: How do you tunnel into a heroku dyno?

18:59 technomancy: seangrov: well that's the tradeoff of uberjars

18:59 bitemyapp: seangrov`: well if you're constrained to HTTP and not TCP, then you'll need to route it over HTTP.

18:59 hiredman: bmag

19:00 technomancy: smaller slugs vs having everything there

19:00 AeroNotix: https://github.com/clojure/core.match in the fizzbuzz example here why doesn't the [0 _] match *before* the [_ 0] ?

19:00 does it not short-circuit?

19:00 or does it find a 'better' match?

19:00 seangrov`: 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:00 AeroNotix: in Erlang, matches are essentially short-circuit.

19:00 technomancy: agreed that not having tcp access is a huge drag

19:01 wish i could do something about that

19:01 but yeah if you want access to the dyno itself, you use drawbridge

19:03 hiredman: AeroNotix: why do you think it doesn't?

19:03 bitemyapp: oh dear god this Python library hashes keywords to the same values as their inner strings

19:03 fucking madmen.

19:04 AeroNotix: hiredman: well, they implemented fizzbuzz like that. As an example I'd expect it to be 'correct'?

19:04 amalloy: AeroNotix: it is correct. hiredman is asking why you think it's not

19:04 technomancy: seangrov`: downloading jars on the dyno is less o fa problem when a human is directly involved

19:05 AeroNotix: amalloy: because how does [0 _] not match *before* [_ 0] ?

19:05 is it not short-circuiting matching?

19:05 amalloy: that just doesn't make any sense as a question. it does exactly what you're asking why it doesn't

19:05 hiredman: AeroNotix: it could only match if both were 0, which is covered by the first case

19:06 amalloy: AeroNotix: there's a [0 0] case before both of them, so there's no overlap

19:06 AeroNotix: Remove the [0 0] case and what happens?

19:06 seangrov`: 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:07 AeroNotix: just trying to understand which *kind* of pattern matching it is.. some use short-circuit and some use 'best fit'

19:07 amalloy: first match

19:07 AeroNotix: cool ok

19:07 cheers

19:07 seangrov`: technomancy: Also, I *am* doing the uberjar compile, should it still be downloading all the deps on `heroku run lein repl`?

19:07 hiredman: if you click around in the wiki there is a link to the paper it is based on

19:08 technomancy: seangrov`: worst case you fall bacx to `rlwrap heroku run java -cp ... clojure.main`

19:08 AeroNotix: sure, bedtime now though

19:11 technomancy: seangrov`: yeah, you should still download the kj

19:11 the jars

19:11 since the uberjar leaves out m2 to speed up deploys

20:04 cemerick: dnolen: 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:52 levinm: from [#{'A 'B} #{'B}], how do I use clojure.set/union to get #{'A 'B}

21:54 justin_smith: levinm: (apply clojure.set/union sets)

21:54 if they are in a collection

21:55 levinm: thanks justin

22:02 logic_prog: how do peopel in merger & acquisations profit? what percent of the sale/purchase price do they get?

22:12 so for example, what does qatalyst partenrs do, and how do they profit from it?

22:16 SegFaultAX: logic_prog: What does this have to do with Clojure?

22:16 logic_prog: I'm in the wrong channel.

22:47 amalloy: fwiw 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:50 levinm: Thank you amalloy - yes that is helpful to me.

22:52 rovar: I'm not sure if I hate paredit mode or really really fucking hate paredit mode

22:52 eggnoggin: paredit is amazing

22:52 structural editing forever

22:53 rovar: except when I'm trying to fix broken parens

22:53 writing new code is pretty nice

22:55 also, it insists on matching up a ( and a ]

22:55 so I can't provide the correct [ for the ]

22:56 because it thinks it's already balanced.

22:56 i mean wtf?

22:56 hiredman: rovar: stop typing unbalanced expressions

22:57 rovar: i kill/yanked an expression, and didn't get the entire thing

22:57 SegFaultAX: That shouldn't even be possible with paredit

22:57 rovar: missed a [

22:57 now I can't re-add it

22:57 hiredman: rovar: are you using a recent version of paredit?

22:57 seancorfield: rovar: you can copy another [ from somewhere else and paste it in

22:57 amalloy: rovar: C-q prefix always means "insert the next character, ignoring weird rebindings"

22:57 rovar: yea.. just loaded today

22:57 SegFaultAX: Or just temporarily disable paredit mode.

22:58 amalloy: seancorfield: that's a fairly gross way to do it

22:58 seancorfield: amalloy: ah, that's even easier ;)

22:58 rovar: C-q [ did the trick

22:58 amalloy: i did it that way for years, but now i know better (in the rare instances where i need to do it at all)

22:58 rovar: thanks

22:58 amalloy: C-q DEL deletes the next character unconditionally, as well

22:58 seancorfield: the great thing about emacs - you learn something new every day :)

22:58 hiredman: rovar: 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:59 amalloy: wait, 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:59 SegFaultAX: As a vim user, I have a hard time learning emacs because my fingers start hurting after 10 minutes of heavy usage.

22:59 I must be using C- wrong.

23:00 amalloy: SegFaultAX: yeah, if you don't remap capslock to control, you'll be sad

23:00 seancorfield: amalloy: i've managed to kill chunks of text with unbalanced parens

23:00 amalloy: sure, i do that all the time

23:00 hiredman: amalloy: sometimes when I kill an expression weird things happen

23:00 SegFaultAX: amalloy: Meta seems fairly important too

23:00 hiredman: then I undo, and do it again and it is fine

23:00 amalloy: SegFaultAX: yeah, but at least for me that one was never hard. you just use your thumb

23:00 rovar: i need foot pedals for ctrl and mod

23:00 err meta

23:00 SegFaultAX: In vim you can just find the outer-most matching brace and use d% to kill the entire thing.

23:01 amalloy: rovar: i got myself some foot pedals for that reason

23:01 hiredman: sometimes the entire file from the point to the end vanishes leaving unbalanced expressions

23:01 rovar: I've been a vim user for the last 7 years

23:01 hiredman: but, it is very rare

23:01 rovar: just cut the habit on friday

23:01 amalloy: never 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:01 SegFaultAX: Is 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:01 rovar: heh

23:02 seancorfield: hiredman: doesn't that happen when you've set a mark and later accidentally kill-to-mark?

23:02 SegFaultAX: I really really want to like emacs, but I just can't get over how hard it is on my hands.

23:02 rovar: SegFaultAX: I use dvorak, so it balances out

23:02 hiredman: seancorfield: you mean am I doing that? could be, but not to my knowledge

23:03 rovar: actually.. with dvorak, the : key is at the qwerty z key

23:03 SegFaultAX: rovar: That doesn't help the awkward placement of ctrl and meta.

23:03 rovar: so it's almost as annoying as ctrl

23:03 hiredman: I wonder if I just don't type enough/fast enough

23:03 SegFaultAX: rovar: But for qwerty it's just right there on the neutral pinky. Great for vim. :D

23:04 amalloy: SegFaultAX: 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:04 rovar: that's why I switched.. the nrepl and the clojurescript browser nrepl

23:05 SegFaultAX: amalloy: vimscript is /horrible/. I'll give you that.

23:05 rovar: I got tired of switching back and forth between windows because I needed by browser, terminal and editor

23:05 SegFaultAX: But for editing lisp, emacs has always been superior. vim is getting better all the time to be sure, but emacs has no equal.

23:05 rovar: no I stay in 1 window with my browser and editor

23:06 so you either alt-tab or change workspaces.. or you type a few extra ctrls

23:06 I think I will remap caps to ctrl though.

23:06 SegFaultAX: amalloy: 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:08 amalloy: yeah, that's been my experience when trying to use Raynes's laptop

23:08 Raynes: Like what plugins?

23:08 (amalloy in particular)

23:09 I never came across a single thing that evil-mode broke when I used Emacs.

23:09 amalloy: i forget what in particular, but i remember you didn't notice them because you don't use a lot of the emacs builtins

23:09 or something

23:10 LuminousMonkey: I'm considering moving back to vim, but just because I've moved to an AwesomeWM, tmux config on my work machine.

23:11 SegFaultAX: Raynes: Do you use paredit for vim?

23:11 LuminousMonkey: Movement in vim feels much nicer, but I still move to Emacs for Clojure editing.

23:11 Raynes: Yeah.

23:11 rovar: LuminousMonkey: I use i3, but why would a new wm effect your editor choice?

23:13 LuminousMonkey: Have 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:13 rovar: for i3 I use windowkey for everything.. for tmux.. yea.. you'll need to find a free key.

23:13 LuminousMonkey: Moving between windows in AwesomeWM I have mapped to vim movement keys, but with Modkey.

23:14 rovar: I always used mod+number

23:14 never liked relative movement

23:14 LuminousMonkey: Dual screen?

23:14 rovar: because I map all my processes to fixed windows

23:14 SegFaultAX: No xmonad love?

23:14 joshhead: I 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:15 rovar: even when I was coding haskell professionally I couldn't handle writing haskell to config my wm

23:15 SegFaultAX: joshhead: Please don't do that :(

23:15 LuminousMonkey: I've never tried Xmonad.

23:15 rovar: joshhead: do it

23:15 SegFaultAX: joshhead: But in general yes, Clojure is very lenient with symbol names.

23:15 rovar: imo 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:16 joshhead: I've never seen it before, though I have seen it used like (let [a' (somefn a)] ...)

23:16 SegFaultAX: joshhead: Well that's not the same thing.

23:16 rovar: a prime

23:16 that's a common idiom

23:16 SegFaultAX: Yup

23:16 amalloy: the support for ' was added to allow symbols like a', not like don't

23:16 joshhead: SegFaultAX: just because it's lenient doesn't mean I should abuse the power

23:16 SegFaultAX: joshhead: Correct

23:17 (inc amalloy)

23:17 rovar: joshhead: do it.. abuse said power

23:17 lazybot: ⇒ 80

23:17 joshhead: but I was wondering if symbol as apostrophe instead of prime would constitute abuse :)

23:17 rovar: it might have unintended consequences later.. like when you're testing or porting to the web..

23:17 but do it anyways

23:17 let the apostrophe flow through you.

23:17 joshhead: rovar you just like chaos don't you

23:17 lol

23:18 hyPiRion: SegFaultAX: xmonad <3

23:18 rovar: ya

23:18 joshhead: I'm planning to use this code as an example to teach some Clojure. I don't want to instill too many bad habits

23:19 rovar: hmm.. elscreen looks kind of cool

23:19 I like tabs

23:19 so far.. switching between buffers is not as fast as I'd like..

23:19 finding by name gets old..

23:19 I want to assign numbers..

23:23 ooh.. I wonder if I could map meta-tab to switch-to-previous-buffer

23:24 oh well, enough meta optimization, back to work.

23:24 indigo: 4clojure makes me feel dumb... so many good solutions

23:26 andyf: Indigo: try to draw knowledge and inspiration instead. E.g. Next time my solution will be just a bit more clever than last time

23:26 indigo: andyf: Oh yeah I know

23:26 I like that it makes me feel dumb; it means I'm learning :P

23:27 kandinski: indigo: sometimes they make me feel smart because I understand them

23:27 whoever amcnamara is, he wins at codegolf

23:27 eggnoggin: lol

23:28 and chouser

23:28 andyf: Code golf solutions usually (but not always) makes me glad I don't write code that way.

23:29 indigo: kandinski: Yeah, I'm following him

23:29 So good

23:29 eggnoggin: seeing stuff like ` ~@ inside of for comprehensions makes my head hurt

23:29 kandinski: yeah, I only started last weekend

23:29 levinm: can you see solutions from people you don't follow - I just chose people at random to follow, is there some smarter way?

23:29 kandinski: I mean, three days ago. So I get what you mean.

23:30 I picked the top users

23:30 soome of which are the developers of 4clojure

23:30 so people who know it well

23:31 joshhead: do you have to solve a problem before you can see other solutions?

23:31 kandinski: always

23:32 rovar: also clojurescriptkoans.com has a very nice ui

23:32 for doing said koans

23:32 indigo: joshhead: You can search for solutions on other people's githubs but that takes away the fun

23:32 rovar: speaking of clojurescript, does anyone know how I'd go about using dommy macros inside of a clojurescript nrepl?

23:34 joshhead: yeah it would kind of take away the challenge

23:34 amalloy: kandinski: 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:35 kandinski: amalloy: what I meant to say is that he knows clojure very well

23:35 his solutions are not only codegolf-y, but also reasonably so

23:36 amalloy: the code-golf champion IMO was always youz

23:36 his stuff is nuts

23:36 kandinski: I'll avoid him then :)

23:36 amalloy: i usually tried for idiomatic and readable rather than golf

23:36 kandinski: I have jumped straight into 4clojure to teach myself the language. I'm using that and the cheatsheet at (defn removeDuplicates [arg]

23:36 (loop [chars arg, acc []]

23:37 (if (empty? chars) acc

23:37 oops, sorry about that

23:37 amalloy: lol

23:37 kandinski: mispaste

23:37 amalloy: kandinski: remove-duplicates is the Lisp Way, since you mention it

23:37 kandinski: amalloy: I have done a bit of scheme, so all my solutions are the classroom-standard recursive bit

23:37 that wasn't even my code

23:37 SegFaultAX: amalloy: I start with something completely readable and idiomatic, then work backwards to something golfed down to a reasonable size.

23:37 rovar: I tend to go for point-free if I can get it without making things too obtuse

23:37 kandinski: mine had a non-obvious error, so I googled for a solution and compared both

23:37 rovar: I use -> and comp a lot, I've found.

23:38 kandinski: (I was using into when I should have been using conj)

23:38 amalloy: that's one of the things i love about 4clojure. everyone uses it to practice something different

23:38 rovar: I'm still finding parts of the stdlib that shorten my code drastically.

23:38 SegFaultAX: On a side note, I wish "comp" was shorter.

23:38 indigo: I try to use as many stdlib functions as I can

23:38 rovar: I agree

23:38 SegFaultAX: It's really convenient being able to do eg `foo . bar`

23:38 kandinski: indigo: not as few?

23:38 indigo: And I also try to avoid for

23:38 kandinski: You know what I mean :P

23:39 amalloy: SegFaultAX: for sure. lisp gives up some stuff that is really nice in haskell

23:39 SegFaultAX: amalloy: "comp" just feels really obtuse for some reason, though.

23:40 I don't know what I would rather it be (that isn't already used by something else)

23:40 I also really hate identity not being just id

23:40 amalloy: i'm reasonably happy with identity

23:40 it reads so much better out loud

23:41 SegFaultAX: The name of the function is almost as long as the thing it names

23:41 Longer even.

23:41 amalloy: well, longer since it's #(do %)

23:41 hiredman: someone had a pretty neat emacs setup that mapped lots of function names to mathy unicode symbols

23:41 indigo: SegFaultAX: You can redefine function names

23:41 SegFaultAX: I thought it was (fn [x] x)

23:41 eggnoggin: could use idiot instead of identity and bluebird instead of comp but not sure...

23:42 indigo: For example I redefined map as ♫

23:42 SegFaultAX: Ewwie.

23:42 indigo: (♫ inc '(1 2 3))

23:42 ;P

23:43 kandinski: great

23:43 you could also redefine '(' as '[' and vice-versa

23:43 SegFaultAX: That'd be a great way to mess with your co-workers though. Re-map the top 25 most common function to glyphs.

23:43 kandinski: because, why not?

23:43 "it works on my machine"

23:43 indigo: Hehe

23:44 Make Clojure into APL

23:47 SegFaultAX: Wow, crazy valuation: http://sfbay.craigslist.org/sfc/cpg/4247279322.html

23:49 amalloy: is "established startup" an oxymoron, or am i just not hip to the jive?

23:49 kandinski: SegFaultAx, if you have one cent, I'll sell you 0.00000001 of my million-dollar-valuated company

23:49 which will ve so valuated by the fact that you gave me that cent

23:49 SegFaultAX: 400,000 isn't cool. You know what is cool? 1,000,000.

23:50 hiredman: https://github.com/Bronsa/.emacs.d/blob/master/config/hooks.el#L10-L37

23:50 SegFaultAX: I've never met an entrepeneur with expectations that reasonable.

23:57 amalloy: speaking of making clojure into APL, i wonder what a clojure version of "under" would look like

23:57 as explained at http://prog21.dadgum.com/121.html

23:57 kandinski: it's a context manager, isn't it?

23:58 I read it, and it looked like an advanced version of "with" or DSU

23:58 python's "with", I mean, or "Decorate, Sort (or summate, or whatever) and Undecorate"

Logging service provided by n01se.net