#clojure log - Apr 17 2012

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

0:05 wkmanire: A vector of vectors?

0:06 emezeske: wkmanire: [[11 12] [21 22]]

0:06 wkmanire: emezeske: He he he, I knew what you meant

0:07 emezeske: wkmanire: Oh!

0:07 wkmanire: I wasn't asking literally for you to explainwhat that is.

0:07 Validating columns and quadrants would be painful with a vector of vectors

0:08 emezeske: Painful?

0:09 ,(map #(get % 0) [[1 2] [3 4]])

0:09 There's a column

0:09 clojurebot: (1 3)

0:09 wkmanire: &(doc get)

0:09 lazybot: ⇒ "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

0:10 wkmanire: I see how that works.

0:10 emezeske: I'm still taking my baby steps with clojure. The way I would have done that would been a whole lot uglier.

0:10 emezeske: wkmanire: ^_^

0:11 wkmanire: emezeske: Wanna golf some code back 'n forth on refheap?

0:11 emezeske: wkmanire: As for a quadrant, you might do something like ##(map #(subvec % 1 3) (subvec [[1 2 3 4] [5 6 7 8] [9 0 1 2] [3 4 5 6]] 0 2))

0:11 lazybot: ⇒ ([2 3] [6 7])

0:11 emezeske: wkmanire: Although I'm not sure that's the most succinct approach

0:12 wkmanire: A bit busy atm :)

0:12 wkmanire: &(doc subvec)

0:12 lazybot: ⇒ "([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done."

0:12 wkmanire: emezeske: Bummer, maybe another time.

0:13 I'm going to hack around on this and try to learn me sumthin' before I go to bed.

0:13 Thanks for the pointers.

0:14 emezeske: wkmanire: NP

0:14 technomancy: muhoo: the trampoline repl thing is a known bug; will be fixed in the next preview

0:16 emezeske: technomancy: Hey, I wonder if you might have insight into this:

0:16 technomancy: When I add [org.apache.maven.artifact/maven-artifact "3.0.4"] as a dependency in lein-cljsbuild, lein2 seems to blow up

0:16 technomancy: I assume that it's because of a version conflict

0:16 technomancy: emezeske: I think it might need a different version of plexus from pomegranate, but I couldn't say for sure

0:17 actually, maven 3.x should be compatible

0:17 what's the error?

0:17 emezeske: java.lang.NoSuchMethodError: org.codehaus.plexus.DefaultPlexusContainer.initialize

0:17 I don't really care what version of the JAR I use, I'm just using it to compare versions

0:17 technomancy: oh gross dependency injection

0:17 sorry, no idea

0:17 cemerick might know

0:17 emezeske: haha, thanks

0:18 technomancy: I can't even understand what dependency injection is, much less use it.

0:18 emezeske: Pain... I just want to call one function from the JAR :(

0:18 technomancy: every time I read about it, the words describing it just don't form coherent impressions in my mind.

0:18 which function?

0:18 method

0:18 emezeske: actually I was wrong about just calling a func

0:18 DefaultArtifactVersion.

0:19 TimMc: technomancy: I only know about DI from Java-land, where it basically consists of writing Java in XML syntax. /kills self

0:19 technomancy: emezeske: are you comparing two versions?

0:19 emezeske: technomancy: yes

0:19 technomancy: because I have a native Clojure function for that in leiningen.core.main

0:19 emezeske: technomancy: is it a public function?

0:19 technomancy: aye

0:19 wkmanire: technomancy: There is an older google tech talk "Clean Code Talks" that demonstrates one understanding of dependency injection.

0:19 emezeske: technomancy: thanks I'll just use that!

0:19 technomancy: emezeske: oh, it's marked ^:internal, but I should probably make it public

0:20 wkmanire: technomancy: The speaker was Misko Hevery.

0:20 technomancy: leiningen.core.main/version-satisfies?

0:20 emezeske: technomancy: nice

0:20 TimMc: Pretty sure dynamic vars take the place of a lot of dependency injection in Clojure.

0:20 emezeske: technomancy: I'm not familiar with internal; is that enforced?

0:20 technomancy: emezeske: not a bit; it's just documentation

0:20 wkmanire: But the examples were entirely imperative and he mostly cited the concept of requiring objects as arguments to your functions that you need to use

0:20 as opposed to having your functions take arguments and using them to create new object instances with them.

0:21 technomancy: wkmanire: I think you might need to understand crappy type systems for it to make sense?

0:21 emezeske: technomancy: Nice, I like that better than private ;)

0:21 technomancy: that's my theory

0:21 xeqi: heh, I had to write something similiar for pomegranate

0:21 re: version comparison

0:21 technomancy: xeqi: oh, I should use that then

0:21 is yours public? =)

0:22 xeqi: c.p.a/within?

0:22 I think

0:22 wkmanire: technomancy: Well, the concept works even with languages that have generally liked typed systems like Python.

0:22 technomancy: xeqi: cool

0:22 xeqi: well, it works on the coordinates, not the version specifically

0:22 technomancy: ah, sure

0:22 emezeske: best to go with that; mine might go away

0:23 emezeske: technomancy: thanks

0:23 Hmm, I don't know what "coordinates" means

0:23 * emezeske considers the "screw it, copy+paste" option

0:23 xeqi: [ring "1.0.2"] <- coordinate

0:24 technomancy: wkmanire: you can implement it in Ruby too, but you will be filled with regret years later if you do: http://weblog.jamisbuck.org/2007/7/29/net-ssh-revisited

0:24 emezeske: xeqi: Ah, the whole thing, I see

0:25 xeqi: are you just doing version comparisons?

0:25 emezeske: xeqi: yeah

0:25 wkmanire: technomancy: Yeah, with languages like Ruby an Python it is a lot easier to mock things.

0:25 and... I think the biggest draw of DI is testability.

0:25 emezeske: wkmanire: It's ridiculously easy to mock in clojure, see midje

0:26 wkmanire: No need go to the extremes you need to to in languages such as VB.net or Java.

0:26 emezeske: I still haven't written a unit test for Clojure.

0:26 xeqi: https://github.com/cemerick/pomegranate/blob/master/src/main/clojure/cemerick/pomegranate/aether.clj#L462

0:26 wkmanire: emezeske: I wrote my first Clojure app today, a number guessing game that uses the binary search algorithm

0:26 emezeske: wkmanire: I just started recently, I've been super impressed with midje

0:27 wkmanire: https://refheap.com/paste/2156

0:27 I really am just a wet-behind-the-ears clojure newb.

0:27 xeqi: could take just some of that if don't need full coordinates

0:27 emezeske: xeqi: thank you!

0:28 wkmanire: emezeske: I do want to start unit testing right out of the gate though. I waited about 10 years to start that habbit with imperative programming. That was a big mistake.

0:30 emezeske: wkmanire: Yeah, I hear you there

0:34 wkmanire: &(doc =>)

0:34 lazybot: java.lang.RuntimeException: Unable to resolve var: => in this context

0:35 wkmanire: emezeske: Did they modify the way the reader works in midge to make => meaningful?

0:35 Raynes: Why would they have to modify the reader?

0:35 emezeske: wkmanire: Nah, it's just a macro

0:35 wkmanire: Raynes: Cause I don't know how to ask the question gooder.

0:35 emezeske: wkmanire: Within the (fact ...) macro, you'll have to look at midje's documentation. It's a DSL.

0:36 wkmanire: okeydokey.

0:36 Raynes: emezeske: I'm lonely and you're the closest thing to a close friend who is around right now. You should give me hugs and stuff.

0:36 eggsby: hey, is there any way to get run-jetty to work in conjunction with an infinite loop in the same project?

0:36 or will one just block the other from ever happening

0:36 emezeske: Raynes: Doooon't be loonely

0:37 * emezeske bear hugs Raynes.

0:37 Raynes: wkmanire: Your double printlns in game-over can be a single println.

0:37 Not that it matters. Just noting.

0:37 <3

0:37 xeqi: emezeske: you can use {:join? false} to background jetty

0:37 err

0:37 eggsby: ^

0:37 eggsby: oh, thank you xeqi

0:38 Raynes: emezeske: I'm in West Hollywood alone in a tiny room and all of my friends are asleep.

0:38 wkmanire: Raynes: I realized that a bit earlier.

0:38 emezeske: Raynes: I read that to the tune of the fresh prince of bel air theme song

0:38 wkmanire: Raynes: I'm all ears for pointers though. I kind of feel like I wrote an imperative thing dressed in FP.

0:38 Raynes: emezeske: Appropriately. I'm like a stones throw from Bel-Air.

0:39 emezeske: Raynes: "On the REPL, is where I spent most of my days"

0:39 Raynes: o/

0:39 emezeske: "Chillin' out, relaxin, and maxin' all cool, just writin' some lambdas, inside where it's cool"

0:39 * wkmanire dies.

0:40 * wkmanire again.

0:40 emezeske: "When a couple of bugs, that were up to no good, started makin' trouble in the neighborhood"

0:40 wkmanire: emezeske: Ever laugh at a crappy joke and then feel guilty about it?

0:40 Raynes: wkmanire: https://refheap.com/paste/2156#L-38 You don't need this do.

0:40 emezeske: wkmanire: Never.

0:41 wkmanire: :D

0:41 Raynes: Or this one https://refheap.com/paste/2156#L-26

0:41 wkmanire: The code runs inside an implicit do.

0:41 So there can be multiple top-level expressions as if there were an explicit do there.

0:41 wkmanire: Raynes from the let from the defn?

0:42 Raynes: wkmanire: You're doing like (defn foo [] (do …)); you don't need to do that.

0:43 wkmanire: Raynes: Gotchya. I'll make a couple of edits. just a sec

0:44 Raynes: wkmanire: And the only reason you're getting tips is because you use my pastebin. If you pasted it on gist, you'd be dead to me right now. ;p

0:44 wkmanire: Raynes: For your information, I'm as proud of my number guesser as you are of your fancy pastebin.

0:44 Raynes: :p

0:45 wkmanire: Did you implement it with clojure?

0:45 emezeske: technomancy: I noticed in the lein2 preview changelog that "Stop using numeric exit codes for task failures."

0:45 technomancy: I have some hooks that pay attention to tasks returning 0 or 1. Will my hooks need to change?

0:45 Raynes: wkmanire: Sure did: https://github.com/Raynes/refheap

0:46 wkmanire: Raynes: I'm a web-dev by trade. My ultimate goal with clojure is to build a site FP style.

0:46 Raynes: wkmanire: refheap can always use some web-dev expertise. Particularly: we all suck at design.

0:46 wkmanire: I'm also really fond of Javascript, so I'm interested to see what working with ClojureScript is like.

0:46 emezeske: wkmanire: It's fun :)

0:46 wkmanire: I also suck at design. web-dev, not web-designer.

0:47 Raynes: Fair enough. :p

0:47 laurus: join #debian

0:47 eggsby: why does this return a null pointer exception? (while true (Thread/sleep 5000 (println 'hi')))

0:47 laurus: Sorry.

0:47 wkmanire: laurus: no.

0:47 Raynes: But yeah, javascript is an area where we lack too. I can learn it as I go, but I imagine real jsers could think of stuff to add.

0:48 wkmanire: Well, Since you're helping me I'd be happy to have a look if there is something in particular you'd like me to see.

0:49 Raynes: Nothing in particular. Just check out the issue tracker if you're ever looking for something to contribute to. I don't care if your code is perfect, so feel free to practice on stuff there and we can work through pull requests and stuff if you want.

0:49 wkmanire: Though to be honest, I don't have the foggiest idea of how to set up a dev environment for clojure for web stuff.

0:49 eggsby: wkmanire: lein

0:50 wkmanire: Raynes: Okeydokey.

0:50 Raynes: &(quot 10 2)

0:50 lazybot: ⇒ 5

0:50 Raynes: wkmanire: ^ Integer division. Simplifies your mid-point function.

0:51 wkmanire: quot is short for quotiant?

0:51 Raynes: Yessir.

0:51 wkmanire: how the hell do you spell that word.

0:51 Kwohshunt.

0:51 Raynes: quotient

0:51 a vs e

0:54 wkmanire: Raynes: Wow, your paste has real editing.

0:54 Raynes: Indeed.

0:54 wkmanire: Very much appreciated.

0:54 Raynes: :D

0:54 wkmanire: It irks me when I have to paste a new link to everyone every time i makea changed.

0:54 make a change*

0:54 There, I applied your advice and tested it in my terminal

0:55 seems to work with the undid do's.

0:55 Raynes: wkmanire: Looks good!

0:55 wkmanire: I forgot that do is part of let is part of defn.

0:56 xeqi: eggsby: your calling Thread.sleep(long, int)

0:56 prolly need to move a paren

0:57 * wkmanire peruses the issue tracker...

0:57 eggsby: ah

0:57 should I be using the 'future' macro for this?

0:58 wkmanire: Raynes: Gah, fixed height is a PITA. Issue #77. You guys are targeting only modern browsers right?

0:58 Considering that it is a developer a tool.

0:59 Raynes: wkmanire: Yeah, there are already a few things that preclude <IE8 support.

0:59 I don't care *at all* about IE though, even newer versions.

0:59 The answer to any IE problem is don't use IE>

0:59 xeqi: for this case (do (Thread/sleep 5000) (println "hi")) should work

1:01 Raynes: wkmanire: #77 is one solution to the problem. The problem with it is that when you paste something long, it throws you to the bottom of the page.

1:01 xeqi: future is for when you want to do something in the background

1:01 Raynes: Which makes sense and all, but the paste button is at the top of the page.

1:01 xeqi: not for rate limiting like you're doing here

1:01 Raynes: I'd personally just rather make it grow. I think autodidakto was looking at using media queries.

1:02 eggsby: hmm, xeqi, how would I achieve something like this? https://refheap.com/paste/2171

1:02 In that example, run-jetty never seems to happen (i.e. requests get dropped)

1:03 oops should have been defn

1:03 oh nvm

1:03 * Raynes goes and watches random stuff on netflix.

1:03 wkmanire: Raynes: I'll go ahead and clone the repo.

1:03 eggsby: yaaaay it works

1:04 thank you very much xeqi

1:04 xeqi: np

1:06 wkmanire: Raynes: I'm really seeing minimal JS here.

1:12 Raynes: I see you are using codemirror as your code editor. So fixing the full height + middle click paste issue means reading through that project's code.

1:20 goodnight folks.

1:21 spoon16: if I want to use the clojurescript repl capability to connect a brower instance back to my listening repl… do I have to have the repl connect command execute from an iframe served from localhost?

1:23 muhoo: technomancy: thanks. i'd be happy to help with it, if i can, but it seems it may be beyond me.

1:23 but i'm motivated since i work on low-memory, anemic-cpu netbooks, so trampoline is good

1:25 afoolsuchasi: there is a jar installed on my system at /opt/sphinx4/lib/sphinx.jar. I cannot seem to get this into my classpath for a slime repl started with clojure-jack-in. anyone know what i should be looking for for managing generic classpaths?

1:35 muhoo: afoolsuchasi: lein-localrepo

1:36 specifically https://github.com/kumarshantanu/lein-localrepo

1:38 afoolsuchasi: thx. checking it out

1:46 emezeske: spoon16: I don't think you want to use an iframe

1:46 spoon16: Or are you trying to do something like have the REPL run somewhere other than the web server itself?

1:47 ibdknox: cross host won't work there

1:47 emezeske: ibdknox: Yeah

1:47 ibdknox: Wouldn't an iframe run in a different javascript context?

1:47 ibdknox: yep

1:48 damn browsers and their security features ;)

1:48 emezeske: ^_^

1:49 ivan: you can send messages across domains

1:49 emezeske: reverse SSH tunnel, anyone?

1:49 ibdknox: ivan: yeah, but the JS would be locked into the iframe

1:49 so it wouldn't be meaningful

1:49 and if the iframe is in a different domain the host frame can't grab its content

1:50 the real problems isn't the frame it's getting the stuff in and out of it :(

1:51 emezeske: we should just implement the repl over websockets

1:51 problem solved.

1:51 that's how brepl worked

1:52 granted it used my socket.io implementation which is like shooting a fly with a nuclear bomb

1:53 emezeske: ibdknox: by which you mean "highly effective?"

1:53 :)

1:53 ibdknox: haha

1:57 emezeske: Does anyone have lein-midje working with Leiningen 2?

1:59 afoolsuchasi: sry, still trying to come to terms with clojure/lein build system. trying to install plugin localrepo, breaking with "cant find cemerick/pomegranate/aether.clj on classpath" i see aether in lein search but it doesnt seem to want to install, plugin, or dependency in my project. what do i need to do to satisfy that?

2:00 or rather, installed localrepo, trying to run and it breaks

2:00 aether is :required in the main ns of the localrepo project

2:05 xeqi: afoolsuchasi: what does `lein version` output?

2:06 afoolsuchasi: Leiningen 1.7.0 on Java 1.7.0_147-icedtea OpenJDK 64-Bit Server VM

2:06 xeqi: what version of localrepo are you using?

2:09 afoolsuchasi: 1.13.1

2:09 sorry

2:09 that was the aether

2:09 was using 0.4.0

2:10 emezeske: drewr: Give lein-cljsbuild 0.1.8 a shot, to see if it fixes your lein2 problem

2:10 xeqi: lein 1.7 needs localrepo 0.3

2:10 afoolsuchasi: oh fiddlesticks. i was thinking i had already gotten 2

2:10 that didnt even click

2:10 thanks

2:11 xeqi: might need to rm 0.4 from ~/.lein/plugins depending on how you were using it

2:15 afoolsuchasi: well localrepo now works. on with the quest. thanks.

2:16 i sense it is time to retire before i further shame my ancestors here. peace.

2:35 ibdknox: seriously.. node still doesn't have hot code reloading?

2:35 I'm way to used to Clojure lol

2:35 too*

2:51 seancorfield: amalloy_: yes, i figureed another thread was needed after i posed that Q (and i'd already suggested the queue for buffering) - glad i'm not insane :)

2:52 ibdknox: we finally decided to put swank servers in all our long-running processes so we could do hot code reloading :)

2:52 ibdknox: :)

3:13 spoon16: emezeske: I'm just messing around, but I'm trying to serve a site from a remote server to my browser and then in a separate window on the local machine connect a repl to the browser window. So yes, run the repl somewhere besides the server serving the HTTP requests.

3:16 emezeske: spoon16: A separate browser window?

3:18 mrnex2010: spoon16: are you using compojure?

3:19 (im doing some compojure and i just found how to do that there

3:24 spoon16: a console repl

3:24 I want the js on the website to execute and connect to "localhost:9000/repl"

3:25 and then for my local repl to be able to pipe clojure -> javascript and execute it in the browser

3:25 mrnex2010: cool, what are you doing it for?

3:25 spoon16: for fun right now

3:25 no real reason

3:25 have to sleep now though

3:25 will mess around more tomorrow

3:26 mrnex2010: cool bye

3:29 emezeske: spoon16: So you know that with an iframe or whatever, the REPL is not going to be able to affect your site, right?

3:29 spoon16: It will only affect the context of that iframe

3:30 spoon16: The browser REPL simply has to connect to the server the page was loaded from

3:30 spoon16: If you really want to run the REPL on your local machine, I suggest setting up your webserver to proxy /repl

3:31 Doh, spoon16 is gone.

3:44 kral: morning

5:28 xumingmingv: is there a btrace kind of thing for clojure? http://kenai.com/projects/btrace

5:30 clgv: xumingmingv: there is org.clojure/tools.trace - you can check the feature set on github

5:32 TheBusby: ,(map clojure.string/trim [" a " "b" nil "d "])

5:32 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NullPointerException>

5:33 clgv: ,(map (fnil clojure.string/trim "") [" a " "b" nil "d "])

5:33 clojurebot: ("a" "b" "" "d")

5:33 xumingmingv: clgv: thanks!

5:33 TheBusby: clgv: thanks!

6:26 tomoj: ratios have no place in production, because doing a harmonic series with ratios is slow. oi

7:02 michaelr525: hi

7:02 tried building the latest enlive from github

7:02 leiningen can't find clojure-1.4.0

7:03 so where can I find it?

7:04 clgv: michaelr525: 1.4.0 is not released yet. so you probably haveo use something like 1.4.0-betaX with X being the latest number

7:05 michaelr525: hey clgv

7:05 i can't the clojure jar on http://build.clojure.org

7:05 clgv: michaelr525: humm well, on search.maven.org there is a clojure-1.4.0

7:05 michaelr525: ah.. let's

7:05 see

7:06 vijaykiran: I think 1.4 is in maven somewhere, my lein pulled it yesterday

7:07 clgv: strange that there is no announcement on clojure.org or the ML

7:07 babilen: 1.4.0 has been released?

7:08 Yeah, 1.4.0 is on maven.org :-/ -- I am surprised that I missed that.

7:09 clgv: silent release? :P

7:09 babilen: Nothing on http://www.clojure.org as well

7:10 michaelr525: thanks clgv.. have to run now otherwise I would have asked why leiningen didn't find it. It said it was searching repo1.maven.org

7:11 clgv: michaelr525: you got [org.clojure/clojure 1.4.0] in the project.clj?

7:12 michaelr525: nope, i've got this [org.clojure/clojure "[1.2.0,)"] - it's from https://github.com/cgrand/enlive/blob/master/project.clj

7:13 using the stable leiningen version

7:13 babilen: michaelr525: I've just downloaded it from repo1.maven.org (1.4.0 that is) -- https://refheap.com/paste/2176

7:13 clgv: ah ok

7:13 babilen: (lein2)

7:14 michaelr525: gotta run :)

7:14 bye

7:14 clgv: lein 1.7.1 works as well

7:38 clojure 1.4.0: http://corfield.org/blog/post.cfm/clojure-1-4-0-clj-time-congomongo

8:28 tomoj: what's an elegant way to do (f [:foo :bar :baz]) == '([:foo (:bar :baz)] [:bar (:foo :baz)] [:baz (:foo :bar)])

8:29 right now I am iterating over indices and calling split-at

8:36 clgv: tomoj: ##(letfn [(f [coll] (for [a coll] [a (remove #{a} coll)]))] (f [:foo :bar :baz]))

8:36 lazybot: ⇒ ([:foo (:bar :baz)] [:bar (:foo :baz)] [:baz (:foo :bar)])

8:36 tomoj: I should have picked a better example

8:37 (f [:foo :bar :baz :foo]) == '([:foo (:bar :baz :foo)] [:bar (:foo :baz :foo)] [:baz (:foo :bar :foo)] [:foo (:foo :bar :baz)])

8:37 clgv: ##(letfn [(f [coll] (for [a coll] [a (remove #{a} coll)]))] (f [:foo :bar :baz :foo]))

8:37 lazybot: ⇒ ([:foo (:bar :baz)] [:bar (:foo :baz :foo)] [:baz (:foo :bar :foo)] [:foo (:bar :baz)])

8:37 angerman: ,(char 0x4)

8:37 clojurebot: \

8:38 clgv: oh well. than you probably need the index iteration

8:38 or you can try a lazy-seq approach

8:40 tomoj: lazy-seq where the function keeps track of prefix-coll and rest-coll and thus builds what you want

8:40 angerman: ,(clojure.string/replace (list \a \b \c (char 0x4) \d) (char 0x4) "")

8:40 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character>

8:41 angerman: ,(clojure.string/replace (list \a \b \c (char 0x4) \d) (char 0x4) \space)

8:41 clojurebot: "(\\a \\b \\c \\ \\d)"

8:41 llasram: tomoj: Is the input always going to be a vector?

8:44 tomoj: yes

8:44 (fn ctx [less [x & more]] (lazy-seq (when x (cons [x (concat less more)] (ctx (conj less x) more)))))

8:44 (e.g. (ctx [] [:foo :bar :baz]))

8:46 also the input never has more than 5 elements in it...

8:47 clgv: good idea

8:58 Kototama: hi, where can i find the slime version compatible with lein swank?

8:59 i would like to have the latest slime contrib files compatible with clojure

8:59 llasram: Kototama: swank Clojure includes a/the compatible version of SLIME

9:00 If you're just using SLIME with Clojure, you can just use clojue-mode's clojure-jack-in and be done

9:00 Kototama: ok but how can i get slime-fuzzy slime-c-p-c.el etc?

9:01 llasram: Hmm. This question I cannot answer

9:01 You can look at the version of SLIME bundled in swank-clojure and find the associated compatible versions?

9:11 Kototama: ok seems the frozen version is the one from technomancy

9:12 babilen: Kototama:

9:13 Kototama: All you have to do is to install clojure-mode and the swank-clojure leiningen plugin. See https://github.com/technomancy/swank-clojure for details

9:14 Kototama: no actually i need a bit more, i need to have the slime contribs working to have anything-slime working too

9:14 it looks like the slime bundled xith swank clojure provides slime-repl but no more

9:14 babilen: Kototama: Shouldn't be a problem to install that with package.el

9:15 Kototama: most of the contribs are not on it :s

9:16 babilen: Kototama: What about marmalade? How do *you* install it? (We venture into #emacs territory though)

9:17 Kototama: it's the same for marmalade most of the slime contribs are not on it

9:17 i used to just use swank-clojure from package.el

9:18 but this time i downloaded the slime and the contribs from the technomancy github

9:18 just to have slime fuzzy slime-c-p-c etc

9:18 angerman: ,(cons nil '(10 12))

9:18 clojurebot: (nil 10 12)

9:19 Kototama: it's really nice, you get a anything-slime-repl-history with anything-slime

9:19 it acts like a filtered history on all your previous inputs

9:19 way better than the default

9:22 gfredericks: I'm trying to debug my "That's not a task" message I get from M-x clojure-jack-in

9:23 my .lein/profiles.clj is '{:user {:plugins [[lein-swank "1.4.4"]]}}'

9:23 and I just ran `lein upgrade`

9:23 I'm not sure what else is necessary

9:25 well I guess it's `lein repl` for now

9:33 Kototama: what happens if you call 'lein swank' from the shell?

9:33 llasram: gfredericks: `lein version` output?

9:34 gfredericks: llasram: Leiningen 1.7.1 on Java 1.6.0_26 Java HotSpot(TM) Client VM

9:35 llasram: gfredericks: Ah, there you go. Profiles aren't backported to lein 1.x. Need to either use the lein 2.0 preview release or `lein plugin install` the plugin

9:36 gfredericks: the swank-clojure docs say that only applies to pre-1.6.2 :(

9:37 llasram: gfredericks: I believe at that point 1.6.2 was intended to be the last 1.x release, but there were some bugs which led to 1.7

9:37 s,at that point,when those docs were last updated,

9:38 babilen: gfredericks: The README is outdated. It actually appliad to every 1.x release (of which 1.7.1 is the latest)

9:38 *applies

9:40 gfredericks: llasram: that does fix it; thanks

9:55 flashingpumpkin: guys, what would you recommend to work with websockets?

10:01 jedahu: what's the correct way to write this macro? http://dev.clojure.org/jira/browse/CLJ-869

10:02 fliebel: jedahu: let a normal gensym, and insert that.

10:03 (let [a (gensym)] `(foo ~a)) or something like that

10:04 &(let [a (gensym)] `(foo ~a))

10:04 lazybot: ⇒ (clojure.core/foo G__7487)

10:04 jedahu: fliebel: thanks, sorted :-)

10:26 tomoj: how do you typehint a primitive array in 1.3?

10:27 dnolen: tomoj: ^doubles ^longs etc

10:28 tomoj: hmm

10:28 with ^bytes I get "java.lang.IllegalArgumentException: Unable to resolve classname: clojure.core$bytes@1fc5681"

10:29 dnolen: tomoj: I not sure if there is support for ^bytes

10:30 ,(class (make-array Type/BYTE 0))

10:30 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: Type, compiling:(NO_SOURCE_PATH:0)>

10:30 dnolen: ,(class (make-array Byte/TYPE 0))

10:30 clojurebot: [B

10:30 dnolen: ^"[B"

10:30 tomoj: ^ should work as well.

10:31 tomoj: yeah, that's what I've got. I feel like #^bytes used to work?

10:32 gfredericks: has anybody used the aleph http client to send post requests with data?

10:33 dnolen: tomoj: I don't remember that, but even referencing that syntax - #^bytes - ancient history.

10:41 dgrnbrg: dnolen: what is your talk going to be on tomorrow? I follow all your postings to the mailing list carefully, and i'm trying to decide between your talk and another one-time-only event

10:42 tomoj: gfredericks: some, yeah

10:42 RickInGA: dgrnbrg: what list?

10:43 dgrnbrg: the main clojure list

10:43 gfredericks: tomoj: I don't see any documentation on it -- does it only accept channels of byte-arrays as the body?

10:43 tomoj: certainly strings don't seem to work

10:43 tomoj: strings work here

10:44 gfredericks: hrrrrm

10:44 tomoj: also e.g. vectors/maps with :content-type "application/json" and :auto-transform true

10:44 gfredericks: I'm probably going to use channels, but I'm having odd hard-to-debug trouble and so I'm just trying to get a feel for what's expected

10:45 tomoj: what version of aleph/lamina?

10:45 jtoy: http://www.niclas-meier.de/2012/04/first-hundred-days-of-clojure/

10:45 tomoj: aleph 0.2.1-beta2

10:46 gfredericks: me too; I get the hugest stack trace if I pass in a string :/

10:46 cmajor7: when is "clojure east" (in New York)?

10:46 gfredericks: I'm just running against a compojure server I setup for testing this

10:46 tomoj: the stack trace is from the client though?

10:47 gfredericks: tomoj: that is difficult to discern since I have them running in the same process. Time to split them up I guess! hadn't thought of that

10:48 tomoj: well, is the stack trace about aleph http client stuff or compojure stuff?

10:48 gfredericks: oh definitely aleph

10:48 lotta lamina and netty and such

10:49 I think it's a timeout exception; I set a 1200 ms timeout on the request

10:50 tomoj: so your server just isn't responding?

10:50 jtoy: how do I return the first line from a slurp? (first (slurp "file")) seems to return the first character

10:50 gfredericks: tomoj: well it certainly responds if I use a channel instead

10:50 I guess I could log from the server to check

10:50 tomoj: jtoy: (with-open [r (clojure.java.io/reader "file")] (first (line-seq file)))

10:51 if you use a channel the request is chunked

10:51 dunno why that should make the server not respond

10:51 I'd just test the client against `nc -l 8080`

10:51 jtoy: i see, why can't I use slurp for that though?

10:52 rhc: you could always slurp - string/split "\n"

10:52 tomoj: you can, but it doesn't make much sense

10:52 ...if you only want the first line

10:53 interestingly, the aleph client seems to spit out chunk lengths in hexadecimal when :auto-transform is true

10:53 oh, no it always does that :)

10:53 gfredericks: tomoj: I did not know about `nc`; this sounds useful

10:55 tomoj: it will let you just see the raw http request aleph is producing

10:55 gfredericks: right

10:57 tomoj: when running with channel it outputs predictably; when running with string it prints nothing

10:57 but the result channel responds to me shutting down nc (by enqueueing nil)

10:57 so it's as if it opens the tcp connection and then waits

10:57 I'm doing this from the repl, where oddly I see no stacktrace at all

10:58 TimMc: Man, would it have killed Rich to make PersistentHashMap generic?

10:58 mdeboard: Yes

10:58 TimMc: I really want to use it from a Java project...

10:58 mdeboard: There is a bomb in his brain

10:58 Set to go off if he makes it generic

10:58 tomoj: gfredericks: strange.. works here

10:58 ((http/http-client {:url url :method :post}) {:body "foo"}) ?

10:59 gfredericks: uh

10:59 I'm using http-request

10:59 tomoj: yeah, worked for me there too

10:59 gfredericks: I'll try yours

11:00 tomoj: yeah same behavior there

11:00 alright this is uberweird; I'll startup a fresh project on a fresh VM and see if it does the same thing

11:01 tomoj: 0.2.1-beta2, right? I'm on clojure 1.3 as well, don't think it should matter

11:01 gfredericks: tomoj: same for both

11:01 tomoj: jvm?

11:02 tomoj: sun 1.6.0_30

11:02 gfredericks: Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

11:02 Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

11:02 tomoj: (http/http-request {:url "http://localhost:8083/&quot; :method :post :body "foo"}) doesn't print anything?

11:03 gfredericks: tomoj: it returns the channel that sits there waiting

11:03 tomoj: be sure to try a new port

11:03 it returns a result channel, right?

11:03 gfredericks: yeah

11:03 one sec I'll try new port

11:03 tomoj: that's to be expected, but nothing in nc?

11:03 gfredericks: correct

11:03 the result channel waits until I close nc, then it gets nil

11:04 tomoj: so it must be connecting, but it's not writing anything at all..

11:04 gfredericks: right

11:05 tomoj: baffling

11:05 gfredericks: tomoj: well at least you've helped me isolate the issue much more than I had on my own

11:11 tomoj: extracted test https://gist.github.com/a552a8f82180e6d27f51

11:14 gfredericks: tomoj: sweet I was just doing something like that

11:15 tomoj: I like the version 0.1.0 part :) does lein default to that for you?

11:17 tomoj: it defaulted to 0.1.0-SNAPSHOT

11:17 I think

11:17 or maybe I just still habitually change 1.0.0 to 0.1.0

11:18 gfredericks: tomoj: ooh, this seems to work fine; the plot is thickening

11:18 sweet, I'll do a binary search between these two setups to figure out wtf.

11:18 tomoj: much thx

11:19 tomoj: random guess: do you have aleph jars in both lib and lib/dev?

11:19 that would be odd

11:19 gfredericks: nope

11:20 lib has aleph-0.2.1-beta2.jar at top level

11:20 tomoj: no clue what could cause that then

11:21 gfredericks: tomoj: I'll let you know what I figure out

11:25 michaelbarton: I'm getting java.lang.OutOfMemoryError errors for this code: https://gist.github.com/2406699

11:25 I thought it was lazy but perhaps not?

11:26 gfredericks: michaelbarton: well (apply str ...) definitely isn't lazy

11:26 woah wait you're just printing a function

11:26 never mind

11:27 dnolen: michaelbarton: you're story a lazy sequence in a top level.

11:27 michaelbarton: That bit should only be a three entry seq

11:27 dnolen: storing

11:27 michaelbarton: line 20

11:27 jonasen: how about that for something for kibit to catch? :)

11:28 gfredericks: michaelbarton: so due to what dnolen just said, there's a global reference to the head of the seq

11:28 so as the seq is realized the whole thing stays in memory

11:28 michaelbarton: I see

11:28 What's the correct way to do this?

11:28 gfredericks: you could change normalized-edges to a function and call it inside your doseq

11:28 dnolen: michaelbarton: what gfredericks said.

11:29 michaelbarton: OK

11:29 I there a way to reference a sequence with holding the head? A function I suppose?

11:30 Sorry, I meant without.

11:30 gfredericks: (doseq [i (normalized-edges)] ...) will do it

11:30 dnolen: michaelbarton: don't store it in a top level.

11:31 michaelbarton: How does does putting normalised edges inside parenthesis change this?

11:31 gfredericks: michaelbarton: you have to change normalized-edges to a function as well to match

11:31 michaelbarton: OK

11:32 fliebel: Would a memory-less lazy-seq be any good? You know, just calculate the next item every time it is requested.

11:32 michaelbarton: (defn normalised-edges [] ... )

11:32 gfredericks: since the global var is now a function that returns the sequence, there's no global reference to it. You call the function and give the resulting seq to doseq, so you as the user have no references to it

11:32 michaelbarton: OK

11:32 gfredericks: fliebel: that sounds like clojure.org/streams

11:32 michaelbarton: That's very helpful.

11:32 gfredericks: which I coincidentally saw for the first time yesterday

11:32 michaelbarton: Thank you.

11:32 fliebel: gfredericks: I wouldn;t know. I'm going to look at them for sure.

11:33 gfredericks: fliebel: it's old history; I don't know why exactly though

11:35 fliebel: in any case what you're describing isn't really a lazy seq

11:35 it may as well be a function

11:36 otherwise it's pretending to be a data structure but somehow disappears from under you

11:37 fliebel: gfredericks: Hm, yea, what I have in mind would only work for generated lazy seqs, but not for 'consumed' ones(line-seq for example)

11:38 What i mean is that you do not "realize" a seq, but calculate the crd/rest of a seq every time it is requested.

11:38 gfredericks: fliebel: so if the cdr is requested a second time you compute it again?

11:39 fliebel: yea, so you can hold on to the head all you want, without consuming memory, and iterate without any overhead. Only, the second time you need to iterate it is more expensive.

11:40 michaelbarton: That worked perfectly.

11:40 gfredericks: that is an interesting thought.

11:40 michaelbarton: An much faster too.

11:40 Thank you gfredericks, dnolen

11:40 fliebel: It is just the cached reference to the next value, that keeps the seq from being gcd.

11:40 gfredericks: tomoj: I inserted your code into my project and it failed. I deleted some deps and otherwise made no changes and it passed. So now to figure out which dep is the tipping point.

11:41 devn: dnolen: have you seen the bill cunningham documentary?

11:41 dnolen: devn: no

11:41 michaelbarton: np

11:42 devn: dnolen: total tangent, but he's a photographer at the NYT -- he does the style/fashion on the street photography. it was interesting, figured I'd mention it given you're around here.

11:42 dnolen: devn: yes, I know :) but I haven't seen it.

11:43 devn: haha fair enough, just watched it the other night. it was good. </tangent>

11:45 gfredericks: tomoj: it seems to be [clj-http "0.3.6"], which I don't need thankfully

11:46 dnolen: devn: yeah I've heard it's great!

11:47 tomoj: strange

11:48 gfredericks: tomoj: I expect examining the recursive dependency tree would reveal something, but I'm not motivated to bother if nothing else comes up

11:48 dabd: Does the clojurescript compiler support the full Clojure language at the moment?

11:48 tomoj: I was wondering earlier how to even see the recursive dependency tree (other than manually)

11:48 gfredericks: dabd: certainly not the parts that don't apply well/at-all to JS

11:48 dabd: there are significant differences

11:48 tomoj: mvn dependency:tree I think

11:49 (after `lein pom`)

11:50 dnolen: dabd: the bits that are missing are mostly concurrency related - which are mostly irrelevant for JS.

11:50 dabd: Is it possible to invoke Clojure from clojurescript?

11:52 gfredericks: dabd: at runtime all you have is the JS environment

11:53 dabd: If I need to do processor intensive computation then I would need a server hosting JVM to run Clojure

11:54 gfredericks: embedding a java applet might be an option too

11:54 dnolen: dabd: why would you want to invoke Clojure from CJLS?

11:54 gfredericks: so whichever is less of a hassle I guess

11:54 dnolen: CLJS

11:55 dabd: dnolen: If I need to use existing Clojure code as a "service"

11:55 because it is processor intensive

11:56 tomoj: I'd think you should invoke it just like you would invoke any other service from a JS environment

11:56 dabd: tomoj: In that case perhaps AJAX is better than applets right?

11:57 I meant Web Services instead of AJAX

11:57 angerman_: how do you do DB switching on dev and production env? using environment variables?

11:57 dnolen: dabd: writing your client code in CLJS and your server in CLJ is an ideal use case yes if that's what you mean.

11:57 tomoj: you'd have to have a pretty strange use case to want to embed clojure in an applet instead of talking to it over ajax/whatever

11:57 dabd: dnolen: yes that is exactly what I want. I want to write UI for existing Clojure code.

11:58 ClojureScript One seems interesting

11:59 gfredericks: I was reading the CLJS docs and it shows the differences. thx

11:59 tomoj: will many calls to reify hog permgen?

12:00 gfredericks: tomoj: turns out aleph wants clj-http 0.1.3

12:00 tomoj: ah, I see

12:00 dakrone: gfredericks: waa? why is aleph using clj-http at all in the first place, that seems strange

12:00 dnolen: dabd: yes, people have been doing this.

12:01 dakrone: I thought it had its own http client

12:01 gfredericks: I haven't noticed it in the stacktrace; who knows what it's using it for

12:01 there's a lot of helpers in clj-http I think

12:01 dakrone: what version of aleph? I'll look

12:02 dabd: I was reading this blog http://blog.raynes.me/. Did anyone also switch from Emacs to VIM. I'm a long time Emacs user but sometimes I find it too cumbersome and heavy. VIM seems neater but I'm not sure it is as good for Lisp languages.

12:02 gfredericks: dakrone: 0.2.1-beta2; it's not a big deal for me personally at the moment

12:02 dakrone: gfredericks: yea, I'm interested now though

12:02 gfredericks: I'm using clj-http in my tests, but I can look up how to use the older version

12:03 dakrone: 0.1.3 is ancient by now :-/

12:04 rads: dabd: I used to use Emacs and switched to Vim

12:04 I didn't really use clojure until I learned vim though

12:04 TimMc: tomoj: "Reify Hog Permgen" scans like a person's name :-D

12:05 gfredericks: dakrone: aleph totally breaks with newer clj-http though

12:05 dakrone: gfredericks: I am forking to fix

12:05 gfredericks: and I use the word "totally" very very loosely there

12:06 dakrone: here's what breaks when using 0.3.6: https://gist.github.com/a552a8f82180e6d27f51

12:06 dakrone: okay, shouldn't be too bad to fix

12:08 rads: dabd: the repl support isn't great. I use a macro to send the selected contents to a tmux buffer rather than the vimclojure repl. I like vim better in general, though. I prefer the modal editing to the keyboard shortcuts

12:09 gfredericks: dakrone: if you're working on it right now, keep me posted, so I know whether to backport to 0.1.whatsit or upgrade aleph

12:11 dakrone: gfredericks: I will

12:19 gfredericks: https://github.com/ztellman/aleph/pull/60

12:21 gfredericks: dakrone: cool I'll try that out, thanks

12:22 dakrone: hopefully Zach merges it too :)

12:22 gfredericks: until then we have lein checkouts

12:23 and clojars

12:23 dabd: rads: I might give it a try

12:23 but it will be hard to leave more than 10 years of emacs behind :-)

12:26 dnolen: ~max

12:26 clojurebot: Most users ever in #clojure: 404

12:27 dnolen: bah, we'll break 500 here soon

12:27 gfredericks: dnolen: you sure clojurebot didn't just deliver a not-found response? :)

12:34 pandeiro: dnolen: have you noticed multimethod dispatch errors in cljs don't tell you which multimethod they're referring to?

12:35 i'm going to try to track that down and leave a bug report but i am just mentioning it in case it's already been fixed (i'm using the latest jar)

12:36 dnolen: pandeiro: haven't noticed, patch welcome ;)

12:39 TimMc: dnolen: That's a hardcoded factoid.

12:40 clojurebot: forget max |is|<reply>Most users ever in #clojure: 404

12:40 clojurebot: I forgot that max is <reply>Most users ever in #clojure: 404

12:40 TimMc: ~max

12:40 clojurebot: Excuse me?

12:41 TimMc: clojurebot: max is <reply>Neither bot has an accurate value for the max number of users in #clojure

12:41 clojurebot: Ok.

12:45 gfredericks: TimMc: you could've replaced it with a more interesting number :)

12:45 TimMc: 404 was the best it could be.

12:46 gfredericks: it could be good but also not believable

12:48 ibdknox: next time someone comes into the channel asking for a simple project to help the community we should have them add the max command to lazy bot

12:57 autodidakto: ,(#(apply str (reduce conj () %)) "pey")

12:57 clojurebot: "yep"

13:07 mebaran151: so I'm having a little bit of trouble installing the lein noir plugin to start playing with noir; it complains about being unable to rebind a dynamic var

13:08 unlink_: Every time I run "lein ring server" on leiningen-1.7.1, it deletes my lein javac-compiled classes.

13:08 Is that a feature?

13:08 mebaran151: any work around? I'm on Windows running a lein 1.7

13:09 pandeiro: mebaran151: sounds like an old version of noir?

13:09 mebaran151: is the plugin no longer recommended?

13:09 I haven't gotten to the whole using noir part yet :)

13:11 though it looks so nice and clean and pretty; I'm in tooling purgatory atm

13:11 rodnaph: when using update-in to change a map, is there any way i get get hold of the change that was made to the map? (i need to put it in a datastore)

13:11 pandeiro: mebaran151: tbh i'm not sure its status, check the github page... i think cljs-template uses a very recent version of noir, though maybe you don't want the clojurescript parts

13:12 raek: mebaran151: are you using lein-noir 1.2.0? are you sure you are not using lein2?

13:13 mebaran151: I do not believe I'm using lein2

13:15 pandeiro: mebaran151: if i were you i'd just go the lein-newnew + cljs-template route

13:16 raek: mebaran151: what step goes wrong? "lein plugin install ..."? "lein noir new ..."? a later step?

13:16 "unable to rebind a dynamic var" often indicates that code written for clojure 1.2 is being run in clojure 1.3 or later

13:17 but all lein 1.x plugins execute in the lein process, which uses clojure 1.2

13:17 (lein2 uses clojure 1.3)

13:18 gfredericks: does paredit have a command for cleaning up whitespace?

13:19 dakrone: gfredericks: emacs does, C-c n

13:19 mebaran151: raek: it's the lein plugin install step

13:19 it sounds like I should just reinstall lein, as somehow some something got crossed

13:20 raek: mebaran151: what does "lein version" output?

13:20 gfredericks: dakrone: crap I rebound that

13:21 mebaran151: Leinigen Version 1.7.1-SNAPSHOT

13:27 autodidakto: gfredericks: C-h a whitespace cleanup

13:28 mebaran151: raek: on Java 7, though I doubt that would matter

13:28 gfredericks: autodidakto: I rebound C-h too :-D

13:29 autodidakto: gfredericks: to what?

13:29 gfredericks: backspace

13:29 but F1 works

13:30 in any case, whitespace-cleanup doesn't seem to de anything for my " (three four)\n ))" chunk of code

13:30 (I want the last two parens to come up a line)

13:30 autodidakto: reindent?

13:30 gfredericks: how?

13:30 clojurebot: with style and grace

13:31 dakrone: gfredericks: whitespace cleanup won't touch that, you'll have to move it up yourself

13:31 gfredericks: oh man I thought paredit was cool about these things

13:31 dakrone: there might be a way to make it do that? no idea

13:31 gfredericks: okay, thanks

13:31 * gfredericks abandons 3 months of effort and switches back to vim

13:32 autodidakto: oh... come up a line... sorry that's not indent

13:32 gfredericks: okay how do I make org-mode work on vim?

13:32 autodidakto: gfredericks: you do, "electric returns" ? C-style )s, then reformat?

13:32 * gfredericks is just kidding

13:32 gfredericks: autodidakto: man I don't really know what any of those things are

13:33 autodidakto: i think that's what it is called... there's a plugin for that... er... *grabs gfredericks and walks to #emacs*

13:33 * gfredericks /j #emacs

13:33 bradwright: gfredericks: mark all of it and do M-x indent-region

13:33 I think

13:34 gfredericks: bradwright: doesn't that keep everything on its own line?

13:34 bradwright: Yeah actually it does, sorry

13:46 gfredericks: can clj-http be configured to not send retries?

13:46 dakrone: gfredericks: you mean for redirects?

13:46 gfredericks: dakrone: no I'm sending a post with a multipart and it seems it's being sent 3 times before giving up (server failed to respond)

13:47 org.apache.http is logging its retries

13:47 dakrone: gfredericks: I'm not doing any retrying on my end, so apache must be trying the multipart stuff, open an issue with info and I can look into it

13:47 gfredericks: dakrone: okay, thanks

13:48 dakrone: gfredericks: good to know that it does that, I'm sure there's a way I can make that configurable

13:49 mebaran151: raek: reinstalling lein seemed to do the trick; I'm not sure how it got all vesion confused

13:50 gfredericks: dakrone: done

13:50 dakrone: gfredericks: thanks!

14:32 dnolen: somebody should really do this for CLJS, http://synonym.dartlang.org/

14:36 aaelony: I'm confused as which clojars dependenc(y/ies) I need to start playing with cljs. Say I'm on clojars, the first hit seeking "clojurescript" is lein-cljsbuild 0.1.8, is that what I need?

14:37 dnolen: aaelony: lein-cljsbuild is all you need yes.

14:37 aaelony: dnolen: thx

14:38 ibdknox: I forgot how much I disliked node's ecosystem :(

14:39 aaelony: dnolen: guessing that lein-cljsbuild is lein and not lein2 ?

14:39 dnolen: aaelony: works w/ both

14:39 ibdknox: what issues are you running into?

14:39 aaelony: dnolen: tres cool... !

14:40 devn: dnolen: it reminds me a bit of coffeescript's website

14:40 ibdknox: dnolen: I lost an hour and a half to broken versions of big libs (socket.io and express latest don't play well together)

14:41 samrat: I'm having trouble installing lein. I did lein self-install but after that I get this error http://dpaste.com/733207/ when trying to run lein

14:42 how can i fix this?

14:42 hiredman: ibdknox: but JS is the future!!! the same language on the front and backend! and callbacks!

14:42 dnolen: devn: yes I think that was the idea

14:42 ibdknox: hiredman: lol

14:42 dnolen: ibdknox: heh - yeah

14:42 ibdknox: dnolen: I think I found a bug in CLJS

14:43 dnolen: ibdknox: wassup?

14:43 ibdknox: dnolen: any method with the name static gets a $ appended to it. Including ones that aren't cljs :)

14:43 xeqi: samrat: can you remove that file, and your ~/.lein and re self-install?

14:43 ibdknox: so expres.static is getting turned into express.static$

14:44 dnolen: ibdknox: are you writing js/express.static ?

14:45 ibdknox: dnolen: https://refheap.com/paste/2185

14:45 dnolen: perhaps I'm doing it wrong?

14:46 septomin_: don't all js keywords get munged?

14:47 samrat: xeqi: okay, i'm doing that now

14:48 dnolen: ibdknox: yes file a bug, reserved words that appears as property names should probably not get munged like that.

14:48 ibdknox: dnolen: will do

14:49 dnolen: ibdknox: we'll need to double check to make sure this isn't going to cause problems w/ IE, I don't think it will.

14:53 jtoy: how do I turn (def car "test") into #"test" ?

14:53 wkmanire: The part that worries me is the reset.css I stuck at the top.

14:53 That makes it easier to write cross-browser compatible CSS

14:53 raek: jtoy: re-pattern

14:53 wkmanire: oops

14:54 shit, wrong chat window.

14:54 Sorry folks.

14:54 jtoy: ah, nice

14:59 amalloy: ibdknox: so javascript can actually have objects with a property named "static"? not much of a reserved word then :P

15:00 gfredericks: amalloy: you can at least only reference the property with string literals

15:00 or strings rather

15:01 but you probably mean more than that

15:01 amalloy: well, that makes sense. so why would we expect cljs to be able to access them as properties?

15:01 gfredericks: "as properties" means the foo.bar syntax?

15:01 foo.static in this case

15:02 amalloy: gfredericks: actually i think you're wrong. you can do `foo.static = 4`, in a test i just did

15:02 gfredericks: I didn't say you couldn't; I just said even if you can't you can foo['static']

15:02 amalloy: you can at least only reference the property with string literals - "only" here sounds like you said you can't

15:02 gfredericks: oh how did that word get there

15:11 pandeiro: is there already an async flow control lib for clojurescript?

15:19 dnolen: pandeiro: there is not, I'd like to see someone fix delimc for CLJS

15:19 or write something way better

15:20 mmarczyk: dnolen: hi, thanks for applying the strobj patch

15:21 dnolen: mmarczyk: sure

15:21 mmarczyk: thx for doing it

15:21 mmarczyk: dnolen: np

15:21 dnolen: I'm experimenting with replacing inode-find with inode-lookup in PHM

15:21 dnolen: since cljs.core/find doesn't care about the key stored in the map...

15:21 dnolen: new performance bottleneck I want to eliminate - variadic fns.

15:22 mmarczyk: dnolen: incidentally, that means that one can't use find to extract metadata attached to the actual key assoc'd onto the map -- not that I've ever done it, but it is possible in Clojure

15:23 dnolen: mmarczyk: I wouldn't do that

15:24 unless there's a significant performance win.

15:24 mmarczyk: dnolen: sure

15:25 dnolen: the current version is a direct port, which may be a good thing in and of itself -- as a non-trivial example of how one might build the equivalent of clj's PHM in clj(s)

15:25 dnolen: but no harm in running a few perf tests, so... :-)

15:29 gfredericks: okay, so when running an aleph http server, the request handler gets the response channel as its first argument. If I enqueue into the channel right away, it works. If I do it from a future, it doesn't.

15:30 also does not work if I do it from a vanilla thread

15:32 RickInGA_: I have a function that only compiles when it is indented properly. https://refheap.com/paste/2187

15:32 I am using inferior-lisp

15:33 Whitespace isn't supposed to matter, right?

15:33 gfredericks: RickInGA_: can you reproduce the issue outside of emacs?

15:33 RickInGA_: whitespace definitely shouldn't matter

15:36 RickInGA_: gfredericks can't figure out how to run it outside of emacs

15:36 gfredericks: RickInGA_: you use leiningen?

15:36 RickInGA_: gfredericks: yeah

15:37 gfredericks: so put it in your main ns and do lein run or something...

15:39 xeqi: or lein repl

15:39 gfredericks: aleph lesson learned: don't close the channel at the bottom of your function and forget you did that

15:42 RickInGA_: xeqi: gredericks: when I try to use the namespace that is giving me the problem in lein repl, again I am finding errors that are fixed by indentation

15:43 gfredericks: that is the spookiest thing I have ever heard of.

15:43 fliebel: RickInGA_: Huh? Clojure is whitespace-sensitive? Python people will love this.

15:43 RickInGA_: it may be a phantom error, I moved some things between namespaces, so somethings legitimately are not found

15:43 gfredericks: somebody should fork clojure and write a version of the reader that accepts indents in place of closing parens

15:44 "Clojure Ghost Stories"

15:44 RickInGA_: I will clean up ns errors, and then go try to mess with indentation again

15:46 septomin_: add more semicolons

15:50 RickInGA_: cleared up ns issues… lein repl works fine. inferior-lisp is still sensative to indentation

15:51 ynniv: technomancy: do you have any reference material to go with org.clojars.technomancy/osmosis-hstore ?

16:06 pppaul: i was looking at the clojurescript wiki on github, and then reading the source code for .core. i'm interested in knowing, are persistent data structures and meta data implemented? (i see these things in the .core)

16:07 devn: pppaul: meta is in core.cljs, persistent data structures are WIP if I understand correctly

16:07 pppaul: wip?

16:07 devn: Work in Progress

16:07 pppaul: oh, ok

16:07 i see a lot of code for them in core

16:07 devn: I saw something in this channel earlier today or late yesterday about PersistentHashSet (I think)

16:08 pppaul: i guess it's not too big of a deal for me, cus in JS i do copy on write anyway

16:10 dnolen: pppaul: PersistentVector is in

16:10 pppaul: we have a working PersistentHashMap that needs a little more assessment

16:11 pppaul: PersistentTreeMap would be nice but no one's started

16:12 pppaul: cool

16:13 jondot_: is there anything special to consider when deploying a clojure ring/compojure app? tomcat/jetty? i'm also trying out deploying to heroku, not sure how common is that ?

16:14 ibdknox: heroku works wonderfully :)

16:14 jondot_: hello ibdknox, loving your IDE concept, btw.

16:14 Raynes: Heroku is nice.

16:14 mmarczyk: pppaul: persistent hash set will be in automatically if/when persistent hash map is

16:14 ibdknox: thanks :)

16:15 mmarczyk: dnolen: actually, about noone being starting on tree map... :-)

16:15 jondot_: so heroku runs on jetty? does that matter?

16:15 mudphone: ibdknox: jondot: ditto

16:16 jondot_: runs clojure apps on jetty that is

16:16 from what i can remember of my dark java past, i used to sware by tomcat. not sure its true nowadays.

16:17 ibdknox: jetty works just fine for all my sites

16:18 blakesmith: ibdknox: Do you use jetty standalone via the adapter?

16:19 ibdknox: blakesmith: yep

16:19 mmarczyk: *started

16:19 cemerick: jondot_: I'd probably prefer jetty over tomcat these days.

16:19 ibdknox: I usually stick nginx in front of it if it's on my box

16:19 on heroku I just leave it be

16:19 cemerick: heroku apps are already proxied to the nines anyway

16:19 ibdknox: yup

16:20 blakesmith: For deploys, do you drop a jar, or just 'lein run' the source itself?

16:20 cemerick: blakesmith: the adapter is fine; check out https://devcenter.heroku.com/articles/clojure if you want to use heroku

16:21 blakesmith: I'm talking about non-heroku deploys.

16:21 jondot_: i'm wondering if lein-ring makes any sense for heroku?

16:22 ibdknox: jondot_: not really

16:22 blakesmith: lein trampoline run

16:23 jondot_: ibdknox, suspected so. is it too complex to combine both? i do enjoy the development bonuses i get with lein-ring

16:23 ibdknox: you just need to create a -main, there's no reason you can't have both :)

16:24 jondot_: yep, ok

16:25 pandeiro: i still haven't used lein-ring much, what does it help with?

16:25 dnolen: mmarczyk: ! :)

16:26 jondot_: pandeiro, code reloads, war, opens a browser, etc. read on the github page

16:27 mmarczyk: dnolen: sometime this week I'd say :-)

16:27 cemerick: blakesmith: Depends a lot on what you're targeting. Beanstalk requires a .war, as will any other container-based deployment. Elsewhere, perhaps not.

16:29 pppaul: has anyone looked into doing servers on node.js?

16:29 via clojurescript?

16:31 dnolen: pppaul: some people have tho I haven't heard detailed reports

16:31 pppaul: and ibdknox is looking into it as well it seems

16:32 ibdknox: yeah, I managed to get it working

16:32 jondot_: foreman and jetty Just Works, with all my custom jars pulled in.. lein is great!

16:32 pppaul: are there enough libs ported to clojurescript to make it desirable?

16:33 ibdknox: not at all

16:33 pppaul: or, have people found servers on clojure (java) painful?

16:33 ibdknox: I'd only do it if you have to

16:35 yoklov: pppaul: what sort of libs?

16:35 js or clj

16:35 pppaul: clj

16:36 yoklov: there are a good amount, from what i've seen

16:36 but obviously its a small fraction

16:36 or not-so-small fraction since there aren't _that_ many non-interop clj libs to begin with

16:37 but still pretty small

16:37 i think its still quite desirable though :p

16:39 ibdknox: sorry I meant over CLJ

16:39 in the case of nodejs servers

16:39 I would take noir + jetty/netty in a heartbeat

16:40 kovasb: ibdknox: what is advantage of node then?

16:40 ibdknox: none

16:40 abedra: ^^

16:41 kovasb: "ibdknox figures it out so that you don't have to"

16:41 ibdknox: lol

16:42 I was starting with node thinking that I'd write the core of the platform in JS

16:42 I'm questioning that decision

16:42 as I'm rapidly approaching the "fuck this" stage lol

16:42 septomin_: anyone played around with cljs on meteor?

16:42 kovasb: yeah, better sooner rather than later

16:42 dnolen: ibdknox: heh, how will you run people's JS extensions? Rhino?

16:42 cemerick: ibdknox: what, node isn't our salvation and solace? :-P

16:43 dnolen: ibdknox: btw, man it didn't take long for the Light Table google group to pass noise to signal ratio

16:43 ibdknox: dnolen: that's why I locked it down :(

16:43 dnolen: I might still package node for the JS bit

16:43 kovasb: its like the fountain wishing well, everyone has their 2 cents

16:44 yoklov: oh, dnolen, i've been meaning to ask you, have you ever had any issues with the performance of cljs.core.str?

16:44 dnolen: ibdknox: and communicate between JVM and Node.js?

16:44 yoklov: yeah it stinks

16:44 yoklov: yeah

16:44 ibdknox: dnolen: the architecture I have is very neat :)

16:45 dnolen: yoklov: I think largely due to how variadic fns are implemented

16:45 yoklov: I'm looking into it.

16:45 ibdknox: dnolen: all the pieces of the system are decoupled, so any one piece of it can be run remotely if so desired.

16:45 dnolen: ibdknox: cool - cuz that would have sounded like a headache to me.

16:45 ibdknox: dnolen: at some level it's necessary - you need all of these things to be out of process

16:46 you can't run all the language services on top of the JVM

16:46 they should talk to whatever thing makes the most sense. e.g. python service on top of pypy or whatever

16:46 they all talk through tcp

16:46 hiredman: (stomp)

16:47 dnolen: ibdknox: and you're not too concerned about the JVM dependency?

16:47 ibdknox: dnolen: not sure it's really any worse than a node dependency. Is there something specific you're thinking there?

16:47 yoklov: okay cool, yeah, just wanted to make sure that wasn't unknown

16:48 dnolen: ibdknox: requires a separate install on OS X now right?

16:48 yoklov: dnolen: so you think its cljs being slow and not goog.string?

16:49 dnolen: yoklov: I benched variadic fns, str is particularly bad because it's recursive.

16:49 yoklov: goog.string is not that slow

16:49 ibdknox: dnolen: given that the target is devs, I don't think that's so bad, but it's a good point

16:50 it doesn't prevent people from using eclipse

16:50 yoklov: dnolen: right, i didn't really think about the fact that str/str* were recursive

16:50 wyan: what's the current preferred way of using slime with clojure & sbcl side by side?

16:51 (not simultaneously, just on the same system)

16:51 cemerick: is node not require a separate install?

16:51 does*, feh

16:51 dnolen: cemerick: it's easy to package up node inside your OS X app - not sure about JVM ?

16:52 ibdknox: cemerick: I might be able to package the binaries

16:52 Raynes: cemerick: Borat-cemerick?

16:52 cemerick: Raynes: Might need to start a twitter account.

16:52 * gfredericks was in the middle of typing that

16:52 cemerick: ibdknox: You can definitely redistribute OpenJDK FWIW.

16:52 ibdknox: oo

16:53 I wouldn't care, but this is seriously slowing me down

16:53 cemerick: OS X Java is going to be OpenJDK starting with 7 anyway.

16:53 dnolen: ibdknox: cemerick: how big is OpenJDK tho?

16:54 cemerick: When I was redistributing the Sun JVM for windows apps, that was ~11MB?

16:54 dnolen: cemerick: plus the JDK? really?

16:55 ibdknox: jdk is around 70-80mb looks like

16:55 dnolen: a far cry from VS's 4gb ;)

16:56 RickInGA_: ibdknox yeah, but vs lets me code without knowing how to program. emacs doesn't have that feature. slows me down considerably

16:56 ibdknox: RickInGA_: :)

16:56 dnolen: ibdknox: ok, yeah 70-80mb is not a big deal.

16:57 ibdknox: yeah, that doesn't bother me

16:57 yoklov: isn't OS X losing built-in java when the next version comes out?

16:57 ibdknox: I think I might go that route

16:57 RickInGA_: doh, must have left my work machine logged in. anyone have rights to kick RickInGA

16:58 kovasb: i think optimizing for development speed and capabilities versus download size is a win

16:58 cemerick: yoklov: It's not built-in starting with 10.7. Installs on demand.

16:58 yoklov: huh, didn't realize I had installed it

16:58 ibdknox: and that experience was quite nice

16:58 when I did it

16:58 ok

16:58 I'm sold.

16:58 yoklov: aside from when I installed the development stuff

16:58 * ibdknox goes to start over

17:01 kovasb: dnolen: any chance your talk tomorrow gets moved to a bigger room?

17:03 dnolen: kovasb: hmm I'm not in control of that sadly.

17:04 RickInGA_: dnolen any chance your talk tomrrow gets recorded? :)

17:04 kovasb: dnolen: guess I better show up early if I want a seat :)

17:04 dnolen: RickInGA_: not sure, sometimes thickey comes and does that.

17:05 RickInGA_: really? do you know where they get posted?

17:05 dnolen: kovasb: heh, it won't be too fancy, mostly a review.

17:05 RickInGA_: vimeo / blip.tv

17:05 RickInGA_: dnolen: cool, I will go looking for them

17:06 kovasb: dnolen: mostly want to meet more clojure people in the city

17:06 though I'm sure ill learn something too

17:08 cemerick: ibdknox: I can't find the JRE packages I built, but they were very slim; I think it was < 20MB, though that required some tricks (e.g. pack200, no i8n stuff, etc)

17:08 ibdknox: cemerick: ah. I'm really not worried about download size

17:08 cemerick: anything < 200mb is trivial for a dev

17:09 cemerick: Sure. This was ~2005 for end users, so things were different. :-)

17:09 ibdknox: absolutely

17:09 I'm lucky in that my audience is technically inclined :)

17:10 cemerick: gawd, thinking of the hours I spent slimming that download out… :-|

17:12 dnolen: neat seems like IFn is making Brendan Eich ponder callable Objects for JS

17:13 kovasb: dnolen: have you watched http://blip.tv/jsconf/jsconf2011-andrew-dupont-everything-is-permitted-extending-built-ins-5211542

17:14 near the end he starts talking about some new proposals for js

17:14 dnolen: kovasb: I have seen that yes.

17:14 kovasb: watching it, 80% of the time I was like "yeah clojurescript solves that.."

17:15 but seems like they are coming to a similar conclusion

17:16 dnolen: kovasb: ClojureScript is live 5 years ahead of wherever JS is going. It also delivers most of what Google Dart is selling w/o forking the web.

17:16 s/live/like

17:18 kovasb: dnolen: on the one hand I'm glad I put off learning JS for so long. On the other hand it makes it harder to really get into the guts of cljs in the early days

17:18 yoklov: IFn is awesome

17:19 dnolen: kovasb: I definitely encourage digging into JS. One thing I never expected, writing fast CLJS code is way more fun than trying to wrangle Clojure on the JVM.

17:21 kovasb: dnolen: i could see that, given js is more dynamic. But the debugging situation is pretty tough unless u are pro

17:22 dnolen: kovasb: yeah, debugging story needs work

17:23 yoklov: debugging code which uses cljs data structures is annoying

17:23 harder to look at them in the debugger than arrays

17:23 and in general you gotta know js

17:24 dnolen: yoklov: true, you do know I added toString methods right?

17:25 yoklov: hm, last I checked they were still printing "[object Object]"

17:25 dnolen: yoklov: not in master

17:25 yoklov: hm, i might have an old master then

17:25 might == must

17:26 by the way, if anybody is interested in seeing a neatish cljs game-like-thing, http://thomcc.github.com/Argh/ is what i've been working on lately

17:26 dnolen: yoklov: :)

17:26 yoklov: very nice

17:27 yoklov: haha, thanks. it reminded me how little i remember from when i took linear algebra :p

17:27 but runs quite nicely

17:28 dnolen: yoklov: it's really awesome that you're focusing on game work with ClojureScript.

17:28 brehaut: yoklov: is it using web3d ?

17:28 yoklov: brehaut: no, though I should have

17:28 brehaut: yoklov: thast even cooler :)

17:28 yoklov: i just draw pixels on a tiny tiny canvas

17:29 and scale it up

17:29 brehaut: haha fantastic :)

17:29 yoklov: that explains why i was surprised it worked in safari

17:29 yoklov: dnolen: thanks, yeah, its the kind of stuff which i've been doing for a while (or at least as long as i've been programming) as side projects

17:30 brehaut: yeah, though the sound sounds awful in safari

17:30 html5 audio is the worst for working cross browser.

17:30 brehaut: huh i dont even have any sound

17:30 yoklov: thats possible, it gives up after 1 second of waiting for assets to load.

17:31 which is too short.

17:31 sound only really works right in chrome, though locally it works in both chrome and firefox. i have no idea why.

17:32 mmarczyk: yoklov: wow, that's really cool

17:32 (just looked at Argh)

17:32 yoklov: mmarczyk: thanks!

17:34 amalloy: i think RickInGA's issue was caused by emacs's open-paren-in-column-0-is-defun-start

17:35 he's gone now, but someone (gfredericks?) was claiming clojure is whitespace-sensitive

17:35 rplevy: amalloy: just commas, and you get better perf if you leave them out

17:36 drewr: any ideas why this cljs repl require doesn't work? http://p.draines.com/13346981126818f600a46.txt

17:36 rplevy: it's like semicolons

17:37 cemerick: Interesting, there's hard API breakage between Clojure 1.2 and 1.3+: unchecked-divide and unchecked-remainder were renamed to add an -int suffix.

17:38 dnolen: drewr: hmm, haven't seen that before.

17:38 yoklov: cemerick, yeah, i noticed that if you look at the clojure alioth benchmarks they had to work around that

17:38 dnolen: cemerick: core.logic works around that with macros+resolve

17:39 I fixed that like a year ago.

17:41 drewr: dnolen: tried cleaning my working dir too (rm -rf .repl; git clean -fd; script/bootstrap)

17:42 dnolen: drewr: are you trying to dev against the clojurescript compiler directly? why not lein cljsbuild?

17:43 drewr: dnolen: in order to run script/repljs

17:43 is there another way to get a cljs repl that I'm missing?

17:43 dnolen: drewr: lein cljsbuild supports REPLs

17:44 drewr: Rhino and Browser

17:44 drewr: oh but you're working against Node.js right?

17:44 drewr: dnolen: yes

17:45 * drewr spies repl-launch

17:46 drewr: ah, but I see what you're saying.. cljs.nodejs won't be avail in rhino!

17:46 s/saying/implying maybe?/

17:47 emezeske: drewr, dnolen: If someone points me toward a tutorial on how to set up a nodejs cljs REPL, I'd love to support that in cljsbuild

17:47 I've never messed with it, though, personally

17:47 dnolen: drewr: it wont

17:47 drewr: if you feel ambitious I have an almost working Node.js REPL here https://github.com/swannodette/clojurescript

17:48 drewr: I have some ambition

17:48 dnolen: drewr: look in the node-repl branch

17:48 pppaul: oh sweet!

17:48 dnolen: drewr: there's a working repl.js file, there's the necessary clj code, and a startup script.

17:49 drewr: if someone makes it a little better I'm more than happy to merge it into CLJS proper

17:49 pppaul: how large is a hello world clojurescript .js file?

17:49 drewr: dnolen: awesome; I'll take a look

17:49 dnolen: pppaul: probably 30-50k after advanced compilation, 7-8k gripped.

17:58 yoklov: pppaul: looks like 48k for advanced, and 8.7k gzipped

18:05 ibdknox: Light Table is on kickstarter!

18:05 http://www.kickstarter.com/projects/306316578/light-table

18:05 crassus: whoo

18:06 ibdknox: posted on HN, can a few people vote it up from the new page? http://news.ycombinator.com/newest

18:08 Raynes: ibdknox: Awesome!

18:08 emezeske: ibdknox: Hmm, third on front page, not bad for 10 seconds

18:09 ynniv: wow, 14 points in 3 minutes

18:10 Raynes: ibdknox: TAKE MY MONEY!

18:12 jconnolly: upboated ;D

18:13 brehaut: ibdknox: does the $50 include a tshirt as well or not?

18:13 ynniv: brehaut: no, check the HN comments

18:14 brehaut: ah thanks

18:16 ibdknox: anyone with reddit foo want to put it on reddit? :)

18:17 amalloy: ibdknox: there will be five or ten separate reddit posts about it by tomorrow

18:17 emezeske: ibdknox: done

18:18 ibdknox: http://www.reddit.com/r/programming/new/

18:19 autodidakto: Raynes: stop throwing money at the screen :)

18:22 brehaut: ibdknox: i have had a question from one of my friends: is it a stand alone product, or will it be a web app?

18:22 lancepantz: ibdknox: so you're just refreshing that page right?

18:22 ibdknox: standalone

18:22 lancepantz: there's so much shit going down right now lol

18:22 lancepantz: :)

18:24 ibdknox: haha my girlfriend is apparently doing the refreshing for me

18:26 autodidakto: ibdknox: Just you? Or others too?

18:27 ibdknox: autodidakto: I'm good, but not that good. I'll put together a team

18:28 autodidakto: I'm not the one who'd know best, but lots of kickstarter projects go into more detail about the $... why that number, how long, what will be done if receive more, etc

18:31 And I wanna see what t-shirt looks like :)

18:33 sattvik: ibdknox: I'm confused is the $500 level the one that gets the earliest access? It seems odd that the higher levels don't.

18:34 hiredman: http://news.ycombinator.com/item?id=3855293 <-- this is so dumb, if have a dev job $100 is a "rouding error" in your finances

18:34 lancepantz: hiredman: agree

18:34 brehaut: hah yes. your chair should cost more

18:34 hiredman: god, I am trying to pick a new chair now

18:34 yoklov: heh, that's the boat i'm in but then again i'm a student :p

18:35 hiredman: shopping is hard, lets go programming

18:35 brehaut: hiredman: thats been a long process right

18:35 ?

18:35 lancepantz: hiredman: nothing has yet to top the aeron

18:35 hiredman: atleast don't fall for the steelcase propaganda

18:35 jodaro: the best chair is no chair for me. i stand or sit on the floor.

18:35 lancepantz: i actually stand as well

18:36 hiredman: the chair? yeah I haven't really gotten serious about it, but I moved recently so trying to getting everything all nice

18:36 lancepantz: interesting, have you tried the mirra?

18:37 lancepantz: actually yes, i had one for about 8 months

18:37 i would put it below both the the steelcase and the aeron

18:37 ynniv: I haven't tried one, but I've heard that the Humanscale Freedom Chair is quite good

18:37 brehaut: im probably going to be moving in the next few months. i need to get a proper desk

18:37 emezeske: ynniv: I use the freedom, it's good.

18:38 ynniv: emezeske: how does it compare to the aeron?

18:38 lancepantz: we have freedom's all over the office, and people fight for the aerons

18:38 hiredman: with nerf guns?

18:38 lancepantz: better, deadly magnets

18:39 hiredman: those sound painful

18:39 ynniv: like, MRI's?

18:39 emezeske: ynniv: Heh, I prefer it, but it's totally subjective. I really like the upright headrest thingie.

18:39 septomin_: how do they work?

18:39 lancepantz: septomin_: :)

18:40 ynniv: which one is "the" steelcase chair? they seem to have many

18:40 lancepantz: ynniv: the leap is what i used to have

18:41 ynniv: the Leap WorkLounge looks serious

18:45 ibdknox: you don't mention deployment packaging anywhere. Do you plan on making a standalone app that wraps a web view, or would people run a local server and navigate to it?

18:46 ibdknox: ynniv: it'll be standalone

18:46 ynniv: erm, well… both of those could be "standalone" :-)

18:48 kovasb: 200k.. ambitious. i like it

18:48 ibdknox: 200k is really just barely enough to be honest

18:49 ynniv: it's high for a single person, but low for a team

18:49 Lajla: THat is not the point

18:49 ibdknox: yeah, it's for a team

18:49 metajack: Has anyone tried the Embody, which seems to the be successor to the Aeron?

18:49 Lajla: what is the point is ##(symbol? (symbol ":This has spaces in it and starts with a colon"))

18:49 lazybot: ⇒ true

18:49 ibdknox: ynniv: I added an answer to app for that question just now, it'll be in a webview and feel like an app :)

18:49 ynniv: excellent. thanks :)

18:51 kovasb: well i threw in my 100 :)

18:51 brehaut: 3% of the way already :)

18:52 * mdeboard waits for the soul-crushing part of this to begin as so many people with (relatively) minor financial stakes in the project start to complain

18:54 brehaut: mdeboard: i expect most of them to complain about fonts and colors :P (because its the most obvious bike shed and everyone has an opinion)

18:54 ibdknox: yeah, I'm not convinced this is going to work

18:54 scriptor: ibdknox: that kickstarter won't work?

18:55 ibdknox: we'll see

18:55 mdeboard: brehaut: As long as there's support for comic sans I'm good

18:55 brehaut: its a very ambitious project

18:55 ibdknox: I'm not convinced it'll hit the 200k mark, much less higher.

18:55 brehaut: ~guards

18:55 clojurebot: SEIZE HIM!

18:55 ibdknox: lol

18:56 mdeboard: ibdknox: Would this be a pure Clojure product?

18:56 brehaut: ibdknox: well, data point for you, day job nerds i know who dont follow the tech news channels know about the project

18:56 ibdknox: also, I don't understand why everyone seems to think I can just add this to sublime/emacs/vim

18:56 scriptor: yea...

18:56 mdeboard: ibdknox: Because everyone is terrible. People are, literally, the worst.

18:56 scriptor: I'm not sure if people actually paid attention to the video

18:56 or even watched it

18:56 yoklov: ^

18:56 hagna: for datomic? I did

18:56 scriptor: just going, "hurr durr emacs can do everything"

18:57 hagna: for light table

18:57 hagna: oh oops

18:57 mdeboard: well to be fair, emacs CAN do everything

18:57 scriptor: can you have draggable windows in emacs?

18:57 wkelly: scriptor: I watched the video, said "Hurr durr, emacs can do everything" and pledged money to the kickstarter ;p

18:58 kovasb: that last 50 or 100k might require some work..

18:58 mdeboard: ashton kutcher

18:58 scriptor: I'm 100% sure it's possible

18:58 scriptor: I'm basically trying to make the point that it's poss

18:58 ible

18:58 but I was mostly being sarcastic

18:58 scriptor: ah

18:58 mdeboard: because whether or not it can isn't really relevant, it's whether you'd want to

18:59 scriptor: yea, part of the reason why this appeals to me is the from scratch idea

18:59 not having to bother with emacs

18:59 mdeboard: Id unno I really do use emacs for everything except web browsing

19:00 yoklov: yeah, i like emacs and all but having a 20+ year old design... sorta takes its toll

19:00 mdeboard: I'm chatting in emacs

19:00 scriptor: me too

19:00 yoklov: i am too

19:00 mdeboard: ONLY ME

19:00 wkelly: haha

19:00 wkmanire_away: I wish I were.

19:00 scriptor: heh, ERC?

19:00 wkmanire_away: ERC rocks.

19:00 mdeboard: rcirc

19:00 duncanm: what's this kickstarter project about?

19:00 brehaut: mdeboard: w3 wants to disagree with you :P

19:00 mdeboard: rcirc uber alles

19:00 duncanm: i use rcirc, i wish i could get rcirc-reconnect to work with irc proxies

19:00 yoklov: w3 stinks :/

19:01 duncanm: there's some patch, but it's kinda rotted

19:01 brehaut: nevertheless ;)

19:01 scriptor: oh nice, rcirc is installed by default

19:01 brehaut: yoklov: the majority of the web browsers in the world stink, so its in good company

19:02 yoklov: heh, yeah but I wouldn't want to do any web development in it

19:02 brehaut: yoklov: thats different to IE <= 8 how ;)

19:02 yoklov: conkeror is emacsy enough for me

19:02 not that i really use it

19:02 brehaut: (not that id ever use a browser embeded in emacs anyway)

19:03 mdeboard: whoa amount doubled in the 20 minutes since I pledged

19:03 hagna: acme can do everything :)

19:04 wei_: for a multimethod, can I dispatch on a key in a map, but pass the entire map to the dispatch function?

19:04 scriptor: wei_: yes, I believe so

19:04 duncanm: mdeboard: where's the link to the project?

19:04 mdeboard: http://www.kickstarter.com/projects/306316578/light-table

19:04 brehaut: alternatively, anywhere you get your nerd news ;)

19:05 amalloy: brehaut: irc, evidently, making both of you correct

19:05 scriptor: wei_: check out http://clojuredocs.org/clojure_core/clojure.core/defmulti#example_549

19:05 duncanm: ah, i didn't know he started a kickstarter project

19:05 autodidakto: wei_: your defmethods see the same arguments that the defmulti does

19:06 scriptor: wei_: in that example, 'params' will be english-map, french-map, etc.

19:08 wei_: oh, I got it. thanks!

19:11 the1andonlycary: does anyone have experience with incanter? I'm getting an 'unable to resolve symbol' when trying to use sample-weibull (https://gist.github.com/7d8dccd5df3a59cfeb7c)

19:15 aaelony: thelandonlycary: user=> (sample-weibull 1)

19:15 1.0698556892475477

19:17 thelandonlycary: here is the project.clj https://refheap.com/paste/2198

19:22 the1andonlycary: thanks, aaelony! I've got it running now :-)

19:22 livingston: i'm looking for something like gentemp but that will give me a deterministic / reproducible set of names... I ended up with this which works but it feels ugly: git://gist.github.com/2409793.git

19:23 er I mean this: https://gist.github.com/2409793

19:27 aaelony: thelandonlycary: cool

19:38 yoklov: oh huh, did clojure 1.4.0 come out?

19:38 wei_: how do I print an caught exception e to a file?

19:38 hiredman: ~jdoc Exception

19:38 clojurebot: I don't understand.

19:38 hiredman: clojurebot: jerk

19:38 clojurebot: you cut me deep, man.

19:39 amalloy: $javadoc Exception

19:39 lazybot: http://docs.oracle.com/javase/6/docs/api/java/lang/Exception.html

19:42 wei_: oh-- getStackTrace. thanks! I'll check the javadocs next time

19:43 b_erb: i want to increment a counter in a transaction (i know that this is usually a good cause for atoms). but i'm wondering if the inc function is actually commutative?

19:44 lancepantz: wei_: https://github.com/flatland/useful/blob/develop/src/useful/debug.clj#L33 may be of use

19:44 llasram: b_erb: What do you mean?

19:45 hiredman: b_erb: http://en.wikipedia.org/wiki/Commutative_property

19:45 if I apply inc ten times to 1, can you rearrange the order that my incs are applied in and get a different result?

19:45 yoklov: no

19:45 michaelbarton: I have a quick question. How can I perform OR pairwise on two sequences?

19:46 yoklov: hiredman, inc is just +1

19:46 no matter how you do 1+1+1+1+…+1+1 it's still the same result

19:46 wei_: lancepantz: thanks. all of those fns look useful actually

19:46 yoklov: because addition is commutative

19:46 michaelbarton: Would it be interleave then compare in steps of two?

19:46 yoklov: oh wait

19:47 i didn't realize b_erb asked that

19:47 llasram: The danger of the rhetorical question in IRC :-)

19:47 b_erb: hiredman: / yoklov: thanks, i should know this from back in the school. ;-) i was just distracted by "last-one-in-wins" and "in-transaction-value-of-ref".

19:47 septomin_: i assume he's asking if inc is safe

19:48 llasram: b_erb: I'm sensing potential confusion about what `inc` does...? Like most Clojure functions it's "pure" -- doesn't actually mutate anything, just returns the value of its input +1

19:49 septomin_: i.e. in java if you did x += 1 ten times without locking x

19:51 sattvik: magnars: You mean like:

19:51 michaelbarton: like:

19:52 ,(map #(or %1 %2) [true true false false] [true false true false])

19:52 clojurebot: (true true true false)

19:54 yoklov: hm, you can't do (map or …) because or's a macro?

19:54 ,(map or [true] [false])

19:54 clojurebot: #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/or, compiling:(NO_SOURCE_PATH:0)>

19:54 yoklov: yup

19:54 bummer

19:58 michaelbarton: Perhaps there is a way to do it with all? and true?

19:59 yoklov: hm?

20:00 michaelbarton: I think #(every? true? %) works

20:00 yoklov: oh you can do it the way he suggests

20:00 michaelbarton: Sorry

20:00 I didn't see that

20:01 map can take multiple sequences?

20:01 yoklov: yeah

20:01 its awesome

20:01 michaelbarton: They are automatically interleaved?

20:01 yoklov: ,(map + [1 2 3] [4 5 6])

20:01 clojurebot: (5 7 9)

20:01 amalloy: interleaving seems irrelevant

20:02 michaelbarton: I mean the arguments are passed pairwise to function?

20:02 amalloy: &(doc map)

20:02 lazybot: ⇒ "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. A... https://refheap.com/paste/2201

20:02 michaelbarton: I see

20:02 Very interesting

20:03 Thank you

20:15 pablo_ns: Has anybody who uses Moustache come up with a way to reverse routes? It's getting unruly to call routes with "/foo/bar" and I can't think of a way to reverse routes without named routes (which moustache doesn't support)

20:17 brehaut: pablo_ns: i havent seen one. its quite a hard problem as any ring handler could be the RHS of a route, which means it might not be a moustache app thus not necessarily going to be reversable. I've just used a multimethod myself

20:18 cemerick: what's a sane way to run a shell command (that includes piping, etc)?

20:18 I could pull in stevedore or something, but it seems like this should be easier than it appears...

20:19 emezeske: cemerick: Raynes' "conch" looks pretty cool

20:19 Raynes: cemerick: conch should be able to do everything you need. If not, send me a pull request.

20:20 pablo_ns: brehaut: thanks for the insight. Can you share a snippet of how you're using a multimethod in this way?

20:21 brehaut: pablo_ns: sure. its particularly easy for me because my site uses couchdb and all my documents have :type keys, so i just have a multi switching on type and then the implementation of the methods unpacks the appropriate values

20:21 pablo_ns: its not especially elegant ;)

20:22 pablo_ns: I've searched high and low on github and past discussions for some code that does that, but everyone seems to call routes by hand (strings

20:22 cemerick: Raynes, emezeske: thanks, I'll keep it in mind. I managed to eliminate the piping, so c.j.shell/sh works now.

20:22 brehaut: pablo_ns: https://refheap.com/paste/2203

20:23 pablo_ns: make-url just creates a fully qualified url from the fragments provided (interposes slashes) and prefixes the domain and scheme

20:25 livingston: is there any way to set the value of a dynamic var to be a function that will be defined later? I tried (declare foo) (def ^:dynamic *my-foo* foo) (defn foo ...) but that doesn't seem to work?

20:25 hiredman: (declare ^:dynamic foo)

20:26 pablo_ns: brehaut: Humm, I thought about something like that, but using metadata. Thanks for the snippet!

20:26 brehaut: pablo_ns: no problem. i do think its a problem that does need to be solved, and ideally in a way tat works across ring libs

20:26 livingston: hiredman: really? make the function itself dynamic too, weird

20:26 hiredman: livingston: I don't think you understand what you are doing

20:27 livingston: oh you're just saying let people bind over the function itself yeah, that's not what I really want..

20:28 in binding over *my-foo* I might still want to do something in terms of foo, if I bind over foo to do something in terms of foo, that seems ugly

20:29 pablo_ns: brehaut: Yes. I don't think my models should know how to assemble their URLs, but so far that is the only sane way that I've seen.

20:29 livingston: hiredman: I was just trying to keep all my globals at the top of the file, so I wanted to forward declare a function name.

20:32 brehaut: pablo_ns: yeah, the models themselves shouldnt know how to reverse their urls, hence using a multi

20:33 pablo_ns: you could potentially use a protocol if you are using records (im not)

20:33 but its still a half solution

20:34 seancorfield: arohner: you around? Q about lein-daemon

20:34 arohner: seancorfield: yeah, I'm here

20:35 bsteuber: ibdknox: almost 10% within the first two hours should give you some confidence

20:35 pablo_ns: brehaut: sorry, I was actually loud thinking about my solution before I saw your snippet =)

20:36 brehaut: oh right :)

20:36 ibdknox: bsteuber: Still skeptical, we'll run out of excited people soon enough ;) Those are the ones who jumped in that quickly.

20:36 yoklov: hm, so am I really the only one who has the google closure compiler crash on them _all the time_ while doing lein cljsbuild auto?

20:36 ibdknox: yoklov: seriously never had it happen

20:36 yoklov: its extremely common for me.

20:36 more than 2 hours open and it will probably happen.

20:37 bsteuber: ibdknox: I'd rather assume you'll have to figure out soon what to support after python ^^

20:37 ibdknox: :)

20:37 Ruby probably

20:37 although with mono's stuff I could take on VS ;)

20:37 bsteuber: btw. is cljs already included when you say clojure?

20:37 ibdknox: yeah

20:37 emezeske: yoklov: Never had the closure compiler crash on me

20:38 bsteuber: cool

20:38 yoklov: emzeske: yeah, it runs out of memory

20:38 emezeske*

20:38 bsteuber: paredit would be next on my list then ^^

20:38 ibdknox: bsteuber: hopefully in a little bit I'll get it to the point where I can program it in itself, so it'll need CLJS

20:38 bsteuber: makes sense :)

20:38 seancorfield: arohner: thanx... two Qs in fact... when I run lein daemon start :something I sort of expected it to fork it in the background and return to the command prompt

20:38 emezeske: yoklov: Interesting...

20:38 pablo_ns: idbknox: Just make it clj-only and let the lesser languages drool over it wiht jealousy =)

20:38 ibdknox: bsteuber: I was thinking about using that as a hiring project actually

20:38 emezeske: yoklov: Have you tried setting lein's java options with a higher heap size?

20:38 seancorfield: arohner: is that just my misunderstanding? and it's more like lein run in that way?

20:39 arohner: also, where do stdout / stderr go?

20:39 arohner: seancorfield: it waits for the pid file to show up, then exits

20:39 yoklov: emezeske: no, I haven't, thats a good idea.

20:39 arohner: seancorfield: though I'm pretty sure it's not functional on lein2 yet

20:39 yoklov: emezeske, the thing is that I don't even have it doing any optimizations

20:39 ivan: Compiler needs hundreds of megs

20:40 arohner: seancorfield: re stdout/stderr, that's a good question. I typically just use logging.

20:40 seancorfield: i'm still on lein1... but it's just sitting there after start the process... hasn't exited

20:40 emezeske: yoklov: Actually, I'm not sure if the JVM memory options would be carried from your project.clj into the lein cljsbuild options

20:40 seancorfield: but it created the pidfile fine

20:40 emezeske: yoklov: I should look into that.

20:40 bsteuber: ibdknox: you mean the first person to build paredit into codemirror will get hired? ^^

20:41 ibdknox: haha no, but it's a good proof that that person could be hired :)

20:41 ability is only one side of the equation, personality and fit is super important in small very quick moving teams

20:42 bsteuber: sure - I'm afraid I don't have time at this point anyways ^^

20:42 besides living in Europe

20:42 muhoo: that means a high probability the hires will come from #clojure

20:43 emezeske: yoklov: https://github.com/emezeske/lein-cljsbuild/issues/82

20:43 arohner: seancorfield: oh, right. I close stdout and stderr. I don't remember why exactly, but it has to do with daemonizing properly

20:43 ibdknox: muhoo: I'm actually trying to convince a couple of the guys I used to work with at MSFT to join. They're some of the best programmers I've ever met.

20:44 seancorfield: arohner: ok, that answers that question - and i am using logging so i can get at things that way

20:44 arohner: seancorfield: if you add :debug true to the value in your daemon map, it won't close the descriptors, which may aid debugging

20:44 seancorfield: arohner: even after lein daemon stop :something, the original lein daemon start... invocation still just sits there

20:44 bsteuber: I actually think this might be the long-awaited Clojure killer app

20:44 seancorfield: arohner: 'k i'll try that

20:45 bsteuber: but we'll see ^^

20:45 arohner: seancorfield: i.e. :daemon {"foo" {:ns foo.bar :debug true}}

20:45 yoklov: emezeske: hm, yeah that seems about right

20:46 arohner: seancorfield: looks like the lein process waits 5 minutes for the pid to show up

20:46 yoklov: emezeske: Though wouldn't other people get the same issue if it's not user configurable at all

20:46 emezeske: yoklov: Could be java/system version differences, e.g. maybe your default heap size is low for some reason?

20:46 seancorfield: arohner: with :debug true i see the stdout output of my task but no indication why the lein process does not exit - i'm using a relative pid file path, just :pidfile "myproc.pid"

20:46 muhoo: ibdknox: good point, if you've worked with them before especially

20:47 emezeske: yoklov: Or maybe your project requires more memory from the closure compiler for some reason?

20:47 yoklov: emezeske: Maybe, but it's set to only do whitespace optimizations

20:47 seancorfield: and if i ^C the lein daemon start command after i see my task is running, it kills my task (as well as lein daemon start...)

20:48 arohner: this is on mac os x lion, btw

20:48 arohner: seancorfield: oh, what's your lein version?

20:48 1.7.x?

20:49 seancorfield: arohner: yeah, 1.7.1

20:49 emezeske: yoklov: Yeah, it seems very weird. Just a guess on my part, could be totally wrong !

20:49 livingston: is there any way to make one namespace completely mirror the contents of one or more other namespaces? for example, if I have functions foo/fn1 and bar/fn2 I want to have baz namespace setup such that I can call baz/fn1 and baz/fn2 ?

20:49 yoklov: emezeske: yeah, and if it makes any difference I use mac os x lion too. I've never had the patience to run auto on advanced optimizations for any length of time.

20:49 arohner: seancorfield: actually, I think it's broken there too. :-(. I'm on 1.6.1.1

20:49 emezeske: yoklov: cool, thanks

20:50 seancorfield: arohner: ah, so i'm doomed then?

20:50 arohner: seancorfield: I think so. Sorry. I haven't looked into what changed yet

20:51 yoklov: just to be sure I'm not an idiot, "com.google.javascript.jscomp.mozilla.rhino" seems like a google closure compiler package right?

20:52 seancorfield: arohner: 'k guess i'll put my ticket back into the backlog then :) (my world singles ticket to investigate lein-daemon)

20:53 kovasb: livingston: I believe its possible to programmatically manipulate the namespace mappings

20:53 devn: good evening fellow clojuriants

20:53 Hail and well met!

20:54 livingston: kovasb: yeah, I could just grab all the symbols and re-intern them in the new ns - I was just hoping there was something as nice as "use".

20:55 kovasb: livingston: i'd look at the chapter on namespaces in joy of clojure

20:55 amalloy: livingston: it's something you're not really encouraged to do

20:55 emezeske: yoklov: I think si, yeah

20:55 amalloy: but various people love to do it, and potemkin probably has the basic tool you want

20:56 livingston: amalloy: I know - it's a connivence thing. I'm trying to set up a shorthand namespace for use with some manual data entry.

20:56 amalloy: $google clojure potemkin

20:56 lazybot: [ztellman (Zach Tellman) · GitHub] https://github.com/ztellman

20:56 amalloy: github's seo is so awful

20:56 yoklov: emezeske: Yeah, mozilla.rhino is in that one but com.google.javascript.jscomp seems fairly closure compilery. I posted a stacktrace on that issue, should it help, by the way.

20:57 emezeske: yoklov: thanks!

20:59 yoklov: emezeske: no problem, if you want to know anything else i can answer it, that's just all I could think of

21:00 livingston: amalloy: thanks that might be what I"m looking for... still digging into it.

21:05 devn: ibdknox: maybe this is an obvious question, but how close to functional was your demo? It seemed like you had something already working? Is that way off?

21:10 yoklov: how do you guys combat growing arglists?

21:10 brehaut: keyword args or maps

21:11 yoklov: already doing that

21:11 brehaut: (sometimes anyway)

21:11 yoklov: same size, just destructured

21:11 brehaut: but it lets you group args together, which means the prcessing of them can be handled by a seperate function

21:12 yoklov: hm

21:12 brehaut: (because lots of args often is a symptom of a function doing more than 1 thing)

21:14 yoklov: yeah, i agree. Right now I'm trying to refactor a terrible blob of a function into more managable pieces, and I can't think of how to do it without passing lots of args

21:17 to make it even more difficult, I can't break things up to operations on sequences because it needs to be fast.

21:17 blargh.

21:32 ibdknox: devn: it worked but it was a bit of a mess and missing some of the really simple things... like saving :)

21:35 tufflax: Does anyone know what's wrong with this? http://codepaste.net/w5idc1

21:36 That error message is a bit cryptic

21:36 septomin_: that's a strange-looking destructuring

21:37 tufflax: I think it's supposet to be fine though :p

21:37 supposed* :p

21:38 septomin_: what's the point of [& dests] there?

21:38 isn't it just equivalent to dests?

21:39 tufflax: yes, you are right

21:39 but still... :P

21:40 the error persists

21:41 emezeske: tufflax: You might want to give an example of the inputs passed to your function.

21:41 tufflax: yes ok

21:42 or

21:42 The error results when I try to compile it

21:42 but yes, i can get some supposet input

21:42 d

21:43 xeqi: works when I paste it in a repl

21:43 emezeske: Well, the example input might help explain what you're trying to do

21:43 amalloy: it compiles fine when anyone else compiles it, so i suspect your error is in your environment, or in your ability to match line numbers up

21:43 tufflax: hm

21:48 Hm, I copied and pasted from codepaste and now it works, vim must have been playing tricks with me. :p

21:49 septomin_: some weird character in the source?

21:49 tufflax: possibly, but i tryied :set list

21:50 tried :P

21:51 septomin_: personally i don't trust any character over 127

22:05 kovasb: i don't trust any character over 30

22:13 Lajla: kovasb, but do you trust 30 in symbols?

22:24 mebaran151: I'm interacting with the Salesforce web service and would like individual steps in transaction to automatically check if they need to refresh their login token automatically (ie. try action against a set Salesforce environment and if you get an unauthorized access exception, refresh the login token and the connection environment)

22:24 to me, it seems like this would be a good fit for something adapted from a state monad

22:25 anybody here have much experience with the Clojure monad package and could comment if this idea would be overengineered

22:27 brehaut: mebaran151: it would probably work nicely. depending how you are writing and composing operations it could be over engineered compared to just closing over an atom

22:28 but the way you have described it (and my limited knowledge of the salesforce api) it sounds like a fit

22:28 mebaran151: good chance for me to play with the algo.monad library too

22:29 brehaut: yup

22:29 mebaran151: my other idea was to just use a higher order function that took a bunch of salesforce related closures as the steps

22:30 but then I didn't have a good way to pass state between them without some clumsy global

22:30 brehaut: state-m is just doing that with some mechanical sugar to reduce the burden of passing crap everywhere

22:30 S11001001: mebaran151: I missed all but the last two lines, but sounds like you want a fold, or indeed, a state traversal

22:31 setting aside monads, fold is the primitive functional list traversal in the same way that foreach is the primitive imperative list traversal

22:33 kovasb: isn't foreach more equivalent to map

22:33 brehaut: for is equive to mapcat

22:33 tufflax: I'm gonna win the code golf at the lab presentations. I love Clojure. :)

22:34 brehaut: tufflax: only if nobody else know APL ;)

22:34 tufflax: hehe i dont think they do

22:34 everyone's gonna use java

22:34 brehaut: bahaha

22:34 you cant play golf with java :P

22:36 S11001001: kovasb: for in clojure is like mapcat; for-each in scheme, mapc in lisp, each in ruby are the "foreach" I mean

22:38 or doseq in clojure

22:39 mebaran151: does state-m use an atom?

22:39 S11001001: no

22:39 brehaut: mebaran151: http://brehaut.net/blog/2010/welcome_to_the_machine

22:40 (toot toot)

22:40 mebaran151: I'd normally just do a higher order function but for two things: 1) I want the functions to share a result set in a given set of actions/queries and 2) that I can thread in some login and environmental boilerplate in between

22:40 brehaut: pretty blog :)

22:40 brehaut: thanks :)

22:41 mebaran151: I like playing with Haskell, but I've never really gotten to anything big

22:42 I'm thinking you could probably emulate something similar with reduce over a list of functions actually

22:42 brehaut: mebaran151: apologies about the quality of the writing on that, its not my best use of english

22:42 mebaran151: basicly state-m just hides the state tracking inside a bunch of function calls so that you dont have to worry about it unless you need it

22:43 mebaran151: any advantage to the monadic approach compared to say (reduce #(do (refresh-salesforce) (%1 %2)) function-list)

22:44 brehaut: mebaran151: if you have a number of operations and want to intermediate the context passing, and allow ad hoc composition at a later date, then state-m is probably what you want. if you just want to roll over a list of functions and dont mind explicitly passing the context state in and out, then reduce is fine

22:44 mebaran151: I'd prefer the former I think

22:44 brehaut: mebaran151: the magic of state-m is that it is pure functional, but hides the state variable

22:45 mebaran151: well I essentially have two states, the state of my sales env (what environment to connect to, etc) and the results my last function returned, though the return really isn't state is it

22:45 brehaut: mebaran151: you might also find http://www.clojure.net/2012/02/10/State/ useful

22:46 correct

22:46 if you need to track more than one thing in state-m you need to stuff it into a vector of map

22:47 mebaran151: the cleanest api would look something like (dosalesforce [res (query x) res2 (query res1)])

22:47 brehaut: that would be trivial

22:48 mebaran151: between res1, and res2, I'd make sure I fulfilled all the SF nonsense

22:48 brehaut: you could either do that by writing a salesforce monad that is like a state-m but does that checking in m-bind

22:48 mebaran151: trying the action, retrying after a refresh if salesforce kicked me out

22:48 brehaut: or write a decorate for your query functions on top of state-m

22:49 mebaran151: I was just about to consider a decoration macro, but it feels cleaner in the bind function

22:49 brehaut: big old bag of it-depends

22:49 personally, i'd start with the decorators

22:49 mebaran151: also since the decoration is all about the state of environment, I'd probably have to put it in the bind

22:50 brehaut: whenever i use monads, i try to a) use an existing monad where possible, b) use it as internal mechanics rather than exposing it as the API

22:51 right; if your queries never want to know about the state of the salesforce nonsense, then by all means, put it in m-bind

22:51 mebaran151: because basically I'm saying try using the old environment first, and if you get a failure response, refresh the environment state and try to again

22:51 the queries should never want to know the login information, ever

22:51 brehaut: oh then

22:51 s/oh/ok/

22:52 one question

22:52 are you going to want to be able to define a salesforce function in one place and use that in another saleforce function somewhere else?

22:52 mebaran151: I would also like some magic destructuring too if possible within the monad at each step ideally, though I'm not familiar enough with the monad interfaces to know if that's unrealistic

22:52 brehaut: (ie, are the queries you mentioned earlier also 'dosalesforce' things?)

22:53 mebaran151: I'd prefer them not to be

22:53 though they could be

22:53 brehaut: if thats the case, then monads might be too heavy handed

22:53 mebaran151: they could be dosalesforce things theoretically

22:54 I'd assume within each query-fn, that it's environment would be essentially safe, though for a big long task, it might be nice to compose them

22:55 brehaut: ibdknox: lol, PHP support requested already. that'd have to be one hell of a stretch goal

22:56 kovasb: Facebook should drop 200k just for that

22:56 mebaran151: I suppose practically my interface looks a lot like a with macro really, that just makes sure the with stays nice and open and optionally logouts out at the end

22:57 brehaut: mebaran151: yeah. monads (if you were familiar with them already) would make it trivial to implement (or prototype) but might be overkill otherwise

22:58 mebaran151: I was thinking this felt like the first place in some code I was writing that they really clicked

22:58 brehaut: if it looks like a let, and has magic between the binding pairs, then a monad probably makes it easier, yes

22:59 mebaran151: exactly

23:01 actually the more I consider it, I'd ideally like more, where in I had a magic HTTP post that was state aware and knew to include the authorization token

23:02 so these actions are starting to look a lot more like they'd each have to be modeled as a dosalesforce to make sense

23:18 kovasb: nathanmarz: cloning right now :)

23:47 nathanmarz: do i just use serializable.fn into my namespace?

Logging service provided by n01se.net