#clojure log - Oct 14 2014

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

0:00 justin_smith: you may also want to try printing the value of *db* in context of the call

0:00 to see what is really there in the thread local binding

0:00 DomKM: "java.sql.SQLException: No suitable driver found for jdbc:postgres://localhost:5432/brandroid_zonefs"

0:01 I *think* that's correct but I don't have much experience with jdb

0:01 justin_smith: maybe try switching to the c.j.jdbc.deprecated ns and see what parse-properties-uri returns when handed that?

0:02 DomKM: oh, weird

0:03 subprotocols include "postgres" and "postgresql" but classnames only includes "postgresql"

0:03 maybe try switching postrgres for postgresql?

0:04 DomKM: justin_smith: the deprecated get-connection fn works

0:04 justin_smith: hmm, OK

0:04 then why is it saying it can't find a driver?

0:05 DomKM: ...I don't know

0:05 (#'clojure.java.jdbc.deprecated/get-connection "jdbc:postgresql://localhost:5432/brandroid_zonefs")

0:05 that works with or without "jdbc:"

0:05 and postgres or postgresql

0:06 justin_smith: and I assume you can use that in order to successfully access your db?

0:07 DomKM: justin_smith: Haven't tried with deprecated yet, one moment

0:07 justin_smith: I'd still be a bit suspicious about *db* being thread local, unless you know 100% it has the right value at the point of being called at the time of the error

0:07 or, make that, suspicious because *db* is thread local

0:10 DomKM: justin_smith: I'm not familiar with the deprecated api, is it possible that I could create a connection but get this driver error after?

0:10 that seems like it would happen before a connection is made

0:11 justin_smith: not sure - but the real issue to me is that get-connection is called in a specific dynamic binding context, and there are a few things that can make it so you don't have the same binding at runtime you see in a repl - it matches the weird behavior you describe

0:12 each call to a db using function iirc will call get-connection and use the current thread local dynamic binding of *db* to create a connection (unless you are using a connection pool, in that case it grabs a connection out of a pool stored under *db*)

0:13 DomKM: justin_smith: ok, so the deprecated connection works

0:13 I created a table with it

0:14 using with-connection and the dynamic db binding

0:14 justin_smith: right, but you also have to verify that the dynamic binding is right inside your migration function at runtime

0:19 DomKM: justin_smith: ok, I'll dig around more. Thanks for your help :)

0:20 justin_smith: best of luck, and let me know when you figure out the issue, I'm curious

0:22 gzmask: how do I use object methods that changes object properties in clojurescript? i.e in three js, there is this camera.lookAt() method that changes its directions.

0:23 DomKM: justin_smith: this is bizarre, jdbc works with "postgres" or "postgresql" but joplin/ragtime errors with "postgres"

0:24 justin_smith: I assumed it would for "postgresql" but, on a whim, changed it

0:24 justin_smith: now it works

0:24 bizarre

0:24 also potentially problematic because Heroku's database url var uses "postgres", not "postgresql"

0:27 justin_smith: weird

0:27 at least it is an easy regex switch?

0:27 anyway, sorry I wasn't more helpful (though among my scattershot suggestions I did point out the postgres / postgresql weirdness)

0:28 gzmask: (.lookat camera args...)

0:29 or, for chained usage: (-> camera (.lookat args...) .whatever)

0:59 handojin: need some direction

0:59 have project

0:59 lein run works fine

0:59 lein beanstalk deploy development

1:00 crashes out with...

1:00 could not locate ring/middleware/not_modified__init.class or ring/middleware/not_modified.clj on classpath

1:08 (+ 1 1)

1:08 clojurebot: 2

1:13 justin_smith: handojin: do you directly rely on the ring deps, or only via the lein-ring plugin?

1:17 handojin: @justin_smith not using lein-ring plugin. i have lib-noir, rind-devel, ring-json as dependencies

1:19 justin_smith: any reason to use ring-devel rather than ring?

1:20 handojin: lib-noir was a later addition - needed ring-devel for reload - seems like it's unnecc now

1:23 xsyn: Hi

1:23 I'm looking for a function like reduce

1:23 but isn't ;)

1:23 If I have a coll

1:23 [ 1 2 3 4]

1:24 I want to apply a function in such a way that it apples to sets of elements at a time

1:24 so say +

1:24 would return

1:24 [3 5 7]

1:30 justin_smith: (map #(apply + %) (partition 2 [1 2 3 4 5]))

1:30 ,(map #(apply + %) (partition 2 [1 2 3 4 5]))

1:30 clojurebot: (3 7)

1:30 justin_smith: ,(map #(apply + %) (partition 2 1 [1 2 3 4 5]))

1:30 clojurebot: (3 5 7 9)

1:30 justin_smith: oh, you did not include 5

1:31 ,(map #(apply + %) (partition 2 1 [1 2 3 4]))

1:31 clojurebot: (3 5 7)

1:40 DomKM: justin_smith: you were very helpful and yeah, it's an easy regex fix

1:41 justin_smith: I wouldn't have thought of switching the name to "postgresql"

1:43 handojin: ok - included :plugins [[lein-ring "0.8.12"]] and it's compiling

1:43 and deploying

2:03 @justin_smith - thanks for gesturing towards the right path!

2:09 TEttinger: apparently there may have been a dropbox hack, change your passwords if you use it. I hope no one's relying on the dropbox API for an app...

2:17 gws: TEttinger: more info on that: https://blog.dropbox.com/2014/10/dropbox-wasnt-hacked/

2:18 TEttinger: thanks gws

2:28 (inc gws)

2:28 lazybot: ⇒ 6

4:19 Fender: hey, any of you knows how to idiomatically format numbers such that they stay numbers but 7/9 has some predefined decimal precision, i.e., is represented as 0.77778?

4:20 they say BigDecimal is the way to go but instantiating objects to call their functions feels so java

4:22 hyPiRion: ,(with-precision 5 (bigdec 7/9))

4:22 clojurebot: 0.77778M

4:23 Fender: thanks!

4:23 hyPiRion: I think that should cover your use case

4:23 np

4:23 Fender: looks like exactly the thing I wanted

4:23 hyPiRion: hurray!

4:25 clgv: ,(format "%.7f" (with-precision 5 (bigdec 7/9)))

4:25 clojurebot: "0.7777800"

4:27 hyPiRion: clgv: it's better than ##(format "%.7f" (bigdec 7/9)) :p

4:27 lazybot: java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.

4:29 clgv: hyPiRion: :P just wanted to demonstrate that there are no more "digits" stored ;)

4:29 hyPiRion: ohh

4:31 Fender: ,(with-precision 6 (bigdec 0.25341263737))

4:31 clojurebot: 0.25341263737M

4:31 Fender: hmmm

4:32 I only want 6 digits but format is not an option "because string" :)

4:34 well, I guess I do that by composing * round int /

4:36 something like this #(-> % (* 1000000) double (Math/round) int (/ 1000000))

4:37 you know something better?

4:38 every number is double, then int, then bigdec :-/

4:38 hyPiRion: huh, honestly surprised about that

4:38 clgv: Fender: yes, I was not suggesting `format` as solution ;)

4:39 Fender: format returns a string

4:39 clgv: mind the "not" above ;)

4:39 hyPiRion: ,(defn scale-it [decimal precision] (.setScale (bigdec decimal) precision java.math.RoundingMode/HALF_UP)))

4:39 clojurebot: #'sandbox/scale-it

4:40 hyPiRion: ,(scale-it 0.25341263737 6)

4:40 clojurebot: 0.253413M

4:40 hyPiRion: ,(with-precision 6 :rounding HALF_UP (bigdec 0.25341263737))

4:40 clojurebot: 0.25341263737M

4:41 hyPiRion: That smells buggy...

4:41 Fender: clgv: can you repaste the line you refer to? I honestly dont know :)

4:42 hyPiRion: gfrederi`: would you expect that? ^ I thought converting to a bigdec was considered a bigdec operation.

4:42 Fender: maybe I just dont understand the difference between precision and scale

4:43 hyPiRion: Maybe I don't either.

4:43 Fender: maybe precision rfers to internal representation and scale to external

4:43 hyPiRion: 1http://stackoverflow.com/questions/15643280/rounding-bigdecimal-to-always-have-two-decimal-places

4:46 Fender: ,(.setScale (with-precision 6 (bigdec 0.76)) 6 6)

4:46 clojurebot: 0.760000M

4:46 Fender: D:

4:49 ah yes, to explain: I want the shortest representation with at most 6 digits after the point

4:50 reason why no strings are allowed: I pass it to cheshire after that

4:51 so the JSON would become "0.123" instead of 0.123

4:51 which is not good

4:52 ok, got it

4:52 (.stripTrailingZeros (.setScale (with-precision 6 (bigdec 0.76)) 6 6))

4:52 works for (/ 7 9) and 0.7356293892 as well

4:53 maybe using the double-> int -> bigdec trail is faster :)

4:56 doing this to some 2k numbers costs me 33msecs

4:57 not exactly cheap

4:59 sveri: Hi, how can I mark dependencies as test dependencies in project.clj?

5:00 hyPiRion: sveri: `:profiles {:dev {:dependencies [[my-dev-dependency "1.0.0"]]}}`

5:01 sveri: hyPiRion: thank you, I thought there was something like :dependencies [[foo.bar "3.0" :test]]?

5:03 luxbock: there is [my-dev "0.1.0" :scope "test"]

5:04 dysfun_: is there any documentation on compiling code with a custom reader (Well, the clojure reader with some reader macros), :aot -style?

5:04 sveri: luxbock: ah, thats what I meant, thank you

5:10 Fender: ok, the reason this is slow is reflection

5:11 ,(.setScale ^BigDecimal (with-precision 6 (bigdec 1.235)) 6 6)

5:11 clojurebot: 1.235000M

5:11 Fender: I get a Reflection warning, call to method setScale can't be resolved (target class is unknown).

5:11 Link http://docs.oracle.com/javase/6/docs/api/java/math/BigDecimal.html

5:12 what else does it need to know to get rid of that reflection warning?

5:12 should I hint that 6 is an int?

5:16 TEttinger: ,(.setScale (bigdec (with-precision 6 (bigdec 1.235))) 6 6)

5:16 clojurebot: 1.235000M

5:16 TEttinger: wonder if that will help at all

5:18 Fender: Tettinger that helped

5:18 how did you know?

5:18 I'm down from 33msecs to 16

5:18 TEttinger: I've optimized some weird reflection stuff in the past with clojure. take a look at primitive-math by ztellman

5:19 $google ztellman primitive-math

5:19 lazybot: [ztellman/primitive-math · GitHub] https://github.com/ztellman/primitive-math

5:19 Fender: I thought hinting that a bigdec is a bigdec is sufficient :)

5:19 thanks!

5:19 TEttinger: no prob!

5:19 ztellman did a great job with that lib btw, very useful in optimizing a tricky thing

5:19 wenshan: I'm playing around with play-clj to learn clojure. Every time I make a change, I have to restart the game (call `lein run`) so the change is effective. Is it possible to avoid this?

5:20 TEttinger: wenshan: take a look at nightmod, by the author of play-clj

5:20 https://nightmod.net/

5:21 Fender: very nice, I didnt know that clj still reflects on numbers

5:22 Cr8: boxes

5:22 Fender: gotta rewrite some stuff now :)

5:35 dysfun_: scala has a neat feature where it can compile extra copies of functions that operate on primitives and it only boxes and unboxes at the edges, so there's a separate fast code path

5:36 although i wonder how long before hotspot starts doing that automagically

5:52 wenshan: TEttinger: I'm aware of nightmod, but I'm using Emacs and setting up a development workflow

5:53 TEttinger: ah, then your best bet is a long-running lein. drip can do it, there's some shenanigans technomancy used to make lein run faster (can't remember the details)

5:55 https://github.com/technomancy/grenchman wenshan

5:59 justin_smith: wenshan: it should also be possible to construct your code such that a reload of your code should change your running game? I don't know play-clj specifically and what any gotchas for that would be though

6:02 wenshan: for example, based on looking at the example in the readme, if you did (defn play-on-show [screen entities] ...) (defscreen main-screen :on-show #'play-on-show ...) etc. then each time you update the definition of play-on-show at runtime, that should update the on-show behavior of the running screen

6:06 wenshan: looking at the macro, the macro itself may be "clever" enough to make that approach break horribly, but in that case you can still use (fn [screen entities] (#'play-on-show screen entities)) inside the defscreen body

6:07 and get the same reloading effect

6:09 wenshan: actually, looking a little closer - the whole point of play-clj is that you can launch it from a repl, and redefine any part of it at runtime and see an immediate update - just run it from a repl instead of using lein run

6:19 wenshan: justin_smith: thanks, I'll try

7:10 crispin: Hey there peeps!

7:11 how do I "subclass" a javascript "object" in clojurescript

7:11 I want to "subclass" this: https://github.com/GoodBoyDigital/pixi.js/blob/master/src/pixi/filters/AbstractFilter.js

7:12 deftype? defrecord? reify?

7:12 proxy?

7:12 clojurebot: proxy is <Chouser> proxy teases with its ease of use, then suddenly betrays.

7:18 justin_smith: crispin: from a quick look, it seems like reify might work (unlike proxy it actually has an implementations in cljs.core)

7:19 dnolen_: crispin: just do what you would do in JS

7:20 (defn AClass [...] (this-as this (AbstractClass this) ...)

7:21 crispin: when subclassing patterns are solidified by ES6 we might think about better support for this, but until then ^

7:36 martinklepsch: How can one concatenate selectors in garden like illustrated here: https://gist.github.com/mklappstuhl/24407c3069f77a0ab162

7:58 perplexa: ,(reduce (fn [r v] (into r (clojure.string/split v #","))) ["1/a,1/b,2/c" "2/d,1/e,2/f"])

7:58 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentCollection>

7:58 perplexa: wat

7:58 ,(reduce (fn [r v] (into r (clojure.string/split v #","))) [] ["1/a,1/b,2/c" "2/d,1/e,2/f"])

7:58 clojurebot: ["1/a" "1/b" "2/c" "2/d" "1/e" ...]

7:59 perplexa: can i now sort them all by the numbers without having a second reduce?

8:00 i want to have a map like {:1 ["a" "b"] :2 ["c" "d"]}

8:00 would probably use update-in + a second reduce form, any better way to solve this?

8:01 raspasov: perplexa: just joined, what are you trying to achieve?

8:01 dnolen_: martinklepsch: you'll probably want to ask noprompt when he comes online

8:01 perplexa: raspasov: ##(reduce (fn [r v] (into r (clojure.string/split v #","))) [] ["1/a,1/b,2/c" "2/d,1/e,2/f"])

8:01 lazybot: ⇒ ["1/a" "1/b" "2/c" "2/d" "1/e" "2/f"]

8:01 martinklepsch: dnolen_: yup

8:01 perplexa: i wonder if it's possible to get {:1 ["a" "b"] :2 ["c" "d"]} with a single reduce form

8:03 dnolen_: ,(map #(clojure.string/split % "/") (mapcat #(clojure.string/split % #",") ["1/a,1/b,2/c" "2/d,1/e,2/f"]))

8:03 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>

8:03 dnolen_: ,(map #(clojure.string/split % #"/") (mapcat #(clojure.string/split % #",") ["1/a,1/b,2/c" "2/d,1/e,2/f"]))

8:03 clojurebot: (["1" "a"] ["1" "b"] ["2" "c"] ["2" "d"] ["1" "e"] ...)

8:04 dnolen_: ,(group-by first (map #(clojure.string/split % #"/") (mapcat #(clojure.string/split % #",") ["1/a,1/b,2/c" "2/d,1/e,2/f"])))

8:04 clojurebot: {"1" [["1" "a"] ["1" "b"] ["1" "e"]], "2" [["2" "c"] ["2" "d"] ["2" "f"]]}

8:04 perplexa: oh group-by ;o

8:04 nice

8:04 that's just what i am looking for, thx!

8:05 (inc dnolen_)

8:05 lazybot: ⇒ 5

8:05 dnolen_: ,(group-by first (mapcat #(clojure.string/split % #",") ["1/a,1/b,2/c" "2/d,1/e,2/f"]))

8:05 clojurebot: {\1 ["1/a" "1/b" "1/e"], \2 ["2/c" "2/d" "2/f"]}

8:05 perplexa: that's good enough! :) thx

8:18 RazWelles: Hey, I'm just starting with clojure, trying to load an assembly- I loaded an assembly successfully, created an instance of a class in it, but I can't access the methods- in C# it would be client.Network.Login(credentials) but clojure doesn't see network or login?

8:21 any idea how to a method that's nested like this.method.is.here()?

8:22 kungi: RazWelles: use (.. this method is here)?

8:22 RazWelles: kungi: I'll try that sec

8:26 kungi: malformed member exception :(

8:27 Here's an example of simple login in ironpython http://lib.openmetaverse.org/wiki/IronPython/Simple_Login

8:27 I'm just trying to translate that so I can get started x.x

8:28 dnolen_: RazWelles: gist/paste what you are trying

8:29 RazWelles: dnolen: ok sec

8:30 dnolen_: http://pastebin.com/YA7iSL43

8:31 dnolen_: RazWelles: this is ClojureCLR ?

8:31 RazWelles: dnolen_: yes

8:33 dnolen_: RazWelles: don't know it that well but try (.Login (. client Network) "User" "Name" "pass" "bot" "ver1")

8:33 RazWelles: the way you use .. def won't work, strings aren't methods/properties

8:35 RazWelles: dnolen_: should I be using defn?

8:35 seems it hung on that method approach

8:47 dnolen_: (. Login (.. client Network) "User" "Name" "pass" "bot" "ver") worked, thanks!

8:48 dnolen_: do you know a cleaner way I could maybe format that xD

8:59 dnolen_: RazWelles: (.. client Network (Login "User" "Name" "pass" "bot" "ver")) might work?

9:03 RazWelles: dnolen_: nope :(

9:03 wait, maybe..

9:03 forgo to close a paren

9:03 Yep!

9:03 dnolen_: it works :D

9:03 *forgot

9:04 dnolen_: RazWelles: cool

9:04 RazWelles: Is there a page I can read up on all these weird ways to call objects?

9:04 My google fu is poor tonight

9:05 ro_st: http://clojure.org/java_interop covers the basics

9:05 dnolen_: RazWelles: http://clojure.org/java_interop, should hold for ClojureCLR (and mostly true for ClojureScript as well)

9:05 RazWelles: thanks a bunch :)

9:07 Sorry one more question how do I get a script to drop into the repl after it completes running?

9:12 perplexa: when i need the forms (a) (b) and (c) to be executed in order, i use (do (a) (b) (c)), right?

9:12 ro_st: yes

9:12 perplexa: do i understand correctly that just calling something like (fn [] (a) (b) (c)) wouldn't ensure execution order?

9:13 ro_st: fns have an implicit do for their body

9:13 so, same as do

9:13 perplexa: oh

9:14 ro_st: `((fn [] (prn "a") (prn "b")))

9:14 that'd produce a then b

9:17 gfrederi`: I think the only order that isn't guaranteed is the evaluation order of arguments in function calls

9:17 stuartsierra: Function arguments evaluate left-to-right.

9:17 Bronsa: gfredericks: I don't think that's true

9:18 gfredericks: "Both the operator and the operands (if any) are evaluated, from left to right" http://clojure.org/evaluation

9:19 gfredericks: Bronsa: yeah I just found that

9:19 stuartsierra: Bronsa: thanks

9:20 looks like the same is documented for interop method calls

9:44 zot: top of the (morning|afternoon|whatever)! i feel like i saw a smarter way to do this someplace, but can't find it, and have no intuition on where else to look: (map #(identity {:foo %1 :bar %2 :baz %3}) foos bars bazs)

9:46 joegallo: minor tweak: #(hash-map :foo %1 ...)

9:46 but that's fundamentally the same

9:49 zot: i was thinking there was some clean way to avoid the #() lambda and instead zip in [:foo :bar :baz] as keys to the values coming from the RHS, but still uninspired :)

9:51 gfredericks: (map #(zipmap [:foo :bar :baz] %&) foos bars bazs)

9:52 zot: mmm, definitely going places with that :)

10:22 RazWelles: How do you assign an event handler without a delegate? (set! (.event (.. event object) function)?

10:33 perplexa: how do you call the combination of a namespace and function name in clojure? eg. clojure.string/split

10:33 like, not cal as in evaluate the symbol, but what name does it actually have?

10:34 Bronsa: perplexa: it's a namespace qualified symbol

10:34 dysfun_: "fully qualified"?

10:35 perplexa: Bronsa: thx; dysfun_: i thought that was a bit too generic ;x

10:43 m1dnight_: Is there any point in using (ensure) twice in a single transaction?

10:43 I'm guessing no, but i'm not sure

10:44 wombawomba: I need for some resources to be freed on exit. How do I make sure that this happens?

10:45 m1dnight_: Doesn't your GC do that for you?

10:45 Or do you mean threads or something?

10:46 wombawomba: the resources are not on my computer

10:46 I'm writing a distributed application

10:47 dysfun_: (-> Runtime/getRuntime (.addShutdownHook <thread-subclass>))

10:47 csd_: Is it possible to use the threading macro to thread execution through an if statement?

10:47 dysfun_: er, with another pair of parens

10:48 wombawomba: cool, thanks

10:48 dysfun_: csd_: you can trivially thread the condition

10:49 (-> true (if true false))

10:50 you can thrush the false case too (->> false (if true true)) is the equivalent

10:50 csd_: I'm basically threading an SQL statement and I want part of it to be conditonal using an if statement. So I've got (->> (select users (fields ...) (join ...) ... and then i'd like (if username .. (do x))

10:51 Balveda: I'm having a bit of a design issue.. I'm using Hoplon, but it's more of a Clojure-y thing

10:51 dysfun_: oh, you want to thread the middle item?

10:51 csd_: yes

10:51 Balveda: In a form, I have to have radio fields that when clicked yes, spawn a new field. It could be any kind of field depending on the question, or a group of fields

10:51 csd_: i want the threading to continue inside the if statement so that a where clause inside works

10:52 Balveda: And since I'm a bit of a neophyte I can't think of a language-y way to do it.

10:52 dysfun_: as-> ?

10:52 not quite what you want, but perhaps close enough

10:53 csd_: that might work, i've never used that before

10:53 dysfun_: or there's -<> in swiss-arrows

10:53 csd_: swiss-arrows?

10:55 dysfun_: https://github.com/rplevy/swiss-arrows/blob/master/src/swiss/arrows.clj#L34

10:55 Balveda: I mean, I'd rather create the fields I have to pass before-hand, then give them an ID internally, but how would I keep that persistant within the function and enable and disable them? With a let?

10:56 csd_: looks like a neat lib

10:56 dysfun_: Balveda: define 'persistent'

10:57 also this sounds more like a clojurescript question. is it?

10:59 Balveda: Hoplon more like, so kinda

11:00 greghendershott: Is there something like Racket's split in Clojure -- an efficient implementation of what conceptually is (defn split [pred coll] (list (take-while pred coll) (drop-while pred coll)) ?

11:01 dysfun_: split-by or split-with i think. check the cheatsheet

11:01 danneu: csd_: (as-> x _, (foo 1 _), (bar _ 1))

11:04 greghendershott: dysfun_: Ah, thanks. I need to add the cheatsheet to my list of docs at-hand.

11:11 squeedee: How do i write a lazy function for a sequence that does not require iteration? What i want is a function that knows the positional argument to a lazy sequence.

11:12 stuartsierra: greghendershott: Note: `split-with` traverses the "before" part of the sequence twice.

11:13 squeedee: eg if i do (nth my-seq 5) - i'd like the 5 dispatched to the my-seq function

11:14 joegallo: squeedee: want something else

11:15 squeedee: like?

11:16 I'm hoping to compose a dungeon map of curried functions describing rooms etc.

11:16 as an excercise..

11:17 I thought perhaps i could avoid building the entire map up front, and lazily evaluate when doing visibility checks.

11:17 greghendershott: stuartsierra: Yep, looks like its definition is the "conceptual" one I gave above.

11:18 (Well, except it returns a vector instead of a list, which is the more Clojure-ish thing to do. But I mean the traversal you mentioned.)

11:18 joegallo: well, seqs aren't functions of their positions arguments, so, well, don't do that.

11:20 squeedee: i guess just write a function that takes positional arguments and evaluate the content

11:20 then wrap that with a function which memoizes into a vac

11:21 so busy looking at the bark on trees I didnt step far enough back

11:21 s/vac/vec/

11:28 noprompt: dnolen_: are you sure you want me to move munge etc. in to util in the same patch as 871? that's a pretty loud commit. happy to do it if you're cool with that though.

11:35 dbasch: &(doseq [a [] b [] c [] d [] e [] f [] g [] h []])

11:35 ,(doseq [a [] b [] c [] d [] e [] f [] g [] h []])

11:35 clojurebot: #<CompilerException java.lang.RuntimeException: Method code too large!, compiling:(NO_SOURCE_PATH:0:0)>

11:35 lazybot: Execution Timed Out!

11:36 dbasch: ^ I checked via no.disassemble that the generated code doubles for every binding pair

11:36 ,(doseq [a [] b [] c [] d [] e [] f [] g [])

11:36 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

11:36 dbasch: ,(doseq [a [] b [] c [] d [] e [] f [] g []])

11:36 clojurebot: nil

11:37 dbasch: ^ that one is still under 64k

12:15 brianwong: i changed my 'map' to a 'reduce' because i wanted to accumulate some results

12:15 the function executed in the reduce has side-effects and the output to stdout is no longer appearing

12:15 is there another pattern i should be using?

12:15 joegallo: can you gist the relevant code?

12:18 brianwong: joegallo, nevermind, i realized i only had one item in my collection

12:18 and nothing was being called

12:18 thanks

12:19 is there another pattern i can use that acts like reduce but actually processes a collection with 1 item?

12:21 bbloom: brianwong: you need to give it an accumulator

12:21 ,(reduce (fn [acc x] (prn acc) (+ x acc)) (range 3))

12:21 clojurebot: 0\n1\n3

12:21 bbloom: ,(reduce (fn [acc x] (prn acc) (+ x acc)) 0 (range 3))

12:21 clojurebot: 0\n0\n1\n3

12:22 bbloom: ,(reduce (fn [acc x] (prn acc) (+ x acc)) [5])

12:22 clojurebot: 5

12:22 bbloom: ,(reduce (fn [acc x] (prn acc) (+ x acc)) 0 [5])

12:22 clojurebot: 0\n5

12:22 bbloom: brianwong: see?

12:23 brianwong: yes, the initial value. thanks bbloom

12:29 noncom: i know that java code can very easily be decompiled back into source. is the same true for clojure code?

12:29 how prone is clojure to decompiling ?

12:31 clgv: noncom: decompiling to java syntax is easy - but depending on the kind of implementation it is not necessarily easy to understand that result in java syntax ;)

12:32 noncom: you can try it yourself using luyten+procyon or jd-gui

12:33 noncom: clgv: but generally the hackers will have first to witness the clojure lisp-vm layer before they get to the actual program ?

12:33 and do i have to use gen-class for that ?

12:34 clgv: noncom: I do not understand that question. just AOT a project of yours and have a look at the decompiled result to judge yourself

12:34 noncom: okay, will try :)

12:36 clgv: noncom: if your project needs to be protected at all costs, you probably have to keep the money-making-bits on your company servers and use a service infrastructure to access them from client sides (or implement the whole thing as web ui)

12:37 noncom: clgv: i just need to make a client for a game.. some machinery inside it has to be protected so that hackers won't break it

12:37 originally it was in c++

12:37 but now i think about clojure...

12:37 and i wonder if it suits

12:40 clgv: noncom: those vm languages usually make it a bit easier to reverse engineering the programs compiled for them, since you do not have to start from assembler ...

12:41 noncom: clgv: yes, sure... so i wander if these languages, particulary clojure is acceptable for this task at all

12:42 clgv: noncom: well depending what exactly you need, even c/c++ might not be acceptable. skype encrypted large parts of its binary to protect its communication protocol but was hacked anyway after some time

12:44 noncom: you should specify your goals exactly and then go from there analyzing the available measures

13:04 TimMc: Ugh, the Clojure survey yet again fails to include "Emacs and lein repl" as a development environment option.

13:04 technomancy: TimMc: just put inf-lisp

13:05 basically the same thing

13:05 inf-lisp is basically just a dedicated shell that can't run anything but the repl (and has nice send-region/send-buffer bindings for free)

13:06 in fact, I can't think of any reason to use M-x shell over inf-lisp.

13:08 TimMc: But it's not the same! I keep my repl in a different window for a reason.

13:09 technomancy: inf-lisp is in its own window

13:11 TimMc: Do you mean "Emacs window" or do you mean "X window"?

13:11 clgv: TimMc: vote for a "other"-field with a free text entry ;)

13:12 technomancy: TimMc: emacs window

13:12 oh, you're not talking about M-x shell

13:12 TimMc: nope

13:12 literally `lein repl` in gnome-terminal or whatever it is

13:12 * technomancy raises an eyebrow

13:13 TimMc: I switch between my large monitor and my laptop (docking and undocking) so I don't always have room for a 3rd Emacs "window" (I usually have src adnd test buffers up at the same time); it's also easier to switch to the terminal window with M-tab than to muck about in Emacs and lose my layout.

13:14 technomancy: I think it's just C-z

13:14 to focus inf-lisp

13:14 or C-c C-z

13:14 TimMc: That's too many keys.

13:15 llasram: Then just map your foot pedals to the appropriate command

13:15 technomancy: hm; it is twice as many

13:15 TimMc: Anyway, I don't think this is so uncommon.

13:16 technomancy: from a tooling perspective though, it's basically the same

13:16 which is I think what the survey is getting at

13:17 llasram: TimMc: You don't use CIDER to connect to the REPL process you've spawned elsewhere?

13:17 TimMc: No, for reasons explained above.

13:18 llasram: Oops. Scroll-back failure

13:18 TimMc: Also, the last 3 times I tried cider, nrepl.el, or whatever it was a disaster.

13:18 * llasram implodes with embarrassment

13:18 technomancy: TimMc: you can get nice stuff like "load current namespace" without any fancy nreplisms though

13:19 not that you have to change what you do; just so you know

13:22 TimMc: I also like having fewer layers of tooling so that I can more quickly arrive at a diagnosis when shit gets weird.

13:22 technomancy: yeah, that's basically the whole point of inf-lisp. fewer moving parts; basically foolproof

13:23 Bronsa: TimMc: you could use emacsclient to have different X windows connecting to the same emacs instance

13:23 justin_smith: and it calls itself inferior, which is pretty punk rock

13:24 TimMc: Bronsa: Oh yeah, I've played with that in the past. Thanks for reminding me of it -- I may check it out again.

13:24 Bronsa: I have dozens of emacsclient windows open all the time

13:24 technomancy: "Also, Dude, inferior is not the preferred nomenclature. 'subprocess', please."

13:24 justin_smith: loser-lisp-mode

13:24 havenwood: as opposed to superior options like emojilisp?: http://emojilisp.com/

13:25 justin_smith: OK, their definition for cdr made me lol

13:26 havenwood: 🌜💿🌜🏢1 2 3 4 5🌛🌛 #=> 5

13:27 (apologies to folks with emoji-less irc clients)

13:36 amalloy: i remember someone in here (bbloom?) saying they use paredit successfully for non-lisp languages. a friend of mine is interested in trying it out for python; does anyone have recommended settings or other advice?

13:36 no, it can't be bbloom, he uses vim

13:36 bbloom: amalloy: also i dislike paredit

13:36 technomancy: amalloy: I use it

13:36 amalloy: the trick is you have to turn off the thing where an open-paren always inserts a space before it

13:37 amalloy: bbloom: there's a correlation between things you like and things i like, and it's a strong correlation, but it seems to be negative

13:37 technomancy: amalloy: (set (make-local-variable 'paredit-space-for-delimiter-predicates) '((lambda (endp delimiter) nil))) in a hook

13:37 bbloom: amalloy: you're bizarro brandon

13:38 amalloy: i like that better than me being bizarro amalloy

13:38 amalloy: you just like alliteration

13:38 bbloom: amalloy: you don't?

13:38 amalloy: you could be absurdo alan

13:38 bbloom: i like that.

13:38 amalloy: well, i don't. so there

13:38 bbloom: heh

13:39 technomancy: amalloy: it's not great, but it's better than no paredit

13:39 amalloy: thanks, technomancy. no other sage recommendations other than keyboard pants?

13:40 technomancy: amalloy: well... smartparens might be better for that. it takes a lot more config to get going, but it's supposedly more flexible than paredit.

13:40 the out-of-the-box experience with smartparens is dumb, but supposedly it can be turned into something decent

13:40 also works with HTML tags, which is cool

13:40 amalloy: technomancy: it's okay, he started the conversation by asking me about smartparens, then was as horrified as i am by its lax attitude to balance: "that's /why i use paredit/"

13:40 technomancy: heh, yeah

13:42 hiredman: I also tried smartparens then ran away screaming

13:52 dbasch: ,(doseq [a [] b [] c [] d [] e [] f [] g [] h []]) ; for those who missed it earlier

13:52 clojurebot: #<CompilerException java.lang.RuntimeException: Method code too large!, compiling:(NO_SOURCE_PATH:0:0)>

13:52 dbasch: exponential code explosion

13:53 justin_smith: fascinating

13:53 arrdem: hum... I'm gonna have to assemble that by hand later

13:54 dbasch: that's just 7 deep, right?

13:54 dbasch: arrdem: yes

13:54 arrdem: hum... I'd think that's doable

13:54 dbasch: ,(doseq [a [] b [] c [] d [] e [] f [] g []]) ; works

13:54 arrdem: some other time.

13:54 clojurebot: nil

13:54 dbasch: it’s under 64k

13:55 amalloy: dbasch: i remember someone having a related issue with a for-comprehension only three or four levels deep, the cause of which ended up being pretty funny

13:56 TimMc: ,(macroexpand-1 '(doseq [a [] b [] c [] d [] e [] f [] g [] h []]))

13:56 clojurebot: (clojure.core/loop [seq_2367 (clojure.core/seq []) chunk_2368 nil count_2369 ...] (if (clojure.core/< i_2370 count_2369) (clojure.core/let [a (.nth chunk_2368 i_2370)] (clojure.core/loop [seq_2879 (clojure.core/seq []) chunk_2880 nil count_2881 ...] (if (clojure.core/< i_2882 count_2881) (clojure.core/let [b (.nth chunk_2880 i_2882)] (clojure.core/loop [seq_3135 (clojure.core/seq []) chunk_3136 ni...

13:56 amalloy: it worked for everyone else, but for this one guy (for [x xs, y x, z y, a z] ...) failed compile, because of an IOException!

13:56 "file name too long"

13:57 perplexa: Throwable. vs Exception. - which do people use and why?

13:57 amalloy: it turned out that my.ns$foo$for__123$fn__124$iter__125$fn__126$iter_127... was a really long name for a .class file, and his encrypted filesystem made it twice as long as for everyone else

13:59 TimMc: Huh, do you recall what fs that was?

13:59 amalloy: TimMc: i think it was whatever ubuntu used to encrypt your home directory, if you turn that option on

13:59 probably truecrypt

14:00 but i could be wrong/misremembering

14:00 TimMc: Nah, the home dir encryption isn't truecrypt.

14:00 dbasch: both Throwable and Exception are subclasses of Googleable :P

14:00 Bronsa: should be ecryptfs

14:01 amalloy: sure, that sounds right

14:01 dbasch: perplexa: Throwable is the superclass of Error and Exception

14:02 justin_smith: perplexa: general idea is that Exceptions are things that you should try to deal with and keep going at runtime, Errors are things that should blow up and stop

14:02 perplexa: ty

14:02 ;p

14:03 justin_smith: user did something unexpected vs. code did something unexpected - deal with the former, bail on the latter

14:03 amalloy: oh my gosh. how embarrassing, my memory has betrayed me. found the logs, and the poor chump who had encrypted his home directory so that he couldn't compile his code was me

14:04 TimMc: hah!

14:04 whoa, does that show up as underlined for anyone else?

14:04 justin_smith: what underlined?

14:05 TimMc: what the hell did I type

14:05 amalloy: i can't actually find the log of my asking the question, but if you search for "IOException" in http://logs.lazybot.org/irc.freenode.net/%23clojure/2012-08-10.txt you can see me talking about it

14:05 justin_smith: TimMc: I guess that means no, I did not see it

14:05 TimMc: OK, freaky.

14:06 jcromartie: is there any way to jump to the source code for a namespace in Cider?

14:07 Bronsa: amalloy: I'm confused. it seems to me that solussd is the one asking about it

14:07 justin_smith: jcromartie: should be M-.

14:07 jcromartie: i.e. I want to be able to specify foo.bar.bat and then visit ~/projects/whatever/src/foo/bar/bat.clj

14:07 justin_smith: oh, that's different

14:07 jcromartie: actually that works for namespaces!

14:07 but I have to have the text there

14:08 amalloy: Bronsa: he is; i tell him it happened to me once

14:08 jcromartie: I can easily make that a command

14:08 that accepts the namespace

14:08 amalloy: i guess that's several lines later

14:08 Bronsa: amalloy: ah, ok. didn't get to that point in the log

14:08 amalloy: i didn't realize it was so much later or i'd have given a better C-f point

14:08 dbasch: amalloy: don’t worry, ∀person, ∃t ∈time such that is-chump(person, t) is true

14:09 Bronsa: amalloy: it wasn't that much later actually, I just stopped reading.

14:09 amalloy: (inc dbasch)

14:09 lazybot: ⇒ 13

14:10 magopian: i have several questions regarding the om basic tutorial, several concepts i don't understand and don't know where to look for

14:11 starting with om.core/value: what is it? what does it do? from the source code, it seems it's just returning (-value cursor) on the given cursor, which isn't of much help :/

14:12 (isn't of much help regarding me understand what it's doing)

14:14 jcromartie: huh... cider-jump is supposed to ask if there's no symbol at the point but it doesn't

14:20 dnolen_: magopian: it returns the cursor's cached value - don't use it unless you understand why you might need it. Deref is probably what you want.

14:27 jcromartie: gr

14:27 I updated cider, now cider-jack-in fails because 'The lein executable (specified by `cider-lein-command') isn't on your exec-path"

14:27 that seems like a regression

14:28 justin_smith: we should add a "it has been X hours since the last cider regression" segment to the topic line

14:29 jcromartie: could it be caused by leftover elc files from the old cider libs?

14:29 jcromartie: maybe

14:29 I'll clear it out and install fresh

14:33 Bronsa: hiredman: did you notice that I closed CLJ-1503? Maybe your comment would be more useful on CLJ-1425

14:33 llasram: Isn't The Real Problem (tm) MELPA and not CIDER?

14:33 I recently upgraded CIDER from the last stable release on marmalade to the stable release on melpa-stable, and everything went fine

14:36 hiredman: Bronsa: oh, I did not

14:38 added with a link to the wiki

14:39 magopian: dnolen_: thanks for your answer. So i should rather use @text instead of (om/value text) ?

14:39 (there's om/value in a few places in the basic tutorial)

14:39 dnolen_: magopian: the former will give you the most recent value, om/value is likely to be stale

14:39 magopian: feel free to update the tutorial - only so many hours in my day :)

14:40 magopian: yeah, sure ;) i'll push a PR soon then ;)

14:40 dnolen_: magopian: anybody can update the wiki, no PRs needed, Om doesn't take PRs

14:40 yet anyway

14:40 magopian: ah, it's a wiki, sure

14:40 Bronsa: hiredman: I honestly still think that the current behaviour is wrong but I no longer think that the benefit of a more correct impl outweights the cost of complicating the reader

14:41 magopian: dnolen_: thanks for answering, thanks for your time ;)

14:41 i'm also wondering what all this ICloneable stuff is, i can't understand exactly what is the issue, and what's the correct way of doing it

14:41 in the intermediate tutorial, it seems the value is taken from datomic instead (and then pushed back in there)

14:41 hiredman: Bronsa: we need staff philosphers to argue these things

14:42 magopian: how does that make a change?

14:42 hiredman: is it really a map literal if it allows for duplicate entries but maps do not?

14:42 what does it mean to be a literal?

14:42 Bronsa: hiredman: `#{} doesn't expand to a map literal though

14:44 hiredman: Bronsa: sure, but maybe it should

14:44 but it can't because of splicing

14:44 but maybe there should be some kind of splicing set type or something

14:45 magopian: dnolen_: btw, what if I update the wiki with wrong information? i'm only a newbie :/

14:45 hiredman: I actually pulled your ticket as an example of the complications from map literals in another conversation I was having

14:45 Bronsa: hiredman: it doesn't seem controversial to me that #{(gensym) (gensym)} should work. The fact that it doesn't is just because of the impl detail that the clojure compiler uses a reader rather than a simpler parser

14:46 hiredman: Bronsa: I don't think that is an implementation detail

14:46 a set literal should be a set when it exits the reader, no?

14:47 and a lisp has got to have a reader

14:48 gfredericks: ,(read-string "#{(gensym) (gensym)}"

14:48 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

14:48 gfredericks: ,(read-string "#{(gensym) (gensym)}")

14:48 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (gensym)>

14:48 gfredericks: Bronsa: ^ what should that do?

14:48 hiredman: so pre what version of clojure it changed in, #{(gensym} (gensym)} would read fine, but people complained about it, which is why it throws now

14:49 gfredericks: it would read into a single-element set?

14:49 Bronsa: gfredericks: yeah I'm not arguing the reader should change its behaviour

14:50 hiredman: in my other conversation I was saying you could build some kind of perpetual motion machine from this as opinion oscillates

14:50 Bronsa: hiredman: that used to return #{(gensym)} though, which is even more worse than throwing

14:50 hiredman: Bronsa: are you sure about that?

14:51 the array based collections would actually allow duplicates

14:51 Bronsa: really?

14:51 hiredman: (from what I recall)

14:51 I may be wrong as you well know

14:51 Bronsa: ,(array-map 1 1 1 1)

14:51 clojurebot: {1 1}

14:51 Bronsa: unless the internal impl changed I don't think it ever did allow that

14:51 AeroNotix: ,#{(gensym) (gensym)}

14:51 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (gensym)>

14:51 AeroNotix: that's retarded

14:52 Bronsa: AeroNotix: I wouldn't go that far as to call it retarded, definitely counterintuitive for some, but OTOH for others a different behaviour would be just as counterintuitive

14:52 hiredman: in 1.1.0 at least it did

14:52 I just checked

14:53 AeroNotix: Bronsa: what about #{(rand) (rand)}

14:53 Bronsa: AeroNotix: that's the same thing

14:53 hiredman: https://gist.github.com/hiredman/c6cdb5fdd77ed13335cc

14:53 amalloy: Bronsa: well, almost the same thing, in that you might by luck end up with a collision

14:53 hiredman: so maybe it was in 1.2 that the behaviour changed

14:53 Bronsa: TIL

14:53 AeroNotix: Bronsa: exactly, but you wouldn't argue that someone would expect a set of two

14:53 jcromartie: aghghghhghghghgh

14:53 AeroNotix: someone wouldn't*

14:54 surely

14:54 jcromartie: I've nuked my emacs packages, switched to melpa-stable, reinstalled cider etc.

14:54 AeroNotix: ,#{(rand) (rand)}

14:54 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (rand)>

14:54 AeroNotix: so dumn

14:54 jcromartie: and it still complains about the exec-path

14:54 AeroNotix: dumb

14:54 Bronsa: amalloy: well sure :)

14:54 technomancy: jcromartie: what does M-x shell-command which lein show?

14:54 hiredman: it was one way, people didn't like it and argued it should be another way, after some time some other people didn't like it that way and argued it should go back to the first way

14:55 AeroNotix: hiredman: can't please everyone I guess.

14:55 hiredman: perpetual motion guys

14:55 amalloy: AeroNotix: i can't not fail to misunderstand the convoluted inversions and subjunctives in your "wouldn't argue" claim

14:55 jcromartie: it says "/bin/bash: lein: command not found"

14:55 Bronsa: (inc amalloy)

14:55 lazybot: ⇒ 174

14:55 AeroNotix: amalloy: don't not try to misunderstand it then

14:55 technomancy: jcromartie: so... that's a problem =)

14:56 jcromartie: it's at /usr/local/bin/lein

14:56 and /usr/local/bin is added to my exec-path

14:56 technomancy: jcromartie: apparently it's not

14:56 jcromartie: shouldn't this just work like it did for a very long time?

14:57 I'm a little confused as to why it stopped with a supposedly "stable" Cider

14:57 amalloy: $echo hello ## my favorite multiple inversion

14:57 $shell echo hello

14:57 lazybot: amalloy: It is not the case that you don't not unhave insufficient privileges to do this.

14:57 amalloy: silly me

14:57 technomancy: jcromartie: not a lot emacs can do if you give it the wrong path though

14:57 jcromartie: well it complained before I set up the exec-path

14:57 I mean

14:57 it worked before I updated Cider

14:57 then I updated Cider and it stopped working

14:57 then I tried to set up my exec-path

14:58 and that doesn't change the situation

14:58 so, updating cider broke cider-jack-in

14:58 justin_smith: jcromartie: which cider version?

14:58 jcromartie: I never set exec-path before

14:58 technomancy: the real problem is that lein isn't on your $PATH

14:58 jcromartie: 0.7.0

14:59 technomancy: what version of cider you're using isn't going to affect that

14:59 jcromartie: why did it work with a previous version of Cider, then?

14:59 seriously, I was using Cider this morning

14:59 now I'm not

15:00 technomancy: did you launch emacs the same way?

15:00 justin_smith: jcromartie: is this in osx?

15:00 hiredman: technomancy: it does

15:00 technomancy: maybe it inherited an environment that had the correct $PATH

15:00 jcromartie: yes

15:00 I launched Emacs the same way before and after

15:00 (from Alfred)

15:00 justin_smith: jcromartie: in osx, things launched bia the GUI do not get the path set up in your shell

15:00 technomancy: what's Alfred?

15:00 hiredman: technomancy: newer versions of cider look for lein in some exec-path thing, which may or may not be the same as your PATH

15:00 jcromartie: right

15:00 technomancy: did it change?

15:00 jcromartie: I understand

15:00 justin_smith: jcromartie: there is a way to set it system wide, or you can launch emacs from a shell

15:00 jcromartie: either of those will fix it

15:00 gfredericks: what on earth does this do? https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/main.clj#L379

15:00 technomancy: hiredman: exec-path is just unix $PATH turned into a lisp

15:01 *turned into a list

15:01 hiredman: technomancy: it wasn't on my linux laptop

15:01 technomancy: hiredman: other things can manipulate the list of course

15:01 hiredman: technomancy: dunno why, but even when lein was in my path, and I could execute lein from emacs, cider refused to launch it until I put ~/bin in my exec-path

15:02 justin_smith: jcromartie: you can also manually add things to the emacs exec-path, that's a third option

15:02 jcromartie: I did!

15:02 (add-to-list 'exec-path "/usr/local/bin")

15:02 technomancy: hiredman: probably you were setting your path in .bashrc or something, which didn't affect the GUI you used to launch emacs

15:02 justin_smith: OK, weird

15:02 technomancy: it's a common mistake

15:03 hiredman: technomancy: I used dmenu

15:03 technomancy: hiredman: but dmenu on its own won't source .bashrc

15:03 jcromartie: its value is ("/usr/local/bin" "/usr/bin" "/bin" "/usr/sbin" "/sbin" "/Applications/Emacs.app/Contents/MacOS/libexec" "/Applications/Emacs.app/Contents/MacOS/bin")

15:03 justin_smith: hiredman: OK, so it does sound like a cider problem then

15:03 jcromartie: and /usr/local/bin/lein is the lein executable

15:04 not a symlink or anything weird

15:04 hiredman: *shrug*

15:05 technomancy: it usually comes down to people conflating .bashrc and environment variables in general

15:05 .bashrc is a specific configuration file for bash, so it shouldn't be surprising that not-bash doesn't use it

15:06 .profile is a more general-purpose thing

15:06 clj-learner: Hi, i'm learning macros and i'm stuck. why doesnt this work?

15:06 (defmacro chain [& forms]

15:06 (when forms

15:06 `(chain (. (first ~forms) (second ~forms)) ~@(drop 2 forms))))

15:06 jcromartie: I set cider-lein-command to /usr/local/bin/lein and that seems to work

15:06 technomancy: but even then some guis like mac os x's will ignore it and force you to edit some xml file nonsense

15:06 gfredericks: clj-learner: what do you get when you macroexpand, and what would you like to get?

15:07 clj-learner: stackoverflowerror

15:07 hiredman: technomancy: anyway, my point is, the version of cider does matter unfortunately

15:07 clj-learner: i would like it to stop

15:07 at the ebnd

15:07 end

15:07 gfredericks: clj-learner: ##(drop 2 '(foo bar))

15:07 lazybot: ⇒ ()

15:08 hiredman: ,(when () 1)

15:08 clojurebot: 1

15:08 hiredman: ,(when (seq ()) 1)

15:08 clojurebot: nil

15:08 gfredericks: ,(doc nnext)

15:08 clojurebot: "([x]); Same as (next (next x))"

15:08 hiredman: then what gfredericks said

15:08 clj-learner: i tried nnext but i got the same

15:08 hiredman: ,(when () 1)

15:08 clojurebot: 1

15:08 gfredericks: ,(nnext '(1 2))

15:08 hiredman: ,(when (seq ()) 1)

15:08 clojurebot: nil

15:08 nil

15:09 jcromartie: WARNING: CIDER's version (0.7.0) does not match cider-nrepl's version (not installed)

15:09 cider-nrepl is not in melpa-stable...?

15:10 gfredericks: clj-learner: oh it's also how you're doing your recursion exactly

15:10 clj-learner: if you did a (prn forms) outside your `when` for debugging I think it'd be obvious

15:10 justin_smith: jcromartie: cider-nrepl is a clojure lib, not an emacs one

15:11 jcromartie: goes in your :dev section of profiles.clj

15:11 jcromartie: I don't even have it there

15:11 justin_smith: you need to create it then ~/.lein/profiles.clj

15:12 clj-learner: this is the exercise solution

15:12 (defmacro chain

15:12 ([x form] `(. ~x ~form))

15:12 ([x form & more] `(chain (. ~x ~form) ~@more)))

15:12 but do i have to use multiarities ?

15:13 jcromartie: I'm reading TFM right now :)

15:16 perplexa: is there something like a callable? form?

15:16 eg. (callable? #'clojure.core/defn) => true

15:16 Bronsa: perplexa: you might be looking for `ifn?`

15:16 perplexa: ah yeah

15:16 thx :D

15:17 justin_smith: ,(ifn? 'a)

15:17 clojurebot: true

15:17 jcromartie: *sigh*

15:17 technomancy: hiredman: hm; cider may include a workaround for the problem

15:17 jcromartie: error in process filter: Symbol's value as variable is void: results

15:17 what the heck did I do

15:17 why did I try to fix what wasn't broke

15:18 technomancy: IMO it's better to just fix your PATH though; that way it shouldn't matter

15:18 gfredericks: clj-learner: you don't *have* to -- you at least have to check how many args you have

15:18 one way or another

15:18 jcromartie: I got cider-jack-in working now

15:18 but it's just problem after problem

15:18 dopamean_: does anyone know of a good resource for implementing a BST in clojure?

15:18 jcromartie: what's the best way to uninstall ELPA packages?

15:19 hiredman: technomancy: if anything cider makes whatever problems exist worse as per usual

15:22 gfredericks: clojurebot: hiredman |does not like| cider

15:22 clojurebot: c'est bon!

15:26 atyz: ,docs ..

15:26 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: docs in this context, compiling:(NO_SOURCE_PATH:0:0)>

15:26 jcromartie: can someone with a great working Cider setup share their .emacs?

15:26 justin_smith: (doc ..)

15:26 clojurebot: "([x form] [x form & more]); form => fieldName-symbol or (instanceMethodName-symbol args*) Expands into a member access (.) of the first member on the first argument, followed by the next member on the result, etc. For instance: (.. System (getProperties) (get \"os.name\")) expands to: (. (. System (getProperties)) (get \"os.name\")) but is easier to write, read, and understand."

15:27 atyz: thanks justin_smith

15:27 Is there somewhere I can get a link to that?

15:28 justin_smith: atyz: http://grimoire.arrdem.com/

15:28 has examples and lists functions by category, very handy

15:29 atyz: justin_smith: thats awesome, finding any of the macros are usually a pain

15:29 gfredericks: justin_smith: github.com/gfredericks/dotfiles

15:30 justin_smith: gfredericks: you probably meant to point that at jcromartie

15:30 gfredericks: I haven't pegged my emacs lib versions yet though

15:30 what? there are two people whose nicks start with j???

15:30 lazybot: gfredericks: Oh, absolutely.

15:30 gfredericks: crap.

15:30 technomancy: are there any languages that use "ibid" as *1?

15:31 jcromartie: I'm just using cider 0.6 from a checkout

15:31 works fine, provided lein is correctly installed

15:32 gfredericks: someday soon I am going to use el-get and presumably that will be better

15:33 justin_smith: technomancy: (conor .... (sic ...)) is the new try/catch

15:33 technomancy: yes please

15:33 justin_smith: I mean if erlang can use commas and periods, why not?

15:34 justin_smith: if we use more latin, we can make clojure seem much more sophisticated and mature

15:40 gfredericks: jcromartie: I'm on cider 0.7.0 FWIW

15:49 shem: bernie greenberg, the multics kernel lisper, used latin in error strings and comments

15:50 "hodie natus est radici frater"

15:52 justin_smith: http://www.multicians.org/hodie-natus-est.html

15:55 shem: i had some correspondence with bernie in the 90s. really funny, nice guy

15:59 jcromartie: so the new testing support in Cider really changes the workings of C-c , huh

15:59 since I don't name my test namespaces like foo.bar-test, I'm just out of luck

16:00 instead I name them foo.test.bar

16:03 aztak: gd'evening

16:06 TimMc: shem: I had the pleasure of working with him a couple years ago.

16:09 shem: TimMc: wow. must have been fun.

16:11 technomancy: greenberg from Hackers?

16:13 michaelr524: Hello

16:13 technomancy: oh, thatwas greenblatt

16:13 michaelr524: Who are the intellij users in here?

16:13 I'm looking for the parallel from emacs for Meta-Space and Meta-\

16:14 For condensing whitespace to one or zero spaces respectively

16:17 TimMc: shem: It was a bit hard to keep up with him in conversation. :-)

16:22 shem: TimMc: i can imagine… :)

16:27 terom: michaelr524: I think not. There is "Join lines" which performs something similar and then it seems that there is some plugin that provides at least just-one-space: https://plugins.jetbrains.com/plugin/7163?pr=phpStorm

16:30 *think there's no such thing, I mean

16:34 aztak: so, (assert ..) fails with an AssertionError... which is not an Exception. Took me some time to discover why my Ring exception logging middleware never got 'used'. Ouch.

16:36 stuartsierra: If you're going to log it, catch `Throwable`

16:36 aztak: stuartsierra: yeah, that's what I discovered. :)

16:37 michaelr524: terom: 10x

16:37 ghadisha`: i wrote a macro that works like assert but throws ex-info rather than AssertionError

17:17 perplexa: is there a way to expand macro use in function bodies? something like (macroexpand-all (source fn)) where fn itself is not a macro?

17:19 amalloy: perplexa: what on earth would that do?

17:20 perplexa: amalloy: just curious what a function using the thread-last macro would expand to ;p

17:23 amalloy: perplexa: slime includes a macroexpansion facility; nrepl may too, for all i know

17:23 if so, you can M-. to the source of the function, point at the macro confusing you, and ask to macroexpand it

17:24 justin_smith: perplexa: well, fn is a macro, so you can expand it ##(:macro (meta #'fn))

17:24 lazybot: ⇒ true

17:24 amalloy: justin_smith: fn was a metasyntactic variable in perplexa's question, not referring to c.c/fn

17:25 justin_smith: OK

17:30 perplexa: oh i just realised that i can paste the function after (macroexpand-all ' in nrepl

17:30 * perplexa facepalms

17:31 justin_smith: perplexa: that's what I was getting at with the "fn is a macro you can expand it" thing

17:31 perplexa: i thought it was not possible, because i tried it at some point earlier, but must have pasted a syntax error ;x

17:38 borkdude: cfleming I'm trying to use core.typed for cljs in cursive, I don't get it to work right now

17:39 cfleming it seems to want to compile a cljs as a clj file

17:43 cfleming: borkdude: Yes, I haven't added that support yet since it seems to be experimental in core.typed.

17:43 borkdude: cfleming I guess it would make sense to not "type check current ns" but just the whole project without having to have a repl and get red curlies everywhere core.typed found an error

17:43 cfleming I got a cljs type error via the typed plugin

17:44 cfleming: borkdude: Does that type check the whole project at once? I guess you can't type check a cljs ns in the REPL?

17:47 borkdude: cfleming I don't know why core.typed checking is coupled to having a REPL

17:47 cfleming could just call this in the background : https://github.com/clojure/core.typed/blob/master/module-rt/src/main/clojure/cljs/core/typed.clj#L265

17:48 cfleming: borkdude: I could, but I have to be careful about loading a bunch of stuff into the IntelliJ process. I could spin up a transparent external process though.

17:49 borkdude: cfleming that is why it's coupled to a repl now?

17:51 cfleming: borkdude: Yes, and also that I based this integration on the existing plugins.

17:53 borkdude: cfleming ok, I'm able to call cljs.core.typed/check-ns* from the REPL and see the output of the type errors. I guess it would be possible to use that

17:53 cfleming https://www.dropbox.com/s/t3bn2gsyu95bct1/Screenshot%202014-10-14%2023.53.49.png?dl=0

17:55 cfleming so maybe: when you have a REPL, offer to typecheck whatever namespace, could be an option

17:56 cfleming: borkdude: Is there a cljs.core.typed/check-ns-info that returns a map?

17:56 borkdude: c-n-i is what Cursive used for Clojure, it's quite a new API though so I'm not sure it's made it to CLJS

17:57 borkdude: cfleming https://www.dropbox.com/s/i6oohpt6dhbus7p/Screenshot%202014-10-14%2023.56.52.png?dl=0

17:57 fbob: Hi. I am updating an atom holding a Map. I am using (get map key else), where else is something that will update the Map if the key doesn't exist. Since else has side effects, I was wondering what is the most idiomatic way to do this?

17:57 cfleming: borkdude: Thanks, looks promising.

17:58 borkdude: I'll see about getting that in there.

17:58 amalloy: fbob: else will be evaluated whether or not the key is in the map

17:58 get is a function, and that is just how functions work: all of their arguments are evaluated

17:59 fbob: amontalenti: I see. I didn't realise. Maybe I should use a let binding somehow?

17:59 Oops, amalloy

17:59 amalloy: boy, amontalenti has a way cooler last name than i do

18:00 it depends a bit on what you want to do, fbob, but if you want a combined get-and-modify kind of operation, you are looking for swap!

18:00 borkdude: cfleming would be cool

18:01 fbob: amalloy: I just want to update the map if they key doesn't exist in the map

18:01 noonian: fbob: you want swap!

18:01 fbob: I decided I wasn't going to do it inside the function of swap!, maybe I was wrong

18:02 noonian: ,(swap {:foo 17} (fn [the-map] (if (:non-existent the-map) (assoc the-map :non-existent :bar))))

18:02 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: swap in this context, compiling:(NO_SOURCE_PATH:0:0)>

18:02 amalloy: fbob: any time you do something to an atom which is not inside a swap!, you are generally wrong

18:02 noonian: ,(swap! {:foo 17} (fn [the-map] (if (:non-existent the-map) (assoc the-map :non-existent :bar))))

18:02 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.Atom>

18:02 noonian: ,(swap! (atom {:foo 17}) (fn [the-map] (if (:non-existent the-map) (assoc the-map :non-existent :bar))))

18:02 clojurebot: nil

18:02 noonian: doh

18:03 fbob: amalloy: Thanks for the advice!

18:03 amalloy: the exception is if you just read it with deref, and then don't use that information to decide how to modify the atom: that's okay to do outside of swap

18:03 noonian: do it in the else

18:03 fbob: Is if else lazy then?

18:03 noonian: ,(swap! (atom {:foo 17}) (fn [the-map] (if (:non-existent the-map) the-map (assoc the-map :non-existent :bar))))

18:03 clojurebot: {:non-existent :bar, :foo 17}

18:04 noonian: fbob: the else you supply to get is not called with the map as an argument, it is just returned instead of nil if the key does not exist in the map

18:06 fbob: noonian: I don't think I understand

18:08 noonian: fbob: in your original question you were trying (get map key else), with else being a function, but the way get works is that the value of else will just be returned

18:09 fbob: noonian: I thought else would be evaluated on call

18:10 What gives this away in the api, is it the question mark?

18:10 noonian: fbob: yes, the expression there will be evaluated before get gets called

18:10 ,(doc get)

18:10 clojurebot: "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

18:10 noonian: fbob: which question mark?

18:11 fbob: For if

18:11 Not get

18:11 noonian: ah, my bad I thought you were asking about the behavior of else in get

18:11 fbob: Well, I kind of am asking both

18:11 That's why I was asking is it lazy in if, which it seems to be

18:12 noonian: if is not a function, its a macro, so if receives its arguments unevaluated

18:12 it evaluates the test, then the appropriate branch and not the other one

18:13 amalloy: noonian: if isn't a macro, it's a special form

18:13 noonian: yes

18:14 dav_: Anyone knows if there is any standard "protocol" that REPLs / debuggers / static code anilyzers can follow to work with a large number of editors without requiring implementing n * m combinations?

18:14 amalloy: dav_: that's what nrepl is supposed to be

18:14 dav_: amalloy: does any other language use that?

18:15 amalloy: oh man. you want a language-universal toolkit? good luck. i am not aware of any such thing

18:15 the landscape is littered with the bones of those who have tried

18:15 dav_: amalloy: well if there are n languages and m editors, it'd be nice to have support for the n * m combos without having to do the work in that order..

18:16 wouldn't be a toolkit per say

18:16 just a communication protocol

18:16 technomancy: technically you could write an nrepl server in any language

18:17 dav_: the repl is probably the simplest part

18:17 static code analysis requires a bit more communication

18:17 noonian: amalloy: often if is a macro for cond but clojure is the other way around i guess

18:17 technomancy: dav_: you can invoke all kinds of commands over an nrepl connection

18:17 amalloy: noonian: yeah, indeed it is often the other way around

18:17 technomancy: dav_: http://p.hagelb.org/clojurewest-2014.org.html

18:17 dav_: technomancy: yes as I said the repl is the simplest protocol..

18:18 technomancy: interesting post

18:19 technomancy: dav_: it's just a proof of concept, but you could go a lot further with the idea

18:20 noonian: dav_: you can use emacs for all the languages except apple's pretty much hehe

18:20 dav_: noonian: that's the thing, I don't know emacs.

18:21 noonian: yeah, its definitely a learning curve. I've only been using it for a few months now

18:22 dav_: noonian: I've been using vim for 15 years, gonna be hard to change for me at this point..

18:22 justin_smith: noonian: learning spiral :)

18:22 dav_: have you tried evil mode at all?

18:22 dav_: justin_smith: I have, couldn't get used to it

18:22 justin_smith: my intro to emacs over a decade ago was viper mode

18:23 a predecessor to evil

18:23 the keybindings are not the good part of emacs, so keeping most of your vi keybindings is fine imho

18:24 dav_: to be fair, I think we focus too much on "text manipulation" and not enough on "coding features"

18:24 talios: emacs existed before evil? so thats.... pre-fall. I always knew emacs was Gods preferred editor.

18:24 dav_: ultimately, the latter should be quite standard across editors

18:24 hence my thought that an IDE "protocol" should be put in place

18:24 given the rate at which languages come out

18:24 and the number of editors

18:25 technomancy: vim works fine with nrepl

18:25 metellus: <insert xkcd about creating new standards>

18:28 dav_: metellus: the created freedesktop..

18:28 *they

18:28 not sure why we couldn't have freeide

18:28 unlike the xkcd standard joke, sounds like it would be the first attemt..

18:28 metellus: creating standards is easy, getting people to centralize on one is hard

18:28 dav_: metellus: sure, happens over time

18:28 technomancy: dav_: why make something new when the tooling already exists?

18:29 dav_: technomancy: the tooling exists for one feature, one language

18:29 metellus: dav_: every editor has its own set of ide features and things right now, and those are the existing "standards"

18:29 technomancy: dav_: two languages, N features

18:29 dav_: technomancy: repl is 1 feature

18:29 technomancy: dav_: I have it working for arbitrary features

18:30 toggle-trace, slamhound, test, etc

18:30 dav_: technomancy: completion, code analysis

18:30 technomancy: dav_: completion is already implemented, type checking is a small leap

18:31 dav_: technomancy: the 2nd language is.. clojurescript?

18:31 technomancy: docstring lookup, javadoc, inspect

18:31 yeah

18:31 I bet I could write a racket backend in a weekend

18:31 (but I wouldn't, because the existing racket tools are already a lot better)

18:32 dav_: is there a standard way to communicate back to the editor? on this file at that line/colum, add this warning, etc.

18:32 a way that all editors know how to use?

18:33 s/all/most?

18:33 s/most/a few of the major ones

18:33 technomancy: I have a sketch of a protocol and a proof-of-concept implementation for emacs

18:33 the emacs implementation was ~2 evenings of hacking to write

18:33 dav_: cool, it's the beginning of the freeide protocol :)

18:34 i'll have a closer look at nrepl

18:34 justin_smith: technomancy: "Well, I certainly applaud anyone wanting to make a racket backend in a weekend, but take it from an old tooling rat, I've spent my entire adult life hacking codez, and a program like this can do more harm than good..."

18:34 dav_: going to bed now, night.

18:35 technomancy: justin_smith: actually with racket people are disincentivized to do stuff like that just because drracket is so far ahead of everything else

18:36 justin_smith: technomancy: sorry, referencing an obscure old meme

18:37 http://www.escapistmagazine.com/forums/read/18.204104-100-push-ups-200-sit-ups

18:40 * technomancy is insufficiently memed

18:41 justin_smith: you're better off for it

18:42 gzmask: playing with literature programming with marginalia... how do you keep the flow of writing yet not having to follow the dependency orders forced by compiler?

18:43 justin_smith: gzmask: liberal use of declare?

18:44 gzmask: justin_smith: thought of that, any other ways?

18:44 justin_smith: not that I know of, I think literate programming setups are pretty linear

18:45 gzmask: I know man ... but they are so good when you are trying to fill a 50 pages thesis and want to spend all the time coding ...

18:46 amalloy: gzmask: is it so much harder to write the narrative in compiler order?

18:47 gzmask: I don't know others. I already find my original function too big, then have to break it into little ones

18:47 always*

18:48 afhammad: why is it necessary to define functions in order?

18:49 gzmask: compiler would complain. but there is declare ...

18:49 justin_smith: afhammad: that's a restriction of the clojure compiler

18:50 afhammad: it did complain, thats why I ask :)

18:50 dbasch: some people prefer Memento-style coding

18:50 gzmask: I think the order thing makes clojure performance more predictable. I like it

18:51 justin_smith: also it makes files and the repl compatible

18:51 dbasch: I’ve got this error condition…

18:51 technomancy: helps you spot typos, theoretically

19:02 mdeboard: Hi, I want to do something like (zipmap [:col :row] [(range 6) (range 6)]), but such that it yields a vector of {:col x :row y} maps

19:02 How would I do this

19:03 This is kinda it:

19:03 &(map #(zipmap [:col :row] [% %2]) (range 6) (range 6))

19:03 lazybot: ⇒ ({:row 0, :col 0} {:row 1, :col 1} {:row 2, :col 2} {:row 3, :col 3} {:row 4, :col 4} {:row 5, :col 5})

19:04 mdeboard: but It should yield 36 entries

19:04 justin_smith: mdeboard: for?

19:05 mdeboard: yeah I reckon a for loop would work

19:05 justin_smith: ,(for [col (range 6) row (range 6)] {:col col :row row})

19:05 mdeboard: but I figured there is some incantation

19:05 clojurebot: ({:col 0, :row 0} {:col 0, :row 1} {:col 0, :row 2} {:col 0, :row 3} {:col 0, :row 4} ...)

19:05 mdeboard: nailed it

19:05 thanks

19:05 justin_smith: btw, pedantically, it's not a for loop

19:05 for is a lazy list comprehension

19:06 mdeboard: noted

19:06 justin_smith: it's an unfortunate name, since for is a loop in most languages

19:06 amalloy: justin_smith: how about python, where there are two fors, one a loop and one a comprehension?

19:07 justin_smith: sadly, I know no python, 'tis my achilles heel

19:08 amalloy: or scala, where it's a monadic comprehension. haskell doesn't really have for, but it does have forM and forM_

19:08 really i think it's mostly C-family languages that have the C for loop

19:08 justin_smith: *algol family

19:08 amalloy: i think i've probably overstated my case here

19:08 but "most" languages is a bit strong

19:20 cbp: python only leads to misery anyway

19:24 noonian: (inc cbp)

19:24 lazybot: ⇒ 9

19:25 amalloy: really, guys? you don't have anything better to do than say unkind things about other programming languages? it doesn't further any positive goals, just leads to a culture of unfriendliness

19:25 noonian: well, i'm dealing with said misery as we speak

19:27 mdeboard: it's a poor craftsman etc., etc.

19:27 amalloy: yeah, exactly. so far i can equally well conclude that working with programs noonian has worked on only lead to misery

19:28 noonian: amalloy: i'd say you do more than your share of fostering a culture of unfriendliness in this room...

19:28 Sorella: Python just has a different view on how software should be written, it's partly OO, partly imperative. I particularly don't think that works, but some people find it okay.

19:29 * Sorella thinks OO languages should be pure or at least enforce immutability/minimise side-effects

19:36 amalloy: you're of course entitled to any opinion about me that you'd like to hold, noonian, although i hope i don't come across that way. i try to be mostly friendly and helpful

19:37 {blake}: I've always enjoyed Python -and- amalloy.

19:38 amalloy: infidel!

19:38 {blake}: I've yet to find a language that can't be screwed up, tho'. It always hurts when it's one you love.

19:40 Also, even great programmers working in great languages can end up with crappy code.

19:42 amalloy: {blake}: i was going to propose lojban as a counterexample: a language you can't screw up because of its strictly-defined grammar/structure. but instead i just started reading the lojban wikipedia page

19:45 {blake}: amalloy, heheheh

19:46 Good lord, I don't even know what it means...

19:48 justin_smith: amalloy: I'm picturing a far side cartoon "we had a terrible nerd infestation, 'til ma and I figured out we could leave out articles about lojban and pages from tv tropes, they get stuck and we can deal with 'em humanely"

19:48 featuring the standard tubby farmer holding a pitchfork of course

20:37 uptown: hello nice clojure people. noob here. not sure how to untangle my deps as seen here http://pastebin.com/NjwMMfms

20:38 adding the suggested exclusion makes clj_time throw

20:38 amalloy: uptown: you're being warned about conflicting dependencies in midje itself. i'd just ignore that warning unless you notice a specific problem that's fixed by the exclusion

20:39 uptown: thanks, will press on

20:41 xeqi: I should fix that exclusion message

20:41 uptown: feel free to make an issue at https://github.com/technomancy/leiningen/issues about the exclusion suggestion not helping

20:43 uptown: will do.

20:50 ..added. i hope my descriptions are somewhere near useful. i'm still new at reading the clj stack's tea leaves

20:52 amalloy: uptown: is https://github.com/technomancy/leiningen/issues/1729 yours? the paste is dead

20:53 sritchie: has anyone seen M-. break with the cider 0.8.0 snapshot?

20:54 this started happening for me when I upgraded to the 10.07 build

20:54 I see “symbol <whatever> not resolved” in the minibuffer

20:56 uptown: amalloy: missed a letter. should be fixed

21:10 justin_smith: sritchie: did you also update the cider nrepl middleware?

21:10 sritchie: it’s in my plugins, and it’s on snapshot,

21:11 but cider isn’t detecting it

21:11 I put it in my dev profile

21:12 technomancy: sritchie: you probably want your :user profile?

21:12 sritchie: yeah, I had moved it in to try to get it to register somewhere

21:12 technomancy: (and also to not use snapshots)

21:12 sritchie: well,

21:12 sure

21:12 but 0.8.0 wasn’t out at the time

21:12 I don’t think it’s been published at all

21:13 justin_smith: yeah, only snapshot versions of 0.8.0 are out right now

21:14 sritchie: it should be in your dev profile, not plugins

21:14 since it is needed in the running process

21:14 sritchie: it’s in the :plugins vector in my :dev profile

21:14 ah

21:14 so put it in the dependencies?

21:14 justin_smith: right

21:15 sritchie: okay, trying that now

21:16 184f13f27ad1b25ab3091055aaed39323d95c211

21:16 whoops, sorry

21:18 justin_smith: looks like these instructions are busted, if that’s true: https://github.com/clojure-emacs/cider

21:18 since it says to place this in plugins

21:18 justin_smith: hrm...

21:18 synkte: test

21:19 justin_smith: sritchie: I know the middleware is needed at runtime, and afaik lein plugins are not in the repl process at runtime

21:19 hiredman: cider is the worst

21:19 sritchie: haha

21:19 justin_smith: ~cider

21:19 sritchie: hiredman: what should I use?

21:19 clojurebot: cider is rage-inducing

21:19 hiredman: sritchie: I dunno

21:19 sritchie: anything build / dev related is rage inducing

21:19 hiredman: cider just keeps changing things and breaking things

21:20 it is no kind of basis for people to actually get work done

21:20 the vm I use for work has some crazy old version of nrepl and clojure mode on it

21:20 xeqi: oh how I despise everyone who works on tooling

21:20 sritchie: :)

21:20 yeah, it’s still hosed, even though I can print the classpath with clojure.java.classpath and SEE cider-nrepl

21:20 arrdem: "cider is shit!" <- doesn't work on cider

21:21 hiredman: my new linux machine has a new cider on it, but I can't stand it so I end up ssh'ed in to my mac to do work, which actually has an old nrepl and clojure mode

21:22 sritchie: you are at least the 3rd or 4th person in here complaining that M-. doesn't work

21:22 sritchie: yeah, I believe that the whole thing is hosed

21:23 and that seems like a major regression

21:23 I won’t be the last, I bet

21:25 arrdem: there are no open cider issues wrt M-.

21:25 that I can find

21:25 hiredman: nrepl.el went from a stable but clunky project to 1000x larger project that breaks all the time

21:26 sritchie: with a name change, always helpful

21:26 hiredman: emacs basically went from being the best clojure dev environment to being broken all the time

21:27 sritchie: trying to debug the nrepl version issue now

21:29 hiredman: who runs that project?

21:29 hiredman: are they in IRC now?

21:30 hiredman: bbatsov, I dunno

21:30 justin_smith: bbatsov isn't here or in #emacs, so I assume he isn't on IRC

21:30 $seen bbatsov

21:30 lazybot: I have never seen bbatsov.

21:31 arrdem: sritchie: bbatsov doesn't spend a lot of time in here. there is a cider channel. lemme see if I have it.

21:31 sritchie: #clojure-emacs

21:34 sritchie: debugging emacs lisp, great

21:37 hiredman: bbatsov also claims to be the editor of the clojure style guide

21:37 cursivecode: If cider and nrepl are not good, what do people use for clojure development?

21:38 hiredman: nrepl is a distinct thing from cider

21:38 nrepl.el is also distinct from nrepl

21:38 nrepl is a general network repl sort of protocol

21:38 nrepl.el is an emacs client

21:38 noonian: cursivecode: lein repl

21:39 hiredman: cider is a the nonsense nrepl.el turned in to

21:39 noonian: but i haven't personally had a problem with nrepl or cider; i think the version of cider i have installed usually works fine

21:39 llasram: FWIW, I've had no problems running the stable releases of CIDER

21:40 sritchie: great, when I run (cider--check-middleware-compatibility) AFTER the repl’s set up,

21:40 it reports the proper version

21:42 xeqi: I've been running 0.7.0 cider with minor issues, though I hear lots of good things about cursive

21:52 cfleming: xeqi: Thanks - Cursive's nREPL integration does seem to be more stable than Cider's, at least from what I hear. I still have people asking me to add essentially the equivalent to an inferior-lisp mode though :-)

21:52 xeqi: cfleming: can I ask you to charge for it already?

21:54 cfleming: xeqi: I'm actually surprised at the number of people that do!

21:55 xeqi: https://www.youtube.com/watch?v=OnB1TgxgwEA

21:57 cfleming: A classic!

22:01 sritchie: rolled back to 0.7.0

22:01 now it’s totally broken

22:06 technomancy: sritchie: the name change was actually really great because it means it's easy to fall back to something that works

22:06 sritchie: yeah, I suppose that’s true

22:06 name changes seem better than major version changes

22:07 technomancy: doesn't exactly scale in the longh run

22:17 amalloy: speaking of using old tools because cider is unstable: devn, did you ever get swank/slime running successfully from my dotfiles?

22:17 RazWelle1: How do you load a .net asseembly with clojureclr into a namespace? I'm able to instantiate objects, even use them, but I can't seem to introspect them

22:18 (all-ns) doesn't include the assembly I loaded

22:18 _pr0t0type_: Hey guys, is there any way to key a hashmap with a variable reference? Ie: (defn x "mykey") (x {"mykey" "Yay"})

22:18 amalloy: RazWelle1: i don't really know what clojure-clr is like, but you probably still have to require the namespace

22:18 _pr0t0type_: sorry I mean (def x "mykey")

22:18 justin_smith: amalloy: we figured out sritchie 's issue, it was the same problem I got when upgrading from slime to nrepl.el - if you uninstall the old, then install the new, some of the old defs are still there, and lead to mixed up elc files, a sequence of uninstall, restart, install fixes the issue

22:19 makes sense, a bunch of elisp stuff basically has defonce semantics

22:19 sritchie: justin_smith: amalloy well, I can’t confirm that that was the cause of the M-.

22:19 justin_smith: this was my issue with downgrading back to 0.7.0

22:19 amalloy: _pr0t0type_: ##(doc get)

22:19 lazybot: ⇒ "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

22:21 justin_smith: sritchie: OK, so it's not a full explanation

22:21 but could your problems on the initial upgrade had a similar source?

22:21 _pr0t0type_: amalloy: perfect, thanks!

22:30 sritchie: justin_smith: I THINK what was going on -

22:30 justin_smith: and the reason M-. broke,

22:30 was that I had installed a version of cider-0.8.0-SNAPSHOT a while ago

22:31 but the snapshot version in my lein/profiles.clj was upgrading every single day

22:31 justin_smith: so an incompatility just appeared out of nowhere

22:31 justin_smith: right, SNAPSHOT versions do that

22:31 sritchie: yeah, I get it

22:31 so publishing snapshots for cider-nrepl is insane

22:31 since the snapshot version of cider doesn’t auto-upgrade

22:32 the better thing would be to publish a timestamped version

22:32 justin_smith: I think even with a snapshot, an API incompatibility should be a version change

22:32 like why not name it 0.8.1-SNAPSHOT 0.8.2-SNAPSHOT etc.?

22:32 or timestamps or commit hashes, yeah

22:33 bostonaholic: you should never be dependent upon a snapshot that you do not control

22:34 justin_smith: bostonaholic: I guess the sparkly shiny features of the latest alpha are too good to resist

22:34 bostonaholic: http://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom-syntax.html

22:36 I only ever depend upon snapshot when I'm currently developing the -SNAPSHOT and I need to install the changes to my local .m2/repository for each change

22:36 justin_smith: that sounds quite sane

22:37 * bostonaholic wipes brow

22:39 bostonaholic: if you must depend on -SNAPSHOT, I would recommend having a CI server setup that also builds projects with depend on that -SNAPSHOT

22:39 that was you know right away if it is incompatible

22:40 worst case scenariou

22:41 justin_smith: well, worst case is everything still compiles, it just crashes at runtime with the new version, deletes all your client's data, and sends your credit card number to bulgaria

22:44 RazWelle1: Is there a way to import all rather than specifically go (:import [Library Object])?

22:45 Like (:import [Library *])

22:45 llasram: RazWelle1: Nope

22:46 Java fakes it by internally creating a search path for each such import, but

22:46 RazWelle1: :\

22:46 is there an alternative to import?

22:46 llasram: several features of Clojure's evaluation model depend on having each class known and interned by name into the namespace as each form is compiled

22:47 In what sense?

22:47 RazWelle1: I'm having trouble getting an assembly into a namespace, I can't introspect it so I don't know how to access it otherwise

22:47 In python I'd just do dir(assembly) after import

22:47 Not sure what to do here

22:47 llasram: Oh, clojure-clr?

22:47 RazWelle1: Yeah

22:48 llasram: I'm afraid I myself cannot provide any insight

22:48 RazWelle1: much appreciated anyway :)

22:48 llasram: Good luck!

22:48 RazWelle1: I did it once but I lost the code xD

23:00 allen: quick noob question, I apologize in advance: from the lein repl, how do I include my core namespace so I can load all my vars, funcs, etc..?

23:00 sorry, i have no x server running, so i can't easily view source code and example code on my terminal :/

23:01 llasram: allen: (require 'whatever.your.namespace.is) then (in-ns 'the.same.thing)

23:01 allen: But you'll have a much better time of it if you get some sort of editor-connected REPL going. It's one of the core features of most people's Clojure workflows

23:02 allen: llasram, ahh ok I was trying (require '[project-name.core])

23:02 llasram, I have emacs split vertically and have a shell process with lein in the second split

23:03 technomancy: allen: what does an X server have to do with viewing source code?

23:03 llasram: technomancy: I think they mean they don't have a graphical Web browser available

23:03 allen: technomancy, can't view stuff on github through lynx

23:03 technomancy, DAMN, i just realized i can pull code... FAIL

23:03 technomancy: oh, like source code rendered as HTML?

23:04 allen: technomancy, yeah that, but I realized, that's not essential... hmmm

23:04 llasram: To be fair, a significant chunk of documentation is displayed primarily as HTML...

23:04 allen: well, I do have lynx

23:04 technomancy: only lame docs

23:04 allen: so I can view a quick gist if someone's readme is well documented

23:05 llasram: technomancy: Well, uses HTML as the primary presentation layer? I mean, even text-based wiki-like markup formats are generally written with HTML rendering in mind

23:56 RazWelle1: Does anyone know how to inspect an assembly loaded with clojure-clr?

Logging service provided by n01se.net