#clojure logs

2014-07-14

00:08justin_smithFare: have you tried flet or trampoline for said issues?
00:09Farejustin: not sure what exactly you propose
00:10justin_smithsorry, not flet, letfn
00:10justin_smithd'oh
00:10justin_smithboth letfn and trampoline turn mutual recursion into looping that does not grow the stack
00:11Farejustin: right now I have 82 entries in the grammar and 9 forward references
00:11Farein 260 lines.
00:13justin_smithtrampoline can use functions defined outside the trampoline block - each step should return the next function to be called
00:13Fareso I'd like to keep it top-level definitions instead of one big form
00:14Farejustin_smith, my problem isn't tail recursion, it's plain mutual definition
00:14justin_smithtoo many declare blocks?
00:26drusellersif i have a function that takes in a sequence of functions how can I apply them all to the same 'object' / 'value'?
00:26justin_smith(doc juxt)
00:26clojurebot"([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)]"
00:26drusellersthanks
00:27justin_smith,((apply juxt [inc identity dec]) 0)
00:27clojurebot[1 0 -1]
00:27justin_smithif they are in a list, you should use apply, as above
00:28justin_smith,(map #(% 0) [inc identity dec]) drusellers: if you need laziness there is also this
00:28clojurebot(1 0 -1)
00:31drusellersok. i'm looking for something a bit more like the thread macro
00:31drusellersif i could pass a seq of functions to a thread macro that would be what i'm looking for. I think.
00:32drusellersthat or I'm doing this all wrong.
00:32justin_smithmaybe you want comp
00:32drusellers(-> {} array-of-func)
00:32justin_smithor reduce
00:33drusellerscomp looks good
00:33justin_smith,((comp inc inc inc) 0)
00:33clojurebot3
00:33drusellersyes, closer to comp
00:33justin_smithwith apply of course
00:33drusellerswith apply
00:33justin_smith,((apply comp [inc inc inc]) 0)
00:33clojurebot3
00:34drusellersYES
00:34drusellersapply comp was the magicness
00:34justin_smiththe one trick is that the first function to use goes last in the list
00:34drusellersnow I will go learn the crap out this
00:34drusellersorder doesn't matter thankfully
00:34drusellersbut good to know.
00:35justin_smithit uses the standard mathematical rules for functional composition, is why
00:35justin_smith,((apply comp [:c :b :b]) {:a {:b {:c "buried"}}})
00:35clojurebotnil
00:35justin_smith,((apply comp [:c :b :a]) {:a {:b {:c "buried"}}}) oops
00:35clojurebot"buried"
00:41drusellersjustin_smith thanks!!
00:54kristofWho was I talk to yesterday about dynamic scope?
00:54kristofhttps://www.gnu.org/software/emacs/emacs-paper.html#SEC18
00:55benkaydoes anyone use system v init scripts to persist clojure apps? i'm having the damndest time setting environment variables (LEIN_ROOT=true, among them) and getting those passed to leiningen correctly
00:56Fareif I use a deftype or a defrecord, is it easy to (1) destructure the object, and (2) build a new object with just one or two fields modified?
01:00ambrosebsFare: only with a record
01:03Fareambrosebs, how do I do the destructuring and/or incremental modification of a record?
01:03Jaoodbenkay: any reason you are not using an uberjar instead of using lein?
01:03ambrosebsFare: get/assoc
01:05ambrosebskioos is spamming me
01:05Fareambrosebs, wonderful!
01:06benkayJaood: yeah. this app writes files to disk (at resources/public/output) and then serves those files via ring's wrap-resource. i need to keep these files around and back up other things getting written to various directories in resources/, and don't know how to get access to the inside of a jar.
01:07webushello. why clojure official repo have very little num of commits ? is clojure developing stop ?
01:07ambrosebswebus: we think a lot.
01:08Farewow, I'm impressed by clojure once again
01:09benkayJaood: do you know how to backup files written to the classpath of a jar?
01:10benkaymaybe i'm going about this the entirely wrong way. i could use the ring wrap-resources function to wrap resources off of the classpath, but i recall reading that it's only willing to serve resources off the classpath and not the host filesystem. is this at all true?
01:14benkayugh i want to be using ring.middleware.file/wrap-file, writing to that dir and then serving out of there.
01:20puredangerwebus: most feature development happens in branches, most defects/enhancements work is done in patches. at the moment work is focusing on some feature stuff.
01:21puredangerwebus: definitely not stopped! :)
01:21webuscool
01:25benkaylisp is dead
01:25benkay;)
01:25xk05(never)
01:37xk05the cardinality of lispyness may rise and fall and rise again or cruise through long periods of stability, but it will go on
02:04Fare(inc ambrosebs )
02:04lazybot⇒ 1
02:45Farehow do I get the ref for a symbol?
02:46mthvedtFare: you mean the var corresponding to a symbol in a ns?
02:46Farea var
02:47Farefind-var maybe
02:47mthvedt#'
02:48mthvedt,(println #’println)
02:48clojurebot#<ArrayIndexOutOfBoundsException java.lang.ArrayIndexOutOfBoundsException: 8217>
02:48mthvedtthat is supposed to say #’clojure.core/println
02:52mthvedtfare: what are you trying to do with parser combinators
02:57Faremthvedt, parse python
02:59mthvedtfare: consider a parser i wrote, https://github.com/mthvedt/clearley
02:59mthvedtparser generator, that is
03:00Farehow does it deal with line / column information?
03:01FareI have a lexer that gives it
03:02mthvedtfare: nothing built in, but you can parse any seq of objects
03:02mthvedtso you could for example embed that into your lexer tokens
03:02Farenice
03:03Farewell, I'll keep it in mind for the next rewrite
03:03Farethat's the kind of software I was looking for
03:03Farebut not having found it, I wrote my own parser combinators
03:05Farehow do you deal with debug information and tracing the errors to the source location?
03:07mthvedtyou can print out parse trees and incomplete parse trees
03:07mthvedtit’s hard to do that stuff in a standard way. practical parsers usually have error detecting parse rules, and/or manual intervention in the code. since clearley didn’t take off as much as i hoped, i never got around to adding better ways
03:09Fareok
03:10Fareright now, I track source location, but don't print very useful error messages. I have ideas how to: track the furthest lookahead you've got, and print a tree of the options that were expected then.
03:11FareI don't know how well your framework supports it, but I'm *really* enjoying higher-order combinators
03:12FareI have a (&non-empty-maybe-terminated foo) pattern where foo is one of the parser combinators
03:13rritochHi, is there anyone here who thinks they can help me with an IllegalStateException? This is a java-interop situation where there are two definterfaces and two gen-classes. One definterface inherits the parent definterface, the class implementing the child interface inherits a class that implements the parent interface.
03:14rritochThis is leading to an illegal state exception because the child interface accepts an argument for one of its methods, and the parent has the same method that doesn't accept an argument.
03:15mthvedtfare: rules before the parser builds them are just objects, you can combine arbitrary rules using ordinary functional programming
03:27rritochNever mind this, I had syntax issues, it looks like I was able to clear up the illegal state using gen-class ... :exposes-methods
04:07rritochHi, does anyone know a good way to add java ee support to a clojure project? I'm trying to create a custom servletcontext for evaluating JSP templates from clojure but I'm not sure how to utilize the version of JavaEE installed on the users computer from project.clj
04:10rbarraud_rritoch: what's the deployment environment look like?
04:12rritochrbarraud: Eventually I plan on deploying these from tomcat servers, but I'm using ring
05:28rritochAfter going the wrong direction repeatedly, I finally solved the javaee problem, I simply needed to add [javax/javaee-api "7.0"] to my dependencies >:) Much easier than expected, and magically this one line of code repaired everything
05:37augustlrritoch: didn't know that package existed, nice :)
05:37augustlI've usually added dependencies directly to jms, servlets, etc
06:07mr-foobarin clojure is there an alternate for mutexes ? need to sequence build-ish tasks
06:12augustlmr-foobar: there's always queues :)
06:13mr-foobaratom + q ?
06:13augustlor just a queue, and consume one item at a time
06:14mr-foobarhmm i don't know when the task1 or task2 will finish. their output is a file on the disk.
06:15augustlah, you need mutexes for task completion, not ensuring only one task runs
06:16augustlmr-foobar: sounds like a good problem for core-async
06:19mr-foobari could use messages like :task-done, :run-next i suppose. will give it a shot
06:19rritochmr-foobar: You can use agents for what your trying to do if each operation "sent" to the agent triggers the next send but doesn't return until it's job is complete
06:20rritochmr-foobar: agents only allow one operation at a time so calling the next send, the operation will stay on hold until the current one completes
06:20mr-foobarrritoch: sweet, that's exactly what i want
07:02krasHi, I am reading Joy Of Clojure, I am at section 2.4 titled "Vars are not variables"
07:02krasI don't find a concrete description of why this statement is true anywhere in the section
07:03krasBut the description of the Var tempts me into thinking its a variable
07:03krasany ideas?
07:03scape_kras: from my experience, I rarely use vars like I do in other languages
07:04scape_you rarely set and reset a var
07:04scape_http://clojure.org/vars
07:06scape_read that first paragraph, it explains it well
07:06krasscape_: thanks this explanation is way better than the one given in the book
07:07krasSo a Var is special in the sense it has a root binding and it can be dynamically binded on a per thread basis
07:07krasright?
07:07kerneisyes
07:07scape_I almost always use atom if I need to mutate something repeatedly, otherwise I use let and bind variables within a scope
07:09krasseem to get it now, thanks folks
07:09kerneisyou can think of Vars as thread-local storage with a default (shared) value
07:10krasso if a thread changes it, the others still have the root binding with them?
07:11kerneisI'm not quite sure what happens for threads created within the new binding; but for other threads, created before you rebind, yes, definitely
07:11yotsovif a thread changes a var, the other threads will see the new value
07:13yotsovunless the var is ^:dynamic
07:15kerneisoh right… but is there any common use-case for non-dynamic vars in practice?
07:15scape_yes
07:15kerneislike scape_, I tend to use atoms most of the time, except when I need per-thread bindings
07:16kerneissuch as?
07:16scape_constants
07:16yotsovnon-dynamic vars are the usual vars, the ones you create with def or defn, and so on, so there are a lot of usecases for them. I guess you mean use cases for dynamic vars. I have not yet encountered one
07:16scape_dynamic vars are less common
07:17krasback to square one I guess :-)
07:17krasSo the non-dynamic vars are like variables but thread safe?
07:17kerneisthen I probably don't understand the point of Vars either
07:17yotsovah you mean if there is a practice promoting storing data in vars I guess, as oposed to in atoms. as scape_ said, for constants
07:18yotsovkras, vars are not intended to be modified except in exceptional circumstances. They are for functions, for constants
07:19rritochkerneis brought up a important issue that I've been wondering about myself. What value do new threads inherit if the value has been rebound in the thread. This behavior seems to be undefined in the documentation.
07:20scape_the root val
07:20kerneisthe doc says "Bindings created with binding cannot be seen by any other thread" so I guess they see the root
07:21kerneisoh, of course static vars are used all the time when you define new functions, etc. - I'm a bit slow
07:21Dutchsmoker_can someone help me with the peoplesign captcha?
07:21Dutchsmoker_i just cant seem to find a way to beat it
07:21krasif "Vars provide a mechanism to refer to a mutable storage location that can be dynamically rebound (to a new storage location) on a per-thread basis." is true
07:22kraswhy then by default have non-dynamic vars
07:22krasall vars should be dynamic by default
07:23kerneiskras: Vars are what is used under the hood each time you use def/defn/etc.
07:23kerneisyou don't want something dynamic for this, I guess
07:24kerneisbut arguably, the doc is a bit confusing because it starts by presenting the dynamic use-case
07:24kerneisand only at the end mentions the use of static vars for defn
07:24kerneisit feels backwards
07:25kras"Functions defined with defn are stored in Vars, allowing for the re-definition of functions in a running program. This also enables many of the possibilities of aspect- or context-oriented programming. For instance, you could wrap a function with logging behavior only in certain call contexts or threads"
07:25krasthis defnitely is useful
07:25krasin this case you want a dynamic var
07:25krasnot a static one, right?
07:26yotsovif you want to be able to redefine a function on the repl, you want the function to be in a static var, otherwise it will only change in the thread of the repl
07:27krasOk, so can I say that the non-dynamic vars are similar to variables in other languages?
07:27krasGlobal variables to be specific
07:27yotsovnot really
07:28yotsovthey are not intended to be used as variables
07:28nbeloglazovHow are variables intended to be used, then?
07:28nbeloglazovTo be fair, I rarely find myself changing variable in other languages too
07:29silasdavisI've noticed a strange bit of behaviour with a record when running tests using lein test-refresh
07:29yotsovnbeloglazov: fair point...
07:29silasdavisI have a record with a protocol implemented inline
07:29silasdavisfrom a repl, lein test, and other contexts my code works as expected
07:30silasdavisfrom test-refresh if I print the record object to console it shows up as #my.custom.Record{ ... }
07:30krasor this: static or non-dynamic vars are only to refer to some values and the dynamic vars are the real and only use cases?
07:30silasdavisbut unlike in a repl it does not implement the interface my.custom.Protocol
07:30yotsovdynamic vars are a very exotic thing that is used almost never afaik
07:31silasdavisit seems to be a different version of the class, that has somehow missed implementing the protocol interface
07:31silasdavisso the protocol methods cannot be called on it
07:31silasdavisit is created with the (->Record ...) method that is generated for 'Record'
07:33nbeloglazovsilasdavis: code + step-by-step instructions how to reproduce the issue would be helpful
07:33silasdavisit feels like a load order or revaluation thing, but I'm still getting a object of class #my.custom.Record
07:33silasdavisyeah maybe I can try and put together a minimal example
07:41TimMcyotsov: "Almost never" is overstating it. I see them from time to time.
07:41TimMcIt often ends up being a bad idea, though!
07:42scape_I see it mostly in libraries
07:43scape_kras: http://blog.rjmetrics.com/2012/01/11/lexical-vs-dynamic-scope-in-clojure/
07:43TimMcAnyone else getting spammed by "lammy"?
07:43scape_the conclusion sums it up a bit
07:44TimMcscape_: Another problem is library instancing (or the lack thereof); if an app needs to use the library for two different things, it still only has one copy of that dynamic var.
07:45scape_that's an interesting point, I never came across this but that makes sense
07:46scape_TimMc: yes I did too
07:46scape_mods awake?
07:46scape_:)
07:50krasscape_: going back to my original question, yes vars are not variables in that they can have dynamic binding
07:50krasbut then there are not many cases where this is useful
07:50krasand hence treat them as global constants
07:50krasis that is?
07:50yotsovTimMc: I was spammed too
07:51krasTimMc: yeah, I was spammed too
07:51TimMcOK, reported in #help.
07:52honzai was wondering if anyone could enlighten me as to the reason why all existing lisp tools in the editor realm (emacs, vim) now have clojure-specific alternatives? for example, SLIME for emacs has been replaced by cider and slimv by fireplace
07:52honzawhat is it about clojure that makes us abandon existing tools? are they not cool enough?
07:52scape_kras: yes I do, I make use of thread safe mutations when necessary-- like atom
07:53TimMcWell, for one, developing in elisp apparently sucks.
07:53honza(i'm honestly asking, not trolling)
07:53TimMc(Actually, is cider written in elisp? I don't use it.)
07:53honzaTimMc: everything for emacs is elisp, no?
07:54Glenjamindoes slime have something equiavlent to nrepl?
07:54TimMcYeah, except where it's done via embedded shell.
07:54Glenjamineditor/repl transport protocol with middleware
07:57honzayou can add swank to lein and use that with slime, i think
08:13TimMcI just use lein repl. -.-
08:13andyfhonza: I don't know the motivation for nREPL development myself, but you may be interested in this: https://github.com/clojure/tools.nrepl#why-nrepl
08:23nobodyzzzbtw, is there a way to make lein faster on MacOS? I've tried several recipes I've googled but none of them seems to help
08:24honzahere is the reason, i guess http://technomancy.us/163
08:24honzaold, quirky code essentially
08:29kerneisis it considered bad style to throw IllegalArgumentException in clojure (when a function gets parameters violating its invariants)?
08:41scape_if your checking arguments in a function consider :pre and :post
08:41scape_kerneis: http://blog.fogus.me/2009/12/21/clojures-pre-and-post/
08:42visofhello
08:43visofin this page http://grepcode.com/file/repo1.maven.org/maven2/com.orientechnologies/orient-commons/1.0rc9/com/orientechnologies/common/profiler/OProfiler.java i want to import (import 'com.orientechnologies.common.profiler OProfiler$OProfilerHookValue)) with ClassnotFoundException
08:43visofhow can i import OProfileHoodValue
08:43visof?
08:43kerneisscape_: thanks
08:45visofalso how can i convert this line to clojure OServer server = OServerMain.create(); (let [server OServerMain/create nil]) ??
08:45lazybotvisof: Definitely not.
08:45visoflazybot: what do you mean?
08:45lazybotIt's AWWWW RIGHT!
08:45nbeloglazovvisof : (let [server (OServerMain/create)] ...)
08:46visofnbeloglazov: i got CompilerException java.lang.IllegalArgumentException: No matching method: create, compiling:(/tmp/form-init7885630799929940797.clj:1:1)
08:46visofhttps://github.com/orientechnologies/orientdb/blob/master/server/src/main/java/com/orientechnologies/orient/server/OServerMain.java
08:47scape_try OServer. or OServerMain. first, then run create; perhaps
08:51visofscape_: i did and i got NoClassDefFoundError Could not initialize class com.orientechnologies.orient.core.config.OGlobalConfiguration com.orientechnologies.orient.server.OServer.defaultSettings (OServer.java:726)
08:53nbeloglazovvisof: are you sure you have all necessary dependencies?
08:54visofnbeloglazov: i'm using this https://github.com/orientechnologies/orientdb/wiki/Embedded-Server
08:56nbeloglazovvisof: are you using lein? What dependencies are you using in project.clj?
08:57visofnbeloglazov: yeah i'm using lein deps : https://www.refheap.com/88149
08:59scape_maybe you have to instantiate it with some config info? IDK sorry :-\
09:01nbeloglazovvisof: I'm not sure what set of jars you need to run it. Have you tried to add "orientdb-core" as dependency? And where did you get this list of deps from?
09:16mirfhi peeps
09:17mirfC# refugee here
09:17mirffinding it hard to wrpa my noodle round some core concepts I think :)
09:17mirfof clojure, that is
09:17ToxicFrogWelcome!
09:18mirf:) thanks
09:19onr(he never welcomed me)
09:32tbaldridgemirf: I left the C# world about 3 years ago. The amount of anger I experience at my day job has dropped by 99% since then ;-)
09:33tbaldridgeC# is a nice language, the frameworks around .NET....not so much
09:33tbaldridgemirf: but welcome!
09:38bsimaDoes anyone have experience working with complex numbers in Clojure?
09:39bsimaThis is really the only thing I found that was up to date: http://rosettacode.org/wiki/Arithmetic/Complex#Clojure
09:55boxedI have a datastructure like [:foo “foo data” :bar {:bar :data} :bar {:bar :data2}]… is there a way to destructure that nicely?
09:56bsima(get-in map [:bar :bar])
09:57bsimahttp://grimoire.arrdem.com/1.6.0/clojure.core/get_DASH_in/
09:57bsimaThat will return :data in your case
09:59boxed,(get-in [:foo "foo data" :bar {:bar :data} :bar {:bar :data2}] [:bar :bar])
09:59clojurebotnil
09:59boxednope :P
09:59bsimaoh I thought it was all a map, not a map inside a vector, oops
09:59boxednotice the duplicate :bar
10:00boxedyea, it’s a pretty shitty data structure, but I’m trying not to change it since it’s someone elses code
10:00kerneisboxed: I have a list->map function to convert such vectors to maps
10:00nbeloglazovboxed: what do you mean by "destructure nicely"? Regular destructure doesn't meet your needs?
10:00bsimaMaybe combine it with get http://grimoire.arrdem.com/1.6.0/clojure.core/get/
10:01kerneis(should be called vec->map obviously)
10:01kerneis(apply hash-map (map-indexed #(if (even? %1) (keyword %2) %2) vec)
10:02tbaldridgeboxed: yeah, change that structure asap, unless the structure truly is order dependent
10:02kerneisboxed: oh, in your case (apply hash-map vec) would even be enough
10:02kerneis(I have strings as keys in my case)
10:02boxedtbaldridge: not my structure, it’s https://github.com/jafingerhut/clojure-cheatsheets/blob/master/src/clj-jvm/clojure-cheatsheet-generator.clj and I want to be able to consume that and convert it into something usable… and I don’t want to change the structure because then I can’t keep using changes to the original repo
10:03boxed,(apply hash-map [:foo "foo data" :bar {:bar :data} :bar {:bar :data2}])
10:03clojurebot{:bar {:bar :data2}, :foo "foo data"}
10:04boxedkerneis: that throws away the first :bar thingie
10:04scape_try merge maybe
10:05boxedtbaldridge: tell me about it.. I was just gonna throw something nice together real quick and then I find that this is the data structure >_<
10:05tbaldridgeAnd kids, this is why we don't use vectors to imply meanings of things. ["Some Command" :cmds '[foo bar]] tells me nothing. {:desc "Some Command" :type :cmds :symbols '[foo bar]} tells me lots.
10:05tbaldridge</rant>
10:06boxedmaybe I should just destructure it to [x y z w q] and assert x = :foo, z = :bar, w = :bar
10:07boxedfeels icky
10:07nbeloglazovboxed: do you know the structure of the vector?
10:07nbeloglazovLike, what it consists of. Does it consist of name-value pairs? Or something else
10:08boxednbeloglazov: yea, see the above URL.. but I want something that breaks in a usable way if that structure changes
10:10kerneisin this specific case, you will need ad-hoc conversion, yeah (because of stuff like :subsection "foo" :table t :subsection "bar" :table v, which really should be {:subsections {"foo" t "bar" v}} imho
10:13nbeloglazovOk, it's still not clear not me what we're talking about. Are we talking about top-level structure, or page-desc, or box-desc, or something else? :)
10:15boxednbeloglazov: well all of it I guess :P I want to convert that fugly data structure into something that doesn’t suck
10:20boxedI guess I’ll have another go at seqex again :/
10:29scape_boxed: what about? (merge-with union {:b [:d1]} {:b [:d2]})
10:31boxed,(merge-with clojure.set/union [:foo "foo data" :bar {:bar :data} :bar {:bar :data2}])
10:31clojurebot#<CompilerException java.lang.ClassNotFoundException: clojure.set, compiling:(NO_SOURCE_PATH:0:0)>
10:33boxedbah, well.. anyway the result is [:foo "foo data" :bar {:bar :data} :bar {:bar :data2}] when I tried it, which is the input
10:35scape_,(use 'clojure.set)
10:35clojurebotnil
10:35scape_,(merge-with union {:b [:d1]} {:b [:d2]})
10:35clojurebot{:b [:d1 :d2]}
10:35scape_probably still not what you need tho
10:36tbaldridgeboxed: clojure.set/* only works with hashsets
10:37boxedyea, not what I want :(
10:37tbaldridgemore correctly it works with others, but does odd things
10:37scape_why the {:bar {:bar ..}} seems redundant
10:37AeroNotixdo people still use Korma and if so, how well does it integrate with stuartsierra's components?
10:38philandstuff,(let [{foo 1, bar 3} [:a :b :c :d]] [foo bar])
10:38clojurebot[:b :d]
10:38boxedscape_: it is. As I said, not my code… it’s a format that is made just to print the output into HTML/Latex and it shows
10:40boxedseems like seqex should be a perfect match for this problem, but I can’t figure it.. fuck it, I’ll just bind everything and assert a bunch of crap
10:42whodidthiskorma is dumdum, yesql is where its at
10:50geardevWhat are some issues I might run into when scaling a clojure app?
10:50tbaldridgegeardev: depends on the app, depends on what you mean by scaling
10:51geardevWhat does clojure and community do better than erlang? What does erlang and community do better? What are their weaknesses compared to the other? I'm trying to figure out when you would use one or the other
10:52tbaldridgeWell to be honest I think Erlang adds a bunch of complexity that most apps don't need. Just setup RabbitMQ, JMS, etc, and then have your clojure apps connect to that.
10:53geardevtbaldridge: I have no clue what I mean. I'm guessing it means able to handle all the requests coming from users?
10:53tbaldridgeLet distributed queues handle all the message retrying and all the complex distributed stuff, your clojure app can then be put on multiple machines, machines are free to die as needed.
10:55tbaldridgeAs a co-worker told me once "what's the first thing people do with Erlang? Build a distributed message queue...why not just start with one written in Erlang like RabbitMQ. Let the queue people worry about that stuff, let your app worry about the app stuff."
10:56boxedgear: “from users”? you mean from a browser? or do you mean from a telephone system like what erlang was originally made for?
10:57philandstuffgeardev: well what's your expected volume of users? what are their needs?
10:58geardevboxed: browser, i only know how to build browser apps
10:58geardevs/browser/web
10:58philandstuffsome apps can scale massively just by sticking a CDN in front of them
10:58tbaldridge(inc philandstuff)
10:58lazybot⇒ 1
10:58philandstuffothers need to put more effort in
10:59philandstuffread-heavy vs write-heavy workloads, fully up-to-date vs okay-to-be-a-little-stale, etc etc
10:59geardevphilandstuff: expected volume ~2,000,000 tranactions max at any one time
10:59tbaldridgegeardev: philandstuff: my favorite blog post about the CDN approach (or one like it) http://www.colinsteele.org/post/27929539434/60-000-growth-in-7-months-using-clojure-and-aws
10:59geardevi've never built anything this big before, so it's exciting but scary
10:59tbaldridgegeardev: 2M transactions max at any one time
11:00tbaldridgedefine one time. throughput needs a X per Y where Y is time
11:00gfrederickstbaldridge: one time!
11:00geardevgfredericks: :)
11:00geardevtbaldridge: ~5minutes
11:00geardevor less
11:00gfredericksit's like how I'm seven lengths tall
11:01tbaldridge, (/ 2000000 5 60) ; in sec
11:01clojurebot20000/3
11:01geardevgfredericks: hah, that's a good analogy :)
11:01tbaldridgeDANGIT CLOJURE!
11:01tbaldridge, (int (/ 2000000 5 60)) ; in sec
11:01clojurebot6666
11:02tbaldridgethat's not bad, a sufficiently sized queue service should be able to handle something like that, but test first.
11:05bozhidar`I'm thinking of submitting a talk proposal for clojure/conj about the evolution of CIDER and the transition from eval-based to middleware based tooling. Do you think such a talk might be of interest to the broader Clojure community?
11:06tbaldridgegeardev: take a look at Kafka (immutable distributed queue) or Amazon Kinesis (if on AWS)
11:07philandstuffbozhidar`: LIKE
11:08Glenjamin(inc bozhidar`)
11:08lazybot⇒ 1
11:10tbaldridgebozhidar`: I'm on the fence with that one, this switch to middleware has added a ton of complexity, meaning that CIDER ends up being quite a bit more buggy (in my experience). Perhaps a bit of the talk could focus on how this new approach is simpler? Not just easier?
11:13bozhidar`tbaldridge: I'm surprised to hear that. In my own experience the pre-middleware approach was extremely buggy. :-)
11:13bozhidar`(not to mention it was impossible to support ClojureScript properly back then)
11:14tbaldridgeand perhaps that sort of comment is too open to interpretation. So perhaps a few minutes spent on the rationale behind the switch to middleware, and how it simplifies things?
11:16bozhidar`Yeah, of course. I'm planning to start the talk with a retrospective on the pre-middleware era and discuss its virtues (simple setup) and shortcomings (like complex inlined code, the need for a tooling session, the implicit dependency on libs like core.complete, etc)
11:16boxedhttps://github.com/dcolthorp/matchure seems to be more like what I need
11:17tbaldridge(inc bozhidar`)
11:17lazybot⇒ 2
11:19bozhidar`This was definitely not a decision that was taken lightly. Most of the problems introduced by the middleware switch are caused by CIDER's need for sync evaluation here and there (due to Emacs limitations) and this was originally implemented as an infinite loop that was often causing deadlocks in case of server-side exceptions
11:20geardevtbaldridge: thank you so much for your helpful responses
11:20tbaldridgegeardev: np
11:21bozhidar`it's still an infinite loop, but at least now it has a timeout which should prevent the nasty deadlocks
11:21martinklepsch(sort (map :key (-> aggregation :aggregations :inventors :buckets))) — suggestions how to make this simpler?
11:22bozhidar`martinklepsch: seems pretty simple as it is :-)
11:22tbaldridge(->> aggregation :aggregations :inventors :buckets (map :key) sort)
11:22tbaldridgenot sure if it's simpler, but maybe?
11:22Glenjamini'd use a get-in
11:22Glenjaminit's a bit more explicity
11:22martinklepschtbaldridge, hah, that was what I tried first but used the wrong threading macor
11:23Glenjamin(sort (map :key (get-in aggregation [:aggregations :inventors :buckets]))
11:23kerneismartinklepsch: -> appends as first param, ->> as last
11:23kerneisboth are really the same, it just depends whether where the functions you are using expect their parameters
11:23bozhidar`martinklepsch: expand a few with macroexpand and will all become clear
11:24martinklepschkerneis, I tried something like (-> x :a :b #(map :key %) sort)
11:24justin_smithmartinklepsch: you need an extra () around the lambda
11:24justin_smithotherwise it expands to #(map <something> :key %)
11:25martinklepschjustin_smith, ah, ok. that makes sense
11:26martinklepschthanks! :)
11:41mwelthi
11:42mwelt(deftest foo (testing "bar") (is nil nil))
11:42mweltFAIL in (foo) (test.clj:33)
11:42mweltexpected: nil actual: nil
11:42mweltbug or feature?
11:42bozhidar`(is (= nil nil))
11:42justin_smithmwelt: is tests if its arg is truthy
11:42justin_smiththe second arg is an optional reporting string
11:43puredangerprob want (deftest foo (testing "bar" (is (= nil nil))))
11:43mweltah k ty :)
11:43justin_smithor (deftest foo (is (= nil nil) "nil is nil"))
11:44mweltthis does make sense to me now ^^
11:44mwelti overread (= ...) in documentation examples
11:44mweltthx a lot
11:46Fareok, my python parser is basically working. Now to transform the parse tree into clojure code...
11:46tbaldridgeFare: oh, now that sounds interesting
11:47tbaldridgeesp when it comes to mutable objects....
11:47tbaldridgeor are you just mapping Python syntax to clojure?
11:54mlb-does the community have an opinion on a binary data manipulation library?
11:59Faretbaldridge, so far, I'm not doing anything yet with the parse tree. My immediate plan is to trivially generate s-expression trees, and leave the source code location in meta-information.
11:59Farethen write a bunch of macros to give a semantics to that tree
12:00Farethen maybe write a micropass compiler.
12:01tbaldridgeFare: have you taken a look at tools.analyzer?
12:01tbaldridgeWrite a few tree transformations and you should be good to go.
12:02Fareinteresting
12:03tbaldridgetools.emitter.jvm takes ASTs from tools.analzyer (they're just hashmaps) and spits out compiled java classes.
12:04Fareit looks promising, but the README is a bit sparse — where is the documentation?
12:04arrdemFare: the code is the documentation T_T
12:04Faremy ASTs so far are vectors [tag data source-information]
12:04Farearrdem, Works For Me(tm)... or not.
12:05arrdemFare: the good news is that Bronsa, tbaldridge and I are the only people on earth who do use it and we're pretty active here :P
12:05Fareexamples?
12:05clojurebotexamples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
12:06arrdembrb I seem to have nuked ~/
12:12hiredmancd sa-safe
12:12hiredmanwhoops, pardon me
12:14devnWhat talks, blog posts, etc. are your favorite on: "Why Clojure?" written towards someone who spends more of their time on the business side than the programming side?
12:15puredangerthis is not exactly that, but I love this talk by Stu http://www.infoq.com/presentations/Clojure-tips
12:16devnpuredanger: Thanks. it's weird because I feel like I've read posts or seen talks that tackle this
12:16devnbut i think for the most part they are still aimed pretty squarely in the direction of "developer"
12:17bbloomdevn: trying to sell clojure to your boss? :-P
12:18devnbbloom: nah, just trying to write something up for potential clients who are like: "Wait, why clojure?"
12:18Glenjaminsimple made easy is the big one for me
12:18puredangeryeah, I think we could be better at telling this story. Stu's talk above does address this (but also other things)
12:18Glenjaminoh sorry
12:18Glenjamindidn't fully read
12:18arrdemdevn: I think the TL;DR of "Out Of The Tarpit" and Clojure's design philosophy is that Clojure is a tool for programmers designed to help programmers escape obvious pitfalls and be able to spend more time working on the business side of the project and less time just bludgeoning it into working.
12:18bbloomdevn: are they concerned about maintaining your work after you've completed the project?
12:19devnbbloom: it might be, it might also be to someone who has no business picking the technology, in which case we would probably feel pretty comfortable saying: look, this is the right answer, so we're going to do it in clojure, but if you're curious about why we're doing that, check this out.
12:20bbloomdevn: often i find you can better address such concerns by not answering the question they have, but by uncovering their fears and reassuring them
12:20tbaldridgedevn: have you read Colin's posts? http://www.colinsteele.org/tagged/clojure
12:20devnnot all of them, but ill trawl through them
12:20arrdemtbaldridge: I list your "feature request" in my "Of Mages and Grimoires" as something I'd like to build :P
12:22devnpuredanger: im surprised i missed this talk. this is helpful. thanks.
12:22bbloomdevn: my suggestion would be to avoid "why clojure" and focus on "*JAVA's* jvm: an industry standard" and "Clojure" a "java-based programming language favored by some of the smartest most productive" startups in silicon valley
12:23bbloomdevn: i suspect that would quash the primary fears
12:23devnbbloom: yeah, that's kind of the route i'm looking at
12:23tbaldridgebbloom: cargo-culting FTW!!!!
12:23tbaldridge:-P
12:23devnBUT -- i think some people will roll their eyes at the startup thing
12:23devnand rightly so
12:23bbloomtbaldridge: that's what you gotta do to get the deal closed to protect clients from themselves
12:23bbloomthat's part of the job :-)
12:23devnthey work 120 hour work weeks
12:23devnso of course they're "productive"
12:23devn;)
12:24bbloomdevn: basically you make them not afraid of a word they haven't heard before, and make them feel special for being among silicon valley's finest
12:24bbloomthen go back to work :-)
12:25devnthere are a few audiences: "So you're building an app..." "So you've been building apps for years and you want us to help build part of it..." "So you've been building apps for years and you need a new app that lives in the same ecosystem..."
12:25mbacwhat's the answer if the client says "how are we going to find people who can maintain this clojure thing after you leave?"
12:26devnmbac: depends a lot on who they are as a client: what their resources are, etc.
12:27devnfor companies who can afford to have decent programmers, that's not an issue. for companies which can't, then finding someone smart who is willing to get paid a lower rate and work on it is possible. for companies with lots of devs, there are lots of options: "Do you want to train a dev to maintain this by having them work with me/us?" etc.
12:28bbloommbac: more likely to get a smarter candidate for less money :-P
12:28devnding ding
12:28devnbig value proposition in that, but it's also not free
12:28mbacwhy less money?
12:28puredangerNeal Ford's talk from the Conj is maybe useful https://www.youtube.com/watch?v=2WLgzCkhN2g
12:28devnsince recruiting and interviewing and so on costs time
12:28devnand money
12:29bbloommbac: because there's lots of young aspiring hackers who would rather work on something fun and be the hero, than be yet another faceless number in a big shop w/ dull tools
12:29bbloommbac: less experience, so they command a lower rate
12:29mbacoh i see
12:29bbloommbac: but greater exposure & curiosity, so likely to be better than even quite a bit experienced folks
12:30devnbbloom: that was me early on in my career. not much experience but a strong desire to do something interesting, new
12:30bbloomit's quite common
12:30devnbbloom: step 1, start a clojure meetup group, step 2, hire most of the people who go to it more than once, step 3 profit
12:30bbloomplus, you get to stay on as a consultant to onboard that guy :-P
12:32devnbbloom: yeah, honestly i think my answer these days is still: "ill find you someone."
12:32bbloomyup
12:33devnbecause ive seen recruiters reallllly fail to hire clojure programmers
12:33bbloomrecruiters are, almost without exception, useless
12:33devntotally missing the boat on what makes those kinds of people tick
12:34devni once offered a local company my help and rewrote their job posting for them
12:34bbloomdid you bill them for that? haha
12:34devnthey then proceeded to contact me 3 different times for the job
12:34devn"we see that you're a clojure programmer"
12:34bbloomd'oh
12:36tbaldridgeI can't tell you how many times I've been contacted by recruiters "I see on your resume you know .NET and live in the Madison area", "what's the date on that PDF you have", "2012" "yeah about that...."
12:36technomancyhonza: saw your Q about slime from hours ago. the main problem was that slime doesn't have a documented, stable network protocol to build from. it's totally implementation-defined, and at the time the slime devs were not very interested in supporting anything other than the emacs<->CL combination.
12:37justin_smithadd to that, the fact that the recommended way of using slime was to check it out of git and keep updated with master
12:37technomancyjustin_smith: oh man, if only
12:37technomancyit was CVS
12:37bbloomtbaldridge: when i worked at msft fulltime, i got so many vendor-company recruiters trying to get me a contract at microsoft
12:37devntbaldridge: i think madison's recruiting is particularly weird and bad
12:38tbaldridgeI've worked with some groups that ended up being okay, but yeah in general recruiting is just weird
12:38devnthe same people trying to fill a clojure position are the people who are hiring a safety engineering manager at kraft foods or something
12:38devnspread too thin in terms of expertise about certain types of industries and the people who inhabit them
12:39tbaldridgebbloom: there was a story on the Daily WTF the other day about a guy who was trying to find his replacement while looking for a new job. A recruiter never caught on that his candidate and the interviewer were the same guy.
12:40bbloomi particularly enjoy this story: http://www.ewherry.com/2012/06/the-recruiter-honeypot/
13:01Kneivais it possible to solve this kind of problems with core.logic? http://oi59.tinypic.com/s27ddw.jpg
13:01justin_smithwoah the "also enjoy" on that page was intense
13:02arrdem[NSFW] ^
13:03arrdemKneiva: core.logic probably buys you nothing, that's a linear algebra problem not a constraint solving problem.
13:03justin_smithoh of course, it's because it was tagged [balls], for a ball puzzle, that explains it
13:03cbpo dear
13:03hiredmanKneiva: core logic includes some finite domain stuff which lets you reason over numbers, so if you turn the pictures in to algebra I think it can solve it
13:07Kneivahiredman: I tried that but failed miserably
13:07magopian,(-> "test" #(str "you can't do that it seems:" %1))
13:07clojurebot#<CompilerException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.ISeq, compiling:(NO_SOURCE_PATH:0:0)>
13:07arrdemmagopian: look at that with macroexpand and it'll make sense
13:07magopian,(macroexpand (-> "test" #(str "you can't do that it seems:" %1)))
13:07clojurebot#<CompilerException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.ISeq, compiling:(NO_SOURCE_PATH:0:0)>
13:08arrdemyou have to quote the expression for macroexpand.
13:08arrdem&(macroexpand '(-> "test" #(str "you can't do that it seems:" %1)))
13:08lazybot⇒ (fn* "test" [p1__20805#] (str "you can't do that it seems:" p1__20805#))
13:08magopianah, thanks arrdem ;)
13:09arrdemmagopian: does the error make sense now?
13:09magopiannot sure i understand the output though :/
13:09magopianit's not a function anymore
13:09arrdemright. #() is a reader macro that expands into (fn [..] ..).
13:09magopianlet me look at the docs for fn*
13:09arrdemfn* is a special form.
13:10arrdemhttp://grimoire.arrdem.com/1.6.0/clojure.core/fn_STAR
13:10arrdemhum...
13:10arrdemthat should be a thing.
13:10tbaldridgeit's a special form ;-)
13:10arrdemhttp://grimoire.arrdem.com/1.6.0/clojure.core/fn/
13:10magopianwow, this looks nice!
13:11arrdemtbaldridge: right. I added special forms on friday :P
13:11magopianthis webste
13:11magopianit looks very sexy
13:11magopiani'll bookmark that straight away
13:11arrdem:D
13:12honzatechnomancy: thanks for the clarification
13:14hiredmanKneiva: you might have an easier time with https://github.com/clojure-numerics/expresso
13:14magopianhonza: hey, you here? :)
13:14hiredman(dunno, I've never used it)
13:14magopianhonza: is elasticsearch going to be rewritten in clojure? :)
13:15honzamagopian: i think you might have the wrong honza :)
13:15magopianah, sorry ;)
13:15magopianthere's a "honza kral" who is a core contributor of elasticsearch
13:15magopiansorry ;)
13:15honzamagopian: mr honza kral is a celebrity, i get this a lot
13:16magopian:)
13:16magopianarrdem: anyway, not sure I understand how/why it's not working from reading the macroexpand, but i understand that a reader macro get "expanded" before a standard macro
13:17magopianso i understand it may just go awry ;)
13:17magopian(and is there some documentation somewhere to explain what fn* does?)
13:24Kneivahiredman: thanks, I'll give it a try
13:25geardevall data structures in clojure aren't necessarily lazy, correct?
13:25technomancygeardev: only seqs
13:26nathan7and delays, if you can call them data structures
13:27geardevtechnomancy: ty
13:29bbloomi wish somebody would fix the reflection warnings in nrepl, etc
13:30bbloomclojure/tools/nrepl/... and complete/core.clj produce quite a few warnings when i start lein repl w/ reflection warnings on
13:32puredangeri wish that stuff was open source ;)
13:33puredanger(sorry, feeling saucy :) )
13:33bbloompuredanger: i dunno about wherever "complete" comes from
13:33technomancyhttps://github.com/ninjudd/clojure-complete
13:34technomancyweird that it reflects at boot though
13:34bbloompuredanger: but whenever i see a project w/ clojure/... in front, i tend to assume that complaining is just as effective as fixing it myself (not very)
13:34bbloomtechnomancy: https://gist.github.com/brandonbloom/4ba5cac0acc34275e07d
13:35bbloomlet's see... maybe i can fix up complete quickly
13:35puredangerlooks like some great practice for someone in fixing reflection warnings! :)
13:36technomancyoh cool; old swank code
13:36bbloomtechnomancy: old? why is it in my lein :-P
13:36bbloomseems pretty current to med!
13:36bblooms/med/me
13:37technomancybbloom: I mean it was copied from swank
13:39bbloomtechnomancy: this code hasn't been changed in 6 months to 2 years... what are the odds that ninjudd would take a PR ? :-P
13:41andyf_boxed: What do you want to do with that data, out of curiosity?
13:43andyf_bbloom: I have written patches attached to tickets for most reflection warnings in Clojure. You can take those patches in a private version of your own if you wish
13:44bbloomandyf_: these are in nrepl etc
13:44daGrevis,(map #(println 42) (range 10))
13:44clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval25/fn--26>
13:44daGreviswhy isn't that working
13:44cbpdaGrevis: #(println 42) takes 0 arguments
13:44cbpit should take 1
13:44andyf_I've written patches for some of those, too, although the ones cemerick wanted May have already been merged
13:45andyf_That and new ones have probably appeared on the last year
13:45daGreviscbp, ohh i didn't know it checks what I do so strictly
13:45daGrevisthanks!
13:46cbpit's only slightly more strict than javascript ;)
13:47technomancybbloom: ninjudd is pretty good about that stuff
13:49bbloompuredanger: i honor of your sauciness: https://github.com/ninjudd/clojure-complete/pull/20 /cc technomancy ninjudd
13:49technomancybbloom: brackets on :imports? =\
13:49technomancyoh, I guess it's honoring the existing convention
13:49bbloomoh, i probably don't want that set! in there...
13:50technomancyheh
13:50bbloomfixed
13:50technomancybut you are aware of http://p.hagelb.org/import-indent.html, right?
13:50bbloomtechnomancy: i don't subscribe to your school of thought that the first element of vectors can't be special
13:51bbloomi do [:keyword "style" 'stuff] all the time :-P
13:51technomancybbloom: do you manually indent?
13:52boxedandyf_: I want to write a nicer web frontend with reagent.. seems pretty silly to me to have a bunch of javascript powering various such sites when clojurescrip exists
13:52bbloomtechnomancy: only the first line. i had guns fix vim indenting to satisfy my preferences :-) https://github.com/guns/vim-clojure-static/issues/47
13:53andyf_boxed: You have read the comments describing that data structure?
13:53andyf_It hasn't changed its structure on quite some time
13:54bbloompuredanger: but i don't wanna deal w/ nrepl :-/
13:54andyf_Grr. iPhone fat fingers today. "In quite some time"
13:54daGrevisany idea why this isn't printing out anything? https://gist.github.com/072b5dc3e9032299bedf i'm sure tweets are there. outer-most map isn't working together with println :(
13:55boxedandyf_: skimmed it… it’s pretty tightly coupled to the html and latex output, it’s not semantic. But yea, I’m counting on it not changing much in order for the maintainability of the code I’m writing now to be ok :P
13:55daGrevis,(map println [1 2])
13:55clojurebot(1\n2\nnil nil)
13:55daGrevismy example doesn't work thought
13:55boxedandyf_: I don’t want to refactor the data structure though, because then I’d have to fix all the down stream problems with the html/latex generation that would cause
13:56andyf_I am open to suggested changes if you think it would make your job easier, if it doesn't make mine too much harder...
13:56boxedandyf_: no problem, I’ve found a lib that makes parsing it… well… reasonable at least
13:57boxedeveryone in here should give it a cursory glance I think! It can make some problems much simpler and more elegant: https://github.com/dcolthorp/matchure
13:58boxedI’m just happy I didn’t have to write a lib myself like I had to last time I was in here asking for help transforming a data structure heh
13:58TimMcbbloom, technomancy: It should also be pointed out that import's docstring calls for lists.
13:59andyf_boxed: Let me know if you hit any snags. Github issue is probably quicker than waiting for me to be on IRC
13:59bbloomTimMc: 1) was matching the existing code and 2) annoying technomancy quasi-intentionally
13:59TimMcMatching the code wins, yes.
14:00hiredmanboxed: what does matchure have over https://github.com/clojure/core.match?
14:00TimMcbut it sounded like you had moved to discussing which is better in new code.
14:00boxedandyf_: cool thanks. I’ll throw you a mail if I get something useful… maybe it makes sense to have this stuff in your project directly
14:02boxedhiredman: hmm… didn’t know about that. I guess matchure has “I found it on google” over it… plus the documentation is optimized for my use case
14:03technomancybbloom: it's an art form
14:03technomancyrelevant: http://penny-arcade.com/comic/2014/07/14/winston-smith
14:03daGreviswhy https://gist.github.com/anonymous/a5bda24626de3a953ade
14:03hiredmanboxed: looks like it hasn't been touched in years, has bugs and issues related to the 1.2 release, the current version of clojure being 1.6, so much for the "cursory glance"
14:05TimMcdaGrevis: map is lazy
14:05boxedhiredman: pity no one in here managed to direct me to core.match before ^_-
14:05daGrevisTimMc, oh. how can I explicitly say to it that I need it to be executed?
14:06TimMcdaGrevis: Try dorun. That will force the sequence and throw away the result.
14:07daGrevisTimMc, thanks, you're awesome!
14:08twiceadayif i want someone that is so kind to explain me a bit of the code
14:08twiceadaywhat is appropriate way to paste it here?
14:08cbppaste?
14:08clojurebotpaste is https://refheap.com/
14:15daGrevisso i have two functions. can i somehow say map 1st-function then 2nd-function?
14:15gfredericks,(doc comp)
14:15clojurebot"([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc."
14:15cbp(map (comp second first) ..)
14:16daGrevisthanks:)
14:36celwellIs there an easy way to change the name of a lein project (and the namespace)? Or do I have to go through all the files and do it manually (including pom.properties and idk what else)?
14:38TimMccelwell: Changing the maven coordinates can be done just by editing the project.clj.
14:38TimMc(pom.properties is irrelevant, that will be regenerated.)
14:38celwellah, ok. so just change that and the namespaces?
14:39TimMcIf you want to change a namespace, something like sed -i will change many files at once. The more annoying bit is renaming directories and such to match the namespaces. Maybe rename will do it.
14:40arrdem&(inc Long/MAX_VALUE)
14:40lazybotjava.lang.ArithmeticException: integer overflow
14:41celwellTimMc: thanks
14:42amalloyarrdem: there was some bug in c.l.Numbers that made a particular kind of overflow happen silently, wasn't there? i can't remember what version it was in, or how to expose it
14:43arrdemamalloy: I'm just watching Rich's old video with Brian Beckman in which he says "Numbers silently extend to bignums" which I believed to be no longer the case and that seems to be correct above.
14:43Raynesalandipert: What does Sean mean by custom build system?
14:43amalloyarrdem: that's definitely not the case; hasn't been since 1.2
14:43amalloy,(inc' Long/MAX_VALUE)
14:43clojurebot9223372036854775808N
14:44Bronsaamalloy: http://dev.clojure.org/jira/browse/CLJ-1222 ?
14:44arrdemright but we have the inc/inc' */*' split.
14:44amalloyah, multiplication! i tried (- Long/MIN_VALUE), but no luck
14:46amalloy(inc Bronsa)
14:46lazybot⇒ 31
14:46amalloy&(* Long/MIN_VALUE -1)
14:46lazybot⇒ -9223372036854775808
14:46technomancy"We've secretly replaced amalloy's arithmetic operations with ones that return correct results. Let's see if he notices."
14:46amalloygood old lazybot, living in the past
14:46arrdemheh
14:49andyf_amalloy: Also CLJ-1225 and the 2 similar tickets linked in its description, still in 1.6
14:49amalloy*chuckle* i got a poorly-worded email about a game that's getting ready to release a beta: "Within the next 2 to 3 days we'd like to get as many major game-breaking issues (such as [...]) in as we can."
14:59averellmust be EA
15:03alandipertRaynes, dunno
15:07stuartsierraTimMc:, celwell: tools.namespace has a semi-experimental `move-ns` function
15:07celwellThanks Stuart!
15:08martinklepschwhen using emacs + cider is there a way to eval the ()-expression the pointer is in? like (+ 3 (- 1 | 2)) will eval (- 1 2) ?
15:09amalloymartinklepsch: the problem is that pointer is in many sexps at once, and you don't really want the inner-most one (which is, in fact, just 1!)
15:09amalloyso you need a way to specify "how far up" you want to go before evaluating
15:09martinklepschamalloy,yeah that's why I wrote ()-expression and not s-expression
15:10stuartsierraC-x C-e will evaluate the *previous* S-expression, so if you place the point after the closing ) you can evaluate just one expression.
15:10stuartsierraSorry, C-c C-e or something like thate
15:10amalloystuartsierra: you had it the first time: C-x C-e
15:10stuartsierraha, it's both!
15:11amalloyoh, really?
15:11amalloyin slime/swank C-c C-e is a different thing
15:11amalloyi'd be surprised if that feature (prompt for a string in minibuffer, then eval it) isn't in cider
15:11martinklepschstuartsierra, yeah I know but for that I need to move to the end.
15:11amalloymartinklepsch: paredit-forward-up
15:12amalloyif you want you can just write a function that does all of those things: (defun eval-innermost-expr () (interactive) (save-excursion (paredit-forward-up) (cider-eval-last-expr)))
15:19Raynesalandipert: ANSWER ME HEATHEN
15:19Raynesalandipert: So you're not using a custom build tool?
15:19RaynesHe seemed pretty angry about that nonexistent build tool.
15:20RaynesWhat I usually do in these situations is create the thing that is making the guy angry then remove it to make him happy.
15:20alandipertRaynes, oh, he was talking about boot https://github.com/tailrecursion/boot
15:20RaynesOh, so you do have a custom build tool.
15:20RaynesWhat's wrong with you Alan
15:20alandipertwhat build tools aren't custom?
15:20RaynesLeiningen.
15:20RaynesIt's too old to be custom.
15:21alandipertweird, i wonder why i'm not using it
15:21Raynes:P
15:21RaynesSo why boot?
15:21alandipertasset compilation/coordination
15:21FareInternational Lisp Conference 2014 in Montreal, Aug 15-17 — today is last day for early bird pricing (even cheaper if you get ALU membership). I bought my ticket. Will some of you join me there?
15:22Raynesalandipert: So there is functionality that couldn't have been elegantly expressed as plugins for leiningen?
15:22alandipertRaynes, among a few other advantages one need never 'clean'
15:22Raynestechnomancy doesn't believe in clean.
15:22alandipertRaynes, give the readme a whirl, you may enjoy it
15:23amalloyclojurebot: technomancy |likes| things dirty
15:23clojurebotIn Ordnung
15:23alandipertRaynes, as a fellow custom build tool
15:23RaynesI highly doubt it.
15:23alandiperthaha
15:23RaynesAs a person who helped write a Clojure build tool, I'm gonna go hide behind leiningen.
15:23alandipertmay i direct you then to cuteoverload.com which almost certainly has something you may enjoy
15:23RaynesThis I can get on board with.
15:25FareI've written and am writing a build tools, but nothing Clojure specific at this point.
15:29seancorfieldalandipert: (and Raynes) - it would really help your cause if 1. hoplon's getting started explained _why_ boot is needed in addition to lein and 2. if boot's examples catered to windows - boot's readme says to d/l a JAR and use java -jar ... but ALL the examples talk about a boot _shell_ script and using #!/usr/bin/env boot which makes no sense for Windows users
15:29seancorfieldand it's that lack of Windows support that makes boot (and hoplon) a non-starter for clojurebridge
15:30alandipertseancorfield, thanks, i appreciate the feedback
15:30Farewhat's hoplon?
15:31Raynes$google clojure hoplon
15:31lazybot[tailrecursion/hoplon · GitHub] https://github.com/tailrecursion/hoplon
15:31Raynesdis
15:31alandipertFare, http://hoplon.io for soapbox
15:31RaynesWhat is an epicycle?
15:32RaynesI know what the word means, but not in the context of this README. :P
15:32alandipertRaynes, http://en.wikipedia.org/wiki/Deferent_and_epicycle#Slang_for_bad_science
15:33seancorfieldhoplon is beautifully documented and the frp cell stuff is wonderful
15:33RaynesI have come away from this paragraph knowing exactly as much about the purpose of that badge as I did before I read it.
15:33alandipertRaynes, so far we haven't had to bend the model to any one-off circumstances :-)
15:33puredangerseancorfield: sorry for engaging on Twitter where everything goes horribly wrong all the time
15:33RaynesOh, I see. I think.
15:33seancorfieldbut this whole discussion was about _clojurebridge_ and thus programming beginners using windows!!
15:34seancorfieldboot is really a non-starter for windows users who are new to programming
15:35puredangerseancorfield: I appreciate where you're coming from and maybe Hoplon is just not the right starting place (or maybe the wise and somewhat strange alandipert can make it a happy place)
15:35amalloyis this a continuation of some discussion from elsewhere? i'm confused by the first mention of clojurebridge being "this whole discussion was about clojurebridge"
15:35alandipertwe have windows users but they're all experienced programmers
15:35puredangeramalloy: twitter
15:35alandipertwhich i think is why the documentation is pointy
15:36seancorfieldraynes brought the twitter discussion here - and i felt was lampooning me - hence my follow-up here
15:36RaynesI actually was not lampooning you at all.
15:36TimMcThat's a great word.
15:36seancorfieldalandipert: yeah, i know windows is kind of a second class citizen in the clojure world in a lot of areas :(
15:36RaynesI'm actually super wary of new build tools
15:36RaynesJust not because of Windows support.
15:36puredangerand old build tools
15:37seancorfieldRaynes: ok, your tone wasn't clear... written word isn't always good for that :)
15:37RaynesWell I was trolling like hell, so I'm unsurprised.
15:37RaynesSorry <3
15:37seancorfield~guards
15:37clojurebotSEIZE HIM!
15:38seancorfieldout of curiosity alandipert can new hoplon projects be created with boot alone or is leiningen needed for that?
15:38seancorfieldarrdem: lol
15:39michaniskinseancorfield: we have a lein template for it
15:39alandipertseancorfield, a boot project is defined by its build.boot file, which can be created by hand, like a project.clj if desired
15:39arrdemBronsa: raw eval should work in the current master, right?
15:39seancorfieldyeah, that's what i got from the docs... use lein to create a hoplon project then use boot to run it
15:39RaynesA man after my own heart. <3
15:39alandipertwe use lein because it has the nice template system thing
15:39alandipertfor that bit
15:39Bronsaarrdem: correct
15:40trap_exitanyone here go from clojure to haskell (becuase types = awesome), but then switch back to clojure (because laziness = hard to performance debug)
15:40technomancytrap_exit: try ocaml =D
15:40RaynesI use multiple languages. I don't often 'switch' languages.
15:40arrdemBronsa: hum... lemme reproduce this weirdness but I'm not sure its working.
15:40RaynesLike, I can't 'switch' from Python to language x because I still need to write Python at work.
15:40trap_exittechnomancy: but I just spent a week of my life groking monads
15:41RaynesAnyways, I started with Haskell, ended up using Clojure far more.
15:41seancorfieldmichaniskin: are the windows binaries you refer to (for boot) actual native binaries or just the JAR file?
15:41RaynesI enjoy Haskell's type system, but prefer dynamically typed languages.
15:41tbaldrid_trap_exit: the lazy part seems to be be a common issue. Apparently even the language designers regret the lazy part of Haskell
15:41michaniskinseancorfield: it's just the uberjar (but before there was only source, so it's an improvement, right?) :)
15:41notostracaheh, I "switched" to C# but I'm still using a java lib in C# via IKVM, so I need to know BOTH standard libs! and I'm offering clojure help here sometimes after the pros go to sleep
15:41seancorfieldtrap_exit: have you looked at core.typed for optional typing?
15:42technomancyRaynes: re: "switching" https://twitter.com/mjeaton/status/483620293567848449
15:42trap_exitI spent the past 2 months of my life as folows: (1) use clojurescript (2) I want more compile time bug detection (3) start using typed clojure (4) decide typed clojure is too slow (5) learn Haskell (6) play with Haste/Fay to compile ahskell to js (7) instalal ghcjs to compile haskell to js and (8) banging head against table, wondering why my clojurescript code is 10x faster than my haskell code
15:42seancorfieldmichaniskin: "improvement"... er, yes...
15:42trap_exitseancorfield: it's slow
15:42michaniskinseancorfield: we're actively assessing various ways to package boot for windows
15:42Raynestechnomancy: I know, the wording always makes me twitch.
15:42michaniskinhow is launch4j with clojure?
15:42trap_exitclearly, the solution is: I need to write a haskell -> clojurescript compiler
15:42trap_exitso Ican get the type checking of haskell, but the perdictable performance of cljs
15:43technomancytrap_exit: ocaml has monads, they just don't bash you over the head with them within weeks of picking it up.
15:43devnis clojure the first language to make wide use of persistent data structures at the language level?
15:43technomancydevn: wat
15:43seancorfieldmichaniskin: how about a boot.bat that at least wraps the JAR and makes it easier to use the basic boot commands per the docs?
15:43RaynesNo.
15:43devntechnomancy: to implement HAMTs is maybe what I meant to say
15:44seancorfieldmichaniskin: i don't know what to suggest about all the unix-y shell script examples for boot on windows tho'...
15:44michaniskinseancorfield: yes we should do that (the .bat file)
15:44tbaldrid_devn: well rich invented PersistentVectors, and IIRC had Persistent HM before most other languages
15:44seancorfieldi'll be happy to test the experience on my win8.1 tablet :)
15:44michaniskinseancorfield: launch4j wraps the uberjar in a windows .exe
15:45seancorfieldmichaniskin: ah, ok, haven't looked at that
15:45notostracamichaniskin, there's also packr
15:45notostracawhich makes more than windows
15:45notostracaI have used it with uberjars
15:45trap_exithmm, maybe I will go try idris
15:45michaniskinnotostraca: how did it work for you?
15:45notostracahttps://github.com/libgdx/packr
15:45tbaldrid_trap_exit: lol, why?
15:45seancorfieldthe lein.bat / windows installer has made the leiningen-on-windows experience fairly painless (but it took a long time to get there)
15:46notostracafantastic, I actually was able to take my hack of a haxe jdk bundler and completely switch out
15:46seancorfieldunfortunately to bring more newbies to clojure, we need to be more aware of the windows experience - and the "pointy" nature of the docs (to use alandipert's lovely phrase - thank you!)
15:46technomancyso what does "asset compilation" mean?
15:46michaniskinseancorfield: we're working on boot-ng currently, which will be completely focused on being an "on-ramp" for clojure that beginners can use
15:46notostracamichaniskin, the point of packr is to be used regardless of the installed or not installed jdks on the user's machine
15:47technomancyI mean, how is it different from other types of compilation?
15:47boxedhiredman: just fyi: I managed to change my code to use core.match, works pretty well. Thanks!
15:47puredangertrap_exit: Sounds like you are in PureScript territory https://github.com/purescript/purescript
15:48michaniskinseancorfield: one of my personal goals for the whole hoplon boot thing is to get non-programmer types into the frontend dev
15:48seancorfieldmichaniskin: nice! def. interested in that...
15:49trap_exitpuredanger: holy shit, this looks amazing
15:50michaniskinseancorfield: hoplon was a step toward that goal. we envision frontend dev work to be as accessible as spreadsheets in excel
15:50clojurebotNo entiendo
15:50seancorfieldtrap_exit: if you want just a front-end solution that looks like haskell, check out elm as well - http://elm-lang.org
15:50michaniskincurrently though you're right, the on-ramp is not there yet
15:51seancorfieldthanx for the discussion... lunch calls...
16:04tbaldrid_wasn't the only one
16:04michaniskinhahaha, i get ppl talking to me on irc all the time
16:04michaniskinthinking i'm him
16:04stuartsierratechnomancy: I had the same problem until I met michaniskin in person.
16:06michaniskinstuartsierra: i used to think you were stuart halloway, but since books are not interactive i never bothered you with instant messages :P
16:06nathan7Anyone with core.async chops?
16:07nathan7I'm trying to use pub-sub, but my publication doesn't seem to be taking anything from my channel
16:07tbaldridgenathan7: I know a little about core.async, can I see some code?
16:08nathan7tbaldridge: a moment, putting an example of my problem together
16:08nathan7tbaldridge: http://sprunge.us/CZIg?clojure
16:08nathan7err
16:08nathan7a line got lost there
16:09nathan7tbaldridge: http://sprunge.us/DTfb?clojure
16:09nathan7tbaldridge: this just blocks indefinitely
16:11hiredmannathan7: do you know which line is blocking?
16:11hiredmanmy guess is the put!
16:11nathan7hiredman: nope
16:12nathan7hiredman: the <!! is blocking
16:12hiredmanbut I forget how put! works, I always just use <!! and >!!
16:12tbaldridgenathan7: your async/pub is publishing to updates I think?
16:12hiredmannathan7: maybe a typo, metric-pub is on an undefined updates channel
16:12nathan7hiredman: (future (async/>!! …)) gets me the same thing
16:12hiredmanshould it be on metric-chan?
16:12nathan7OH
16:13nathan7goddamn old names hanging around in my ns
16:13nathan7yep, everything works perfectly now
16:14tbaldridgegotta love the mutable global state of the repl
16:14alandipertmutable languages are key to productivity
16:14alandiperterr, dynamic languages i mean
16:16stuartsierraI should be quieter, I just found a bug in it this weekend.
16:18arrdemandyf y u no twitter
16:23Fareso what does tools.analyzer do?
16:24tbaldridgeit analyzes clojure forms and emits an AST. it then includes many passes on that AST to add more information
16:24tufttools.namespace++
16:24Fareis the AST semantically equivalent to the original code?
16:24bbloomFare: it's an elaboration in to a tree of maps
16:24bbloomie 1 becomes {:op :constant :value 1 ...}
16:25tbaldridgeFare: yes, that's the point, you can feed that AST into tools.emitter and you then have a Clojure compiler.
16:25Fareis the point to compile the code to something based on it?
16:25Fareso it's the first half of a compiler that doesn't exist?
16:25andyfarrdem: Everything I have to say about Clojure goes into one of the Google groups. Either that or I'm old and don't trust these newfangled web sites :-)
16:25bbloomFare: the other half of the compiler is a work in progress here: https://github.com/clojure/tools.emitter.jvm
16:25tbaldridgeThat emitter actually works pretty well.
16:26Fareoh. Then what's left to do?
16:26bbloomyou'd have to ask Bronsa
16:26Fareis this thing in any way related to Andy Keep's presentation on a nanopass compiler?
16:27tbaldridgeFare: nope, it's a been a long running project to build Clojure in Clojure
16:27bbloomwell, it's a multi-pass design
16:27Farein contrast, what does the current implementation do?
16:27bbloomthere's no AST validator as far as i know tho
16:27bbloomthe current clojure compiler is all single pass java crammed together
16:27tbaldridgeFare: the current compiler is mostly single pass
16:27Farea straightforward naive compilation?
16:27vermahey guys, I recently saw this pretty cool demo where cljs.async was used to blip little rects on a canvas and I think it was using Om as well, not sure, anyone know what I am talking about?
16:28tbaldridgeyeah, and it works pretty well thanks to how fast the JVM is.
16:28bbloomthere are some small optimizations for boolean tests and things, but it leans on the jit pretty hard
16:28tbaldridgeFare: but it's easier to add more features in something like tools.analyzer
16:29tbaldridgeFare: IMO, the current compiler isn't very maintainable. It works well for what it does, and for being written in Java, but I'd rather write something like core.async's go macro in tools.analyzer instead of the current compiler.
16:34dogonthehorizonGreetings folks. I'm wrapping an internal http api in Clojure as an exercise and have run into a casting issue. It appears that PersistentArrayMap and ObjectNode (from the jackson JSON lib) are incompatible types. Any pointers on how to go about making these two types friendly? Here's the relevant snippets: https://gist.github.com/dogonthehorizon/fcfe226879354073e969 ...thanks folks!
16:35tbaldridgedogonthehorizon: use cheshire?
16:35tbaldridgehttps://github.com/dakrone/cheshire
16:36dogonthehorizontbaldridge: I think clj-http is using cheshire under the hood, so I could try that. My goal is to have this library be usable by some existing Java projects, hence the interest in returning an ObjectNode.
16:40stuartsierradogonthehorizon: I don't get it. You want to return a Jackson ObjectNode from your function?
16:40seancorfieldmichaniskin: like technomancy i wasn't initially sure about your name and kept misreading it as mechaniskin... i assume it's Micha Niskin?
16:41michaniskinseancorfield: haha yes, that's me
16:41michaniskinare nicks case sensitive?
16:42tuftyes
16:44dogonthehorizonstuartsierra: So far: yes. Unless there's a better/cleaner way to do so.
16:44stuartsierradogonthehorizon: then you'll probably have to use the Jackson API directly
16:46dogonthehorizonhmm, alright I'll give that a shot then. Thanks all!
17:04dogonthehorizonstuartsierra: thanks for the suggesetion! Instead of using clj-http's json parsing facilities I accessed jackson directly to parse the response body. Things are working wonderfully now :)
17:05aperiodic
17:05stuartsierradogonthehorizon: you're welcome
17:10mi6x3mhey clojure, is there a way to get a qualified name from a var?
17:10arrdemmi6x3m: get a fully qualified symbol from a var?
17:10mi6x3marrdem: get clojure.core/+ from #'+
17:11mi6x3mI understand I can do it with the meta
17:11mi6x3mbut perhaps there's ready code for it
17:11stuartsierra(let [{ns :ns sym :name} (meta the-var)] (symbol (name (ns-name ns)) (name sym)))
17:12mi6x3mstuartsierra: yes, that's what I have now :)
17:12stuartsierrathat's all there is
17:12mi6x3mok, so nothing out of the box
17:18vermaHow do I get rid of the extra pair of () I am getting around my for form in this macro: https://gist.github.com/verma/a8560f22cdae3e7709fb
17:19hiredmanwhy is it a macro?
17:20vermahiredman, for funsies
17:20vermaI am going to attach a bunch of handlers which basically have the same body
17:20verma+ I am learning macros, so
17:21vermabut you're right, doesn't have to be a macro
17:23bteuberverma: has your question been answered already? if not, I'd like to help you once I understand the problem ^^
17:23vermabteuber, no it hasn
17:23vermahasn't been
17:23bteuberokay so which pair of () do you mean?
17:24vermaright after the cond
17:24vermabteuber, basically cond needs even number of forms right, so it doesn't work
17:24bteuberah should have read the comments below :)
17:25bteuberwell the ~@ "cancels" the list you created with the for
17:25bteuberbut not the one you created with the (list `... `...)
17:25bteuberso instead of list try concat
17:25vermabteuber, yeah, but how else do I bring the two statements together that I want for to emit
17:26bteubererm right
17:26aperiodicverma: you probably want mapcat in place of the for
17:26bteuberah yes
17:26bteuberor (apply concat (for ...))
17:26bteuberbut mapcat is more idiomatic
17:27vermaoh nice, let me look that up
17:27bteuberbut before you do, check if (apply concat (for ...)) works
17:27bteuberjust for fun ^^
17:27vermasure :)
17:29vermabteuber, yes (apply concat ...) works :)
17:29bteubergood
17:32vermaaperiodic, bteuber mapcat works as well :)
17:33vermanice, thanks guys :)
17:38TimMcI'm going to write a clojure.test utility to check if an iterator is well-behaved unless someone pipes up with an existing library in the next hour or so. :-P
17:42hiredmanTimMc: have you seen https://github.com/ztellman/collection-check? it doesn't have an iterator check, but it has some established patterns for testing collection kinds of things
17:43TimMcNice, thanks! I should have trawled through ztellman's repos first. :-P
17:43ztellmanTimMc: feel free to add an iterator check
17:44cbpa
17:44hiredmanbmag
17:44hiredmanpardon me
17:44Glenjaminztellman: hello! is iim still due to move into a core lib?
17:45ztellmanGlenjamin: yes, work has just been eating into all my open source efforts
17:45ztellmanmy company's doing a hackathon in a few weeks, was going to do it then
17:45Glenjamincool, i'll continue to keep an eye out for it
17:45ztellmansorry for the delay, I feel bad about it whenever I have time to remember
17:46Glenjamindoesn't make a huge difference - it works extremely well with the current name
17:46notostracaiim?
17:46Glenjamini'm on the CLA now, so if you want the rseq stuff it shouldn't be too much hassle
17:49_alejandronotostraca: immutable-int-map?
17:49TEttingerah, thanks (I am notostraca)
17:49Glenjaminyeah, https://github.com/ztellman/immutable-int-map
17:49TimMcztellman: I think I'll take that as inspiration but not try to add to it; iterators are stateful and involve exceptions, so they might be hard to wedge in.
17:50Glenjaminmakes r/fold magically work on maps
17:50ztellmanTimMc: all you do is create a generator that creates iterator actions
17:50ztellmanand then run it against your data structure and a Clojure data structure
17:50ztellmanand make sure the behavior is equivalent
17:51TimMcHmm, I see!
17:51TimMcI will give that a shot.
17:52schmeehas anyone here implemented the Negamax algorithm in clojure?
17:53TimMcI still need to read up on simple-check.
17:53reiddraperztellman: a test like that could never find any bugs... ;)
17:54ztellmanreiddraper: note that I didn't say compare a Clojure dat structure against itself :)
17:54ztellmandata*
17:54TimMcOh, looks like simple-check moved.
17:55reiddraperztellman: haha yes, true
17:55ztellmanTimMc: oh, yeah, I probably haven't retargeted collection-check yet
17:55reiddraperTimMc: indeed: http://github.com/clojure/test.check
18:39alexherbo2Hi
19:09shanemhansenI heard about the XY thing in hacker news comments like yesterday.
19:10caternXY problem?
19:10shanemhansenoops, sorry catern wrong channel.
19:11shanemhansenAlthough it's probably relevant in any irc channel where people ask for support: http://mywiki.wooledge.org/XyProblem
19:11caternyep, XY problem
19:14cbp~xy
19:14clojurebotxy is http://mywiki.wooledge.org/XyProblem
19:15shanemhansenI feel like I'm one of today's lucky 10k http://xkcd.com/1053/
20:07fifosineIf I have a list and a list of indices, how do I get a sequences of elements at the indices?
20:07technomancyfifosine: put your list in a vector and map it over the indices
20:08fifosinehow do you mean? I have '("A" "B" "C") and indices '(0 2), and I want to get '("A" "C")
20:08pandeiro`getting java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil using clojurescript 0.0-2268 with advanced compilation -- is this a tools.reader problem?
20:09technomancy,(map ["A" "B" "C"] '(0 2))
20:09clojurebot("A" "C")
20:11fifosinetechnomancy: How do I force map to evaluate and not give me a lazy seq?
20:12nkozofifosine: (doall (map ....)
20:13fifosinenkozo: thanks
20:13technomancywhat's wrong with a lazy seq?
20:15technomancy(there are legitimate reasons to avoid them, but it's unlikely you're coming across them if you're unfamiliar with doall)
20:16numbertencan someone tell me if there's a neater way to do this than what I just thought of? it feels kinda hacky
20:16numberten,((reduce comp (map #(partial + %) [1 2 3 4 5])) 0)
20:16clojurebot15
20:17numbertenobviously I mean the pattern and not summing a vector of ints
20:17technomancyapply comp instead of reducing it
20:18hiredmanum
20:18hiredmanthere is no need at all for the map
20:18hiredmanjust reduce with +
20:18amalloynumberten: what pattern? the stuff you're doing there is just all contrived
20:18numbertenI didn't realize comp worked on functions of n-arity
20:18numbertenthanks technomancy
20:18amalloyi can't tell you how to better do that pattern because i don't understand what pattern there you're hoping to promote
20:18hiredmanhis pattern is just a really weird way to write a reduce
20:18numberten?
20:19hiredmanyay, the spammer is back
20:19hiredmanmuuunis
20:19numbertenI guess I was just wondering if there was a shorter way, since it's kinda verbose
20:19hiredmannumberten: (reduce + 0 [1 2 3 4 5])
20:20numbertenI want to be able to take a traversable structure of functions of type a->a and weave some accumlator between them
20:20hiredmanthere is a shorter way, that whole computation is just a reduce
20:20numbertenso i compose all the functions into 1 large a->a
20:20numbertenand then apply the initial value
20:20hiredmanthat is reduce
20:20numbertenyeah
20:20numbertenbut it's verbose
20:20numbertenas noted
20:20hiredmanno no
20:21hiredmannot reduce with comp
20:21hiredmanit is just reduce
20:21numbertenbut the function changes
20:21numberten:/
20:22numbertenright?
20:22numbertenthe first application of f f=(+1)
20:22numbertenthe second f=(+2)
20:23Jaoodhiredman: do you mean he just wants (reduce + 0 [1 2 3 4 5]) ?
20:23numbertenso (reduce + 0 [1 2 3 4 5]) doesn't capture it? Unless I'm just very tired and missing something
20:24numbertenwhat I kinda want is a non-macro ->> I think?
20:25hiredman,(reduce #(%2 %1) 0 (map #(partial + %) [1 2 3 4 5]))
20:25clojurebot15
20:25hiredmanyou have multiple things, you want one thing, it is reduce
20:25numbertenaha
20:25numbertenthanks
20:26nkozocan I force evaluation of a macro parameter from outside the macro? like doing (defmacro m [x] x) and (m (get-big-expr)), and get-big-expr will be evaluated in compile-time (by some magic) before the macro call
20:28amalloynkozo: no, that is not possible. macros don't work that way
20:30nkozoamalloy: thanks, just checking
22:28hellofunkddellacosta: do you do your Om markup with sablano or something else, or do you just use the built-in om/dom stuff?
22:32garrettdreyfusHey guys I was wondering if anybody new how to test out plugins for leingen
22:33ddellacosta_hellofunk: sablono, usually
22:34hellofunkddellacosta_: is it primarily a syntactic convenience for you or are there additional features you use?
22:35numbertenany reason a macro might be evaluated instead of expanded by macroexpand-1 in the repl?
22:35hellofunknumberten are you quoting the macro expression?
22:36numbertenyes
22:37numbertenthe macro is mread-slurp
22:37numberten(mread-slurp "data/b") gives an error
22:37hellofunkand what *exactly* are you typing at the repl?
22:37numbertenand (expandmacro-1 '(mread-slurp "data/b")) gives what I would expect
22:37numbertenwhen normally doing (mread-slurp "data/b")
22:37numbertenit's strange :/
22:38hellofunknumberten why not using macroexpand?
22:38numbertensorry was a typo
22:39numbertens/expandmacro-1/macroexpand-1
22:39hellofunkwhat is "s" namespace representing for you
22:40numbertens?
22:41hellofunkmaybe you are just putting lots of typos here?
22:41hellofunkyou typed s/...
22:41numbertenthat was sed substitution >.>
22:41numbertento correct my typo above
22:43numbertenhttp://pastebin.com/wZD4gb2M
22:43numbertenisn't that strange? :/
22:43numbertenthe macroexpand-1 line and the last line return the same input which I cut out because it's spammy
22:45numbertenwouldn't you expect (macroexpand-1 '(mread-slurp "data/b")) to return (read-string (slurp "data/b")) ?
23:03numbertenneeded to ~ the argument in my defmacro >.>
23:03devnnumberten: i was going to say, i dont have any such problem
23:03devnnumberten: why put that in a macro?
23:17numbertenfor embedding structures into binaries at compile time
23:23nathan7…whoa, was that a netsplit recovering?
23:23nathan7looks like it
23:34kegundoff-topic... is there a paredit command to cycle between paren type ([{) ?
23:35elbenI’m writing a cljs app using Om. Trying to understand the async model. cljs only implements atoms, and om/react seem to use settimeout for its requestanimationframe. Do browser events (e.g. on click) take control of the process on fire? E.g. if I have a do block that is doing a bunch of swap!s, would a button click move the process out of that block? A settimeout I assume does exactly this.
23:42elbenAh, js seems to work like most async systems where the yielded context must give back control to the process (e.g. method ends)
23:59kristofelben: Do you mean "go" block? As far as I know, go blocks are only scheduled out of the thread after a channel operation.
23:59kristofelben: So a go block running a tight loop would not care about any button click until it was finished, oooor it called a put or a take.