#clojure logs

2014-05-01

00:08amalloyi remember lein-xml. that was a good plugin
00:13livingstonamalloy: what did it do? (I've never seriously use lein)
00:13amalloylivingston: it was an april fool's joke
00:14amalloyit did some kind of conversion between project.clj and pom.xml
00:14livingstonah
00:14amalloyi think it let you specify project.clj in an xml format that looked like pom.xml
00:15livingstonI kinda get why people hate the xml, but it's really not that bad once you've used it even a little.
00:15amalloys/xml/parens is the more usual thing to hear in here
00:15livingstonif I had to tinker with it daily it would probably drive me nuts, but honestly you mostly just forget about it. maybe come drop in a resource from time to time.
00:17livingstonI mean yeah the sexperssions are easier and you don't have to know what tag to use to close etc. blah blah but half the time in a big config file like that you end up notating ;end foo section anyway
00:19amalloyi've never written ;end foo to denote a sexpr section in my life
00:19amalloymaybe when i'd been using clojure for a week
00:19livingstonoh no not in code
00:20amalloyanyway, i don't know how i wound up involved in a "you defending xml from me" conversation, since i never said anything bad about xml
00:20livingstonI meant in some big ungodly configuration file or something where the blocking may not be so obvious or scroll off the screen. in code that's definitely bad code.
00:20livingstonlol
00:20amalloyright. i was saying i've never done that
00:20amalloywhy would i have such an ungodly config file?
00:21livingstonI don't know, if you shove everything I have in my most complex pom into a project file I bet it would get somewhat unruly? maybe not
00:22amalloyi'm sure it would
00:22amalloybut that's one reason people like leiningen. project.clj doesn't have to have all that mess that's in pom.xml
00:27livingstonok, time to go. thanks for talking everyone. goodnight.
00:32yuri_niyazovHi guys. I have a question
00:32yuri_niyazovConsider this form: (doseq [:let [a 1] b '(1 2 3)] (println b))
00:32yuri_niyazovversus this one: (for [:let [a 1] b '(1 2 3)] (println b))
00:33yuri_niyazovThe first one compiles and runs fine. The second one breaks.
00:33yuri_niyazovIs that known and expected behavior, or is it a bug?
00:33Frozenlocksecond one is lazy
00:33yuri_niyazovNo, the second one is invalid.
00:34danoyoungIllegalStateException Can't pop empty vector clojure.lang.PersistentVector.pop (PersistentVector.java:380)
00:35FrozenlockYeah that too, what's up with this syntax?
00:35yuri_niyazov:let, :when and :while are modifiers that you can put inside doseq and for
00:35yuri_niyazovhttp://clojuredocs.org/clojure_core/clojure.core/for
00:36FrozenlockI know that, but they're usually used after the binding
00:36Frozenlocklike this (for [b '(1 2 3) :let [a 1]] (println b))
00:36yuri_niyazovYea, I am aware of that too.
00:37yuri_niyazovHowever, it is certainly usual that the first item in that form is a binding for a seq rather than a modifier
00:37yuri_niyazovbut it is not, strictly speaking, incorrect.
00:37yuri_niyazovBecause it is supported in doseq
00:37FrozenlockEhh I don't know about that. My repl is chocking when I try your form.
00:37yuri_niyazovfor doseq?
00:37Frozenlockno, for `for'
00:37yuri_niyazovyes
00:37yuri_niyazovThat's exactly my point
00:37yuri_niyazovIt chokes for me to
00:37yuri_niyazovtoo
00:38yuri_niyazovBut it doesn't choke on doseq
00:38FrozenlockOk, so your point is that this form should work for `for' too?
00:38FrozenlockPerhaps... fill a bug on Jira :-p
00:38yuri_niyazovHappy to do that. Was just wondering if this is known
00:39FrozenlockIt's frankly the first time ever I see someone writing those this way
00:40yuri_niyazovit's shorthand for (let [a 1] (for [b '(1 2 3] ...))
00:40FrozenlockAnd it's probably because if you use `let' in a loop, it's to use something from the binding, like this (doseq [b '(1 2 3) :let [a b]] (println a))
00:40yuri_niyazovit obviates the need for one level of nesting
00:40FrozenlockSure, I'm aware of that. But you're writing it in reverse :-p
00:41Frozenlock,(doseq [b '(1 2 3) :let [a b]] (println a))
00:41clojurebot1\n2\n3\n
00:41Frozenlock,(doseq [:let [a b] b '(1 2 3)] (println a))
00:41clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: b in this context, compiling:(NO_SOURCE_PATH:0:0)>
00:41yuri_niyazovthe :let form isn't required to use something from a binding
00:42yuri_niyazovit can be an arbitrary function call to anywhere else
00:42FrozenlockCorrect.
00:43beamsomoving the :let after b '(1 2 3) worked for me.
00:43Frozenlockbeamso: Yeah, that's how it's usually used.
00:44beamsoi couldn't remember seeing it before
00:44Frozenlock:let ?
00:44yuri_niyazovCorrect. Except that the :let after b '(1 2 3) rebinds it on every execution of the loop
00:44yuri_niyazovso, if [:let a (expensive-fn-call)] then that's wasteful.
00:45yuri_niyazovI *understand* that I can move it out of the for form, which is what I am doing at the moment
00:46beamsohttp://clojuredocs.org/clojure_core/clojure.core/for mentions that it's illegal for for to start with :let
00:46Frozenlockbeamso: What's surprising is that it isn't for `doseq'
00:46Frozenlockamalloy: need an expert here.
00:48amalloyi've never understood why it doesn't work with 'for. some implementation detail, i imagined, since i don't see a technical reason it couldn't
01:45muhukIs there a function in core, that assigns test's (non-nil) result in a while? while-let like when-let.
01:47muhukI don't have a collection to start with, just a function. Would the idiomatic way be (repeatedly f) ?
01:54dbaschmuhuk: it sounds like you could do it with a regular loop. What does your function do?
01:56TravisDAh, are there any tricks for dealing with laziness and dynamic bindings?
01:57muhukdbasch: pops something from a queue-like object, returns nil if it's empty. I need to repeatedly call this function each time and process all items. It is an input queue.
01:59dbasch(loop [something (pop queue)]
01:59dbasch(when something (do whatever (recur (pop queue))))
02:00TravisDDoes anyone have a common workaround for this type of problem?
02:00TravisD,(def ^:dynamic x 0) (binding [x 1] (lazy-seq [x]))
02:00clojurebot#'sandbox/x
02:01TravisDer
02:01muhukdbasch: thanks, I was hoping to avoid that. But I couldn't come up with anything better either.
02:01muhukI was hoping the seq returned by (repeatedly f) to terminate when f returns nil.
02:03TravisDbut yeah, realizing a lazy-seq created inside a binding form outside of the binding form will not reflect the bindings. Do laziness and dynamic binding just not play well together?
02:04muhukTravisD: there should be another way to do XXX without combining binding/lazy-seq. If we knew XXX...
02:04dbaschmuhuk: you could do (take-while (complement nil?) (repeatedly f))
02:04muhukdbasch: neat. But I'll go with your 1st suggestion. There's & body.
02:05TravisDmuhuk: It is true that I'm working on another problem, but I asked the question because I am curious
02:06muhukTravisD: it's cool. I just don't think there's a way out there.
02:08TravisDthat's unfortunate :(
02:18TravisDlooks like you can use bound-fn to reinstall the bindings present when some function was called
02:34`tlmWhat would be a good name for a higher order function like this?
02:35`tlm(fn [f coll] (if (< (count coll) 2) [] (map f coll (rest coll))))
02:35`tlm(It returns a collection of results from calling f on every two adjacent elements of coll.)
02:35amalloy`tim: that's just (map f coll (rest coll)). there's no need for the if clause
02:36amalloyalso, (< (count coll) 2) is really bad: consider how it works when given an infinite sequence. instead, you want (not (next coll))
02:37`tlmamalloy: Ah, so the idiom is short enough there's no need for a function...
02:37`tlmGood point!
02:38amalloy`tim: i'd also often do it differently, depending on what f is: (for [[a b] (partition 2 1 coll)] (...use a and b...)) is more my style, unless there's a ready-made f
02:40`tlmDo you happen to know what this would be called in other Lisps, where (cdr '()) throws an error?
02:41amalloyare there a lot of such lisps? most of them return '() afaik
02:42`tlmMaybe it's just Scheme.
03:06cpetzoldDoes anyone know of any public web api’s that return edn?
03:15Raynescpetzold: Refheap's API.
03:15cpetzoldRaynes: oh cool, thanks!
03:16Rayneshttps://github.com/Raynes/innuendo Is a client to that API that uses edn
03:18cpetzoldhmm, application/clojure
03:20cpetzoldRaynes: so if I’m reading this right.. https://www.refheap.com/api/paste/83935?return=clojure should return me a paste in edn?
03:21cpetzoldoh, looks like they changed it to application/edn
03:21cpetzoldhttps://www.refheap.com/api/paste/83935?return=edn works
03:22amalloyheh. "they"
03:22Raynesamalloy: Shhhhhhh stealth
03:22amalloycpetzold: for context, refheap is Raynes's thing. he's secretly trying to gain more users
03:23cpetzold:D
03:23cpetzoldi see
03:23cpetzoldWell you need to update innuendo then ;)
03:24cpetzoldBy the way, here’s what your api looks like using the really stealthy project I’m working on: https://cloudup.com/c7pOt5pXmWE
03:24TEttingerI use refheap to generate copious amounts of fake words https://www.refheap.com/16011
03:25amalloyis your project google chrome, cpetzold?
03:25amalloy(i kid, i kid. a chrome extension to pretty-print edn is pretty sweet)
03:25cpetzold:P
03:26amalloythose are surprisingly pronounceable, TEttinger
03:27amalloythough i confess i'd stumble over rhourtauspotron
03:27TEttingerthe fake star wars names https://www.refheap.com/83943 are even harder to tell from the real ones
03:29TEttingerI had help on the first one, which is meant to be fake ancient greek
03:29amalloyTEttinger: tbh it sounded like a mix between greek and cthulu
03:29amalloymore like greek names for chemicals than people, though
03:29TEttingerconsidering cthonic is the adjective for earth gods in greek haha
03:30gkoAny user of cider ? It seems to make Emacs hanging (high CPU load, only solution is to kill Emacs) from time to time on Windows...
03:31TEttingererr chthonic https://en.wikipedia.org/wiki/Chthonic
03:32dbaschsome of those words are real
03:33TEttingerdbasch, that was the hope yes
03:34dbaschanyway, neat
03:34TEttingerthanks, it's a great use for a one-liner
03:43jack_rabbitHey, there. Is it appropriate to ask questions about Korma, the clojure sql library, here?
03:43Frozenlocksure
03:44jack_rabbitI've got a question regarding relationships between entities. I have a 'user' entity which "has-many" 'posts', but when I (select users (with posts)), I get "IllegalArgumentException No value supplied for key"
03:47jack_rabbitIt seems when I have an odd number of users, the query doesn't work. The returned structure is a map, but each key is a 'user' and its value is also a 'user'.
03:47jack_rabbitSeems like it should be a list rather than a map, but I'm not sure quite what I'm doing wrong.
03:52dimsuzhello! I do this: (map :a [{:a 1} {:a 2} {:a 1} {:a 2}]) => (1 2 1 2), is there a quick way to make returned seq uniq? i.e. (1 2)
03:52dimsuzi mean maybe give some clever function to map rather than :a
03:52dimsuzi smell 'set' here, but dunno where to put it...
03:53dbasch,(distinct (map :a [{:a 1} {:a 2} {:a 1} {:a 2}]) )
03:53clojurebot(1 2)
03:53dimsuzoh, ok, so I'll have to apply a function to the result. just thought maybe i can get away with just 'map' :)
03:54RaynesYou could reduce into a set.
03:54dimsuzi also know i can do into #{}
03:54dimsuzI see, thanks!
03:55Raynes(reduce #(conj % (:a %2)) #{} [{:a 1} {:a 2} {:a 1} {:a 2}])
03:56RaynesBut you don't really lose anything by doing into after a map.
03:56RaynesMap is lazy.
03:56dimsuzor shorter: (into #{} (map :a [{:a 1} {:a 2} {:a 1} {:a 2}]))
03:56RaynesWhat I was just saying, yes.
03:57dimsuzok :) i just thought maybe there's some syntactic sugar I didn't know about, decided to ask :)
03:57dbaschbut into is not lazy, distinct is
03:57dimsuzoh, right.
03:58RaynesWhich is extremely unlikely to matter in this case.
03:58RaynesDepending on how representative the input set is :P
03:58dbaschsure, but “be lazy when possible” is good practice, especially when you don’t lose clarity :)
03:59RaynesSets exist for a reason.
03:59RaynesIf you're faking set behavior, you often should just use a set.
03:59amalloystop the presses! new headline: "Laziness doesn't matter", says Raynes
03:59Raynes:p
03:59RaynesAnyways, it really just depends on the greater goal.
04:00RaynesBut OP mentioned sets specifically.
04:00RaynesSo I was kinda latching on to sets.
04:00dimsuzusecase is i receive some data from DB and need to distinctify it. but now that you said it I see that I can ask DB to do that for me instead
04:01RaynesWhat database? :o
04:01dbaschselect distinct :P
04:01RaynesI don't know of many dbs that don't do that for you if you ask nicely enough.
04:12dimsuzplaying with nedb (nosql-like for nodejs) - toying with some clojurescript based project in node-webkit env :)
04:12dimsuzi didn't check but i guess it must've something like select distinct :)
04:17deobaldsHey folks. Did anyone else experience breakage with cider/cider-nrepl in the past month or so? I just upgraded prelude and cider, and now M-. tells me "Can't find nREPL middleware providing op info. Please, install cider-nrepl and restart cider."
04:17deobaldsThe hints for setting up cider-nrepl aren't very helpful, since they're all lein-focused. We don't use lein to run our app or connect to it with a repl.
04:20dimsuzguys and having [1 2 3 4 5], what is the best way to create smth like [{:a 1} {:a 2} {:a 3}]. I would do this: (map #(assoc :a %) [1 2 3])
04:20dimsuzis this a right way? :)
04:25jack_rabbitWell, seeing as I can't seem to navigate this korma thing, and the documentation is terribly minimal, and it doesn't work in an intuitive way, does anyone have a suggestion for a SQL library for clojure?
04:25beamsoi use clojure/java.jdbc
04:26deobaldsjack_rabbit: We're using java.jdbc directly as well. Though one of our teams tried honey on top of that and liked it.
04:27jack_rabbitI saw honey. I might give that a shot. I'd like some sort of abstraction on top of the sql. The idea of writing queries in string form isn't appealing.
04:28beamsoyou don't have to write all your queries in string form using clojure/java.jdbc
04:29ucbdimsuz: try a combination of interleave and constantly
04:29ucb,(doc constantly)
04:29clojurebot"([x]); Returns a function that takes any number of arguments and returns x."
04:29ucbsorry, repeat
04:29ucb,(doc repeat)
04:29clojurebot"([x] [n x]); Returns a lazy (infinite!, or length n if supplied) sequence of xs."
04:29ucb,(doc interleave)
04:29clojurebot"([] [c1] [c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc."
04:30ucb,(interleave [1 2 3] (repeat :a))
04:30clojurebot(1 :a 2 :a 3 ...)
04:30ucbthen add partition
04:30ucb,(doc partition)
04:30clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
04:30ucband take it from there dimsuz
04:30jack_rabbitbeamso, yeah, I'm looking through the API now.
04:33dbasch,(take 5 (map hash-map (repeat :a) (range)))
04:33clojurebot({:a 0} {:a 1} {:a 2} {:a 3} {:a 4})
04:34dbasch,(map hash-map (repeat :a) (range 1 5))
04:34clojurebot({:a 1} {:a 2} {:a 3} {:a 4})
04:46deobaldsSo, is anyone here using cider-0.7.0 and cider-nrepl-0.7.0-SNAPSHOT?
04:50ucbdeobalds: I am
04:50deobaldsucb: No issues? Do you ever use it without lein?
04:50ucbdeobalds: without lein? I usually cider-jack-in (I assume that uses lein behind the scenes)
04:50ucbdeobalds: so far no issues
04:51deobaldsucb: It does. We always connect cider to a running repl inside an exernal process on our projects, so lein isn't involved. Makes it hard to use stuff that assumes lein will always be there. :(
04:52ucbdeobalds: I see! I've used it to connect to long running processes without much fuzz, though not that much to be fair
04:52deobaldsucb: Good to know, thanks. Maybe we've got something else misconfigured.
04:52CookedGryphondeobalds: I'm working on a pull request that will let you customise the command for cider-jack-in completely
04:52CookedGryphonalso per project
04:53CookedGryphonbut afaik not much assumes lein will be there, if you just use plain cider to connect and not jack in
04:53deobaldsCookedGryphon: Not sure what you mean? 0.6.0 works perfectly for us; we just use `cider` rather than `cider-jack-in`.
04:54deobaldsCookedGryphon: Cider 0.7.0 works. It can't find cider-nrepl (or some part of it) when I try to do things like navigate the code using M-.
04:54deobaldsCookedGryphon: All the cider-nrepl intallation instructions involve plugins in lein profiles.clj, dev-dependencies, or some other leiningen malarkey.
04:56supersymcould someone please enlighten me how I implement this interface exactly, I can't seem to get it right
04:56supersymhttps://github.com/asciidoctor/asciidoctorj/blob/master/src/main/java/org/asciidoctor/Asciidoctor.java
04:56deobaldsCookedGryphon: Just getting cider-nrepl 0.7.0 on the classpath doesn't seem to be enough for cider to find it.
05:04CookedGryphonfair enough, I'm not sure then
05:04dimsuzucb: thanks!
05:07supersymah... import-static from contrib ... that might be it ;_)
05:20CookedGryphonCan anyone tell me why clojurescript has its own separate :source-paths? I've got a project with different profiles for each different platform on which it builds
05:20CookedGryphonand clojurescript sticks out a bit as it's got a custom :builds thing with a separate :source-paths which can't inherit from the common one
05:24muhukPromises are not like agents in the sense that they are only delivered on transaction success, right?
05:26muhukSo, I should use agent & await to leak values outside of transactions.
05:31muhukawait blocks :/
05:32muhukI got it to work with the (promise), but if the transaction fails, it will still be delivered.
05:33muhukThe code is like this BTW: (swap! a (fn [...] (deliver p ...) ...) (do-something @p)
05:37muhukAnother solution is to throw another atom at the problem: http://stackoverflow.com/a/22414839/42188
06:01CookedGryphonis cljx hard wired to only deal with cljs and clj, or can you define other output targets?
06:01CookedGryphonfor example jvm6/jvm7 versions
06:01CookedGryphonor jvm vs android implementations
06:04ssiderisCookedGryphon: as far as I can tell, it will do other targets too
06:24grimmulfrBeen learning Clojure for a few days. Made this with that knowledge: https://www.refheap.com/84169 (I tried using everything just to see how stuff works, we have JQuery, DOM manipulation, strings, custom functions, the works). ANy thoughts, suggestions and critique? :D
06:25devurandomHello!
06:26devurandomI need help in translating a JavaScript program to ClojureScript (the code is at https://gist.github.com/anonymous/ac60b1f22c7de9aec355 if that helps you understand):
06:27devurandomIn JS, I created a 2d array of nested maps. The inner maps carry references to the outer maps, to ease traversal. I also need a way to update these maps.
06:27devurandomHow do I do this best in Clojure(Script)?
06:29devurandomI.e. how do I easily keep references to the outer map in the inner map, in a way that works with immutability? And how would you recommend to update or add keys to the maps, without rebuilding everything?
06:30muhukdevurandom: if I understand you correctly, I don't think you can easily build your references as such.
06:30CookedGryphondevurandom: What's the basic problem? Better to start from that and think how to explain it in clojure rather than thinking about how to do your javascript implementation in clojure
06:31CookedGryphonbecause the javascript implementation was based on assumptions that might not be true any more, you might not need these back references for the clojure implementation for example
06:33muhukdevurandom: even if you re-write your code in clojurescript, you'll still be using whatever Kinetic.Layer() returns, so no immutability there.
06:34devurandomI need to represent a 2d grid. Each cell can contain data and stuff that is necessary for drawing it (I used KineticJS, which iirc uses HTML5 Canvas, before). I need to draw certain parts differently, based on the values of the cell's data. I also need onmouseover callbacks and such, to implement the UI - so onclick or onmouseover I need to find the correct cell and change it, update other parts of the program, etc.
06:36muhukdevurandom: if you want to store your data in an immutable container, I'd start by removing edge.parcel
06:36devurandommuhuk: Yeah, the drawing is not immutable, I know. My problem was that in Clojure everything is immutable, so I cannot do this.street = true anymore, as I did before. It seems like the whole way of dealing with the data (traversing, having functions that take objects that are not an atom, ...) is different now.
06:36muhukdevurandom: and then, I'd use a different index for quick edge->parcel lookups
06:36devurandom"different index"?
06:37muhukdevurandom: think of it as a reverse map
06:37muhukdevurandom: (def parcels [{:edges [...]} {:edges [...]}])
06:38muhukdevurandom: (def edge->parcel {:edge-id parcel-value ...})
06:38muhukdevurandom: does that make sense?
06:38muhukdevurandom: you can build the latter based on the former.
06:38devurandomYou mean like storing the path "x -> y -> horiz/vert" and looking up the parcel that way?
06:39devurandomOr create a unique ID for each edge and parcel and then map only those?
06:39muhukdevurandom: in that case: (def edge->parcel {[x y :horizonal] p1 [x1 y1 :vertical] p2 ...})
06:40l3dxhow would I "alias" a static java value? ie. KeyEvent.VK_LEFT without using contrib static-import ?
06:40muhukdevurandom: I'm just giving you some ideas, you know the requirements of your code better than me.
06:41muhukl3dx: does (def x KeyEvent/VK_LEFT) work?
06:42muhukdevurandom: also, if you are storing your state in an atom, you'd probably want to store both parcels and the index in the same atom, so that they are in sync. And you probably want functions that modify this data structure to make changes in both places.
06:44l3dxmuhuk: yes
06:44l3dxthanks
06:44l3dxI was trying to do it with :require :as
06:45muhukl3dx: yw
06:47devurandommuhuk: Ok, so you would address the parcels/edges via their path in the datastructure (instead of storing references as in JS)?
06:48muhukdevurandom: yes.
06:49muhukdevurandom: reference in clojurescript means, AFAIK, a javascript object or an atom. The former, as you know, is mutable. Instead of dealing with many atoms, I'd start with a single top-level atom and see how far that takes me.
06:50devurandomAnd is there maybe a better datastructure than the 2d array, that I used in JS? I will need to find parcels based on their x/y location, and I will need to iterate everything to e.g. draw it. I choose the 2d array in JS, because it seemed like the most efficient way to do the x/y lookup.
06:50muhukdevurandom: tough question.
06:51muhukdevurandom: 1st answer that comes to my mind is a map with keys of [x y]
06:51muhukdevurandom: but it wouldn't come close to the raw js array
06:51devurandomIf [x y] can be a key in a map - would that be an efficient way to store them? Instead of in a list/vector, in a map with [x y] indices?
06:51devurandomHaha, same idea. :)
06:51hennryhello can any body tell me where we define the properties file filename.properties in luminus web application
06:52muhukdevurandom: my suggestion is to try a map with composite keys ([x y) and a nested map
06:52muhukdevurandom: see how they perform
06:52devurandomRegarding the single top-level atom: And then you update the top-level atom using something like (swap! the-atom assoc-in [the path] ...)?
06:52muhukdevurandom: perhaps the fastest is a vector where you calculate the index as (+ x (* y w))
06:53devurandommuhuk: nested map is {0 {0 ... 1 ...} 1 {...}}?
06:53muhukdevurandom: yes, top level atom idea, I'm pretty confident you should start with that.
06:53muhukdevurandom: yes.
06:53hennry hello can any body tell me where we define the properties file filename.properties in luminus web application
06:53devurandomhennry: Your question came through the last time already :)
06:54hennryok
06:55devurandommuhuk: Thanks!
06:55muhukdevurandom: yw
07:51hennryhow to get a single value of map from load-file
07:52TEttingerhennry: ##(doc read-string)
07:52lazybot⇒ "([s]); Reads one object from the string s"
07:53TEttingernot sure about load-file
07:54hennry<TEttinger>i am getting the full map but i need a single value
07:55TEttingerdo you know the key of that value?
07:55hennryyes
07:55lvhhennry: Can you get the full map and then extract the value?
07:55TEttinger,(get {"whatever-key" :value} "whatever-key")
07:55clojurebot:value
07:55hennryyes but not get succes
07:56TEttinger,(get {"whatever-key" :value} "whatever-key-not-this" :default-get)
07:56clojurebot:default-get
07:57hennry<lvh> yes but not success to extract single value
07:58gfrederickshennry: what goes wrong?
08:00hennry <gfredericks> i am extracting the single value of map from load-file but i get the whole map
08:01hennryis there any way to get single value
08:05gfrederickshennry: yes, TEttinger showed you how to do it above using the get function
08:06hennrythanks to all
08:24hennryis there way to reload the repl from the code
08:28muhukhennry: you do mean reload the code from the repl?
08:38cYmenIs there a flag or something to make emacs indent 2 spaces after a line break instead of after the function name in a sexp?
08:41justin_smithcYmen: you would have to make a new mode to replace clojure-mode I think
08:41hennry<muhuk> no i want to reload the repl from the code my motive is to refresh the application frm the code
08:41justin_smithhennry: you can use :reload to force a dep reload, or :reload-all as args to require
08:42hennryit refresh my application
08:42justin_smithit will grab any changes in your clj files
08:43justin_smith(require '[my-app.core :as core :reload-all])
08:43justin_smiththere are still some tricky things (like old definitions still being around even if they are deleted in the source) but it mostly works
08:51cYmenjustin_smith: I find that odd because I see it in a lot of code examples.
08:51phillord@cYmen (setq lisp-indent-offset 2) ?
08:52cYmenphillord: as soon as I find out how to eval that :p
08:52phillordoh, sorry
08:52cYmennot your fault that I don't know how to use my editor ;)
08:52phillordAlt-Shift :
08:53phillordor M-x customize-variable
08:53phillordI've been meaning to look that up for ages, because I really don't like the default when I've been using core.logic
08:54cYmenphillord: sweet. works. :)
08:54cYmenthank you!
08:55phillordno worries, have fun
08:55justin_smithcYmen: TIL, thanks
08:56justin_smithalso, there is M-x IELM to get an elisp repl
08:56justin_smithor control-j to evaluate the form before point in the *scratch* buffer
08:56cYmencool
08:57justin_smith(or C-M-x to evaluate the enclosing form)
08:57cYmenI wish I had a clever system to write down all these tricks.
08:57cYmenI tend to not find them when I need them.
08:57justin_smithI discovered ielm and the *scratch* bindings when I was trying to debug a poorly thought out elisp package
08:58justin_smithmy very-bad-code led to extensive knowledge of emacs' elisp facilities as I tried to fix it / debug it
09:01phillordcYmen --- Org-Mode:-)
09:05gfredericks(defmacro errly [& body] `(binding [*out* *err*] ~@body))
09:26cYmenphillord: I tried but I can't get the hang of it.
09:27cYmenI need a new job. All this windows and C++ is taking up space in my brain that I would rather allocate differently. :/
09:43jkjcYmen: evernote
09:45justin_smithcYmen: if you ignore every feature of org mode other than * subgroup ** subsubgroup *** subsubsubgroup etc. and tab to expand / collapse, it is very easy to learn, and very useful for keeping track of things
09:48AeroNotixjustin_smith: pretty much this^
09:48AeroNotixI've been using just those features for ~1.5 years
09:48AeroNotixgood thing is that you can put .org files into a github gist and share them with co-workers, too
09:49AeroNotixgithub renders them in gists, but not in actual repos, though. Weirdly.
09:49justin_smith[[/home/justin/clojure/][clojure]] <- for extra credit, make an occasional clickable hyperlink to a directory or file
09:50AeroNotixjustin_smith: nice :D
09:55justin_smithalso, something I try to remember to use more often [[/home/justin/test-uber/src/test_uber/core.clj::defn -main][-main]]
09:56justin_smiththat links to a text search for the first instance of the specified string
09:56justin_smithIOW it is a clickable link to a def
09:57AeroNotixjustin_smith: insanity! I never knew that. :D
09:57justin_smithsee that is what makes org mode look hard - so many nice features to be found
09:58justin_smithbut we must remind ourselves, there is an easy to remember and very easily usable subset :)
09:58AeroNotixfor sure
09:58AeroNotixas with all emacs features
09:58justin_smithright
09:59justin_smithit only looks hard because you want to know what *all* the buttons do :)
10:00AeroNotixyupp
10:09gfrederickshas anybody written an org-mode parser for clojure yet?
10:13AeroNotixbest off just writing an ELisp interpreter and running the code there!
10:13AeroNotix:)
10:15justin_smithgfredericks: I started to make a two way org subset / edn translator and got stuck
10:15justin_smithgfredericks: a parser and an exporter would be more humble and doable, and very useful
10:17justin_smithI think I got stuck on how maps should be represented in org
10:24justin_smithperhaps maps should be :PROPERTIES:
10:24justin_smithbut that doesn't allow collections as keys
10:27cYmenquickest introduction to core.async?
10:33BobSchackcYmen David Nolen's blogs about it are a pretty good introduction
10:44gfredericksjustin_smith: I like the idea of clojure code that persists collections of maps to org tables :)
11:18stompyjbbloom: SHOTS FIRED
11:18bbloomstompyj: ?
11:18stompyjbbloom: turbopape: if you have to ask, you probably don't have large traffic
11:18stompyjLOVE IT
11:18stompyjfrom yesterday
11:19bbloomstompyj: yup, well it's true
11:19stompyjno, I 1000% agree
11:19AeroNotixlink plz
11:19stompyjLove how direct it was
11:25gtraktechnomancy: I got Syne working this morning, but I didn't get a chance to try git-pushing and such. Are there any gotchas? Is the project that you specify in the form handled specially in some way?
11:29gtraks/Syne/Syme
11:36rolfbwhen i call `lein repl` outside of any projects on my mac, it loads clojure 1.5.1 ... how do I make it load 1.6 by default?
11:36gtrakI just make extra projects to play in.
11:37gtrakmight also want to try: https://github.com/rkneufeld/lein-try
11:40rolfbgtrak: thanks, what i'm mostly curious about is why it's choosing 1.5.1
11:41rolfbcan I inspect where it's loading it from?
11:42gtrakI figured it'd be in the default profile, but it's not.
11:44rolfbgtrak: they haven't released another version of leiningen since it bumped clojure to 1.6.0
11:44rolfbthat's why
11:44rolfb:/
11:44gtrakthat's not 'why'..
11:45gtrakthat's just some kind of correlation :-)
11:45rolfbgtrak: leiningen includes clojure
11:45rolfbthey've updated it in their repositoriy
11:45rolfbbut not pushed a new version
11:45gtraklein creates two processes, one for leiningen itself, another for the repl. It has to set up the classpath somehow.
11:45rolfbgtrak; https://github.com/technomancy/leiningen/commit/a296ff8918a581c975f49127d7e37a3f0c510d22
11:46gtrakI'm guessing it defaults to adding that leiningen-standalone jar if there's no project, which contains the clojure version.
11:46gtrakI believe you.. I'm just saying I don't see the connection, and I'd like to :-)
11:46gtrakthe literal, in the code, connection.
11:47rolfbgtrak, wdym? clojure is included in leiningen-core, current published version contains clojure 1.5.1
11:48stompyjnew “web benchmarks test” came out today. (or recently). Is anyone optimizing the clojure code for speed, or in general, do we just not care (I don’t )
11:48rolfbgtrak: are you thinking about the exact point where it switched based on the current project.clj?
11:49gtrakyea
11:49tbaldridgednolen_: does cljs.core.logic not include to-stream?
11:49gtrakrolfb: so, the repl task has 'no-project-needed' metadata on it, but it still takes a project argument. I'm guessing somewhere there's a default project map that gets merged in.
11:49technomancyrolfb: you can run from a git checkout of lein if you need 1.6 outside a project
11:50rolfbtechnomancy: my desire is to just open a terminal and type "lein repl" :-)
11:50rolfbsilly, i know
11:50gtrakI once made a terrible mistake, that might be useful here. put a project.clj in your root home directory.. :-)
11:51rolfbtechnomancy: any reason a new version of leiningen hasn't been pushed?
11:51rolfbgtrak: well, that might just work :-)
11:51technomancyrolfb: it's not done yet https://github.com/technomancy/leiningen/issues?milestone=15&amp;state=open
11:51gtrakrolfb: I didn't know that's what I'd done, but lein repl scans up parents to find a project.clj. I was getting weird stuff on 'lein install'.
11:51rolfbtechnomancy: aha, thanks :-)
11:52gtrakeverything works as normal if you're actually in a project dir.
11:53technomancyhyPiRion: did you mean to add the mktemp issue to the 2.4.0 milestone?
11:53hyPiRiontechnomancy: well, I could. It's not a hard fix
11:54hyPiRionjust want to ensure I have a windows instance running so I can confirm that it works first
11:54technomancyno problem; just checking it was intentional
11:54hyPiRionwell, it's not a big deal really -- people can use the .bat file instead
11:54hyPiRion(Or at least that's what I've understood)
11:55technomancyhyPiRion: any opinions about https://github.com/technomancy/leiningen/issues/1512 ?
11:56hyPiRiontechnomancy: yeah, but I'm a bit busy now
11:56technomancyno worries
11:57technomancyrolfb: part of the reason this release has taken so long was that we were going to include https://github.com/technomancy/leiningen/issues/1388, which is really hard to get right
11:57technomancybut I decided to drop that from the 2.4.0 release
11:57hyPiRionIt's good, but I feel it breaks backwards compatibility. Not sure how big issue that is for people in general.
11:58technomancyhyPiRion: I feel like it's probably safe in the `lein deploy` case.
11:58technomancyif you're manually compiling some stuff and then relying on it being present on clojars without putting it in project.clj, you're doin' it wrong
11:59rolfbtechnomancy, i'm too new at clojure to understand that issue :-)
11:59technomancybut the general case of jar files is less clear-cut; people could be using the jar task for non-traditional workflows
12:02hyPiRiontechnomancy: yeah, if you have intermediate compilation steps, I would assume there might be some breakage
12:02hyPiRionnot found any examples yet though.
12:03technomancyintermediate compilation steps that aren't declared in :prep-tasks, yeah
12:03hyPiRionyeah
12:05hyPiRionI could see it being a problem for people with long compilation times
12:05hyPiRion(as there's no make-like functionality bundled with Lein)
12:06technomancyoh, like if there are tasks that you can't cheaply check if they need to be re-run before running?
12:06technomancyyou can always memoize tasks, but that doesn't persist across invocations
12:07technomancyI feel pretty safe about making the change in deploy, because any weird deploy work flow is likely to apply to applications only and not libraries
12:08hyPiRiontechnomancy: I mean tasks where it's taking a long time to compile something, and the task isn't using date checks to check for updates in source files
12:09hyPiRionSo they make a command to compile whatever
12:09hyPiRionI don't know if that's actually a problem though
12:24llasramIs there any way to nest test.check generation? Say generate a positive integer, then generate vectors in ranges around that integer
12:25nullptryes, see gen/bind
12:25llasramAh, awesome
12:25llasramThanks
12:25nullptrsomething like (gen/bind gen/int #(gen/choose % (+ % 5)))
12:27heizHello! Tell me please if leiningen is able to use custom default template?
12:28technomancyheiz: custom default sounds like a contradiction of terms =)
12:29justin_smithheiz: you can define a template and use it via lein new foo
12:30justin_smithhttp://yogthos.net/blog/34-Creating+Leiningen+Templates
12:31heizFor example, I want lein to use compojure-app template by default. So I don't need to specify it every time. Is it possible?
12:32technomancyheiz: you can make an alias for ["new" "compojure-app"] if you like
12:32technomancyyou can even call that alias "new"
12:37gtrakoh, man, I'm banging out 20 compojure apps a day :-)
12:39gtrakeclipse is what broke me, rather it broke itself too often, also archlinux (which I enjoyed otherwise)
12:40llasramHmm. Property-based testing may not actually be the best way to test probabilistic data structures
12:40bbloomheiz: technomancy: isn't this what ~/.bash_aliases is for?
12:40nullptrllasram: that doesn't mean it isn't fun...
12:40llasram"Hey, look -- I found an example which exceeds the average expected error!" Well, yes
12:41technomancybbloom: that works too. unfortunately I don't think you can have bash aliases over one word though.
12:41bbloomtechnomancy: the guy left, but the idea of changing what `lein new` does by default just seems insane to me
12:41gtrakthank goodness
12:42gtrakmulti-word bash aliases, not the guy leaving.
12:42technomancybbloom: eh; there is a good case for overriding built-ins
12:42hyPiRionllasram: Usually you'd do prop-based with confidence intervals
12:42technomancylike if you want `lein test` to actually run expectations or something
12:42llasramhyPiRion: What does that look like in test.check?
12:43technomancygtrak: it's just pattern matching =)
12:44gtrakwe'd get weird bash dsls.. ambiguous: $ r v m shoot myself
12:44reiddraperllasram: have you looked through the docs?
12:44l1xmorning guys
12:44gtrakyou just know people would use it that way.
12:44gtrakand make others use it
12:44reiddraperllasram: take a looks in the docs dir of test.check repo
12:45technomancyno one can make you use pattern matching against your will; it's a human rights violation
12:45justin_smithgtrak: I wonder if anyone has created a forth out of bash aliases treating their arg lists as stacks
12:45hyPiRionllasram: Instead of checking if a single data structure is broken, check multiple and test whether they are in the confidence interval or not
12:45gtrakjustin_smith: so crazy it could possible work.
12:45l1xis there a better way of getting the difference between two lists than http://clojuredocs.org/clojure_core/clojure.data/diff ?
12:45gtrakpossibly*
12:46gtrakjustin_smith: I'm going to tweet that.
12:46llasramhyPiRion: By e.g. "manually" calling `gen/sample` w/in the property test to generate the set?
12:46justin_smithl1x: how much do you know about the lists? if they are two arbitrary lists diff is probably best, if you know more about their potential structure you can probably improve on it
12:47l1xit is just 2 simple flat lists with keywords like (:a :b :c) (:a :b)
12:47llasramhyPiRion: I literally started trying it out 10 minutes ago, so haven't really explored it yet and don't know what facilities are available
12:47justin_smithrecently I discovered that clojure.data/diff combined with clojure.string/split makes tracking down what broke in unit tests that compare string equality much easier
12:47l1xnice :)
12:47llasramreiddraper, hyPiRion: but yes, did read the `docs/` files :-p
12:47technomancyjustin_smith: you mean ... you aren't using lein difftest??
12:47lazybottechnomancy: Definitely not.
12:48justin_smithl1x: then diff will probably help, but also consider whether it would help to sort them first, or compare them as sets...
12:48justin_smithtechnomancy: no, I haven't tried it
12:48technomancyit is, as they say, the cats
12:49hyPiRionllasram: Like, generate a vector (gen/vector) of at least x data structures, then check if the elements are within the confidence interval
12:49l1xjustin_smith: you think that a set would improve that much if the maximum number of elements in the list is ~100
12:49l1xquestion mark
12:49justin_smithtechnomancy: very nice
12:49llasramhyPiRion: Oh. Duuuuuh. Thanks
12:49justin_smithl1x: well a set helps if you care about what is there, but not the order
12:49justin_smith(or how many times)
13:41apricotshow does one get result set metadata using clojure.java.jdbc? i tried (jdbc/db-query-with-resultset db-spec ["select ..."] jdbc/metadata-result) but it just returns the data, not the metadata
13:43justin_smithapricots: that should return the function jdbc/metadata-result
13:43justin_smithoh, never mind
13:46apricotshmm looking at it more, it seems c.j.jdbc doesn’t actually let me get result set metadata
13:47justin_smiththat sucks - is it a limitation of that driver, or of jdbc?
13:48eraserhdDoes pomegranate have a way to query the latest version of a dependency? I'm not seeing one.
13:50eraserhdAnd, if not, should it?
13:52technomancyeraserhd: probably not; legitimate use cases are fairly rare.
13:54joegalloapricots: maybe i'm misunderstanding, but this is working just fine for me... (jdbc/db-query-with-resultset db-spec ["select * from foobar"] #(.getMetaData %)))
13:55eraserhdtechnomancy: I just realized that `lein new` does this... time to steal code?
13:56technomancyeraserhd: you can set the version to "RELEASE" but it's almost always the wrong thing
13:56technomancybut yeah, lein new is a special case because template creation isn't supposed to be repeatable
13:58seangrovebbloom: Working on calculating the height of a formatted block of text without rendering to the DOM to vertically center it in the layout manager - Anything jump out at that's naive in this approach? http://jsfiddle.net/QWQ4c/6/
13:58apricotsjoegallo: yeah calling the low level methods works. i suppose i was just looking for something more clojury
13:59bbloomseangrove: any plans to target IE8? :-P
13:59seangrovebbloom: Not immediately, no. Maybe in the future?
13:59bbloomseangrove: IE8 doesn't have canvas
14:00seangroveWell then, probably not, unless there's some other API for measuring text in IE8.
14:00seangroveAs it is, there's no reliable way to get pixel height from text without rendering it :P
14:00bbloomseangrove: my first thought is: does canvas text size stuff respect system accessibility settings?
14:00bbloomseangrove: that's a fact about text heights in general
14:00eraserhdtechnomancy: This is for an internal lein template, and I want it to always use the latest version of our internal plugin.
14:00bbloomseangrove: fonts are programs
14:00bbloomseangrove: you can only tell what they do by evaluating them :-P
14:00eraserhdBut I agree, it's usually not hte right thing to do.
14:01technomancyeraserhd: gotcha; makes sense
14:01nullptrseangrove: if you're in cljs goog.graphics has an abstraction across canvas, vml, svg
14:01technomancyyou can probably try to load a "RELEASE" version and then see what it resolves to, but it's a bit tricky
14:02nullptrthough the vml back end for getTextWidth just has a todo comment and returns 0... :P
14:02bhaumanseangrove: you probably didn’t render it and measure in a div for reason.. I am wondering why?
14:02bbloomseangrove: i believe that spaces can vary in width
14:02seangrovebbloom: Even so, shouldn't have to put them into the DOM to get the height of a given font
14:02bbloomseangrove: oh yeah, having to put them in to the dom is a nightmare :-P
14:02bhaumanand there it is
14:02bbloomseangrove: i'm also wondering why you didn't just use a div to measure, especially considering that will handle wrapping etc for you
14:02seangroveI'll add that approach in as well
14:04seangrovenullptr: I would guess it'd be way too slow for what I'm using it for, but good point
14:04bbloomi think that's a much better approach b/c you're never going to be able to get all the little edge cases right
14:04bbloomdivs i mean
14:05bbloomyou'll want to handle line spacing, system font size scaling, text justification, hyphenation, etc etc etc
14:05bbloomellipses for truncation, etc
14:05bbloomtext is fucking hard.
14:06seangroveDefinitely agree that it's hard. The thing that kills me is that browsers have done all this work, but don't expose it at all, not even in their usually insane ways.
14:06bbloomunless you plan on implementing a full on true/open type renderer, i'd 100% delegate to the browser
14:06justin_smithyou could translate TeX to javascript via empscripten and just use that :P
14:06bbloomjustin_smith: sounds like a solid plan. seangrove go with that lol :-)
14:06justin_smithmaybe that would be less trouble than the alternatives, lol
14:06seangroveI think I have a perfect place for it right here in this tight loop
14:07eraserhdtechnomancy: I'm assuming the resolve here isn't necessary anymore, now that new is in leiningen? https://github.com/technomancy/leiningen/blob/master/src/leiningen/new.clj#L22
14:07seangrovejustin_smith: Working on a layout system, so have to be very wary of the costs involved
14:07justin_smithfair enough, I figured it was a silly suggestion
14:08bbloomseangrove: i've used off screen divs for measuring before and perf was "good enough"
14:08bbloomgive it a try, see how it compares
14:08technomancyeraserhd: oh yeah, that probably dates from when lein-new was a plugin that needed 1.x compatibility
14:08seangrovebbloom: Yeah, adding it now
14:08bbloomseangrove: won't be as good as canvas measure string, but will support rich text w/ proper typogrophy
14:15dnolen_tbaldridge: hmm it probably doesn't actually, wouldn't be hard to add
14:15s2013is clojure similar to scala in terms of being on jvm
14:17tbaldridgednolen_: I tried copying over to-stream from the CLJ version, but Choice seems to be different in CLJS
14:17noonianin the sense that they both interoperate with java, yes, but the languages have very different philosophies. Clojure only really supports functional programming whereas you can write javaish oo code in scala.
14:18s2013do you need to know java to use clojure?
14:18ToxicFrogs2013: no, although it will help if you find yourself needing to interact with plain Java APIs (e.g. for sockets)
14:18justin_smiths2013: definitely not, though being able to read javadoc well enough to use something via interop is helpful
14:18s2013gotcha. stupid question but do you need to compile clojure code?
14:19nullptrscala is a terrific choice if you like swordfighting ... http://xkcd.com/303/
14:19s2013only bits of java i remember is from college 10 years ago
14:19justin_smiths2013: clojure is a compiler, all code is compiled into jvm bytecode by clojure
14:19s2013oh ok
14:19s2013my current work is mostly ruby and rails and some python. but ive been wanting to learn something else on the side
14:20justin_smiths2013: well, if you haven't done functional programming there is a lot to learn, and a lot to gain, with clojure
14:20nooniani'd recommend clojure over scala if you are just trying to learn something new that will expand your horizons
14:20technomancys2013: you don't need to sit around and wait for code to compile, if that's what you mean
14:20technomancyyou type code in, it compiles, then runs
14:21s2013yeah im not thinking about scala
14:21technomancybut it usually happens instantaneously once your repl has started
14:21s2013i got a book on Go but have been hearing good things about clojure
14:21s2013i wonder if i can jus tlearn both side by side
14:21bblooms2013: learn one language at a time
14:21bhaumans2013: they are extremely different
14:21noonianif you are new to functional programming, clojure will probably be a lot to learn on it's own
14:21s2013yeah i havent done much functional programming
14:21noonianthe syntax will also be very different if you haven't used a lisp before
14:22s2013would js be considered be close to some functional programming?
14:22tbaldridges2013: the way Go does polymorphism is similar to Clojure, but Clojure does it 100x better, imo.
14:22s2013cause js isnt true oo
14:22bblooms2013: "functional" js is a joke
14:22s2013i mean i gues sthats my closest exposure to fp
14:23s2013not saying that its much of an exposure
14:23bblooms2013: i suggest you start with www.4clojure.com & try some puzzles... it's fun
14:23eraserhdtechnomancy: I was going to submit that pull request, but I can't seem to run tests. Keep getting "Unable to resolve var: *force?* in this context.
14:23noonianjs has functional features but if you get into it knowing only imperative programming it is unlikely you are using it functionally :P
14:23s2013thanks bbloom
14:23s2013let me check it out
14:23eraserhdBut the line number reported doesn't make sense.
14:23bblooms2013: be sure to follow some top users, so you can see their alternative solutions after you solve some
14:24s2013stupid question but what is clojure commonly used for
14:24cbpprogramming
14:24bbloomcbp: lol
14:24s2013thanks cbp
14:24nullptrweb applications
14:24TimMcI use it as an egg replacer.
14:24nullptrtoo heavy for embedded/mobile at present
14:24nullptroffline/server/web app
14:25s2013gotcha nullptr
14:25s2013can you write system apps with it?
14:25bblooms2013: depends on what you define "system" to mean
14:25s2013like low level stuff
14:25llasrams2013: Hadoop MapReduce jobs
14:25bblooms2013: there are at least a few databases & serious high perf stuff written w/ clojure
14:25s2013gotcha. thats cool
14:25bblooms2013: anything the java can do, clojure can do
14:25s2013can you run it on windows/
14:26joegalloyou can
14:26tbaldridges2013: datomic is written in Clojure
14:27s2013cool. well im on ubuntu anyways, but just wondering
14:27s2013how long did take you guys before you felt comfortable writing some basic apps inc lojure?
14:28bblooms2013: if you're just looking to learn, don't fret so much: just get started
14:28joegalloabout 1 basic apps
14:28tbaldridge1 year for me, but that was 4 years ago when the documentation was quite a bit more sparse
14:28s20131 year? damn
14:28technomancys2013: depends on how many bad imperative habits you have to overcome
14:28joegallothat is, struggle through the first basic app, and hey presto, you'll probably have learned a whole lot
14:28s2013im loking at some basic tutorials.. the syntax looks a bit weird
14:28bhaumanhey guys I wrote a live coding leinigne plugin for CLJS and I’m looking for some feedback, kinda been in a cave writing it
14:28tbaldridges2013: that being said, I haven't really touched Python or C since, so it was a great investment for me
14:28s2013but if i could overcome obj-c syntax im sure i can overcome anything
14:30nullptra month or so of active effort for me (but spread out over much longer), though i had experience with lisp and fp (ocaml/f#) going in
14:30s2013gotcha
14:30justin_smiths2013: lisp style languages are a whole other world, I think one of the main revelations is there is a relative *absence* of syntax, and that is why all the parens are there
14:30nullptrkeep in mind that clojure is still relatively early and things change quickly, so your level of comfort will decrease rapidly without continued investment
14:30seangrovebbloom: Maybe I should expose both strategies - one for when 'simple text layout' and one for full-fledged text flow http://jsfiddle.net/QWQ4c/7/
14:30technomancynullptr: wait, clojure changes quickly??
14:30justin_smiths2013: the hard part is really getting how little syntax there is, and how consistent it is (mostly)
14:30lazybottechnomancy: What are you, crazy? Of course not!
14:30bbloomseangrove: lol... you ready for an MSDN link?
14:31seangrovebbloom: I may have beat you to this one ;)
14:31seangroveBut yes, please
14:31s2013do you need to know Lisp or no?
14:31justin_smiths2013: no, I am just saying it is in the lisp family
14:31s2013gotcha
14:31bbloomseangrove: http://msdn.microsoft.com/en-us/library/bb613560.aspx
14:31justin_smithwhich is why it looks so weird, the lisp family is like the australia of programming
14:31justin_smithparallel evolution
14:32s2013ok so i think ill set aside an hour or two a day for clojure. im hoping by this sumemr i can write some basic apps
14:32s2013are there any orms for clojure?
14:32s2013i write mostly web apps
14:32tbaldridges2013: you don't need ORMs with clojure ;-)
14:32technomancyjustin_smith: the madagascar of programming
14:33justin_smithtechnomancy: even better :)
14:33seangrovebbloom: Nope, I came across a different one. Reading through this now, thanks
14:33tbaldridgeORMs are an abomination created because of the limitations of OOP
14:33s2013i see
14:33s2013so you write pure sql queires?
14:33bbloomseangrove: in short, there are two types of text-rendering components... one for simple text runs and one for rich text / flow documents
14:33justin_smithtechnomancy: or the new zealand, all things replaced by s/birds/functions
14:34tbaldridgethere are many ways to go about it, there are LINQ like dsls for clojure, or write SQL, or use Datomic
14:34s2013ok thanks
14:34s2013i guess ill cross that bridge when i get there
14:34justin_smithwe do map storage / retrieval with edn for caribou
14:35nullptrs2013: it's probably good to absorb a bit of the clojure philosophy before diving in, gives helpful context to understand "the clojure way"
14:35justin_smith(since clojure is more about maps than objects and all)
14:35nullptrrich hickey's "simple / easy" talk will shed some light -- and i believe it touches on orm specifically
14:35tbaldridges2013: have you seen any of Rich Hickey's talks?
14:35nullptrhttp://www.infoq.com/presentations/Simple-Made-Easy
14:35seangrovebbloom: Ok, this is heartening. Seems like we can start with these strategies, and make them more configurable as we need.
14:35tbaldridgealso this list is probably a great way to start learning about Clojure http://thechangelog.com/rich-hickeys-greatest-hits/
14:36bbloomseangrove: yeah, just be careful not to use names that will confuse the fuck out of you later & make a compatability nightmare ;-)
14:36tbaldridgeseangrove: bbloom: I recently started trying to do some layout stuff in SVG, that was insanely painful.
14:36tbaldridgeseangrove: bbloom: like the fact that SVG text only returns the width of text when you measure
14:36bbloomtbaldridge: seems like seangrove is having success w/ some prototype code i sent him recently
14:36bbloomtbaldridge: but text is the hardest part
14:37tbaldridgebbloom: probably true, my skills with most web UI stuff is sub-par
14:37seangroveYeah, I'm going to add this in, and I'll post a screenshot of properly laid-out app
14:38FoxboronAnyone picked up "Clojure for Machine Learning"? Thoughts?
14:39seangroveWell, this is pre-text layout anyway http://dl.dropboxusercontent.com/u/412963/Screenshots/e0.png scroll view with a fixed-height table view with rows of absolutley-positioned canvas layout for the relative time component and the text-view component
14:39seangroveWorking towards the right-hand, left is what we have so far
14:40seangroveThen we talked with the designer and he said that the text is actually variable-height even though it's not shown in the screenshot, so had to implement proper text-block sizing
14:54BobSchackAnyone here use / play around with fressian? I'm porting fressian to clojurescript (https://github.com/devn/longshi) and would like any comments on the api design. I'm currently going to model the api after data.fressian.
14:56tbaldridgeBobSchack: yeah, I've used it a fair amount
14:56tbaldridgeBobSchack: lol, it's you devn?
14:56tbaldridgeoh I see multiple people in this repo
14:56BobSchackNo I'm working with devn
14:59mdrogalistbaldridge: Tell Stuart to keep the Clojure version in sync with the Java dependency. It causes classpath woes when used in conjunction with Datomic :P
15:00tbaldridgeBobSchack: so I started on a CLJS port of fressian once, and ran into a problem that perhaps you'll be able to solve better than I
15:01BobSchackwhat problem?
15:01tbaldridgenamely, decoding UTF-8 strings in JS from a byte array.
15:02BobSchackoh I already have the string encoding / decoding portion done (at least in JS) I haven't tested it with java encoded fressian
15:02BobSchackany codepoints that caused problems?
15:03tbaldridgeah, I see that code now
15:06blake__Is there any documentation on how to build a new Clojure system? Like, if I wanted to target a new VM, a la ClojureScript or clojure-py?
15:09BobSchacktbaldridge I've smoke tested encoding / decoding of the base types (integer, strings, byte array, etc) and I'm working on the extension point / caching system.
15:09akhudekblake__: there is no such thing that I’m aware of. I’ve heard it’s best to start with clojurescript as a base though. The much desired clojure-in-clojure would make this much easeir, but it’s yet to appear.
15:09tbaldridgeblake__: tools.analyzer is always a good starting place for this sort of thing
15:10tbaldridgeBobSchack: nice! then you're further than I ever was.
15:10blake__tbaldridge: Tx. I seem to keep coming back to that. Guess I better figger it out. =P
15:10tbaldridgeblake__: shameless plug https://www.youtube.com/watch?v=KhRQmT22SSg
15:11blake__tbaldridge: Ha! Shameless plugs are the best kind! I'll watch!
15:11Frozenlocktbaldridge: Nooooo, my productivity!
15:11seangrovetbaldridge: You and your shameless, helpful plugs
15:12BobSchackGetting InterleavedIndexHopMap to work an decent speed was a fun challenge. I'd especially like to know how people are using in to do perf tuing once I get everything working
15:17tbaldridgeblake__: code from that talk https://github.com/halgari/data-all-the-asts/blob/master/src/data_all_the_asts_talk/core.clj
15:17amalloyi think it's only shameless if you don't explicitly say so. loudly excusing it as shameless suggests you must feel some shame
15:22blake__Unless it's meant ironically.
15:22dbaschamalloy: “shameless plug” is just a template. Only a programmer will take that literally and not evaluate it :)
15:35dbaschbtw, I’ve been thinking about a generic way to do user management. Here’s a super basic idea for an api, thoughts? https://www.refheap.com/84419
15:38bhaumandbasch: the anonymous user case? or are you not going to have that?
15:39bhaumandbasch: that case seems to creep into every web product
15:39dbaschbhauman: not for now, although this wouldn’t preclude you from allowing users to create bogus accounts
15:40bbloomdbasch: there's basically no such thing as a "generic way to do user management"
15:40bbloomthe list of possible features is hilariously large
15:40dbaschbbloom: I know, but you can provide a template to aid with a couple of basic things
15:40dbasch1) never use a plaintext password
15:40dbasch2) enforce a minimum password length
15:40dbasch3) have a sane key derivation function
15:41dbaschI think that alone would help many people
15:41dbaschit’s really easy to make horrible mistakes in 10 lines of code to authenticate users
15:42bhaumanit’s easy to make horrible mistakes in 100 lines too
15:42bhauman:)
15:42bhaumandbasch: you are getting at correct core functionality, I like it
15:42dbaschof course, the point being most people start with the most basic authentication features and make mistakes
15:43amalloyhuh, i got a different error message than i was expecting from ##(count [] [])
15:43lazybotclojure.lang.ArityException: Wrong number of args (2) passed to: core$count
15:43amalloyerrrrr. in my repl i get "Wrong number of args (2) passed to: core/count--inliner"
15:43llasramhuh
15:44llasramI get what you get. Clojure 1.6?
15:44llasram&*clojure-version*
15:44lazybot⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}
15:44llasramOh, lazybot
15:44llasramYou so old
15:44bbloomdbasch: i don't see how this is any better than a one page readme on how to properly hash/store passwords
15:44bbloomdbasch: in fact, this is already wrong, since it doesn't do any salting
15:45bbloomthere's no substitute for understanding security
15:45dbaschbbloom: it does salting
15:45bbloomdbasch: where?
15:45dbaschbbloom: crypto-password
15:45dbaschI’m trying to bridge crypto-password and friend somewhat
15:46dbaschbbloom: the idea is that a readme is one step less than a template for most people who just want to build an app
15:47dbaschbbloom: if there’s a default that you can stick in your project, that’s easy to find than a readme on the web (of which there are probably thousands, and many of them outdated/wrong)
15:50bbloomdbasch: so the salt is stored as part of the hashed password result string?
15:50bbloomodd. but ok
15:50dbaschbbloom: yes, it’s a standard
15:51dbaschbbloom: I have my own implementation where I store salt in a db column, but I prefer to use crypto-password because it’s already out there
15:53dbaschbbloom: btw, I asked Colin Percival about that library and he said it seemed ok
15:53bbloomdbasch: sure, i'm just saying i've never worked on a web app that didn't out grow a simple auth API basically overnight
15:54dbaschbbloom: yeah, me either. But I always wanted a starting point. It happened to me very recently in fact.
15:54dbaschI started working on cointipping.com and realized I had to reinvent passwords from scratch
15:55dbaschit’s really easy to forget basic things like enforcing minimum password lengths
15:55coventrydbasch: Do you want to store a salt as well, and use it in generating the hash?
15:55bbloomcoventry: we just discussed this :-P
15:55dbaschcoventry: ScryptUtil does that
15:56bbloomcoventry: apparently the libraries he calls in to stores the hash in the returned string value
15:56bbloomstores the salt* with the hash, i mean
15:57dbaschcrypto-password looks pretty solid. I hardcoded scrypt because I see no reason to make that optional, but it could be if someone really cares
15:57dbaschalthough I would assume that if someone is at that level, they don’t need this
15:57bbloomdbasch: yeah, no reason to expose multiple crypto algorithms. just pick the most secure one available
15:58dbaschI think for 99.99% of apps the three choices in crypto-password are just fine
15:59dbaschif you are building a clojure app that must withstand a concerted attack by a government, this is not for you :)
16:00dbaschalso, it’s easy to bikeshed about password algorithms and forget many other mundane aspects of user management
16:00bhaumandbasch: shouldn’t we really default to forcing people to install pgp
16:00dbaschbhauman: that would be nice, but who’s we? :P
16:00bhaumanthe programming elite :)
16:01dbaschfor example, one of the things I want to do is swallow the password, and make sure it’s not being passed around in the user’s app
16:01dbaschif I could zero-out the in-memory password after hashing it, I would
16:02dbaschalso, I want to remove reasons for people to print plaintext passwords in debug logs
16:02bbloomdbasch: blows my mind how often i encounter that
16:03dbaschbbloom: right. If you don’t need to debug your password implementation, it’s less likely that you’ll log passwords
16:03dbaschof course, nothing stops your from logging every request
16:03bbloomdbasch: it's particularly funny in rails apps where there's a way to filter request params, yet ppl decide to use something like password2 instead of confirm_password or whatever the OFFICIAL second field is
16:03bbloomso sure enough, logs are full of plain text passwords
16:03bbloom:-/
16:03dbaschbbloom: also, confirm_password should never really make it to the server. In 2014, that’s a UX matter.
16:04bbloomdbasch: if you're not writing any client side code, it's perfectly reasonable to send that to the server
16:04bbloomwhether or not the absence of client side validation is acceptable in 2014 is another matter
16:04dbaschbbloom: it’s reasonable, but it’s preferable to avoid it
16:05dbaschit’s one more opportunity for an error to be logged somewhere, containing a password
16:06bbloomdbasch: that's the least of our worries really. it's not all that uncommon for passwords to be sent via http in the clear anyway
16:07dbaschbbloom: not much we can do about that, other than fight to make ssl mandatory
16:07bbloomi'd suggest that browsers should just start stripping out password fields from form posts, but that won't work as soon as somebody does some wacky AJAX nonsense w/ some jquery plugin
16:07bbloomend-to-end encrypted network traffic should be *the fucking law*
16:07dbaschbbloom: preaching to the choir :P
16:10{blake}Or maybe it should all be totally open and obviously hackable. Might teach people to be more circumspect online. =P
16:10dbaschbbloom: one of my worries is the very common scenario where someone accesses a server, steals logs and password dbs
16:11dbaschit happens to pretty much every company at some point
16:11dbaschand it’s hard to protect against, especially as a company grows and more people have server access
16:11dbaschat the very least we should help people make sure that information is un-bruteforceable
16:12dbaschbecause we won’t stop people from reusing passwords across sites
16:12noonianthe nsa will still get theirs
16:13bbloompasswords won't get fixed until auth is a proper browser feature that has a compelling dev story
16:13dbasch{blake}: it’s even worse now that people have cryptocurrency on their machines
16:13{blake}noonian: My point!
16:13{blake}dbasch: "Why do you rob banks--er, computers?" "'cause that's where the money is!"
16:13dbaschyeah, I wouldn’t even try to protect against the NSA
16:14dbaschmeaning, the threat model presented by the NSA goes way beyond anything that can be done in software
16:15dbaschfor all we know, the NSA owns every keystroke on every network-connected computer on the planet, and many unplugged ones
16:15nooniani think thats a reasonable assumption to go with
16:15{blake}Going back to my "Well, if it can't be protected, we should at least be honest about it" theory. Heh.
16:16dbasch{blake}: protected is not an absolute. You can protect against some things and not others
16:16{blake}dbasch: Yeah, I know. I just think there's been more than a little dishonesty about what's being protected from whom.
16:17dbasch{blake}: I could so go on a rant, starting by the invention of the phrase “identity theft” :P
16:17dbaschbut we’re probably getting offtopic
16:17{blake}dbasch: Moving on...
16:18dbaschI see many people coming into clojure and the first thing they do is a compojure/ring app
16:19{blake}<--Is doing that. (Not first thing but...top 10.)
16:19dbaschand it’s true that the state of security in Clojure can improve, even if it’s not as bad as abedra’s talk made it sound
16:25coventryYeah, if you're worried about concerted attack by a government, you're pretty much lost unless you are one. :-)
16:25bbloom(doc assoc) ; because of the lack of the 1 arg arity....
16:26clojurebot"([map key val] [map key val & kvs]); assoc[iate]. When applied to a map, returns a new map of the same (hashed/sorted) type, that contains the mapping of key(s) to val(s). When applied to a vector, returns a new vector that contains val at index. Note - index must be <= (count vector)."
16:26bbloomwhat's the best way to take & kwargs and assoc them in to an existing map?
16:27fowlslegsI'm trying to use this https://github.com/kephale/clj-random/blob/master/src/clj_random/core.clj library's #'lrand-bytes to produce vectors of integers with 8-bit binary representations. However when I try (map #(Integer/toBinaryString %) (vec (lrand-bytes 8))) strings with more than 8 bits are produced.
16:29fowlslegsI need a fast way to psuedorandomly generate and manipulate binary data, but am having trouble finding the right tools to use.
16:31AimHereslurp and /dev/null!
16:31TimMc/dev/random you mean
16:31AimHereyes
16:31stompyjhow is intellij clojure support?
16:32stompyjsemi-bummed in what happened with lighttable
16:32dbaschfowlslegs: why not (byte (- 127 (rand-int 256))))
16:32dbaschand repeat as needed
16:32akhudekstompyj: not bad, get the cursive clojure plugin
16:32stompyjstill early I guess, but i hope they don’t abandon it in favor of aurora.
16:32dbaschconcatenate into byte array, etc
16:32cbpI've heard good things about cursive
16:33cbpbut never tried it
16:33dbaschTimMc: /dev/random is for when you need secure random bits, but it may be slow for some apps
16:33stompyjakhudek: I’d need the paid version of intellij to try that right?
16:33dbaschTimMc: and if you’re going to use it, do it through SecureRandom
16:33akhudekstompyj: noope
16:34fowlslegsI think I came up with a solution.
16:34akhudekstompyj: community version works fine
16:34stompyjakhudek: thansk!
16:34{blake}Wait, what happened with LightTable?
16:35stompyj{blake}: I looks like he’s ramping down dev on lighttable and ramping up dev on that aurora thing
16:35stompyjRight now LT isn’t a better general IDE then ST3 for my workflow, so I can’t switch yet
16:36{blake}stompyj: Huh. LT needs work. But Cursive is pretty solid as is CCW. (In my limited experience.) Also, emax.
16:36fowlslegsdbasch: Yeah that should work using a different rand. I also thought of an optimization for creating large random strings of random length. Will post details when I get it working.
16:36akhudekstompyj: I’ve expereinced issues with st3 and the repl
16:36stompyj{blake}: Yeah, I’m excited to try Cursive
16:36dbaschfowlslegs: cool
16:36noonianyeah, i like LT and hope development continues, but it's open source now so in theory the community could move it forward
16:36stompyjakhudek: 1000% agreed. I meant ST3 is my non-clojure IDE
16:37stompyjnoonian: Yeah, it just feels like it needs a couple more releases to get it to the point where the community will want to push it over the edge
16:37{blake}I've been using LT when I don't want to deal with "projects" and "workspaces" and what-not.
16:37stompyjAll that said, props to Chris, it’s amazing for what it is
16:38akhudeklighttable has always had too much magic in it when I’ve tried it. It’s great for the cases it’s explicitly programmed for, but very quicly falls flat in more complicated scenarios
16:38TimMcstompyj: Source on LT statement?
16:39stompyjsure, one sec
16:40nooniani don't even use the in-line evaluation stuff really, i just like it as an editor that's as pretty or prettier than sublime text and the configuration files use edn and have a nice auto complete feature
16:40nooniani just keep a lein repl up next to it
16:40stompyjhttps://groups.google.com/forum/?fromgroups#!topic/light-table-discussion/A3pc87gGcHc
16:40stompyjI won’t quote bomb the channel, but scroll down to see his response
16:42TimMcthanks
16:43nooniannice, i hadn't seen the new lighttable.com site
16:44nooniansounds like he's focusing on aurora to try and make the company sustainable, and that he's not ditching LT, just trying to get the time to keep working on it
16:44fowlslegs,(Integer/toBinaryString -20)(Integer/toBinaryString 255)
16:44clojurebot"11111111111111111111111111101100"
16:44fowlslegsdbach: ^
16:45fowlslegs,(Integer/toBinaryString 255)
16:45clojurebot"11111111"
16:45justin_smithdbasch: what about storing the password as a byte-array instead of string - that prints opaquely and can be zeroed
16:45justin_smithdbasch: also the underlying crypto stuff expects byte arrays, it is the lib in front that will convert from string from what I have seen
16:46dbaschjustin_smith: I’m not too worried about the password after it’s hashed, I’d like to zero-out the plaintext password that comes into the api but (being Clojure) I can’t :)
16:47justin_smithdbasch: you can get the request before the middleware expands the body, while it is still an input stream
16:47justin_smithas long as you give it back another input stream (with pw zeroed), you are fine
16:47justin_smithI did something similar with a request serializer lib
16:48fowlslegsThe whole integer to binary string thing maxes out a bit before 2^32
16:48fowlslegs,(count (Integer/toBinaryString (dec (Math/pow 2 31))))
16:48clojurebot31
16:49fowlslegsI can still work with this because I can map bitwise operators across vectors of numbers with binary representations that are at maximum 1 byte.
16:50fowlslegsBijective rotations left and right might be hard to do efficiently though.
16:50dbaschjustin_smith: interesting idea. I’ll think about it.
16:50fowlslegsAnyway, if anyone has any ideas, let me know, otherwise I'll stop thinking aloud.
16:52dbaschfowlslegs: well, you can move on to Long :)
16:52justin_smithdbasch: the key is to make sure it sees the request before any other handler or middleware, of course
16:52fowlslegsdbasch: My knowledge of Java is very limited.
16:53dbaschjustin_smith: although in the real world nginx or waht have you also has the password in memory
16:53fowlslegsdbasch: Not that I'm not willing to learn.
16:53dbaschjustin_smith: it’s probably not that important anyway
16:53justin_smithfair enough
16:53dbaschfowlslegs: Long has the same api, only it’s 64 bits
16:54dbaschfowlslegs: how much random data do you need, and in what format?
16:57fowlslegsdbasch: This is a genetic programming experiment to evolve a compression function for use in a cryptographic hash.
16:57fowlslegs(defn gen-plaintext [distr-center] (-> (r/lrand-gaussian) Math/abs (* distr-center) round #(repeatedly (r/lrand-int 255))))
16:58fowlslegsThis is what I'm using to create random binary strings. If I put in 100000 I get an email, 1000 a short txt file, etc..
16:59dbaschwhat is round?
16:59dbaschoh, never mind
17:00dbaschfowlslegs: any reason to use a gaussian?
17:01dbaschfowlslegs: and also, why do you need binary strings? Couldn’t you just generate random text?
17:03fowlslegsdbasch: For the error function I'm trying to analyze each compression functions performance measured in terms of a random sampling of its performance on higher orders of the strict avalanche criterion when implemented in a variation on the classical Merkle-Damgard.
17:03fowlslegsdbasch: I think my results will be best if I use varying length strings.
17:04stompyjnoonian: understood, I didn’t mean to insinuate he was ditching LT, just that he was shifting priorities a bit
17:04stompyjwhich makes sense to me, I just hope LT is far enough along that people really want to dig in
17:05fowlslegsdbasch: I can say test it's adherence to GSAC for 3 small, 3 medium, and 3 long strings, with variation in all three categories.
17:05noonianstompyj: yeah, thanks for linking that discussion anyway, i'm now discovering a bunch of features that were added like the plugin manager
17:06fowlslegsdbasch: Does that make sense? Kind of going with the more variation and randomness, the better results I will get, at least in terms of what I throw at the compresssion functions (this is not the same for the function set, terminals, gen operators, etc.).
17:07dbaschfowlslegs: so you’re looking to generate strings with varying levels of entropy?
17:10Jaoodis it common practice to use -main in applications?
17:13amalloythere's not really any other way to do it, Jaood?
17:13justin_smithamalloy: well you can name it something else I guess (or I seem to remember having done so)
17:14amalloyjustin_smith: yes, you can in fact change the prefix
17:14Jaoodamalloy: lein lets you use a different name
17:14amalloyfrom - to anything you want. but why bother?
17:14fowlslegsdbasch: Entropy as I understand it in the language of computer science is the randomness that comes from hardware timings and such. This may not meet the mathematical distribution of a cts uniform distr when we look at it in large quantities, but it is much less deterministic than a PRNG. It might be true that the values generated by our PRNG have greater entropy when they are shorter, but that is not what I'm trying to achieve. The Mersenn
17:14fowlslegsDid that cut off?
17:14welderyes
17:14fowlslegsWhere?
17:14stompyjThe Mersenn
17:15fowlslegsMersenne-Twister algorithm is cryptographically secure, so I'm more looking for variation in length for testing purposes because perhaps the performance of certain compression functions in my population will be poor when given very short or long strings and it needs to be able to perform well on all strings.
17:16Jaoodamalloy: but I meant that any function call can really just start your app
17:17amalloyi'm not aware of such an option. what is it?
17:17amalloylike, if i want to build an uberjar which, when run, first calls my.ns/foo instead of my.ns/-main, what do i do?
17:17llasramamalloy: Use `lein-otf` :-)
17:18amalloy$google lein otf
17:18lazybot[timmc/lein-otf · GitHub] https://github.com/timmc/lein-otf
17:18amalloyi see. plausible, i guess, but i wouldn't say that because some random plugin allows it it's a feature of lein
17:19TimMcIt's not random, it's my wife!
17:19JaoodCalls the -main function in the namespace specified as :main in project.clj.
17:19JaoodYou may use -- to escape the first argument in case it begins with `-' or `:'.
17:19JaoodIf your main function is not called "-main", you may use a namespaced symbol
17:19Jaoodlike clojure.main/main.
17:19amalloyJaood: right, i said uberjar. not lein run
17:19llasramJaood: More generally -- although `lein run` and other tricks will let you invoke some arbitrary function, (a) the built-in `clojure.main` class wants to run a function named `-main` (b) the genclass tooling wants a function named `-main` (mod you can change the prefix if you want)
17:19TimMcJaood: So, all lein-otf is doing is providing a -main and calling something else that you specify.
17:20TimMcJaood: All Java processes start with a call to main.
17:20Jaoodamalloy: right, I wasn't talking about jars, just a simple file, like a script
17:20amalloysomething that you make the user run via lein is not much of an app
17:20llasramAdditionally -- you could name all your Clojure source files with the extension `.funkyfuntimes` and get everything to work. But why?
17:21JaoodTimMc: goi it
17:21JaoodI should haved said script instead of app :P
17:24Jaoodllasram: yeah, was just reading about genclass
17:25fowlslegsdbasch: Long ain't as long as you think.
17:26fowlslegsI mean it's probably #'Integer/toBinaryString
17:26Jaooddo you guys have like a shell allas for 'java -cp clojure.jar clojure.main' then? for running scripts
17:26fowlslegsWon't work on anything with a minimal binary representation > 32 bits in length
17:26Jaoods/allas/alias/
17:26llasramJaood: No scripts. Doesn't really work
17:27noonianis there anyway to reload code in a repl such that multimethod definitions are re-evaluated?
17:27Jaoodllasram: why not?
17:27turbofaili don't have a general script for doing something like that, but i do have some scripts that specify namespaces to run
17:28llasramJaood: I mean that in practice. You pay the whole JVM start-up time to get a process with no libraries. Just isn't worth it
17:28llasramnoonian: You mean e.g. changing the dispatch function?
17:28justin_smithJaood: that would only work with clojure.core + what comes with the jvm, I typically use other deps, which means needing to manage deps, which means lein to me
17:28noonianllasram: ah, yes
17:29llasramnoonian: Yeah, for that you need to actually replace the multimethod instance, which will drop all of the implementations too
17:29turbofailoh yeah usually my scripts are dealing with some sort of uberjar with clojure in it, not the clojure jar alone
17:29llasramnoonian: OTOH, that's almost always what I want, so I just use the pattern of having `(def my-mm nil)` right before the actual declaration
17:29turbofailand they're usually running a long process, as part of a cron job
17:30justin_smithturbofail: then I would do lein uberjar + java -jar usually
17:30Jaoodjustin_smith: llasram: well the jvm surely has lots of libraries for simple system tasks/scripts no? but I can see how the startup time can be an issue
17:30noonianllasram: just during development? or do you leave that in there and not worry about it?
17:30llasramnoonian: The latter. Doesn't hurt anything :-)
17:30noonianllasram: thanks
17:31llasramI'll even claim that it more closely aligns multimethods with protocols, since re-compiling the namespace containing a protocol loses all existing registered protocol implementatinos
17:31turbofailjustin_smith: `java -cp uber.jar clojure.main ...` gives more flexibility. i can pick a namespace to run, or specify a random file to run with those dependencies available, or whatever
17:31turbofailalso having to AOT a main class is lame
17:31justin_smithturbofail: oh, interesting point
17:32llasramYou can also add extra deps, which is useful for running under frameworks
17:32technomancyturbofail: as of the next version of lein if you dont specify an uberjar entry point, it assumes clojure.main
17:32technomancyso you can use java -jar
17:33turbofailah
17:33turbofailthat's handy
17:33technomancyI agree re: having to AOT just to get a main
17:38l1xhey clojure aces, I am trying to write a function that does multiple update-in -s for a single swap! call but i fail https://gist.github.com/l1x/1d29bc762a316461a849
17:38l1xit throws a null pointer exception on a key that does not exist yet
17:39llasraml1x: try s,inc,(fnil inc 0),
17:41technomancyfnil is great
17:41technomancypartly because, you know, f-ing nils.
17:41llasramhah
17:41l1xllasram: you right
17:41l1xthanks!
18:00m1dnighthey guys o/
18:01noonianyo
18:03Glenjaminhi guys, does anyone have any experience with pulsar - is there such thing as pmap for pulsar, does it make sense to use lightweight threads in this way?
18:05rasmusto~trampoline
18:05clojurebottrampoline is the clenched fist in the gauntlet of letfn
18:06justin_smithbhauman: very nice
18:06bhaumanjustin_smith: Thanks man
18:06whodidthishow do i use clojure.set/union on '(#{:a} #{:c} ...)
18:07rasmustowhodidthis: apply
18:07whodidthissweet thanks
18:08rasmustowhodidthis: yeah, most of the set functions are multi-arity, so you can use apply on all of them
18:08rasmusto"difference" is the only one that might do something confusing, the rest should be straightforward :p
18:09justin_smith,(set/difference #{1 2 3 4 5} #{1 2 3} #{4}) kind of like multi arity -
18:09clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: set, compiling:(NO_SOURCE_PATH:0:0)>
18:09justin_smith,(clojure.set/difference #{1 2 3 4 5} #{1 2 3} #{4}) kind of like multi arity -
18:09clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>
18:10rasmusto,(require 'clojure.set)
18:10clojurebotnil
18:10justin_smith,(clojure.set/difference #{1 2 3 4 5} #{1 2 3} #{4}) kind of like multi arity -
18:10mmitchellis it considered "ok" to have side effects in a watcher fn?
18:10clojurebot#{5}
18:10justin_smiththanks :)
18:11mmitchelli'd think that watchers would really be all about side effects anyway?
18:11stompyjbhauman: badass!
18:12justin_smithyeah, seeing the whole thing, it was very well done
18:12coventrymmitchell: om does.
18:12justin_smith(inc bhauman)
18:12lazybot⇒ 1
18:12dbaschbhauman: just watched it, awesome.
18:12mmitchellcoventry: ok thanks, good to know
18:12bhaumanjustin_smith: stompyj: thank guys, BTW I just posted it to HN so … you can dec me for asking for votes
18:13stompyjI was just looking for it on HN :)
18:13bhaumanon the new page
18:13coventryI find that when I re-evaluate clojurescript, the attached web page only updates accordingly maybe 50% of the time, and I haven't been able to figure out why.
18:14mdeboardGlenjamin, Is Pulsar still relevant since the advent of goroutines in Clojure?
18:14mdeboard(This is the first time I've read about pulsar)
18:15Glenjamini think the thing i was actually looking for was reducers in my case
18:15mdeboardI agree with most of that blog post regardless
18:15Glenjaminbut afaik pulsar provdes an api-compatible version of core.async
18:15Glenjaminso they must think it's useful
18:15mdeboardahh
18:16Glenjaminas i understand it, quasar does it's own scheduling across a threadpool, rather than leaving it to the OS
18:16Glenjaminwhich has some benefits in some cases apparently
18:20Glenjaminbah, i wish i'd read this rich hickey reducers blogpost before starting this latest project
18:20Glenjamini've got everything working with lazy seqs and recur
18:20bbloomGlenjamin: this talk is really good too: http://vimeo.com/45561411
18:20amalloymmitchell: yeah, a watcher with no side effects does nothing at all
18:21Glenjamini've been trying to optimise a large DB read via lazy-seqs
18:21amalloyi mean, arguably you should try to stay away from watchers, but if you do use one, it necessarily has side effects
18:21mmitchellamalloy: cool yep, thanks for the confirmation!
18:21Glenjaminand it turns out i was solving the wrong problem
18:21bbloomi've only found watchers useful for interop with externally stateful things during dev time
18:21bbloomlike managing a "debug window" in swing or something
18:22Glenjamini've got no explict paralleism in this code, and it still manages to use all my cores - sounds like reducers are the solution i wanted
18:22amalloyi used a watcher once at geni
18:22amalloywe had a background thread churning through a work queue as fast as it could, and some client would say "let me know when my task id #1234 is done"
18:22Glenjamini wanted something in between a watcher and a validator the other day
18:23amalloyso there was an atom or something with the id of the last-processed job, and we'd set a watcher to notify the user when their thing was done
18:23Glenjamini wanted to throw some data into an atom, but have it compute some derived values before swapping - but i guess that's just an agent
18:23amalloythat sounds like a function, Glenjamin
18:24Glenjaminwell yeah, that what i have, but i wanted to ensure you couldn't put the wrong thing in the atom
18:24Glenjamini suspect this is my OO reflex, which i need to beat down
18:26justin_smithGlenjamin: well, you didn't subclass hash-map with a version of conj that throws exceptions on certain inputs
18:26Glenjamini did add a validator to my atom to check the keys
18:27m1dnightcould anyone tell me, how I can create a key-value map (or what is the proper term?) from [[:a 1] [:b 2]]? I.e., to {:a 1 :b 2}
18:27m1dnightplease :)
18:27justin_smithm1dnight: into
18:27Glenjamin,(into {} [[:a 1] [:b 2]])
18:27m1dnightoh
18:27clojurebot{:a 1, :b 2}
18:28m1dnightis that the same then, as #{} ?
18:28m1dnightI was reading about this in the docs
18:28Glenjamin#{} is a set
18:28justin_smith,(class #{})
18:28clojurebotclojure.lang.PersistentHashSet
18:28m1dnightoh :)
18:28justin_smith,(class {})
18:28clojurebotclojure.lang.PersistentArrayMap
18:28m1dnightohhh that's what I need
18:28noonianbut you can also use with into heh
18:28Glenjaminjustin_smith: is that something someone did?
18:28rasmusto,[#{1 2 3} {1 2, 3 5}]
18:28clojurebot[#{1 3 2} {1 2, 3 5}]
18:28m1dnighthey, thanks a lot!! :)
18:28noonian,(into #{} [[:a 1] [:b 2]])
18:28clojurebot#{[:b 2] [:a 1]}
18:29noonian,(into #{} [1 2 3])
18:29clojurebot#{1 3 2}
18:29justin_smithGlenjamin: no, just going even more OO with it, saying you aren't that far off the saintly path yet
18:29m1dnighthmm, just saw it here :p seems not to be what I want
18:29m1dnightoh wait, yes it is
18:29Glenjaminheh
18:29m1dnightthanks
18:29justin_smith,(into #{} [1 2 3 2 1])
18:29clojurebot#{1 3 2}
18:30m1dnight,(into {} [[:a 1][:b 2]])
18:30clojurebot{:a 1, :b 2}
18:30m1dnightyes sir indeed :)
18:30m1dnightthanks guys
18:30Glenjamini've got a map in an atom {:a a, :b b}, where (= (f a) b) always holds but is expensive to calculate on demand
18:30Glenjaminso i kinda wanted to encode that relation into the data structure
18:31Glenjaminbut for now i'm just creating that data with a function and only updating the atom via those functions
18:31justin_smithGlenjamin: that sounds like a cache / memoization
18:31Glenjaminit is
18:31coventry(doc memoize)
18:31clojurebot"([f]); Returns a memoized version of a referentially transparent function. The memoized version of the function keeps a cache of the mapping from arguments to results and, when calls with the same arguments are repeated often, has higher performance at the expense of higher memory use."
18:32Glenjaminsort of
18:32amalloywhy not just put a delay of the result in? then you don't have to calculate it unless it's needed
18:32justin_smithGlenjamin: what about a map from input to a delay of that input's realization?
18:32justin_smithjynx
18:32Glenjamini get update events, and get requests can receive the previous version
18:32Glenjaminrequests are continuous, and should get the latest value as soon as it's ready
18:33Glenjamincurrently doing something like: new info -> ~ 10 seconds of work -> update atom with latest data
18:33justin_smithwould you want to prevent the situation where two threads are trying to realize the same result in parallel?
18:33Glenjaminyes
18:34{blake}I'm going through the "How Clojure babies are made" article, and when I get to the lein run part, I find that lein puts nothing in the classes directory! I can't find the classes anywhere on my disc (except for the ones I made the manual build). What am I missing?
18:34Glenjamin{blake}: possibly ~/.m2 ?
18:34amalloyit's probably just really old, {blake}, like from lein 1
18:34Glenjaminif i understand the question
18:34Glenjaminoh, i perhaps dont
18:34{blake}amalloy: Where'd they go? Does lein bundle the classes into...something else?
18:35Glenjaminjustin_smith: calculating the result currently takes over all cores for some time, so doing more than one at once would be bad
18:35rasmustoGlenjamin, justin_smith: https://www.refheap.com/20471 maybe useful?
18:35amalloyi don't know what that tutorial asks you to do, so i don't know what lein does in that case :P
18:35justin_smithGlenjamin: a delay will only be in progress of being forced once
18:35{blake}It's just a "lein run".
18:36{blake}It goes through the manual build process to illustrate what lein does for you automatically.
18:36Glenjaminjustin_smith: but i'd only end up deref-ing it straight away, as i dont want to update the atom until the result is ready
18:36Glenjamini'd rather serve the old value
18:36{blake}I guess it doesn't really matter for my purposes. Just curious.
18:37justin_smithGlenjamin: ahh, that sounds almost more like an agent than a delay, if we are talking about "old value" and "new value"
18:37Glenjaminyeah, i might re-work it like that when i'm done optimising the calculation
18:37technomancy{blake}: classes arent generated if you don't AOT
18:38Glenjaminat the mo i just have to not reset! the atom until i know i'm done
18:38Glenjaminit's a league table for an in-play game
18:38Glenjaminwith ~1 million players
18:38{blake}technomancy: Oh! So it just ... what, compiles in-memory and then discards?
18:39technomancy{blake}: yep
18:39technomancyits clojure that does that btw, not lein
18:40Glenjaminhrm, actually an agent doesn't really make a difference here
18:41{blake}Ahhhh. So maybe if I want to update this I'd have to put the AOT in there or "lein compile"? Seems like the latter should work but I don't see the class files. I'll search...
18:41Glenjamini think i'm happy that calculating derived fields is just calling the right function, rather than trying to set things up so no-one can call the wrong function
18:42turbofail{blake}: lein will only AOT compile namespaces that you explicitly tell it to
18:43technomancy`lein compile` means "compile the things in :aot" which is usually nothing
18:43justin_smith{blake}: lein check will compile every ns, as a side effect
18:43justin_smithalso I advise runnint lein check frequently it helps catch problems
18:43turbofailanyway if you want to look at the compiler output no.disassemble is way more useful/fun
18:43justin_smith*running
18:45turbofailhm. looks like bytecode exploration's not really what that article's about. oh well.
18:47coventryWhat kinds of problems is lein check useful for catching?
18:48technomancylein check complects reflection warnings with compilation failures
18:48justin_smithcoventry: code that is infrequently run but statically invalid
18:48coventryI see. Thanks.
18:49technomancyyou can also do `lein compile :all` to get the latter without the former
18:49technomancybut then you need to clean, which is annoying
18:49justin_smithtechnomancy: oh, cool - though I actually am glad to see reflection warnings on the whole project
18:50dbaschturbofail: have you seen this series of posts? http://blog.guillermowinkler.com/blog/2014/04/27/decompiling-clojure-iii/
18:50technomancyjustin_smith: it's useful, it's just a weird way to expose it
18:51turbofaildbasch: yeah i read those
18:52justin_smithcoventry: or a more concrete example, one of the top level namespaces in a lib has a bad function definition, lein check lets you find that within the lib repo, instead of finding it in an app that uses the lib
18:53justin_smithcoventry: nothing that wouldn't be caught if you defined at least one test which required the ns, but it's still useful
18:57rasmustooh god I made a nested thing
19:01justin_smith#onlyon#clojure
19:02rasmusto})})})})})})})})})})})})] in my repl
19:02justin_smithahaha
19:03justin_smiththat's some serious nesting
19:03rasmustothat's with :max-steps 4 :o
19:03TimMcSell it as modern art.
19:04rasmusto~art
19:04clojurebotPardon?
19:04coventry,(nth (iterate vector []) 1000)
19:04clojurebot[[[[[[[[[[#]]]]]]]]]]
19:04TimMcclojurebot is artless
19:05rasmustoI'm doing something like this: (loop [fns (interleave (repeat fn1) (repeat fn2)) thing blah] (recur (drop 1 fns) ((first fns) blah)))
19:05rasmusto:p
19:05rasmustoer, (map (first fns) blah)
19:06rasmustoIt's supposed to be a breadth-first traversal of sorts?
19:06TimMccoventry: http://clojure-log.n01se.net/date/2014-03-25.html#18:04
19:06justin_smith,(nth (iterate (comp #(apply hash-map %) (juxt identity identity)) {}) 4)
19:06clojurebot{{{{{} {}} {{} {}}} {{{} {}} {{} {}}}} {{{{} {}} {{} {}}} {{{} {}} {{} {}}}}}
19:07rasmustoI was reading about ((.)$(.)) yesterday
19:07justin_smith,(nth (iterate #(hash-map % %) {}) 4) 'doh
19:07clojurebot{{{{{} {}} {{} {}}} {{{} {}} {{} {}}}} {{{{} {}} {{} {}}} {{{} {}} {{} {}}}}}
19:08justin_smithrasmusto: that's a funny place to keep your money
19:08rasmusto,(juxt identity identity identity)
19:08clojurebot#<core$juxt$fn__4213 clojure.core$juxt$fn__4213@1af86ae>
19:08coventryTimMc: You are a bad, bad man.
19:09TimMc:-D
19:09TimMc:-D :-D :-D
19:09justin_smith,(nth (iterate #(hash-map % %) {}) 20)
19:09clojurebot{{{{{{{{{{# #} {# #}} {{# #} {# #}}} {{{# #} {# #}} {{# #} {# #}}}} {{{{# #} {# #}} {{# #} {# #}}} {{{# #} {# #}} {{# #} {# #}}}}} {{{{{# #} {# #}} {{# #} {# #}}} {{{# #} {# #}} {{# #} {# #}}}} {{{{# #} {# #}} {{# #} {# #}}} {{{# #} {# #}} {{# #} {# #}}}}}} {{{{{{# #} {# #}} {{# #} {# #}}} {{{# #} {# #}} {{# #} {# #}}}} {{{{# #} {# #}} {{# #} {# #}}} {{{# #} {# #}} {{# #} {# #}}}}} {{{{{# #} {# #}...
19:10TimMcjustin_smith: See my link to coventry for an infinite version.
19:10justin_smithlooking at that now...
19:10justin_smithI remember that
19:19{blake}turbofail, justin_smith, technomancy: Thanks all!
19:20{blake},(map inc (list turbofail justin_smith technomancy))
19:20clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: turbofail in this context, compiling:(NO_SOURCE_PATH:0:0)>
19:20{blake}eh well
19:22justin_smiththe inc bot command is not that smart
19:22justin_smith(inc juxt)
19:22lazybot⇒ 8
19:23justin_smithI could have sworn that was more popular
19:23rasmusto(inc juxtin_smith)
19:23lazybot⇒ 1
19:43andrewchambersHi there
19:43andrewchambersis there a clojurescript irc too?
19:43justin_smithyeah, #clojurescript
19:43andrewchambershas anyone benchmarked clojurescript vs clojure
19:43andrewchambersbtw
19:44andrewchambersTrying to decide which to use for a project
19:44technomancyserver-side cljs?
19:44andrewchambersnot a server really
19:44justin_smithI would be surprised if clojurescript beat jvm clojure on any benchmark, but I can't cite proof
19:44andrewchambersIm writing a C compiler with clojure
19:44technomancyany benchmark but startup time or memory usage, yeah
19:45andrewchambersthe only benefit I can think of clojurescript is deploying to web for fun
19:45andrewchambersif its not faster
19:45andrewchambersthe tooling for clojurescript also seems worse
19:45technomancyheh, that is a generous way to put it
19:46andrewchambersI just tried to benchmark my start of a tokenizer in both
19:46justin_smithtechnomancy: well for a fair comparison you would want uberjar with java -jar vs. clojurescript already compiled - unless we mean dev spin up time
19:46andrewchambersand i couldnt even get it to work on clojurescript
19:47justin_smithalso the lib scenario with clojure is much more solid
19:47justin_smith*jvm clojure (since technically all the impls are clojures)
19:47justin_smithandrewchambers: there is also the too often neglected CLR port of clojure
19:48andrewchambersyeah, i dont care too much about that since im linux dev
19:48justin_smithandrewchambers: it works great under mono
19:48andrewchambersI think most of my code is purely algorithmic
19:48andrewchambersso i can swap between
19:48andrewchamberswith a little bit of effort
19:50andrewchambersIf anyone is interested, I'm trying to reimplement my own version of this guys C compiler https://github.com/rui314/8cc in clojure. To prove to myself a clojure implemention is superior
19:50andrewchambersand to kind of test, the differences and benefits
19:52andrewchambersmight be an interesting benchmark at least
19:54technomancywriting code to prove one technology is superior doesn't always work out well
19:55technomancywhy not write it in order to discover the strengths and weaknesses of a given language/runtime?
19:55technomancyhttp://technomancy.us/169
19:56andrewchambersI actually wrote a large part of a C compielr in python previously
19:56andrewchambersthe immutability in clojure makes the way things are done slightly different
19:56TimMctechnomancy: (Note: On stupidly large monitors, the "next post" arrow floats over the post's text.)
19:56andrewchamberslike, im representing the input source as a lazy seq
19:57andrewchambersso implementing a recursive descent parser is a bit different
19:57technomancyTimMc: yeah... I should just get rid of those. I don't have the CSS chops to pull it off correctly =)
20:00ppoldHi guys, what is the current state of debugging in Clojure, using Emacs?
20:01TimMctechnomancy: Another layer of indirection should do it.
20:01technomancyTimMc: go on?Z
20:08TimMctechnomancy: If you enclose them in a div that is position:fixed and dropped 280 pts down the page, then float the arrows to the two ends of the div...
20:08technomancyTimMc: I'll give that a shot; thanks!
20:08TimMcBut you may have to futz around with ems and pts for a bit.
20:09technomancyfutzing is what css is all about
20:09TimMctechnomancy: One downside: Selecting text between teh arrows may cause shenanigans.
20:10technomancyI'm sure it'd be better than what I have
20:46andrewchambersis a difference in behaviour in clojurescript and clojure a bug?
20:47andrewchambersif you do a (println my-lazy-seq) in clojure it pritns it as it evaluates it, if you do it in clojurescript it waits until the whole seq is generated before printing anything
20:47justin_smithis an insect a bug? sometimes
20:47andrewchambersto be more specific :)
20:49justin_smithI'm not sure. Maybe someone else knows.
20:49hiredmanthe jvm has streams you can print to incrementally
20:50hiredmanjs doesn't really
20:50hiredmanthe reallity of the platforms
20:50andrewchambersdoes that java console not just have a .write method
20:51TimMcandrewchambers: Javascript doesn't have anything like OutputStream, no.
20:52TimMcYou can fake it with incremental output to the page, but you can't do that in the console.
20:52andrewchambersWell, im using the nodejs one for a command line program
20:52andrewchambersI guess its just used much
20:52andrewchambersor too hard to detect which platform you areo n
20:53andrewchambersnot used much*
21:02andrewchamberswell did my tests
21:03andrewchambersclojure with reflection took 2 minutes to process my file
21:03andrewchambersclojure with typehints and large heap took 22 seconds
21:03andrewchambersclojurescript took 3 minutes with no optimization and clojurescript took 1.5 minutes with advanced
21:12akhudekandrewchambers: reflection really is a killer
21:12andrewchambersyeah, it was on a single call to my BufferedReader
21:13andrewchamberssince im processing a 30 meg text file
21:13andrewchambersthough the C version does it in less than a second haha
21:13akhudekit’s really hard to beat C
21:15bbloomshouldn't be that big a disparity for a simple file parse job though...
21:16akhudekbbloom: including startup time possibly?
21:16akhudekro rather andrewchambers
21:17andrewchambersyeah, but startup time is aroudn a second
21:17andrewchambersmy PC is pretty quick at starting clojure
21:17andrewchambersI am using lazy seqs and other things in the clojure code
21:17akhudeklazy seqs slow things down
21:17andrewchambersso its probably just overhead from that sort of thing
21:18andrewchambersBut thats kind of what im testing
21:18andrewchambersif using high level features like that negatively affect performance too badly
21:18akhudekin my experience they do
21:18akhudekit’s ok for most of the code
21:19akhudekbut awful for the cpu intensive bits
21:19andrewchambershaha, well my application is pretty cpu intensive
21:20akhudekwhat is your app?
21:33andrewchamberscompiler
21:35technomancyif you want to write code that sacrifices maintainability for perf, it's hard to beat http://meshy.org/2009/12/13/widefinder-2-with-clojure.html for a starting point
21:36andrewchamberstechnomancy, thanks for that link , its actually pretty applicable
21:37technomancyold but classic
21:38andrewchambersIf my code is written in a way that allows some concurrency and future computers have more than 4-8 cores it might actually be faster
22:02ivanhttps://github.com/cldwalker/datomic-free/blob/master/bin/datomic-free
22:03ivanI find all the useful things from unrelated google searches
22:04Jaoodtalking about datomic, is there a favourite storage option for it?
22:10wildnuxhi, i am using emacs prelude with clojure mode to learn clojure, when i type say a function and go to next line, it does not auto-indent, how do i make emacs to auto-indent?
22:10wildnuxi am trying to learn emacs and clojure together :)
22:11Jaoodctrl + j
22:11wildnuxJaood: :) thank you
22:11wildnuxJaood: is there a way to make it automatic with enter key?
22:13Jaoodwildnux: you can with some elisp I guess (I'm noob too)
22:13wildnuxJaood: :) no problem
22:13Jaoodwildnux: you can ask in emacs, but I have sense that doing that is anti-emacs
22:14Jaood#emacs
22:15wildnuxJaood: in that case, i will try to remember it
22:15Jaoodwildnux: you can change pretty much anything in emacs with elisp
22:16Jaoodwildnux: but stick to emacs/clojure-mode defaults while learning clojure so you don't feel overwhelmed
22:17Jaoodwildnux: this is a nice starter config https://github.com/technomancy/better-defaults
22:18ToxicFrogWhen using lein repl, how do I get it to print the entire stack trace on error by default?
22:35technomancyToxicFrog: not sure, but if you figure it out could you submit a PR to add it to sample.project.clj?
22:35technomancybecause I am so not a fan of the current behaviour
22:42ToxicFrogtechnomancy: oh, I thought this was something you'd done deliberately
22:42technomancynah I use emacs for everything. trptcolin wrote the repl client.
22:49ToxicFrogSo apparently lein uses REPLy, which in turn uses nREPL, and I'm not sure which of those the problem is in.
22:49technomancyToxicFrog: it's in reply
22:57ToxicFrogtechnomancy: :repl-options { :caught pst }
22:57technomancynice
22:57ToxicFrogThat is almost correct; it prints the first line of the stack trace twice for some reason
22:57technomancymaybe it's in addition to whatever reply does by default
22:57ToxicFrogI suspect so. Still trying to figure out how to suppress that.
22:57ToxicFrogThis is close enough for me to be content with, though.