#clojure logs

2014-10-14

00:00justin_smithyou may also want to try printing the value of *db* in context of the call
00:00justin_smithto see what is really there in the thread local binding
00:00DomKM"java.sql.SQLException: No suitable driver found for jdbc:postgres://localhost:5432/brandroid_zonefs"
00:01DomKMI *think* that's correct but I don't have much experience with jdb
00:01justin_smithmaybe try switching to the c.j.jdbc.deprecated ns and see what parse-properties-uri returns when handed that?
00:02justin_smithDomKM: oh, weird
00:03justin_smithsubprotocols include "postgres" and "postgresql" but classnames only includes "postgresql"
00:03justin_smithmaybe try switching postrgres for postgresql?
00:04DomKMjustin_smith: the deprecated get-connection fn works
00:04justin_smithhmm, OK
00:04justin_smiththen why is it saying it can't find a driver?
00:05DomKM...I don't know
00:05DomKM(#'clojure.java.jdbc.deprecated/get-connection "jdbc:postgresql://localhost:5432/brandroid_zonefs")
00:05DomKMthat works with or without "jdbc:"
00:05DomKMand postgres or postgresql
00:06justin_smithand I assume you can use that in order to successfully access your db?
00:07DomKMjustin_smith: Haven't tried with deprecated yet, one moment
00:07justin_smithI'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
00:07justin_smithor, make that, suspicious because *db* is thread local
00:10DomKMjustin_smith: I'm not familiar with the deprecated api, is it possible that I could create a connection but get this driver error after?
00:10DomKMthat seems like it would happen before a connection is made
00:11justin_smithnot 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
00:12justin_smitheach 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*)
00:13DomKMjustin_smith: ok, so the deprecated connection works
00:13DomKMI created a table with it
00:14DomKMusing with-connection and the dynamic db binding
00:14justin_smithright, but you also have to verify that the dynamic binding is right inside your migration function at runtime
00:19DomKMjustin_smith: ok, I'll dig around more. Thanks for your help :)
00:20justin_smithbest of luck, and let me know when you figure out the issue, I'm curious
00:22gzmaskhow 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.
00:23DomKMjustin_smith: this is bizarre, jdbc works with "postgres" or "postgresql" but joplin/ragtime errors with "postgres"
00:24DomKMjustin_smith: I assumed it would for "postgresql" but, on a whim, changed it
00:24DomKMjustin_smith: now it works
00:24DomKMbizarre
00:24DomKMalso potentially problematic because Heroku's database url var uses "postgres", not "postgresql"
00:27justin_smithweird
00:27justin_smithat least it is an easy regex switch?
00:27justin_smithanyway, sorry I wasn't more helpful (though among my scattershot suggestions I did point out the postgres / postgresql weirdness)
00:28justin_smithgzmask: (.lookat camera args...)
00:29justin_smithor, for chained usage: (-> camera (.lookat args...) .whatever)
00:59handojinneed some direction
00:59handojinhave project
00:59handojinlein run works fine
00:59handojinlein beanstalk deploy development
01:00handojincrashes out with...
01:00handojincould not locate ring/middleware/not_modified__init.class or ring/middleware/not_modified.clj on classpath
01:08handojin(+ 1 1)
01:08clojurebot2
01:13justin_smithhandojin: do you directly rely on the ring deps, or only via the lein-ring plugin?
01:17handojin@justin_smith not using lein-ring plugin. i have lib-noir, rind-devel, ring-json as dependencies
01:19justin_smithany reason to use ring-devel rather than ring?
01:20handojinlib-noir was a later addition - needed ring-devel for reload - seems like it's unnecc now
01:23xsynHi
01:23xsynI'm looking for a function like reduce
01:23xsynbut isn't ;)
01:23xsynIf I have a coll
01:23xsyn[ 1 2 3 4]
01:24xsynI want to apply a function in such a way that it apples to sets of elements at a time
01:24xsynso say +
01:24xsynwould return
01:24xsyn[3 5 7]
01:30justin_smith(map #(apply + %) (partition 2 [1 2 3 4 5]))
01:30justin_smith,(map #(apply + %) (partition 2 [1 2 3 4 5]))
01:30clojurebot(3 7)
01:30justin_smith,(map #(apply + %) (partition 2 1 [1 2 3 4 5]))
01:30clojurebot(3 5 7 9)
01:30justin_smithoh, you did not include 5
01:31justin_smith,(map #(apply + %) (partition 2 1 [1 2 3 4]))
01:31clojurebot(3 5 7)
01:40DomKMjustin_smith: you were very helpful and yeah, it's an easy regex fix
01:41DomKMjustin_smith: I wouldn't have thought of switching the name to "postgresql"
01:43handojinok - included :plugins [[lein-ring "0.8.12"]] and it's compiling
01:43handojinand deploying
02:03handojin@justin_smith - thanks for gesturing towards the right path!
02:09TEttingerapparently 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...
02:17gwsTEttinger: more info on that: https://blog.dropbox.com/2014/10/dropbox-wasnt-hacked/
02:18TEttingerthanks gws
02:28TEttinger(inc gws)
02:28lazybot⇒ 6
04:19Fenderhey, 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?
04:20Fenderthey say BigDecimal is the way to go but instantiating objects to call their functions feels so java
04:22hyPiRion,(with-precision 5 (bigdec 7/9))
04:22clojurebot0.77778M
04:23Fenderthanks!
04:23hyPiRionI think that should cover your use case
04:23hyPiRionnp
04:23Fenderlooks like exactly the thing I wanted
04:23hyPiRionhurray!
04:25clgv,(format "%.7f" (with-precision 5 (bigdec 7/9)))
04:25clojurebot"0.7777800"
04:27hyPiRionclgv: it's better than ##(format "%.7f" (bigdec 7/9)) :p
04:27lazybotjava.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
04:29clgvhyPiRion: :P just wanted to demonstrate that there are no more "digits" stored ;)
04:29hyPiRionohh
04:31Fender,(with-precision 6 (bigdec 0.25341263737))
04:31clojurebot0.25341263737M
04:31Fenderhmmm
04:32FenderI only want 6 digits but format is not an option "because string" :)
04:34Fenderwell, I guess I do that by composing * round int /
04:36Fendersomething like this #(-> % (* 1000000) double (Math/round) int (/ 1000000))
04:37Fenderyou know something better?
04:38Fenderevery number is double, then int, then bigdec :-/
04:38hyPiRionhuh, honestly surprised about that
04:38clgvFender: yes, I was not suggesting `format` as solution ;)
04:39Fenderformat returns a string
04:39clgvmind the "not" above ;)
04:39hyPiRion,(defn scale-it [decimal precision] (.setScale (bigdec decimal) precision java.math.RoundingMode/HALF_UP)))
04:39clojurebot#'sandbox/scale-it
04:40hyPiRion,(scale-it 0.25341263737 6)
04:40clojurebot0.253413M
04:40hyPiRion,(with-precision 6 :rounding HALF_UP (bigdec 0.25341263737))
04:40clojurebot0.25341263737M
04:41hyPiRionThat smells buggy...
04:41Fenderclgv: can you repaste the line you refer to? I honestly dont know :)
04:42hyPiRiongfrederi`: would you expect that? ^ I thought converting to a bigdec was considered a bigdec operation.
04:42Fendermaybe I just dont understand the difference between precision and scale
04:43hyPiRionMaybe I don't either.
04:43Fendermaybe precision rfers to internal representation and scale to external
04:43hyPiRion1http://stackoverflow.com/questions/15643280/rounding-bigdecimal-to-always-have-two-decimal-places
04:46Fender,(.setScale (with-precision 6 (bigdec 0.76)) 6 6)
04:46clojurebot0.760000M
04:46FenderD:
04:49Fenderah yes, to explain: I want the shortest representation with at most 6 digits after the point
04:50Fenderreason why no strings are allowed: I pass it to cheshire after that
04:51Fenderso the JSON would become "0.123" instead of 0.123
04:51Fenderwhich is not good
04:52Fenderok, got it
04:52Fender(.stripTrailingZeros (.setScale (with-precision 6 (bigdec 0.76)) 6 6))
04:52Fenderworks for (/ 7 9) and 0.7356293892 as well
04:53Fendermaybe using the double-> int -> bigdec trail is faster :)
04:56Fenderdoing this to some 2k numbers costs me 33msecs
04:57Fendernot exactly cheap
04:59sveriHi, how can I mark dependencies as test dependencies in project.clj?
05:00hyPiRionsveri: `:profiles {:dev {:dependencies [[my-dev-dependency "1.0.0"]]}}`
05:01sverihyPiRion: thank you, I thought there was something like :dependencies [[foo.bar "3.0" :test]]?
05:03luxbockthere is [my-dev "0.1.0" :scope "test"]
05:04dysfun_is there any documentation on compiling code with a custom reader (Well, the clojure reader with some reader macros), :aot -style?
05:04sveriluxbock: ah, thats what I meant, thank you
05:10Fenderok, the reason this is slow is reflection
05:11Fender,(.setScale ^BigDecimal (with-precision 6 (bigdec 1.235)) 6 6)
05:11clojurebot1.235000M
05:11FenderI get a Reflection warning, call to method setScale can't be resolved (target class is unknown).
05:11FenderLink http://docs.oracle.com/javase/6/docs/api/java/math/BigDecimal.html
05:12Fenderwhat else does it need to know to get rid of that reflection warning?
05:12Fendershould I hint that 6 is an int?
05:16TEttinger,(.setScale (bigdec (with-precision 6 (bigdec 1.235))) 6 6)
05:16clojurebot1.235000M
05:16TEttingerwonder if that will help at all
05:18FenderTettinger that helped
05:18Fenderhow did you know?
05:18FenderI'm down from 33msecs to 16
05:18TEttingerI've optimized some weird reflection stuff in the past with clojure. take a look at primitive-math by ztellman
05:19TEttinger$google ztellman primitive-math
05:19lazybot[ztellman/primitive-math · GitHub] https://github.com/ztellman/primitive-math
05:19FenderI thought hinting that a bigdec is a bigdec is sufficient :)
05:19Fenderthanks!
05:19TEttingerno prob!
05:19TEttingerztellman did a great job with that lib btw, very useful in optimizing a tricky thing
05:19wenshanI'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?
05:20TEttingerwenshan: take a look at nightmod, by the author of play-clj
05:20TEttingerhttps://nightmod.net/
05:21Fendervery nice, I didnt know that clj still reflects on numbers
05:22Cr8boxes
05:22Fendergotta rewrite some stuff now :)
05:35dysfun_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
05:36dysfun_although i wonder how long before hotspot starts doing that automagically
05:52wenshanTEttinger: I'm aware of nightmod, but I'm using Emacs and setting up a development workflow
05:53TEttingerah, 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)
05:55TEttingerhttps://github.com/technomancy/grenchman wenshan
05:59justin_smithwenshan: 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
06:02justin_smithwenshan: 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
06:06justin_smithwenshan: 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
06:07justin_smithand get the same reloading effect
06:09justin_smithwenshan: 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
06:19wenshanjustin_smith: thanks, I'll try
07:10crispinHey there peeps!
07:11crispinhow do I "subclass" a javascript "object" in clojurescript
07:11crispinI want to "subclass" this: https://github.com/GoodBoyDigital/pixi.js/blob/master/src/pixi/filters/AbstractFilter.js
07:12crispindeftype? defrecord? reify?
07:12crispinproxy?
07:12clojurebotproxy is <Chouser> proxy teases with its ease of use, then suddenly betrays.
07:18justin_smithcrispin: from a quick look, it seems like reify might work (unlike proxy it actually has an implementations in cljs.core)
07:19dnolen_crispin: just do what you would do in JS
07:20dnolen_(defn AClass [...] (this-as this (AbstractClass this) ...)
07:21dnolen_crispin: when subclassing patterns are solidified by ES6 we might think about better support for this, but until then ^
07:36martinklepschHow can one concatenate selectors in garden like illustrated here: https://gist.github.com/mklappstuhl/24407c3069f77a0ab162
07:58perplexa,(reduce (fn [r v] (into r (clojure.string/split v #","))) ["1/a,1/b,2/c" "2/d,1/e,2/f"])
07:58clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentCollection>
07:58perplexawat
07:58perplexa,(reduce (fn [r v] (into r (clojure.string/split v #","))) [] ["1/a,1/b,2/c" "2/d,1/e,2/f"])
07:58clojurebot["1/a" "1/b" "2/c" "2/d" "1/e" ...]
07:59perplexacan i now sort them all by the numbers without having a second reduce?
08:00perplexai want to have a map like {:1 ["a" "b"] :2 ["c" "d"]}
08:00perplexawould probably use update-in + a second reduce form, any better way to solve this?
08:01raspasovperplexa: just joined, what are you trying to achieve?
08:01dnolen_martinklepsch: you'll probably want to ask noprompt when he comes online
08:01perplexaraspasov: ##(reduce (fn [r v] (into r (clojure.string/split v #","))) [] ["1/a,1/b,2/c" "2/d,1/e,2/f"])
08:01lazybot⇒ ["1/a" "1/b" "2/c" "2/d" "1/e" "2/f"]
08:01martinklepschdnolen_: yup
08:01perplexai wonder if it's possible to get {:1 ["a" "b"] :2 ["c" "d"]} with a single reduce form
08:03dnolen_,(map #(clojure.string/split % "/") (mapcat #(clojure.string/split % #",") ["1/a,1/b,2/c" "2/d,1/e,2/f"]))
08:03clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>
08:03dnolen_,(map #(clojure.string/split % #"/") (mapcat #(clojure.string/split % #",") ["1/a,1/b,2/c" "2/d,1/e,2/f"]))
08:03clojurebot(["1" "a"] ["1" "b"] ["2" "c"] ["2" "d"] ["1" "e"] ...)
08:04dnolen_,(group-by first (map #(clojure.string/split % #"/") (mapcat #(clojure.string/split % #",") ["1/a,1/b,2/c" "2/d,1/e,2/f"])))
08:04clojurebot{"1" [["1" "a"] ["1" "b"] ["1" "e"]], "2" [["2" "c"] ["2" "d"] ["2" "f"]]}
08:04perplexaoh group-by ;o
08:04perplexanice
08:04perplexathat's just what i am looking for, thx!
08:05perplexa(inc dnolen_)
08:05lazybot⇒ 5
08:05dnolen_,(group-by first (mapcat #(clojure.string/split % #",") ["1/a,1/b,2/c" "2/d,1/e,2/f"]))
08:05clojurebot{\1 ["1/a" "1/b" "1/e"], \2 ["2/c" "2/d" "2/f"]}
08:05perplexathat's good enough! :) thx
08:18RazWellesHey, 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?
08:21RazWellesany idea how to a method that's nested like this.method.is.here()?
08:22kungiRazWelles: use (.. this method is here)?
08:22RazWelleskungi: I'll try that sec
08:26RazWelleskungi: malformed member exception :(
08:27RazWellesHere's an example of simple login in ironpython http://lib.openmetaverse.org/wiki/IronPython/Simple_Login
08:27RazWellesI'm just trying to translate that so I can get started x.x
08:28dnolen_RazWelles: gist/paste what you are trying
08:29RazWellesdnolen: ok sec
08:30RazWellesdnolen_: http://pastebin.com/YA7iSL43
08:31dnolen_RazWelles: this is ClojureCLR ?
08:31RazWellesdnolen_: yes
08:33dnolen_RazWelles: don't know it that well but try (.Login (. client Network) "User" "Name" "pass" "bot" "ver1")
08:33dnolen_RazWelles: the way you use .. def won't work, strings aren't methods/properties
08:35RazWellesdnolen_: should I be using defn?
08:35RazWellesseems it hung on that method approach
08:47RazWellesdnolen_: (. Login (.. client Network) "User" "Name" "pass" "bot" "ver") worked, thanks!
08:48RazWellesdnolen_: do you know a cleaner way I could maybe format that xD
08:59dnolen_RazWelles: (.. client Network (Login "User" "Name" "pass" "bot" "ver")) might work?
09:03RazWellesdnolen_: nope :(
09:03RazWelleswait, maybe..
09:03RazWellesforgo to close a paren
09:03RazWellesYep!
09:03RazWellesdnolen_: it works :D
09:03RazWelles*forgot
09:04dnolen_RazWelles: cool
09:04RazWellesIs there a page I can read up on all these weird ways to call objects?
09:04RazWellesMy google fu is poor tonight
09:05ro_sthttp://clojure.org/java_interop covers the basics
09:05dnolen_RazWelles: http://clojure.org/java_interop, should hold for ClojureCLR (and mostly true for ClojureScript as well)
09:05RazWellesthanks a bunch :)
09:07RazWellesSorry one more question how do I get a script to drop into the repl after it completes running?
09:12perplexawhen i need the forms (a) (b) and (c) to be executed in order, i use (do (a) (b) (c)), right?
09:12ro_styes
09:12perplexado i understand correctly that just calling something like (fn [] (a) (b) (c)) wouldn't ensure execution order?
09:13ro_stfns have an implicit do for their body
09:13ro_stso, same as do
09:13perplexaoh
09:14ro_st`((fn [] (prn "a") (prn "b")))
09:14ro_stthat'd produce a then b
09:17gfrederi`I think the only order that isn't guaranteed is the evaluation order of arguments in function calls
09:17stuartsierraFunction arguments evaluate left-to-right.
09:17Bronsagfredericks: I don't think that's true
09:18Bronsagfredericks: "Both the operator and the operands (if any) are evaluated, from left to right" http://clojure.org/evaluation
09:19gfredericksBronsa: yeah I just found that
09:19gfredericksstuartsierra: Bronsa: thanks
09:20gfrederickslooks like the same is documented for interop method calls
09:44zottop 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)
09:46joegallominor tweak: #(hash-map :foo %1 ...)
09:46joegallobut that's fundamentally the same
09:49zoti 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 :)
09:51gfredericks(map #(zipmap [:foo :bar :baz] %&) foos bars bazs)
09:52zotmmm, definitely going places with that :)
10:22RazWellesHow do you assign an event handler without a delegate? (set! (.event (.. event object) function)?
10:33perplexahow do you call the combination of a namespace and function name in clojure? eg. clojure.string/split
10:33perplexalike, not cal as in evaluate the symbol, but what name does it actually have?
10:34Bronsaperplexa: it's a namespace qualified symbol
10:34dysfun_"fully qualified"?
10:35perplexaBronsa: thx; dysfun_: i thought that was a bit too generic ;x
10:43m1dnight_Is there any point in using (ensure) twice in a single transaction?
10:43m1dnight_I'm guessing no, but i'm not sure
10:44wombawombaI need for some resources to be freed on exit. How do I make sure that this happens?
10:45m1dnight_Doesn't your GC do that for you?
10:45m1dnight_Or do you mean threads or something?
10:46wombawombathe resources are not on my computer
10:46wombawombaI'm writing a distributed application
10:47dysfun_(-> Runtime/getRuntime (.addShutdownHook <thread-subclass>))
10:47csd_Is it possible to use the threading macro to thread execution through an if statement?
10:47dysfun_er, with another pair of parens
10:48wombawombacool, thanks
10:48dysfun_csd_: you can trivially thread the condition
10:49dysfun_(-> true (if true false))
10:50dysfun_you can thrush the false case too (->> false (if true true)) is the equivalent
10:50csd_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:51BalvedaI'm having a bit of a design issue.. I'm using Hoplon, but it's more of a Clojure-y thing
10:51dysfun_oh, you want to thread the middle item?
10:51csd_yes
10:51BalvedaIn 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:51csd_i want the threading to continue inside the if statement so that a where clause inside works
10:52BalvedaAnd since I'm a bit of a neophyte I can't think of a language-y way to do it.
10:52dysfun_as-> ?
10:52dysfun_not quite what you want, but perhaps close enough
10:53csd_that might work, i've never used that before
10:53dysfun_or there's -<> in swiss-arrows
10:53csd_swiss-arrows?
10:55dysfun_https://github.com/rplevy/swiss-arrows/blob/master/src/swiss/arrows.clj#L34
10:55BalvedaI 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:56csd_looks like a neat lib
10:56dysfun_Balveda: define 'persistent'
10:57dysfun_also this sounds more like a clojurescript question. is it?
10:59BalvedaHoplon more like, so kinda
11:00greghendershottIs 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:01dysfun_split-by or split-with i think. check the cheatsheet
11:01danneucsd_: (as-> x _, (foo 1 _), (bar _ 1))
11:04greghendershottdysfun_: Ah, thanks. I need to add the cheatsheet to my list of docs at-hand.
11:11squeedeeHow 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:12stuartsierragreghendershott: Note: `split-with` traverses the "before" part of the sequence twice.
11:13squeedeeeg if i do (nth my-seq 5) - i'd like the 5 dispatched to the my-seq function
11:14joegallosqueedee: want something else
11:15squeedeelike?
11:16squeedeeI'm hoping to compose a dungeon map of curried functions describing rooms etc.
11:16squeedeeas an excercise..
11:17squeedeeI thought perhaps i could avoid building the entire map up front, and lazily evaluate when doing visibility checks.
11:17greghendershottstuartsierra: Yep, looks like its definition is the "conceptual" one I gave above.
11:18greghendershott(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:18joegallowell, seqs aren't functions of their positions arguments, so, well, don't do that.
11:20squeedeei guess just write a function that takes positional arguments and evaluate the content
11:20squeedee then wrap that with a function which memoizes into a vac
11:21squeedeeso busy looking at the bark on trees I didnt step far enough back
11:21squeedees/vac/vec/
11:28nopromptdnolen_: 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:35dbasch&(doseq [a [] b [] c [] d [] e [] f [] g [] h []])
11:35dbasch,(doseq [a [] b [] c [] d [] e [] f [] g [] h []])
11:35clojurebot#<CompilerException java.lang.RuntimeException: Method code too large!, compiling:(NO_SOURCE_PATH:0:0)>
11:35lazybotExecution Timed Out!
11:36dbasch^ I checked via no.disassemble that the generated code doubles for every binding pair
11:36dbasch,(doseq [a [] b [] c [] d [] e [] f [] g [])
11:36clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
11:36dbasch,(doseq [a [] b [] c [] d [] e [] f [] g []])
11:36clojurebotnil
11:37dbasch^ that one is still under 64k
12:15brianwongi changed my 'map' to a 'reduce' because i wanted to accumulate some results
12:15brianwongthe function executed in the reduce has side-effects and the output to stdout is no longer appearing
12:15brianwongis there another pattern i should be using?
12:15joegallocan you gist the relevant code?
12:18brianwongjoegallo, nevermind, i realized i only had one item in my collection
12:18brianwongand nothing was being called
12:18brianwongthanks
12:19brianwongis there another pattern i can use that acts like reduce but actually processes a collection with 1 item?
12:21bbloombrianwong: you need to give it an accumulator
12:21bbloom,(reduce (fn [acc x] (prn acc) (+ x acc)) (range 3))
12:21clojurebot0\n1\n3
12:21bbloom,(reduce (fn [acc x] (prn acc) (+ x acc)) 0 (range 3))
12:21clojurebot0\n0\n1\n3
12:22bbloom,(reduce (fn [acc x] (prn acc) (+ x acc)) [5])
12:22clojurebot5
12:22bbloom,(reduce (fn [acc x] (prn acc) (+ x acc)) 0 [5])
12:22clojurebot0\n5
12:22bbloombrianwong: see?
12:23brianwongyes, the initial value. thanks bbloom
12:29noncomi know that java code can very easily be decompiled back into source. is the same true for clojure code?
12:29noncomhow prone is clojure to decompiling ?
12:31clgvnoncom: 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:32clgvnoncom: you can try it yourself using luyten+procyon or jd-gui
12:33noncomclgv: but generally the hackers will have first to witness the clojure lisp-vm layer before they get to the actual program ?
12:33noncomand do i have to use gen-class for that ?
12:34clgvnoncom: I do not understand that question. just AOT a project of yours and have a look at the decompiled result to judge yourself
12:34noncomokay, will try :)
12:36clgvnoncom: 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:37noncomclgv: 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:37noncomoriginally it was in c++
12:37noncombut now i think about clojure...
12:37noncomand i wonder if it suits
12:40clgvnoncom: 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:41noncomclgv: yes, sure... so i wander if these languages, particulary clojure is acceptable for this task at all
12:42clgvnoncom: 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:44clgvnoncom: you should specify your goals exactly and then go from there analyzing the available measures
13:04TimMcUgh, the Clojure survey yet again fails to include "Emacs and lein repl" as a development environment option.
13:04technomancyTimMc: just put inf-lisp
13:05technomancybasically the same thing
13:05technomancyinf-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:06technomancyin fact, I can't think of any reason to use M-x shell over inf-lisp.
13:08TimMcBut it's not the same! I keep my repl in a different window for a reason.
13:09technomancyinf-lisp is in its own window
13:11TimMcDo you mean "Emacs window" or do you mean "X window"?
13:11clgvTimMc: vote for a "other"-field with a free text entry ;)
13:12technomancyTimMc: emacs window
13:12technomancyoh, you're not talking about M-x shell
13:12TimMcnope
13:12TimMcliterally `lein repl` in gnome-terminal or whatever it is
13:13TimMcI 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:14technomancyI think it's just C-z
13:14technomancyto focus inf-lisp
13:14technomancyor C-c C-z
13:14TimMcThat's too many keys.
13:15llasramThen just map your foot pedals to the appropriate command
13:15technomancyhm; it is twice as many
13:15TimMcAnyway, I don't think this is so uncommon.
13:16technomancyfrom a tooling perspective though, it's basically the same
13:16technomancywhich is I think what the survey is getting at
13:17llasramTimMc: You don't use CIDER to connect to the REPL process you've spawned elsewhere?
13:17TimMcNo, for reasons explained above.
13:18llasramOops. Scroll-back failure
13:18TimMcAlso, the last 3 times I tried cider, nrepl.el, or whatever it was a disaster.
13:18technomancyTimMc: you can get nice stuff like "load current namespace" without any fancy nreplisms though
13:19technomancynot that you have to change what you do; just so you know
13:22TimMcI also like having fewer layers of tooling so that I can more quickly arrive at a diagnosis when shit gets weird.
13:22technomancyyeah, that's basically the whole point of inf-lisp. fewer moving parts; basically foolproof
13:23BronsaTimMc: you could use emacsclient to have different X windows connecting to the same emacs instance
13:23justin_smithand it calls itself inferior, which is pretty punk rock
13:24TimMcBronsa: Oh yeah, I've played with that in the past. Thanks for reminding me of it -- I may check it out again.
13:24BronsaI have dozens of emacsclient windows open all the time
13:24technomancy"Also, Dude, inferior is not the preferred nomenclature. 'subprocess', please."
13:24justin_smithloser-lisp-mode
13:24havenwoodas opposed to superior options like emojilisp?: http://emojilisp.com/
13:25justin_smithOK, their definition for cdr made me lol
13:26havenwood🌜💿🌜🏢1 2 3 4 5🌛🌛 #=> 5
13:27havenwood(apologies to folks with emoji-less irc clients)
13:36amalloyi 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:36amalloyno, it can't be bbloom, he uses vim
13:36bbloomamalloy: also i dislike paredit
13:36technomancyamalloy: I use it
13:36technomancyamalloy: the trick is you have to turn off the thing where an open-paren always inserts a space before it
13:37amalloybbloom: 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:37technomancyamalloy: (set (make-local-variable 'paredit-space-for-delimiter-predicates) '((lambda (endp delimiter) nil))) in a hook
13:37bbloomamalloy: you're bizarro brandon
13:38bbloomamalloy: i like that better than me being bizarro amalloy
13:38amalloyyou just like alliteration
13:38bbloomamalloy: you don't?
13:38amalloyyou could be absurdo alan
13:38bbloomi like that.
13:38amalloywell, i don't. so there
13:38bbloomheh
13:39technomancyamalloy: it's not great, but it's better than no paredit
13:39amalloythanks, technomancy. no other sage recommendations other than keyboard pants?
13:40technomancyamalloy: 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:40technomancythe out-of-the-box experience with smartparens is dumb, but supposedly it can be turned into something decent
13:40technomancyalso works with HTML tags, which is cool
13:40amalloytechnomancy: 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:40technomancyheh, yeah
13:42hiredmanI also tried smartparens then ran away screaming
13:52dbasch,(doseq [a [] b [] c [] d [] e [] f [] g [] h []]) ; for those who missed it earlier
13:52clojurebot#<CompilerException java.lang.RuntimeException: Method code too large!, compiling:(NO_SOURCE_PATH:0:0)>
13:52dbaschexponential code explosion
13:53justin_smithfascinating
13:53arrdemhum... I'm gonna have to assemble that by hand later
13:54arrdemdbasch: that's just 7 deep, right?
13:54dbascharrdem: yes
13:54arrdemhum... I'd think that's doable
13:54dbasch,(doseq [a [] b [] c [] d [] e [] f [] g []]) ; works
13:54arrdemsome other time.
13:54clojurebotnil
13:54dbaschit’s under 64k
13:55amalloydbasch: 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:56TimMc,(macroexpand-1 '(doseq [a [] b [] c [] d [] e [] f [] g [] h []]))
13:56clojurebot(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:56amalloyit 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:56amalloy"file name too long"
13:57perplexaThrowable. vs Exception. - which do people use and why?
13:57amalloyit 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:59TimMcHuh, do you recall what fs that was?
13:59amalloyTimMc: i think it was whatever ubuntu used to encrypt your home directory, if you turn that option on
13:59amalloyprobably truecrypt
14:00amalloybut i could be wrong/misremembering
14:00TimMcNah, the home dir encryption isn't truecrypt.
14:00dbaschboth Throwable and Exception are subclasses of Googleable :P
14:00Bronsashould be ecryptfs
14:01amalloysure, that sounds right
14:01dbaschperplexa: Throwable is the superclass of Error and Exception
14:02justin_smithperplexa: 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:02perplexaty
14:02perplexa;p
14:03justin_smithuser did something unexpected vs. code did something unexpected - deal with the former, bail on the latter
14:03amalloyoh 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:04TimMchah!
14:04TimMcwhoa, does that show up as underlined for anyone else?
14:04justin_smithwhat underlined?
14:05TimMcwhat the hell did I type
14:05amalloyi 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:05justin_smithTimMc: I guess that means no, I did not see it
14:05TimMcOK, freaky.
14:06jcromartieis there any way to jump to the source code for a namespace in Cider?
14:07Bronsaamalloy: I'm confused. it seems to me that solussd is the one asking about it
14:07justin_smithjcromartie: should be M-.
14:07jcromartiei.e. I want to be able to specify foo.bar.bat and then visit ~/projects/whatever/src/foo/bar/bat.clj
14:07justin_smithoh, that's different
14:07jcromartieactually that works for namespaces!
14:07jcromartiebut I have to have the text there
14:08amalloyBronsa: he is; i tell him it happened to me once
14:08jcromartieI can easily make that a command
14:08jcromartiethat accepts the namespace
14:08amalloyi guess that's several lines later
14:08Bronsaamalloy: ah, ok. didn't get to that point in the log
14:08amalloyi didn't realize it was so much later or i'd have given a better C-f point
14:08dbaschamalloy: don’t worry, ∀person, ∃t ∈time such that is-chump(person, t) is true
14:09Bronsaamalloy: it wasn't that much later actually, I just stopped reading.
14:09amalloy(inc dbasch)
14:09lazybot⇒ 13
14:10magopiani have several questions regarding the om basic tutorial, several concepts i don't understand and don't know where to look for
14:11magopianstarting 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:12magopian(isn't of much help regarding me understand what it's doing)
14:14jcromartiehuh... cider-jump is supposed to ask if there's no symbol at the point but it doesn't
14:20dnolen_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:27jcromartiegr
14:27jcromartieI updated cider, now cider-jack-in fails because 'The lein executable (specified by `cider-lein-command') isn't on your exec-path"
14:27jcromartiethat seems like a regression
14:28justin_smithwe should add a "it has been X hours since the last cider regression" segment to the topic line
14:29justin_smithjcromartie: could it be caused by leftover elc files from the old cider libs?
14:29jcromartiemaybe
14:29jcromartieI'll clear it out and install fresh
14:33Bronsahiredman: did you notice that I closed CLJ-1503? Maybe your comment would be more useful on CLJ-1425
14:33llasramIsn't The Real Problem (tm) MELPA and not CIDER?
14:33llasramI recently upgraded CIDER from the last stable release on marmalade to the stable release on melpa-stable, and everything went fine
14:36hiredmanBronsa: oh, I did not
14:38hiredmanadded with a link to the wiki
14:39magopiandnolen_: thanks for your answer. So i should rather use @text instead of (om/value text) ?
14:39magopian(there's om/value in a few places in the basic tutorial)
14:39dnolen_magopian: the former will give you the most recent value, om/value is likely to be stale
14:39dnolen_magopian: feel free to update the tutorial - only so many hours in my day :)
14:40magopianyeah, sure ;) i'll push a PR soon then ;)
14:40dnolen_magopian: anybody can update the wiki, no PRs needed, Om doesn't take PRs
14:40dnolen_yet anyway
14:40magopianah, it's a wiki, sure
14:40Bronsahiredman: 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:41magopiandnolen_: thanks for answering, thanks for your time ;)
14:41magopiani'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:41magopianin the intermediate tutorial, it seems the value is taken from datomic instead (and then pushed back in there)
14:41hiredmanBronsa: we need staff philosphers to argue these things
14:42magopianhow does that make a change?
14:42hiredmanis it really a map literal if it allows for duplicate entries but maps do not?
14:42hiredmanwhat does it mean to be a literal?
14:42Bronsahiredman: `#{} doesn't expand to a map literal though
14:44hiredmanBronsa: sure, but maybe it should
14:44hiredmanbut it can't because of splicing
14:44hiredmanbut maybe there should be some kind of splicing set type or something
14:45magopiandnolen_: btw, what if I update the wiki with wrong information? i'm only a newbie :/
14:45hiredmanI actually pulled your ticket as an example of the complications from map literals in another conversation I was having
14:45Bronsahiredman: 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:46hiredmanBronsa: I don't think that is an implementation detail
14:46hiredmana set literal should be a set when it exits the reader, no?
14:47hiredmanand a lisp has got to have a reader
14:48gfredericks,(read-string "#{(gensym) (gensym)}"
14:48clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
14:48gfredericks,(read-string "#{(gensym) (gensym)}")
14:48clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (gensym)>
14:48gfredericksBronsa: ^ what should that do?
14:48hiredmanso 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:49gfredericksit would read into a single-element set?
14:49Bronsagfredericks: yeah I'm not arguing the reader should change its behaviour
14:50hiredmanin my other conversation I was saying you could build some kind of perpetual motion machine from this as opinion oscillates
14:50Bronsahiredman: that used to return #{(gensym)} though, which is even more worse than throwing
14:50hiredmanBronsa: are you sure about that?
14:51hiredmanthe array based collections would actually allow duplicates
14:51Bronsareally?
14:51hiredman(from what I recall)
14:51hiredmanI may be wrong as you well know
14:51Bronsa,(array-map 1 1 1 1)
14:51clojurebot{1 1}
14:51Bronsaunless the internal impl changed I don't think it ever did allow that
14:51AeroNotix,#{(gensym) (gensym)}
14:51clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (gensym)>
14:51AeroNotixthat's retarded
14:52BronsaAeroNotix: 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:52hiredmanin 1.1.0 at least it did
14:52hiredmanI just checked
14:53AeroNotixBronsa: what about #{(rand) (rand)}
14:53BronsaAeroNotix: that's the same thing
14:53hiredmanhttps://gist.github.com/hiredman/c6cdb5fdd77ed13335cc
14:53amalloyBronsa: well, almost the same thing, in that you might by luck end up with a collision
14:53hiredmanso maybe it was in 1.2 that the behaviour changed
14:53BronsaTIL
14:53AeroNotixBronsa: exactly, but you wouldn't argue that someone would expect a set of two
14:53jcromartieaghghghhghghghgh
14:53AeroNotixsomeone wouldn't*
14:54AeroNotixsurely
14:54jcromartieI've nuked my emacs packages, switched to melpa-stable, reinstalled cider etc.
14:54AeroNotix,#{(rand) (rand)}
14:54clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (rand)>
14:54AeroNotixso dumn
14:54jcromartieand it still complains about the exec-path
14:54AeroNotixdumb
14:54Bronsaamalloy: well sure :)
14:54technomancyjcromartie: what does M-x shell-command which lein show?
14:54hiredmanit 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:55AeroNotixhiredman: can't please everyone I guess.
14:55hiredmanperpetual motion guys
14:55amalloyAeroNotix: i can't not fail to misunderstand the convoluted inversions and subjunctives in your "wouldn't argue" claim
14:55jcromartieit says "/bin/bash: lein: command not found"
14:55Bronsa(inc amalloy)
14:55lazybot⇒ 174
14:55AeroNotixamalloy: don't not try to misunderstand it then
14:55technomancyjcromartie: so... that's a problem =)
14:56jcromartieit's at /usr/local/bin/lein
14:56jcromartieand /usr/local/bin is added to my exec-path
14:56technomancyjcromartie: apparently it's not
14:56jcromartieshouldn't this just work like it did for a very long time?
14:57jcromartieI'm a little confused as to why it stopped with a supposedly "stable" Cider
14:57amalloy$echo hello ## my favorite multiple inversion
14:57amalloy$shell echo hello
14:57lazybotamalloy: It is not the case that you don't not unhave insufficient privileges to do this.
14:57amalloysilly me
14:57technomancyjcromartie: not a lot emacs can do if you give it the wrong path though
14:57jcromartiewell it complained before I set up the exec-path
14:57jcromartieI mean
14:57jcromartieit worked before I updated Cider
14:57jcromartiethen I updated Cider and it stopped working
14:57jcromartiethen I tried to set up my exec-path
14:58jcromartieand that doesn't change the situation
14:58jcromartieso, updating cider broke cider-jack-in
14:58justin_smithjcromartie: which cider version?
14:58jcromartieI never set exec-path before
14:58technomancythe real problem is that lein isn't on your $PATH
14:58jcromartie0.7.0
14:59technomancywhat version of cider you're using isn't going to affect that
14:59jcromartiewhy did it work with a previous version of Cider, then?
14:59jcromartieseriously, I was using Cider this morning
14:59jcromartienow I'm not
15:00technomancydid you launch emacs the same way?
15:00justin_smithjcromartie: is this in osx?
15:00hiredmantechnomancy: it does
15:00technomancymaybe it inherited an environment that had the correct $PATH
15:00jcromartieyes
15:00jcromartieI launched Emacs the same way before and after
15:00jcromartie(from Alfred)
15:00justin_smithjcromartie: in osx, things launched bia the GUI do not get the path set up in your shell
15:00technomancywhat's Alfred?
15:00hiredmantechnomancy: newer versions of cider look for lein in some exec-path thing, which may or may not be the same as your PATH
15:00jcromartieright
15:00technomancydid it change?
15:00jcromartieI understand
15:00justin_smithjcromartie: there is a way to set it system wide, or you can launch emacs from a shell
15:00justin_smithjcromartie: either of those will fix it
15:00gfrederickswhat on earth does this do? https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/main.clj#L379
15:00technomancyhiredman: exec-path is just unix $PATH turned into a lisp
15:01technomancy*turned into a list
15:01hiredmantechnomancy: it wasn't on my linux laptop
15:01technomancyhiredman: other things can manipulate the list of course
15:01hiredmantechnomancy: 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:02justin_smithjcromartie: you can also manually add things to the emacs exec-path, that's a third option
15:02jcromartieI did!
15:02jcromartie(add-to-list 'exec-path "/usr/local/bin")
15:02technomancyhiredman: probably you were setting your path in .bashrc or something, which didn't affect the GUI you used to launch emacs
15:02justin_smithOK, weird
15:02technomancyit's a common mistake
15:03hiredmantechnomancy: I used dmenu
15:03technomancyhiredman: but dmenu on its own won't source .bashrc
15:03jcromartieits value is ("/usr/local/bin" "/usr/bin" "/bin" "/usr/sbin" "/sbin" "/Applications/Emacs.app/Contents/MacOS/libexec" "/Applications/Emacs.app/Contents/MacOS/bin")
15:03justin_smithhiredman: OK, so it does sound like a cider problem then
15:03jcromartieand /usr/local/bin/lein is the lein executable
15:04jcromartienot a symlink or anything weird
15:04hiredman*shrug*
15:05technomancyit usually comes down to people conflating .bashrc and environment variables in general
15:05technomancy.bashrc is a specific configuration file for bash, so it shouldn't be surprising that not-bash doesn't use it
15:06technomancy.profile is a more general-purpose thing
15:06clj-learnerHi, i'm learning macros and i'm stuck. why doesnt this work?
15:06clj-learner(defmacro chain [& forms]
15:06clj-learner (when forms
15:06clj-learner `(chain (. (first ~forms) (second ~forms)) ~@(drop 2 forms))))
15:06jcromartieI set cider-lein-command to /usr/local/bin/lein and that seems to work
15:06technomancybut even then some guis like mac os x's will ignore it and force you to edit some xml file nonsense
15:06gfredericksclj-learner: what do you get when you macroexpand, and what would you like to get?
15:07clj-learnerstackoverflowerror
15:07hiredmantechnomancy: anyway, my point is, the version of cider does matter unfortunately
15:07clj-learneri would like it to stop
15:07clj-learnerat the ebnd
15:07clj-learnerend
15:07gfredericksclj-learner: ##(drop 2 '(foo bar))
15:07lazybot⇒ ()
15:08hiredman,(when () 1)
15:08clojurebot1
15:08hiredman,(when (seq ()) 1)
15:08clojurebotnil
15:08gfredericks,(doc nnext)
15:08clojurebot"([x]); Same as (next (next x))"
15:08hiredmanthen what gfredericks said
15:08clj-learneri tried nnext but i got the same
15:08hiredman,(when () 1)
15:08clojurebot1
15:08gfredericks,(nnext '(1 2))
15:08hiredman,(when (seq ()) 1)
15:08clojurebotnil
15:08clojurebotnil
15:09jcromartieWARNING: CIDER's version (0.7.0) does not match cider-nrepl's version (not installed)
15:09jcromartiecider-nrepl is not in melpa-stable...?
15:10gfredericksclj-learner: oh it's also how you're doing your recursion exactly
15:10gfredericksclj-learner: if you did a (prn forms) outside your `when` for debugging I think it'd be obvious
15:10justin_smithjcromartie: cider-nrepl is a clojure lib, not an emacs one
15:11justin_smithjcromartie: goes in your :dev section of profiles.clj
15:11jcromartieI don't even have it there
15:11justin_smithyou need to create it then ~/.lein/profiles.clj
15:12clj-learnerthis is the exercise solution
15:12clj-learner(defmacro chain
15:12clj-learner([x form] `(. ~x ~form))
15:12clj-learner([x form & more] `(chain (. ~x ~form) ~@more)))
15:12clj-learnerbut do i have to use multiarities ?
15:13jcromartieI'm reading TFM right now :)
15:16perplexais there something like a callable? form?
15:16perplexaeg. (callable? #'clojure.core/defn) => true
15:16Bronsaperplexa: you might be looking for `ifn?`
15:16perplexaah yeah
15:16perplexathx :D
15:17justin_smith,(ifn? 'a)
15:17clojurebottrue
15:17jcromartie*sigh*
15:17technomancyhiredman: hm; cider may include a workaround for the problem
15:17jcromartieerror in process filter: Symbol's value as variable is void: results
15:17jcromartiewhat the heck did I do
15:17jcromartiewhy did I try to fix what wasn't broke
15:18technomancyIMO it's better to just fix your PATH though; that way it shouldn't matter
15:18gfredericksclj-learner: you don't *have* to -- you at least have to check how many args you have
15:18gfredericksone way or another
15:18jcromartieI got cider-jack-in working now
15:18jcromartiebut it's just problem after problem
15:18dopamean_does anyone know of a good resource for implementing a BST in clojure?
15:18jcromartiewhat's the best way to uninstall ELPA packages?
15:19hiredmantechnomancy: if anything cider makes whatever problems exist worse as per usual
15:22gfredericksclojurebot: hiredman |does not like| cider
15:22clojurebotc'est bon!
15:26atyz,docs ..
15:26clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: docs in this context, compiling:(NO_SOURCE_PATH:0:0)>
15:26jcromartiecan someone with a great working Cider setup share their .emacs?
15:26justin_smith(doc ..)
15:26clojurebot"([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:27atyzthanks justin_smith
15:27atyzIs there somewhere I can get a link to that?
15:28justin_smithatyz: http://grimoire.arrdem.com/
15:28justin_smithhas examples and lists functions by category, very handy
15:29atyzjustin_smith: thats awesome, finding any of the macros are usually a pain
15:29gfredericksjustin_smith: github.com/gfredericks/dotfiles
15:30justin_smithgfredericks: you probably meant to point that at jcromartie
15:30gfredericksI haven't pegged my emacs lib versions yet though
15:30gfrederickswhat? there are two people whose nicks start with j???
15:30lazybotgfredericks: Oh, absolutely.
15:30gfrederickscrap.
15:30technomancyare there any languages that use "ibid" as *1?
15:31technomancyjcromartie: I'm just using cider 0.6 from a checkout
15:31technomancyworks fine, provided lein is correctly installed
15:32gfrederickssomeday soon I am going to use el-get and presumably that will be better
15:33justin_smithtechnomancy: (conor .... (sic ...)) is the new try/catch
15:33technomancyyes please
15:33technomancyjustin_smith: I mean if erlang can use commas and periods, why not?
15:34justin_smithif we use more latin, we can make clojure seem much more sophisticated and mature
15:40gfredericksjcromartie: I'm on cider 0.7.0 FWIW
15:49shembernie greenberg, the multics kernel lisper, used latin in error strings and comments
15:50shem"hodie natus est radici frater"
15:52justin_smithhttp://www.multicians.org/hodie-natus-est.html
15:55shemi had some correspondence with bernie in the 90s. really funny, nice guy
15:59jcromartieso the new testing support in Cider really changes the workings of C-c , huh
15:59jcromartiesince I don't name my test namespaces like foo.bar-test, I'm just out of luck
16:00jcromartieinstead I name them foo.test.bar
16:03aztakgd'evening
16:06TimMcshem: I had the pleasure of working with him a couple years ago.
16:09shemTimMc: wow. must have been fun.
16:11technomancygreenberg from Hackers?
16:13michaelr524Hello
16:13technomancyoh, thatwas greenblatt
16:13michaelr524Who are the intellij users in here?
16:13michaelr524I'm looking for the parallel from emacs for Meta-Space and Meta-\
16:14michaelr524For condensing whitespace to one or zero spaces respectively
16:17TimMcshem: It was a bit hard to keep up with him in conversation. :-)
16:22shemTimMc: i can imagine… :)
16:27terommichaelr524: 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:30terom*think there's no such thing, I mean
16:34aztakso, (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:36stuartsierraIf you're going to log it, catch `Throwable`
16:36aztakstuartsierra: yeah, that's what I discovered. :)
16:37michaelr524terom: 10x
16:37ghadisha`i wrote a macro that works like assert but throws ex-info rather than AssertionError
17:17perplexais there a way to expand macro use in function bodies? something like (macroexpand-all (source fn)) where fn itself is not a macro?
17:19amalloyperplexa: what on earth would that do?
17:20perplexaamalloy: just curious what a function using the thread-last macro would expand to ;p
17:23amalloyperplexa: slime includes a macroexpansion facility; nrepl may too, for all i know
17:23amalloyif so, you can M-. to the source of the function, point at the macro confusing you, and ask to macroexpand it
17:24justin_smithperplexa: well, fn is a macro, so you can expand it ##(:macro (meta #'fn))
17:24lazybot⇒ true
17:24amalloyjustin_smith: fn was a metasyntactic variable in perplexa's question, not referring to c.c/fn
17:25justin_smithOK
17:30perplexaoh i just realised that i can paste the function after (macroexpand-all ' in nrepl
17:31justin_smithperplexa: that's what I was getting at with the "fn is a macro you can expand it" thing
17:31perplexai thought it was not possible, because i tried it at some point earlier, but must have pasted a syntax error ;x
17:38borkdudecfleming I'm trying to use core.typed for cljs in cursive, I don't get it to work right now
17:39borkdudecfleming it seems to want to compile a cljs as a clj file
17:43cflemingborkdude: Yes, I haven't added that support yet since it seems to be experimental in core.typed.
17:43borkdudecfleming 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:43borkdudecfleming I got a cljs type error via the typed plugin
17:44cflemingborkdude: Does that type check the whole project at once? I guess you can't type check a cljs ns in the REPL?
17:47borkdudecfleming I don't know why core.typed checking is coupled to having a REPL
17:47borkdudecfleming 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:48cflemingborkdude: 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:49borkdudecfleming that is why it's coupled to a repl now?
17:51cflemingborkdude: Yes, and also that I based this integration on the existing plugins.
17:53borkdudecfleming 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:53borkdudecfleming https://www.dropbox.com/s/t3bn2gsyu95bct1/Screenshot%202014-10-14%2023.53.49.png?dl=0
17:55borkdudecfleming so maybe: when you have a REPL, offer to typecheck whatever namespace, could be an option
17:56cflemingborkdude: Is there a cljs.core.typed/check-ns-info that returns a map?
17:56cflemingborkdude: 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:57borkdudecfleming https://www.dropbox.com/s/i6oohpt6dhbus7p/Screenshot%202014-10-14%2023.56.52.png?dl=0
17:57fbobHi. 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:57cflemingborkdude: Thanks, looks promising.
17:58cflemingborkdude: I'll see about getting that in there.
17:58amalloyfbob: else will be evaluated whether or not the key is in the map
17:58amalloyget is a function, and that is just how functions work: all of their arguments are evaluated
17:59fbobamontalenti: I see. I didn't realise. Maybe I should use a let binding somehow?
17:59fbobOops, amalloy
17:59amalloyboy, amontalenti has a way cooler last name than i do
18:00amalloyit 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:00borkdudecfleming would be cool
18:01fbobamalloy: I just want to update the map if they key doesn't exist in the map
18:01noonianfbob: you want swap!
18:01fbobI decided I wasn't going to do it inside the function of swap!, maybe I was wrong
18:02noonian,(swap {:foo 17} (fn [the-map] (if (:non-existent the-map) (assoc the-map :non-existent :bar))))
18:02clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: swap in this context, compiling:(NO_SOURCE_PATH:0:0)>
18:02amalloyfbob: any time you do something to an atom which is not inside a swap!, you are generally wrong
18:02noonian,(swap! {:foo 17} (fn [the-map] (if (:non-existent the-map) (assoc the-map :non-existent :bar))))
18:02clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.Atom>
18:02noonian,(swap! (atom {:foo 17}) (fn [the-map] (if (:non-existent the-map) (assoc the-map :non-existent :bar))))
18:02clojurebotnil
18:02nooniandoh
18:03fbobamalloy: Thanks for the advice!
18:03amalloythe 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:03nooniando it in the else
18:03fbobIs if else lazy then?
18:03noonian,(swap! (atom {:foo 17}) (fn [the-map] (if (:non-existent the-map) the-map (assoc the-map :non-existent :bar))))
18:03clojurebot{:non-existent :bar, :foo 17}
18:04noonianfbob: 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:06fbobnoonian: I don't think I understand
18:08noonianfbob: 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:09fbobnoonian: I thought else would be evaluated on call
18:10fbobWhat gives this away in the api, is it the question mark?
18:10noonianfbob: yes, the expression there will be evaluated before get gets called
18:10noonian,(doc get)
18:10clojurebot"([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."
18:10noonianfbob: which question mark?
18:11fbobFor if
18:11fbobNot get
18:11noonianah, my bad I thought you were asking about the behavior of else in get
18:11fbobWell, I kind of am asking both
18:11fbobThat's why I was asking is it lazy in if, which it seems to be
18:12noonianif is not a function, its a macro, so if receives its arguments unevaluated
18:12noonianit evaluates the test, then the appropriate branch and not the other one
18:13amalloynoonian: if isn't a macro, it's a special form
18:13noonianyes
18:14dav_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:14amalloydav_: that's what nrepl is supposed to be
18:14dav_amalloy: does any other language use that?
18:15amalloyoh man. you want a language-universal toolkit? good luck. i am not aware of any such thing
18:15amalloythe landscape is littered with the bones of those who have tried
18:15dav_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:16dav_wouldn't be a toolkit per say
18:16dav_just a communication protocol
18:16technomancytechnically you could write an nrepl server in any language
18:17dav_the repl is probably the simplest part
18:17dav_static code analysis requires a bit more communication
18:17noonianamalloy: often if is a macro for cond but clojure is the other way around i guess
18:17technomancydav_: you can invoke all kinds of commands over an nrepl connection
18:17amalloynoonian: yeah, indeed it is often the other way around
18:17technomancydav_: http://p.hagelb.org/clojurewest-2014.org.html
18:17dav_technomancy: yes as I said the repl is the simplest protocol..
18:18dav_technomancy: interesting post
18:19technomancydav_: it's just a proof of concept, but you could go a lot further with the idea
18:20nooniandav_: you can use emacs for all the languages except apple's pretty much hehe
18:20dav_noonian: that's the thing, I don't know emacs.
18:21noonianyeah, its definitely a learning curve. I've only been using it for a few months now
18:22dav_noonian: I've been using vim for 15 years, gonna be hard to change for me at this point..
18:22justin_smithnoonian: learning spiral :)
18:22justin_smithdav_: have you tried evil mode at all?
18:22dav_justin_smith: I have, couldn't get used to it
18:22justin_smithmy intro to emacs over a decade ago was viper mode
18:23justin_smitha predecessor to evil
18:23justin_smiththe keybindings are not the good part of emacs, so keeping most of your vi keybindings is fine imho
18:24dav_to be fair, I think we focus too much on "text manipulation" and not enough on "coding features"
18:24taliosemacs existed before evil? so thats.... pre-fall. I always knew emacs was Gods preferred editor.
18:24dav_ultimately, the latter should be quite standard across editors
18:24dav_hence my thought that an IDE "protocol" should be put in place
18:24dav_given the rate at which languages come out
18:24dav_and the number of editors
18:25technomancyvim works fine with nrepl
18:25metellus<insert xkcd about creating new standards>
18:28dav_metellus: the created freedesktop..
18:28dav_*they
18:28dav_not sure why we couldn't have freeide
18:28dav_unlike the xkcd standard joke, sounds like it would be the first attemt..
18:28metelluscreating standards is easy, getting people to centralize on one is hard
18:28dav_metellus: sure, happens over time
18:28technomancydav_: why make something new when the tooling already exists?
18:29dav_technomancy: the tooling exists for one feature, one language
18:29metellusdav_: every editor has its own set of ide features and things right now, and those are the existing "standards"
18:29technomancydav_: two languages, N features
18:29dav_technomancy: repl is 1 feature
18:29technomancydav_: I have it working for arbitrary features
18:30technomancytoggle-trace, slamhound, test, etc
18:30dav_technomancy: completion, code analysis
18:30technomancydav_: completion is already implemented, type checking is a small leap
18:31dav_technomancy: the 2nd language is.. clojurescript?
18:31technomancydocstring lookup, javadoc, inspect
18:31technomancyyeah
18:31technomancyI bet I could write a racket backend in a weekend
18:31technomancy(but I wouldn't, because the existing racket tools are already a lot better)
18:32dav_is there a standard way to communicate back to the editor? on this file at that line/colum, add this warning, etc.
18:32dav_a way that all editors know how to use?
18:33dav_s/all/most?
18:33dav_s/most/a few of the major ones
18:33technomancyI have a sketch of a protocol and a proof-of-concept implementation for emacs
18:33technomancythe emacs implementation was ~2 evenings of hacking to write
18:33dav_cool, it's the beginning of the freeide protocol :)
18:34dav_i'll have a closer look at nrepl
18:34justin_smithtechnomancy: "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:34dav_going to bed now, night.
18:35technomancyjustin_smith: actually with racket people are disincentivized to do stuff like that just because drracket is so far ahead of everything else
18:36justin_smithtechnomancy: sorry, referencing an obscure old meme
18:37justin_smithhttp://www.escapistmagazine.com/forums/read/18.204104-100-push-ups-200-sit-ups
18:41justin_smithyou're better off for it
18:42gzmaskplaying 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:43justin_smithgzmask: liberal use of declare?
18:44gzmaskjustin_smith: thought of that, any other ways?
18:44justin_smithnot that I know of, I think literate programming setups are pretty linear
18:45gzmaskI 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:46amalloygzmask: is it so much harder to write the narrative in compiler order?
18:47gzmaskI don't know others. I already find my original function too big, then have to break it into little ones
18:47gzmaskalways*
18:48afhammadwhy is it necessary to define functions in order?
18:49gzmaskcompiler would complain. but there is declare ...
18:49justin_smithafhammad: that's a restriction of the clojure compiler
18:50afhammadit did complain, thats why I ask :)
18:50dbaschsome people prefer Memento-style coding
18:50gzmaskI think the order thing makes clojure performance more predictable. I like it
18:51justin_smithalso it makes files and the repl compatible
18:51dbaschI’ve got this error condition…
18:51technomancyhelps you spot typos, theoretically
19:02mdeboardHi, 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:02mdeboardHow would I do this
19:03mdeboardThis is kinda it:
19:03mdeboard&(map #(zipmap [:col :row] [% %2]) (range 6) (range 6))
19:03lazybot⇒ ({: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:04mdeboardbut It should yield 36 entries
19:04justin_smithmdeboard: for?
19:05mdeboardyeah I reckon a for loop would work
19:05justin_smith,(for [col (range 6) row (range 6)] {:col col :row row})
19:05mdeboardbut I figured there is some incantation
19:05clojurebot({:col 0, :row 0} {:col 0, :row 1} {:col 0, :row 2} {:col 0, :row 3} {:col 0, :row 4} ...)
19:05mdeboardnailed it
19:05mdeboardthanks
19:05justin_smithbtw, pedantically, it's not a for loop
19:05justin_smithfor is a lazy list comprehension
19:06mdeboardnoted
19:06justin_smithit's an unfortunate name, since for is a loop in most languages
19:06amalloyjustin_smith: how about python, where there are two fors, one a loop and one a comprehension?
19:07justin_smithsadly, I know no python, 'tis my achilles heel
19:08amalloyor scala, where it's a monadic comprehension. haskell doesn't really have for, but it does have forM and forM_
19:08amalloyreally i think it's mostly C-family languages that have the C for loop
19:08justin_smith*algol family
19:08amalloyi think i've probably overstated my case here
19:08amalloybut "most" languages is a bit strong
19:20cbppython only leads to misery anyway
19:24noonian(inc cbp)
19:24lazybot⇒ 9
19:25amalloyreally, 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:25noonianwell, i'm dealing with said misery as we speak
19:27mdeboardit's a poor craftsman etc., etc.
19:27amalloyyeah, exactly. so far i can equally well conclude that working with programs noonian has worked on only lead to misery
19:28noonianamalloy: i'd say you do more than your share of fostering a culture of unfriendliness in this room...
19:28SorellaPython 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:36amalloyyou'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:38amalloyinfidel!
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{blake}Also, even great programmers working in great languages can end up with crappy code.
19:42amalloy{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{blake}Good lord, I don't even know what it means...
19:48justin_smithamalloy: 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:48justin_smithfeaturing the standard tubby farmer holding a pitchfork of course
20:37uptownhello nice clojure people. noob here. not sure how to untangle my deps as seen here http://pastebin.com/NjwMMfms
20:38uptownadding the suggested exclusion makes clj_time throw
20:38amalloyuptown: 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:39uptownthanks, will press on
20:41xeqiI should fix that exclusion message
20:41xeqiuptown: feel free to make an issue at https://github.com/technomancy/leiningen/issues about the exclusion suggestion not helping
20:43uptownwill do.
20:50uptown..added. i hope my descriptions are somewhere near useful. i'm still new at reading the clj stack's tea leaves
20:52amalloyuptown: is https://github.com/technomancy/leiningen/issues/1729 yours? the paste is dead
20:53sritchiehas anyone seen M-. break with the cider 0.8.0 snapshot?
20:54sritchiethis started happening for me when I upgraded to the 10.07 build
20:54sritchieI see “symbol <whatever> not resolved” in the minibuffer
20:56uptownamalloy: missed a letter. should be fixed
21:10justin_smithsritchie: did you also update the cider nrepl middleware?
21:10sritchieit’s in my plugins, and it’s on snapshot,
21:11sritchiebut cider isn’t detecting it
21:11sritchieI put it in my dev profile
21:12technomancysritchie: you probably want your :user profile?
21:12sritchieyeah, I had moved it in to try to get it to register somewhere
21:12technomancy(and also to not use snapshots)
21:12sritchiewell,
21:12sritchiesure
21:12sritchiebut 0.8.0 wasn’t out at the time
21:12sritchieI don’t think it’s been published at all
21:13justin_smithyeah, only snapshot versions of 0.8.0 are out right now
21:14justin_smithsritchie: it should be in your dev profile, not plugins
21:14justin_smithsince it is needed in the running process
21:14sritchieit’s in the :plugins vector in my :dev profile
21:14sritchieah
21:14sritchieso put it in the dependencies?
21:14justin_smithright
21:15sritchieokay, trying that now
21:16sritchie184f13f27ad1b25ab3091055aaed39323d95c211
21:16sritchiewhoops, sorry
21:18sritchiejustin_smith: looks like these instructions are busted, if that’s true: https://github.com/clojure-emacs/cider
21:18sritchiesince it says to place this in plugins
21:18justin_smithhrm...
21:18synktetest
21:19justin_smithsritchie: I know the middleware is needed at runtime, and afaik lein plugins are not in the repl process at runtime
21:19hiredmancider is the worst
21:19sritchiehaha
21:19justin_smith~cider
21:19sritchiehiredman: what should I use?
21:19clojurebotcider is rage-inducing
21:19hiredmansritchie: I dunno
21:19sritchieanything build / dev related is rage inducing
21:19hiredmancider just keeps changing things and breaking things
21:20hiredmanit is no kind of basis for people to actually get work done
21:20hiredmanthe vm I use for work has some crazy old version of nrepl and clojure mode on it
21:20xeqioh how I despise everyone who works on tooling
21:20sritchie:)
21:20sritchieyeah, it’s still hosed, even though I can print the classpath with clojure.java.classpath and SEE cider-nrepl
21:20arrdem"cider is shit!" <- doesn't work on cider
21:21hiredmanmy 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:22hiredmansritchie: you are at least the 3rd or 4th person in here complaining that M-. doesn't work
21:22sritchieyeah, I believe that the whole thing is hosed
21:23sritchieand that seems like a major regression
21:23sritchieI won’t be the last, I bet
21:25arrdemthere are no open cider issues wrt M-.
21:25arrdemthat I can find
21:25hiredmannrepl.el went from a stable but clunky project to 1000x larger project that breaks all the time
21:26sritchiewith a name change, always helpful
21:26hiredmanemacs basically went from being the best clojure dev environment to being broken all the time
21:27sritchietrying to debug the nrepl version issue now
21:29sritchiehiredman: who runs that project?
21:29sritchiehiredman: are they in IRC now?
21:30hiredmanbbatsov, I dunno
21:30justin_smithbbatsov isn't here or in #emacs, so I assume he isn't on IRC
21:30justin_smith$seen bbatsov
21:30lazybotI have never seen bbatsov.
21:31arrdemsritchie: bbatsov doesn't spend a lot of time in here. there is a cider channel. lemme see if I have it.
21:31arrdemsritchie: #clojure-emacs
21:34sritchiedebugging emacs lisp, great
21:37hiredmanbbatsov also claims to be the editor of the clojure style guide
21:37cursivecode If cider and nrepl are not good, what do people use for clojure development?
21:38hiredmannrepl is a distinct thing from cider
21:38hiredmannrepl.el is also distinct from nrepl
21:38hiredmannrepl is a general network repl sort of protocol
21:38hiredmannrepl.el is an emacs client
21:38nooniancursivecode: lein repl
21:39hiredmancider is a the nonsense nrepl.el turned in to
21:39noonianbut i haven't personally had a problem with nrepl or cider; i think the version of cider i have installed usually works fine
21:39llasramFWIW, I've had no problems running the stable releases of CIDER
21:40sritchiegreat, when I run (cider--check-middleware-compatibility) AFTER the repl’s set up,
21:40sritchieit reports the proper version
21:42xeqiI've been running 0.7.0 cider with minor issues, though I hear lots of good things about cursive
21:52cflemingxeqi: 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:52xeqicfleming: can I ask you to charge for it already?
21:54cflemingxeqi: I'm actually surprised at the number of people that do!
21:55xeqihttps://www.youtube.com/watch?v=OnB1TgxgwEA
21:57cflemingA classic!
22:01sritchierolled back to 0.7.0
22:01sritchienow it’s totally broken
22:06technomancysritchie: the name change was actually really great because it means it's easy to fall back to something that works
22:06sritchieyeah, I suppose that’s true
22:06sritchiename changes seem better than major version changes
22:07technomancydoesn't exactly scale in the longh run
22:17amalloyspeaking of using old tools because cider is unstable: devn, did you ever get swank/slime running successfully from my dotfiles?
22:17RazWelle1How 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:18RazWelle1(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:18amalloyRazWelle1: 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:18justin_smithamalloy: 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:19justin_smithmakes sense, a bunch of elisp stuff basically has defonce semantics
22:19sritchiejustin_smith: amalloy well, I can’t confirm that that was the cause of the M-.
22:19sritchiejustin_smith: this was my issue with downgrading back to 0.7.0
22:19amalloy_pr0t0type_: ##(doc get)
22:19lazybot⇒ "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."
22:21justin_smithsritchie: OK, so it's not a full explanation
22:21justin_smithbut could your problems on the initial upgrade had a similar source?
22:21_pr0t0type_amalloy: perfect, thanks!
22:30sritchiejustin_smith: I THINK what was going on -
22:30sritchiejustin_smith: and the reason M-. broke,
22:30sritchiewas that I had installed a version of cider-0.8.0-SNAPSHOT a while ago
22:31sritchiebut the snapshot version in my lein/profiles.clj was upgrading every single day
22:31sritchiejustin_smith: so an incompatility just appeared out of nowhere
22:31justin_smithright, SNAPSHOT versions do that
22:31sritchieyeah, I get it
22:31sritchieso publishing snapshots for cider-nrepl is insane
22:31sritchiesince the snapshot version of cider doesn’t auto-upgrade
22:32sritchiethe better thing would be to publish a timestamped version
22:32justin_smithI think even with a snapshot, an API incompatibility should be a version change
22:32justin_smithlike why not name it 0.8.1-SNAPSHOT 0.8.2-SNAPSHOT etc.?
22:32justin_smithor timestamps or commit hashes, yeah
22:33bostonaholicyou should never be dependent upon a snapshot that you do not control
22:34justin_smithbostonaholic: I guess the sparkly shiny features of the latest alpha are too good to resist
22:34bostonaholichttp://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom-syntax.html
22:36bostonaholicI 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:36justin_smiththat sounds quite sane
22:39bostonaholicif you must depend on -SNAPSHOT, I would recommend having a CI server setup that also builds projects with depend on that -SNAPSHOT
22:39bostonaholicthat was you know right away if it is incompatible
22:40bostonaholicworst case scenariou
22:41justin_smithwell, 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:44RazWelle1Is there a way to import all rather than specifically go (:import [Library Object])?
22:45RazWelle1Like (:import [Library *])
22:45llasramRazWelle1: Nope
22:46llasramJava fakes it by internally creating a search path for each such import, but
22:46RazWelle1:\
22:46RazWelle1is there an alternative to import?
22:46llasramseveral 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:47llasramIn what sense?
22:47RazWelle1I'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:47RazWelle1In python I'd just do dir(assembly) after import
22:47RazWelle1Not sure what to do here
22:47llasramOh, clojure-clr?
22:47RazWelle1Yeah
22:48llasramI'm afraid I myself cannot provide any insight
22:48RazWelle1much appreciated anyway :)
22:48llasramGood luck!
22:48RazWelle1I did it once but I lost the code xD
23:00allenquick 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:00allensorry, i have no x server running, so i can't easily view source code and example code on my terminal :/
23:01llasramallen: (require 'whatever.your.namespace.is) then (in-ns 'the.same.thing)
23:01llasramallen: 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:02allenllasram, ahh ok I was trying (require '[project-name.core])
23:02allenllasram, I have emacs split vertically and have a shell process with lein in the second split
23:03technomancyallen: what does an X server have to do with viewing source code?
23:03llasramtechnomancy: I think they mean they don't have a graphical Web browser available
23:03allentechnomancy, can't view stuff on github through lynx
23:03allentechnomancy, DAMN, i just realized i can pull code... FAIL
23:03technomancyoh, like source code rendered as HTML?
23:04allentechnomancy, yeah that, but I realized, that's not essential... hmmm
23:04llasramTo be fair, a significant chunk of documentation is displayed primarily as HTML...
23:04allenwell, I do have lynx
23:04technomancyonly lame docs
23:04allenso I can view a quick gist if someone's readme is well documented
23:05llasramtechnomancy: 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:56RazWelle1Does anyone know how to inspect an assembly loaded with clojure-clr?