#clojure logs

2012-09-05

00:00casionwmealing_: yes
00:00casionI couldn't get it running when I tried 2 months ago or so
00:00casionI'll give it a go again soonish
00:00casionI'm mostly curious if I can get it running on avr
00:00wmealing_AVR, as in microcontroller ?
00:00casionyes
00:00mpansounds cool
00:01technomancymrevil: it's possible to create a lazy seq that releases things when it's consumed, it just opens a huge can of worms
00:01wmealing_casion: what is your chipset ?
00:01technomancythe whole point of lazy seqs is you don't have to think about whether and when it's consumed
00:01mpantechnomancy: you mean by artificially constructing functions yourself?
00:01technomancyso if you have a seq that must be consumed, it kind of defeats the purpose
00:02casionwmealing_: brb
00:02technomancympan: you can use lazy-seq
00:02wmealing_ok
00:02mrevilin this instance it will be always be consumed in full
00:02technomancythere are other ways too
00:02technomancyanyway, it's possible but problematic
00:02mrevilcan you give me a google seed?
00:04dansalmoIs there an inverse of the read-string fn such as: (fn? (read-string "(xz (yz))")) => "(xz (yz))"
00:04amalloy$findfn '(xz (yz)) "(xz (yz))"
00:04lazybotKey must be integer
00:04amalloywhat the hell, lazybot?
00:05amalloyoh, i bet that doesn't handle strings well. anyway, you want pr-str, dansalmo
00:05mrevili 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
00:06mreviltechnomancy: pointer to my can of worms?
00:07dansalmo:amalloy thanks, I never would have thought to look for a print fn.
00:08dnolenjparishy: have you seen http://github.com/jasonjckn/llvm-clojure-bindings
00:10technomancymrevil: you can see how read-lines was implemented in the old clojure.contrib duck-streams library
00:10technomancyprovided it's a temporary hack of course =)
00:11technomancythough considering your nick I'm not sure I can trust you!
00:11mrevil:)
00:11mrevilthanks
00:12SgeoIf I take the time to understand Ring, will I better understand the purposes of things such as Rack and WSGI?
00:13arohnerSgeo: yes
00:14Sgeo{"Content-Type" "text/plain"} that confused me for a second until I realized that that is in fact a map
00:14SgeoI'm so used to {:somekey someval}
00:14Sgeo(I haven't actually done much Clojure, just reading about Clojure)
00:20dansalmo:amalloy I added some examples to clojuredocs
00:20clojurebotexamples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
00:21SgeoHmm
00:21SgeoI once wanted to add lenses to Clojure
00:22SgeoDid I decide it's not worth it, or did I just lose interest in Clojure too soon?
00:22SgeoOr maybe someone else did it
00:22amalloyokay, i guess, but why? that exact example is already there, dansalmo
00:22casionwmealing_: I use the atmega2560, uc3 and atmega32u4
00:23casionwmealing_: and 328 for some stuff when I'm fooling with arduino
00:23wmealing_casion: if you get it working well enough to be useful, i'd be interested
00:23wmealing_in reading about it
00:24casionthat's essentially my day job, avr development and fabrication
00:25casionessentially was a very stupid word to insert there haha
00:29wmealing_casion: i have two arduinos myself
00:29wmealing_casion: one of them is hooked up to the serial port on a security system that apparently, can't be interfaced externally.
00:29wmealing_has a bluetooth connection to the home server
00:29wmealing_the other controls garage/frontdoors over POE.
00:30casionneat
00:31casionright now we're developing a rail and bridge for macro photography, along with an extension bridge-arm for time lapse panoramas
00:31dansalmo:amalloy when I looked, there was an example showing (read-string ... (pr-str ...)) but not the other way around.
00:32dansalmo:amalloy and there was no mention of them being like inverse functions of one another
00:34dansalmo:amalloy and I could have sworn there was no mention of pr-str in the "see also" section, but there is now
00:34dansalmothanks greatly for the help.
00:35SgeoActually, I guess that's not really what I want. What I want is to bring lenses to Clojure and make them useful
00:45l1xhey ho
00:45l1xdnolen: do you remember we talked about the replace Nth character in a string story?
00:45dnolenl1x: yep
00:46l1xdnolen: https://gist.github.com/3630609
00:48dnolenl1x: nice
00:49l1xi am not sure if it is correct yet, need to test is extensively
00:50duck1123Does anyone happen to have any idea why suddenly the cljs compiler would refuse to include the goog.net.Websocket package?
00:50duck1123I had it working before, but now it can't find it
00:50dnolenduck1123: does it still exist? did it get renamed
00:51dnolenduck1123: GClosure seems to change relatively quickly.
00:51duck1123by all indications, it's still there
00:52duck1123for a while, it wasn't in the included goog package, but I was building against the head
00:52dnolenduck1123: are you using CLJS head? a release?
00:52duck1123I'm using head right now
00:53duck1123well, I'm using cljsbuild, I don't know if they conflict
00:53dnolenduck1123: shouldn't if you're using :checkouts
00:53duck1123it's been working fine until tonight, which is what gets me.
00:54dnolenduck1123: if you reproduce preferably w/ other goog libs that would be helpful.
00:54duck1123I'll see what I can do
00:54dnolenduck1123: whenever things get messed up I remove out, .repl, and any generated foo.js files.
00:55akhudekhuh, for short sequences (~5 positions) conjing to a vector is noticeably faster.
00:55akhudekthan conjing to a list
00:56duck1123cleaning everything out didn't do it
00:57duck1123Here's the file, if it helps http://renfer.name/assets/js/jiksnu.js
00:57dnolenduck1123: I see that CLJS uses 1376 closure.jar which doesn't have goog.net.WebSocket
01:02akhudekis there a non-lazy map?
01:02akhudekfor performance?
01:04duck1123you can force a lazy seq with dorun (if you only want side effects) or doall (if you want the return) there's also doseq
01:05duck1123nvm
01:06Sgeoassoc-in isn't defined in a tail-recursive manner
01:06dnolenakhudek: reducers
01:06SgeoErm, ... 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
01:06SgeoBut assoc-in is recursive and doesn't use recur
01:07dnolenSgeo: let us know when you have some code where that's a problem for you.
01:07SgeoWhat's wrong with just making assoc-in more robust?
01:07SgeoDon't tell me it will cause some sort of bizarre efficiency concern?
01:08akhudekdnolen: I thought of trying those, but didn't find clojure.core.reducers in 1.4, do I need to pull 1.4+?
01:08dnolenSgeo: there are problems and there are real problems. not much more to say about it.
01:08dnolenakhudek: reducers are 1.5 I think.
01:09mpanis there an equivalent of map that takes two input seqs?
01:10mpanwoah, it's map
01:10mpanyay
01:10akhudekdnolen: ok, thanks, I'll try getting 1.5 going in a few days to experiment a bit.
01:11uvtcmpan: :)
01:11mpanI do feel silly though
01:11mpansince I was reading it earlier and missed it I suppose
01:14dnolenmpan: easy to miss and yes it's nice.
01:24mpanIs there an easy way to take a function and make it implement java.util.Comparator ?
01:24l1xhmm is there a way to kind of iterate over a set which contains vector instead of using for?
01:24mpanwhat do you want to do with the set? I'm currently using map, but I guess it depends what you want to do
01:27mpan,(map #(vector (+ 1 (first %))) #{[1] [2]})
01:27clojurebot([2] [3])
01:27mpanuh, that's one way I guess
01:28mpanthat's a silly example, and it makes new vectors, but depending on what you wanted to do with your elems, map might do it
01:45clj_newb_2342anyone here got rtmp or rtmps to work with clojure?
02:13mindbender1why is it that if I do (find-ns 'foo) in a repl I get nil, but when (use 'foo) it pulls in the files
02:16nbeloglazov&(doc find-ns)
02:16lazybot⇒ "([sym]); Returns the namespace named by the symbol or nil if it doesn't exist."
02:16xeqifind-ns sees if it has already been declared; use will load the namespace from a file if it hasn't
02:17mindbender1xeqi: what do you mean by `already been declared`
02:19mindbender1xeqi: the ns has already been created in my instance
02:19amalloy&(doc comparator) ;; mpan
02:19lazybot⇒ "([pred]); Returns an implementation of java.util.Comparator based upon pred."
02:21xeqiadded 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
02:22mpanthanks
02:30mpanI think I'm misnaming namespaces? the namespace name has a - and the filename has a corresponding _ but it errors trying to load it
02:53michaelr525hello
03:09mpanhello
03:12clj_newb_234in clojure, what is the way to read _untrusted_ data?
03:12clj_newb_234i.e. I want to read _untrusted_ data as a clojure data structure
03:15wmealing_clj_newb_234: i guess you could slurp it in, then attempt to parse it
03:15wmealing_clj_newb_234: untrusted clojure data structures ?
03:15clj_newb_234clojure data structures from a untrusted source
03:15clj_newb_234i.e. i'm writing a web app taht sends me clojure data structures
03:15clj_newb_234but I dont trust the web app
03:16clj_newb_234does this make sense, or am I an idiot?
03:16clj_newb_234(the two are not mutually exclusive)
03:16wmealing_yeah i get you
03:16wmealing_(ns testing.core
03:16wmealing_  (:require [clojure.java.io :as io])
03:16wmealing_  (:import [java.io PushbackReader]))
03:16wmealing_(def remote-data (with-open [r (io/reader "whatever.clj")]
03:16wmealing_ (read (PushbackReader. r))))
03:17wmealing_but that doesn't mean it cant crash your app
03:17xeqi(doc read-string)
03:17clojurebot"([s]); Reads one object from the string s"
03:17clj_newb_234can anything bad happen from parsing json?
03:17xeqijust make sure to (binding [*read-eval* false] (read-string ...))
03:17wmealing_xeqi: thta was my next idea
03:17wmealing_something like this
03:17wmealing_http://hastebin.com/sipuvalefe.lisp
03:18clj_newb_234so all the pwoer of read, but without read time macros?
03:18wmealing_win
03:18wmealing_actually, i dont pretend to know if my idea is the best idea, or even sane
03:18wmealing_but its how i'm doing it right now
03:19wmealing_ah clj_newb_234: i found something for you
03:19wmealing_clj_newb_234: https://github.com/Licenser/clj-sandbox
03:19wmealing_there you go, a place to execute your untrusted code
03:20clj_newb_234no no, this is enough :-)
03:20wmealing_i imagine the guys who write the clojurebot
03:20clj_newb_234I don't need to excute the code
03:20clj_newb_234only to read it
03:20wmealing_have a good sandbox
03:20wmealing_ah
03:20clj_newb_234plus
03:20clj_newb_234I think you can still crash that system
03:20clj_newb_234with infinite thread creation
03:20clj_newb_234sinsce java deprecated thread.stop
03:20wmealing_"that" being sandbox ?
03:20clj_newb_234yeah
03:20wmealing_i wonder how the bot writer here does it
03:22wmealing_clojail replaced sanbox, apparently
03:22wmealing_https://github.com/flatland/clojail
03:23wmealing_one thing i was interested in, was erlang style hot code reloading
03:24clj_newb_234is read-line completely safe?
03:24clj_newb_234i.e. it just reads the line, but doesn't try to pase it?
03:24clj_newb_234oh, I have hot code reloading working
03:24clj_newb_234I can modify my webserver as it runs :-)
03:24wmealing_orheally
03:25wmealing_so you just save the file
03:25wmealing_and it picks up the changes as it runs ?
03:25clj_newb_234well
03:25clj_newb_234I have to type ctrl-ll
03:25clj_newb_234which does :w, :make
03:25wmealing_in emacs ?
03:25clj_newb_234and :make tells clojure to reload
03:25clj_newb_234it does depdentcy checking too
03:25wmealing_ok
03:25wmealing_ah, vim
03:25wmealing_right
03:25clj_newb_234and reloads all the modules that depends on the module just modified
03:25wmealing_and the session doesn't end ?
03:26mpanis there an equivalent to stepping through execution as one would with an imperative language? (currently in eclipse+ccw if that matters)
03:26wmealing_if your compile fails, what happens ?
03:26clj_newb_234no; my clojure webserver listens on port 11111
03:26clj_newb_234it listens for "reload commands"
03:26clj_newb_234err, code is injected via (require :reload module-name)
03:26clj_newb_234so when it files to compile, nothing bad happens
03:26clj_newb_234(so far, in my experience)
03:26wmealing_mpan: havn't done it in a while: http://georgejahad.com/clojure/swank-cdt.html
03:27clj_newb_234the hardest part ... was actually having to implement typological sort myself
03:27wmealing_but i used to do something like that
03:27clj_newb_234in order to do depency checking
03:27wmealing_clj_newb_234: ok
03:27clj_newb_234lol, had enough of my hot-relaoding system?
03:27wmealing_clj_newb_234: ill have a play, probably end up doing it wrong over and over
03:28wmealing_clj_newb_234: i'm a very lame repl user
03:28wmealing_lots of manual work
03:28mpanthank you!
03:28wmealing_mpan: there is other ways too. that wasnt the only one
03:29mpanI'm currently "debugging with print statements" essentially
03:31clj_newb_234hmm, in clojure, what is the right way to read _a line_ from a _socket_ ?
03:32mpaneek! I think I reversed the order of my compare
03:34scottjmpan: have you tried setting breakpoints and stepping in eclipse?
03:34mpanscottj: idk if I'm doing it wrong, but eclipse seems to ignore my breakpoints
03:36mpanoh wow, yep, I was sorting it by worst-candidates-first
05:03clgvhmmm 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)
05:04clgvor is it to force this explicit decision to use `into` for larger sets?
05:15amalloyclgv: 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
05:15amalloysubmit a patch to jira, i'd suggest
05:16clgvamalloy: no signed CA overhere ;)
05:18clgvmaybe I have to do that when I got some spare time
05:22nbeloglazov$source clojure.lang.PersistentHashSet
05:22lazybotSource not found.
05:22nbeloglazov$source set
05:22lazybotset is http://is.gd/NJA7Kg
05:51no7hingis 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?
06:01Mandarhello
06:01Mandari have a very basic question: how do i convert this vector to a list?
06:01Mandar(list [1 2 3]) returns '([1 2 3])
06:01Mandarhow can i get '(1 2 3)
06:03ejackson,(apply list [1 2 3])
06:03clojurebot(1 2 3)
06:04Mandarthank you!
06:04ejacksonlist wants each of elements of the list as a seperate argument
06:04Mandari thought there might be a reverse to "vec"
06:05Mandar(list* [1 2 3]) seems to return '(1 2 3) too
06:06iDesperadO,(list* [1 2 3])
06:06clojurebot(1 2 3)
06:07iDesperadO,(class (list* [1 2 3]))
06:07clojurebotclojure.lang.PersistentVector$ChunkedSeq
06:08iDesperadO,(vector 1 2 3 4)
06:08clojurebot[1 2 3 4]
06:08iDesperadO,(vec 1 [1 2 3])
06:08clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$vec>
06:08iDesperadO,(vec (range -5 5))
06:08clojurebot[-5 -4 -3 -2 -1 ...]
06:09iDesperadO,(vector (range -5 5))
06:09clojurebot[(-5 -4 -3 -2 -1 ...)]
06:09Mandarso (list* [1 2 3]) is not a list
06:10Mandarso the idiomatic way is ejackson's
06:10Bronsa,(doc list*)
06:10clojurebot"([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."
06:11iDesperadO,(list? (list* [1 2 3]))
06:11clojurebotfalse
06:11Mandarthanks guys
06:11iDesperadO,(seq? (list* [1 2 3]))
06:11clojurebottrue
06:12clgvMandar: you should not try to convert a vector to a list.
06:13clgvmost functions for list will call `seq` on it anyway
06:13clgvI mean "list = sequential data structure"
06:14clgv,(-> [] class ancestors)
06:14clojurebot#{clojure.lang.Reversible clojure.lang.IPersistentStack java.lang.Object clojure.lang.Sequential clojure.lang.IMeta ...}
06:14Mandarso clojure.lang.Sequential is like an interface?
06:15clgv,(.isInterface clojure.lang.Sequential)
06:15clojurebottrue
06:15clgvyes^^
06:15Mandari didn't even know there were interfaces in a functional language :)
06:15clgvthats due to the JVM being the host of clojure ;)
06:16ejacksonMandar: yeah, Protocols are the googlable term.
06:16Mandarthank you very much guys
06:16iDesperadOI'm afraid .isInterface is a java interop...clojure support it practically
06:16clgvejackson: only if he wants to implement something "interfacey" himself ;)
06:16iDesperadOso clojure is not an pure functional programming language:)
06:18clgviDesperadO: I did only use it to check since I was not 100% sure
06:19iDesperadOclgv: I just want to say that clojure is not a pure functional programming language and clojure support this with practicality in mind
06:22clgvsometimes it would be really hand to tag functions as pure and to get an error if they use something that is not tagged pure
06:22clgv*handy
06:23iDesperadOuse meta data?
06:25TheBusbyis there a threading macro that supports nil punning?
06:25clgviDesperadO: yeah, but you would have to write a defn derivate that also checks that metadata ^^
06:25clgviDesperadO: well probably not more complicate than checking for transitive options
06:26clgvTheBusby: yes. clojure.core.incubator/-?> and -?>> - but it's an additional lib
06:27TheBusbyclgv: excellent thank you! Google fails for the threading macros :(
06:27clgvTheBusby: I hope it will get into core since thats what that lib is for - but it didnt happen in 1.3 or 1.4
06:27TheBusby:(
06:29iDesperadOclgv: 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...
06:30iDesperadO,(doc clojure.core.incubator)
06:30clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.core.incubator>
06:30iDesperadO,(dir-fn clojure.core.incubator)
06:30clojurebot#<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.core.incubator, compiling:(NO_SOURCE_PATH:0)>
06:30deadringerbeen struggling with proguard, has anybody got it working with clojure?
06:30iDesperadO,(dir-fn 'clojure.core.incubator)
06:30clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.Exception: No namespace: clojure.core.incubator found>
06:31clgviDesperadO: there is no such feature in clojure itself. I remember someone has written a lib for clojars.org but thats limited then as well
06:31rasputnikis this a good place to ask for help with 4clojure problems?
06:32clgvrasputnik: if you do not spoil the problem for others, yes
06:32rasputnikdon't worry, my solution is throwing exceptions anyway :)
06:32iDesperadOclgv: and I'm afraid the clojurebot don't know about core.incubator either
06:32tomojI assume it is acceptable to spoil the problem in a gist labelled as a spoiler?
06:33clgviDesperadO: but the official maintained projects can be found here: https://github.com/clojure/ including core.incubator
06:33iDesperadOclgv: I know I know
06:34clgv,(use 'clojure.core.incubator)
06:34clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate clojure/core/incubator__init.class or clojure/core/incubator.clj on classpath: >
06:34iDesperadOclgv: :)
06:34clgvnope, he does not use it ^^
06:34rasputnikok, here's my crappy attempt at reversing a sequence (4clojure #23 ) : https://gist.github.com/3634727
06:34rasputnikblows up with : ClassCastException clojure.lang.Cons cannot be cast to clojure.lang.IFn user/widdershins/flip--310 (NO_SOURCE_FILE:4)
06:35rasputnikit's probably very very obvious, only been doing Clojure for a week
06:35clgvrasputnik: for one, you shouldnt use `defn` afair the sandbox forbids def-ing anything
06:36clgvor did that work now on other problems?
06:36clgvI usually just use (fn [...] ...)
06:36rasputniki'll golf it down to a #() once it works in the repl, this is just a more general WTF exploration thing
06:37clgvah ok. cant you paste it in a file to get line number info on the exception?
06:37rasputnikclgv: 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
06:38rasputnikis there an easy way to get the repl to load the file rather than starting a new lein project?
06:38clgvrasputnik: oh you are trying that very complicated ^^
06:38rasputnikNVM, 'load-file'
06:38clgvindeed^^
06:40clgvrasputnik: my golf score on that problem is 7 ;)
06:40rasputnikhum, it's the (tocoll) on line 4 that's breaking apparently. confused now.
06:41clgvrasputnik: ah right. you have strange brackets there
06:42rasputnikclgv: is the letfn in the wrong place, maybe/
06:42clgvno. (tocoll) does not make any sense
06:42clgvyou should just return the `tocoll` there
06:42rasputnikah, skip the enclosing parens?
06:42rasputnikcool, i'll try that
06:43clgvyeah. it's no function call
06:43clgvrasputnik: in general you live risky by using `flip` for recursion instead of `recur`
06:43rasputnikaaah, that'll be it. removed those and now line 6 goes boom (because it has unnecessary () too, i think
06:44rasputnikclgv: yup, that's what i thought. need to tidy it up and then tweak things to get the recursive bit to a tail position
06:44clgvyeah, even in lisp there might be too many parens ;)
06:44rasputnikclgv: heresy!!
06:45wmealing_ /join #lazybot
06:45wmealing_bha
06:45rasputnikyay, no more errors. returns the original seq mind, but still - progress :)
06:45wmealing_sorry about that
06:48clgvrasputnik: but I can tell you, you are overthinking this problem.
06:49rasputnikclgv: oh i'm sure i am :) have to complete it though to see the other solutions
06:49wmealing_amalloy_: my lazybot isnt responding to anything, what did i do wrong ?
06:50rasputnikclgv: I don't know the library functions at all, see, so have to bang rocks together
06:50rasputnik(which i think is part of the point of the exercise)
06:51clgvdepending on you knowledge probably. but if so you should read about the basic data types in clojure and the common operations on them
06:52rasputnikclgv: yeah think it comes down to lucky stumbling at the moment :)
06:52rasputnikwas happy with the previous exercise, ended up with a sort of map/reduce to count sequence elements
06:52clgvrasputnik: you got a clojure book?
06:53rasputnikclgv: yup, programming clojure (the pragprog one). it's pretty good.
06:53rasputniki'm on the tail recursion chapter, which is probably why i'm fixating on it now
06:53clgvrasputnik: then read the part about the data structures after that problem ^^
06:54clgvor if you having problems stop to read it^^
06:55rasputnikah, it's all good fun. doing this while I'm off on sick leave from work, so no rush.
06:55rasputnikclgv: thanks for the advice though, appreciate it.
06:56clgvah ok. I wouldnt want to spent so much time on the simple problems - I like the harder problems on 4clojure more ;)
06:57rasputnikclgv: sometimes you have to plod through the easy stuff to get to the final boss though IYSWIM
06:59rasputnikWOOOO nailed it!
07:00ro_stwhere can i learn about leiningen trampoline's with-profile?
07:03rasputnikalso: cheated and did a (source reverse) which is probably not in the spirit.
07:04clgvrasputnik: try golf score 7 ;)
07:05rasputnikhey, baby steps here mate ):
07:05rasputniki'll have a look at yours on there
07:09rasputnikclgv: actually that can get to 6 #trolololol
07:10clgvhumm right
07:10rasputnik(don't need the "'")
07:11rasputnik(i am following a few people, not my solution. sorry :))
07:11clgvprobably remained from that clojure 1.1/1.0 book
07:13mpanhow is golf scored in this sort of syntax? # tokens? #s-exprs?
07:14rasputnikmpan: character count
07:15mpanah ok thanks
07:15clgvnon-whitespace character count ^^
08:01romain_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?
08:02romain_p_(I mean the Google Closure DRAGSTART event)
08:33michaelr525hmm
08:33michaelr525how to read request body in comojure?
08:33michaelr525I'm getting it as org.eclipse.jetty.server.HttpInput
08:39xeqimichaelr525: I would use ring.middleware.multipart-params; which you get if you use compojure.handler/site
08:40xeqithat will read it for you and place key/values into the params
08:40michaelr525oh cool
08:41michaelr525xeqi: thanks
08:42deadringernot sure if this question is appropriate for the channel, but does anyone have any experience with using proguard on uberjars?
08:43michaelr525xeqi: and for json?
08:43deadringerI'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.
08:43wmealing_anyone here run lazybot ?
08:49michaelr525ring-json-params seems good
09:00xeqimichaelr525: that could work, or you could run chesire over the values manually
09:01xeqiwmealing_: that would be Raynes or amalloy_, but I've been futzing with it lately
09:01xeqido you have a question about it?
09:03wmealing_xeqi: yeah, kind of expected it to respond.. to anything
09:03wmealing_xeqi: ie, a login.. but i never hear peep from it
09:03wmealing_how do you login ?
09:03xeqi&"hi"
09:03lazybot⇒ "hi"
09:04wmealing_the symbol is @ by default,
09:04wmealing_i dont think i have the clojure stuff enabled
09:04xeqi $login I think, only ever seen raynes do it for updates
09:05xeqiah, you're running a version of it
09:05wmealing_yes..
09:06wmealing_i can look deeper, but if ive done something obviously stupid..
09:06wmealing_'d rather spent time having it do what i need, rather than spend hours finding that i missed something obvious
09:09wmealing_xeqi: have you set it up ?
09:09xeqido you have a ~/.lazybot/config.clj ?
09:09wmealing_yes.
09:10wmealing_i have it join an irc network
09:10wmealing_and the channel
09:10xeqino, I've just been over the source code a few times
09:12xeqiblah, I'm outta helpful ideas, but would expect it to be related to the config.
09:12xeqimight have to wait for one of Raynes or amalloy_ for good advice
09:17michaelr525xeqi: i wonder how chesire compares with clojure.data.json
09:20clgvdo I have any chance to create a macro that generates a ns-form and use this instead of an ns-form?
09:21clgvmy first try fails when the generated ns-form loads another ns with the same macro
09:25romain_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 "))))
09:25romain_p_Anybody knows why?
09:25xeqimichaelr525: the impression I get from here is that it is better, but I haven't used either firsthand
09:37naeghow I can I access a specified bit of a number?
09:37naegonly way I can think of is bit-test
09:38tomojisn't that what you want?
09:41naegtomoj: seems so :3
09:48naegis it OK to nest two maps? or is there a better solution?
09:49the-kennynaeg: Absolutely ok. Just use whatever data format fits to your domain
09:49the-kennyThere's even assoc-in to update nested entries.
09:50naegthe-kenny: I'm not manipulating, just printing
10:30Kneferilishello
10:30Kneferilisit's been a while since the last time I programmed in the java environment
10:31Kneferiliswhat do I need to build an applet in clojure?
10:33Kneferilisi mean, ok, I install latest jdk, then?
10:33S11001001Kneferilis: lots of patience on behalf of your users, mainly
10:33KneferilisI assume I should have the clojure library in my project's folder?
10:33S11001001Kneferilis: you can get applets into jars right?
10:33nDuffKneferilis: If you aren't already, you should be using a clojure-aware build tool
10:34S11001001Kneferilis: as nDuff says, start with leiningen
10:34nDuffKneferilis: ...those will be responsible for downloading the version of Clojure you want for you.
10:34nDuff(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:35KneferilisnDuff: so, leiningen compiles my projects?
10:35nDuffKneferilis: Yes.
10:35uvtcKneferilis: 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:35KneferilisnDuff: sounds good, does it also install jdk and clojure library?
10:36S11001001Kneferilis: not jdk
10:36KneferilisS11001001: just the clojure library?
10:36uvtcKneferilis: What OS are you using?
10:36S11001001Kneferilis: jre (not jdk as it happens) is lein's prerequisite
10:37Kneferilisuvtc: windows 7 64 bit at home, it's for a home project
10:37KneferilisS11001001: how is lein going to compile a project without jdk?
10:37S11001001Kneferilis: because clojure is not java
10:37jcromartiespeaking of Clojure and OS… I have a Mac OS X Lion system running an Ubuntu Server inside VirtualBox
10:37jcromartieClojure is about 2X faster in the VM
10:37S11001001Kneferilis: and every other library you end up using, plus it packages things up right and sets up your editor for repl hacking
10:37jcromartie,(time (count (map str (range (Math/pow 10 6)))))
10:37clojurebot"Elapsed time: 518.675539 msecs"
10:37clojurebot1000000
10:38jcromartiethat runs in 310 msecs on the host OS, 160 on the guest
10:38KneferilisS11001001: sounds cool
10:38uvtcKneferilis: 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:39S11001001Kneferilis: 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:39KneferilisI 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:39chouserKneferilis: 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:40nDuffKneferilis: There's nothing different about compiling applets.
10:40nDuffKneferilis: ...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:42djanatynwhat's an idiomatic way to return a list with a random element removed?
10:42KneferilisI see.
10:42djanatynI also want to return the element that I removed, too
10:42djanatynsomething like (remove-random [1 2 3]) => [1 [2 3]]
10:43djanatyn(rand-nth)returns a random element, but I'm working with lists that may have duplicate elements
10:44djanatynI guess removing exactly one of the element returned is an acceptable solution
10:46abalonejcromartie: is it clojure that is faster on your ubuntu VM or is it java itself that is faster?
10:46jcromartieabalone: I have no idea
10:46jcromartieabalone: generally the VM is faster at everything
10:46jcromartieabalone: Clojure, Python, Ruby
10:47abalonejcromartie: that's pretty cool
10:47djanatynhow can I use remove but only remove *one* item?
10:47jcromartieabalone: 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:48jcromartie"much less load"
10:48S11001001djanatyn: ##(doc split-with)
10:48lazybot⇒ "([pred coll]); Returns a vector of [(take-while pred coll) (drop-while pred coll)]"
10:49djanatynthanks!
10:49abalonejcromartie: oh. i thought magic was involved.
10:50tomojdjanatyn: what are you actually doing?
10:51Kneferilisthanks for the information
10:52AntelopeSaladnewbie 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:53nDuffAntelopeSalad: 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:53AntelopeSaladi'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:53nDuffAntelopeSalad: 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:54nDuffAntelopeSalad: ...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:54AntelopeSaladnDuff: so right now you write your server code in clojure and use cljs to spit out js for the client?
10:55nDuffAntelopeSalad: ...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:55AntelopeSaladatm, 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:55AntelopeSaladso i figured i'd fool around with clojure
10:57nDuffAntelopeSalad: 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:57nDuff(and a whole lot of other underlying philosophy)
10:58AntelopeSaladthanks i'll check it out
11:00AntelopeSaladyou're off by a few states
11:00chousernDuff: I was just re-reading that. It could use some work.
11:01AntelopeSaladis it more philosophy oriented? i'm usually iffy on books when it comes to programming languages because of how things change
11:01nDuffchouser: ...heh. Another edition pending?
11:01chousernDuff: shh
11:01wmealing_xeqi: the problem was a poorly configured mongodb/hostname resolution problem
11:02nDuffAntelopeSalad: It's much more philosophy oriented than the other leading (IMHO) book, Clojure Programming (http://clojurebook.com/)
11:02abalonechouser: if we bought the ebook, would an update cost money?
11:02nDuffAntelopeSalad: ...though Clojure Programming covers a lot of philosophy too; you can't go wrong with either.
11:02chouserabalone: if there were an update, I have no idea how the pricing would work out.
11:02duck11231AntelopeSalad: "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:03AntelopeSaladduck1123: nice, so it's seamless for development -- and you deploy native js?
11:05duck11231yep. 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:06AntelopeSaladexcellent, that's exactly what i'm looking for -- context switching wise (mentally), are you experiencing any problems?
11:06duck11231you 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:07duck11231Not 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:08AntelopeSaladseems fair enough
11:10nDuff...so my experience with clojurescript doesn't include so much about avoiding C-c C-k :)
11:10nDuffthat 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:11duck11231I tried using the clojurescript repl, but I wasn't finding it very useful. Maybe I just wasn't using it right
11:12nDuff...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:12nDuffwithout that, the clojurescript repl wouldn't have been nearly as handy
11:12nDuffbut it's something Chrome does well.
11:12nDuffFirebug, not so much.
11:13duck11231I 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:14bobbywilson0I'm not sure why this doesn't work `(map str/split ["01 02 03", "04 05 06"] #"\s")`, can anyone explain?
11:15xeqifor clojurescript and C-c C-k: https://github.com/cemerick/piggieback
11:15duck11231,(map #(str/split % #"\s") ["01 02 03", "04 05 06"])
11:15clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: str, compiling:(NO_SOURCE_PATH:0)>
11:15xeqiwell, I think theres a pull request I need to send to nrepl.el first, but it should all work well together soon
11:16duck11231,(map #(clojure.string/split % #"\s") ["01 02 03", "04 05 06"])
11:16clojurebot(["01" "02" "03"] ["04" "05" "06"])
11:16bobbywilson0duck11231: thanks
11:17duck11231bobbywilson0: in your case, it was trying to take one from each collection (including the "collection" #"\s")
11:17bobbywilson0duck11231: ah, ok makes sense
11:18tomoj&(map clojure.string/split ["01 02 03" "04/05/06"] [#"\s" #"/"])
11:18lazybot⇒ (["01" "02" "03"] ["04" "05" "06"])
11:19bobbywilson0tomoj: oh interesting
11:21djcoinDoes clojurescript generate "compact" javascript with not so much boilerplate so it can be inspected/used to debug in the browser ?
11:22duck11231if 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:22djcoinI was thinking also to folks pluggin some userscript (exemple with grease monkey)
11:23djcoinexample *
11:23djcoinBut I guess I would rather set up a specific API
11:23djcoinok duck11231
11:23djcointhanks :)
11:24djcoinIt'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:25duck11231The 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:28kangI 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:28duck11231Sometimes 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:28xeqi(doc take-while)
11:28clojurebot"([pred coll]); Returns a lazy sequence of successive items from coll while (pred item) returns true. pred must be free of side-effects."
11:30kangthanks.
11:32AntelopeSaladduck1123: have you seen this? http://vimeo.com/29535884
11:33AntelopeSaladit's a short video on using the cljs repl
11:34duck11231AntelopeSalad: 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:34duck11231so I didn't go much further
11:34duck11231one of these days I'll go back and try it again
11:35nDuff(you couldn't?)
11:36duck11231nDuff: no, and when I asked about it, I was told it wasn't possible. (love for you to proove me wrong)
11:36nDuff...granted, if you used (ns ...) to changes namespaces, you needed the whole declaration, as it would otherwise wipe your requires/whatnot...
11:36nDuffbut, ehh, I did that all the time.
11:36duck11231ok, then. I'll give it another shot later on tonight
11:37nDuff...oh, require'ing your namespace, not switching to it, so you _are_ suggesting a slightly different workflow
11:37nDuffI always moved the REPL into my target namespace.
11:38duck11231for 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:39duck11231I could access all of my namespaces via interop, but by that point, why not just use chrome's console
11:43imadeit it possible to destruct a map in a let?
11:43llasramLazy 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:44duck11231,(let [{:keys [a b c]} {:a 1 :b 2 :c 3}] [a b c])
11:44clojurebot[1 2 3]
11:44nDuffimade: Yes, it is.
11:44imade(let [{true anagrams false rest} (group-by (partial anagram? w) words)]
11:44naegWhat 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:44imadethis gives error
11:45nDuffimade: See the way duck1123 just demonstrated it to you
11:45hyPiRion,((juxt keys vals) {:a 1 :b 2 :c 3})
11:46clojurebot[(:a :c :b) (1 3 2)]
11:46imadebut 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:46jcromartieI saw a presentation that said you can use "send" inside of "dosync" and it will only send the action if the transaction completes
11:46jcromartiebut I do not see this documente
11:47jcromartiedocumented anywhere
11:47nDuffjcromartie: It _is_ the case.
11:47hyPiRionimade: (let [xs (map true)] ...) ?
11:47jcromartieoh I see
11:47jcromartieI was grep'ing for "dosync" and "send" in their respective docs
11:47jcromartie"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:47nDuffAhh; there you are.
11:48imadehyPiRion, yes that would work, but I was searching for smth else
11:49nDuffimade: destructuring expects the keys to be keywords, not values
11:49nDuffimade: ...so, having true rather than :foo as your key makes it not a good fit.
11:50imadenDuff, ok, thanks
11:50imadeI'll use intermediate result then
11:51duck1123,(let [{t true f false} {true 'xs false 'ys}] [t f])
11:51clojurebot[xs ys]
11:53imadeduck1123, nice!
11:54duck1123map 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:55nDuffHeh.
11:59whitakerI'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:59antares_whitaker: I did
11:59antares_I developed Langohr for that reason
11:59Chousuke:P
11:59whitakerah!
12:00whitakerheh
12:00nDuffantares_: heh -- howdy!
12:00whitakerThanks for Langohr.
12:00whitakersame.
12:01antares_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:02duck1123whitaker: When I was using Rabbit I did exactly that (wabbit first, then langohr)
12:02whitakerI 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:02nDuff...only place where I've had issues with langohr is not throwing exceptions early enough
12:02antares_but with http://clojureelasticsearch.info being almost 1.0, Langohr will soon get its own dose of attention
12:02nDufffor 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:02whitakers/under/understand
12:02nDuffwith no obvious way to tell how/why it closed
12:02antares_nDuff: feel free to file issues if you don't like something
12:03antares_nDuff: that's strange, maybe langohr.consumer/subscribe swallows exceptions
12:03antares_the Java client will raise an exception
12:04antares_or rather, pass it to a handler
12:04antares_that's a tricky part to expose to Clojure in a good way
12:04antares_you basically need a bunch of functions tied together
12:05whitakerHas anyone here personally tried to educate mefesto/Allen Johnson on the deficiencies of wabbitmq?
12:06nDuffHmm. 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:06nDuffEh -- probably makes more sense to have this discussion happen in a ticket.
12:07technomancyantares_: I may end up adapting clojuresphere to use neocons; digging the docs there
12:08antares_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:08antares_technomancy: nice. What does it currently use?
12:09technomancyantares_: slurp+read-string =)
12:09technomancythe data set changes very slowly, but part of that is due to the fact that it's currently cumbersome to update
12:09antares_technomancy: I see. Yeah, it may be a bit tricky to efficiently query with that.
12:10technomancywell it's still quite small
12:10antares_plus, neo4j server has decent search built in which is nice
12:10technomancyso the primary deficiency of the current setup is the fact that the data map is checked into git
12:11XPheriorIf 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:11XPheriorTotally baffled by this one for like 2 weeks.
12:12technomancywith-redefs changes the var's root, so it's visible everywhere. it's not the slightest bit safe and inappropriate for production use.
12:13technomancyit's there for tests
12:13XPheriortechnomancy: 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:13XPheriorSo yes, trying to use it for tests. I passed #'app to run-jetty as well
12:13technomancycool; should be good then
12:13XPheriorYou'd think, right?
12:14XPheriorMaybe something's up with clj-webdriver.
12:15XPheriorIf 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:16djanatyntomoj: I was trying to ... uhh, shake a list
12:16djanatynto mix up the elements randomly
12:16XPheriorShuffle, djanatyn
12:16djanatynis there a (/ x y) that always returns a float?
12:16djanatynI always do (defn d [x y] (float (/ x y)))
12:16djanatynthanks, XPherior
12:18naegnew connect four checking algorithm using bitboard reprensation: https://gist.github.com/3639220
12:18naegwould be great if some of you could take a look at it and help me, especially with (insert) and (bit-check-board)
12:19naegalso, the checking algorithm always checks the whole board, but takes only ~0.025 msecs
12:26MosesI'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:27XPheriorI don't think it's supposed to work like that, Moses?
12:28scriptorMoses: I Mthink this might help https://github.com/ring-clojure/ring/wiki/Interactive-Development
12:28XPheriorMaybe I'm wrong. *Shrug*
12:29MosesThank you <scriptor>
12:30nDuff...frankly, if refreshing the browser manually reflects your code changes, you're doing pretty well. :)
12:30XPheriorHaha.. Yeah that's true nDuff
12:30scriptorhow neat would that be though, if ring could force browser refreshes on code changes?
12:30XPheriorI'd adore it.
12:31XPheriorDoes Chrome have an API sort of thing for being able to force a refresh from another process?
12:31hyPiRionSome javascript injection and you've got it.
12:31technomancyXPherior: mozrepl does that for mozilla
12:31scriptoryep, if you want to get fancy I guess it could be done via websockets
12:31technomancychrome's extension API is pretty crappy compared to moz though
12:31XPheriortechnomancy: That's sick. I gotta try it.
12:32XPheriorHey technomancy, curious. What're you doing for a living at the moment?
12:32scriptorwindow.location = window.location seems to work
12:32technomancyXPherior: I'm working for Heroku maintaining Clojure support and the general build pipeline
12:33XPheriorWow, that's a sweet job.
12:33technomancycan't complain
12:33`thomasWith Seesaw is it possible to listen to a change of a slider's value?
12:36antares_technomancy: ok, let me know how it goes with Neocons
12:40bobbywilson0,(map #(read-string (str/replace % #"^0" "")) (map #(str/split % #"\s") (#(str/split-lines %) "01 02 03\n04 05 06")))
12:40clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: str, compiling:(NO_SOURCE_PATH:0)>
12:40bobbywilson0,(map #(read-string (clojure.string/replace % #"^0" "")) (map #(clojure.string/split % #"\s") (#(clojure.string/split-lines %) "01 02 03\n04 05 06")))
12:40clojurebot(["01" "02" "03"] ["04" "05" "06"])
12:41bobbywilson0I am expecting ([1 2 3] [4 5 6]) what did I mess up?
12:42hyPiRion,(read-string "01")
12:42clojurebot1
12:42bobbywilson0hyPiRion: that's what I want :)
12:42scriptor, (map #(clojure.string/split % #"\s") (#(clojure.string/split-lines %) "01 02 03\n04 05 06"))
12:42clojurebot(["01" "02" "03"] ["04" "05" "06"])
12:43hyPiRionyeah, there's your problem.
12:43raek,(read-string "08")
12:43clojurebot#<NumberFormatException java.lang.NumberFormatException: Invalid number: 08>
12:43hyPiRion,(read-string "([\"01\" \"02\" \"03\"] [\"04\" \"05\" \"06\"])")
12:43clojurebot(["01" "02" "03"] ["04" "05" "06"])
12:44hyPiRion,(read-string "[\"01\" \"02\" \"03\"]")
12:44clojurebot["01" "02" "03"]
12:44bobbywilson0hyPiRion: I still don't understand the problem
12:44bobbywilson0raek: I am replacing the leading zeros with ""
12:44bobbywilson0,(read-string "8")
12:44clojurebot8
12:45gfredericks,(read-string "0456")
12:45clojurebot302
12:45hyPiRionbobbywilson0: You're mapping the different vectors, not the elements.
12:45nvymap twice or so
12:45bobbywilson0hyPiRion: ahhh, ok, shoot
12:46raek,(for [line (clojure.string/split-lines "01 02 03\n04 05 06"))] (for [word (re-seq #"\S" line)] (Integer/parseInt word)))
12:46clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
12:46raek,(for [line (clojure.string/split-lines "01 02 03\n04 05 06")] (for [word (re-seq #"\S" line)] (Integer/parseInt word)))
12:46clojurebot((0 1 0 2 0 ...) (0 4 0 5 0 ...))
12:47raek,(for [line (clojure.string/split-lines "01 02 03\n04 05 06")] (for [word (re-seq #"\S+" line)] (Integer/parseInt word)))
12:47clojurebot((1 2 3) (4 5 6))
12:47raekmaybe Long/parseLong is more ideomatic these days...
12:47bobbywilson0raek: interesting approach with for
12:47bobbywilson0oh ok
12:48bobbywilson0I didn't know about Long/parseLong
12:53tanzoniteblackbobbywilson0: 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:55mdeboardhm
12:55mdeboard,(-> (clojure.string/split-lines "01 02 03\n04 05 06") (fn [x] (apply (clojure.string/split x #"\s+"))))
12:55clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
12:55mdeboard:boggle:
12:55mdeboardWhy doesn't that work
12:55nDuffCan 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:56bobbywilson0tanzoniteblack: unfortunately I don't know a lick of java :[
12:56nDuffmdeboard: Think about how the threading macro rewrites the fn _definition_
12:56mdeboard,(-> (clojure.string/split-lines "01 02 03\n04 05 06") #(apply (clojure.string/split % #"\s+")))
12:56clojurebot#<CompilerException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentVector, compiling:(NO_SOURCE_PATH:0)>
12:57nDuffmdeboard: (fn (clojure.string/split-lines ...) [x] (apply ...))
12:57dnolennDuff: default and nil are not the same case, you need to handle both.
12:58nDuffdnolen: Noted. Presuming that I do so -- is Object good enough for default?
12:58dnolennDuff: yes that's what Object is for, the default.
12:58tanzoniteblackbobbywilson0: 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:59mdeboardnDuff: Wait, huh? I thought it got compiled to `(fn [x] (apply (split (split-lines "w x\ny z") #"\s")))'
12:59bobbywilson0tanzoniteblack: thanks for the tip
12:59nbeloglazov&(doc ->)
12:59gtrak`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:59lazybot⇒ "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:00mdeboardI see
13:00mdeboardOk
13:00mdeboardmind blown
13:00nbeloglazovwhy read-string was better?
13:01TimMcgtrak`: Sure, so make sure *read-eval* is disabled.
13:01gtrak`TimMc: ah, thanks for the tip, didn't know about that one
13:01TimMcInteger/parseInt just makes more sense to me -- very clear on input and output.
13:02nbeloglazovI also like Inteteger/parseInt more
13:02TimMcgtrak`: Yeah, I've filed a bug for that to be mentioned in read(-string)'s docs... :-/
13:02gtrak`I will +1 it :-)
13:03mdeboardclojurebot has just informed me that noir is great
13:03bobbywilson0technomancy nbeloglazov: because it more clearly expresses what you are trying to do?
13:03TimMchttp://dev.clojure.org/jira/browse/CLJ-904
13:03tanzoniteblackread-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:03nbeloglazovbobbywilson0: usually operation is to convert string to int, not to just read string and get some unknown object
13:04tanzoniteblackgranted...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:05nbeloglazov&(Double/parseDouble "100000000000000000000000000000000000000000000000000")
13:05lazybot⇒ 1.0E50
13:05bobbywilson0makes sense
13:08NorritHi, I have a littel problem with nrepl.el ...
13:08NorritWhen 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:08nbeloglazovNorrit: what version of emacs?
13:09nbeloglazovNorrit: https://github.com/kingtim/nrepl.el/issues/88
13:09Norrit24 .. let me check
13:09nbeloglazovHm, then it's not the case
13:10NorritGNU Emacs 24.0.94.7
13:10nbeloglazovDon't know then
13:11Norritok, thanks anyway :-)
13:25mdeboardok, here we go.
13:25mdeboard(-> (split-lines "01 02 03\n04 05 06") (#(map (fn [x] (split x #"\s+")) %)) flatten (#(map read-string %)))
13:25mdeboard,(-> (split-lines "01 02 03\n04 05 06") (#(map (fn [x] (split x #"\s+")) %)) flatten (#(map read-string %)))
13:25clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: split in this context, compiling:(NO_SOURCE_PATH:0)>
13:25mdeboardyou son of a gun
13:25mdeboard(-> (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:26mdeboard,(-> (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:26clojurebot#<CompilerException java.lang.RuntimeException: No such var: clojure.string/read-string, compiling:(NO_SOURCE_PATH:0)>
13:26mdeboardSorry for the spam.
13:26mdeboard,(-> (clojure.string/split-lines "01 02 03\n04 05 06") (#(map (fn [x] (clojure.string/split x #"\s+")) %)) flatten (#(map read-string %)))
13:26clojurebot(1 2 3 4 5 ...)
13:26mdeboardThere.
13:28djanatynis there anything special you need to do with defrecord to use the classes you made in other files?
13:29TimMc~flatten
13:29clojurebotflatten 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:29djanatynin roguelike.entity, I have the line (defrecord Entity [name stats])
13:30djanatynin roguelike.player, my namespace declartion is (ns roguelike.player (:use roguelike.entity))
13:30dnolenmdeboard: it seems a bit odd to use -> there when you're threading through seq ops.
13:30dnolen,(->> (clojure.string/split-lines "01 02 03\n04 05 06") (map (fn [x] (clojure.string/split x #"\s+"))) flatten (map read-string))
13:30clojurebot(1 2 3 4 5 ...)
13:30djanatynerrm, roguelike.entity is in a vector.
13:30mdeboarddnolen: Yeah, I was just being stubborn at that point
13:30TimMc,(for [line (clojure.string/split-lines "01 02 03\n04 05 06"), num-str (clojure.string/split line #"\s+")] (read-string num-str))
13:30clojurebot(1 2 3 4 5 ...)
13:30djanatynin roguelik.player, I tried using (def me (Entity. "djanatyn" {:hp 10 :mp 10}))
13:30mdeboardI agree threading macros aren't the right choice, I was just determined.
13:31TimMcmdeboard: ^ use for :-)
13:31mdeboardld if I was going ot use 'for' I'd write Python
13:31mdeboardಠ_ಠ
13:31mdeboard(kidding)
13:31dnolendjanatyn: :import, but really you should use the create ctors or your own.
13:31djanatynafter trying to compile roguelike.player, it says "unable to resolve classname: Entity" D:
13:32dnolenthe created ctors or you own I mean.
13:32djanatynctors? o_O
13:32pandeirois there a shortcut to recompile all emacs buffers in nrepl?
13:32dnolen(ns foo (:import [your.ns Entity]))
13:32dnolendjanatyn: ctor -> constructor fns
13:33aaelonyI'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:34aaelony,(for [x (seq [:a :b :c]) y (seq [:a :b :c]) :when (not= x y)] (into #{} [x y]))
13:34clojurebot(#{:a :b} #{:a :c} #{:a :b} #{:c :b} #{:a :c} ...)
13:34dnolendjanatyn: if you use the namespace where the record is defined a positional ctor function called ->Entity will be available
13:34djanatynoh! I saw that, and I was really confused
13:34pandeiro,(set (for [x (seq [:a :b :c]) y (seq [:a :b :c]) :when (not= x y)] (into #{} [x y])))
13:34clojurebot#{#{:a :c} #{:a :b} #{:c :b}}
13:35djanatynI didn't define that function anywhere :)
13:35aaelonypandeiro: that gives two #{:a :b}
13:35pandeiroaaelony: in the same set?
13:35aaelonyyes
13:36djanatyn:) now everything is in seperate namespaces and works together
13:36aaelonythat gives: (#{:a :b} #{:a :c} #{:a :b} #{:c :b} #{:a :c} #{:c :b})
13:36djanatynthanks, dnolen
13:36dnolendjanatyn: np
13:36pandeiroaaelony: pretty sure by definition it doesn't
13:37raekaaelony: not when you wrap the whole thing in (set ...)
13:37aaelonypandeiro: try it
13:37pandeiroi just did, above
13:37raek(as pandeiro did)
13:37aaelonypandeiro: I see, I was using it with sorted-set
13:38Cheironhey, what is the original bishop project on github?
13:38raek,(for [x [:a :b :c], y [:a :b :c], :when (> x y)] #{x y})
13:38clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.Number>
13:38aaelonyset works, but yet sorted-set gives two
13:38Cheironhttps://github.com/search?q=bishop&amp;repo=&amp;langOverride=&amp;start_value=1&amp;type=Repositories&amp;language=Clojure too many, don't know what is the original
13:38raek,(for [x [:a :b :c], y [:a :b :c], :when (pos? (compare x y))] #{x y})
13:38clojurebot(#{:a :b} #{:a :c} #{:c :b})
13:38aaelonyraek: that's cool
13:39raekif the items are not comparable you could let x and y be indices of a vector of the items
13:40aaelonyI'm playing around with ways to compare subsequent items in a vector
13:40raek,(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:40clojurebot(#{:a :b} #{:a :c} #{:c :b})
13:40nz-(doc pos?)
13:40clojurebot"([x]); Returns true if num is greater than zero, else false"
13:40nz-(doc neg?)
13:40clojurebot"([x]); Returns true if num is less than zero, else false"
13:46aaelonyraek: compare appears really useful in this case, thanks!
13:49pandeirois nrepl-enable-on-existing-buffers like a nrepl-load-current-buffer for all open buffers?
13:50abalonehttp://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:50aaelonypandeiro: thanks for your help as well
13:51pandeiroaaelony: np
13:52abalone"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:53TimMcClearly it's TwoGuysArguing.
13:54abalonethere are four lights!
13:55abalone(one guy needs more line breaks to become two guys)
13:55abalonemaybe i'll read something else. anyone have a favorite rant on loop/recur for me?
13:56SegFaultAX|work2abalone: What are you having trouble with?
13:56abalonetho 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:58abalonemaybe 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:59llasramabalone: 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:00llasram*what the post author is trying to say
14:01llasramMmmm.... words
14:02`fogusHmmm, I never thought -> or ->> made anything look imperative
14:03nz-(doc ->>)
14:03clojurebot"([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:03SegFaultAX|work2Are the threading macros generally disliked?
14:03abalonei like em
14:03llasramI think I tend to over use them, but definitely like them
14:04abalone`fogus: maybe steps in forward sequence look imperative. that's all
14:04llasramThey make sequences of sequence ops or JVM interop calls waaay easier to grok
14:05abalonellasram: your interpretation of his writing works for me. thanks. bludgeon brain wrinlke has been ironed out.
14:05`fogusI like them too.
14:06`fogusI read them as "Take this, then do this, then take the result and do this, ...."
14:06SgeoI dislike them, but mostly because there are more functional solutions that I think should be used instead
14:06`fogusWhat's non-functional about them?
14:06SegFaultAX|work2`fogus: That's what I don't understand.
14:06Sgeohttp://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/
14:06Sgeo`fogus, they're macros unnecessarily
14:07SgeoIt occurs to me that I may be giving your blog post back to you
14:07abaloneSgeo: oh. fn-functional
14:07`fogusSgeo: Ah I see. You dislike the magicness of them?
14:07SegFaultAX|work2Are they really that magical?
14:07Sgeo`fogus, I dislike the lack of generality... -> puts things in the second position in the form, ->> puts themm in the last
14:07`fogusThey are magic in that they are syntactic
14:08`fogusSgeo: I see
14:08SegFaultAX|work2But they don't have to be.
14:08SgeoUsing thrush instead might force a bit more typing, but allows for more generality
14:08SegFaultAX|work2I was having this discussion the other day and I wrote a functional version of thread in Python: https://gist.github.com/3373635
14:08SegFaultAX|work2And by the other day, I mean almost a month ago apparently.
14:09Sgeo(thrush somevalue #(assoc % :foo 5) #(map somefn %))
14:09SegFaultAX|work2But 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:09SgeoWait, that doesn't quite work
14:10SgeoBut something along those lines may be more annoying with -> or ->>
14:11SegFaultAX|work2Ah, because -> is maniuplating the forms instead of creating a pipeline of computation.
14:11abalone~thrush
14:11clojurebotI don't understand.
14:11abaloneworth a try
14:12abalonethere 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`fogusCan I tell clojurebot to link thrush with my blog post?
14:12abalonewould be nice if ~thrush brought up the conclusion to that
14:12chousersuch a macro has been written many times
14:13SgeoAnd it would only need to be written once if it were in the core
14:13Sgeo(And it doesn't even need to be a macro, as fogus's blog post shows)
14:13chouseryes, but most people who have written it (myself included) have stopped using it.
14:14SgeoDue to reasons intrinsic to it, or due to lack of use elsewhere?
14:14chouserintrisic
14:14`fogusHaving only -> and ->> makes me think harder about my function arg ordering. I rarely have the need for -$> or its ilk
14:15abalonechouser: could you explain or link please?
14:16chouserI can try. :-)
14:17cemerickSgeo: If core had everything, then no one would need to write anything! ;-)
14:18hoover_dammalso core would have longer release cycles likely due to extra testing and more people contributing
14:18hoover_dammand trying to keep it clean
14:18chouserAll 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:19jkkramer(inc chouser)
14:19lazybot⇒ 9
14:19TimMcThey're also insufficiently general because they only allow linear chaining. There should also be forms for trees and DAGs!
14:20chouserThat is, I would recommend against (-> 5 (< 10) (if "whoa"))
14:20abalonenice
14:20chouseractually, that's bad for different reasons.
14:21abalonewhat are the other reasons?
14:21chouserso, helpful use of lexical threading already assumes a similarity of type across the whole form
14:21hyPiRionTimMc: I agree, but it shouldn't be in core. Some pipelining library would be nice.
14:21`fogus(inc chouser)
14:21lazybot⇒ 10
14:22chouseronce 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:23cemerickhyPiRion: Knock yourself out: https://github.com/rplevy/swiss-arrows
14:23dnolencorollary: if you feel the need for a arbitrary threading macro - the API you're being subjected to ... sucks
14:24SgeoBluh, the diamond wand is a macro isn't it?
14:24chouserThat 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:24cemerickThe examples on that readme are like a Rorschach test.
14:25SgeoOk, the nil-shortcutting diamond wand use cases might be better served via monads?
14:26SgeoHmm, or maybe not
14:26hyPiRioncemerick: Well, it's not really what I'm thinking of.
14:26hyPiRion(-<><:p (+ 1 2) [<> 2 1] [5 <> 7] [9 4 <>]) Doesn't really strike me as.... readable.
14:26chouserah, monads. The use cases of the state monad is not unrelated to the use cases of lexical threading.
14:26chouserare
14:27cemerickhyPiRion: Just another reason to be wary. Making something else that *is* readable hasn't been shown to be possible.
14:27chouserare not
14:27chouseryou know what I mean
14:27SgeoHmm, is <<- related to a denest macro I've seen for CL?
14:28hyPiRioncemerick: Not yet, at least.
14:29abalone~bludgeon
14:29clojurebotGabh mo leithsc?al?
14:39gtrak`I feel like I've seen something just like swiss arrows somewhere once before, but it was an april fools joke
14:46S11001001swiss arrows is awesome
14:47S11001001Sgeo: yes
14:50SgeoCool'
14:50SgeoIt should really get a better explanation
14:51S11001001fyi <<- is just backwards ->>
14:51mattmosso_O
14:52S11001001<<- 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:52gfredericks<<-html->><<-body->>Hello World!<<-/body->><<-/html->>
14:52mattmossbrain asplode
14:53gfredericks^ My new markup language called hhttmmll allows inline html literals with no escaping!
14:54ro_stbrain asplode indeed
14:57duck1123dnolen: 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:59casionhow do you use an external library in clojureC? or is this not possible yet?
14:59dnolenduck1123: good to hear
15:00SgeoThis is really starting to hilight the need for a features mechanism I think
15:30pandeirois there a java or clj lib for doing arithmetic with hours, minutes, seconds?
15:30dnolenpandeiro: joda
15:31uvtcpandeiro: https://clojars.org/clj-time
15:32pandeirouvtc: 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:32dnolenpandeiro: http://github.com/aredington/monotony also looks interesting
15:32pandeiroi think i'm looking for something simpler
15:33pandeirojust gonna write conversions to and from seconds
15:34casionit's pretty easy to do time conversion with (mod)
15:34casionfor just days/hours/minutes/seconds/etc..
15:35pandeirocasion: sure just thought it probably already existed but i guess not
15:40duck1123I think kibit gave me bad advice. [251] Consider: :link instead of: (fn [format] [:link format])
15:42ohpauleezduck1123: Yeah, it looks like kibit is matching the [] as if it were ()
15:42arohnerpandeiro: clj-time supports all of that
15:42arohnerand you're pretty much guaranteed to get it wrong, writing yourself
15:42ohpauleezie: (:link format) instead of (fn [format] (:link format))
15:43ohpauleezduck1123: Could you submit a bug on github, someone will get to it
15:43ohpauleezthanks for reporting!
15:43duck1123sure
15:43arohnerpandeiro: (time/in-secs (time/interval (time/now) (time/plus (time/now) (time/hours 3))))
15:44arohner(require '[clj-time.core :as time])
15:44dnolenohpauleez: unification in core.logic works across ISequential
15:44cemerickohpauleez: Looks like the blog post link @ https://github.com/shoreleave/demo-shoreleave-solr is busted
15:44ohpauleezcemerick: Yeah, I haven't written it yet :(
15:44ohpauleezbut it's coming
15:45ohpauleezalso, that demo isn't complete
15:45cemerickah ha, a tease!
15:45SgeoI think -<< is beautiful
15:45SgeoOr is it <<-
15:45ohpauleezyes, a tease indeed. you should look at ro_st's demo
15:45SgeoIt's <<-
15:47duck1123Sgeo: That's the problem with having a bunch of funky macro names. (as brilliant as they may be)
15:47TimMcpandeiro: You just want ideal time, not calendrical time?
15:47SgeoHey, does Clojure have an equivalent of prog1?
15:47TimMcSgeo: doto is the closest I can think of
15:47pandeiroTimMc: thank you i think that's how to express it
15:47pandeiroabstract time?
15:47ohpauleezdnolen: Ah, thanks for the tip
15:47cemerickohpauleez: It looks reasonably straightforward, modulo the magic in fetch. :-/
15:47pandeirounits of time
15:48ohpauleezcemerick: I'm sitting on some screen casts of Shoreleave too
15:48pandeiroarohner: thanks for the snippet but i think it's way overkill to do (- 00:01:56,215 00:00:43,632) for example
15:49arohnerpandeiro: depends on your requirements. doing it yourself, you're guaranteed to get it wrong wrt to timezones and daylight savings
15:49arohnerif you're fine with that, great
15:49pandeiroarohner: yeah these are not calendrical, as TimMc would say ;)
15:52gtrak`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:52SgeoBecause I like <* in Haskell and prog1 reminds me of it
15:54antares_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:54ohpauleezcemerick: I've added even more magic ;)
15:54antares_gtrak`: in other words, they will be executed in order and given a function as the argument, the rest is up to you
15:54ohpauleezYou can expose a server-side namespace to the client-side
15:54ohpauleezall remote calls of any kind are CSRF protected (if the token is present)
15:55SgeoMagic/more magic?
15:55cemerickYeah, I saw that. That's far too much rope for me.
15:55gtrak`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:55TimMcSgeo: Easy enough to write for yourself!
15:55gtrak`I guess that's alright, if that's the case
15:56ohpauleezindeed, you have to be careful not to expose non-sense, but it makes writing Data Abstraction Layers (DALs) a breeze
15:56ohpauleeznonsense*
15:56cemerickTLA WTF ;-P
15:56antares_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:56gtrak`antares_: I guess that means I have to do (use-fixtures :once setup1 setup2 run teardown1 teardown2), where only run calls (f)
15:56TimMc(defmacro do1 [form & forms] `(let [ret# ~form] ~@forms ret#))
15:56abalonegtrak: i actually use it the way you asked about, i think
15:57gtrak`not terribly clear :-)
15:58abalonegtrak`: 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:58gtrak`ok, that's what I figured was meant by 'compose'
15:59gtrak`it's more like ring middleware
15:59abalonewhat do ` and _ mean in nicks anyway?
15:59cemerickohpauleez: I just realized that shoreleave-remote doesn't depend on fetch at all; I over-read into the verbiage in the README :-)
15:59gtrak`I have a couple extra nicks for extra comps, when I log on it takes the one with the least ``'s
16:00ohpauleezcemerick: Nope, a more secure implementation and some different design decisions
16:00dysingerpardon my dumb question. I'm getting rusty at clojure. How do I access super inside gen-class ?
16:00casionabalone: usually to deal with ghosts and multiple computers
16:01cemerickohpauleez: works for me; so I should be able to wire up a shoreleave-remote-compojure without much trouble :-)
16:02ohpauleezcemerick: 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:02ohpauleezbut by all means hook it into compojure
16:02ohpauleezpatches welcome :)
16:03cemerickohpauleez: 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:03ohpauleezahh gotcha
16:04cemerickThat is, I'm not sure if you could satisfy both sensibilities with a single lib.
16:04ohpauleezgotcha
16:04dysingerI don't see examples anywhere for referencing super instance from a gen-class. am i dumbz?
16:05aperiodicdysinger: what do you want to do with the super?
16:05abalonegtrak: so i'm not sure what antares_ is saying. which makes me concerned since i am not as knowledgable
16:05RaynesSave the world, aperiodic.
16:05dysinger:)
16:05abalone~Raynes
16:05clojurebotif it's not one thing it's another
16:05abalone(inc raynes) ; for conch
16:05lazybot⇒ 17
16:06dysingerI need a reference to the super for reflecting access to a private member field.
16:06gtrakabalone: 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:07staindysinger: uh.. private in the superclass? You would probably need to delve into th java.lang.reflect API for that
16:08dysingeryes
16:08dysingerfirst I an instance reference to the super class as I understand it
16:08dysingerfirst I _need_
16:08auserI 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:09aperiodicwhy do you need to access the field in the super rather than in your subclass?
16:09abalonegtrak: so far the only thing i've had to experiment with was the ordering
16:09dysingeraperiodic: I assume so because it's private field
16:09llasramauser: 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:09staindysinger: 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:10llasrams,running REPL session,running REPL session attached to your editor,
16:10staindysinger: if it is *private* then it won't be accessible (the clue is in the name)
16:10hiredmandysinger: the first argument to functions backing methods in a gen-class is this, which by definition is an instance of its super class
16:10dysingerI'm too rusty I guess
16:10stainunless you use reflection and manage to flip the field to be protected
16:10auserllasram: I suppose I don't have that new workflow "down" yet then
16:10dysingerstain you can use reflection and go around private
16:10dysingeryes
16:10llasramauser: What editor are you using?
16:10auserI like "sbt's" sbt ~ test
16:10stainso it sounds like you know what to do :)
16:10auserllasram: emacs
16:11hiredmandysinger: are you trying to access it from the init function?
16:11aperiodicdysinger: you can use the :exposes methods to generate getters/setters for your subclass for the private fields in question
16:11dysingerno from another method/fun
16:11aperiodics/methods/option
16:11dysingeraperiodic: oooooh I like that better
16:11aperiodicdysinger: see the gen-class doc string
16:12auseralso, 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:12llasramauser: 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:13auserllasram: does that work with tests, such as autotest? I want to write a test and then write the code for it
16:14auserI found okku (https://github.com/gaverhae/okku -- an akka library for clojure), looks pretty nice… anyone have experience with it?
16:14dysingerdoc string makes it sound like only protected members can be exposed auser
16:14antares_auser: SLIME lets you run tests in a long-running JVM and it will recompile what's necessary
16:14auserneat
16:15llasramauser: 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:15llasramantares_, auser: Oh, automatically? How does one wire that up?
16:15antares_llasram: clojure-jack-in, C-c C-,
16:15antares_in a test ns
16:15llasramOh, yeah, that's clojure-test-run-tests :-)
16:15antares_right
16:16auserhm, I'll check that
16:16auserout
16:19auserokay, 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:19antares_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:19auserfrom 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:19antares_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:20antares_I certainly do with "applications" that can be started, stopped, etc
16:20Raynesantares_: I'm actually writing a component of a system fronted by Scala that will use okku.
16:20RaynesGoing to be interesting.
16:21auseryou use different jars for different services antares_ ?
16:21auserdoes it make sense to use something like netty combined with little tcp-driven services so you can cross jvm boundaries?
16:21antares_Raynes: sorry, what "by Scala" means here?
16:22Raynesantares_: The frontend of the thing will be Scala. And other components.
16:22antares_auser: see Lamina and Aleph. Also, Langohr (a sane small RabbitMQ client)
16:22auseryeah, by ztellman
16:22antares_auser: finally, maybe stuff from http://clojurewerkz.org will give you more ideas
16:22auserI'll check those out
16:22antares_Raynes: ah, cool
16:23auserI suppose I'm curious about crossing the jvm boundaries
16:23antares_Raynes: pretty awesome, good Akka integration for Clojure is a missing piece currently
16:23auserit'd be nice to have a cluster of jvm machines running different services
16:23antares_auser: there is nothing that matches Erlang in this area but I guess remote Akka actors may be all you need
16:23auseryeah
16:24auserhttps://github.com/gaverhae/okku is the closest thing I can find to clojure support for akka
16:25abrooksIn 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:25auserthanks antares_
16:25abrooksI feel like I may want to use core.logic/solutions but see no examples and can't figure out how to use it.
16:26antares_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:28amalloyabrooks: 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:28Sgeo(-<><:p (+ 1 2) [<> 2 1] [5 <> 7] [9 4 <>]) => '[(3 2 1) (5 3 7) (9 4 3)]
16:28SgeoIt makes perfect sense!
16:28tanzoniteblackSgeo: ...sure, why not
16:31dysingerauser: yeah just as I suspected I can't use :exposes on private fields
16:31dysinger"Caused by: java.lang.IllegalAccessError: tried to access field "
16:32SgeoWoah that seems broken
16:32SgeoWhy is it a vector of ... hmm
16:32SgeoWhy is it a vector of lists?
16:32SgeoAnd not a vector of vectors?
16:33dysingerin actual Java one would go super().getDeclaredFields()….. and off I'd go using reflection to gain access to the private field
16:34dysingersorry super.getDeclaredFields
16:34chousergen-class creates a subclass, so of course it can't directly touch the private fields of its parent class
16:37TimMcdysinger: Are you subclassing Class? :-/
16:37dysingerchouser not directly no
16:37chouserdysinger: 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:37dysingerbut I don't think the super classes private field will show up in declared fields
16:37dysingerguessing - need to try it next
16:37chouserAnd your method fns get a this paramter, so you can pass that in when needed.
16:38chouseryeah, private fields may be trickier. They can probably be renamed by the compiler
16:38dysingeryeah I'm looking for this (super this) or something
16:39chouserthis is the instance. What would (super this) return?
16:39hiredmandysinger: I think you are confusing class methods with instance methods
16:39hiredman.getDeclaredFields is a method on Class objects
16:40dysingeryeah you are correct
16:40hiredmanso you can just call it on the super classes Class
16:40TimMcdysinger: What are you actually trying to accomplish?
16:40hiredmanand then you need an instance of the class to access the field
16:40hiredmanluckily the first argument to the functions is "this" which is an instance of its superclass
16:41dysingerah
16:41dysingerI need to bang my head more and then come back I guess :)
16:41chouseran instance of this class and all its superclasses.
16:42hiredmandysinger: you may want to checkout clj-wallhack
16:42hiredmanhttps://github.com/arohner/clj-wallhack
16:42dysingerk
16:43hiredmanI don't know that it will make things much simpler, but it gets rid of a lot of reflection boiler plate
16:44pandeirohow do i go from line-seq back to a txt file?
16:44hiredmanso if you know the name of the field you can just do (wall.hack/field SuperClass :foo this)
16:44dysingerack
16:44dysingerI was using the code from get-field in the old clojure contrib
16:45pandeiro(spit "file.txt" (apply #(str % "\n") my-line-seq)) ?
16:45dysingerand I didn't think that (class this) would give me access to the declared fields of the super class.
16:46nbeloglazovI'd use inerpose: (->> my-line-seq (interpose "\n") (apply str) (spit "file.txt"))
16:47dysingeryeah just as I suspected (-> this class .getDeclaredFields) doesn't expose the super classes declared fields.
16:48dysingertrixy
16:48dysingerso no concept of super outside proxy-super then
16:49hiredmandysinger: yeah, because the class of this is not the super class, if you know the super class (-> SuperClass .getDeclaredFields) will work
16:49nbeloglazovdysinger: it's not hard to iterate through all superclasses
16:49hiredmanor (for [super (supers (class this)) field (.getDeclaredFields super)] [super field])
16:49dysingermaybe I can hardcode it
16:50nbeloglazov&(doc supers)
16:50lazybot⇒ "([class]); Returns the immediate and indirect superclasses and interfaces of c, if any"
16:50nbeloglazovnice
16:50dysingerah thanks for the help
16:54pandeiroline-seq doesn't use utf-8 by default?
16:54pandeiroor is that set when i create the reader?
16:55llasrampandeiro: The latter
17:01solussdsorry 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:04auserantares_: there isn't a good fsm?
17:04auserthat surprises me
17:04auser(sorry, lunch)
17:04antares_auser: well, there are FSM libraries of various scope but they are not async, for example
17:04pandeirollasram: (io/reader "foo" :encoding "UTF-8") should do it?
17:04auseryuck
17:04ausernot even in akka?
17:05auserhttp://doc.akka.io/docs/akka/snapshot/scala/fsm.html
17:05auserthat's one reason I'm interested in using akka
17:06llasrampandeiro: Should indeed
17:06pandeiroweird, maybe emacs/nrepl issue
17:07llasrampandeiro: What issue are you experiencing?
17:09pandeironon-ascii chars aren't appearing (at the repl at least) when i try to read a file with line-seq and reader
17:10antares_auser: I am not sure about Akka
17:11llasrampandeiro: 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:13pandeirollasram: (map int ...) shows the chars with values
17:13llasramchars with values...?
17:13llasram&(map int "I am a string")
17:13lazybot⇒ (73 32 97 109 32 97 32 115 116 114 105 110 103)
17:14pandeiro,(map int "Télévision")
17:14clojurebot(84 65533 65533 108 65533 ...)
17:14llasramWhat's up with that, clojurebot ?
17:15llasram&(map int "Télévision")
17:15lazybot⇒ (84 233 108 233 118 105 115 105 111 110)
17:15llasramMuch better, lazybot
17:15thorbjornDXwhat's clojurebot doing?
17:15pandeiro&(map int "Television")
17:15lazybot⇒ (84 101 108 101 118 105 115 105 111 110)
17:15pandeirook
17:16pandeiro&(apply str (map char (map int "Télévision")))
17:16lazybot⇒ "Télévision"
17:16thorbjornDX,(apply str (map char (map int "Télévision")))
17:16clojurebot"T??l??vision"
17:17nbeloglazov,(java.nio.charset.Charset/defaultCharset)
17:17clojurebot#<US_ASCII US-ASCII>
17:17llasramAh
17:17nbeloglazov&(java.nio.charset.Charset/defaultCharset)
17:17lazybot⇒ #<UTF_8 UTF-8>
17:17thorbjornDXAhh
17:17llasramclojurebot recognizes that there is one true character encoding, and all others must be truncated to 7 bits
17:17hiredmanclojurebot: why you no utf8?
17:17clojurebotExcuse me?
17:17pandeiromaybe my src file isn't UTF-8
17:19auserantares_: I would check out akka for it
17:19auserfor the FSM
17:19auserit looks fairly complete
17:20pandeirodamn you ISO-8859-1
17:25antares_auser: yeah I think they also follow many OTP principles pretty closely
17:25auseryeah
17:25Raynesyuh
17:27auserI'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:28antares_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:29auseryeah… I think you're right… too bad I <3 clojure syntax
17:29auserthanks antares_
17:50mpanguys, 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:50mpanthe 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:55S11001001mpan: where is get-lines defined?
17:55nvympan: what about parse-train-lines? (I can't answer your query, but this might be useful for others)
17:56mpanget-lines is something that gets a non-lazy seq of strings from the filesystem (domain specific)
17:56mpanparse-train-lines is supposed to map 1-to-1
17:56S11001001mpan: what kind of non-lazy seq?
17:56mpana list, I believe
17:56S11001001mpan: clojure.lang.PersistentList?
17:56mpanI just found an exception happening midway
17:57mpanand I'm not sure why it was silent about the exception when I was running main
17:57mpanlike I ran the def, and the def succeeded
17:57mpanbut in reality, it died halfway to an exception (??)
17:57S11001001mpan: loaded-files, you mean?
17:57mpanthe def for loaded-files
17:57S11001001mpan: map is lazy
17:58mpanso if it fails, it's silent?
17:58S11001001mpan: try dorun instead of count
17:58mpanlike the function passed to map raised an exception
17:59S11001001because ##(first (map #(%) [#(/ 1 1) #(/ 1 2) #(/ 1 0)]))
17:59lazybotjava.lang.ArithmeticException: Divide by zero
18:00mpanah
18:00mpanforcing the seq via dorun makes the exception manifest
18:00S11001001count is funky
18:01mpanwhy doesn't count hit that same exception, though?
18:01mpanand for that matter, why does every other map I called on that seq not hit it?
18:01mpanor is that just the semantics of map?
18:01S11001001all maps are lazy
18:02mpanoh, this also explains why map and println weren't working with each other :(
18:02gfredericksmpan: see prn
18:02S11001001try prn instead
18:02mpan(doc count)
18:02gfredericksS11001001: my idea was better
18:02clojurebot"([coll]); Returns the number of items in the collection. (count nil) returns 0. Also works on strings, arrays, and Java Collections and Maps"
18:02S11001001gfredericks: definitely
18:02mpanwhy was count happy with the seq that would produce an exception, though?
18:02mpanthat part still confuses me
18:03S11001001probably no one cares about count
18:03hyPiRion$source count
18:03lazybotcount is http://is.gd/r6IxoX
18:03gtrakit isn't though
18:03gfredericksclojure.lang.RT/count
18:04mpanthank you all so much for helping me find this problem!
18:04mpanthank you, although, I'm still very confused why does counting a seq not hit the exception that forcing it would?
18:05tanzoniteblackmpan: it's likely it is hitting the exception, it just counts what existed pre-the exception occuring?
18:06hyPiRionWell
18:06tanzoniteblack~(count (map #(%) [#(/ 1 1) #(/ 1 2) #(/ 1 0)]))
18:06tanzoniteblack,(count (map #(%) [#(/ 1 1) #(/ 1 2) #(/ 1 0)]))
18:06clojurebot#<ArithmeticException java.lang.ArithmeticException: Divide by zero>
18:06clojurebotclojure is a language to use if you want to up your game
18:06tanzoniteblackwell...there goes that idea
18:06hyPiRion,(count (map #(%) [#(/ 0 0)]))
18:06clojurebot#<ArithmeticException java.lang.ArithmeticException: Divide by zero>
18:06mpanI'm just confused why it didn't propagate the exception it encountered
18:07hyPiRion,(do (map #(%) [#(/ 0 0)]) nil)
18:07clojurebotnil
18:08mpano_O
18:08mpanthis feels just so strange
18:08mpanthank you all for helping me figure it out
18:08mpanalthough, people in the computer lab probably think I'm crazy now
18:09thorbjornDXmpan: if people in the computer lab don't think you're crazy something is wrong
18:12mpanthorbjornDX: hm??
18:12lazybotmpan: Definitely not.
18:12mpanlazybot: I thought you're a bot??
18:12lazybotmpan: Definitely not.
18:12mpan:(
18:13hyPiRion&:D
18:13lazybot⇒ :D
18:13thorbjornDXmpan: Syntax error near &:(
18:13mpanturns out, though, ~10 records are malformed
18:13mpanand that was the root cause of, well, everything
18:14SgeoWait, why would you map #(%).... what does that function do... oh, it calls the argument
18:14ivaraasenthorbjornDX: I always get looks when I'm using something else than Eclipse or Matlab in our computer labs. "are you playing games, bro?"
18:14SgeoAh, reason it threw me for a loop is because in haskell, there are no 0 argument functions, they're not needed
18:15thorbjornDXivaraasen: just tell them that you're playing nethack
18:15hyPiRionivaraasen: Haha, people go crazy when I pop up Emacs, even in our computer department.
18:15hyPiRionvim and its popularity nowadays
18:15ivaraasenthorbjornDX: to be fair, I am mostly playing nethack
18:18ivaraasenthorbjornDX: your nick suggests you're Scandinavian. is that correct?
18:19thorbjornDXivaraasen: (/ "danish" 2)
18:21hyPiRion#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number>
18:21thorbjornDXhyPiRion: I figured someone would call me on it. I want a full stacktrace though
18:22hyPiRionmeh.
18:22SegFaultAX|work2What's the difference between find and get?
18:22thorbjornDX&:)
18:22lazybotjava.lang.RuntimeException: Invalid token: :
18:22SegFaultAX|work2,(doc find)
18:22clojurebot"([map key]); Returns the map entry for key, or nil if key not present."
18:22SegFaultAX|work2,(doc get)
18:22clojurebot"([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."
18:22mpanwhat's people's usual strategy for when clojure code isn't working as intended?
18:23gfredericksget thee to a replee
18:23thorbjornDXpppaul is having some problems :(
18:23hyPiRionSegFaultAX|work2: ##((juxt get find) {:foo :bar} :foo)
18:23lazybot⇒ [:bar [:foo :bar]]
18:24thorbjornDX,(doc juxt)
18:24clojurebot"([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:29Heyklquit
18:31mpanwhat's non-lazy map called?
18:31mpan(for e.g. println purposes)
18:32dnolenmpan: 1.5 has reducers, otherwise you need to wrap the lazy seq in a doall.
18:32mpanall right, thank you!
18:32tanzoniteblackmpan: alternatively, you can use doseq
18:32tanzoniteblack,(doseq [x [1 2 3]] (println x))
18:32clojurebot1
18:32mpanthank you as well!
18:33clojurebot2
18:33clojurebot3
18:40mattgordon(clj-json.core/generate-string {"canceled" 0.0})
18:40mattgordonjava.lang.NoClassDefFoundError: clojure/lang/BigInt (NO_SOURCE_FILE:0)
18:40mattgordonIs that expected? It seems like a bug
18:41hiredmanclj-json is ancient, use cheshire
18:42hiredmanmattgordon: you need to upgrade your version of clojure too
18:43mattgordon[org.clojure/clojure "1.4.0"]
18:44mattgordonhmm I've used clj-json in some other projects but I'll check out cheshire if that is the modern solution
18:46hiredmanmattgordon: you may have a problem with your dependencies, something pulling in an old version of clojure
18:47mattgordoninteresting
18:47hiredmanclojure.lang.BigInt definitely exists in 1.4
19:00mattgordonit'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:07mpan,(#(%) 100)
19:07clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
19:07mpanwhoops
19:07mpanwhat's the shorthand for identity fn?
19:08metellus,(identity 100)
19:08clojurebot100
19:12Apage43,(#(do %) 100)
19:12clojurebot100
19:12Apage43if you're golfing or something
19:14mpanok thanks guys
19:16hyPiRion,(#([%]0) 100)
19:16clojurebot100
19:17hyPiRion,((fn[a]a) 100) ; works too
19:17clojurebot100
19:18metellus,(#(%1) 100)
19:18clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
19:18metellusdarn.
19:23amalloyaw, + and * both cast to Number, so you can't use them as identity
19:27duck1123,(-> 100)
19:27clojurebot100
19:27amalloynot a function
19:27duck1123aww
19:29metellus,(pr 100)
19:29clojurebot100
19:29metellustada!
19:40Apage43,(or 100)
19:40clojurebot100
19:40Apage43there we go :)
19:41duck1123wow. How did no one think of 'or'?
19:47amalloynot a function
19:49arrdemcould you not create a lazy recursive definition of or?
19:49arrdem(but yes dang the clojure.core macro or)
19:50amalloyarrdem: you couldn't write a function that acts just like the existing macro
19:54arrdemwhy 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:54arrdem,((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:54clojurebot0
19:54dnolenarrdem: won't work. think about evaluation.
19:55dnolenarrdem: 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:58thorbjornDX,(doc cond)
19:58clojurebot"([& 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:59thorbjornDXarrdem: what's that :else thing doing?
19:59Sgeo,(if :else ":else is logically true" ":else is logically false")
19:59clojurebot":else is logically true"
20:00tanzoniteblackthorbjornDX: :else is a keyword, which always resolves to "true", so it's a condition that will always work
20:00thorbjornDXah, thanks :)
20:00tanzoniteblackthorbjornDX: you could just as easily use :whyTheHellNot and it would work...but it's not very idiomatic
20:00thorbjornDXoh, so all keywords resolve to true?
20:00SgeoOnly nil and false are untruthy
20:00Sgeo(if 0 "0 is truthy" "0 is falsey")
20:01Sgeo,(if 0 "0 is truthy" "0 is falsey")
20:01clojurebot"0 is truthy"
20:01dnolenthorbjornDX: Sgeo's point is more important.
20:01thorbjornDXI'd ask about 0, but you already answered that. Hmm.
20:02thorbjornDXI guess that makes little logical sense
20:02SgeoIt's not just Clojure that does it
20:02amalloydnolen: 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:02SgeoAlthough, statically typed languages tend to not have that question at all
20:02SgeoOnly booleans can be truthy or falsey
20:02dnolenthorbjornDX: 0 as false-y is truly awful - as McCarthy says encourages pornographic programming
20:03thorbjornDXdnolen: &foo += 1;
20:03thorbjornDXman, I haven't written C in a while
20:03dnolenamalloy: 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:03tanzoniteblackdnolen: pornographic programming?
20:03tanzoniteblackif I weren't at work, I would go look that up...
20:04dnolentanzoniteblack: look up McCarthy's notes on the history of lisp
20:04SgeoHow is the type fiction? It might operate "magically", but it still takes a list of Bools and gives a Bool
20:04Sgeoif/then/else is syntax, but a lot of people dislike that
20:05SgeoAnd you can write a function instead (similarly to Smalltalk)
20:05dnolenSgeo: 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:06Sgeoamalloy, or can be defined in terms of other functions: <Sgeo> @src or
20:06Sgeo<lambdabot> or = foldr (||) False
20:06amalloyobviously
20:06SgeoI think I still have some trouble wrapping my mind around folds :/
20:07mattmoss(or (and 0 "truthy") "falsey")
20:07mattmoss,(or (and 0 "truthy") "falsey")
20:07clojurebot"truthy"
20:07mattmoss,(or (and nil "truthy") "falsey")
20:07clojurebot"falsey"
20:08dnolenthe 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:08mattmoss,(str (or nil :horsey) :sauce)
20:08clojurebot":horsey:sauce"
20:09Sgeo,(letfn [(truthy [val] (if val :truthy :falsey))] (map truthy [false nil 0 "" '() () (list)]))
20:09clojurebot(:falsey :falsey :truthy :truthy :truthy ...)
20:09SgeoIs letfn often used where where is used in Haskell?
20:09amalloynot really
20:10SgeoHm :/
20:10thorbjornDXSgeo: thanks for that clarification
20:10SgeothorbjornDX, you're welcome
20:11thorbjornDX&(letfn [(truthy [val] (if val :truthy :falsey))] (map truthy [false nil 0 "" '() () (list)]))
20:11lazybot⇒ (:falsey :falsey :truthy :truthy :truthy :truthy :truthy)
20:11antares_Langohr 1.0.0-beta4 is out: https://github.com/michaelklishin/langohr/blob/master/ChangeLog.md
20:12Sgeo,(map class () '())
20:12clojurebot()
20:12Sgeo?
20:12Sgeo,(map class () '() (list))
20:12clojurebot()
20:12SgeoOh, hmm
20:12Sgeo,(map class [() '() (list)])
20:12clojurebot(clojure.lang.PersistentList$EmptyList clojure.lang.PersistentList$EmptyList clojure.lang.PersistentList$EmptyList)
20:15jkdufairi 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:18SgeoWhat's the rationale for condp's predicate's first argument being the case and second argument being provided just once?
20:18Sgeo(As opposed to the other way around)
20:18SgeoI know that it's one or the other, but any reason for that choice in particular?
20:20ohpauleezSgeo: Think about this:
20:21ohpauleez(condp = (class x) String :string Integer :integer)
20:21ohpauleezthat reads pretty easy
20:21ohpauleezif they were swapped, it looks like you messed up the s-expr
20:21SgeoUh, = is symmetric, isn't it?
20:22casionohpauleez: I asked the same question as Sgeo last week, and your response made a lot of sense, thanks
20:22ohpauleezcasion: No problem!
20:22SgeoHow does that example clarify anything?
20:23SgeoHmm, maybe I misexplained my question
20:23ohpauleezSgeo: Let's say we write condpp, the version you're proposing. How would the line above look in condpp?
20:23Sgeo(condp = (class x) String :string Integer :integer)
20:23ohpauleezmaybe a concrete example will help clear up the question and answer
20:24Sgeo,(doc some)
20:24clojurebot"([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:25Sgeo(condp #(some %2 %1) [1 2 3 4] #{0 6 7} :>> inc #{4 5 9} :>> dec)
20:25Sgeo(Taking from the Clojuredoc example, how that would need to be rewritten, I think
20:26SgeoThat is, the rationale for "For each clause, (pred test-expr expr) is evaluated."
20:26SgeoOver (pred expr test-expr)
20:29ohpauleezSgeo: If you swapped the order, the layout of condp makes less sense, when you think about what's really happening with the code
20:30SgeoHmm, how so?
20:30aperiodici think it's mainly for comparisons
20:30aperiodic,(condp > 0 -1 :negative 1 :positive)
20:30clojurebot:positive
20:30ohpauleezthe condp form is laid out (pred test-expr expr)
20:30ohpauleezand you read it that way
20:31ohpauleezif you're looking to match seqs, I'd use a straight cond or case
20:32casionI think the use of 'some' on clojuredoc makes the intended use confusing
20:32ohpauleezagreed
20:32SgeoI think I've written Haskell code where I wished I had condp
20:33SgeoBut I don't remember it in any detail
20:33casionalso, that damn :>> keyword...
20:33ohpauleezagreed, again
20:33ohpauleezto me, it's an abuse of a language construct as syntax
20:34ohpauleezso I tend to avoid that use of condp
20:34ohpauleezbut nonetheless, super powerful
20:39Frozenlo`Eh.. I've forgotten how to require a cljs subclass. I'm pretty sure (:require [goog.ui.DatePicker :as dp]) is wrong.
20:41ohpauleezFrozenlock: that looks right to me
20:42ohpauleezbut if you're going to instantiate an object, you need to use the full path
20:42FrozenlockReally? Emacs adds a weird color after the goog.ui
20:42ohpauleez(:require [goog.pubsub.PubSub :as pubsub])
20:42ohpauleez….
20:42ohpauleez(extend-type goog.pubsub.PubSub ...)
20:43FrozenlockThen I'll continue as I were, thank you :)
20:43ohpauleezalso note that Closure lib is split into two different organization techniques
20:44ohpauleezolder stuff, the path name endpoint is not the object name. In the newer stuff (like pubsub) it is
20:44ohpauleezFrozenlock: totally welcome
20:45SgeoLamina pipelines remind me of monads
20:45SgeoEverything reminds me of monads
20:45SgeoHmm, I might be wrong
20:45n00b6502whats a lamina pipeline
20:45Sgeohttps://github.com/ztellman/lamina/wiki/Pipelines-New
20:47gf3sjl: yt?
20:48SgeoOh right, I raged in infinite fury when I saw Lamina's map*
20:49amalloy$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:49lazybotMessage saved.
20:50SgeoOh hey cool I can use $mail for stuff
21:21unlinkI wish there was a version of (partial ...) that partially applied the arguments after the first
21:22unlinklike (partial2 assoc :key "val")
21:22technomancyrpartial would be tops
21:23TimMctechnomancy: Do you often find yourself wanting rpartial where you omit more than 1 leading argument?
21:24unlinkI basically only want to omit the 2nd arg. Is rpartial in some library?
21:25gfredericksmight be in useful
21:25unlinkIs that intended to mean "reverse partial"? i.e. (rpartial assoc "val" :key)?
21:25gfredericksrest partial maybe
21:25TimMcMaybe rpartial could be done as a conjugation of partial and something that applies the reverse of its restargs to its first argument.
21:25tmciverunlink: how about (defn delegate [f &args] #(apply f % args))? (Saw this in cgrand's moustache)
21:26unlinkYeah, I mean I could write it easily enough, but I don't want to be in the business of creating general utility functions.
21:26TimMcunlink: :-(
21:26TimMcSomeone's gotta write 'em!
21:26gfredericksover and over again
21:26gfredericksin each project
21:26unlinkWell writing them is easy, justifying them as idiomatic basic Clojure is hard.
21:31unlinkThe 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:33antares_anybody else seeing exceptions with code that does not use :only/:refer after https://github.com/clojure/clojure/commit/ec802664760d160c325323e999778ffd7b13e22c ?
21:35Apage43antares_: what'
21:35Apage43s the code?
21:35amalloy&(keys nil)
21:35lazybot⇒ nil
21:35antares_Apage43: I am still tracking it down but apparently some nses that do not even have :use in them now fail to compile
21:35antares_tracking it down by commenting things out :/
21:36Apage43ah
21:36amalloyantares_: 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:36antares_amalloy: yeah
21:36antares_I have a couple of such ns-es
21:36antares_they only extend protocol
21:36antares_protocols
21:36amalloy*nod* time for a jira ticket, sounds like
21:37antares_https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/json.clj
21:39antares_amalloy: http://dev.clojure.org/jira/browse/CLJ-1062
21:40amalloyantares_: it doesn't break compilation of those namespaces, it breaks requiring of such namespaces from a separate ns clause
21:40antares_amalloy: hm, yeah
21:40amalloyanyway, i'd suggest including at least a failing test, and preferably a patch, which would be easy
21:41antares_amalloy: I haven't mailed my CLA
21:41wmealing_amalloy: had some issues with lazybot last night, doesn't work well at all without mongo setup
21:41antares_I will include a test but monger's code is a good test
21:41wmealing_it'll join channels, but the go mute
21:41amalloywmealing_: indeed, he assumes mongo
21:41amalloyor at least, a number of his plugins do
21:49antares_amalloy: https://github.com/michaelklishin/clj1062
21:50amalloyantares_: 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:51antares_amalloy: I'd need to try
21:52antares_amalloy: but then there are nses like https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/operators.clj
21:53antares_it makes sense to :use monger.operators
21:55amalloyso? that namespace isn't empty, so it works fine
21:55antares_amalloy: as far as I can see, it does not
21:56antares_amalloy: you are right
21:56antares_oh well, I can't even edit my ticket to lower the severity
21:56antares_lovely JIRA
21:58devnjira is an ugly thing
21:58devnThing(tm)
21:59devnCVS + Jira -> The Future
22:00FrozenlockOh what fresh hell is this
22:00FrozenlockMy cljs repl broke :(
22:01ohpauleezFrozenlock, you're almost always better off not using the cljs repl
22:01devnAndy 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:01FrozenlockI have only two lines in my .cljs: (repl/connect "http://localhost:9000/repl&quot;) (dom/log "Hello, world!"). Yet the console shows me "Uncaught TypeError: Cannot call method 'appendChild' of null"
22:01ohpauleezafter all, you're just writing real Clojure code, so a standard repl should be fine.
22:02ohpauleezFrozenlock: Where are you getting `dom` from?
22:02Frozenlock (:require [clojure.browser.repl :as repl]
22:02Frozenlock [clojure.browser.dom :as dom]))
22:02Frozenlock
22:02Frozenlockohpauleez: I interact with the browser, so I don't see how I could do it in the java repl
22:02antares_devn: I don't know Andy but I don't think I've seen anything on the clojure mailing list
22:03antares_devn: where does that involvement happen? clojure-dev? that's a closed playground for cool kids, we mere mortals don't go there
22:03ohpauleezAre you sure you don't just want to us (js/console.log …)?
22:03FrozenlockIsn't it the same thing?
22:03devnantares_: don't believe the hype. people are welcome, I promise.
22:03devnyou know, like, regular people
22:04xeqiantares_: yep, weekly clojure-dev
22:04xeqiI lurk
22:04ohpauleezFrozenlock: 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:04devnit doesn't change the fact that everything is mired in enterprise-levelish process
22:05Frozenlockohpauleez: Perhaps one day... but I still lack the javascript/dom experience to know what I'm doing :P
22:05technomancytrufacts: from 2005 to 2010, Jira emailed passwords in plaintext upon signup.
22:05FrozenlockSo I need to test everything
22:05antares_devn: no hype, just my own experience
22:06ohpauleezFrozenlock: 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:06ohpauleezAlso, you might checkout out the Shoreleave core and Shoreleave browser stuff
22:06ohpauleezit might ease some of your CLJS woes
22:06devntechnomancy: yeesh
22:06ohpauleez(shameless plug)
22:06dnolen_ohpauleez: not following the conversation closely but (js/console.log ...) is not really valid ;)
22:06FrozenlockYeah I'm looking at the source now, should find if dom/log is the same thing.
22:06devntechnomancy: what's the most recent reason for keeping clojure stuff on jira?
22:06dnolen_ohpauleez: and I disagree about the REPL when I have used it I use it a lot.
22:07devntechnomancy: i ask you because you've been fighting the good fight for quite some time if memory serves
22:07technomancydevn: tempted to ask why you think reason comes into it
22:07antares_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:07ohpauleezdnolen_: In what context do you find the REPL the most useful?
22:07Frozenlock(defn log [& args]
22:07Frozenlock (.log js/console (apply pr-str args)))
22:07technomancydevn: that'd be antares_ fighting the good fight
22:07technomancyme, I bend my principles sometimes
22:08antares_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:08dnolen_ohpauleez: I always use the REPL when writing code - though I know some people have differently dev styles.
22:08ohpauleezI 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:08ohpauleezdnolen_: I use the repl constantly
22:08ohpauleezjust not the cljs repl
22:08clojurebotreply is the new high-powered repl that powers lein2's repl task https://github.com/trptcolin/reply
22:08dnolen_ohpauleez: I see what you mean, you just code against the CLJ repl since the lang is more or less the same.
22:08ohpauleezenvironment in the browser-repl**
22:09devntechnomancy: surely there must be *some* reason. honestly, there isn't?
22:09technomancydevn: "because I said so"?
22:09ohpauleezdnolen_: yeah, unless I'm doing something browser specific, or there's a bug in my CLJS app and I want to poke around
22:09devnantares_: sorry to hear about your troubles. that's most uncool IMO.
22:09dnolen_ohpauleez: that's actually nice to hear! that the language is not significantly different enough for you to bother!
22:10ohpauleezjust protocols and maps :)
22:10xeqi$seen kingtim
22:10lazybotkingtim was last seen quitting 1 day and 2 hours ago.
22:11technomancyto be fair, "because I said so" is often reasonable
22:11antares_amalloy: thanks for finding the root cause so quickly, I now have a passing build again
22:11TimMcxeqi: Try $mail
22:12antares_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:12devntechnomancy: 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:12TimMcantares_: I, on the other hand, *did* sign the CA -- but I still don't feel that I can contribute code.
22:12xeqiTimMc: sure, or just make my pull request I was gonna ask about
22:13technomancyantares_: absolutely agreed, though the shortcomings of google groups are different from the shortcomings of jira.
22:13devnI 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:13antares_technomancy: but it has nothing to do with the mailing list
22:13antares_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:14ohpauleezdevn: It has to do with how Clojure is licensed and it's possible paths in the future
22:14antares_devn nails it, CVS + Jira = The Future
22:14antares_why does clojure even use git
22:14ohpauleezits**
22:14TimMcohpauleez: I really have to reject that argument. There are many paths to that.
22:14dnolen_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:14devnI wonder that sometimes as well antares_: "Type your patch out and mail us a copy!"
22:15dnolen_antares_: but if you're heavily invested - CA is a small barrier. They're pretty responsive once they have it.
22:15TimMcdnolen_: Maliciousness, no -- apathy, then? Perhaps underestimation of the effect on morale?
22:15technomancyantares_: it's a mess, but I've pretty much given up caring.
22:15ohpauleezTimMc: 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:16dnolen_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:16technomancyjust better to do apply effort in places where you can make a difference without a huge fight
22:16TimMcohpauleez: I'm not talking about the CA alone -- lack of pull requests is pretty bad.
22:16devndnolen_: but people *do* make money supporting Clojure.
22:16antares_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:17mpanis it a bad idea to have circular requires?
22:17dnolen_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:17antares_dnolen_: what can that be attributed to?
22:17TimMcdnolen_: Right, the understaffing/bottleneck is probably the core issue.
22:17technomancyit 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:17dnolen_on CLJS specifically.
22:17technomancy(it was about ten lines)
22:17TimMcmpan: A terrible idea, and it won't even work. :-)
22:18mpan:/ the alternative is making factories, essentially
22:18ohpauleezTimMc: 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:18TimMctechnomancy: I'm still not sure if anyone has even looked at my unsigned-bit-shift-right JIRA ticket.
22:18dnolen_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:18technomancydnolen_: we discussed it thoroughly in person at the conj
22:18ohpauleezWe should set up some alternative/fund/help for special cases
22:19ohpauleezalso, dnolen_ is a ticket reviewing champ and deserves a round of beers
22:19devndnolen_: 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:19technomancyohpauleez: you can't prevent frivolous lawsuits with policies
22:19ohpauleezlike… five…. seven rounds of beers
22:19technomancythe EPL already has a solid patent protection clause
22:19dnolen_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:19TimMcohpauleez: Explain to me how a fraudulent pull request could even *happen* -- and more plausibly than a JIRA break-in.
22:20antares_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:20technomancydnolen_: it's not like there was any discussion once the patch was submitted though
22:20TimMcI could maybe spoof your email address and submit a patch that way.
22:20ohpauleezantares_: I'm totally ok with a signed PDF - I don't think the mail pieces is necessary
22:20antares_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:20hoover_dammantares_, using echosign for example
22:20dnolen_technomancy: sure, but other changes waited even longer - numerics - 1.5 years?
22:20antares_ohpauleez: for Clojure, it is!
22:20ohpauleezsure, that's not what I'm arguing
22:21technomancyscala's CA uses oauth
22:21ohpauleezI'm saying the CA is necessary
22:21ohpauleezI don't care how it works
22:21antares_ohpauleez: I don't argue with the need for CA
22:21antares_just with the entire process that shuts people out every months
22:21antares_*month
22:21ohpauleezjust the need to mail the physical copy
22:21ohpauleezsure
22:22hoover_dammnext time someone complains about the opscode cla... i'm going to point them to the clojure CA
22:23dnolen_devn: I'm not convinced there's a real barrier.
22:24ohpauleezTimMc: 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:24ohpauleezwould pounce on that
22:25dnolen_TimMc: pull requests suck
22:25technomancyhaha
22:25technomancyohpauleez: though signing a CA doesn't prevent someone from submitting patches for which they don't own copyright
22:26TimMcohpauleez: And that requires a physical piece of paper?
22:26dnolen_technomancy: well not for every project - but we've already talked about that.
22:26TimMcI can commit perjury electronically, why not sign a CA electronically?
22:26technomancyohpauleez: it's not like signing paperwork makes it *more* illegal
22:26antares_dnolen_: are you serious about pull requests?
22:27ohpauleeztechnomancy: 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:27TimMcI'm not actually arguing about CAs in the abstract.
22:27TimMcWhat 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:27xeqiohpauleez: really? I would think Comcast would still be able to do it, they didn't sign the CA and own the copyright
22:29technomancyI'm sure Comcast would have an easy time disavowing the actions of a rogue employee.
22:30dnolen_antares_: for ClojureScript, core.logic, core.match yes.
22:30antares_dnolen_: why?
22:30dnolen_antares_: many tickets involve multiple reviews, multiple patches you want that history.
22:30antares_dnolen_: are JIRA patches good for CLJS, core.logic, core.match?
22:30dnolen_antares_: eys
22:30dnolen_oop yes
22:31antares_dnolen_: and how do you not have history with pull requests?
22:31dnolen_antares_: they aren't JIRA patches, they are just patches.
22:31antares_they can be updated, github shows you full history + comments
22:31dnolen_antares_: does a pull request have every pull request in it?
22:31TheBusbyRaynes: there?
22:31dnolen_like I want you to modify it?
22:31antares_dnolen_: yes, I just push a few more commits to the same branch and you have them all in the pull request
22:31antares_visible, commentable
22:31antares_that's how we develop travis-ci.org
22:32dnolen_antares_: what if I want them squashed?
22:32antares_submit a PR, people comment, you update it a few times
22:32technomancyor if the approach turns out to be wrong, it's trivial to link from one pull request to another
22:32antares_dnolen_: then you say so and I squash and merge it (not via UI, but still)
22:32dnolen_technomancy: an follow a bunch of links for one conversation
22:32dnolen_antares_: technomancy: pull request are fine, but they are not "awesome"
22:32antares_dnolen_: but we probably have squashed only 2 PRs in 1.5 years of development
22:32antares_dnolen_: and unlike patches, we have CI integration for pull requests
22:33technomancydnolen_: compared to "attach a patch to a jira issue", they are amazing.
22:33antares_each push in a PR results in a build
22:33antares_and trivial issues like doc corrections or other trivial things are 2 weeks of work
22:33antares_someone found an issue, reported it, submitted a PR, someone merges it, done
22:34SgeoHmm, if I make a patch for assoc-in to use loop/recur, does it have a reasonable chance of making it in?
22:34antares_neo4j uses both CA and pull requests
22:34antares_seems to work for them
22:34dnolen_technomancy: for you're definition of "awesome", OK
22:34SgeoEven if it solves a problem that people might not have?
22:34dnolen_antares_: I get patches from people of varying levels of familiarity with git, Clojure ticket process etc.
22:34antares_dnolen_: sounds like clojure/core is optimizing for 1% of the cases
22:34antares_completely alienating the 99%
22:34dnolen_antares_: people come and go, people forget stuff
22:35antares_dnolen_: face it, most of active contributors are the same small group of people
22:35antares_for CLJS this is certainly true according to the log
22:35dnolen_antares_: probably 20-30% of patches are worth amending.
22:35antares_and they probably have no problem with git
22:35dnolen_antares_: no
22:35technomancynobody understands the Clojure ticket processes
22:35dnolen_antares_: they come and they go.
22:35technomancyexcept _possibly_ Andy Fingerhut
22:35dnolen_haha
22:35SgeoWho's Andy Fingerhut?
22:36technomancyThe Man who Conquered Jira
22:36technomancyor possibly The Man who Jira Tricked into Thinking He Had Won, only to be Torn to Pieces once His Guard Was Down
22:36technomancyonly time will tell
22:36antares_dnolen_: this graph suggests something different https://github.com/clojure/core.logic/graphs/impact
22:37antares_dnolen_: I don't know, alienating 70% for the joy of reviews of a few people sounds a little odd to me
22:37ohpauleeztechnomancy: "The Man who Conquered Jira" is cracking me up
22:37antares_and I am not the most friendly agreeable maintainer out there, for sure
22:37dnolen_antares_: core.logic & core.match are projects that few people understand the implementation of - I'm not expecting much there ... yet
22:38ohpauleezantares_: That was the point I was going to make ^
22:38dnolen_antares_: this graph is quite different, https://github.com/clojure/clojurescript/graphs/impact
22:38antares_dnolen_: ok, for CLJS, fair enough. I applaud the patience of CLJS contributors.
22:38ohpauleezcase 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:39antares_I am curious how the CA stuff and all will go if someone wants to fork Clojure
22:39antares_rename it, keep the license, scrap JIRA and patches and just use github, like normal projects do
22:39technomancyantares_: it'll play out like xemacs; patches can flow only in the direction of the fork, but not back
22:40antares_technomancy: I mean, it will have to be renamed, what else? no use of the same logo. Anything else serious?
22:40technomancygranted xemacs is basically dead now, but only because they made GNU open up their development policies
22:41dnolen_antares_: I can't imagine it would last very long or generate much interest.
22:41antares_dnolen_: I don't know. You know, if the maintainer will actually document things and make contributors welcome.
22:41ohpauleezantares_: 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:42dnolen_antares_: for your version of "document things" and "make contributors welcome"
22:42antares_ohpauleez: the language will very much stay the same
22:42antares_dnolen_: for most of Clojure developers' version
22:42ohpauleezAssuming you have a CA in, there is absolutely no trouble getting changes in or suggesting something new
22:42antares_dnolen_: cause you know, only clojure.core argues that the process is pleasant
22:42technomancyohpauleez: seriously?
22:42ohpauleeztechnomancy: yes, for real
22:43technomancyit sounds like you have been very lucky
22:43amalloyohpauleez: are you talking about clojure, or some other language?
22:43technomancyor perhaps you work for Relevance?
22:43antares_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:43xeqiI thought the weekly emails started because there were patches that were languishing
22:43ohpauleezthe 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:44ohpauleezhow is any of that hard
22:44amalloyohpauleez: the "wait" step is hard, because it's non-terminating
22:44antares_ohpauleez: on any step of the way, your chances of being ignored are non-trivial
22:44amalloythe past month or so it's actually been a lot better, but i still have patches sitting around for over a year
22:45antares_dnolen_: because things are better understood in comparison, and many potential Clojure contributors actually have something to compare the process with
22:45ohpauleezamalloy: So let's solve the real problem then - getting patches screened and applied
22:45dnolen_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:45technomancyohpauleez: you and I can't solve that problem
22:45antares_dnolen_: the entire thing
22:45technomancyeverything needs the approval of one person
22:45antares_dnolen_: the "we know better" part
22:46technomancythere's no delegation happening
22:46antares_dnolen_: the "submit a patch and wait for 11 months" part
22:46antares_dnolen_: the "oh that effort won't go very far" when a fork discussion comes up
22:46devnspeed is not the issue in my opinion
22:46dnolen_antares_: so you would prefer that patches that aren't going to move forward get rejected outright immediately?
22:46antares_dnolen_: the "pull requests suck" part when the majority of OSS uses them and likes them
22:46amalloytechnomancy: 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:46dnolen_antares_: you like generalizations :)
22:46ohpauleezdevn: what's your major issue?
22:46antares_dnolen_: for sure. Not giving people hope is better than asking them to wait for 11 months.
22:47technomancyohpauleez: 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:47RaynesTheBusby: Huh?
22:47ohpauleezamalloy: I agree, Andy has done an awesome job
22:47TheBusbyRaynes: had a lazybot question
22:47RaynesOh.
22:47RaynesSure, shoot.
22:47dnolen_amalloy: agreed about Andy's work
22:47RaynesYou've got 6 seconds.
22:47Raynes;)
22:47SgeoI guess a small implementation change like fixing assoc-in will take forever or just get ignored
22:47antares_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:48amalloySgeo: write the patch first. you'll find you can't (usefully) make assoc-in tail-recursive
22:48TheBusbyadding a ton of plugins, but for some like twitter/yammer/etc they need to output with no specific trigger
22:48antares_dnolen_: they LOVE pull requests. Nobody has asked us to adopt JIRA, CA and patches.
22:48TheBusbyRaynes: so when a tracker twitter account posts, lazybot just dumps the post into the channel without prompting
22:48antares_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:48ohpauleeztechnomancy: So your proposal is that we add more gate-keepers? Or something else?
22:48antares_they just don't want to talk about it here because they feel like giving up
22:49RaynesTheBusby: Look at the Github plugin. We do that there.
22:49technomancyohpauleez: 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:49TheBusbyRaynes: perfect, that's just what I needed to hear! Thank you again for the software and help
22:49RaynesTheBusby: Consider contributing the yammer plugin. I'd be interested in seeing it.
22:49antares_dnolen_: maybe that speaks loud enough to consider. The OSS community widely uses pull requests and a significantly more open, respectful process
22:49ohpauleeztechnomancy: I totally agree - but what are you proposing we do to adjust the current flow?
22:50ohpauleezI wonder if david nolen has turned off his speakers/headphones or shut off ping yet
22:50antares_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:51technomancyohpauleez: 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:51TheBusbyRaynes: forked and pushed the youtube plugin to github last night, need to clean up the other plugins though http://bit.ly/NTqJFR
22:51ohpauleezantares_: Are you going to the conj?
22:51dnolen_antares_: sounds like it's time for you to sign your CA and voice your opinion on clojure-dev ;)
22:51technomancyI just think it's weird that there are other people outside /core that don't find it frustrating and broken.
22:51ohpauleezI was JUST about to say that
22:51antares_ohpauleez: in fact, eliminate the entire clojure/core notion. Let x10 as many people cast their votes.
22:52antares_I am not convinced a group of Relevance employees are the best engineers on the planet
22:52antares_Rich Hickey's last word is reasonable
22:52ohpauleezantares_: core is only a business entity, they are not dev
22:52antares_ohpauleez: I don't. I live on the other side of the world.
22:52antares_ohpauleez: they are the gatekeepers
22:52ohpauleezthey just help out by admin'ing jira and the mailing list
22:52antares_however they are called this week
22:53antares_dnolen_: they whole notion that I need to mail a CA to suggest something is stupid
22:53antares_dnolen_: limiting, shortsighted
22:53antares_I don't know any other popular OSS project that is a few years old that uses it
22:53RaynesI had this argument a long time ago.
22:53devnohpauleez: 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:54technomancyRaynes: then you became cynical and bitter like me? =)
22:54RaynesI was mostly called shortsighted myself and I just gave up, antares_.
22:54antares_Scala does not, JRuby does not, NoSQL data stores do not, Kotlin does not
22:54Raynestechnomancy: Yeah, actually. I think I might have. :\
22:54ohpauleezdevn: I definitely agree with that. It's hard to adjust the system for different levels of involvement and patches
22:54devnohpauleez: I think there's value in it being baroque, ugly process
22:54devnbut in other worths I think it's abhorrent
22:55devns/worths/ways
22:55TimMcWhat if antares_ secretly emails me a signed PDF that is CA-like, emails me patches, and I submit them to JIRA?
22:55ohpauleezTimMc: That's totally fair
22:55TimMcAnd would totally be rejected.
22:55dnolen_antares_: you have strong opinions about it.
22:55TimMcOr... would it? Can't be right.
22:56dnolen_antares_: maybe you'll actually prove me wrong and do something about it.
22:56RaynesWhat can he do about it, dnolen_?
22:56antares_dnolen_: why the heck should I prove somebody wrong? Your community is telling you, this process is broken
22:56antares_dnolen_: how many people other than you and maybe ohpauleez defend the process in here? 0
22:56antares_how many people agree there is a problem? certainly more than 2
22:57dnolen_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:57TheBusbyMany contributors in OS use pseudonyms anyways to avoid legal entanglements which isn't legal to begin with...
22:57antares_dnolen_: because The Elders don't pay attention to clojure, I have no illusions about that
22:57antares_they play in their clojure-dev sandbox
22:57technomancymy friend mentalguy (who rewrote parts of the ruby threading implementation) gave up because the CA doesn't let him submit under a pseudonym
22:57SgeoI tend to use pseudonyms because I grew up being told never to put my name online
22:57ohpauleezHas anyone asked RH what would be acceptable, legally, in place of the physical CA? OAuth + SSH public key perhaps?
22:57SgeoI kind of regret that at times
22:58dnolen_antares_: huh ... that's not my impression. The Stuarts are there.
22:58antares_…and mentalguy is a hell of a hacker
22:58antares_dnolen_: yeah? how long has it been since they've discussed anything with the community?
22:58FrozenlockSgeo: Why? What would you have gained by using your name?
22:58pandeiropardon my ignorance and naivete and whatnot but could clojure itself ever be forked? just asking, i admit not even having read the epl
22:58antares_dnolen_: once every 2 months?
22:58SgeoFrozenlock, my name would have been in the Wall Street Journal once
22:58antares_dnolen_: clojure.data.json is undergoing breaking changes, I did not see a single discussion of that on the clojure ML
22:59ohpauleezantares_: How would you propose they discuss things with the community? We are the community, we're discussing it right now
22:59TheBusbytechnomancy: he's more respectable than a number of others I know who just sign with fake info.
22:59ohpauleezwe're the instruments of change
22:59RaynesI imagine you can fork Clojure. You can also destroy the world too, but that doesn't help people either.
22:59dnolen_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:59antares_ohpauleez: at least come out and say "hey, we are doing this, at least be aware of ti"
22:59SgeoMy name would also have been in some Paranoia supplement book
22:59antares_ohpauleez: but instead library authors will have to such it up when the next version comes out
22:59devnohpauleez: 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:00antares_no warnings, no explanations, just get this completely incompatible changes to a contrib library
23:00antares_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:00ohpauleezdevn: 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:00pandeiroRaynes: ok could the alternative implementation be called 'open-clojure' for its play-on-wordiness? :)
23:01antares_ohpauleez: does that sound like what clojure/core is doing on the clojure ML? maybe on clojure-dev, I cannot subscribe to it
23:01RaynesMan, don't even talk about forking Clojure.
23:01pandeiroi am not serious in the least, sorry
23:01RaynesIf this language turns into Arc, I might just go be a fireman or something.
23:01Raynes:p
23:01antares_Raynes: elixir. There is still elixir :)
23:01dnolen_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:01ohpauleezantares_: Clojure ML these days is mostly library and help related. It's most certainly a community portal
23:02Raynesantares_: Even Jose makes me mad sometimes. :P
23:02ohpauleezproposals for contributions come up all the time on dev
23:02dnolen_antares_: contrib is generally it's own can of worms since each project has it's own maintainer.
23:02ohpauleezand we all collab on it
23:02antares_dnolen_: I complain about that once every few months, being told I am not nice, then the issue comes back
23:02ohpauleezIf you look, there's a great thread on how to answer the "reactive" piece for CLJS
23:02dnolen_antares_: on the ML?
23:02antares_ohpauleez: exactly! and The Elders are nowhere to be found on that portal.
23:03ohpauleezthere are blog posts for the work being done on CLJS, ClojureScript-Lua, Android, Clojure optimization, core.logic
23:03antares_ohpauleez: honestly, who gives a shit about ClojureScript-Lua?
23:03antares_compared to clojure.org documentation, the core JVM clojure changes or contrib libraries
23:03devnDude, that's someone's project.
23:03antares_oh, clojure.org documentation
23:04ohpauleezantares_: When someone proposes a real implementation, if it involves Clojure Core, RH contributes. Otherwise, the community takes it upon itself to police itself
23:04ohpauleezI'm AMPED on Lua as a backend
23:04antares_devn: I am sorry but this is exactly what I am saying : clojure/core is optimized for making clojure/core happy
23:04ohpauleezand I agre with devn, please be respectful
23:04ohpauleezno one here has said your ideas are wrong or aren't worth discussing
23:04ohpauleezplease don't say someone else's are total shit
23:04antares_the rest of CLojure users have to live with clojure.org docs, clojure/core contrib process, breaking contrib lib changes, etc
23:05ohpauleezantares_: someone was fed up with clojure.org docs and made clojuredocs.org
23:05ohpauleezwe're just going on tangents
23:05antares_ohpauleez: while in the Scala world someone made docs.scala-lang.org
23:05Sgeoclojredocs needs to be fixed.
23:05antares_and docs.python.org in another community
23:06ohpauleezso you just want it to be a sub-domain?
23:06ohpauleezClojure is young
23:06ohpauleezwe'll get there
23:06antares_and they were not pushed through patches and 11 months of waiting
23:06devnSgeo: what do you think? a rewrite or patches?
23:06ohpauleezit wasn't until a year ago that PyPy had a python related address or email
23:06devnSgeo: or better content organization? or?
23:06antares_the level of interest in improving clojure.org kinda speaks for itself
23:06Sgeodevn, searches for a thing should list exact matches first
23:06ohpauleezantares_: What is the level of interest?
23:06antares_exotic projects take all the time
23:07antares_bare essentials like docs are ignored
23:07ohpauleezagreed, this just came up on the Clojure ML today
23:07antares_ohpauleez: not a priority?
23:07devnSgeo: are you interested in building a new clojuredocs?
23:07SgeoNo, just interested in fixing the current one
23:07devnSgeo: sorry if that came off as antagonistic, im just genuinely curious
23:08antares_ohpauleez: the first thing I tell clojure newcomers is "don't use clojure.org for anything"
23:08devni 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:08devnantares_: aww, that's not totally fair
23:08devnclojure.org has a lot of deep info, but for newcomers it's jump into freezing water
23:08antares_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:09devnbut then again, only for some newcomers
23:09devnfor other "newcomers", clojure.org is what the doctor ordered
23:09devnit's a lisp manifesto
23:09antares_devn: again, optimizing for a handful of The Elders
23:09ohpauleezSo 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:09antares_anyway
23:09antares_I have to such it up and go write some more clojurewerkz.org guides
23:09antares_there is next to no interest in fixing the system
23:10antares_cool with me
23:10devnantares_: maybe, I'm not denying what you're saying doesn't exist
23:10antares_most of active users had given up
23:10devnI'm just suggesting maybe The Elders are a necessary bunch?
23:10SgeoWell, ok. I'm mostly a Haskell oriented person
23:10dnolen_antares_: I'm not sure that's true. Alex Miller and others got rights to clojure.org in order to help.
23:11ohpauleezantares_: and last Conj we addressed some of these and made improvements. I suggest this Conj will make further improvements.
23:11ohpauleezWe're young, nothing is perfect, and anyone can change anything if you really want to and are committed to putting the effort in
23:11antares_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:11ohpauleezantares_: Is my list sufficient?
23:12antares_dnolen_: while esoteric projects (sorry, important projects some people care about) get so much attention
23:12devnantares_: that's a bit unfair, dude.
23:12ohpauleezagreed
23:12Khaozhumm.. good to know about clojurewerkz :)
23:12ohpauleezand also, doc and site changes often get merged immediately
23:12antares_devn: as you can see, I am neither fair nor nice
23:12devnantares_: i find that hard to believe
23:12antares_devn: but I have a bunch of other projects that people love
23:13devnthat seems fair to me
23:13devnand nice
23:13ohpauleezantares_: 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:13antares_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:13devnantares_: clojure.org rights are not 11 month stints
23:14devnyou get the ability to change the site
23:14antares_devn: yeah, just 4, right?
23:14antares_good to know
23:14devnyou're just making assumptions now
23:14antares_devn: you know how long it takes to get access to clojurewerkz.org repos?
23:14antares_10 minutes
23:14antares_just prove me you want to work on something
23:14antares_especially if it is doc guides
23:14antares_I merged 3 PRs today
23:14ohpauleezantares_: Can you answer my two questions?
23:14antares_no patches, no JIRA, no CAs
23:15antares_3 releases, also today
23:15antares_users are already using new features, seem happy
23:15ohpauleezIs the list sufficient and if allowed, would you work on clojure.org and clojure proper as hard as you work on ClojureWerkz?
23:15antares_and then CLJ-940, a patch from march, finally broke CI for Monger after being merged last week
23:15antares_ohpauleez: which one, sorry?
23:15ohpauleezsame amount of effort, same amount of polish
23:16ohpauleezSo 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:16ohpauleezantares_: ^
23:16ohpauleezwould that be a start?
23:17devnantares_: 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:17ohpauleezleaving serious contributions to core in the old process, and still using the new contrib process (which I think is very collaborative)
23:18antares_ohpauleez: that list outlines all the top issues Id' say
23:18antares_back to me working on clojure.org, no, after this discussion with dnolen_, I am not going to work on clojure.org
23:18antares_why would I?
23:18ohpauleezto make it better
23:18devnOr rather antares_: I don't think you've *told* the community what sorts of changes you intend to make.
23:18antares_I'd much rather work on guides.clojurewerkz.org
23:18ohpauleezto fix the things you see as broken
23:18ohpauleezto help the next person to come along
23:18antares_à la Learn You Some Erlang kind of thing
23:18devnantares_: collaboration is good, friend.
23:18antares_it will use pull requests and stuff
23:19antares_and nothing will get in my way
23:19devnlol
23:19ohpauleezwould you merge the clojurewerkz guides into werkz.clojure.org if given the opportunity?
23:19devnI'm sorry, but that's what a villain says in a Scooby Doo episode:
23:19ohpauleezallowing you to manage it as desired
23:19devn03:15 < antares_> and nothing will get in my way
23:19devn"If it wasn't for you pesky kids!"
23:19ohpauleezhahaha
23:19antares_ohpauleez: it is currently all CC 3 licensed
23:20ohpauleezso I could even do that if I ewanted to
23:20ohpauleezassuming I attribute correctly
23:20ohpauleezlet's add that to the list
23:20antares_ohpauleez: if someone wants to reuse anything that is or will be part of clojurewerkz.org, bless them
23:20ohpauleezCollect all CC 3 licensed works around Clojure, unify them, and make a solid doc central of them
23:20antares_devn: :)
23:20ohpauleezperfect, 5 things, that's a solid list
23:20devnAgain 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:21ohpauleezI'll email the both lists tomorrow morning
23:21ohpauleezfair enough?
23:21antares_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:22dnolen_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:22antares_devn: why would I spend my time explaining that things are broken rather than writing docs and developing libs?
23:23ohpauleezantares_: 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:23devnantares_: for the next person
23:24wmealing_no point whining about things,if people cared, it would have already been changed
23:24wmealing_do the work and move on
23:24antares_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:25antares_devn: clojure.org and clojure itself is as inefficient as it gets right now
23:25antares_in this sense
23:25antares_even though yes, everybody who uses clojure, well, uses core clojure
23:25devnmaximize ROI and shift paradigms through agile synergy
23:25antares_and not everyone uses data store clients we have on clojurewerkz.org
23:25antares_devn: something like that, yes!
23:25dnolen_...
23:26antares_I don't know how committed you have to be to clojure to go through all this
23:26Sgeocore.unify, umm
23:26SgeoLooks cool, but shouldn't it be part of core.logic?
23:26antares_while you have other options that are 0 friction
23:26dnolen_Sgeo: it predates core.logic as a contrib
23:26ohpauleezhe beat me to it
23:27devnhey dnolen_, conj this year I hope?
23:27dnolen_devn: yes!
23:27ohpauleezI'm so amped for it
23:27dnolen_devn: you going to StrangeLoop?
23:27devn:X So sad to say no.
23:27ohpauleezantares_: Just out of curiousity, what's the biggest F/OSS project you've contributed to or managed?
23:28ohpauleezboth in terms of public adoption and corporate adoption (or corporate investment)
23:28zenoliUgh, slime is hanging emacs with great consistency. It's acting really flaky with even moderate levels of output from swank-clojure. Known issue?
23:28devndnolen_: I'm going to need you to hug the Clojure contingent for me since I can't be in attendance.
23:29devndnolen_: *Serious Look*
23:29antares_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:29ohpauleezantares_: hahaha, I didn't mean it to be taken that way, I was just curious
23:29antares_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:29devnSgeo: Oh yeah? Whatcha thinking about?
23:29dnolen_devn: man that stinks! it's gonna be xtra awesome this year!
23:30devndnolen_: I know :( Le Sob. Le Sigh.
23:30ohpauleezantares_: For sure, the docs make all the difference. Again, this JUST came up on the ML today
23:30devndnolen_: do you have special guests yet this year for the conj? ;)
23:31devnI feel like after last year you need to bring back Turing as a hologram to give a lecture
23:31dnolen_devn: I'm pretty sure Dan & Will will be there again. They have some cool stuff to talk about I think.
23:31SgeoWell, 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:31dnolen_devn: well actually I KNOW they have cool stuff to talk about :)
23:31Sgeo*perhaps a run-time check
23:32SgeoEven if it ends up merely being earlier at run-time
23:32ohpauleezantares_: 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:32devnExcited to hear that! Huzzah!
23:32SgeoStuff that can be statically checked should, stuff that can be only detected at runtime should still be detected as soon as possibly
23:32ohpauleezthe ClojureWerkz docs and guidebooks speak for themselves. That's what we, as a language/project/community need more of
23:32Sgeo*soon as possible
23:32ohpauleezthere's no doubt about that
23:33ohpauleezbut it takes many hands to make the work doable
23:33devnit takes some trust as well
23:33ohpauleezagreed
23:33bobbywilson0not sure why I'm getting this exception
23:33bobbywilson0,(map #(map Integer/parseInt (clojure.string/split % #"\s")) (#(clojure.string/split-lines %) "01 02 03\n04 05 06"))
23:33clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: parseInt in class java.lang.Integer, compiling:(NO_SOURCE_PATH:0)>
23:33ohpauleezand a little suffering
23:33ohpauleez:)
23:33SgeoPerhaps the "type" of a function could be specified by a function, that gets run at the static checker
23:34bobbywilson0ohpauleez: were better exceptions part of that list? ;) jk
23:34dnolen_Sgeo: have you looked at Typed Clojure?
23:34Khaozso, (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:34ohpauleezhaha bobbywilson0 They're always on that list
23:34Sgeodnolen_, no, although I've heard of Typed Racket and that Typed Clojure is being based on it
23:35ohpauleezbobbywilson0: I'm going to dig into your issue right now, but if memory serves me right, you can't map a method
23:35bobbywilson0ah ok
23:35bobbywilson0ohpauleez: I appreciate it
23:35ohpauleeztry wrapping parseInt in: #(Integer/parseInt %)
23:35antares_Khaoz: that means clojure.string/reverse shadows clojure.core/reverse for you namespace. Use :use with :only (recommended) or (:refer-clojure :exclude [reverse])
23:35xeqi&(map #(map (fn [x] (Integer/parseInt x)) (clojure.string/split % #"\s")) (#(clojure.string/split-lines %) "01 02 03\n04 05 06"))
23:35lazybot⇒ ((1 2 3) (4 5 6))
23:35dnolen_Sgeo: worth looking at if static typing + Clojure interests you
23:36bobbywilson0xeqi: ding ding ding! thanks :)
23:36xeqilooks like others explained it
23:36ohpauleezbobbywilson0: xeqi The power of community
23:36bobbywilson0ohpauleez: word
23:36ohpauleezSgeo: You could also find such things with dynamic checking - as part of the compilation process
23:37Sgeo<Phantom_Hoover> try asking them if O(ln n) is equivalent to O(log_32 n).
23:38Sgeo(PH has had a bad experience with this channel, with people giving the wrong answer. So, what's the answer?)
23:39duck1123isn't log32 n better?
23:39mpanI think I'm accidentally trying to consume an infinite seq somewhere
23:39mpan:(
23:39Khaozantares_: thanks.
23:40Khaozi 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:40ohpauleezduck1123: log32 n of the biggest n supported by the JVM in the data structures - is 7
23:40ohpauleez:)
23:40ohpauleez7 is a small number
23:41Sgeoohpauleez, but is O(log_32 n) the same or different from O(ln n)?
23:41ohpauleezSgeo: different
23:42Sgeo...
23:42SgeoIs O(2n) the same or different from O(n)?
23:42dnolen_Sgeo: textbook same - in practice could be more different.
23:42dnolen_couldn't be
23:42mpanwait, is it somehow bad to call shuffle on the result of range?
23:42ohpauleezdnolen_: 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:42xeqimpan: if its infinite
23:42duck1123if I remember my math, isn't log32N = ln(N) / ln(32)
23:43mpanrange gives finite seqs doesn't it?
23:43ohpauleezSgeo: Ohh in terms of big o complexity
23:43mpan,(range 1 10)
23:43clojurebot(1 2 3 4 5 ...)
23:43ohpauleezyeah, nolen's answer
23:43xeqimpan: if you give it an end
23:43mpanI did
23:43Sgeoduck1123, yes
23:44xeqi,(shuffle (range 1 3))
23:44clojurebot[2 1]
23:44mpan,(take 10 (shuffle (range 1 100)))
23:44clojurebot(27 31 45 24 53 ...)
23:44mpanhuh
23:44mpanhow did I just hang my repl doing that?
23:44cgagwhat's ln of the largest n on the jvm?
23:46TimMccgag: Largest Long? BigInteger?
23:46mpan,(->> (range 100) shuffle (take 10) doall)
23:46clojurebot(70 84 98 85 76 ...)
23:47cgaglooks like 43
23:48cgagTimMc: "ohpauleez: log32 n of the biggest n supported by the JVM in the data structures - is 7"
23:48mpanidk what I'm running, I thought it was that, but whatever it is hung the repl and eclipse
23:52devn,(range 10 0 0)
23:52clojurebot(10 10 10 10 10 ...)
23:59SgeoAre lazy sequences of I/O stuff generally discouraged?
23:59SgeoSuch as a lazy sequence of lines in a file
23:59SgeoI know they're frowned upon in Haskell