#clojure logs

2013-10-16

00:46rhg135hello ppl, i was wondering about feedback about some code. im new to "simple" and don't know i overdid this but i think it's about as simple as can be. https://www.refheap.com/19856
00:48amalloyrhg135: i don't see any reason why it's an atom instead of just a map
00:48rhg135hmm
00:49rhg135i borrowed the code so didn't know if I needed that
00:49bitemyapprhg135: do you know what atoms are for?
00:49rhg135yes
00:49bitemyapprhg135: you can't do "simple" unless you understand what you're doing - as opposed to cargo cult.
00:50rhg135theyre for managing non-coordinated concurency
00:50bitemyapprhg135: you're just repeating something you saw. Do you know what those words mean?
00:50rhg135ys i do
00:50bitemyapprhg135: what do you use atoms for? don't repeat something you read. Say it in your own words.
00:51rhg135for setting a counter not tied with something else
00:51bitemyapprhg135: just counters?
00:51rhg135no
00:51bitemyapprhg135: what does being tied with something else have to do with it?
00:51bitemyapprhg135: what are atoms for?
00:51rhg135but mutability isn't too useful for me
00:52bitemyapprhg135: you don't need atoms for mutability alone, so what are atoms for?
00:52rhg135i just happen to be making a server and am forced to use mutability
00:52rhg135managing time
00:52TEttingerthat's agents I thought
00:52rhg135not state and time
00:53bitemyapprhg135: managing time how? it's not clear to me what atoms have to do with time.
00:53bitemyapprhg135: stop repeating words you saw somebody else use.
00:53bitemyapprhg135: what are atoms for?
00:53bitemyappas much as I love Hickey's talks, you're letting his words muddle your mind.
00:53bitemyappuse your own words.
00:53rhg135if you repoint it, you don't change it's value you point to a new value
00:54bitemyapprhg135: you're off-track and still not explaining what atoms are for.
00:54rhg135well it's hard to describe atoms
00:54bitemyapprhg135: don't tell me how you (incorrectly) think they work.
00:54rhg135ok
00:54rhg135idk
00:54bitemyapprhg135: tell me what they're for. What sort of problem do they solve?
00:54rhg135shared data you need from various threads
00:55TEttingerheh bitemyapp are you callen by any chance? this seems like a rough intro
00:55rhg135like in most languages it's hard
00:55TEttinger$seen callen
00:55lazybotcallen was last seen talking on #clojure 2 weeks ago.
00:55rhg135so much to do sigh
00:56bitemyapprhg135: why do you need atoms for shared data across multiple threads?
00:56bitemyapprhg135: you can share data between threads without an atom.
00:56rhg135cuz locking is a pita
00:57bitemyappyou're getting closer but still getting a bit besides the point.
00:57rhg135then you forget and D:
00:57bitemyapprhg135: why does locking matter if you are sharing data between threads?
00:57rhg135because if you mutate it as you read
00:57rhg135well it can get corrupted
00:58bitemyapprhg135: so, thread-safety, right?
00:58rhg135yes
00:58bitemyapprhg135: https://www.refheap.com/19856 what about this code needs to be thread safe?
00:58rhg135it's a server
00:58rhg135i can't handle request on one thread
00:59bitemyapprhg135: I don't see a thread pool in that code.
00:59indigoYeah, there's nothing multithreaded about it
00:59rhg135i have it modular
00:59rhg135thats just the json code
00:59bitemyapprhg135: so what do you need the atom for?
00:59rhg135idk
00:59rhg135i just forgot to remove it
00:59indigoAnyway this is a bit of a rough intro ;P
01:00bitemyapprhg135: so if you can't explain why you need it, what do you think the simple thing to do is?
01:00bitemyappindigo: I prefer fewer lessons that stick to many lessons that fade away.
01:00rhg135sigh
01:00rhg135yes, sir
01:00mgaareis lesson 1 meant to be, "don't join #clojure" ?
01:01bitemyappmgaare: I'm surprised you genuinely think it was unpleasant.
01:01indigoAnyway!
01:01indigoI think the main problem with the code is not the lack of simplicity
01:02indigoIt's that it's very Java-like right now
01:02rhg135well in fairness i've had easier tests in school
01:02bitemyappI am perfectly happy to pass the ball to somebody else if they're interested in helping somebody and think they can do a better job
01:03bitemyappWhat I am not going to countenance is criticism from idlers that aren't actually trying to help somebody.
01:03rhg135new version https://www.refheap.com/19857
01:03bitemyappIf you don't like the teaching method, teach in an alternate fashion, don't stand on the sidelines and gripe.
01:03rhg135indigo, how so?
01:03indigoI feel like there might be a better way to do sockets in Clojure
01:04bitemyapprhg135: you're just smashing the socket.
01:04rhg135smashing?
01:04bitemyappthat's my preferred verb when side effects are involved.
01:04rhg135ah
01:04rhg135i don't see a way around it
01:05bitemyapprhg135: then you should learn more Clojure. Ring has good examples for abstracting servers from their implementations.
01:05indigorhg135: What's the jim-chat protocol
01:06rhg135jim-chat is JSON IM
01:06rhg135see jim.hackpad.com
01:06TEttingerI learned a lot by reading and adding to the lazybot source.
01:06rhg135ah
01:06TEttingerit makes use of a lot of clojure features, but you can start with pretty basic plugins
01:06rhg135i ran a lazybot instance
01:06rhg135augmented it even
01:07rhg135but not much
01:07TEttingerclojure source is also good.
01:08rhg135i once tried to read a language's source, and stopped programming for a week
01:09rhg135but clojure's is quite nice
01:09indigoHm, doesn't seem to be that well-documented... is it using just plain TCP sockets or is it a RESTful protocol over HTTP
01:09rhg135from what ive seen of it
01:09rhg135plain tcp
01:09rhg135it's pretty new
01:09indigoHm okay
01:09bitemyappindigo: if it's one or the other, I'd ask the people hammering out the standard: porque no los dos?
01:09rhg135see im writing the server
01:09rhg135it's that new
01:10indigoAh
01:10indigoWell, congrats on choosing a cool language to do it in ;)
01:10rhg135and the client, but i can't on the jvm
01:10rhg135i don't thin ppl would like a jvm based chat client
01:11indigoAnyway, I suggest looking at server-socket
01:11rhg135k
01:12indigoI also suggest hitting the JIM people with a stick
01:12rhg135ya id like to write the client on nodejs
01:12mgaarealeph is also very nice for tcp
01:12indigoUntil they make their stuff RESTful
01:12indigoBecause they're already using the HTTP status codes
01:12rhg135indigo, if you look i helped write it :(
01:13bitemyapprhg135: I second mgaare's recommendation of Aleph, can help for writing a nice, clean async server.
01:13rhg135i guess it'd be nice
01:14technomancyI think sticking with regular sockets would be better if you're just starting out
01:14indigorhg135: It's a good idea though :)
01:14rhg135it'd put the other nodejs server to shame
01:14technomancyyou don't want to turn your codebase inside out when you're new to the language
01:14rhg135i agree
01:15rhg135also i guess the other authors haven't seen the tao and thought it'd be too complex
01:16rhg135even my python code is sorta functional
01:16bitemyapptechnomancy: probably true but working towards something like Aleph is a good terminal goal.
01:16indigoAnyway, I strongly suggest moving to a RESTful API for JIM, unless you're dead set on plain sockets
01:17indigoYou're like 2/3 of the way there... HTTP status codes and JSON request/response ;P
01:17rhg135it would be even more bandwith
01:17rhg135sigh
01:18rhg135i get an urge to abandon this and got to edn
01:18indigoBut it'd be so much easier to integrate with everything else
01:18indigoIf you're worried about bandwidth, you should probably take a look at protobufs
01:18rhg135idk if it'll be in the spec but i can try to implement
01:19indigoBut then it won't be JIM anymore
01:19rhg135in famous words "f*** them"
01:20rhg135maybe, i don't think they're that unsensible
01:20rhg135it's not like on dude likes c
01:21marcopolo2$seen rhickey
01:21lazybotrhickey was last seen quitting 17 weeks and 1 day ago.
01:22indigoHeh
01:23indigoAnyway good luck on your protocol/server, I'm heading off to bed
01:24rhg135thx
01:24rhg135gn
01:24indigoListen to bitemyapp and don't use atoms when you don't need them :P
01:24rhg135mhm
02:11brainproxyjust read through the cljs source for core.async ... I feel small and weak, my mind is excited yet trembling
02:11marcopolo2brainproxy: wow, kudos!
02:11marcopolo2(inc brainproxy )
02:11lazybot⇒ 1
02:12brainproxyimpl/ioc_macros.clj is pretty awesome
02:13brainproxyi understand the state monad well enough, but what's going on in there is going to take some deep study
02:14marcopolo2have you seen this: http://hueypetersen.com/posts/2013/08/02/the-state-machines-of-core-async/
02:22brainproxymarcopolo2: i have, but i need to take a deeper look now
02:22brainproxyi mean, having started dabbling proper
02:22Jardamarcopolo2: thanks for that link!
03:22Jarda(defn foo [arg & other] (some-other-call (merge arg {:some "thing"}) <how to just pass the others>))
03:23Jardaso I need to call some-other-call with a variable number of arguments but need to always process the first argument?
03:28ddellacostaJarda: sorry, I don't understand--what exactly do you want to return?
03:29Jardaddellacosta: in the end I want to call (some-other-call arg arg2 arg3)
03:29Jardabut there might bew N args for foo (and some-other-call)
03:29Jardabut I need to always modify the first
03:29ddellacostaJarda: so, you have variable arity for both foo and some-other-call?
03:29Jardayes
03:30Jardaah, now I got the syntax right
03:30Jarda(apply some-other-call arg other)
03:30ddellacostaI would use the construct clojure provides for declaring variable arity functions: (defn foo ([one] (foo one nil nil)) ([one two] (foo one two nil) …) etc.
03:31ddellacostaJarda: but yeah, that works too.
03:31Jardayeah but there would be unlimited count of declarations
03:32ddellacostaJarda: okay…not sure what you're trying to do but there are many ways to do these things.
03:32ddellacostaJarda: but sounds like you've got something working.
03:33matt`Good evening everyone.
03:33ddellacosta'evening.
03:33matt`Hello ddellacosta
03:33Jardaddellacosta: yeah thanks
03:33Jardaevening? not that much. 10 am here :)
03:33bitemyappddellacosta: howdy.
03:34ddellacostabitemyapp: howdy
03:34bitemyappddellacosta: I'm in a delightful mood, finally got a desk and chair.
03:34matt`Jarda: ha.. i'm on the other side of the world to you then :P
03:34ddellacostabitemyapp: haha, excellent. :-)
03:34bitemyappjust got done committing some improvements to Selmer too :)
03:34ddellacostayah, it's 4:00 PM here
03:34ddellacostanice!
03:34bitemyappit's easier to code at home when a chair and desk are in place.
03:34Jardamatt`: .fi :)
03:34ddellacostabitemyapp: that is very much true, as I found out myself. ;-)
03:35matt`bitemyapp: very true.
03:36bitemyappddellacosta: Selmer has template validation (yogthos work), throws a nicer error when your template path is invalid or the file doesn't exist, and tells you which template file is invalid. :)
03:36ddellacostanice. :-)
03:36bitemyappI don't know how long he'll want to bake it, but it'll probably merit a release soon. I need to work on Simonides, honestly.
03:36ddellacostanow, you have to give me something that does partial compilation on the server and generates template functions I can use in CLJS. Please.
03:37bitemyappddellacosta: that's doable actually.
03:37bitemyappddellacosta: no seriously.
03:37ddellacostabitemyapp: I believe you. Actually, I've been looking into it myself, just had so much else to do.
03:37bitemyappddellacosta: the way Selmer works is it does a recursive gather of template includes and mixins and generates a vector of content nodes and function nodes.
03:37bitemyappdoing a clj server -> cljs client handoff is totally doable.
03:37bitemyappyou could render a subset of the vector or handoff the vector directly as edn.
03:38bitemyappthere would be limitations in what the function nodes could do in terms of custom functionality if you do so, though.
03:38bitemyappthat or parity between the customization on the cljs and clj side would be needed.
03:39ddellacostabitemyapp: yeah, that's the rub. Honestly, I don't quite know what I need yet. One idea we've been playing with is having template functions in CLJS auto-render based on core.async messages…we'll probably use some kind of mechanism like that in the end, but perhaps with template function de-coupled from the channel binding
03:39ddellacostabut we want to have the server side do the work of actually creating functions based on raw HTML
03:39ddellacostathere is a lot in between to figure out though.
03:40ddellacostaprobably I'm going to build a half-assed system at first, then throw it away and build one that works properly. As I am wont to do.
03:40bitemyappddellacosta: one thing to consider is that Selmer is multi-stage and has a notion of "preprocessor", "compiler", and "renderer"
03:41bitemyappddellacosta: the server would be best suited to the first two bits, and those are the parts that can get memoized. "renderer" is restricted to runtime because it needs the "context" to do any further work.
03:41ddellacostabitemyapp: yeah, that makes sense
03:41bitemyappthat's where it rips through the content and function nodes, handing off the context to the function nodes.
03:42ddellacostadamn, selmer does a lot doesn't it
03:42ddellacosta(looking at docs now)
03:42ddellacostaash, I don't know what to do yet.
03:42ddellacosta*ah
03:42bitemyappddellacosta: Clojure is ~1.6k LOC
03:42bitemyapper, Selmer. Sorry.
03:42ddellacostafreaking spellcheck, I thought I turned it off
03:42ddellacostabitemyapp: haha, no worries.
03:42ddellacostagotcha.
03:42bitemyappI'm still agitating for an experimental rewrite in Instaparse
03:43bitemyappbut yogthos is mighty jealous of his performance.
03:43ddellacostabitemyapp: ha, I've been spending the last few days on instaparse
03:43ddellacostaI LOVE it
03:43bitemyappIt was quite a feat that Selmer ended up being as fast as Stencil.
03:43ddellacostaso much
03:43bitemyappand anything that compromises that will displease my Russian master :)
03:44bitemyappmaking something as fast as Stencil is really hard in the realm of template libraries. Only hiccup and clj-mustache are faster.
03:45ddellacostahave you ever looked at tinsel?
03:45bitemyappSure.
03:45bitemyappddellacosta: seemed okay, but it's not to my taste at all.
03:45ddellacostadon't know anything about its speed though
03:46bitemyappddellacosta: easy way to find out mate: https://github.com/bitemyapp/clojure-template-benchmarks
03:47ddellacostaheh, nice
03:47bitemyappas you can see, hiccup, mustache, and tinsel were all around the performance of using str.
03:48bitemyapp(I didn't try it with a StringBuilder, guess I should've?)
03:48bitemyappthen out in the stratosphere you had enlive, laser, and clabango.
03:49bitemyappand that was in a test totally absent the fancy tree transformation most people do with enlive.
03:49bitemyappit's godawful slow the moment you do any of that at runtime.
03:50bitemyappifesdjeen: hey. no hard feelings?
03:51bitemyappddellacosta: this stuff *does* matter, replacing a slow template library moved Luminus from the bottom of one of the Techempower benchmarks to closer to the top.
03:51ddellacostavery nice.
03:53bitemyappddellacosta: the hybrid rendering model you're thinking of is what Twitter does btw
03:53bitemyappnot many sites go about it in a disciplined manner though.
03:54ddellacostabitemyapp: really? that is pretty interesting, didn't know that about twitter. Will have to research it.
03:54ddellacostabitemyapp: yeah, it's not simple to do
03:55bitemyappddellacosta: well Twitter went from 100% server-side (original Rails), to 100% client-side, which ended up being too slow (lol), to a hybrid model for which it's not clear what the split looks like.
03:55bitemyappI should pilfer through the site with dev console turned on and see what I see.
03:56ddellacostabitemyapp: I wonder if they have open-sourced any of that part of their codebase? I haven't checked out their open-source projects lately, forgot what they put out
03:56bitemyappcljx Selmer would make yogthos piss blood though.
03:56bitemyappddellacosta: they open source stuff, oddly mostly Scala: https://github.com/twitter/
03:57bitemyappddellacosta: summingbird is something our very own sritchie works on if I'm not mistaken.
03:57ddellacostayeah, I remember a lot of scala being open-sourced
03:57ddellacostaI started going through their tutorial at one point actually
03:57ddellacostaseemed pretty good
03:57bitemyappthere are some odd and end JS libraries (like typeahead.js) but nothing that really demonstrates their overall approach.
03:57ddellacostalot of it seems more back-end
03:58bitemyappddellacosta: You really should take a look at this if you're doing frontend: https://github.com/twitter/typeahead.js
03:58ddellacostanot that that's a bad thing, just not what I'm looking for
03:58ddellacostayeah, that's part of bootstrap isn't it?
03:58ddellacostaI've used that actually, it's freaking nice
03:58bitemyappI didn't know it was part of bootstrap, just find it massively impressive :)
03:59ddellacostayeah, I mean, I dunno if the one in bootstrap is like a "junior" version or what, but that one is freaking super awesome
03:59ddellacostareally handy
03:59ddellacostaoh wow, this has MUCH more than I knew
03:59ddellacostamaybe it's not the same, although it is configured similarly
03:59bitemyappddellacosta: This is their frontend mustache template compiler: http://twitter.github.io/hogan.js/
03:59ddellacosta"For simple autocomplete use cases, the typeahead component Bootstrap provides should suffice."
03:59ddellacostaright, they are different
04:00ddellacostaah, right, Hogan--I've heard of that
04:00ddellacostathanks
04:00bitemyappso Hogan.js should give some hints as to how they work, maybe.
04:00bitemyappI'm digging around for more.
04:01bitemyappyeah that's it I'm afraid.
04:02bitemyappI'm a little curious as to why Twitter needed their own mustache library. Compactness maybe?
04:03bitemyappddellacosta: https://blog.twitter.com/2012/improving-performance-twittercom this is the best explanation of their current site architecture so far as I'm aware.
04:04ddellacostabitemyapp: cool, thank you! I was on to something else, but I will definitely be reading this very soon
04:04ddellacostaand absorbing whatever I can from their techniques
04:04bitemyappSure, just sharing what I had since it seemed to pique your interest.
04:04bitemyappSorry for distracting you :)
04:12noncomhi anyone using lighttable here?
04:14TEttingernoncom, yes
04:16noncomhow is your experience? are you using it for big projects at work?
04:19TEttingernoncom, i don't think it's ready for that just yet.
04:20TEttingersmall projects are fine
05:13udoprogI'm using vim-fireplace, but I can't seem to get the macroexpand-all shortcut (cmm) to work, all I see is the same s-expression that I am trying to expand. i.e. (my-macro :foo :bar) 'cmm' -> (my-macro :foo :bar)
05:15silasdavisif I destructure on an seq, is it implicitly getting converted into a vector?
05:16silasdavisI have a reduction where I prefer the way it looks comp'ing 'vec' on to the function
05:16silasdavisbut if that is wasteful I could just vec the result
05:18silasdavisAlso, the same function: (reduce (comp vec (partial map (partial apply (juxt min max))) (partial map conj)) [[0 0] [0 0]] points))
05:19silasdavisfinds the min/max'es of a list of points [[3 4] [5 6] ...] as [[min-x max-x] [min-y max-y]]
05:20silasdavisonly the initialisation value is broken
05:20silasdavisI need [[x x] [y y]] where [x y] is any point in the list
05:20silasdaviswhat's the neatest way to do this
05:24silasdavistell me it's not: (cons (vec (map (juxt identity identity) (first points))) (rest points))
05:25crocketIs leiningen better than gradle clojure plugin?
05:25crocketgradle seems to be good.
05:25crocketnot sure gradle fits clojure, too.
05:26silasdaviscrocket: pretty much everyone uses leiningen if that helps
05:26silasdavisit's a bit more than a build tool
05:27silasdaviswith it's ring plugin, project config, and repl'ing abilities
05:27crocketI don't like this trend.
05:27silasdaviswhy's that?
05:27crocketgradle has been conquering java, scala, and groovy build automations.
05:28crocketclojure has a separate effort named leiningen.
05:28silasdavisI don't think they are trying to serve the same purpose
05:28silasdavisleiningen is largely a development tool
05:29crocketCan leiningen automate java, scala, groovy, and clojure builds?
05:29s4muelNo, such a polyglot scenario is what Gradle is good at
05:30silasdavisif you have complex build needs, particularly pulling in more of the java ecosystem then you might want to use a heavier build system
05:32clgvcrocket: leiningen supports java per default
05:32crocketDoes leiningen support scala?
05:33clgvcrocket: no per default. I do not know whether there is a leiningen plugin for this.
05:33crocketmeh
05:33crocketit seems leiningen is optimized for clojure.
05:35crocketI believe clojure will win for the next 2 decades.
05:36crocketIt will win in its own ways.
05:46clgvcrocket: there seems to be a scala plugin, see here https://github.com/technomancy/leiningen/wiki/Plugins or directly there https://github.com/technomancy/lein-scalac
05:47clgvcrocket: apparently there was a plugin for groovy in leiningen 1.x as well. should not be to hard to update that one to lein 2.x I guess
06:44babilenDid any great testing frameworks appear in the last couple of months or are clojure.test and midje still state of the art?
06:58carlosgaldinowhat's the most idiomatic way of defining a new "type" like scala's Option, for example, which resembles the maybe monad? using deftype?
07:00llasramI think that question is like "what's the most straightforward way for me to travel faster than the speed of light" :-)
07:01llasramIn idiomatic Clojure, you'd just leverage the fact that any reference can be `nil`, and use `nil` when you need None
07:02carlosgaldinollasram: I know
07:02llasramOr if you really actually wand the maybe monad, algos.monads (and all the other monad libraries) have implementations
07:03carlosgaldinollasram: but I need to define the Option type, or at least something that behaves just like it. not for real code. and I get it all the dynamic aspect of clojure not needing a type where you can just use `nil`
07:04llasramcarlosgaldino: Ok. In that case, `deftype` is probably the way to do
07:04llasramer, way to *go*
07:04carlosgaldinollasram: ok, thanks. gonna give it a try
07:06winkMonad for Nothing and the types for free
07:09tomjack(defn box [val] (reify clojure.lang.IDeref (deref [_] val)))
07:09tomjackthat's from core.async
07:09tomjackI'm not sure though, is it used like Maybe there?
07:10tomjackI remember being confused about its purpose, and I don't understand channels.clj anymore
07:11maris`(if (Boolean. "false") :LOL :false)
07:11clgvtomjack: I'd call it a conversion to a reference
07:11clgv,(if (boolean (Boolean. "false")) :LOL :false)
07:11clojurebot:false
07:13clgv,(if (Boolean/valueOf "false") :LOL :false)
07:13clojurebot:false
07:13clgvmaris`: ^^
07:15tomjackI think it's used to distinguish "just nothing" from "nothing just yet"
07:16clgvtomjack: for that you'd need to implement clojure.lang.IPending
07:16clgvtomjack: IDeref just stands for a reference and access that might block
07:17tomjackI'm more interested in this particular use than the general conventions for IDeref
07:17tomjackin this case, as you can see, it will never block :)
07:17clgvah ok.
07:17clojurebotPardon?
07:19clgvtomjack: in channels.clj it seems that `box` is used to have return something dereferencable in every case
07:20clgvtomjack: so I suppose the cases where `box` is not used return IDeref instances as well
07:20tomjackI think the only non-box return value is nil
07:20tomjackwhich is what makes think it's a poor (rich?) man's Maybe
07:21clgvhumm maybe ;)
07:23clgvtomjack: that source could use some more comments ...
07:30tomjackhttps://www.refheap.com/961b02b5d230c1757ce5476e8
07:31clgvtomjack: you could use #(get-in % [0 0 1]) instead of (comp first first second)
07:31clgvtomjack: whats your general question about that snippet?
07:32tomjackgenerally.. how could it be better? :)
07:32tomjack(comp first first second) etc was probably the most bothersome to me
07:33tomjack#(get-in % [0 0 1]) seems just as inscrutable
07:33llasramtomjack: I think you could split this into smaller more general parts. If you had a function which just did a sorting merge of some number of other sequences
07:33tomjackI feel some temptation to try making a new seq type, or maybe use maps
07:34clgvtomjack: well then destructuring...
07:34tomjackoh, hmm
07:34llasramThen I think this function would be (-> sort-merge partition-by map)
07:34clgvyes, splitting up into smaller functions is often worth the effort
07:35tomjackmerge means like concat, but sorted?
07:36llasramtomjack: Yeah. Concat-interweave-sorted. That function isn't trivial, but isolates that responsibility in a way which lets existing standard library functions do the remaining work
07:37tomjacknot obvious to me that that would work
07:37tomjackI think if there are no simultaneous occurrences in each input, it could, maybe?
07:38llasramOh, I must have missed something about what your function does
07:38tomjackI hadn't tested simultaneous occurrences, they are troublesome :(
07:40llasramSo what' this actually doing semantically?
07:40tomjackit returns a seq of [time value] entries, with one entry per distinct time in any input (ignoring simultaneous occurrences where I have no clue really what the right output is..), where the value is (f a b ...) where e.g. a is the most recent value observed for a at that time, or nil
07:41llasramHmm
07:41crocketDoes clojure apply the concept of module or package version to a group of codes?
07:42crocketOSGi does, and it's helpful.
07:42sm0kecrocket: you can use osgi with clojure then
07:42llasramtomjack: An interesting problem, but unfortunately it's time for my run, so I must -- run
07:43llasramCurious to see where you get though!
07:43tomjackthanks, I need to sleep so I must sleep, probably :(
07:43crocketsm0ke, The problem is that OSGi fucks with clojure classloaders.
07:44sm0keugh.. i didnt know they were so close
07:45sm0ke'clojure classloaders' its kind of oxymoron give clojure doesnt embrace objects
07:46crocketClojure needs its own versioning and modularity solutions.
07:46crocketClojure runs on web browsers, JVM, and CLR.
07:47sm0kei dont think that can happen..i may be wrong..something like runtime dependency isolation has to be done on platform level
07:48crocketsm0ke, scala has scala components.
07:48crocketjavascript has CommonJS and RequireJS that deal with modularity.
07:49crocketjava has OSGi
07:49crocketclojure?
07:49clojurebotclojure is a very attractive hammer with a nice heft to it
07:49sm0keoh what is that? scala components?
07:54crocketIs clojure so superior that it doesn't need any external modularity solution?
08:04crocketDoes clojure obviate OSGi?
08:12sm0keto be honest no one has found a silver bullet for modularity..osgi is still now seamless to use in you java systems.. it requires a lot of manual work to use osgi in a project where most of the dependencies are not osgi packages themselves..secondly who the f**l cares about modularity on browser ..lastly there are projects trying to integrate clojure and osgi (havent tried myself).. If you have the need why dont you go ahead and create one 'modularity soluti
08:13sm0keugh..weird typos
08:14sm0kehave a good one..g2g
08:15ddellacostacrocket: can you give me a use case where you think it is missing in clojure? I have to admit I'm a bit confused what you mean.
08:16crocketddellacosta, I don't know about clojure yet, but I guess it can't handle multiple versions of a library on a JVM.
08:18ddellacostacrocket: hmm, I saw something about that recently…where was it.
08:19noncomwhat is the quick way to transform a value in true or false if it is not nil and nil respectively?
08:19crocketddellacosta, eclipse chose OSGi as its module system, and eclipse has made OSGi the most advanced modularity system.
08:20noncomlike (f 1) => true or (f nil) => false or (f 'k) => true and so on...
08:20ddellacostanoncom: boolean?
08:20ddellacosta&(boolean 1)
08:20lazybot⇒ true
08:20ddellacosta&(boolean nil)
08:20lazybot⇒ false
08:20noncom,(boolean nil)
08:20noncom,(boolean {:a 1})
08:20clojureboteval service is offline
08:20noncomumm..
08:20clojureboteval service is offline
08:21ddellacostacrocket: I will have to read up on it. I guess I don't know enough what problems it is solving to answer your question w/r/t Clojure
08:21noncom&(boolean {:a 1})
08:21lazybot⇒ true
08:21noncomcool, thanks!
08:21noncomwhat's up woth clojurebot?
08:21ddellacostacrocket: I haven't needed, to use your example, to set up multiple libs at once (but I can see the potential value)
08:21ddellacostanoncom: dunno
08:23crocketddellacosta, A depends on B and C. B depends on D 1.0, and C depends on D 2.0.
08:23crocketWhat will happen in clojure?
08:23crocketkaboom!!
08:23ddellacostacrocket: generally, to handle that first I'll run leiningen with deps :tree and check stuff out
08:24ddellacostacrocket: I haven't found it to be a huge problem in practice
08:25ddellacostacrocket: there's this too, if you're interested: https://github.com/aav/clojure.osgi
08:26ddellacostasomeone forked it pretty recently and tweaked it: https://groups.google.com/forum/#!searchin/clojure/osgi/clojure/Q1S5-bTH5cE/CTOZqu8fn-MJ
08:27crocketddellacosta, Do you mean there is no problem?
08:28ddellacostacrocket: no, I'm not saying that. I'm just saying that, for me, up until now, it hasn't been a problem. It is entirely possible it is a problem, depending on your use-case. In fact, it must have been *someone's* problem as they wrote a library for it, and other people's problem too as they forked it.
08:28ddellacostacrocket: I'm just making conversation, and trying to learn. ;-)
08:28crocketddellacosta, If A depends on D 1.0 and D 2.0, does clojure have any problem?
08:28ddellacostaquite seriously, I'm pretty ignorant of OSGI and the problems it solves, so I was curious about it when you brought it up. I'm not trying to make a case for Clojure one way or the other, just stating my experiences up until now.
08:29ddellacostacrocket: I've found that, if I have two libraries, and one references an older version of the other library I'm using, I can figure it out by looking at lein deps :tree
08:30ddellacostacrocket: I used to use lein pedantic, which was really nice
08:30ddellacostathink there may be some recent updates to lein which fixes it
08:30ddellacostaer, adds similar functionality
08:32ddellacostaif technomancy was on here he could give you a much better answer to your question, I'm sure.
08:32ddellacostaanyways, gotta go--cheers!
08:53crocketok
08:53crockettechnomancy, hey
08:53crockettechnomancy, How does clojure deal with modularity as OSGi does?
09:30clgvcrocket: namespaces. clojure libs are packaged in jars which allow to use their namespaces when added to the classpath
09:31cleos_freyHey guys, any advice on how to write a language parser? Always something I've been interested in, just don't know where to start
09:31cleos_freyI was thinking of starting with something simple to parse Mustache templates
09:33hyPiRioncleos_frey: Play around with instaparse
09:33uruvielcleos_frey: https://github.com/Engelberg/instaparse
09:33uruvielcleos_frey: although for mustasche you can probably do regexes
09:34uruvielcleos_frey: it's what does js libraries do anyway :p
09:35cleos_freycool thanks, reading the README now
09:38crocketclgv: even java has packages
09:38crocketclojure needs something better than java.
09:39crocketOSGi is the most advanced module system on earth
09:39crocketclojure should take note of it
09:39clgvcrocket: clojures namespaces are the replacements for java packages.
09:40crocketclgv: Does it associate namespace with versions.
09:40clgvcrocket: you can use clojure with OSGi it was recently discussed on the mailing list
09:41crocketclgv: can you refer me to the link.
09:41clgvcrocket: no. namespaces are provided by libs and you depend on the libs in a certain specified version (Leiningen's project.clj)
09:41crocketclgv, even maven can do that.
09:41clgvcrocket: sorry I do not have it ready, but search for osgi and laurent petit (he was involved in the discussion)
09:42clgvcrocket: no one said that clojure was better on that front ;)
09:42clgvcrocket: I'd say leiningen is a much easier to use substitute for maven
09:43pandeirois there a way to get nrepl.el to do eldoc-like behavior inside a clojure source buffer?
09:44si14jonasen: regarding that schema bug tomorrow: how did you managed to reproduce it?
09:45crocketclgv: what happens if A depends on B and C, and B depends on D 1.0, and C depends on D 2.0?
09:45clgvcrocket: armageddon if they are incompatible.
09:46crocketclgv: OSGi lets D 1.0 and 2.0 coexist.
09:47clgvcrocket: yeah, if you need that behavior you should be able to use OSGi and Clojure according to the ML posts...
09:47crocketclgv: that happens a lot
09:47hyPiRioncrocket: What happens if A depends on B and C, B depends on D 1.0 and C depends on D 2.0, where D contains internal state needed to be shared between B and C?
09:48clgvhyPiRion: armageddon as well ;)
09:48Pupnik_hire assassins to murder the people that wrote those libraries
09:48crockethyPiRion: don't know
09:48clgvhyPiRion: they'll wish that they had used clojure maps as data ;)
09:49hyPiRionNot worked with OSGi, but there should be an option to specify whether you'd like to have stuff coexist or switch dependency
09:49clgvPupnik_: but only the one who wrote and released A ;)
09:49hyPiRioneither way internal state is bad :p
09:52coventry2crocket: I really don't have a good feel for the kinds of problems OSGI is trying to solve. The example you give of different libraries depending on different versions of a package sounds quite nerve wracking. That said, I think metaverse is meant to be a step in the direction you're talking about. I think it's still really at the proof-of-concept stage, though. https://github.com/technomancy/metaversea
09:52coventry2Err, https://github.com/technomancy/metaverse
09:53clgvcoventry2, crocket: classlojure might help as well in certain specific scenarios
09:55crocketclassloser
09:55coventry2pandeiro: M-X nrepl-turn-on-eldoc-mode. Needs an nrepl connection to work, of course.
09:57pandeirocoventry2: thanks, somehow i missed that in the nrepl-* list
09:57crockethell
10:03mulosiculciao
10:03mulosicul!list
10:07cleos_freywhat's everyone working on? Trying to think of a clojure project
10:08cleos_freyI built a simple api for a service I use, but I'm trying to think of another project to practice my clojure'ing
10:23Pupnik_make a game engine
10:23Pupnik_there are currently: 0
10:25cleos_freylol
10:26winkI'd say http://stevelosh.com/blog/2012/07/caves-of-clojure-01/ counts as game engine. *points to sjl*
10:26cleos_freywith processing through quil?
10:26cleos_freywink: haha cool post
10:27Pupnik_good lord, theres a book about how to play dwarf fortress
10:31hyPiRionPupnik_: of course. It's not exactly the simplest game out there
10:32Pupnik_i know, ive made a mod for it
10:32Pupnik_I still don't know what you would write to fill a book
10:32Pupnik_stories i guess
10:38strangeworksexit
10:43Zarielis there a nicer way to do this? https://gist.github.com/Zariel/7008302
10:43Zarieli basically just need the key to be passed to the mapping function along with the value
10:45hyPiRionZariel: (defn kvmap [f m] (reduce-kv (fn [m k v] (assoc m k (f k v))) {} m))
10:46Zarieldoesnt look much nicer
10:46Zarielbut it is shorter
10:46hyPiRionnot sure you can get it better than that
10:46chronnoZariel: and it avoids using flatten
10:47Zarielif there is reduce-kv why does there not exist map-kv ?
10:51fredyr,(seq {:a :1 :b :2})
10:51clojurebot([:a :1] [:b :2])
10:51fredyryou can use map + seq for that
10:51Zarielexplain?
10:51mdrogalisreduce-kv. Never knew that was there.
10:52fredyri thought you meant you want to map over all key/value pairs?
10:52Zarieli want to do soemthing like
10:52Zarielmap[key] = func(key, map[key])
10:53jcromartie_phew
10:53mdrogalisZariel: Can you give an example of a concrete input and output that you want?
10:55Zarielhere, https://gist.github.com/Zariel/7008302/#comment-930499
10:58mdrogalis,(reduce-kv (λ [all k v] (assoc all k (str v "/" k))) {} {"host" "http://localhost&quot;})
10:58clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ? in this context, compiling:(NO_SOURCE_PATH:0:0)>
10:58mdrogalis,(reduce-kv (fn [all k v] (assoc all k (str v "/" k))) {} {"host" "http://localhost&quot;})
10:58clojurebot{"host" "http://localhost/host&quot;}
10:59mdrogalisI, too, use lambdas where fns once were. D:
11:00Zarielmdrogalis: :)
11:05fredyrhere's my attempt anyway
11:05fredyrhttps://gist.github.com/fredyr/7008646
11:06fredyrgot a seq to many, i see now tho
11:24muhooit'd be really cool if there were a way in nrepl.el's clj-stacktrace output to hit RET on a line and go to that line in the source
11:25muhoo*nrepl-error* is nicely colorized, but manually digging around in a large project for that source file and line is getting really tedious
11:33muhooalso, isn't reduce-kv just sugar for not having to do (fn [all [k v]] ...) destructuring on a map?
11:33TEttingermuhoo, I think it has more utility when using existing functions
11:33TEttingerrather than lambdas
11:34muhoomakes sense, the shape of it is similar to assoc then
11:34TEttingerthough I can't think of many existing clojure.core functions that take [all k v]
11:39llasramassoc?
12:13gfredericksis there a map literal that will OOM at read-time due to pathological hash collisions?
12:16justin_smithwebapp folks: given I want to have varnish and nginx in front of my clojure webapp, what would be the gotchas to running lein ring instead of uploading a war to tomcat?
12:17justin_smithit could potentially simplify our deployment to do things that way, so I am tempted
12:20arrdemgfredericks: php is the only language where I've seen an attack like that
12:21arrdemgfredericks: but I'm sure there exists one
12:21gfredericksarrdem: I thought there was one in ruby recently that caused them to add process-level-randomness to the hash function
12:22arrdemgfredericks: that would not surprise me. the last I've heard on this subject was the PHP pathalogical collision DDOS attack about 6 months ago
12:23arrdemgfredericks: yeah that ruby change was back in '11
12:25justin_smithhttp://stackoverflow.com/questions/8669946/application-vulnerability-due-to-non-random-hash-functions relevent SO on security of java hash
12:27justin_smithpragmatically one approach could be to make the post parameters an array of pairs rather than a map, and filter for the ones you actually use before constructing a map
12:27hiredman /win 15
12:27justin_smith(usually this is a web app exploit)
12:28Wild_Cat`I thought DDOS attacks on hashmaps exploited time complexity rather than memory?
12:29Wild_Cat`(as in, force the maps to degenerate into linked lists)
12:29arrdemWild_Cat`: lookup time complexity yes, and typically memory at the same time.
12:29Yiamhello
12:30Yiamis it possible to use custom cell renderer with tables in seesaw?
12:33tcrawleydoes anyone know if there is already a clojure wrapper around java.nio.file.*?
12:35arrdemtcrawley: someone was kicking around Raynes fs wrapper a few days ago, dunno if it helps tho.
12:36tcrawleyarrdem: thanks. I think that just uses commons-io. I need to use java.nio.file.Files, since it can copy and preserve permissions
12:36pandeiroany cljs/emacs people know if clojurescript-mode treats #() fn syntax correctly? (ie, paredit doesn't force a space between the # and ( )
12:36tcrawleyI can use it directly, of course. but it would be nice if some of the javaness was hidden
12:37technomancypandeiro: I don't know much about cljs, but afaik clojurescript-mode is deprecated
12:38pandeirotechnomancy: thanks, what is recommended?
12:38pandeiroclojure-mode?
12:38clojurebotclojure-mode is an Emacs mode for Clojure, found at git://github.com/jochu/clojure-mode.git
12:38dnolenpandeiro: clojure-mode works fine
12:40gfredericksevery time I use cheshire to parse json: A) (json/parse-string s) B) debug strange nil errors for 15 minutes C) (json/parse-string s true)
12:41holohi
12:42technomancyheh; jochu's repo.
12:43arrdemis there a "best practice" for structuring a protocol and several implementing records? throwing them all linearly in a single file just feels... wrong.
12:43holo,(re-seq (re-pattern "[\b]") "\b")
12:43clojurebot("\b")
12:44holo,(re-seq #"[\b]" "\b")
12:44clojurebot#<SecurityException java.lang.SecurityException: denied>
12:44holosupposed to output:
12:44holo[\b]
12:44holo ^ java.util.regex.Pattern.error
12:45gfredericksholo: what's that supposed to mean? \b is not a character class
12:45gfredericks,"\b"
12:45clojurebot"\b"
12:45gfredericks,(int (first "\b"))
12:45clojurebot8
12:46arrdem,(map int "\b")
12:46clojurebot(8)
12:48gfredericks,(re-seq #"[\u008x]" "\b")
12:48clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class java.util.regex.PatternSyntaxException>
12:48gfredericks&(re-seq #"[\u008x]" "\b")
12:48lazybotjava.util.regex.PatternSyntaxException: Illegal Unicode escape sequence near index 6[\u008x] ^
12:48hologfredericks, i expected a consistent behaviour. error on none or all. i don't know much of the theory behind it
12:49hiredmanclojurebot: weirdo
12:49clojurebotNo entiendo
12:49justin_smith,(count "\b")
12:49clojurebot1
12:50gfredericksholo: \b is special for regexes, signifying word boundary
12:50gfredericksnot sure how to match a "\b" character
12:50hologfredericks, re-pattern does
12:50gfredericksooh I didn't see you were pointing out a difference
12:50gfredericksso that makes sense to me actually
12:51pandeirotechnomancy: what's the recommended way to kill a lein repl :headless instance?
12:51gfredericks,(re-seq (re-pattern "[\\b]") "\b")
12:51clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class java.util.regex.PatternSyntaxException>
12:51gfredericksholo: ^ there's the equivalent error with re-pattern
12:51gfredericksthe difference is regarding what the string looks like at the time it gets parsed into a regex
12:51justin_smith,(re-matches (re-pattern "\\\b") "\b")
12:52clojurebot"\b"
12:52dnolenarrdem: put your protocols in a separate namespace
12:52gfredericksin your re-pattern version, there's an actual bell character in the string. in the #"" version, there's a backslash and a b
12:52Yiamhelo?
12:53Yiamhow can i make my flow-panel in seesaw vertical scrollable only?
12:53arrdemdnolen: hum... ok, thanks.
12:54Yiamwhen i'm just invoking scrollable at it, it just scrolls horizontally and items are just in line
12:54dnolenarrdem: I'm also starting to be of the mind that deftypes should be defined eslewhere and where you export your api you provide constructor fns.
12:55dnolenarrdem: I've gotten into some trouble mixing convenience ctor fns in same file as deftypes - creates interdependencies that are best avoided IMO
12:55justin_smithYiam: I think the swing docs plus seesaw source would be the best lead for that, I have used seesaw but not in that kind of depth yet
12:55arrdemdnolen: is there a defrecord option to kill off ->Foo?
12:56dnolenarrdem: there isn't, I actually think the automatically generated ctors fns were a whopping bad idea, I never use them.
12:56arrdemnever mind, that's silly.
12:56gfredericks&(re-seq #"[\\b]" "\b")
12:56lazybot⇒ nil
12:56arrdemdnolen: some days agreed.
12:56arrdemdnolen: thanks for the feedback.
12:56hologfredericks, what makes you say there's a bell character in one, but \ and b in the other?
12:56gfredericksdnolen: I'm curious why -- I thought it was useful to use vars by default, for aspect-oriented purposes
12:57hologfredericks, for me they are composed the exact same way
12:57dnolengfredericks: just the modularity problem, assumes the ctors and deftypes need to live in the same place.
12:57gfredericksholo: in one the conversion from string to regex happens at read-time, in the other at runtime
12:57gfredericksdnolen: same "place" meaning same namespace?
12:57dnolengfredericks: yes
12:57gfrederickshmm
12:58justin_smithholo: you can see by what they match
12:58hologfredericks, you rock too much
12:58justin_smith(re-pattern "\\\b") matched "\b", it has a bell in it
12:59gfredericksjustin_smith: oh that's why that worked
13:01justin_smithyeah, it seems the regex reader is less expressibe than the string reader
13:01justin_smith*expressive
13:03bosiehow would i require this http://www.versioneye.com/clojure/webmine:webmine/0.1.1
13:03bordatouecould anyone please help me to add bgcolor to <tr> element using hiccup html fn, I would like to create a table with alternate color for each row .
13:05arrdembosie: https://clojars.org/webmine is the same library... note that it's clojure 1.2 based.
13:06justin_smithbosie: based on the pom.xml snippet I would say [webmine/webmine "0.1.1"]
13:06justin_smithit is [groupId/artifactId "version"] in general with lein
13:07bosieok
13:07arrdembosie: I would question whether this is really the library you want to use... it's quite old by Clojure standards.
13:08bosiearrdem: i looked at enlive but cant make any sense out of it
13:09arrdembosie: are you trying to do .. parsing? generation?
13:09cdombroskibordatoue: wouldn't that just be [:tr {:style "background-color=blue"} [:td content]]?
13:09arrdembosie: enlive is a CSS _generation_ toolkit. this is a feed _parsing_ toolkit.
13:09bosiearrdem: i am trying to parse html files and extract links
13:09Creapbordatoue: it would be way easier to use css. tr:nth-child(odd)
13:09bosiearrdem: yes but enlive should be able to parse and select too... no?
13:10arrdembosie: it looks like it can..
13:10dnolenarrdem: not CSS, HTML really
13:10arrdembosie: clj-tagsoup and clj-http is the library pair that I default to for this sort of job.
13:10bordatouecdombroski: Creap , is there any documents on how to apply style in hiccup
13:10arrdemdnolen: ok. I haven't worked with enlive yet.
13:11bosiearrdem: i got clj-tagsoup running and it parses everything just fine
13:11bosiearrdem: the selection though is odd
13:11justin_smithbosie: I use enlive for that - what I ended up doing was just using enlive to parse, then doing all the modifications with standard clojure datastructure ops, then using enlive to do the reverse conversion again
13:11bordatouecdombroski: i tried {bgcolor: blue} but it didn't work
13:11arrdembosie: are you looking for selection by ID, class and soforth?
13:12arrdembosie: because that's probably gonna be an enlive job. that'll be.. awkward with clj-tagsoup
13:12arrdemfor awkward defined as "you'll have to build it".
13:12justin_smithbosie (-> (java.net.URL. enlive/html-resource
13:12justin_smitherr
13:13s4muelbosie: Have a look at laser. https://github.com/Raynes/laser/blob/master/docs/guide.md
13:13justin_smithbosie (-> (java.net.URL. "http://example.com&quot;) enlive/html-resource (data ops go here) enlive/emit* #(apply str %))
13:13bosiearrdem: or just extract all links and let me filter it based on the actual link
13:15arrdembosie: my approach would be to use those two to build the syntax tree, then write a little traversal that generates a sequence of a [:a ] groups
13:15arrdembosie: then you can just (filter) that sequence.
13:17bosiehm
13:20justin_smithrepeating a question I asked earlier, since it has been a while: would it be crazy to use lein-ring + nginx + varnish instead of tomcat + nginx + varnish in production?
13:21technomancyjustin_smith: not totally crazy, but I'd recommend an uberjar+jetty over lein-ring
13:22arrdemjustin_smith: I ran my blog that way for a while... it benchmarked quite favorably against a buddy's raw apache server when we did a "who's blog is faster" one night but I have no idea how well it'll scale.
13:22arrdemjustin_smith: the uberjar+jetty approach seems the more "production ready" one.
13:24justin_smithpragmatically: a coworker wants the nginx / varnish config in git - so that means we add two more deploy targets, or we could just put the whole repo up there
13:24technomancyusing leiningen in production is really hard to do right
13:25arrdemtechnomancy: what does uberjar+jetty buy you?
13:25technomancyI mean, there are lots of subtle ways to screw it up
13:25technomancyarrdem: dependencies are fixed at deploy time; there's no chance of anything new sneaking in and getting an inconsistent state across the cluster
13:25technomancyplus you can't accidentally pull in dev profiles
13:26justin_smithOK, thanks
13:26justin_smithyeah, that does make sense
13:27arrdemtechnomancy: given how much stuff I have in my .lein/profile that's probably valuable...
13:27justin_smithI'll just use fabric and make the uberwar, the nginx config, and the varnish config into three seperate deploy targets in jenkins
13:28justin_smithunless there is a good clojure replacement for fabric
13:31warpydark_element: hi
13:34warpydnolen: hey, i made a small game in clojurescript and core.async in flow based programming style. demo at http://abhinavsarkar.net/frpong/ and code at https://github.com/abhin4v/frpong/
13:36Pupnik_warpy: have you tested it on firefox? it is non-responsive for me
13:36arrdemPupnik_: I can confirm
13:36warpyPupnik_: oh no, i didnt. i just made it run on chrome
13:36arrdemwarpy: [11:59:26.950] TypeError: a is undefined @ http://abhinavsarkar.net/frpong/js/frpong.js:293
13:37dnolenwarpy: nice, why didn't you just use the fns provided by core.async itself?
13:37dnoleni.e. the stuff in signals
13:37warpyuh, i dont want to fix it for firefox right now. maybe i should put up a disclaimer on the page.
13:37warpydnolen: because i wanted it to read as a dsl for signals
13:38warpyi wrapper the core.async functions and macros in my own with more suitable names
13:38dnolenwarpy: so it's just different names not different functionality?
13:38warpyya
13:38dnolenwarpy: k, don't see the point though.
13:39warpyi feel it is easier to understand
13:40warpyi had to write some functions to sample channels etc
13:41warpysample, sustain etc
13:41warpythat was quite interesting
13:43warpydnolen: so would you call this flow based programming or functional reactive programming?
13:43dnolenwarpy: CSP is very closely related to dataflow programming, this has been know for a long time now as far as I know
13:44warpyi see
13:44dnolenwarpy: functional reactive programming provides similar functionality but at a little higher level, nearly all the original literature also refers to dataflow programming as far as I know.
13:45dnolenwarpy: but as you've probably discovered you can model FRP like things pretty easily with CSP yet easily drop down
13:45dnolenwarpy: not see easy in FRP if the implementation doesn't ship lower level primitives
13:45dnolen"not see easy" -> "not so easy"
13:46coventrygfredericks, arrdem: How can a hash collision attack hose the memory?
13:46arrdemcoventry: hosing access time is easy.. some hashtables do collision escaping by using nested hashtables, with a potentially large basic size.
13:47arrdemcoventry: this means that if you nest enough collisions you can force the creation of thousands of sparse hashtrees
13:47arrdemcoventry: repeat until you run out of RAM and swap :D
13:48coventryInteresting. Thanks.
13:48`cbpHi, I'm new to lein plugins. How can I use a plugin on project 'x' while being connected to a repl on the plugin. Specifically I guess I need a way to get a project map since that's what the "main" function of the plugin needs
13:50technomancy`cbp: that's not a thing you can do
13:51`cbpwell shucks
13:51technomancythat would be like asking a character in a book what he thought about the author
13:52coventryI'm pretty sure that's been done, but it's terribly narcissistic. :-)
13:52technomancy`cbp: sorry, do you mean a repl on the project or a repl into leiningen itself?
13:52`cbptechnomancy: I basically cloned a plugin repo, made some changes and wanna use the plugin with the changes on a project
13:53technomancy`cbp: oh, gotcha. you should be able to use `lein install`
13:53`cbptechnomancy: thanks
14:09pandeirorepeating my question above: is there any way provided by lein to kill a lein repl :headless process?
14:10technomancypandeiro: `echo "(System/exit 0)" | lein repl :connect` maybe?
14:10technomancynot sure that would work
14:10technomancylein update-in : conj :eval-in :nrepl -- run -m clojure.main/main -e "(System/exit 0)"
14:11justin_smithpandeiro: connect and send (System/exit 0) or send a kill via sh
14:12pandeirotechnomancy: justin_smith: cool that works, i will create a bash function or something
14:12justin_smithor what he said
14:12technomancypandeiro: which?
14:12pandeirotechnomancy: your first suggestion, like justin_smith's
14:12technomancyoh cool
14:13pandeiroproduces ugly output but that is fine
14:13pandeiro(it causes a SocketException...)
14:13technomancynever sure how stdin is going to behave with lein
14:14justin_smiththis totally worked here: echo '(System/exit 0)' | lein repl :connect 4014
14:14technomancyI think there's an open issue for the SocketException
14:14pandeiro`lein repl :disconnect 4014` would be nice sugar i think
14:15technomancyit's not disconnecting though
14:15justin_smiththe magic port number is the only drawback with that I guess
14:15pandeirotechnomancy: you're right... :stop ?
14:15coventrypandeiro, justin_smith: That's available in /project/path/.nrepl-port.
14:16technomancy`lein repl :stop` isn't a bad idea
14:17technomancywould take a pull req for that
14:18justin_smithcoventry: not for me, I start nrepl within my app
14:18justin_smithunless I create that file myself I guess
14:18justin_smithmaybe that wouldn't be a half bad idea actually
14:19maku_anyone know how to call a function from a string (the function name derived at runtime) in CLOJURESCRIPT? I tried (resolve (symbol x) to no avail...
14:20coventryjustin_smith: Should work for pandeiro's case though.
14:21pandeirocoventry: i couldn't find the .nrepl-port file...
14:21technomancypandeiro: target/repl-port on older versions
14:22justin_smithyeah, absolutely
14:23justin_smithand I am tempted to hack in the creation of that file myself, least-surprise for other devs and all
14:23justin_smithpandeiro: how are you starting the repl?
14:25pandeirojustin_smith: i start it from .xinit actually, specifying the port number, so it's not an issue
14:25pandeirofor me, in this case
14:28justin_smithmaybe providing the explicit port arg prevents creating the .nrepl-port file?
14:29dnolenmaku_: ((aget js/window "someName") ...)
14:30hiredmandnolen: assuming you haven't compiled in advanced mode
14:31jcromartie_how can I generate Swagger documentation from Compojure routes? I'm leaning towards an approach with side effects unfortunately
14:32jcromartie_I see https://github.com/narkisr/swag
14:32maku_dnolen: Thanks so much!
14:32bitemyappjcromartie_: why would you need "side effects"?
14:32bitemyappjcromartie_: can't you just gather the Compojure routes and generate the documentation?
14:33tbaldridgehiredman: I missed the original context, why won't david's code work in adv mode?
14:33bitemyappalso I'm glad to see there's a Clojure library for Swagger, pretty cool.
14:33jcromartie_routes are just functions after all, I suppose
14:33hiredmantbaldridge: because your function names won't exist
14:33jcromartie_I could just have decorator functions that attach metadata to them and collect up the operations into a resource
14:34tbaldridgeah, so this is something the user has added to js/window I assume
14:34hiredmanfoo.bar/fobnabricator will be f
14:34hiredmanno, he wants to lookup a function by name at runtime
14:35tbaldridgeright, that was the context I was missing, thanks
14:35jcromartie_but Compojure routes are pretty opaque, there's nothing like "rake routes" for a compojure app unless you do something quite fancy
14:35dnolenmaku_: as hiredman says, that only works for JS outside the advanced compilation process, which is what I assumed you were asking about.
14:37glosolidamn friggin nrepl package got renamed ;/
14:37glosolifor emacs
14:37pandeiroi'm trying to compile a project with cljs 1934 that compiles fine with 1889 and it is failing with 'clojure.lang.ArityException: Wrong number of args (3) passed to: reader-types$indexing-push-back-reader'
14:38bitemyappglosoli: http://marmalade-repo.org/packages/nrepl it did?
14:38dnolenpandeiro: you have a stale tools.reader dependency, or some other lib is bringing in the wrong one.
14:38glosolibitemyapp: https://github.com/clojure-emacs/cider :)
14:38pandeirodnolen: thanks
14:39bitemyappglosoli: http://marmalade-repo.org/packages?q=cider Iuno.
14:40glosolibitemyapp: I believe marmalade isn't synced real time, is it :?
14:40bitemyappglosoli: marmalade is some manner of JS nonsense. I don't know how it works.
14:40technomancymarmalade is for stable releases
14:41technomancythe rename just happened today; hasn't been released yet
14:41bitemyappgithub 500'ing, can't see this cider repo. mfw.
14:41hiredman:(
14:41bitemyapptechnomancy: what precipitated it?
14:41technomancyI dunno
14:41bitemyappcan I pay for premium access to a github that doesn't break?
14:42hiredmanhere is to renaming projects instead of fixing architectural problems
14:42bitemyapp^^ what he said.
14:42technomancynie mój cyrk, nie moje małpy
14:43hiredmanfeh, right...
14:43glosolitechnomancy: polak ?
14:43glosolior what is it :?
14:43technomancyglosoli: yeah, polish I think
14:43bitemyappaye, it's polish.
14:43glosolinice huh
14:44technomancyI have some 1/8th polish blood but don't speak it beyond that phrase
14:44glosolilol
14:44technomancywhich is the best possible polish phrase
14:44glosolitechnomancy: iirc it's actually Russian phrase :D
14:44glosoliAt least that's how I heard it the first time
14:44bitemyappit's famous in the West for being a Polish phrase
14:44glosoliaaa
14:45glosolithen Polish it is :D
14:46pandeiroweird, i did `lein clean` and searched `lein deps :tree` for tools.reader and nothing else is bringing it in...
14:49scriptoranybody remember that project that was introduced regarding source code history tracking
14:49coventrycodeq?
14:49scriptoryep, that's it, thanks
14:52dnolenpandeiro: what version of tools.reader does is being depended on?
14:52ta479in counterclockwise's repl, does it support something like pressing up in a terminal to get the last commands entered?
14:53coventryWhy the rush to upgrade to the latest nrepl? Am I missing out on anything good?
14:53glosoliprobably not
14:55bitemyappreally? we're just going to rename everything from nrepl-* to cider-*?
14:55bitemyappoh oh, even better, some stuff is cider and some stuff is nrepl.
14:55bitemyappThis is going to be great.
14:56glosoliyeah..
14:59jcromartie_bleh, I think I have to give up on Swagger. It's obviously designed for someone else's notion of an HTTP API. I can hardly get over the nomenclature.
14:59jcromartie_at the top level is a "resource listing" which is a set of "APIs", which each have a set of "operations"
15:00jcromartie_I was with you up through the resource listing
15:00jcromartie_I think Swagger is brought to you by the same folks that think "REST" means "pretty URLs"
15:09cemerickta479: Ctrl-Up, last I knew
15:10ta479cemerick: I'm assuming that's cmd+up on mac and it doesn't work
15:10cemerickta479: no, Ctrl-Up, even on macs.
15:11cemerickI haven't used ccw in a little bit, so that might be wrong, but that's what it was for a long time.
15:12cemerickta479: also note that some newer rev of OS X Spaces conflicts; if that's the problem, you can either turn off spaces, or rebind the "previous" REPL command in eclipse's key config.
15:12ta479okay thanks, had to remove conflict with system shortcuts
15:12glosolita479: Mission COntrol went mad yes ? :D
15:13ta479cemerick: also do you know what the button on the top right of the REPL with hint "Repeat last evaluation each time editor sends changes" does
15:13ta479glosoli: yes
15:16cemerickta479: nope, haven't seen taht
15:30ta479CCW doesn't autocomplete java?
15:43pandeirodnolen: lein deps :tree shows cljs 1934 depending on 0.7.9 of tools.reader; when i explicitly include a tools.reader 0.7.9 dependency in my project, the cljs compiles, but otherwise not
15:44pandeiro...and lein deps :tree shows none of my other deps depending on tools.reader, so i have no idea what is conflicting
15:48jtoyif I want to make a function call like (myfunc :foo 2 :bar 3) and I have a string of "myfunc", how would I make the call?
15:49mdrogalisjtoy: Use a map and look it up.
15:49mdrogalis{"myfunc" myfunc}
15:49dnolenpandeiro: no idea, you're going to dig in some more - remove 0.7.8 from your .m2 directory, use lein repl to double check that the source of the offending tools.repl fn matches 0.7.9 etc
15:49mdrogalisYou can use apply to make a pretty clean transition. It's quite nice.
15:49jtoymdrogalis: I dont understand your example of use a map there
15:50xeqicemerick: should I have any concerns that piggieback and cljsbuild use different directories for their build directories?
15:50jtoyI think I need something like: ((read-string "myfunc") {:foo 2 :bar 3})
15:51mdrogalisjtoy: https://gist.github.com/MichaelDrogalis/7013173
15:51cemerickxeqi: don't think so; why would you?
15:51xeqicemerick: I haven't come up with a reason yet, just something I noticed
15:58amalloyjtoy: if you do it that way (and you'll need eval or resolve as well as read-string), users can run arbitrary code inside your application. mdrogalis is suggesting you build a map of string -> function for all functions you expect users to be allowed to call, and look them up that way
15:58rhg135hello, is anybody here experienced with complex formats in aleph?
15:58amalloy~anyone
15:58clojurebotJust 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 ..."
15:58amalloyand formats are really more of a gloss thing than an aleph thing
15:58rhg135for some reason the spec im using doesn't delimit messages
15:59rhg135ok gloss
15:59rhg135instead of being sane and putting a delimite they decide to just send it all undelimited
16:00rhg135makes it difficult to parse
16:01jtoyamalloy: all the code that wil be evaled is code that I choose
16:01amalloyin that case, choose to have something better than strings - for example, functions :P
16:02mdrogalisHah
16:04jtoyamalloy: im using strings because I run a bunch of tests and i store teh function name in a database
16:05amalloywell, you'll have to store them namespace-qualified, and then use either eval or resolve to look them up, as i said
16:05mdrogalisjtoy: It might be easier to go the other way around if you can
16:05ta479anyone using La Clojure know how to set the native path for REPL?
16:05mdrogalisYou can derive the name of a function as a string
16:06ta479the java.library.path
16:06jtoymdrogalis: how so? Im not following
16:08mdrogalis,(:name (meta #'inc))
16:08clojurebotinc
16:12rhg135the only way i see is to write a json parser (or glue the data.json one) to work on a channel of chars, but that seems worse than my existing solution with raw sockets
16:13hiredmanrhg135: just make an inputstream that reads chars from a channel
16:13rhg135how?
16:13clojurebotwith style and grace
16:13rhg135and?
16:14hiredmanI dunno what your confusion is there
16:14technomancyclojurebot: style and grace and inputstreams
16:14clojurebotI don't understand.
16:14hiredmanthere is a class InputStream, which can be adapted to be the input for just about any json library you want
16:15rhg135the cannel owuld produce one char at a timei cant map over it
16:15clojurebotTitim gan éirí ort.
16:15rhg135cchannel*
16:15hiredmanyou can implment an inputstream that produces characters read from a channel
16:16rhg135as in write from scratch but following an interface
16:16rhg135?
16:21llasramrhg135: You can use `proxy`. The only method you *need* to implement is the zero-argument `read` method, which returns the next byte to be read from the tream
16:21llasramstream even
16:22yedicore.async is def clojurescripts killer app
16:22rhg135ah ic now
16:23rhg135also id like to return utf-8 chars and this is for byte's
16:23rhg135is there a similar class
16:23yediitd be cool of cljsfiddle had a browsable interface
16:23scriptorbrowsable interface?
16:24dnolenyedi: you should let jonasen know
16:24scriptorif you could browse other people's fiddles?
16:24dnolenwhen he's around
16:24llasramrhg135: There's Reader is the same thing but for character streams instead of byte streams.
16:25rhg135thx
16:25llasramrhg135: But it may depend on the JSON library -- IIRC e.g. cheshire only supports InputStreams
16:25rhg135that sounds nice
16:25rhg135im using data.json
16:25llasramOh, cool -- those can use a Reader
16:26llasramSo yeah, you should be able to just implement the one method via `proxy`, and be good to go. The Reader single method is slightly more complicated (fill a char-array), but not by much
16:26rhg135it is sad how much complexity is inherited from java
16:27technomancyuuuuh streams vs readers is a really important ditinction
16:27technomancydistinction
16:27llasramHmm. I disagree. This is something which being on the JVM makes possible at all. Python or Ruby, sometimes you can fake in a file-like object, but it's fraught w/ difficulties
16:27rhg135thats true
16:28technomancyit's basically impossible to write nontrivial ruby programs that don't have encoding bugs
16:29rhg135ya in oython encoding is a pita
16:29rhg135even more so if you use python2
16:29llasramYeah. At Damballa the appliance team just squishes everything to "ASCII-8bit" and ignores it
16:29llasramAlso, "ASCII-8bit"
16:29cemerickxeqi: I can't recall if it was intentional, but them not sharing tmp dirs is a good thing, I think; minimizes (confusing) compiler artifact crosstalk
16:29technomancyllasram: it'll be fiiiiiine
16:29rhg135i'm a more 'forget it, im using utf-8'
16:30technomancyhttp://p.hagelb.org/mal.gif
16:30llasramheh
16:30hyPiRionthat's why we use UTF-16 in java
16:30rhg135it's mostly ascii compatible and if we ever add another language itll work
16:30llasramPoor Java, trying to be ahead of it's time...
16:31llasramUTF-16 characters and millisecond-resolution timestamps
16:31rhg135not optimized but will work
16:32pjstadigi was just this morning considering the idea of using (vector-of :byte ...) to represent ASCII strings in a more compact format
16:32pjstadigbonus: equality doesn't suck (c.f. byte arrays)
16:32bitemyapppjstadig: more compact?
16:32hyPiRionthan strings
16:33technomancyyou could steal jruby's string implementation, but they're mutable
16:33pjstadigbitemyapp: 8-bits per character instead of 16-bit
16:33hiredmanwhich is not a bad idea, because with vector-of you can get structural sharing
16:33bitemyapphyPiRion: than UTF-16 strings maybe
16:33hyPiRionbitemyapp: than java strings?
16:33bitemyappwhich are UTF-16
16:33llasramDoesn't Java 7+ use UTF-8 bytes internally under ASCII conditions?
16:33hyPiRionyeah, exactly
16:33bitemyappllasram: news to me
16:33pjstadigllasram: oh does it?
16:33pjstadigi thought it was UTF-16 everywhere
16:33llasramHmm, maybe I'm mistaken. Trying to find the reference
16:33technomancywhoa, really?
16:33bitemyappI typically default to utf-8, but I know I don't really have a choice in Java.
16:34rhg135hmm, it seems i can implement a reader or a stram but which is better/simpler/easier?
16:34technomancythat would be awesome if it worked
16:34technomancyseems like it would wreak havoc with JNI and stuff though
16:34hyPiRionhah, yeah
16:34danlarkinthe jvm is all utf16 afaik
16:34clojurebot'Sea, mhuise.
16:35technomancyat least dalvik uses utf-8 internally
16:35pjstadig~suddenly
16:35clojurebotBOT FIGHT!!!!!111
16:35bitemyapptechnomancy: apparently -Dfile.encoding=ISO646-US -Dsun.jnu.encoding=ISO646-US to produce UTF-8 is a thing.
16:35pjstadigwut
16:35technomancyclojurebot: forget the jvm
16:35clojurebotGabh mo leithscéal?
16:35pjstadig~suddenly
16:35clojurebotBOT FIGHT!!!!!111
16:35bitemyapptechnomancy: those ISO standards are ascii, but the JVM uses UTF-8 when asked to use ASCII.
16:35technomancyclojurebot: forget the jvm |is| all utf16 afaik
16:35clojurebotI forgot that the jvm is all utf16 afaik
16:35technomancybitemyapp: right, I'm thinking of internal representation
16:36bitemyapptechnomancy: that's -Dsun.jnu.encoding= I think.
16:36llasramOk, I was wrong
16:36bitemyappoh.
16:36technomancyoh, huh
16:36bitemyappgod dammit.
16:36llasramThere was a Java 6 version to use compressed strings which some page of esoteric Java options mentioned was enabled by default
16:36pjstadigstrings are a wrapper around a char array and chars are 16-bit
16:36llasramIt apparently caused problems and was disabled and deprecated
16:36pjstadighaha
16:36rhg135in an ideal world the json message would be \0 delimited and in edn but sigh
16:37llasramhttp://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7129417
16:37hyPiRionIn an ideal world you wouldn't have to do ./configure before make
16:38danlarkinI don't even understand this conversation
16:38danlarkinwhat am I doing here
16:38rhg135that too
16:38rhg135but this standard is so new that i should be able to bend it to my will
16:39rhg135whether i should is another question
16:40bitemyappdanlarkin: this is the land of Dayman
16:40bitemyappdanlarkin: who fights the nightman...dunnnnnnn
16:41arrdembitemyapp: except that the Sun and Day lost and left us to the tender care of the Oracle who dwells in darknes...
16:42bitemyapparrdem: new mouse is fantastic btw.
16:42bitemyapparrdem: Steelseries Sensei raw. Less hiccuping, more sensitive.
16:42arrdembitemyapp: cool!
16:43rhg135im still confused though, how can i get a channel of maps from a channel of json formatted strings from a channel of bytebuffers
16:43bitemyapprhg135: what's with the word channel?
16:43llasrambitemyapp: lamina/aleph
16:43rhg135thats the word aleph uses
16:44bitemyapp(-> payload (String. "utf-8") (parse-string))
16:44bitemyapprhg135: ^^
16:44rhg135but what if the bytes arent even enough for a string
16:45rhg135or not valid json
16:45indigorhg135: How goes the API
16:45rhg135bad
16:45bitemyappbytes aren't even enough for a string? then let it break.
16:45rhg135i would rewrite it if i was good at api design
16:45bitemyappthrow an exception.
16:45bitemyappreject the message, send back an error, whatever.
16:46rhg135i mean messages aren't delimited
16:46indigo:)
16:46arrdemindigo, bitemyapp: (trace-form (com.xtructure.graphs.misc/benchmark-hash (com.xtructure.graphs/make-bundle [:a :b :c] [[0 1 2]]) 50))
16:46arrdemshit.
16:46arrdemhttp://somethingofthatilk.com/?id=202
16:46rhg135in essense, i'd have to read a byte try to decode it and parse it and if that fails read another until i hit the max length
16:47llasramrhg135: If you can switch to cheshire, it actually has a function to read an otherwise-undelimited sequence of JSON objects from an InputStream
16:47bitemyapprhg135: haha, what?
16:47indigoarrdem: Haha, awesome
16:47bitemyapprhg135: messages aren't delimited? wtf
16:47rhg135ik
16:47llasramrhg135: So then you just need to translate your channel of bytes -> InputStream
16:47bitemyapprhg135: did Node.js devs "design" this protocol?
16:47indigorhg135: Are you sticking with JSON or what
16:47rhg135i tried to tell the other guys
16:47rhg135the other ppl aren't enlightened
16:48rhg135one even likes c
16:48llasramTo be fair, C is pretty awesome at what C is awesome at
16:48rhg135yup
16:48rhg135but its fragile as possible
16:49bitemyappnah there are more fragile things than C
16:49rhg135one slight mistake and it segfaults, or fails mysteriously
16:50bitemyapprhg135: valgrind helps a lot there.
16:50coventrySo does gdb.
16:50rhg135well json is an improvement over xml
16:51rhg135xmpp anybody? lol
16:52rhg135bitemyapp, and yes they do use node
16:52bitemyappknew it.
16:52rhg135i only found out after most of it was written
16:55winkI don't like xml either, but I see nothing wrong for xmpp
16:56rhg135yeah im just going to bend this to my will to show them why they should listen to rhg135
16:56winkjson has no comments, that really sucks
16:56winkat least as a config format
16:56rhg135ill use edn tho
16:57rhg135extensible as possible
16:59ta479I'm importing LWJGL and doing :import (org.lwjgl.opengl G11 G15 G20 G30) and each G11,G15.. class has a bunch of functions that don't conflict but it's hard to remember which function is where. How do I merge them all together or use all the function directly without doing G15/glBindBuffer, GL20/glVertexAttribPointer
17:00llasramta479: You could write a macro which reflected on the classes and defined functions for each static method. You'd need to write it though -- I'm not aware of anything off-the-shelf for doing that
17:00llasramBut it wouldn't be too complicated. See `clojure.reflect`
17:02ta479llasram: does that have a speed penalty
17:03coventryReflection would be done at compile time. I would expect the JIT to optimize the function calls away, but don't know for sure.
17:04llasramta479: It doesn't need to. (a) The JVM is very good at JITing away anything static like that. (b) You make the defined functions have `:inline` metadata, which essentially is a small macro to expand when the function is called in-place
17:04llasramOh, and what coventry said about the reflection in the first place
17:05yediwhat are magic keys?
17:05llasramThey unlock magic doors
17:06jtoywhy cant a pass a map object to this function? https://www.refheap.com/19878 and how do i change it so i can?
17:06rasmustojtoy: drop the &
17:06rasmustoor apply your function to a map
17:07rasmusto,(apply (fn [& {:keys [a b] :or {a 3}}] [a b]) {:b 2})
17:07clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: [:b 2]>
17:07jtoydropping the & just means the hash-map is required?
17:08rasmusto,(apply (fn [& {:keys [a b] :or {a 3 :b 4}}] [a b]) {:b 2})
17:08clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: [:b 2]>
17:08rhg135yes
17:08rasmusto,(apply (fn [& {:keys [a b] :or {a 3 b 4}}] [a b]) {:b 2})
17:08clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: [:b 2]>
17:09rasmustooh, maybe I'm wrong about the application thing
17:09rasmusto,(apply (fn [& {:keys [a b] :or {a 3 b 4}}] [a b]) (apply concat {:b 2}))
17:09clojurebot[3 2]
17:10rasmustoyeah, using the & means that you're expecting an even number of key-value pairs to be passed in to the function
17:11rasmustoso you'll have to pull them out of the map yourself and apply the function to the resulting collection
17:11jtoyrasmusto: but i do pass it in , im still not clear on why dropping & fixes it, but I will just use it
17:11rasmusto,((fn [{:keys [a b] :or {a 3 b 4}}] [a b]) {:b 2})
17:11clojurebot[3 2]
17:11ta479llasram: it's not possible to import all the functions of GLXX directly into the namespace so I could for ex: (glBindVertexArray 0) and not (GL30/glBindVertexArray 0)?
17:12jtoy,((fn [{:keys [a b] :or {a 3 b 4}}] [a b]) {})
17:12clojurebot[3 4]
17:12rasmustojtoy: the & implicitly turns everything after it into a seq, so you'd have to expand the map before its passed in
17:12rasmustoor else you get a seq with a map in it, and then the :keys destructuring doesn't work
17:13rasmustoI hope this is making sense, I've noodled around with it, but I'm far from an expert on the topic
17:13jtoyyes, appreciate it rasmusto
17:15coventry,((fn [& t] t) {:foo 'bar})
17:15clojurebot({:foo bar})
17:15Jarda,(:foo {:foo "bar"})
17:15clojurebot"bar"
17:15Jardacool
17:19coventry,((fn [& [{:keys [foo]}]] foo) {:foo 'bar})
17:19clojurebotbar
17:19pcarrier11:02:00 <glosoli> damn friggin nrepl package got renamed ;/
17:19pcarrier11:02:03 <glosoli> for emacs
17:19pcarrier^ anybody knows more?
17:20glosolipcarrier: Yeah, it got renamed and won't appear in melpa for some time.
17:20yedilol llasram i hate you
17:20glosoliWhen it does you will be required to rename your configs
17:20glosoli:)
17:20technomancyor just keep using the old package
17:20glosolitechnomancy: I tend to get fixes from time to time :)
17:20arrdemppft stability. why would you ever want that.
17:20coventryjtoy: The example I just sent to clojurebot answers your original question.
17:21pcarrierrenamed from->to?
17:21technomancypcarrier: https://github.com/clojure-emacs/nrepl.el/issues/375
17:22Jarda,((fn [{:keys [foo bar]}] (str foo bar)) {:foo "Foo", :bar "Bar"})
17:22clojurebot"FooBar"
17:22glosolito cider lol
17:22Jardahow many possible ways is there to destructure input..
17:22BobSchackyeps
17:22yedibut srsly, what are magic keys?
17:23yedithis post talks about em: http://teropa.info/blog/2013/10/14/euroclojure-2013-common-clojure-smells.html
17:23coventryJarda: http://clojure.org/special_forms#Special Forms--Binding Forms (Destructuring)
17:24Jardacoventry: I guess the answer to my question is "if it can be imagined, it can be destructured"
17:25gfredericksyedi: I think it just means making implicit assumptions about the shape of your data everywhere
17:25gfredericksrather than in some contained place, like a single namespace
17:25tbaldridgeI disagree with that part of the article.
17:25tbaldridgeWhat's better about foo.bar.baz in OOP vs (-> mp :foo :bar :baz) ?
17:26gfrederickstbaldridge: well if it's a static language then at least you have some auto-checks
17:26technomancytbaldridge: arguably foo.bar.baz is a law of demeter violation
17:26tbaldridgeit's the same problem that any dynamic language has, changing the name of a thing can cause problems....
17:27gfrederickswell compare ruby where you're using methods and you get a method not found error
17:27gfredericksvs clojure where you often don't distinguish between key-is-nil and key-is-wrong
17:27tbaldridgedon't store nil in a map, problem solved :-P
17:27gfrederickswell maybe not intentionally
17:27gfredericksthat doesn't make it impossible
17:28tbaldridgebut seriously, I rarely see this problem in day-to-day use.
17:28technomancydo you use preconditions everywhere?
17:28gfredericksand so when nil comes up I still don't off the bat know whether I got the key right or not
17:28tbaldridgetechnomancy: no, I just very rarely need to go and do a system wide rename of a keyword
17:29technomancyunexpected nil leakage is probably the main clojure-specific source of bugs IME
17:29gfrederickseven if you don't need to do a rename, just the possibility of typos with bizarre effects is significant
17:30technomancybecause it's so easy to put in a sensible default in the rare case where you want one
17:30gfrederickstechnomancy: yeah I wish that sometimes too
17:30tbaldridgetechnomancy: oh heck no, if that was in Clojure I'd fork it and change it back.
17:31rasmustocoventry: ah, thanks for the destructuring examples, I knew there was something funny about the apply + apply concat business I was messing with
17:31gfredericksprismatic has their safe-get, but there's no analog for (:foo m) style
17:31technomancybrehaut: add tha tto the list of historical mistakes you'd fix if you had a time machine after visiting Brendan Eich
17:31yedigfredericks tbaldridge technomancy: this issue goes away by leveraging core.typed right?
17:31brehautgfredericks: core.typed and hmaps!
17:31coventryrasmusto: No worries, I wouldn't have thought of that unless I'd seen the way you were playing with ith.
17:31tbaldridgethat's the one thing I hate about python, any get can throw an exception.
17:31technomancyyedi: yes, if you sink a lot of work into it
17:31gfrederickstbaldridge: do you often meaningfully have missing keys?
17:32technomancyfixing keywords would get you that for free across the board
17:32brehauttechnomancy: i've made a note
17:32tbaldridgegfredericks: not really. I guess most of the time I don't mis-spell keywordS? I really don't hit this issue very often at all.
17:32riley526tbaldridge: {}.get('nothing') returns None
17:32gfrederickstbaldridge: if you don't have meaningfully missing keys then when would the auto-throw feature bother you?
17:32riley526but yeah, {}['nothing'] does raise
17:33tbaldridgegfredericks: no, I mean that I don't often expect a key to be there that isn't. I do stuff like this all the time
17:33coventryriley526, tbaldridge: Unless you use a collections.default_dict or whatever it's called.
17:33tbaldridge, (or (:a {}) (:b {:b 42}))
17:33clojurebot42
17:33riley526defaultdict, yeah
17:35gfrederickstbaldridge: man why can't there be some perfect and obviously-so programming language. everything so damn subtle and tradeoffy
17:35coventryThat article mentions locally scoped atoms as a code smell. I don't see them often, but they don't seem that bad in and of themselves.
17:36gfrederickscoventry: that's funny I'd think of global atoms as more smelly
17:36technomancy(:a {} nil) ; <- that wasn't that hard now was it? =)
17:36tbaldridgetechnomancy: yep, and now I get to do (map #(:a % nil) maps) instead of (map :a maps)
17:37technomancywell yeah, the lack of rpartial is pretty annoying granted
17:37tbaldridgeReally, nil existing in clojure is critical to how succinct it is.
17:37technomancyand how easy it is for mistakes to go undetected
17:40gfrederickstechnomancy: rpartial would make that even longer
17:40tbaldridgeat the risk of sounding like a jerk, I'd have to say I see most of those issues as something that only inexperienced developers encounter. I can't remember the last time I had a bug related to a nil where I didn't want it.
17:40technomancygfredericks: I count tokens rather than characters
17:41gfredericks:)
17:42technomancythat's cool; just don't make mistakes and it'll be fine =)
17:42hiredmantbaldridge: I think it is kind of a style thing, if you do everythign as operations over collections, nil just sort of magically is handled as an empty collection
17:42tbaldridgelike most of programming, why don't we use types?
17:42technomancywe do?
17:43tbaldridge(inc hiredman)
17:43lazybot⇒ 26
17:43technomancyhiredman: that doesn't help when you're trying to get something *out* of a collection though
17:44hiredmantechnomancy: sure, I am just saying that style wise collection oriented code has less of those problems, so people who lean that way have less issues
17:45technomancyoh sure; elisp trained me to be OK with conflating nil and ()
17:45hiredmanI am making an observation, not endorsing or proclaiming a style has some kind of silver bullet
17:45technomancy«Tony Hoare introduced Null references in ALGOL W back in 1965 “simply because it was so easy to implement”, says Mr. Hoare. He talks about that decision considering it “my billion-dollar mistake”.»
17:45technomancywelp
17:46technomancythose are probably 1985 dollars too; wonder what that would be adjusted
17:46arrdemtechnomancy: not a large enough number
17:47technomancyarrdem: yeah, but we'll forgive him for underestimating because he's Tony freaking Hoare.
17:47hiredmanmccarthy's lisp paper was 1960, so of course, lisp had nil first
17:48marcopolo2can you inc random words?
17:48marcopolo2(inc lisp)
17:48lazybot⇒ 1
17:48marcopolo2haha
17:49arrdem$karma leiningen
17:49lazybotleiningen has karma 2.
17:49arrdem$karma lein
17:49lazybotlein has karma 1.
17:51hiredmanit being the '60s they spelled it NIL
17:52tbaldridgebut I agree with hiredman, it depends on how your language handles nils. If your language blows up anytime you get a non-existant key, you end up using try/catch everywhere and that just results in spaghetti code. Been there, done that, and I never want to go back .
17:52technomancyI agree that an Option type would be nicer
17:52technomancybut you don't need try/catch to avoid exceptions; just specify a default
17:53tbaldridgetechnomancy: that's just reifying the problem to something else. nil vs :unknown
17:53technomancyjust use nil as a not-found in the rare case you actually want it
17:54tbaldridgejust use :unknown in the rare case you actually want it
17:55tbaldridge:-P
17:55technomancysure, it doesn't matter; the point is to have the default be to catch errors earlier before they propagate down the call chain to somewhere it's impossible to trace to the root cause
17:56tbaldridgebut realize your assumption. get of a non-existant key is an error by your definition. I would assert that it is not.
17:56technomancyI understand that
18:00brehauttechnomancy: is this defaulting to safety a slippery slope to type checking and effectful programming?
18:00tbaldridge<--- thinks yes
18:01technomancybrehaut: what does "effectful" mean in this context?
18:01technomancypersistent data structures are defaulting to safety
18:01brehauttechnomancy: things like IO monads or similar: ways of staticly knowing when and where 'effects' happen
18:01bitemyappI'm a huge fan of GIGO. Python was one of those languages that blows up on non-existent keys (and properties. and methods.) and it was utterly unpleasant.
18:02dnolenI don't actually see how you can actually remove the problem of null given the existence of empty collections
18:02dnolenwhich functions should throw, which functions should return Option
18:02dnolen?
18:02bitemyappdnolen: maybe monads + pattern matching is the answer in Haskell.
18:02dnolenpeople complaining about null never seem to talk about this.
18:02bitemyappyou just special case the empty coll or require a return from the monad.
18:02dnolenbitemyapp: you can have an incomplete match that Haskell won't catch and still blow up.
18:03technomancydnolen: racket doesn't have any difficulty with it
18:03hiredmanobviously we need lens
18:03bitemyappdnolen: most certainly, just mentioning how they handle it.
18:03bitemyapphiredman: if Kmett's work starts infecting Clojure I will start a riot.
18:03bitemyapps/start/incite/g - lets use the right verbiage.
18:04dnolentechnomancy: perhaps, I haven't poked at enough to find bugs
18:04bitemyapp99% of the time, I want to perform a series of operations that will GIGO a nil or empty coll, and it either flies or it doesn't.
18:05technomancybitemyapp: I agree that GIGO is too deeply embedded in Clojure for anything else to be practical
18:05bitemyappdnolen: core.typed could be smarter than what Haskell offers though, in cases where an empty coll is statically guaranteed not to happen it can elide the case from the return type.
18:06bitemyappthat kind of smart elision isn't possible in ML/Haskell, or D-M in general
18:06bitemyapptechnomancy: I've seen you bring this up before, does it bother you that much?
18:06bitemyapptechnomancy: it seems like the sort of thing that could be readily solved with a wrapper monad.
18:07bitemyappYou associate stages of computation with error triggers and error types/messages, short-circuit and return if it triggers.
18:07technomancybitemyapp: I write like ~10 LOC of clojure a week these days, so no, not really
18:08crockettechnomancy, hi
18:08bitemyapptechnomancy: I guess my point is that even in cases where I would want static typing I'd still rather build on core.typed's more expressive type system alongside Clojure.
18:09bitemyapprather than OCaml/Haskell
18:09crocketbitemyapp, When do you want static typing?
18:09bitemyapptechnomancy: what is it that racket does that you like?
18:10bitemyappcrocket: not very often, but since I used Haskell before fully warming up to Clojure I'm comfortable "thinking in types"
18:10brehautcrocket: i want static types whenever i have data that is long lived within my application and has complex operations performed on it. i dont want it if my application code is mostly just marshalling between two edges
18:11technomancybitemyapp: just gave that as an example of a language without nil which has to trouble with empty collections, which dnolen seemed to imply was problematic
18:11bitemyappwhich for me can sometimes mean being able to think about a problem with lower conceptual "load", a more compact "working memory" representation.
18:11crockettechnomancy, Do you know how to write pluggable versioned modules in clojure as I do with OSGi?
18:11technomancycrocket: I don't know what that means really
18:11technomancywhat do you with OSGi?
18:11bitemyapptechnomancy: I'm not sure how true that is, (null? '()) => #t in Racket.
18:12crockettechnomancy, A depends on B and C, and B depends on D 1.0, and C depends on D 2.0.
18:12crocketHow does clojure take care of D 1.0 and 2.0?
18:12crocketIt happens a lot
18:12dnolentechnomancy: I actually don't see how it's not a problem in Racket, (car '()) throws an exception
18:12bitemyapp'() *is* the null type.
18:13bitemyappso I'm with dnolen, I don't see how it's not a problem. You still have to break it out, check for it, GIGO, or Monad it out.
18:13technomancycrocket: there's no good solution
18:13technomancyamong the bad solutions are 0) metaverse, which only works for namespaces and not java classes
18:14technomancy1) construct multiple classloaders and populate them with pomegranate
18:14technomancy2) upgrade B to work with the latest versions
18:14crockettechnomancy, What if B and C are out of my control? 2) doesn't work.
18:15bitemyapp2 can definitely work.
18:15technomancyyes, that's why it's listed under "bad solutions"
18:15bitemyappexclusions + monkeypatching hooooooooooo
18:15technomancy1) could probably be made easier with some tooling if someone had the time and inclination to come up with something fancy and reusable
18:15crockettechnomancy, OSGi solves that problem easily.
18:15technomancyok?
18:15bitemyappI'm not sure the word easy is appropriate here.
18:16coventryHow does OSGi solve the issue of needing distinct namespaces for the two versions?
18:16technomancyyou still have to define boundaries of different contexts and describe how objects are able to move between the two
18:16crocketcoventry, OSGi attaches version numbers to java packages.
18:16crocketIt has its own classloaders.
18:16crocketOSGi replaces java classloaders.
18:17hiredmannope
18:17crocketI can load D 1.0 and D 2.0 on OSGi easily.
18:17technomancyI've read the description to OSGi like three times and could still never figure out what exactly it was for
18:17arrdemvulns... vulns everywhere...
18:18bitemyapparrdem: hum?
18:18bitemyappcomponent model makes me shiver my bones after my experience with .NET
18:18coventrycrocket: Yeah, that can't work with clojure's architecture. You are going to need distinct namespaces, or some way of switching off functions in the single namespace depending on the version the caller is expecting. Both options are horrible.
18:19bitemyappJust fix the dependencies...
18:19bitemyapppain now is pain avoided forever again.
18:19crockethmm
18:19crocketbitemyapp, OSGi is not a pain.
18:20crocketI think OSGi is the most advanced module system on this planet.
18:20crocketeclipse chose OSGi and evolved it to that point.
18:20bitemyappcrocket: are you a buddy of chord?
18:21technomancycrocket: I implemented the ability to depend on multiple versions of a clojure namespace simultaneously in 2 hours in clojure; it's ridiculously easy to do
18:21technomancyexcept it doesn't work for Java classes =\
18:21crockettechnomancy, how?
18:21technomancyhttps://github.com/technomancy/metaverse <- seajure hack night project
18:21clojurebotCool story bro.
18:21crockettechnomancy, You said it was a bad solution.
18:21technomancyooh, sick burn
18:22technomancycrocket: because most incompatibilities are actually in Java classes
18:22bitemyappcrocket: what part of "hack night project" didn't you parse?
18:22technomancyisolating clojure namespaces on their own is not very helpful
18:23technomancybitemyapp: well to be fair I would have developed it further if it weren't for the insurmountable Java problems
18:23crockettechnomancy, I read metaverse documentation, and it seems I have to manually specify namespaces yet.
18:23technomancycrocket: yeah, it's a proof of concept
18:23coventrycrocket: I did what metaverse is trying to do for clojure.core and test-clojure. References to java classes make it is very intricate, and only about 75% of clojure's tests pass in the modified namespaces.
18:23crocketIf somebody implements a real module system on clojure!!!
18:24technomancycrocket: a pure-clojure solution just isn't very useful
18:24coventrycrocket: You should do it!
18:24arrdemcrocket: do it!
18:24crockettechnomancy, Clojure runs on web browsers, JVM, and CLR.
18:24crocketclojure-only solution may help in that situation.
18:25technomancywell don't let me stop you if you want to give it a shot =)
18:25coventryOnce we have the OSGi clone, we can run multiple starcraft games in a single clojure instance.
18:25crockethmm
18:25technomancyjust explaining my own motivation for abandoning the project
18:25crockettechnomancy, What do you think is a better solution?
18:25bitemyappcrocket: fix your dependencies
18:25technomancyin the short term: fixing the incompatible libraries is usually the easiest
18:26technomancyin the long term: a tool for constructing isolated classloaders for some kind of Kandor-style dependency subtree
18:27hiredmancrocket: the problem is, clojure, clojurescript, etc, lean heavily on the host, so a pure clojure module system that neglects the host is pretty much useless
18:28hiredmanyou can use clojure fine with a jvm modules system like jboss's, and people have used it with osgi, so there is the solution
18:28bitemyappcrocket: if you want classloader isolation with separate namespaces you can use Immutant.
18:28bitemyappImmutant in this case would basically be the interface between Clojure and JBoss.
18:29bitemyapphiredman: how promising is polycosm?
18:29bitemyappcrocket: https://github.com/hiredman/polycosm
18:30justin_smithI think you would need to reimpliment clojure's class loading to make it work with osgi
18:30crocketreally?
18:30crocketIs clojure.osgi working well?
18:30hiredmanif you really worry about that kind of thing what you should do is 1. relax and stop worrying about it 2. develop clojure services 3. deploy them to some kind of app server like jboss(or jboss+immutant) and let it worry about it
18:33hiredmanI don't particular care about osgi, so if clojure.osgi doesn't work, meh use some other jvm module system, there are plenty
18:34arrdemor is just a macro around if, IIRC?
18:34hiredmanif you are tied to osgi, then what is a "pure clojure" module system going to get you any way?
18:34coventry,(macroexpand '(or 1 2))
18:34clojurebot(let* [or__3943__auto__ 1] (if or__3943__auto__ or__3943__auto__ (clojure.core/or 2)))
18:35bitemyapparrdem: http://clojuredocs.org/clojure_core/clojure.core/or
18:36bitemyapparrdem: click "+ Source"
18:36bitemyapp,(source or)
18:36clojurebotSource not found\n
18:36bitemyapp...
18:36arrdem(inc clojurebot)
18:36lazybot⇒ 33
18:36bitemyappuseless.
18:36bitemyapp##(source or)
18:36lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
18:36bitemyappJ. F. C.
18:36arrdembitemyapp: pwnt.
18:36bitemyapparrdem: just look at the damn link
18:38coventryhiredman: So polycosm works because it's loading in a jar file, and the classloader lets it pull in a completely separate clojure ecosystem? If that's how it works, that is pretty cool.
18:47bitemyapparrdem: In case you're curious: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2551-L2697
18:48crockethiredman, What JVM module systems?
18:48hiredmanI happen to like jboss modules
18:50brainproxyexample of correct way to use :foreign-libs in context of cljbuild?
18:50bitemyappbrainproxy: https://github.com/emezeske/lein-cljsbuild/blob/master/sample.project.clj
18:50hiredmanmost "module" systems do the dependency thing, but really for clojure lein does the dependency thing, and you can just build an uberjar then you just need classloader isolation, which module systems will do, but even most webapp containers do classloader isolation
18:50brainproxybitemyapp: other than that one
18:50brainproxy:p
18:52brainproxyso I'm looking at this
18:52brainproxyhttp://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
18:53brainproxyand it's suggestive that a foreign-lib need not be setup with goog.provide
18:54bitemyappInnuendo Oriented Programming
18:55brainproxybut when I try it with such a lib, I'm getting a bunch of compiler errors as if the indicated foreign-lib was expected to be setup with the google closure stuff
18:55technomancyhiredman: how do you do classloader isolation within an uberjar though? by that point, the dependency tree has already been flattened; multiple copies of a class can't exist in one uberjar
18:56technomancyseems like you'd need two uberjars
18:56technomancyor N uberjars, whatever
18:56dnolenbrainproxy: GitHub search maybe your friend here, also the Luke Vanderhart blog post on this stuff http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.htmlhttp://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
18:56hiredmantechnomancy: yeah, you don't
18:56dnolenoops sorry, brainproxy: http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
18:57hiredmantechnomancy: a single service shouldn't need isolation internally, and if it does, the best thing to do is make 2 services, but you can still deploy them to a single jvm via isolation
18:57technomancyjust to save memory?
18:58technomancyI mean, at that point they're not really taking advantage of being in the same process, right?
18:58hiredmantechnomancy: the single jvm? yeah, memory what have, once you have as two services you can map those servers 2:N to jvms
18:58hiredmanhave 5 jvms, 4 running both services, 1 running only one for some reason
18:59brainproxydnolen: yep, that's what I linked above
18:59hiredmanyou can deploy to a single jvm until you decide your heap is too big for gc pauses, and split, etc
18:59brainproxyanyway, just trying to get a grip on what's possible
18:59brainproxyiow, say I have x.js and y.js neither of which have anything to do with google closure stuff
19:00technomancyhiredman: I agree wanting isolation within a single codebase is probably a sign your Doin' It Wrong, but I don't imagine it would go over that well to tell users that =)
19:00brainproxyaccording to luke's post, it seems like :foreign-libs is a way to indicate that those can be included in the compiler's output
19:00brainproxybut when I try such a thing, the compiler barfs because those libs aren't doing things like goog.provide
19:01dnolenbrainproxy: hmm don't know I've never used :foreign-libs I'd ask on the ML
19:01hiredmantechnomancy: they can pound sand
19:02technomancyhiredman: works for me
19:02hiredmanjust pretend they are windows users
19:03technomancyhttp://p.hagelb.org/unix.jpg
19:03`cbpWrong number of args (-1)
19:03`cbpwat
19:06bitemyapp`cbp: lol, how'd you do that?
19:06`cbpbitemyapp: combining multimethod + macros I guess
19:08technomancyimaginary functions have negative arities
19:09mlb-Question: If I'm using a library which maintains its own state, how can I have another "instance" of this library with a separate state?
19:09hyPiRionmlb-: hit the author with a stick. Tends to work for me.
19:10hyPiRionseriously though, that's a library issue which is hard to fix without fixing the library itself
19:10brehautgithub issues make good sticks
19:10mlb-Damn. I wanted a separate instance of a logging library instead of having to write my own user-oriented reporting library
19:11technomancyyou could always slurp up the source and munge the ns form and then sequentially eval each form
19:11technomancybut don't tell anyone I said that
19:12bitemyappmlb-: which library?
19:12mlb-timbre
19:12bitemyapptechnomancy: good lord man, are you trying to bring about the apocalypse?
19:12bitemyappmlb-: I'm a pretty active user of that library, which state is problematic to you?
19:12bitemyappmlb-: the configuration atom?
19:12mlb-technomancy: I was pondering that, or making use of "classojure"
19:12bitemyappdude, no
19:13bitemyappjust submit a PR for an alternate closure based config to pt-toomanyfuckingvowels-nis's library.
19:14bitemyappmlb-: I solved this sort of problem in bulwark: https://github.com/bitemyapp/bulwark/ has atom based and closure based configuration.
19:14bitemyappso you can have multiple instances of differently configured middleware running around.
19:14bitemyappmlb-: which is what you want, right?
19:15mlb-bitemyapp: Yeah, I want two separate configs. Not sure how I'd manage that as the logging functions seem to implicitly refer to the config atom
19:16mlb-Either that, or I'll have to add a timbre middleware to extract messages with a special signature and treat them separately...
19:16bitemyappmlb-: https://github.com/ptaoussanis/timbre/issues/31
19:16mlb-not really appealing
19:16bitemyappmlb-: no, don't do that. Seriously.
19:16bitemyappmlb-: I've had this problem too, I'm considering either PR'ing or forking.
19:16mlb-haha, thanks for opening that issue with me
19:16bitemyappmlb-: keep in touch with me. +1 the Github issue please.
19:17mlb-"me too" posts are acceptable github ettiquite?
19:17mlb-etiquette, even,
19:17bitemyappmlb-: yes dude, there's a +1 emoticon for showing your support/desire for a feature
19:17bitemyappmlb-: maintainers will use that to gauge interest.
19:18bitemyappeven fucking JIRA has that.
19:18bitemyappmlb-: it's in keeping with Github etiquette as long as you don't spam memes or something stupid. Just +1 and say you'd like this too.
19:23technomancy<3 the fact that you can remove yourself from those threads now
19:24technomancyunlike google code where you can't star an issue without getting spammed by every idiot who doesn't know about stars
19:25crockethiredman: Is https://github.com/hiredman/polycosm only useful in jboss application server
19:25crockethiredman: Is https://github.com/hiredman/polycosm only useful in jboss application server?
19:27marcopolo2technomancy: maybe they know about stars and that's why they comment...
19:27mlb-bitemyapp: threw in my $0.02. Thanks for helping out.
19:27mlb-technomancy: and for now, I'll try to resist your hack-tastic solutions
19:28bitemyappmlb-: np
19:30hiredmancrocket: I don't think it is that useful regardless, but you use it just like it says, no app server or what have you required
19:31hiredmancrocket: but I think putting that stuff in you app is a bad idea
19:31hiredmanyour app should just talk to services, and you deploy services to something, and that something you deploy to takes care of isolation, what have you
19:31crockethiredman: what about clojure.osgi?
19:32crocketIf clojure has to depend on host modularity systems, osgi can be a choice
19:32hiredmancrocket: never looked at it, the osgi docs make as much sense to me as they do to technomancy
19:32crocketcommonjs on web browsers?
19:33crockethiredman: Does it make little sense?
19:36hiredmancrocket: well last I looked the docs were so buzzword infused it was hard to figure out what was actually being said, and I ran away with the impression that osgi spends complexity budget without getting good value for money
19:37`cbpyet again! CompilerException clojure.lang.ArityException: Wrong number of args (-1). I'm so good at this
19:37crockethiredman: It is an absolute neccesity in eclipse.
19:37crocketOnce you decide write your apps in OSGi, it makes sense.
19:38crocketosgi is the most advanced module system so far.
19:40crockethiredman: I've been reading "OSGi in action", and it certainly solves the modularity problem for OSGi-based programs.
19:40hiredmanI don't think eclipse is a neccesity, so eclipsing using osgi doesn't mean I care about it
19:40hiredmancrocket: I am not saying it doesn't solve it
19:41crockethiredman: What if you need to deploy 500 JARs that may use log4j 1.0 and 2.0 simultaneously?
19:41hiredmanI mean, if you spend $1,000 on a pen, that pen solves the writing problem, but is it a good solution?
19:42crocketnetflix API consists of 500 JARs.
19:42crocketIn a big deployment, module version conflicts invariably happen.
19:42hyPiRioncrocket: have you worked with Erlang? That may be a better fit for your needs
19:42hiredmancrocket: I am well aware
19:42crockethyPiRion: why
19:42hiredmancrocket: I am not saying it isn't a problem
19:43crocketI don't know if erlang is a good general purpose language.
19:43hyPiRioncrocket: because they handle modules as first-class citizens instead of namespacing in general, thus avoids the version issue
19:43hiredmanI am saying: osgi may solve, but as far as I can tell it doesn't solve it with completely expending the complexity budget of a project
19:44crockethiredman: Do you mean "without"?
19:44hiredmanand there are other possible solutions that have less moving parts, don't have weird package based things etc
19:44hiredmancrocket: yes
19:44crockethiredman: like what?
19:44hiredmanand whatever the solution it doesn't belong in the service, what ever, you deploy
19:45hiredmanthe runtime environment you deploy to should do it
19:45crockethiredman: reified version information should be considered.
19:46hiredmancrocket: as I keep mentioning, jboss modules, in fact jboss modules are low level enough that they did their osgi impl on top of their own module system
19:46crocketJARs don't have reified version information.
19:46crockethiredman: Why do you refer me back to jboss?
19:46coventrycrocket, do you have a concrete problem you're working on?
19:46crocketYou told me jboss was a bad idea for my apps?
19:46hiredmancrocket: sure, and most / all module systems require you to add that information
19:46hiredmancrocket: no I didn't
19:47crocketcoventry: I just want to save headaches in the future.
19:47crocketI know it'll happen.
19:47hiredmanI said my library polycosm is, I would recommend you deploy to an appserver like immutant which is built on jboss
19:47crocketmodule version conflits
19:47hiredmanand your app doesn't have to care about isolation
19:47hiredmanthe app server takes care of that when it loads your app
19:47crockethiredman: What if I don't need an app server like jboss?
19:48crocketIf I need jboss, it's perfect.
19:48crocketIf I don't need it, ???
19:48lazybotcrocket: Oh, absolutely.
19:48hiredmancrocket: I would argue you do if you care about isolation like that
19:49`cbppremature modularization is the root of all evil?
19:49crocket`cbp: late modularization is a disaster.
19:50crocketmodularization should be considered from the design.
19:50technomancyosgi might be the best way to deploy programs with very large dependency trees, but it is definitely not the best way to solve the problem of large dependency trees
19:50crockettechnomancy: Do you already know the best way?
19:50technomancydon't have large dependency trees
19:51crocketDoes anyone have experience with clojure.osgi?
19:51crocketIf it works, I may use it.
19:52coventryFor what?
19:52crocketfor modularity
19:52coventryBwahaha
19:53bitemyapp(inc coventry)
19:53lazybot⇒ 2
19:53crocketI work for a company that makes java web office.
19:53crocketIt is a big giant mud of java packages.
19:53crocketIt's sick.
19:53crocketModuarity is a neccesity.
19:54dnolenseems like ClojureScript might benefit from asm.js after all ...
19:54coventrySorry I laughed. That sounds terrible.
19:55crocketcoventry: I decided not to non-modular apps.
19:55crocketcoventry: I decided not to write non-modular apps.
20:13coventry,(do (defmacro f [] (assoc)) (f)) <--`cbp. I knew I'd seen that somewhere before.
20:13clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
20:14coventry`cbp: Anyway, that gives an ArityException with a supposedly negative number of arguments.
20:17coventryHmm, this was also the cause of the uninformative stacktrace I complained about last night. Macroexpand strips out the stack trace info if it gets an arity exception. https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6475
20:19georgyghey everyone! I'm having some issues using clojure.java.jdbc to execute two statements using the same connection
20:20georgygI'm trying to connect to mysql and set group_concat_max_len, and then execute a select group_concat().... but the first set doesn't get set
20:20georgygany hints on how to use the same connection between two statements (one being a set and the other a select)?
20:26razieliyohi, would you say clojure is more friendly than lisp and its dialects? or more or less the same?
20:26technomancyrazieliyo: lisp dialects vary wildly
20:26dnolenrazieliyo: Clojure is a Lisp dialect, relatively friendly
20:26razieliyotechnomancy: yes, you're right on that
20:26razieliyodnolen: I see
20:27technomancymuch more friendly than CL; less beginner-friendly than racket
20:28razieliyothe thing is, I've done just a little on lisp, but its hard for me to get into it, and now I have to implement an ID3 algorithm, I was thinking on using lisp, but I'm thinking about clojure too, because it seems to me for the less I've read to be more friendly than CL for example, as technomancy say
20:30technomancyan ID3 parser sounds like the kind of thing that might need a fast startup time
20:30bitemyapprazieliyo: https://github.com/kirankulkarni/clj-id3
20:31bitemyapprazieliyo: https://github.com/onewland/clojure-mp3
20:31juhohhow is it possible that the function *value* is returning true in some cases? http://pastebin.com/9wMimJVs (last function)
20:31razieliyobitemyapp: I have/want to make it for myself, obviously I know I can just type *language* *id3 algorithm* and find lots of implementations
20:32razieliyothe thing is that idk how much difficult that will become, because I have a deadline
20:32technomancyrazieliyo: if you're looking to create a CLI tool, clojure is pretty bad at that
20:32razieliyoI know that depends on my knowledge on lispy stuff
20:32razieliyotechnomancy: why?
20:32technomancyfor a school project it should be fin ethough
20:33razieliyoyes, it's for a school project
20:33razieliyowe were told to make it in java, but I think this is the time for me to learn some lisp stuff for good
20:33technomancyrazieliyo: ok; it's not significantly worse than Java for CLI stuff
20:33technomancyjust slower startup time
20:34razieliyotechnomancy: alright, so it may be a good choice
20:34razieliyoand I guess that lots of stuff I learn on clojure are valid for other lisp dialects, isn't it?
20:35technomancyyeah, lots of it
20:35razieliyoalright, thank you all for the help
20:36razieliyoI think I'll try it with clojure, and pray to not last too much because of the deadline
20:37technomancyclojure has the most active IRC channel of any lisp I believe
20:37technomancythat's gotta count for something
20:37arrdemit totally counts for something.
20:37technomancyexcept maybe elisp, but that channel never actually talks about emacs
20:37arrdemyou can drop in here and get help from the library authors about 75% of the time.
20:37razieliyotechnomancy: that's an indirect reason of chosing clojure, I find that there's lot of fresh info on the net
20:38razieliyosupport is always good
20:38razieliyoanyway, I have to say that people at #lisp are pretty helpful too
20:38technomancyhuh, really?
20:39razieliyotechnomancy: well, at least that's what I found out the last time I played with lisp and asked (maybe too much time ago)
20:39technomancythey used to have a reputation for hostility