#clojure log - Sep 05 2012

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

0:00 casion: wmealing_: yes

0:00 I couldn't get it running when I tried 2 months ago or so

0:00 I'll give it a go again soonish

0:00 I'm mostly curious if I can get it running on avr

0:00 wmealing_: AVR, as in microcontroller ?

0:00 casion: yes

0:00 mpan: sounds cool

0:01 technomancy: mrevil: it's possible to create a lazy seq that releases things when it's consumed, it just opens a huge can of worms

0:01 wmealing_: casion: what is your chipset ?

0:01 technomancy: the whole point of lazy seqs is you don't have to think about whether and when it's consumed

0:01 mpan: technomancy: you mean by artificially constructing functions yourself?

0:01 technomancy: so if you have a seq that must be consumed, it kind of defeats the purpose

0:02 casion: wmealing_: brb

0:02 technomancy: mpan: you can use lazy-seq

0:02 wmealing_: ok

0:02 mrevil: in this instance it will be always be consumed in full

0:02 technomancy: there are other ways too

0:02 anyway, it's possible but problematic

0:02 mrevil: can you give me a google seed?

0:04 dansalmo: Is there an inverse of the read-string fn such as: (fn? (read-string "(xz (yz))")) => "(xz (yz))"

0:04 amalloy: $findfn '(xz (yz)) "(xz (yz))"

0:04 lazybot: Key must be integer

0:04 amalloy: what the hell, lazybot?

0:05 oh, i bet that doesn't handle strings well. anyway, you want pr-str, dansalmo

0:05 mrevil: i understand it's problematic, but the goal is to avoid refactoring a bunch of code tonight. the thing is I don't even want the lock, the thing has single concurrency guarantees the API is forcing me to obtain a lock

0:06 technomancy: pointer to my can of worms?

0:07 dansalmo: :amalloy thanks, I never would have thought to look for a print fn.

0:08 dnolen: jparishy: have you seen http://github.com/jasonjckn/llvm-clojure-bindings

0:10 technomancy: mrevil: you can see how read-lines was implemented in the old clojure.contrib duck-streams library

0:10 provided it's a temporary hack of course =)

0:11 though considering your nick I'm not sure I can trust you!

0:11 mrevil: :)

0:11 thanks

0:12 Sgeo: If I take the time to understand Ring, will I better understand the purposes of things such as Rack and WSGI?

0:13 arohner: Sgeo: yes

0:14 Sgeo: {"Content-Type" "text/plain"} that confused me for a second until I realized that that is in fact a map

0:14 I'm so used to {:somekey someval}

0:14 (I haven't actually done much Clojure, just reading about Clojure)

0:20 dansalmo: :amalloy I added some examples to clojuredocs

0:20 clojurebot: examples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples

0:21 Sgeo: Hmm

0:21 I once wanted to add lenses to Clojure

0:21 * Sgeo wonders what happened to that

0:22 Sgeo: Did I decide it's not worth it, or did I just lose interest in Clojure too soon?

0:22 Or maybe someone else did it

0:22 amalloy: okay, i guess, but why? that exact example is already there, dansalmo

0:22 casion: wmealing_: I use the atmega2560, uc3 and atmega32u4

0:23 wmealing_: and 328 for some stuff when I'm fooling with arduino

0:23 * wmealing_ nods

0:23 wmealing_: casion: if you get it working well enough to be useful, i'd be interested

0:23 in reading about it

0:24 casion: that's essentially my day job, avr development and fabrication

0:25 essentially was a very stupid word to insert there haha

0:29 wmealing_: casion: i have two arduinos myself

0:29 casion: one of them is hooked up to the serial port on a security system that apparently, can't be interfaced externally.

0:29 has a bluetooth connection to the home server

0:29 the other controls garage/frontdoors over POE.

0:30 casion: neat

0:31 right now we're developing a rail and bridge for macro photography, along with an extension bridge-arm for time lapse panoramas

0:31 dansalmo: :amalloy when I looked, there was an example showing (read-string ... (pr-str ...)) but not the other way around.

0:32 :amalloy and there was no mention of them being like inverse functions of one another

0:34 :amalloy and I could have sworn there was no mention of pr-str in the "see also" section, but there is now

0:34 thanks greatly for the help.

0:34 * Sgeo wants to make assoc-in unnecessary

0:35 Sgeo: Actually, I guess that's not really what I want. What I want is to bring lenses to Clojure and make them useful

0:45 l1x: hey ho

0:45 dnolen: do you remember we talked about the replace Nth character in a string story?

0:45 dnolen: l1x: yep

0:46 l1x: dnolen: https://gist.github.com/3630609

0:48 dnolen: l1x: nice

0:49 l1x: i am not sure if it is correct yet, need to test is extensively

0:50 duck1123: Does anyone happen to have any idea why suddenly the cljs compiler would refuse to include the goog.net.Websocket package?

0:50 I had it working before, but now it can't find it

0:50 dnolen: duck1123: does it still exist? did it get renamed

0:51 duck1123: GClosure seems to change relatively quickly.

0:51 duck1123: by all indications, it's still there

0:52 for a while, it wasn't in the included goog package, but I was building against the head

0:52 dnolen: duck1123: are you using CLJS head? a release?

0:52 duck1123: I'm using head right now

0:53 well, I'm using cljsbuild, I don't know if they conflict

0:53 dnolen: duck1123: shouldn't if you're using :checkouts

0:53 duck1123: it's been working fine until tonight, which is what gets me.

0:54 dnolen: duck1123: if you reproduce preferably w/ other goog libs that would be helpful.

0:54 duck1123: I'll see what I can do

0:54 dnolen: duck1123: whenever things get messed up I remove out, .repl, and any generated foo.js files.

0:55 akhudek: huh, for short sequences (~5 positions) conjing to a vector is noticeably faster.

0:55 than conjing to a list

0:56 duck1123: cleaning everything out didn't do it

0:57 Here's the file, if it helps http://renfer.name/assets/js/jiksnu.js

0:57 dnolen: duck1123: I see that CLJS uses 1376 closure.jar which doesn't have goog.net.WebSocket

1:02 akhudek: is there a non-lazy map?

1:02 for performance?

1:04 duck1123: you can force a lazy seq with dorun (if you only want side effects) or doall (if you want the return) there's also doseq

1:05 nvm

1:06 Sgeo: assoc-in isn't defined in a tail-recursive manner

1:06 dnolen: akhudek: reducers

1:06 Sgeo: Erm, ... I don't know how to phrase that in Clojure terms considering that even tail-recursive defined functions will blow the stack and should use recur to avoid that

1:06 But assoc-in is recursive and doesn't use recur

1:07 dnolen: Sgeo: let us know when you have some code where that's a problem for you.

1:07 Sgeo: What's wrong with just making assoc-in more robust?

1:07 Don't tell me it will cause some sort of bizarre efficiency concern?

1:08 akhudek: dnolen: I thought of trying those, but didn't find clojure.core.reducers in 1.4, do I need to pull 1.4+?

1:08 dnolen: Sgeo: there are problems and there are real problems. not much more to say about it.

1:08 akhudek: reducers are 1.5 I think.

1:09 mpan: is there an equivalent of map that takes two input seqs?

1:10 woah, it's map

1:10 yay

1:10 akhudek: dnolen: ok, thanks, I'll try getting 1.5 going in a few days to experiment a bit.

1:11 uvtc: mpan: :)

1:11 mpan: I do feel silly though

1:11 since I was reading it earlier and missed it I suppose

1:14 dnolen: mpan: easy to miss and yes it's nice.

1:24 mpan: Is there an easy way to take a function and make it implement java.util.Comparator ?

1:24 l1x: hmm is there a way to kind of iterate over a set which contains vector instead of using for?

1:24 mpan: what do you want to do with the set? I'm currently using map, but I guess it depends what you want to do

1:27 ,(map #(vector (+ 1 (first %))) #{[1] [2]})

1:27 clojurebot: ([2] [3])

1:27 mpan: uh, that's one way I guess

1:28 that's a silly example, and it makes new vectors, but depending on what you wanted to do with your elems, map might do it

1:45 clj_newb_2342: anyone here got rtmp or rtmps to work with clojure?

2:13 mindbender1: why is it that if I do (find-ns 'foo) in a repl I get nil, but when (use 'foo) it pulls in the files

2:16 nbeloglazov: &(doc find-ns)

2:16 lazybot: ⇒ "([sym]); Returns the namespace named by the symbol or nil if it doesn't exist."

2:16 xeqi: find-ns sees if it has already been declared; use will load the namespace from a file if it hasn't

2:17 mindbender1: xeqi: what do you mean by `already been declared`

2:19 xeqi: the ns has already been created in my instance

2:19 amalloy: &(doc comparator) ;; mpan

2:19 lazybot: ⇒ "([pred]); Returns an implementation of java.util.Comparator based upon pred."

2:21 xeqi: added to https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Namespace.java#L25 from a previous use / require / ns / create-ns or whatever

2:22 mpan: thanks

2:30 I think I'm misnaming namespaces? the namespace name has a - and the filename has a corresponding _ but it errors trying to load it

2:53 michaelr525: hello

3:09 mpan: hello

3:12 clj_newb_234: in clojure, what is the way to read _untrusted_ data?

3:12 i.e. I want to read _untrusted_ data as a clojure data structure

3:15 wmealing_: clj_newb_234: i guess you could slurp it in, then attempt to parse it

3:15 clj_newb_234: untrusted clojure data structures ?

3:15 clj_newb_234: clojure data structures from a untrusted source

3:15 i.e. i'm writing a web app taht sends me clojure data structures

3:15 but I dont trust the web app

3:16 does this make sense, or am I an idiot?

3:16 (the two are not mutually exclusive)

3:16 * wmealing_ nods

3:16 wmealing_: yeah i get you

3:16 (ns testing.core

3:16   (:require [clojure.java.io :as io])

3:16   (:import [java.io PushbackReader]))

3:16 (def remote-data (with-open [r (io/reader "whatever.clj")]

3:16 (read (PushbackReader. r))))

3:17 but that doesn't mean it cant crash your app

3:17 xeqi: (doc read-string)

3:17 clojurebot: "([s]); Reads one object from the string s"

3:17 clj_newb_234: can anything bad happen from parsing json?

3:17 xeqi: just make sure to (binding [*read-eval* false] (read-string ...))

3:17 wmealing_: xeqi: thta was my next idea

3:17 something like this

3:17 http://hastebin.com/sipuvalefe.lisp

3:18 clj_newb_234: so all the pwoer of read, but without read time macros?

3:18 wmealing_: win

3:18 actually, i dont pretend to know if my idea is the best idea, or even sane

3:18 but its how i'm doing it right now

3:19 ah clj_newb_234: i found something for you

3:19 clj_newb_234: https://github.com/Licenser/clj-sandbox

3:19 there you go, a place to execute your untrusted code

3:20 clj_newb_234: no no, this is enough :-)

3:20 wmealing_: i imagine the guys who write the clojurebot

3:20 clj_newb_234: I don't need to excute the code

3:20 only to read it

3:20 wmealing_: have a good sandbox

3:20 ah

3:20 clj_newb_234: plus

3:20 I think you can still crash that system

3:20 with infinite thread creation

3:20 sinsce java deprecated thread.stop

3:20 wmealing_: "that" being sandbox ?

3:20 clj_newb_234: yeah

3:20 wmealing_: i wonder how the bot writer here does it

3:21 * clj_newb_234 washes his hands clean of any bot abuse.

3:22 wmealing_: clojail replaced sanbox, apparently

3:22 https://github.com/flatland/clojail

3:23 one thing i was interested in, was erlang style hot code reloading

3:24 clj_newb_234: is read-line completely safe?

3:24 i.e. it just reads the line, but doesn't try to pase it?

3:24 oh, I have hot code reloading working

3:24 I can modify my webserver as it runs :-)

3:24 wmealing_: orheally

3:25 so you just save the file

3:25 and it picks up the changes as it runs ?

3:25 clj_newb_234: well

3:25 I have to type ctrl-ll

3:25 which does :w, :make

3:25 wmealing_: in emacs ?

3:25 clj_newb_234: and :make tells clojure to reload

3:25 it does depdentcy checking too

3:25 wmealing_: ok

3:25 ah, vim

3:25 right

3:25 clj_newb_234: and reloads all the modules that depends on the module just modified

3:25 wmealing_: and the session doesn't end ?

3:26 mpan: is there an equivalent to stepping through execution as one would with an imperative language? (currently in eclipse+ccw if that matters)

3:26 wmealing_: if your compile fails, what happens ?

3:26 clj_newb_234: no; my clojure webserver listens on port 11111

3:26 it listens for "reload commands"

3:26 err, code is injected via (require :reload module-name)

3:26 so when it files to compile, nothing bad happens

3:26 (so far, in my experience)

3:26 wmealing_: mpan: havn't done it in a while: http://georgejahad.com/clojure/swank-cdt.html

3:27 clj_newb_234: the hardest part ... was actually having to implement typological sort myself

3:27 wmealing_: but i used to do something like that

3:27 clj_newb_234: in order to do depency checking

3:27 wmealing_: clj_newb_234: ok

3:27 clj_newb_234: lol, had enough of my hot-relaoding system?

3:27 wmealing_: clj_newb_234: ill have a play, probably end up doing it wrong over and over

3:28 clj_newb_234: i'm a very lame repl user

3:28 lots of manual work

3:28 mpan: thank you!

3:28 wmealing_: mpan: there is other ways too. that wasnt the only one

3:29 mpan: I'm currently "debugging with print statements" essentially

3:31 clj_newb_234: hmm, in clojure, what is the right way to read _a line_ from a _socket_ ?

3:32 mpan: eek! I think I reversed the order of my compare

3:34 scottj: mpan: have you tried setting breakpoints and stepping in eclipse?

3:34 mpan: scottj: idk if I'm doing it wrong, but eclipse seems to ignore my breakpoints

3:36 oh wow, yep, I was sorting it by worst-candidates-first

5:03 clgv: hmmm I wonder why the standard way to construct a set namely (set c) does not use a transient set. that means if I anticipate that I have to construct large sets I have to use (into #{} c)

5:04 or is it to force this explicit decision to use `into` for larger sets?

5:15 amalloy: clgv: i think it's just an unimplemented feature in c.l.PersistentHashSet, since HashMap/create uses a transient and HashSet/create doesn't. perhaps sets didn't have transients at the time

5:15 submit a patch to jira, i'd suggest

5:16 clgv: amalloy: no signed CA overhere ;)

5:18 maybe I have to do that when I got some spare time

5:22 nbeloglazov: $source clojure.lang.PersistentHashSet

5:22 lazybot: Source not found.

5:22 nbeloglazov: $source set

5:22 lazybot: set is http://is.gd/NJA7Kg

5:51 no7hing: is there any smarter way than having a macro for parsing an int (e.g. userid) out of matched compojure routing parts? especially when the context is the userid and a bunch of handlers derive that?

6:01 Mandar: hello

6:01 i have a very basic question: how do i convert this vector to a list?

6:01 (list [1 2 3]) returns '([1 2 3])

6:01 how can i get '(1 2 3)

6:03 ejackson: ,(apply list [1 2 3])

6:03 clojurebot: (1 2 3)

6:04 Mandar: thank you!

6:04 ejackson: list wants each of elements of the list as a seperate argument

6:04 Mandar: i thought there might be a reverse to "vec"

6:05 (list* [1 2 3]) seems to return '(1 2 3) too

6:06 iDesperadO: ,(list* [1 2 3])

6:06 clojurebot: (1 2 3)

6:07 iDesperadO: ,(class (list* [1 2 3]))

6:07 clojurebot: clojure.lang.PersistentVector$ChunkedSeq

6:08 iDesperadO: ,(vector 1 2 3 4)

6:08 clojurebot: [1 2 3 4]

6:08 iDesperadO: ,(vec 1 [1 2 3])

6:08 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$vec>

6:08 iDesperadO: ,(vec (range -5 5))

6:08 clojurebot: [-5 -4 -3 -2 -1 ...]

6:09 iDesperadO: ,(vector (range -5 5))

6:09 clojurebot: [(-5 -4 -3 -2 -1 ...)]

6:09 Mandar: so (list* [1 2 3]) is not a list

6:10 so the idiomatic way is ejackson's

6:10 Bronsa: ,(doc list*)

6:10 clojurebot: "([args] [a args] [a b args] [a b c args] [a b c d & ...]); Creates a new list containing the items prepended to the rest, the last of which will be treated as a sequence."

6:11 iDesperadO: ,(list? (list* [1 2 3]))

6:11 clojurebot: false

6:11 Mandar: thanks guys

6:11 iDesperadO: ,(seq? (list* [1 2 3]))

6:11 clojurebot: true

6:12 clgv: Mandar: you should not try to convert a vector to a list.

6:13 most functions for list will call `seq` on it anyway

6:13 I mean "list = sequential data structure"

6:14 ,(-> [] class ancestors)

6:14 clojurebot: #{clojure.lang.Reversible clojure.lang.IPersistentStack java.lang.Object clojure.lang.Sequential clojure.lang.IMeta ...}

6:14 Mandar: so clojure.lang.Sequential is like an interface?

6:15 clgv: ,(.isInterface clojure.lang.Sequential)

6:15 clojurebot: true

6:15 clgv: yes^^

6:15 Mandar: i didn't even know there were interfaces in a functional language :)

6:15 clgv: thats due to the JVM being the host of clojure ;)

6:16 ejackson: Mandar: yeah, Protocols are the googlable term.

6:16 Mandar: thank you very much guys

6:16 iDesperadO: I'm afraid .isInterface is a java interop...clojure support it practically

6:16 clgv: ejackson: only if he wants to implement something "interfacey" himself ;)

6:16 iDesperadO: so clojure is not an pure functional programming language:)

6:18 clgv: iDesperadO: I did only use it to check since I was not 100% sure

6:19 iDesperadO: clgv: I just want to say that clojure is not a pure functional programming language and clojure support this with practicality in mind

6:22 clgv: sometimes it would be really hand to tag functions as pure and to get an error if they use something that is not tagged pure

6:22 *handy

6:23 iDesperadO: use meta data?

6:25 TheBusby: is there a threading macro that supports nil punning?

6:25 clgv: iDesperadO: yeah, but you would have to write a defn derivate that also checks that metadata ^^

6:25 iDesperadO: well probably not more complicate than checking for transitive options

6:26 TheBusby: yes. clojure.core.incubator/-?> and -?>> - but it's an additional lib

6:27 TheBusby: clgv: excellent thank you! Google fails for the threading macros :(

6:27 clgv: TheBusby: I hope it will get into core since thats what that lib is for - but it didnt happen in 1.3 or 1.4

6:27 TheBusby: :(

6:29 iDesperadO: clgv: the question I asked yesterday here comes..I don't know about clojure.core.incubator. Now the only solution seems to google to read on the web. How I wish I can get some info on repl...

6:30 ,(doc clojure.core.incubator)

6:30 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.core.incubator>

6:30 iDesperadO: ,(dir-fn clojure.core.incubator)

6:30 clojurebot: #<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.core.incubator, compiling:(NO_SOURCE_PATH:0)>

6:30 deadringer: been struggling with proguard, has anybody got it working with clojure?

6:30 iDesperadO: ,(dir-fn 'clojure.core.incubator)

6:30 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.Exception: No namespace: clojure.core.incubator found>

6:31 clgv: iDesperadO: there is no such feature in clojure itself. I remember someone has written a lib for clojars.org but thats limited then as well

6:31 rasputnik: is this a good place to ask for help with 4clojure problems?

6:32 clgv: rasputnik: if you do not spoil the problem for others, yes

6:32 rasputnik: don't worry, my solution is throwing exceptions anyway :)

6:32 iDesperadO: clgv: and I'm afraid the clojurebot don't know about core.incubator either

6:32 tomoj: I assume it is acceptable to spoil the problem in a gist labelled as a spoiler?

6:33 clgv: iDesperadO: but the official maintained projects can be found here: https://github.com/clojure/ including core.incubator

6:33 iDesperadO: clgv: I know I know

6:34 clgv: ,(use 'clojure.core.incubator)

6:34 clojurebot: #<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate clojure/core/incubator__init.class or clojure/core/incubator.clj on classpath: >

6:34 iDesperadO: clgv: :)

6:34 clgv: nope, he does not use it ^^

6:34 rasputnik: ok, here's my crappy attempt at reversing a sequence (4clojure #23 ) : https://gist.github.com/3634727

6:34 blows up with : ClassCastException clojure.lang.Cons cannot be cast to clojure.lang.IFn user/widdershins/flip--310 (NO_SOURCE_FILE:4)

6:35 it's probably very very obvious, only been doing Clojure for a week

6:35 clgv: rasputnik: for one, you shouldnt use `defn` afair the sandbox forbids def-ing anything

6:36 or did that work now on other problems?

6:36 I usually just use (fn [...] ...)

6:36 rasputnik: i'll golf it down to a #() once it works in the repl, this is just a more general WTF exploration thing

6:37 clgv: ah ok. cant you paste it in a file to get line number info on the exception?

6:37 rasputnik: clgv: yeah, that's not a bad idea. pretty sure its' the recursive call though. I read it as saying 'cons is not a function' which is what's confusing me

6:38 is there an easy way to get the repl to load the file rather than starting a new lein project?

6:38 clgv: rasputnik: oh you are trying that very complicated ^^

6:38 rasputnik: NVM, 'load-file'

6:38 clgv: indeed^^

6:40 rasputnik: my golf score on that problem is 7 ;)

6:40 rasputnik: hum, it's the (tocoll) on line 4 that's breaking apparently. confused now.

6:41 clgv: rasputnik: ah right. you have strange brackets there

6:42 rasputnik: clgv: is the letfn in the wrong place, maybe/

6:42 clgv: no. (tocoll) does not make any sense

6:42 you should just return the `tocoll` there

6:42 rasputnik: ah, skip the enclosing parens?

6:42 cool, i'll try that

6:43 clgv: yeah. it's no function call

6:43 rasputnik: in general you live risky by using `flip` for recursion instead of `recur`

6:43 rasputnik: aaah, that'll be it. removed those and now line 6 goes boom (because it has unnecessary () too, i think

6:44 clgv: yup, that's what i thought. need to tidy it up and then tweak things to get the recursive bit to a tail position

6:44 clgv: yeah, even in lisp there might be too many parens ;)

6:44 rasputnik: clgv: heresy!!

6:45 wmealing_: /join #lazybot

6:45 bha

6:45 rasputnik: yay, no more errors. returns the original seq mind, but still - progress :)

6:45 wmealing_: sorry about that

6:48 clgv: rasputnik: but I can tell you, you are overthinking this problem.

6:49 rasputnik: clgv: oh i'm sure i am :) have to complete it though to see the other solutions

6:49 wmealing_: amalloy_: my lazybot isnt responding to anything, what did i do wrong ?

6:50 rasputnik: clgv: I don't know the library functions at all, see, so have to bang rocks together

6:50 (which i think is part of the point of the exercise)

6:51 clgv: depending on you knowledge probably. but if so you should read about the basic data types in clojure and the common operations on them

6:52 rasputnik: clgv: yeah think it comes down to lucky stumbling at the moment :)

6:52 was happy with the previous exercise, ended up with a sort of map/reduce to count sequence elements

6:52 clgv: rasputnik: you got a clojure book?

6:53 rasputnik: clgv: yup, programming clojure (the pragprog one). it's pretty good.

6:53 i'm on the tail recursion chapter, which is probably why i'm fixating on it now

6:53 clgv: rasputnik: then read the part about the data structures after that problem ^^

6:54 or if you having problems stop to read it^^

6:55 rasputnik: ah, it's all good fun. doing this while I'm off on sick leave from work, so no rush.

6:55 clgv: thanks for the advice though, appreciate it.

6:56 clgv: ah ok. I wouldnt want to spent so much time on the simple problems - I like the harder problems on 4clojure more ;)

6:57 rasputnik: clgv: sometimes you have to plod through the easy stuff to get to the final boss though IYSWIM

6:59 WOOOO nailed it!

7:00 ro_st: where can i learn about leiningen trampoline's with-profile?

7:03 rasputnik: also: cheated and did a (source reverse) which is probably not in the spirit.

7:03 * rasputnik levelled up

7:04 clgv: rasputnik: try golf score 7 ;)

7:05 rasputnik: hey, baby steps here mate ):

7:05 i'll have a look at yours on there

7:09 clgv: actually that can get to 6 #trolololol

7:10 clgv: humm right

7:10 rasputnik: (don't need the "'")

7:11 (i am following a few people, not my solution. sorry :))

7:11 clgv: probably remained from that clojure 1.1/1.0 book

7:13 mpan: how is golf scored in this sort of syntax? # tokens? #s-exprs?

7:14 rasputnik: mpan: character count

7:15 mpan: ah ok thanks

7:15 clgv: non-whitespace character count ^^

8:01 romain_p_: Hi everyone, does anybody know how to handle the DRAGSTART event using ClojureScript (and C2 if possible: the "on"... function); also, does adding drag and drop handlers on SVG elements work?

8:02 (I mean the Google Closure DRAGSTART event)

8:33 michaelr525: hmm

8:33 how to read request body in comojure?

8:33 I'm getting it as org.eclipse.jetty.server.HttpInput

8:39 xeqi: michaelr525: I would use ring.middleware.multipart-params; which you get if you use compojure.handler/site

8:40 that will read it for you and place key/values into the params

8:40 michaelr525: oh cool

8:41 xeqi: thanks

8:42 deadringer: not sure if this question is appropriate for the channel, but does anyone have any experience with using proguard on uberjars?

8:43 michaelr525: xeqi: and for json?

8:43 deadringer: I've been trying to make it work on a default lein project for the past hour or so... constantly running into problems. Wondering if anybody can help.

8:43 wmealing_: anyone here run lazybot ?

8:49 michaelr525: ring-json-params seems good

9:00 xeqi: michaelr525: that could work, or you could run chesire over the values manually

9:01 wmealing_: that would be Raynes or amalloy_, but I've been futzing with it lately

9:01 do you have a question about it?

9:03 wmealing_: xeqi: yeah, kind of expected it to respond.. to anything

9:03 xeqi: ie, a login.. but i never hear peep from it

9:03 how do you login ?

9:03 xeqi: &"hi"

9:03 lazybot: ⇒ "hi"

9:04 wmealing_: the symbol is @ by default,

9:04 i dont think i have the clojure stuff enabled

9:04 xeqi: $login I think, only ever seen raynes do it for updates

9:05 ah, you're running a version of it

9:05 wmealing_: yes..

9:06 i can look deeper, but if ive done something obviously stupid..

9:06 'd rather spent time having it do what i need, rather than spend hours finding that i missed something obvious

9:09 xeqi: have you set it up ?

9:09 xeqi: do you have a ~/.lazybot/config.clj ?

9:09 wmealing_: yes.

9:10 i have it join an irc network

9:10 and the channel

9:10 xeqi: no, I've just been over the source code a few times

9:10 * wmealing_ nods

9:12 xeqi: blah, I'm outta helpful ideas, but would expect it to be related to the config.

9:12 might have to wait for one of Raynes or amalloy_ for good advice

9:17 michaelr525: xeqi: i wonder how chesire compares with clojure.data.json

9:20 clgv: do I have any chance to create a macro that generates a ns-form and use this instead of an ns-form?

9:21 my first try fails when the generated ns-form loads another ns with the same macro

9:25 romain_p_: I get an error when trying to use C2's 'on-raw' function: "invalid listener argument". The code is: (on-raw "#list" ".item" :dragstart (fn [e] (.log js/console (str "dragstart "))))

9:25 Anybody knows why?

9:25 xeqi: michaelr525: the impression I get from here is that it is better, but I haven't used either firsthand

9:37 naeg: how I can I access a specified bit of a number?

9:37 only way I can think of is bit-test

9:38 tomoj: isn't that what you want?

9:41 naeg: tomoj: seems so :3

9:41 * wmealing_ thought the same thing

9:48 naeg: is it OK to nest two maps? or is there a better solution?

9:49 the-kenny: naeg: Absolutely ok. Just use whatever data format fits to your domain

9:49 There's even assoc-in to update nested entries.

9:50 naeg: the-kenny: I'm not manipulating, just printing

10:30 Kneferilis: hello

10:30 it's been a while since the last time I programmed in the java environment

10:31 what do I need to build an applet in clojure?

10:33 i mean, ok, I install latest jdk, then?

10:33 S11001001: Kneferilis: lots of patience on behalf of your users, mainly

10:33 Kneferilis: I assume I should have the clojure library in my project's folder?

10:33 S11001001: Kneferilis: you can get applets into jars right?

10:33 nDuff: Kneferilis: If you aren't already, you should be using a clojure-aware build tool

10:34 S11001001: Kneferilis: as nDuff says, start with leiningen

10:34 nDuff: Kneferilis: ...those will be responsible for downloading the version of Clojure you want for you.

10:34 (If you already have a codebase using something other than Leiningen, there are plugins for Gradle, Maven, &c. adding Clojure support -- but Leiningen _is_ the gold standard)

10:35 Kneferilis: nDuff: so, leiningen compiles my projects?

10:35 nDuff: Kneferilis: Yes.

10:35 uvtc: Kneferilis: I haven't seen applets used in quite a while. If you want an app that runs in a browser, I think you can use Clojurescript to build client-side browser-based apps.

10:35 Kneferilis: nDuff: sounds good, does it also install jdk and clojure library?

10:36 S11001001: Kneferilis: not jdk

10:36 Kneferilis: S11001001: just the clojure library?

10:36 uvtc: Kneferilis: What OS are you using?

10:36 S11001001: Kneferilis: jre (not jdk as it happens) is lein's prerequisite

10:37 Kneferilis: uvtc: windows 7 64 bit at home, it's for a home project

10:37 S11001001: how is lein going to compile a project without jdk?

10:37 S11001001: Kneferilis: because clojure is not java

10:37 jcromartie: speaking of Clojure and OS… I have a Mac OS X Lion system running an Ubuntu Server inside VirtualBox

10:37 Clojure is about 2X faster in the VM

10:37 S11001001: Kneferilis: and every other library you end up using, plus it packages things up right and sets up your editor for repl hacking

10:37 jcromartie: ,(time (count (map str (range (Math/pow 10 6)))))

10:37 clojurebot: "Elapsed time: 518.675539 msecs"

10:37 1000000

10:38 jcromartie: that runs in 310 msecs on the host OS, 160 on the guest

10:38 Kneferilis: S11001001: sounds cool

10:38 uvtc: Kneferilis: Note that Clojure is just another Java jar. Once you've got Java installed, you install Leiningen (the project management tool), and it will take care of grabbing all your dependencies for you (including Clojure itself).

10:39 S11001001: Kneferilis: the clojure library includes the clojure compiler, so the only reason to have jdk is if you need to compile java *source* as well

10:39 Kneferilis: I see. I will go for lein ofcource. But maybe I will just build a desktop application, I don't know if lein compiles applets.

10:39 chouser: Kneferilis: one key complication is that unsigned applets cannot do reflection, so you'll have to be vigilant with *warn-on-reflection* and make sure the Clojure compiler doesn't generate any reflection code, or it'll blow up at runtime.

10:40 nDuff: Kneferilis: There's nothing different about compiling applets.

10:40 Kneferilis: ...well, there may be some META-INF miscellany needed -- been too long to remember -- but if it is, and _if_ it can't be added with lein, you can add that in with a shell script.

10:42 djanatyn: what's an idiomatic way to return a list with a random element removed?

10:42 Kneferilis: I see.

10:42 djanatyn: I also want to return the element that I removed, too

10:42 something like (remove-random [1 2 3]) => [1 [2 3]]

10:43 (rand-nth)returns a random element, but I'm working with lists that may have duplicate elements

10:44 I guess removing exactly one of the element returned is an acceptable solution

10:46 abalone: jcromartie: is it clojure that is faster on your ubuntu VM or is it java itself that is faster?

10:46 jcromartie: abalone: I have no idea

10:46 abalone: generally the VM is faster at everything

10:46 abalone: Clojure, Python, Ruby

10:47 abalone: jcromartie: that's pretty cool

10:47 djanatyn: how can I use remove but only remove *one* item?

10:47 jcromartie: abalone: the guest OS is under much less lost, itself, so it might have a more straightforward path when executing anything… i.e. it's not running a GUI or any extra services

10:48 "much less load"

10:48 S11001001: djanatyn: ##(doc split-with)

10:48 lazybot: ⇒ "([pred coll]); Returns a vector of [(take-while pred coll) (drop-while pred coll)]"

10:49 djanatyn: thanks!

10:49 abalone: jcromartie: oh. i thought magic was involved.

10:50 tomoj: djanatyn: what are you actually doing?

10:51 Kneferilis: thanks for the information

10:52 AntelopeSalad: newbie question: is it worth bothering with clojurescript to write client side code (which gets compiled to js automatically i guess?) if you plan to run clojure on the server?

10:53 nDuff: AntelopeSalad: Depends on how interesting the things you're doing on the client side are, and if you want to use the reader for transport.

10:53 AntelopeSalad: i'm coming from a node/js background and really like not having to context switch, i was hoping between clojure and clojurescript the same type of workflow would be possible once you have your dev env. setup?

10:53 nDuff: AntelopeSalad: since cljs includes the reader, you can send Clojure literals over the wire between the client and server if you want to not have to deal with JSON or such.

10:54 AntelopeSalad: ...personally, it's been worth it for me, because I like having my state compartmentalized into atoms (with watches used to trigger actions on changes to that state).

10:54 AntelopeSalad: nDuff: so right now you write your server code in clojure and use cljs to spit out js for the client?

10:55 nDuff: AntelopeSalad: ...not for the project I'm writing _right now_ -- it doesn't have a web interface at all -- but for my last one, yes.

10:55 AntelopeSalad: atm, i'm not even sure what a reader or atom is haha, all i did was watch rich's talk on simple made easy and he's my new hero

10:55 so i figured i'd fool around with clojure

10:57 nDuff: AntelopeSalad: Might I suggest The Joy of Clojure? It covers not only what those things are, but why they're important and when to use them.

10:57 (and a whole lot of other underlying philosophy)

10:58 AntelopeSalad: thanks i'll check it out

10:59 * nDuff tries to figure out AntelopeSalad's location from a traceroute... Rhode Island, maybe? Not book-loaning distance, anyhow.

11:00 AntelopeSalad: you're off by a few states

11:00 chouser: nDuff: I was just re-reading that. It could use some work.

11:01 AntelopeSalad: is it more philosophy oriented? i'm usually iffy on books when it comes to programming languages because of how things change

11:01 nDuff: chouser: ...heh. Another edition pending?

11:01 chouser: nDuff: shh

11:01 wmealing_: xeqi: the problem was a poorly configured mongodb/hostname resolution problem

11:02 nDuff: AntelopeSalad: It's much more philosophy oriented than the other leading (IMHO) book, Clojure Programming (http://clojurebook.com/)

11:02 abalone: chouser: if we bought the ebook, would an update cost money?

11:02 nDuff: AntelopeSalad: ...though Clojure Programming covers a lot of philosophy too; you can't go wrong with either.

11:02 chouser: abalone: if there were an update, I have no idea how the pricing would work out.

11:02 duck11231: AntelopeSalad: "lein cljsbuild auto" works pretty well for automatically compiling your cljs into js for your page to use. I usually keep that running in screen while I'm developing

11:03 AntelopeSalad: duck1123: nice, so it's seamless for development -- and you deploy native js?

11:05 duck11231: yep. As soon as I save the file, the js should be ready for me to use. I have it compile to the my assets directory

11:06 AntelopeSalad: excellent, that's exactly what i'm looking for -- context switching wise (mentally), are you experiencing any problems?

11:06 duck11231: you just have to resist the urge to hit C-c C-k (The command to send clojure code to the server) I don't know what I'd do if Clojure ever got :use-macros

11:07 Not really. I'm dealing with a lot of non-cljs libraries, so I have to think about how it'll emit the js code, but for most things, I just think in Clojure

11:08 AntelopeSalad: seems fair enough

11:09 * nDuff uses the clojurescript REPL during development with emacs+inferior-lisp

11:10 nDuff: ...so my experience with clojurescript doesn't include so much about avoiding C-c C-k :)

11:10 that said, you _will_ need to figure out how to write annotations for the 3rd-party javascript libraries you interoperate with if you want to be able to compile in advanced mode (and if you don't, the generated javascript is huge)

11:11 duck11231: I tried using the clojurescript repl, but I wasn't finding it very useful. Maybe I just wasn't using it right

11:12 nDuff: ...so, one thing that I did find necessary was using a browser that can show you source it received over-the-wire when hitting a breakpoint there

11:12 without that, the clojurescript repl wouldn't have been nearly as handy

11:12 but it's something Chrome does well.

11:12 Firebug, not so much.

11:13 duck11231: I used to love Firebug, but since I've been writing a lot of JS for my day job, I've found I prefer the webkit console

11:14 bobbywilson0: I'm not sure why this doesn't work `(map str/split ["01 02 03", "04 05 06"] #"\s")`, can anyone explain?

11:15 xeqi: for clojurescript and C-c C-k: https://github.com/cemerick/piggieback

11:15 duck11231: ,(map #(str/split % #"\s") ["01 02 03", "04 05 06"])

11:15 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: str, compiling:(NO_SOURCE_PATH:0)>

11:15 xeqi: well, I think theres a pull request I need to send to nrepl.el first, but it should all work well together soon

11:16 duck11231: ,(map #(clojure.string/split % #"\s") ["01 02 03", "04 05 06"])

11:16 clojurebot: (["01" "02" "03"] ["04" "05" "06"])

11:16 bobbywilson0: duck11231: thanks

11:17 duck11231: bobbywilson0: in your case, it was trying to take one from each collection (including the "collection" #"\s")

11:17 bobbywilson0: duck11231: ah, ok makes sense

11:18 tomoj: &(map clojure.string/split ["01 02 03" "04/05/06"] [#"\s" #"/"])

11:18 lazybot: ⇒ (["01" "02" "03"] ["04" "05" "06"])

11:19 bobbywilson0: tomoj: oh interesting

11:21 djcoin: Does clojurescript generate "compact" javascript with not so much boilerplate so it can be inspected/used to debug in the browser ?

11:22 duck11231: if you choose the simple or whitespace modes, you can usually get something clean enough that you can follow it, but messier than hand-written code

11:22 djcoin: I was thinking also to folks pluggin some userscript (exemple with grease monkey)

11:23 example *

11:23 But I guess I would rather set up a specific API

11:23 ok duck11231

11:23 thanks :)

11:24 It's a very vague question but I too, come rather from writing heavy loads of js. A bit from nodejs and most of in clientside

11:25 duck11231: The other day, I took a simple mode output and shrunk it down to what I would've written in js, there was quite a bit of shrinkage. Mostly due to stuff like gensyms and the whay it represents things like when-let and or

11:28 kang: I wonder how I can get the the sequence (from head to some proper place) when the item firstly broke some rule? for example (thefunctioniwant #(> 3) '(1 2 3 4 5 6)) would return (1 2 3 4)

11:28 duck11231: Sometimes I'll open my generated js file in one buffer, and have my cljs source in the other buffer and set the js file to auto revert. That way I can see how changing my cljs forms affect the generated js.

11:28 xeqi: (doc take-while)

11:28 clojurebot: "([pred coll]); Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects."

11:30 kang: thanks.

11:32 AntelopeSalad: duck1123: have you seen this? http://vimeo.com/29535884

11:33 it's a short video on using the cljs repl

11:34 duck11231: AntelopeSalad: I did, but I got annoyed when I couldn't simply require my namespace and invoke my functions like I would in a clj repl

11:34 so I didn't go much further

11:34 one of these days I'll go back and try it again

11:35 * nDuff isn't clear on what duck1123 is talking about

11:35 nDuff: (you couldn't?)

11:36 duck11231: nDuff: no, and when I asked about it, I was told it wasn't possible. (love for you to proove me wrong)

11:36 nDuff: ...granted, if you used (ns ...) to changes namespaces, you needed the whole declaration, as it would otherwise wipe your requires/whatnot...

11:36 but, ehh, I did that all the time.

11:36 duck11231: ok, then. I'll give it another shot later on tonight

11:37 nDuff: ...oh, require'ing your namespace, not switching to it, so you _are_ suggesting a slightly different workflow

11:37 I always moved the REPL into my target namespace.

11:38 duck11231: for instance, I was in my target namespace, but then I was trying to require some of the utility namespaces I use (such as jayq.core)

11:39 I could access all of my namespaces via interop, but by that point, why not just use chrome's console

11:43 imade: it it possible to destruct a map in a let?

11:43 llasram: Lazy IRC question: I vaguely recall a utility library which contained a macro (or at least template) for implementing all the map-ish interfaces for a fresh deftype. Anyone know what I might be thinking of?

11:44 duck11231: ,(let [{:keys [a b c]} {:a 1 :b 2 :c 3}] [a b c])

11:44 clojurebot: [1 2 3]

11:44 nDuff: imade: Yes, it is.

11:44 imade: (let [{true anagrams false rest} (group-by (partial anagram? w) words)]

11:44 naeg: What is the correct way to determine the order of expressions depening on some test? i'm doing it with a if, but that's ugly: http://bpaste.net/show/204CYg8hsbCkOixIt1Z4/

11:44 imade: this gives error

11:45 nDuff: imade: See the way duck1123 just demonstrated it to you

11:45 hyPiRion: ,((juxt keys vals) {:a 1 :b 2 :c 3})

11:46 clojurebot: [(:a :c :b) (1 3 2)]

11:46 imade: but if I know that my map would be {true xs false ys} and I want only xs, then how can I destruct to get xs

11:46 jcromartie: I saw a presentation that said you can use "send" inside of "dosync" and it will only send the action if the transaction completes

11:46 but I do not see this documente

11:47 documented anywhere

11:47 nDuff: jcromartie: It _is_ the case.

11:47 hyPiRion: imade: (let [xs (map true)] ...) ?

11:47 jcromartie: oh I see

11:47 * nDuff has seen that behavior documented in print as well.

11:47 jcromartie: I was grep'ing for "dosync" and "send" in their respective docs

11:47 "Agents are integrated with the STM - any dispatches made in a transaction are held until it commits, and are discarded if it is retried or aborted."

11:47 nDuff: Ahh; there you are.

11:48 imade: hyPiRion, yes that would work, but I was searching for smth else

11:49 nDuff: imade: destructuring expects the keys to be keywords, not values

11:49 imade: ...so, having true rather than :foo as your key makes it not a good fit.

11:50 imade: nDuff, ok, thanks

11:50 I'll use intermediate result then

11:51 duck1123: ,(let [{t true f false} {true 'xs false 'ys}] [t f])

11:51 clojurebot: [xs ys]

11:53 imade: duck1123, nice!

11:54 duck1123: map destructuring expects the first val to be a var and the second to be the key. If the first val is a keyword, it does something special. (:keys :as :or, etc.)

11:55 nDuff: Heh.

11:56 * nDuff just learned something; thanks!

11:59 whitaker: I'm musing out loud, but… has anyone else here wanted to talk AMQP to RabbitMQ, tried WabbitMQ for its advertised ease of use, only to dump it in disgust in favor of Langohr? Just curious.

11:59 antares_: whitaker: I did

11:59 I developed Langohr for that reason

11:59 Chousuke: :P

11:59 whitaker: ah!

12:00 heh

12:00 nDuff: antares_: heh -- howdy!

12:00 whitaker: Thanks for Langohr.

12:00 * nDuff <- actively using langohr

12:00 whitaker: same.

12:01 antares_: Langohr is far from ideal and does not have doc guides like http://rubyamqp.info but it was built with a few years of RabbitMQ usage behind me and follows AMQP 0.9.1 model closely

12:02 duck1123: whitaker: When I was using Rabbit I did exactly that (wabbit first, then langohr)

12:02 whitaker: I wasted a couple of days recently dealing with WabbitMQ, and then, after some hours of RTFM, I had a "WTF?" moment and realized that the implementor didn't under the spec

12:02 nDuff: ...only place where I've had issues with langohr is not throwing exceptions early enough

12:02 antares_: but with http://clojureelasticsearch.info being almost 1.0, Langohr will soon get its own dose of attention

12:02 nDuff: for instance, if the server closes my channel due to duplicate acks, I don't get an exception over that, but only about the channel being closed next time I try to do something

12:02 whitaker: s/under/understand

12:02 nDuff: with no obvious way to tell how/why it closed

12:02 antares_: nDuff: feel free to file issues if you don't like something

12:03 nDuff: that's strange, maybe langohr.consumer/subscribe swallows exceptions

12:03 the Java client will raise an exception

12:04 or rather, pass it to a handler

12:04 that's a tricky part to expose to Clojure in a good way

12:04 you basically need a bunch of functions tied together

12:05 whitaker: Has anyone here personally tried to educate mefesto/Allen Johnson on the deficiencies of wabbitmq?

12:06 nDuff: Hmm. If I follow correctly (and I'm not sure I do) -- would it be reasonable for the handler to store the exception associated with the channel, then raise it on next use?

12:06 Eh -- probably makes more sense to have this discussion happen in a ticket.

12:07 * nDuff opens one.

12:07 technomancy: antares_: I may end up adapting clojuresphere to use neocons; digging the docs there

12:08 antares_: nDuff: there is a way to create a consumer with a bunch of functions, I think we need to somehow make consumer/subscribe be more like that

12:08 technomancy: nice. What does it currently use?

12:09 technomancy: antares_: slurp+read-string =)

12:09 the data set changes very slowly, but part of that is due to the fact that it's currently cumbersome to update

12:09 antares_: technomancy: I see. Yeah, it may be a bit tricky to efficiently query with that.

12:10 technomancy: well it's still quite small

12:10 antares_: plus, neo4j server has decent search built in which is nice

12:10 technomancy: so the primary deficiency of the current setup is the fact that the data map is checked into git

12:11 XPherior: If another thread has a var, and I try to do with-redefs on it on another thread, should with-redefs actually fail to override the var?

12:11 Totally baffled by this one for like 2 weeks.

12:12 technomancy: with-redefs changes the var's root, so it's visible everywhere. it's not the slightest bit safe and inappropriate for production use.

12:13 it's there for tests

12:13 XPherior: technomancy: Idea is that I have a function that gets data from persistence. In a test, I want to override what it does to return canned data.

12:13 So yes, trying to use it for tests. I passed #'app to run-jetty as well

12:13 technomancy: cool; should be good then

12:13 XPherior: You'd think, right?

12:14 Maybe something's up with clj-webdriver.

12:15 If you get a sec, could you see if anything's obviously wrong with how I'm trying it, technomancy? http://stackoverflow.com/questions/12271054/compojure-app-not-playing-well-with-with-redefs

12:16 djanatyn: tomoj: I was trying to ... uhh, shake a list

12:16 to mix up the elements randomly

12:16 XPherior: Shuffle, djanatyn

12:16 djanatyn: is there a (/ x y) that always returns a float?

12:16 I always do (defn d [x y] (float (/ x y)))

12:16 thanks, XPherior

12:18 naeg: new connect four checking algorithm using bitboard reprensation: https://gist.github.com/3639220

12:18 would be great if some of you could take a look at it and help me, especially with (insert) and (bit-check-board)

12:19 also, the checking algorithm always checks the whole board, but takes only ~0.025 msecs

12:26 Moses: I'm running ubuntu and can't seem to get compojure's auto refresh working. Its loading up chromium, but when I change my source files, it doesn't refresh the browser.

12:27 XPherior: I don't think it's supposed to work like that, Moses?

12:28 scriptor: Moses: I Mthink this might help https://github.com/ring-clojure/ring/wiki/Interactive-Development

12:28 XPherior: Maybe I'm wrong. *Shrug*

12:29 Moses: Thank you <scriptor>

12:29 * nDuff is pretty sure that automatically refreshing the browser isn't a part of what that does.

12:30 nDuff: ...frankly, if refreshing the browser manually reflects your code changes, you're doing pretty well. :)

12:30 XPherior: Haha.. Yeah that's true nDuff

12:30 scriptor: how neat would that be though, if ring could force browser refreshes on code changes?

12:30 XPherior: I'd adore it.

12:31 Does Chrome have an API sort of thing for being able to force a refresh from another process?

12:31 hyPiRion: Some javascript injection and you've got it.

12:31 technomancy: XPherior: mozrepl does that for mozilla

12:31 scriptor: yep, if you want to get fancy I guess it could be done via websockets

12:31 technomancy: chrome's extension API is pretty crappy compared to moz though

12:31 XPherior: technomancy: That's sick. I gotta try it.

12:32 Hey technomancy, curious. What're you doing for a living at the moment?

12:32 scriptor: window.location = window.location seems to work

12:32 technomancy: XPherior: I'm working for Heroku maintaining Clojure support and the general build pipeline

12:33 XPherior: Wow, that's a sweet job.

12:33 technomancy: can't complain

12:33 `thomas: With Seesaw is it possible to listen to a change of a slider's value?

12:36 antares_: technomancy: ok, let me know how it goes with Neocons

12:40 bobbywilson0: ,(map #(read-string (str/replace % #"^0" "")) (map #(str/split % #"\s") (#(str/split-lines %) "01 02 03\n04 05 06")))

12:40 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: str, compiling:(NO_SOURCE_PATH:0)>

12:40 bobbywilson0: ,(map #(read-string (clojure.string/replace % #"^0" "")) (map #(clojure.string/split % #"\s") (#(clojure.string/split-lines %) "01 02 03\n04 05 06")))

12:40 clojurebot: (["01" "02" "03"] ["04" "05" "06"])

12:41 bobbywilson0: I am expecting ([1 2 3] [4 5 6]) what did I mess up?

12:42 hyPiRion: ,(read-string "01")

12:42 clojurebot: 1

12:42 bobbywilson0: hyPiRion: that's what I want :)

12:42 scriptor: , (map #(clojure.string/split % #"\s") (#(clojure.string/split-lines %) "01 02 03\n04 05 06"))

12:42 clojurebot: (["01" "02" "03"] ["04" "05" "06"])

12:43 hyPiRion: yeah, there's your problem.

12:43 raek: ,(read-string "08")

12:43 clojurebot: #<NumberFormatException java.lang.NumberFormatException: Invalid number: 08>

12:43 hyPiRion: ,(read-string "([\"01\" \"02\" \"03\"] [\"04\" \"05\" \"06\"])")

12:43 clojurebot: (["01" "02" "03"] ["04" "05" "06"])

12:44 hyPiRion: ,(read-string "[\"01\" \"02\" \"03\"]")

12:44 clojurebot: ["01" "02" "03"]

12:44 bobbywilson0: hyPiRion: I still don't understand the problem

12:44 raek: I am replacing the leading zeros with ""

12:44 ,(read-string "8")

12:44 clojurebot: 8

12:45 gfredericks: ,(read-string "0456")

12:45 clojurebot: 302

12:45 hyPiRion: bobbywilson0: You're mapping the different vectors, not the elements.

12:45 nvy: map twice or so

12:45 bobbywilson0: hyPiRion: ahhh, ok, shoot

12:46 raek: ,(for [line (clojure.string/split-lines "01 02 03\n04 05 06"))] (for [word (re-seq #"\S" line)] (Integer/parseInt word)))

12:46 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>

12:46 raek: ,(for [line (clojure.string/split-lines "01 02 03\n04 05 06")] (for [word (re-seq #"\S" line)] (Integer/parseInt word)))

12:46 clojurebot: ((0 1 0 2 0 ...) (0 4 0 5 0 ...))

12:47 raek: ,(for [line (clojure.string/split-lines "01 02 03\n04 05 06")] (for [word (re-seq #"\S+" line)] (Integer/parseInt word)))

12:47 clojurebot: ((1 2 3) (4 5 6))

12:47 raek: maybe Long/parseLong is more ideomatic these days...

12:47 bobbywilson0: raek: interesting approach with for

12:47 oh ok

12:48 I didn't know about Long/parseLong

12:53 tanzoniteblack: bobbywilson0: all the long methods from java (http://java.sun.com/javase/6/docs/api/java/lang/Long.html) are available to you, hence Long/parseLong

12:55 mdeboard: hm

12:55 ,(-> (clojure.string/split-lines "01 02 03\n04 05 06") (fn [x] (apply (clojure.string/split x #"\s+"))))

12:55 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>

12:55 mdeboard: :boggle:

12:55 Why doesn't that work

12:55 nDuff: Can one provide a default implementation of a protocol? I notice that providing an implementation for Object isn't good enough -- doesn't help nil, for instance, and I'm worried about whether other boundary cases exist as well.

12:56 bobbywilson0: tanzoniteblack: unfortunately I don't know a lick of java :[

12:56 nDuff: mdeboard: Think about how the threading macro rewrites the fn _definition_

12:56 mdeboard: ,(-> (clojure.string/split-lines "01 02 03\n04 05 06") #(apply (clojure.string/split % #"\s+")))

12:56 clojurebot: #<CompilerException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentVector, compiling:(NO_SOURCE_PATH:0)>

12:57 nDuff: mdeboard: (fn (clojure.string/split-lines ...) [x] (apply ...))

12:57 dnolen: nDuff: default and nil are not the same case, you need to handle both.

12:58 nDuff: dnolen: Noted. Presuming that I do so -- is Object good enough for default?

12:58 dnolen: nDuff: yes that's what Object is for, the default.

12:58 tanzoniteblack: bobbywilson0: you don't need to know Java, but if you feel like you're "missing" some sort of method that would be bloody useful on a basic type (like Long, or Integer, or String), try typing (javadoc Long) and see if Java has something for you

12:59 mdeboard: nDuff: Wait, huh? I thought it got compiled to `(fn [x] (apply (split (split-lines "w x\ny z") #"\s")))'

12:59 bobbywilson0: tanzoniteblack: thanks for the tip

12:59 nbeloglazov: &(doc ->)

12:59 gtrak`: I saw a discussion on read-string vs Integer/parseInt here yesterday, and now I find that I need to do the same thing. I think the consensus was read-string was better, however it seems like calling read-string on user input (command line arguments) is probably a bad thing to do, yes? I guess it's not harmful unless eval'd.

12:59 lazybot: ⇒ "Macro ([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."

13:00 mdeboard: I see

13:00 Ok

13:00 mind blown

13:00 nbeloglazov: why read-string was better?

13:01 TimMc: gtrak`: Sure, so make sure *read-eval* is disabled.

13:01 gtrak`: TimMc: ah, thanks for the tip, didn't know about that one

13:01 TimMc: Integer/parseInt just makes more sense to me -- very clear on input and output.

13:01 * technomancy prefers Integer.

13:02 nbeloglazov: I also like Inteteger/parseInt more

13:02 TimMc: gtrak`: Yeah, I've filed a bug for that to be mentioned in read(-string)'s docs... :-/

13:02 gtrak`: I will +1 it :-)

13:03 mdeboard: clojurebot has just informed me that noir is great

13:03 bobbywilson0: technomancy nbeloglazov: because it more clearly expresses what you are trying to do?

13:03 TimMc: http://dev.clojure.org/jira/browse/CLJ-904

13:03 tanzoniteblack: read-string does have more flexibility if you're not sure what kind of number is going to be coming to you, i.e. (read-string "2.3")

13:03 nbeloglazov: bobbywilson0: usually operation is to convert string to int, not to just read string and get some unknown object

13:04 tanzoniteblack: granted...sometimes you don't want that flexibility, but want to control your inputs better so you don't get input like that, but somtimes you might

13:05 nbeloglazov: &(Double/parseDouble "100000000000000000000000000000000000000000000000000")

13:05 lazybot: ⇒ 1.0E50

13:05 bobbywilson0: makes sense

13:08 Norrit: Hi, I have a littel problem with nrepl.el ...

13:08 When I connect to a nrepl server in emacs the repl is opened but when I try to evaluate an expression the error "Wrong type argument: stringp, nill" is thrown ... any suggestions?

13:08 nbeloglazov: Norrit: what version of emacs?

13:09 Norrit: https://github.com/kingtim/nrepl.el/issues/88

13:09 Norrit: 24 .. let me check

13:09 nbeloglazov: Hm, then it's not the case

13:10 Norrit: GNU Emacs 24.0.94.7

13:10 nbeloglazov: Don't know then

13:11 Norrit: ok, thanks anyway :-)

13:25 mdeboard: ok, here we go.

13:25 (-> (split-lines "01 02 03\n04 05 06") (#(map (fn [x] (split x #"\s+")) %)) flatten (#(map read-string %)))

13:25 ,(-> (split-lines "01 02 03\n04 05 06") (#(map (fn [x] (split x #"\s+")) %)) flatten (#(map read-string %)))

13:25 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: split in this context, compiling:(NO_SOURCE_PATH:0)>

13:25 mdeboard: you son of a gun

13:25 (-> (clojure.string/split-lines "01 02 03\n04 05 06") (#(map (fn [x] (clojure.string/split x #"\s+")) %)) flatten (#(map clojure.string/read-string %)))

13:26 ,(-> (clojure.string/split-lines "01 02 03\n04 05 06") (#(map (fn [x] (clojure.string/split x #"\s+")) %)) flatten (#(map clojure.string/read-string %)))

13:26 clojurebot: #<CompilerException java.lang.RuntimeException: No such var: clojure.string/read-string, compiling:(NO_SOURCE_PATH:0)>

13:26 mdeboard: Sorry for the spam.

13:26 ,(-> (clojure.string/split-lines "01 02 03\n04 05 06") (#(map (fn [x] (clojure.string/split x #"\s+")) %)) flatten (#(map read-string %)))

13:26 clojurebot: (1 2 3 4 5 ...)

13:26 mdeboard: There.

13:28 djanatyn: is there anything special you need to do with defrecord to use the classes you made in other files?

13:29 TimMc: ~flatten

13:29 clojurebot: flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.

13:29 djanatyn: in roguelike.entity, I have the line (defrecord Entity [name stats])

13:30 in roguelike.player, my namespace declartion is (ns roguelike.player (:use roguelike.entity))

13:30 dnolen: mdeboard: it seems a bit odd to use -> there when you're threading through seq ops.

13:30 ,(->> (clojure.string/split-lines "01 02 03\n04 05 06") (map (fn [x] (clojure.string/split x #"\s+"))) flatten (map read-string))

13:30 clojurebot: (1 2 3 4 5 ...)

13:30 djanatyn: errm, roguelike.entity is in a vector.

13:30 mdeboard: dnolen: Yeah, I was just being stubborn at that point

13:30 TimMc: ,(for [line (clojure.string/split-lines "01 02 03\n04 05 06"), num-str (clojure.string/split line #"\s+")] (read-string num-str))

13:30 clojurebot: (1 2 3 4 5 ...)

13:30 djanatyn: in roguelik.player, I tried using (def me (Entity. "djanatyn" {:hp 10 :mp 10}))

13:30 mdeboard: I agree threading macros aren't the right choice, I was just determined.

13:31 TimMc: mdeboard: ^ use for :-)

13:31 mdeboard: ld if I was going ot use 'for' I'd write Python

13:31 ಠ_ಠ

13:31 (kidding)

13:31 dnolen: djanatyn: :import, but really you should use the create ctors or your own.

13:31 djanatyn: after trying to compile roguelike.player, it says "unable to resolve classname: Entity" D:

13:32 dnolen: the created ctors or you own I mean.

13:32 djanatyn: ctors? o_O

13:32 pandeiro: is there a shortcut to recompile all emacs buffers in nrepl?

13:32 dnolen: (ns foo (:import [your.ns Entity]))

13:32 djanatyn: ctor -> constructor fns

13:33 aaelony: I'd like to avoid #{:b :a} since #{:a :b} is sufficient. How can I amend the following? (for [x (seq [:a :b :c]) y (seq [:a :b :c]) :when (not= x y)] (into #{} [x y]))

13:34 ,(for [x (seq [:a :b :c]) y (seq [:a :b :c]) :when (not= x y)] (into #{} [x y]))

13:34 clojurebot: (#{:a :b} #{:a :c} #{:a :b} #{:c :b} #{:a :c} ...)

13:34 dnolen: djanatyn: if you use the namespace where the record is defined a positional ctor function called ->Entity will be available

13:34 djanatyn: oh! I saw that, and I was really confused

13:34 pandeiro: ,(set (for [x (seq [:a :b :c]) y (seq [:a :b :c]) :when (not= x y)] (into #{} [x y])))

13:34 clojurebot: #{#{:a :c} #{:a :b} #{:c :b}}

13:35 djanatyn: I didn't define that function anywhere :)

13:35 aaelony: pandeiro: that gives two #{:a :b}

13:35 pandeiro: aaelony: in the same set?

13:35 aaelony: yes

13:36 djanatyn: :) now everything is in seperate namespaces and works together

13:36 aaelony: that gives: (#{:a :b} #{:a :c} #{:a :b} #{:c :b} #{:a :c} #{:c :b})

13:36 djanatyn: thanks, dnolen

13:36 dnolen: djanatyn: np

13:36 pandeiro: aaelony: pretty sure by definition it doesn't

13:37 raek: aaelony: not when you wrap the whole thing in (set ...)

13:37 aaelony: pandeiro: try it

13:37 pandeiro: i just did, above

13:37 raek: (as pandeiro did)

13:37 aaelony: pandeiro: I see, I was using it with sorted-set

13:38 Cheiron: hey, what is the original bishop project on github?

13:38 raek: ,(for [x [:a :b :c], y [:a :b :c], :when (> x y)] #{x y})

13:38 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.Number>

13:38 aaelony: set works, but yet sorted-set gives two

13:38 Cheiron: https://github.com/search?q=bishop&repo=&langOverride=&start_value=1&type=Repositories&language=Clojure too many, don't know what is the original

13:38 raek: ,(for [x [:a :b :c], y [:a :b :c], :when (pos? (compare x y))] #{x y})

13:38 clojurebot: (#{:a :b} #{:a :c} #{:c :b})

13:38 aaelony: raek: that's cool

13:39 raek: if the items are not comparable you could let x and y be indices of a vector of the items

13:40 aaelony: I'm playing around with ways to compare subsequent items in a vector

13:40 raek: ,(let [v [:a :b :c], n (count v)] (for [x (range n), y (range n), :when (> x y)] #{(get v x) (get v y)}))

13:40 clojurebot: (#{:a :b} #{:a :c} #{:c :b})

13:40 nz-: (doc pos?)

13:40 clojurebot: "([x]); Returns true if num is greater than zero, else false"

13:40 nz-: (doc neg?)

13:40 clojurebot: "([x]); Returns true if num is less than zero, else false"

13:46 aaelony: raek: compare appears really useful in this case, thanks!

13:49 pandeiro: is nrepl-enable-on-existing-buffers like a nrepl-load-current-buffer for all open buffers?

13:50 abalone: http://twoguysarguing.wordpress.com/2010/07/26/7-rules-for-writing-clojure-programs/ ... rule #7 first paragraph ... why does he threaten to death-bludgeon if you start typing the threading macro?

13:50 aaelony: pandeiro: thanks for your help as well

13:51 pandeiro: aaelony: np

13:52 abalone: "you should use ->>" ... "but if you type the threading macro i'll bludgeon you" ... "most of the time a let would suffice" ... "but it's pathological". say what?

13:53 TimMc: Clearly it's TwoGuysArguing.

13:54 abalone: there are four lights!

13:55 (one guy needs more line breaks to become two guys)

13:55 maybe i'll read something else. anyone have a favorite rant on loop/recur for me?

13:56 SegFaultAX|work2: abalone: What are you having trouble with?

13:56 abalone: tho i still really want to know about that bludgeoning impulse. SegFaultAX|work2: why does he want to bludgeon if you start typing the threading macro?

13:58 maybe the thing about loop/recur is if you can at all avoid it with a single core clojure fn or a composition of such fn's then that's better than loop/recur. if that's the main point then i'm good. except for the bludgeoning impulse triggered by the threading macro. still don't get that.

13:59 llasram: abalone: I think that post author trying is that the threading macros are crutches for making functional code look more like imperative code. Which he's fine with, unless you're praising functional code? That's my interpretation anyway

14:00 *what the post author is trying to say

14:01 Mmmm.... words

14:02 `fogus: Hmmm, I never thought -> or ->> made anything look imperative

14:03 nz-: (doc ->>)

14:03 clojurebot: "([x form] [x form & more]); Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc."

14:03 SegFaultAX|work2: Are the threading macros generally disliked?

14:03 abalone: i like em

14:03 llasram: I think I tend to over use them, but definitely like them

14:04 abalone: `fogus: maybe steps in forward sequence look imperative. that's all

14:04 llasram: They make sequences of sequence ops or JVM interop calls waaay easier to grok

14:05 abalone: llasram: your interpretation of his writing works for me. thanks. bludgeon brain wrinlke has been ironed out.

14:05 `fogus: I like them too.

14:06 I read them as "Take this, then do this, then take the result and do this, ...."

14:06 Sgeo: I dislike them, but mostly because there are more functional solutions that I think should be used instead

14:06 `fogus: What's non-functional about them?

14:06 SegFaultAX|work2: `fogus: That's what I don't understand.

14:06 Sgeo: http://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/

14:06 `fogus, they're macros unnecessarily

14:07 It occurs to me that I may be giving your blog post back to you

14:07 abalone: Sgeo: oh. fn-functional

14:07 `fogus: Sgeo: Ah I see. You dislike the magicness of them?

14:07 SegFaultAX|work2: Are they really that magical?

14:07 Sgeo: `fogus, I dislike the lack of generality... -> puts things in the second position in the form, ->> puts themm in the last

14:07 `fogus: They are magic in that they are syntactic

14:08 Sgeo: I see

14:08 SegFaultAX|work2: But they don't have to be.

14:08 Sgeo: Using thrush instead might force a bit more typing, but allows for more generality

14:08 SegFaultAX|work2: I was having this discussion the other day and I wrote a functional version of thread in Python: https://gist.github.com/3373635

14:08 And by the other day, I mean almost a month ago apparently.

14:09 Sgeo: (thrush somevalue #(assoc % :foo 5) #(map somefn %))

14:09 SegFaultAX|work2: But as long as the co-domain of the first function matches the domain of the second and so on, it shouldn't matter that it's syntax should it?

14:09 Sgeo: Wait, that doesn't quite work

14:10 But something along those lines may be more annoying with -> or ->>

14:11 SegFaultAX|work2: Ah, because -> is maniuplating the forms instead of creating a pipeline of computation.

14:11 abalone: ~thrush

14:11 clojurebot: I don't understand.

14:11 abalone: worth a try

14:12 there was a long discussion on the ML about whether clojure core should support an operator that allowed you to cherrypick the destination of the value in the next argument list

14:12 `fogus: Can I tell clojurebot to link thrush with my blog post?

14:12 abalone: would be nice if ~thrush brought up the conclusion to that

14:12 chouser: such a macro has been written many times

14:13 Sgeo: And it would only need to be written once if it were in the core

14:13 (And it doesn't even need to be a macro, as fogus's blog post shows)

14:13 chouser: yes, but most people who have written it (myself included) have stopped using it.

14:14 Sgeo: Due to reasons intrinsic to it, or due to lack of use elsewhere?

14:14 chouser: intrisic

14:14 `fogus: Having only -> and ->> makes me think harder about my function arg ordering. I rarely have the need for -$> or its ilk

14:15 abalone: chouser: could you explain or link please?

14:16 chouser: I can try. :-)

14:17 cemerick: Sgeo: If core had everything, then no one would need to write anything! ;-)

14:18 hoover_damm: also core would have longer release cycles likely due to extra testing and more people contributing

14:18 and trying to keep it clean

14:18 chouser: All that's technically required is for the return value of form n to be legal as the first/last parameter of form n+1, but if they're not in some sense similar it is often *more* confusing to have them in a lexical thread macro than just to use let.

14:19 jkkramer: (inc chouser)

14:19 lazybot: ⇒ 9

14:19 TimMc: They're also insufficiently general because they only allow linear chaining. There should also be forms for trees and DAGs!

14:19 * TimMc runs away

14:20 chouser: That is, I would recommend against (-> 5 (< 10) (if "whoa"))

14:20 abalone: nice

14:20 chouser: actually, that's bad for different reasons.

14:21 abalone: what are the other reasons?

14:21 chouser: so, helpful use of lexical threading already assumes a similarity of type across the whole form

14:21 hyPiRion: TimMc: I agree, but it shouldn't be in core. Some pipelining library would be nice.

14:21 `fogus: (inc chouser)

14:21 lazybot: ⇒ 10

14:22 chouser: once you have that, the set of forms available is constrained to those consuming and returning similar types. The overwhelming majority of these take that similar parameter in the last position (usually fns that take seqables and return seqs) or in the first position (everything else)

14:23 cemerick: hyPiRion: Knock yourself out: https://github.com/rplevy/swiss-arrows

14:23 dnolen: corollary: if you feel the need for a arbitrary threading macro - the API you're being subjected to ... sucks

14:24 Sgeo: Bluh, the diamond wand is a macro isn't it?

14:24 chouser: That simply means that -$> type things are rarely enough needed in practice that falling back to let in those cases usually seems reasonable to me.

14:24 * Sgeo still things functions are to be preferred

14:24 cemerick: The examples on that readme are like a Rorschach test.

14:25 Sgeo: Ok, the nil-shortcutting diamond wand use cases might be better served via monads?

14:26 Hmm, or maybe not

14:26 hyPiRion: cemerick: Well, it's not really what I'm thinking of.

14:26 (-<><:p (+ 1 2) [<> 2 1] [5 <> 7] [9 4 <>]) Doesn't really strike me as.... readable.

14:26 chouser: ah, monads. The use cases of the state monad is not unrelated to the use cases of lexical threading.

14:26 are

14:27 cemerick: hyPiRion: Just another reason to be wary. Making something else that *is* readable hasn't been shown to be possible.

14:27 chouser: are not

14:27 you know what I mean

14:27 Sgeo: Hmm, is <<- related to a denest macro I've seen for CL?

14:28 hyPiRion: cemerick: Not yet, at least.

14:29 abalone: ~bludgeon

14:29 clojurebot: Gabh mo leithsc?al?

14:29 * Sgeo will have to try to understand this swiss arrow stuff

14:39 gtrak`: I feel like I've seen something just like swiss arrows somewhere once before, but it was an april fools joke

14:46 S11001001: swiss arrows is awesome

14:47 Sgeo: yes

14:50 Sgeo: Cool'

14:50 It should really get a better explanation

14:51 S11001001: fyi <<- is just backwards ->>

14:51 mattmoss: o_O

14:52 S11001001: <<- is a replacement for https://github.com/egamble/let-else and -<> is nice in practice; no experience with the other operators in swiss arrows though

14:52 gfredericks: <<-html->><<-body->>Hello World!<<-/body->><<-/html->>

14:52 mattmoss: brain asplode

14:53 gfredericks: ^ My new markup language called hhttmmll allows inline html literals with no escaping!

14:54 ro_st: brain asplode indeed

14:57 duck1123: dnolen: regarding my cljs issue last night. One of my transitive dependencies updated and added a reference to the older closure library. That was why I didn't notice it until I cleaned. Once I excluded that jar, it worked fine again.

14:59 casion: how do you use an external library in clojureC? or is this not possible yet?

14:59 dnolen: duck1123: good to hear

15:00 * Sgeo hmms at ClojureC

15:00 Sgeo: This is really starting to hilight the need for a features mechanism I think

15:30 pandeiro: is there a java or clj lib for doing arithmetic with hours, minutes, seconds?

15:30 dnolen: pandeiro: joda

15:31 uvtc: pandeiro: https://clojars.org/clj-time

15:32 pandeiro: uvtc: dnolen: i looked at clj-time last night but i didn't see how i could do basic time diffs of hour/min/second values w/o regard to timezone

15:32 dnolen: pandeiro: http://github.com/aredington/monotony also looks interesting

15:32 pandeiro: i think i'm looking for something simpler

15:33 just gonna write conversions to and from seconds

15:34 casion: it's pretty easy to do time conversion with (mod)

15:34 for just days/hours/minutes/seconds/etc..

15:35 pandeiro: casion: sure just thought it probably already existed but i guess not

15:40 duck1123: I think kibit gave me bad advice. [251] Consider: :link instead of: (fn [format] [:link format])

15:42 ohpauleez: duck1123: Yeah, it looks like kibit is matching the [] as if it were ()

15:42 arohner: pandeiro: clj-time supports all of that

15:42 and you're pretty much guaranteed to get it wrong, writing yourself

15:42 ohpauleez: ie: (:link format) instead of (fn [format] (:link format))

15:43 duck1123: Could you submit a bug on github, someone will get to it

15:43 thanks for reporting!

15:43 duck1123: sure

15:43 arohner: pandeiro: (time/in-secs (time/interval (time/now) (time/plus (time/now) (time/hours 3))))

15:44 (require '[clj-time.core :as time])

15:44 dnolen: ohpauleez: unification in core.logic works across ISequential

15:44 cemerick: ohpauleez: Looks like the blog post link @ https://github.com/shoreleave/demo-shoreleave-solr is busted

15:44 ohpauleez: cemerick: Yeah, I haven't written it yet :(

15:44 but it's coming

15:45 also, that demo isn't complete

15:45 cemerick: ah ha, a tease!

15:45 Sgeo: I think -<< is beautiful

15:45 Or is it <<-

15:45 ohpauleez: yes, a tease indeed. you should look at ro_st's demo

15:45 Sgeo: It's <<-

15:47 duck1123: Sgeo: That's the problem with having a bunch of funky macro names. (as brilliant as they may be)

15:47 TimMc: pandeiro: You just want ideal time, not calendrical time?

15:47 Sgeo: Hey, does Clojure have an equivalent of prog1?

15:47 TimMc: Sgeo: doto is the closest I can think of

15:47 pandeiro: TimMc: thank you i think that's how to express it

15:47 abstract time?

15:47 ohpauleez: dnolen: Ah, thanks for the tip

15:47 cemerick: ohpauleez: It looks reasonably straightforward, modulo the magic in fetch. :-/

15:47 pandeiro: units of time

15:48 ohpauleez: cemerick: I'm sitting on some screen casts of Shoreleave too

15:48 pandeiro: arohner: thanks for the snippet but i think it's way overkill to do (- 00:01:56,215 00:00:43,632) for example

15:49 arohner: pandeiro: depends on your requirements. doing it yourself, you're guaranteed to get it wrong wrt to timezones and daylight savings

15:49 if you're fine with that, great

15:49 pandeiro: arohner: yeah these are not calendrical, as TimMc would say ;)

15:52 gtrak`: if I'm using clojure.test fixtures a and b, do they compose like pre-a pre-b (f) post-b post-a, for instance, with (use-fixtures :once a b)? where and and b have stuff before/after the (f)

15:52 Sgeo: Because I like <* in Haskell and prog1 reminds me of it

15:54 antares_: gtrak`: no, I believe each one is called with the test fn as the argument and you do whatever you want there. Many fixture fns can wrap around.

15:54 ohpauleez: cemerick: I've added even more magic ;)

15:54 antares_: gtrak`: in other words, they will be executed in order and given a function as the argument, the rest is up to you

15:54 ohpauleez: You can expose a server-side namespace to the client-side

15:54 all remote calls of any kind are CSRF protected (if the token is present)

15:55 Sgeo: Magic/more magic?

15:55 cemerick: Yeah, I saw that. That's far too much rope for me.

15:55 gtrak`: antares_: that doesn't quite make sense though, so that would I imply I shouldn't actually call the test-fn in every function except the last?

15:55 TimMc: Sgeo: Easy enough to write for yourself!

15:55 gtrak`: I guess that's alright, if that's the case

15:56 ohpauleez: indeed, you have to be careful not to expose non-sense, but it makes writing Data Abstraction Layers (DALs) a breeze

15:56 nonsense*

15:56 cemerick: TLA WTF ;-P

15:56 antares_: gtrak`: hm, it's true that it is common to call (f) in more than one. I am not entirely sure how that is implemented then.

15:56 gtrak`: antares_: I guess that means I have to do (use-fixtures :once setup1 setup2 run teardown1 teardown2), where only run calls (f)

15:56 TimMc: (defmacro do1 [form & forms] `(let [ret# ~form] ~@forms ret#))

15:56 abalone: gtrak: i actually use it the way you asked about, i think

15:57 gtrak`: not terribly clear :-)

15:58 abalone: gtrak`: i don't use it like your last description. all my fixtures call f whatever f turns out to be given the pre wrapping done by other fixtures in my list

15:58 gtrak`: ok, that's what I figured was meant by 'compose'

15:59 it's more like ring middleware

15:59 abalone: what do ` and _ mean in nicks anyway?

15:59 cemerick: ohpauleez: I just realized that shoreleave-remote doesn't depend on fetch at all; I over-read into the verbiage in the README :-)

15:59 gtrak`: I have a couple extra nicks for extra comps, when I log on it takes the one with the least ``'s

16:00 ohpauleez: cemerick: Nope, a more secure implementation and some different design decisions

16:00 dysinger: pardon my dumb question. I'm getting rusty at clojure. How do I access super inside gen-class ?

16:00 casion: abalone: usually to deal with ghosts and multiple computers

16:01 cemerick: ohpauleez: works for me; so I should be able to wire up a shoreleave-remote-compojure without much trouble :-)

16:02 ohpauleez: cemerick: Yeah, in 0.2.3 my goal is to make shoreleave's remotes at the ring-middleware level with web-lib independent interop functions

16:02 but by all means hook it into compojure

16:02 patches welcome :)

16:03 cemerick: ohpauleez: Sounds much better. Not sure if patches are the right thing; AFAICT, there's quite the schism between what's considered good practice w/ noir vs. compojure.

16:03 ohpauleez: ahh gotcha

16:04 cemerick: That is, I'm not sure if you could satisfy both sensibilities with a single lib.

16:04 ohpauleez: gotcha

16:04 dysinger: I don't see examples anywhere for referencing super instance from a gen-class. am i dumbz?

16:05 aperiodic: dysinger: what do you want to do with the super?

16:05 abalone: gtrak: so i'm not sure what antares_ is saying. which makes me concerned since i am not as knowledgable

16:05 Raynes: Save the world, aperiodic.

16:05 dysinger: :)

16:05 abalone: ~Raynes

16:05 clojurebot: if it's not one thing it's another

16:05 abalone: (inc raynes) ; for conch

16:05 lazybot: ⇒ 17

16:06 dysinger: I need a reference to the super for reflecting access to a private member field.

16:06 gtrak: abalone: I'll just try it and see, thanks though, what you're saying seems like it could be more right according to what's in the docs

16:07 stain: dysinger: uh.. private in the superclass? You would probably need to delve into th java.lang.reflect API for that

16:08 dysinger: yes

16:08 first I an instance reference to the super class as I understand it

16:08 first I _need_

16:08 auser: I feel like I'm going to open a can of worms, but… I'm relatively new to product development in clojure and scala… the scala dev. environment with sbt is much faster than lein and clojure… is there a comparable task to the "~" syntax of sbt for leiningen?

16:09 aperiodic: why do you need to access the field in the super rather than in your subclass?

16:09 abalone: gtrak: so far the only thing i've had to experiment with was the ordering

16:09 dysinger: aperiodic: I assume so because it's private field

16:09 llasram: auser: In practice, you use a rather different work flow. Instead you typically have a running REPL session, to which you send all new code as you finish logical blocks (such as functions)

16:09 stain: dysinger: the instance is just the instance, you can't capture "just super" - super is only a way to get hold of the methods and fields above

16:10 llasram: s,running REPL session,running REPL session attached to your editor,

16:10 stain: dysinger: if it is *private* then it won't be accessible (the clue is in the name)

16:10 hiredman: dysinger: the first argument to functions backing methods in a gen-class is this, which by definition is an instance of its super class

16:10 dysinger: I'm too rusty I guess

16:10 stain: unless you use reflection and manage to flip the field to be protected

16:10 auser: llasram: I suppose I don't have that new workflow "down" yet then

16:10 dysinger: stain you can use reflection and go around private

16:10 yes

16:10 llasram: auser: What editor are you using?

16:10 auser: I like "sbt's" sbt ~ test

16:10 stain: so it sounds like you know what to do :)

16:10 auser: llasram: emacs

16:11 hiredman: dysinger: are you trying to access it from the init function?

16:11 aperiodic: dysinger: you can use the :exposes methods to generate getters/setters for your subclass for the private fields in question

16:11 dysinger: no from another method/fun

16:11 aperiodic: s/methods/option

16:11 dysinger: aperiodic: oooooh I like that better

16:11 aperiodic: dysinger: see the gen-class doc string

16:12 auser: also, I have one more question… I really like the storm project and clojure syntax, but I like the akka paradigm (I have a bunch of experience with erlang)

16:12 llasram: auser: Ok, easy-peasy. So using SLIME or nrepl.el, you type some code in a file, then hit C-c C-k. The running REPL session re-compiles the file content, and either spits out errors or succeds, in which case your REPL has the new code

16:13 auser: llasram: does that work with tests, such as autotest? I want to write a test and then write the code for it

16:14 I found okku (https://github.com/gaverhae/okku -- an akka library for clojure), looks pretty nice… anyone have experience with it?

16:14 dysinger: doc string makes it sound like only protected members can be exposed auser

16:14 antares_: auser: SLIME lets you run tests in a long-running JVM and it will recompile what's necessary

16:14 auser: neat

16:15 llasram: auser: There's lazytest, which lets you start a separate persistent process for running tests, but I haven't used it myself. I more test to use clojure-test-mode, and run `clojure-test-run-tests` in the relevant test namespace

16:15 antares_, auser: Oh, automatically? How does one wire that up?

16:15 antares_: llasram: clojure-jack-in, C-c C-,

16:15 in a test ns

16:15 llasram: Oh, yeah, that's clojure-test-run-tests :-)

16:15 antares_: right

16:16 auser: hm, I'll check that

16:16 out

16:19 okay, one last question for the #clojure community… prismatic (brilliant software) suggests writing small, contained services… in the erlang world, I would implement these as a gen-server (or an actor), I'm curious if anyone here has similar suggestions for how to approach breaking monolithic services up in clojure

16:19 antares_: auser: as for okku, I think using Akka Java API from Clojure should be pretty nice. okku does not seem to have any documentation beyond 2 examples but from what I know about Akka, it should be fine.

16:19 auser: from what I read (http://blog.darevay.com/2011/06/clojure-and-akka-a-match-made-in/) it's not particularly easy to use the two

16:19 antares_: auser: well, JVM is not BEAM and separate services often means separate apps (that may or may not share a JVM) but you can follow many of the same principles

16:20 I certainly do with "applications" that can be started, stopped, etc

16:20 Raynes: antares_: I'm actually writing a component of a system fronted by Scala that will use okku.

16:20 Going to be interesting.

16:21 auser: you use different jars for different services antares_ ?

16:21 does it make sense to use something like netty combined with little tcp-driven services so you can cross jvm boundaries?

16:21 antares_: Raynes: sorry, what "by Scala" means here?

16:22 Raynes: antares_: The frontend of the thing will be Scala. And other components.

16:22 antares_: auser: see Lamina and Aleph. Also, Langohr (a sane small RabbitMQ client)

16:22 auser: yeah, by ztellman

16:22 antares_: auser: finally, maybe stuff from http://clojurewerkz.org will give you more ideas

16:22 auser: I'll check those out

16:22 antares_: Raynes: ah, cool

16:23 auser: I suppose I'm curious about crossing the jvm boundaries

16:23 antares_: Raynes: pretty awesome, good Akka integration for Clojure is a missing piece currently

16:23 auser: it'd be nice to have a cluster of jvm machines running different services

16:23 antares_: auser: there is nothing that matches Erlang in this area but I guess remote Akka actors may be all you need

16:23 auser: yeah

16:24 https://github.com/gaverhae/okku is the closest thing I can find to clojure support for akka

16:25 abrooks: In core.logic, is it ever right (is it always wrong) to have a run query inside of a run query? (run* [x] ... (run* [y] ...))

16:25 auser: thanks antares_

16:25 abrooks: I feel like I may want to use core.logic/solutions but see no examples and can't figure out how to use it.

16:26 antares_: auser: I am kinda going in the opposite direction (from Clojure to Erlang) and another thing you should be prepared to miss is gen_fsm. That stuff is brilliant in Erlang and there are no good alternatives in Clojure right now.

16:28 amalloy: abrooks: i don't think that's ever right. run* isn't relational, of course, so you can't do much usefully with it inside another run*

16:28 Sgeo: (-<><:p (+ 1 2) [<> 2 1] [5 <> 7] [9 4 <>]) => '[(3 2 1) (5 3 7) (9 4 3)]

16:28 It makes perfect sense!

16:28 tanzoniteblack: Sgeo: ...sure, why not

16:31 dysinger: auser: yeah just as I suspected I can't use :exposes on private fields

16:31 "Caused by: java.lang.IllegalAccessError: tried to access field "

16:32 Sgeo: Woah that seems broken

16:32 Why is it a vector of ... hmm

16:32 Why is it a vector of lists?

16:32 And not a vector of vectors?

16:33 dysinger: in actual Java one would go super().getDeclaredFields()….. and off I'd go using reflection to gain access to the private field

16:34 sorry super.getDeclaredFields

16:34 chouser: gen-class creates a subclass, so of course it can't directly touch the private fields of its parent class

16:37 TimMc: dysinger: Are you subclassing Class? :-/

16:37 dysinger: chouser not directly no

16:37 chouser: dysinger: you should be able to use reflection from clojure just as well. You know the class you're inheriting from, and so can reflect on that I'd think...

16:37 dysinger: but I don't think the super classes private field will show up in declared fields

16:37 guessing - need to try it next

16:37 chouser: And your method fns get a this paramter, so you can pass that in when needed.

16:38 yeah, private fields may be trickier. They can probably be renamed by the compiler

16:38 dysinger: yeah I'm looking for this (super this) or something

16:39 chouser: this is the instance. What would (super this) return?

16:39 hiredman: dysinger: I think you are confusing class methods with instance methods

16:39 .getDeclaredFields is a method on Class objects

16:40 dysinger: yeah you are correct

16:40 hiredman: so you can just call it on the super classes Class

16:40 TimMc: dysinger: What are you actually trying to accomplish?

16:40 hiredman: and then you need an instance of the class to access the field

16:40 luckily the first argument to the functions is "this" which is an instance of its superclass

16:41 dysinger: ah

16:41 I need to bang my head more and then come back I guess :)

16:41 chouser: an instance of this class and all its superclasses.

16:42 hiredman: dysinger: you may want to checkout clj-wallhack

16:42 https://github.com/arohner/clj-wallhack

16:42 dysinger: k

16:43 hiredman: I don't know that it will make things much simpler, but it gets rid of a lot of reflection boiler plate

16:44 pandeiro: how do i go from line-seq back to a txt file?

16:44 hiredman: so if you know the name of the field you can just do (wall.hack/field SuperClass :foo this)

16:44 dysinger: ack

16:44 I was using the code from get-field in the old clojure contrib

16:45 pandeiro: (spit "file.txt" (apply #(str % "\n") my-line-seq)) ?

16:45 dysinger: and I didn't think that (class this) would give me access to the declared fields of the super class.

16:46 nbeloglazov: I'd use inerpose: (->> my-line-seq (interpose "\n") (apply str) (spit "file.txt"))

16:47 dysinger: yeah just as I suspected (-> this class .getDeclaredFields) doesn't expose the super classes declared fields.

16:48 trixy

16:48 so no concept of super outside proxy-super then

16:49 hiredman: dysinger: yeah, because the class of this is not the super class, if you know the super class (-> SuperClass .getDeclaredFields) will work

16:49 nbeloglazov: dysinger: it's not hard to iterate through all superclasses

16:49 hiredman: or (for [super (supers (class this)) field (.getDeclaredFields super)] [super field])

16:49 dysinger: maybe I can hardcode it

16:50 nbeloglazov: &(doc supers)

16:50 lazybot: ⇒ "([class]); Returns the immediate and indirect superclasses and interfaces of c, if any"

16:50 nbeloglazov: nice

16:50 dysinger: ah thanks for the help

16:54 pandeiro: line-seq doesn't use utf-8 by default?

16:54 or is that set when i create the reader?

16:55 llasram: pandeiro: The latter

17:01 solussd: sorry for the tools question, but I'm assuming some people here use counterclockwise-- how do you change the background color of the repl view? a lot of text is unreadable b/c my color theme has a dark background and the repl has a white one. :D

17:04 auser: antares_: there isn't a good fsm?

17:04 that surprises me

17:04 (sorry, lunch)

17:04 antares_: auser: well, there are FSM libraries of various scope but they are not async, for example

17:04 pandeiro: llasram: (io/reader "foo" :encoding "UTF-8") should do it?

17:04 auser: yuck

17:04 not even in akka?

17:05 http://doc.akka.io/docs/akka/snapshot/scala/fsm.html

17:05 that's one reason I'm interested in using akka

17:06 llasram: pandeiro: Should indeed

17:06 pandeiro: weird, maybe emacs/nrepl issue

17:07 llasram: pandeiro: What issue are you experiencing?

17:09 pandeiro: non-ascii chars aren't appearing (at the repl at least) when i try to read a file with line-seq and reader

17:10 antares_: auser: I am not sure about Akka

17:11 llasram: pandeiro: Yeah, sounds like a problem on the output side. You can always do something like (map int string-with-non-ascii) to see integral codepoints

17:13 pandeiro: llasram: (map int ...) shows the chars with values

17:13 llasram: chars with values...?

17:13 &(map int "I am a string")

17:13 lazybot: ⇒ (73 32 97 109 32 97 32 115 116 114 105 110 103)

17:14 pandeiro: ,(map int "Télévision")

17:14 clojurebot: (84 65533 65533 108 65533 ...)

17:14 llasram: What's up with that, clojurebot ?

17:15 &(map int "Télévision")

17:15 lazybot: ⇒ (84 233 108 233 118 105 115 105 111 110)

17:15 llasram: Much better, lazybot

17:15 thorbjornDX: what's clojurebot doing?

17:15 pandeiro: &(map int "Television")

17:15 lazybot: ⇒ (84 101 108 101 118 105 115 105 111 110)

17:15 pandeiro: ok

17:16 &(apply str (map char (map int "Télévision")))

17:16 lazybot: ⇒ "Télévision"

17:16 thorbjornDX: ,(apply str (map char (map int "Télévision")))

17:16 clojurebot: "T??l??vision"

17:17 nbeloglazov: ,(java.nio.charset.Charset/defaultCharset)

17:17 clojurebot: #<US_ASCII US-ASCII>

17:17 llasram: Ah

17:17 nbeloglazov: &(java.nio.charset.Charset/defaultCharset)

17:17 lazybot: ⇒ #<UTF_8 UTF-8>

17:17 thorbjornDX: Ahh

17:17 llasram: clojurebot recognizes that there is one true character encoding, and all others must be truncated to 7 bits

17:17 hiredman: clojurebot: why you no utf8?

17:17 clojurebot: Excuse me?

17:17 pandeiro: maybe my src file isn't UTF-8

17:19 auser: antares_: I would check out akka for it

17:19 for the FSM

17:19 it looks fairly complete

17:20 pandeiro: damn you ISO-8859-1

17:25 antares_: auser: yeah I think they also follow many OTP principles pretty closely

17:25 auser: yeah

17:25 Raynes: yuh

17:27 auser: I'm curious if "storm" is a good enough reason to use clojure instead of scala and just use scala (yuck in terms of syntax)

17:28 antares_: auser: I know people who do basically that. I would not worry so much about the syntax, though. You won't care about it in a week and I think Scala is not bad in that regard.

17:29 auser: yeah… I think you're right… too bad I <3 clojure syntax

17:29 thanks antares_

17:50 mpan: guys, could you please help me with a strange bug? I'm using map and (indirectly) the output of the process has far fewer elements than the input

17:50 the relevant snippets and repl interactions are pasted to http://pastebin.com/B2Dj9G28 but I'm not sure if there's context that would affect this

17:55 S11001001: mpan: where is get-lines defined?

17:55 nvy: mpan: what about parse-train-lines? (I can't answer your query, but this might be useful for others)

17:56 mpan: get-lines is something that gets a non-lazy seq of strings from the filesystem (domain specific)

17:56 parse-train-lines is supposed to map 1-to-1

17:56 S11001001: mpan: what kind of non-lazy seq?

17:56 mpan: a list, I believe

17:56 S11001001: mpan: clojure.lang.PersistentList?

17:56 mpan: I just found an exception happening midway

17:57 and I'm not sure why it was silent about the exception when I was running main

17:57 like I ran the def, and the def succeeded

17:57 but in reality, it died halfway to an exception (??)

17:57 S11001001: mpan: loaded-files, you mean?

17:57 mpan: the def for loaded-files

17:57 S11001001: mpan: map is lazy

17:58 mpan: so if it fails, it's silent?

17:58 S11001001: mpan: try dorun instead of count

17:58 mpan: like the function passed to map raised an exception

17:59 S11001001: because ##(first (map #(%) [#(/ 1 1) #(/ 1 2) #(/ 1 0)]))

17:59 lazybot: java.lang.ArithmeticException: Divide by zero

18:00 mpan: ah

18:00 forcing the seq via dorun makes the exception manifest

18:00 S11001001: count is funky

18:01 mpan: why doesn't count hit that same exception, though?

18:01 and for that matter, why does every other map I called on that seq not hit it?

18:01 or is that just the semantics of map?

18:01 S11001001: all maps are lazy

18:02 mpan: oh, this also explains why map and println weren't working with each other :(

18:02 gfredericks: mpan: see prn

18:02 S11001001: try prn instead

18:02 mpan: (doc count)

18:02 gfredericks: S11001001: my idea was better

18:02 clojurebot: "([coll]); Returns the number of items in the collection. (count nil) returns 0. Also works on strings, arrays, and Java Collections and Maps"

18:02 S11001001: gfredericks: definitely

18:02 mpan: why was count happy with the seq that would produce an exception, though?

18:02 that part still confuses me

18:03 S11001001: probably no one cares about count

18:03 hyPiRion: $source count

18:03 lazybot: count is http://is.gd/r6IxoX

18:03 gtrak: it isn't though

18:03 gfredericks: clojure.lang.RT/count

18:04 mpan: thank you all so much for helping me find this problem!

18:04 thank you, although, I'm still very confused why does counting a seq not hit the exception that forcing it would?

18:05 tanzoniteblack: mpan: it's likely it is hitting the exception, it just counts what existed pre-the exception occuring?

18:06 hyPiRion: Well

18:06 tanzoniteblack: ~(count (map #(%) [#(/ 1 1) #(/ 1 2) #(/ 1 0)]))

18:06 ,(count (map #(%) [#(/ 1 1) #(/ 1 2) #(/ 1 0)]))

18:06 clojurebot: #<ArithmeticException java.lang.ArithmeticException: Divide by zero>

18:06 clojure is a language to use if you want to up your game

18:06 tanzoniteblack: well...there goes that idea

18:06 hyPiRion: ,(count (map #(%) [#(/ 0 0)]))

18:06 clojurebot: #<ArithmeticException java.lang.ArithmeticException: Divide by zero>

18:06 mpan: I'm just confused why it didn't propagate the exception it encountered

18:07 hyPiRion: ,(do (map #(%) [#(/ 0 0)]) nil)

18:07 clojurebot: nil

18:08 mpan: o_O

18:08 this feels just so strange

18:08 thank you all for helping me figure it out

18:08 although, people in the computer lab probably think I'm crazy now

18:09 thorbjornDX: mpan: if people in the computer lab don't think you're crazy something is wrong

18:12 mpan: thorbjornDX: hm??

18:12 lazybot: mpan: Definitely not.

18:12 mpan: lazybot: I thought you're a bot??

18:12 lazybot: mpan: Definitely not.

18:12 mpan: :(

18:13 hyPiRion: &:D

18:13 lazybot: ⇒ :D

18:13 thorbjornDX: mpan: Syntax error near &:(

18:13 mpan: turns out, though, ~10 records are malformed

18:13 and that was the root cause of, well, everything

18:14 Sgeo: Wait, why would you map #(%).... what does that function do... oh, it calls the argument

18:14 ivaraasen: thorbjornDX: I always get looks when I'm using something else than Eclipse or Matlab in our computer labs. "are you playing games, bro?"

18:14 Sgeo: Ah, reason it threw me for a loop is because in haskell, there are no 0 argument functions, they're not needed

18:15 thorbjornDX: ivaraasen: just tell them that you're playing nethack

18:15 hyPiRion: ivaraasen: Haha, people go crazy when I pop up Emacs, even in our computer department.

18:15 vim and its popularity nowadays

18:15 ivaraasen: thorbjornDX: to be fair, I am mostly playing nethack

18:18 thorbjornDX: your nick suggests you're Scandinavian. is that correct?

18:19 thorbjornDX: ivaraasen: (/ "danish" 2)

18:21 hyPiRion: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number>

18:21 thorbjornDX: hyPiRion: I figured someone would call me on it. I want a full stacktrace though

18:22 hyPiRion: meh.

18:22 SegFaultAX|work2: What's the difference between find and get?

18:22 thorbjornDX: &:)

18:22 lazybot: java.lang.RuntimeException: Invalid token: :

18:22 SegFaultAX|work2: ,(doc find)

18:22 clojurebot: "([map key]); Returns the map entry for key, or nil if key not present."

18:22 SegFaultAX|work2: ,(doc get)

18:22 clojurebot: "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

18:22 mpan: what's people's usual strategy for when clojure code isn't working as intended?

18:23 gfredericks: get thee to a replee

18:23 thorbjornDX: pppaul is having some problems :(

18:23 hyPiRion: SegFaultAX|work2: ##((juxt get find) {:foo :bar} :foo)

18:23 lazybot: ⇒ [:bar [:foo :bar]]

18:24 thorbjornDX: ,(doc juxt)

18:24 clojurebot: "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"

18:29 Heykl: quit

18:31 mpan: what's non-lazy map called?

18:31 (for e.g. println purposes)

18:32 dnolen: mpan: 1.5 has reducers, otherwise you need to wrap the lazy seq in a doall.

18:32 mpan: all right, thank you!

18:32 tanzoniteblack: mpan: alternatively, you can use doseq

18:32 ,(doseq [x [1 2 3]] (println x))

18:32 clojurebot: 1

18:32 mpan: thank you as well!

18:33 clojurebot: 2

18:33 3

18:40 mattgordon: (clj-json.core/generate-string {"canceled" 0.0})

18:40 java.lang.NoClassDefFoundError: clojure/lang/BigInt (NO_SOURCE_FILE:0)

18:40 Is that expected? It seems like a bug

18:41 hiredman: clj-json is ancient, use cheshire

18:42 mattgordon: you need to upgrade your version of clojure too

18:43 mattgordon: [org.clojure/clojure "1.4.0"]

18:44 hmm I've used clj-json in some other projects but I'll check out cheshire if that is the modern solution

18:46 hiredman: mattgordon: you may have a problem with your dependencies, something pulling in an old version of clojure

18:47 mattgordon: interesting

18:47 hiredman: clojure.lang.BigInt definitely exists in 1.4

19:00 mattgordon: it's a tiny app at the moment so switching to cheshire will be easy. Thanks for the insight and the confirmation that it should "just work" with clj-json and 1.4

19:07 mpan: ,(#(%) 100)

19:07 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

19:07 mpan: whoops

19:07 what's the shorthand for identity fn?

19:08 metellus: ,(identity 100)

19:08 clojurebot: 100

19:12 Apage43: ,(#(do %) 100)

19:12 clojurebot: 100

19:12 Apage43: if you're golfing or something

19:14 mpan: ok thanks guys

19:16 hyPiRion: ,(#([%]0) 100)

19:16 clojurebot: 100

19:17 hyPiRion: ,((fn[a]a) 100) ; works too

19:17 clojurebot: 100

19:18 metellus: ,(#(%1) 100)

19:18 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

19:18 metellus: darn.

19:23 amalloy: aw, + and * both cast to Number, so you can't use them as identity

19:27 duck1123: ,(-> 100)

19:27 clojurebot: 100

19:27 amalloy: not a function

19:27 duck1123: aww

19:29 metellus: ,(pr 100)

19:29 clojurebot: 100

19:29 metellus: tada!

19:40 Apage43: ,(or 100)

19:40 clojurebot: 100

19:40 Apage43: there we go :)

19:41 duck1123: wow. How did no one think of 'or'?

19:47 amalloy: not a function

19:49 arrdem: could you not create a lazy recursive definition of or?

19:49 (but yes dang the clojure.core macro or)

19:50 amalloy: arrdem: you couldn't write a function that acts just like the existing macro

19:54 arrdem: why not? It seems equivalent to (fn [ & x ] (loop [f (first x) t (rest x)] (cond f f (nil? t) nil :else (recur (first t) (rest t)))))

19:54 ,((fn [ & x ] (loop [f (first x) t (rest x)] (cond f f (nil? t) nil :else (recur (first t) (rest t))))) 0 0 0 1)

19:54 clojurebot: 0

19:54 dnolen: arrdem: won't work. think about evaluation.

19:55 * arrdem hurrys off to a meeting vowing to fix the code above

19:55 dnolen: arrdem: it could theoretically be done in Haskell or Smalltalk, but of course it isn't because making your primitive branching constructs work like that destroys performance.

19:58 thorbjornDX: ,(doc cond)

19:58 clojurebot: "([& clauses]); Takes a set of test/expr pairs. It evaluates each test one at a time. If a test returns logical true, cond evaluates and returns the value of the corresponding expr and doesn't evaluate any of the other tests or exprs. (cond) returns nil."

19:59 thorbjornDX: arrdem: what's that :else thing doing?

19:59 Sgeo: ,(if :else ":else is logically true" ":else is logically false")

19:59 clojurebot: ":else is logically true"

20:00 tanzoniteblack: thorbjornDX: :else is a keyword, which always resolves to "true", so it's a condition that will always work

20:00 thorbjornDX: ah, thanks :)

20:00 tanzoniteblack: thorbjornDX: you could just as easily use :whyTheHellNot and it would work...but it's not very idiomatic

20:00 thorbjornDX: oh, so all keywords resolve to true?

20:00 Sgeo: Only nil and false are untruthy

20:00 (if 0 "0 is truthy" "0 is falsey")

20:01 ,(if 0 "0 is truthy" "0 is falsey")

20:01 clojurebot: "0 is truthy"

20:01 dnolen: thorbjornDX: Sgeo's point is more important.

20:01 thorbjornDX: I'd ask about 0, but you already answered that. Hmm.

20:02 I guess that makes little logical sense

20:02 Sgeo: It's not just Clojure that does it

20:02 amalloy: dnolen: isn't it? i see that haskell's or has type [Bool]->Bool. i can't find the source, which suggests it's native/special somehow, but it does take regular boolean args

20:02 Sgeo: Although, statically typed languages tend to not have that question at all

20:02 Only booleans can be truthy or falsey

20:02 dnolen: thorbjornDX: 0 as false-y is truly awful - as McCarthy says encourages pornographic programming

20:03 thorbjornDX: dnolen: &foo += 1;

20:03 man, I haven't written C in a while

20:03 dnolen: amalloy: it's not. the type is fiction - I believe specially handled by the compiler just like Smalltalk, where the messaging syntax is pure fiction.

20:03 tanzoniteblack: dnolen: pornographic programming?

20:03 if I weren't at work, I would go look that up...

20:04 dnolen: tanzoniteblack: look up McCarthy's notes on the history of lisp

20:04 Sgeo: How is the type fiction? It might operate "magically", but it still takes a list of Bools and gives a Bool

20:04 if/then/else is syntax, but a lot of people dislike that

20:05 And you can write a function instead (similarly to Smalltalk)

20:05 dnolen: Sgeo: the semantics are preserved - but it's a fiction because you can't make a if in either language that actually delivers the performance that those constructs magically have.

20:06 Sgeo: amalloy, or can be defined in terms of other functions: <Sgeo> @src or

20:06 <lambdabot> or = foldr (||) False

20:06 amalloy: obviously

20:06 Sgeo: I think I still have some trouble wrapping my mind around folds :/

20:07 mattmoss: (or (and 0 "truthy") "falsey")

20:07 ,(or (and 0 "truthy") "falsey")

20:07 clojurebot: "truthy"

20:07 mattmoss: ,(or (and nil "truthy") "falsey")

20:07 clojurebot: "falsey"

20:08 dnolen: the previous point is also why macros are still the bees knees from an engineering perspective - sometimes its useful to get the performance of the fundamental languages constructs w/ mucking around with a UI as terrible as an AST.

20:08 mattmoss: ,(str (or nil :horsey) :sauce)

20:08 clojurebot: ":horsey:sauce"

20:09 Sgeo: ,(letfn [(truthy [val] (if val :truthy :falsey))] (map truthy [false nil 0 "" '() () (list)]))

20:09 clojurebot: (:falsey :falsey :truthy :truthy :truthy ...)

20:09 Sgeo: Is letfn often used where where is used in Haskell?

20:09 amalloy: not really

20:10 Sgeo: Hm :/

20:10 thorbjornDX: Sgeo: thanks for that clarification

20:10 Sgeo: thorbjornDX, you're welcome

20:11 thorbjornDX: &(letfn [(truthy [val] (if val :truthy :falsey))] (map truthy [false nil 0 "" '() () (list)]))

20:11 lazybot: ⇒ (:falsey :falsey :truthy :truthy :truthy :truthy :truthy)

20:11 antares_: Langohr 1.0.0-beta4 is out: https://github.com/michaelklishin/langohr/blob/master/ChangeLog.md

20:12 Sgeo: ,(map class () '())

20:12 clojurebot: ()

20:12 Sgeo: ?

20:12 ,(map class () '() (list))

20:12 clojurebot: ()

20:12 Sgeo: Oh, hmm

20:12 ,(map class [() '() (list)])

20:12 clojurebot: (clojure.lang.PersistentList$EmptyList clojure.lang.PersistentList$EmptyList clojure.lang.PersistentList$EmptyList)

20:15 jkdufair: i have a web app with a collection of domain functions that will depend on the ring session. does anyone recommend a strategy to develop these to keep the coupling loose between my app domain functions and ring?

20:18 Sgeo: What's the rationale for condp's predicate's first argument being the case and second argument being provided just once?

20:18 (As opposed to the other way around)

20:18 I know that it's one or the other, but any reason for that choice in particular?

20:20 ohpauleez: Sgeo: Think about this:

20:21 (condp = (class x) String :string Integer :integer)

20:21 that reads pretty easy

20:21 if they were swapped, it looks like you messed up the s-expr

20:21 Sgeo: Uh, = is symmetric, isn't it?

20:22 casion: ohpauleez: I asked the same question as Sgeo last week, and your response made a lot of sense, thanks

20:22 ohpauleez: casion: No problem!

20:22 Sgeo: How does that example clarify anything?

20:23 Hmm, maybe I misexplained my question

20:23 ohpauleez: Sgeo: Let's say we write condpp, the version you're proposing. How would the line above look in condpp?

20:23 Sgeo: (condp = (class x) String :string Integer :integer)

20:23 ohpauleez: maybe a concrete example will help clear up the question and answer

20:24 Sgeo: ,(doc some)

20:24 clojurebot: "([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"

20:25 Sgeo: (condp #(some %2 %1) [1 2 3 4] #{0 6 7} :>> inc #{4 5 9} :>> dec)

20:25 (Taking from the Clojuredoc example, how that would need to be rewritten, I think

20:26 That is, the rationale for "For each clause, (pred test-expr expr) is evaluated."

20:26 Over (pred expr test-expr)

20:29 ohpauleez: Sgeo: If you swapped the order, the layout of condp makes less sense, when you think about what's really happening with the code

20:30 Sgeo: Hmm, how so?

20:30 aperiodic: i think it's mainly for comparisons

20:30 ,(condp > 0 -1 :negative 1 :positive)

20:30 clojurebot: :positive

20:30 ohpauleez: the condp form is laid out (pred test-expr expr)

20:30 and you read it that way

20:31 if you're looking to match seqs, I'd use a straight cond or case

20:32 casion: I think the use of 'some' on clojuredoc makes the intended use confusing

20:32 ohpauleez: agreed

20:32 Sgeo: I think I've written Haskell code where I wished I had condp

20:33 But I don't remember it in any detail

20:33 casion: also, that damn :>> keyword...

20:33 ohpauleez: agreed, again

20:33 to me, it's an abuse of a language construct as syntax

20:34 so I tend to avoid that use of condp

20:34 but nonetheless, super powerful

20:39 Frozenlo`: Eh.. I've forgotten how to require a cljs subclass. I'm pretty sure (:require [goog.ui.DatePicker :as dp]) is wrong.

20:41 ohpauleez: Frozenlock: that looks right to me

20:42 but if you're going to instantiate an object, you need to use the full path

20:42 Frozenlock: Really? Emacs adds a weird color after the goog.ui

20:42 ohpauleez: (:require [goog.pubsub.PubSub :as pubsub])

20:42 ….

20:42 (extend-type goog.pubsub.PubSub ...)

20:43 Frozenlock: Then I'll continue as I were, thank you :)

20:43 ohpauleez: also note that Closure lib is split into two different organization techniques

20:44 older stuff, the path name endpoint is not the object name. In the newer stuff (like pubsub) it is

20:44 Frozenlock: totally welcome

20:45 Sgeo: Lamina pipelines remind me of monads

20:45 Everything reminds me of monads

20:45 Hmm, I might be wrong

20:45 n00b6502: whats a lamina pipeline

20:45 Sgeo: https://github.com/ztellman/lamina/wiki/Pipelines-New

20:47 gf3: sjl: yt?

20:48 Sgeo: Oh right, I raged in infinite fury when I saw Lamina's map*

20:49 amalloy: $mail seancorfield i don't know if you get notifications on data.priority-map jira issues, since engelberg seems to be the nominal project lead, but it looks like you're the one doing any actual work. so, please take a look at http://dev.clojure.org/jira/browse/DPRIMAP-1 when you have a moment

20:49 lazybot: Message saved.

20:50 Sgeo: Oh hey cool I can use $mail for stuff

21:21 unlink: I wish there was a version of (partial ...) that partially applied the arguments after the first

21:22 like (partial2 assoc :key "val")

21:22 technomancy: rpartial would be tops

21:23 TimMc: technomancy: Do you often find yourself wanting rpartial where you omit more than 1 leading argument?

21:24 unlink: I basically only want to omit the 2nd arg. Is rpartial in some library?

21:25 gfredericks: might be in useful

21:25 unlink: Is that intended to mean "reverse partial"? i.e. (rpartial assoc "val" :key)?

21:25 gfredericks: rest partial maybe

21:25 TimMc: Maybe rpartial could be done as a conjugation of partial and something that applies the reverse of its restargs to its first argument.

21:25 tmciver: unlink: how about (defn delegate [f &args] #(apply f % args))? (Saw this in cgrand's moustache)

21:26 unlink: Yeah, I mean I could write it easily enough, but I don't want to be in the business of creating general utility functions.

21:26 TimMc: unlink: :-(

21:26 Someone's gotta write 'em!

21:26 gfredericks: over and over again

21:26 in each project

21:26 unlink: Well writing them is easy, justifying them as idiomatic basic Clojure is hard.

21:31 The issue is that -> wants you to curry the 2nd parameter, but partial wants you to curry the last parameter. Most clojure functions agree with ->, but there is no analog to partial for the first idiom.

21:32 * gfredericks would use it

21:33 antares_: anybody else seeing exceptions with code that does not use :only/:refer after https://github.com/clojure/clojure/commit/ec802664760d160c325323e999778ffd7b13e22c ?

21:35 Apage43: antares_: what'

21:35 s the code?

21:35 amalloy: &(keys nil)

21:35 lazybot: ⇒ nil

21:35 antares_: Apage43: I am still tracking it down but apparently some nses that do not even have :use in them now fail to compile

21:35 tracking it down by commenting things out :/

21:36 Apage43: ah

21:36 amalloy: antares_: at a glance, i think that commit would cause an exception if you (:use some-ns) where some-ns does not define any public functions

21:36 antares_: amalloy: yeah

21:36 I have a couple of such ns-es

21:36 they only extend protocol

21:36 protocols

21:36 amalloy: *nod* time for a jira ticket, sounds like

21:37 antares_: https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/json.clj

21:39 amalloy: http://dev.clojure.org/jira/browse/CLJ-1062

21:40 amalloy: antares_: it doesn't break compilation of those namespaces, it breaks requiring of such namespaces from a separate ns clause

21:40 antares_: amalloy: hm, yeah

21:40 amalloy: anyway, i'd suggest including at least a failing test, and preferably a patch, which would be easy

21:41 antares_: amalloy: I haven't mailed my CLA

21:41 wmealing_: amalloy: had some issues with lazybot last night, doesn't work well at all without mongo setup

21:41 antares_: I will include a test but monger's code is a good test

21:41 wmealing_: it'll join channels, but the go mute

21:41 amalloy: wmealing_: indeed, he assumes mongo

21:41 or at least, a number of his plugins do

21:41 * wmealing_ nods

21:49 antares_: amalloy: https://github.com/michaelklishin/clj1062

21:50 amalloy: antares_: it probably also works if you (:require clj1062.core), right? :use isn't good since someone might be inclined to say "well don't do a bare-use, silly"

21:51 antares_: amalloy: I'd need to try

21:52 amalloy: but then there are nses like https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/operators.clj

21:53 it makes sense to :use monger.operators

21:55 amalloy: so? that namespace isn't empty, so it works fine

21:55 antares_: amalloy: as far as I can see, it does not

21:56 amalloy: you are right

21:56 oh well, I can't even edit my ticket to lower the severity

21:56 lovely JIRA

21:58 devn: jira is an ugly thing

21:58 Thing(tm)

21:59 CVS + Jira -> The Future

22:00 Frozenlock: Oh what fresh hell is this

22:00 My cljs repl broke :(

22:01 ohpauleez: Frozenlock, you're almost always better off not using the cljs repl

22:01 devn: Andy Fingerhut has done such a wonderful job of getting the rest of the community involved with his patch update emails, but apparently no one realizes the source of the problem JIRA

22:01 Frozenlock: I have only two lines in my .cljs: (repl/connect "http://localhost:9000/repl") (dom/log "Hello, world!"). Yet the console shows me "Uncaught TypeError: Cannot call method 'appendChild' of null"

22:01 ohpauleez: after all, you're just writing real Clojure code, so a standard repl should be fine.

22:02 Frozenlock: Where are you getting `dom` from?

22:02 Frozenlock: (:require [clojure.browser.repl :as repl]

22:02 [clojure.browser.dom :as dom]))

22:02

22:02 ohpauleez: I interact with the browser, so I don't see how I could do it in the java repl

22:02 antares_: devn: I don't know Andy but I don't think I've seen anything on the clojure mailing list

22:03 devn: where does that involvement happen? clojure-dev? that's a closed playground for cool kids, we mere mortals don't go there

22:03 ohpauleez: Are you sure you don't just want to us (js/console.log …)?

22:03 Frozenlock: Isn't it the same thing?

22:03 devn: antares_: don't believe the hype. people are welcome, I promise.

22:03 you know, like, regular people

22:04 xeqi: antares_: yep, weekly clojure-dev

22:04 I lurk

22:04 ohpauleez: Frozenlock: There are only two cases where I've found the cljs-repl a clear advantage over just letting cljsbuild auto kick off another version for me - Debugging an exception, and tweaking some dom work

22:04 devn: it doesn't change the fact that everything is mired in enterprise-levelish process

22:05 Frozenlock: ohpauleez: Perhaps one day... but I still lack the javascript/dom experience to know what I'm doing :P

22:05 technomancy: trufacts: from 2005 to 2010, Jira emailed passwords in plaintext upon signup.

22:05 Frozenlock: So I need to test everything

22:05 antares_: devn: no hype, just my own experience

22:06 ohpauleez: Frozenlock: see what dom/log is a value of. My guess is it's null. Usually if you want to log something, you should do js/console.log, not dom/log

22:06 Also, you might checkout out the Shoreleave core and Shoreleave browser stuff

22:06 it might ease some of your CLJS woes

22:06 devn: technomancy: yeesh

22:06 ohpauleez: (shameless plug)

22:06 dnolen_: ohpauleez: not following the conversation closely but (js/console.log ...) is not really valid ;)

22:06 Frozenlock: Yeah I'm looking at the source now, should find if dom/log is the same thing.

22:06 devn: technomancy: what's the most recent reason for keeping clojure stuff on jira?

22:06 dnolen_: ohpauleez: and I disagree about the REPL when I have used it I use it a lot.

22:07 devn: technomancy: i ask you because you've been fighting the good fight for quite some time if memory serves

22:07 technomancy: devn: tempted to ask why you think reason comes into it

22:07 antares_: devn: I tried joining that ML only to be told that I can't because I did not mail a piece of paper to North Carolina, across 8 time zones. My choices are: 1) Use a non-reliable Russian mail, 2) Pay $100+ for fedex or similar. To join a mailing list and contribute a patch to this wonderful language. I say no, we are not in the 17th century.

22:07 ohpauleez: dnolen_: In what context do you find the REPL the most useful?

22:07 Frozenlock: (defn log [& args]

22:07 (.log js/console (apply pr-str args)))

22:07 technomancy: devn: that'd be antares_ fighting the good fight

22:07 me, I bend my principles sometimes

22:08 antares_: devn: and in 1) I will have to wait for literally weeks. Nope, real people don't make contributors go through that shit. See how travis-ci.org is managed.

22:08 dnolen_: ohpauleez: I always use the REPL when writing code - though I know some people have differently dev styles.

22:08 ohpauleez: I really only use it for debugging and dom work. Everything else I want to evaluate, I just do in a standard Clojure REPL. Very rarely do I care about building up an environment in the REPL

22:08 dnolen_: I use the repl constantly

22:08 just not the cljs repl

22:08 clojurebot: reply is the new high-powered repl that powers lein2's repl task https://github.com/trptcolin/reply

22:08 dnolen_: ohpauleez: I see what you mean, you just code against the CLJ repl since the lang is more or less the same.

22:08 ohpauleez: environment in the browser-repl**

22:09 devn: technomancy: surely there must be *some* reason. honestly, there isn't?

22:09 technomancy: devn: "because I said so"?

22:09 ohpauleez: dnolen_: yeah, unless I'm doing something browser specific, or there's a bug in my CLJS app and I want to poke around

22:09 devn: antares_: sorry to hear about your troubles. that's most uncool IMO.

22:09 dnolen_: ohpauleez: that's actually nice to hear! that the language is not significantly different enough for you to bother!

22:10 ohpauleez: just protocols and maps :)

22:10 xeqi: $seen kingtim

22:10 lazybot: kingtim was last seen quitting 1 day and 2 hours ago.

22:11 technomancy: to be fair, "because I said so" is often reasonable

22:11 antares_: amalloy: thanks for finding the root cause so quickly, I now have a passing build again

22:11 TimMc: xeqi: Try $mail

22:12 antares_: technomancy: I agree but having a separate mailing list that people like me cannot even read (without going to the site every day) is not reasonable

22:12 devn: technomancy: i don't disagree tbh. I don't think about it every waking moment of my life, but I've heard the same stories from tens of would-be contributors. Something is wrong here.

22:12 TimMc: antares_: I, on the other hand, *did* sign the CA -- but I still don't feel that I can contribute code.

22:12 xeqi: TimMc: sure, or just make my pull request I was gonna ask about

22:13 technomancy: antares_: absolutely agreed, though the shortcomings of google groups are different from the shortcomings of jira.

22:13 devn: I signed a CA and then I spent hours trying to figure out if any of the time I spent figuring out the process was worth it. I'm still scratching my head.

22:13 antares_: technomancy: but it has nothing to do with the mailing list

22:13 it has to do with some people believe in their process so much they ignore people who want to contribute. And I am not an über hacker but clojurewerkz.org suggests I am pretty involved in the community to not be totally ignored.

22:14 ohpauleez: devn: It has to do with how Clojure is licensed and it's possible paths in the future

22:14 antares_: devn nails it, CVS + Jira = The Future

22:14 why does clojure even use git

22:14 ohpauleez: its**

22:14 TimMc: ohpauleez: I really have to reject that argument. There are many paths to that.

22:14 dnolen_: antares_: I think there's far too much going on in the Clojure world these days to attribute it to maliciousness at this point.

22:14 devn: I wonder that sometimes as well antares_: "Type your patch out and mail us a copy!"

22:15 dnolen_: antares_: but if you're heavily invested - CA is a small barrier. They're pretty responsive once they have it.

22:15 TimMc: dnolen_: Maliciousness, no -- apathy, then? Perhaps underestimation of the effect on morale?

22:15 technomancy: antares_: it's a mess, but I've pretty much given up caring.

22:15 ohpauleez: TimMc: To aid in corporate adoption and corporations embedding Clojure into larger systems (much like Datomic), they go through a serious vetting process. To ensure nothing holds Clojure as a language back, the CA is a small price to pay

22:16 dnolen_: TimMc: not even apathy. Just being too busy. I'm not saying I like it. But unless they starting making money from supporting Clojure I don't see it changing.

22:16 technomancy: just better to do apply effort in places where you can make a difference without a huge fight

22:16 TimMc: ohpauleez: I'm not talking about the CA alone -- lack of pull requests is pretty bad.

22:16 devn: dnolen_: but people *do* make money supporting Clojure.

22:16 antares_: dnolen_: I don't know what to say. I am watching clojure.data.json being rewritten in a way that my libraries won't be able to support and I don't have anything to say because the discussion happens on the mailing list I cannot join, I cannot contribute any changes and my comments on github are ignored.

22:17 mpan: is it a bad idea to have circular requires?

22:17 dnolen_: devn: going through patches is crazy amounts of work. As far as I can tell in the past 6 months I'm the only one that does any serious amount of ticket reviewing.

22:17 antares_: dnolen_: what can that be attributed to?

22:17 TimMc: dnolen_: Right, the understaffing/bottleneck is probably the core issue.

22:17 technomancy: it took about six months for :require/:refer to get merged even though I had in-person verbal agreement that my idea and approach were a good idea.

22:17 dnolen_: on CLJS specifically.

22:17 technomancy: (it was about ten lines)

22:17 TimMc: mpan: A terrible idea, and it won't even work. :-)

22:18 mpan: :/ the alternative is making factories, essentially

22:18 ohpauleez: TimMc: It is what it is. Clojure is serious project with serious goals. In my opinion, it's worth taking precautions. I don't want to see Clojure end up in some bs lawsuit because of a single pull-request.

22:18 TimMc: technomancy: I'm still not sure if anyone has even looked at my unsigned-bit-shift-right JIRA ticket.

22:18 dnolen_: technomancy: line count doesn't really mean much. I've seen shorter ones for CLJS - sometimes it just needs stewing, testing, alternate approaches etc.

22:18 technomancy: dnolen_: we discussed it thoroughly in person at the conj

22:18 ohpauleez: We should set up some alternative/fund/help for special cases

22:19 also, dnolen_ is a ticket reviewing champ and deserves a round of beers

22:19 devn: dnolen_: I'm not conerned with speed. I'm concerned with would-be contributors who feel put out by the weird process that's currently set up.

22:19 technomancy: ohpauleez: you can't prevent frivolous lawsuits with policies

22:19 ohpauleez: like… five…. seven rounds of beers

22:19 technomancy: the EPL already has a solid patent protection clause

22:19 dnolen_: technomancy: still might need stewing even after that. changing ns isn't a small change. the repercussions of ns will expand for years better or wrose.

22:19 TimMc: ohpauleez: Explain to me how a fraudulent pull request could even *happen* -- and more plausibly than a JIRA break-in.

22:20 antares_: ohpauleez: sorry but do you realize that there are MUCH more serious projects out there (OpenJDK, Eclipse Foundation) that have contributor agreement process that takes 10 minutes to go through? you just email a PDF, done.

22:20 technomancy: dnolen_: it's not like there was any discussion once the patch was submitted though

22:20 TimMc: I could maybe spoof your email address and submit a patch that way.

22:20 ohpauleez: antares_: I'm totally ok with a signed PDF - I don't think the mail pieces is necessary

22:20 antares_: ohpauleez: I had to submit a patch to Neo4j not so long ago. It took 5 minutes to email the PDF and less than 1 hour for them to confirm it to me. Done.

22:20 hoover_damm: antares_, using echosign for example

22:20 dnolen_: technomancy: sure, but other changes waited even longer - numerics - 1.5 years?

22:20 antares_: ohpauleez: for Clojure, it is!

22:20 ohpauleez: sure, that's not what I'm arguing

22:21 technomancy: scala's CA uses oauth

22:21 ohpauleez: I'm saying the CA is necessary

22:21 I don't care how it works

22:21 antares_: ohpauleez: I don't argue with the need for CA

22:21 just with the entire process that shuts people out every months

22:21 *month

22:21 ohpauleez: just the need to mail the physical copy

22:21 sure

22:22 hoover_damm: next time someone complains about the opscode cla... i'm going to point them to the clojure CA

22:23 dnolen_: devn: I'm not convinced there's a real barrier.

22:24 ohpauleez: TimMc: Here's what can happen without a CA: Some Comcast employee tries out Clojure. They love it. He contributes a patch without his bosses approval on company time. Comcast corporate finds out and says, "No, this employee doesn't have the right to relinquish corporate copyright. Remove the patch. Once removed, no one who has seen the patch code can resubmit the patch, it must be clean-roomed with no influence. If not, Comc

22:24 would pounce on that

22:25 dnolen_: TimMc: pull requests suck

22:25 technomancy: haha

22:25 ohpauleez: though signing a CA doesn't prevent someone from submitting patches for which they don't own copyright

22:26 TimMc: ohpauleez: And that requires a physical piece of paper?

22:26 dnolen_: technomancy: well not for every project - but we've already talked about that.

22:26 TimMc: I can commit perjury electronically, why not sign a CA electronically?

22:26 technomancy: ohpauleez: it's not like signing paperwork makes it *more* illegal

22:26 antares_: dnolen_: are you serious about pull requests?

22:27 ohpauleez: technomancy: The CA prevents Comcast from being able to make that request, yes. TimMc: I don't think the CA needs to be mailed, I just think it needs to be in there

22:27 TimMc: I'm not actually arguing about CAs in the abstract.

22:27 What I'm saying is: 1) They do not need to be physical, and 2) they should not block access to reading a maiing list.

22:27 xeqi: ohpauleez: really? I would think Comcast would still be able to do it, they didn't sign the CA and own the copyright

22:29 technomancy: I'm sure Comcast would have an easy time disavowing the actions of a rogue employee.

22:30 dnolen_: antares_: for ClojureScript, core.logic, core.match yes.

22:30 antares_: dnolen_: why?

22:30 dnolen_: antares_: many tickets involve multiple reviews, multiple patches you want that history.

22:30 antares_: dnolen_: are JIRA patches good for CLJS, core.logic, core.match?

22:30 dnolen_: antares_: eys

22:30 oop yes

22:31 antares_: dnolen_: and how do you not have history with pull requests?

22:31 dnolen_: antares_: they aren't JIRA patches, they are just patches.

22:31 antares_: they can be updated, github shows you full history + comments

22:31 dnolen_: antares_: does a pull request have every pull request in it?

22:31 TheBusby: Raynes: there?

22:31 dnolen_: like I want you to modify it?

22:31 antares_: dnolen_: yes, I just push a few more commits to the same branch and you have them all in the pull request

22:31 visible, commentable

22:31 that's how we develop travis-ci.org

22:32 dnolen_: antares_: what if I want them squashed?

22:32 antares_: submit a PR, people comment, you update it a few times

22:32 technomancy: or if the approach turns out to be wrong, it's trivial to link from one pull request to another

22:32 antares_: dnolen_: then you say so and I squash and merge it (not via UI, but still)

22:32 dnolen_: technomancy: an follow a bunch of links for one conversation

22:32 antares_: technomancy: pull request are fine, but they are not "awesome"

22:32 antares_: dnolen_: but we probably have squashed only 2 PRs in 1.5 years of development

22:32 dnolen_: and unlike patches, we have CI integration for pull requests

22:33 technomancy: dnolen_: compared to "attach a patch to a jira issue", they are amazing.

22:33 antares_: each push in a PR results in a build

22:33 and trivial issues like doc corrections or other trivial things are 2 weeks of work

22:33 someone found an issue, reported it, submitted a PR, someone merges it, done

22:34 Sgeo: Hmm, if I make a patch for assoc-in to use loop/recur, does it have a reasonable chance of making it in?

22:34 antares_: neo4j uses both CA and pull requests

22:34 seems to work for them

22:34 dnolen_: technomancy: for you're definition of "awesome", OK

22:34 Sgeo: Even if it solves a problem that people might not have?

22:34 dnolen_: antares_: I get patches from people of varying levels of familiarity with git, Clojure ticket process etc.

22:34 antares_: dnolen_: sounds like clojure/core is optimizing for 1% of the cases

22:34 completely alienating the 99%

22:34 dnolen_: antares_: people come and go, people forget stuff

22:35 antares_: dnolen_: face it, most of active contributors are the same small group of people

22:35 for CLJS this is certainly true according to the log

22:35 dnolen_: antares_: probably 20-30% of patches are worth amending.

22:35 antares_: and they probably have no problem with git

22:35 dnolen_: antares_: no

22:35 technomancy: nobody understands the Clojure ticket processes

22:35 dnolen_: antares_: they come and they go.

22:35 technomancy: except _possibly_ Andy Fingerhut

22:35 dnolen_: haha

22:35 Sgeo: Who's Andy Fingerhut?

22:36 technomancy: The Man who Conquered Jira

22:36 or possibly The Man who Jira Tricked into Thinking He Had Won, only to be Torn to Pieces once His Guard Was Down

22:36 only time will tell

22:36 antares_: dnolen_: this graph suggests something different https://github.com/clojure/core.logic/graphs/impact

22:37 dnolen_: I don't know, alienating 70% for the joy of reviews of a few people sounds a little odd to me

22:37 ohpauleez: technomancy: "The Man who Conquered Jira" is cracking me up

22:37 antares_: and I am not the most friendly agreeable maintainer out there, for sure

22:37 dnolen_: antares_: core.logic & core.match are projects that few people understand the implementation of - I'm not expecting much there ... yet

22:38 ohpauleez: antares_: That was the point I was going to make ^

22:38 dnolen_: antares_: this graph is quite different, https://github.com/clojure/clojurescript/graphs/impact

22:38 antares_: dnolen_: ok, for CLJS, fair enough. I applaud the patience of CLJS contributors.

22:38 ohpauleez: case in point - Brandon Bloom is relatively new to Clojure and CLJS. He came along, found a few things he wanted, made tickets with patches - done.

22:39 antares_: I am curious how the CA stuff and all will go if someone wants to fork Clojure

22:39 rename it, keep the license, scrap JIRA and patches and just use github, like normal projects do

22:39 technomancy: antares_: it'll play out like xemacs; patches can flow only in the direction of the fork, but not back

22:40 antares_: technomancy: I mean, it will have to be renamed, what else? no use of the same logo. Anything else serious?

22:40 technomancy: granted xemacs is basically dead now, but only because they made GNU open up their development policies

22:41 dnolen_: antares_: I can't imagine it would last very long or generate much interest.

22:41 antares_: dnolen_: I don't know. You know, if the maintainer will actually document things and make contributors welcome.

22:41 ohpauleez: antares_: That reality would almost never happen. The would assume the momentum of people hating the CA and contrib process was greater than the momentum of the adoption of the language itself

22:42 dnolen_: antares_: for your version of "document things" and "make contributors welcome"

22:42 antares_: ohpauleez: the language will very much stay the same

22:42 dnolen_: for most of Clojure developers' version

22:42 ohpauleez: Assuming you have a CA in, there is absolutely no trouble getting changes in or suggesting something new

22:42 antares_: dnolen_: cause you know, only clojure.core argues that the process is pleasant

22:42 technomancy: ohpauleez: seriously?

22:42 ohpauleez: technomancy: yes, for real

22:43 technomancy: it sounds like you have been very lucky

22:43 amalloy: ohpauleez: are you talking about clojure, or some other language?

22:43 technomancy: or perhaps you work for Relevance?

22:43 antares_: dnolen_: seriously, this conversation make me believe that clojure/core really sees no problem with how alienating the process is for anyone who has contributed to Scala, JRuby, Groovy, JVM ecosystem tools

22:43 xeqi: I thought the weekly emails started because there were patches that were languishing

22:43 ohpauleez: the process is this: Propose the idea on the dev list, see if there's interest, make page on Jira, make a reference implementation and ticket, wait

22:44 how is any of that hard

22:44 amalloy: ohpauleez: the "wait" step is hard, because it's non-terminating

22:44 antares_: ohpauleez: on any step of the way, your chances of being ignored are non-trivial

22:44 amalloy: the past month or so it's actually been a lot better, but i still have patches sitting around for over a year

22:45 antares_: dnolen_: because things are better understood in comparison, and many potential Clojure contributors actually have something to compare the process with

22:45 ohpauleez: amalloy: So let's solve the real problem then - getting patches screened and applied

22:45 * devn tries to put out the fire he started

22:45 dnolen_: antares_: I'm confused about which part you think can be improved. pull requests are a bit of red herring. rhickey needs approve everything anyhow.

22:45 technomancy: ohpauleez: you and I can't solve that problem

22:45 antares_: dnolen_: the entire thing

22:45 technomancy: everything needs the approval of one person

22:45 antares_: dnolen_: the "we know better" part

22:46 technomancy: there's no delegation happening

22:46 antares_: dnolen_: the "submit a patch and wait for 11 months" part

22:46 dnolen_: the "oh that effort won't go very far" when a fork discussion comes up

22:46 devn: speed is not the issue in my opinion

22:46 dnolen_: antares_: so you would prefer that patches that aren't going to move forward get rejected outright immediately?

22:46 antares_: dnolen_: the "pull requests suck" part when the majority of OSS uses them and likes them

22:46 amalloy: technomancy: andy's done a good job with improving it. you or i could have done it (not to belittle his effort; i'm just saying it's not something you have to be rhickey to improve)

22:46 dnolen_: antares_: you like generalizations :)

22:46 ohpauleez: devn: what's your major issue?

22:46 antares_: dnolen_: for sure. Not giving people hope is better than asking them to wait for 11 months.

22:47 technomancy: ohpauleez: two times I've submitted patches with close collaboration by people who wrote an existing lib that got promoted into clojure itself (clojure.test and clojure.main) with their full approval; each time it was ~6 months before discussion on getting it applied even started

22:47 Raynes: TheBusby: Huh?

22:47 ohpauleez: amalloy: I agree, Andy has done an awesome job

22:47 TheBusby: Raynes: had a lazybot question

22:47 Raynes: Oh.

22:47 Sure, shoot.

22:47 dnolen_: amalloy: agreed about Andy's work

22:47 Raynes: You've got 6 seconds.

22:47 ;)

22:47 Sgeo: I guess a small implementation change like fixing assoc-in will take forever or just get ignored

22:47 antares_: dnolen_: no, I think I am just involved in quite a few project other than clojurewerkz.org. travis-ci.org exposes me to thousands of projects, 14 ecosystems, hundreds of people I help in #travis every week.

22:48 amalloy: Sgeo: write the patch first. you'll find you can't (usefully) make assoc-in tail-recursive

22:48 TheBusby: adding a ton of plugins, but for some like twitter/yammer/etc they need to output with no specific trigger

22:48 antares_: dnolen_: they LOVE pull requests. Nobody has asked us to adopt JIRA, CA and patches.

22:48 TheBusby: Raynes: so when a tracker twitter account posts, lazybot just dumps the post into the channel without prompting

22:48 antares_: dnolen_: nobody suggested using the Ivory Tower model. And in the Clojure world? Quite a few prominent people told me they don't really like the process.

22:48 ohpauleez: technomancy: So your proposal is that we add more gate-keepers? Or something else?

22:48 antares_: they just don't want to talk about it here because they feel like giving up

22:49 Raynes: TheBusby: Look at the Github plugin. We do that there.

22:49 technomancy: ohpauleez: I think it's crazy that you could have a library accepted into clojure and then lose the ability to make bug fixes to it.

22:49 TheBusby: Raynes: perfect, that's just what I needed to hear! Thank you again for the software and help

22:49 Raynes: TheBusby: Consider contributing the yammer plugin. I'd be interested in seeing it.

22:49 antares_: dnolen_: maybe that speaks loud enough to consider. The OSS community widely uses pull requests and a significantly more open, respectful process

22:49 ohpauleez: technomancy: I totally agree - but what are you proposing we do to adjust the current flow?

22:50 I wonder if david nolen has turned off his speakers/headphones or shut off ping yet

22:50 antares_: ohpauleez: drop the stupid piece of paper requirement, accept PDF CAs. Reject patches that The Elders don't like without asking people to wait. Discuss things on a list that everybody can join.

22:51 technomancy: ohpauleez: I'm not proposing anything; I've become convinced that the people with the authority to improve it aren't interested in doing so, and it's not worth my effort to push it right now when I could be working on things that actually make a difference.

22:51 TheBusby: Raynes: forked and pushed the youtube plugin to github last night, need to clean up the other plugins though http://bit.ly/NTqJFR

22:51 ohpauleez: antares_: Are you going to the conj?

22:51 dnolen_: antares_: sounds like it's time for you to sign your CA and voice your opinion on clojure-dev ;)

22:51 technomancy: I just think it's weird that there are other people outside /core that don't find it frustrating and broken.

22:51 ohpauleez: I was JUST about to say that

22:51 antares_: ohpauleez: in fact, eliminate the entire clojure/core notion. Let x10 as many people cast their votes.

22:52 I am not convinced a group of Relevance employees are the best engineers on the planet

22:52 Rich Hickey's last word is reasonable

22:52 ohpauleez: antares_: core is only a business entity, they are not dev

22:52 antares_: ohpauleez: I don't. I live on the other side of the world.

22:52 ohpauleez: they are the gatekeepers

22:52 ohpauleez: they just help out by admin'ing jira and the mailing list

22:52 antares_: however they are called this week

22:53 dnolen_: they whole notion that I need to mail a CA to suggest something is stupid

22:53 dnolen_: limiting, shortsighted

22:53 I don't know any other popular OSS project that is a few years old that uses it

22:53 Raynes: I had this argument a long time ago.

22:53 devn: ohpauleez: i don't have a "major" issue. I think the current situation discourages some would-be maintainers and community-building-type people, but it really depends on what kind of patches we're talking about.

22:54 technomancy: Raynes: then you became cynical and bitter like me? =)

22:54 Raynes: I was mostly called shortsighted myself and I just gave up, antares_.

22:54 antares_: Scala does not, JRuby does not, NoSQL data stores do not, Kotlin does not

22:54 Raynes: technomancy: Yeah, actually. I think I might have. :\

22:54 ohpauleez: devn: I definitely agree with that. It's hard to adjust the system for different levels of involvement and patches

22:54 devn: ohpauleez: I think there's value in it being baroque, ugly process

22:54 but in other worths I think it's abhorrent

22:55 s/worths/ways

22:55 TimMc: What if antares_ secretly emails me a signed PDF that is CA-like, emails me patches, and I submit them to JIRA?

22:55 ohpauleez: TimMc: That's totally fair

22:55 TimMc: And would totally be rejected.

22:55 dnolen_: antares_: you have strong opinions about it.

22:55 TimMc: Or... would it? Can't be right.

22:56 dnolen_: antares_: maybe you'll actually prove me wrong and do something about it.

22:56 Raynes: What can he do about it, dnolen_?

22:56 antares_: dnolen_: why the heck should I prove somebody wrong? Your community is telling you, this process is broken

22:56 dnolen_: how many people other than you and maybe ohpauleez defend the process in here? 0

22:56 how many people agree there is a problem? certainly more than 2

22:57 dnolen_: antares_: you're on IRC - if you don't like it why don't you make a mailing list post - don't mistake my tone I'm not feeling that argumentative here.

22:57 TheBusby: Many contributors in OS use pseudonyms anyways to avoid legal entanglements which isn't legal to begin with...

22:57 antares_: dnolen_: because The Elders don't pay attention to clojure, I have no illusions about that

22:57 they play in their clojure-dev sandbox

22:57 technomancy: my friend mentalguy (who rewrote parts of the ruby threading implementation) gave up because the CA doesn't let him submit under a pseudonym

22:57 Sgeo: I tend to use pseudonyms because I grew up being told never to put my name online

22:57 ohpauleez: Has anyone asked RH what would be acceptable, legally, in place of the physical CA? OAuth + SSH public key perhaps?

22:57 Sgeo: I kind of regret that at times

22:58 dnolen_: antares_: huh ... that's not my impression. The Stuarts are there.

22:58 antares_: …and mentalguy is a hell of a hacker

22:58 dnolen_: yeah? how long has it been since they've discussed anything with the community?

22:58 Frozenlock: Sgeo: Why? What would you have gained by using your name?

22:58 pandeiro: pardon my ignorance and naivete and whatnot but could clojure itself ever be forked? just asking, i admit not even having read the epl

22:58 antares_: dnolen_: once every 2 months?

22:58 Sgeo: Frozenlock, my name would have been in the Wall Street Journal once

22:58 antares_: dnolen_: clojure.data.json is undergoing breaking changes, I did not see a single discussion of that on the clojure ML

22:59 ohpauleez: antares_: How would you propose they discuss things with the community? We are the community, we're discussing it right now

22:59 TheBusby: technomancy: he's more respectable than a number of others I know who just sign with fake info.

22:59 ohpauleez: we're the instruments of change

22:59 Raynes: I imagine you can fork Clojure. You can also destroy the world too, but that doesn't help people either.

22:59 dnolen_: antares_: it's a dev issue, so you could bite the bullet for everyone else and get on clojure-dev and outline how you think could be better.

22:59 antares_: ohpauleez: at least come out and say "hey, we are doing this, at least be aware of ti"

22:59 Sgeo: My name would also have been in some Paranoia supplement book

22:59 antares_: ohpauleez: but instead library authors will have to such it up when the next version comes out

22:59 devn: ohpauleez: adjusting the system is more than just verifiability though -- i think this tendency to say the current system is the way that it is, for one specific reason, is misguided. You're focusing on one minor dimension, don't you think?

23:00 antares_: no warnings, no explanations, just get this completely incompatible changes to a contrib library

23:00 ohpauleez: when we do something breaking or even potentially breaking on travis-ci.org, we write a blog post weeks in advance and try out best to keep things compatible

23:00 ohpauleez: devn: I certainly am, because the devil is in the details and we should decompose this. Let's come up with REAL ACTIONABLE things, that when put together make the system better

23:00 pandeiro: Raynes: ok could the alternative implementation be called 'open-clojure' for its play-on-wordiness? :)

23:01 antares_: ohpauleez: does that sound like what clojure/core is doing on the clojure ML? maybe on clojure-dev, I cannot subscribe to it

23:01 Raynes: Man, don't even talk about forking Clojure.

23:01 pandeiro: i am not serious in the least, sorry

23:01 Raynes: If this language turns into Arc, I might just go be a fireman or something.

23:01 :p

23:01 antares_: Raynes: elixir. There is still elixir :)

23:01 dnolen_: antares_: well remember that contrib is supposed to follow guidelines. if they aren't being following you should complain about that to the maintainer, or express your dissatisfication w/ the rules not being followed.

23:01 ohpauleez: antares_: Clojure ML these days is mostly library and help related. It's most certainly a community portal

23:02 Raynes: antares_: Even Jose makes me mad sometimes. :P

23:02 ohpauleez: proposals for contributions come up all the time on dev

23:02 dnolen_: antares_: contrib is generally it's own can of worms since each project has it's own maintainer.

23:02 ohpauleez: and we all collab on it

23:02 antares_: dnolen_: I complain about that once every few months, being told I am not nice, then the issue comes back

23:02 ohpauleez: If you look, there's a great thread on how to answer the "reactive" piece for CLJS

23:02 dnolen_: antares_: on the ML?

23:02 antares_: ohpauleez: exactly! and The Elders are nowhere to be found on that portal.

23:03 ohpauleez: there are blog posts for the work being done on CLJS, ClojureScript-Lua, Android, Clojure optimization, core.logic

23:03 antares_: ohpauleez: honestly, who gives a shit about ClojureScript-Lua?

23:03 compared to clojure.org documentation, the core JVM clojure changes or contrib libraries

23:03 devn: Dude, that's someone's project.

23:03 antares_: oh, clojure.org documentation

23:03 * dnolen_ raises his hand about caring about ClojureScript-Lua

23:04 ohpauleez: antares_: When someone proposes a real implementation, if it involves Clojure Core, RH contributes. Otherwise, the community takes it upon itself to police itself

23:04 I'm AMPED on Lua as a backend

23:04 antares_: devn: I am sorry but this is exactly what I am saying : clojure/core is optimized for making clojure/core happy

23:04 ohpauleez: and I agre with devn, please be respectful

23:04 no one here has said your ideas are wrong or aren't worth discussing

23:04 please don't say someone else's are total shit

23:04 antares_: the rest of CLojure users have to live with clojure.org docs, clojure/core contrib process, breaking contrib lib changes, etc

23:05 ohpauleez: antares_: someone was fed up with clojure.org docs and made clojuredocs.org

23:05 we're just going on tangents

23:05 antares_: ohpauleez: while in the Scala world someone made docs.scala-lang.org

23:05 Sgeo: clojredocs needs to be fixed.

23:05 antares_: and docs.python.org in another community

23:06 ohpauleez: so you just want it to be a sub-domain?

23:06 Clojure is young

23:06 we'll get there

23:06 antares_: and they were not pushed through patches and 11 months of waiting

23:06 devn: Sgeo: what do you think? a rewrite or patches?

23:06 ohpauleez: it wasn't until a year ago that PyPy had a python related address or email

23:06 devn: Sgeo: or better content organization? or?

23:06 antares_: the level of interest in improving clojure.org kinda speaks for itself

23:06 Sgeo: devn, searches for a thing should list exact matches first

23:06 ohpauleez: antares_: What is the level of interest?

23:06 antares_: exotic projects take all the time

23:07 bare essentials like docs are ignored

23:07 ohpauleez: agreed, this just came up on the Clojure ML today

23:07 antares_: ohpauleez: not a priority?

23:07 devn: Sgeo: are you interested in building a new clojuredocs?

23:07 Sgeo: No, just interested in fixing the current one

23:07 devn: Sgeo: sorry if that came off as antagonistic, im just genuinely curious

23:08 antares_: ohpauleez: the first thing I tell clojure newcomers is "don't use clojure.org for anything"

23:08 devn: i think clojuredocs should be a very approachable community project, but I don't think it's really set up in a way to allow that

23:08 antares_: aww, that's not totally fair

23:08 clojure.org has a lot of deep info, but for newcomers it's jump into freezing water

23:08 antares_: devn: yes it is. Because clojure.org is in the 1.2 days, with very reference/traditional Lisp-oriented docs and occasionally broken download links

23:09 devn: but then again, only for some newcomers

23:09 for other "newcomers", clojure.org is what the doctor ordered

23:09 it's a lisp manifesto

23:09 antares_: devn: again, optimizing for a handful of The Elders

23:09 ohpauleez: So major problems: 1.) Clojure.org should have a better host of documentation, especially for newcomers 2.) Clojure-dev should announce upcoming changes on Clojure ML and potentially via a blog connected to Planet Clojure. 3.) much like an ER, there should be a fast-track to getting smaller patches screened, approved, and merged. 4.) The CA process should be digital

23:09 antares_: anyway

23:09 I have to such it up and go write some more clojurewerkz.org guides

23:09 * Sgeo is a more Lisp oriented person than a Java oriented person

23:09 antares_: there is next to no interest in fixing the system

23:10 cool with me

23:10 devn: antares_: maybe, I'm not denying what you're saying doesn't exist

23:10 antares_: most of active users had given up

23:10 devn: I'm just suggesting maybe The Elders are a necessary bunch?

23:10 Sgeo: Well, ok. I'm mostly a Haskell oriented person

23:10 dnolen_: antares_: I'm not sure that's true. Alex Miller and others got rights to clojure.org in order to help.

23:11 ohpauleez: antares_: and last Conj we addressed some of these and made improvements. I suggest this Conj will make further improvements.

23:11 We're young, nothing is perfect, and anyone can change anything if you really want to and are committed to putting the effort in

23:11 antares_: dnolen_: I am not wasting my time on clojure.org only to dance by someone else's tune waiting for my patch to be merged in just 11 months

23:11 ohpauleez: antares_: Is my list sufficient?

23:12 antares_: dnolen_: while esoteric projects (sorry, important projects some people care about) get so much attention

23:12 devn: antares_: that's a bit unfair, dude.

23:12 ohpauleez: agreed

23:12 Khaoz: humm.. good to know about clojurewerkz :)

23:12 ohpauleez: and also, doc and site changes often get merged immediately

23:12 antares_: devn: as you can see, I am neither fair nor nice

23:12 devn: antares_: i find that hard to believe

23:12 antares_: devn: but I have a bunch of other projects that people love

23:13 devn: that seems fair to me

23:13 and nice

23:13 ohpauleez: antares_: If given the opportunity, would you put the same amount of effort and polish in Clojure proper that you do into the clojurewerkz stuff?

23:13 antares_: and I am convinced that Clojure development process (on all levels, from the details to priorities The Elders have set up) is almost as broken as I've seen

23:13 devn: antares_: clojure.org rights are not 11 month stints

23:14 you get the ability to change the site

23:14 antares_: devn: yeah, just 4, right?

23:14 good to know

23:14 devn: you're just making assumptions now

23:14 antares_: devn: you know how long it takes to get access to clojurewerkz.org repos?

23:14 10 minutes

23:14 just prove me you want to work on something

23:14 especially if it is doc guides

23:14 I merged 3 PRs today

23:14 ohpauleez: antares_: Can you answer my two questions?

23:14 antares_: no patches, no JIRA, no CAs

23:15 3 releases, also today

23:15 users are already using new features, seem happy

23:15 ohpauleez: Is the list sufficient and if allowed, would you work on clojure.org and clojure proper as hard as you work on ClojureWerkz?

23:15 antares_: and then CLJ-940, a patch from march, finally broke CI for Monger after being merged last week

23:15 ohpauleez: which one, sorry?

23:15 ohpauleez: same amount of effort, same amount of polish

23:16 So major problems: 1.) Clojure.org should have a better host of documentation, especially for newcomers 2.) Clojure-dev should announce upcoming changes on Clojure ML and potentially via a blog connected to Planet Clojure. 3.) much like an ER, there should be a fast-track to getting smaller patches screened, approved, and merged. 4.) The CA process should be digital

23:16 antares_: ^

23:16 would that be a start?

23:17 devn: antares_: I understand how every project outside of core and contrib libraries works. I appreciate your work, but it's hard for me to say "okay" when you wave your hands and say it will take at minimum 4 months to contribute meaningful changes to clojure.org. You haven't even asked.

23:17 ohpauleez: leaving serious contributions to core in the old process, and still using the new contrib process (which I think is very collaborative)

23:18 antares_: ohpauleez: that list outlines all the top issues Id' say

23:18 back to me working on clojure.org, no, after this discussion with dnolen_, I am not going to work on clojure.org

23:18 why would I?

23:18 ohpauleez: to make it better

23:18 devn: Or rather antares_: I don't think you've *told* the community what sorts of changes you intend to make.

23:18 antares_: I'd much rather work on guides.clojurewerkz.org

23:18 ohpauleez: to fix the things you see as broken

23:18 to help the next person to come along

23:18 antares_: à la Learn You Some Erlang kind of thing

23:18 devn: antares_: collaboration is good, friend.

23:18 antares_: it will use pull requests and stuff

23:19 and nothing will get in my way

23:19 devn: lol

23:19 ohpauleez: would you merge the clojurewerkz guides into werkz.clojure.org if given the opportunity?

23:19 devn: I'm sorry, but that's what a villain says in a Scooby Doo episode:

23:19 ohpauleez: allowing you to manage it as desired

23:19 devn: 03:15 < antares_> and nothing will get in my way

23:19 "If it wasn't for you pesky kids!"

23:19 ohpauleez: hahaha

23:19 antares_: ohpauleez: it is currently all CC 3 licensed

23:20 ohpauleez: so I could even do that if I ewanted to

23:20 assuming I attribute correctly

23:20 let's add that to the list

23:20 antares_: ohpauleez: if someone wants to reuse anything that is or will be part of clojurewerkz.org, bless them

23:20 ohpauleez: Collect all CC 3 licensed works around Clojure, unify them, and make a solid doc central of them

23:20 antares_: devn: :)

23:20 ohpauleez: perfect, 5 things, that's a solid list

23:20 devn: Again antares_, I Don't think you're wrong, but you have to meet me roughly halfway on this. There is value in contributing to something you care about even if they use CVS and SourceForge and Telnet and Gnome 3.

23:21 ohpauleez: I'll email the both lists tomorrow morning

23:21 fair enough?

23:21 antares_: devn: Clojure's process is 17th century. Why would I live in the 17th century if I can live in the 21st with Github?

23:22 dnolen_: antares_: I looked at all your posts to the clojure ML - you just post your project announcements. I've see no effort or interest there to express your opinions / concerns / criticisms about the clojure dev process. While making awesome stuff w/ an awesome language is a cornerstone - there's more to community than that.

23:22 antares_: devn: why would I spend my time explaining that things are broken rather than writing docs and developing libs?

23:23 ohpauleez: antares_: If we get positive responses, I'd totally appreciate any help you could pitch in. be it collecting and unifying documentation (maybe you have some tools to help you with that already)

23:23 devn: antares_: for the next person

23:24 wmealing_: no point whining about things,if people cared, it would have already been changed

23:24 do the work and move on

23:24 antares_: devn: my goal is to maximize my OSS contributions efficiency (which I am not doing this very moment, true). This includes developing libs that are practical (sorry, but core.unify is not practical for Joe The Web Developer) and making sure people have great time using those projects.

23:25 devn: clojure.org and clojure itself is as inefficient as it gets right now

23:25 in this sense

23:25 even though yes, everybody who uses clojure, well, uses core clojure

23:25 devn: maximize ROI and shift paradigms through agile synergy

23:25 antares_: and not everyone uses data store clients we have on clojurewerkz.org

23:25 devn: something like that, yes!

23:25 dnolen_: ...

23:26 * devn looks around

23:26 antares_: I don't know how committed you have to be to clojure to go through all this

23:26 Sgeo: core.unify, umm

23:26 Looks cool, but shouldn't it be part of core.logic?

23:26 antares_: while you have other options that are 0 friction

23:26 dnolen_: Sgeo: it predates core.logic as a contrib

23:26 ohpauleez: he beat me to it

23:27 devn: hey dnolen_, conj this year I hope?

23:27 dnolen_: devn: yes!

23:27 ohpauleez: I'm so amped for it

23:27 dnolen_: devn: you going to StrangeLoop?

23:27 devn: :X So sad to say no.

23:27 ohpauleez: antares_: Just out of curiousity, what's the biggest F/OSS project you've contributed to or managed?

23:28 both in terms of public adoption and corporate adoption (or corporate investment)

23:28 zenoli: Ugh, slime is hanging emacs with great consistency. It's acting really flaky with even moderate levels of output from swank-clojure. Known issue?

23:28 devn: dnolen_: I'm going to need you to hug the Clojure contingent for me since I can't be in attendance.

23:29 dnolen_: *Serious Look*

23:29 antares_: ohpauleez: by the total numbers of users, probably travis-ci.org (there are other very nice maintainers, too). By codebase size, I don't even know, a bunch of large-ish Java stuff. I am not saying I am worth listening to ;)

23:29 * Sgeo ponders a staticish typing system

23:29 ohpauleez: antares_: hahaha, I didn't mean it to be taken that way, I was just curious

23:29 antares_: ohpauleez: but I have developed a couple of dozens of libraries and people love our doc guides. This makes me believe using JIRA and patches and caring about esoteric libraries is not that important to make fellow devs happy.

23:29 devn: Sgeo: Oh yeah? Whatcha thinking about?

23:29 dnolen_: devn: man that stinks! it's gonna be xtra awesome this year!

23:30 devn: dnolen_: I know :( Le Sob. Le Sigh.

23:30 ohpauleez: antares_: For sure, the docs make all the difference. Again, this JUST came up on the ML today

23:30 devn: dnolen_: do you have special guests yet this year for the conj? ;)

23:31 I feel like after last year you need to bring back Turing as a hologram to give a lecture

23:31 dnolen_: devn: I'm pretty sure Dan & Will will be there again. They have some cool stuff to talk about I think.

23:31 Sgeo: Well, read can theoretically give many types. So if it tries to give data to, say, a function that is expecting a map, there should be a warning, and perhaps a check at the read level at runtime, since if the read doesn't return a map, it doesn't matter at what point stuff will start barfing, it would be better to detect it early

23:31 dnolen_: devn: well actually I KNOW they have cool stuff to talk about :)

23:31 Sgeo: *perhaps a run-time check

23:32 Even if it ends up merely being earlier at run-time

23:32 ohpauleez: antares_: I know your first go at getting involved with Clojure wasn't great. I know there are others in the community who have similar issues. I think we teased out a list of five solid things the whole community, together, could work on. I'd love for you to stay involved

23:32 devn: Excited to hear that! Huzzah!

23:32 Sgeo: Stuff that can be statically checked should, stuff that can be only detected at runtime should still be detected as soon as possibly

23:32 ohpauleez: the ClojureWerkz docs and guidebooks speak for themselves. That's what we, as a language/project/community need more of

23:32 Sgeo: *soon as possible

23:32 ohpauleez: there's no doubt about that

23:33 but it takes many hands to make the work doable

23:33 devn: it takes some trust as well

23:33 ohpauleez: agreed

23:33 bobbywilson0: not sure why I'm getting this exception

23:33 ,(map #(map Integer/parseInt (clojure.string/split % #"\s")) (#(clojure.string/split-lines %) "01 02 03\n04 05 06"))

23:33 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: parseInt in class java.lang.Integer, compiling:(NO_SOURCE_PATH:0)>

23:33 ohpauleez: and a little suffering

23:33 :)

23:33 Sgeo: Perhaps the "type" of a function could be specified by a function, that gets run at the static checker

23:34 bobbywilson0: ohpauleez: were better exceptions part of that list? ;) jk

23:34 dnolen_: Sgeo: have you looked at Typed Clojure?

23:34 Khaoz: so, (use '[clojure.string]) say that some functions like reverse and replace are being replaced by the ones in the clojure.string. Is that normal or i`m missing something ?

23:34 ohpauleez: haha bobbywilson0 They're always on that list

23:34 Sgeo: dnolen_, no, although I've heard of Typed Racket and that Typed Clojure is being based on it

23:35 ohpauleez: bobbywilson0: I'm going to dig into your issue right now, but if memory serves me right, you can't map a method

23:35 bobbywilson0: ah ok

23:35 ohpauleez: I appreciate it

23:35 ohpauleez: try wrapping parseInt in: #(Integer/parseInt %)

23:35 antares_: Khaoz: that means clojure.string/reverse shadows clojure.core/reverse for you namespace. Use :use with :only (recommended) or (:refer-clojure :exclude [reverse])

23:35 xeqi: &(map #(map (fn [x] (Integer/parseInt x)) (clojure.string/split % #"\s")) (#(clojure.string/split-lines %) "01 02 03\n04 05 06"))

23:35 lazybot: ⇒ ((1 2 3) (4 5 6))

23:35 dnolen_: Sgeo: worth looking at if static typing + Clojure interests you

23:36 bobbywilson0: xeqi: ding ding ding! thanks :)

23:36 xeqi: looks like others explained it

23:36 ohpauleez: bobbywilson0: xeqi The power of community

23:36 bobbywilson0: ohpauleez: word

23:36 ohpauleez: Sgeo: You could also find such things with dynamic checking - as part of the compilation process

23:37 Sgeo: <Phantom_Hoover> try asking them if O(ln n) is equivalent to O(log_32 n).

23:38 (PH has had a bad experience with this channel, with people giving the wrong answer. So, what's the answer?)

23:39 duck1123: isn't log32 n better?

23:39 mpan: I think I'm accidentally trying to consume an infinite seq somewhere

23:39 :(

23:39 Khaoz: antares_: thanks.

23:40 i think that is a little bit strange to have two reverse functions, but maybe i need to read a little more to get the point.

23:40 ohpauleez: duck1123: log32 n of the biggest n supported by the JVM in the data structures - is 7

23:40 :)

23:40 7 is a small number

23:41 Sgeo: ohpauleez, but is O(log_32 n) the same or different from O(ln n)?

23:41 ohpauleez: Sgeo: different

23:42 Sgeo: ...

23:42 Is O(2n) the same or different from O(n)?

23:42 dnolen_: Sgeo: textbook same - in practice could be more different.

23:42 couldn't be

23:42 mpan: wait, is it somehow bad to call shuffle on the result of range?

23:42 ohpauleez: dnolen_: Again, thanks for all the work in the community and on CLJS. And for real, I swear, I'm going to start screening and approving patches for CLJS

23:42 xeqi: mpan: if its infinite

23:42 duck1123: if I remember my math, isn't log32N = ln(N) / ln(32)

23:43 mpan: range gives finite seqs doesn't it?

23:43 ohpauleez: Sgeo: Ohh in terms of big o complexity

23:43 mpan: ,(range 1 10)

23:43 clojurebot: (1 2 3 4 5 ...)

23:43 ohpauleez: yeah, nolen's answer

23:43 xeqi: mpan: if you give it an end

23:43 mpan: I did

23:43 Sgeo: duck1123, yes

23:44 xeqi: ,(shuffle (range 1 3))

23:44 clojurebot: [2 1]

23:44 mpan: ,(take 10 (shuffle (range 1 100)))

23:44 clojurebot: (27 31 45 24 53 ...)

23:44 mpan: huh

23:44 how did I just hang my repl doing that?

23:44 cgag: what's ln of the largest n on the jvm?

23:46 TimMc: cgag: Largest Long? BigInteger?

23:46 mpan: ,(->> (range 100) shuffle (take 10) doall)

23:46 clojurebot: (70 84 98 85 76 ...)

23:47 cgag: looks like 43

23:48 TimMc: "ohpauleez: log32 n of the biggest n supported by the JVM in the data structures - is 7"

23:48 mpan: idk what I'm running, I thought it was that, but whatever it is hung the repl and eclipse

23:52 devn: ,(range 10 0 0)

23:52 clojurebot: (10 10 10 10 10 ...)

23:59 Sgeo: Are lazy sequences of I/O stuff generally discouraged?

23:59 Such as a lazy sequence of lines in a file

23:59 I know they're frowned upon in Haskell

Logging service provided by n01se.net