#clojure logs

2012-09-07

00:02FrozenlockErr.. how does one do this in cljs?: goog.i18n.DateTimeSymbols = goog.i18n.DateTimeSymbols_en_ISO;
00:03FrozenlockI was thinking of bindings, but the variable isn't declared as dynamic
00:05xeqi(set! goog.i18n/DateTimeSymbols goog.i18n/DateTimeSymbols_en_ISO) ?
00:06tomojdjanatyn: thanks for what?
00:06tomojI was going to recommend (zero? x) instead of (= 0 x)
00:12Frozenlockxeqi: Thanks! (still untested). Is there the same function in clj? I don't remember ever using it! o_O
00:13xeqiFrozenlock: you can use set! to change public fields in java, but its rare to see them
00:14xeqithat was a guess btw, but I imagine its something similar
00:15xeqiI'm using it to play with three.js
00:16FrozenlockIt does work, thank you very much :)
00:20FrozenlockOh wow, the demos are impressive!
00:44dansalmoIs there a way to bind a symbol during run time based on an evaluation besides using (load-string (str "(def "...
00:45tomojwhy?
00:45clojurebotWhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
00:47tomojwat?
00:47clojurebotFor Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
00:47tomojothx
00:53dansalmoCan list of symbols '(x y z) be defined at run time?
01:00oyvindnhmm, why is up to 5 arguments explicitly defined for "apply" with & args and not just args used (the first signature)?
01:04antares_dansalmo: (list (symbol "x") (symbol "y") (symbol "z"))
01:05antares_,(list (symbol "x") (symbol "y") (symbol "z"))
01:05clojurebot(x y z)
01:39dysingerIs there an easier way to go from an EntrySet to a hash than this ? (reduce conj {} (.entrySet {:one 1 :two 2}))
01:39dysinger,(reduce conj {} (.entrySet {:one 1 :two 2}))
01:39clojurebot{:two 2, :one 1}
01:40tomojreduce conj is into
01:40dysingerthanx
01:40dysingerthat's better
01:40dysingerI'm uber rusty :)
01:41tomojwhere'd you get an entryset?
01:41dysingerjava interop
01:41tomojah
01:45samratin noir, how do I set up routes so that calling a route with params sends a different respnse than without params
01:45samratlike /api would redirect to api-docs, but /api?url=.. would respond with json
01:46samratcan I do this without using if; something like function overloading?
01:47tomoj"without using if" is a strange requirement
01:48samrattomoj: no, I just wanted to know if it was possible
01:51amalloysamrat: lambdas are turing complete; anything is possible
01:52muhoook, weird (for [i bar] (apply hash-map i)) works, but (map #(apply hash-map) bar) pukes
01:52muhooaren't they the same thing?
01:52tomoj#(apply hash-map) is nullary
01:53muhoooh, duh %
01:53muhoo(map #(apply hash-map %) bar) works, sorry for noise
01:54tomojis consensus that defpage is not evil?
02:01dansalmoantares_: I'm sorry, I meant is there a way to bind a value to each symbol in the list of symbols '(x y z)
02:02antares_,(let [x y z] [1 2 3] y)
02:02clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: let requires an even number of forms in binding vector in sandbox:>
02:02antares_,(let [[x y z] [1 2 3]] y)
02:02clojurebot2
02:03dysingerargh I'm so rusty - what's the clojure equiv to haskell flip again ?
02:03dansalmoThe symbols are in the list received as input, not avail during compile
02:04dansalmothe symbols in the list are not available until the program is running.
02:04antares_dysinger: (apply f (reverse args)) is the best I can think of
02:05dansalmoCan you show me a form that uses the list '(x y z)?
02:06dansalmo, (def (last '(x y z)))
02:06clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
02:06antares_dansalmo: I am afraid there is no such thing
02:07dansalmook, thanks
02:07antares_dansalmo: if you know the structure of your list of values, my example with let will still work
02:07antares_,(let [xs '(1 2 3) [x y z] xs] y)
02:07clojurebot2
02:08dansalmomy list is a list of undefined symbols, that I would like to define
02:11antares_dansalmo: but you know the structure of the list of values?
02:12antares_if you don't, I am not sure how you would use those locals later
02:12antares_dansalmo: consider using a map instead
02:12antares_it has exactly the key/value relationship you need
02:14dansalmo, (let [[x y z] [1 2 3]] (map eval '(x y z)))
02:14clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
02:15dansalmothis form picks up values from outside the form
02:15amalloyno it doesn't. it just breaks
02:16dansalmoactually, my list is nested, with repeated symbols, '(x z (y z))
02:16dansalmoyou mean the form is not valid?
02:22dansalmo' (let [[x y z] [1 2 3]] [(eval y)])
02:22dansalmo,(let [[x y z] [1 2 3]] [(eval y)])
02:22clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
02:22antares_eval is disabled for clojurebot
02:23dansalmothis works, but I can not eval the list
02:23antares_dansalmo: instead of trying to do that just use maps
02:23dansalmobut I think what I am trying to do would have duplicate keys
02:24antares_dansalmo: use a proplist https://github.com/michaelklishin/chash/blob/master/src/clojure/clojurewerkz/chash/proplists.clj but what you are trying to do is crying for associative data structures
02:25dansalmothanks, I will look at this
02:48dansalmoantares: nested list of maps ( {:x '()} {:z '()} ( {:y '()} {:z '()} ) ) and list of keys with new values '(:x '1 :y '2 :z '3) will work
02:48dansalmoI just need to figure out the most efficient way to apply the new values
02:49dansalmoantares_: nested list of maps ( {:x '()} {:z '()} ( {:y '()} {:z '()} ) ) and list of keys with new values '(:x '1 :y '2 :z '3) will work
02:50dansalmocan not map a func to a nested list
02:51dansalmoantares_: thanks for the help, I think it will work.
02:52antares_dansalmo: nice
03:24kral'morning (here)
04:33andersf_g'morning (there)
04:38ro_stnot for long!
04:38ro_stanyone using datomic and can answer questions about how to go about writing maps of data to it?
04:44AustinYunro_st: elaborate?
04:45ro_stso it allows you to make arbitrary entities and then pin attributed values to it
04:46ro_sti'm wondering if anyone's gone through the process of taking a map of data and converted it into a series of datomic calls, and how that process went
04:48ro_steg, how to sanely and clearly marry keys in the map to attributes in the schema. simplest would be to use attribute idents in the map, but if, say you don't want to expose that information, due to the map coming in off the web, there'd need to be some lookups or whatever to link them together
04:48ro_stthis is more of an opinion-about-approach question than a how-do-i? question
04:55AustinYunso youre getting a map of kvps from the internet, and you want to update an entity in datomic? or add to the schema?
04:56ro_stadd/update an entity in datomic
04:57ro_stthe use case is storing client-side user events. clicked this button, checked that box, visited this url, entered that text.
04:58AustinYunand why dont you want to use the datomic attributes in the map you get from clients?
04:59ro_sti'm not sure :-) some vague idea that it might be prudent not to
05:04ro_stok. i need to play more and pontificate less, obviously
05:05AustinYunwell if you insist on basically translating the db keys to something else for the client, it seems the path of least resistance would be to write a translation fn that takes a client map, reduces through the keys and translates them, and then sends that off as a datomic transaction (also a map)
05:05AustinYunbut i seriously must be missing something here and im well known as an idiot
05:06ro_styes. my idiocy is that i haven't actually spent time in the repl with datomic yet. i'm sure that when i do, it'll all fall into place
05:07AustinYuni only started messing with it last week, so...
05:09ro_stwhat do you think, so far?
05:09AustinYuni'm testing it out because it seems like a natural fit for what i'm trying to do because of the way it deals with time
05:13AustinYunso far the whole immutable, simple data structures, which are also transactions, thing seems really cool
05:14ro_styeah. i'm very enthusiastic
05:16AustinYunbasically the fact that database transactions are just vectors of facts, is <3
05:16AustinYunro_st: https://gist.github.com/2635666 was interesting to me
05:16AustinYuncomes from http://pelle.github.com/Datomic/2012/07/09/transactions-as-entities/
05:19ro_stvery cool
05:20ro_stgotta go!
05:22clgv,(doc dissoc-in)
05:22clojurebotNo entiendo
05:22clgv:/
05:22clgvthere is assoc-in but not dissoc-in?
05:25jmlsay I've got a vector of [x y] pairs and I want to filter on the 'x' bit, is there a more idiomatic way than (filter (fn [[x y]] (predicate? x)) x-y-pairs)
05:26clgvjml: (filter #(-> % first predicate?)) will work too with less pain
05:27jmlclgv: ah, thanks.
05:27jmlI confess I still have a bit of trouble reading '->'
05:28jmlclearly I need to spend more time reading & writing clojure code :)
05:30clgvjml: it's semantically like piping ^^
05:30AustinYunso, on the tools side of things for writing clojure
05:30clgvwith sequences it's ofter pretty handy to use ->>
05:31AustinYuni use vim normally but paredit is too nice to pass up -- anyone write keybindings for evil mode in emacs to rebind vim's movement keys to paredit ones?
05:31jmlclgv: or like composition, but backwards!
05:31jmlclgv: looking up ->> now.
05:32AustinYunjml: ->> is basically ->, but puts stuff last instead of second
05:33jmlAustinYun: thanks.
05:35AustinYunit's hard to google for operator names sometimes :p
05:36jmlyeah. and the description in the API docs is rather technical.
05:39AustinYunjml: http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E#example_191
05:43AustinYun-> is ridiculously useful for accessing stuff from nested data structures, ->> more for chaining functions in my experience
05:45AustinYun(-> person :emplyer :address :city) is like person.employer.address.city in javascript or something
05:46AustinYunit literally never occurred to me to use -> to go through data structures until i read the docs, lol
05:46jmlAustinYun: yeah, I've seen it mostly used for that in the stuff I've read.
05:46AustinYuni was like, "that's so clever! I'm an idiot for not thinking of that"
05:47jmlI guess a lot falls out from keywords being functions.
05:47AustinYunthe keyword <-> data structure function relationship is really useful
05:53weavejesterHm, the latest released versions of Lamina/Aleph seem to be incompatible in places.
05:55weavejesterOr maybe the class names are misleading. Perhaps the ResultChannel is actually a pipeline in 0.5.0
05:55AustinYunman if nobody's done a vim keybinding thing for emacs' paredit, i'm going to have to do it :\
05:56AustinYuni can't stand the emacs chords for moving around
05:56weavejesterThere's evil mode, which doesn't have bindings for paredit, but is quite customisable
05:56weavejesterHowever, Vim and paredit operate under two fundementally different philosophies
05:57weavejesterVim is all about action + movement
05:57weavejesterWhile paredit treats the document as a tree
05:58AustinYunim actually using evil and paredit right now and the keyboard shortcuts kind of step on eachother, especially with xmonad
05:58AustinYunsince M-( moves my friggin emacs window to workspace 9 lol
06:00pyrhey everyone, just to let you know that there is now a leiningen plugin in jenkins
06:02AustinYuni was thinking about for example, in evil normal mode, rebinding ( and ) to paredit-backwards and paredit-forwards
06:03weavejesterAustinYun: That'll work so long as you don't treat them as proper movement keys
06:03weavejesterAustinYun: i.e. d) will probably not work
06:09mpenetweavejester: just curious, what is the issue with pipelines/result-channel ?
06:10weavejestermpenet: In 0.4.0 result-channel seemed to be a type of channel, but in 0.5.0 I think it's a pipeline
06:14AustinYunodd
06:14mpenetit is a separate type now, I dont think it's built on top of pipelines. But yes, 0.5.0 is almost a total rewrite in this respect I think
06:15AustinYunparedit-forward/backward outright do not work correctly in evil mode
06:15AustinYunbut to the extent they DO work, they work properly as movement commands
06:16weavejestermpenet: It works like a pipeline anyway. merge-results works on the output of http-request
06:16AustinYunfor some reason paredit-forward won't properly move from top level sexp to top level sexp, and paredit-backward basically just is move backwards by a word it seems
06:16mpenetyep, pipelines return a result-channel so that makes sense
06:18weavejestermpenet: Do you know if there's a function in aleph for reading netty ChannelBuffers?
06:18weavejestermpenet: That's what's returned for the body of the http response
06:18mpenetweavejester: probably in aleph.formats, not sure though
06:18weavejestermpenet: Ah, thank you!
06:19mpenetthere are a couple apparently
06:20mpenetweavejester: you can also use :autotransform depending on what you are doing
06:20weavejesterLike (http-request {:method :get :url url :autotransform true}) ?
06:21mpenetalmost: :auto-transform true
06:22mpenetbut yes
06:22weavejestermpenet: Ah, perfect
06:23weavejestermpenet: Well, except that I probably want to filter out content types, so I probably don't want them as strings right away
06:23weavejesterBut channel-buffer->string works
06:23mpenetI think auto-transform checks for json and a couple of others
06:28weavejestermpenet: Do you know how you'd catch errors in an Aleph http-request ?
06:28mpenetweavejester: it seems it decodes the body for text json and xml content-types, and returns the raw body if unknown
06:28weavejesterOhh, wait, on-realized
06:29mpenetweavejester: it s just result channels, so you can use on-realize from lamina or run-pipeline
06:29weavejestermpenet: Can the callbacks on on-realized return a result, do you know?
06:29mpenetI almost always end up using run-pipeline
06:29weavejestermpenet: i.e. return the response on success, nil if not.
06:30mpenetweavejester: I wouldn't think so, you will need to check the status yourself
06:30weavejestermpenet: Ah, no, they do! :)
06:31mpenetoh, interesting
06:31weavejestermpenet: (on-realized response identity (constantly nil))
06:31mpenetweavejester: ah yes like this
06:31weavejesterNow I just need to figure out how to apply that to merge-results
06:31weavejesterOh, unless it already works...
06:31mpenetweavejester: but this wont work in practice
06:32weavejestermpenet: Hm? Why not?
06:32mpenetweavejester: 404 for instance wont emit an error
06:32mpenetweavejester: the response completed successfully (no exceptions etc), you will have to check the status in the success handler or in a pipleline stage
06:33mpenetweavejester: to be double checked, but I think that is how it works
06:33CheironHi, would you please have a look at this macro http://pastie.org/4679152
06:33weavejestermpenet: But in on-realized you supply a success and failure callback, right?
06:33weavejestermpenet: So if the success is identity, and the failure is (constantly nil) that should work?
06:34mpenetweavejester: yes, but result-channel failure and http response error code arent the same thing
06:34mpenetweavejester: you wont get 500 errors 404 etc as an error
06:35weavejesterCheiron: You need to "~" the first request on line 2. Also, you could maybe use a function instead of a macro?
06:35weavejestermpenet: Oh yeah
06:36weavejestermpenet: I'll make sure anything with a status >= 400 is converted to nil
06:36Cheironoh, true
06:37mpenetweavejester: yup, if you are in a pipeline you can throw an error to trigger the error handler, not sure that is what you want to do though
06:38weavejestermpenet: Hm, merge-results returns nil if there are any errors in its components. That makes sense, but...
06:38weavejesterI can use on-realized to realize a single result
06:39weavejesterBut I really want to realized many at once
06:39Cheironsorry but what is wrong this time? http://pastie.org/4679182
06:39mpenetweavejester: imo it might be better just to check that in a pipeline stage and return (complete nil) if the http code >= 400
06:40weavejestermpenet: Yeah, but I'm more thinking about how to handle exceptions like connection errors
06:40mpenetweavejester: what do you mean by realize many at once? parallelization of queries?
06:40weavejestermpenet: Well, many HTTP requests can be made in parallel with NIO
06:44weavejesterI wonder if I could do it by having...
06:44weavejester(task (on-realized response indentity (constantly nil)))
06:44mpenetweavejester: yes, but this is handled by aleph under the hood, not sure what you mean. If you want some way to manage the responses (like handle then in the order they come back etc), you might want to use a channel or some sort of queue
06:45weavejestermpenet: I want to kick off N http-requests and discard the results of those that except.
06:45mpenetweavejester: you dont need task I think, http-request is non blocking by default, as long as you dont deref it straight away
06:46weavejestermpenet: Right, but how do I merge the results?
06:46weavejestermpenet: If I do (merge-results good-resp bad-resp) then it will error for the whole
06:47weavejestermpenet: "If any of the inputs are realized as an error, the async-result returned by merge-results will also be realized as that error."
06:49mpenetweavejester: you could use a channel where you enqueue the responses only if they are valid, and from there I think you can use fns (like reduce*) to do the merging
06:50weavejestermpenet: Hm, yes, that's a good idea...
06:51weavejesterI'm still getting used to thinking in terms of channels :)
06:51mpenetweavejester: there might be some higher level solution in Lamina to handle that, not sure
06:52weavejestermpenet: There's a join function that operates on channels, which I assume joins two channels into one. But… wait, I don't need that I don't think.
06:52weavejestermpenet: I mean, I just need one channel for the results
06:53weavejestermpenet: And the on-realized will enqueue on success and do nothing on error
06:53weavejestermpenet: Then I just consume the channel
06:53mpenetweavejester: exactly
06:53mpenetweavejester: that is how I would do it I think
06:54weavejestermpenet: I think you're right. I'm just too used to thinking functionally :)
06:56mpenetweavejester: there is some necessary evil in channels :)
07:05Cheironsorry, network problems. what is wrong with this macro? http://pastie.org/4679301
07:08mpenetCheiron: you need to quote what you want to expand
07:09mpenet(macroexpand-1 '(resource-operations request :get get-fn))
07:09mpenetCheiron: also it seems the cond could be rewritten with case, avoiding some repetitions
07:10Cheironwhy calling (resource-operations request :post get-fn) is giving: CompilerException java.lang.IllegalArgumentException: Can't call nil, compiling:(NO_SOURCE_PATH:14)
07:12Apage43grumble
07:12mpenetCheiron: get-fn is nil as the Exception suggests
07:12Apage43trying to get at a java method that has both an int and a string overload
07:12Apage43specifically, trying to get the int form
07:12Apage43but it always winds up looking for a Long or long form, and not finding the right overload
07:13SgeoHas anyone in here used JNAerator to make a Java wrapper for a C library and then used it from Clojure?
07:13Apage43even if I wrap it in (int)
07:13SgeoBecause I'm planning on doing something like that soonish
07:15Apage43.. fixed it
07:32grayzonehello to all : can anyone describe what is significate of[ #^Atrribute attr ]
08:13Cheironfor (defn resource-operations [request & {:keys [get post put delete head]}]) , is it possible to assign a name to the last named args map?
08:17Cheironyes it is
08:17Cheiron:as
08:34pepijndevosWhat is the difference between the BitmapIndexedNode and the ArrayNode?
08:34pepijndevos$mail
08:41pepijndevos(in the implementation of PersistentHashMap)
08:53bosiei have a weird question as i am new to FP. how do i iterate through a list and keep information from previous entries at hand
08:53bosiein java i would simply use state to do it
08:54hoeck1bosie: depends on the kind of information you need
08:55bosiehoeck1: information i extract from previous entries
08:55hoeck1bosie: using reduce, you can keep and return single value
08:55bosiehoeck1: at the moment its up to 9 values
08:55bosieof a different type
08:55cmiles74bosie: well, you could build up a map or a vector or something.
08:55hoeck1with partition and partition-by in combination with map, you can access the n+1 or n-1 elements while mapping over a sequence
08:56bosiecmiles74: which i return plus the map i am already returning?
08:56bosiehoeck1: yes but i don't want to access elements. i want to access my distilled information, otherwise the algorithm would be n^2 instead of n
08:56cmiles74bosie: It's messy, but you could do that.
08:57bosiecmiles74: wouldn't that double the memory requirement?
08:57bosiecmiles74: since each iteration stores two instead of 1 map?
08:57hoeck1bosie: if its a tuned imperative algorithm, I personally wouldn't bother to convert it to FP style and just use (loop [] .. recur) to keep it fast
08:57cmiles74bosie: I don't wnat to argue too hard for this map in map thing. I was trying to say, you could build up your data structure through your use of reduce. I typed too slow, hoeck1 beat me to it.
08:58bosiecmiles74: oh no i just wanna know how i would code a similar usecase in clojure in the future
08:58bosiehoeck1: hmmm so there is no 'design pattern' for such use cases for FP?
08:59HodappI'm of the really pejorative opinion that design patterns are workarounds for weak languages...
08:59bosieHodapp: well
08:59hoeck1bosie: there is, as cmiles74 suggested, using reduce and a map to store the loops state, but it may be inefficient and slower than the loop
08:59bosieHodapp: so how do i solve my use case? ;)
09:00bosieHodapp: there is no way clojure has no design patterns
09:00hoeck1bosie: maybe paste your code somewhere?
09:01bosiehoeck1: i have none as i don't know how to start….
09:01bosiehoeck1: i will try the reduce/map one
09:01hoeck1or the algorithms pseudocode? or the java version of it?
09:01bosieoh you don't wanna see the java version of it ;)
09:02cmiles74Myself, I use reduce to pull the bits I want out of a larger sequence (or map) and loop if I really am not reducing, for instance, when dealing with Java objects or something more complicated.
09:02hoeck1bosie: :), and what about simplified pseudocode?
09:02bosieok lemme try
09:02grayzoneHello everyone, I'm new to clojure and I can not find the meaning of the characters # ^ Attributes, in the line: (startElement [uri local-name name-q # ^ Attributes atts] by xml.clj
09:03cmiles74grayzone: I believe that is hinting that the "atts" value is of the Java class Attributes.
09:05grayzonethanks cmiles74 ... at least now I have a track to follow
09:05cmiles74grayzone: Perhaps I read to fast, a hint is usually in the form (let [^Attribute atts] ...)...
09:06cmiles74Yes, that is a type hint. :) https://github.com/clojure/clojure/blob/master/src/clj/clojure/xml.clj#L35
09:07grayzoneok
09:07nz-how to get line numbers in emacs to start of every line? there is line-number-mode that puts number to bottom of each buffer
09:09chronnonz-: M-x global-linum-mode
09:11nz-chronno: thanks
09:11chronnonz-: np
09:17nathanichello, i'm looking for clojure.tools.logging / log4j advice: how can i stop it from printing a line like "sun.reflect.GeneratedMethodAccessor3 invoke" before each log message?
09:20uvtcHi grayzone. Clojure has syntactic sugar for a handful of things, and some of those use the hash mark as a prefix. Also, Clojure uses the caret for indicating metadata. #^foo is an older deprecated syntax for adding metadata.
09:23grayzoneuvtc : thank's for clarification
09:25grayzoneuvtc: ..... xml.clj version (https://github.com/clojure/clojure/blob/master/src/clj/clojure/xml.clj#L35) has and only ^ and not #^ and did not understand why : case closed
09:25nz-nathanic: i have used logback-classic instead of log4j
09:26nathanicnz-: interesting, was that still via clojure.tools.logging?
09:26nz-yes
09:27nathanicyou were getting the GeneratedMethodAccessor spam like me, and that inspired you to switch?
09:27nz-nathanic: https://github.com/jsyrjala/ruuvitracker_server/blob/master/resources/logback.xml and https://github.com/jsyrjala/ruuvitracker_server/blob/master/project.clj#L22
09:28nathanicnz-: thanks!
09:28nz-nathanic: no, I have started using logback with java stuff before I started playing with clojure
09:29nathanicin real life java work i use slf4j in front of log4j, but i must admit i've never delved very deeply into their guts
09:29nz-I believe that tools.logging is also using slf4j
09:29dsabaninhey guys
09:30dsabaninI'm having big issues with clojure in production :) some weird issue with threading
09:30nz-basically log4j development has stopped and the guy behind the log4j works now with the slf4j/logback instead
09:31clgvdsabanin: what exactly?
09:32dsabaninbasically I have a clojure-resque client that is sending work to agents on each new job in the queue. It runs fine for a while and then it gets stuck, all agent threads become listed as "waiting on condition" and nothing is happening until I restart the process. When I restart things start working again for a while. Sometimes it lasts for days, sometimes hours, sometimes 10 minutes is enough for it to get stuck again
09:33nathanicnz-: interesting re: logback. also this ruuvitracker seems like it's going to be very cool
09:33dsabaninI connected to stuck process through jdb, but I can't seem to find anything useful
09:33chouseryou can't see what the stuck threads are waiting on?
09:34nz-nathanic: we shall see, currently the problem is lack of firmware developers
09:34dsabaninI have a trace but tells me nothing -- all clojure-agent-send-pool threads are stuck in this trace: http://pastie.org/4679976
09:35wmealing_dejavu
09:35wmealing_dsabanin: which kernel ?
09:35dsabanin2.6.32-5-amd64
09:35wmealing_ubuntu ?
09:35dsabaninDebian GNU/Linux 6.0
09:36wmealing_ok
09:36wmealing_i know there is a popen cow bug that may end up showing what you're saying happens
09:36wmealing_let me see if i can find the commit
09:38dsabaninwmealing_: thanks!
09:41chouserdsabanin: what version of java?
09:41clojurebotjava.util.Date is the worst class in the entire JDK.
09:41wmealing_others can feel free to jump in and help..
09:42wmealing_it just sounds very familar to a problem i was solving
09:42dsabaninjava version "1.7.0_04"
09:42dsabaninJava(TM) SE Runtime Environment (build 1.7.0_04-b20)
09:42dsabaninJava HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
09:42wmealing_https://bugzilla.redhat.com/show_bug.cgi?id=664931
09:43chouseruvtc: fuzzy match between my use of "java" and "java.util.Date" would be my guess
09:43uvtcclojurebot: how was your date last night?
09:43clojurebotjava.util.Date is the worst class in the entire JDK.
09:44wmealing_and he wonders why he can't keep a girl
09:44chouserdsabanin: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/concurrent/locks/AbstractQueuedSynchronizer.java#2043
09:44chouserCould it be that no more work is being sent to the agents?
09:45dsabaninchouser: hmmm, it could be
09:47dsabaninthanks for ideas and help guys
09:48chouseryeah, it looks to me like the agent threads are waiting for the next work item: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/concurrent/ThreadPoolExecutor.java?av=f#1043
09:53dsabaningood, so no bug in clojure at least :) probably a bug in resque-clojure lib
09:54dsabaninit probably doesn't handle well disconnects from redis server
09:55wmealing_dsabanin: -5 contains the patch.. they backported it
09:56dsabaninwmealing_: I asked our sysadmin guy, he says our kernel doesn't seem to be affected by that
09:56wmealing_ye
10:01dfdanyone here have experience with Chas Emerick's Friend library?
10:01uvtc~anyone
10:01clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
10:01wmealing_cemerick may have.
10:02wmealing_but i do agree with clojurebot
10:02wmealing_clojurebot: botsnack
10:02dfdhaha, cemerick most definitely would.
10:02clojurebotThanks! Can I have chocolate next time
10:03dfdyeah, sorry to be vague. I'm trying to write a workflow for an OAuth2 flow (app.net in particular), and I'm having trouble figuring out what to return. I thought I was returning the right auth-map, but I keep going back to the callback--I'm getting a endless loop.
10:04mpenetdsabanin: resque-clojure doesnt seem to use testOnBorrow on the connection pool, maybe you have a bunch of dead/rotten connections there
10:04uvtc$mail samflores Thanks again for the tip using clostache. I ran with it and did this https://github.com/fhd/clostache/wiki/Using-Partials-as-Includes .
10:04lazybotMessage saved.
10:04dsabaninmpenet: I checked with lsof, there were only 2 connections, but both at CLOSE_WAIT state when the issue is happening
10:10kryftHmm.. https://github.com/kingtim/nrepl.el doesn't mention SLIME in the requirements; should I still install it separately?
10:10xeqidfd: are you returning a value from friend.workflows/make-auth ?
10:11xeqikryft: no nrepl and slime are seperate
10:11scriptorkraft: nrepl.el should be all you need, it connects to the nrepl server on its own
10:12scriptoressentially, it's a slime/swank replacement
10:12kryftAh
10:12dfdxeqi: hi, yeah, I return the ring redirect response for the oauth redirect url when we don't have the code to get a token, and then after we get the token, I return an auth-map.
10:12kryftApparently swank-clojure (which is recommended on clojure.org, but claims to be deprecated in favor of nrepl) was also a stand-alone slime replacement?
10:14xeqiit was a version of swank that supported clojure
10:14xeqi* is
10:18kryftxeqi: Right, I'm just a bit confused because I've heard a lot of people talking about using SLIME and clojure, but apparently that's not strictly speaking true
10:18dfdxeqi: I know it's working up to a point, there's just some basic thing I'm not getting. This is a work in progress: https://gist.github.com/3666571
10:18xeqikryft: nrepl.el just took over in the past couple weeks, its a transition point right now
10:19xeqiswank-clojure still works, but no one is maintaining it
10:25xeqidfd: I think the :type needs to be ::friend/auth
10:26xeqidfd: assuming you requires [cemerick.friend :as friend]
10:26dfdxeqi: I don't think that's it; I've been dumping out data from the authenticate* function in friend.clj, and auth? evaluates to true
10:26dfdI feel really dumb, there's something I'm just not getting no matter how many times I've read through friend.clj
10:27duck11231Does friend only work with Ring apps, or can it be used for other types of request/response applications?
10:27xeqi&::auth
10:27lazybot⇒ :clojure.core/auth
10:27xeqi&(= ::clojure.string/auth ::auth)
10:27lazybot⇒ false
10:27dfdduck11231: as far as I know, it's just ring apps; it uses the ring response format pretty extensively to store session data and whatnot
10:28dfdxeqi: I actually had it as ::friend/auth before and it was failing there.
10:28duck11231That's annoying. I support a couple different request types (all similar to ring) and was hoping I could use friend to replace my custom auth flow
10:29dfdduck11231: well, you could fork it. ;-)
10:34xeqidfd: are you using 0.1.0?
10:35dfdxeqi: yes, in fact I'm using a checked out version from github so I can do some dumping of variables directly in the friend code.
10:39xeqidfd: after https://github.com/cemerick/friend/blob/master/src/cemerick/friend.clj#L186 whats new-auth?, (-> request :session ::friend/unauthorized-uri), and (-> request ::friend/auth-config :default-landing-uri) ?
10:41dfdxeqi: good question...I don't get past this line in friend.clj: (if (and workflow-result (not (auth? workflow-result)))
10:41dfdsorry, I'll give you a line number
10:41dfdxeqi: line 175, https://github.com/cemerick/friend/blob/master/src/cemerick/friend.clj
10:42cemerickdfd: right, this goes back to the :type ::friend/auth issue that xeqi mentioned
10:42dfdxeqi: so, right before my code is dying, I print out auth? and my workflow-result. The workflow-result is a legit (I think) auth-map, and auth? evaluates to true. But that conditional fails.
10:43cemerickaccording to `(not (auth? workflow-result))`, it's not ;-)
10:43dfdcemerick: doh, yeah, it must be as you say. Let me see what I'm doing wrong...
10:44dfdcemerick, xeqi: okay, yeah, now it's starting to come clear; if I make :type ::friend/auth, I get the endless redirecting I was talking about talking to cemerick privately
10:45dfdso, um, apparently I guess maybe my identity binding isn't working...
10:45cemerickdfd: redirecting to…which URI?
10:46xeqicheckinng the unauthorized-uri and default-landing-uri might help for the redirecting
10:46cemerickdfd: this would be easier if we could see the whole file, plus your application of the authenticate middleware.
10:46dfdyeah, sorry, one sec--
10:48dfdhttps://github.com/ddellacosta/friend-example/tree/master/src/friend_test
10:48dfdcemerick: the handler code was largely stolen from your example code, and the oauth2.clj file is (obviously) in progress.
10:49dfdforgive my goofy comments, I talk to myself in my "in progress" code...
10:51kryftxeqi: The swank-clojure page gives the impression that swank is a version of SLIME: "be sure you don't have any other versions of SLIME loaded"
10:52djanatynhey, where's the zip function?
10:52dfdcemerick: I didn't answer your previous question: it goes through the whole flow, first hitting the redirect URL then again getting the access token. As far as the OAuth flow itself, that seems to be fine.
10:52djanatynlike, it takes two lists and a predicate that takes two arguments
10:53djanatyn(zip + [1 2 3] [1 2 3]) => (2 4 6)
10:53cemerickdfd: it's an infinite loop because the workflow handles all requests; it should limit its action to a defined workflow URI (or set of URIs, if you need to define a separate callback URI, etc). See: https://github.com/cemerick/friend/blob/master/src/cemerick/friend/openid.clj#L109
10:53djanatynI can't find it on clojuredocs
10:53kryftUgh, maybe I should just try to use swank-clojure for now. It's confusing enough learning emacs, evil and clojure without trying to deduce what to do with nrepl based on what people say about slime or swank-clojure. :)
10:54scriptordjanatyn: for that example you can actually use map
10:54dfddjanaytn: zipper? http://clojuredocs.org/clojure_core/clojure.zip/zipper
10:54scriptor,(map + [1 2 3] [1 2 3])
10:54clojurebot(2 4 6)
10:54djanatynoh! I remember that mapcar had that behavior too
10:54scriptorno, zipper is something else
10:54djanatynI'm used to map :: (a -> b) -> [a] -> [b]
10:55djanatynso, map can take an arbitrary number of arguments?
10:55scriptordjanatyn: yes, but map can take multiple collections
10:55scriptorand it passes the next element of each collection to the function, so it can function like zip
10:55djanatyncool! thanks.
10:55dfdcemerick: okay, the dense fog is slowing lifting...
10:55djanatynyou guys are very helpful.
10:56djanatyn...I forgot why I wanted to use zip, though
10:56dfdcemerick: oh! how stupid of me, I think I get it--it's trying to process every request, but it should filter the url of the request...doh
10:58djanatynHodapp: haskell's type system is sometimes the most concise way to explain what I mean :)
11:00hyPiRionIs there a shorter way to write ##(map #(map inc %) [[1 2 3 4] [5 6 7 8]]) ?
11:00lazybot⇒ ((2 3 4 5) (6 7 8 9))
11:00casionwhere can I see good examples of (lazily) parsing input-streams in clojure?
11:00hyPiRionOr, well, maybe more idiomatic.
11:01zerokarmaleftwhen i call gen-class, if i specify :extends/:implements does the runtime automatically import the parent classes into the current ns?
11:02zerokarmalefti suspect it does, but i'm needing a sanity check
11:03jparishyDoes reify create a concrete class on the JVM? Because when I pass an object created by reify that implements an interface to .getClass, I definitely don't get what I expected
11:03chouserjparishy: yes
11:06casionhyPiRion: is it always 2d? to me a list comp would be more readable
11:08hyPiRioncasion: so ##(for [x [[1 2 3 4] [5 6 7 8]]] (map inc x)) instead?
11:08lazybot⇒ ((2 3 4 5) (6 7 8 9))
11:09hyPiRionI don't know what's mor idiomatic, but it's a bit more readable, I agree.
11:09casionhyPiRion: that seems more in line with what I've seen done in the clojure code I've browsed
11:10TimMchyPiRion: (map (partial map inc) ...)
11:11zerokarmalefthyPiRion: i think your first nested map is still readable
11:12zerokarmaleftit follows the structure of the seq you're passing
11:13hyPiRionzerokarmaleft: it's more messier when you do something like this:
11:14hyPiRion(map (fn [is] (map #(get-in b %) is)) ...)
11:14hyPiRionand well, (map (partial (map (partial get-in b))) ...) isn't that beautiful either.
11:15jparishychouser: so this would be expected? https://gist.github.com/3667031
11:16zerokarmalefthyPiRion: i wonder if you could write a nested-map function that repeats those calls to an arbitrary depth
11:16chouserjparishy: yup, that's a classname believe it or not
11:17zerokarmaleftor at least depth 2, for the simple case
11:18hyPiRionWell, for me, it's all about readability, as long as one doesn't overengineer it.
11:19jparishyHeh, alright. thanks
11:26casionI am having a revelation… when you realize there isn't a library for something you think should be really simple, it's probably far from it.
11:44Frozenlockcasion: Seems like a great thought
11:44FrozenlockI'll be sure to remember it.
11:45casionFrozenlock: great for you maybe, for me it's borderline infuriating ;)
11:46FrozenlockI have my own rule of thumb: If it looks simple, it will take you 4x as much time as you think. If it looks complicated, don't even start.
11:46casionhaha :)
11:47casionevery time I find a spec for a new format I want to support, I end up finding out that no one implements it correctly… and that's now my problem to support all the various bastardizations of it
11:48uvtcYou guys, this is old hat stuff. The first one is well known as casion's conjecture, and the second is referred to as Frozenlock's formula.
11:49Frozenlocklol!
11:49casionwoohoo, I'm e-famous!
11:49FrozenlockYay, power to the pseudonym!
11:49casionwhen do the paychecks start rolling in?
12:03FrozenlockI can't believe the power cljs gives me over a webpage; I feel like a god!
12:03casionwhich one?
12:03solussdis there a way to provide a "transform", or something that happens when a auto generated constructor (e.g. ->Record or map->Record) is called?
12:04Frozenlockcasion: Anubis, who else?
12:04solussdi'm guessing the answer is no, but it would be a nice feature- maybe something you specify when you declare the record
12:05casionFrozenlock: considering what cljs is, and how many gods ra absorbed… I'd think ra ;)
12:06FrozenlockBut, but, Anubis almost destroyed earth! If it wasn't for SG1...
12:06pepijndevosAnyone familiar with clojure internals? I'm trying to understand https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentHashMap.java
12:07pepijndevosIt seems the only difference between ArrayNode and BitmapIndexedNode is that the formar only contains nodes, while the other possibly contains leafs?
12:08pepijndevosIs that an optimization?
12:08pepijndevosI read this: http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/ but it seems super simplified.
12:08pepijndevoson the other hand, the current implementation does not contain empty and single nodes.
12:15chouserpepijndevos: This stuff has changed quite a bit since I last looked at it, but it appears ArrayNode also don't bother with a bitmap mask -- it just always has a 32-node array.
12:17pepijndevoschouser: huh, so the bitmap mask is not a 32 element array?
12:17pepijndevosThat is what I understood from the deftwice article
12:17chouserbitmap is an int: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentHashMap.java#L571
12:18pepijndevosI need to study this. I'm beginning to see why my C implementation was slower than Clojure
12:19pepijndevoschouser: but it seems to be used like an array of bits?
12:28chouserpepijndevos: where? I see places where it's bit-shifted with >>>, counted with bitCount, bit-or'ed with |
12:30dnolenpepijndevos: that's the whole idea being Bagwell's array mapped hash trie. rhickey changed the array into a integer in his implementations.
12:33dnolenpepijndevos: actually I'm probably wrong about that - http://en.wikipedia.org/wiki/Hash_array_mapped_trie
12:33pepijndevosdnolen: so what is this integer used for? I thought that was like an index into the array[32] of nodes
12:33pepijndevosoh
12:33dnolenpepijndevos: the path
12:34pepijndevosdnolen: right, in sections of 5 bits, which map to 32 elements per level
12:34dnolenpepijndevos: yes
12:35pepijndevosdnolen: so then both arraynode and bitmmapindexednodes have an array of 32 items, I think. Except, one is an array of nodes, and the other of object keys and values(acually 64 elements)
12:36bobbywilson0is there a way to do this?
12:36bobbywilson0,(conj '(1) '(2))
12:36clojurebot((2) 1)
12:36bobbywilson0and get ((2) (1))
12:37pepijndevosconcat
12:37pepijndevosno
12:37pepijndevosseq?
12:37clojurebotseq is what
12:37chouserlist
12:37pepijndevos,(list '(1) '(2))
12:37clojurebot((1) (2))
12:38bobbywilson0chouser: thanks!
12:38carkhello all, I think i found a little bug in algo.monad is there a maintainer i could talk to ?
12:39bobbywilson0pepijndevos: thanks! as well
12:39carkalso an efficiency issue, got solution for both of these
12:39cark(simple solution)
12:40uvtcWhat database would you recommend using with a small/medium Clojure webapp? I don't expect a large amount of traffic. Was going to use something like SQLite as I'm already familiar with it... Have not yet tried CouchDB. Not sure exactly what to make of Datomic.
12:40technomancyuvtc: there are better embedded DBs on the JVM that SQLite
12:41technomancySQLite has to do some crazy C interop
12:41uvtctechnomancy: Right.
12:41uvtctechnomancy: I've been pointed toward Derby and H2 and another one to use rather than SQLite.
12:42uvtcNot sure about hosting. I've heard Heroku is pretty easy to use.
12:42technomancyit's true! =)
12:42ibdknoxlol
12:42ibdknoxuvtc: technomancy works for heroku ;)
12:42technomancyif you're on Heroku then Postgres is the way to go
12:43dnolenpepijndevos: looking the ClojureScript implementations it seems like ArrayNodes don't hold values.
12:43ibdknoxuvtc: though I will happily attest to its simplicity and ease of use
12:43carkpostgres is awesome, why go for the lesser solutyion when it is so readily available
12:44technomancyif you know you're never going to grow beyond a single process or need redundancy then an embedded DB is a lot simpler to get going with
12:44uvtcibdknox: thanks. I'm not too sure what to make of it (what with the manifolds and dynoplexes and control surfaces :) ).
12:44pepijndevosdnolen: right. just to save space? seems to add a lot of complexity
12:44uvtclingo
12:44technomancyhaha
12:45carktechnomancy: yes and no, that's learning a whole new model, how are transactions behaving and such
12:45pepijndevos(dnolen, link?)
12:45ibdknoxuvtc: haha, yeah don't worry about their terms. The only thing you need to know is that you can git push and then scale the number of processes running that
12:45ibdknoxuvtc: that's basically all there is to it
12:45technomancyone of these days I'm going to give BDB a shot
12:45ibdknoxBDB?
12:45uvtcCan I use an embedded db (where the db is just a file in my project dir) with Heroku?
12:45dnolenpepijndevos: I'm assuming it was done for performance reasons, look at the CLJS source man :)
12:46dnolenpepijndevos: relevant method is inode-lookup.
12:46dnolenpepijndevos: both BitmapIndexedNode & ArrayNode implement it.
12:46technomancyuvtc: no, the filesystem is ephemeral on Heroku, same as EC2
12:46technomancyibdknox: berkeley DB
12:46uvtccark: Thanks for the recommendation. I've used MySQL in the past, but not Postgres yet.
12:46technomancyembedded KV store
12:47ibdknoxah
12:47pepijndevosdnolen: ok, will try to navigate cljs
12:47carkuvtc: then go for mysql, unless you've got time to learn postgres. mysql is also available everywhere
12:48technomancyanyway, if you're not distributing the app to others who might have a low tolerance for complicated installation procedures then I'd go with postgres.
12:48carkuvtc: support is good for both in clojure and in the jvm
12:48uvtctechnomancy: above you said, "if you know you're never going to grow beyond a single process or need redundancy then an embedded DB is a lot simpler to get going with", but just now you wrote that I can't use a little db file because the filesystem is ephemeral... (?)
12:48technomancyuvtc: right, because redundancy is built-in to the assumptions on heroku
12:49chouseruvtc: have you considered datomic? I'm itching for an excuse to use it, but haven't had one yet.
12:49uvtcIs "embedded db" == that little .sql file in my project dir?
12:49technomancythat is, you don't actually get redundancy on the free tier, but it forces you into patterns of application design that make redundancy easier
12:50ibdknoxI wish they'd work on presenting datomic a bit better
12:50carkis it possible to have all of datomic in-process ?
12:50madsyNot far from NY and it's another state, lol
12:50madsySorry wrong channel
12:50uvtcchouser: Not sure what to make of datomic. That is to say, I'm not exactly sure what it is or how I'd use it. That's what I meant above by "not sure what to make of it".
12:50Apage43cark: there's an in-memory only way to use it, but I don't know that you get transactions?
12:51technomancypostgres unfortunately doesn't optimize for getting started at all
12:51abalonesorry if this question is dumb but is Light Table open for people to write plugins ? or is that for later?
12:52ibdknoxabalone: the playground isn't yet
12:52ibdknoxabalone: primarily because it makes big swings every couple of weeks and I will make absolutely no claim of stability
12:52uvtctechnomancy: I'm looking at the postgres docs right now. Thanks for the tips.
12:52solussdmongodb + monger (clojure library) is the way to go for web apps, imo. Fast and better suited for storing data composed of arrays, maps, etc.
12:53solussdalso, heroku has mongohq support via 'add-ons'.
12:53technomancyuvtc: I've been working on a simple postgres app on heroku if you want a sample to work from: https://github.com/heroku/buildkits
12:53abaloneibdknox: is there an old version that people can play with (in terms of practicing the mere act of writing a plugin) ?
12:53technomancyit also uses hstore, but the jdbc support for hstore is currently extremely sketchy, so I'd recommend waiting on that for now =(
12:54ibdknoxabalone: no, though something along those lines might show up in not too long. Is there something specific you're wanting to do?
12:54uvtctechnomancy: Thanks. Will read up on what "buildkits" and "buildpacks" are.
12:55technomancyuvtc: that's not really relevant to the topic at hand, but if you're interested ... =)
12:55technomancyuvtc: in particular see the instructions for running postgres in user-space
12:55technomancywhen developing
12:55abaloneibdknox: i'd like to try paredit. i'm 100% sure that if paredit exists for light table in the future it will have been written by someone else much faster and in a better fashion but i'd like to try as an exercise
12:55technomancytypically postgres wants to run as a system daemon, which is appropriate for production but kinda crappy for dev.
12:55ibdknoxabalone: so you can build paredit around codemirror directly. :)
12:56abaloneibdknox: oh ok :)
12:56abalonehas someone already tried?
12:56ibdknoxabalone: and that would be a *very* welcome project!
12:56ibdknoxabalone: not that I know of
12:56uvtctechnomancy: I can't think of any reason why it'd be a hassle to have postgres running locally for dev.
12:56ibdknoxthough I haven't done a ton of digging
12:57pepijndevosdnolen: okay, makes sense now. But… take a look at inode-assoc. ouch. Who implemented this? I'm curious to know the speed improvement.
12:57dnolenpepijndevos: speed improvement over what?
12:57abalonei'll look into it but i really must emphasize that i hope this doesn't cause The Right Person to skip doing it just because i said i'll make feeble efforts
12:58ohpauleezabalone: what's the project? (late to the party)
12:58ibdknoxabalone: maybe "the right person" ends up being you, or helping with your impl
12:58pepijndevosdnolen: over just using one type of bitmap node that has nodes and leaves in a big array.
12:58abaloneohpauleez: paredit for codemirror
12:58abalonei just can't code without it, so i really want it for light table
12:58ohpauleezahhh - that would indeed be absolutely great
12:58dnolenpepijndevos: because rhickey probably knows he's doing and we don't. We just ported the Java.
12:59abalonecoding lisp without paredit feels like coding with a pen and paper
13:00pepijndevosdnolen: okay. to bad rhickey isn't on irc much lately. (read: since 1.2 or so)
13:00kangquestion: is there any corresponding function of the R's which.max function in clojure/incanter?
13:00dnolenpepijndevos: even if he was he probably say read the code like 10 more times ;)
13:01dnolenpepijndevos: I'm sure if you think about it some more you'll some kind of complexity advantage.
13:01dnolensee some
13:03pepijndevosdnolen: hah, probably.
13:03pepijndevosdnolen: maybe I can just strip the cljs from the arraynode and see what happens
13:04dnolenpepijndevos: getting that code to work under Clojure should require trivial changes ;)
13:05pepijndevosdnolen: dinner time. I'll ping you if I have any significant revelations.
13:08serpent213hi
13:09serpent213i have a function call (clj-http.client/get) which works fine on the repl but does not return in production. how can i debug this...?
13:10serpent213could it be a threading issue? i use futures here and there...
13:11aperiodicusually when someone runs into a difference between the repl and anywhere else, it's something to do with laziness
13:11aperiodicthe REPL forces evaluation of lazy sequences
13:13serpent213the only argument is the URL, which looks good in the log directly before the "get"
13:14serpent213the logging call afterwards does not get evaluated
13:20jkkramerserpent213: could the call be throwing an exception? clj-http throws on 404 etc by default
13:21serpent213jkkramer: no, the call does not return, no log output
13:22serpent213the same code did already work in another callchain... i'm really puzzled :(
13:24jkkramerserpent213: what does "not return" mean if not an exception? it times out, returns nil, …?
13:27casion,(time (= (seq (byte-array (map byte (range 100)))) (seq (byte-array (map byte (range 100))))))
13:27clojurebot"Elapsed time: 11.256664 msecs"
13:27clojurebottrue
13:27casion,(time (java.util.Arrays/equals (byte-array (map byte (range 100))) (byte-array (map byte (range 100)))))
13:27clojurebot"Elapsed time: 9.752234 msecs"
13:27clojurebottrue
13:28serpent213jkkramer: good point. the following statement is never executed, so i assume it just hangs somewhere in the clj-http code forever...
13:28casionhum, seq is always faster here by a factor of 2
13:29jkkramerserpent213: if it's on another thread, it might be throwing an exception you're not seeing
13:33jkkramer,((fn [] (future (println "foo") (throw (Exception.)) (println "bar")) :done))
13:33clojurebot#<SecurityException java.lang.SecurityException: no threads please>
13:44nz-I am getting this error with clojurescript: Uncaught Error: No protocol method IWatchable.-notify-watches defined for type object: {}
13:45nz-I have an atom that holds {}, and I am using swap! to update it
13:46nz-what I am doing wrong?
13:47serpent213jkkramer: where do these exceptions end up...? how can i catch them?
13:47nz-I dont have any watches
13:50nz-seems that the value gets updated
13:52fentoncan anyone comment on my inability to read a resource file defined in a clojure library from java? https://github.com/ftravers/PublicDocumentation/blob/master/clojure/resource-file.md
13:53fentonsimple example at above url
13:54jkkramerserpent213: you catch them on the thread they're thrown on
14:00pepijndevosdoes vimclojure work with nrepl already? I see there is a branch.
14:01tanzoniteblackpepijndevos: somebody was asking about that yesterday, and the best response I heard was "um...maybe?". apparently it's still in progress, but can't hurt to go ahead and try it out if you see the branch so you can report what's broken
14:02pepijndevostanzoniteblack: The problem is setting it up. Maybe I need to say wantnrepl = "paht/tonrepl/client"
14:02serpent213jkkramer: (log/info) does work in the thread, so i assumed exceptions would be printed out as well...
14:03serpent213jkkramer: i'll dig deeper in that direction, thanks a lot! :)
14:04pepijndevostanzoniteblack: from what I can tell, the client is there, but the plugin itself is not.
14:05aperiodicserpent213: the exceptions will bubble up when the future is deref'd
14:07tanzoniteblackpepijndevos: I'd say that nrepl isn't up and working with vim yet then, which is a much more definitive answer then was given yesterday, so thanks for exploring that. Of course...by the next time someone asks that in #clojure the answer will probably have changed....but oh well
14:07pepijndevostanzoniteblack: https://twitter.com/kotarak/status/240069366224416768
14:07serpent213aperiodic: i never deref some of them -- does clojure deal with this? or is it bad style?
14:08pepijndevoshttps://bitbucket.org/kotarak/vimclojure/issue/82/use-nrepl
14:12nz-_well, my problem was that I was trying to swap! a map, and not an atom
14:19aperiodicserpent213: this is mostly speculation, but i think those computations would just terminate, and the thread pool would move on to other things. should have no ill effects
14:22dnolenninjudd: is drip supposed to work w/ lein 2 only?
14:28serpent213aperiodic: good to hear, thx :)
14:32serpent213jkkramer: connection refused -- you are my hero! :* ,)
14:33jkkramerserpent213: glad I could help
15:19wtingRunning `lein new foobar` gives me "Could not transfer artifact [...] from/to central [...] connection to http:// refused."
15:19wtingI'm not sure what to do to get leiningen working
15:20xeqiwting: what version?
15:21wtingxeqi: 20120722-1 from github.com/technomancy/leiningen
15:25wtingThe above was from Arch's package repo. I've downloaded and installed directly from the repo now with the same issue.
15:25wtingfrom the GitHub repo*
15:26xeqik, does it just say "http://&quot; or does it have a full url?
15:26wtingjust http
15:26wtingWell.. "Could not transfer artifact lein-newnew:lein-newnew:pom:0.3.5 from/to central (http://repo1.maven.org/maven2): Connection to http:// refused"
15:27wtingand "Could not transfer artifact lein-newnew:lein-newnew:pom:0.3.5 from/to clojars (https://clojars.org/repo/): Connection to http:// refused"
15:28xeqihmm, what does `lein version` give you?
15:28chouserHow does one build clojure these days? Just typing "ant" failed on a test generative dep
15:28wtingSame errors, here's the full error message: http://pastebin.com/yLciNDBV
15:29xeqik, how are you installing it from the repo?
15:30wtingFollowing the instructions from the repo: https://github.com/technomancy/leiningen#installation Basically downloading, chmod+x lein, ./lein repl
15:31Bronsachouser: maven install?
15:32xeqik, then you should have preview10
15:32xeqican you browse to https://clojars.org/ ?
15:33wtingyup, what's preview10?
15:33xeqithe version
15:33chouserHm, skipping the tests works for now
15:33serpent213aperiodic: guess you were right: http://grokbase.com/t/gg/clojure/119wytxaph/are-futures-garbage-collected
15:36xeqiwting: do you have a ~/.lein/profiles.clj
15:38wtingnope, only have ~/.lein/self-installs/leiningen-2.0.0-preview10-standalone.jar
15:39dnolenchouser: 'mvn package' works for me.
15:39chouserah, ok. Didn't realize ant wasn't fully supported anymore.
15:39wtingI just removed ~/.m2 and ~/.lein and tried running lein again, same result.
15:40nbeloglazovIs there a reason why map-indexed takes only 1 collection?
15:41S11001001nbeloglazov: 'cause if you're using more than one there's no real benefit, just pass (range) as one of them
15:41nbeloglazovS11001001: ah, cool. Thanks
15:42nbeloglazovDidn't think about range :\
15:42S11001001as it is map-indexed is kind of trading clarity for efficiency (quick, does the number come first or second?)
15:43S11001001as a fun challenge, implement map on two-or-three seqs with full chunking support :)
15:44xeqiwting: it sounds like its setup right. the refused connections are weird, almost like theres a proxy or something in the way messing it up
15:45wtingxeqi: I don't know, I just logged into my Debian VPS, went through the same steps and got the same result.
15:48wtingSame problems with Ubuntu. These 3 boxes (Arch, Debian, and Ubuntu) are in 3 separate states...
15:49xeqihmm
15:49xeqinow I really don't want to delete my ~/.m2 and try it
15:49wtinglol
15:49wtingyou can always just back up ~/.m2 and ~/.lein
15:49wtingor create a new test user
15:50wtingbut thanks for your help anyway
15:50xeqiyeah, realized that after a moment
15:50wtingI gotta run, I'll probably report it to GitHub issues tonight
15:52xeqiwting: https://www.refheap.com/paste/4927 works :/
15:53wtingwth
15:53wtinglemme ssh into a university CS machine and try it
15:54wtinghttp://pastebin.com/20g0MaXg
15:54wtingSame result. :-/
15:55SgeoWhy does awtbot provide a with-robot macro?
15:55SgeoIt doesn't seem to be significantly different from doto?
15:58scriptorSgeo: readability, maybe?
15:58xeqiit is doto
15:58SgeoI just played a bit with type-text
15:58SgeoIt seems to be a bit slow
15:59xeqiwting: try `lein self-install` before `lein new ..`
16:26nz-_is there a function for removing duplicates from a list? like unix command uniq?
16:26Raynes&(distinct [1 1 2 2 3 2 4 5 6])
16:26lazybot⇒ (1 2 3 4 5 6)
16:26nz-(doc distinct)
16:26clojurebot"([coll]); Returns a lazy sequence of the elements of coll with duplicates removed"
16:27nz-ok, how about one where I can provide function that decides what is "equal"?
16:28RaynesCan't help ya there.
16:28Cheiron_Hi, what is the recommended clojure lib to work with Kafka?
16:29nz-[{:a 1 :b 2} {:a 1 :c 3} {:a 2 :d 4}] here entries that have same value for :a would be identical and duplicates need to be dropped (doesn't matter which one gets dropped)
16:29ohpauleeznz-: I think at that point you're into filter territory
16:30ohpauleezand this question just came up a few months ago
16:30ohpauleezmaybe a few weeks aog
16:30ohpauleezin here
16:30ohpauleezI din't recall the answer
16:30aperiodicmaybe something with group-by :a?
16:31nz-ok, group-by :a, loop over list and take first item from each list
16:32aperiodic(for [[v dups] (group-by :a coll)] (first dups))
16:32aperiodicyeah
16:33metellus,(group-by :a [{:a 1 :b 2} {:a 1 :c 3} {:a 2 :d 4}])
16:33clojurebot{1 [{:a 1, :b 2} {:a 1, :c 3}], 2 [{:a 2, :d 4}]}
16:33metellus,(map first (vals (group-by :a [{:a 1 :b 2} {:a 1 :c 3} {:a 2 :d 4}])))
16:33clojurebot({:a 1, :b 2} {:a 2, :d 4})
16:34nz-thanks
16:35metellusor use partition-by
16:35metellusand you can get first of the (vals ...)
16:35nz-(doc parititon-by)
16:35clojurebotPardon?
16:36metellusand you can get rid of the (vals ...)
16:36nz-(doc partition-by)
16:36clojurebot"([f coll]); Applies f to each value in coll, splitting it each time f returns a new value. Returns a lazy seq of partitions."
16:36metellus,(partition-by :a [{:a 1 :b 2} {:a 1 :c 3} {:a 2 :d 4}])
16:36clojurebot(({:a 1, :b 2} {:a 1, :c 3}) ({:a 2, :d 4}))
16:37nz-by the way, is there a faq or a cookbook like thing for these kinds of questions?
16:38devnclojurebot: the cheat sheet coupled with clojuredocs.org and a repl
16:38clojurebotclojure.repl in swank is not useful for two reasons: 0) everything it provides has an enhanced version in slime and 1) having to re-refer it every time you changed namespaces would be annoying
16:38tmcivermetellus: partition-by only works for consecutive duplicates, yes?
16:38devnerr nz- ^
16:39metellusoh, right. group-by it is, then
16:39uvtcnz- : There's this http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Cookbook
16:39devnbe careful!
16:39devnit's badly out of date
16:40devnunless someone has been giving it some time and energy
16:40uvtcYeah, not sure who maintains that wiki. Changes seem to take a while to be approved.
16:41Sgeo,(doc assoc!)
16:41clojurebot"([coll key val] [coll key val & kvs]); Alpha - subject to change. When applied to a transient map, adds mapping of key(s) to val(s). When applied to a transient vector, sets the val at index. Note - index must be <= (count vector). Returns coll."
16:41uvtcThere's http://rosettacode.org/wiki/Category:Clojure , but it's not quite a cookbook.
16:45mefestois clojure.xml/emit meant to be used? it's public in the source but listed in the api docs
16:54Raynes$findfn [1 2 1 2 3 3] [1 2 3]
16:54lazybot[clojure.core/distinct]
16:54Raynesxeqi: Fixed findfn.
16:55nz-Raynes: findfn tries every function until it find match?
16:55RaynesPretty much.
16:55typeclassyvery cool
16:56nz-is there some doc that tell what tricks the bots can do?
16:56RaynesNot really.
16:56RaynesYou can browse his plugins on irc
16:56Raynes$whatis source
16:56lazybotsource is http://github.com/flatland/lazybot
16:56Raynessrc/lazybot/plugins
16:56RaynesHe can even tell you the weather.
16:56Raynes$conditions 35554
16:57lazybotLast Updated on September 7, 3:12 PM CDT; Partly Cloudy; Dewpoint: 74 F (23 C); Precipitation today: 0.00 in (0 mm); Temperature: 89 F (31.7 C); Windchill: NA; Wind speed: 2mph; Wind gust: 5.0mph; URL: http://www.wunderground.com/US/AL/Eldridge.html.
16:57hyPiRionHot.
16:57uvtclazybot: fortune
16:57lazybotNever Graduate
16:58Rayneshrm. I thought I deleted that plugin.
16:58nz-$source partition-by
16:58lazybotpartition-by is http://is.gd/rB7Az4
16:58RaynesThat one needs fixed too.
16:58RaynesIt is pointing at the wrong tag and stuff.
16:58uvtclazybot: leet this message
16:58uvtc$leet this message
16:58muhoo$40
16:59Rayneslazybot: elite this message
16:59lazybot7h!5 m355493
16:59uvtcOoof.
16:59tanzoniteblacklazybot: elite Raynes: this plugin seems terribly unnecessary
16:59lazybotr4yn35: 7h!5 p1u9!n 533m5 73rr!81y unn3c3554ry
16:59RaynesIndeed, that was on my deletion list as well. :p
16:59aperiodicis there an inverse?
17:00RaynesDon't think so.
17:00uvtclazybot: help
17:00lazybotYou're going to need to tell me what you want help with.
17:00ivaraasenRaynes: I reckon the weather forecast only works for US zip codes?
17:00Raynes$help elite
17:00lazybotRaynes: Takes words and replaces them with their leetspeak alternatives.
17:00muhoolazybot: leet 1337
17:00Raynesivaraasen: You can give it names too. wunderground seems to have information for other countries.
17:01Raynes$conditions Melbourne, Australia
17:01lazybotLast Updated on September 8, 6:58 AM EST; Mostly Cloudy; Dewpoint: NA; Precipitation today: 0.00 in (0 mm); Temperature: 51.3 F (10.7 C); Windchill: NA; Wind speed: 7.6mph; Wind gust: 12.6mph; URL: http://www.wunderground.com/global/stations/94868.html.
17:01uvtc$timer 0:0:5 surprise!
17:01lazybotTimer added.
17:01lazybotsurprise!
17:02uvtctehehe
17:02RaynesThat plugin needs rewritten so bad.
17:02tanzoniteblack$("$conditions Palo Alta, CA")
17:02cemerickRaynes: lazybot needs a timezone plugin.
17:02tanzoniteblack,("$conditions Palo Alta, CA")
17:02clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn>
17:02Raynescemerick: That would do?
17:03uvtc$pwd
17:03cemericklazybot: time in Hong Kong
17:03lazybotcemerick: The time is now 2012-09-07T20:59:58Z
17:03ivaraasen$conditions Hell, Norway
17:03lazybotLast Updated on September 7, 4:55 PM EDT; Scattered Clouds; Dewpoint: 61 F (16 C); Precipitation today: 0.00 in (0 mm); Temperature: 80.3 F (26.8 C); Windchill: NA; Wind speed: 0.0mph; Wind gust: 5.0mph; URL: http://www.wunderground.com/US/MI/Hell.html.
17:03cemerickoh, there we go :-P
17:03Raynescemerick: That didn't do what you thought it did.
17:03hyPiRionWhat, that can't be true
17:03ivaraasenwrong Hell :(
17:03hyPiRionivaraasen: yeah, I wondered.
17:03hyPiRion$conditions Trondheim
17:03lazybotLast Updated on September 7, 10:50 PM CEST; Mostly Cloudy; Dewpoint: 41 F (5 C); Precipitation today: 0.00 in (0.0 mm); Temperature: 46 F (8 C); Windchill: 41 F (5 C); Wind speed: 12mph; Wind gust: 0mph; URL: http://www.wunderground.com/global/stations/01271.html.
17:04tanzoniteblack,(println "$conditions Palo Alto, CA")
17:04clojurebot$conditions Palo Alto, CA
17:04lazybotLocation not found.
17:04cemerickRaynes: bummer.
17:04RaynesI don't think I ever fixed space handling in the weather plugtin
17:04RaynesIt is probably looking for Alto, CA
17:04tanzoniteblackRaynes: that would explain why there's no Palo Alto, though I was really just curious if I could feed things from one bot to the other
17:05ivaraasenhyPiRion: pretty bad weather in Trondheim lately, but at least it's quite warm
17:05RaynesYou can, but you can't really get them in a loop.
17:06tanzoniteblack,(println "$(println \",(println $conditions 94303)\")")
17:06clojurebot$(println ",(println $conditions 94303)")
17:06tanzoniteblackthis is probably a good thing
17:07RaynesThat didn't work because you used $ rather than &
17:07tanzoniteblack,(println "&(println \",(println $conditions 94303)\")")
17:07clojurebot&(println ",(println $conditions 94303)")
17:07lazybot⇒ ,(println $conditions 94303) nil
17:08RaynesThat's as far as you can get.
17:08hyPiRionivaraasen: yeah, it's still hot enough to not be horrible
17:11duck11232We just need a new bot that parses ⇒ as it's input character
17:11tanzoniteblackduck11232: I can only see that ending badly
17:12shadowh511yo, i'm having trouble with this basic clojure IRC bot
17:12shadowh511i found this sample: http://nakkaya.com/2010/02/10/a-simple-clojure-irc-client/
17:12shadowh511and I am wondering how to make it wait for and respond to commands
17:14arohner,((fn [] (println ",(println \"foo\")")))
17:14clojurebot,(println "foo")
17:15arohner,((fn [] (println "&(println \"foo\")")))
17:15clojurebot&(println "foo")
17:15lazybot⇒ foo nil
17:15arohnersounds like you can get them to loop, using fns
17:15arohnerah, no, because of the =>
17:15muhoobot torture!
17:16antares_shadowh511: you can see more or less that happening in conn-handler, now generalize it (extracting a function for command identification and another one for each command is a good idea, too)
17:17aperiodicdarn lazybot replacing newlines with whitespace
17:18shadowh511antares_: oh, I get it, it's in the let binding
17:18tanzoniteblack&(println (str \newline ",(println "gotcha")))
17:18lazybotjava.lang.RuntimeException: EOF while reading string
17:19tanzoniteblack&(println (str \newline ",(println \"gotcha\")"))
17:19lazybot⇒ ,(println "gotcha") nil
17:19aperiodictanzoniteblack: it probably does a `with-out-str` and does the newline replacement in that, which seems foolproof to me
17:20tanzoniteblack&(doc with-out-str)
17:20lazybot⇒ "Macro ([& body]); Evaluates exprs in a context in which *out* is bound to a fresh StringWriter. Returns the string created by any nested printing calls."
17:25aperiodicand now people would probably figure out what i'm up to if i tried to add inline evaluation to clojurebot :(
17:35shadowh511aperiodic: do you have the source code publically available?
17:35Sgeo##(+ 1 1)
17:35lazybot⇒ 2
17:36Sgeo&(println (str \backspace))
17:36lazybot⇒  nil
17:36Sgeo&(println (str \backspace \backspace \backspace \backspace))
17:36lazybot⇒  nil
17:36dnolenheh
17:36dnolenCLJS reveals a funny bug in CLJ
17:36dnolen,(case 'quote 'a :foo :bar)
17:36clojurebot:foo
17:36metellus&(println (str "abcde" \backspace \backspace \backspace \backspace))
17:36lazybot⇒ abcde nil
17:37jkdufairhow would i access both the entire request and route params from a compojure route definition?
17:37Sgeo,(println (str "abcde" \backspace \backspace \backspace \backspace))
17:37clojurebotabcde
17:38dnolenactually I guess not given the description of case, since the tests are literals.
17:38Sgeo(Not helpful just I'm curious
17:40SgeoOh now I know what periodic meant by inline evaluation: The ## thing
17:41aperiodic$google clojurebot source code
17:41lazybot[hiredman/clojurebot · GitHub] https://github.com/hiredman/clojurebot
17:41aperiodicshadowh511: ^
17:44xeqi_jkdufair: (GET "/" request ...) would bind the entire request to request https://github.com/weavejester/compojure/wiki/Destructuring-Syntax
17:44aperiodiclol, apparently clojurebot is hardcoded to not eval messages from certain nicks
17:45tanzoniteblackitistoday: where do you see that?
17:45itistoday,(println "clojurebot, y u no listen to me??")
17:45clojurebotitistoday: Pardon?
17:47Sgeo,(println "clojurebot, y u listen to me??")
17:47clojurebotclojurebot, y u listen to me??
17:47lazybotclojurebot: Uh, no. Why would you even ask?
17:47clojurebotexcusez-moi
17:47SgeoWoah
17:47aperiodictanzoniteblack: bottom of src/hiredman/clojurebot/sb.clj
17:48antares_can someone point me to that Simplicity/Freedom to focus/Empowerment diagram? I need it for a talk I am giving
17:49tanzoniteblackaperiodic: thanks
17:54jkdufairxeqi: that's what i'm doing now to get the entire request. what i'd also like is, i.e. (GET "/foo/:bar" ...) and bind somehow to get bar and request. perhaps it would be {foo :foo :as request} ?
17:57xeqijkdufair: (GET "/" {{:keys [bar]} :params :as request} ...) maybe
17:58jkdufairi'll try. thx.
17:58dslsdI have a collection: [["foo" "bar"] ["foo" "baz"] ["bar" "qux"]] and I want {:foo ["bar" "baz"], :bar "qux"}
17:59jkdufairxeqi: that did it. thank you!
17:59dslsdive been in imperative land for too long and im struggling to think of how to accomplish the above functionally
18:04SgeoRelated question: Does loop/recur count as functionally?
18:04SgeoAlthough I do see a functional way to do it, I ... think
18:05dslsdim going to say no to loop/recur
18:05Sgeodslsd, please note that I'm not a Clojure expert, so am trying to solve your problem with that limitation in mind
18:05dslsdjust to spite you
18:05jkdufairdslsd: you should be able to use reduce i think
18:05Chousukedslsd: sounds like you need something like group-by but not quite
18:05dslsdChousuke: exactly
18:05Sgeo,(reduce {} (fn [acc vec] (assoc acc (first vec) (nth vec 1)))
18:05clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
18:05Sgeo,(reduce {} (fn [acc vec] (assoc acc (first vec) (nth vec 1))))
18:05clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: sandbox$eval51$fn__52>
18:06Sgeo,(doc reduce)
18:06clojurebot"([f coll] [f val coll]); f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is returned and f is not called. If val i...
18:07Sgeo,(reduce (fn [acc vec] (assoc acc (first vec) (nth vec 1))) {} [["foo" "bar"] ["foo" "baz"] ["bar" "qux"]])
18:07clojurebot{"bar" "qux", "foo" "baz"}
18:07nz-,(group-by first [["foo" "bar"] ["foo" "baz"] ["bar" "qux"]])
18:08clojurebot{"foo" [["foo" "bar"] ["foo" "baz"]], "bar" [["bar" "qux"]]}
18:09SgeoIs it generally considered acceptable to write out an fn like that that's tailored for use with reduce?
18:11dansalmojoy, I figured out my first regex
18:11dansalmo, (clojure.string/split "--(--)4*234/-/1-/1" #"(?<=[^-()])-" 2)
18:11clojurebot["--(--)4*234/" "/1-/1"]
18:11SgeoOn a related note, is there a nice parser combinator library for Clojure?
18:11dansalmobut I would like not to swallow the -
18:13Chousuke(reduce (fn [m [a b]] (let [item (m a [])] (assoc m a (conj item b)))) {} '[[foo bar] [foo zonk] [bar foo]])
18:13Chousuke,(reduce (fn [m [a b]] (let [item (m a [])] (assoc m a (conj item b)))) {} '[[foo bar] [foo zonk] [bar foo]])
18:13clojurebot{bar [foo], foo [bar zonk]}
18:15SgeoHmm http://brehaut.net/blog/2011/fnparse_introduction
18:15SgeoIt doesn't particularly look maintained though
18:15Chousukedslsd: See above. It's way easier to write if you don't treat the one-item case specially
18:15Chousukespecial cases are icky :P
18:16dslsdthanks Chousuke
18:16dslsd(reduce (fn [m [a b]] (let [item (m a [])] │ altivec
18:16dslsd | (assoc m a (conj item b)))) {} '[[foo bar] [foo │ amalloy_
18:16dslsdoops, sorry
18:17SgeoNot only is the function to do the transform easier to implement without a one-item case, it means code that uses the result doesn't need to think about it
18:17xeqiRaynes: I think its broke again
18:17xeqi$findfn 3 4 7
18:17lazybotjava.lang.ClassCastException: clojure.lang.PersistentStructMap$Def cannot be cast to clojure.lang.IFn
18:17Chousukeyeah. special cases leak out :P
18:17SgeoI think maybe Haskell would be good for hammering this into people's heads
18:17Chousukeif you have a special case somewhere down the stack it will spread everywhere
18:18dansalmoIs there a way to get ["----/" "-/"] from (clojure.string/split "----/-/" #"(?<=[^-])-" 2)? without having to add the "-" back the second result?
18:18dansalmo, (clojure.string/split "----/-/" #"(?<=[^-])-" 2)
18:18clojurebot["----/" "/"]
18:20xeqiRaynes: looks like eval too ##(+ 1 2)
18:20lazybotjava.lang.ClassCastException: clojure.lang.PersistentStructMap$Def cannot be cast to clojure.lang.IFn
18:21xeqi,(clojure.string/split "---/-/" #"/")
18:21clojurebot["---" "-"]
18:21xeqiah, right
18:22pbostrom,(reduce (fn [m [k v]] (update-in m [(keyword k)] conj v)) {} [["foo" "bar"] ["foo" "baz"] ["bar" "qux"]])
18:22clojurebot{:bar ("qux"), :foo ("baz" "bar")}
18:23pbostromdslsd: ^ lists, but not vectors
18:25dslsdChousuke: that's really cool -- that ({} :key []) thingamajig
18:25dslsdi didn't know you could get a sort of not-found by doing that
18:25dslsdpbostrom: cool thanks
18:26Chousukedslsd: it's a kind of a hidden-in-plain-sight feature :P
18:26xeqidansalmo: do you want to split after "/"s ?
18:27Chousuke,(:foo 'bar 1)
18:27clojurebot1
18:27dslsdChousuke: thanks that's interesting
18:27Chousukeworks that way too, even if your input is not actually associative.
18:27SgeoChousuke, hmm, I don't see what dslsd is looking at
18:27SgeoOh
18:27dslsdChousuke: where the hell is that documented?
18:27ChousukeI have no idea.
18:28Chousukeprobably on the clojure website
18:28dslsdChousuke: are there any other magical "oh btw this thing is also a function" things?
18:28Chousukemaps, sets, vectors, symbols and keywords are all functions
18:29dslsd,({} '() [])
18:29clojurebot[]
18:30Chousuke,('[a b c] 2)
18:30clojurebotc
18:31dslsd,(let [rocket-to-the-sun (->(*))] rocket-to-the-sun)
18:31clojurebot1
18:31Chousukethe other way around unfortunately can't work :P
18:31Sgeo,(macroexpand-1 '(->(*)))
18:31clojurebot(*)
18:32cemerickweavejester: I wonder if you'd be open to splitting up the predicates in valip so that some subset would be cljs-safe?
18:32Chousukewhile we're on the topic of non-obvious features...
18:32cemerickOr, just keeping the cljs-safe ones in a separate namespace, and immigrating them into valip.predicates, I suppose.
18:32Chousuke,(meta '^:bar [a b c])
18:32clojurebot{:bar true}
18:33weavejesterweavejester: I haven't worked on valip for a while, though I may be looking at it again soon.
18:33weavejesterBut I'm not sure about sharing namespaces between cljs and clj
18:33Chousuke,(meta ^:bar [a b c])
18:33clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0)>
18:33Chousuke,(meta ^:bar '[a b c])
18:33clojurebotnil
18:33Chousukecan you tell why that is? :P
18:33Chousuke(pop quiz!)
18:33cemerickweavejester: I've actually had some good luck doing so so far. *shrug*
18:34cemerickI'll fork for now and you can see if you like what comes out of the other end when you get around to it :-)
18:34thorbjornDXcan anyone recommend "Functional Programming for the Object-Oriented Programmer"?
18:34weavejestercemerick: Sure thing :)
18:40SgeoI should try to implement that search across an infinite space thing I saw once
18:42aperiodicChousuke: does it attach the metadata to the (quote [a b c]) form, which gets evaluated before it's passed to meta?
18:42Chousukeaperiodic: yeah.
18:43aperiodicChousuke: what's going on with '^:bar [a b c]?
18:43Chousukeaperiodic: the metadata goes on the list in the quote form, whereas in the former example it goes on the vector, and the vector is what exists when meta is called.
18:44Chousukeaperiodic: it's just (quote ^:bar [a b c])
18:44Chousukesince ^ is a read time operation it needs to be that way around.
18:45aperiodicah, right, because ^:bar isn't a form
18:45Chousukeright. it's just reader magic :P
18:46SgeoIf reader magic is acceptable here is reader magic unacceptable for a features mechanism?
18:47Chousukewhat sort of features mechanism?
18:47Chousukeif you're looking for a way to make code portable between different clojure implementations, then you should know that that is an explicit non-goal :P
18:47SgeoChousuke, as in, a way to choose a form to read in based on which implementation of Clojure
18:47SgeoOh :(
18:48SgeoWhy?
18:48clojurebothttp://clojure.org/rationale
18:48ChousukeI guess you can sort of do it with read-time evaluation? maybe
18:48technomancyChousuke: an explicit non-goal for application code
18:49technomancythere's a thread about adding a features mechanism; it's not out of the question
18:49ChousukeI suppose it's not a bad idea for libraries
18:49SgeoCommon Lisp the language has no standard way to do threads or networking. Yet, various implementations have implementation specific threading and networking. There exist libraries that smooth over these to provide cross-implementation threading and networking
18:57cemerickChousuke: portability is turning out to be less of a headache than I expected.
18:57cemerickWithin reason, of course; interop-heavy stuff doesn't work well.
18:57cemericks/work well/port easily
18:59casioncan you lazily read from an input-stream using (with-open)?
19:05hyPiRioncasion: if you use read, you can
19:05hyPiRion(repeatedly 3 read) - for instance.
19:07casionhyPiRion: ahhh. I keep getting java.io and clojure.java.io mixed up. I tried with .read and it wasn't working
19:08casionI guess (memfn read) would have worked (and been silly) though
19:12casionhyPiRion: (read) only works with PushBackReaders, I'm using input-stream
19:13casionor java.io.InputStream as it is
19:14Hodappblugh, I hate trying to get vim to do anything with plugins
19:15hyPiRioncasion: (repeatedly #(read-function-here stream)) should work fine
19:15Hodapp:he vimclojure just does nothing
19:15hyPiRionthough lazy reading is kind of scary if you have multiple readers.
19:16casionhyPiRion: I get 'IOException Stream closed' when I try that
19:16casionI suspect because with-open closes the stream?
19:16hyPiRioncasion: yeah - you have to force the reads within a with-open, otherwise you're out of luck
19:17babilenHodapp: Just use a reasonable plugin manager such as vim-addon-manager, vundle or (meh) pathogen
19:17casionalright then, guess I have to rework how I'm thinking about this
19:17casionthanks
19:17Hodappbabilen: I'm trying to use pathogen. Things are silently failing.
19:18hyPiRioncasion: Do you have to lazily read though? Can't you just eagerly read?
19:18babilenHodapp: pathogen would be my third choice, but this is rather a dicussion for #vim than #clojure I guess.
19:18Sgeocasion, try to avoid lazy streams of IO requiring stuff
19:18casionhyPiRion: files can be, and are often, very large
19:19Hodappbabilen: I'm just following instructions for lein-tarsier...
19:19casionavg 4gb, often exceeding 10gb
19:19Sgeocasion, the Haskell community has come to view such things with distrust. The function in Haskell that enables it is called unsafeInterleaveIO, and it's called unsafe for a reason.
19:19hyPiRioncasion: https://github.com/richhickey/clojure-contrib/blob/061f3d5b45657a89faa335ffa2bb80819f2e6918/src/main/clojure/clojure/contrib/duck_streams.clj#L235
19:19Hodappokay, :ClojureRepl is working but :he vimclojure does nothing, that is annoying
19:19casionIs there another way to 'safely' handle large files then?
19:20casionhyPiRion: I need a stream, not a reader
19:20technomancycasion: you just have to find the right place for with-open
19:20casionunless I want to split the chars myself I guess
19:22babilenHodapp: It's probably due to the fact that pathogen "forgets" to generate the helptags (or you forget it) -- IIRC it is :Helptags from pathogen. I would still strongly recommend to take a look at the other two though.
19:22casionactually, if I set encoding to UTF-8, I can read bytes with a reader then right?
19:22SgeoI guess see if there's an Iteratee-like thing for Clojure?
19:22SgeoOr Conduit-like
19:23Hodappbabilen: any recommendations between vim-addon-manager and vundle?
19:23technomancybabilen: do you know of any existing convention for a declarative alternative to Debian's update-java-alternatives?
19:23Hodappmost ofthese tools I only want to learn far enough that they get out of the way and let me do WTF I was going to do in the first place
19:23babilenHodapp: I happily use v-a-m, but both are good.
19:23technomancysomething appropriate for a config file that's included with an application
19:25babilentechnomancy: Not really -- But you could just call whatever binary you want to call directly, can't you? I mean the paths are known and the alternatives system just manages symlinks to them.
19:25casionhah! that worked great. (reader "" :encoding "UTF-8") with line-seq to read a byte-stream
19:26technomancybabilen: no, it needs to be declarative since it's just read by the build process out of an application's source repo
19:26technomancybabilen: we will probably end up inventing our own convention, which I hate to do =(
19:26technomancybut we couldn't find any prior art
19:28Hodappgah, finding vim-addon-manager installation to be... confusing
19:32thorbjornDXHodapp: do you know about pathogen.vim?
19:33thorbjornDXHodapp: https://github.com/tpope/vim-pathogen
19:33babilen(full circle)
19:33Hodappugh.
19:34thorbjornDXHodapp: ah, sorry. Just saw the latest question
19:35Hodappwithout knowing much about vim, I can hardly make heads or tails of the v-a-m installation instructions
19:39UrthwhyteDon't se pathogen
19:39UrthwhyteVundle is much nicer
19:40thorbjornDXUrthwhyte: what don't you like about pathogen?
19:40Hodappuggggggggh
19:40XPheriorEvening, people.
19:41UrthwhyteMakes it wicked hard to just sync dtfiles across machines
19:41thorbjornDXUrthwhyte: how about pathogen + git + git submodules?
19:42Hodappvim-addon-manager is making it wicked hard to comprehend WTF their installation documentation means.
19:42UrthwhytePlease excuse the typos, wifi latency is in the many seconds right now :(
19:42thorbjornDXUrthwhyte: No problem.
19:43UrthwhyteBecause why complicate what could just be a single file sync?
19:44thorbjornDXUrthwhyte: I tend to hack on both my vimrc and the code in the submodules, so I like to have them source controlled
19:46UrthwhyteI avoid vimscript as much as possible
19:46Urthwhytebut I also have a very minimal vimrc
19:47UrthwhytePRetty much just the bare minimum for working with whatever language I'm currently big into
19:47Hodappthat's all I'm trying to set up
19:49UrthwhyteI haven't actually worked out how to get the standard clojure stuff into vim, since all I've ben doing is 4clojure problems
19:52FrozenlockFriday evening on #clojure, let's party!
19:53SgeoI'm having too much fun with awtbot
19:53shaungilchristbeen partying hard since 3am last night. couldn't sleep so started working on edn parser for node.. you know because of because.
19:55duck1123I haven't gotten around to reading the spec just yet, keywords are still supported, right? Namespaced keywords?
19:55shaungilchristtotally
19:55duck1123I'm wondering if I can specify that Ciste's config format is just edn
19:56technomancyit's just an attempt to trick non-clojure-users into using the reader
19:57duck1123well, if it's going to be used as a data format anyway. Why not specify it apart from clojure
20:00FrozenlockCmon guys, no need, we have json
20:00thorbjornDXFrozenlock: can't forget XML
20:01duck1123json puts colons in the wrong place and it's too picky about commas
20:01FrozenlockOh right, we have xml!
20:02S11001001json in yaml in xml in s-exps
20:02duck1123csv?
20:02Frozenlocktsv, csv is for noob
20:03FrozenlockS11001001: s-exps aren't that bad
20:04technomancywhatever; I'm still using application/clojure as my mime type
20:04shaungilchristI am going the other way and writing my code in csv and marshalling that to edn and then passing it to clojure
20:05shaungilchristthat way I can use excel macros to truly unleash the power
20:05Frozenlockhttps://sites.google.com/site/steveyegge2/the-emacs-problem
20:05Frozenlockshaungilchrist: You've won with the excel macros.
20:05duck1123has anyone ever tried encoding clojure code as xml? Second question: have they been shot?
20:06shaungilchristI am sure adobe is working on that for flex4
20:07thorbjornDXI write my clojure code in powerpoint
20:07shaungilchristevery time I see thier </mediocrity> tag I almost lose my mind and drive off the road
20:09duck1123Years ago, I spent some time using a XForms/XSLT/XQuery/XPL system. It was XML all the way down. I'm sure everyone has things from their youth that they regret
20:09Hodappshaungilchrist: </mediocrity>?
20:10shaungilchristHodapp: they really have a billboard w/ just a </mediocrity> tag as in "end your mediocre career and come work here slinging mad markups rockstar"
20:11Hodappsigh.
20:11technomancyduck1123: https://code.google.com/p/xsharp/
20:12shaungilchristif I were young again I'd totally deface it with an s-expression. that would show them.
20:14duck1123I'd probably add the open tag, just for symmetry.
20:16xeqiwonder if nrepl should change to using edn underneath
20:17thorbjornDXI just installed emacs, am I in for a good time? (vim-user)
20:17xeqia world of pain, followed by acceptance, followed by a good time
20:17xeqimuch like any new tool
20:17Frozenlockxeqi: Wasn't edn the description of clojure seqs?
20:18thorbjornDXI don't mind the non-modality of it so long as I'm just in the repl, but I can't bring myself to use the arrow keys when traversing my src
20:19thorbjornDXand C-n/p/b/f or w/e seem marginally worse than jkhl
20:19aperiodicyou could always try evil-mode
20:19thorbjornDX</nitpicking>
20:19duck1123I can't remember the name, but there's a package that'll yell at yuou if you're arrowing around too much
20:19thorbjornDXaperiodic: this sounds like a whirlwind of pain, but I'll give it a shot
20:20Frozenlockno-easy-key
20:20thorbjornDX<M-x> package-install <CR> evil <CR>
20:22technomancyjkhl is awful in dvorak
20:23thorbjornDXtechnomancy: true, I tried prog dvorak a while back and couldn't make the switch because of vim
20:23thorbjornDXtechnomancy: if I was a nano slinger I would have been perfectly fine :(
20:23hoover_dammthorbjornDX, doubt it
20:24hoover_dammthorbjornDX, i've paired with nano coders... it's they feel awkward as heck in emacs
20:24hoover_dammthorbjornDX, when they cry out for vim is when you know they've had it.
20:24aperiodici didn't have much trouble switching to programmer dvorak as a vim user
20:25aperiodicj and k are still right next to each other, in the same orientation
20:25aperiodich and l i very rarely use
20:25duck1123I overheard some people talking about OSX's movement commands and was like, I know this! Emacs!
20:25hoover_dammaperiodic, I've been dealing with *Unix* since 1990 and started with vi
20:25hoover_dammaperiodic, I don't understand why people care so much
20:25hoover_dammemacs, vi, nano, ed
20:25hoover_dammit all works
20:25cgagvim just works best
20:25hoover_dammuse what works best
20:26hoover_dammoften that is personal so you shouldn't try and share that feeling with someone else
20:26cgagI'm trying to get korma to work with mysql, does anyone know if i'm doing anything obviously wrong here? https://www.refheap.com/paste/4932
20:26thorbjornDXI don't think I can force myself to use evil mode, I have a bit too much invested in my vimrc. I guess I can just use it as in interface to nrepl
20:27shaungilchristI think thats enough for a day, I can now load datomic schemas/dtm files in node
20:28shaungilchristI know the "easy" route would have been to go clojure script but I wanted something stand alone w/o the jvm deps
20:28shaungilchristhttps://github.com/shaunxcode/jsedn if anyone wants to break it that would be cool
20:31duck1123shaungilchrist: add a bin that'll allow me to get-in among other things and that'll be cool
20:32shaungilchristjust like a simple repl that reads and prints edn forms?
20:33duck1123yeah, basically, That way if you want to extract a value from a edn file in a bash script or something, it'd be easy
20:35duck1123$ echo "{:foo 7}" | jsedn -s :foo => 7
20:35duck1123not sure what args it would actually take
20:35SgeoWTF
20:35Sgeohttp://www.nsa.be/index.php/eng/Blog/Using-Jwt-yes-it-s-a-J-with-Clojure
20:36SgeoThe first create-listener macro defined on that page shouldn't work because the autogensym is outside of any quasiquote form
20:37SgeoOh "Update
20:37SgeoWith the Clojure bug mentioned above gone, and removing the unecessary gensym as it is outside the escaped code, the macro can be written:"
21:34seancorfieldcgag: sorry, guess there's no korma users here at the moment...
21:37cgagseancorfield, i figured it out, it was putting quotes in places it shouldn't have, i just had to pass a :delimiters option somewhere to fix it
21:43dansalmohow to i get numeric value of char /0 as 0? not (int /0)?
21:43dansalmo, (int \0)
21:43clojurebot48
21:45dansalmoI hope it is not (read-string (str \0))
21:45dansalmo, (read-string (str \0))
21:45clojurebot0
21:46dansalmois there a simpler way?
21:46dansalmo,(int (read-string (str \0)))
21:46clojurebot0
21:46dansalmo, (int (read-string (str \0)))
21:46clojurebot0
21:47tmciverdansalmo: do you want the character numbers to evaluate to their value? ##(- (int \1) (int \0))
21:47lazybotjava.lang.ClassCastException: clojure.lang.PersistentStructMap$Def cannot be cast to clojure.lang.IFn
21:48tmciver,(- (int \1) (int \0))
21:48clojurebot1
21:48dansalmoyes
21:48tmciverdansalmo: just subtract 48 then.
21:48tmciver,(- (int \5) (int \0))
21:48clojurebot5
21:49tmciver,(map #(- (int %) (int \0)) "123456789")
21:49clojurebot(1 2 3 4 5 ...)
21:50dansalmoI want just one int like (int \0)
21:51dansalmo. ([ 1 2 3 4] (int \1))
21:51dansalmo, ([ 1 2 3 4] (int \1))
21:51clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
21:51mthvedtwoah what?
21:52mthvedt,([ 1 2 3 4] (int \1))
21:52clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
21:52tmciver,(int \1)
21:52clojurebot49
21:53tmciver,({49 1 50 2} [(int \1) (int \2)])
21:53clojurebotnil
21:53dansalmoclojer gives easily the stuff you have to work for in other langs and make you work for the easy stuff
21:53tmciver,({49 1 50 2} (int \1))
21:53clojurebot1
21:53mthvedthow do vectors implement ifn
21:54tmcivermthvedt: they return the value at the index given as an arg.
21:54tmciver,([1 2 3 4] 1)
21:54cgagit's basically the same as nth isn't it?
21:54clojurebot2
21:55mthvedtso...
21:55mthvedt,([1 2 3 4] 1)
21:55clojurebot2
21:55mthvedt,([1 2 3 4] (int \1))
21:55clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
21:55mthvedt,(int \1)
21:55clojurebot49
21:55mthvedtoh
21:55mthvedtthat's boring
21:55mthvedt=/
21:56mthvedti was hoping it would yield some interesting insights on the clojure language
22:01dansalmoit will for me :)
22:01cgagwhere does that actually get implemented in the clojure source? I think it kind of does
22:02cgagthe way datastructures can implement the function protocol is an interesting insight imo
22:03SgeoDoes Eclipse have a thing for making Swing GUIs visually? Is that comfortable to use with Counterclockwise and Clojure?
22:03dansalmo, ([1 2 3 4] (read-string (str \1)))
22:03clojurebot2
22:04dansalmois there no more direct way for char?
22:04dansalmo, ([1 2 3 4] \1)
22:04clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Key must be integer>
22:04SgeoSo, doseq is a non-lazy for
22:04tmcivercgag: here's how vector implements IFn: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentVector.java#L593
22:04SgeoI don't know how to remember the difference between doall and dorun
22:05Sgeodoall is sequence and dorun is sequence_
22:06tmciverdansalmo: I would just subtract (int \0) from the chars you're interested in. Otherwise, you have to hard-code your 'vector of values'.
22:06dansalmo, ([1 2 3 4] (- (int \1) 48))
22:06clojurebot2
22:06tmciverdansalmo: actually, that's not *terrible*: ##([0 1 2 3 4 5 6 7 8 9] \3)
22:06lazybotjava.lang.ClassCastException: clojure.lang.PersistentStructMap$Def cannot be cast to clojure.lang.IFn
22:07tmcivererr
22:07tmciver,([0 1 2 3 4 5 6 7 8 9] \3)
22:07clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Key must be integer>
22:07tmciveroh yeah, that won't work.
22:07dansalmoseems like there should be something better, but then when I run into these things, it means I am trying to do something the hard way.
22:09cgagSgeo, doseq returns nil
22:09SgeoMaybe doseq should be called dofor
22:10cgagdofor would be like calling (doall (for ....))
22:10cgagi've seen that macro in storm's source
22:18dansalmo, (Integer. (str \0))
22:18clojurebot0
22:18dansalmo, (Integer. \0)
22:18clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching ctor found for class java.lang.Integer>
22:19tmciverdansalmo: works but that's terribly inefficient.
22:19dansalmoand more code than (- (int n) 48) :)
22:20tmciverand not very idiomatic either.
22:22dansalmoI am just astonished that there is not something simpler that is findable in docs
22:24tmciverdansalmo: I think it is rather succinct. If you want something simpler, just create a function to do that for you.
22:25dansalmo, (let [int-c (fn [x] (- (int x) 48))] (int-c \0))
22:25clojurebot0
22:26dansalmothat'l do
22:27Sgeo,(let [int-c (comp (partial + -48) int)] (int-c \0))
22:27clojurebot0
22:29Sgeo,(letfn [(int-c [x] (- (int x) 48))] (int-c \0))
22:29clojurebot0
22:29dansalmo:tmciver, thanks for your help, I was able to clean it up without the fn.
22:29tmciverdansalmo: np
22:30SgeoIs my pointless version a bit too... err, pointless?
22:31dansalmoI right clojure code at about 1 line per hour. Re-writes go a little faster though.
22:32tmciverSgeo: it's never pointless when you get to use comp and partial together. :)
22:32dansalmoI spell bad to.
22:33tmciverdansalmo: you mean 'too'. ;)
22:33dansalmoIf I were going to use the fn, I would use yours for sure. ;)
22:33dansalmoTook too much effort to fix speel.
22:33dansalmonone left over for grammer
22:38SgeoClojure doesn't have a built-in flip, does it?
22:39tmciverSgeo: what's flip? Swap?
22:40SgeoDefinable as (defn flip [f] (fn [arg1 arg2 & args] (apply f arg2 arg1 args)))
22:40Sgeo,(doc swap)
22:40clojurebotI don't understand.
22:41tmciverwhat does that do? It just looks like apply.
22:41tmciverOh I see.
22:41duck1123reverses the 1st 2 args
22:41Sgeotmciver, (flip f) returns a function that acts like f except with the first two arguments reversed
22:44duck1123I think the idea is, if all the libs are designed right, you should rarely need something like that, and when you do, #(f %2 %1)
22:44dysingeris there a shortcut to install a (missing) jar in the local repo like 'mvn install-file' ?
22:44SgeoInstead of writing (partial + -48), with flip I could write (partial (flip -) 48)
22:44dysinger(for leiningen)
22:45yankovis there analogue of .indexOf for sorted-map/
22:45duck1123dysinger: I think install:install-file is it
23:08riley526Can anyone recommend their preferred Markdown library for Clojure?
23:09dslsdriley526: https://github.com/yogthos/markdown-clj
23:10riley526dslsd: Cool, thanks. I'll check it out.
23:11dslsdIt's under active development which is the more important part in my opinion.
23:25cemerickAnyone know why ClojureScript requires a vector for e.g. :refer in require forms? Seems like a silly point on which to be strict on, and just one more stumbling block for clj/cljs portability…
23:26hiredmancemerick: a vector is clearly the correct choice
23:26cemerickhiredman: I'll just assume that's sarcasm. :-P
23:27hiredmanlook, the things you refering are all peers, so if you newline them each they should indent as a column one on top of each other
23:28hiredmanwhere, because lists are typically function calls, lists usually indent differently
23:28hiredmansarcasm?
23:28hiredmanme?
23:30cemericknever, I know
23:30cemerickparens in that position seem to be far more common, for the good reason that they stand out among the always-vectored libspecs
23:30cemerickBesides, editor peculiarities should stay out of language issues.
23:31cemerickAnyway, it's a gratuitous difference.
23:31SgeoI think it's a popular opinion of the meaning of a literal vector in syntax vs a literal list
23:31hiredmanI have a 34888 lines of clojure code here where it is always vectors
23:31SgeoRather than an editor concept
23:32cemerickAh-ha, see, I've over 50K lines where it's always lists.
23:32SgeoLists look like function calls, so the first item should be important in some way
23:32hiredman~guards
23:32clojurebotSEIZE HIM!
23:32SgeoIf all the items are roughly the same importance-wise, a vector makes sense
23:34cemerickSgeo: sorry, lists within libspecs have a long history, e.g. http://clojure.org/libs
23:34cemerickProbably from the repeated use of "list" in `refer`. http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/refer
23:36Sgeocemerick, in the line (require '(clojure.contrib def except sql))
23:36Sgeo ?
23:37SgeoIn that case, the first item is significant, because it signifies the namespace those other things are found in
23:37cemerickSgeo: No, talking about :only on the lib page
23:37Sgeohmm
23:39cemerickFunction position is "significant". When used to just denote a list (i.e. not a function calls or special forms), parens don't indicate anything about the first element.
23:39cemerick'(see — like this)
23:40SgeoYes, at a language level, but at a level of common conventions is what I'm referring to
23:41cemerickThe language level is the only one where the first element of a list denotes anything significant.
23:41cemerickBeyond that, it's just people fuzzing because they see parens. :-)
23:52duck1123ahh, got a big chunk of my unpushed code all pushed to github and clojars
23:54duck1123I just ran "rm -rf ~/.m2/repository; lein midje" now we wait
23:55duck1123and it fails on bouncycastle. *grumble*