#clojure logs

2013-02-25

02:17marianoguerraactions are run on agents in the order they are sent right?
04:11nicholasfhi. I'm trying to decide whether to use clojure to hack on a prototype for a startup Im thinking about
04:11nicholasfthis isnt trolling - just wondering about the clojure is slow problem
04:12nicholasfis anyone really hitting this in production level apps? Is it biting anyone?
04:13vijaykiranhow did you get the impression taht clojure is slow :) ?
04:13nicholasfjust from googling on it
04:13pwnedI wish I used clojure for this one
04:13nicholasfthere's a benchmark site which compares a lot of operations
04:13nicholasfclojure doesn't do well
04:13nicholasfaltho, that doesnt quite make sense given the existence of things like storm, etc.
04:14pwnednicholasf: what is it compared to ?
04:14clojurebotTitim gan éirí ort.
04:14nicholasfhrm, I'm taking it no one has been bitten by this problem
04:14nicholasfthat's the easiest way to resolve this
04:14nicholasfpwned: I'll try to dig up the URL
04:14TheBusbynicholasf: for many bits clojure is fairly slow compared to C/C++
04:14TheBusbybut clojure allows you to use more available cores more easily, so it balances out depending on what you're doing
04:14TheBusbyit makes distributed computing *MUCH* easier too
04:15nicholasfTheBusby: yeh that's cool
04:15nicholasfI want to use the JVM as I'm building an app that sells security
04:16TheBusbyI think the only way to be sure it suites your needs is to prototype something at test it yourself
04:16nicholasfTheBusby: Ive made a simple noir app before
04:16vijaykirannicholasf: performance depends on various factors, so the you may need to try out and find the bottlenecks
04:16no7hingnicholasf: you probably mean this one? http://benchmarksgame.alioth.debian.org/
04:16nicholasfif people arent hitting major problems with slowness issues it seems like a decent pathway for me
04:16TheBusbyif you're doing web apps, then I don't think performance will be an issue
04:16nicholasfno7hing: yup
04:17nicholasfTheBusby: Im doing web apps with a lot of encryption
04:17TheBusbyif you can separate out the encryption bit, that shouldn't pose a problem
04:17TheBusbyeither call it via JNI, or proxy through NGINX
04:19clgvnicholasf: in my code a solution to a N=100 customer vehicle routing problem is constructed in 6ms the whole optimization runs 6seconds. I'd say that's pretty much usable ;)
04:20clgvthough the solution representation is not completely mutable
04:20clgv*not completely immutable
04:25kanzurehi there. i have a class file (Gb.class) that i want to import. i have put it into a directory that is in $CLASSPATH and i call (:import Gb) but get "CompilerException java.lang.RuntimeException: Unable to resolve symbol: Gb in this context, compiling:(NO_SOURCE_PATH:6)". what am i doing wrong?
04:43clgvkanzure: what is the package of `Gb`?
04:44kanzureclgv: its com.aurellem.gb (so com.aurellem.gb.Gb)
04:44kanzureclgv: i have Gb.class and a gb-drivers.jar file (which contains com/aurellem.gb/Gb.class)
04:46kanzureoh oops. i was adding the folder to my $CLASSPATH instead of the path to the jar itself.
04:57clgvkanzure: well your class file needs to be in the folder hierarchy your package declares
04:57clgvso dir-on-classpath/com/aurellem/gb/Gb.class
05:11kanzureclgv: and then call (:import com.aurellem.gb.Gb) ?
05:12clgvkanzure: exactly
05:13clgvkanzure: it is the same procedure as it is in java except the import statement has lisp-flavor and does not support ".*"
06:56michaelr525hello
07:26ciphergothMy macro fu isn't up to this job, but wondering if someone's already done it: I had this idea that I could maybe write a macro such that I could replace a given "defn" with eg "defn-pprint", and the result would be that every time that function was called, its params and result would get pretty-printed
07:26ciphergothDoes that sound very hard?
07:28hugodciphergoth: https://github.com/clojure/tools.trace
07:28ciphergotha-ha! thank you!
08:16yediis clj-stripe the only clojure library for stripe?
09:45znDuffCan I get some feedback on Marick's "Functional Programing for the Object Oriented Programmer"? Is it useful for someone who's actually been doing Clojure in production for a few years, or more strictly beginner-centric?
10:12frenchypznDuff: The book is for FP beginners. It uses a clojure but only what you would learn in a 10 minutes tutorial, so it is really not a book to learn advanced clojure
10:14frenchypas for FP, it explains concepts clearly and consisely, starting from nothing and reaching monads
10:14florianover@frenchyp which book are you talking about?
10:15frenchypit also presents OO concepts starting from scratch and ending in a complete system
10:15frenchypFunctional Programing for the OO Programmer, responding to znDuff question
10:15florianoverk thx
10:17frenchypflorianover: np
10:18frenchypso, book is 50% OO, 50% FP, both presuming no knowledge. I am happy I bought it
10:26aroemers~logs
10:26clojurebotlogs is http://clojure-log.n01se.net/
10:38daviddparkI have been tasked with creating a hypermedia API in a shop that is very python centric, but I am trying to introduce the team to Clojure. To that end, I really like what I am reading about the liberator project, but am having some difficulty in getting the examples to work properly. If there are any folks who have worked with Liberator out there. I have recently cloned the clojure-liberator project and simply run "l
10:38daviddparkein examples" from the top level directory. I can get some of the examples to work, such as hello-world and hello-george, but when I attempt to do anything with olympic athletes, I am seeing "UnsupportedOperationException: nth not supported on this type: Character (representation.clj:58) Anyone have a couple of minutes to help me troubleshoot and get the examples working properly?
10:45a|iwhat's the up to date setup for starting clojure with emacs?
10:45a|igooglng brings up many out of date stuff.
10:46a|ieg, is clojure-mode dead now?
10:46frozenlocka|i: use nrepl.el and clojure-mode.el. That's about it.
10:46jeremyheilera|i, clojure-mode and nrepl.el
10:47a|iwhat's swank then?
10:47jeremyheilernrepl.el replaced it
10:47jeremyheilerfor clojure
10:47florianoversee http://clojure-doc.org/articles/tutorials/emacs.html
10:48nilbertnrepl also plays quite nicely with leiningen, just user M-x nrepl-jack-in
10:48a|iok, what's slime then?
10:49nilbertI think both swank and slime are being phased out, nrepl replaces them
10:49nilbertI also personally use rainbow-parens and paredit-mode, but YMMV
10:49frozenlocka|i: swank and slime are being replaced by nrepl and nrepl.el :p
10:49znDuffa|i: personally, I tend to use emacs-live
10:49znDuffa|i: ...that way you have a single package to download that tracks all the current/modern bits.
10:49florianoverslime is the emacs mode for common-lisp
10:50a|iso, nrepl = the new slime+swank?
10:50frozenlockyup
10:50nilbertif you want to have autocomplete, then ac-nrepl is worth checking out
10:51znDuffa|i: ...well, nrepl+nrepl.el ~= new slime+swank
10:51a|iznDuff: emacs-live is a like a package manager that keeps nrepl up-to-date?
10:51znDuffa|i: rather, it's a bundle that includes everything you need to be productive working with Clojure in Emacs.
10:51frozenlocknilbert: wait... doesn't nrepl already auto complete?
10:51znDuffa|i: ...including paredit, nrepl.el, clojure-mode, and much much else.
10:52znDuffa|i: See https://github.com/overtone/emacs-live (and, optionally, videos linked from same).
10:52nilbertnot sure if it does nowadays, but when I started using it it didn't
10:52a|iznDuff: is that nice and light 'much much more', or bloated 'much much more'? :)
10:52znDuffa|i: That's a matter of personal taste, isn't it?
10:52znDuffa|i: It makes me happy, though.
10:53a|iznDuff: I'll give it a try now :)
10:53a|iah one more thing, how is light table compared with emacs?
10:53a|iI know it's not mature yet..
10:53znDuffa|i: Light Table is very nifty/promising, but not ready to be a day-to-day editor yet.
10:53frozenlocknilbert: nvm, it's not the same thing.
10:54a|iznDuff: what sort of target does light table aim for?
10:54znDuffa|i: What it aims for is a larger discussion. What it is right now is a decent platform for experimentation -- if I were teaching someone Clojure who didn't know the language, for instance, it's what I'd start them on.
10:55znDuff...but when they started doing real work, it'd be over to Emacs.
10:55a|iznDuff: makes sense.
10:56hashbang1a|i: the instarepl in lighttable is a great way to learn about clojure, but gets annoying when you want to write something non-trivial. its also still very new, new minor releases are coming out all the time for it
10:57a|ihashbang1: I guess light table would be functional maybe a year from now.
11:18johnmn3g'day
11:41ipostelnikanyone using lein with Jenkins/Hudson? If so, how do you make dependent projects build in right order?
11:42no7hingipostelnik: don't you configure that in jenkins itself?
11:45znDuffHmm; automating the Jenkins setup to sync from the dependency tree might be fun.
11:46znDuff...actually, I have an internal bug that would be fixed by modeling a flattened topological sort of our dependency order into Jenkins. *ponders*.
11:46znDuffipostelnik: ...btw, how's life treating you these days? It's been a while.
11:47ipostelnikznDuff, maven3 plugin does that
11:47znDuffipostelnik: Ahh. We're an Ivy shop, so it's not so handy locally.
11:47znDuff...but looking at the implementation might be worthwhile.
12:20bordatouehello could anyone tell which is the widely used library to deal with SQL in clojure
12:22znDuffbordatoue: well, everything uses clojure.java.jdbc, since that's what the available mapping layers backend into.
12:22znDuffbordatoue: of those mapping layers, Korma has some popularity, but IMHO it's pretty awful.
12:23bordatoueznDuff: which one would you prefer?
12:23znDuffI built my own mapping layer on clojure.java.jdbc. Not released, and probably shouldn't be, since it's just good enough for my own usage and nothing more.
12:24znDuff...but it's a lot less awful that korma (which, owing to overuse of macros, is very hard to compose with)
12:24znDuffs/that/than/
12:24frozenlockInteresting... a government services that has a < 16 characters password limit. Be afraid, be very afraid.
12:24TimMcBanks do that *all the time*.
12:24akhudekfrozenlock: be happy it's not 4 digits
12:25frozenlockDoesn't that tell you that they don't hash the password?
12:26bordatoueznDuff: what do you think about clojurql , i got some error while loading it
12:28znDuffbordatoue: Haven't looked at it in enough detail to have a strong opinion.
12:28bordatoueznDuff: okay thanks
12:41arrdemis there an equivlaent to cl-yacc for Clojure? I'm just looking for a way to hook a token stream together into an AST.
12:42znDuffarrdem: How does what you're looking for differ from clojure.tools.reader?
12:45arrdemznDuff: haven't used that tools lib before.. I'm writing a Pascal lexer/parser for a class and need a way to build ASTs from a tokenizer I already wrote.
12:46arrdemznDuff: looks like that's just an EDN/Sexpr reader for CLJ.
12:46znDuffAhh.
12:46arrdembelieve me, if I could just use an existing reader I would XP
12:46znDuffHmm; I've looked at available parser generators before, but wasn't looking for yacc compatibility.
12:47arrdemI mean I'm writing mine in clisp (I know I'm a trator burn me later) and a buddy of mine is doing the same thing in Clojure.
12:48arrdemI know I can use their cl-yacc library to define tokens and build ASTs from them, but all I've ever done in CLJ is use fnparse or equivalent to do the AST and lexer in one go
12:51TimMcfrozenlock: It's a fairly strong indicator, yes.
12:52TimMcfrozenlock: I'm annoyed that my email provider doesn't let you go beyond 12 characters. They say it's because they got tired of people losing their passwords...
12:54preyaloneWhat's the Clojure equivalent of Haskell's replicateM ?
12:54preyaloneE.g., Generate N random numbers and return them in a sequence.
12:55znDuffpreyalone: the typical way to do that is something like (take N (infinite-random-sequence))
12:55preyalone,(infinite-random-sequence)
12:55clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: infinite-random-sequence in this context, compiling:(NO_SOURCE_PATH:0:0)>
12:55znDuff...well, yes, assuming that you have such a thing. :)
12:56preyaloneThat begs the question, since I'm trying to IMPLEMENT such a thing.
12:56arrdem,(doc random)
12:56clojurebotGabh mo leithscéal?
12:56znDuffDo you have a call that gives you a single random number?
12:56mpenet,(take 4 (repeatedly (rand-int 100)))
12:56clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn>
12:56znDuffpreyalone: http://clojuredocs.org/clojure_core/clojure.core/repeatedly
12:56preyalone,(rand)
12:56clojurebot0.9065726517372994
12:56znDuff,(take 5 (repeatedly #(rand-int 11)))
12:56clojurebot(4 8 8 1 0)
12:56preyaloneThanks znDuff!
12:56arrdem,(doc repeatedly)
12:56clojurebot"([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"
12:57mpenet,(take 4 (repeatedly rand-int 100))
12:57clojurebot#<ClassCastException java.lang.ClassCastException: clojure.core$rand_int cannot be cast to java.lang.Number>
12:57mpenetgni
12:57preyalone,(repeatedly 3 (rand))
12:57clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Double cannot be cast to clojure.lang.IFn>
12:57arrdem#clojure just turned into a repl again..
12:57mpenet,(take 4 (repeatedly #(rand-int 100)))
12:57clojurebot(19 11 75 82)
12:57mpenetthere!
12:57preyalone,(repeatedly 4 (rand-int 100))
12:57clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn>
12:58preyalone,(repeatedly 4 #(rand-int 100))
12:58clojurebot(50 99 54 19)
12:58preyaloneOooooh no. It's almost like a LISP-2 here.
12:58preyaloneWhy do I need to prefix the rand-int call with a pound?
12:59znDuffpreyalone: ...replicateM doesn't have anything to do with random numbers, does it? Hence, I took the "random numbers" part of the question to be a stand-in for some other function.
12:59Bronsait's a shortrand for an anonymous function
12:59mknoszligpreyalone: because repeatedly takes a function as an argument
12:59arrdem(inc Bronsa )
12:59lazybot⇒ 1
12:59preyaloneznDuff: Correct. random numbers are just a particular application.
12:59preyalonemknoszlig: But I thought Clojure was a LISP-1.
13:00znDuffpreyalone: Where does it look like a LISP-2 to you? I don't see anything about those examples that make it look like there are separate namespaces.
13:00preyalone#(...) constructs a lambda, right?
13:00arrdemyes...
13:00TimMcpreyalone: #(foo %) is (fn [x] (foo x))
13:00mknoszligpreyalone: what does that have to do with it? (rand-int 100) will evaluate to a random number
13:00preyalone!
13:00Bronsapreyalone: you're doing (repeatedly 4 (fn [x] (rand-int 100)))
13:00arrdem# is just a reader macro
13:00yediis clj-stripe the only clojure library for stripe?
13:00TimMcBronsa: Not quite, (fn [] ...)
13:01mknoszligpreyalone: and repeatedly expects a fn as 2nd arg
13:01Bronsayeah, brainfart
13:01S11001001,'#(list 1 % 3)
13:01clojurebot(fn* [p1__412#] (list 1 p1__412# 3))
13:02znDuffyedi: http://www.clojuresphere.com/?query=Stripe doesn't find anything that isn't a fork or branch of it, so probably.
13:02znDuffyedi: You can of course use Java libraries if it's totally unsuitable for some reason.
13:03yedii could have sworn i read about a clojure library that wraps java's lib instead of clj-stripes approach of wrapping the rest api
13:06technomancydoes anyone use clojurescript-mode.el? I think there is no longer any reason to keep it around, but thought I should check first.
13:11preyaloneI see how doseq is good for replacing (doall (map...)) boilerplate, but I think (doall (map...)) is much easier for us to read.
13:12mknoszligpreyalone: you also get argument destructuring with doseq
13:14preyaloneCan I use arbitrary types as keys in hashmaps, or can I only use label-like keywords?
13:15dnolenpreyalone: arbitrary
13:15preyalonednolen: Would :[1 2 3] be a valid key?
13:16dnolen,:[1 2 3]
13:16clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :>
13:16dnolenpreyalone: ^
13:17dnolenpreyalone: keys can be anything, preferably immutable - leading `:` is only for keywords
13:25TimMcpreyalone: You can use [1 2 3] as a key, yes. However, beware of numbers as keys -- the JVM hashes numbers weirdly.
13:25preyaloneTimMc: Such as Integers vs BigIntegers?
13:25TimMcLong and Integer, I think.
13:26TimMc&(assoc {[1 2] "val"} :a-keyword 'some-symbol)
13:26lazybot⇒ {:a-keyword some-symbol, [1 2] "val"}
13:26preyaloneThanks for the warning
13:26TimMcIt's rare to see anything but keywords, symbols, and strings as keys.
13:27TimMcAnd keywords vastly outnumber the others. It's one of the things they're intended for, really.
13:29TimMcpreyalone: If you want keys whose values are not known at compile time, just use strings. You *can* convert arbitrary strings into keywords, but those keywords may not be able to survive a print-read round-trip.
13:29TimMc&(read-string
13:29lazybotjava.lang.RuntimeException: EOF while reading, starting at line 1
13:29TimMc&(keyword "white space")
13:29lazybot⇒ :white space
13:30TimMc&(read-string (pr-str (keyword "white space")))
13:30lazybot⇒ :white
13:30TimMcSome JSON and DB libraries are fond of keyword-izing strings, but it can bite you during debugging (or make debugging a mess.)
13:39lynaghkcemerick: ping
13:54Raynescemerick: Man. Drop support for 1.2.0 in friend. Anybody using 1.2.0 doesn't deserve to use friend.
13:55Raynes;)
13:55cemerickRaynes: I try to help the meek and downtrodden.
13:56RaynesSuch a good samaritan.
13:57technomancyI think I convinced marick to drop 1.3.0 from midje
13:57technomancybut he's doing this crazy thing where leiningen-core is brought into the project JVM itself that I think I don't even want to understand
14:00Raynescemerick: I guess a browserid whateveryoucallitinfriend should be a separate project? I guess I need to write it soon (finally) so I can use that fancy rate limiting middleware properly.
14:01cemerickRaynes: Yes. I'm in the middle of factoring out openid right now, actually.
14:01RaynesI don't understand friend at all, so that should be exciting.
14:01RaynesBecause I've got so much time.
14:01cemerickIt's so absurdly straightforward, you'll cry with joy.
14:02Rayness/ly straightforward//
14:02Rayness/with joy//
14:03cemerickmaybe that, too
14:03cemerickPerhaps I should have named the project 'kafka'.
14:05Raynescemerick: Is it a coincidence that you just said that?
14:05cemerickwe'll never know, now
14:05dgrnbrgIs anyone using the lein-groovyc plugin to mix groovy and clojure?
14:05Raynescemerick: I'm currently working on a Clojure implementation of the Kafka file format for work.
14:06cemerickSomeone named a file format 'kafka'? Perfect.
14:07Raynescemerick: http://kafka.apache.org/
14:08RaynesIt's a messaging system in Scala.
14:08RaynesWhich does a lot of what we want but is mighty complex for our purposes.
14:08RaynesSo we're just stealing the format and idea.
14:09cemerickhrm, I think I heard about this briefly
14:15Raynescemerick: It's my third week at work and I'm writing a database. Send help.
14:25cemerickRaynes: sounds like a good job :-)
14:25Raynescemerick: "Writing a custom codec in gloss is easy. Just reify some shit."
14:25Raynes<3
14:36frozenlockIs https://github.com/overtone/at-at still the goto library when one needs to do things at regular intervals?
14:38Raynesfrozenlock: I've been using it. Pretty nice, I thinks.
14:38RaynesIt's simpler than stuff like quartzite.
14:38RaynesAnd no cron crap.
14:42frozenlockYeah I like very much also;I was wondering if there was any newcomers that stole the spotlight. Apparently there isn't. :)
14:42frozenlockThank you for your input!
14:43devinusif you guys were doing an algebra library and wanted to represent points on a cartesian plane, would you use e.g. [x y] in a vector or create a point defstruct or something else?
14:45frozenlockI would probably settle for a vector.
14:46devinusfrozenlock: my only worry is that a vector is too heavy duty
14:47antares_devinus: I'd start with a vector. I assume points won't be mutated anyway?
14:47devinusantares_: negative
14:47antares_devinus: then why not use an immutable pair that vector gives you
14:48devinusantares_: what do you mean?
14:48devinusright now i'm using [x y]
14:48devinusis there some other immutable pair I'm unaware of?
14:48antares_devinus: no, that's it
14:48devinusah right
14:48antares_vectors only really have overhead over mutable objects if you mutate them
14:48antares_if not, it's perfect
14:49devinusantares_: am i mistaken in believing that the vector won't become a full logn32 or whatever vector if it's just two elements?
14:51hugodis anyone using true, false and nil for three-value logic?
14:51antares_devinus: log32 (n) with 2 elements probably won't be different from O(1) in any real world scenario
14:51Raynes$google three value logic
14:51lazybot[Three-valued logic - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Three-valued_logic
14:52hyPiRionexcept for like the obvious overhead
14:52devinusantares_: right, but i think i read somewhere that it doesn't go log32 until the vector reaches a certain size
14:52RaynesInteresting. I guess this is what I get for not going to college.
14:52devinusmaybe I'm wrong
14:52devinusRaynes: theres still time
14:52antares_devinus: since it's a tree, it should be proportional to the height of the tree http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/
14:53Raynesdevinus: But what's the point when I have wikipedia?
14:53devinusRaynes: not the same :(
14:53antares_Raynes: it's OK, I barely remembered what it is anyway
14:53devinus<- 26 year old college student
14:53devinusantares_: nice thank you
14:53arkhwhy can't a person take x from line-seq? - (defn foo [filename] (with-open [rdr (clojure.java.io/reader filename)] (take 3 (line-seq rdr))))
14:54Raynesdevinus: I also have amalloy_ (when he isn't in Colorado) to teach me these things. He is an excellent teacher.
14:54hyPiRionarkh: because you're reading those lines lazily. Try to wrap the (take 3 ..) within a doall
14:54RaynesI really enjoy learning about computer sciencey things in a work environment.
14:54devinusi want a personal amalloy_
14:54RaynesEverybody should be entitled to one, imo.
14:54RaynesI'm really lucky.
14:55arkhhyPiRion: still seems strange 'take' can't just realize 3 of them as in other lazy sequences
14:55hugodI'm wondering if nil or :undefined would be a better third value
14:55jballancstyle question -- best way to conditionally add key/value pairs to a map? i.e. (let [my-map {:foo "bar"} my-map (if baz (assoc my-map :baz "qux") my-map)])
14:55antares_arkh: take is also lazy
14:55RayneshyPiRion: I've read books where this did not end well.
14:55hyPiRionMe too.
14:55antares_Raynes: honestly, I don't think any college CS education is worth what it costs in the US
14:56RayneshyPiRion: Actually, it was a movie: http://en.wikipedia.org/wiki/Multiplicity_(film)
14:56Raynesantares_: Well, I'm certainly not going to college when I have a great full time job right now and unlimited resources for learning without college.
14:56arkhantares_: I did not know that : / Thank you
14:57antares_Raynes: doing it right
14:57hyPiRionznDuff: I've had a bajillion I think.
14:57RayneshyPiRion: Man, I'm wrong all around. This movie *did* end well.
14:57znDuff...one of those being systems engineering (starting with carnaugh maps and ending with "what data lines do we need to add to this chip before we can implement this new instruction?"), and the other being formal database design.
14:57antares_Raynes: http://media.tumblr.com/tumblr_lqfw3oPpTW1qd0g1t.gif
14:58alv-r-only problem is that companies don't wanna pay you much if you don't have a degree (at least in my country, dunno how it is in the US)
14:58hyPiRionRaynes: Well, you better by my cloning technology then!
14:58hyPiRion*buy
14:58Raynesantares_: http://media.tumblr.com/tumblr_m4m05vgNYO1qk7x97.gif
14:59znDuffalv-r-: Having a degree doesn't make a big difference w/ CS in the US after you've had substantial, verifiable work experience.
14:59znDuff...there are shops that differ, but that's the general rule.
15:00Raynesalv-r-: Most companies I'd actually want to work for don't care much about a college degree and value what I've actually done over it.
15:01RaynesMy github page is right over there. I've done lots of stuff. I still do lots of stuff. And now I even have some work experience. Hopefully I won't have much in the way of problems getting jobs later in life.
15:04frozenlockSchool certification is like the cake. It's a lie.
15:04xeqithere is something to be said about learning about the field from some of the pioneers
15:08jcromartie… clojure.data.zip.xml
15:08jcromartiewas clownpenis.fart already taken?
15:13Raynesxeqi: I met William Byrd and Rich Hickey, dude. :p
15:16znDuff...and going to a school where you're working with people who pioneered the field is, as a rule, bloody expensive. Also, just because someone won a Nobel Prize doesn't make them a competent teacher.
15:17xeqiznDuff: true, luckily for me it was a in-state public school
15:17mpenetif you want to do research in your field, it's mandatory (there are exceptions but it's rare). Depends on what are your goals
15:17frozenlockNot all fields are young enough to have 'pioneers'.
15:17znDuff(Fiancee has a lot to say about that subject, having gone to UofC directly out of high school and finishing paying off loans from same at 39).
15:17technomancy4 years is a ton of time to spend learning; you'll have a lot better chances of rubbing shoulders with pioneers if you bootstrap the learning process yourself
15:18technomancyprovided you have the discipline to actually focus
15:18frozenlocktechnomancy: I wish someone convinced me of this before doing the usual school road.
15:19frozenlockIs that what you're telling your children? :)
15:19mrb_bkdnolen: thanks for the RT love
15:19technomancyfrozenlock: they'll figure it out on their own; we're homeschooling =)
15:20dnolenmrb_bk: np, excellent post!
15:20mrb_bki chatted with technomancy about this in person and it in fact seems like he would be an awesome dad
15:21technomancyheh; thanks =)
15:21technomancywe are having a blast with Scratch; highly recommended for kids at the early stages: http://scratch.mit.edu/
15:22mrb_bkscratch is cool
15:24jcromartieScratch is Squeak!
15:25jcromartienot sure how they get it on the web
15:25jcromartieI guess because they're MIT
15:27Apage43my schoolgoing stopped pretty quick as I was paying for it out of pocket (and therefore working at the time) and I wound up not sleeping enough to do either.
15:34jcromartieI'm about to ditch the fancy XML zipper stuff and just use xpath
15:34jcromartiewould that be wrong
15:35znDuffjcromartie: I don't think anyone would be lining up with pitchforks.
15:37brehautjcromartie: do you know about clojure.data.zip.xml/xml-> ?
15:37jcromartiebrehaut: yes, I'm using that
15:37jcromartieit seems to work well
15:37brehautjcromartie: i've been surprised by it a few times; i was just checking you knew about it before throwing in the zipper stuff
15:38jcromartieI suppose I'll stick with it for now
15:38brehautjcromartie: i found it reasonable for simple stuff, but i can see it getting annoying for more complex stuff xpath does well
15:38jcromartieit's so simple, really, and the fact that it's just been there quiet and mostly unchanged…
15:38znDuffHeh.
15:39jcromartiehmm
15:39jcromartieXquery....
15:39jcromartiewell this app is a middle-man for different feeds (RSS, ATOM)
15:39brehautznDuff: i've always been aware of XQuery, but ive never actually used it. ive always thought that if my xml had got that complicated i had made some bad life choices and needed to reevaluate things
15:39jcromartieI'm practically done with RSS
15:39frozenlockOh god... what have I done...
15:40znDuffbrehaut: I'm rarely working only with my own XML.
15:40frozenlock"ClassNotFoundException clojure.repl java.net.URLClassLoader$1.run (URLClassLoader.java:366)" when trying C-c C-d in the nrepl buffer :(
15:40brehautznDuff: oh for sure, its other peoples xml decisions that always hurt
15:40znDuffbrehaut: In the project where I use XQuery most, I'm pulling in documents from 5 different sources -- three of those in 3rd-party XML schemas, one of them SQL, one of them text over HTTP with my own XQuery code both doing the HTTP requests and generating XML from the output.
15:40Apage43I did succesfully use clojure.data.xml to do streaming parsing of some multi-gigabyte XML files. Directly from the .ZIP files I downloaded them in too :)
15:41Apage43but I had to bake my own xml-> alike among other things to actually do useful things with it
15:41brehautznDuff: im sorry to hear that ;)
15:41znDuffbrehaut: ...anyhow, it makes joining between those only-barely-related documents pretty darned straightforward.
15:41brehautznDuff: thats actually quite interesting
15:42brehautznDuff: In a previous job i had to do some work parsing reuters' financial XML and its a similar sort of monstrosity
15:42brehaut(though less sources, it just looks a lot like a cobol datastructure munged into xml)
15:46meegoflHi
15:46dnolenhrm, the more I think about it more I think extending nil to core prototypes in ClojureScript is a bad idea ...
15:47meegoflhow can i read input from user in loop and perform function on it until recieves "exit"
15:47meegofl?
15:48hyPiRionmeegofl: (doc read)
15:49hyPiRionuse (read stream eof-error? eof-value)
15:50meegoflhyPiRion: 10x!
15:51meegoflhyPiRion: anyway i can do it directly from user? like read-line?
15:51frozenlockdnolen: Is the explanation of this conclusion graspable for mere mortals? :P
15:51meegoflhyPiRion: i can't get read-line to work in loop...
15:52hyPiRionread-line should return nil when there's no input to read
15:53hyPiRionso like (loop [s (read-line)] (when-not (nil? s) (println s))) should probably work
15:53hyPiRionwell, with a recur step of course
15:53brehautdnolen: someone put forth a heuristic that you should only extend protocols to things if you are the owner of one of the thing or the protocol; nil for core protocols would fit that
15:55brehaut(wish i could find a reference)
15:59dnolenbrehaut: to be a bit more clear - I think it OK for user defined protocols and extending those to nil.
15:59brehautdnolen: right, typically though because you own the user defined protocol even though you dont own nil
15:59dnolenfrozenlock: it's a performance issue but it's also a semantic thing, (sequential? nil) => true seems a bit odd
16:03jwr7so, did the old clojure.contrib.seq-utils/separate make its way into something new?
16:03brehaut(conj filter remove) ?
16:03brehautconj? wtf
16:03brehautjuxt
16:03brehautalways juxt
16:05TimMcYou're slipping, man.
16:05brehautsomeone will have to dec me
16:06Raynes(dec brehaut)
16:06lazybot⇒ 9
16:06brehautthanks
16:07jwr7brehaut: right -- this will basically do the same thing. Neat. I was kinda hoping for a nicer solution that would look at each element exactly once and then place it in one of two output bins.
16:07gfrederickswhat do people do about clj-time not automatically hooking into the #inst data reader?
16:07gfredericksshould there be a separate lib that does that?
16:07jwr7... and experience taught me to ask before I go write anything in Clojure myself. Because most of the time, it's been done before.
16:08mpenetodd, there is no boolean? or bool? fn in core... we have string? number? that would make sense no?
16:08TimMcjwr7: I'm sure flatland/useful has something like that...
16:09RaynesI doubt it.
16:09RaynesWe really like juxt.
16:09gfredericksmpenet: yeah, I've hit that a couple times. (partial instance? Boolean)
16:10hiredmanbooleans are a tricky case
16:10hiredmandue to boxing as Boolean
16:10TimMcRaynes: https://github.com/flatland/useful/blob/develop/src/flatland/useful/seq.clj#L26
16:10brehautjwr7: https://github.com/clojure/clojure-contrib/blob/master/modules/seq/src/main/clojure/clojure/contrib/seq.clj#L33-L37 (juxt filter remove) is actually a more elegant implementation than the one in old contrib
16:10gfrederickshiredman: yeah?
16:10hiredmanbetter to just call boolean and make it a good boolean
16:10Raynes$wiki humor
16:10lazybot[Humour - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Humour
16:10RaynesTimMc: ^
16:11mpenetwell boolean and bool? don't do the same thing, and in my case I can't use boolean
16:11hiredmangfredericks: the sane way to deal with boolean boxing would be to cache 2 instances of Boolean, one for true and one for false
16:11hiredmanbut of couse the jvm doesn't do that
16:11jcromartiehow can I get a java Iterator from a vector or seq
16:11TimMcRaynes: Anyway, you'll be happy to know that separate uses decorate, which uses juxt identity.
16:12hiredmanso you can make multiple different instances of Boolean which can break all kinds of weird things
16:12RaynesTimMc: I don't understand half of those bizarre combinator functions in useful. I let amalloy decorate (no pun intended) my code with them when I'm finished if eh wants.
16:12jcromartienever mind
16:12jasonbrayusing shoreleave for the first time and getting a 404 on _fetch, the default rpc uri.. any ideas? handlers seem to be working in general
16:13jwr7brehaut: you are right, it's more elegant. But I think I'll want to write my own 'separate' function anyway, one that traverses the input sequence only once.
16:13hiredman,(if (Boolean. false) :a :b)
16:13clojurebot:a
16:13ohpauleezjasonbray: What version?
16:13brehautjwr7: im not sure you could easily do the two seq generation thing in clojure
16:13jasonbrayohpauleez: 0.2.2
16:13TimMc&(letfn [(decorate [& fs] (apply juxt identity fs))] (map (decorate inc -) (range 5)))
16:13lazybot⇒ ([0 1 0] [1 2 -1] [2 3 -2] [3 4 -3] [4 5 -4])
16:14TimMcbrehaut: Sure you can, with lazy-seqs sharing state.
16:14ohpauleezjasonbray: And you're using the ring middleware?
16:14jwr7brehaut: I never intended to, I am resigned to realizing both output sequences. I just hoped to call the predicate only once. But wait -- it seems the version in useful does exactly that. Hmm.
16:14Raynes&(require 'flatland.useful.fn)
16:14lazybotjava.io.FileNotFoundException: Could not locate flatland/useful/fn__init.class or flatland/useful/fn.clj on classpath:
16:14Raynes&(require 'flatland.fn)
16:14lazybotjava.io.FileNotFoundException: Could not locate flatland/fn__init.class or flatland/fn.clj on classpath:
16:14jasonbrayohpauleez: yes, shoreleave/shoreleave-remote and com.cemerick/shoreleave-remote-ring
16:14Raynes&(require 'useful.fn)
16:14lazybot⇒ nil
16:15brehautTimMc: sorry, yeah that was implicit.
16:15RaynesDamn namespace changes.
16:15TimMcbrehaut: Example: https://github.com/timmc/rand/blob/master/src/rand/core.clj#L26
16:15ohpauleezjasonbray: If you're just experimenting with it, I'd give this a try and see if you still have the issue: https://github.com/shoreleave/shoreleave-baseline
16:15Raynes&(map (decorate inc -) (range 5))
16:15lazybotjava.lang.RuntimeException: Unable to resolve symbol: decorate in this context
16:15ohpauleezall of the pieces will be released as 0.3.0 soon and will be in Clojars
16:15Raynes&(map (useful.fn/decorate inc -) (range 5))
16:15lazybot⇒ ([0 1 0] [1 2 -1] [2 3 -2] [3 4 -3] [4 5 -4])
16:15ohpauleezfor some definition of "soon"
16:15jasonbrayyeah, I've based the code largely off of that and modern-cljs - both have been a huge help
16:16alv-r-Raynes: (sorry about taking long to reply) a lot of companies here hire without a degree if you're good too, the problem is that the majority wanna pay you way less cause you don't have a degree :\
16:16brehautTimMc: oh right, by creating an interstitial lazy-seq?
16:16ohpauleezjasonbray: Awesome! Once I wrap up the "kitchensink" code on baseline, I'm cutting the release - hopefully I'll get to that this week
16:16alv-r-anyway, gtg to class lol :P
16:17alv-r-cya
16:17ohpauleezjasonbray: If you try baseline, and you still see 404's let me know. Also feel free to ping me with pastes
16:17jasonbrayohpauleez: thanks, appreciate it
16:18TimMcbrehaut: Sorry, I thought that link was an example, but I misremembered. You'd let over two lazy-seq-using fns that share two queues under atoms.
16:18TimMcI think.
16:18brehautah right
16:21TimMcAt the center, you'd have some loop that spits elements into the opposing queue until an appropriate element is found.
16:21TimMcI guess you could generalize this to n queues.
16:23TimMcI wonder if mutable queues would be more appropriate there, or immutable queues inside atoms.
16:38TimMcbrehaut: Kind of a cute fn I wrote, split-atom!: https://github.com/timmc/handy/blob/v1.3.0/src/org/timmc/handy.clj#L86
16:38TimMcIt was very satisfying to write deterministic (a test helper) using that.
16:39ravsterhello all
16:39brehautTimMc: nice :)
16:39TimMcI couldn't figure out how to work juxt into it.
17:22gfredericks,(when-let [nums (map #(apply str % (repeat 10000 \c)) (range)] (first (nth nums 1000000)))
17:22clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>
17:22gfredericks,(when-let [nums (map #(apply str % (repeat 10000 \c)) (range))] (first (nth nums 1000000)))
17:22clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Character>
17:23gfredericksI'm getting an OOM error and wondering if (when-let [coll ...] (process-huge-lazy-sequence coll)) constitutes holding on to the head
17:26gfredericks&(when-let [nums (map #(apply str % (repeat 100000 \c)) (range))] (first (nth nums 10000)))
17:26lazybotExecution Timed Out!
17:27gfredericks&(when-let [nums (map #(apply str % (repeat 100000 \c)) (range))] (first (nth nums 1000)))
17:27lazybotExecution Timed Out!
17:27gfredericks&(when-let [nums (map #(apply str % (repeat 10000 \c)) (range))] (first (nth nums 1000)))
17:27lazybot⇒ \1
17:28TimMcgfredericks: The let should clear its locals as soon as that fn call is made.
17:28gfredericksthat's what I figured :/
17:29hiredmanbut the let doesn't clear the locals until process-huge-lazy-sequence returns
17:30gfredericksoh?
17:30gfredericksthat's basically the opposite of what TimMc says, right?
17:30gfredericksdoes this apply to function args as well? (fn [coll] (process-huge-... coll))?
17:31gfredericksI can't figure out an interpretation of this that doesn't make lazy seqs awful
17:31brehaut,@(if-let [nums (map #(apply str % (repeat 10000 \c)) (range))] (delay (first (nth nums 1000000))) (delay nil)) ; hmm?
17:31clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Character>
17:32brehautO_o
17:34gfredericksbrehaut: I don't understand clojurebot's behavior there
17:34gfredericksthat's why I switched to lazybot
17:34gfredericks"the thinking man's bot"
17:35TimMcgfredericks: The way to check empirically would be to use a WeakReference and calls to System/gc.
17:36TimMcOh, and I guess some threads.
17:38TimMcHmm, I'm having trouble coming up with a test, actually.
17:40hiredmanbasically if you force a lazy seq lower in the call stack then you create it, you are asking for trouble
17:41gfredericksI cannot figure out what that means
17:41brehauthiredman: i may be having a stupid morning, but isnt that every lazy seq generating function ever?
17:41gfredericksI don't even know which direction "lower in the call stack" is :(
17:41hiredmanif you create a lazy-seq in function X, and function X passes that lazy seq to function Y and function Y passed in to function Z and function Z does a doall on it
17:41gfredericksshallower or deeper?
17:42gfredericksdorun or only doall?
17:42hiredmandorun too
17:42gfredericksthat sounds like the sort of thing you might want to do often
17:43hiredmansure, it only ends up as a problem if the seq in question blows the heap
17:43hiredmanthe head of the seq is basically held by the activation records of the functions
17:44hiredmanI've gotten rid of oomes by going through code that did that and replacing the lazy seq creation with (not memoized in anyway) thunk
17:45hiredman,@(if-let [nums (map #(apply str % (repeat 10000 \c)) (range))] (delay (first (nth nums 1000000))) (delay nil))
17:45clojurebotExecution Timed Out
17:48gfrederickshiredman: I would think that even when things are smaller so as not to OOM there'd still be perf implications of holding the head
17:48hiredmangfredericks: would way to check it would would be to aot compile the function and look at the bytecode to see when the locals get nil'ed out
17:50gfredericksI do that by adding the ns to :aot?
17:51ravsterhow do I pass in variables to a future?
17:51brehautravster: you close over them
17:52tyler_im trying to make a simple macro
17:52tyler_https://www.refheap.com/paste/11804
17:52tyler_whats messed up>
17:52tyler_?
17:52brehaut,(let [x 1] @(future (+ x 2)))
17:52clojurebot#<SecurityException java.lang.SecurityException: no threads please>
17:52ravsterI tried a few variation on bound-fn and I'm getting "unable to resolve symbol" errors
17:52hiredmangfredericks: sure
17:53brehaut,(apropos 'future)
17:53clojurebot(future-done? future future-call future? future-cancel ...)
17:53brehaut,(apropos 'future-fn)
17:53clojurebot()
17:54brehauttyler_: what is that macro supposed to do?
17:55brehautravster: (future-call (bound-fn (fn [] …)))
17:56tyler_brehaut: send "open http://i.imgur.com/UmpOi.gif&quot; to the shell its for education use only
17:56tyler_i figured out how to do it as a function
17:56brehauttyler_: why on earth are you trying to use an ns form then?
17:56tyler_brehaut: because im a noob?
17:56brehauttyler_: are you explicitly wanting to do macro stuff ?
17:57tyler_brehaut: nope i just want it to be a macro, i want to learn me how to do it if its possible, if it is possible
17:57tyler_meh last part of that sentence was redundant
17:58tyler_brehaut: http://www.youtube.com/watch?v=zn0JsGKk2k4&amp;feature=youtube_gdata_player
17:59brehautsharing a repl session as a video? bleark
18:00tyler_(good? bleark)
18:00brehauttyler_: i _think_ what you mean to be doing is (defmacro asplode [] (do (require 'clojure.java.shell) (clojure.java.shell/sh …
18:00brehauttyler_: no. the opposite of good
18:00tyler_brehaut: how do you share repl sessions?
18:00brehautyou sent me a video. text would have been sufficient
18:01tyler_brehaut: it was for entertainment value ;)
18:01ravsterbrehaut: that didn't work. I thought bound-fn needed an empty arg-list after it. Going by the one example on clojuredocs
18:02brehautravster: oh, my bad. it just wants a tail
18:02tyler_brehaut: yay it worked, you're the best :)
18:02brehaut(future-call (bound-fn [] …) ; ravstar
18:02ravsterwhat is a 'fntail'? I don't see an explanation for that.
18:02brehautravster: everything from the arglist on
18:03arohnerwhat is the best Java 7 JVM for OSX?
18:03ravsterso after the arglist?
18:03technomancyarohner: virtualbox =)
18:03brehautravster: and the arglist
18:04ravsteroh
18:04brehauttyler_: its still a terrible way to call a function
18:04tyler_brehaut: im not using it for anything srs, you can sleep well tonight
18:05ravstershould I be putting variables in the arglist for bound-fn? and then the body of it will be able to see them?
18:07ravsterweird. that changed something
18:40cemerickany chance someone has written a phantomjs ClojureScript REPL env that pipes evaluations over stdin/out instead of using it with browser-REPL?
18:43cemerickI guess the distance between that and https://github.com/bodil/cljs-noderepl is minimal...
18:44Bodilcemerick: Challenge accepted. :)
18:47cemerickBodil: I promise I wasn't trying to troll you ;-)
18:48nopromptthis will probably raise some suspicions, but is it possible to use multi methods with letfn?
18:49noprompti'm using clojurescript with angularjs and it would help clean up services
18:49nopromptwasn't sure if there was a way to do that
18:50bbloomnoprompt: probably easy to wire up with https://github.com/brandonbloom/dispatch-map
18:50bbloomunfortunately, no clojurescript support yet
18:50nopromptbbloom: yet again to my rescue
18:50noprompt:)
18:51nopromptand this should be usable from cljs?
18:51hiredmannoprompt: you can also create a multifn and bind it to a local with something like let
18:51hiredmanwell not in cljs I guess
18:51noprompthiredman: i was trying to work something like this
18:52bbloomnoprompt: no, it implements clojure.lang Java interfaces, etc. it's not currently possible to write compatible map types between clj and cljs
18:52nopromptboy, this state stuff can get a little gross
18:52bbloomnoprompt: but i'm gonna want to use dispatch-maps on cljs soon, so it's something i plan to tackle.... eventually....
18:54nopromptbbloom: that would be awesome. right now i have this gross defmulti bit going on inside of a defn.
18:55tommo_#join libgdx
18:55tommo_oops
18:55noprompthas there been any work done on cleaning up angular for use with cljs?
18:55bbloomnoprompt: it should be pretty easy to port to CLJS, but it's not something i need for a while
18:56bbloomnoprompt: i'm building something somewhat angular-like with clojure.... but it's gonna be a while :-) stay tuned!
18:56nopromptbbloom: i thought it might be fun to have a leiningen style macro that lets you specify controllers, factories, and their dependencies for angular
18:57noprompt(defapp my-app :controllers [[]] ...)
18:57nopromptthat sort of thing
18:57bbloomi haven't given much thought to wrapping angular b/c it seemed more important to substitute the hierarchical scopes idea with a persistent tree :-)
18:57nopromptusing the .. macro is fine for now but it looks like shit
18:59nopromptso how would that look?
19:01nopromptheh
19:02nopromptso JNI...
19:09ohpauleezA general thanks to everyone who helped me with clojail stuff last week - I have my Clojure Endpoint setup
19:09ohpauleez:)
19:09pbostromohpauleez: what does it do exactly?
19:10Bodilohpauleez: Grats :)
19:10ohpauleezthe same thing as lazybot, but over HTTP as a RESTful service
19:10pbostromnice
19:10ohpauleezso I can integrate it across a bunch of things
19:10ohpauleezand I really wanted core.logic in there
19:10ohpauleezso that's in there
19:11pbostromI have a similar setup, but it's clojail over websockets, I have yet to really abstract it into a real service though
19:12Bodilcemerick: PhantomJS 1.8 lacks an API for stdin, do you mind if compiling HEAD is a requirement until 1.9 is released? :)
19:13nopromptPhantomJS <3
19:36airstrikeanyone familiar with using mock data files with clojure testing?
19:37technomancyairstrike: those terms are a bit vague; could you be more specific?
19:39airstrikeof course. I've got a function which reads a periodically updated file on the system living over in /var/projectname, and I'd like to test it with a mock data file
19:39airstrikeso I run lein test projectname.test-subnamespace
19:40airstrikeit may be a permissions issue, but I've verified that I have permissions to read and write to the directory and test file
19:41airstrikehaven't been able to find much about whether lein test operates with only a subset of the user permissions
19:42technomancyno, definitely not
19:42airstrikehmm
19:43airstrikeI've been drawing a blank on searches for anyone using mock data files instead of mock data defined in-line or generated
19:44technomancyairstrike: as long as the target dir isn't hard-coded it should be easy to test
19:45airstrikein principal just slurp up the target file contents, although I'm trying to swap in the test data for whatever might be there
19:46airstrikeif I'm honest with myself it should probably be re-designed to redefine the target rather than fetching and temporarily storing the target data while it puts test data there
19:46bbloomairstrike: you can use `binding or, less preferrably, `with-redefs to provide mock values for definitions
19:46bbloomsee ##(doc binding) etc
19:46lazybot⇒ "Macro ([bindings & body]); binding => var-symbol init-expr Creates new bindings for the (already-existing) vars, with the supplied initial values, executes the exprs in an implicit do, then re-establishes the bindings that existed before. The new bindings are ... https://www.refheap.com/paste/11808
19:46airstrikeyeah. I ought to do that. I'd still like to eventually figure out why I'm getting these permissions issues
20:26cemerickBodil: I suppose not...but maybe just piping things into its REPL is sufficient?
20:31Bodilcemerick: That would involve trying to guess what kind of type the output might be... sounds a bit fragile.
20:38preyaloneHow would I defined a macro to transform symbols into strings?
20:39preyaloneE.g., I want to implement a die roller along the lines of (shake 2d6) => (3 4)
20:39RaynesMeh.
20:40RaynesWhy not just use strings, pass a quoted symbol, or use a keyword?
20:40preyaloneRaynes: I have implemented a die roller for strings: (roll "2d6"). I just want to write a macro that takes symbols instead.
20:42preyaloneAh, name!
20:42preyalone,(name)
20:42clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$name>
20:44Raynespreyalone: That isn't a valid symbol though.
20:44RaynesWell, it's a valid symbol, but the reader won't accept it if you pass it in.
20:44preyaloneRaynes: Aye sir, because 2d6 begins with a number.
20:44RaynesYessir.
20:44preyaloneShould I alter the reader?
20:49TimMcpreyalone: Nope.
20:50TimMcNothing wrong with strings.
20:50Raynespreyalone: God no. Why would you do a thing like that? :p
20:51preyaloneHehe, I'm a CL novice and and Clojure newbie... I just expected macro trickery would allow for this.
20:51preyaloneStrings are cool, I just wanted to use even less syntax for die rolling.
20:51rabbit_airstrikeuse keywords?
20:51TimMcYou can't really alter the reader in Clojure like you can in CL.
20:51TimMc,:2d6
20:51clojurebot:2d6
20:51rabbit_airstrike(roll 2 :d6)
20:52TimMc,'2d6
20:52clojurebot#<NumberFormatException java.lang.NumberFormatException: Invalid number: 2d6>
20:52preyaloneAnd save one character? Sure!
20:52preyaloneWhat's the function for transforming keywords into strings?
20:52TimMcname
20:52TimMcpreyalone: If you're using paredit, it's the same number of keystrokes.
20:52TimMc" 2 d 6 results in "2d6"
20:53preyaloneTimMc: That assumes all end users are operating in Emacs rather than, say, an ordinary clj repl.
20:53TimMcsure
20:53rabbit_airstrikealthough I think it looks cleaner to add a little separation between the quantity and die type anyways
20:54TimMc(or operating in some Vim nREPL thingy)
20:54preyalonerabbit_airstrike: d or D usually serves this purpose in RPG lingo
20:55rabbit_airstrikeI know, but if you're interacting with the repl anyways, it doesn't seem like a leap to ask users or programmers to enter (roll 2 :d6)
20:55preyaloneor even 2 :d 6
20:55rabbit_airstrikealso sensible
20:56preyaloneWeird. I can do (roll (name :2d6)) in clj, but when I use my (shake) function defined this way, I get ClassCastException java.lang.Character cannot be cast to java.lang.CharSequence
21:01preyalone,name
21:01clojurebot#<core$name clojure.core$name@13136f3>
21:01majykis there a setting for countclockwise that will make it honor my tab key? I know this is silly and it probably knows best what the indention level should be but it's highly annoying to press tab and it eat it.
21:02preyaloneDoes (name) do any qualification trickery? It doesn't seem to work on keywords when called indirectly.
21:02majykah crap, just found out what setting it was
21:11preyaloneI've settled on a minimal syntax for the die roller, via the terminal: ./roll.clj 2d6
21:14preyaloneHey Raynes, I had no idea you were such a big contributor to the Clojure community. Keep it up!
21:15Raynes<3!
21:15preyaloneIs there anything like Learn You a Clojure?
21:16RaynesUnfortunately now. I was writing a book to serve a similar purpose a while back but I've postponed it due to life for now. Plan to pick that up in the future, but it doesn't help you right now.
21:17preyaloneMerf. And Harry Potter and the Methods of Rationality has also stalled :(
21:17gfredericks(inc Raynes) ;; because I am using fs and conch a lot lately
21:17lazybot⇒ 21
21:17clojurebotExcuse me?
21:18preyaloneRaynes: In your opinion, what's the best introductory Clojure book out there today?
21:19gfredericksis it feasible to write a lein plugin that lets you list some ns requires in your project.clj and have `lein foo-repl` launch a repl into the user ns and execute those requires?
21:19xeqiinsert plug here for clojurebook.com
21:19bbloomgfredericks: you can eval arbitrary code on repl startup
21:20gfredericksbbloom: with the current `lein repl` you mean?
21:20gfredericks(and how?)
21:20bbloomgfredericks: https://github.com/technomancy/leiningen/blob/master/sample.project.clj
21:20xeqihttps://github.com/technomancy/leiningen/blob/master/sample.project.clj#L123
21:21bbloomgfredericks: well i didn't mean to say RTFM, i was aiming to be as helpful as xeqi with the line number on there :-P
21:21gfredericksoh I didn't see the line number
21:22gfredericksoh sweet you can override :main
21:22gfredericksI've been wanting that for a while
21:22bbloomso in pointing it out, i succeeded in actually being helpful :-)
21:23gfredericks(inc bbloom)
21:23lazybot⇒ 4
21:23bbloom(inc xeqi)
21:23lazybot⇒ 6
21:23gfredericksyour first composite number!
21:23bbloomdammit. i only want prime karma!
21:24xeqi(inc bbloom) ;;fixed
21:24lazybot⇒ 5
21:25gfredericksnumber-theory related karma inflation
21:25bbloomxeqi: haha, thanks, i was hoping somebody would do that to help out my joke
21:25bbloomxeqi: you're so helpful, let's keep the karmic circle jerk going:
21:25bbloom(inc xeqi)
21:25lazybot⇒ 7
21:25bbloomnow we're both prime!
21:25gfrederickstwin primes!
21:25noprompttwin primes!
21:25nopromptlol
21:25bbloomhaha
21:25gfrederickstwin irc statements!
21:25nopromptit's a sign!
21:29noprompthas anyone here had to convince someone that using clojure for a new application was a good idea?
21:29gfredericksyes.
21:30nopromptme and a few friends have an idea for a web app and one of them is a hard core python guy.
21:30noprompteveryone's on board with cli, but i gotta convince this guy.
21:30nopromptany tips?
21:31noprompthe thinks let expressions are dumb...
21:31noprompti'm in tears :P
21:31gfrederickstell him you think assignment is dumb and then walk out in a huff
21:31nopromptdoesn't understand that immutability is a good thing.
21:31nopromptha!
21:31brehautnoprompt: do a brief sell on the improved reasonability, and if it doesnt take hold, then forget it. you arent going to convince a 'hardcore X' user if they dont want or care to be convinced
21:33nopromptbrehaut: that's true
21:33gfrederickscompare mutability to OO's public getters/setters and GOTOs
21:33nopromptfrom what i recall, python distinguishes between statements and expressions
21:33gfredericksthere's a PLT-Life for that
21:33nopromptha!
21:33nopromptoh yeah
21:34ivantie him down and make him watch Rich Hickey videos
21:34nopromptivan: that might be a good idea
21:34brehautnoprompt: ps, https://www.refheap.com/paste/11811 thats why let is not dumb ;)
21:34noprompti'll invite him over for beers
21:34nopromptloosen him up so he's receptive of the reasoning
21:34AdmiralBumbleBeegetting people tipsy always makes logic work better...
21:35nopromptcan't tell if thats sarcasm or not
21:35noprompthaha
21:35AdmiralBumbleBeemaybe you're tipsy now? :P
21:35nopromptbehaut: what… the?
21:36gfredericksbrehaut: that error looks totes legit
21:36brehautnoprompt: pythons scoping is magically broken
21:36gfredericksno wait it doesn't
21:36gfrederickssomehow I convinced myself x was a third variable there
21:37AdmiralBumbleBeebrehaut: explain?!
21:38nopromptwow
21:38brehautAdmiralBumbleBee: the intent is pretty clear: foo should be closing over x, but because python has implicit variable declaration (and weird scoping modifiers) it has to make best guesses at times. sometimes those guesses are really wrong
21:38brehautnoprompt: i updated it btw
21:39AdmiralBumbleBeethat is so confusing
21:40brehautif javascript (with strict mode) is clearer than your language of choice in some area, you've got a problem
21:40AdmiralBumbleBeeit's times like this that I have a euphoric wave roll across me in the acknowledgement that I do not, nor ever intend to, use python
21:40nopromptman, that hurts my brain
21:40noprompt+1 to that
21:41brehautincidentally if you want to see the other side of the particular scoping tradeoffs with implicit declarations, check out coffeescript
21:42brehautnoprompt: a common python hack is to use a mutable cell such as a 1 item list
21:44noprompti'm surprised that's a thing though
21:45noprompti mean i think even php can get that one right
21:45ivanin Python 3 you use `nonlocal`
21:46brehautivan: finally
21:49ivanPython 3 improves Python by forcing people to maintain code that works in both 2.x and 3.x along with associated compat.py files
21:49ivana never-ending polyglot programming challenge to stretch your brain
21:49AdmiralBumbleBeewhy exactly does it force that?
21:51ivanbecause 2.x is here for a while and 2to3 was too slow, from what I heard
21:54dcolishits not necessarily slow, it requires too much human intervention to get right
21:55brehautoh, heres my personal favorite python wat
21:55brehauthttps://www.refheap.com/paste/11812
21:55brehaut(never been bitten by it, but its still strange)
21:55ivanyeah, I do list(x for x in range(10)) instead
21:55dcolishi've seen that used intentionally, that was fixed in python 3
21:56dcolishmany languages have/had leaky loop invariants
21:56brehautivan: yeah i prefer that too
21:57ivan>>> False == False is True
21:57ivanFalse
21:57brehauthaha
21:57brehautthats a good one
21:58seangroveUhg, korma seems to be rocky around the edges
21:58ivanI think my favorite Python wat is the collections.namedtuple implementation
21:58dcolishheh
21:59brehautivan: haha fair
21:59brehautivan: technomancy's is statments ;)
22:09seangroveAnyone had trouble with Korma's (with/) query and the transform function applied to the results? Doesn't work well on a lazy sequence :P
22:12seangroveHow can I tell if I have a lazy seq?
22:13gfredericks,(type (range))
22:13clojurebotclojure.lang.LazySeq
22:15seangrovegfredericks: Thanks, just wondering if there was something convenient like (integer? ...) or (list? ...), e.g. (lazy? ...)
22:15gfredericks$findfn (range) true
22:15lazybotjava.lang.OutOfMemoryError: Java heap space
22:15brehautseangrove: seq? etc dont distinguish between concrete seqs and lazy seq
22:15brehautgfredericks: lol
22:15gfredericks$findfn (range 1 3) true
22:15lazybot[]
22:16gfrederickswat
22:16brehaut,(seq? (range 1 3)
22:16clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
22:16brehaut,(seq? (range 1 3))
22:16clojurebottrue
22:16brehauti wish lazybot still fixed those errors
22:16bbloom$findfn true (range)
22:16lazybotjava.lang.OutOfMemoryError: Java heap space
22:16bbloom$findfn true (range 1 3)
22:16lazybot[]
22:16bbloomthought maybe you had the arg order wrong...
22:17bbloom*shrug*
22:46zenoliHm...(shutdown-agents) also kills nrepl? :/
23:10nopromptthis is going about as well as a shit sandwhich
23:38frozenlockStill bumping my head on how to an extensible application with plugins. I can load .clj files, but that won't help me if the plugin need a new dependency . :(
23:38frozenlock*how to make
23:41technomancyhoo boy; python and statements
23:42technomancynothing says "I have not used very many programming languages" like statements
23:44frozenlocktechnomancy: could you be my dad and explain that? :P
23:44gfrederickswoah wait we can have #clojure dads?
23:44ChongLiapparently so
23:44gfredericksthis seems like an important decision
23:47rboydis there a macro that takes a list of symbols and returns a map of {:symbol1 symbol1 :symbol2 symbol2 …}?
23:50frozenlockrboyd: yes, just a sec...
23:50frozenlockhttps://www.refheap.com/paste/11818
23:51frozenlockI new I wasn't crazy when I made this :)
23:51frozenlockknew even
23:51ChongLino that's not quite what rboyd asked
23:51frozenlockOh he wants the symbol, not the value o_O
23:52RaynesHe wants the s.
23:52rboydmaybe I asked wrong, this is what I wanted
23:52ivanbanjara: your client is borked
23:52rboydalthough I was hoping it was in core
23:53ChongLiwhy would it be in core?
23:53rboydcuz I need it all the time
23:54rboydI tried clojure.core/mapify-for-rboyd but I got a compiler exception
23:54rboydshot in the dark
23:57frozenlockSo, none have succeeded in making extensible (with plugins) clojure applications? Something like step 1: drop a jar in an extension folder, step 2: be happy.
23:57rboydfrozenlock: not I, but I'd be pretty interested in that pattern. and thanks for the macro
23:58frozenlockrboyd: yeah that be, in techno talk, freakin' awesome.
23:58alandipertfrozenlock: i think leiningen's plugin system is close to that (creative use of vars under the leiningen ns)
23:59frozenlockalandipert: yeah I took a look into that, but that's really the dependency issue that bugs me.