#clojure log - Feb 20 2012

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

0:02 michaelr525: hello

0:03 emezeske: michaelr525: Hello indeed.

0:04 Woohoo, I built myself a Heisenbug. This should be fun! ^_^

0:13 michaelr525: Heisenbug?

0:14 emezeske: michaelr525: A bug that changes it's behavior, or disappears entirely, when you try to observe it. Sort like Heisenberg's uncertainty principle.

0:16 michaelr525: oooh

0:16 emezeske: A lot of race conditions are like that... You add some logging code or whatever, and it screws up the timing just enough that the bug goes away. Ugg!

0:19 technomancy: amalloy: do you think that ordered bug would be hard to fix?

0:20 amalloy: technomancy: what bug is that?

0:20 technomancy: https://github.com/flatland/ordered/issues/2

0:20 assumed you were watching that repo like a hawk =)

0:21 devn: overtone is fun.

0:21 technomancy: btw, does anyone still need a Leiningen sticker?

0:21 amalloy: i used to stay on top of github notifications, but they changed their UI in some subtle way that makes me completely ignore them

0:21 technomancy: amalloy: understandable

0:21 the only way I keep up with them now is via email

0:21 devn: technomancy: ah, yes, so long as it has a heavy duty moustache

0:21 technomancy: since I can actually sort and filter that stuff

0:21 I've been saving a really easy issue for a beginner

0:21 devn: moustache thickness guaranteed

0:22 devn: !!!

0:22 that is exciting.

0:22 technomancy: i would like to sponsor leiningen contributors

0:22 technomancy: devn: basically I want you to be able to customize which java is used from within project.clj itself

0:23 devn: for every leiningen contributor you get I will send them some spirit gum and a big burly glue-on theatre-quality stache

0:23 technomancy: now there's an idea

0:23 devn: im not joking. get adresses and the staches will flow like water

0:24 technomancy: that's pretty hardcore. who has that use case?

0:24 (not saying it's not valid, just never have even thought about it)

0:24 technomancy: devn: basically I want to be able to do lein-multi-type stuff across JDK versions

0:25 easy to test across Clojure versions: https://gist.github.com/1846759

0:25 devn: *nod*, but why? is that a big problem for people?

0:25 technomancy: I've had a couple bugs in Leiningen that only surfaced on 1.5

0:26 devn: how old is that?

0:26 technomancy: right now 1.7 hasn't been around long, but when 1.8 hits that's potentially 4 different JDKs, plus more if you're crazy enough to care about the IBM ones etc.

0:26 it's ancient, but Clojure supports it

0:26 amalloy: technomancy: a fix is just five characters. still researching whether that's the right fix though

0:26 emezeske: Hey, I want to repeatedly run a function every N seconds from a background thread, while the main thread does other stuff. Is there an idiomatic way to do that? I thought futures might help, but my future never seems to get executed, as I never dereference it.

0:26 amalloy: emezeske: futures run whether you deref them or not

0:26 technomancy: devn: anyway, I've pretty much decided to drop 1.5 support, but it would be nice if I found out about the breakage some other way than someone bitching about it in #emacs

0:26 devn: technomancy: does it make sense to support 1.5? why not be opinionated and force an upgrade?

0:27 emezeske: amalloy: So that should work? I must be doing something crazy

0:27 devn: technomancy: if the bug report you received came as a msg on #emacs then I would probably downgrade it even further :)

0:28 technomancy: devn: so do you want to send this patch or should I do it myself? =)

0:28 devn: :X

0:29 amalloy: technomancy: so the right fix is to duplicate the crazy behavior of APersistentMap.cons, where it checks for MapEntries, then for Vectors, then for a seqable thing of MapEntries. but the general consensus seems to be that that was a crazy thing to do in the first place, so i'm not super-keen on copying it

0:29 devn: I think I'm advocating not doing it all

0:29 doing it at all*

0:29 technomancy: antares_: what do you think? you mentioned offering support for multiple JDKs in Travis, right?

0:30 devn: as a stakeholder of leiningen I want new features and increased stability, not legacy support

0:30 technomancy: what if it was just another profile value that you could set? then a single lein with-profiles call could test against them all

0:30 devn: but that's just me

0:30 technomancy: devn: I don't care about 1.5 at all; I'm thinking 6-8

0:30 amalloy: because (merge m ()) comes down to (conj m nil). hash-map handles that by pretending nil is an empty map, whereas i pretend it's a two-element vector with nil k/v

0:30 devn: technomancy: ah

0:31 amalloy: ick

0:31 technomancy: wow, that's gross

0:31 devn: yeah, seriously, fuck that.

0:31 jaimef: devn that you david?

0:31 devn: jaimef: nope.

0:31 technomancy: amalloy: if you put it that way I can work around it in lein

0:32 amalloy: technomancy: i can easily fix this exact scenario, in a way that doesn't bother me

0:32 technomancy: amalloy: would into have the same problem?

0:32 amalloy: (into {} ())? no, that would be fine

0:32 devn: jaimef: why do you ask?

0:33 technomancy: amalloy: ok, I'll use that for now then

0:33 amalloy: in the meantime, i can choose to do nothing when you conj nil, and not fix the behavior when given a map to conj

0:33 well. not "fix" it

0:38 devn: technomancy: what's new on the clojars front? ;)

0:39 technomancy: i say that in jest only because i havent seen much change. clojars really needs an overhaul. we need rubygems-esque 1:1 dependency + require behavior

0:39 technomancy: devn: it's next on my plate after getting the lein2 preview out

0:39 devn: whenever i am showing someone clojure we come up with a project and i say: great! i know of a library we can use!

0:40 we hit clojars, find it under some ridiculous nested: org.manythings.andmore.frederick/alibrary

0:40 oh right...how do we use it in our project? (ns ... (:require [...]))

0:41 "hold on a sec, i need to inspect the jar to figure out which freaking namespace this lives in"

0:41 technomancy: devn: so one thought is to keep the current repository and have a separate "releases" repository that has a higher bar for uploads

0:41 devn: that is deadly to noobs

0:41 technomancy: it will accept uploads over HTTP, which will mean that it will be trivial to check out and hack on yourself without compiling nailgun, setting up a new unix user, etc

0:42 so that means adding support for features like HTML doc hosting would be way easier

0:42 amalloy: technomancy: 1.1.0 is on github and clojars now

0:42 devn: is there any way around the problem of: name of dependency does not match thing you actually use or require

0:42 technomancy: devn: because what you're describing is a documentation problem

0:42 amalloy: superb; thanks

0:42 amalloy: that's not a simple bugfix bump?

0:43 amalloy: meh. it changes behavior that wasn't well-defined; whether it's a bug or a new feature or a compatibility break is not defined either

0:43 devn: technomancy: *nod*, i suppose it is -- i'm evangelizing clojure like a sonofabitch, but sometimes the dependency stuff is like 2/3rds of the time I spend working with someone on clojure. it seems crazy.

0:43 amalloy: so i averaged

0:44 devn: technomancy: if the other person im pairing with is driving i need to show them how jars are things we can navigate to determine what namespace needs to be required. i can't overstate this: it's crazy.

0:45 technomancy: hm; that's the one disadvantage of not having jars in lib

0:45 you can't just pop over to emacs with them

0:46 devn: (at least for people coming from ruby who say: gem install foo, vim thing.rb, "require 'foo'" -- i realize there are some mismatches there as well, but in clojure land sometimes it is 3x as hard -- you dont have to guess where the - or the _ is, you have to guess at where the _ or - is in 4 different dot-separated portions of the dependency

0:46 and then guess at whether the library creator used .core as the default

0:47 technomancy: huh? you never have _ in require calls?

0:47 devn: that's crazy talk from me, just riffing here.

0:47 technomancy: that seems like a tooling problem though

0:47 devn: i mean, i can't be the only one who sees this when teaching new people the language

0:47 technomancy: well, a combination of tooling and crappy docs

0:49 devn: "oh right, you want to use enlive, so you need to type: (:require [net.cgrand.enlive-html :as enlive])

0:49 technomancy: so what we need is for slime and nrepl to offer tab completion on require and use calls

0:49 doesn't help for people who insist on reverse-domain-style namespaces

0:49 but there's not much hope for them

0:50 right now tab completion only works for stuff that's already required

0:50 devn: we have the power to redistribute. people who submit that style should automatically have their repo searched and replaced and have that release cut under "clojars"

0:51 like vimscript does it

0:51 granted that's not 1:1, but they at least say: "okay, we have this zip file, we put it on github for you under vimscript"

0:51 technomancy: I don't know anything about vimscript

0:52 this is the first time I've heard it used in any context other than "it's the worst thing I've ever seen oh no make the hurting stop"

0:52 devn: honestly me either! i've written trace amounts of it and embarassed to say so

0:52 and am*

0:53 either way, if you go to the "canonical" website for vim scripts, you find lots of ways they're being distributed. vim-scripts created a github account where they "mirror" them

0:53 Scriptor: using lein with mingw32 here, having it crash because of no class def found for jline

0:54 otherwise lein works fine if I use the batch script from cmd

0:54 ibdknox: technomancy: what do you use for your blog?

0:54 Scriptor: please help me not have to use cmd

0:54 technomancy: Scriptor: is it possible to install rlwrap?

0:54 ibdknox: http://p.hagelb.org/Rakefile.html

0:54 devn: technomancy: i think we have a problem in our community when it comes to finding what we want, and how to use it *right now*. yes, I realize that is instant gratification territory, but even still

0:54 ibdknox: haha

0:54 devn: there are like 3-4 sites that keep track of libraries, how to get them via lein, etc.

0:55 that's a smell

0:55 ibdknox: nice

0:55 technomancy: devn: there are?

0:55 Scriptor: technomancy: any binaries for it available? I don't have gcc or make installed right now

0:55 devn: technomancy: im referring to sites like the clojure-toolbox, etc.

0:55 there are others, dont have links off the top of my head

0:55 technomancy: devn: oh yeah, we definitely need to merge clojars and clojuresphere

0:55 that's on my list too

0:56 Scriptor: don't know; sorry

0:56 * emezeske wishes that clojuresphere was updated in the last two months.

0:57 ibdknox: emezeske: me too

0:57 emezeske: ibdknox: I sent a nice note to the maintainer, didn't hear back. Maybe he's in the bahamas :)

0:57 technomancy: it's OSS =)

0:57 ibdknox: who wrote it again?

0:57 devn: technomancy: i wish i could be more helpful on this front. it seems like the hole just gets bigger every day though.

0:57 technomancy: ibdknox: jkkramer

0:58 emezeske: technomancy: There's already several versions floating around, I don't want to add another

0:58 Also, I'm lazy

0:58 technomancy: devn: well I'll be sure to bug you when I get a fully-http clojars working

0:58 devn: im not trying to be a downer, but the crazy way we all share clojure code is not making it easy to say: "hey, beginner, wanna learn clojure?"

0:59 * emezeske thinks Clojars isn't half bad. Even if it has tons of room to be slicker.

0:59 ibdknox: wait

0:59 technomancy: devn: oddly enough "difficulty finding dependencies" didn't rank very highly on the list of annoyances in http://lein-survey.herokuapp.com/results

0:59 ibdknox: what's wrong with the way we share clojure code?

0:59 github works nicely :)

1:00 devn: ibdknox: tell me, how many README.md have instructions for building and installing and using it in their project?

1:00 where it is the library...

1:01 ibdknox: it's layers of garbage people dont have to deal with in other environments

1:01 technomancy: how do you not have this issue in Java?

1:01 ibdknox: not sure I understand

1:01 devn: "What's a SNAPSHOT? Why can't I require the name of the dependency in my (ns) macro?"

1:01 ibdknox: that's true regardless of the mechanism we use. There will always be libraries that will be better documented

1:01 technomancy: there are plenty of java projects that don't even publish to a maven repo ffs

1:01 ibdknox: and made "easy"

1:02 devn: so wait, java *is* a requirement for clojure?

1:02 ibdknox: but that takes effort, and more people will have to invest in Clojure for more such libs to exist

1:02 clojurebot: Excuse me?

1:02 devn: for learning* clojure

1:02 technomancy: devn: no, just responding to "other languages don't have this problem"

1:02 python has like three different mechanisms for fetching dependencies

1:02 ibdknox: other languages absolutely have the same problem

1:02 devn: oh, right on

1:02 yeah, agreed

1:02 technomancy: ocaml has ... oh man, I don't even want to talk about it

1:03 ibdknox: haha

1:03 * technomancy whimpers

1:03 devn: yeah, they're all less than great

1:03 but i think we can do a lot better

1:03 ibdknox: we do pretty well

1:03 technomancy: ruby has rvm, which redefines your shell's cd command

1:03 ibdknox: haha really?

1:03 devn: that's a trump card

1:04 it's flashy, but i don't think it's related to our problem

1:04 * technomancy had to use bundler a bunch last week

1:04 dnolen: devn: lein is really good compared to what most other languages have.

1:04 technomancy: argh

1:04 Scriptor: technomancy: where exactly does it look for jline? Does it look for a classpath variable?

1:04 technomancy: did you know you can't shell out to a rake task from one project using bundler to another project using bundler without hunting down a bunch of environment variables to unset first?

1:05 Scriptor: jline comes included in the leiningen standalone jar

1:05 devn: dnolen: im just getting crazy about this because ive been scheduling time with people to work with them on clojure projects. i end up explaining more about requiring a lib than anything else

1:05 i mean, i spend 4 hours talking to them about FP too

1:06 but when we're just trying to hack on something and see something work, that becomes this whole discussion

1:06 Scriptor: any reason why it wouldn't find it? I used lein self-install and it fetched 1.7.0

1:06 dnolen: devn: why does talking about adding a lib take more than a minute?

1:07 devn: dnolen: because we go out to clojars, find that someone released a version of the lib under org.foo.bar.efjdsaio/hello-world "0.2.6"

1:07 and then i need to explain to them how we put that in the project.clj, and then how the thing we put in project.clj has nothing to do with how we actually require or use it

1:07 it seems schizophrenic

1:07 technomancy: Scriptor: can't imagine why; what's the precise class?

1:07 Scriptor: jline/ConsoleRunner

1:07 technomancy: devn: "some people upload crazy shit. EOF."

1:08 devn: technomancy: yes, but apparently /everyone/ uploads crazy shit

1:08 technomancy: o_O

1:08 emezeske: O_o

1:08 technomancy: Scriptor: perhaps the jar it's trying to find doesn't exist at all?

1:08 devn: oo_oo

1:10 Scriptor: technomancy: the leiningen stand-alone jar exists, isn't that what jline should be bundled with?

1:10 michaelr525: has anyone tried running clojurescript one on windows? after running 'lein repl' i get this error:

1:10 FileNotFoundException Could not locate one/tools__init.class or one/tools.clj on

1:10 classpath: clojure.lang.RT.load (RT.java:430)

1:11 technomancy: Scriptor: yes; I just checked and it's present here

1:11 dnolen: not a bad showing for Clojure, http://thecodegeneral.wordpress.com/2012/02/19/jvm-language-popularity/

1:11 technomancy: Scriptor: sha1sum ~/.lein/self-installs/leiningen-1.7.0-standalone.jar # gives me 5ae81a504cb7f0d003bbbf27034913b54f6f272d

1:12 devn: dnolen: congrats on the ink, btw.

1:12 dnolen: devn: ink?

1:12 devn: newspaper

1:13 dnolen: devn: oh thanks!

1:13 devn: it was cool to read about. much respect.

1:14 it reminds me a bit of trying to start a clojure group in madison, WI -- sometimes we have 15 people show up, others we have 3

1:15 but who cares? im going to do it whether im the only one there or not.

1:19 alexbaranosky: devn: that's the way I feel too about our local baznex group - as long as there's one other person there I'm happy

1:19 technomancy: alexbaranosky: I need to head off, but I'd like to get your help testing midje on leiningen 2

1:20 alexbaranosky: technomancy, what do you need from me? I'm all for it

1:21 technomancy: alexbaranosky: there are a few breaking changes in lein2 and I want to go over the most common plugins to make sure they've been updated for compatibility

1:21 I wrote a compatibility guide for 1.x and 2.x

1:22 near the bottom of https://github.com/technomancy/leiningen/blob/master/doc/PLUGINS.md

1:22 anyway, if you get a chance it would be great to hear how midje fares with that

1:22 plus any other projects you feel like testing on lein2

1:22 alexbaranosky: I'll take a give it a shot

1:23 devn: alexbaranosky: technomancy: I have 20% time tomorrow. if you guys want me to test projects for a few hours im in

1:23 technomancy: won't be around much tomorrow but should be able to help you after that if you run into anything

1:23 devn: yeah if you've got projects you could try on lein2 that would be great

1:24 once you have a checkout on the master branch, the "Building" section at the bottom of the readme should have everything you need to get going

1:24 if you can't get help in #leiningen when I'm not around please ping the mailing list

1:24 devn: i have a project im working on to make the clojure cheat sheet more of a living document, so you can say: (cheat "foo")

1:24 it sees java.lang.String and replies with the table of create/use/change/etc.

1:24 technomancy: ah, handy

1:24 well, gotta head off; catch you folks later

1:25 devn: ciao technomancy

1:25 alexbaranosky: i need to run as well, getting late here, but ill be on IRC tomorrow all day. let's try and coordinate and we can test projects against lein2

1:26 'night all

1:26 alexbaranosky: devn: sure thing.

1:40 Scriptor: technomancy: not sure if you're still here, but sha1sums were the same

1:55 Raynes: Scriptor: He's off for the night.

1:55 He doesn't have time for mere peasants like you and I.

1:55 tjgillies: does clojure have a built in timer function like javascript's setTimeout?

1:57 Raynes: tjgillies: Doesn't setTimeout just wait n milliseconds and then execute something?

1:57 If that's the case, you can just use Thread/sleep

1:58 emezeske: tjgillies: Maybe something like (future (do (Thread/sleep 500) (my-thing)))

1:58 tjgillies: Raynes: emezeske: thnx

1:58 Raynes: Man, futures are the devil for spinning up threads.

1:59 emezeske: Raynes: They're bad?

2:00 Raynes: Well, if you plan to deref them, no. I've ran into issues where I used a future to spin off a thread that did nothing but side effects (and thus was never deref'd). Errors that occur in a future don't bubble up until you've deref'd them.

2:01 So if you never deref them, any errors that occur that could otherwise break your program are impossible to find unless you happen to check the value of the future.

2:01 emezeske: Raynes: Ah, yeah, that is a problem -- probably not a bad idea to wrap the body of the future in a try/catch and print errors or something

2:04 tjgillies: all my future is gonna do is tell an atom to update peridoically

2:05 i have a hashmap and i want one of the keys to go to zero every x seconds

2:08 Raynes: $seen amalloy

2:08 lazybot: amalloy was last seen talking on #clojure 1 hour and 24 minutes ago.

2:08 Raynes: Huh. I didn't know he had been here.

2:08 amalloy: stalkerbot

2:08 Raynes: I also didn't know that plugin still worked.

2:08 I guess it's max that doesn't work.

2:08 $max

2:08 $max #clojure

2:08 clojurebot: Huh?

2:08 Raynes: Yeah, it's still broken.

2:09 ibdknox: looks like xhr is broken in firefox for CLJS :/

2:09 amalloy: fwiw, the body of a future is wrapped in an implicit 'do

2:10 emezeske: amalloy: nice, thanks

3:02 mvid_: any idea why this is happening?

3:02 http://dpaste.com/705556/

3:02 those are all of the files that exist in the project

3:02 i can't tell which lib is tripping it up

3:04 nvm

3:04 Raynes: mvid_: Don't quote the vector after :require

3:04 mvid_: yea, just noticed that

3:05 that line must have been from a repl

3:59 Blkt: good morning everyone

7:09 claj: I'm having problems with åäö in aquamacs && swank-clojure 1.4.0

7:10 using slime-20100404, through elpa. is that to antique?

7:22 getting this error: byte-code("\302\300\"\210\303 \304\"\210\300\305\"\207" [error process debug slime-net-close t "net-read error: %S"] 3)

7:23 very strange, since I've got it working on other mac os x:es just fine

7:23 tomoj: do you have slime-net-coding-system set?

7:24 I'm using the same version of slime (though not mac)

7:24 claj: hmm, says iso-latin-1. not the same...

7:24 thx

7:25 tomoj: I setq that to 'utf-8-unix

7:25 claj: works. thanks a lot.

7:26 miss-spelled this in a conf file.

8:33 osa1_: `lein deps` started to give this error after adding data.xml to dependencies: http://paste.pocoo.org/show/553929/ can anyone help?

8:37 Bronsa: this is because there's no public release of data.xml yet

8:40 osa1_: Bronsa: is it because it's not stable enough? I was planning to use it in a project

8:44 Bronsa: honestly, i have no idea.

8:44 jkkramer: osa1_: I cloned the github repo and installed locally (mvn install). it's stable enough for my purposes. the latest version is much better about not using more memory than needed to parse large xml files lazily

9:21 osa1_: how can I use a record from other namespaces? I tried ns/Record. but didn't work. seems like (use ..) doesn't import records to my namespace

9:24 algernon: amro: (import namespace.Record)

9:25 osa1_: strange, I'm getting ClassNotFoundException this time

9:25 oh ok, found it. thanks

9:26 * algernon slaps self for failing at tab-completing the appropriate person.

9:26 algernon: osa1_: \o/

9:36 Bronsa: osa1_: if you're using clojure >= 1.3.0 you can use ns/->Record

9:41 osa1_: Bronsa: is it a special syntax? how do you use it?

9:41 Bronsa: it's a factory function created when you create a record

9:42 so instead of importing the record and doing (MyRecord. fields) you can simply use/require the namespace and do (ns/->MyRecord fields)

9:44 osa1_: wow, that's nice. thanks.

9:47 how can I restart SLIME REPL(or swank session, or whatever I need to restart to reset all definitions I made)

9:47 I was using ,restart in common lisp SLIME but it didn't work for Clojure

9:48 whatever, I just run `slime-disconnect` and the M-x clojure-jack-in again

9:52 jcromartie: Clojure may as well have a splash screen while it's starting up :)

9:52 osa1_: is there a way to use same generic method for multiple dispatch values?

9:53 or do I have to create a function and call it from different multimethods?

9:59 osa1: damn I've disconnected just after asked a question, did anybody answer my question?

9:59 <osa1_> is there a way to use same generic method for multiple dispatch values?

10:01 jcromartie: so could Clojure's small startup time be related to loading nearly 3K classes right away?

10:01 err

10:01 big startup time

10:01 not small at all

10:04 ~2300 classes

10:04 clojurebot: Excuse me?

10:04 jcromartie: clojurebot: I wasn't talking to you, silly bot

10:04 clojurebot: Cool story bro.

10:05 pipeline: heh

10:05 I actually could answer his question

10:05 whoops

10:10 Bronsa: osa1_: you could probably use derive to get that

10:11 16:10:25 Bronsa: osa1_: you could probably use derive to get that

10:37 osa1_: anyone here know a library to generate graphiz files? like s-dot for common lisp

10:41 Bronsa: osa1_: https://github.com/daveray/dorothy

10:46 osa1_: Bronsa: I found this API https://github.com/pallix/lacij easier but I couldn't (use ) or (require ) it even though I added it to project.clj and run lein deps

10:48 Bronsa: osa1_: what are you useing?

10:49 osa1_: Bronsa: (use lacij)

10:49 Bronsa: indeed

10:49 osa1_: https://github.com/pallix/lacij/tree/master/src/lacij

10:49 you see how the namespaces are split

10:49 raek: osa1_: I tried "loom" a time ago. it did what I needed. (https://github.com/jkk/loom)

10:50 Bronsa: you have to (use 'lacij.geom.core) etc according to your neds

10:50 *needs

10:50 osa1_: Bronsa: yeah, thanks

10:51 raek: thanks. I think I liked lijic's API and I will go with it, I've added this as an alternative though

10:52 raek: someone should open an issue for lacij regarding that what namespace you are supposed to use is not mentioned in the readme

10:52 why is this so common?

10:52 Bronsa: because reading clojure is so easy, it's easier than understanding a doc

10:53 osa1_: raek: yeah I would do that when I arrive home(which takes about 2 hours)

10:53 Bronsa: this way you make your users read the code instead of docs

10:53 Bronsa: osa1_: i was using sarcasm

10:53 not easy to understand sarcasm on the internet i guess

10:55 osa1_: now I have to find which namespace contains create-graph function ...

10:58 Bronsa: osa1_: lacij.graph.svg.graph

10:58 woah.

10:58 osa1_: lacij.graph.svg.graph

11:18 lypanov: (re-pattern "blah") == #"blah" ?

11:18 repl says so but just to verify. the docs are a bit mystifying.

11:21 dnolen: ,(doc re-pattern)

11:21 clojurebot: "([s]); Returns an instance of java.util.regex.Pattern, for use, e.g. in re-matcher."

11:23 lypanov: dnolen: just taking time to get used to the host symbiosis.

11:24 just spotted "A regex pattern is read and compiled at read time. The resulting object is of type java.util.regex.Pattern." which makes the above re-pattern doc which i read earlier make sense :)

11:28 ivan: what's different in the second case? http://paste.lisp.org/display/127877

11:30 oh right, (println (pr-str names))

11:31 gfredericks: ivan: (println (pr-str names)) should be equiv to (prn names)

11:31 raek: and more efficient

11:31 ivan: thanks

11:32 gfredericks: raek: cuz it doesn't build a string up on the heap?

11:32 raek: gfredericks: yep

11:33 (println (pr-str ...)) will create a string writer, print the data to it, create a string from it, and then print that string

11:59 chawks: Hey. Anyone know why something like (seq? [1 2 3]) returns false?

12:02 mdeboard: ,(seq? [])

12:02 clojurebot: false

12:02 mdeboard: vectors aren't sequences

12:03 chawks: they're not? I was under the impression list, vectors are seqs

12:03 ,(seq? '())

12:03 clojurebot: true

12:03 chawks: so what is a sequence except for lists?

12:04 mdeboard: ,(seq? (cycle (range 5)))

12:04 clojurebot: true

12:04 mdeboard: ,(seq? (iterate inc 0))

12:04 clojurebot: true

12:04 mdeboard: iterators and lists

12:05 ,(filter (partial seq?) [[] '() {} #{}])

12:05 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$partial>

12:05 mdeboard: ,(filter #(seq? %) [[] '() {} #{}])

12:05 clojurebot: (())

12:06 devn: anyone know their way around enlive?

12:06 chawks: I see... so... is there another way to check if something is either a vector or a list?

12:06 gfredericks: chawks: vector? and list? should work

12:06 chawks: except explicitly calling vector?/list?

12:06 okay... I guess that actually covers it, so should be good

12:06 gfredericks: what would motivate you to not use those functions?

12:07 mdeboard: chawks: Er, why not--

12:07 chawks: gfredericks: Nothing, you're right. It's fine that way

12:07 Bronsa: chawks: you can (some-fn vector? list?)

12:07 TimMc: chawks: Depends. list? is pretty bad

12:08 chawks: TimMc: How come?

12:08 TimMc: What you probably want is sequential?

12:09 chawks: lists and seqs get conflated in a lot of the Clojure core codebase.

12:10 chawks: TimMc: Thanks:)

12:10 TimMc: &(map sequential? [[5] '(6) (range) #{:set} {:m :ap}])

12:10 lazybot: ⇒ (true true true false false)

12:10 TimMc: http://www.brainonfire.net/files/seqs-and-colls/main.html

12:17 jaley: Is there a way to control the path the 'lein deps' will try to deploy to? I need to make the artifact name match some arbitray rules for a company repo :/

12:18 sorry, I meant 'lein deploy'

12:32 TimMc: artifact name is controlled by the first line in project.clj, no?

12:33 Oh, not artifact ID, sorry.

12:45 leafw: what is the fastest outputstream class or nested stream classes to write a ~100kb file with java?

12:45 jaley: TimMc: well.. the problem is that the repo host has the pattern matching thing set up, where it expects a build number in the jar's file name

13:14 poincare101: Hi everyone. I'm having a bit of trouble with learning clojure: http://pastie.org/3421981 <- Why is that functioning returning nil? According to the guide I'm following (http://pragprog.com/magazines/2011-07/growing-a-dsl-with-clojure), it should be returning a proper value.

13:17 ibdknox: that can be done in a much nicer way

13:18 poincare101: I know, but, why isn't that particular approach working?

13:18 ibdknox: poincare101: because of this bug http://groups.google.com/group/clojure-dev/browse_thread/thread/1e80f6eee88527

13:19 poincare101: was the bug introduced recently?

13:19 ibdknox: in that particular case, it makes more sense just to call (str a)

13:19 no

13:20 poincare101: oh. well, the guide I'm following isn't that old.

13:20 are there any other places I can learn to write DSLs in Clojure from?

13:21 ibdknox: that's actually a good article, perhaps at some point that actually did work

13:21 and once you get to the multi-method version of things, everything will be fine

13:21 alternatively, you can look at how I wrote Korma

13:22 but you'd be digging through source for that

13:23 poincare101: That's fine, I'll read through Korma.

13:23 Wow, you're the guy that wrote Korma. You're like a celebrity.

13:24 ibdknox: lol

13:24 poincare101: any docs on "multimethod version of things"?

13:24 ibdknox: further down in that article he replaced the case statement

13:24 with multi-methods, which is a much cleaner solution

13:24 poincare101: I'll look at that.

13:27 ibdknox: oh I get it, multimethods are a bit like guards in Haskell

13:28 pandeiro: ibdknox: i saw your response about noir memory usage... when you say the jvm will consume what you give it, does that mean one should be setting that when deploying a noir app?

13:28 ibdknox: pandeiro: probably

13:28 I've not had any issues with my sites

13:28 pandeiro: ibdknox: as a jvm newb how do i know how much to give it?

13:29 ibdknox: well, I would give it as much as you're willing to part with :)

13:29 it will actually decrease over time

13:29 and run at something reasonable

13:29 TimMc: Hmm, does 'case require *compile*-time literals, or *read*-time literals?

13:29 poincare101: +

13:30 ibdknox: pandeiro: at RFZ we run on a really beefy machine, so we give it tons of memory. In general though setting Xmx to around 400 seems to do fine

13:30 you can definitely go lower

13:30 but I've always had enough available just to leave it around there

13:31 juhu_chapa: Hi everybody!

13:31 pandeiro: ibdknox: thanks, i'll take that as a rough guideline

13:31 juhu_chapa: How is the recommended way to write a byte into a socket output stream?

13:31 ibdknox: pandeiro: fwiw, that's the default on heroku

13:31 pandeiro: ibdknox: i didn't know you could tweak the jvm on heroku

13:32 * pandeiro has no idea how heroku works

13:32 ibdknox: you're given a process that you can mostly do whatever you want with through buildpacks

13:32 but there's a set of config options where you can set the JVM_OPTS

13:33 pandeiro: ibdknox: getting OT but if you were building a prototype would you choose heroku over a vps?

13:33 ibdknox: yes

13:33 the latest few things I've built, I did on top of heroku

13:33 pandeiro: are you paying for heroku or using a free tier service?

13:33 ibdknox: free

13:34 pandeiro: is that a consideration?

13:34 just b/c i already have a vps locked down for the year

13:34 ibdknox: I have several and still used it :)

13:35 I don't like to think about ops stuff, it's distracting

13:35 but it's definitely a trade

13:35 Heroku is quite a bit more expensive than running your own EC2

13:35 pandeiro: ibdknox: i'm still so new to linux i enjoy being the boss of everything :)

13:35 ibdknox: if you're not using the free tier

13:35 pandeiro: and EC2 is more expensive than eg linode, yeah?

13:35 lynaghk``: pandeiro: you'll get over that =)

13:35 ibdknox: not that I'm aware

13:36 last comparison I did, EC2 was far cheaper than everyone else

13:36 though I was only looking at the low end

13:36 lynaghk``: pandeiro: in general yeah. If you know you're going to want a server 24/7 I think getting a Linode is much cheaper for the computational resources you get.

13:36 ibdknox: definitely true

13:37 pandeiro: lynaghk``: that was the impression i got but yeah i know squat about how EC2 charges

13:37 ibdknox: heroku = ease for money

13:37 pandeiro: ibdknox: yeah and learning the API

13:37 lynaghk``: pandeiro: by the hour.

13:38 ibdknox: using it is pretty trivial, I don't think that's a barrier to entry :) Learning how to set up nginx is several orders of magnitude the greater investment

13:38 lynaghk``: The real advantage of EC2 is being able to spin up tons of new instances when you need 'em

13:38 chewbranca: ec2 is actually pretty expensive, you can get more performant dedicated hardware for cheaper

13:38 pandeiro: lynaghk``: right, that's how i saw it

13:38 ibdknox: I guess I should've qualified that with instantly scalable

13:39 pandeiro: and since nothing i make is used by *anyone* at this point...

13:39 ibdknox: static resources don't really work for me :)

13:39 pandeiro: ibdknox: heroku is also 'just add money' to scale kinda thing?

13:39 chewbranca: but you get more along the lines of stand alone machines that an elastic cloud, so you defintiely pay overhead to be able to easily treat ec2 as an actual cloud, just like with heroku you pay more to treat hosting a black box you magically adjust some sliders for

13:39 ibdknox: pandeiro: yep :)

13:39 pandeiro: there's no downside to using the free heroku stuff

13:40 chewbranca: I'm a big fan of heroku though, I think there make a dyno out of your app approach is awesome, and I think they have the right idea with the addon api system

13:40 pandeiro: ibdknox: only that my brain is saturated learning tex, clojure, lua, bash, etc and it's one more API

13:40 same to be said for GAE

13:40 lynaghk``: ibdknox: well, except you get addicted to their excellent services

13:40 pandeiro: i think heroku is more interesting than gae but it's a similar decision to make

13:40 ibdknox: pandeiro: gae is much more difficult

13:41 their sandbox is really annoying

13:41 lynaghk``: indeed :)

13:41 pandeiro: lynaghk``: how did you start to learn d3?

13:41 ibdknox: pandeiro: build a graph! ;)

13:42 pandeiro: i took a stab at it for the first time the other day

13:42 lynaghk``: pandeiro: the tutorials are pretty good.

13:42 pandeiro: i was like 'this is SO easy!'

13:42 3 hours later i gave up

13:42 lynaghk``: ahh

13:42 what part did you have trouble with?

13:42 pandeiro: i wanted to create a simple visualization over a time period

13:42 i realize time is a tricky mfer

13:42 lynaghk``: heh

13:42 pandeiro: but say i had data for things that happened over the past week

13:43 lynaghk``: yeah, the real value in D3 is all of the helpers. There is a pretty solid time scaling library in there now

13:43 pandeiro: i wanted a graph showing how many times each thing happened each day

13:43 w/out going through the source i realized maybe d3 doesn't help so much with that kind of thing?

13:44 (think something like the github repo activity visualization)

13:44 lynaghk``: nah, it's a very low level library. You need to handle aggregation yourself

13:44 I mean, there are some helpers like histograms, &c.

13:44 but I would process the data in whatever language you're most familiar with, then use D3 for the actual plotting

13:45 so once you have a dataset like [{:day "Mon" :count 17}, {:day "Tue" :count 122} ...], write that out to JSON and use D3 to visualize

13:45 pandeiro: using svg probably as the vehicle?

13:45 lynaghk``: depends, SVG or HTML would work for a bar chart.

13:46 pandeiro: i actually had a rough time with HTML - there's a way to bottom-align a div i must be forgetting i guess

13:46 otherwise you're stuck with inverted bar graphs :)

13:46 lynaghk``: though, totally self-serving annoucement here, I'll be open sourcing a D3-like library in ClojureScript at Clojure/West in a month. So if you want to hold tight for a few weeks...

13:47 pandeiro: lynaghk``: well i am wanting to look through your cljs-d3 as well...

13:47 lynaghk``: ah, yeah. In SVG you could make a <g transform="scale(0,-1)"> to hold your bars

13:47 pandeiro: but at this rate i think your announcement will probably beat me to it

13:47 lynaghk``: pandeiro: don't it's getting totally depreciated. = )

13:47 pandeiro: are you ditching d3 altogether?

13:47 lynaghk``: or in HTML you could just use absolute positioning with CSS like "bottom: 0"

13:48 yeah pretty much. I mean, taking the core idea of mapping data to a DOM tree, but there is no shared code as of right now

13:48 pandeiro: ah yeah sure, position: absolute... reminds me of that quote about programmers having a problem and wanting to use regex, now they have 2 problems

13:48 dnolen: lynaghk``: looking forward to it!

13:48 ibdknox: lynaghk``: I'm excited to see what you came up with

13:49 lynaghk``: dnolen, ibdknox: I just cut a draft talk for clj/west, so if you're okay with spoiling the surprise I can send you two copies (I'd love to hear your feedback)

13:49 ibdknox: dnolen: later today I'm going to put up a screencast of me building an ipad overtone controller in CLJS :)

13:49 lynaghk``: I'd be happy to

13:49 dnolen: lynaghk``: yes!

13:49 ibdknox: haha, awesome :)

13:49 pandeiro: ibdknox: that sounds awesome

13:49 lynaghk``: Chris, are we going to have to have CLJS iPad fights-to-the-death?

13:49 because that's what we've been working on too =P

13:50 ibdknox: haha

13:50 pandeiro: overtone the clojure lib?

13:50 ibdknox: pandeiro: yeah

13:50 pandeiro: it runs on a server somewhere? surely not on the ipad?

13:50 ibdknox: lynaghk``: I mean, I'm ready for it :p

13:50 correct

13:50 pandeiro: sweet

13:50 ibdknox: it uses noir + jayq/fetch

13:50 and builds a little interface to control a piano and a dubstep thing

13:50 much like the monome that Sam used at the conj

13:51 pandeiro: ibdknox: will you build my prototype?

13:52 ibdknox: do you write code while you sleep?

13:52 ibdknox: pandeiro: not currently taking on anything new :) Things are changing quite a bit for me in the next month

13:52 haha

13:52 * pandeiro was kidding, sorry wasn't clear

13:52 ibdknox: my girlfriend makes fun of me, because I kind of do

13:52 I often wake up with solutions

13:52 pandeiro: you must be doing that thing rich talked about, figuring out some of the background stuff

13:52 lynaghk``: ibdknox: that's why I take siestas every day after lunch

13:53 pandeiro: ibdknox: how long have you been programming?

13:53 ibdknox: 15 years

13:53 since I was 10 :)

13:53 lynaghk``: yeah, it's something I've done for a long time. I believe it's a skill, more so than most people think

13:53 pandeiro: and when did you become a superhuman?

13:54 `fogus: when he entered our solar system

13:54 ibdknox: haha well still human, but I think taking a couple years to teach myself how to learn probably helped :)

13:54 TimMc: ibdknox: 25, and you've already lead projects at Microsoft? o.O

13:55 ibdknox: TimMc: C# and VB no less ;) I was actually as surprised as you are

13:55 TimMc: :-D

13:55 ibdknox: that transition was a very interesting month

13:56 pandeiro: gates has a quote about knowing if someone has what it takes to be a good programmer after 4 years... i'm approaching that soon...

13:56 TimMc: VB to C#?

13:56 pandeiro: maybe i will have to go ask him

13:56 ibdknox: TimMc: I was supposed to go off and work on some future thinking stuff after working on the editor

13:56 TimMc: but the guy who was supposed to take over C# left and then the guy who was supposed to take on VB just stopped showing up to work

13:56 lol

13:57 pandeiro: ibdknox: so instead you turned on, tuned in, and dropped out?

13:57 TimMc: ibdknox: "left", "stopped showing up to work"

13:57 Mob connections much? :-P

13:57 ibdknox: TimMc: one transfered to bing

13:57 the other guy was just a flake, not sure how he got hired

13:58 my boss was like.. well these teams have never been merged before... I'm sure Chris can do it!

13:58 lol

13:59 still ended up working on far future stuff, which I don't think made it anywhere after I left :( But ended up unifying and running those two for a while

14:01 I'd love to work on dev tools again :)

14:01 TimMc: It's satisfying stuff.

14:02 ibdknox: with lots of room for improvement

14:17 pandeiro: ibdknox: you could always build us that awesome web-based clojurescript IDE with heroku integration built in :)

14:18 ibdknox: haha

14:18 maybe some day :)

14:18 pandeiro: i was actually toying with the basic compile-cljs-via-http-request idea and got hung up on how to do it

14:18 TimMc: Me too.

14:19 pandeiro: because the compilation takes a while

14:19 TimMc: See the moldering remains of trycljs on my github.

14:19 pandeiro: so maybe the right way to do it would be passing messages

14:19 TimMc: i would like to

14:19 link?

14:19 lnostdal: i still do not understand how to get DB transactions to work well with Clojure transactions.. no matter which way i "flip" things it'll end up wrong it seems

14:19 TimMc: pandeiro: https://github.com/baznex/trycljs

14:19 I guess it's actually not under my account.

14:20 lnostdal: i can't put any dosync inside a DB transaction; not even at the very end because the DB transaction might still roll back without the Clojure one doing so

14:21 gfredericks: lnostdal: the DB transaction can roll back without you finding out?

14:22 * TimMc mutters something incoherent at lnostdal about storing stuff in Accumulo and coordinating data version IDs in Clojure

14:22 lnostdal: i can "find it out", but i don't see how that can help me

14:22 pandeiro: TimMc: you remember where you were derailed with that?

14:23 gfredericks: lnostdal: you couldn't then about the clojure transaction?

14:23 s/about/abort

14:23 llasram: lnostdal: Why do you need to interweave them? I haven't thought about this too but what's the use case?

14:23 s,too,too deeply,

14:23 TimMc: pandeiro: Yes, I couldn't get namespace resolution working properly. Also, there's an annoying misfeature in GClosure that fucks with REPL usage model.

14:24 lnostdal: they have to overlap somehow

14:25 one of them have to "finish", then give room for the other to finish .. before the first one "really finishes" .. or something

14:25 pandeiro: TimMc: I imagined namespace functionality would be limited, like you would have to shoehorn all user cljs code into one ns...

14:25 gfredericks: if you commit the DB transaction at the end of the clojure transaction, what's going to go wrong?

14:25 llasram: lnostdal: Could you give a specific example?

14:26 TimMc: gfredericks: Network failure, commit conflict...

14:26 lnostdal: not really, llasram .. because all my examples are wrong

14:26 jsabeaudry: All of a sudden, firefox says my clojurescript function is undefined although I see it defined 5 lines earlier in Firebug. I'm really puzzled!

14:26 lnostdal: and i can't seem to find any right way of doing this

14:26 gfredericks: TimMc: but if something goes wrong with the DB transaction then at least clojure should throw an exception, no?

14:26 TimMc: lnostdal: A use-case example, not a solution.

14:27 gfredericks: TimMc: or do you mean DB succeeds but then clojure fails?

14:27 TimMc: gfredericks: That's the other option, yes.

14:27 gfredericks: oh, or commit conflict on clojure's side, I see

14:27 lnostdal: even trivial stuff .. start a db transaction, make a decision based on some SELECT .. then write to some Clojure refs based on the decision

14:28 gfredericks: lnostdal: I think they're asking why you need to coordinate these things?

14:28 llasram: gfredericks: +1

14:28 I'm not saying you don't -- I just want to understand why you do

14:28 lnostdal: what else would i do? .. i can't do a "SELECT" vs. in-memory data

14:30 so i got to have both transactions working together

14:30 TimMc: lnostdal: Friggin' example, please.

14:30 gfredericks: lnostdal: like what sort of data do you have on DB vs in memory

14:30 llasram: TimMc: No need for such language!

14:31 TimMc: :-P

14:32 lnostdal: well, type of data? "items" .. *sigh* .. .does it matter? .. (with-db (with-query-results res ["SELECT ...;" ...] (if res-is-something (dosync this) (dosync that))

14:33 ..with-db is just a the typical BEGIN + COMMIT type macro

14:33 gfredericks: so there are items in the db, and what're you tracking in memory?

14:35 lnostdal: ok, yeah, so i got to not have these things in memory at all? ..

14:36 llasram: I guess the fundamental idea is that you have multiple coordinating threads, which are moving things between the database and the STM-managed data-structures, and you want to keep the in-memory data structures and the database completely synchronized at all times?

14:36 lnostdal: yes, llasram

14:36 llasram: Ok, an easy one. That's impossible.

14:36 lnostdal: i don't want to ask the DB for trivial stuff over and over again...

14:36 ok, that sucks thes

14:36 llasram: Ok, that was a flip answer, and I may be wrong

14:37 TimMc: Is there a way to tell the STM manager, "this transaction has failed, please retry it"?

14:37 lnostdal: i guess it's a lack in the DB .. i can only see it working if i had some time semi-after the DB transaction

14:37 gfredericks: lnostdal: and I think he means impossible generally, not because of a clojure shortcoming

14:37 llasram: gfredericks: +1; that's my initial reaction as well

14:37 lnostdal: ok, this isn't good enough then .. i can't use postgresql for this

14:37 llasram: Oh, you're just interpreting me. Well, I definitely agree with you :-)

14:37 lnostdal: screw all this .. so fed up .. gah x)

14:38 TimMc: CAP theorem, am I right?

14:38 gfredericks: isn't there some fundamental theorem of faulty communication channels where you can never have identical shared knowledge?

14:38 TimMc: I don't think so

14:39 llasram: lnostdal: Don't give up! Can you back off describe at a higher level what you're trying to do, outside of the synchronizing memory vs DB problem?

14:39 TimMc: Two Generals' Dilemma, yes.

14:39 gfredericks: yeah there it is

14:40 dnolen: lnostdal: llasram: gfredericks: http://groups.google.com/group/clojure/browse_thread/thread/aa22a709501a64ac/b578f0915b55c4be?#b578f0915b55c4be

14:40 it's an interesting idea, but no one's actually done the legwork yet.

14:41 lnostdal: yes, that's the other option; if i could control the clojure STM better it would also work out i think

14:42 i think i'll just "give up" and move everything down to the DB for now

14:44 llasram: dnolen: Interesting... That would be pretty cool, although I'm not entirely sure it applies to this case though. Extending the semantics of transactions doesn't seem quite the same as interweaving the transactions of two unrelated systems

14:44 lnostdal: or wait, what's this; http://www.postgresql.org/docs/9.1/static/sql-prepare-transaction.html

14:44 hum

14:47 gfredericks: cljs doesn't have a release yet does it?

14:49 _phil: hey, if anyone is interested, i just made a menubar time tracker for mac os as a weekend project in clojure

14:49 https://github.com/pkamenarsky/atea

14:49 it should work but i havent tested it extensively

14:59 llasram: lnostdal: Just out of curiosity, what are you doing that need this hard synchronization between DB and memory?

15:00 mklappstuhl: hey... I am thinking about packaging leiningen for Archlinux - the Debian dependency chain looks wierd and I can find no good description of what leiningen acutally needs. Is it enough (and not only a workaround) to copy the binary into $PATH?

15:00 TimMc: technomancy: Ping, mklappstuhl discussing packaging lein for Arch

15:03 mklappstuhl: TimMc, technomancy: I'll be away for half an hour, msg/mention me, I will respond then.

15:06 lnostdal: llasram, auction site

15:23 gfredericks: lein-cljsbuild doesn't have a repl :(

15:26 mrBliss: ibdknox: how can I test file uploads with send-request in noir? Passing a File doesn't seem to work.

15:31 pandeiro: gfredericks: what do you mean?

15:32 gfredericks: pandeiro: a rhino-based clojurescript repl

15:33 pandeiro: gfredericks: doesn't clojurescript come with a script to launch that?

15:34 gfredericks: yes; but part of the appeal of cljsbuild is to have the project be self contained and not need clojurescript "installed" somewhere

15:36 pandeiro: gfredericks: not to mention i can't even get the script/repljs to work anymore with the up-to-date cljs repo

15:36 it used to work

15:37 anyway yeah cljsbuild uses a jar of a certain cljs commit?

15:38 gfredericks: I don't see that it's put it in my project anywhere

15:38 so I guess it's bundled up in the jar off in the ~/.m2

15:40 brehaut: morning talios

15:40 lamed: java.lang.String cannot be cast to clojure.lang.IFn :P

15:40 dnolen: pandeiro: hmm, repljs is working fine on master for me.

15:41 talios: Mornin brehaut

15:41 brehaut: lamed: werent you pasting these errors into irc yesterday too?

15:41 dnolen: the ClojureScript One folks were having some trouble as well but I checked and they have no problems with master either

15:41 lamed: brehaut: nope

15:43 antares_: just a little announcement here: travis-ci.org Clojure builds now have a separate machine. So, keep those builds coming!

15:44 pandeiro: dnolen: probably my side, sorry... throws a java.lang.ClassNotFoundException: org.mozilla.javascript.Context though

15:45 dnolen: pandeiro: hmm that doesn't make sense, did you try a fresh checkout?

15:45 pandeiro: dnolen: just realized maybe i need to run the build script again? it is a fresh checkout

15:45 dnolen: pandeiro: not a bad idea

15:45 pandeiro: err, bootstrap, not build

15:48 lamed: (Integer/toString 10) ;; obviously

15:50 graphbum: is there any way to tell swing to resize a buffered image in response to a window size changing?

15:51 I've seen some swing examples from the clojure community, but none of them deal with dynamically resizing the display

15:56 aphyr: I suspect my clojure application is slowly leaking memory. I've dumped the heap with jmap; jhat suggests my top memory allocations are (by an order of magnitude) clojure.lang.LazySeq and clojure.lang.Cons.

15:56 Sort of lost as to where to go from here. Any advice?

15:57 brehaut: graphbum: based on a quick googling i think you need to use either a windowlistener or componentlistener and implement componentResized

15:57 aphyr: holding onto the head of a seq while traversing / realizing it is a great way to leak memory.

15:58 aphyr: I've tried to avoid that, but this isn't exactly a trivial app: https://github.com/aphyr/reimann

15:59 I dunno if it's somewhere inside my code, aleph, lamina, postal, protobuf...

15:59 graphbum: brehaut: thanks for the googling :/ I've spent about a week on this stupid 2d rendering project....I know more about Swing than I ever wanted to. I have some stuff hooked up via component listeners, which mutates the image buffer, but it's crap and doesn't "quite" accomplish what I'm looking for.

16:00 brehaut: lau jensen and some other folks have good samples, but all of them seem to have statically sized views.

16:00 brehaut: graphbum: my j2d knowledge is weak and extremely out of date (i last used it in earnest in 2003 / 1.4, so grain of salt) but i recall that J2d is quite operation ordering sensitive

16:00 graphbum: have you looked at any of the seesaw stuff? they might have some relevant examples?

16:01 graphbum: github.com/daveray/seesaw

16:01 graphbum: brehaut: I did look at seesaw (excellent lib).

16:01 brehaut: was going to use it, but I didn't need the extra size (i.e. the miglayout stuff).

16:02 brehaut: ended up wrapping the nifty gui library in Joy of Clojure, with my own extensions...

16:03 dnolen: aphyr: you might want to take a look at JVisualVM or YourKit

16:03 graphbum: brehaut: other option is to just lock the window size for now and get on with my life.

16:04 ibdknox: gfredericks: emezeske was working on adding repl support the other day

16:04 devn: anyone know if i need to do anything fancy with clojail beyond use the secure tester? What if I use the secure tester and my policy gives all permissions?

16:05 emezeske: ibdknox: It's actually finished code-wise, although I still need to document/release

16:05 ibdknox: emezeske: sweet

16:05 emezeske: ibdknox: If you're curious, check out https://github.com/emezeske/lein-cljsbuild/blob/0.1.0/doc/REPL.md

16:05 I'm also adding test support in the next release

16:06 gfredericks: emezeske: writing CLJS tests in CLJS?

16:06 emezeske: gfredericks: Yeah, and running them in PhantomJS

16:06 ibdknox: emezeske: I'm glad someone took this up in my stead :)

16:06 emezeske: ^_^

16:06 gfredericks: emezeske: crossover tests for crossover code?

16:06 emezeske: gfredericks: I guess crossovers could be tested in either CLJ or CLJS

16:07 gfredericks: I think you could write crossover tests too actually, which is.. interesting!

16:07 gfredericks: emezeske: yeah I would only feel half confident if I had only tested my crossover code on one host

16:07 emezeske: gfredericks: Although they'd be limited to the CLJ/CLJS feature intersection :)

16:08 gfredericks: and there isn't a clojure.test in cljs is there?

16:08 emezeske: gfredericks: I haven't dug into that too much yet; I'm just laying the foundation to run things

16:08 gfredericks: Hoping other people will work on those tools :)

16:09 gfredericks: okeedoke, just curious what exactly "test support" meant

16:09 emezeske: gfredericks: Really it just means a way to launch tests, with lein hooks, and a decent example of how to make it work

16:10 gfredericks: I'm pretty stoked to type "lein test" and see my CLJS get tested!

16:10 gfredericks: emezeske: I was heading toward putting together a similar library and one feature I had completed was generating a duplicate namespace for calling functions from vanilla JS; is that a feature you think would fit in cljsbuild, or is it a terrible idea?

16:11 (by "from vanilla JS" I primarily mean that it translated data structures)

16:11 emezeske: gfredericks: I might not understand what you mean; I've been doing that with (defn ^:export myfn [] ...)

16:11 Ah, is this an OSS thing that I could look at?

16:12 gfredericks: oh I hope I didn't delete that project once I saw cljsbuild

16:12 * gfredericks looks around

16:12 emezeske: haha

16:12 gfredericks: I think I did but I have a copy on this computer over here in my bag I think, give me a second

16:13 emezeske: the idea was that for your (ns foo.bar) it would generate a (ns foo.bar-js) with function wrappers calling into the original

16:14 I had it running and could successfully call cljs code from coffeescript

16:15 emezeske: gfredericks: I see, so the wrappers automatically did a clojure->javascript translation for the return values and such?

16:15 gfredericks: yeah, and js->clojure for the args

16:17 emezeske: That's very interesting. I'm not sure lein-cljsbuild would be the place for that. But I'm also not sure if that could be implemented outside of the build system (?)

16:18 gfredericks: emezeske: the project is here, though I'm not sure if you'll learn anything further by looking at it: https://github.com/fredericksgary/lib-4642

16:19 the translator functions are in resources/cljs.cljs

16:19 emezeske: gfredericks: Cool, thanks!

16:20 gfredericks: yep; let me know if you decide you like the idea, I'd be happy to work on it. I'll probably have to set up something equivalent for my current project regardless.

16:20 osa1: is there a find or search function to use instead of (first (filter ...)) ?

16:20 gfredericks: osa1: I don't think so

16:21 osa1: lazybot has a good tool for questions like that

16:21 $findfn [3, 8, 5, -5, -3, 2] neg? -5

16:21 lazybot: []

16:21 brehaut: (def first-match (comp first filter)) ;)

16:22 gfredericks: amalloy: lazybot should return results from useful as well :)

16:23 amalloy: it'd be more interesting if he tried some combinations of comp/juxt/partial

16:24 brehaut: amalloy: or employed core.logic for friedman-byrd results

16:25 Raynes: alexbaranosky: namespaces-matching is there.

16:25 alexbaranosky: Use the :prefix option to the… whatever function.

16:26 alexbaranosky: Raynes, thanks for clarifying that

16:26 Raynes: alexbaranosky: I just streamlined it all when I moved it out of Leiningen. It's one function that does everything based on the keyword options given. The README has examples.

16:27 alexbaranosky: yeah I see it now.

16:28 devn: howdy alexbaranosky

16:28 Raynes: devn: Did you get my messages in #flatland?

16:28 alexbaranosky: devn: what's up

16:28 devn, I'm looking at fixing up lein-midje at the moment

16:29 using bultitude for some ns utils the plugin depended on that have been moved

16:38 devn: alexbaranosky: ill be ready to look at that in a few -- im in the middle of trying resurrect my walton project from a couple of years ago

16:39 currently running /a lot/ of code in clojail

16:39 TimMc: devn: For what purpose?

16:40 Raynes: TimMc: His walton project reads #clojure logs for the past 5 years and evaluates code to see what works and then forms them into structured examples of clojure libraries.

16:41 TimMc: Wild.

16:41 brehaut: devn: so you've got it going now?

16:43 alexbaranosky: devn: that's pretty interesting sounding! github link?

16:44 devn: the code that is out on github is disgusting (and old)

16:44 https://github.com/devn/walton

16:46 it's been dead in the water for awhile -- im not parsing text logs anymore, am going to use a real store of some kind, currently playing with redis, but that's really just because it was handy

16:47 Raynes: devn: Redis is probably pretty fast for this.

16:47 devn: yeah, i was laughing with the guys i work with: "[35484] 20 Feb 14:28:18 * 10000 changes in 60 seconds. Saving..."

16:47 the only problem is doing fuzzy text search on it is kind of a PITA

16:48 i'd like for people to be able to search for +, and not only see (+ 1 1), but also see something like (nested (form (that (uses (+ ...)))))

16:48 TimMc: and (map + (range 100)) ?

16:48 osa1: &(map #([(keyword %) (keyword "blaah")]) '("ok" "bir"))

16:48 lazybot: clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentVector

16:49 osa1: what's wrong with this code?

16:49 devn: *nod*, lots of ways to search would be nice

16:49 by class, type, symbols used, etc.

16:49 TimMc: osa1: The #() form has to be a function call.

16:50 &([1 2 3]) <- osa1: the same thing is wrong here

16:50 lazybot: clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentVector

16:50 devn: ultimately i'd like to wrap it into another project im working on that will let you use the clojure cheat sheet + findfn + clojuredocs API from the repl

16:50 osa1: TimMc: weird. thanks.

16:50 TimMc: &(#())

16:50 lazybot: ⇒ ()

16:50 devn: btw, fun stuff: clojure.inspector just opened two windows

16:51 :)

16:51 brehaut: ,(map #(-> [%]) [1 2 3])

16:51 clojurebot: ([1] [2] [3])

16:51 TimMc: brehaut: That's hot.

16:51 brehaut: TimMc: blatently stolen from Joy of Clojure

16:52 TimMc: &(map #(doto [%]) [1 2 3])

16:52 lazybot: ⇒ ([1] [2] [3])

16:52 amalloy: are we using -> instead of do just to be confusing?

16:52 TimMc: Oh yeah, do...

16:52 Scriptor: but that uses letters

16:52 TimMc: I've actually used that, too. >_<

16:53 brehaut: TimMc: footnote 14 page 102

16:53 TimMc: Don't own it. :-(

16:53 amalloy: &(map (comp vec hash-set first list) [1 2 3])

16:53 lazybot: ⇒ ([1] [2] [3])

16:53 amalloy: super-efficient

16:54 TimMc: partial map ...

16:54 because why not?

16:55 Scriptor: ,(for x in [1 2 3] [x])

16:55 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (4) passed to: core$for>

16:56 TimMc: ...

16:56 Scriptor: ,(for [x in [1 2 3]] [x])

16:56 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: for requires an even number of forms in binding vector in sandbox:>

16:56 TimMc: s/ in//

16:56 Scriptor: ...

16:56 TimMc: This isn't JS. :-P

16:57 Scriptor: shut up, I just got done talking python :p

16:57 TimMc: aha

16:59 brehaut: huh. pods are kind of like a conjugation based on mutation

17:01 TimMc: brehaut: In a way that transients aren't?

17:02 brehaut: TimMc: not really. im just months behind everyone else, because ive had to wait for the video of rich's conj keynote

17:02 TimMc: Oh, it's up now?

17:02 brehaut: http://blip.tv/clojure/rich-hickey-keynote-5970064

17:03 which is to say, yes

17:03 franks: (doc clojure.core)

17:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.security.PrivilegedActionException: java.lang.ClassNotFoundException: clojure.core>

17:04 TimMc: &(-> 'clojure.core the-ns meta :doc)

17:04 lazybot: java.lang.SecurityException: You tripped the alarm! the-ns is bad!

17:04 TimMc: ,(-> 'clojure.core the-ns meta :doc)

17:04 clojurebot: "Fundamental library of the Clojure language"

17:05 devn: &(use 'clojure.repl)

17:05 lazybot: ⇒ nil

17:05 devn: &(doc +)

17:05 lazybot: ⇒ ------------------------- clojure.core/+ ([] [x] [x y] [x y & more]) Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +' nil

17:06 TimMc: Whoa, Rich apologized to cemerick in the keynote. Didn't know that.

17:07 franks: TimMc: right - I'm confused... I was looking at source code for clojure.repl/doc - I have the feeling that (cond...(resolve...(find-ns... should be reversed to (cond...(find-ns...(resolve...

17:08 TimMc: Well, now I'm distracted by a Conj video. :-P

17:08 franks: TimMc: if you do the find-ns first, then you can do a (doc clojure.core)

17:20 rbanffy: Hi folks. Returning to Clojure from the pre-1.3 era. Where did clojure.contrib.string/substring? went?

17:20 TimMc: rbanffy: Try clojure.string

17:20 and in general...

17:20 ~contrib

17:20 clojurebot: Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

17:21 brehaut: that particular case is subs right?

17:21 rbanffy: TimMc, nope. No substring? there

17:21 brehaut: oh. no it isnt

17:21 amalloy: $javadoc String contains

17:21 lazybot: http://download.oracle.com/javase/6/docs/api/java/lang/String.html#contains(java.lang.CharSequence)

17:25 franks: How do I recompile clojure.repl/doc in a running image? Trying (binding [*ns* (find-ns 'clojure.repl)] (defmacro doc..., but that tells me "CompilerException java.lang.IllegalStateException: doc already refers to: #'clojure.repl/doc in namespace: user..."

17:26 amalloy: binding happens at runtime, and defmacro happens at compile-time

17:27 well. sorta. it's a little more complicated than that, i guess. but the short answer is: (in-ns 'clojure.repl) (defmacro ...)

17:28 TimMc: amalloy: Presumably just the def happens at compile time?

17:30 My understanding is: read, macro-expand, parse sexps into AST + hoist defs, emit/eval

17:30 * franks tried the (ns 'clojure.repl) before, but then I got: CompilerException java.lang.IllegalStateException: var: #'clojure.repl/namespace-doc is not public, compiling:(NO_SOURCE_PATH:1)

17:31 TimMc: franks: in-ns, not ns

17:31 franks: TimMc: same error

17:35 TimMc: used an old trick that you taught me to get around private functions ;-) - substituted namespace-doc by #'namespace-doc and it works

17:40 Pls see "https://gist.github.com/1872000" - which would make (doc clojure.core) work - feels like a bug - pls someone confirm

17:47 uvtc: Hi #clojure. I just noticed that you can optionally pass `fn` a "name". As in: `(def a (fn foobar [x] (* x x)))`. How is this name used? What is the common use of it?

17:47 In the above case, the symbol `a` refers to my fn. What use is the "foobar" name?

17:48 brehaut: uvtc: you can use it like any other local

17:48 usually you wont be passing it to a def though

17:48 uvtc: brehaut, but `(foobar 3)` doesn't return 9...

17:48 Clojure is unable to resolve the symbol "foobar".

17:49 brehaut: uvtc: its local to the fn, not global to the NS

17:49 ,((fn fac [n] (if (= 1 n) 1 (* n (fac (dec n))))) 5)

17:49 clojurebot: 120

17:50 TimMc: &((fn introspect [] (class introspect)))

17:50 lazybot: ⇒ sandbox6832$eval10921$introspect__10922

17:50 brehaut: uvtc: sometimes you want to have a anonymous function that knows about itself, eg for recursion

17:50 TimMc: Also it makes for more readable stack traces. :-P

17:50 brehaut: TimMc: ah yes, good point!

17:51 uvtc: brehaut, thanks for that `fac` example ... When I saw it, I thought, "wouldn't I just use `recur` for that?"

17:51 brehaut: uvtc: you would!

17:52 uvtc: but if it was an indirect recursion you wouldnt be able to

17:52 TimMc: There are definitely times when it is useful for a fn to pass itself to something else.

17:52 Nothing off the top of my head, though.

17:53 uvtc: brehaut, in your `fac` example, using `recur` doesn't work, with Clojure telling me that I of course can only recur from the tail pos.

17:54 brehaut: uvtc: sure, but you'd rewrite it to use an accumulator

17:54 actually thats a use right there

17:55 uvtc: Agh, ... kids, dinner,.. can't ... hold ... out ... much longer ....... thanks for the help!

17:55 brehaut: ,((fn fac ([n] (fac (dec n) n)) ([n acc] (if (<= n 1) acc (recur (dec n) (* n acc))))) 5)

17:55 clojurebot: 120

17:55 brehaut: bah

17:55 a minute to late

17:56 bweaver: fwiw, naming a `fn` is really useful in this case: (fn foo ([] (foo default-value)) ([val] (do-something val)))

17:56 TimMc: ooh, right

18:03 amalloy: brehaut: isn't that just an ugly way to write a loop/recur?

18:04 brehaut: amalloy: i guess thats true

18:04 TimMc: brehaut: Were you referring to the value->transient and transient->value stuff as conjugation, or something later?

18:04 brehaut: bweaver's example made more sense

18:04 Raynes: amalloy: List comprehensions are bad. :P

18:05 Just throwing that out there.

18:05 brehaut: TimMc: thats stuff and the pod stuff that follows

18:05 TimMc: OK

18:05 amalloy: TimMc: correct, re: the def. but since the point of the binding was to change the def's namespace, the important part of defmacro happens at compile-time

18:06 TimMc: Agreed.

18:06 amalloy: Raynes: what? is that somehow related to anything, or are you just flamebaiting?

18:07 TimMc: Probably directed at Scriptor

18:07 Raynes: amalloy: It was a reference to our discussion with alexbaranosky at the conj.

18:07 At least, I think it was alexbaranosky, right?

18:07 Maybe it was lynaghk``

18:07 At the art place? You remember.

18:07 amalloy: him and rplevy. but alex was easily convinced that for might be nice, whereas rplevy was like "wut i hate for loops it's like java"

18:07 alexbaranosky: that was both myself and lynaghk``

18:08 Raynes: I apologize. I'm not great with names and faces.

18:08 alexbaranosky: my argument was that there are times for both

18:08 Raynes: I know there was somebody there who was just totally "it sux"

18:08 At least at first.

18:08 Scriptor: I think for is more readable for the example people were discussing earlier

18:08 qbg: I need a list of CSci books relating to Clojure without too much overlap. I already have "The Reasoned Schemer". Anything else?

18:08 Scriptor: turning a list into a list of lists

18:08 alexbaranosky: who knows, it might have been me; I was drinking

18:09 amalloy: Scriptor: oh, the #(do [%]) thing? yeah, i wouldn't recommend anyone actually do that

18:09 alexbaranosky: I like for especially for times when I want to utilize destructuring -- in other words, mapping over an anonymous fn that destructures is a code smell to me

18:10 amalloy: but i'd prefer (map vector [1 2 3]) to (for [x [1 2 3]] [x]), personally

18:10 alexbaranosky: amalloy, absolutely

18:10 amalloy: just because all the brackets mush together and i have to squint to see what's happening

18:10 Scriptor: true, using vector is way cleaner

18:11 amalloy: i think (hope) TimMc and brehaut were just fooling around looking for short/interesting ways to write it

18:11 brehaut: amalloy: yes

18:13 amalloy: i don't know of anyone who has ever written #(do ...) in real code and lived to tell the tale...because anyone who does that, i murder

18:13 qbg: So do #(list %) instead?

18:15 Scriptor: there's also #([[%]] 0)

18:15 amalloy: haha

18:16 * amalloy just found a new favorite

18:16 TimMc: niiiice

18:21 PntBlnk: Hi all, I'm having some difficulty modifying a macro in the Korma library and wonder if someone could have a peek at https://gist.github.com/1872212 and tell me what I'm doing wrong. I can't seem to get evaluation to happen in the right order.

18:23 qbg: If only transpose was built in. (transpose [[1 2 3]])

18:25 amalloy: &(let [transpose (partial apply map vector)] (transpose [[1 2 3]]))

18:25 lazybot: ⇒ ([1] [2] [3])

18:25 amalloy: it's built in, it just has a slightly longer name :P

18:26 Scriptor: is there a function that returns vector or list depending on the collection type you passed it?

18:26 qbg: &(empty [1 2 3])

18:26 lazybot: ⇒ []

18:26 Scriptor: *type of the collection

18:26 qbg: &(empty '(1 2 3))

18:26 lazybot: ⇒ ()

18:27 qbg: Good enough?

18:27 Scriptor: as in the functions list or vector themselves

18:27 TimMc: Scriptor: associative?

18:27 if you know it is either a list/seq or a vector

18:27 Scriptor: so you could do ((f [1 2 3]) 4) -> [4]

18:28 qbg: #(partial apply conj (empty %)) ? :p

18:28 &(let [foo #(partial apply conj (empty %))] ((foo [1 2 3]) 4))

18:28 lazybot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long

18:28 amalloy: i think you just want conj, not apply conj

18:28 qbg: &(let [foo #(partial conj (empty %))] ((foo [1 2 3]) 4))

18:28 lazybot: ⇒ [4]

18:29 qbg: Yep. For bonus points make it varargs

18:29 amalloy: it already is

18:29 qbg: &(let [foo #(partial conj (empty %))] ((foo [1 2 3]) 4 5 6))

18:29 lazybot: ⇒ [4 5 6]

18:29 qbg: You are correct!

18:30 Never did use partial much...

18:30 &(let [foo #(partial conj (empty %))] ((foo '(1 2 3)) 4 5 6))

18:30 lazybot: ⇒ (6 5 4)

18:30 amalloy: partial is not as cool as juxt, but it's pretty handy

18:31 oh hah. right

18:31 qbg: New bonus points: make it return it in the right order

18:32 TimMc: Of course, none of this is what Scriptor actually asked for.

18:32 amalloy: (comp {() list [] vector} empty)

18:32 TimMc: i think it actually is?

18:32 Scriptor: how do you copy in emacs with the starter kit settings?

18:32 TimMc: close enough, and it's not something I need right now

18:32 TimMc: Oh, so it is.

18:32 qbg: &(let [foo (comp {() list [] vector} empty)] [((foo '(1 2 3)) 1 2 3) ((foo [1 2 3]) 1 2 3)])

18:32 lazybot: java.lang.IllegalArgumentException: Duplicate key: clojure.lang.PersistentList$EmptyList@1

18:32 PntBlnk: Calling again for help with macro evaluation: https://gist.github.com/1872212. I'm embarrassed by the amount of time I've spent failing to understand how to solve the problem.

18:33 qbg: Yeah, not good enough

18:33 * TimMc pokes amalloy with an equality partition

18:33 amalloy: oh man

18:33 qbg: PntBlnk: What do you mean by 'I want this to be evaluated before pred-map'?

18:34 &(type [])

18:34 lazybot: ⇒ clojure.lang.PersistentVector

18:35 qbg: amalloy: I guess you could go from the type names, but eww

18:35 amalloy: yeah, i thought of that first but it's so gross

18:35 welcome to #clojure, where we can't tell how to make collections

18:36 PntBlnk: Oh yay, thanks! Well the pred-map is getting the parse-where function instead of the result..

18:36 jweiss: in the REPL is there anything that can be done to stop the memory use from ever-increasing? (System/gc) gives back nothing and my jvm is at 780m

18:37 TimMc: &(let [f (fn [x] {:pre [(sequential? x)]} (if (associative? x) vector list))] (map f [[1 2 3] (range 10)]))

18:37 lazybot: ⇒ (#<core$vector clojure.core$vector@5e119c> #< clojure.lang.PersistentList$1@4dc33c>)

18:37 qbg: jweiss: Sounds you you're holding onto some big object

18:38 TimMc: jweiss: Start unmapping namespaces and defs.

18:38 jweiss: TimMc: i was about to ask whether it's typically data or code that takes up a lot of space

18:38 sounds like code is a part of it

18:38 significant part i mean

18:39 qbg: jweiss: What have you done in your repl session? I've only ever gotten that big by def'ing a huge object

18:39 TimMc: Good question. Start VisualVM or whatever and find out!

18:39 amalloy: you guys are assuming that the jvm gives memory back to the OS when it's done GCing. unless you give it a max heap size at startup, it often won't do that

18:39 jweiss: i'm installing visualvm now

18:39 qbg: Do you have the JDK installed?

18:39 If so, you already have it

18:39 jweiss: amalloy: good point, i need to ask the jvm rather than linux

18:40 qbg: separate package on my distro, apparently

18:40 qbg: Yeah, it is sort of a random addition :p

18:41 PntBlnk: Does manually invoking the effective eng/parse-where call work?

18:41 jweiss: PSYoungGen total 598208K, used 157197K

18:42 PntBlnk: Yes, as follows in a sec...

18:42 wubo: pretty awesome talk on JVM memory tuning and what the generations (like PSYoungGen) mean: http://www.infoq.com/presentations/JVM-Performance-Tuning-twitter

18:43 qbg: jweiss: You can do a heap dump and see what is using what

18:43 (probably want to compute retained sizes)

18:43 jweiss: qbg: i think what i pasted shows the jvm isn't actually using it

18:44 but it's not giving anything back to the os, so i think i need to lower Xmx

18:44 currently at 512mb

18:44 qbg: Do you really need the jvm to give up that virtual memory?

18:44 jweiss: still, kinda surprised at 780m memory use

18:44 qbg: i think that's res not virtual

18:45 on this box, i have plenty of mem, but i want other people to be able to do the same without using embarrassing amounts

18:45 qbg: If you have plenty of memory, I'm not surprised that linux is keeping most of the unused mem resident

18:45 duck1123: with lein-cljsbuild, I should be able to just specify clojurescript libraries in my project and it should find them, or does it not work that easily jet?

18:46 jweiss: i guess i should just not try to solve this problem until it's actually a problem :)

18:46 gfredericks: duck1123: I think that's advertised in the README

18:47 qbg: Probably be better to find the peak amount of mem your app uses

18:47 Scriptor: is there an equivalent to & rest but for #(do %) style functions?

18:47 gfredericks: duck1123: I take it back

18:47 qbg: You don't want to set Xmx too low or else you'll get GC overhead limit exceeded exceptions.

18:47 duck1123: I've tried that, and it doesn't seem to work. Can't find jayq.core

18:47 PntBlnk: If I call (select call (where (like :assignee "ab"))), the parse where is evaluated and the pred-map function gets (korma.sql.fns/pred-like :assigned_to "ab").

18:47 qbg: &(#(do %&) 1 2 3)

18:47 lazybot: ⇒ (1 2 3)

18:48 Scriptor: ooh

18:48 ibdknox: duck1123: it does work that easily :)

18:48 PntBlnk: The parse-where function takes a the predicate and replaces it with a function. What I want it to get is the resulting map: {:korma.sql.utils/pred #<engine$do_infix korma.sql.engine$do_infix@19e17b0>, :korma.sql.utils/args [:assigned_to "LIKE" "ab"]}

18:50 Sorry, I wasn't clear. I would like pred-map to get the resulting map from evaluating the function returned by parse-where.

18:51 qbg: PntBlnk: Do you really want to be passing parse-where a list of the form (unalias-form ...)?\

18:51 PntBlnk: Nope, what you see there is the result of many painful experiments and misunderstandings.

18:52 qbg: You just want to call parse-where with the result of unalias-form I presume?

18:52 PntBlnk: The unalias-form function returns the same form with replacements.

18:53 qbg: Does replace that section with (unalias-form form query) work?

18:54 newb_cl: Hi, does aleph work with clojure 1.3?

18:54 PntBlnk: Yes. But I was having lots of trouble getting form to stay as it is and forcing the query to evaluate. Unevaluated the query is something like (select* call). I want the form to stay unevaluated, because of course it has to be processed by the parse-where...

18:55 You you suggest completely unquoting the bottom line?

18:55 duck1123: Well, It appears I simply needed a more recent copy of clojurescript. I apologize for suggesting that something may not be easy. Now to hack some clojurescript

18:56 qbg: PntBlnk: Yeah, so you'll passing the result of unalias-form to parse-where

18:56 ibdknox: duck1123: I'm about to put up a video of me building an app from start to finish :)

18:57 I guess I should probably narrate it though

18:57 hm

18:57 gfredericks: ibdknox: you finish apps?

18:57 ibdknox: upon occasion ;)

18:57 PntBlnk: qbg: That gets back to my previous issue.

18:57 gfredericks: you could sell that.

18:57 duck1123: that would be very cool to watch. I've been holding off on doing much javascript until I could actually, you know, get any dependencies to work

18:58 qbg: Does replacing ~(eng/parse-where ...) with '~(eng/parse-where ...) help with your previous issue?

18:58 PntBlnk: The form gets passed okay, but the query is unevaluated.

18:59 qbg: PntBlnk: What does query look like?

18:59 PntBlnk: Massive. You don't want it posted here :)

19:00 Korma uses pretty complicated nested maps for queries and tables.

19:01 ibdknox: oh, you guys are talking about korma.. maybe I should pay attention lol

19:01 PntBlnk: Feel free to have a look at my Korma fork if you'd like to see what I've been up to. I'm working on the field-aliases branch. https://github.com/pauldorman/Korma

19:01 ibdknox: what are you guys trying to accomplish?

19:02 qbg: https://gist.github.com/1872212

19:02 PntBlnk: Are you essentially wanting to use (unalias-form form q#) instead of (unalias-form form query)?

19:03 PntBlnk: qbg: If I quote the parse-where line the form gets evaluated...

19:03 ibdknox: lol or don't tell me :)

19:03 qbg: ibdknox: The second macro isn't working correctly

19:03 ibdknox: sure

19:04 I don't know what that does :)

19:04 what is the ultimate goal?

19:04 PntBlnk: ibdknox: I've almost got this licked, just having a fight with the 'where' macro.

19:05 franks: Is there a way to see if a var refers to a protocol ? (doc or meta doesn't seem to provide any clue...)

19:05 PntBlnk: The 'field-aliases TLDR': Enable the definition of default aliases for entities (using the 'aliases' function) which can be used in place of actual field names for all Korma functions.

19:07 franks: A protocol function, however, does have a meta :protocol meta member...

19:07 ibdknox: couldn't you just do (def myalias :some-crazy-long-field) and use that all over?

19:08 franks: Sorry, not function but : A protocol interface definition, however, does have a meta :protocol meta member...

19:08 qbg: PntBlnk: Did you write unalias-form?

19:08 PntBlnk: All of the existing tests pass (with a couple of minor changes).

19:08 Sure, but why not do it at the entity?

19:09 ibdknox: because it adds another layer of indirection, and I would assume complicates the implementation a fair amount

19:09 PntBlnk: Actually, the changes are pretty minor aside from the functions I've added.

19:10 qbg: If you wrote unalias-form, do you have to do it before parse-where?

19:10 ibdknox: complexity isn't always measured in the size of a change :)

19:10 PntBlnk: I'd love it if you'd have a peek, though it's not ready for a pull request yet ;)

19:10 devn: take for instance the code i just rewrote

19:11 PntBlnk: qbg: yep, because parse where needs the unaliased form.

19:11 qbg: Is unalias-form out in that repo? If so, where?

19:12 PntBlnk: qbg: It's in the field-aliases branch.

19:12 https://github.com/pauldorman/Korma/tree/field-aliases

19:13 weavejester: Does anyone happen to know of an easy way of running an interactive shell script from a Gist?

19:13 My usual "wget -O - http://blah | bash" doesn't work due to the pipe

19:14 amalloy: curl http://blah > foo && chmod +x foo && bash ./foo?

19:15 weavejester: amalloy: Yeah… but… that's kinda ugly… *whines*

19:16 brehaut: isnt theres some sort of parenthesised file source notation in bash?

19:16 amalloy: there is, but i don't remember it

19:16 brehaut: liekwise

19:16 $(…) or something?

19:16 amalloy: bash <(curl http://blah) maybe

19:16 weavejester: Hm…

19:16 brehaut: yes

19:17 echo "echo \"hello, world\"" > test.sh; bash <(cat test.sh)

19:17 works for me

19:17 amalloy: yeah

19:17 qbg: PntBlnk: Are you sure parse-where needs the unaliased form? I'm not seeing how from a quick peek at the source of parse-where

19:18 brehaut: i think http://mywiki.wooledge.org/BashSheet looks bookmark worthy

19:18 weavejester: Yep, it works!

19:18 bash <(echo "read -p 'Username: ' username")

19:19 PntBlnk: Well, this is possibly my non-lazy thinking, but shouldn't parse-where get the expected form rather than a function call to unalias-form?

19:19 weavejester: brehaut, amalloy: Thanks for the help

19:19 amalloy: i've learned enough cool bash tricks that i no longer feel a pressing need to better myself

19:20 TimMc: I use diff <(svn cat or whatever) <(etc) all the time.

19:20 brehaut: i have learnt that bash frightens me enough that i dont want to learn any more

19:21 amalloy: aw. the bash syntax is a complete hodgepodge, but it's amazingly powerful and concise

19:21 brehaut: hah yes

19:21 i also havent learnt apl ;)

19:22 amalloy: but clojure!? i hear those guys just use parentheses for everything, even to represent numbers!

19:22 brehaut: oleg numbers for life!

19:22 qbg: PntBlnk: If I'm understanding this correctly, the issue here is that query is not evaluated before it is passed to unalias-form (if you do (unalias-form form query)).

19:22 PntBlnk: Yes, exactly

19:23 qbg: If that is the case, I think you might be out of luck because you've made a big complecting of runtime and macroexpansion time as far as I can see

19:23 PntBlnk: I clearly have expert help. Thank you.

19:23 TimMc: Are you saying PntBlnk has an ugly complexion?

19:24 qbg: You'd probably have to add an interpreter to Korma to do what you want in that case

19:24 Or do some big restructuring

19:24 PntBlnk: Hmm.

19:24 amalloy: is unalias-form a macro?

19:24 qbg: function

19:24 PntBlnk: Not yet :)

19:25 amalloy: okay good. i haven't been paying much attention but it seems like it should be a function, and you're saying things that sound like accidental-macros

19:25 qbg: Because you want to get the runtime value of query at macroexpansion time currently (to determine the aliases)

19:25 ibdknox: in theory, if it walked the form and just replaced keywords with other keywords, you'd get most of the way there

19:25 TimMc: technomancy: By the way, I finally figured out how to do temp-namespace sandboxing for my tests: https://github.com/timmc/handy/blob/v1.1.0/src/org/timmc/handy.clj#L53

19:25 qbg: But the mappings are determined at runtime currently

19:26 ibdknox: yep

19:26 qbg: And Korma is basically a compiler...

19:26 So we need to invent time travel

19:26 ibdknox: it *is* a compiler :)

19:26 mostly

19:26 heh

19:26 PntBlnk: I've been avoiding macros as much as possible - partly because of where I am in Clojure development, and partly because I haven't needed to learn much about them yet.

19:27 TimMc: Macros are extensions to the compiler.

19:28 qbg: Korma is at the 'put a compiler into the macro system' level of compilerception.

19:29 ibdknox: you can use korma without any macros at all actually

19:29 they just make it slightly nicer

19:29 so you can use = instead of pred-=

19:29 and (select ...) instead of (-> select)

19:29 qbg: But we're touching the macro part here

19:29 ibdknox: yeah :(

19:30 PntBlnk: qbg: Well I have done similar with the realias-fields function.

19:31 It was necessary to keep with Korma's goal of being very composable

19:31 TimMc: qbg: At one point I was going to help someone rewrite a macro that expanded from a CFG definition into a parser. Is Korma fancier than that? :-P

19:32 qbg: Not really

19:32 From my quick look at it

19:32 PntBlnk: Thank you very much for your help qbg and ibdknox. I'll take a different tack and see where that get's me.

19:32 TimMc: qbg: http://www.shivers.com/~shivers/scheme04/tmp/scheme04/article/05-lexparse.pdf

19:33 ibdknox: TimMc: I actively tried to make korma not be fancy

19:33 TimMc: It's crazy shit.

19:33 qbg: Not having read that paper (at least recently), I'd think the way you'd go is expand into code that builds up the parser using parser combinators

19:33 PntBlnk: ibdknox: I've also got a pred-between branch on my Korma fork, implementing inclusive ('between'), and exclusive ('between!') predicates. Let me know if you think they might be suitable for a pull request :)

19:34 qbg: I've basically done that before when working on an implementation of something like syntax-parse

19:36 TimMc: qbg: I actually don't remember much about the details. At the time, I was trying to learn Scheme48, advanced macros, and Emacs all at the same time. That was ill-fated enough without also trying to grok the existing (apparently somewhat heinous) codebase and learn how to write parsers at the same time.

19:37 qbg: parser combinators are cool :)

19:37 TimMc: Oh, and there was something about CPS macros or some such. o.O

19:37 qbg: I bet.

19:37 qbg: Oh fun!

19:38 In my attempt to create something like syntax-parse, I discovered that syntax-parse is way too complected

19:38 All what Clojure really needs is a good parser generator library that works on sexps

19:39 TimMc: :-)

19:39 qbg: And the hard part about writing such a parser is providing the good error messages that syntax-parse provides

19:40 (more like awesome error messages)

19:40 TimMc: Oh yeah, errors are hard.

19:41 qbg: At the same time, defmacro provides for 90% of the use cases, the other 10% being macros on the order of defn for example

19:43 And defn seems to be essentially hard if you think about it

19:44 TimMc: You mean, making something like defn?

19:44 qbg: It is all about normalizing the macro call into something that is easier to use

19:44 Yeah

19:45 TimMc: Well, all the hard stuff is really in fn. Sort of.

19:45 qbg: I've done a basically complete port of defn to my macro system for Clojure

19:45 Well, you have a ton of different forms to handle

19:46 TimMc: I had a look at the impl. It was brimming with ugliness.

19:46 ...but that's largely because of the large number of weird formats it can take.

19:47 qbg: Here is what I did: https://github.com/qbg/syntax-rules/wiki/defn-implementation See how ugly it is :)

19:48 Need to rewrite that library from scratch at some point in time, and bring it up to Clojure 1.3 :)

20:08 tjgillies: im working on http://cl.ly/2P121e1Z0R020n0O1k0W and (map raise subneurons) in the fire function isn't causing the subneuron to increment

20:08 is it because you can't do a dosync inside a dosync?

20:11 brehaut: you can definately do a dosync in a dosync; thats half the point of the primative

20:11 although its restart semantics might suprise some people

20:12 tjgillies: weird

20:12 brehaut: but i cant actually see your code (dunno why)

20:13 TimMc: Yeah, there's nothing there.

20:13 tjgillies: hrm

20:13 odd

20:13 oh weird just disspeared for me too

20:13 was there

20:13 must be a glitch in cloudapp

20:13 TimMc: tjgillies: Try https://refheap.com/paste

20:13 tjgillies: have to go i'll come back later and paste

20:14 refheap uses browserid

20:14 nice

20:14 ive been waiting for more actual uses of it before i use it myself

20:15 TimMc: Raynes: Remind me again of my opinion of browserid?

20:25 Scriptor: oh come on, clojure-jack-in doesn't work because " 'lein' is not recognized as an internal or external command,\noperable program or batch file."

20:26 M-x slime-connect works fine

20:26 TimMc: Scriptor: And lein is on your PATH?

20:27 Scriptor: TimMc: yep, it works fine in cmd

21:07 muhoo: with a lein in your path and a spring in your step.

21:08 ibdknox: does korma handle tables with composite primary keys?

21:09 ibdknox: not implicitly

21:09 you can make it do so explicitly though

21:10 (join some-ent (and (= k1 se.k1) (= k2 se.k2)))

21:10 or just add a where

21:11 muhoo: thanks

21:12 did your demo of the cljs synth front-end ever get published anywhere?

21:38 ibdknox: muhoo: I'm finishing up a couple things and then it goes live :)

21:48 brehaut: what is the autocomplete mode sam aaron uses in his overtone vid?

21:58 devn: brehaut: this is just a guess, but maybe slime-fuzzy?

21:58 ibdknox: As requested: http://news.ycombinator.com/item?id=3615022

21:58 devn: brehaut: his dotfiles are online

21:58 overtone-emacs i believe is the repo name

21:58 brehaut: devn: oh right. thanks :)

21:58 devn: brehaut: if you want something really fancy for live coding you have to check out hilight-tail-mode

21:58 ibdknox: along with the video is an epic blog post

21:59 brehaut: ibdknox: oh, the jekyll blog?

21:59 that was fast

21:59 ibdknox: No point in waiting around ;)

21:59 brehaut: nope ;P

22:00 ibdknox: that should provide a pretty good intro for those looking to mess around with CLJS though

22:00 lots of good tidbits in there

22:01 brehaut: ibdknox: pygments highlighting?

22:01 ibdknox: yessir

22:02 jimduey: ibdknox: nice job on the blog and the app.

22:03 I thought about doing an app like that, but buried it deep in my TODO stack. Glad to see you do it.

22:03 ibdknox: :)

22:03 it was fun and quick

22:04 jimduey: What did you think of Jekyll?

22:05 ibdknox: it took me a bit to get it "right"

22:05 I tried starting from that bootstrap thing, but it just seemed like there was way too much there

22:05 brehaut: ibdknox: surely you'll still be getting it 'right' for the next 6 months or more :P

22:05 ibdknox: now that it works, I like it

22:05 brehaut: there's nothing to mess with! I'm pretty happy with the design

22:06 the content for projects could probably be a little better

22:06 I threw most of those together pretty quickly

22:06 brehaut: ibdknox: haha. ive been happy with the design every time i refreshed my site, but still found heaps of stuff to tweak after not too long

22:10 devn: ,(def yall? every?)

22:10 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

22:10 devn: &(def yall? every?)

22:10 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

22:10 devn: :(

22:11 i stole that from gnuvince: http://clojure-log.n01se.net/date/2009-02-05.html

22:11 i need to make a redneck clojure, (def ygot? contains?)

22:25 ,(let [foo (let [bar 2] (str bar))] foo)

22:25 clojurebot: "2"

22:28 muhoo: is there any clojure library for interfacing directly with git?

22:28 other than maybe using java interop and jgit, perhaps.

22:28 devn: muhoo: not probably what you're after, but: https://github.com/Raynes/tentacles

22:29 muhoo: also, checkout clojars, seems to be a few things worth looking into including: [quickbeam "1.0.0-SNAPSHOT"]

22:30 muhoo: https://github.com/technomancy/quickbeam

22:31 muhoo: cool. thanks.

22:31 devn: np, looks like it uses jgit

22:31 pretty tiny lib, but probably ripe for commits if you feel so inclined :)

22:34 tjgillies: when neuron2 fires its not increasign neuron1 https://refheap.com/paste/783

22:34 increasing*

22:34 devn: huzzah!

22:35 let the neurons fire!

22:35 pandeiro: ibdknox: does your jekyll site automatically make a post to hn too and generate the link at the bottom?

22:35 ibdknox: nope, I did that

22:35 pandeiro: but you intend to let hn handle the comments for your posts?

22:35 devn: ibdknox: reading back up in my buffer now -- i never liked jekyll

22:35 i found it to be a pain in the ass

22:35 :X

22:35 ibdknox: so far I really do

22:36 devn: i tried almost as many times as i tried emacs

22:36 ibdknox: what was the problem?

22:36 it seems like now that I have it in this state, all I do is add posts

22:36 devn: honestly I'm not sure, it just felt like most of the time I was plumbing and not doing

22:36 err not "adding value"

22:36 it took long enough to setup that i was like...great, why didn't i use wordpress?

22:37 muhoo: ibdknox: that cljs app is fantastic. thanks for documenting it so clearly. actually, all of your stuff seems really well documented to me. thanks for that.

22:37 devn: +10, ibdknox's docs rule

22:37 model clojurian

22:37 ibdknox: :)

22:38 devn: his color scheme choices are fun too

22:38 ibdknox: do you have a donate button somewhere on your repos?

22:38 pandeiro: ibdknox: all the comments for your blog will be through hn then?

22:38 ibdknox: pandeiro: probably, I never found it useful to have them on my own site

22:38 devn: I keep forgetting to do that

22:40 devn: ibdknox: i work at a small company and we have a sort of internal "give other people company money" sort of thing. tooting my own horn: I gave to a couple of open source projects recently and noticed that a half dozen of my favorite clojure projects have no way to donate

22:40 i want a world where we all get paid to work on open source

22:40 so get them buttons up, ibdknox! :D

22:42 Scriptor: donations raise a whole bunch of issues though, like being more partial to the donator's wants, even if you don't realize it

22:46 ibdknox: it'd have to be anonymous

22:46 muhoo: i don't think that's necessarily a bad thing. i like to eat. others do too, i'm told.

22:46 brehaut: muhoo: thats a ridiculous liberal media conspiracy

22:46 muhoo: :-)

22:47 * gfredericks imagines project super-pacs

22:47 brehaut: super-pac? is that some sort of american thing?

22:47 gfredericks: quite

22:47 muhoo: brehaut: you don't want to know :-/

22:47 brehaut: probably right

22:48 gfredericks: don't google it it would just make you sad

22:48 brehaut: gfredericks: most of your political system makes me sad

22:48 Scriptor: has anyone used clojurescript's reader on its own?

22:48 muhoo: one dollar, one vote!

22:48 Scriptor: or are there any guides to do so?

22:55 devn: Scriptor: There is a degree of being partial to donors' wants that is healthy.

22:56 Scriptor: some projects do not have donors and cater to themselves exclusively. Balance is healthy.

22:59 pandeiro: ibdknox: did you mute your mic or are you really that zen when all this crap keeps throwing exceptions and screwing up?

22:59 ibdknox: haha

22:59 no muting

22:59 muhoo: i think anyone with experience in web dev is used to that

23:00 pandeiro: yeah i guess you gotta be in the zone

23:00 but i don't even hear a sigh, nothing

23:00 you gotta swear at the compiler or it's not programming i thought

23:01 muhoo: web dev, usually does not involve a compiler. it usually involves multiple broken browsers and broken languages.

23:02 mrevil: what do people use for building rest clients?

23:02 brehaut: mrevil: in clj or cljs?

23:02 mrevil: clj

23:02 brehaut: clj-http is probably a good start

23:02 http://github.com/dakrone/clj-http/ i think?

23:02 pandeiro: muhoo: in this case talking about the cljs compiler

23:03 muhoo: oh, well my understanding it that cljs is still very alpha. so maybe that's still the norm.

23:04 mrevil: no higher level abstraction?

23:04 muhoo: mrevil: noir? ring?

23:04 mrevil: i thought that was server side

23:05 muhoo: clj, yes, server side. cljs is client-side.

23:07 brehaut: mrevil: higher level? rest is an architectural style, not a protocol. there really isnt a 'higher level' than http for rest in general

23:07 TimMc: devn: So, should I put a bitcoin address on all my READMEs or what? :-P

23:08 mrevil: no, but take for instance httparty for ruby, there are abstractions that make writing rest clients easier/faster.

23:08 devn: TimMc: I look around at some of the projects I really love and people support them, allow them to work full time on a particular project. I don't think some people care to be tied down their open source projects. I think there are others who would like that very much.

23:09 down by their*

23:09 TimMc: Maintainership can be a real bear, yes.

23:09 Sometimes I want to release code anonymously. :-P

23:09 brehaut: mrevil: a quick look at some docs for that and it looks horrible! specific urls‽ thats not restful

23:10 devn: I think we all sort of do that TimMc

23:10 TimMc: More seriously, how to handle multi-contributer projects?

23:11 devn: IRC is sort of like this oracle. You can walk into this room, and if people are around you can wind up with some really great answers to problems you never asked to be answered.

23:11 TimMc: I have no idea

23:11 TimMc: a lot of real communication?

23:12 TimMc: Let's say I put a donation button on org.baznex/imports, which started out as a clojure.contrib migration but is now largely code written by me, with some code and ideas from tmciver and a bunch of ideas from the channel.

23:12 devn: point taken

23:12 but also, meh.

23:12 TimMc: I think the easiest thing to do would be to have a donation button that actually sends the money to some explicitly listed charity, and all the contributors just get a boost by seeing donations that come in.

23:13 brehaut: TimMc: that sounds like a great idea

23:13 devn: TimMc: I think that should be everyone's choice

23:13 If someone becomes an addict maintainer, who is to say that I should stop them?

23:14 TimMc: haha

23:14 devn: If someone can make it a job and help the community a ton by asking for modest donations that seems like a net win.

23:14 TimMc: I *want* it to be easy for people to make money from this stuff, but figuring out non-poisonous incentive structures is hard.

23:16 devn: yeah, totally agree. at the end of the day I think I really feel like if someone has a dream to maintain the hell of out projects, then I think we should encourage that. There shouldn't be whispers around it.

23:16 It's sort of like people are afraid to get paid a living wage for doing what they love.

23:18 TimMc: 1) Project owner takes all: People would probably feel a little weird doing significant contributions. 2) Proportional take by LOC/issues closed/etc.: Skews what works is done (probably! or could be in a good way!) 3) renegotiate percentages occasionally

23:18 Maybe (1) + project owner puts a bounty on issues.

23:18 devn: TimMc: There is a middle ground still though, maybe?

23:19 TimMc: I should have labeled those A B and C, by the way -- those are alternatives, if it wasn't clear.

23:19 devn: Think of Heroku, AWS. You can get a free micro, or free hosting, the base platform, but there's a buiness model outside of it that builds *with* the community behind it..

23:20 TimMc: Right, it has a good incentive model, just like NFSN

23:20 pay-for-what-you-use

23:20 devn: I'm not familiar

23:20 TimMc: NearlyFreeSpeech.net, a web host I use.

23:21 devn: TimMc: *nod* -- I like that. Here's the guts. You could build this yourself. Most of it is open source, the rest would be useless to organize.

23:21 TimMc: Prepay, and bandwidth, storage, and other site fees are deducted penny by penny.

23:21 devn: but, hey, if you want some of that stuff, we're plumbing the system together.

23:21 TimMc: Not following.

23:22 devn: puts quotes around everything I just said from "Here's the guts." on...

23:22 TimMc: I'm speaking from the perspective of a Heroku or AWS.

23:23 TimMc: Hmm, OK. I got confused by the dual role of "open source" in this conversation.

23:23 tjgillies: heroku is expensive for more than one dyno

23:23 devn: *nod* -- sorry, I realize I'm a confusing typist. I write like I speak a lot of the time and it gets me in constant trouble.

23:23 TimMc: tjgillies: Yeah, I'd love a middle ground.

23:24 devn: Oh, I figured out that you were summing up their sales pitch.

23:24 devn: TimMc: As I wrote that I had changed my tone, inflection to clearly be another person.

23:24 :)

23:24 tjgillies: clearly

23:24 devn: TimMc: I mean, that's not far off.

23:24 TimMc: devn: Are you suggesting a pay-for-customization model?

23:25 devn: I don't know. I don't know enough about that to have a reasonable opinion.

23:25 What is the Heroku, AWS model in your opinion?

23:26 ibdknox: PaaS

23:26 devn: Not to assume they're the same... They might be very different. I guess I personally see them as similar, but would be curious to know your take.

23:26 tjgillies: so weird. on line 17 https://refheap.com/paste/784#L-17 it works with an anonymous function, but if i try to map over the vector of refs it doesn't do anything

23:26 TimMc: ibdknox: "P" == ?

23:26 ibdknox: Platform

23:26 TimMc: plumbing?

23:26 devn: haha

23:26 brehaut: poodles

23:27 devn: parsnips

23:27 tjgillies: plojure

23:27 devn: "i hear plojure is really making a splash these days"

23:28 TimMc: tjgillies: Those dangling parens after (inside?) the dosync make it hard to see the structure.

23:28 tjgillies: TimMc: i'll rewrite that section

23:28 brehaut: tjgillies: why are you using an anon fn in a let anyway?

23:29 TimMc: tjgillies: Anyway, you call that fn with (first subneurons), right?

23:29 devn: tjgillies: it seems a little weird to me that your arities are reversed

23:29 TimMc: tjgillies: At this point, all I can offer is doall around any side-effecting maps, or maybe just a doseq

23:30 devn: tjgillies: why is [popularity] after [popularity subneurons]

23:30 TimMc: devn: polarity

23:30 * devn sighs at himself

23:30 devn: either way, it struck me as being sort of odd, just saying...

23:31 tjgillies: devn: because im a clojure noob thats why

23:31 TimMc: I can see it either way. Most general case first, helpers later? (No implication of "forward reference".)

23:32 When writing chaining Java constructors, I can never decide which order to put them in.

23:32 devn: tjgillies: nah it's fine, i don't mean to nitpick

23:32 TimMc: im just cargo culting -- i see that most people go low to high. that seems to be a common pattern in clojure

23:32 tjgillies: TimMc: https://refheap.com/paste/785

23:32 devn: it's an unspoken idiom

23:33 tjgillies: i cleared that function up to its easier to see structure

23:33 so it's*

23:33 brehaut: tjgillies: you (dosync (alter subneuron…)) can be rewritten as (dosync (alter subneuron update-in [:value] inc))

23:33 tjgillies: brehaut: thnx

23:33 brehaut: update-in is magic :)

23:34 devn: select-keys too

23:34 brehaut: tjgillies: you might even find (fnil inc 0) useful too

23:34 TimMc: brehaut: especially when combined with fnil

23:34 devn: :)

23:34 TimMc: bah!

23:34 brehaut: ,(update-in {} [:value] (fnil inc 0))

23:34 clojurebot: {:value 1}

23:34 brehaut: ,(update-in {:value 100} [:value] (fnil inc 0))

23:34 clojurebot: {:value 101}

23:34 TimMc: Sniped by a kiwi! My internet must be super-laggy tonight.

23:34 brehaut: TimMc: ahaha

23:34 devn: "f nil" seems to be fitting

23:34 tjgillies: my question was i don't understand why my anonymous function alters the ref, but when i try to map over subneurons nothing happens

23:34 brehaut: stephen fry says yes

23:35 tjgillies: im not sure i understand why you are creating a fn in the let and then executing it it imiediately?

23:35 TimMc: tjgillies: Show the attempt at using map.

23:36 brehaut: why ont just (let [[subneuron & _] (:subneurons @neuron)] (dosync …)) ?

23:36 TimMc: and remember that map is lazy

23:37 tjgillies: TimMc: here it is with the map: https://refheap.com/paste/786

23:37 TimMc: tjgillies: Right, put a (doall ...) around that map, see what happens.

23:38 tjgillies: ok not sure what doall is

23:38 brehaut: , (let [{[subneuron & _] :neurons} {:neurons [:magic 2 3]}] subneuron) ;; more magic

23:38 clojurebot: :magic

23:38 tjgillies: lemme try it

23:38 brehaut: tjgillies: doall forces the realization of a lazy sequence

23:38 tjgillies: i wish i could use doall on people

23:38 brehaut: baha

23:40 tjgillies: TimMc: sweet its working now

23:40 TimMc: tjgillies: Now replace the doall and map with https://refheap.com/paste/787

23:40 tjgillies: im not used to working with lazy stuff

23:40 im a ruby guy

23:40 TimMc: You were throwing away the return values anyway, right?

23:41 tjgillies: yeah i was essentially using it as for-each

23:41 TimMc: doseq = dorun map

23:41 brehaut: doseq = dorun for

23:41 tjgillies: whats dorun?

23:41 so many do* functions in clojure

23:42 brehaut: like doall but it discards the sequence rather than returning the head

23:42 tjgillies: ah, is that more efficient?

23:42 brehaut: it wont consume memory for no reason

23:42 Scriptor: so dorun is only for side effects?

23:42 tjgillies: i'll take that as a yes

23:43 brehaut: Scriptor: yes

23:43 tjgillies: it was a specific yes ;)

23:45 tjgillies: TimMc: awesome thanks

23:46 TimMc: tjgillies: Make sure you learn the difference between dorun and doall and why they exist; what it means for doall to "hold onto the head" of the seq.

23:47 tjgillies: ok

23:49 whats the best way to clear all the values in clojure-swank? just reload it?

23:49 swank-clojure rather

23:52 oh looks like c-c c-k clears the values as well as compiling

23:53 Scriptor: is there a list joining function or is (reduce str ...) the idiomatic way?

23:54 lynaghk``: for a list of strings?

23:54 clojure.string/join

23:54 ibdknox: lynaghk``: did you catch my blog post? :)

23:55 lynaghk``: yeah, I just saw it on HN

23:55 I'm tempted to crank out my own iPad overtone controller

23:55 in our iFight.

23:55 ibdknox: haha

23:55 lynaghk``: LUCKILY for you Chris, I'm slammed with other work

23:55 =P

23:55 ibdknox: I am too, I'll probably regret losing the day to making this

23:55 lol

23:55 oh well, for the good of the community and all

23:56 pandeiro: ibdknox: so this didn't all happen in 23 minutes you mean?

23:56 ibdknox: building it did

23:56 pandeiro: i saw that ipadtest vim session boy...

23:56 ;)

23:56 ibdknox: then writing the blog post and cleaning up the blog and blah blah

23:56 lol

23:56 that one was actually faster

23:56 oddly enough

23:57 took me about 15 minutes

23:57 apparently my computer can't take recording an HD screencast and getting deps at the same time

23:57 lol

23:57 the screencap at two cores the whole time :/

23:58 Scriptor: is there a function that returns whether a value is an atom (not Atom), so if it's a string, integer, boolean, etc.

23:58 atom? seems to do the trick

23:59 pandeiro: ibdknox: awesome that you also did the write up... one thing still foggy in my mind is what the remotes middleware is doing

Logging service provided by n01se.net