#clojure log - Oct 03 2014

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

0:00 handojin: now FUBAR

0:00 :(

0:00 justin_smith: that sucks

0:00 the sad thing about all this is often setting up cider is one of the first things people do when trying clojure - bad first impression when it goes that bad

0:01 TEttinger: I had similar issues with lighttable, none with nightcode

0:01 handojin: well - i've kind of invested some time in emacs so i want this relationship to work

0:02 :P

0:02 TEttinger: it's understandable :)

0:02 justin_smith: handojin: sounds like you and emacs need to spend some time with M-x eliza for some couples councelling :)

0:02 handojin: why do you say that?

0:02 justin_smith: sorry, bad pun about "wanting the relationship to work"

0:03 and I should have said M-x doctor

0:03 which runs the eliza algorithm

0:03 handojin: do you want to make the relationship work?

0:03 justin_smith: rofl

0:03 handojin: <- runs it too

0:04 ok, time to die

0:07 mdeboard: lighttable and nightcode?

0:07 huh

0:07 Cursive is pretty good, still has plenty of rough spots

0:09 TEttinger: nightcode is a lot smaller than, say, eclipse or IntelliJ, so there's less I need to worry about going wrong :)

0:09 and it's very closely integrated with lein, which is nice

0:09 mdeboard: intellij really, like, I am not an IDE person at all. emacs til i die, but intellij is really good

0:10 cfleming: (inc mdeboard)

0:10 lazybot: ⇒ 9

0:11 handojin: prelude-update-packages & lein upgrade and I'm back in business

0:13 still on 0.7.0-snapshot though

0:17 cfleming: Is anyone here using piggieback?

0:18 mdeboard: yeah

0:18 well, not directly

0:18 but via figwheel

0:18 cfleming: Ok, do you know if there's a setting in project.clj that controls where it writes out generated js?

0:18 Does it even write the generated js to disk?

0:18 mdeboard: there definitely is

0:19 i don't thin kit has to do with piggieback tho

0:19 cfleming: I can't find it in the doc anywhere or find an example.

0:19 mdeboard: sec

0:20 cfleming: https://gist.github.com/mattdeboard/744d597fa5d155d4d94f

0:20 ctrl-f :compiler

0:20 cfleming: So piggieback just uses the cljsbuild settings?

0:20 mdeboard: yeah I think so

0:21 cfleming: Someone told me they had generated js being written somewhere else.

0:21 mdeboard: but i have no idea for sure

0:21 cfleming: Ok, thanks.

0:21 mdeboard: i prob misunderstod your question on further reflectin

0:22 cfleming: No, I don't think so - piggieback has to generate js from the cljs it receives. I'm not sure if that gets written to disk or if it's just done in memory and sent over the wire.

0:22 I assumed there would be a project.clj setting to control where that went.

0:26 arrdem: idle musing... would y'all think Grimoire's PR based contribution process is better or worse than clojuredocs?

0:29 cfleming: arrdem: I'd say it's pretty difficult to beat reading the docs, clicking a link and entering your example.

0:30 arrdem: Having to clone grimoire, find the file, paste my example, check it, commit, push, create PR (I'm assuming that's more or less the process) is a pretty significant barrier IMO

0:30 arrdem: It seems less API-friendly too.

0:31 arrdem: cfleming: it's a little better than that becuase I use GH's "new" URLs that let you fork and create a file for PRing all from the web

0:31 cfleming: but it does take you somewhere else to submit a (trivial) PR

0:31 cfleming: arrdem: Ah, ok - that sounds better then. I must admit I haven't tried it

0:32 arrdem: showing source not examples by default is a mistake..

0:32 cfleming: arrdem: I think that's ok. Are the results displayed right away or after some batch process?

0:32 arrdem: cfleming: there is no DB lookup here, it just stats directories.

0:32 cfleming: arrdem: And could you create an API to allow tools to provide "Upload example to Grimoire" functionality?

0:33 mdeboard: web scale

0:33 arrdem: cfleming: defeats the point of having the entire datastore in git IMO

0:33 mdeboard: filesystems are indeed web scale

0:33 mdeboard: i wasn't being sarcastic

0:33 cfleming: arrdem: Ok, cool - so it's pushed right to the prod repo? That sounds ok then.

0:33 mdeboard: :P

0:34 cfleming: arrdem: I do like the idea of all the content being available in a git repo.

0:35 arrdem: cfleming: I hope that either this release or next I'll go beyond that and break it out into a standard package format that anyone can read/write/host

0:35 but that's a lot of ... thinking to make a good spec

0:35 TEttinger: arrdem, needs more xml

0:36 arrdem: TEttinger: quiet in the peanut galery

0:36 * arrdem weeps tears of blood over IBM's JSON in XML standard

0:36 TEttinger: I saw that!

0:36 it's so awful

0:36 arrdem: I would almost work for IBM because of their SPARK stuff.

0:36 but shit like that is painful

0:36 cfleming: arrdem: That would be nice - I'll need something like that to show the Cursive API docs if I ever release it.

0:37 * cfleming wrote a Clojure data structure to XML serialiser yesterday

0:37 cfleming: Seriously

0:37 arrdem: I should write a Clojure datastructure to filesystem serializer/deserializer

0:40 mdeboard: what do you mean "to filesystem"

0:40 kristof: He means a data serialization format.

0:41 mdeboard: there's so many already

0:41 insert xkcd about competing standards

0:41 arrdem: mdeboard: a map becomes a folder with a file .type = "map\EOF" and then each file/folder is a key where the value is the data stored etc.

0:42 mdeboard: the point is that it's a reasonable WYSIWYG and GIT managable structure, unlike say a JSON encoded blob of the same data

0:42 or even an XML blob of the same data

0:43 mdeboard: oh

0:43 huh

0:43 that's interesting

0:44 * arrdem extrudes Unix guru beard

0:44 arrdem: it's all just files maaaaaaaan

0:44 cfleming: And you've even partitioned your data - truly web scale!

0:44 arrdem: rofl

0:45 https://github.com/grimradical/clj-semver

0:45 proof that Clojure code can survive bit rot

0:46 almost unchanged since 1.3

0:46 cfleming: arrdem: Amazingly, that is actually something I need soon - thanks!

0:47 arrdem: cfleming: :D I was gonna just write one... then I read that one and it was perfect

0:47 cfleming: The irony of it being a snapshot release is not lost either

0:47 arrdem: yeah... the "eh it's a stable snapshot" thing seems pretty common

0:47 mdeboard: lol

0:53 arrdem: I feel like the serialization thing you mentioned would get unwieldy quick

0:53 arrdem: mdeboard: how so?

0:54 mdeboard: you can totally slurp it into a DB if you want... the point is that it's a WYSIWYG intermediary store/exchange standard

0:54 sir_pinecone: hey guys, noobie here. Can anyone tell me if it's possible to pass around a namespace in some form and then call functions that are in that namespace? here's a silly example of what I want to do https://gist.github.com/anonymous/84649fdd3dfcfbb215be

0:55 mdeboard: you'd hav eto do some really start structure sharing or it'd get nuts

0:55 at some point it'd just coalesce into an inverted index or something

0:55 odds are basically 1:1 I'm talking out of my ass

0:55 arrdem: mdeboard: meh depends on the structure you're working with. for what I have in mind I'm doing it already and it works out OK

0:56 but I really just have a DB in a FS, not an arbitrary datastructure

0:57 mdeboard: yeah i'm down with the idea in general

0:57 i've fantasiezd about replacing mongodb with flat files

0:57 but who has the time

0:57 arrdem: lol

0:58 https://github.com/ibdknox/simpledb

0:58 mdeboard: pretty much every uh

0:58 arrdem: please don't actually use that for anything

0:58 but I have

0:58 mdeboard: person i've talked to ince moiving here has the same "i used mongodb " horror tostry

0:58 Wow

0:58 Nice typing

0:58 arrdem: works juuuuust fine when you really just need a temporary "dev" datastore

0:58 mdeboard: horror story*

0:59 cfleming: sir_pinecone: No, you can't do that - namespaces are not first-class objects you can pass around

1:00 sir_pinecone: cfleming: ok, thank you

1:00 arrdem: simpledb would actually work really well for another project I have in mind...

1:00 mdeboard: just no

1:00 lol

1:00 postgres all day

1:00 arrdem: datastores are all too much work

1:01 mdeboard: pfft

1:01 so easy nowadays

1:03 dbasch: Someone should create RRDB: Russian Roulette DB

1:04 mdeboard: they did, it's called "MongoDB under network partition"

1:04 arrdem: dbasch: 1/6 chance to not actually persist your data?

1:04 dbasch: I was thinking more like 1e-6 every second

1:04 mdeboard: also pretty sure what's his face's Jepsen series of blog posts show they're all RRDBs

1:04 dbasch: yes, I mean on purpose. Make it a feature.

1:05 mdeboard: lol

1:05 joshuafcole: market it as a "Probabilistic Data Store"

1:05 mdeboard: I ... think that is a thing already

1:05 * mdeboard googles

1:05 joshuafcole: it'll be all the rage in the big data secor

1:05 sector*

1:05 dbasch: It’s like the idea I had back in the day when China’s population was growing out of control: randomly exploding cars with adaptive probability

1:05 arrdem: lolwut

1:06 metellus: RRDB solves cache invalidation

1:06 joshuafcole: on average, anyway

1:06 arrdem: metellus: but only for problems where serving old data is OK

1:06 dbasch: RRDB is good for startups, because they have greater risks already

1:06 arrdem: metellus: turns out not to work for CPU caches

1:07 metellus: darn

1:07 joshuafcole: although

1:07 if you combine it with probabilistic registers

1:07 you probably couldn't tell the difference

1:07 arrdem: joshuafcole: now you have a machine that's worthless. actually.

1:07 joshuafcole: RRReg

1:07 Nah, see

1:07 * arrdem listens with interest

1:07 joshuafcole: because you hook it up to another, regular computer

1:08 and that regular computer in turn

1:08 checks all of it's computations the normal way, however long that takes

1:08 and if it detects an incorrect answer

1:08 it detonates the nuclear warhead it's connected to

1:08 Then, using quantum immortality, you're golden

1:08 hell, you can even implement all of your ops as single cycle randoms

1:08 * arrdem facedesk

1:09 mdeboard: well

1:09 arrdem: joshuafcole: you have to destroy the universe. a simple nuke won't do ot

1:09 *it

1:09 mdeboard: according to quantum physics there's a non-zero probability it's already happened

1:09 joshuafcole: arrdem: No? I thought quantum immortality applied individually

1:09 so so long as you sat next to the machine

1:09 for however long it would take

1:09 for *your* universe, call it U', the machines output should always be valid right?

1:10 arrdem: pretty sure in this universe you can in fact nuke yourself

1:10 joshuafcole: however, for people outside the blast radius it probably wouldn't work very well

1:10 I'd try it to prove you wrong if quantum immortality didn't seem like obvious quackery.

1:10 :P

1:11 U_1: "Hah arrdem: I told you so!" "What are you talking about?"

1:11 U_2: "In other news, San Francisco detonated in a completely out of the blue nuclear explosion this morning..."

1:11 mdeboard: this is a #emacs quality conversation

1:12 arrdem: lol mdeboard

1:12 joshuafcole: M-x rely-on-quantum-immortality really improves startup times

1:12 mdeboard: to be fair #emacs is my favorite channel

1:12 joshuafcole: (inc mdeboard)

1:12 lazybot: ⇒ 10

1:13 arrdem: someone give me a schema for a documentation datastore that houses symbols, namespaces and classes

1:13 I've got a bunch of ideas but none of them seem sane

1:13 * arrdem totally isn't designing Grimoire 0.4.0

1:18 joshuafcole: arddem: namespace = db (nestable) classes = collections (+ a global collection for stuff outside classes), symbols = rows?

1:19 the real trick is making it import from existing sources just as javadocs

1:19 mdeboard: Hold-My-Beer-driven development

1:20 arrdem: hey i'll take M-x hold-my-beer RET HACKING over M-x ponder RET heat-death RET

1:21 is there a javadocs engine for Clojure...?

1:21 joshuafcole: hard to argue with that

1:22 arrdem: https://github.com/clojure/clojure/blob/master/src/clj/clojure/java/javadoc.clj

1:22 why is this shit in core...

1:22 joshuafcole: with hardcoded urls and subdomains

1:23 I like it

1:23 mdeboard: futureproof

1:23 arrdem: one of these days I'm gonna have a beer

1:23 and fork Clojure

1:23 mdeboard: that's a good project name

1:23 arrdem: mdeboard: rofl

1:23 dbasch: &(clojure.java.javadoc/javadoc "wtf")

1:23 lazybot: java.lang.ClassNotFoundException: clojure.java.javadoc

1:24 arrdem: &(require 'clojure.java.javadoc)

1:24 lazybot: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "java.specification.version" "read")

1:25 dbasch: I want to add transmorphers to clojure

1:25 arrdem: http://www.imdb.com/title/tt0960835/

1:25 * arrdem done for the night

1:26 arrdem: dbasch: you only get to do that if you're rhicky

1:26 mdeboard: transmorphers? LOL

1:26 I'm working on a teledildonics library

1:26 based on some really advanced research

1:26 joshuafcole: while we're adding transformers, can we please get dinobot into core?

1:26 mdeboard: GRIMLOCK SMASH

1:27 arrdem: I would get a beer

1:27 and late-night #clojure with yall

1:27 but I have class in the morning

1:27 T_T

1:27 joshuafcole: heh

1:27 mdeboard: my cat has a vet appointment, so

1:27 joshuafcole: well, goodnight all

1:28 maybe now I'll get some code written. :)

1:46 a13x: is there a way to make `lein run` exit after a standalone app ends? thanks

1:47 jeremyheiler: a13x: what's keeping it alive?

1:48 arrdem: a13x: add (shutdown-agents) to the end of your -main?

1:48 a13x: jeremyheiler: I'm not really sure... in -main I do have a println that is reached but then the JVM continues to run

1:49 dbasch: a13x: do you have any other threads running? What if you explicitly add a System/exit after the println?

1:49 a13x: arrdem: I see no changes with shutdown-agents

1:50 * dbasch is watching Transmorphers on Hulu

1:51 arrdem: I should torrent iron sky one of these days...

1:51 thinking of bad movies

1:52 a13x: System/exit works... but I'd like to understand why the app continues to run

1:52 jeremyheiler: are you using futures, agents, threads?

1:53 dbasch: a13x: any code you can share (via refheap / gist / pastebin)?

1:53 you may be using a library that launches its own threads

1:54 mdeboard: cutting edge teledildonic technology

1:54 a13x: http://pastebin.com/2D8h96Mb

1:55 dbasch that's what I'm starting to suspect... I'm using twitter-api lib that makes http calls, but that should really spawn non daemon threads

1:56 jeremyheiler: a13x: as a side note, you're not invoking the destroy function

1:57 a13x: jeremyheiler right (still that's not the cause :)

1:58 jeremyheiler: i know

2:01 a13x: ok... I see more threads that I expected, so I guess twitter-api lib is spawning

2:02 dysfun: is there a leiningen plugin for running ant tasks?

2:03 arrdem: $google lein ant

2:03 lazybot: [Leiningen Versus the Ants - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Leiningen_Versus_the_Ants

2:03 dysfun: i did

2:03 i get a lot of that, even if i put 'clojure' in

2:03 it's all very clever and everything, but it's not helpful :(

2:04 a13x: found it https://github.com/adamwynne/twitter-api/issues/6

2:05 dbasch: dysfun: leiningen is a build tool that pretty much everyone here uses, because it’s the most convenient way to manage dependencies

2:06 I’d say it’s probably one of the main drivers behind clojure’s adoption at this point

2:06 dysfun: yes, i understand lein is brilliant, but i also want to build something java that's only buildable with ant

2:06 (javafx)

2:06 dbasch: oh, I misunderstood your question

2:07 a13x: I was looking earlier today for something similar... a way to run custom build steps

2:08 I really like lein's automation, but if there's something custom it looks like the only way to go is to create your own plugin

2:09 in my case what triggered this was that I wanted to test a webapp on GAE; lein ring uberwar includes the jetty libs and these are conflicting with GAE's version, so I wanted to clean those up

2:09 dysfun: you can exclude them in your deps

2:11 https://github.com/technomancy/leiningen/blob/stable/sample.project.clj#L48

2:16 a13x: thanks dysfun. I'll try that once I get back to that

2:34 gtmacdonald: Hi Everyone! So I was curious, you know how you have to do (shutdown-agents) for the agent thread pool? Does anyone know why that's not necessary for core.async threads? Specifically if you do a (thread (while true ...)).

3:36 crocket: Is clojure suitable for running a CMS?

3:37 It runs on JVM which might not be a suitable execution environment for a CMS.

3:37 arrdem: lolwut

3:37 crocket: CMS means content management system like wordpress.

3:37 I think nodejs is a better execution environment for a CMS.

3:38 maybe not

3:54 avishai: hi all

3:55 i have a problem with midje prerequisites

3:55 i get java.lang.ClassCastException: clojure.lang.AFunction$1 cannot be cast to clojure.lang.IFn$OLO

3:55 when trying to stub a function with type hinting

4:00 crocket: Does clojure come with sane exceptions?

4:01 Java exceptions drive you insane.

4:01 arrdem: fuck off chare

4:04 domokato: does creating a transient do anything for me if I'm only performing one mutation?

4:05 arrdem: domokato: no

4:05 domokato: kthx

4:05 arrdem: s/no/almost certainly not, benchmark it yourself/g

4:06 domokato: just trying to understand what they're for

4:06 i think i get it now

4:11 man, in order to eliminate allocations in my render loop, i had to switch to using java ArrayLists. Everything was creating seqs, even "empty?", and doseq

4:12 i had to start using .isEmpty and i wrote a "foreach" macro with similar syntax to doseq but operates on java Lists

4:12 and had to use the primitive-math lib to prevent boxing

4:15 pepijndevos: domokato, sounds like fun

4:16 borkdude: good morning

4:16 domokato: pepijndevos: actually kinda was. learned a lot about the implementation of clojure in the process. so many allocations everywhere tho...

4:17 it would be nice if the compiler was smart enough to remove unnecessary allocations if the invocation doesn't need them

4:18 arrdem: the JVM has no way to express that concept.

4:18 unless you manually implement instance recycling somehow

4:20 domokato: yeah, i think that would work too. object pools maybe

4:20 arrdem: why. most JVMs will do generationed (memory pooled) GC anyway

4:21 domokato: what does that mean?

4:22 arrdem: JVM JITs can and will trace the lifetime of a given allocation point, and will use different pools of different sizes for objects with different lifetimes.

4:22 so short lived allocations will go in one frequently collected pool, intermediary and long lived objects get their own pools

4:22 ultra-short term objects may be optimized out altogether depending on the JIT.

4:23 domokato: hm, but the GC still has to pause the process and run occassionally?

4:23 arrdem: sure, but that's relatively cheap and you're amortizing it by minimizing the scope over which it needs to run

4:25 kyrre: How can I declare that a method returns ArrayList<String> ? (gen-class)

4:25 domokato: not so cheap if it causes stuttering in a skill-based game

4:26 arrdem: kyrre: Generics don't actually exist at the JVM level. The type templating is a feature of the Java language, and is not reflected in the bytecode. This is for backwards compat.

4:26 domokato: but maybe if i limit the frame rate the gc will be smart enough to run when all the threads are asleep

4:26 arrdem: kyrre: consequently you aren't really -> ArrayList<String>, you're -> ArrayList

4:27 kyrre: that's what ArrayList<String> becomes if you write it in Java anyway

4:28 kyrre: mhm, that makes sense

4:31 domokato: anyway, thanks for the discussion. gnite

4:42 hm, looks like dalvik (android) uses mark and sweep anyway

4:47 ooo, except ART (upcoming android JVM) looks like it uses concurrent gc. should help

4:52 mercwithamouth: hmm so what should be my expectations of SICP? What do you all get out of this book?

4:55 arrdem: totally depends on you. It's a solid introduction to scheme... shows off some of what can be done with macros for language extensions... delves into the metacircular evaluator and hints at what a lisp CPU would look like

4:56 mercwithamouth: ok, fair enough

4:56 arrdem: the more you work the examples and toy with them the more you'll understand it... I never ran a single example and it took me several rereadings of each chapter to really grock what was going on

4:56 mercwithamouth: that's about where i am =P

4:57 arrdem: =P in fairness SCIP was my breakfast time reading for a semester...

4:58 mercwithamouth: ahh gotcha. i'm trying to decide if it's a book that i really should sit down with and go through religiously. i'm wondering how much of a better developer it'll make me

4:58 arrdem: if you arlready grock FP I wouldn't expect to get much out of it

4:58 mercwithamouth: no i'm fairly new

4:58 arrdem: it really is like a freshman/sophomore level CS textbook in scheme by The Scheme Guyts

4:58 *Guys

4:59 mercwithamouth: gotcha. i'll work through it over time then

4:59 arrdem: $seen rubygeek

4:59 lazybot: rubygeek was last seen quitting 17 hours and 6 minutes ago.

4:59 mercwithamouth: ^ learn something new every day

4:59 arrdem: ^^ he has my SCIP copy :P

4:59 mercwithamouth: lol

5:11 amalloy: arrdem: it's grok, by the way, no C. you should read stranger in a strange land - it's a classic

5:32 hyPiRion: bbloom_: no, I didn't find anything obvious sadly

6:02 borkdude: awesome: https://github.com/wit-ai/duckling

6:13 vijaykiran I just registered #clojure.nl

6:19 vijaykiran: borkdude: ? channel ?

6:20 borkdude: vijaykiran yes, channel

6:27 cfleming it would be nice to have an overview of what is possible in cursive and not in other editors (like counter clockwise, emacs). do you think this will exist at some point?

6:28 cfleming: borkdude: Yes, probably. I'm going to be speaking about Cursive at the conj, and I'll mostly be talking about what differentiates Cursive from the other editors, since they mostly work in the same way (i.e. are REPL based)

6:28 borkdude: :-D

6:28 cfleming will the conj videos be available for streaming?

6:29 cfleming: borkdude: I assume so, they usually are.

6:29 borkdude: kewl

6:51 vijaykiran: borkdude: :) cool - I guess I need to brush-up on dutch then

6:56 dysfun: is there a way to instantiate a lein repl in my code? apparently javafx is quite pernickety about what thread stuff runs on, so i'd like to run the lein repl on another thread

7:00 borkdude: dysfun maybe look at jvm break glass

7:00 dysfun for inspiration

7:01 dysfun: hrm, interesting

7:10 cfleming: dysfun: You want to start a REPL server? Sure, the nREPL page has details on how to do that.

7:28 dysfun: oh brilliant, thanks

8:00 justin_smith: arrdem: re: your exchange with domokato - lifetime-aware gc may be cheap, but with real time constraints like a framerate nothing beats cache locality, which means primitive arrays (I am well aware you will only see this much later in scrollback when you wake up)

8:29 borkdude: cfleming when typing a docstring with a function, can I indent the "paragraph" to keep within 80 cols, like in emacs?

8:29 cfleming: borkdude: No, there's nothing like that right now sorry. IntelliJ has a "Fill paragraph" but it never works for me.

8:58 borkdude: cfleming I would like to attach a debugger to lein test, is that possible with cursive?

9:02 justin_smith: borkdude: you can load a namespace and run its tests in a normal repl - deftest creates a function of no arguments that you can call

9:02 borkdude: justin_smith I know

9:02 justin_smith: and of course there is clojure.test/run-tests for proper running of all tests in an ns with their fixtures

9:02 OK

9:06 borkdude: I think with a "leiningen" run configuration it could work

9:51 cfleming another feature: when cursor is on fully qualified symbol, offer to add a require + refer

10:19 chitofan: has anybody used clojure for developing embedded software?

10:24 lavokad: :vs

10:25 Illusioneer: Is anybody familiar with nginx-clojure?

10:28 justin_smith: Illusioneer: it's weird, just use nginx as a reverse proxy

10:29 maybe try it if you find that per-request-overhead is your bottleneck. It probably won't be though.

10:30 Illusioneer: justin_smith: not even gotten nearly that far but is that an issue with it?

10:30 justin_smith: the improvement you would hypothetically get is less overhead per request since it is not proxying but clojure is in process

10:31 in return, deployment is more complex

10:31 tvanhens: is there a way to do a reduce and?

10:31 justin_smith: easier to make an uberjar, run it, and reverse proxy

10:31 Illusioneer: more complex? Id have thought that would simplify it

10:31 justin_smith: deploying clojure is really easy

10:32 tvanhens: I have a list of predicates and I want to check if they are all true. I can think of ways to do that but I feel like there has to be a quick and easy way to do that

10:32 justin_smith: ,(every? even [0 2 4 6])

10:32 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: even in this context, compiling:(NO_SOURCE_PATH:0:0)>

10:32 justin_smith: ,(every? even? [0 2 4 6])

10:32 clojurebot: true

10:33 tvanhens: every thats what I was looking for thanks

10:36 edw: `mapcat` is very nice, but so is `for`; how do folks deal with situations where you want to flatten the results of a `for` form but don't want an ugly `->>` form or a surrounding `(apply concat ... )`?

10:37 gfredericks: edw: for can flatten further with another clause

10:37 for is flatteningest

10:39 ,(for [x (range 5) y (range x)] [x y])

10:39 clojurebot: ([1 0] [2 0] [2 1] [3 0] [3 1] ...)

10:39 mdeboard: ->> is gorgeous tbh

10:39 you're missing out

10:40 i miss threadng macros in all the work I do

10:41 legittalon: wait. ->> is different from ->?

10:41 mdeboard: yes

10:42 &(-> 1 (+ 2))

10:42 lazybot: ⇒ 3

10:42 mdeboard: &(-> 1 (- 2))

10:42 lazybot: ⇒ -1

10:42 mdeboard: &(->> 1 (- 2))

10:42 lazybot: ⇒ 1

10:43 legittalon: &(->> (-2) 1)

10:43 lazybot: java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn

10:43 gfredericks: &(-2)

10:43 lazybot: java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn

10:43 legittalon: I'm such a noob.

10:44 justin_smith: legittalon: pretty much everything is a valid constituent of a symbol in clojure, so use whitespace to separate functions from arguments

10:45 ,(let [<-? 2 *_' 3] (+ <-? (* <-? *_')))

10:45 clojurebot: 8

10:46 razum2um: is there any way to make it more concise https://gist.github.com/razum2um/dc78032ef76778ac6a38 ?

10:47 justin_smith: by shortening the function name? :)

10:47 Bronsa: razum2um: (zipmap (map (partial apply f) xs) xs)

10:47 razum2um: Bronsa: thx

10:47 mdeboard: transducers

10:47 I think

10:47 Bronsa: mdeboard: uh? how would they help?

10:48 mdeboard: I have no idea

10:48 I just wanted to sound smart, I guess it backfired

10:48 justin_smith: (into {} (map (juxt #(apply f %) identity) xs))

10:49 err, swap the order on the identity and the #() of course

10:49 mdeboard: &(doc zipmap)

10:49 lazybot: ⇒ "([keys vals]); Returns a map with the keys mapped to the corresponding vals."

10:50 mdeboard: what's the diff between (partial apply f) and #(apply f %)

10:50 there

10:50 justin_smith: the zipmap version has to walk the input twice (not a huge deal of course, but always feels a bit less than ideal)

10:50 mdeboard: Bronsa:

10:50 Bronsa: mdeboard: none

10:50 justin_smith: partial creates a varargs fn, #() does not

10:50 it's a small difference

10:50 Bronsa: justin_smith: your version too, once for map, the second time for into

10:50 justin_smith: ahh, you are right :)

10:50 gfredericks: #() creates another damn class, partial does not

10:51 mdeboard: huh

10:51 today I learned, interesting

10:51 why is that bad

10:51 I'm sure that's a dumb question but..

10:51 gfredericks: it might not be :)

10:51 it makes stack traces easier actually

10:51 mdeboard: oh

10:51 you damned the notion of creating another class

10:52 I figured it was objectively bad

10:52 Bronsa: he was just being overly dramatic

10:52 gfredericks: the communication method language is the difficulty level hard

10:52 mdeboard: wat

10:52 did I have a stroke

10:52 justin_smith: (persistent! (reduce (fn [m v] (assoc! m v (apply f v))) (trainsent {}) xs))

10:53 edw: mdeboard: I have nothing against threading; I love it. But a two element threading form is ugly IMO.

10:53 mdeboard: edw: fair

10:53 edw: gfredericks: Ah, good point.

10:54 justin_smith: my last is no longer more concise, but it only walks the input once

10:54 Bronsa: ,(defn trainsent [coll] (println "chuff"))

10:54 clojurebot: #'sandbox/trainsent

10:54 justin_smith: heh

10:54 mdeboard: lol

10:54 justin_smith: good catch on the typo, I need my coffee

10:54 (inc Bronsa)

10:54 lazybot: ⇒ 51

10:54 mdeboard: &(doc trainsent?)

10:54 lazybot: java.lang.RuntimeException: Unable to resolve var: trainsent? in this context

10:55 justin_smith: the train sent my coffee that I have not yet consumed. Thanks Thomas!

10:55 Bronsa: justin_smith: I use that idiom all the time for building maps, I don't think there's a faster way to do it

10:56 mdeboard: which idiom is that

10:56 justin_smith's original?

10:56 or the trainsent gambit

10:56 Bronsa: reduce+assoc! w/ (transient {}) as init

10:56 mdeboard: ah

10:56 justin_smith: transient transient transient (too much more of that typo and it will become infections)

10:57 mdeboard: I love it

10:57 It almost sounds like a technical term

10:57 The trainsent pattern

10:57 justin_smith: heh

10:58 mdeboard: I'll give up the ghost, though.

10:58 I'm just stalling before I have to dive into work

10:58 justin_smith: mock all you want, I just have to make sure I don't imprint mentally on the misspelling :)

10:58 gfredericks: justin_smith: Bronsa: that's plumbing.core/map-from-keys I think

10:59 Bronsa: dunno, I don't get to use any utils library because of contribs :<

10:59 gfredericks: oh noes

10:59 justin_smith: gfredericks: looks like it

10:59 gfredericks: Bronsa: just rhickey's util library (clojure.core)

10:59 justin_smith: gfredericks: adding plumbing to my "util libraries" category

11:00 Bronsa: gfredericks: heh yeah

11:00 justin_smith: soon we will need a "all the utils" meta lib

11:00 gfredericks: justin_smith: it's the one I settled on

11:00 the included graph stuff is pretty useful for certain things too

11:01 justin_smith: looking at that now

11:01 http://blog.getprismatic.com/prismatics-graph-at-strange-loop/

11:01 Bronsa: https://github.com/Prismatic/plumbing/blob/master/src/plumbing/core.cljx#L35-L39 this is kinda ugly

11:01 justin_smith: woah

11:02 yeah I take back that "it's basically the same"

11:02 Bronsa: I guess they had to do it that way to avoid rewriting the for/doseq syntax

11:02 (:let/:when etc)

11:03 gfredericks: ah right I bet that was the point

11:04 justin_smith: could have used an array of length one instead of an atom

11:05 whether that's better or worse...

11:05 gfredericks: would be interesting to compare the speed

11:05 I can't think of any downside; they're just using reset! anyhow

11:05 Bronsa: one 1.7 is out we get volatiles for that

11:05 justin_smith: not any different semantics wise

11:06 and it's in a safe lexical env anyway

11:06 Bronsa: yeah, exactly

11:06 gfredericks: the entire use case for volatiles is such local enhancements?

11:06 justin_smith: hell, the let bindings inside the doseq could safely be one element arrays / volatiles defined outside the doseq

11:07 Bronsa: gfredericks: yes

11:07 gfredericks: like transients but for reference types?

11:07 zot: newb question: i have a set of keys, and want to gen a map with same keys, but vals as result of function taking the key as input. is there an idiomatic way to do this? so far i didn't see it in the set api, but some of the lingo there is confusing to me still...

11:07 Bronsa: gfredericks: they were introduced to replace atoms for the mutable state inside transducers

11:07 http://dev.clojure.org/jira/browse/CLJ-1512

11:07 gfredericks: Bronsa: yeah I know how they came up; just trying to figure out what else they might be used for

11:08 Bronsa: and I will keep complaining till the end of days about vswap! being a macro.

11:08 gfredericks: why?

11:08 clojurebot: because that's not how macros work

11:08 gfredericks: O_O

11:08 clojurebot: you are eerie

11:08 clojurebot: No entiendo

11:08 justin_smith: zot: seems like a job for reduce-kv

11:08 (doc reduce-kv)

11:08 clojurebot: "([f init coll]); Reduces an associative collection. f should be a function of 3 arguments. Returns the result of applying f to init, the first key and the first value in coll, then applying f to that result and the 2nd key and value, etc. If coll contains no entries, returns init and f is not called. Note that reduce-kv is supported on vectors, where the keys will be the ordinals."

11:08 zot: that sounds like exactly what i would want!

11:09 justin_smith: tnx :)

11:09 gfredericks: zot: justin_smith: what? I thought this was just map-from-keys as described above?

11:09 Bronsa: gfredericks: because there is no good reason why it couldn't be a function

11:09 gfredericks: Bronsa: oh with :inline stuff?

11:09 Bronsa: yes

11:09 tim___: Bronsa, well it could have :inline, but that stuff is pretty buggy apparently.

11:10 Bronsa: tbaldridge: no it isn't

11:10 zot: hrm. yes as i read ths descr (came after typing) i think it's not quite it

11:10 gfredericks: Bronsa: probably you're a weirdo if you need it to be a function :P

11:10 zot: i mean, i can use assoc as the top level of the inner func, but i wonder if there's something tighter

11:10 gfredericks: zot: there was code given above for map-from-keys, which is in plumbing if you like util libs

11:10 tbaldridge: Bronsa: http://dev.clojure.org/jira/browse/CLJ-1227 ?

11:11 Bronsa: tbaldridge: the "bug" was on definline, but it turned out it wasn't related to the :inline part at all, it was a bug on the fn munging

11:11 justin_smith: ,(reduce-kv (fn [m k v] (assoc m k (inc v))) {} {:a 0 :b 1 :c 2}) ; zot

11:11 clojurebot: {:a 1, :b 2, :c 3}

11:12 Bronsa: tbaldridge: even if the bug was in definline, that would have only affected definlines, manual :inline was never broken

11:12 justin_smith: or you could map over it and use what we were talking about above

11:12 Bronsa: tbaldridge: if you scroll at the end of that ticket there's the fn munging ticket linked that solves it btw

11:12 justin_smith: zot: oh, never mind, misread your question - you don't have a map coming in, just the keys

11:13 zot: which means gfredericks was right, it's exactly the function we were just talking about at length

11:13 zot: yeah, it's an actual set (or could be a list/vector, but currently a set)

11:13 tbaldridge: Bronsa: from what I understand, :inline would be superseded by this: http://dev.clojure.org/display/design/Inlined+code

11:13 Bronsa: tbaldridge: right, but that doesn't exist yet :)

11:13 tbaldridge: Bronsa: just saying, I could imagine it changing to a function at some point.

11:14 justin_smith: zot: (persistent! (reduce (fn [m v] (assoc! m v (apply f v))) (transient {}) xs))

11:14 f and xs are your function and your set

11:14 Bronsa: tbaldridge: sure, I'd like it if you were right

11:17 zot: justin_smith/gfredericks: tnx :)

11:20 squidz: does anybody know a good way to shift an entry in a collection left or right like (shift coll el :left)

11:21 modulus: when i use lein repl from outside a project directory under windows it refuses to recognise []s - inside a project it does. this is really really really strange.

11:22 any idea how to fix?

11:22 justin_smith: it won't recognize literal vectors?

11:22 modulus: it won't recognise the character

11:22 squidz: like (shift [{:id 0} {:id 1} {:id 2}] 1 :right) >>> [{:id 0} {:id 2} {:id 1}]

11:22 modulus: it refuses to register it

11:24 squidz: or (shift [{:id 0} {:id 1} {:id 2}] 1 :left) >>> [{:id 1} {:id 0} {:id 2}]

11:24 gfredericks: modulus: so if you type (first [1 2 3]) into your repl, what happens?

11:25 modulus: it interprets it as (first 2 3)

11:25 the []s don't appear on the text and it doesn't capture the character right after the [

11:25 so wrong arity

11:26 this is seriously super-weird, never happened before

11:26 gfredericks: I feel like nothing I know about clojure is remotely related to this problem

11:27 modulus: what's really strange is that it will correctly read when inside a project

11:27 hmm let me think, maybe it's running a different version of clojure

11:27 gfredericks: easy to check

11:27 ,*clojure-version*

11:27 clojurebot: {:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"}

11:29 modulus: no, that isn't it, i shifted the project's clojure to 1.6.0 and it works in it but not out of it

11:29 how do i even go about diagnosing this? i don't know where to start

11:30 d0ky: hello i want to find out how to implement red-black tree, is there any option to do it in java like in clojure style http://goo.gl/NMoAMf or any other advice ?

11:30 gfredericks: modulus: windows is probably pretty rare around here, so there might be a scarcity of ideas

11:32 technomancy: modulus: probably a jline bug related to locale?

11:32 justin_smith: squidz: interesting problem, here's my solution https://www.refheap.com/91106

11:32 modulus: ok, i see one distinction

11:33 justin_smith: squidz: weird thing is it returns false if no match is found - that could be fixed by changing the second arg to reduce in the binding of position

11:33 modulus: on the project i get RPLY-y 0.3.0 while outside i get RPLY-y 0.3.5, nRPL 0.2.6.

11:33 could it be a regression on REPL-y?

11:34 justin_smith: (inc technomancy)

11:34 lazybot: ⇒ 137

11:34 justin_smith: yeah jline windows bug is my guess too

11:35 Frozenlock: Somehow I feel dirty by doing the following... (filter identity [nil nil "string" 13]) ---> ["string" 13]

11:35 justin_smith: remove nil?

11:35 Frozenlock: yeah

11:35 justin_smith: ,(remove nil? [nil nil "string" 13])

11:35 clojurebot: ("string" 13)

11:35 lvh: So, it appears that a (core.async/take! c f) on a channel that gets closed at some point, f doesn't fire synchronously with the close

11:35 justin_smith: funny how the suggestion to use it looks like a verification that is what you are doing?

11:36 lvh: that's making it pretty annoying to test my fn

11:36 justin_smith: heh

11:36 Frozenlock: justin_smith: Is it more efficient?

11:36 justin_smith: reads more straightforwardly

11:36 Frozenlock: true

11:36 justin_smith: should be just about identical in performance

11:37 maybe faster? easy to micro-benchmark with criterium

11:38 Morgawr: it returns a list rather than a vector, it looks

11:38 justin_smith: Morgawr: what does?

11:38 Morgawr: the remove nil? vs filter identity

11:38 Frozenlock: Morgawr: filter/remove always do that

11:39 justin_smith: both filter and remove return lazy seqs

11:39 Morgawr: oh nevermind

11:39 modulus: technomancy - so any clue what to do about this, if it's jline related as you say?

11:39 Morgawr: I saw Frozenlock's output and I thought it was the bot's output

11:39 because he wrote [ ]

11:39 modulus: should i file a bug against repl-y?

11:39 Morgawr: ignore me then :)

11:39 Frozenlock: Yeah, I wrote it by hand, sorry about that :-p

11:39 technomancy: modulus: sure. maybe try changing your locale too?

11:39 Morgawr: you got me confused :P

11:40 modulus: not very sure how to do that on win32

11:40 er win64

11:41 technomancy: modulus: hang on, you get a different reply version when running in a project?

11:42 same lein version?

11:42 squidz: justin_smith: yeah I see, interesting, never knew abot clojures (reduced function. I wonder if there are other ways

11:42 modulus: correct

11:42 yes, same line version

11:42 technomancy: modulus: reply actually runs inside lein itself, not inside the project

11:42 so I don't understand how that's possible, but I guess it is

11:42 anyway, a bug report is warranted

11:42 squidz: justin_smith: how would you implement it if the id's weren't the indexes?

11:43 justin_smith: squidz: same

11:43 modulus: hmm let me check something

11:43 justin_smith: squidz: I am only using the id for matching, it works for any matching function

11:43 modulus: maybe i'm running two different leins due to path issues

11:43 * modulus checks

11:43 justin_smith: squidz: notice I allow any matching function for selecting a swappable element

11:44 squidz: oh right you get the index by the range, not by the map values

11:44 modulus: ok, when outside the project i was running another lein

11:44 unfortunately i believe it's the more modern lein that has this issue

11:45 squidz: thanks, I was wondering how I could solve it simply. I tried recursion, and I tried reduce, but your solution seems to be just what I was looking for

11:45 justin_smith: squidz: look out for edge cases

11:45 maybe check before trying to shift element 0 to the left

11:45 or trying to shift the rightmost to the right

11:46 otherwise, you are welcome, it was a fun morning programming puzzle :)

11:46 technomancy: modulus: reply bugs are like bubbles in wallpaper

11:46 justin_smith: squidz: also, maybe return the collection unmodified if position is false

11:46 technomancy: at least the locale issues are

11:46 push one down and it's just going to pop up somewhere else

11:47 squidz: yeah i'm modifyfing your version for the edge cases now

11:47 Bronsa: squidz: I implemented it with zippers http://sprunge.us/YFcD?clj. probably highly inefficient and bugged on the edge cases but fun :P

11:48 modulus: technomancy - i see, it's just that this seems a pretty basic input thing

11:48 justin_smith: interesting- one of these days I will grok zippers...

11:48 modulus: and it was working before. anyway i'll file.

11:48 Bronsa: slightly better http://sprunge.us/MUUB?clj

11:49 modulus: i mean being able to type brackets is kind of important lol

11:49 justin_smith: modulus: sounds like a really anemic version of sweajure - roundjure

11:49 clojure without vector literals

11:50 modulus: where do i file? googling for reply has ... issues

11:50 justin_smith: haha

11:51 squidz: Bronsa: cool, I never thought about using zippers i'll have to take a look and try to understand

11:51 modulus: yeah, theoretically one could do everything with (vec bla bla bla) i guess.

11:51 but it would get old fast

11:51 justin_smith: and #() instead of fn / defn

11:51 lol

11:51 modulus: hah

11:51 justin_smith: good luck getting by without let :)

11:52 Bronsa: #() dont even nest

11:52 modulus: yes, this does make it unusable really

11:52 justin_smith: right, but still easier than swearjure

11:52 modulus: i wonder if i'm the only person using it on win or no-one else noticed or what

11:53 borkdude: cfleming another nice feature for cursive: warning / special color when calling a function with wrong arity

11:54 martinklepsch: hey. I'm trying to get started writing cassowary in clj/cljs — I assume if I dig into core.logic I'll be able to make use of that later or at least better understand the domain of constraint solvers. Is that an ok assumption to make or should I approach that project from another direction?

11:56 squidz: Bronsa: never used zippers so now's a good time to see what they are about. Would you be able to use them if you were 'matching' on something else besides the index in the collection? For example if the collection was [{:id "a"}{:id "b"} ... ] and you wanted to shift element {:id "b"} for example?

12:00 Bronsa: squidz: sure, but zippers are mostly useful for walking nested datastructures, kind of an overkill for your use case I think

12:00 squidz: okay I see

12:02 borkdude: cfleming do you want me to put those features to github?

12:03 cfleming requests that is ;)

13:05 m1dnight: Hm, (java.util.ArrayList. [1 2 3]) works, but when I pass [1 2 3] to a java function and call x = new ArrayList<Object>([1 2 3]); it fails?

13:05 Any ideas?

13:05 casting! silly me!

13:10 gfredericks: are there any util libs that define min/max/>/</>=/<= using clojure.core/compare?

13:10 * gfredericks feels like he asked this maybe six months ago or something

13:11 bbloom_: gfredericks: i don't think that'd be useful at all b/c you can't parameterize other modules to use those operators

13:11 minus with-redefs or similar hackery

13:11 justin_smith: m1dnight: I don't think arrays in java implement the Collection interface

13:12 gfredericks: bbloom_: why isn't it useful for me to use myself?

13:12 bbloom_: gfredericks: *shrug* you mean just for the syntax benefit of variadic < instead of explicit compares in your own code?

13:12 yeah i guess you can do that :-P

13:13 gfredericks: bbloom_: it's semantic too; calling compare and looking at the sign of the return value is kind of klunky

13:13 not to mention error-prone

13:14 bbloom_: gfredericks: sure, i gotcha. was just saying that it's a bummer the built in operators aren't generic

13:14 justin_smith: m1dnight: try new ArrayList<Object>(Arrays.asList([1, 2, 3]))

13:15 d0ky: hello i want to find out how to implement red-black tree, is there any option to do it in java like in clojure style http://goo.gl/NMoAMf or any other advice ?

13:15 gfredericks: I might just write a dang library

13:15 justin_smith: d0ky: so you want to write a red black tree in java, imitating the style of that clojure code?

13:16 d0ky: justin_smith: yes, thats it

13:20 justin_smith: it should be pretty straightforward - probably easiest if you use the Clojure persistent datatypes

13:20 though that relies on core.match - which will turn into a switch statement in java I guess

13:21 d0ky: justin_smith: and without clojure persistent data types ? is also possible ?

13:22 justin_smith: it's possible, you just don't get the immutiblity / structural sharing

13:23 d0ky: justin_smith: ah ok i will search how to use clojure persistent DS in java

13:32 danneu: i have a range from 1 to 100. it's divided into 4 equal buckets. i want to determine the bucket a given number lands in: (get-bucket 24)=> 1. (get-bucket 25)=>2. (get-bucket 100)=>4. i'm blanking out, here

13:32 TimMc: Did everyone else know that contains? works on Java Collections in general and also on arrays? 'Cause I just found out, and I'm pretty happy.

13:33 danneu: how could you implement get-bucket?

13:33 TimMc: danneu: quot

13:34 ,(map #(inc (quot (dec %) 25)) [1 24 25 100])

13:34 clojurebot: (1 1 1 4)

13:34 nkoza: somebody is experimenting weird hiccups with latest melpa cider?

13:34 TimMc: almost

13:34 danneu: Wait, 25 => 2?

13:35 dbasch: TimMc: it’s 1 to 100, not 0 - 99

13:35 TimMc: OK, but then 25 should land in the first bucket

13:35 gfredericks: okay I think technomancy is forcing me to bite the GPG bullet

13:36 luxbock: nkoza: yes, there's an issue with eldoc and company mode, but I think at least the eldoc problem issue was closed, but I don't know if it's in the latest MELPA build yet

13:36 dbasch: TimMc: and it does

13:36 luxbock: I upgraded and haven't noticed the slowdowns yet so I think it probably worked

13:37 dbasch: your buckets are 1-4

13:39 TimMc: dbasch: Earlier you said (get-bucket 25)=>2

13:39 and I disagree with that

13:39 dbasch: TimMc: it wasn’t me :)

13:39 TimMc: All you d.* people are the same! I can't be expected to keep track.

13:40 danneu: ^ :-P

13:40 dbasch: TimMc: maybe you should group us into buckets by the second letter

13:40 TimMc: (group-by second (:users @channel))

13:40 xeqi: hi, I'm \e

13:41 gfredericks: hi, I'm \g

13:42 danneu: TimMc: thanks. yeah, i was wrong

13:44 technomancy: gfredericks: because of https deploy?

13:44 gfredericks: yeah

13:45 also `lein tag`

13:45 TimMc: ,(map #(inc (quot (dec %) 25)) [1 25 26 100])

13:45 clojurebot: (1 1 2 4)

13:45 technomancy: sure, blame me and not your own professional dignity

13:46 gfredericks: I just don't like having two different crypto identity systems

13:47 * technomancy quickly hides his plans to switch to HTTPS client certs

13:47 technomancy: wait, do you not like having two, or do you not like having more than one?

13:47 because we could easily make it three =)

13:47 gfredericks: http://en.wikipedia.org/wiki/Zero_one_infinity_rule

13:48 technomancy: what I'm saying is we need infinity crypto identity systems

13:48 technomancy: clojurebot: the number two is ridiculous and can't exist.

13:48 clojurebot: Ik begrijp

13:49 technomancy: ,(ns-unmap 'clojure.core 'second)

13:49 clojurebot: nil

13:49 TEttinger: the number two~

13:49 ~the number two

13:49 clojurebot: the number two is ridiculous and can't exist.

13:50 dbasch: infinity is the loneliest number

13:50 technomancy: gfredericks: on that note though, you can run the same program as gpg-agent and ssh-agent

13:50 gfredericks: technomancy: I'm so foggy about these issues that I have no idea what that means

13:51 I know what ssh-agent does

13:51 technomancy: gfredericks: it means from a "caching your passphrase" perspective, the tools you use for both systems are the same

13:51 gfredericks: i.e., one tool does both?

13:51 technomancy: yeah

13:53 gfredericks: do I need to go setup this gpg key on clojars

13:53 technomancy: gfredericks: no

13:53 gfredericks: https asks me to login though

13:53 that's what I always liked about scp

13:54 it used my ssh key

13:54 technomancy: gfredericks: the plans for verifying signatures server-side are on-hold

13:54 gfredericks: right; the idea is you encrypt your HTTPS credentials, and then it uses your gpg key to decrypt them on-demand.

13:55 https client certs would be an improvement, but there's no gpg-agent equivalent for them

13:55 so you'd have to enter the passphrase every time

13:55 gfredericks: my HTTPS credentials being my clojars username & password?

13:55 technomancy: yeah

13:55 xeqi: I'm probably going to pull turn the promotion stuff off for now, and then re-enable it once I fix the sig verifications

13:56 gfredericks: okay. I think I've got it all straight then.

13:56 technomancy: xeqi: I should have done that long ago; sorry

13:56 gfredericks: (inc technomancy)

13:56 lazybot: ⇒ 138

13:56 technomancy: gfredericks: it's confusing because gpg can be used for 3 distinct things

13:56 gfredericks: oh and clojars has a field for my PGP public key

13:56 I assume GPG isa PGP

13:57 xeqi: true

13:57 technomancy: gfredericks: that's totally optional; skip it for now

13:57 gfredericks: hey I just set a new password and clojars didn't tell me it had to be less than 12 characters. hooray.

13:58 the internet isn't all crazy

13:58 xeqi: technomancy: glad you're not opposed. then I'll include it in the next deployment

13:58 verma: ,(seq? [1 2 3])

13:58 clojurebot: false

13:58 verma: ,(seq? '(1 2 3))

13:58 clojurebot: true

13:58 verma: so IPersistantVector and ISeq are not sort of compatible?

13:58 ,(vector? [1 2 3])

13:58 clojurebot: true

13:59 jeremyheiler: ,(every? sequential? [[] '()])

13:59 clojurebot: true

13:59 verma: nice

13:59 ,(sequential? [])

13:59 clojurebot: true

13:59 verma: nice

13:59 (inc jeremyheiler)

13:59 lazybot: ⇒ 3

14:04 verma: is there an interface I can implement to get str function showing the right stuff for my defrecord?

14:05 Bronsa: verma: Object/toString

14:06 ,(defrecord x [] Object (toString [_] "1"))

14:06 clojurebot: sandbox.x

14:06 Bronsa: ,(str (x.))

14:06 clojurebot: "1"

14:06 verma: nice!

14:06 thanks!

14:07 avishai: hi, i need a hand with midje

14:08 i'm getting java.lang.ClassCastException: clojure.lang.AFunction$1 cannot be cast to clojure.lang.IFn$OLO

14:08 when trying to stub a function with type hinting

14:09 technomancy: clojure.lang.IFn$YOLO

14:09 Bronsa: avishai: it probably has nothing to do with midje, are you using with-redefs?

14:09 verma: (inc Bronsa)

14:09 lazybot: ⇒ 52

14:09 verma: Bronsa, println doesn't pick it up though

14:10 Bronsa: verma: yeah you have to extend print-method for that

14:10 hiredman: avishai: you are replacing a function that clojure has determined should be called in a way that takes primitive arguments with one that does not

14:11 Bronsa: by the fact atht he's getting an AFunction$1 I believe he might be rebounding it with something like ^long (fn [] ..) instead of (fn ^long [] ..)

14:11 verma: thanks Bronsa

14:12 trc: What's the meaning of @ before stuff-to-do symbol in this code http://hastebin.com/suladuluja.clj?

14:12 Bronsa: verma: np

14:14 justin_smith: trc: it's a reader-macro that expands to deref

14:14 cbp: trc: ~@ inside a macro is unquote-splice (or something like that), it "explodes" a list inside another list

14:14 puredanger: trc: ~@ is unquote-splice http://clojure.org/reader

14:15 justin_smith: I should have looked at that code before answering, d'oh

14:15 trc: Got it. Thanks guys :)

14:16 puredanger: trc: http://yobriefca.se/blog/2014/05/19/the-weird-and-wonderful-characters-of-clojure/ may also be useful

14:18 trc: puredanger: Thanks. That very helpful

14:19 mdeboard: puredanger: Oh, nice

14:19 Very glda it exists

14:19 glad, too

14:22 cfleming: borkdude: No, currently you can't debug lein tasks - issue welcome. Auto-import is partially there, does it not work for you? Wrong arity is coming very soon.

14:24 puredanger: the next cursive drop contains a keybinding panel, so you'll have no excuse :-)

14:24 puredanger: sweet

14:24 I have no excuse now, I'm just lazy :)

14:24 (inc cfleming)

14:24 lazybot: ⇒ 1

14:24 cfleming: hehe

14:24 puredanger: wat

14:25 cfleming: I'm new around these parts

14:25 puredanger: y'all are slacking

14:26 Bronsa: (inc cfleming)

14:26 lazybot: ⇒ 2

14:26 mdeboard: cfleming: When's that happening anyhoo

14:26 keybinds aren't really that big a deal for me atm

14:26 cfleming: What's that, the next drop?

14:26 mdeboard: yeah

14:27 cfleming: hopefully today, just waiting for confirmation that I actually fixed a bug from someone with a dev build.

14:28 avishai: Bronsa, i'll try with-redefs

14:29 Bronsa: avishai: don't, that wasn't a suggestion :) I just wanted to know if you were using it in order to help you

14:29 avishai: not using it

14:30 midje is creating the replacement function in `provided` block

14:30 don't really have control on how its created

14:30 Bronsa: I don't know any midje, it probably is using with-redefs itself under the hood then

14:31 avishai: can you control what the replacement function will be?

14:31 e.g. do you provide a (fn ..) form?

14:31 avishai: not really

14:31 Bronsa: avishai: can you nopaste the bit of relevant code so I can get a better idea?

14:31 mdeboard: arrdem: I was thinking, you should really get a different domain for your grimoire to help results on the google

14:32 clojuregrimoire.plumbing or something

14:33 gfredericks: technomancy: omg it worked

14:33 mdeboard: this is already taken http://grimoire.io/

14:33 So is foo.bar

14:33 Bronsa: puredanger: we were talking about this issue yesterday, primInvoke breaks with-redefs -- should this be in scope with build profiles?

14:33 mdeboard: and clojure.foo

14:34 puredanger: Bronsa: eh?

14:34 Bronsa: puredanger: i.e. make dev/test profiles compile primInvokes to (if (instance? the-f primInterface) (.invokePrim the-f ..) (.invoke the-f ..)) and have the direct callpath in the production

14:34 puredanger: by we I mean me and other people in #clojure, not me and you :)

14:35 puredanger: you mean to get errors at dev time?

14:35 or to catch a redef that changes prim-ness?

14:35 Bronsa: puredanger: right now if we have (defn x ^long [] 1) (defn y [] (x)) to with-redefs x the fn must be properly hinted or invoking y will produce a classcast exception

14:37 puredanger: I was suggesting making clojure dev profiles compile to include a check at the invoke site rather than directly to invokePrim calls

14:37 I'm asking because I see build profiles are in Release.Next

14:38 puredanger: they are in their specifically with respect to the fastload / direct ideas. All of that has been pretty dormant since transducers. And I would categorize the results of those as inconclusive.

14:38 s/their/there/

14:38 Bronsa: ah

14:39 puredanger: which is not to say they won't come back up but I think it's more likely 1.7 will proceed w/o them right now

14:39 Bronsa: got it

14:39 puredanger: popping the stack...

14:39 I think there are many things that could potentially be done in a dev profile

14:39 to give more feedback on errors etc

14:40 what is your intention in this case? (I may just need more coffee :)

14:41 gfredericks: Bronsa: interesting point I think puredanger made about doing it in a dev profile -- you wouldn't want e.g. to have your dev code work perfectly because it's more flexible but then fail in production or something

14:41 puredanger: that's what I was trying to understand

14:41 Bronsa: puredanger: I'm more interested in solving inconsistencies in the current "profile", currently there are things like ^:inline & primInvoke that break with-redefs

14:42 gfredericks: puredanger: we weren't talking in terms of dev profiles specifically yesterday, so that aspect didn't come up

14:42 so I think Bronsa is talking about a different sort of use case than "dev"

14:43 I don't know what it is exactly though

14:43 Bronsa: it is my impression (I'm probably wrong though) that with-redefs was primarily intended for temporarily stubbing functions, for testing

14:44 puredanger: generally, I think that's the common case

14:45 justin_smith: I wouldn't mind at all if with-redefs only worked with a dev profile, that seems a sane arrangement actually

14:45 (and then I'll find out half the libraries I rely on are misusing with-redefs...)

14:45 puredanger: http://crossclj.info/fun/clojure.core/with-redefs.html

14:45 gfredericks: Bronsa: oh yeah I guess if it's just something that affects with-redefs then it's less of a danger

14:45 Bronsa: I see in the confluence page that there's mentioned a "dyn" profile, that might probably be a better fit for what I had in mind

14:45 puredanger: "den" is approximately what we have now

14:45 arg autocorrect

14:45 Bronsa: (I'm probably screwing myself here since I depend on with-redefs for prod in tools.emitter.jvm :P)

14:45 puredanger: dyn

14:46 gfredericks: superdyn then

14:46 danneu: TimMc: alright, i think i got it. i was implementing x-rate-limit middleware https://gist.github.com/danneu/1d4c2f6a8e47935dbfb0 since https://github.com/myfreeweb/ring-ratelimit doesnt let you specify the rate limit window

14:49 gfredericks: ,(defmacro without-redefs [bindings & body] (cons `do body))

14:49 clojurebot: #'sandbox/without-redefs

14:50 justin_smith: haha

14:50 gfredericks: everybody start using ` on your special forms so we can futureproof against special forms getting namespaced

14:50 Bronsa: if only

14:55 gfredericks: haha! "if"! get it!

14:55 stuartsierra: ,`do

14:55 clojurebot: do

14:57 TimMc: danneu: Wrong nick, I think. :-)

14:58 danneu: TimMc: nah, there's your work, dude: https://gist.github.com/danneu/1d4c2f6a8e47935dbfb0#file-ratelimit-clj-L27

14:59 gfredericks: okay I wrote those comparison functions I was whining about: https://github.com/gfredericks/compare

14:59 danneu: resume filler

14:59 TimMc: Oh, I see -- I read too quickly.

15:16 doctorm: What am I doing wrong with this simple protocol test? https://www.refheap.com/91122

15:16 gfredericks: doctorm: too many args to formal

15:17 clojure throws a totally different error messages on arity problems with protocols vs normal functions

15:17 doctorm: gfredericks: Ah, I see

15:17 justin_smith: doctorm: you need an explicit this arg

15:17 gfredericks: oh yeah that's the other side of the problem

15:17 * gfredericks didn't notice the real issue because he HAD to be first to answer the question

15:18 gfredericks: should there be a ticket about that error message?

15:18 it pretty much always means "wrong arity" amirite?

15:19 doctorm: gfredericks: Looks like there is one - http://dev.clojure.org/jira/browse/CLJ-735

15:19 puredanger: I'm still waiting on that one :)

15:20 one of the first tickets I ever filed

15:21 gfredericks: puredanger: waiting on what?

15:21 puredanger: for *someone* to approve it :)

15:21 * gfredericks approves it

15:21 puredanger: thx

15:24 Rich bumped this one way up in priority today http://dev.clojure.org/jira/browse/CLJ-1315 btw, not sure what prompted that

15:28 llasram: Awesome

15:29 allenj12: anyone wanna help me with this macro im trying to make? https://www.refheap.com/91123

15:29 llasram: Well, you know the first rule of macro club

15:30 allenj12: llasram: no what is it?

15:30 puredanger: thx to Bronsa, CLJ-1330 is now in the Screened list too http://dev.clojure.org/jira/browse/CLJ-1330

15:31 allenj12: don't write a macro :)

15:32 not that I think he was serious :)

15:33 llasram: allenj12, puredanger: well, half-serious. Hadn't looked at refheap yet

15:33 And now that I'm have, I'm afraid I don't understand :-)

15:33 johnny_mck: quit

15:33 llasram: allenj12: "overwrites the namespace of a function" -- not sure what you mean

15:34 allenj12: And, why does this need to be a macro vs just a higher-order function?

15:34 allenj12: llasram: its for overtone, i wanna be able to evaluate the macro and it to regenerate the function... its mainly for speed when im live coding music

15:35 doctorm: So for defprotocol, the first argument is always assumed to be something that implements the protocol?

15:35 llasram: allenj12: WHy not just e.g. `(def whatever-name (loopy-as-a-hof ...))` ?

15:35 allenj12: llasram: because currently say if i call a recurring function called loop if i do (loop (some midi notes here)) i cant really change those notes since its stuck in the temporal recursion then

15:36 llasram: allenj12: Oh, it re-schedules itself via the var

15:36 allenj12: yes

15:36 its very domain specific, i wouldnt do this for anything but live coding music

15:37 i wanna be able to change the parameters of the function... by calling the function again... why its recurring... if that makes sense

15:37 llasram: allenj12: Ok. I'd still suggest separating out the part which defines the function to a higher-order function, then having a wrapper macro which does the `def` and passes the `def`d var as one of the parameters

15:37 Is the part missing just that you need to unquote `fname` and accessing the var?

15:37 clojurebot: It's greek to me.

15:38 llasram: allenj12: That should be just `~fname` and `(var ~fname)` respectively

15:38 (with the '`' characters in this case being me indicating code, not part of the program text)

15:39 Well, or `fnname` as you currently have the parameter

15:41 allenj12: llasram: yea i keep getting unable to resolve symbol fname :(

15:41 justin_smith: llasram: allenj12: would using intern remove the need to use a macro?

15:41 ,(doc intern)

15:41 clojurebot: "([ns name] [ns name val]); Finds or creates a var named by the symbol name in the namespace ns (which can be a symbol or a namespace), setting its root binding to val if supplied. The namespace must exist. The var will adopt any metadata from the name symbol. Returns the var."

15:41 llasram: allenj12: your macro parameter is `fnname` (with an extra "n")

15:42 Make them match and you should be good

15:42 (Well, you still need to change #'fname -> (var ~fname), but otherwise)

15:43 allenj12: justin_smith: maybe actually i think i might need to play with that more for an intuiton on that

15:43 llasram: justin_smith: I'd argue that that would be grosser, because you'd have a function which mucked with the namespace

15:43 I think a macro is the right approach for handling that aspect

15:44 allenj12: llasram: its now complaining beat is not supported arg for *metro* which it def should be

15:46 llasram: allenj12: This is where separating out the function vs macro portions will make your code much simpler. As-is you've got a whole boatload of namespaced symbols

15:47 allenj12: llasram: yea

15:47 llasram: That particular error is probably because you're passing the literal namespaced symbol `beat to whatever *metro* is, but still

15:49 amalloy: llasram: by the way, #'~fname is the same as (var ~fname). you don't actually need to use the long form just because you're in a macro

15:50 llasram: amalloy: Oh, that is obvious in hindsight. Thank you

15:59 justin_smith: llasram: why is a function messing with a namespace worse than a macro that mucks with a namespace?

16:00 (asking as a legitimate question)

16:02 llasram: justin_smith: So you can just call `def`, which is more common and thus easier to understand :-)

16:03 I think you have a point -- the big thing for me would be separating definition of the function from the namespace-mucking part

16:05 aaelony: having a bit of a time with mysql with java.jdbc and running out of memory when trying to execute a query that dumps to a delimited file. This despite among other things using ideas/code as suggested here http://stackoverflow.com/questions/19728538/clojure-java-jdbc-query-large-resultset-lazily where it appears to have worked correctly for the author. I'm able to use the mysql client to easily and quickly extract the data I need, but would

16:05 much rather like to be able to do this in Clojure with not more than 2GB RAM. The example makes use of clojure.java.jdbc/query and clojure.java.jdbc/prepare-statement. I'm also don't think I'm "holding onto the head" of anything that would interfere with laziness. Just stumped. Any help appreciated. thanks.

16:07 amalloy: aaelony: how can anyone help without any idea what your code is doing? you've posted a link to code that works but is not yours, so the best answer i can give right now is "do what that guy does"

16:07 aaelony: amalloy: it's exactly as in the link I posted

16:07 please see the link

16:07 the error I get is: java.lang.OutOfMemoryError: GC overhead limit exceede

16:07 d

16:08 llasram: aaelony: What version of clojure.java.jdbc are you using?

16:08 amalloy: i see the link. it is to code that the author, and you, say works. if you claim your code is the same byte-for-byte but doesn't work, then call an exorcist

16:08 aaelony: clojure 1.6.0

16:09 llasram: aaelony: No. clojure.java.jdbc, not clojure

16:09 aaelony: clojure.java.jdbc 0.3.5

16:09 (slow to type)

16:09 mysql/mysql-connector-java "5.1.25"

16:10 llasram: Then I'm going to need to agree with amalloy if you are literally running exactly the same code with different results

16:10 aaelony: what can I post that would help

16:10 ?

16:11 llasram: (although that honestly seems unlikely, as the answer in that post references postgres and you say you are using mysql)

16:11 The actual code that you are using

16:11 aaelony: I will refheap it. give me a minute...

16:13 https://www.refheap.com/91126

16:16 llasram: aaelony: So I honestly haven't used clojure.java.jdbc, but it seems like there is a `result-set-fn` which defaults to being either `vec` or `doall`, neither of which seem to be what you cant here

16:17 s,cant,want,

16:17 aaelony: Maybe try adding `:result-set-fn dorun` to the `jdbc/query` arguments

16:17 aaelony: It *will* output data, but only when the I give it a query with a small limit, e.g. select * from bigtable limit 100

16:18 llasram: I will try your recommendation...

16:18 justin_smith: aaelony: small style thing, string/join is already eager, so you don't need to wrap the arg in doall

16:18 also, it already returns a string, so the wrapping str is redundant too

16:18 aaelony: justin_smith: ok, at this point I was just trying to do exactly what the stackoverflow post author had found to work

16:19 justin_smith: ahh, OK

16:19 amalloy: aaelony: your row-fn returns a string, so unless you change result-set-fn, you're returning a vector of strings

16:19 justin_smith: like I said, not correctness issues, just style

16:19 amalloy: if you have a large number of rows, you'll have a large vector

16:19 llasram: amalloy: If you look, they then actually do `#(.write writr (row-fn %))`

16:19 So it'll actually be a large vector of `nil`s

16:19 But potentially same problem

16:19 (which I think `:result-set-fn` will fix)

16:20 amalloy: ah, right

16:20 aaelony: amalloy: that's probably it. Everything is really large, so I don't want anything that may overflow...

16:21 andyf_: technomancy: Did you intentionally change the email address on your JIRA acct? Ok if so. It just looked odd

16:21 aaelony: trying it now with :result-set-fn dorun ...

16:23 technomancy: andyf_: yeah, it seemed easier than hunting down everything I'm getting notifications for and unsubscribing individually

16:23 aaelony: another thing is that I would expect it to report every 1000 rows, but it is silent...

16:24 andyf_: technomancy: Understood. Good to know JIRA isn't under attack yet

16:25 amalloy: no-thanks@technomancy.com?

16:27 technomancy: close enough =)

16:27 andyf_: Clojure-jira-updates-are-bursty@cant-keep-up.com

16:29 hiredman: I use the rss feed

16:29 it is great

16:30 technomancy: I'm allergic to Dave Winer.

16:30 dagda1: what does the hash symbol in this expression mean (inc (#'levenshtein-distance (rest seq1) seq2))

16:30 justin_smith: ,#'+

16:30 clojurebot: #'clojure.core/+

16:31 justin_smith: ,+

16:31 clojurebot: #<core$_PLUS_ clojure.core$_PLUS_@77e40c>

16:31 justin_smith: it points to the var, rather than the thing the var resolves to

16:31 ,#'*clojure-version*

16:31 clojurebot: #'clojure.core/*clojure-version*

16:31 justin_smith: ,*clojure-version*

16:31 clojurebot: {:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"}

16:31 justin_smith: better example

16:32 amalloy: it's hard to believe (inc (#'levenshtein-distance (rest seq1) seq2)) actually needs the #', though

16:33 i guess they're probably memoizing it later on, and want to indirect through the memoized var

16:33 dagda1: I don't think I understand this, is there a name for this so I can look at the docs

16:33 justin_smith: dagda1: var

16:33 amalloy: ,'#'foo

16:33 clojurebot: (var foo)

16:33 alejandro1: amalloy: what do you mean "indirect through the memoized var"?

16:36 amalloy: i mean like this: (defn fib [n] (if (<= n 1) n, (+ (#'fib (- n 1)) (#'fib (- n 2))))), (alter-var-root #'fib memoize) (fib 50)

16:36 ie, instead of making a direct recursive call to the "dumb" fib that's currently being defined, they make a call to the memoized fib that will later be stored in the var

16:43 allenj12: my brain hurts now, might take a nap from all these macros :)

16:49 aaelony: that was with (jdbc/query db-connection [statement] :as-arrays? true :result-set-fn dorun :row-fn ...

16:49 update... re-tried dumping a large resultset (this time at the repl, not in emacs). after 12 minutes the error message is "OutOfMemoryError GC overhead limit exceeded com.mysql.jdbc.MysqlIO.nextRowFast (MysqlIO.java:2222)" that was with (jdbc/query db-connection [statement] :as-arrays? true :result-set-fn dorun :row-fn ...

16:50 justin_smith: aaelony: connect a profiler and see what's using up the heap

16:50 the jvm comes with one (jvisualvm) but there are other options too, like yourkit, etc.

16:50 clojurebot: Cool story bro.

16:50 justin_smith: ~botsmack

16:50 clojurebot: clojurebot evades successfully!

16:51 aaelony: justin_smith: yeah, I'll try that next I. I guess I need to :aot everything first?

16:51 amalloy: no

16:51 justin_smith: no, you don't

16:52 you do need to add a jvm opt to open a dt-socket

16:52 aaelony: justin_smith: ok, I'll look that up ...

16:52 justin_smith: "-agentlib:jdwp=transport=dt_socket" in :jvm-opts in project.clj

16:53 that allows a debugger full access to the vm

16:53 if that's your only opt, it goes in a vector

16:53 aaelony: justin_smith: thank-you.. finding that would've taken me a while!!

16:53 justin_smith: err... to be more clear, opts go in a vector :)

16:53 amalloy: yeah, or just don't do that and let the profiler attach manually, which works fine as long as it's running on your local machine

16:54 justin_smith: amalloy: really? thought it was neccessary but I guess I was cargo-culting it because I needed it once upon a time

16:54 amalloy: justin_smith: there are a few minor features that you can get if you attach before starting up, but nothing i've ever needed to use

16:59 puredanger: I don't usually set any options to attach with visualvm

16:59 I do with yourkit but usually I'm setting something that way

17:01 aaelony: ok, I will first try re-running with VisualVM (mac os x mavericks) with a lein repl and see what happens... it will take 10 min or so..

17:02 puredanger: by the way all, planning to open up the 2014 State of Clojure/ClojureScript survey next week

17:03 Chas asked me to give him a hand due to his newborns but it is essentially the same

17:03 technomancy: puredanger: cool; thanks for taking that up

17:04 puredanger: np

17:04 I'm very interested in seeing the jvm usage data this year

17:04 given that java 1.7 is EOL in a few months

17:04 technomancy: whoa; really?

17:05 puredanger: yeah, I think it's March?

17:05 mrcheeks: heh, I haven't even use either 1.7 or 1.8 in prod yet

17:05 used*

17:05 technomancy: 1.6 is still getting security updates, just from redhat instead of oracle iirc

17:05 puredanger: http://www.oracle.com/technetwork/java/eol-135779.html

17:05 justin_smith: I swear debian and osx have conspired to freeze everyone on 1.6

17:05 technomancy: which is arguably better? =)

17:06 puredanger: lein survey from march: http://lein-survey-2014.herokuapp.com/afc8dc1d80cd2468dee533a795610f.png

17:06 puredanger: I saw that, thx

17:06 technomancy: 1.8 was pretty new in march though, I think?

17:06 puredanger: that was right after 1.8 came out right?

17:06 technomancy: I think so

17:08 borkdude: really cool that lein test :only also supports test-ns-hook

17:09 I tried to understand the code which takes care of that, but I'll just believe it works

17:10 is there anything to stop after the first error or failure instead of lein fail fast anno 2014?

17:11 technomancy: borkdude: if lein-fail-fast doesn't work with 2.x I bet it would be an easy fix

17:11 borkdude: technomancy I wondered why retest is built in, but something like fail fast not

17:12 technomancy: retest is harder to do in a plugin

17:12 well

17:12 yeah, it would require some monkeypatching

17:12 borkdude: I see

17:12 technomancy: which fail-fast would too, but it hardly matters since by the time the monkeypatching is hit, the JVM is already exiting =)

17:13 bbloom_: gfredericks: did you mean "use"? https://github.com/gfredericks/compare#usage

17:16 gfredericks: bbloom_: no, I meant to prefix the usages with `compare/`; but yes it's wrong, thanks :)

17:17 fixed

17:18 bbloom_: />= seems so haskell

17:18 "not bind" maybe?

17:18 or is that />==

17:18 gfredericks: just like without-redefs

17:18 bbloom_: or >/=

17:18 without-redefs?

17:18 gfredericks: without-redefs is dangerous to use in development, please only use it in production

17:19 it's like with-redefs but it doesn't redefine anything

17:19 puredanger: I assume I can find this in core.uncontrib

17:19 gfredericks: lol

17:19 bbloom_: heh

17:20 koreth_: If I want mapcat-style semantics from "for", is the best way to do it to wrap a regular "for" in "mapcat identity"?

17:20 bbloom_: puredanger: libraries contributed by the united nations?

17:20 gfredericks: koreth_: use more clauses

17:20 bbloom_: ,(for [x (range 3) y (range 3) [x y]) ; koreth_

17:20 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

17:20 hiredman: ,(for [i (range 3) ii (range i)] ii)

17:20 clojurebot: (0 0 1)

17:20 bbloom_: ,(for [x (range 3) y (range 3)]/ [x y]) ; koreth_ ( i suck)

17:20 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core/for>

17:20 gfredericks: bbloom_: puredanger: that got me imagining a library that specifically has everything rich hickey has rejected

17:20 puredanger: heh

17:21 bbloom_: i can't type, but you get the idea koreth_

17:21 puredanger: clojurebot should really just re-run the previous statement with more parens when it gets Unmatched delimiter :)

17:21 bbloom_: didn't rich already propose the "yes" language?

17:21 hiredman: that was steve

17:21 (yegge)

17:22 borkdude: ,(for [x [1 2 3 :let y [(inc x) (dec x)] result y] result)

17:22 bbloom_: or thought it was rich to mock (or some more polite word) yegge

17:22 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

17:22 borkdude: lol

17:22 amalloy: i thought steve said clojure should be a yes language, and rich said look man, go make your own yeslang

17:23 koreth_: bbloom_: I'm not sure I see how that helps.

17:23 ,(for [x (range 3) y (range 3)] [x y])

17:23 clojurebot: ([0 0] [0 1] [0 2] [1 0] [1 1] ...)

17:23 koreth_: ,(mapcat identity (for [x (range 3)] [x (str x)]))

17:23 clojurebot: (0 "0" 1 "1" 2 ...)

17:23 aaelony: ok, silly question... what should I be looking for from visualvm? I see byte[] at 72% live bytes and byte[][] at 23 %, and com.mysql.jdbc.ByteArrayRow at 3.9% live bytes. Does that mean that writing to file is the bottleneck rather than jdbc?

17:23 bbloom_: koreth_: nested for is the same as mapcat or "flatmap"

17:23 technomancy: gfredericks: isn't that just potemkin?

17:24 cfleming: puredanger: CLJ-1315 might be a fastload thing? Either way I'm stoked to see it getting some love.

17:24 hiredman: ,(for [x (range 3) i [x (str x)] i)

17:24 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

17:24 koreth_: By "mapcat semantics" I mean that the body of the for returns a list, and I want the result of the "for" to be the concatenation of those lists.

17:24 hiredman: ,(for [x (range 3) i [x (str x)]] i)

17:24 clojurebot: (0 "0" 1 "1" 2 ...)

17:24 gfredericks: technomancy: :P

17:24 puredanger: cfleming: I've been looking at it for the last hour

17:24 cfleming: And many thanks to Bronsa for CLJ-1330 too

17:24 koreth_: hiredman: Ah, okay, that makes sense. Thanks.

17:25 puredanger: cfleming: I've run a patched version of Clojure on many oss clojure projects, have yet to find a place where it causes new failures (which is a good sign)

17:25 hiredman: koreth_: btw mapcat identity is apply mapcat

17:25 err

17:25 apply concat

17:25 koreth_: hiredman: Doesn't apply break laziness?

17:25 hiredman: try it and see

17:25 aaelony: I also see used heap size increasing until a plateau and then a crash

17:25 cfleming: puredanger: I've been running that patch since it came out. Everyone running Cursive has been using it since then.

17:25 puredanger: Although I realised later that I only really need it to compile.

17:26 aaelony: have screenshots...

17:26 borkdude: ,(for [x [1 2 3] :let [y [(inc x) (dec x)]] result y] result)

17:26 clojurebot: (2 0 3 1 4 ...)

17:26 cfleming: puredanger: I had a horrible Heath Robinson contraption set up to compile before that.

17:27 bbloom_: puredanger: while we're discussing tickets, what can i do to help CLJ-803 along? :-)

17:27 puredanger: bbloom_: nothing, it's waiting for Rich

17:27 bbloom_: ok

17:28 puredanger: I'm just waiting for ztellman to pop up and ask me about unrolled collections now

17:28 bbloom_: that's the only ticket that affects me which i can't work around easily by copy pasting code in to my own project (because it affects the API of my project, people need to use my swap)

17:28 gvec transients and stuff were easily remedied by good ol' copy paste

17:30 puredanger: Bloom Hypothesis: "a sufficiently wide copy and paste can solve any problem" ? :)

17:30 bbloom_: puredanger: yes, but add "...up to but not including other people refusing to run my copy pasted code"

17:31 and then add "....minus class loader voodoo"

17:43 amalloy: "Monads are in danger of becoming a bit of a joke: for every person who raves about them, there’s another person asking what in the world they are, and a third person writing a confusing tutorial about them. Well, forget all that! In this pragmatic article we'll..." [...writes confusing tutorial]

17:43 technomancy: hehe

17:47 bbloom_: amalloy: they've forgotten the 4th person who understands them and genuinely thinks that they're a waste of mental energy

17:49 amalloy: bbloom_: sorry, i can't accept responses that aren't in the form of a pun on words like Just, Nothing, bind, or return

17:50 bbloom_: amalloy: the've forgotten the Suc (Suc (Suc (Suc 0))) person who Just understands but binds to the thought that the _return_ on investment is Nothing

17:51 amalloy: not bad at all. ten points to ravenclaw

17:51 bbloom_: oh, and something about burritos

17:51 amalloy: though i don't think the peano numbers are relevant to monads

17:52 technomancy: "It's math"

17:52 bbloom_: i'll go with technomancy's explaination

17:52 gfredericks: (inc technomancy) ;; low latency

17:52 lazybot: ⇒ 139

17:52 bbloom_: haha

17:52 (inc team)

17:52 lazybot: ⇒ 1

17:52 bbloom_: really? just one?

17:52 from now on all group effort points will be awarded to team.

17:53 gfredericks: $karma #clojure

17:53 lazybot: #clojure has karma 7.

17:53 bbloom_: $karma clojure

17:53 lazybot: clojure has karma 20.

17:53 bbloom_: $karma bbloom

17:53 lazybot: bbloom has karma 45.

17:53 gfredericks: $karma rhickey

17:53 lazybot: rhickey has karma 2.

17:53 bbloom_: i'm clearly at least twice as good as clojure.

17:53 aw, boo

17:53 (inc rhickey)

17:53 lazybot: ⇒ 3

17:53 gfredericks: $karma rich

17:53 lazybot: rich has karma 0.

17:54 gfredericks: $karma richhickey

17:54 lazybot: richhickey has karma 0.

17:54 gfredericks: huh.

17:57 amalloy: well it's not like he's on here much. certainly not since lazybot started tracking karma

17:57 and wouldn't you feel silly inc'ing him? he doesn't need your acknowledgment

18:04 bbloom_: amalloy: yeah, but i do feel like somebody should special case that to return Long/MAX_VALUE

18:04 :-P

18:05 amalloy: i could set it to over nine thousand

18:06 $karma rhickey

18:06 lazybot: rhickey has karma 9003.

18:07 amalloy: this way it's absurdly high but incs still matter

18:08 bbloom_: (inc amalloy) ; excellent

18:08 lazybot: ⇒ 173

18:09 bbloom_: amalloy: you still need acknowledgement, right?

18:09 amalloy: bbloom_: twice a day or i wither and die

18:14 aaelony: well, one complicating issue was that my data contains 00-00-00 00:00:00 dates that may have been silently accumulating. Adding to the JDBC URL "?zeroDateTimeBehavior=convertToNull" seems to correct this. Probably not the **only** problem, but one less at least ;)

18:19 gfredericks: that's an exciting JDBC URL option I didn't know about

18:20 aaelony: lol, I could do without that kind of exciting ;)

18:22 http://stackoverflow.com/questions/11133759/0000-00-00-000000-can-not-be-represented-as-java-sql-timestamp-error

18:30 asQuirreL: hey guys, I'm looking to create something similar to a map in which two keys point to the same identity, is there an idiomatic way to achieve that?

18:32 dbasch: asQuirreL: you mean, for every value in the map there are always exactly two keys pointing to it?

18:33 what is it that you want to enforce?

18:33 asQuirreL: suppose the keys are `x`, or `y` in `m`, then `(update-in m [x] f)` and `(update-in m [y] f)` modify the same object in memory

18:33 I want to maintain the invariant `(= (m x) (m y))` always.

18:34 if it helps, the structure I am actually trying to create is, for a context free grammar, a map from non-terminals to rules they occur in.

18:35 so two non-terminals may appear in the same rule, but I want that rule to actually be the exact same rule in memory so that if I access it through one non-terminal in the map and modify it, the version seen by the other non-terminal is also modified.

18:36 I could perhaps achieve this by using atoms as values in the map, but, this adds thread synchronisation which I am not interested in, so I was wondering if there was a way of getting the indirection without the synchronisation

18:37 dbasch: asQuirreL: you could have the keys point to the var instead of the value

18:37 asQuirreL: yep, I looked into that, but couldn't find a way to create anonymous vars for the purpose

18:37 would I just use gensym?

18:39 dbasch: you could also have your key be the set of all the keys that point to a value, and use that in your map

18:39 that’s logically what you want

18:40 the indirection comes from the key side

18:41 asQuirreL: dbasch the issue with that is that it makes lookup more cumbersome

18:41 I plan on querying this map using non-terminals

18:41 dbasch: asQuirreL: create a lookup function for that

18:42 but logically you have a bunch of equivalent terminals for which any of them is a key

18:42 sorry, non-terminals

18:43 asQuirreL: dbasch, well not quite, the real data structure is a map of sets, keyed by non-terminals, where each set is the set of rules it occurs in (it is not a straight 1-1 map)

18:43 amalloy: asQuirreL: have another canonicalizing function c, and then instead of (update-in m [x] f), you write (update-in m [(c x)] f)

18:44 and use c when you read as well

18:44 then as long as (= (c x) (c y)), this acts like a map where x and y are indistinguishable

18:46 asQuirreL: amalloy that's an interesting idea

18:46 amalloy: if instead you insist on a "map" where updating x magically makes the same change to the value under y, then what you have won't be a map anymore: it's violating the most basic requirements of a map

18:47 asQuirreL: does it?

18:48 I would've thought, seeing as it does not touch the keyset, that the map properties are preserved

18:48 there's no chance of a key collision, I mean

18:49 the fact that the map is not injective is not an issue, is it?

18:49 amalloy: errrrr, i don't think you've defined things formally enough for injective to be relevant

18:50 tuft: is there any way to make the reader/writer deal in tagged literals for java objects instead of the weird #<Foo SomeFooRepr> strings it spits out by default?

18:50 asQuirreL: I just don't understand which fundamental property of maps it violates?

18:50 (Really the mapping I want is from non-terminals to sets of identities (of rules))

18:50 amalloy: but an immutable map should have the property that (let [m some-map] (= (get m x) (get (update-in m [y] f) x))), as long as (not= y x). the value for each key is distinct. it's really confusing if that's not true

18:50 dbasch: all you really want is a level of indirection, where a and b point to k, and k is a key in a different map

18:50 tuft: specifically I'm working with DateTimes, which end up printed as e.g. #<DateTime 2014-10-03T22:47:46.243Z>

18:51 amalloy: dbasch: right, which is my c function (another map)

18:51 dbasch: yes, that’s what I’ve been saying

18:51 tuft: trying to debug some test.check test failures and it gives me back the generated dates in those terms (not using #inst as joda stuff has more utility)

18:51 asQuirreL: dbasch exactly

18:51 amalloy, that is not a fundamental property of maps, and simultaneously, is definitely the property of injectivity

18:52 amalloy: that doesn't sound like injectivity at all to me, if you are talking about injective relations

18:52 asQuirreL: injectivity with respect to identities

18:53 amalloy: injective means that the same value is never stored under two different keys, which is not at all what i said

18:54 asQuirreL: but if I were to rephrase that as "injectivity with respect to identities is the property that the same identity is never stored under two different keys" then that is what you said, right? The issue is only the codomain that we are both referring to

18:54 which is by-the-by in my opinion, because identities are themselves values

18:55 tuft: looks like this is relevant http://stackoverflow.com/questions/1288877/what-would-be-the-correct-way-to-serialize-this-java-object-in-clojure

18:57 amalloy: i am checking out of this conversation: i don't have anything more productive to say about these maps

19:00 asQuirreL: it's true, I could convert the sequence of rules into a vector, thus keyed by index, and then uses the indices into the vector as my level of indirection

19:00 I was just wondering if there was language level support for indirection

19:00 (without the thread safety)

19:14 tuft: is there any way to set a dynamic variable globally for lein repl sessions?

19:16 hiredman: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L255

19:17 (I don't think it actually uses binding, but it may work fine)

19:17 tuft: sweet thanks =)

19:19 ed-g: random question. I'm creating JSON using data.json. Some values in my clojure map contain already-formatted JSON. Currently I'm using (json/write-str my-clojure-map :value-fn (fn [k v] (if (= k :key-whose-value-is-json-format) (json/read-str v) v))) which converts the JSON to a data structure, so that data.json can convert it back. Is there a better way?

19:21 tuft: hiredman: yeah doesn't seem to work due to not using bindings i believe. "Can't change/establish root binding of: *print-dup* with set"

19:23 hiredman: ed-g: if you Box your json data with a custom type(so it isn't just a string), you can tell data.json how to emit that type, and I am pretty sure when you do that data.json hands you something you can write to directly, so you can just write whatever you want

19:29 ed-g: hiredman: thanks!

20:08 giant_g2: Check out my new app! https://play.google.com/store/apps/details?id=com.blogspot.techandtopics.alcoholpartyfree

20:10 justin_smith: giant_g2: did you use clojure in making it?

20:11 giant_g2: No :(

20:17 But it will tell you how much alchol to buy if you're having a clojure party!

21:03 tuft: is there any way to query for entities that lack a particular attribute in datomic?

21:04 small-chimp: hi everyone can someone help me to program some lickable software with clojure

21:04 or should i use microsoft office for that

21:05 tuft: hah

21:07 xeqi: I think the swiss-arrows library gives you fish and lollipops

21:07 small-chimp: but

21:08 amalloy: i don't use or like swiss arrows, but the trystero furcula sounds undeniably like a magical artifact

21:09 small-chimp: how can i import winsock.dll and use telephony netowork with my clojure project in windows 95

21:09 JCvex: Is anyone familiar with creating a lein uberjar and calling it from a hadoop or java command line? I run uberjar but I don't see the main class in the file. I've added the :main and :aot in the project.clj and I also have (ns project.name (:gen-class :name project.name)) in the name.clj as well as a (defn -main [])

21:10 small-chimp: is lein midje good for a newbie

21:11 dbasch: JCvex: if you’re doing all that then it should work, can you paste your project.clj somewhere?

21:11 JCvex: sure... where?

21:11 small-chimp: i am so anygry because of functional programming i like much more languages like lisp and c which are not functional

21:11 dbasch: ~refheap

21:11 clojurebot: https://www.refheap.com/

21:13 tuft: turns out datomic has missing? now =)

21:13 JCvex: done


21:14 dbasch: JCvex: ok, can you share it with us?

21:15 JCvex: https://www.refheap.com/91137

21:16 I'm trying to call this from bin/hadoop but regardless I keep getting of that I keep getting a missing main class error

21:17 dbasch: JCvex: if you type java -jar youruberjar.jar what happens?

21:17 xeqi: JCvex: whats the :gen-class line look like in hdfshelloworld.core?

21:18 small-chimp: MICROSOFT WINDOWS IS GOOD

21:18 JCvex: (:gen-class :name hdfshelloworld.core)

21:20 if I type java -jar... I get a Exception in thread "main" java.lang.ClassNotFoundException: hdfshelloworld.core

21:20 dbasch: JCvex: you don’t need :name, it could be just (:gen-class)

21:20 xeqi: JCvex: I'd remove the ":name hdfshelloworld.core" part

21:20 JCvex: yea.. I tried that

21:20 still doesn't make the right .class file

21:21 creates and core__init.class

21:21 dbasch: then build the uberjar, and uncompress it to check that the class is there

21:21 JCvex: it's not

21:21 xeqi: what version of lein?

21:21 dbasch: e.g. jar tvf youruberjar |grep hdfshelloworld.core

21:21 JCvex: dbasch: lein 2.4.2

21:22 dbasch: and it’s (ns hdfshelloworld.core … )?

21:22 JCvex: yup

21:22 ... I'll be back online later.. getting kicked out from cafe. :-/

21:23 thanks

22:04 devn: best way to split a coll into two colls based on pred? ex: [1 2 3 4] => even? => [[2 4] [1 3]]

22:06 technomancy: separate

22:06 from clojure.contrib.seq-utils

22:06 I ... I'll see myself out

22:06 (hint: use juxt)

22:06 justin_smith: devn: ,((juxt true false) (group-by even? [1 2 3 4]))

22:06 ,((juxt true false) (group-by even? [1 2 3 4]))

22:06 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn>

22:07 justin_smith: ,(map (group-by even? [1 2 3 4]) [true false]) ; almost

22:07 clojurebot: ([2 4] [1 3])

22:09 TEttinger: ,(juxt #(filter even? %) #(filter odd? %) [1 2 3 4])

22:09 clojurebot: #<core$juxt$fn__4309 clojure.core$juxt$fn__4309@1e6cda2>

22:09 TEttinger: haha

22:09 ,((juxt #(filter even? %) #(filter odd? %)) [1 2 3 4])

22:09 clojurebot: [(2 4) (1 3)]

22:26 devn: TEttinger: nono, i needed the more generic version

22:26 justin_smith: why did you say almost? that's what i was after

22:26 TEttinger: it didn't use juxt

22:26 we were all trying to decipher technomancy's comment

22:27 Atlanis: question about core.async: i'm pulling down a bunch of data from a rest API that is paginated. I want to end up with all of the data on the same channel for me to consume at will locally. should I have the http calls put the data onto the channel directly or have them return channels which are combined using mix/admix (or maybe something else)?

22:36 gtk_: back when clojure-test-mode was a thing, I used to clojure-jump-to-test a lot

22:36 is there an equivalent in the cider 0.7.0 testing that replaces clojure-test-mode?

22:39 maybe it should all be done from the Test Report

22:39 Atlanis: gtk_: don't have something handy to test this with, but look at cider-test-jump. docstring for it is unclear (or im not familiar enough with it)

22:54 danneu: Can someone point out why (js->clj x {:keywordize-keys true}) doesn't work but (js->clj x :keywordize-keys true) works given the source code? Demo: https://www.refheap.com/91142

22:54 Source: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L8359-L8389

22:55 Especially since js->clj arity-1 impl is `(js->clj x {:keyowrdize-keys false})`

23:02 justin_smith: danneu: it takes varargs, and then shoved them into a map on line 8368

23:02 I think

23:03 danneu: rofl

23:06 justin_smith: I mean that is what (apply array-map opts) does

23:06 danneu: how does the arity-1 impl work then?

23:07 i bet it doesn't and it's just nil

23:08 justin_smith: hmm, that's weird, yeah

23:08 ,(apply array-map '({:x true}))

23:08 clojurebot: #<ArrayIndexOutOfBoundsException java.lang.ArrayIndexOutOfBoundsException: 1>

23:08 justin_smith: yeah, that's what it should do for that one arg case :P

23:10 unless x doesn't satisfy IEncodeClojure, but I don't see what classes satsify that

23:54 devn: What do people do in this scenario: You're gonna call first on something I'm handing you, because you literally just want the one thing inside of it, but you don't know if I'm going to pass you nil, empty coll, or [1 2]. If I pass you anything except [1], which is all you'd ever expect, what do you do?

23:55 Would you throw on anything that isn't [1], or...?

23:58 like: ,(filter #(= "3df4cbf" (:id %)) [{:id "3df4cbf"} {:id "foo"}])

23:58 ,(filter #(= "3df4cbf" (:id %)) [{:id "qqq"} {:id "foo"}])

23:58 clojurebot: ()

23:58 devn: ,(first (filter #(= "3df4cbf" (:id %)) [{:id "qqq"} {:id "foo"}]))

23:58 clojurebot: nil

23:59 JCvex: Hi... I had to step out... could anyone help?

Logging service provided by n01se.net