#clojure log - Oct 16 2013

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

0:46 rhg135: hello 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

0:48 amalloy: rhg135: i don't see any reason why it's an atom instead of just a map

0:48 rhg135: hmm

0:49 i borrowed the code so didn't know if I needed that

0:49 bitemyapp: rhg135: do you know what atoms are for?

0:49 rhg135: yes

0:49 bitemyapp: rhg135: you can't do "simple" unless you understand what you're doing - as opposed to cargo cult.

0:50 rhg135: theyre for managing non-coordinated concurency

0:50 bitemyapp: rhg135: you're just repeating something you saw. Do you know what those words mean?

0:50 rhg135: ys i do

0:50 bitemyapp: rhg135: what do you use atoms for? don't repeat something you read. Say it in your own words.

0:51 * noto2 raises hand TEACHER TEACHER

0:51 rhg135: for setting a counter not tied with something else

0:51 bitemyapp: rhg135: just counters?

0:51 rhg135: no

0:51 bitemyapp: rhg135: what does being tied with something else have to do with it?

0:51 rhg135: what are atoms for?

0:51 rhg135: but mutability isn't too useful for me

0:52 bitemyapp: rhg135: you don't need atoms for mutability alone, so what are atoms for?

0:52 rhg135: i just happen to be making a server and am forced to use mutability

0:52 managing time

0:52 TEttinger: that's agents I thought

0:52 rhg135: not state and time

0:53 bitemyapp: rhg135: managing time how? it's not clear to me what atoms have to do with time.

0:53 rhg135: stop repeating words you saw somebody else use.

0:53 rhg135: what are atoms for?

0:53 as much as I love Hickey's talks, you're letting his words muddle your mind.

0:53 use your own words.

0:53 rhg135: if you repoint it, you don't change it's value you point to a new value

0:54 bitemyapp: rhg135: you're off-track and still not explaining what atoms are for.

0:54 rhg135: well it's hard to describe atoms

0:54 bitemyapp: rhg135: don't tell me how you (incorrectly) think they work.

0:54 rhg135: ok

0:54 idk

0:54 bitemyapp: rhg135: tell me what they're for. What sort of problem do they solve?

0:54 rhg135: shared data you need from various threads

0:55 TEttinger: heh bitemyapp are you callen by any chance? this seems like a rough intro

0:55 rhg135: like in most languages it's hard

0:55 TEttinger: $seen callen

0:55 lazybot: callen was last seen talking on #clojure 2 weeks ago.

0:55 rhg135: so much to do sigh

0:56 bitemyapp: rhg135: why do you need atoms for shared data across multiple threads?

0:56 rhg135: you can share data between threads without an atom.

0:56 rhg135: cuz locking is a pita

0:57 bitemyapp: you're getting closer but still getting a bit besides the point.

0:57 rhg135: then you forget and D:

0:57 bitemyapp: rhg135: why does locking matter if you are sharing data between threads?

0:57 rhg135: because if you mutate it as you read

0:57 well it can get corrupted

0:58 bitemyapp: rhg135: so, thread-safety, right?

0:58 rhg135: yes

0:58 bitemyapp: rhg135: https://www.refheap.com/19856 what about this code needs to be thread safe?

0:58 rhg135: it's a server

0:58 i can't handle request on one thread

0:59 bitemyapp: rhg135: I don't see a thread pool in that code.

0:59 indigo: Yeah, there's nothing multithreaded about it

0:59 rhg135: i have it modular

0:59 thats just the json code

0:59 bitemyapp: rhg135: so what do you need the atom for?

0:59 rhg135: idk

0:59 i just forgot to remove it

0:59 indigo: Anyway this is a bit of a rough intro ;P

1:00 bitemyapp: rhg135: so if you can't explain why you need it, what do you think the simple thing to do is?

1:00 indigo: I prefer fewer lessons that stick to many lessons that fade away.

1:00 rhg135: sigh

1:00 yes, sir

1:00 mgaare: is lesson 1 meant to be, "don't join #clojure" ?

1:01 bitemyapp: mgaare: I'm surprised you genuinely think it was unpleasant.

1:01 indigo: Anyway!

1:01 I think the main problem with the code is not the lack of simplicity

1:02 It's that it's very Java-like right now

1:02 rhg135: well in fairness i've had easier tests in school

1:02 bitemyapp: I 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

1:03 What I am not going to countenance is criticism from idlers that aren't actually trying to help somebody.

1:03 rhg135: new version https://www.refheap.com/19857

1:03 bitemyapp: If you don't like the teaching method, teach in an alternate fashion, don't stand on the sidelines and gripe.

1:03 rhg135: indigo, how so?

1:03 indigo: I feel like there might be a better way to do sockets in Clojure

1:04 bitemyapp: rhg135: you're just smashing the socket.

1:04 rhg135: smashing?

1:04 bitemyapp: that's my preferred verb when side effects are involved.

1:04 rhg135: ah

1:04 i don't see a way around it

1:05 bitemyapp: rhg135: then you should learn more Clojure. Ring has good examples for abstracting servers from their implementations.

1:05 indigo: rhg135: What's the jim-chat protocol

1:06 rhg135: jim-chat is JSON IM

1:06 see jim.hackpad.com

1:06 TEttinger: I learned a lot by reading and adding to the lazybot source.

1:06 rhg135: ah

1:06 TEttinger: it makes use of a lot of clojure features, but you can start with pretty basic plugins

1:06 rhg135: i ran a lazybot instance

1:06 augmented it even

1:07 but not much

1:07 TEttinger: clojure source is also good.

1:08 rhg135: i once tried to read a language's source, and stopped programming for a week

1:09 but clojure's is quite nice

1:09 indigo: Hm, doesn't seem to be that well-documented... is it using just plain TCP sockets or is it a RESTful protocol over HTTP

1:09 rhg135: from what ive seen of it

1:09 plain tcp

1:09 it's pretty new

1:09 indigo: Hm okay

1:09 bitemyapp: indigo: if it's one or the other, I'd ask the people hammering out the standard: porque no los dos?

1:09 rhg135: see im writing the server

1:09 it's that new

1:10 indigo: Ah

1:10 Well, congrats on choosing a cool language to do it in ;)

1:10 rhg135: and the client, but i can't on the jvm

1:10 i don't thin ppl would like a jvm based chat client

1:11 indigo: Anyway, I suggest looking at server-socket

1:11 rhg135: k

1:12 indigo: I also suggest hitting the JIM people with a stick

1:12 rhg135: ya id like to write the client on nodejs

1:12 mgaare: aleph is also very nice for tcp

1:12 indigo: Until they make their stuff RESTful

1:12 Because they're already using the HTTP status codes

1:12 rhg135: indigo, if you look i helped write it :(

1:13 bitemyapp: rhg135: I second mgaare's recommendation of Aleph, can help for writing a nice, clean async server.

1:13 rhg135: i guess it'd be nice

1:14 technomancy: I think sticking with regular sockets would be better if you're just starting out

1:14 indigo: rhg135: It's a good idea though :)

1:14 rhg135: it'd put the other nodejs server to shame

1:14 technomancy: you don't want to turn your codebase inside out when you're new to the language

1:14 rhg135: i agree

1:15 also i guess the other authors haven't seen the tao and thought it'd be too complex

1:16 even my python code is sorta functional

1:16 bitemyapp: technomancy: probably true but working towards something like Aleph is a good terminal goal.

1:16 indigo: Anyway, I strongly suggest moving to a RESTful API for JIM, unless you're dead set on plain sockets

1:17 You're like 2/3 of the way there... HTTP status codes and JSON request/response ;P

1:17 rhg135: it would be even more bandwith

1:17 sigh

1:18 i get an urge to abandon this and got to edn

1:18 indigo: But it'd be so much easier to integrate with everything else

1:18 If you're worried about bandwidth, you should probably take a look at protobufs

1:18 rhg135: idk if it'll be in the spec but i can try to implement

1:19 indigo: But then it won't be JIM anymore

1:19 rhg135: in famous words "f*** them"

1:20 maybe, i don't think they're that unsensible

1:20 it's not like on dude likes c

1:21 marcopolo2: $seen rhickey

1:21 lazybot: rhickey was last seen quitting 17 weeks and 1 day ago.

1:22 indigo: Heh

1:23 Anyway good luck on your protocol/server, I'm heading off to bed

1:24 rhg135: thx

1:24 gn

1:24 indigo: Listen to bitemyapp and don't use atoms when you don't need them :P

1:24 rhg135: mhm

2:11 brainproxy: just read through the cljs source for core.async ... I feel small and weak, my mind is excited yet trembling

2:11 marcopolo2: brainproxy: wow, kudos!

2:11 (inc brainproxy )

2:11 lazybot: ⇒ 1

2:12 brainproxy: impl/ioc_macros.clj is pretty awesome

2:13 i understand the state monad well enough, but what's going on in there is going to take some deep study

2:14 marcopolo2: have you seen this: http://hueypetersen.com/posts/2013/08/02/the-state-machines-of-core-async/

2:22 brainproxy: marcopolo2: i have, but i need to take a deeper look now

2:22 i mean, having started dabbling proper

2:22 Jarda: marcopolo2: thanks for that link!

3:22 (defn foo [arg & other] (some-other-call (merge arg {:some "thing"}) <how to just pass the others>))

3:23 so I need to call some-other-call with a variable number of arguments but need to always process the first argument?

3:28 ddellacosta: Jarda: sorry, I don't understand--what exactly do you want to return?

3:29 Jarda: ddellacosta: in the end I want to call (some-other-call arg arg2 arg3)

3:29 but there might bew N args for foo (and some-other-call)

3:29 but I need to always modify the first

3:29 ddellacosta: Jarda: so, you have variable arity for both foo and some-other-call?

3:29 Jarda: yes

3:30 ah, now I got the syntax right

3:30 (apply some-other-call arg other)

3:30 ddellacosta: I 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.

3:31 Jarda: but yeah, that works too.

3:31 Jarda: yeah but there would be unlimited count of declarations

3:32 ddellacosta: Jarda: okay…not sure what you're trying to do but there are many ways to do these things.

3:32 Jarda: but sounds like you've got something working.

3:33 matt`: Good evening everyone.

3:33 ddellacosta: 'evening.

3:33 matt`: Hello ddellacosta

3:33 Jarda: ddellacosta: yeah thanks

3:33 evening? not that much. 10 am here :)

3:33 bitemyapp: ddellacosta: howdy.

3:34 ddellacosta: bitemyapp: howdy

3:34 bitemyapp: ddellacosta: I'm in a delightful mood, finally got a desk and chair.

3:34 matt`: Jarda: ha.. i'm on the other side of the world to you then :P

3:34 ddellacosta: bitemyapp: haha, excellent. :-)

3:34 bitemyapp: just got done committing some improvements to Selmer too :)

3:34 ddellacosta: yah, it's 4:00 PM here

3:34 nice!

3:34 bitemyapp: it's easier to code at home when a chair and desk are in place.

3:34 Jarda: matt`: .fi :)

3:34 ddellacosta: bitemyapp: that is very much true, as I found out myself. ;-)

3:35 matt`: bitemyapp: very true.

3:36 bitemyapp: ddellacosta: 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. :)

3:36 ddellacosta: nice. :-)

3:36 bitemyapp: I 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.

3:36 ddellacosta: now, you have to give me something that does partial compilation on the server and generates template functions I can use in CLJS. Please.

3:37 * ddellacosta ducks

3:37 bitemyapp: ddellacosta: that's doable actually.

3:37 ddellacosta: no seriously.

3:37 ddellacosta: bitemyapp: I believe you. Actually, I've been looking into it myself, just had so much else to do.

3:37 bitemyapp: ddellacosta: 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.

3:37 doing a clj server -> cljs client handoff is totally doable.

3:37 you could render a subset of the vector or handoff the vector directly as edn.

3:38 there would be limitations in what the function nodes could do in terms of custom functionality if you do so, though.

3:38 that or parity between the customization on the cljs and clj side would be needed.

3:39 ddellacosta: bitemyapp: 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

3:39 but we want to have the server side do the work of actually creating functions based on raw HTML

3:39 there is a lot in between to figure out though.

3:40 probably 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.

3:40 bitemyapp: ddellacosta: one thing to consider is that Selmer is multi-stage and has a notion of "preprocessor", "compiler", and "renderer"

3:41 ddellacosta: 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.

3:41 ddellacosta: bitemyapp: yeah, that makes sense

3:41 bitemyapp: that's where it rips through the content and function nodes, handing off the context to the function nodes.

3:42 ddellacosta: damn, selmer does a lot doesn't it

3:42 (looking at docs now)

3:42 ash, I don't know what to do yet.

3:42 *ah

3:42 bitemyapp: ddellacosta: Clojure is ~1.6k LOC

3:42 er, Selmer. Sorry.

3:42 ddellacosta: freaking spellcheck, I thought I turned it off

3:42 bitemyapp: haha, no worries.

3:42 gotcha.

3:42 bitemyapp: I'm still agitating for an experimental rewrite in Instaparse

3:43 but yogthos is mighty jealous of his performance.

3:43 ddellacosta: bitemyapp: ha, I've been spending the last few days on instaparse

3:43 I LOVE it

3:43 bitemyapp: It was quite a feat that Selmer ended up being as fast as Stencil.

3:43 ddellacosta: so much

3:43 bitemyapp: and anything that compromises that will displease my Russian master :)

3:44 making something as fast as Stencil is really hard in the realm of template libraries. Only hiccup and clj-mustache are faster.

3:45 ddellacosta: have you ever looked at tinsel?

3:45 bitemyapp: Sure.

3:45 ddellacosta: seemed okay, but it's not to my taste at all.

3:45 ddellacosta: don't know anything about its speed though

3:46 bitemyapp: ddellacosta: easy way to find out mate: https://github.com/bitemyapp/clojure-template-benchmarks

3:47 ddellacosta: heh, nice

3:47 bitemyapp: as you can see, hiccup, mustache, and tinsel were all around the performance of using str.

3:48 (I didn't try it with a StringBuilder, guess I should've?)

3:48 then out in the stratosphere you had enlive, laser, and clabango.

3:49 and that was in a test totally absent the fancy tree transformation most people do with enlive.

3:49 it's godawful slow the moment you do any of that at runtime.

3:50 ifesdjeen: hey. no hard feelings?

3:51 ddellacosta: 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.

3:51 ddellacosta: very nice.

3:53 bitemyapp: ddellacosta: the hybrid rendering model you're thinking of is what Twitter does btw

3:53 not many sites go about it in a disciplined manner though.

3:54 ddellacosta: bitemyapp: really? that is pretty interesting, didn't know that about twitter. Will have to research it.

3:54 bitemyapp: yeah, it's not simple to do

3:55 bitemyapp: ddellacosta: 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.

3:55 I should pilfer through the site with dev console turned on and see what I see.

3:56 ddellacosta: bitemyapp: 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

3:56 bitemyapp: cljx Selmer would make yogthos piss blood though.

3:56 ddellacosta: they open source stuff, oddly mostly Scala: https://github.com/twitter/

3:57 ddellacosta: summingbird is something our very own sritchie works on if I'm not mistaken.

3:57 ddellacosta: yeah, I remember a lot of scala being open-sourced

3:57 I started going through their tutorial at one point actually

3:57 seemed pretty good

3:57 bitemyapp: there are some odd and end JS libraries (like typeahead.js) but nothing that really demonstrates their overall approach.

3:57 ddellacosta: lot of it seems more back-end

3:58 bitemyapp: ddellacosta: You really should take a look at this if you're doing frontend: https://github.com/twitter/typeahead.js

3:58 ddellacosta: not that that's a bad thing, just not what I'm looking for

3:58 yeah, that's part of bootstrap isn't it?

3:58 I've used that actually, it's freaking nice

3:58 bitemyapp: I didn't know it was part of bootstrap, just find it massively impressive :)

3:59 ddellacosta: yeah, I mean, I dunno if the one in bootstrap is like a "junior" version or what, but that one is freaking super awesome

3:59 really handy

3:59 oh wow, this has MUCH more than I knew

3:59 maybe it's not the same, although it is configured similarly

3:59 bitemyapp: ddellacosta: This is their frontend mustache template compiler: http://twitter.github.io/hogan.js/

3:59 ddellacosta: "For simple autocomplete use cases, the typeahead component Bootstrap provides should suffice."

3:59 right, they are different

4:00 ah, right, Hogan--I've heard of that

4:00 thanks

4:00 bitemyapp: so Hogan.js should give some hints as to how they work, maybe.

4:00 I'm digging around for more.

4:01 yeah that's it I'm afraid.

4:02 I'm a little curious as to why Twitter needed their own mustache library. Compactness maybe?

4:03 ddellacosta: https://blog.twitter.com/2012/improving-performance-twittercom this is the best explanation of their current site architecture so far as I'm aware.

4:04 ddellacosta: bitemyapp: cool, thank you! I was on to something else, but I will definitely be reading this very soon

4:04 and absorbing whatever I can from their techniques

4:04 bitemyapp: Sure, just sharing what I had since it seemed to pique your interest.

4:04 Sorry for distracting you :)

4:12 noncom: hi anyone using lighttable here?

4:14 TEttinger: noncom, yes

4:16 noncom: how is your experience? are you using it for big projects at work?

4:19 TEttinger: noncom, i don't think it's ready for that just yet.

4:20 small projects are fine

5:13 udoprog: I'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)

5:15 silasdavis: if I destructure on an seq, is it implicitly getting converted into a vector?

5:16 I have a reduction where I prefer the way it looks comp'ing 'vec' on to the function

5:16 but if that is wasteful I could just vec the result

5:18 Also, the same function: (reduce (comp vec (partial map (partial apply (juxt min max))) (partial map conj)) [[0 0] [0 0]] points))

5:19 finds the min/max'es of a list of points [[3 4] [5 6] ...] as [[min-x max-x] [min-y max-y]]

5:20 only the initialisation value is broken

5:20 I need [[x x] [y y]] where [x y] is any point in the list

5:20 what's the neatest way to do this

5:24 tell me it's not: (cons (vec (map (juxt identity identity) (first points))) (rest points))

5:25 crocket: Is leiningen better than gradle clojure plugin?

5:25 gradle seems to be good.

5:25 not sure gradle fits clojure, too.

5:26 silasdavis: crocket: pretty much everyone uses leiningen if that helps

5:26 it's a bit more than a build tool

5:27 with it's ring plugin, project config, and repl'ing abilities

5:27 crocket: I don't like this trend.

5:27 silasdavis: why's that?

5:27 crocket: gradle has been conquering java, scala, and groovy build automations.

5:28 clojure has a separate effort named leiningen.

5:28 silasdavis: I don't think they are trying to serve the same purpose

5:28 leiningen is largely a development tool

5:29 crocket: Can leiningen automate java, scala, groovy, and clojure builds?

5:29 s4muel: No, such a polyglot scenario is what Gradle is good at

5:30 silasdavis: if you have complex build needs, particularly pulling in more of the java ecosystem then you might want to use a heavier build system

5:32 clgv: crocket: leiningen supports java per default

5:32 crocket: Does leiningen support scala?

5:33 clgv: crocket: no per default. I do not know whether there is a leiningen plugin for this.

5:33 crocket: meh

5:33 it seems leiningen is optimized for clojure.

5:35 I believe clojure will win for the next 2 decades.

5:36 It will win in its own ways.

5:46 clgv: crocket: 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

5:47 crocket: 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

6:44 babilen: Did any great testing frameworks appear in the last couple of months or are clojure.test and midje still state of the art?

6:58 carlosgaldino: what's the most idiomatic way of defining a new "type" like scala's Option, for example, which resembles the maybe monad? using deftype?

7:00 llasram: I think that question is like "what's the most straightforward way for me to travel faster than the speed of light" :-)

7:01 In idiomatic Clojure, you'd just leverage the fact that any reference can be `nil`, and use `nil` when you need None

7:02 carlosgaldino: llasram: I know

7:02 llasram: Or if you really actually wand the maybe monad, algos.monads (and all the other monad libraries) have implementations

7:03 carlosgaldino: llasram: 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`

7:04 llasram: carlosgaldino: Ok. In that case, `deftype` is probably the way to do

7:04 er, way to *go*

7:04 carlosgaldino: llasram: ok, thanks. gonna give it a try

7:06 wink: Monad for Nothing and the types for free

7:08 * llasram groans

7:09 tomjack: (defn box [val] (reify clojure.lang.IDeref (deref [_] val)))

7:09 that's from core.async

7:09 I'm not sure though, is it used like Maybe there?

7:10 I remember being confused about its purpose, and I don't understand channels.clj anymore

7:11 maris`: (if (Boolean. "false") :LOL :false)

7:11 clgv: tomjack: I'd call it a conversion to a reference

7:11 ,(if (boolean (Boolean. "false")) :LOL :false)

7:11 clojurebot: :false

7:13 clgv: ,(if (Boolean/valueOf "false") :LOL :false)

7:13 clojurebot: :false

7:13 clgv: maris`: ^^

7:15 tomjack: I think it's used to distinguish "just nothing" from "nothing just yet"

7:16 clgv: tomjack: for that you'd need to implement clojure.lang.IPending

7:16 tomjack: IDeref just stands for a reference and access that might block

7:17 tomjack: I'm more interested in this particular use than the general conventions for IDeref

7:17 in this case, as you can see, it will never block :)

7:17 clgv: ah ok.

7:17 clojurebot: Pardon?

7:19 clgv: tomjack: in channels.clj it seems that `box` is used to have return something dereferencable in every case

7:20 tomjack: so I suppose the cases where `box` is not used return IDeref instances as well

7:20 tomjack: I think the only non-box return value is nil

7:20 which is what makes think it's a poor (rich?) man's Maybe

7:21 clgv: humm maybe ;)

7:23 tomjack: that source could use some more comments ...

7:30 tomjack: https://www.refheap.com/961b02b5d230c1757ce5476e8

7:31 clgv: tomjack: you could use #(get-in % [0 0 1]) instead of (comp first first second)

7:31 tomjack: whats your general question about that snippet?

7:32 tomjack: generally.. how could it be better? :)

7:32 (comp first first second) etc was probably the most bothersome to me

7:33 #(get-in % [0 0 1]) seems just as inscrutable

7:33 llasram: tomjack: 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

7:33 tomjack: I feel some temptation to try making a new seq type, or maybe use maps

7:34 clgv: tomjack: well then destructuring...

7:34 tomjack: oh, hmm

7:34 llasram: Then I think this function would be (-> sort-merge partition-by map)

7:34 clgv: yes, splitting up into smaller functions is often worth the effort

7:35 tomjack: merge means like concat, but sorted?

7:36 llasram: tomjack: 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

7:37 tomjack: not obvious to me that that would work

7:37 I think if there are no simultaneous occurrences in each input, it could, maybe?

7:38 llasram: Oh, I must have missed something about what your function does

7:38 tomjack: I hadn't tested simultaneous occurrences, they are troublesome :(

7:40 llasram: So what' this actually doing semantically?

7:40 tomjack: it 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

7:41 llasram: Hmm

7:41 crocket: Does clojure apply the concept of module or package version to a group of codes?

7:42 OSGi does, and it's helpful.

7:42 sm0ke: crocket: you can use osgi with clojure then

7:42 llasram: tomjack: An interesting problem, but unfortunately it's time for my run, so I must -- run

7:43 Curious to see where you get though!

7:43 tomjack: thanks, I need to sleep so I must sleep, probably :(

7:43 crocket: sm0ke, The problem is that OSGi fucks with clojure classloaders.

7:44 sm0ke: ugh.. i didnt know they were so close

7:45 'clojure classloaders' its kind of oxymoron give clojure doesnt embrace objects

7:46 crocket: Clojure needs its own versioning and modularity solutions.

7:46 Clojure runs on web browsers, JVM, and CLR.

7:47 sm0ke: i dont think that can happen..i may be wrong..something like runtime dependency isolation has to be done on platform level

7:48 crocket: sm0ke, scala has scala components.

7:48 javascript has CommonJS and RequireJS that deal with modularity.

7:49 java has OSGi

7:49 clojure?

7:49 clojurebot: clojure is a very attractive hammer with a nice heft to it

7:49 sm0ke: oh what is that? scala components?

7:54 crocket: Is clojure so superior that it doesn't need any external modularity solution?

8:04 Does clojure obviate OSGi?

8:12 sm0ke: to 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

8:13 ugh..weird typos

8:14 have a good one..g2g

8:15 ddellacosta: crocket: 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.

8:16 crocket: ddellacosta, I don't know about clojure yet, but I guess it can't handle multiple versions of a library on a JVM.

8:18 ddellacosta: crocket: hmm, I saw something about that recently…where was it.

8:18 * ddellacosta goes to shuffle around in mailing list archives

8:19 noncom: what is the quick way to transform a value in true or false if it is not nil and nil respectively?

8:19 crocket: ddellacosta, eclipse chose OSGi as its module system, and eclipse has made OSGi the most advanced modularity system.

8:20 noncom: like (f 1) => true or (f nil) => false or (f 'k) => true and so on...

8:20 ddellacosta: noncom: boolean?

8:20 &(boolean 1)

8:20 lazybot: ⇒ true

8:20 ddellacosta: &(boolean nil)

8:20 lazybot: ⇒ false

8:20 noncom: ,(boolean nil)

8:20 ,(boolean {:a 1})

8:20 clojurebot: eval service is offline

8:20 noncom: umm..

8:20 clojurebot: eval service is offline

8:21 ddellacosta: crocket: 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

8:21 noncom: &(boolean {:a 1})

8:21 lazybot: ⇒ true

8:21 noncom: cool, thanks!

8:21 what's up woth clojurebot?

8:21 ddellacosta: crocket: I haven't needed, to use your example, to set up multiple libs at once (but I can see the potential value)

8:21 noncom: dunno

8:23 crocket: ddellacosta, A depends on B and C. B depends on D 1.0, and C depends on D 2.0.

8:23 What will happen in clojure?

8:23 kaboom!!

8:23 ddellacosta: crocket: generally, to handle that first I'll run leiningen with deps :tree and check stuff out

8:24 crocket: I haven't found it to be a huge problem in practice

8:25 crocket: there's this too, if you're interested: https://github.com/aav/clojure.osgi

8:26 someone forked it pretty recently and tweaked it: https://groups.google.com/forum/#!searchin/clojure/osgi/clojure/Q1S5-bTH5cE/CTOZqu8fn-MJ

8:27 crocket: ddellacosta, Do you mean there is no problem?

8:28 ddellacosta: crocket: 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.

8:28 crocket: I'm just making conversation, and trying to learn. ;-)

8:28 crocket: ddellacosta, If A depends on D 1.0 and D 2.0, does clojure have any problem?

8:28 ddellacosta: quite 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.

8:29 crocket: 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

8:30 crocket: I used to use lein pedantic, which was really nice

8:30 think there may be some recent updates to lein which fixes it

8:30 er, adds similar functionality

8:32 if technomancy was on here he could give you a much better answer to your question, I'm sure.

8:32 anyways, gotta go--cheers!

8:32 * ddellacosta waves goodbye and sniffles

8:53 crocket: ok

8:53 technomancy, hey

8:53 technomancy, How does clojure deal with modularity as OSGi does?

9:30 clgv: crocket: namespaces. clojure libs are packaged in jars which allow to use their namespaces when added to the classpath

9:31 cleos_frey: Hey guys, any advice on how to write a language parser? Always something I've been interested in, just don't know where to start

9:31 I was thinking of starting with something simple to parse Mustache templates

9:33 hyPiRion: cleos_frey: Play around with instaparse

9:33 uruviel: cleos_frey: https://github.com/Engelberg/instaparse

9:33 cleos_frey: although for mustasche you can probably do regexes

9:34 cleos_frey: it's what does js libraries do anyway :p

9:35 cleos_frey: cool thanks, reading the README now

9:38 crocket: clgv: even java has packages

9:38 clojure needs something better than java.

9:39 OSGi is the most advanced module system on earth

9:39 clojure should take note of it

9:39 clgv: crocket: clojures namespaces are the replacements for java packages.

9:40 crocket: clgv: Does it associate namespace with versions.

9:40 clgv: crocket: you can use clojure with OSGi it was recently discussed on the mailing list

9:41 crocket: clgv: can you refer me to the link.

9:41 clgv: crocket: no. namespaces are provided by libs and you depend on the libs in a certain specified version (Leiningen's project.clj)

9:41 crocket: clgv, even maven can do that.

9:41 clgv: crocket: sorry I do not have it ready, but search for osgi and laurent petit (he was involved in the discussion)

9:42 crocket: no one said that clojure was better on that front ;)

9:42 crocket: I'd say leiningen is a much easier to use substitute for maven

9:43 pandeiro: is there a way to get nrepl.el to do eldoc-like behavior inside a clojure source buffer?

9:44 si14: jonasen: regarding that schema bug tomorrow: how did you managed to reproduce it?

9:45 crocket: clgv: what happens if A depends on B and C, and B depends on D 1.0, and C depends on D 2.0?

9:45 clgv: crocket: armageddon if they are incompatible.

9:46 crocket: clgv: OSGi lets D 1.0 and 2.0 coexist.

9:47 clgv: crocket: yeah, if you need that behavior you should be able to use OSGi and Clojure according to the ML posts...

9:47 crocket: clgv: that happens a lot

9:47 hyPiRion: crocket: 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?

9:48 clgv: hyPiRion: armageddon as well ;)

9:48 Pupnik_: hire assassins to murder the people that wrote those libraries

9:48 crocket: hyPiRion: don't know

9:48 clgv: hyPiRion: they'll wish that they had used clojure maps as data ;)

9:49 hyPiRion: Not worked with OSGi, but there should be an option to specify whether you'd like to have stuff coexist or switch dependency

9:49 clgv: Pupnik_: but only the one who wrote and released A ;)

9:49 hyPiRion: either way internal state is bad :p

9:52 coventry2: crocket: 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

9:52 Err, https://github.com/technomancy/metaverse

9:53 clgv: coventry2, crocket: classlojure might help as well in certain specific scenarios

9:55 crocket: classloser

9:55 coventry2: pandeiro: M-X nrepl-turn-on-eldoc-mode. Needs an nrepl connection to work, of course.

9:57 pandeiro: coventry2: thanks, somehow i missed that in the nrepl-* list

9:57 crocket: hell

10:03 mulosicul: ciao

10:03 !list

10:07 cleos_frey: what's everyone working on? Trying to think of a clojure project

10:08 I built a simple api for a service I use, but I'm trying to think of another project to practice my clojure'ing

10:23 Pupnik_: make a game engine

10:23 there are currently: 0

10:25 cleos_frey: lol

10:26 wink: I'd say http://stevelosh.com/blog/2012/07/caves-of-clojure-01/ counts as game engine. *points to sjl*

10:26 cleos_frey: with processing through quil?

10:26 wink: haha cool post

10:27 Pupnik_: good lord, theres a book about how to play dwarf fortress

10:31 hyPiRion: Pupnik_: of course. It's not exactly the simplest game out there

10:32 Pupnik_: i know, ive made a mod for it

10:32 I still don't know what you would write to fill a book

10:32 stories i guess

10:38 strangeworks: exit

10:43 Zariel: is there a nicer way to do this? https://gist.github.com/Zariel/7008302

10:43 i basically just need the key to be passed to the mapping function along with the value

10:45 hyPiRion: Zariel: (defn kvmap [f m] (reduce-kv (fn [m k v] (assoc m k (f k v))) {} m))

10:46 Zariel: doesnt look much nicer

10:46 but it is shorter

10:46 hyPiRion: not sure you can get it better than that

10:46 chronno: Zariel: and it avoids using flatten

10:47 Zariel: if there is reduce-kv why does there not exist map-kv ?

10:51 fredyr: ,(seq {:a :1 :b :2})

10:51 clojurebot: ([:a :1] [:b :2])

10:51 fredyr: you can use map + seq for that

10:51 Zariel: explain?

10:51 mdrogalis: reduce-kv. Never knew that was there.

10:52 fredyr: i thought you meant you want to map over all key/value pairs?

10:52 Zariel: i want to do soemthing like

10:52 map[key] = func(key, map[key])

10:53 jcromartie_: phew

10:53 mdrogalis: Zariel: Can you give an example of a concrete input and output that you want?

10:55 Zariel: here, https://gist.github.com/Zariel/7008302/#comment-930499

10:58 mdrogalis: ,(reduce-kv (λ [all k v] (assoc all k (str v "/" k))) {} {"host" "http://localhost"})

10:58 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ? in this context, compiling:(NO_SOURCE_PATH:0:0)>

10:58 mdrogalis: ,(reduce-kv (fn [all k v] (assoc all k (str v "/" k))) {} {"host" "http://localhost"})

10:58 clojurebot: {"host" "http://localhost/host"}

10:59 mdrogalis: I, too, use lambdas where fns once were. D:

11:00 Zariel: mdrogalis: :)

11:05 fredyr: here's my attempt anyway

11:05 https://gist.github.com/fredyr/7008646

11:06 got a seq to many, i see now tho

11:24 muhoo: it'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:25 *nrepl-error* is nicely colorized, but manually digging around in a large project for that source file and line is getting really tedious

11:33 also, isn't reduce-kv just sugar for not having to do (fn [all [k v]] ...) destructuring on a map?

11:33 TEttinger: muhoo, I think it has more utility when using existing functions

11:33 rather than lambdas

11:34 muhoo: makes sense, the shape of it is similar to assoc then

11:34 TEttinger: though I can't think of many existing clojure.core functions that take [all k v]

11:39 llasram: assoc?

12:13 gfredericks: is there a map literal that will OOM at read-time due to pathological hash collisions?

12:13 * gfredericks doesn't know exactly how the hash map is implemented

12:16 justin_smith: webapp 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:17 it could potentially simplify our deployment to do things that way, so I am tempted

12:20 arrdem: gfredericks: php is the only language where I've seen an attack like that

12:21 gfredericks: but I'm sure there exists one

12:21 gfredericks: arrdem: I thought there was one in ruby recently that caused them to add process-level-randomness to the hash function

12:22 arrdem: gfredericks: 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:23 gfredericks: yeah that ruby change was back in '11

12:25 justin_smith: http://stackoverflow.com/questions/8669946/application-vulnerability-due-to-non-random-hash-functions relevent SO on security of java hash

12:27 pragmatically 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:27 hiredman: /win 15

12:27 justin_smith: (usually this is a web app exploit)

12:28 Wild_Cat`: I thought DDOS attacks on hashmaps exploited time complexity rather than memory?

12:29 (as in, force the maps to degenerate into linked lists)

12:29 arrdem: Wild_Cat`: lookup time complexity yes, and typically memory at the same time.

12:29 Yiam: hello

12:30 is it possible to use custom cell renderer with tables in seesaw?

12:33 tcrawley: does anyone know if there is already a clojure wrapper around java.nio.file.*?

12:35 arrdem: tcrawley: someone was kicking around Raynes fs wrapper a few days ago, dunno if it helps tho.

12:36 tcrawley: arrdem: thanks. I think that just uses commons-io. I need to use java.nio.file.Files, since it can copy and preserve permissions

12:36 pandeiro: any cljs/emacs people know if clojurescript-mode treats #() fn syntax correctly? (ie, paredit doesn't force a space between the # and ( )

12:36 tcrawley: I can use it directly, of course. but it would be nice if some of the javaness was hidden

12:37 technomancy: pandeiro: I don't know much about cljs, but afaik clojurescript-mode is deprecated

12:38 pandeiro: technomancy: thanks, what is recommended?

12:38 clojure-mode?

12:38 clojurebot: clojure-mode is an Emacs mode for Clojure, found at git://github.com/jochu/clojure-mode.git

12:38 dnolen: pandeiro: clojure-mode works fine

12:40 gfredericks: every 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:41 holo: hi

12:42 technomancy: heh; jochu's repo.

12:43 arrdem: is there a "best practice" for structuring a protocol and several implementing records? throwing them all linearly in a single file just feels... wrong.

12:43 holo: ,(re-seq (re-pattern "[\b]") "\b")

12:43 clojurebot: ("\b")

12:44 holo: ,(re-seq #"[\b]" "\b")

12:44 clojurebot: #<SecurityException java.lang.SecurityException: denied>

12:44 holo: supposed to output:

12:44 [\b]

12:44 ^ java.util.regex.Pattern.error

12:45 gfredericks: holo: what's that supposed to mean? \b is not a character class

12:45 ,"\b"

12:45 clojurebot: "\b"

12:45 gfredericks: ,(int (first "\b"))

12:45 clojurebot: 8

12:46 arrdem: ,(map int "\b")

12:46 clojurebot: (8)

12:48 gfredericks: ,(re-seq #"[\u008x]" "\b")

12:48 clojurebot: #<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class java.util.regex.PatternSyntaxException>

12:48 gfredericks: &(re-seq #"[\u008x]" "\b")

12:48 lazybot: java.util.regex.PatternSyntaxException: Illegal Unicode escape sequence near index 6[\u008x] ^

12:48 holo: gfredericks, i expected a consistent behaviour. error on none or all. i don't know much of the theory behind it

12:49 hiredman: clojurebot: weirdo

12:49 clojurebot: No entiendo

12:49 justin_smith: ,(count "\b")

12:49 clojurebot: 1

12:50 gfredericks: holo: \b is special for regexes, signifying word boundary

12:50 not sure how to match a "\b" character

12:50 holo: gfredericks, re-pattern does

12:50 gfredericks: ooh I didn't see you were pointing out a difference

12:50 so that makes sense to me actually

12:51 pandeiro: technomancy: what's the recommended way to kill a lein repl :headless instance?

12:51 gfredericks: ,(re-seq (re-pattern "[\\b]") "\b")

12:51 clojurebot: #<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class java.util.regex.PatternSyntaxException>

12:51 gfredericks: holo: ^ there's the equivalent error with re-pattern

12:51 the difference is regarding what the string looks like at the time it gets parsed into a regex

12:51 justin_smith: ,(re-matches (re-pattern "\\\b") "\b")

12:52 clojurebot: "\b"

12:52 dnolen: arrdem: put your protocols in a separate namespace

12:52 gfredericks: in your re-pattern version, there's an actual bell character in the string. in the #"" version, there's a backslash and a b

12:52 Yiam: helo?

12:53 how can i make my flow-panel in seesaw vertical scrollable only?

12:53 arrdem: dnolen: hum... ok, thanks.

12:54 Yiam: when i'm just invoking scrollable at it, it just scrolls horizontally and items are just in line

12:54 dnolen: arrdem: 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:55 arrdem: I've gotten into some trouble mixing convenience ctor fns in same file as deftypes - creates interdependencies that are best avoided IMO

12:55 justin_smith: Yiam: 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:55 arrdem: dnolen: is there a defrecord option to kill off ->Foo?

12:56 dnolen: arrdem: there isn't, I actually think the automatically generated ctors fns were a whopping bad idea, I never use them.

12:56 arrdem: never mind, that's silly.

12:56 gfredericks: &(re-seq #"[\\b]" "\b")

12:56 lazybot: ⇒ nil

12:56 arrdem: dnolen: some days agreed.

12:56 dnolen: thanks for the feedback.

12:56 holo: gfredericks, what makes you say there's a bell character in one, but \ and b in the other?

12:56 gfredericks: dnolen: I'm curious why -- I thought it was useful to use vars by default, for aspect-oriented purposes

12:57 holo: gfredericks, for me they are composed the exact same way

12:57 dnolen: gfredericks: just the modularity problem, assumes the ctors and deftypes need to live in the same place.

12:57 gfredericks: holo: in one the conversion from string to regex happens at read-time, in the other at runtime

12:57 dnolen: same "place" meaning same namespace?

12:57 dnolen: gfredericks: yes

12:57 gfredericks: hmm

12:58 justin_smith: holo: you can see by what they match

12:58 holo: gfredericks, you rock too much

12:58 justin_smith: (re-pattern "\\\b") matched "\b", it has a bell in it

12:59 gfredericks: justin_smith: oh that's why that worked

13:01 justin_smith: yeah, it seems the regex reader is less expressibe than the string reader

13:01 *expressive

13:03 bosie: how would i require this http://www.versioneye.com/clojure/webmine:webmine/0.1.1

13:03 bordatoue: could 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:05 arrdem: bosie: https://clojars.org/webmine is the same library... note that it's clojure 1.2 based.

13:06 justin_smith: bosie: based on the pom.xml snippet I would say [webmine/webmine "0.1.1"]

13:06 it is [groupId/artifactId "version"] in general with lein

13:07 bosie: ok

13:07 arrdem: bosie: I would question whether this is really the library you want to use... it's quite old by Clojure standards.

13:08 bosie: arrdem: i looked at enlive but cant make any sense out of it

13:09 arrdem: bosie: are you trying to do .. parsing? generation?

13:09 cdombroski: bordatoue: wouldn't that just be [:tr {:style "background-color=blue"} [:td content]]?

13:09 arrdem: bosie: enlive is a CSS _generation_ toolkit. this is a feed _parsing_ toolkit.

13:09 bosie: arrdem: i am trying to parse html files and extract links

13:09 Creap: bordatoue: it would be way easier to use css. tr:nth-child(odd)

13:09 bosie: arrdem: yes but enlive should be able to parse and select too... no?

13:10 arrdem: bosie: it looks like it can..

13:10 dnolen: arrdem: not CSS, HTML really

13:10 arrdem: bosie: clj-tagsoup and clj-http is the library pair that I default to for this sort of job.

13:10 bordatoue: cdombroski: Creap , is there any documents on how to apply style in hiccup

13:10 arrdem: dnolen: ok. I haven't worked with enlive yet.

13:11 bosie: arrdem: i got clj-tagsoup running and it parses everything just fine

13:11 arrdem: the selection though is odd

13:11 justin_smith: bosie: 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:11 bordatoue: cdombroski: i tried {bgcolor: blue} but it didn't work

13:11 arrdem: bosie: are you looking for selection by ID, class and soforth?

13:12 bosie: because that's probably gonna be an enlive job. that'll be.. awkward with clj-tagsoup

13:12 for awkward defined as "you'll have to build it".

13:12 justin_smith: bosie (-> (java.net.URL. enlive/html-resource

13:12 err

13:13 s4muel: bosie: Have a look at laser. https://github.com/Raynes/laser/blob/master/docs/guide.md

13:13 justin_smith: bosie (-> (java.net.URL. "http://example.com") enlive/html-resource (data ops go here) enlive/emit* #(apply str %))

13:13 bosie: arrdem: or just extract all links and let me filter it based on the actual link

13:15 arrdem: bosie: 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:15 bosie: then you can just (filter) that sequence.

13:17 bosie: hm

13:20 justin_smith: repeating 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:21 technomancy: justin_smith: not totally crazy, but I'd recommend an uberjar+jetty over lein-ring

13:22 arrdem: justin_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:22 justin_smith: the uberjar+jetty approach seems the more "production ready" one.

13:24 justin_smith: pragmatically: 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:24 technomancy: using leiningen in production is really hard to do right

13:25 arrdem: technomancy: what does uberjar+jetty buy you?

13:25 technomancy: I mean, there are lots of subtle ways to screw it up

13:25 arrdem: dependencies are fixed at deploy time; there's no chance of anything new sneaking in and getting an inconsistent state across the cluster

13:25 plus you can't accidentally pull in dev profiles

13:26 justin_smith: OK, thanks

13:26 yeah, that does make sense

13:27 arrdem: technomancy: given how much stuff I have in my .lein/profile that's probably valuable...

13:27 justin_smith: I'll just use fabric and make the uberwar, the nginx config, and the varnish config into three seperate deploy targets in jenkins

13:28 unless there is a good clojure replacement for fabric

13:31 warpy: dark_element: hi

13:34 dnolen: 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:36 Pupnik_: warpy: have you tested it on firefox? it is non-responsive for me

13:36 arrdem: Pupnik_: I can confirm

13:36 warpy: Pupnik_: oh no, i didnt. i just made it run on chrome

13:36 arrdem: warpy: [11:59:26.950] TypeError: a is undefined @ http://abhinavsarkar.net/frpong/js/frpong.js:293

13:36 * arrdem opens an issue for github cred

13:37 dnolen: warpy: nice, why didn't you just use the fns provided by core.async itself?

13:37 i.e. the stuff in signals

13:37 warpy: uh, i dont want to fix it for firefox right now. maybe i should put up a disclaimer on the page.

13:37 dnolen: because i wanted it to read as a dsl for signals

13:38 i wrapper the core.async functions and macros in my own with more suitable names

13:38 dnolen: warpy: so it's just different names not different functionality?

13:38 warpy: ya

13:38 dnolen: warpy: k, don't see the point though.

13:39 warpy: i feel it is easier to understand

13:40 i had to write some functions to sample channels etc

13:41 sample, sustain etc

13:41 that was quite interesting

13:43 dnolen: so would you call this flow based programming or functional reactive programming?

13:43 dnolen: warpy: CSP is very closely related to dataflow programming, this has been know for a long time now as far as I know

13:44 warpy: i see

13:44 dnolen: warpy: 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:45 warpy: but as you've probably discovered you can model FRP like things pretty easily with CSP yet easily drop down

13:45 warpy: not see easy in FRP if the implementation doesn't ship lower level primitives

13:45 "not see easy" -> "not so easy"

13:46 coventry: gfredericks, arrdem: How can a hash collision attack hose the memory?

13:46 arrdem: coventry: hosing access time is easy.. some hashtables do collision escaping by using nested hashtables, with a potentially large basic size.

13:47 coventry: this means that if you nest enough collisions you can force the creation of thousands of sparse hashtrees

13:47 coventry: repeat until you run out of RAM and swap :D

13:48 coventry: Interesting. Thanks.

13:48 `cbp: Hi, 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:50 technomancy: `cbp: that's not a thing you can do

13:51 `cbp: well shucks

13:51 technomancy: that would be like asking a character in a book what he thought about the author

13:52 coventry: I'm pretty sure that's been done, but it's terribly narcissistic. :-)

13:52 technomancy: `cbp: sorry, do you mean a repl on the project or a repl into leiningen itself?

13:52 `cbp: technomancy: I basically cloned a plugin repo, made some changes and wanna use the plugin with the changes on a project

13:53 technomancy: `cbp: oh, gotcha. you should be able to use `lein install`

13:53 `cbp: technomancy: thanks

14:09 pandeiro: repeating my question above: is there any way provided by lein to kill a lein repl :headless process?

14:10 technomancy: pandeiro: `echo "(System/exit 0)" | lein repl :connect` maybe?

14:10 not sure that would work

14:10 lein update-in : conj :eval-in :nrepl -- run -m clojure.main/main -e "(System/exit 0)"

14:11 justin_smith: pandeiro: connect and send (System/exit 0) or send a kill via sh

14:12 pandeiro: technomancy: justin_smith: cool that works, i will create a bash function or something

14:12 justin_smith: or what he said

14:12 technomancy: pandeiro: which?

14:12 pandeiro: technomancy: your first suggestion, like justin_smith's

14:12 technomancy: oh cool

14:13 pandeiro: produces ugly output but that is fine

14:13 (it causes a SocketException...)

14:13 technomancy: never sure how stdin is going to behave with lein

14:14 justin_smith: this totally worked here: echo '(System/exit 0)' | lein repl :connect 4014

14:14 technomancy: I think there's an open issue for the SocketException

14:14 pandeiro: `lein repl :disconnect 4014` would be nice sugar i think

14:15 technomancy: it's not disconnecting though

14:15 justin_smith: the magic port number is the only drawback with that I guess

14:15 pandeiro: technomancy: you're right... :stop ?

14:15 coventry: pandeiro, justin_smith: That's available in /project/path/.nrepl-port.

14:16 technomancy: `lein repl :stop` isn't a bad idea

14:17 would take a pull req for that

14:18 justin_smith: coventry: not for me, I start nrepl within my app

14:18 unless I create that file myself I guess

14:18 maybe that wouldn't be a half bad idea actually

14:19 maku_: 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:20 coventry: justin_smith: Should work for pandeiro's case though.

14:21 pandeiro: coventry: i couldn't find the .nrepl-port file...

14:21 technomancy: pandeiro: target/repl-port on older versions

14:22 justin_smith: yeah, absolutely

14:23 and I am tempted to hack in the creation of that file myself, least-surprise for other devs and all

14:23 pandeiro: how are you starting the repl?

14:25 pandeiro: justin_smith: i start it from .xinit actually, specifying the port number, so it's not an issue

14:25 for me, in this case

14:28 justin_smith: maybe providing the explicit port arg prevents creating the .nrepl-port file?

14:29 dnolen: maku_: ((aget js/window "someName") ...)

14:30 hiredman: dnolen: assuming you haven't compiled in advanced mode

14:31 jcromartie_: how can I generate Swagger documentation from Compojure routes? I'm leaning towards an approach with side effects unfortunately

14:32 I see https://github.com/narkisr/swag

14:32 maku_: dnolen: Thanks so much!

14:32 bitemyapp: jcromartie_: why would you need "side effects"?

14:32 jcromartie_: can't you just gather the Compojure routes and generate the documentation?

14:33 tbaldridge: hiredman: I missed the original context, why won't david's code work in adv mode?

14:33 bitemyapp: also I'm glad to see there's a Clojure library for Swagger, pretty cool.

14:33 jcromartie_: routes are just functions after all, I suppose

14:33 hiredman: tbaldridge: because your function names won't exist

14:33 jcromartie_: I could just have decorator functions that attach metadata to them and collect up the operations into a resource

14:34 tbaldridge: ah, so this is something the user has added to js/window I assume

14:34 hiredman: foo.bar/fobnabricator will be f

14:34 no, he wants to lookup a function by name at runtime

14:35 tbaldridge: right, that was the context I was missing, thanks

14:35 jcromartie_: but Compojure routes are pretty opaque, there's nothing like "rake routes" for a compojure app unless you do something quite fancy

14:35 dnolen: maku_: as hiredman says, that only works for JS outside the advanced compilation process, which is what I assumed you were asking about.

14:37 glosoli: damn friggin nrepl package got renamed ;/

14:37 for emacs

14:37 pandeiro: i'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:38 bitemyapp: glosoli: http://marmalade-repo.org/packages/nrepl it did?

14:38 dnolen: pandeiro: you have a stale tools.reader dependency, or some other lib is bringing in the wrong one.

14:38 glosoli: bitemyapp: https://github.com/clojure-emacs/cider :)

14:38 pandeiro: dnolen: thanks

14:39 bitemyapp: glosoli: http://marmalade-repo.org/packages?q=cider Iuno.

14:40 glosoli: bitemyapp: I believe marmalade isn't synced real time, is it :?

14:40 bitemyapp: glosoli: marmalade is some manner of JS nonsense. I don't know how it works.

14:40 technomancy: marmalade is for stable releases

14:41 the rename just happened today; hasn't been released yet

14:41 bitemyapp: github 500'ing, can't see this cider repo. mfw.

14:41 hiredman: :(

14:41 bitemyapp: technomancy: what precipitated it?

14:41 technomancy: I dunno

14:41 bitemyapp: can I pay for premium access to a github that doesn't break?

14:42 hiredman: here is to renaming projects instead of fixing architectural problems

14:42 bitemyapp: ^^ what he said.

14:42 technomancy: nie mój cyrk, nie moje małpy

14:43 hiredman: feh, right...

14:43 glosoli: technomancy: polak ?

14:43 or what is it :?

14:43 technomancy: glosoli: yeah, polish I think

14:43 bitemyapp: aye, it's polish.

14:43 glosoli: nice huh

14:44 technomancy: I have some 1/8th polish blood but don't speak it beyond that phrase

14:44 glosoli: lol

14:44 technomancy: which is the best possible polish phrase

14:44 glosoli: technomancy: iirc it's actually Russian phrase :D

14:44 At least that's how I heard it the first time

14:44 bitemyapp: it's famous in the West for being a Polish phrase

14:44 glosoli: aaa

14:45 then Polish it is :D

14:46 pandeiro: weird, i did `lein clean` and searched `lein deps :tree` for tools.reader and nothing else is bringing it in...

14:49 scriptor: anybody remember that project that was introduced regarding source code history tracking

14:49 coventry: codeq?

14:49 scriptor: yep, that's it, thanks

14:52 dnolen: pandeiro: what version of tools.reader does is being depended on?

14:52 ta479: in counterclockwise's repl, does it support something like pressing up in a terminal to get the last commands entered?

14:53 coventry: Why the rush to upgrade to the latest nrepl? Am I missing out on anything good?

14:53 glosoli: probably not

14:55 bitemyapp: really? we're just going to rename everything from nrepl-* to cider-*?

14:55 oh oh, even better, some stuff is cider and some stuff is nrepl.

14:55 This is going to be great.

14:56 glosoli: yeah..

14:59 jcromartie_: 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:59 at the top level is a "resource listing" which is a set of "APIs", which each have a set of "operations"

15:00 I was with you up through the resource listing

15:00 I think Swagger is brought to you by the same folks that think "REST" means "pretty URLs"

15:09 cemerick: ta479: Ctrl-Up, last I knew

15:10 ta479: cemerick: I'm assuming that's cmd+up on mac and it doesn't work

15:10 cemerick: ta479: no, Ctrl-Up, even on macs.

15:11 I haven't used ccw in a little bit, so that might be wrong, but that's what it was for a long time.

15:12 ta479: 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:12 ta479: okay thanks, had to remove conflict with system shortcuts

15:12 glosoli: ta479: Mission COntrol went mad yes ? :D

15:13 ta479: cemerick: 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:13 glosoli: yes

15:16 cemerick: ta479: nope, haven't seen taht

15:30 ta479: CCW doesn't autocomplete java?

15:43 pandeiro: dnolen: 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:44 ...and lein deps :tree shows none of my other deps depending on tools.reader, so i have no idea what is conflicting

15:48 jtoy: if 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:49 mdrogalis: jtoy: Use a map and look it up.

15:49 {"myfunc" myfunc}

15:49 dnolen: pandeiro: 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:49 mdrogalis: You can use apply to make a pretty clean transition. It's quite nice.

15:49 jtoy: mdrogalis: I dont understand your example of use a map there

15:50 xeqi: cemerick: should I have any concerns that piggieback and cljsbuild use different directories for their build directories?

15:50 jtoy: I think I need something like: ((read-string "myfunc") {:foo 2 :bar 3})

15:51 mdrogalis: jtoy: https://gist.github.com/MichaelDrogalis/7013173

15:51 cemerick: xeqi: don't think so; why would you?

15:51 xeqi: cemerick: I haven't come up with a reason yet, just something I noticed

15:58 amalloy: jtoy: 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:58 rhg135: hello, is anybody here experienced with complex formats in aleph?

15:58 amalloy: ~anyone

15:58 clojurebot: Just 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:58 amalloy: and formats are really more of a gloss thing than an aleph thing

15:58 rhg135: for some reason the spec im using doesn't delimit messages

15:59 ok gloss

15:59 instead of being sane and putting a delimite they decide to just send it all undelimited

16:00 makes it difficult to parse

16:01 jtoy: amalloy: all the code that wil be evaled is code that I choose

16:01 amalloy: in that case, choose to have something better than strings - for example, functions :P

16:02 mdrogalis: Hah

16:04 jtoy: amalloy: im using strings because I run a bunch of tests and i store teh function name in a database

16:05 amalloy: well, you'll have to store them namespace-qualified, and then use either eval or resolve to look them up, as i said

16:05 mdrogalis: jtoy: It might be easier to go the other way around if you can

16:05 ta479: anyone using La Clojure know how to set the native path for REPL?

16:05 mdrogalis: You can derive the name of a function as a string

16:06 ta479: the java.library.path

16:06 jtoy: mdrogalis: how so? Im not following

16:08 mdrogalis: ,(:name (meta #'inc))

16:08 clojurebot: inc

16:12 rhg135: the 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:13 hiredman: rhg135: just make an inputstream that reads chars from a channel

16:13 rhg135: how?

16:13 clojurebot: with style and grace

16:13 rhg135: and?

16:14 hiredman: I dunno what your confusion is there

16:14 technomancy: clojurebot: style and grace and inputstreams

16:14 clojurebot: I don't understand.

16:14 hiredman: there is a class InputStream, which can be adapted to be the input for just about any json library you want

16:15 rhg135: the cannel owuld produce one char at a timei cant map over it

16:15 clojurebot: Titim gan éirí ort.

16:15 rhg135: cchannel*

16:15 hiredman: you can implment an inputstream that produces characters read from a channel

16:16 rhg135: as in write from scratch but following an interface

16:16 ?

16:21 llasram: rhg135: 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:21 stream even

16:22 yedi: core.async is def clojurescripts killer app

16:22 rhg135: ah ic now

16:23 also id like to return utf-8 chars and this is for byte's

16:23 is there a similar class

16:23 yedi: itd be cool of cljsfiddle had a browsable interface

16:23 scriptor: browsable interface?

16:24 dnolen: yedi: you should let jonasen know

16:24 scriptor: if you could browse other people's fiddles?

16:24 dnolen: when he's around

16:24 llasram: rhg135: There's Reader is the same thing but for character streams instead of byte streams.

16:25 rhg135: thx

16:25 llasram: rhg135: But it may depend on the JSON library -- IIRC e.g. cheshire only supports InputStreams

16:25 rhg135: that sounds nice

16:25 im using data.json

16:25 llasram: Oh, cool -- those can use a Reader

16:26 So 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:26 rhg135: it is sad how much complexity is inherited from java

16:27 technomancy: uuuuh streams vs readers is a really important ditinction

16:27 distinction

16:27 llasram: Hmm. 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:27 rhg135: thats true

16:28 technomancy: it's basically impossible to write nontrivial ruby programs that don't have encoding bugs

16:29 rhg135: ya in oython encoding is a pita

16:29 even more so if you use python2

16:29 llasram: Yeah. At Damballa the appliance team just squishes everything to "ASCII-8bit" and ignores it

16:29 Also, "ASCII-8bit"

16:29 cemerick: xeqi: 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:29 technomancy: llasram: it'll be fiiiiiine

16:29 rhg135: i'm a more 'forget it, im using utf-8'

16:30 technomancy: http://p.hagelb.org/mal.gif

16:30 llasram: heh

16:30 hyPiRion: that's why we use UTF-16 in java

16:30 rhg135: it's mostly ascii compatible and if we ever add another language itll work

16:30 llasram: Poor Java, trying to be ahead of it's time...

16:31 UTF-16 characters and millisecond-resolution timestamps

16:31 rhg135: not optimized but will work

16:32 pjstadig: i was just this morning considering the idea of using (vector-of :byte ...) to represent ASCII strings in a more compact format

16:32 bonus: equality doesn't suck (c.f. byte arrays)

16:32 bitemyapp: pjstadig: more compact?

16:32 hyPiRion: than strings

16:33 technomancy: you could steal jruby's string implementation, but they're mutable

16:33 pjstadig: bitemyapp: 8-bits per character instead of 16-bit

16:33 hiredman: which is not a bad idea, because with vector-of you can get structural sharing

16:33 bitemyapp: hyPiRion: than UTF-16 strings maybe

16:33 hyPiRion: bitemyapp: than java strings?

16:33 bitemyapp: which are UTF-16

16:33 llasram: Doesn't Java 7+ use UTF-8 bytes internally under ASCII conditions?

16:33 hyPiRion: yeah, exactly

16:33 bitemyapp: llasram: news to me

16:33 pjstadig: llasram: oh does it?

16:33 i thought it was UTF-16 everywhere

16:33 llasram: Hmm, maybe I'm mistaken. Trying to find the reference

16:33 technomancy: whoa, really?

16:33 bitemyapp: I typically default to utf-8, but I know I don't really have a choice in Java.

16:34 rhg135: hmm, it seems i can implement a reader or a stram but which is better/simpler/easier?

16:34 technomancy: that would be awesome if it worked

16:34 seems like it would wreak havoc with JNI and stuff though

16:34 hyPiRion: hah, yeah

16:34 danlarkin: the jvm is all utf16 afaik

16:34 clojurebot: 'Sea, mhuise.

16:35 technomancy: at least dalvik uses utf-8 internally

16:35 pjstadig: ~suddenly

16:35 clojurebot: BOT FIGHT!!!!!111

16:35 bitemyapp: technomancy: apparently -Dfile.encoding=ISO646-US -Dsun.jnu.encoding=ISO646-US to produce UTF-8 is a thing.

16:35 pjstadig: wut

16:35 technomancy: clojurebot: forget the jvm

16:35 clojurebot: Gabh mo leithscéal?

16:35 pjstadig: ~suddenly

16:35 clojurebot: BOT FIGHT!!!!!111

16:35 bitemyapp: technomancy: those ISO standards are ascii, but the JVM uses UTF-8 when asked to use ASCII.

16:35 technomancy: clojurebot: forget the jvm |is| all utf16 afaik

16:35 clojurebot: I forgot that the jvm is all utf16 afaik

16:35 technomancy: bitemyapp: right, I'm thinking of internal representation

16:36 bitemyapp: technomancy: that's -Dsun.jnu.encoding= I think.

16:36 llasram: Ok, I was wrong

16:36 bitemyapp: oh.

16:36 technomancy: oh, huh

16:36 bitemyapp: god dammit.

16:36 llasram: There was a Java 6 version to use compressed strings which some page of esoteric Java options mentioned was enabled by default

16:36 pjstadig: strings are a wrapper around a char array and chars are 16-bit

16:36 llasram: It apparently caused problems and was disabled and deprecated

16:36 pjstadig: haha

16:36 rhg135: in an ideal world the json message would be \0 delimited and in edn but sigh

16:37 llasram: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7129417

16:37 hyPiRion: In an ideal world you wouldn't have to do ./configure before make

16:38 danlarkin: I don't even understand this conversation

16:38 what am I doing here

16:38 rhg135: that too

16:38 but this standard is so new that i should be able to bend it to my will

16:39 whether i should is another question

16:40 bitemyapp: danlarkin: this is the land of Dayman

16:40 danlarkin: who fights the nightman...dunnnnnnn

16:41 arrdem: bitemyapp: except that the Sun and Day lost and left us to the tender care of the Oracle who dwells in darknes...

16:42 bitemyapp: arrdem: new mouse is fantastic btw.

16:42 arrdem: Steelseries Sensei raw. Less hiccuping, more sensitive.

16:42 arrdem: bitemyapp: cool!

16:43 rhg135: im still confused though, how can i get a channel of maps from a channel of json formatted strings from a channel of bytebuffers

16:43 bitemyapp: rhg135: what's with the word channel?

16:43 llasram: bitemyapp: lamina/aleph

16:43 rhg135: thats the word aleph uses

16:44 bitemyapp: (-> payload (String. "utf-8") (parse-string))

16:44 rhg135: ^^

16:44 rhg135: but what if the bytes arent even enough for a string

16:45 or not valid json

16:45 indigo: rhg135: How goes the API

16:45 rhg135: bad

16:45 bitemyapp: bytes aren't even enough for a string? then let it break.

16:45 rhg135: i would rewrite it if i was good at api design

16:45 bitemyapp: throw an exception.

16:45 reject the message, send back an error, whatever.

16:46 rhg135: i mean messages aren't delimited

16:46 * indigo throws an exception at bitemyapp

16:46 indigo: :)

16:46 arrdem: indigo, bitemyapp: (trace-form (com.xtructure.graphs.misc/benchmark-hash (com.xtructure.graphs/make-bundle [:a :b :c] [[0 1 2]]) 50))

16:46 shit.

16:46 http://somethingofthatilk.com/?id=202

16:46 rhg135: in 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:47 llasram: rhg135: If you can switch to cheshire, it actually has a function to read an otherwise-undelimited sequence of JSON objects from an InputStream

16:47 bitemyapp: rhg135: haha, what?

16:47 indigo: arrdem: Haha, awesome

16:47 bitemyapp: rhg135: messages aren't delimited? wtf

16:47 rhg135: ik

16:47 llasram: rhg135: So then you just need to translate your channel of bytes -> InputStream

16:47 bitemyapp: rhg135: did Node.js devs "design" this protocol?

16:47 indigo: rhg135: Are you sticking with JSON or what

16:47 rhg135: i tried to tell the other guys

16:47 the other ppl aren't enlightened

16:48 one even likes c

16:48 llasram: To be fair, C is pretty awesome at what C is awesome at

16:48 rhg135: yup

16:48 but its fragile as possible

16:49 bitemyapp: nah there are more fragile things than C

16:49 rhg135: one slight mistake and it segfaults, or fails mysteriously

16:50 bitemyapp: rhg135: valgrind helps a lot there.

16:50 coventry: So does gdb.

16:50 rhg135: well json is an improvement over xml

16:51 xmpp anybody? lol

16:52 bitemyapp, and yes they do use node

16:52 bitemyapp: knew it.

16:52 rhg135: i only found out after most of it was written

16:55 wink: I don't like xml either, but I see nothing wrong for xmpp

16:56 rhg135: yeah im just going to bend this to my will to show them why they should listen to rhg135

16:56 wink: json has no comments, that really sucks

16:56 at least as a config format

16:56 rhg135: ill use edn tho

16:57 extensible as possible

16:59 ta479: I'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:00 llasram: ta479: 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:00 But it wouldn't be too complicated. See `clojure.reflect`

17:02 ta479: llasram: does that have a speed penalty

17:03 coventry: Reflection would be done at compile time. I would expect the JIT to optimize the function calls away, but don't know for sure.

17:04 llasram: ta479: 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:04 Oh, and what coventry said about the reflection in the first place

17:05 yedi: what are magic keys?

17:05 llasram: They unlock magic doors

17:06 jtoy: why cant a pass a map object to this function? https://www.refheap.com/19878 and how do i change it so i can?

17:06 rasmusto: jtoy: drop the &

17:06 or apply your function to a map

17:07 ,(apply (fn [& {:keys [a b] :or {a 3}}] [a b]) {:b 2})

17:07 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: [:b 2]>

17:07 jtoy: dropping the & just means the hash-map is required?

17:08 rasmusto: ,(apply (fn [& {:keys [a b] :or {a 3 :b 4}}] [a b]) {:b 2})

17:08 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: [:b 2]>

17:08 rhg135: yes

17:08 rasmusto: ,(apply (fn [& {:keys [a b] :or {a 3 b 4}}] [a b]) {:b 2})

17:08 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: [:b 2]>

17:09 rasmusto: oh, maybe I'm wrong about the application thing

17:09 ,(apply (fn [& {:keys [a b] :or {a 3 b 4}}] [a b]) (apply concat {:b 2}))

17:09 clojurebot: [3 2]

17:10 rasmusto: yeah, using the & means that you're expecting an even number of key-value pairs to be passed in to the function

17:11 so you'll have to pull them out of the map yourself and apply the function to the resulting collection

17:11 jtoy: rasmusto: but i do pass it in , im still not clear on why dropping & fixes it, but I will just use it

17:11 rasmusto: ,((fn [{:keys [a b] :or {a 3 b 4}}] [a b]) {:b 2})

17:11 clojurebot: [3 2]

17:11 ta479: llasram: 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:12 jtoy: ,((fn [{:keys [a b] :or {a 3 b 4}}] [a b]) {})

17:12 clojurebot: [3 4]

17:12 rasmusto: jtoy: the & implicitly turns everything after it into a seq, so you'd have to expand the map before its passed in

17:12 or else you get a seq with a map in it, and then the :keys destructuring doesn't work

17:13 I hope this is making sense, I've noodled around with it, but I'm far from an expert on the topic

17:13 jtoy: yes, appreciate it rasmusto

17:15 coventry: ,((fn [& t] t) {:foo 'bar})

17:15 clojurebot: ({:foo bar})

17:15 Jarda: ,(:foo {:foo "bar"})

17:15 clojurebot: "bar"

17:15 Jarda: cool

17:19 coventry: ,((fn [& [{:keys [foo]}]] foo) {:foo 'bar})

17:19 clojurebot: bar

17:19 pcarrier: 11:02:00 <glosoli> damn friggin nrepl package got renamed ;/

17:19 11:02:03 <glosoli> for emacs

17:19 ^ anybody knows more?

17:20 glosoli: pcarrier: Yeah, it got renamed and won't appear in melpa for some time.

17:20 yedi: lol llasram i hate you

17:20 glosoli: When it does you will be required to rename your configs

17:20 :)

17:20 technomancy: or just keep using the old package

17:20 glosoli: technomancy: I tend to get fixes from time to time :)

17:20 arrdem: ppft stability. why would you ever want that.

17:20 coventry: jtoy: The example I just sent to clojurebot answers your original question.

17:21 pcarrier: renamed from->to?

17:21 technomancy: pcarrier: https://github.com/clojure-emacs/nrepl.el/issues/375

17:22 Jarda: ,((fn [{:keys [foo bar]}] (str foo bar)) {:foo "Foo", :bar "Bar"})

17:22 clojurebot: "FooBar"

17:22 glosoli: to cider lol

17:22 Jarda: how many possible ways is there to destructure input..

17:22 BobSchack: yeps

17:22 yedi: but srsly, what are magic keys?

17:23 this post talks about em: http://teropa.info/blog/2013/10/14/euroclojure-2013-common-clojure-smells.html

17:23 coventry: Jarda: http://clojure.org/special_forms#Special Forms--Binding Forms (Destructuring)

17:24 Jarda: coventry: I guess the answer to my question is "if it can be imagined, it can be destructured"

17:25 gfredericks: yedi: I think it just means making implicit assumptions about the shape of your data everywhere

17:25 rather than in some contained place, like a single namespace

17:25 tbaldridge: I disagree with that part of the article.

17:25 What's better about foo.bar.baz in OOP vs (-> mp :foo :bar :baz) ?

17:26 gfredericks: tbaldridge: well if it's a static language then at least you have some auto-checks

17:26 technomancy: tbaldridge: arguably foo.bar.baz is a law of demeter violation

17:26 tbaldridge: it's the same problem that any dynamic language has, changing the name of a thing can cause problems....

17:27 gfredericks: well compare ruby where you're using methods and you get a method not found error

17:27 vs clojure where you often don't distinguish between key-is-nil and key-is-wrong

17:27 tbaldridge: don't store nil in a map, problem solved :-P

17:27 gfredericks: well maybe not intentionally

17:27 that doesn't make it impossible

17:28 tbaldridge: but seriously, I rarely see this problem in day-to-day use.

17:28 technomancy: do you use preconditions everywhere?

17:28 gfredericks: and so when nil comes up I still don't off the bat know whether I got the key right or not

17:28 tbaldridge: technomancy: no, I just very rarely need to go and do a system wide rename of a keyword

17:29 technomancy: unexpected nil leakage is probably the main clojure-specific source of bugs IME

17:29 gfredericks: even if you don't need to do a rename, just the possibility of typos with bizarre effects is significant

17:29 * technomancy wish not-found behaviour defaulted to throwing

17:30 technomancy: because it's so easy to put in a sensible default in the rare case where you want one

17:30 * brehaut wishes nil wasnt a value

17:30 gfredericks: technomancy: yeah I wish that sometimes too

17:30 tbaldridge: technomancy: oh heck no, if that was in Clojure I'd fork it and change it back.

17:31 rasmusto: coventry: ah, thanks for the destructuring examples, I knew there was something funny about the apply + apply concat business I was messing with

17:31 gfredericks: prismatic has their safe-get, but there's no analog for (:foo m) style

17:31 technomancy: brehaut: add tha tto the list of historical mistakes you'd fix if you had a time machine after visiting Brendan Eich

17:31 yedi: gfredericks tbaldridge technomancy: this issue goes away by leveraging core.typed right?

17:31 brehaut: gfredericks: core.typed and hmaps!

17:31 coventry: rasmusto: No worries, I wouldn't have thought of that unless I'd seen the way you were playing with ith.

17:31 tbaldridge: that's the one thing I hate about python, any get can throw an exception.

17:31 technomancy: yedi: yes, if you sink a lot of work into it

17:31 gfredericks: tbaldridge: do you often meaningfully have missing keys?

17:32 technomancy: fixing keywords would get you that for free across the board

17:32 brehaut: technomancy: i've made a note

17:32 tbaldridge: gfredericks: 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:32 riley526: tbaldridge: {}.get('nothing') returns None

17:32 gfredericks: tbaldridge: if you don't have meaningfully missing keys then when would the auto-throw feature bother you?

17:32 riley526: but yeah, {}['nothing'] does raise

17:33 tbaldridge: gfredericks: 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:33 coventry: riley526, tbaldridge: Unless you use a collections.default_dict or whatever it's called.

17:33 tbaldridge: , (or (:a {}) (:b {:b 42}))

17:33 clojurebot: 42

17:33 riley526: defaultdict, yeah

17:35 gfredericks: tbaldridge: man why can't there be some perfect and obviously-so programming language. everything so damn subtle and tradeoffy

17:35 coventry: That 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:36 gfredericks: coventry: that's funny I'd think of global atoms as more smelly

17:36 technomancy: (:a {} nil) ; <- that wasn't that hard now was it? =)

17:36 tbaldridge: technomancy: yep, and now I get to do (map #(:a % nil) maps) instead of (map :a maps)

17:37 technomancy: well yeah, the lack of rpartial is pretty annoying granted

17:37 tbaldridge: Really, nil existing in clojure is critical to how succinct it is.

17:37 technomancy: and how easy it is for mistakes to go undetected

17:40 gfredericks: technomancy: rpartial would make that even longer

17:40 tbaldridge: at 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:40 technomancy: gfredericks: I count tokens rather than characters

17:41 gfredericks: :)

17:42 technomancy: that's cool; just don't make mistakes and it'll be fine =)

17:42 hiredman: tbaldridge: 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:42 * technomancy switches from vectors to arrays

17:42 tbaldridge: like most of programming, why don't we use types?

17:42 technomancy: we do?

17:43 tbaldridge: (inc hiredman)

17:43 lazybot: ⇒ 26

17:43 technomancy: hiredman: that doesn't help when you're trying to get something *out* of a collection though

17:44 hiredman: technomancy: 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:45 technomancy: oh sure; elisp trained me to be OK with conflating nil and ()

17:45 hiredman: I am making an observation, not endorsing or proclaiming a style has some kind of silver bullet

17:45 technomancy: «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:45 welp

17:46 those are probably 1985 dollars too; wonder what that would be adjusted

17:46 arrdem: technomancy: not a large enough number

17:47 technomancy: arrdem: yeah, but we'll forgive him for underestimating because he's Tony freaking Hoare.

17:47 hiredman: mccarthy's lisp paper was 1960, so of course, lisp had nil first

17:48 marcopolo2: can you inc random words?

17:48 (inc lisp)

17:48 lazybot: ⇒ 1

17:48 marcopolo2: haha

17:49 arrdem: $karma leiningen

17:49 lazybot: leiningen has karma 2.

17:49 arrdem: $karma lein

17:49 lazybot: lein has karma 1.

17:51 hiredman: it being the '60s they spelled it NIL

17:52 tbaldridge: but 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:52 technomancy: I agree that an Option type would be nicer

17:52 but you don't need try/catch to avoid exceptions; just specify a default

17:53 tbaldridge: technomancy: that's just reifying the problem to something else. nil vs :unknown

17:53 technomancy: just use nil as a not-found in the rare case you actually want it

17:54 tbaldridge: just use :unknown in the rare case you actually want it

17:55 :-P

17:55 technomancy: sure, 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:56 tbaldridge: but realize your assumption. get of a non-existant key is an error by your definition. I would assert that it is not.

17:56 technomancy: I understand that

18:00 brehaut: technomancy: is this defaulting to safety a slippery slope to type checking and effectful programming?

18:00 tbaldridge: <--- thinks yes

18:01 technomancy: brehaut: what does "effectful" mean in this context?

18:01 persistent data structures are defaulting to safety

18:01 brehaut: technomancy: things like IO monads or similar: ways of staticly knowing when and where 'effects' happen

18:01 bitemyapp: I'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:02 dnolen: I don't actually see how you can actually remove the problem of null given the existence of empty collections

18:02 which functions should throw, which functions should return Option

18:02 ?

18:02 bitemyapp: dnolen: maybe monads + pattern matching is the answer in Haskell.

18:02 dnolen: people complaining about null never seem to talk about this.

18:02 bitemyapp: you just special case the empty coll or require a return from the monad.

18:02 dnolen: bitemyapp: you can have an incomplete match that Haskell won't catch and still blow up.

18:03 technomancy: dnolen: racket doesn't have any difficulty with it

18:03 hiredman: obviously we need lens

18:03 bitemyapp: dnolen: most certainly, just mentioning how they handle it.

18:03 hiredman: if Kmett's work starts infecting Clojure I will start a riot.

18:03 s/start/incite/g - lets use the right verbiage.

18:04 dnolen: technomancy: perhaps, I haven't poked at enough to find bugs

18:04 bitemyapp: 99% 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:05 technomancy: bitemyapp: I agree that GIGO is too deeply embedded in Clojure for anything else to be practical

18:05 bitemyapp: dnolen: 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:06 that kind of smart elision isn't possible in ML/Haskell, or D-M in general

18:06 technomancy: I've seen you bring this up before, does it bother you that much?

18:06 technomancy: it seems like the sort of thing that could be readily solved with a wrapper monad.

18:07 You associate stages of computation with error triggers and error types/messages, short-circuit and return if it triggers.

18:07 technomancy: bitemyapp: I write like ~10 LOC of clojure a week these days, so no, not really

18:08 crocket: technomancy, hi

18:08 bitemyapp: technomancy: 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:09 rather than OCaml/Haskell

18:09 crocket: bitemyapp, When do you want static typing?

18:09 bitemyapp: technomancy: what is it that racket does that you like?

18:10 crocket: not very often, but since I used Haskell before fully warming up to Clojure I'm comfortable "thinking in types"

18:10 brehaut: crocket: 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:11 technomancy: bitemyapp: 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:11 bitemyapp: which for me can sometimes mean being able to think about a problem with lower conceptual "load", a more compact "working memory" representation.

18:11 crocket: technomancy, Do you know how to write pluggable versioned modules in clojure as I do with OSGi?

18:11 technomancy: crocket: I don't know what that means really

18:11 what do you with OSGi?

18:11 bitemyapp: technomancy: I'm not sure how true that is, (null? '()) => #t in Racket.

18:12 crocket: technomancy, A depends on B and C, and B depends on D 1.0, and C depends on D 2.0.

18:12 How does clojure take care of D 1.0 and 2.0?

18:12 It happens a lot

18:12 dnolen: technomancy: I actually don't see how it's not a problem in Racket, (car '()) throws an exception

18:12 bitemyapp: '() *is* the null type.

18:13 so 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:13 technomancy: crocket: there's no good solution

18:13 among the bad solutions are 0) metaverse, which only works for namespaces and not java classes

18:14 1) construct multiple classloaders and populate them with pomegranate

18:14 2) upgrade B to work with the latest versions

18:14 crocket: technomancy, What if B and C are out of my control? 2) doesn't work.

18:15 bitemyapp: 2 can definitely work.

18:15 technomancy: yes, that's why it's listed under "bad solutions"

18:15 bitemyapp: exclusions + monkeypatching hooooooooooo

18:15 technomancy: 1) could probably be made easier with some tooling if someone had the time and inclination to come up with something fancy and reusable

18:15 crocket: technomancy, OSGi solves that problem easily.

18:15 technomancy: ok?

18:15 bitemyapp: I'm not sure the word easy is appropriate here.

18:16 coventry: How does OSGi solve the issue of needing distinct namespaces for the two versions?

18:16 technomancy: you still have to define boundaries of different contexts and describe how objects are able to move between the two

18:16 crocket: coventry, OSGi attaches version numbers to java packages.

18:16 It has its own classloaders.

18:16 OSGi replaces java classloaders.

18:17 hiredman: nope

18:17 crocket: I can load D 1.0 and D 2.0 on OSGi easily.

18:17 technomancy: I've read the description to OSGi like three times and could still never figure out what exactly it was for

18:17 arrdem: vulns... vulns everywhere...

18:18 bitemyapp: arrdem: hum?

18:18 component model makes me shiver my bones after my experience with .NET

18:18 coventry: crocket: 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:19 bitemyapp: Just fix the dependencies...

18:19 pain now is pain avoided forever again.

18:19 crocket: hmm

18:19 bitemyapp, OSGi is not a pain.

18:20 I think OSGi is the most advanced module system on this planet.

18:20 eclipse chose OSGi and evolved it to that point.

18:20 bitemyapp: crocket: are you a buddy of chord?

18:21 technomancy: crocket: 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:21 except it doesn't work for Java classes =\

18:21 crocket: technomancy, how?

18:21 technomancy: https://github.com/technomancy/metaverse <- seajure hack night project

18:21 clojurebot: Cool story bro.

18:21 crocket: technomancy, You said it was a bad solution.

18:21 technomancy: ooh, sick burn

18:22 crocket: because most incompatibilities are actually in Java classes

18:22 bitemyapp: crocket: what part of "hack night project" didn't you parse?

18:22 technomancy: isolating clojure namespaces on their own is not very helpful

18:23 bitemyapp: well to be fair I would have developed it further if it weren't for the insurmountable Java problems

18:23 crocket: technomancy, I read metaverse documentation, and it seems I have to manually specify namespaces yet.

18:23 technomancy: crocket: yeah, it's a proof of concept

18:23 coventry: crocket: 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:23 crocket: If somebody implements a real module system on clojure!!!

18:24 technomancy: crocket: a pure-clojure solution just isn't very useful

18:24 coventry: crocket: You should do it!

18:24 arrdem: crocket: do it!

18:24 crocket: technomancy, Clojure runs on web browsers, JVM, and CLR.

18:24 clojure-only solution may help in that situation.

18:25 technomancy: well don't let me stop you if you want to give it a shot =)

18:25 coventry: Once we have the OSGi clone, we can run multiple starcraft games in a single clojure instance.

18:25 crocket: hmm

18:25 technomancy: just explaining my own motivation for abandoning the project

18:25 crocket: technomancy, What do you think is a better solution?

18:25 bitemyapp: crocket: fix your dependencies

18:25 technomancy: in the short term: fixing the incompatible libraries is usually the easiest

18:26 in the long term: a tool for constructing isolated classloaders for some kind of Kandor-style dependency subtree

18:27 hiredman: crocket: 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:28 you 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:28 bitemyapp: crocket: if you want classloader isolation with separate namespaces you can use Immutant.

18:28 Immutant in this case would basically be the interface between Clojure and JBoss.

18:29 hiredman: how promising is polycosm?

18:29 crocket: https://github.com/hiredman/polycosm

18:30 justin_smith: I think you would need to reimpliment clojure's class loading to make it work with osgi

18:30 crocket: really?

18:30 Is clojure.osgi working well?

18:30 hiredman: if 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:33 I don't particular care about osgi, so if clojure.osgi doesn't work, meh use some other jvm module system, there are plenty

18:34 arrdem: or is just a macro around if, IIRC?

18:34 hiredman: if you are tied to osgi, then what is a "pure clojure" module system going to get you any way?

18:34 coventry: ,(macroexpand '(or 1 2))

18:34 clojurebot: (let* [or__3943__auto__ 1] (if or__3943__auto__ or__3943__auto__ (clojure.core/or 2)))

18:35 bitemyapp: arrdem: http://clojuredocs.org/clojure_core/clojure.core/or

18:36 arrdem: click "+ Source"

18:36 ,(source or)

18:36 clojurebot: Source not found\n

18:36 bitemyapp: ...

18:36 arrdem: (inc clojurebot)

18:36 lazybot: ⇒ 33

18:36 bitemyapp: useless.

18:36 ##(source or)

18:36 lazybot: java.lang.RuntimeException: Unable to resolve symbol: source in this context

18:36 bitemyapp: J. F. C.

18:36 arrdem: bitemyapp: pwnt.

18:36 bitemyapp: arrdem: just look at the damn link

18:38 coventry: hiredman: 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:47 bitemyapp: arrdem: In case you're curious: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2551-L2697

18:48 crocket: hiredman, What JVM module systems?

18:48 hiredman: I happen to like jboss modules

18:50 brainproxy: example of correct way to use :foreign-libs in context of cljbuild?

18:50 bitemyapp: brainproxy: https://github.com/emezeske/lein-cljsbuild/blob/master/sample.project.clj

18:50 hiredman: most "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:50 brainproxy: bitemyapp: other than that one

18:50 :p

18:52 so I'm looking at this

18:52 http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html

18:53 and it's suggestive that a foreign-lib need not be setup with goog.provide

18:54 bitemyapp: Innuendo Oriented Programming

18:55 brainproxy: but 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:55 technomancy: hiredman: 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:56 seems like you'd need two uberjars

18:56 or N uberjars, whatever

18:56 dnolen: brainproxy: 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:56 hiredman: technomancy: yeah, you don't

18:56 dnolen: oops sorry, brainproxy: http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html

18:57 hiredman: technomancy: 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:57 technomancy: just to save memory?

18:58 I mean, at that point they're not really taking advantage of being in the same process, right?

18:58 hiredman: technomancy: the single jvm? yeah, memory what have, once you have as two services you can map those servers 2:N to jvms

18:58 have 5 jvms, 4 running both services, 1 running only one for some reason

18:59 brainproxy: dnolen: yep, that's what I linked above

18:59 hiredman: you can deploy to a single jvm until you decide your heap is too big for gc pauses, and split, etc

18:59 brainproxy: anyway, just trying to get a grip on what's possible

18:59 iow, say I have x.js and y.js neither of which have anything to do with google closure stuff

19:00 technomancy: hiredman: 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:00 brainproxy: according 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:00 but when I try such a thing, the compiler barfs because those libs aren't doing things like goog.provide

19:01 dnolen: brainproxy: hmm don't know I've never used :foreign-libs I'd ask on the ML

19:01 hiredman: technomancy: they can pound sand

19:02 technomancy: hiredman: works for me

19:02 hiredman: just pretend they are windows users

19:02 * technomancy cackles

19:03 technomancy: http://p.hagelb.org/unix.jpg

19:03 `cbp: Wrong number of args (-1)

19:03 wat

19:06 bitemyapp: `cbp: lol, how'd you do that?

19:06 `cbp: bitemyapp: combining multimethod + macros I guess

19:08 technomancy: imaginary functions have negative arities

19:09 mlb-: 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:09 hyPiRion: mlb-: hit the author with a stick. Tends to work for me.

19:10 seriously though, that's a library issue which is hard to fix without fixing the library itself

19:10 brehaut: github issues make good sticks

19:10 mlb-: Damn. I wanted a separate instance of a logging library instead of having to write my own user-oriented reporting library

19:11 technomancy: you could always slurp up the source and munge the ns form and then sequentially eval each form

19:11 but don't tell anyone I said that

19:12 bitemyapp: mlb-: which library?

19:12 mlb-: timbre

19:12 bitemyapp: technomancy: good lord man, are you trying to bring about the apocalypse?

19:12 mlb-: I'm a pretty active user of that library, which state is problematic to you?

19:12 mlb-: the configuration atom?

19:12 mlb-: technomancy: I was pondering that, or making use of "classojure"

19:12 bitemyapp: dude, no

19:12 * technomancy whistles innocently https://github.com/technomancy/metaverse/blob/master/src/meta/verse.clj#L28

19:13 bitemyapp: just submit a PR for an alternate closure based config to pt-toomanyfuckingvowels-nis's library.

19:14 mlb-: I solved this sort of problem in bulwark: https://github.com/bitemyapp/bulwark/ has atom based and closure based configuration.

19:14 so you can have multiple instances of differently configured middleware running around.

19:14 mlb-: which is what you want, right?

19:15 mlb-: 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:16 Either that, or I'll have to add a timbre middleware to extract messages with a special signature and treat them separately...

19:16 bitemyapp: mlb-: https://github.com/ptaoussanis/timbre/issues/31

19:16 mlb-: not really appealing

19:16 bitemyapp: mlb-: no, don't do that. Seriously.

19:16 mlb-: I've had this problem too, I'm considering either PR'ing or forking.

19:16 mlb-: haha, thanks for opening that issue with me

19:16 bitemyapp: mlb-: keep in touch with me. +1 the Github issue please.

19:17 mlb-: "me too" posts are acceptable github ettiquite?

19:17 etiquette, even,

19:17 bitemyapp: mlb-: yes dude, there's a +1 emoticon for showing your support/desire for a feature

19:17 mlb-: maintainers will use that to gauge interest.

19:18 even fucking JIRA has that.

19:18 mlb-: 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:23 technomancy: <3 the fact that you can remove yourself from those threads now

19:24 unlike google code where you can't star an issue without getting spammed by every idiot who doesn't know about stars

19:25 crocket: hiredman: Is https://github.com/hiredman/polycosm only useful in jboss application server

19:25 hiredman: Is https://github.com/hiredman/polycosm only useful in jboss application server?

19:27 marcopolo2: technomancy: maybe they know about stars and that's why they comment...

19:27 mlb-: bitemyapp: threw in my $0.02. Thanks for helping out.

19:27 technomancy: and for now, I'll try to resist your hack-tastic solutions

19:28 bitemyapp: mlb-: np

19:30 hiredman: crocket: 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:31 crocket: but I think putting that stuff in you app is a bad idea

19:31 your 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:31 crocket: hiredman: what about clojure.osgi?

19:32 If clojure has to depend on host modularity systems, osgi can be a choice

19:32 hiredman: crocket: never looked at it, the osgi docs make as much sense to me as they do to technomancy

19:32 crocket: commonjs on web browsers?

19:33 hiredman: Does it make little sense?

19:36 hiredman: crocket: 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 `cbp: yet again! CompilerException clojure.lang.ArityException: Wrong number of args (-1). I'm so good at this

19:37 crocket: hiredman: It is an absolute neccesity in eclipse.

19:37 Once you decide write your apps in OSGi, it makes sense.

19:38 osgi is the most advanced module system so far.

19:40 hiredman: I've been reading "OSGi in action", and it certainly solves the modularity problem for OSGi-based programs.

19:40 hiredman: I don't think eclipse is a neccesity, so eclipsing using osgi doesn't mean I care about it

19:40 crocket: I am not saying it doesn't solve it

19:41 crocket: hiredman: What if you need to deploy 500 JARs that may use log4j 1.0 and 2.0 simultaneously?

19:41 hiredman: I mean, if you spend $1,000 on a pen, that pen solves the writing problem, but is it a good solution?

19:42 crocket: netflix API consists of 500 JARs.

19:42 In a big deployment, module version conflicts invariably happen.

19:42 hyPiRion: crocket: have you worked with Erlang? That may be a better fit for your needs

19:42 hiredman: crocket: I am well aware

19:42 crocket: hyPiRion: why

19:42 hiredman: crocket: I am not saying it isn't a problem

19:43 crocket: I don't know if erlang is a good general purpose language.

19:43 hyPiRion: crocket: because they handle modules as first-class citizens instead of namespacing in general, thus avoids the version issue

19:43 hiredman: I 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:44 crocket: hiredman: Do you mean "without"?

19:44 hiredman: and there are other possible solutions that have less moving parts, don't have weird package based things etc

19:44 crocket: yes

19:44 crocket: hiredman: like what?

19:44 hiredman: and whatever the solution it doesn't belong in the service, what ever, you deploy

19:45 the runtime environment you deploy to should do it

19:45 crocket: hiredman: reified version information should be considered.

19:46 hiredman: crocket: 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:46 crocket: JARs don't have reified version information.

19:46 hiredman: Why do you refer me back to jboss?

19:46 coventry: crocket, do you have a concrete problem you're working on?

19:46 crocket: You told me jboss was a bad idea for my apps?

19:46 hiredman: crocket: sure, and most / all module systems require you to add that information

19:46 crocket: no I didn't

19:47 crocket: coventry: I just want to save headaches in the future.

19:47 I know it'll happen.

19:47 hiredman: I said my library polycosm is, I would recommend you deploy to an appserver like immutant which is built on jboss

19:47 crocket: module version conflits

19:47 hiredman: and your app doesn't have to care about isolation

19:47 the app server takes care of that when it loads your app

19:47 crocket: hiredman: What if I don't need an app server like jboss?

19:48 If I need jboss, it's perfect.

19:48 If I don't need it, ???

19:48 lazybot: crocket: Oh, absolutely.

19:48 hiredman: crocket: I would argue you do if you care about isolation like that

19:49 `cbp: premature modularization is the root of all evil?

19:49 crocket: `cbp: late modularization is a disaster.

19:50 modularization should be considered from the design.

19:50 technomancy: osgi 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:50 crocket: technomancy: Do you already know the best way?

19:50 technomancy: don't have large dependency trees

19:51 crocket: Does anyone have experience with clojure.osgi?

19:51 If it works, I may use it.

19:52 coventry: For what?

19:52 crocket: for modularity

19:52 coventry: Bwahaha

19:53 bitemyapp: (inc coventry)

19:53 lazybot: ⇒ 2

19:53 crocket: I work for a company that makes java web office.

19:53 It is a big giant mud of java packages.

19:53 It's sick.

19:53 Moduarity is a neccesity.

19:54 dnolen: seems like ClojureScript might benefit from asm.js after all ...

19:54 coventry: Sorry I laughed. That sounds terrible.

19:55 crocket: coventry: I decided not to non-modular apps.

19:55 coventry: I decided not to write non-modular apps.

20:00 * zeroem pictures a bunch of java packages playing a MUD over telnet

20:13 coventry: ,(do (defmacro f [] (assoc)) (f)) <--`cbp. I knew I'd seen that somewhere before.

20:13 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

20:14 coventry: `cbp: Anyway, that gives an ArityException with a supposedly negative number of arguments.

20:17 Hmm, 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:19 georgyg: hey everyone! I'm having some issues using clojure.java.jdbc to execute two statements using the same connection

20:20 I'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:20 any hints on how to use the same connection between two statements (one being a set and the other a select)?

20:26 razieliyo: hi, would you say clojure is more friendly than lisp and its dialects? or more or less the same?

20:26 technomancy: razieliyo: lisp dialects vary wildly

20:26 dnolen: razieliyo: Clojure is a Lisp dialect, relatively friendly

20:26 razieliyo: technomancy: yes, you're right on that

20:26 dnolen: I see

20:27 technomancy: much more friendly than CL; less beginner-friendly than racket

20:28 razieliyo: the 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:30 technomancy: an ID3 parser sounds like the kind of thing that might need a fast startup time

20:30 bitemyapp: razieliyo: https://github.com/kirankulkarni/clj-id3

20:31 razieliyo: https://github.com/onewland/clojure-mp3

20:31 juhoh: how is it possible that the function *value* is returning true in some cases? http://pastebin.com/9wMimJVs (last function)

20:31 razieliyo: bitemyapp: I have/want to make it for myself, obviously I know I can just type *language* *id3 algorithm* and find lots of implementations

20:32 the thing is that idk how much difficult that will become, because I have a deadline

20:32 technomancy: razieliyo: if you're looking to create a CLI tool, clojure is pretty bad at that

20:32 razieliyo: I know that depends on my knowledge on lispy stuff

20:32 technomancy: why?

20:32 technomancy: for a school project it should be fin ethough

20:33 razieliyo: yes, it's for a school project

20:33 we were told to make it in java, but I think this is the time for me to learn some lisp stuff for good

20:33 technomancy: razieliyo: ok; it's not significantly worse than Java for CLI stuff

20:33 just slower startup time

20:34 razieliyo: technomancy: alright, so it may be a good choice

20:34 and I guess that lots of stuff I learn on clojure are valid for other lisp dialects, isn't it?

20:35 technomancy: yeah, lots of it

20:35 razieliyo: alright, thank you all for the help

20:36 I think I'll try it with clojure, and pray to not last too much because of the deadline

20:37 technomancy: clojure has the most active IRC channel of any lisp I believe

20:37 that's gotta count for something

20:37 arrdem: it totally counts for something.

20:37 technomancy: except maybe elisp, but that channel never actually talks about emacs

20:37 arrdem: you can drop in here and get help from the library authors about 75% of the time.

20:37 razieliyo: technomancy: that's an indirect reason of chosing clojure, I find that there's lot of fresh info on the net

20:38 support is always good

20:38 anyway, I have to say that people at #lisp are pretty helpful too

20:38 technomancy: huh, really?

20:39 razieliyo: technomancy: well, at least that's what I found out the last time I played with lisp and asked (maybe too much time ago)

20:39 technomancy: they used to have a reputation for hostility

Logging service provided by n01se.net