#clojure logs

2014-07-10

00:01rbritoSomeone asked which programs in python are my most popular. I would say this one:
00:01gfixlerrbrito: just for one more vote of confidence, I'm in chapter 7 of Learn You A Haskell, and it's all been very straightforward, fun, and a little bit eye-opening
00:01rbritohttps://github.com/coursera-dl/coursera
00:01rbritogfixler: I found Learn You a Haskell more engaging than Graham Hutton's book on Haskell.
00:01gfixleroh, have you already read it?
00:02rbritoBut, then, I have only read the 1st chapter of LYAH and only the first 3 chapters of Hutton's book.
00:02gfixlergood start
00:02rbritogfixler: only a small bit.
00:02systemfaultLYAH was a good book beside one or two things.
00:02gfixlerThe friend who got me into Haskell, right as I was starting to learn Clojure rewrote my Clojure 2048 'smoosh' function
00:02gfixlerMine was maybe 10 lines; his was something like 4, and all very clear in that point-free style
00:03rbrito:)
00:03rbritosystemfault: what should I be careful about LYAH?
00:04systemfaultrbrito: Nothing, I liked 95% of it… Just hated its description of type kinds.. and when he just lists a lot of functions for no reasons at the end of some chapters (“here are some monad-related functions”)
00:05systemfaultI’m learning… just don’t dump me a list of functions and a 1 line description of them
00:06rbritoI see. Makes sense.
00:11rbritoOh, just a terminology thing: pattern matching in clojure is called "destructuring", right?
00:11brehautrbrito: nope
00:11brehautrbrito: pattern matching is a much more powerful feature
00:11akhudekhttps://github.com/clojure/core.match
00:12rbritobrehaut: I know pattern matching in scala only.
00:12rbritoakhudek: thanks for the link.
00:12brehautpattern matching has conditional behaviour based on a variety of possible structures. pattern matching also does destrructuring.
00:12brehautbut destructuring just assumes the structure matches and pulls it apart
00:13rbritoOK, great.
00:15rbritoDo I need to import/require/use something to use match?
00:17ttasteriscoyes, core.match is its own lib
00:17ttasteriscoand all those 3 words mean different things..
00:18Shayanjmactually speaking of - what're clojure best practices with regards to using import/require/use?
00:18brehautrbrito: basically you always want require except for sometimes use in a repl
00:18brehautimport is only for java classes
00:19rbritobrehaut: thanks. That's to avoid namespace pollution, right?
00:19brehautright
00:19brehautand require has :refer to import specific names anyway so it does both
00:21brehaut,(require '[clojure.set :refer [subset]])
00:21clojurebot#<IllegalAccessError java.lang.IllegalAccessError: subset does not exist>
00:22brehautfine
00:22brehautapparently i cant remember the name of function in the set namespace
00:23johnwalkermaybe subset?
00:23johnwalker,(require '[clojure.set :refer [subset]])
00:23clojurebot#<IllegalAccessError java.lang.IllegalAccessError: subset does not exist>
00:24johnwalker,(require '[clojure.set :refer [subset?]])
00:24clojurebotnil
00:24brehaut,subset?
00:24clojurebot#<set$subset_QMARK_ clojure.set$subset_QMARK_@300ec4>
00:24brehautjohnwalker: thanks
00:25sir_pineconeI'm trying to use a var/fn from within a record that implements some Java interfaces, but when I compile to a jar and run the code, I get an unbound exception. here is a gist showing a snippet https://gist.github.com/sir-pinecone/9cde707504df436c45bd ... any ideas how to fix this?
00:26sir_pinecone(i'm a clojure noob :P)
00:26johnwalkeryou're welcome :)
00:42rbritoOK, people. Thank you a lot for the help with my newbie-style questions. I feel that I am better after this discussion and I hope to be coming back to this channel soon to tell you of my experiences with the course (and potentially more silly questions). :)
00:43rbritoThanks for the warm reception, hints and tips. They were appreciated and now I have new books on my queue of functional programming to read. :)
02:00devnso, this is basically finished: https://github.com/spinningtopsofdoom/longshi
02:00devncommit coming within a couple of days which matches Fressian in features
02:23sir_pineconesleep time..if anyone can help with https://gist.github.com/sir-pinecone/9cde707504df436c45bd it would be awesome if you left a comment on the gist page. thanks!
04:42swiHello. Can i start nrepl serevr without using leiningen to use it with my cider ?
04:46i-blisswi: directly with cider-jack-in?
04:48swii-blis: well, i was thinking to run nrepl server manualy and than connect to it with M-x cider specifying host:port
04:49i-blisswi: i see, then why would you avoid lein?
04:50swii-blis: cause it start two copy of jvm and eat 17% of my 4G mem :)
04:51Glenjaminlein trampoline repl :headless
04:52swiGlenjamin: hm.. can i 'ask' cider-jack-in to run like this ? :)
04:52Glenjaminno idea, i don't use emacs
04:52Glenjamini assume it lets you pick a port, or read .lein.port
04:52i-blisswi: oh, are you on os x?
04:53i-blisif so, you should probably export LEIN_JVM_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true"
04:54swii-blis: i'm on debian
04:55swiGlenjamin: yep, this work :) Thanks
05:01figoeHi, trying to compile clojure macros in clojurescript, but the clojure libraries were down loaded... hence i get the error, "aused by: java.io.FileNotFoundException: Could not locate selmer/parse__init.class or selmer/parse.clj on classpath: "
05:01figoeI have already added selmer dependency, but the target directory is blank, except for stale/extract-native.dependencies
05:02figoeI meant the clojure (.clj) libs were not being downloaded...
05:06figoeokay, problem fixed, clj libs doesn't get downloaded for clj to cljs macros
05:07figoereferenced the wrong lib path
05:56TerranceWarriori'd like to create a headless local server in clojure that talk to other servers using the browser as the interface. what is the smallest number of steps and how for a user to download and install this headless local server?
06:07Planet_ENWhat should I use to connect to SQL Lite?
06:12ddellacostaPlanet_EN: https://github.com/clojure/java.jdbc
06:12ddellacostaPlanet_EN: I recommend HoneySQL as a DSL on top of it if you need such a thing. I recommend staying away from Korma.
06:46noidiPlanet_EN, many people seem to like https://github.com/krisajenkins/yesql
07:17donbonifaciohello
07:19donbonifaciowe're having a "functional architecture" doubt. Imagina that we have 100 use cases and a function for each one. All function should receive a context (the current user for example). Is there a better way than to have the context on every function's arbument list?
07:19nathan7donbonifacio: dynamic vars!
07:20nathan7donbonifacio: (declare ^:dynamic *ctx*)
07:20nathan7donbonifacio: (binding [*ctx* foo] (some-fn))
07:21donbonifaciogreat nathan7 ! thanks, we'll look into it :)
07:22nathan7donbonifacio: it means you don't need to pass it on all the time and such
07:22nathan7donbonifacio: and the one use case for it is pretty much 'context'
07:41hhenkelHi all
07:41hhenkelI'm trying to use the jolokia client java library described here: http://jolokia.org/reference/html/clients.html#client-java
07:42hhenkelI'm able to use J4pClient with new and bind that to "client" with new
07:43hhenkelBut once I try to do the same with the J4pReadRequest (as described in the example code in the link)
07:43hhenkelI get the following error: IllegalArgumentException No matching ctor found for class org.jolokia.client.request.J4pReadRequest clojure.lang.Reflector.invokeConstructor (Reflector.java:183)
07:44hhenkelAs far as I understand there is no constructer that matches my use case, right?
07:44hhenkelError is produced when I try it like that: (J4pReadRequest. 'java.lang:type=Memory', 'HeapMemoryUsage')
07:46hhenkelFrom the source I see that there is a constructor like this:
07:46hhenkelpublic J4pReadRequest(String pObjectName,String ... pAttribute) throws MalformedObjectNameException {
08:07hhenkelOkay, I managed to get it working....for the record, this is needed:
08:07hhenkel(new J4pReadRequest "java.lang:type=Memory" (into-array String ["HeapMemoryUsage"]))
08:38hhenkelAny hint on how to use the J4pClientBuilder described at http://jolokia.org/reference/html/clients.html#client-java => 8.2.2. J4pClient with Clojure ?
08:45hhenkelOkay, looks like this helps: http://stackoverflow.com/questions/8821751/how-do-i-create-a-java-like-object-in-clojure-that-uses-builder-pattern
09:26TimMchhenkel: Yep, that's a good approach.
09:32luxbockI'm trying to debug a situation where my Clj/CLJS web-app works fine on my local machine, but when I run it on a EC2 instance the ajax-calls I'm doing on the front end fail with net::CONNECTION_REFUSED
09:32luxbockso the first thing I'm doing is trying to see is how the request looks like
09:33teslanickWhat happens if you curl the ajax call instead of running it from the browser?
09:33luxbockit works fine
09:33luxbockI can curl the ec2-instance from my local machine and that works fine too
09:33luxbockhttps://gist.github.com/luxbock/945c8f116c5e39d63967
09:33teslanickCan you confirm that the URLs are identical?
09:34luxbockI believe so, I did check for that as well
09:34teslanick(especially that they're using the same protocol https/http)
09:34hhenkelTimMc: Thanks, that's good to know.
09:35luxbockyeah they are
09:36teslanickajax usually passes a set of headers. Could one of those be messing up the request somehow?
09:37luxbockyeah that's what I'm trying to see with my `wrap-println` function but it's not working as I thought
09:38luxbockbut I'm very new to doing anything web-related so it's possible I'm approaching this the wrong way
09:38teslanickIt's way easier to debug that kind of thing in your browser developer tools.
09:38luxbockbut I thought ring-middleware wrappers worked just like that
09:38teslanickThey have a network tab that lets you inspect requests.
09:39luxbocktrue, I guess I should just test the ajax-request on its own
09:39luxbockright now it's wrapped in a Om component that just keeps repeating the call over and over
09:40ifesdjeenhey guys, does anyone know why CojureScript compiler may say that WARNING: No such namespace: goog.string at line 9 file ...
09:40ifesdjeenweird, since i've made basically no changes to my scripts, didn't recompile them for around a week, and now that stuff happens...
09:41ifesdjeenlooks like i have some kind of dependency missing but i can't figure out which
10:08hhenkelTimMc: Any hint what to provide here when I want to provide multiple request objects (in a list):
10:08hhenkelpublic <R extends J4pResponse<T>,T extends J4pRequest> List<R> execute(List<T> pRequests,Map<J4pQueryParameter,String> pProcessingOptions)
10:10TimMchhenkel: From Clojure's perspective, generics don't exist.
10:10TimMcpublic List execute(List pRequests, Map pProcessingOptions)
10:12TimMc&(instance? java.util.List [1 2 3]) ;; hhenkel: Vectors implement the List interface
10:12lazybot⇒ true
10:12hhenkelTimMc: I tried this: https://www.refheap.com/88045
10:13hhenkelBut I get an error: J4pRemoteException Bad Request org.jolokia.client.J4pClient.extractJsonResponse (J4pClient.java:225)
10:13hhenkelIf I try the request one by one, the request seems okay.
10:13TimMcSounds like your syntax is fine, then.
10:15hhenkelHmm...
10:16hhenkelI looked in the source and it seems like the http response code is not okay, therefore the exception is thrown.
10:17hhenkelOkay, in the server log I see: Malformed request "null". Request parsing failed, Code: -1
10:18sveriHi, is there a way to do a redirect with friend when I try to access a resource that I dont have the rights to access? Currently I only get a string stating: Sorry, you do not have access to this resource. A webpage that I can configure would be nice
10:20TimMchhenkel: By the way, https://www.refheap.com/88046 might be a nicer syntax for constructor and method calls.
10:21hhenkelTimMc: Yes, absolutely. I traced what I type I get and it states it is a clojure.lang.PersistentVector
10:22sverinevermind, I finally found it in one of the examples
10:22hhenkelAlso checked that there are two request objects within....
10:24TimMchhenkel: Well, I don't know the API you're working with, so that part's up to you. :-P
10:25hhenkelTimMc: http://jolokia.org/reference/html/clients.html#client-java
10:26hhenkelTimMc: I haven't found a javadoc for it therefore I started digging around in the code.
10:26hhenkelI just tried my example with only one request in the vector and that also fails.
10:27hhenkelIf I use my code with one request and without a vector around it, it works
10:28hhenkelTimMc: In the link I provided there is this part
10:28hhenkelThe J4pClient provides various variants of a execute() method, which takes either one single request or a list of requests. For a single request, the preffered HTTP method (GET or POST) can be specified optionally. The List<R> argument can be used type only for a homogenous bulk request, i.e. for multiple requests of the same time. Otherwise an untyped list must be used.
10:29hhenkelI guess I'm doing something wrong here... :(
10:32gfrederickshhenkel: how does it fail?
10:33hhenkelgfredericks: On the server side: <Ma
10:33hhenkellformed request "null". Request parsing failed, Code: -1>
10:33hhenkeland after executing my command on the client side I see: J4pRemoteException Bad Request org.jolokia.client.J4pClient.extractJsonResponse (J4pClient.java:225)
10:34hhenkelLooking in that code I see that the http response code is the reason for the exception.
10:34hhenkelBut the question is, why is the request null...
10:35hhenkelThe easiest implementation I found for the thing I want to do is this:
10:36hhenkelhttps://www.refheap.com/88049
10:37hhenkelI decided to paste the complete class...
10:37hhenkelTimMc: ^^
10:38hhenkelL170 - L183 should be the code that get executed I guess
10:39mikerodWhy does tools.analyzer.jvm use tools.analyzer v0.2.2-SNAPSHOT when it is currently working at v0.3.1-SNAPSHOT?
10:40mikerodI'd think they'd be closer up-to-date with each other than that
10:40hhenkelgfredericks: Any idea what's wrong?
10:43gfrederickshhenkel: no, I can't look at it in detail right now, sorry
10:44hhenkelgfredericks: okay, thanks anyway.
10:44hhenkelHere is the complete code I currently use: https://www.refheap.com/88050
10:45hhenkelOnly requirement for testing it is a jvm with jolokia running (jetty, tomcat, weblogic, plain jvm)
10:46hhenkelUser/PW is only required if enabled in the container.
10:50mbriggshey guys, trying to use compojure with spyscope (latest of both), getting java.lang.IllegalAccessError: in-seconds does not exist, compiling:(ring/middleware/cookies.clj:1:1). if I remove spyscope from my profiles.clj, everything is cool. Bit of a clojure noob, not sure how to fix it
10:50Bronsamikerod: I just forgot to bump the dep in project.clj, fixed now
10:50Bronsamikerod: btw project.clj is only there for dev conveniency, it's not actually used for deployment. t.a.j 0.3.0 depends on t.a 0.3.0
10:58mikerod_Bronsa: Oh, thanks that's helpful to know
10:58mikerod_(I was disconnected)
10:58mikerod_I saw your 2 comments concerning the deps though.
11:00hhenkelHow do I need to call a method that looks like this from clojure? public <R extends J4pResponse<T>,T extends J4pRequest> List<R> execute(List<T> pRequests) throws J4pException {
11:00hhenkelFull code is at: https://www.refheap.com/88049 line 180
11:01hhenkelI just used wireshark and it looks like the post request is empty when I try something like https://www.refheap.com/88050
11:02mikerod_hhenkel: what do you mean how to call it?
11:02mikerod_it looks like you are calling it
11:02hhenkelmikerod_: I meant "What it the correct way to use it?" as I keep failing with my request on the server.
11:03hhenkelUsing a different implementation that executes a get request is fine, I get back data.
11:04hhenkelBut as I want to fetch multiple values I currently fail. So I was wondering what might be wrong.
11:04mikerod_I wouldn't think anything is wrong with the way you are calling it from a "how does clj call it standpoint"
11:04mikerod_I can't really say if the arguments you are passing are correct or if the rest is set up right, since I don't know what any of this does/is supposed to do
11:08hhenkelmikerod_: I updated https://www.refheap.com/88050 with a working example.
11:11MaxDHHi! I'm pretty new to Clojure and using Prismatic Schema and I'm having an issue with schema/explain, I am able to use schema/either where some of the options are hard coded such as: (s/either s/Int "" "NA") and I can validate inputs against this successfully. However if I try to call s/explain on this I get an illegal argument exception (no implementation of explain found for java.lang.String) as some of the options are hard coded. Does anyone know if there is
11:22TimMcMaxDH: "either" is weird, one of my coworkers just ran into something with it
11:22TimMcBy the way, your message is cut off after "if there is".
11:23MaxDHTimMc: Thank you, and the cut off message: Does anyone know if there is a way to still use explain and get around this?
11:23hhenkelTimMc: One last question....found some code example (in a test): List resps = j4pClient.execute(Arrays.asList(req1,req2),params);
11:24hhenkelTimMc: Do you know what the equivalent for "Arrays.asList" is in clojure?
11:24rurumateseq?
11:25TimMchhenkel: THat's just a Java-ism for making a List in-place.
11:25rurumatehhenkel: I advise you to experiment in the repl
11:25hhenkelrurumate: Thanks for the advice....I'm doing it: https://www.refheap.com/88050
11:25bbloomarrdem: 20s slower? how long did it use to take?
11:26hhenkelTimMc: So, you're still convinced that using a vector in my case is the thing to do?
11:26TimMcWell, I see no reason not to.
11:26arrdembbloom: the existing code successfully loads all of core in ~25s, the patch fails halfway though loading core in ~30+ s
11:27bbloomarrdem: crazy. something must be wrong...
11:27hhenkelTimMc: hmm, okay thanks.
11:27hhenkelrurumate: Any suggestions?
11:28hhenkelrurumate: Corresponding code used in the library: https://www.refheap.com/88049
11:28TimMcMaxDH: Actually, the thing I'm thinking of may be unrelated. Are you using schema coercion? Apparently Either uses backtracking, so your coercer *may* be given already-coerced output (it needs to be idempotent.)
11:28arrdembbloom: Bronsa was proposing that chunking could be enough of a win that the vector representation is able to do better but we were both pretty shot and didn't play with it.
11:28bbloomarrdem: can you look me to the "outer loop" of the code?
11:29bbloomarrdem: and are you using reducers?
11:29bbloomreducers would be much better than chunking for that outer loop
11:29arrdemworking on the first, neg to the second
11:30MaxDHTimMc: I'm not (consciously) using any coercion
11:32arrdembbloom: https://github.com/clojure/tools.emitter.jvm/blob/7b6896dfc42119aebbc34eb5c636c14492402865/src/main/clojure/clojure/tools/emitter/jvm/emit.clj
11:33TimMcMaxDH: Probably unrelated, then.
11:33TimMc(I have not used the library myself.)
11:33arrdembbloom: the "outer loop" is mutual recursion between the -emit multimethod, the emit function and the emit-class function. we have to flatten all exit case in emit-class, so we do so, and emit flattens because we were encountering stack overflows in concat if we didn't.
11:34bbloomarrdem: *scratches head* i can't really study this at the moment, but i'm sure there's some way to speed it up dramatically :-)
11:35arrdembbloom: heh you and me both. I'll check out reducers, been meaning to for a while anyway.
11:35MaxDHTimMc: Ok, thank you anyway for replying and giving it some thought.
12:11gill_anyone have experience with digitalocean 1cpu/512mb and running a basic clojure web app?
12:13arrdemgill_: I ran the 1st iteration of my blog off of a laptop with equivalent specs for 18 months. it took 100K req/sec like a champ.
12:14arrdemymmv
12:16gfredericksyour mileage may be very good
12:17ziltiIs there a neat way to test core.async stuff with midje? All I came up with so far is a blocking read from a channel, but that's kinda problematic, and embedding a fact inside a go-block breaks core.async
12:17gfredericksproblematic?
12:18ziltigfredericks: Well, if the fact "fails" I have to kill midje and restart it
12:18gfredericksyou do?
12:19ziltigfredericks: Plus it seems that sometimes it just blocks forever even if it shouldn't (or I haven't understood mult/tap)
12:19gfredericksyou can use a timeout channel
12:32gill_arrdem: thanks, good to know
12:33gill_5$/mo is hard to beat, I want to move off my dev box and use something public
12:39gill_my concern is that java takes up like 400-600MB ram, at the least
12:42technomancygill_: at heroku the default size is 512MB. it's common for JVM apps to have to bump up to a larger size, but simple clojure apps run fine.
12:42FrozenlockWait, what did I miss? What is $5/mo?
12:42technomancyFrozenlock: Taco tuesdays!
12:42mdeboardbbatsov is everywhere i look lately
12:42mdeboardpuppet-mode, clojure-mode
12:43arrdemFrozenlock: digitalocean's smallest VM.
12:43FrozenlockTacos, perfect solution to... dev box transitioning.
12:43mdeboardi had fish tacos yesterday
12:43technomancyheh, he's ... extending the menu-bar entries? okay.
12:44FrozenlockOh, interesting. 5$/mo is pretty sweet indeed.
12:44gill_yea i think so
12:44gill_okay great, I guess I'll spin one up and see how it goes
12:45gill_`I wonder what they use on the back end for virtualization
13:04robotblakegill_: They use KVM, they don't let you boot your own kernels though, you have to use kexec trickery :(
13:05arrdemthis also means you can't use arch because they have to maintain a fork of the arch kernel package T_T
13:06gill_ah okay
13:10ziltiAm I the only one who finds it a bit paradox that core.async's mult and pub mechanisms are synchronous?
13:12mdeboardprobably
13:13TimMc&(map class (for [i (range 5)] (clojure.set/union #{1 2} (range i)))) ;; ystael
13:13lazybot⇒ (clojure.lang.PersistentHashSet clojure.lang.PersistentHashSet clojure.lang.PersistentHashSet clojure.lang.Cons clojure.lang.Cons)
13:14bbloomzilti: making concurrency understandable with synchronous operations is kinda half the point
13:16ziltibbloom: Yes, but I assumed that mult and sub would work asynchronously, since, you know, it's core.*async*. Instead it synchronously waits until every subscribed channel has read the value before it writes to the next chan
13:17bbloomzilti: https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L703-L705
13:18ziltibbloom: Exactly.
13:18bbloomzilti: it's about back pressure
13:18bbloomwithout that property, you have unbounded buffering
13:18teslanickI believe the recommendation is that if you want non-blocking with pub/mult, you should use buffered channels.
13:18bbloomright, what teslanick said.... which is also true of all channel operations
13:19arrdemTimMc: the winner of the obfuscated clojure contest will write code using only the java standard library and Clojure interop. it'll be amazing. in place updates everywhere.
13:20teslanickcore.async is basically a set of abstractions to make working with queuing (an asynchronous-by-definition problem) appear synchronous.
13:25gfredericks,(clojure.java.api.Clojure/var "clojure.core/first")
13:25clojurebot#'clojure.core/first
13:25gfredericks,(.invoke (clojure.java.api.Clojure/var "clojure.core/first") '(7 8 9))
13:25clojurebot7
13:27shanemhansenWithout backpressure you have re-invented node.js. poorly.
13:29shanemhansenThere are good arguments that synchronous appearing code is the easiest to reason about. (CSP, etc)
13:44seangrovekwargs?
13:45seangroveclojurebot: kwargs |is| are a bad idea.
13:45clojurebotOk.
13:45seangrovekwargs?
13:45clojurebotkwargs is are a bad idea.
13:45seangrovelgtm
13:45TimMcclojurebot, forget kwargs |is| are a bad idea.
13:45clojurebotI forgot that kwargs is are a bad idea.
13:46arrdemkwargs |are| a bad idea should work
13:46TimMcclojurebot, kwargs |are| a bad idea.
13:46clojurebotOk.
13:46TimMc~kwargs
13:46clojurebotkwargs are a bad idea.
13:46TimMc:-)
13:46Glenjaminis that the map-last-position type, or the splatted type, or both?
13:46seangrove(inc TimMc)
13:46lazybot⇒ 63
13:46seangroveGlenjamin: splatted type
13:46TimMcclojurebot, clojurebot |accepts| arbitrary verbs
13:46clojurebotc'est bon!
13:47Glenjamini wonder who'd win if we took the bots from various language's channels into some sort of irc-bot-off
13:48arrdemGlenjamin: first you'd have to define a "bot contest"..
13:48seangrove~(learn 'kwargs "kwargs are just a bad idea")
13:48clojurebotGabh mo leithscéal?
13:48arrdemI don't think that a contest at maintaining karma is "winnable" :P
13:50seangroveproj
13:57TEttingerheh, my lazybot fork adds quote grabs from supybot (a commonly requested feature in non-language channels), all sorts of last seen or last message with text functionality, and a few other features I can't remember
14:13aaelonyBeen playing around with reading csv files with read-csv. For some reason, read-csv and reducers map don't play nice together unless there is a final call to into. Any reason why this is? https://www.refheap.com/88058
14:16bbloomaaelony: reducers just build up a "recipe" for a reduction, they don't actually do anything until you kick-it-off with something like into
14:16aaelonybbloom: many thanks, that makes sense
14:39shanemhansenI've been having a *really* good time with clojure for the last few days. First serious use of lisp despite being an emacs user for 10 years.
14:39shanemhansen</gush>
14:40puredanger_aaelony: I recently updated the http://clojure.org/reducers page - if that doesn't help you understand it, would be happy to learn of gaps
14:41gfredericks,(defn unapply [f & args] (f args))
14:41clojurebot#'sandbox/unapply
14:41tjdI've noticed that a lot of active members of the Clojure community are either consultants or freelancers. Why is that? Is is attraction to the diversity of projects?
14:43amalloygfredericks: you forgot to do the variadic unrolling; how will this version ever make it into core?
14:43amalloyhttps://www.refheap.com/2b192ca3397c62b5e6aef56f1
14:44gfredericksamalloy: thank goodness!
14:44gfredericksI exercised variadic-unrolling-vigilance on a jira ticket a month or two ago
14:44gfredericksfor clojure.core/update
14:45puredanger_and we thank you :)
14:45gfredericksalways stay alert
14:46gfredericksthat "factor out the unrolling" ticket is probably one of the more fascinating ones I've seen
14:46arrdemgfredericks: link?
14:47gfredericksman it's an oldy but a goody.
14:47gfrederickshttp://dev.clojure.org/jira/browse/CLJ-731
14:48gfredericksman now it's got me thinking about it again
14:49amalloyyeah, it's such a hard problem. i remember trying to figure out an approach and giving up
14:50gfredericksyou'd want it to apply to single-level unrolling as well as double
14:51amalloyyeah, juxt and comp are brutal
14:51gfredericksit HAS to be general because what if somebody comes around and wants to do three levels but you just wrote the two of them THEN WHAT
14:54hiredmanobviously it needs core.logic
14:54amalloyalthough really, gfredericks, i don't think you want to be general like that. you want to only handle one-level, but in a way that you can just call this unroller twice for juxt/comp
14:59vermahow do I check if an object is a javascript null? (nil? x) doesn't seem to catch it
14:59vermajust null?
14:59gfredericksamalloy: let's use core.async and have the unroller send messages with different arities
14:59vermanull seems to work, but clojurescript while compiling is compalining about undefined "null"
15:00vermabut yeah, its not really javascript null, because the (= v null) is failing
15:01technomancyverma: js/null maybe?
15:02hiredmanverma: what makes you think nil? isn't working?
15:02amalloyyeah, i think that's exactly what nil? is supposed to do. maybe your object is actually js/undefined
15:03amalloyin which case nil? is correct in returning false
15:03vermatechnomancy, js/null isn't working
15:03gfrederickstechnomancy: what happened to that lofty idea for an entirely in-browser rewrite of leiningen?
15:03vermahiredman, I am making sure
15:03amalloytechnomancy: it's okay, surely with *three* people who've never used cljs we'll figure this one out
15:03technomancygfredericks: gonna give me nightmares
15:03technomancyamalloy: bahaha
15:04amalloy$google emperor's nose story
15:04lazybot[The Emperor of China's Nose - The Imaginatorium] http://imaginatorium.org/stuff/nose.htm
15:04vermahiredman, technomancy, my bad nil? seems to work, sorry
15:06technomancyone thing I don't understand about web people is how greasemonkey type stuff isn't standard issue in every browser everywhere
15:07technomancydo people just not want to fix problems in websites they visit?
15:07technomancyI guess there's some primitive user-level stylesheets you can apply
15:07technomancybut the lack of imagination is really boggling
15:08gfrederickshttp://www.marriedtothesea.com/070814/the-land-of-cascading-style-sheets.gif
15:08shanemhansentechnomancy, I'm confused. firebug and chrome developer tools give you an in-browser repl.
15:08bbloomtechnomancy: i don't particularly want to have to maintain patches for rapidly changing minified code....
15:08shanemhansenFor scripts both browsers make it pretty easy to make user scripts.
15:09technomancyshanemhansen: I've never heard people actually talking about doing this
15:09bbloomtechnomancy: web technologies are just too bad to justify changing complicated crap
15:09technomancyI guess part of it is because FF profiles are so broken and automation-resistant
15:10bbloomit's like how everybody says "oh, it's open source! you can just add the features you want!"
15:10bbloombut then you need to figure out how to compile that shit, and manage the modified package, and nevermind the fact that the C code looks like it was written by an 8 year old
15:10technomancyand people look at me weird when I say I do everything in emacs
15:11benkaylook weird back at them
15:11technomancybbloom: the tools are all there though. it's just a tragic lack of imagination afaict.
15:11technomancybenkay: this is me, doing that. =)
15:11benkayi'm fixing a bunch of lighttable indentation right now
15:12bbloomtechnomancy: "tragic" maybe, but surprising? not at all
15:12shanemhansenI agree. The tools are all there. I've occasionally ran scripts that fired when I went to a specific web page. I edited some sort of random user.js or prefs.js in firefox do to that.
15:12technomancylike... the key bindings on twitter are terrible; I'm always fav'ing stuff by accident. in emacs, I'd view the twitter-mode-map, and rebind the F key.
15:13gfrederickstechnomancy: why don't you ever fav my stuff by accident
15:13bbloomtechnomancy: i was face palming so hard at the hacker news comments on the mathematica 10 announcement post.... people were like "it's open source, and therefore it is shit" and nobody realizes that they can have a fucking lisp-machine dream for a hundred bucks
15:13technomancygfredericks: I started browsing twitter with js turned off
15:13technomancygfredericks: also kept me from going beyond one page of history, which was actually a benefit
15:13gfrederickshah
15:14bbloomtechnomancy: there's this assumption that because massive creativity and the output of decades of effort exist, that everybody should just go around makign everything more awesome for themselves and everybody else all the time
15:14bbloombut in reality, it's just not that easy
15:14jephree:yogthos is there a way to redefine the second curly brace when using selmar e.x. <<var>> instead of {{?
15:14technomancybbloom: there are smalltalk users who are stuck using web browsers today
15:14jephreeyogthos: is there a way to redefine the second curly brace when using selmar e.x. <<var>> instead of {{?
15:14bbloomtechnomancy: yeah, you can't tell me that those people "lack imagination"
15:14bbloomtechnomancy: it's just that browsers *fucking suck*
15:14technomancyare they just too weighed down with the burden of shame in the entire industry to do anything sensible?
15:14gfredericksbbloom: bits don't rot so things can only get not-worse!
15:14benkayis there a clojure community standard about excessively long lines?
15:15benkayi'm trying to compress a lighttable collaborator's work into ~86 cols so that I can use magit without linebreaks
15:15bbloomtechnomancy: C sucks too, which is another part of the problem
15:15technomancybenkay: it's not a clojure thing, it's a "decent human being" thing
15:16technomancybenkay: or a "I actually use an editor/wm that lets me see more than one file at a time" thing rather
15:16benkaytechnomancy: see i like this guy and he's actually a bang-up programmer, but he does come from IDE and tab-land
15:17technomancybbloom: so are there fragments of broken dreams littering the landscape?
15:17technomancyis greasemonkey one of them1?
15:17gfredericksclojurebot: greasemonkey is one of them1
15:17bbloomtechnomancy: http://userscripts.org:8080/ returns "This website is under heavy load"
15:17clojurebotAck. Ack.
15:18bbloomtechnomancy: the web has just diverted all the creative energy of an entire generation in to a different direction, it will swing around again eventually
15:18technomancybbloom: if you want to fix twitter.com, the easiest way is to move to SF and get a job with twitter?
15:18Frozenlockbbloom: isn't the other direction the 'mobile' thingy?
15:19bbloomtechnomancy: argh. terrible, isn't it?
15:19benkayhere's to the mobile thingy!
15:19bbloomtechnomancy: there was a common internal-mailing-list thing at microsoft that made me aaaaaanngggrrrry.
15:19bbloomtechnomancy: if somebody gave feedback that a particular team had heard one too many times, or if you just didn't say your feedback quite right...
15:19bbloomtechnomancy: you'd get somebody replying with a URL: http://careers
15:20bbloomwhich was the intranet page for internal team transfers, essentially
15:20technomancyhehe
15:20bbloombenkay: at least mobile is reminding people what software CAN BE LIKE
15:20technomancythough on the bright side, html/js UIs means more API-driven applications, which means it's easier to just throw up an elisp version
15:20bbloom(ie attractive and smooth)
15:21Frozenlockbbloom: walled garden?
15:21technomancybbloom: for a long time I used mobile.twitter.com on my laptop. way faster, no hashbangs.
15:21bbloomtechnomancy: two steps forward, one step back.... grumble grumble http/rest/json/apis
15:21bbloomFrozenlock: doesn't bother me at all that your ios app doesn't work on android, or vice versa. matching the platform look and feel is worth it to me... as a user
15:22FrozenlockI can understand that. But I don't like the look and feel of those platform :-p
15:23bbloomif apple went out of business tomorrow, and suddenly all ios apps magically stopped working... half the world would take a collective vacation, while the other half the world ported all their apps to android fast enough that by christmas nobody would remember the event ever happened :-P
15:23technomancyI think of software these days as being like what it would have been like for literacy if handwriting never existed.
15:24technomancyliteracy means everyone can read, but writing is something you need a printing press for
15:24FrozenlockEveryone can use software, but only a few can actually code?
15:25Frozenlock(just to be sure I understand right)
15:25technomancyFrozenlock: because you can't just grab a piece of paper and scribble on it
15:25ivanhttps://greasyfork.org/ is the new userscripts
15:25bbloomtechnomancy: i'm not so sure that universal ability to write has produced significantly more/better literature :-P
15:25technomancybbloom: it's not about literature, it's about empowerment
15:25bbloombut i get your point
15:25bbloomyeah
15:26technomancybbloom: did you see this? http://www.papert.org/articles/ACritiqueofTechnocentrism.html
15:26bbloomtechnomancy: no
15:27technomancyI think professional programmers bring their own biases to the question of code literacy because we're constantly thinking about long-term maintainability, while most people are happy to write throw-away code and are interested in the specific artifacts of its output
15:27technomancyivan: thanks, I'll take a loot
15:28technomancylook
15:28bbloomtechnomancy: that's certainly true, and one of the reasons i'm interested in language/library designs that encourage experimentation, but scale smoothly, even given naive usage
15:28ivanand a word of caution: the thing everyone uses for scripts in Chrome, tampermonkey, is not FOSS
15:29technomancyivan: ah, shitty
15:29technomancyis it fairly divergent from greasemonkey?
15:29technomancyI've ditched chrome anyway
15:29ivanit used to be; the author changed it, he might go back
15:29ivan(FOSS)
15:29ivanI don't know about divergence
15:29ivanit should be very close
15:29technomancycool
15:30technomancynow if only I could figure out how to put firefox dotfiles into version control =(
15:30ivan"write Firefox profile generator" has been on my todo list for about two years
15:30technomancyit's sooooo bad
15:31technomancythe other day I moved my FF profile out of the way to experiment with it
15:31technomancywhen I moved it back and relaunched FF, it deleted all my history
15:31ivantechnomancy: was the old Firefox still running when you moved it?
15:33ivanI don't think that should happen normally but I have not tested
16:08TimMctechnomancy: The new versioning scheme makes it even worse -- you can't easily tell when a Firefox (or THunderbird) upgrade will break your profile for downgrades.
16:10hhenkelHi all, I allready wrote this afternoon and I'm still struggling with some issue.
16:10technomancyTimMc: it's not bad on debian. =) upgrade -> it's fine, dist-upgrade -> gonna break.
16:10technomancyivan: I don't think so, but maybe by accident.
16:10hhenkelI made an easy to follow setup to check my issue out: https://www.refheap.com/88062
16:11hhenkelI would really appreciate if someone could have a look and tell me what is wrong.
16:14hhenkelI allready traced with wireshark and all I see is that there is no post request data as far as I can see.
16:15vijaykiranhhenkel: I get Unmatched delimiter: ), compiling:(/private/tmp/jolokia-test/jol-test/project.clj:8:23)
16:16vijaykiranhhenkel: let me try with copy pasting just the code
16:18hhenkelvijaykiran: any luck with c&p ?
16:18vijaykiranhhenkel: yeah - I'm able to reproduce the same error .. so that's the first step
16:20hhenkelvijaykiran: http://www.jolokia.org/reference/html/clients.html#client-java => search for "The J4pClient provides various variants of a"
16:20hhenkelFor my understanding of the docs, the javadocs and the source I should be able to use a list.
16:21hhenkelBut maybe I get something completly wrong...
16:21glitch83anybody know if I future something and then drop scope (destroying the variable) whether or not the future will complete??
16:21lazybotglitch83: What are you, crazy? Of course not!
16:22glitch83lazybot: are you real?
16:23llasramlazybot: Is glitch83 for real???
16:23lazybotllasram: How could that be wrong?
16:24llasramglitch83: I don't futures are not canceled if they go out-of-scope
16:24glitch831llasram: alright ;-) I don't trust bots is all
16:29hhenkelvijaykiran: Any idea what I do wrong?
16:29boxedis there any lib to make multiple changes to a bit map easier? I find ->, assoc, dissoc, update-in, etc to become rather clunky when the complexity grows a bit
16:30boxedbig map, not bit map -_-;
16:34dbaschboxed: how is a big map different from a small map in that sense?
16:35boxedit’s not just {:foo 1 :bar 2 :baz 3} but has nested maps, vectors etc
16:37boxedso concrete example: http://cljsfiddle.net/fiddle/boxed.foo
16:38dbaschboxed: I would use the above functions as primitives to build functions to alter that specific map schema
16:38dbaschboxed: or create a protocol if you want to be more OO
16:42boxedthat’s what I’m doing, but it seems like I’m writing a lot of the same hard to read and verbose code over and over
16:43boxedif you reload the fiddle I’ve added an example of the code I have to do the transformation now, and below what I’d like to have in some kind of pseudo code
16:45aaelony13:42 *** glitch83 QUIT Read error: Connection reset by peer
16:45amalloyi can understand the code you wrote, but your pseudo-code is a complete mystery to me. even looking at the real code, i can't figure out a scheme that makes the pseudo-code correspond to reality
16:46boxedyea, it’s a bit vague in my mind still heh… basically I want to give some path into the map, that’s the vector arguments in my pseudo-code, and then some transformation on that, which is the rest
16:48boxedupdate-in is nice and all, but the paths it supports are pretty limited
16:48amalloythat's literally update-in. the problem is your "*" variable, which basically corresponds to "magic", and the loose way you hope to deal with arguments. i'd favor the explicit update-in heavily over having to learn a dsl to work with maps
16:48boxedI’d like to have wildcards in the path for example
16:48Raynesboxed: I think we know each other.
16:49boxedraynes: the irclj guy?
16:49RaynesOh right
16:49RaynesYou've been complaining about documentation.
16:50boxedraynes: well, complaining makes it sound so dirty :P I’ve also written a chat bot and put that code on github so there’s an example for people to look at. I think that’s pretty close to helping more than complaining :P
16:51RaynesBut it's easier if I just think of you as an angry consumer.
16:51boxedamalloy: do you get my drift about the wildcard path handling? like “for all paths into this map that matches ‘foo/*/bar’ do baz”
16:51boxedraynes: heh, well since I didn’t pay I’m certainly not a customer
16:51amalloyyes, but i think that what you want it to do in that case is basically magic
16:52RaynesThat doesn't seem particularly magical.
16:53boxedamalloy: eh? why? just “if the object denoted at * is a non-sequence, throw an exception, otherwise apply the transformation on each item of that sequence”
16:53RaynesAnyways, I'd just update-in an update-in at the level where you want to update-in *.
16:53Raynes:D
16:53boxedthat’s what I have now, but it’s fugly as hell
16:53stuartsierraDidn't somebody write an Enlive-like thing that works on arbitrary data structures?
16:53RaynesI agree that the wildcard feature would be cool, but I'd definitely rather that not be a supported feature of Clojure's update-in.
16:54RaynesIt'd make it significantly more confusing.
16:54RaynesAlso, you should try doing any sort of *-in thing in Python.
16:54RaynesYou'll be humbled.
16:54boxedsure… I’m asking for something else clearly :P
16:54Raynes:<
16:56boxedstu: can you remember the name?
16:57Raynesboxed: If you press 'tab' after typing the first few letters of a nickname, chances are your client will expand it to the full name of that person.
16:57RaynesThe usefulness of this is that when you say a person's entire nick, it often pings them so they notice you're responding to them.
16:58bbloomboxed: "lenses" may be related to what you're thinking of
16:58stuartsierraboxed: no
17:00boxedcool, I’ll look into lenses… bbl for more help I’m sure :P thanks guys
17:04TimMctechnomancy: Unfortunately, that's not true for add-ons. Upgrading icedove breaks compat with Lightning (calendaring add-on) and downgrading doesn't work. I had to restore from a week-old backup.
17:05hhenkelvijaykiran: Did you find anything?
17:06hhenkelanyone else willing to give it a shot? https://www.refheap.com/88062
17:17vermaanyone here use vim-clojure-static, I'd like to see how people configure it
17:20FrozenlockRaynes: I've been amazed recently by how insanely superior tokumx is to mongoDB. (And it's a drop-in replacement). You might want to take look if you haven't already.
17:21RaynesI don't use mongodb because I want to as much as because I used it a long time ago and now it's too hard to change to postgres.
17:22vijaykiranhhenkel: did you try the plain Java API ?
17:23FrozenlockRaynes: Sure, but for your legacy project it 'might' be worth it.
17:23RaynesI don't actually have problems with mongodb for my legacy project though.
17:24amalloyyeah, i don't know why Raynes would want to switch
17:24Frozenlockdisk space would be one reason.
17:25RaynesI have enough disk space for about... 15 or so years of growth at the rate refheap gets pastes.
17:25FrozenlockBut if everything's fine, let it be. No reason to lose time on this.
17:25FrozenlockNice!
17:25amalloyRaynes: i think you can go infinite. linode gives you free disk faster than refheap uses it up
17:25vijaykiranhhenkel: I get the same error using the JavaAPI directly
17:25RaynesIndeed.
17:25technomancyrefheap's gonna hockeystick though
17:26amalloysome people would like to hockeystick mongodb
17:26RaynesI could clear up a ton of disk space instantly by deleting all the 40k or so bot-created forks when I was dumb enough to use a GET request for forking.
17:26technomancyright after it pivots to a mobile latté-tracking app for moms
17:26FrozenlockMy mongoDB started acting up after ~20gb :-(
17:29dbaschFisher Price should market MongoDB as "My First Database"
17:31RaynesMongoDB was indeed my first database.
17:31RaynesHence refheap.
17:31RaynesAbsolutely 100% want to move to postgres, just that I don't feel like it and nobody else wants to do it either :P
17:33amalloythe thing about postgres is some of the letters are too close together. i typo it as postgers
17:33amalloyit's worth it to use mongodb if i don't have to deal with that
17:33vijaykiranhhenkel: when sending multiple requests - I get a 302 back. I'm not familiar with this api - so I guess you should first try the JavaAPI directly to get the behaviout you want
17:33technomancythe other annoying thing is that sometimes it's pg, sometimes it's postgres, and sometimes it's postgresql
17:33amalloytechnomancy: don't forget psql
17:33technomancyit's like ... make up your mind
17:34technomancyamalloy: exactly!
17:34amalloyi vote we standardize on postgers
17:34gabnexwhat lisp is most functional (as in leaning toward the functional programming side, not bein the least dysfunctional :) )
17:34gabnexis it clojure? sheme?
17:34gabnex+c
17:35technomancygabnex: iirc r5rs scheme doesn't have any data structure mutation functions in the spec
17:35amalloyliskell, naturally
17:36arrdemtechnomancy: whaaaa no way.
17:36technomancy"most functional" is not a very useful notion since you can just take away non-functional features till there are none left and technically still have a language
17:36amalloytechnomancy: most functional lisp is lambda calculus
17:36technomancyarrdem: setcar! and setcdr! are from an sfri iirc
17:37technomancyyou can still mutate bindings though I think
17:37dnolen_technomancy: the mutation ops are in the spec far as I can tell - http://www.schemers.org/Documents/Standards/R5RS/r5rs.pdf
17:38dnolen_gabnex: Clojure is likely the most functional lisp available today
17:38technomancydnolen_: oh dang, true. they just don't have !
17:38caternwhat about shen
17:38caternwhat now!!!
17:39arrdemtechnomancy: nope. set-car/set-cdr are r5rs standard
17:39arrdempage 26
17:39technomancyI am disappoint
17:39arrdemI'm not... the traditional lisps are all about car/cdr manipulation
17:40technomancymaybe it's mutable strings I'm thinking of
17:40technomancyarrdem: you dare sully scheme by associating it with MACLISP derivatives?
17:40arrdemtechnomancy: yep strings don't have update in place it seems
17:42dnolen_catern: shen is less batteries includes for functional programming as far as data structures
17:42dnolen_s/includes/included
17:42caterndnolen_: the less it can interact with the external world, the more functional it is
17:42caternso i rest my case
17:42arrdemwat
17:45arrdemdnolen_: have you wroked with shen? I looked at it just before I got into Clojure and went with Clojure because of the library support/community
17:46mikerodWhat's the magic behind this: (defrecord MyTest [x] java.lang.Object (bogus/toString [_] (str x)))
17:46mikerod(.toString (->MyTest 2)) := "2"
17:46mikerodIt looks like somewhere along the way
17:46mikerodThe method name doesn't care about things before "/"
17:46Bronsamikerod: deftype* just ignores the namespace of method names
17:46Bronsamikerod: it's in the compiler
17:46mikerodBronsa: I haven't found where this happens
17:46mikerodI was digging around the compiler
17:46amalloymikerod: the compiler just calls name
17:46arrdemmikerod: Symbol/name gets used
17:47amalloyor probably not the compiler, but the code in core_deftype
17:47mikerodamalloy: ah
17:47mikerodI was trying to find a line that did that
17:47mikerodand failed
17:47mikerodI figured it was a Symbol.name thing
17:47Bronsaamalloy: pretty sure it's in the compiler
17:47mikerodIs this just by mistake?
17:47mikerodor is there a good reason for it
17:47amalloymikerod: no, it's an important feature!
17:47Bronsamikerod: well, method names can't be namespaced
17:48mikerodI noticed we had a bogus macro doing something like `(toString [~'this] <etc>)`
17:48amalloyotherwise, macros expanding to defrecord would be hellish to write: `(defrecord Foo [~@xs] Object (toString [this#] "x"))
17:48mikerodamalloy: exactly, we have that
17:48mikerodbut I feel like that is just wrong
17:48Bronsayou'd have to write ~'toString
17:48amalloyright. and it should be allowed. the alternative is too horrible to contemplate
17:48mikerodTo me it is weird that code that you generate is bogus, but it works :P
17:48amalloywho says it's bogus? so far just you
17:48mikerodbogus/toString
17:49mikerodjust gets coerced to toString
17:49Bronsamikerod: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L7889
17:49amalloyso?
17:49clojurebotso is (add-to-list 'erc-keywords '("\\bso\\b" erc-default-face))
17:49mikerodbut macroexpand shows you the bad code, so it is just misleading
17:49arrdemlol clojurebot
17:49mikerodamalloy: it has helped us by accident as well. I just think it is a very weird "feature" :D
17:49Bronsa,(foo/.toString []) ;; mikerod
17:49clojurebot"[]"
17:49mikerodoh...
17:49mikerodI didn't know it went that far
17:49amalloymikerod: a lot of clojure code ignores namespaces in contexts where it can't possibly make sense
17:50mikerodI suppose that is fair
17:50amalloyand you generate "bogus" code all the time, as Bronsa has just demonstrated
17:50mikerodOh, I didn't see this "dotname.name" piece
17:50mikerodthanks for that Bronsa
17:51amalloymikerod: i wonder: when you write a macro that expands to a use of & destructuring, do you write ~'&?
17:51mikerodOk, so lesson learned. It is acceptable to do `(toString [~'this] <blah>) sort of things
17:51amalloyi did that for a while, and then discovered you don't have to
17:51amalloy,`(foo & bar)
17:51clojurebot(sandbox/foo & sandbox/bar)
17:51Bronsaamalloy: heh, nobody actually thinks about why that works
17:52amalloyBronsa: it's actually *not* because the compiler calls name on &, thus ignoring the namespace
17:52BronsaI didn't either until I tried to understand why & in the special symbol table
17:52Bronsais in
17:52mikerodamalloy: that is different if syntax-quote leaves it alone
17:52amalloyoh, is it? that makes sense
17:53amalloymikerod: sure, but did you know before just now that syntax-quote leaves it alone?
17:53Bronsaamalloy: yep ##(special-symbol? '&)
17:53lazybot⇒ true
17:53mikerodamalloy: debatable :)
17:53mikerodI never thought to ~'&
17:53amalloy`(foo bar/& baz)
17:53mikerodbut I never tried to look at it either
17:53amalloy,`(foo bar/& baz)
17:53clojurebot(sandbox/foo bar/& sandbox/baz)
17:54mikerodSo, I guess the main take away is the "ignore Symbol.ns when it doesn't make sense" is a feature I can rely on
17:54mikerodfor macros like `defrecord` or similar
17:55mikerodI was about to run around fixing macros expanding to this stuff
17:55amalloymikerod: except in binding contexts like let and fn, where symbols' namespaces are illegal on purpose to prevent you making any mistakes
17:55mikerodamalloy: yeah, those make sense
17:56mikerod`(defrecord myr [x] Object (toString [_] "hello"))
17:56mikerod,`(defrecord myr [x] Object (toString [_] "hello"))
17:56clojurebot(clojure.core/defrecord sandbox/myr [sandbox/x] java.lang.Object (sandbox/toString [sandbox/_] "hello"))
17:56mikerod,`(defrecord myr [~'x] Object (toString [~'_] "hello"))
17:56clojurebot(clojure.core/defrecord sandbox/myr [x] java.lang.Object (sandbox/toString [_] "hello"))
17:57amalloy(inc Bronsa)
17:57lazybot⇒ 29
17:57mikerodSo you still need to ~' the params right?
17:58amalloywell, often you probably want to gensym them instead
17:58amalloyi had just assumed there was a special case in ` for & somewhere; it never occurred to me it's counted as a special symbol
18:00mikerodI see
18:01mikerodwell thanks for the advice on this stuff
18:01mikerod(inc Bronsa)
18:01lazybot⇒ 30
18:01mikerod(inc amalloy)
18:01lazybot⇒ 147
18:02erdoshello everybody. in data.clj:75 says (extend nil Diff ...) what does (extend nil.. ) form mean?
18:03Bronsaerdos: that's how you implement a protocol for nil
18:04stuartsierraerdos: It means the methods of the `Diff` protocol will use the implementations in the `extend` when called with `nil` as their first argument.
18:04erdoswow great thanks
18:13dnolen_arrdem: only toyed around with it, it's conceptually pretty cool, but Clojure seems more useful to me.
18:20cespareIs it possible to get at a tag using a macro when the type hint is, say, in a function param or a let? (In the same way the compiler can.) http://pastie.org/9375498
18:24Bronsa, (defmacro x [x] (-> &env (find x) first meta :tag))
18:24clojurebot#'sandbox/x
18:24Bronsa,(let [^String a ""] (x a))
18:24clojurebotjava.lang.String
18:24Bronsacespare: ^
18:25cespare&env? what is this magic
18:25lazybotjava.lang.RuntimeException: Unable to resolve symbol: env? in this context
18:25cespareheh
18:25cespareBronsa: cool, i'll look into that. Thanks
18:26amalloydidn't Bronsa suggest &env to you yesterday too?
18:27cesparenot that i recall
18:27cesparemaybe after i left.
18:28cespareamalloy: you pointed out that i was hinting the wrong thing, and I thought that solved my problem and moved on to something else.
18:29BronsaI rememebr talking about it with gfredericks a couple of days ago, I don't recall cespare asking for it
18:29cespareah yeah, there was a discussion about env but i had stopped listening
18:29cesparenobody used my name so i never noticed.
18:31cespareBronsa: should I avoid using this for some reason?
18:31cespare(perusing logs from yesterday)
18:31Bronsacespare: well &env is not really a documented feature AFAIK
18:32arrdemBronsa: I haven't heard of it previously :P
18:32Bronsawell along with &form it's an implicit arg passed to macros
18:32cespareBronsa: yeah, exactly what I needed.
18:33Bronsawhich actually means that while functions can take up to 20 args, macros can take only up to 18 args
18:33amalloyi also can't think of any very good reasons you would want to know at compile time what type a symbol is tagged as. it seems dubious
18:33Bronsaamalloy: dude I'm pretty sure you told me a while ago that you have a macro in useful that uses &env for that reason
18:34amalloyhaha that's true, isn't it. i didn't write that, though, ninjudd did
18:34cespareamalloy: writing macros for record access that throw at compile-time if the thing you pass in is not actually a record or doesn't have that key.
18:34Bronsaand not even the keys part of &env, it's using the vals
18:36amalloyBronsa: well, if you use the vals you get the benefit of the compiler's type inference
18:36amalloy(let [^MyObj x (foo), y x] (typeof y)) ; it's nice to get back MyObj
18:37Bronsaright but then you're starting to abuse internal details which always make me sad
18:37amalloysure. i wouldn't have written that code, myself, but it's useful
18:39amalloyflatland.useful.datatypes is basically nothing but abuse of internals
18:39gabnexhow functional is python compared to clojure?
18:39arrdemgabnex: arduino supports functional style in spite of Guido
18:40gabnexarduino??? :)
18:40arrdemsorry installing arguino crap in emacs
18:40arrdembrain in too many places
18:40Raynesgabnex: It depends on how you define functional. Python has a lot of what you'd expect from a functional language, but people don't often use those things.
18:40RaynesFor example, map, filter, reduce.
18:40gabnexarrdem hah aok
18:40RaynesI've had use for map exactly once.
18:41RaynesI do Python professionally after using Clojure professionally and still have only used map once.
18:41gabnexRaynes I can't define it. the most functional languages I have used are python and C#
18:41amalloypython almost has lambdas
18:41RaynesFunctions are first class though.
18:42RaynesSo you can pass along any given function to higher order functions.
18:42gabnexdo you mean that you use map in python less than in other languages? why?
18:42RaynesLike adults.
18:42technomancyI would argue that "how functional" is a question that makes more sense to ask of a program than a language.
18:42RaynesBecause Python doesn't often give me reasons to use functional idioms like that.
18:42technomancy"how common are functional programs in $lang" might make more sense
18:42RaynesUsually I'd just use for or a list comprehension.
18:42arrdemRaynes: abusing list comprehensions is so much fun
18:42Raynes'abusing'
18:43RaynesI prefer to call it gettin' kinky wit it
18:43gabnexi don't like list comprehensions much
18:43Rayneslol why?
18:43RaynesThey are effectively syntactic sugar for map with extra features.
18:43amalloylist comprehensions are fantastic
18:43amalloypython's are weird because they have to be one-liners, but they're still nice
18:44gabnexmy issues with it are largely cosmetical, it just looks weird. like a for loop read backwards, first the value then the loop. likewise with if statement
18:44gabnexif expression, rather
18:45gabnexr[x for x in [1,2,3,4,5] if x % 2 == 0]
18:46gabnexthe order is all whacky
18:46arrdemgabnex: sure, but the meaning is obvious in terms of the input value sequence
18:46Raynesamalloy: https://www.refheap.com/88071
18:46bryanmaass,(filter even? (range 1 6))
18:46clojurebot(2 4)
18:46bryanmaasssorry, I had to
18:47amalloyBronsa: is there a reason that `(fn [~@(repeatedly 30 gensym)] 1) fails to compile, rather than just emitting a RestFn that checks that its arg count is exactly 30?
18:47gabnexthat is a valid clojure? nice
18:47gabnexit looks like python's filter
18:47Raynesgabnex: God no
18:47gabnexwhat?
18:47clojurebotwhat is not a bug
18:47RaynesOh, referring to the filter example.
18:47gabnexyes
18:47RaynesOkay, we're on the same page.
18:47amalloyclojurebot: many things |are| not bugs
18:47clojurebotIn Ordnung
18:47RaynesThought you were talking about my paste.
18:48gabnexI wasn't. I clicked it now
18:49gabnexwhat would be the clojure equivalent of that?
18:50Bronsaamalloy: I believe it would be quite hard to manage multiple arities with 20+ args that way
18:50amalloy(string/join ",\n" (for [[name redshift-type] (columns table overrides nulls)] (str name " " redshift-type))), although there may be something a bit more clever
18:50Raynes(clojure.string/join ",\n" (for [[name, redshift_type] (columns table overrides nulls)))
18:50Bronsaamalloy: also it would probably mess with recur
18:50RaynesI gave up
18:50RaynesJust closed my parens and went home.
18:50Raynesamalloy struck me down
18:50arrdemBronsa: really? I thought that at 19 the compiler silently switched to varargs destructuring.
18:50amalloy(string/join ",\n" (map (partial string/join " ") (columns table overrides nulls)))
18:51arrdemor at least that's what I would expect.
18:53Bronsaamalloy: not saying it can't be done but that would require possibily collapsing multiple fn-methods into a single one, which is not something the compiler does right now
18:54BronsaI can try prototyping that with t.e.j, shouldn't be hard
18:54amalloynah, it doesn't seem like a compelling feature
18:55Raynesamalloy: ',\n'.join(map(' '.join, self.columns(table, overrides, nulls)))
18:55Raynespwnt
18:55RaynesJesus, amalloy is making my code better using an entirely different language.
18:55Bronsaamalloy: yeah recur would be broken, it currently doesn't handle varargs
18:56Bronsa,(fn [& b] (recur 1 2))
18:56clojurebot#<CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 1 args, got: 2, compiling:(NO_SOURCE_PATH:0:0)>
18:56Bronsathis could probably be considered a bug I guess
18:57technomancyI've run into that. it's pretty annoying
18:57arrdemI'd call that a bug...
18:57technomancysupposedly it's by design iirc
18:57arrdemor at least an obvious failure
18:58Bronsatechnomancy: seems weird that'd be by design
18:58technomancyI agree
18:58amalloywell, how else is it going to work? you want to write (apply recur (rest xs))?
18:59Bronsaamalloy: the compiler can put xs in seq for recur args just like it does for function calls
18:59hiredmanamalloy: well, given that you can call the function with (f 1 2), should you be able to recur inside the function with (recur 1 2)
18:59arrdemamalloy: recur isn't a fn and can't be applied. it's a special form and its arity is statically known, so you can do what Bronsa just said.
19:00Bronsaamalloy: I mean right now you need to do (fn [& x] (recur (list 1 2))) but the compiler could do that automatically
19:01amalloyBronsa: my point is, consider (defn last-arg ([x] x) ([x & xs] (if (empty? xs) x (recur ...????)))). what do you fill in the blank there with, if the compiler automatically wraps things up in a list for you?
19:02amalloyyou need another special form like apply-recur to define this function, if that's how varargs work
19:02technomancyamalloy: iirc you can't recur across bodies
19:03amalloytechnomancy: of course not. my definition doesn't require you to
19:03amalloythe ([x] x) case is just so that it still works for one-arg calls; mabye it's clearer if i leave it out entirely
19:03technomancyright
19:03Bronsaamalloy: ah, I see
19:04technomancyI agree you'd need apply-recur
19:04technomancyit would make a lot more sense than what we have now
19:04amalloytechnomancy: meh. if you had apply-recur, then every variadic function would need to use it; needing to recur and *not* apply it is super rare
19:05amalloyexcept in constructed examples to show how confusing recur is
19:05Bronsatechnomancy: that's debatable, with amalloy's example in mind I can understand the decision to make recur varargs ignorant
19:05technomancyI don't see anything wrong with that
19:07amalloytechnomancy: recur is only confusing if you view it as "call this function again with these args" instead of as "go back to the recur anchor-point and bind the named variables to this, this, and that"
19:07technomancyI'd rather have two forms for different things than one form that you can usually treat as a self-call, except for certain cases
19:07technomancyamalloy: which is exactly how everyone sees it, until they run into this weird quirk
19:08technomancythat's what recursion means in every other language
19:08Bronsaanybody knows the rationale for not optimizing self tail calls to recurs btw?
19:08amalloyBronsa: so that if you accidentally make a non-tail call it's obvious (ie, fails to compile)
19:09amalloyif self-calls silently upgrade into recur, then you'll write a function that depends on this behavior, and then change it subtly so that it doesn't upgrade anymore, and never notice the difference
19:10technomancy[x] more compile-time correctness checking than scala
19:10technomancywait did I say that out loud
19:10Bronsathe solution is easy: add the optimization without telling anybody
19:10amalloyhah. you know #clojure would notice it inside of a week
19:11Bronsabonus points if the change makes in through a totally unrelated commit
19:11Bronsasomething that Rich does all the time
19:11amalloyand then it'd become a feature as well-documented as "(zipmap (keys m) (vals m)) is guaranteed to work in the way you expect"
19:11Bronsaheh
19:11technomancymeaning core team members would contradict it publicly?
19:13Bronsathe one comment that probably bothered me more than Stu's on zipmap, is Rich saying that definlines should not work as HOFs
19:13amalloytechnomancy: send yourself a thatsthejoke.jpg from me
19:13technomancyoh, dang
19:14hiredmanBronsa: subtilty tends to get lost online, could he have meant just the inline part of definlines?
19:14hiredmancause otherwise...
19:14Bronsahiredman: I'm pretty sure Rich actually meant "you can't use them as functions"
19:15hiredmanbut, like, +
19:15amalloyBronsa: do you have a link? i only vaguely remember this
19:15Bronsahiredman: that uses {:inline ..} not definilne
19:15Bronsaamalloy: one sec
19:15hiredmanBronsa: yeah, those are totally different
19:15hiredman(that was sarcasm)
19:16Bronsahttp://dev.clojure.org/jira/browse/CLJ-1227?focusedCommentId=33522&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-33522
19:16RaynesI was incredibly sad to find that core folks were uninterested in a polymorphic range function.
19:16Bronsawell, it was actually Alex speaking for Rich
19:16hiredmanyeah, I feel like something is lost there
19:17Bronsahiredman: amalloy I find it pretty ridiculous that Alex/Rich would say that when reading through the implementation it's clear that they're supposed to behave as functions
19:18hiredmanBronsa: well, but there is no real way in clojure to say "this function isn't for higher order use" or something
19:18hiredmanBronsa: where as, in a lisp-2 like common lisp that is sort of the default stance
19:18hiredman(common lisp being mentioned in the ticket)
19:19amalloyhiredman: i don't get that, though - isn't a function that is only intended for inline use just a macro that evaluates each arg exactly once?
19:19hiredmanso e.g. you want the compiler to try to optimize the expansion, and if it fails, you have a function in place to be used, but you don't want people to run around HOFing it up
19:19Bronsaalso I'm pretty sure there's an example of a definline used as HOF in one of Stu's books, can't recall which Stu though
19:20hiredmanamalloy: if you look at common lisp's compiler macros or whatever, they can sort of decline being expanded
19:20amalloyhiredman: by returning &form?
19:21hiredmanamalloy: so you could write something that, as a clojure example, looks for certain type hints, and expands if they are there, and otherwise doesn't and turns in to a function call
19:21hiredmanamalloy: I guess
19:21amalloyhiredman: sure. and that's a nice use of compiler macros. but what's the harm in also allowing it to be passed as a HOF?
19:21hiredmanI don't know what the huge difference is, my initial reading about common lisp compiler macros, it seems like definline could do all that
19:21hiredmanamalloy: dunno
19:21Bronsathat's funny
19:22Bronsadefinilnes used to have a bug where they could work as HOFs but not in call position
19:22Bronsahttps://groups.google.com/d/msg/clojure/iAt_DDUt6ZA/6RtFapvJugUJ
19:22hiredmanhttp://dev.clojure.org/display/design/Inlined+code cgrand and I are the only ones to drop comments
19:23amalloyi think clojure's {:inline ...} is basically equivalent to CL's compiler macros. i don't know of anything one can do that the other can't
19:23hiredmanright, so what is rich going on about
19:24hiredmanheh
19:24hiredman" (map square xs) would still need to be compiled as a function invocation.
19:24hiredman"
19:25Bronsaand that's exactly how definline currently works, as implemented
19:26Bronsathe bug preventing it to work was related to AOT compilation, had nothing to do with definline itself
19:26hiredmanexcept for the compiler bug, which arguably has nothing to do with definline
19:26hiredmanright
19:26hiredmanstupid aot
19:26amalloyBronsa: i think the joke was that alex miller wrote that wiki page, and in the jira article he was saying the opposite
19:26amalloydid the aot issue get fixed for 1.6?
19:26Bronsanope
19:27amalloygross
19:28Shayanjmamalloy: so I'm running into some issues with my NLP program. I may be attempting to analyze too much data at a time. I can either throw things into some sort of queue/handle them sync, or scale the computationally intensive tasks horizontally
19:28amalloyBronsa, hiredman: another case of https://twitter.com/hiredman_/status/446003708015304704
19:28ShayanjmThe issue specifically is that I have some 30 articles coming in, and I'm attempting to do sentiment analysis + keyword extraction on the whole scraped article contents in parallel
19:29Shayanjmhave I missed a more obvious solution/design pattern in clj?
19:29hiredmanhuh
19:29BronsaTBH I really don't see how clojure/core can be so dismissive wrt AOT bugs given that both clojure and Datomic are AOT compiled
19:31amalloyBronsa: don't forget, if you want your app to have a -main, you AOT compile everything under the sun. but at least this only impacts people who want to run clojure programs, which surely is a tiny subset of clojure programmers...
19:31technomancycider is my shell; I don't know what your problem is
19:32hiredmancider is 99 problems
19:32hiredmanbut aot may aslo be one
19:32hiredmanalso
19:32BronsaI actually used clojure today to batch rename a bunch of files because I can't into bash
19:32Bronsa(inc amalloy)
19:32lazybot⇒ 148
19:33caternyou don't need bash for that
19:33caternuse rename
19:33caternman rename
19:33catern(assuming your batch rename was simple...)
19:33technomancyjust use emacs
19:33BronsaI had to rename foo_bar_baz to "Foo Bar Baz"
19:33technomancywdired-mode, M-x replace-regexp, save
19:34caternew
19:34Bronsatried using zmv which I think is similar to rename
19:34caternwhy would you do that?
19:34caternthat's the exact opposite direction that you should go
19:34caternadding white space and capitals
19:34caternyuck!
19:34Bronsatechnomancy: I contemplated doing that. next time.
19:35Bronsacatern: dude I want my mp3 file names to look nice
19:35Bronsaalso it's 2014 and I can afford spaces in file names
19:35caternBronsa: let your MP3 player show the names in the ID3 tags
19:35caternand your file manager too
19:35amalloyBronsa: nice to meet another fan of the Metasyntactic Variables. Foo Bar Baz is my favorite song on their newest album
19:36catern(oh, you don't have a file manager that's scriptable enough to do that? yeah, neither do I ;_;)
19:37Bronsacatern: yes, I use id3 tags but it still bothers me when my files aren't named in The Right Way™
19:37caternBronsa: spaces is The Wrong Way
19:45justin_smithcatern: that idiom ("the wrong way") always bugged me, there are always more wrong ways than right ways. For example, make the filename be the bytes of the mp3 data, and the file contents be the name. That is clearly wrongerer
19:46technomancyevery happy mp3 is the same, and all unhappy mp3s are different in their own way.
19:46technomancytolstoy said so
19:47justin_smithheh
19:47caternjustin_smith: does the file contents have spaces?
19:48{blake}heh
19:48justin_smithno, they are replaced by NULL bytes
19:49hiredmanNULL bytes are replaced by 0x2a and so on in that fashion
20:00Shayanjmso when processing large sets of data
20:00Shayanjmis it better to run things in parallel or in series if I'm concerned about memory usage?
20:01Shayanjm(i.e: how much 'worse' is running it in parallel? any optimization magic that happens in the back?)
20:08gabnexah, clojure has list comprehensions too
20:08gabnexwhen do you use them over map/filter?
20:09gabnexi kind of hated them in python, as I said earlier
20:09justin_smithgabnex: for tends to be more readable than nested map calls
20:09technomancygabnex: the filtering in c.c/for is clearer IMO than in python
20:09technomancysince it's almost always on its own line
20:10gabnex(they looked weird/backwards in python, and also leaked variable names).
20:10gabnextechnomancy yeah they do look cleaner. I think I will still like filter/map more
20:11technomancyusually I filter/map if you have a readymade function that works and use for if I'd have to construct a lambda
20:11justin_smithgabnex: if your mapping function is also your predicate (maybe returning nil for unwanted elements, and the transformed version otherwise), keep is handy
20:11gabnextechno even with nifty % syntax to shorten lambdas?
20:11justin_smith(doc keep)
20:11clojurebot"([f coll]); Returns a lazy sequence of the non-nil results of (f item). Note, this means false return values will be included. f must be free of side-effects."
20:12technomancygabnex: yeah
20:13BronsaI hate that keep doesn't have a 1-arity with f defaulting to identity
20:13justin_smithBronsa: yeah, I bet that would be the most common usage if it existed
20:13FrozenlockBronsa: I would use that.
20:14technomancythere's a jira for that!
20:14technomancyTM
20:14justin_smith
20:14technomancyactually I think the jira issue is for a similar function; it's been around so long it predates keep
20:14Bronsamight be for filter?
20:14amalloyBronsa: why would you put that on keep? i'd put it on filter
20:14technomancysounds right
20:15amalloyamusingly, (remove xs) and (filter xs) would kinda have to do the same thing
20:15Frozenlock(filter [1 nil 0]) --> (1 0)... ohhh now I want that
20:15Bronsaamalloy: I mean, keep identity and filter identity behave the same way, keep is 2chars shorter
20:15amalloymaybe that's why it doesn't exist
20:16amalloyBronsa: *almost* the same way
20:16amalloy&((juxt keep filter) identity [1 nil 2 false 3])
20:16lazybot⇒ [(1 2 false 3) (1 2 3)]
20:16Bronsaoh, right
20:17justin_smithamalloy: perhaps (remove xs) could simple return all nil items in the input, discarding the non-nil
20:17gabnexcan I mutate a list in clojure?
20:17justin_smithwhich is of course pretty much useless
20:17amalloygabnex: no
20:18technomancyand even if you could, you wouldn't
20:18gabnexI probably would :).
20:19technomancy"For the same reason we don't wear animal skins or hunt the woolly mammoth. Because we're not savages."
20:19technomancyhttp://www.penny-arcade.com/comic/2005/06/06/
20:21justin_smithgabnex: probably the greatest boon in clojure is the wide range of errors that become impossible with mutation (this especially comes into play when you have multiple threads). it's harder to think in immutible objects at first, but it is worth it
20:21justin_smith*impossible without mutation, that is
20:25gabnexjustin_smith it is probably my ignorance but I don't understand how lack of mutation helps when having multiple threads. if a value is immutable we must take it and return a new one. if two threads do this at the same time, one thread could be working on the old, dated value, and not on the current one. so don't we still have issues, only in a different way?
20:25justin_smithgabnex: the class of errors avoided are partial updates
20:26justin_smiththat is, where something is read in the middle of an update, and the contents are invalid
20:26gabnexbut we introduce another class of errors, working on a dated value
20:26technomancygabnex: that kind of mistake is trivial to catch because it's deterministic
20:26justin_smithgabnex: one of these is tractable, the other just leads to reading garbage
20:27gabnexhow do you prevent this? locks?
20:27justin_smithgabnex: that is the mutation oriented solution
20:27technomancygabnex: you just don't do it because it doesn't make sense
20:27justin_smithand that leads to deadlocks, livelocks, etc. - errors that pretty much never happen in live clojure code, because we don't ever use locks
20:27gabnexdon't do what
20:27justin_smith(don't use them directly that is)
20:28justin_smithgabnex: I recommend the book "Java Concurrency in Practice"
20:28justin_smithit gives a really good overview of why locks are tricky, and whenever possible, immutability is easier and less error prone
20:28justin_smithclojure simply increases the range of domains where immutability becomes reasonable
20:29technomancygabnex: the mistake you're describing is just that of thinking imperatively in an fp language. it's not something that you do when you know how clojure works.
20:31gfredericksgabnex: if you're using an atom, then swap! will ensure that if you are working on a dated value, you end up redoing your computation on the current value
20:31gfredericksif you're using an agent, then the updates are guaranteed to be serialized
20:31gfrederickstwo different ways of solving the problem depending on your needs
20:32gabnexgfredericks interesting. is immutability a requirement for those techniques to work, though?
20:32gfrederickscertainly for atoms
20:32gfredericksbecause you will have multiple threads processing the same value
20:33justin_smithgabnex: remember that in clojure we can simplify questions of identity and state, and both of those approaches come from clojure's simplified view of identity and state
20:33justin_smithwhich is of course rooted in immutability
20:33gfredericksand in both cases the current value can be read by any other thread without locking, so you wouldn't want it to be stateful
20:36justin_smithalso, the mutable java collections are all easily accessible from clojure via interop. It's just that outside of specialized applications we don't really find them that useful given the persistent alternatives.
20:37gabnexdo we only have mutable collections from java? clojure does not introduce any new ones?
20:37justin_smithwell, you can introduce a deftype with mutable fields for example
20:38justin_smithbut java has a very rich and complete set of data structures
20:38justin_smithso in practice you won't find much missing, if you are OK with the mutation aspect
20:39justin_smithtrees, lists, vectors, sets and maps of all sorts, queues, deques, etc. etc.
20:39amalloybut justin_smith, what if i want a mutable finger tree? i bet java doesn't have *those*
20:40justin_smithamalloy: I am sure some brilliant clojure programmer would set you up with something nice for that
20:40amalloy(answer: if i want that, i am probably a madman, beyond science's reach to rescue)
20:40justin_smithor that
20:47gfredericksA -> (B -> A)
20:49amalloygfredericks: what what?
20:51gfredericksA = "I am probably a madman, beyond science's reach to rescue"
20:51gfredericksB = "If I want that"
20:52gfredericksmy apologies I had a conversation with a logician yesterday and so apparently this is what happens to my jokes
20:52justin_smithlol
20:53amalloygfredericks: must not have been a very good conversation - you seem to be concluding causation based on this correlation
20:55gfrederickscome on what is causation anyhow
20:55gfredericksalso I don't think my statement literally said anything about causation
20:56amalloyi think "and so" is correlated quite strongly with implying causation
20:56justin_smithin all fairness, it could have been a claim about how things are considered "apperent", natural language is nicely ambiguous that way
20:57justin_smith*apparent
20:57gfredericksI'm a parent
20:58gfredericks(my apologies I had a conversation with amalloy today and so apparently this is what happens to my jokes)
20:58justin_smith(inc gfredericks)
20:58lazybot⇒ 75
22:20hiredmanhmmmm
22:20hiredmantest.check's defspec prints stuff out to stdout on success
22:20hiredmanseems terrible
22:24caternhttps://news.ycombinator.com/item?id=8017588
22:24caterngod this is awful
22:24caternhttps://github.com/eobrain/funcgo
22:24caternwhyyy
22:24caternso awful
22:25justin_smitheta for the "fuckgo" offshoot?
22:25justin_smithwhich of course has an obvious crossover with "self"
22:56puredanger_ amalloy: sometimes I am a flawed translator for Rich :)
23:29nopromptseems kinda silly that (keyword 'foo) works but (symbol :foo) doesn't :/
23:39trptcolinnoprompt: hmm, yeah i don’t see any reason why keyword & symbol shouldn’t offer the same conversions
23:39trptcolinthere’s other fun too:
23:39trptcolin,:123
23:39clojurebot:123
23:39trptcolin,(keyword 123)
23:39clojurebotnil
23:50noprompttrptcolin: ha! i hadn't discovered that one yet. any reasons why this has/hasn't been patched?
23:51trptcolinnot sure if there’s a jira ticket for that or not
23:52dbaschtrptcolin: I think it's intended behavior
23:52dbaschor at least it's properly documented
23:52dbasch(keyword name): name can be string, symbol, or keyword.
23:53dbaschsymbols cannot start with numbers
23:54nopromptdbasch: i can perhaps understand (keyword 123) not working, however the former case i mentioned seems a bit weird.
23:54nopromptbecause you seldom want keyword -> integer.
23:55trptcolindbasch: yeah, i mean i agree, but attempting to match the docs on the numeric-keyword thing breaks existing code, so it’s not happening anytime soon (see http://dev.clojure.org/jira/browse/CLJ-1252)
23:55nopromptthe error message you get from (symbol :foo) is also not helpful either.
23:55nopromptClassCastException clojure.lang.Keyword cannot be cast to java.lang.String clojure.core/symbol (core.clj:546)
23:56dbaschyes, that's par for the course for core
23:57trptcolinright, i mean it seems to me that (source keyword) vs. (source symbol) ought to be symmetric with each other, since they’re so close now and it shouldn’t break anybody (nobody should depend on that CCE)
23:57trptcolini’d vote up a jira for it
23:57noprompttrptcolin: is there an open issue?
23:58nopromptsorry, interleaving some work atm
23:58trptcolini don’t think so
23:58puredanger_I don't know of one
23:58nopromptpuredanger_: what are your thoughts?
23:59puredanger_all sounds reasonable to me.