#clojure log - Aug 17 2012

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

1:35 semperos: for any folks still around dealing with the cljs -> nodejs multi-namespace issue, I've put a temporary workaround on the JIRA ticket for it

1:35 http://dev.clojure.org/jira/browse/CLJS-355

1:43 tomoj: hmm

1:43 i certainly got multiple namespaces working before

1:44 months ago maybe

1:53 semperos: what cljs version?

1:53 semperos: HEAD of master

1:53 tomoj: huh..

1:53 refh seems to work fine here

1:54 semperos: with nodejs as the target?

1:54 tomoj: yeah

1:54 I don't have quite HEAD yet

1:54 semperos: hmm

1:54 I didn't open the issue, just encountered it today, I've only targeted the browser with cljs in the past

1:56 I also tried all of the 0.0-14xx releases and had the same error occur when introducing multiple namespaces and targeting nodejs

1:58 tomoj: https://gist.github.com/de65338f9d7eaa30c2e0

1:58 Raynes: https://gist.github.com/de65338f9d7eaa30c2e0

1:59 semperos: tomoj: able to share the project code?

1:59 or at least what/how many namespaces that code base has?

2:02 nm...

2:03 tomoj: hmm

2:05 wmealing__: hmm

2:07 semperos: tomoj: on that refh code base, if I do `lein cljsbuild once` and then run the file, it doesn't work for me as shown in your gist

2:07 kinda curious

2:07 tomoj: how does it know which cljs version to use?

2:07 Raynes: tomoj: ?

2:07 tomoj: it looks like cljsc is using my HEAD install

2:08 Raynes: tomoj: If that's the case and it is already fixed, somebody really need to push a new cljs release.

2:09 needs*

2:09 That was the craziest bug I've ever seen.

2:10 tomoj: I see cljsbuild depends on 0.0-1450

2:10 Raynes: Is it using that in your gist?

2:10 tomoj: I assume so

2:10 Raynes: Because I can't get it to work with that.

2:10 semperos: me neither

2:11 tomoj: ..platform?

2:11 Raynes: OS X

2:11 semperos: Mac OSX Lion

2:11 Raynes: Same.

2:11 tomoj: called it

2:11 semperos: :)

2:11 tomoj: maybe that's just a coincidence

2:11 ubuntu here

2:11 what occurred to me was "case-insensitive hfs" but I don't see how that could cause it

2:12 Raynes: I can test on my ubuntu vps, tomoj.

2:12 Gimme a sec.

2:12 tomoj: osx java sorts differently? :)

2:12 semperos: I've seen sorting differences in Ruby implementations across OS's...

2:13 tomoj: if it sorts by hash somewhere I could see that

2:13 ..maybe?

2:13 it just happens to come out correct in ubuntu? that seems crazy though

2:15 * magopian is so proud

2:15 tomoj: just tried again using cljsc with my clone on r1450, still works

2:15 magopian: i think i found a very clever solution to problem 82 on 4clojure <3

2:16 Raynes: tomoj: I can reproduce on ubuntu

2:16 semperos: ^

2:16 nbeloglazov: magopian: and what is it? :)

2:16 semperos: Raynes: the error, or it working?

2:16 Raynes: The error.

2:16 Same thing happens.

2:16 semperos: sweet

2:16 so tomoj has the magic box

2:17 Raynes: Apparently so.

2:17 Where all things work.

2:18 semperos: well, time for me to hit the sack; with that simple workaround on that ticket, those not using tomoj's magic box can get nodejs targets compiling again

2:20 magopian: nbeloglazov: did you solve the problem 82 already?

2:20 nbeloglazov: magopian: yes

2:20 magopian: nbeloglazov: my username is "magopian"

2:21 nbeloglazov: reasoning was: if all words have to be chained, it's not possible if there's more than two words that can only connect to one word (the first and the last one)

2:21 if there's more than 2 words with only one connection => it can't be a single chain => false

2:22 i'm pretty sure that's a bit naive, as i'm pretty sure there could be a set of words, each having more than one "connection", but still no one chain could be made

2:23 however, that doesn't seem to be the case with the tests available

2:24 nbeloglazov: must rush, afk, will be back in a few minutes

2:26 nbeloglazov: magopian: no need to hurry, 4clojure slow as hell now (at least for me)

2:27 wmealing__: i know its not clojure related.. but can someone tell me why "Koka" plans to do with these "inferred effects", ie what does it do for the langauge

2:39 magopian: nbeloglazov: back;)

2:41 nbeloglazov: magopian: by the way I think I found a way to crash 4clojure for sometime

2:45 magopian: nbeloglazov: oh?

2:45 nbeloglazov: you mean some way to trump the "execution timeout" trigger ?

2:46 nbeloglazov: magopian: no, just make it very slow and sometimes it shows "Broken gateway". It has problems with user search

2:46 magopian: yes, your solution is a bit of a hack :)

2:49 magopian: nbeloglazov: i think so, yes

2:51 nbeloglazov: but eh, it's the simplest solution given the tests, right? O:)

2:51 i had a first solution, based on brute force (compute all possible combinations of the words, and then checking if it's a chain)

2:52 which was correct, but timed out on the very first test

2:52 nbeloglazov: magopian: mine passed (it also check all permutations)

2:52 magopian: (took me two days to come up with it, was a bit frustrated when it failed :(

2:52 nbeloglazov: well, does it still run now? (your solution) ?

2:53 because mine had nothing fancy, i think, so i was a bit surprised it would timeout

2:53 (i still have it around if you're interested, but it's not very elegant)

2:55 nbeloglazov: magopian: yes, it passes. My nick is nikelandjelo on 4clojure

2:56 magopian: you also can check redraiment's solution it's really hack that has nothing common with the task

2:56 magopian: i'll check those two straight away

2:57 ah, i'm following you already ;) (i follow each and every one who solved every problem, so i can compare my solutions to them)

2:57 tomoj: Raynes: hmm

2:57 I guess I'm not using the cljs version I think I am?

2:58 magopian: nbeloglazov: (drop-nth [n s] (concat (take n s) (drop (inc n) s))) <==== i did that differently with split-at

3:03 nbeloglazov: very clever solution ;) my brute force one was very very close, same logic (but less idiomatic and clear, i'm still big big noob ;)

3:03 nbeloglazov: magopian: hm, yes, drop-nth removes nth element and returns 1 seq, and split-at returns 2 seqs

3:03 magopian: nbeloglazov: i guess my permutations algorithm was too naive to run fast enough

3:03 nbeloglazov: magopian: can you show your algorithm?

3:03 magopian: sure, let me paste it

3:04 tomoj: wonder why symbols can't start with numbers

3:04 magopian: mmm let me trim it down

3:06 nbeloglazov: https://friendpaste.com/1Yti8jqQuUpdY8t8mKOg9

3:06 it takes a word, and inserts it in every possible position in a sequence

3:07 nbeloglazov: tomoj: because compiler won't be able to understand when you type (println 4) if you mean 4 as number or as symbol

3:07 tomoj: hmm

3:08 "if it's a valid literal number, it's a number, otherwise it's a symbol" is just too weird?

3:10 heh "Unable to resolve symbol: 4 in this context"

3:10 nbeloglazov: I think so. It can cause confusion. May be there are some bigger problems with this

3:10 magopian: haha, just checked redraiment's solution :)

3:12 nbeloglazov: i love your "close?" function, it's just simple, clear, concise, readable, perfect !

3:13 nbeloglazov: magopian: thanks :)

3:15 magopian: to learn the syntax of a new language, it can be rather quick... but to learn to write it idiomatically... it can take years

3:15 wow, this sentence is hardly english, sorry ^^

3:25 rod_: hi - i'm using compojure for a JSON RESTish api - and would like to handle exceptions returning them as JSON. i was about to write a macro to wrap all my routes, but can anyone reccomend the beter way of doing this? could i use a ring response handler? thanks

3:29 nz-: rod_: the exact same thing is on my to-do list, I would probably make a regular function as a ring response handler that does the job

3:29 rod_: ok thanks for the advice nz- i'll try it.

3:31 nbeloglazov: rod_: look at this article: http://mmcgrana.github.com/2010/08/clojure-rest-api.html Author creates error handler

3:31 nz-: see wrap-exception-logging and wrap-failsafe in http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html

3:33 rod_: cheers!

3:45 augustl: need to turn {:headers {:foo 1 :bar 2}} into {:headers {:bar 2}}, this is a good use case for clojure.zip right?

3:47 nz-: select-keys?

3:48 ,(select-keys {:foo 1 :bar 2} [:bar])

3:48 clojurebot: {:bar 2}

4:00 hyPiRion: so like

4:01 ,(update-in {:headers {:foo 1 :bar 2}} [:headers] dissoc :bar)

4:01 clojurebot: {:headers {:foo 1}}

4:02 hyPiRion: ,(update-in {:headers {:foo 1 :bar 2}} [:headers] select-keys [:foo])

4:02 clojurebot: {:headers {:foo 1}}

4:03 nz-: ,(update-in {:headers {:foo 1 :bar 2}} [:headers] select-keys [:bar])

4:03 clojurebot: {:headers {:bar 2}}

4:03 nz-: ,(update-in {:headers {:foo 1 :bar 2}} [:headers] select-keys [:foobar])

4:03 clojurebot: {:headers {}}

4:05 nz-: what is idiomatic way to remove "empty" keys from a map: e.g {:a 1 :b {} :c [] :d {:d1 1 :d2 {} :d2 {} :d3 nil}} -> {:a 1 :d {:d1 1}}

4:06 augustl: hyPiRion: ah, cool

4:06 rod_: nz- would (into {} (remove empty? the-data)) work?

4:07 oh, you might have to (comp empty? second)

4:07 nz-: ,(into {} (remove empty? {:a 1 :b {} :c [] :d {:d1 1 :d2 {} :d2 {} :d3 nil}}))

4:07 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Duplicate key: :d2>

4:07 nz-: ,(into {} (remove empty? {:a 1 :b {} :c [] :d {:d1 1 :d2 {} :d4 {} :d3 nil}}))

4:07 clojurebot: {:a 1, :b {}, :c [], :d {:d1 1, :d2 {}, :d4 {}, :d3 nil}}

4:08 rod_: ,(into {} (remove (comp empty? second) {:a 1 :b {} :c [] :d {:d1 1 :d2 {} :d4 {} :d3 nil}}))

4:08 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

4:08 rod_: ouch

4:08 maybe put ur own "empty" comparison in then

4:08 that'll deal with numbers and stuff

4:09 nz-: does it work recursively? several levels deep?

4:09 azkesz: is it possible to redefine a function and inside it call the old function?

4:10 function having the same name

4:13 tomoj: (defn wrap-println [f] (fn [& args] (println (apply f args))))

4:13 (def foo (-> (fn [x] (+ x 2)) wrap-println))

4:13 azkesz: ^

4:13 one way to do what

4:13 ..I think you are asking

4:14 hyPiRion: I think the question is more like (def prn [x] (do (prn x) x)), where the prn inside is the old fn.

4:14 azkesz: I didn't yet read about the "->"

4:15 yes hyPiRion

4:15 tomoj: hyPiRion: in that case, my answer is "don't do that"

4:15 ro_st: Raynes: any idea how i'd serve a static file with Noir? not necessarily a file in /resources/public

4:15 azkesz: i only want to know how it can be done, i don't really want to do it :)

4:15 hyPiRion: You could do it by refering to the explicit namespace

4:15 tomoj: azkesz: er, that could have been written more easily

4:15 hyPiRion: (defn prn [x] (do (clojure.core/prn x) x)))

4:15 tomoj: (def foo (wrap-println (fn [x] (+ x 2))))

4:15 ro_st: i just need to know how to tell ring to serve up a file i tell it to

4:15 weavejester: ro_st: A file or a resource?

4:16 ro_st: a file

4:16 tomoj: azkesz: oh, define it twice in the same namespace, or in separate namespaces, like hyPiRion suggests?

4:16 weavejester: ro_st: You could just do (response (io/file "blah"))

4:16 ro_st: so i have a route /media/:uuid/:file and i want to use the uuid and file to find a file on disk and serve it up

4:16 boom :-) thank you weavejester!

4:16 weavejester: ro_st: Where response is from ring.util.response and io/file is from clojure.java.io

4:17 ro_st: Bastically just add a java.io.File object to the :body of the response.

4:17 ro_st: that's awesome, thanks

4:18 azkesz: that worked , as hyPiRion suggested, though I'm not really sure I got what's happening xD

4:18 oh right, it's redefined in my own user namespace?

4:18 ro_st: hey, so now that i have your attention. i want to serve a ring app in production, but i dont want to do the jar thing, because i want to be able to modify files in resources/public/ without having to recompile. apache currently has port 80 on the machine in question. what can i use?

4:18 azkesz: i see what you meant tomoj

4:20 weavejester: ro_st: You can run your web app with an adapter, then use Apache or Nginx to proxy HTTP requests to it.

4:20 ro_st: ahh, of course! forgot about proxy

4:20 weavejester: ro_st: If you're using "lein-ring" then you can run it with LEIN_NO_DEV=1 lein ring server

4:20 ro_st: any recommendations on the underlying web server to use? is jetty ok?

4:21 -java noob-

4:21 weavejester: ro_st: An embedded Jetty started by "lein ring server" should be okay.

4:21 ro_st: awesomesauce

4:21 weavejester: ro_st: Jetty is the server used for the official adapter

4:23 ro_st: LEIN_NO_DEV stops code reloading, i presume

4:23 tomoj: azkesz: if you did that you should do (ns foo (:refer-clojure :rename {prn core-prn})) (def prn [x] (do (core-prn x) x)))

4:23 ro_st: and stacktraces to the browser

4:23 azkesz: tomoj, very interesting

4:23 weavejester: ro_st: Yes, and in pre-2 Leiningen in prevents :dev-dependencies as well

4:24 ro_st: Lein-Ring uses it as a hint that development middleware is not needed

4:25 ro_st: But with profiles in Lein 2, you can fine tune it, e.g. by having a profile for production with :ring {:auto-reload? false :stacktrace? false}

4:26 ro_st: thanks WJ! appreciate the help

4:27 i only recently discovered the joy of code-reload in my compojure app. what a difference!

4:28 weavejester: ro_st: I actually need to take a look at wrap-reload. I've discovered rare instances where it doesn't seem to work as expected. I think it might be reloading the namespace, but then not reloading the dependent namespaces right or something. Most of the time it works find though...

4:29 ro_st: You could also try wrap-refresh, but you'll need lein-ring 0.7.2 for it to work right. :ring {:auto-refresh? true}

4:29 ro_st: how does that differ?

4:29 weavejester: ro_st: wrap-refresh needs wrap-reload to be useful

4:30 ro_st: wrap-refresh refreshes the browser via javascript when it detects a file change

4:30 ro_st: btw, CmdrDats is probably quite keen to know what you think of his pull-request on ns-tracker #justsaying

4:30 oooh. yes please

4:30 https://github.com/weavejester/ring-refresh ?

4:31 weavejester: ro_st: Yes, but if you're using Lein-Ring 0.7.2, it's included. You just need to add :ring {:auto-refresh? true} to your project.clj

4:31 ro_st: gotdcha

4:32 0.7.2 is new?

4:32 weavejester: ro_st: I replied to CmdrDats - I like his changes, but I think they belong in a different library. ns-tracker is just for tracking changes to namespaces, not for reloading them.

4:32 azkesz: CmdrDats had that nice minecraft plugin in clojure thing, I took a look, but I've much to learn about clojure first :)

4:32 weavejester: ro_st: Yeah. 0.7.1 also has wrap-refresh, but it's a version with several big bugs!

4:32 ro_st: 0.7.2 updates the version of wrap-refresh to fix them.

4:33 azkesz: is cljbin slow?

4:33 ro_st: azkesz: i can only imagine that'd be a fantastic way to learn clojure

4:34 azkesz: nvm, it loaded (the page) :)

4:35 any chance something like this would work? http://cljbin.com/paste/502e019de4b050e15148aab8 (just for proof of concept, not really gonna use it)

4:37 ro_st: weavejester: have you tested refresh with gzip middleware?

4:38 wow it works beautifully .. when gzip middleware is disabled :-)

4:38 weavejester: ro_st: Nooo… I can see why that wouldn't work. It would need to be *under* the gzip middleware

4:38 ro_st: But lein-ring only sees the outer part

4:39 ro_st: if you wrap your ring handler with dev-only middleware (like reload, stacktrace), how do you run that code in production with NO_DEV=1?

4:40 weavejester: ro_st: Well, lein-ring will add wrap-reload and wrap-stacktrace automatically for you if LEIN_NO_DEV is *not* set

4:40 ro_st: oh!

4:40 where is that documented?

4:40 weavejester: ro_st: If you want something in-app, you could use environment variables… which is where I'd recommend a small library called environ

4:41 ro_st: https://github.com/weavejester/lein-ring#starting-a-web-server

4:41 ro_st: that is awesome!

4:42 weavejester: ro_st: Are you using the Lein 2 preview, by any chance?

4:42 ro_st: things just got so much simpler

4:42 i am. i use 1 and 2 side by side

4:42 mostly 1, though

4:42 weavejester: ro_st: Environ needs Lein 2, but I've found it useful for managing configurations: https://github.com/weavejester/environ

4:43 ro_st: nice

4:43 can you mutate those values at runtime?

4:43 weavejester: ro_st: In development mode, you can specify configuration in your project.clj file, or in your ~/.lein/profiles. In production, you can run with environment variables, or with Java system properties

4:44 ro_st: No, it's an immutable map, but you could use that immutable map to populate an atom

4:44 ro_st: we currently use dynamic vars to store our System/getenv values, so that we can use binding to mutate them in midje contexts for testing

4:44 well, not mutate, rebind

4:44 weavejester: ro_st: I believe Clojure 1.3 or 1.4 has a function called with-redefs

4:45 ro_st: You can use it to redefine a var within a scope

4:45 jsyrjala: any idea when lein 2 is released? it is only preview 2.0 now

4:45 weavejester: ro_st: e.g. (with-redefs [env (merge env {:foo "bar"})] (your-tests))

4:46 jsyrjala: I imagine we'll be seeing a beta soon, as a lot of people are already using it a lot. But you'd have to ask technomancy :)

4:47 ro_st: here's what we do: https://www.refheap.com/paste/4440

4:47 works beautifully

4:47 i guess this is just as good as your with-redefs option, except yours supports the use of environ :-)

4:50 weavejester: ro_st: You approach will also work with older versions. Though I like with-redefs because it means I don't have to change my code to accomodate my tests.

4:50 ro_st: true

4:50 we're on 1.4 anyway

4:51 i like that environ supports project.clj too. great for long lived config variables and api keys that are server independent

4:52 azkesz: how can I undef a def-ed var?

4:54 weavejester: azkesz: ns-unmap

4:55 azkesz: (ns-unmap *ns* 'foo) should do it, I think

4:55 ro_st: *downloads weavejester's talk*

4:56 weavejester: what do you use for logging?

4:57 weavejester: ro_st: I haven't settled on something I like, yet...

4:57 azkesz: weavejester, thank you, that works awesomely

4:57 ro_st: have you seen timbre?

4:58 looks pretty good. i like that you can write your own appenders. so you could push data off to a store, or into an atom (which then gets retrieved and sent as a log of the work done in that web request, for eg) or whatever

4:58 https://github.com/ptaoussanis/timbre

4:59 all pure clojure, too. no log4j braindeath

4:59 jsyrjala: how about tools.logging?

4:59 ro_st: too much log4j braindeath :-)

4:59 vijaykiran: "tools.logging helps, but it doesn't save you from the mess of logger dependencies and configuration hell."

5:00 weavejester: ro_st: No, I hadn't seen timbre… hm...

5:01 ro_st: excellent. i got to pay you back, a little :-)

5:01 weavejester: ro_st: Ack, no, I don't like timbre so much now I look at it

5:01 ro_st: … or not. haha

5:01 why not?

5:02 weavejester: ro_st: Oops, sorry :)

5:02 ro_st: I've gotten used to treating log messages as maps

5:03 ro_st: but it is a map?

5:03 https://github.com/ptaoussanis/timbre#custom-appenders, 3rd last line of code sample

5:03 args map

5:03 weavejester: ro_st: The API isn't set up that way, though

5:03 sandbox: hi, does anyone here know things about clojure on heroku? specifically i've recently started getting an error deploying that states 'LEIN_NO_DEV=y: command not found'

5:03 ro_st: i believe you can pass anything to the logging fns

5:04 weavejester: ro_st: I mean, I can't write (log {:foo "bar"}). It assumes things like levels and messages and stuff

5:04 azkesz: in this example, how would I append the string " printed" after thoser args ?(I tried cons/conj they prepend): http://cljbin.com/paste/502e0881e4b050e15148aaba

5:05 sandbox: i'm not entirely sure how the heroku buildpack works but if someone knows and could help me out that would be greatly appreciated, otherwise i can wait for a response from heroku

5:06 weavejester: ro_st: The appenders of timbre look okay, but everything looks very traditional logging.

5:06 ro_st: And atoms for configs I don't like...

5:06 ro_st: what do you use?

5:07 some custom lashup? or tools.logging?

5:07 weavejester: ro_st: I've been developing some functions for myself, but nothing in a releasable state yet.

5:07 ro_st: i'm kinda surprised this particular thing isn't like totally solved for clojure already

5:07 clgv: cemerick: ping

5:07 ro_st: seems like it's the perfect problem for the solution that is clojure :-)

5:08 CmdrDats: i'd love general (log) function in clojure.core that does nothing until you plug in tools.logging or something

5:08 weavejester: ro_st: In my view, most logging libraries get it wrong, so even with Clojure, it'll take a while before it can be done right

5:08 I'm a little opinionated about logging :)

5:09 ro_st: heck, you could use lamina too, i guess

5:09 jsyrjala: i hope that it doesn't happen like in java: everybody creates their own logging thing, then it is noticed that they do not interoperate, then come logging facades

5:09 ro_st: instead of logging down to disk, you log up to the cloud

5:10 this talk was very interesting to me https://vimeo.com/45132054

5:11 weavejester: Yeah, Zach's talk helped form some of the opinions I have on logging

5:11 But I haven't completely finished thinking about it

5:12 Just enough to come to the opinion that most logging has historical routes in linear text logs

5:12 And what we really want is a database of maps

5:12 You'd need a timestamp, and who put the log in, but not necessarily levels or messages.

5:12 ro_st: yeah. i think a key mindset shift is moving away from an archive of activity to a firehose of 'now'

5:12 azkesz: datomic?

5:13 weavejester: datomic could do, but the pretty much anything would work...

5:13 hiredman: datomic scales reads, not writes

5:13 weavejester: ro_st: Exactly

5:13 azkesz: all writes are serialized? but not the reads?

5:14 weavejester: writes are atomic in datomic

5:14 But reads can be distributed

5:14 ro_st: what i like about lamina (if i understand it correctly) is that you just point it at your code and it instruments everything for you, no explicit logging calls.

5:14 azkesz: i like it, i wanna learn :)

5:15 ro_st: so you could just instrument and push all that data down some channel to a sink like a database or whatever, but at any time you can plug some viewer onto the channel and watch in real time

5:15 weavejester: ro_st: Yes, I like that approach… I'd need to think a little more about whether that's suitable in all circumstances, though.

5:16 ro_st: i speak from a standpoint of a complete lack of practical experience, of course. so i don't know how ideal that is in practice

5:16 weavejester: Anyway, I gotta go

5:20 clgv: does cemerick's add-classpath in pomegranate not work for java projects? I have the following failing scenario: (add-classpath "my-dep.jar") (import 'my.dep.SomeClass) which gives a ClassNotFoundException for my.dep.SomeClass. I thought that should work

5:32 tomoj: has defn metadata gone before the params with no ^ for a long time?

5:36 clojure-newcomer: hi guys, I'm able to check metadata on a function as it stands in the REPL…. but I can't check the metadata on the same function when it is passed as a param to another function… does that make sense ?

5:36 just trying to get my head round a little introspection

5:44 ro_st: that's because the meta is on the var, not the function the var points to

5:45 clojure-newcomer: ro_st: can I resolve the function to get to somewhere I can query the metadata ?

5:45 ro_st: i believe so, although i don't know how

5:45 clojure-newcomer: ro_st: or is that metadata lost to me the minute the fund goes into another func as a param ?

5:46 ro_st: http://stackoverflow.com/questions/5592306/how-do-i-dynamically-find-metadata-for-a-clojure-function

5:46 clojure-newcomer: ro_st: *func

5:46 ro_st: that link looks helpful.. ail lead through, thanks

5:49 ro_st: nice, all good, thanks for that

5:49 ro_st: cool

6:18 clgv: tomoj: since 1.2 at least

6:19 clojure-newcomer: you can create the variable name from the class name of a defn instance

6:20 clojure-newcomer: the stack overflow answer is cheating^^

6:20 at least the accepted

6:21 ,(class map)

6:21 clojurebot: clojure.core$map

6:21 clojure-newcomer: clgv: do you mean there are performance implications or complexity etc ?

6:22 clgv: clojure-newcomer: no. it just wont work, if you really get a function as object passed to a function where you want to query the metadata

6:22 ,(meta map)

6:22 clojurebot: nil

6:23 frank: Hi, could anyone help, I am having a wierd problem.

6:23 hyPiRion: frank: Ask the question instead of asking for help ;)

6:23 frank: I am getting the following error: Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: No reader function for tag ordered/map

6:24 when running "lein ring server"

6:24 weavejester: frank: What does your project.clj file look like?

6:24 frank: after running "lein new compojure hello-world; cd hello-world"

6:25 following the instruction in getting started in the compujure github page.

6:25 weavejester: frank: You haven't changed anything else?

6:25 frank: Nope, nothing

6:25 I just installed the newesrtversion of JDK 1.7 on the Mac

6:25 And ran lein upgrade

6:26 weavejester: Which version of Leiningen are you using?

6:26 frank: lein version │

6:26 Leiningen 2.0.0-preview8 on Java 1.7.0_06 Java HotSpot(TM) 64-Bit Server VM

6:28 weavejester: I'm on preview7 - let me upgrade to 8 and see if there's a problem.

6:28 frank: BTW, thx for the amazingly quick reply :-)

6:29 Ah, that could be it, am wondering though what it means, I find it a mysterious error message

6:30 weavejester: frank: I get the same error now in preview8

6:31 frank: Okay, mystery solved, now for the solution. What is going wrong you think?

6:31 azkesz: how to append an item to a list ?

6:32 bosie: do i always have to write (defn f [] …) if my function has no params?

6:32 clojure-newcomer: weavejester: a bit off topic sorry, but your username is cool… whats the story behind it ?

6:33 weavejester: clojure-newcomer: "them am weavejesters" was the best anagram that could be made out of my name

6:33 jsyrjala: bosie: yes

6:33 weavejester: azkesz: To the end of a list?

6:33 bosie: jsyrjala: ok

6:34 weavejester: frank: No idea… I'll need to investigate. Possibly a problem with eval-in-project.

6:34 clojure-newcomer: weavejester: definitely a good way to come up with a name

6:34 weavejester: clojure-newcomer: It worked for voldemort ;)

6:35 azkesz: yes

6:35 jsyrjala: bosie: or (def f (fn [] ...)), but that doesn't help much

6:35 azkesz: I tried cons/conj but they prepend instead

6:35 and I fail to find how to append, even though I'm betting it's expensive

6:37 weavejester, i need it for something like this(just for tests): http://cljbin.com/paste/502e1e5de4b050e15148aabb

6:37 frank: weavejester: ok, I will either downgrade to preview7 or spend some time looking at the changes to see if I can figure out what is going wrong. Not sure if my Clojure is up to snuff for that though

6:37 thx for the help

6:37 weavejester: azkesz: Why not use a vector?

6:38 frank: I'll look into this. It might be a bug in preview8, or it might be some incompatibility introduced. Maybe the syntax of a function is now different.

6:39 azkesz: weavejester, like convert args to vector ?

6:40 that works

6:40 weavejester: azkesz: what exactly are you trying to do…?

6:40 azkesz: something like this(works in repl, but it still prints the quotes around the string): http://cljbin.com/paste/502e1f35e4b050e15148aabc

6:41 clgv: azkesz: there is a better method to alter the output of print for a custom datastruture you use. it's defining an implementation of the multimetoh print-method for that type

6:41 azkesz: I'm trying to redefine prn(in my own ns for now) and still call the old prn, but with an extra parameter at the end

6:41 but I'm doing this just for tests, while learning clojure

6:42 clgv: azkesz: for learning clojure thats probably a weird idea ;)

6:43 azkesz: yeah I know but, it's kinda fun to do it this way, rather than just read a book(although I'm doing that too)

6:43 hyPiRion: I don't know, fogus usually implement parts of the language he learns.

6:43 And he seems like a smart guy.

6:43 clgv: hyPiRion: I meant it not in that generality ;)

6:43 clojurebot: Titim gan ?ir? ort.

6:44 hyPiRion: heh

6:44 antares_: Elastisch 1.0 RC1 is out: http://groups.google.com/group/clojure/browse_thread/thread/e7267051fd370e73 (or http://clojureelasticsearch.info)

6:45 azkesz: ok it basically works just like prn, but still I have to wonder, is it possible to append to a list directly?

6:45 returning the new list, ofc

6:46 hyPiRion: azkesz: Do you mean like ##(concat (range 4) [:foo]) ?

6:46 lazybot: ⇒ (0 1 2 3 :foo)

6:46 clgv: antares_: what is "elastic search" in comparison to "search"?

6:46 antares_: clgv: ElasticSearch is a distributed search engine, much like Solr but for modern age

6:48 azkesz: hyPiRion, yep that's the one

6:49 works as expected http://cljbin.com/paste/502e213fe4b050e15148aabd

6:50 clgv: antares_: that should be on the first page ^^

6:50 antares_: clgv: ElasticSearch is a pretty popular project and it is pretty easy to find the right site in google, I think most people will figure out what it is

6:50 bosie: huh, replace-first prints the output?

6:50 azkesz: I gotta say, clojure is the answer to my prayers :D all of those little things that I considered lacking in java, are "fixed" in clojure

6:51 clgv: antares_: ok. I just wanted to know what it is you are announcing to decide whether I am interested to read more ;)

6:52 antares_: I just asked since the start page of http://clojureelasticsearch.info/ didnt help me

6:52 antares_: clgv: if not, you can always go to clojurewerkz.org and find something more relevant to your needs :)

6:52 clgv: I understand, I will add a link to elasticsearch.org

6:57 bosie: now i get this error: ClassCastException java.lang.String cannot be cast to java.lang.Number clojure.lang.Numbers.equiv (Numbers.java:206)

6:57 i know what causes it but how would i get from this exception to the actual line?

7:02 antares_: bosie: it should be there in the full trace

7:02 bosie: antares_: hm. repl doesn't output a full trace by default?

7:03 azkesz: what's the command for showing the last stacktrace ? I see ccw has the button for it

7:04 I mean, if there's a function for it or maybe a dynamic variable like how *clojure-version* is

7:05 or like ##*source-path*

7:05 antares_: bosie: correct

7:05 azkesz: ,*source-path*

7:05 clojurebot: "NO_SOURCE_FILE"

7:05 bosie: antares_: lemme check

7:06 hyPiRion: azkesz: ##(pst) ?

7:06 lazybot: java.lang.RuntimeException: Unable to resolve symbol: pst in this context

7:06 hyPiRion: ,(doc pst)

7:06 clojurebot: "([] [e-or-depth] [e depth]); Prints a stack trace of the exception, to the depth requested. If none supplied, uses the root cause of the most recent repl exception (*e), and a depth of 12."

7:06 azkesz: ##(*clojure-version*)

7:06 lazybot: clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentArrayMap

7:06 azkesz: thanks hyPiRion =)

7:06 hyPiRion: Anytime.

7:07 azkesz: that worked the pst

7:09 bosie: antares_: so the standard procedure is to use "java -cp …. clojure.main -i bla/bla/bla.clj" ?

7:09 azkesz: symbols like *e are thread local dynamic and like *err* *in* *out* are global dynamic ? is that the convention(or where can i read about this exactly)

7:09 antares_: bosie: the standard procedure is to use leiningen and lein run

7:10 bosie: or use something like SLIME that will always output full traces

7:10 bosie: k

7:10 antares_: bosie: leiningen.org has all the info about getting lein ;)

7:10 (and don't worry about 2 not being final yet, many many active projects have been using it for a while)

7:11 azkesz: I see that binding can make any *var* to be threadlocal inside the binding block

7:11 bosie: i have lein already

7:12 antares_: azkesz: http://tech.puredanger.com/2010/02/17/clojure-stack-trace-repl/

7:12 bosie: thanks antares_

7:13 magopian: ,(take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))

7:13 clojurebot: (0 1 2 3 4 ...)

7:13 magopian: so strange, it looks instant, however it timeouts on 4clojure Oo

7:18 azkesz: ,(print-cause-trace *e 3)

7:18 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: print-cause-trace in this context, compiling:(NO_SOURCE_PATH:0)>

7:19 azkesz: ,(pst)

7:19 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.lang.Throwable>

7:19 weavejester: frank: Lein-Ring 0.7.3 now works for preview8

7:19 nbeloglazov: &(time (doall (take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))))

7:19 lazybot: ⇒ "Elapsed time: 189.69069 msecs" (0 1 2 3 4 5 6 7 8 9 11 22 33 44 55 66 77 88 99 101 111 121 131 141 151 161)

7:20 nbeloglazov: ,(take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))

7:20 clojurebot: (0 1 2 3 4 ...)

7:20 nbeloglazov: ,(time (doall (take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))))

7:20 clojurebot: "Elapsed time: 10.978599 msecs"

7:20 (0 1 2 3 4 ...)

7:20 nbeloglazov: &(time (doall (take 1000 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))))

7:21 azkesz: "Elapsed time: 306.868192 msecs"

7:21 nbeloglazov: :)

7:21 hyPiRion: magopian: Clojail is a bureaucratic jail, where everything takes time.

7:21 nbeloglazov: ,(time (doall (take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))))

7:21 clojurebot: "Elapsed time: 5.292717 msecs"

7:21 (0 1 2 3 4 ...)

7:22 nbeloglazov: magopian: are you sure it timeouts on simple tests? Not on hard?

7:22 azkesz: ,(time (reduce + (doall (take 1000 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0)))))

7:22 clojurebot: "Elapsed time: 487.041191 msecs"

7:22 40634649

7:23 bosie: is this wrong for :dependencies in project.clj "[org.clojure/clojure "1.4.0"]"}

7:23 ?

7:23 no works

7:23 nvm

7:23 hyPiRion: seems good

7:23 azkesz: yeah I have the same thing

7:25 how would one return the printed string instead of (just) printing it ##(time 1)

7:25 lazybot: ⇒ "Elapsed time: 239.320027 msecs" 1

7:25 magopian: nbeloglazov: no clue, maybe it does timeout on hard ones, i just thought it would pass the first one (the easy one ;) green before timeouting on the others, seems i was wrong

7:25 Sweden_jack: azkesz: You want to print to string?

7:26 azkesz: Sweden_jack: time already prints it, but what if I wanted to return it, as a function return value?

7:26 hyPiRion: azkesz: ##(with-out-str (time 1))

7:26 lazybot: java.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!

7:26 hyPiRion: Try it in your own repl.

7:26 Sweden_jack: Did you try googling "print to string Clojure"?

7:26 azkesz: yeah that works hyPiRion

7:26 I didn't Sweden_jack :)

7:27 Sweden_jack: Seems to me like that finds what you're looking for :)

7:27 magopian: nbeloglazov: i wanted to try the "obvious" solution first ;)

7:27 i'm gonna think about the "good" one now

7:28 (well, think about how to program it, i think i know what the solution should be)

7:28 azkesz: Sweden_jack, you're probably right, but I'm happy with hyPiRion's solution, also interesting to see ##(source with-out-str)

7:28 lazybot: java.lang.RuntimeException: Unable to resolve symbol: source in this context

7:28 magopian: ,(source with-out-str)

7:28 clojurebot: Source not found

7:28 magopian: $(source with-out-str)

7:28 Sweden_jack: azkesz: http://clojuredocs.org/clojure_core/1.3.0/clojure.core/with-in-str

7:29 magopian: wrong one ;)

7:29 Sweden_jack: Oops, http://clojuredocs.org/clojure_core/clojure.core/with-out-str

7:29 ;P

7:30 azkesz: awesome, how did you get that url ? I'm hoping from some script?

7:30 or just type in that search bar?

7:31 I wonder if clojure bots could trigger on source and show an url instead

7:31 Sweden_jack: azkesz: I personally used a keyword search (http://kb.mozillazine.org/Using_keyword_searches) but ClojureDocs generally shows up in search results as well

7:31 nbeloglazov: $cd with-out-str

7:31 lazybot: clojure.core/with-out-str: http://clojuredocs.org/v/1652

7:31 clojure.core/with-out-str: http://clojuredocs.org/v/5848

7:32 nbeloglazov: $source with-out-str

7:32 lazybot: with-out-str is http://is.gd/3ZQwpP

7:33 nbeloglazov: azkesz: you can use cd or source command for lazybot ^^

7:33 hyPiRion: azkesz: That should be doable - would probably be some fork.

7:33 azkesz: thank you, that's very clever

7:33 hyPiRion: ~botsnack

7:33 clojurebot: Thanks! Can I have chocolate next time

7:33 hyPiRion: ~chocolate

7:33 clojurebot: It's greek to me.

7:33 azkesz: lol

7:34 Sweden_jack: (don't feed it chocolate...)

7:34 nbeloglazov: only source seems broken in lazybot :(

7:34 azkesz: it worked for me, but for 1.2 branch

7:35 in this line: (let [s# (new java.io.StringWriter)] is s# the name of the variable ? or something special about it?

7:35 Sweden_jack: azkesz: it's a macro thing

7:36 hyPiRion: Yeah, you should learn macros before diving into gensyms and backquotes.

7:36 Sweden_jack: It basically creates a new symbol with a unique name, it's generally a bit neater than in Common Lisp

7:36 azkesz: oh i see, ##(`(x#))

7:36 lazybot: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn

7:37 Sweden_jack: azkesz: (maybe wait a bit before diving into macros)

7:37 azkesz: alright, back to reading

7:38 I'm only like page 77 of manning clojure in action

7:38 hyPiRion: azkesz: It's a thing to look forward to though. It's a very powerful construct. Keep it like a carrot to continue learning Clojure ;)

7:38 azkesz: though I can't promise I'll remember anything:))

7:40 but in that context, why was it necessary to generate uniquely named local variable, it's not like it would overwrite (locally) some other same named variable right?

7:40 i mean here: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L4181

7:41 Sweden_jack: azkesz: Do you know how macros work?

7:41 hyPiRion: azkesz: Imagine if it was just (let [s (new StringWriter)] ...) instead.

7:41 azkesz: nope but I can guess why it was needed now lol

7:42 Sweden_jack: If you don't create a variable with a unique name it might capture some non-free variable outside of the macro

7:42 hyPiRion: then doing (let [s "hello"] (with-out-str (println s))) would expand to (let [s "hello"] (let [s (new StringWriter)] ... (println s))), which screws you up

7:42 azkesz: understood, that makes sense now

7:44 ,`(x#)

7:45 clojurebot: (x__27__auto__)

7:45 Sweden_jack: ,(gensym)

7:45 clojurebot: G__56

7:45 azkesz: ,(gensym)

7:45 clojurebot: G__83

7:46 azkesz: is it ever possible that the body could've already manually defined a variable which the next s# or gensym would create? or they auto detect if that variable was already taken and advances the counter to try next one?

7:46 hyPiRion: azkesz: Nope, it's impossible.

7:47 bosie: antares_: ok, so i got it to work with leiningen

7:48 antares_: but lein run is even slower than my regulara java apps (due to compiling)…. kinda defeats the purpose no?

7:48 antares_: bosie: it is very common to use REPL during development, with something like SLIME/swank or nREPL

7:49 I was saying that once you need to run an app, it is very uncommon to do it the way you run ruby or python programs (for example)

7:49 bosie: antares_: honestly, i use vim/intllij ;)

7:49 antares_: the same goes for lein test, SLIME/swank and probably vimclojure stuff lets you run tests without JVM restarts

7:49 as for La Clojure, I am not sure. I only use IDEA for Java :)

7:50 bosie: I am pretty sure VimClojure has support for this. Maybe ask on the mailing list? Sorry, I am an Emacs/IDEA user and can't help with that.

7:50 azkesz: looks like the counter increases directly proportional with the number of chars that I type in repl (except spaces) (in eclipse+ccw at least), I found that interesting :)

7:50 bosie: antares_: coming from java, i would just miss all the goodies from intellij in vim ;(

7:51 hyPiRion: bosie: Both vim and emacs are extensible, so you can add those features if you want to :)

7:51 I would be surprised if not someone has done something like that already.

7:51 antares_: bosie: La Clojure has REPL integration but probably not test runner that reuses the same JVM

7:51 bosie: hyPiRion: it is undone for java… would be surprisd if it were happening for clojure

7:51 antares_: hyPiRion: it will be pretty hard to implement Clojure/Java completion IDEA has

7:52 bosie: hyPiRion: rubymine beats vim, easily. which i hate

7:52 antares_: emacs and vim can do not-so-trivial completion but only with SLIME and without interop awareness

7:53 bosie: antares_: i only know what rubymine is capable of and that is miles ahead of vim

7:53 antares_: bosie: Vim for Ruby and SLIME are not really comparable

7:53 SLIME has code structure awareness, that's its main purpose

7:54 bosie: antares_: right. i don't know slime

7:54 antares_: so slime does refactoring?

7:54 rbarraud: How about jack? ;-)

7:55 antares_: bosie: for Clojure it cannot do everything (you need to implement some adapters for every Lisp) but for Common Lisp it does

7:55 bosie: antares_: cool

7:55 antares_: and "find callers" kind of navigation

7:55 like Find Usages in IDEA

7:55 bosie: you can also try Nailgun

7:55 which is not specific to any JVM language

7:56 bosie: antares_: and create variables/methods/extract methods etc?

7:56 antares_: and override the command IDEA runner uses to run things over Nailgun

7:56 bosie: k

7:57 antares_: bosie: SLIME is a huge project and I don't know all of its capabilities but I don't think it focuses on refactoring operations like those you've mentioned

7:58 mostly navigation and find usages kind of things, documentation, REPL-oriented development

7:58 like eval-ing a region or buffer or form

7:58 bosie: but it basically allows me to change a line in a code that is currently running and it dynamically loads those changes ?

7:58 hyPiRion: bosie: change function definitions, yeah

7:59 and defs.

7:59 antares_: bosie: you will need to re-eval it (like the entire buffer/file) if your tools don't do that but yes, it sends code to the JVM you already ahve running and it is compiled and reloaded there

7:59 clojure-test-mode in emacs does it for you, you don't need to re-eval test files

7:59 or implementation files, for that matter

8:00 just hit C-c C-, and see a green or red line

8:00 bosie: was more thinking along the lines of changing some number and see the changes right away

8:00 antares_: edit something, save, repeat

8:00 bosie: not necessarily about tests, but that is cool too

8:00 thanks guys

8:00 antares_: bosie: in that case you can either use a REPL buffer or reinstall a function with C-x C-e

8:00 bosie: appreciated

8:00 XPherior: Can anyone help me write a macro to take a form and double it? IE (the-macro '(a b)) => ((a b) (a b))

8:00 bosie: gtg

8:00 antares_: REPL buffer is basically REPL inside your editor, so you can do multi-line editing easily

8:01 XPherior: something like (defmacro doublah [form] `(do ~form ~form)) ?

8:02 XPherior: the key for macros that produce lists of forms is to not forget the (do …) part

8:02 XPherior: antares_: Ah. Yeah that's what I was missing. Also, I was trying to splice it with ~@

8:03 antares_: XPherior: you can use splicing if you want, too

8:03 as long as that's a collection

8:04 XPherior: antares_: Hm, okay. Thanks :)

8:07 Be right back.

8:40 Why does: (defmacro show [body] `(do ~body ~body)) and (show '(1 2)) return (1 2) ?

8:40 I'd expect it to spit back ((1 2) (1 2))

8:41 stuartsierra: When you "invoke" a macro, the expression it returns gets evaluated.

8:41 XPherior: stuartsierra: Right. So how is it possible that my expectations evaluate to (1 2)?

8:42 stuartsierra: `do` returns the value of the last expression inside it.

8:42 XPherior: ... Doh

8:42 How does one return multiple forms from a macro, then?

8:43 stuartsierra: return a list

8:43 XPherior: Oh wait! I did it! `'(~body ~body)

8:43 hyPiRion: XPherior: Wrap it in vector or list

8:43 XPherior: I was really overthinking this one.

8:46 jweiss: is there a clojure FAQ somewhere that includes common pitfalls like "map is lazy"?

8:47 stuartsierra: clojurebot: faq?

8:47 clojurebot: FAQ #1 is http://groups.google.com/group/clojure/msg/8fc6f0e9a5800e4b

8:48 stuartsierra: ok, that's not what I meant

8:48 http://dev.clojure.org/display/doc/FAQ

8:49 jweiss: that doesn't include the "map is lazy" problem

8:49 stuartsierra: So add it.

8:49 jweiss: ok :)

8:49 would that require a signed contrib agreement?

8:50 stuartsierra: oh shucks, I don't know

8:50 probably yes, because that's how you get wiki edit access

8:50 jweiss: i'll try, probably about time i signed the agreement anyway

8:50 stuartsierra: thanks

9:06 N8Dawg: Hello Clojurists, I was wondering, a want a collection type which is non-standard, its basically a sorted-set-by but of a max-size, items can only be added when the set is full by displacing an existing item

9:06 basically, is there one out there already, or if not how would one go about building one?

9:07 hyPiRion: what do you mean by "displacing an existing item"?

9:07 Should the structure remove the item for you, or should you get an error when it is full?

9:08 N8Dawg: it should remove and add the new item

9:08 hyPiRion: What item should it remove?

9:08 N8Dawg: basically imagine i want the top 100 items of a seq with is 10000000 items long

9:08 i could sort the entire set and take 100

9:08 which is inefficient

9:09 nz-: N8Dawg: https://github.com/clojure/core.cache

9:09 N8Dawg: or I could build this collection type and reduce across irt

9:09 hyPiRion: Use priorityqueue

9:09 Let me look it up

9:11 N8Dawg: nz-: So you suggest building something like a max-cache of a fixed size

9:11 hyPiRion: Okay, what you want is something like a max heap with a fixed size.

9:12 tomoj: every function has its own class, yes?

9:12 N8Dawg: hyPiRion: Yes if the heap is sorted

9:13 nz-: N8Dawg: well, cache doesn't provide ordering, so it wont suit you

9:14 clgv: tomoj: yes

9:14 tomoj: so might it make sense to extend protocols to function's classes?

9:16 hyPiRion: I thought this was something already implemented. Huh.

9:17 clgv: tomoj: no idea. why do you want to do that?

9:17 ,(class map)

9:17 clojurebot: clojure.core$map

9:18 N8Dawg: hyPiRion: Basically i'd like to wrote something like: (reduce conj (bounded-sorted-set 100) collection)

9:18 clgv: tomoj: or do you mean extending a protocol to clojure.lang.Fn?

9:18 tomoj: no

9:18 clgv: ,(-> map class ancestors)

9:18 clojurebot: #{clojure.lang.IFn java.lang.Object java.lang.Runnable java.util.concurrent.Callable clojure.lang.IObj ...}

9:18 hyPiRion: N8Dawg: Yeah, I realized.

9:19 tomoj: I'm thinking about automatic differentiation

9:19 clgv: how would you differentiat `map`?

9:19 tomoj: I considered a metadata flag, but then I have to maintain a special list of exceptions

9:19 or vary-meta

9:20 alter-meta! or whatever

9:26 well I would extend Differentiable to map and put the implementation there

9:26 it would assume f is Differentiable

9:26 are you asking what the implementation is?

9:27 clgv: tomoj: you do this as a hobby project or for work?

9:28 tomoj: I'm not doing it yet, just thinking about it. hobby (that could someday be useful for work..)

9:30 hyPiRion: N8Dawg: I would just use (take 100 (sort ...)) as a temporary solution, and try to look up some PriorityQueue with a fixed size

9:31 Someone really should have made one.

9:31 clgv: tomoj: well in most interesting cases you would have to differentiate numerical...

9:31 tomoj: not in the cases I am interested in

9:31 clgv: polynomials?

9:31 tomoj: mostly simple matrix math, some simple nonlinearities

9:32 clgv: ok

9:32 tomoj: basically I want to port theano to clojure

9:33 to my knowledge they don't need to use numerical methods for the derivatives, but I could be wrong

9:35 jsabeaudry: Is org.clojure/tools.logging the general consensus when it comes to logging?

9:55 acheng: /msg leafw ping

9:55 Chouser: that didn't work.

10:06 acheng: i have this impression that jobs-where-clojure-is-one-of-the-main-languages-used are few and therefore require more programmer-skill to get than jobs for other languages. is this accurate or inaccurate?

10:08 nDuff: acheng: Folks with production experience with Clojure are also fairly few.

10:09 Wild_Cat: as a non-mainstream language, Clojure requires, by definition, that you have invested some time of your own to learn it. Which usually implies more skills or at least more curiosity than the norm.

10:09 acheng: nDuff: heh, my users are co-workers so i don't count

10:09 hyPiRion: acheng: It's a good conclusion, but I disagree with the reasoning to the conclusion.

10:09 acheng: hyPiRion: what's a better reason?

10:09 nDuff: acheng: ...I can't give you a definitive answer, but last time I was job-hunting, there was at least one shop that was willing to hire me for a Clojure-centric position despite having only hobbyist experience at the time.

10:10 acheng: nDuff: did you take it? :)

10:10 nDuff: acheng: ...granted, they were willing to hire me largely because I had experience in large-scale provisioning and deployment automation

10:10 acheng: No.

10:10 Chouser: acheng: that may be. I know there are a few places hiring Clojure devs that are having some trouble finding applicants that match their requirements.

10:11 acheng: a recruiter just told me to learn scala instead.

10:11 sigh

10:12 * nDuff intends to learn scala, and is hoping that his experience in thinking functionally will translate.

10:12 acheng: sure i'll learn both. but i'm pretty sure i know which i'll always prefer

10:12 Wild_Cat: in my (very) humble opinion, if you're going to learn a language like Scala, you might as well go all the way and learn Haskell instead

10:12 hyPiRion: arbscht: I haven't solid evidence, but I believe that companies who see the value of Clojure have bosses with higher technical competance than other bosses.

10:12 Chouser: I think most shops that have chosen Clojure want a small team of top notch devs. Therefore getting a Clojure job right now may require one to be able to demonstrate they are top notch.

10:13 LonoCloud is hiring top notch Clojure devs: http://lonocloud.com/careers.html

10:14 nDuff: *nod* -- they're the folks I was talking to

10:14 hyPiRion: And I usually consider higher technical competance in a boss as higher technical competance in their underlings.

10:14 scriptor: once you understand FP, haskell isn't even that hard

10:14 but a lot of companies seem to be starting to tinker with scala

10:14 Chouser: nDuff: May I ask why it didn't work out?

10:14 acheng: are there Haskell jobs?

10:15 scriptor: some, not as widespread

10:15 nDuff: Chouser: Something came up with offices in Austin and extremely competitive pay

10:16 Chouser: I think Relevance is also hiring

10:16 acheng: the class i took in haskell/ml was dominated by a jerk who sat down front -- he'd ask questions every two minutes that no one else could hear and it totally disrupted the lecture flow.

10:16 hyPiRion: Yeah.

10:16 Chouser: nDuff: Ah, sure. What language are you using there?

10:16 scriptor: Chouser: do you have to relocate to NC?

10:16 xeqi: wow, you have to download a pdf to see the job description

10:16 Chouser: scriptor: I don't think so.

10:16 nDuff: Chouser: They're officially a Java shop, but as I'm my own team, I can get away with Clojure for most things.

10:16 Chouser: nDuff: cool.

10:17 acheng: nDuff: your team consists of you? :)

10:17 Wild_Cat: scriptor: well, I've dabbled in Haskell, and kept finding things about its purity and balls-out laziness that disrupted my workflow more than it helped me.

10:18 nDuff: acheng: *nod*. Not as fun as it sounds -- place drew me in by interviewing with some of the smartest people I've met, and then I barely work with them in practice.

10:18 Wild_Cat: ...that, and the community, while helpful, felt far too buried in PL theory and academic research for my tastes.

10:19 scriptor: hmm, I'll have to keep relevance in mind next time I go lookin

10:19 Chouser: scriptor: and LonoCloud, right? :-)

10:19 Wild_Cat: (hence my learning Clojure, which, ironically for a Lisp, feels a *lot* more practical -- plus, I'm finally starting to get the elegance of the Lisp idiom)

10:19 scriptor: Chouser: eww california ;)

10:20 Chouser: scriptor: just to visit! It's a fully distributed team

10:20 scriptor: oh, really?

10:20 * scriptor goes back to investigate

10:20 xeqi: nDuff: is there a clojure group in austin?

10:20 Chouser: And visiting San Diego occasionally is quite nice.

10:20 nDuff: xeqi: Yup -- just had a meetup this Monday

10:20 scriptor: I've gotten too used to non-telecommuter jobs where I just look at the location and leave

10:20 redinger: scriptor: No, Relevance doesn't require relocation to NC

10:20 Wild_Cat: while we're on the topic of user groups: is there one in Montreal?

10:20 acheng: if y'all could be a bit dumber, i'd stand a chance at being average :-P

10:21 xeqi: ah, http://www.meetup.com/Austin-Clojure-Meetup/ it looks like

10:21 * nDuff might well end up in ca.us -- the wife-to-be wants to be somewhere more conducive to her acting career, and a lot less hot.

10:21 scriptor: redinger: are all interviews over the phone/skype?

10:21 jkkramer: is there something like a clojure-jack-out command? slime-disconnect doesn't appear to kill the swank server

10:21 scriptor: Chouser: it is, been there once a while ago

10:21 redinger: scriptor: We do a phone interview, tech screen and remote pairing session. Then we bring you into the office for a day with the team here

10:21 * Chouser wonders if he and redinger should disclose their affiliations. :-)

10:21 stuartsierra: jkkramer: At the SWANK REPL, type a comma then type "quit"

10:21 Chouser: ah, there you go.

10:22 redinger: But, half of our team is remote

10:22 Chouser: I work at LonoCloud in case that wasn't yet obvious.

10:22 acheng: stuartsierra: is that different than sayoonara?

10:22 stuartsierra: acheng: I don't think so

10:22 acheng: stuartsierra: ok. just cultural preference :)

10:22 scriptor: Chouser: figured, prinicipal software engineer eh?

10:23 jkkramer: stuartsierra: thanks. forgot about the comma commands

10:23 scriptor: will let you know once I have 8 years of experience

10:27 Chouser: scriptor: ok! or when you become as capable as someone who has 8 years experience...

10:33 cshell_: redinger: where do you work?

10:33 redinger: cshell_: Relevance

10:35 bosie: what does ~ do?

10:35 nDuff: bosie: inside a syntax-quote, it causes something to not be treated as quoted.

10:36 bosie: k

10:36 nDuff: bosie: ..."unquote" is the keyword to search for in the docs.

10:37 cshell_: redinger: ah cool - I came into the conversation late, who is hiring a principal software engineer in Clojure?

10:37 redinger: cshell_: Lonocloud

10:37 * nDuff is (job-wise) an odd duck -- he's a damned good system-level developer or ops automation type, but mediocre at application-level development. This last career move, being more towards app work, feels like a mistake.

10:37 ejackson: how about an unprincipled one ?

10:37 nDuff: ...in hindsight, Lonocloud may have actually been a better choice, with the position in question being ops-automation-centric.

10:37 cshell_: redinger: thanks

10:37 redinger: ejackson: I think they are all set in that dept. ;)

10:38 Chouser: ejackson: not interested, thanks. ;-)

10:38 hey!

10:38 ejackson: hehehe

10:40 cshell_: Chouser: that posting looks like it's from March - are you having trouble finding the right person?

10:42 or is it just that you only hire principal software engineers? :)

10:42 bosie: whats a principal software engineer?

10:42 Chouser: cshell_: I think it's more than just one position. We've hired a few people since March

10:43 cshell_: Chouser: cool, what % of your code is Clojure?

10:45 Chouser: oh, probably around 90%. There's some JS for the browser (though that's being transitioned to clojurescript now) and some Java for providing interop for customers.

10:45 bosie: Chouser: do you have problem finding _high quality_ clojure programmers in your area?

10:46 cshell_: Chouser: or just clojure programmers in general?

10:47 Chouser: bosie: we're very intent on adding only high quality devs to the team, so that does narrow the pool, but we hire from all over the country. In fact I think we now have devs working from each time zone of the US.

10:48 jsabeaudry: Wild_Cat, yes there is, it's called Bonjure

10:48 bosie: Chouser: oh, you are doing remote hiring. that should of course solve your problem ;)

10:48 cshell_: that's awesome, I think that's a good philosophy to follow - hire the best regardless of where they live

10:49 Chouser: bosie: well, helps. :-)

10:50 Wild_Cat: jsabeaudry: ah, nice, I'll check it out once I come back from my vacation in France

10:51 Chouser: we just had our (roughly quarterly) physical meeting a couple weeks ago. This time they put us up here: http://goo.gl/maps/tuCZX

10:53 clgv: Chouser: I hope there was no formal dresscode required ;)

10:55 Chouser: no, though we did have lunch at a place one day that required collared shirts and close-toed shoes. Caused a bit of a panic among the team, but it worked out ok.

10:56 scriptor: but you could still wear jeans?

10:56 bosie: Chouser: cos you guys figured out you could order online? ;)

10:56 Chouser: scriptor: heh, yes.

10:58 bosie: whats wrong here: (defn current-path ((java.io.File. "") .getAbsolutePath))

10:58 S11001001: bosie: files aren't functions

10:58 Wild_Cat: bosie: you're missing the argument vector here.

10:59 bosie: Wild_Cat: thanks

10:59 Wild_Cat: ...in fact, you probably want a regular def, not a defn -- or possibly even a let binding.

10:59 wait, nevermind that.

11:00 scriptor: Chouser: what kind of stuff do you guys typically work on? I see mentions of distributed archs and clouds

11:00 bosie: Wild_Cat: and i also have to swap the two things

11:00 Wild_Cat: yup.

11:00 bosie: Wild_Cat: (.getAbso (java.io.file "")

11:00 logical

11:00 dan

11:02 Chouser: scriptor: yep, distributed algorithms and services, virtual resource management, basically all the tricky bits needed by most of the more complex apps as they transition to the cloud.

11:03 making use of all the normal clojure tech, but in some areas using ClojureScript, core.logic, or monads as appropriate.

11:04 bosie: Chouser: distributed algorithms in the cloud? hadoop replacement?

11:04 scriptor: where does the distributed bit come in, managing all the machines behind the cloud?

11:05 Chouser: bosie: oh, I don't think that's quite an accurate characterization. But there are contexts where hadoop is not currently a good choice, such as if the pool of servers used needs to change dynamically during a long run or for other reasons.

11:06 bosie: Chouser: or if you want to run it quickly on less than 5TB of data ;)

11:08 Chouser: scriptor: that, but also providing libraries for developers of apps that need to span multiple servers

11:08 bosie: :-)

11:12 azkesz: ,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))

11:12 clojurebot: ((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))

11:40 rhickey: agent users - more pool flexibility: https://github.com/clojure/clojure/commit/f5f4faf95051f794c9bfa0315e4457b600c84cef

11:40 configure the global pools and send-via a specific executor

11:41 cshell_: sweet, rich!

11:41 trptcolin: fantastic - thanks!

11:42 stuarthalloway: I think it needs some type checking and error messages to prevent misuse :-)

11:42 trptcolin: any plans for something similar for futures?

11:42 hyPiRion: Ah, decoupling. Nice.

11:43 cshell_: it always feels great to decouple

11:43 Chouser: excellent

11:45 rhickey: futures will get same soon

11:45 hoping to build future pool in ForkJoin

11:45 on

11:46 dnolen: nice

11:46 nDuff: Very nice.

11:46 rhickey: gotta run, have fun!

11:46 trptcolin: nice. and i just realized futures' executors will be customizable already because they use Agent/soloExecutor under the hood. seem right?

11:46 Chouser: send-via is key. I have converted code from using agents to using executors directly because of not having this.

11:46 * nDuff is having trouble with more agents than he can afford running memory-intensive operations

11:46 nDuff: ...being able to have a separate pool for those would be very convenient.

11:47 trptcolin: although since the executor static you probably want more flexibility with futures anyway (per-execution)

11:48 bosie: how is clojure financed these days?

11:48 back when i first looked at it it was through donation

11:48 nDuff: bosie: Many of the core contributors are employed by Relevance, which does consulting/training/whatnot

11:49 bosie: k

11:51 pjstadig: how does this affect shutdown-agents?

11:51 i guess you're responsible for your own pools

11:54 y3di: so is disclojure gone for good?

11:56 trptcolin: pjstadig: looks like shutdown-agents calls .shutdown on both soloExecutor and pooledExecutor, so assuming your executor honors those, wouldn't it be fine?

11:57 derp, of course i totally missed the binding version

12:06 antifuchs: hugod: so ritz is failing to install deps for me when trying to get leiningen:leiningen:jar:2.0.0-SNAPSHOT

12:06 hugod: this seems immensely weird, what's going on? (:

12:09 hugod: antifuchs: ah - leiningen doesn't publish snapshots - I had those in my local repo. I'll change them to preview8, hold on.

12:09 antifuchs: heh. I dropped the :dev dependencies for now (:

12:12 hugod: how do you try out ritz vs emacs?

12:12 hugod: as in, how do you run it? (:

12:12 TimMc: reiddraper: ^ see rhickey's ANN above re configuring agent threadpools

12:12 hugod: i do `lein ritz` and then M-x slime-connect

12:13 antifuchs: hugod: it seems to have some stale source's code somewhere

12:13 complains about symbols in a line that I fixed. do you compile anything / deploy somewhere?

12:14 my question is, how do you test your development version while you develop?

12:15 ("test" is a loaded term, let's say "use") (:

12:22 hugod: antifuchs: ritz runs two vms - the "debugger" and the "user" vms for want of better names - there is no way to eval code in the debugger vm, but you can eval code normally in the user vm

12:23 this is something that I fixed in the nrepl-ritz, which can eval code in either vm, which makes dev much more pleasant

12:24 antifuchs: yeah, I don't really mind that. I just want the most convenient way to run the code that is currently in my ritz checkout as a swank server

12:24 right now, it's loading stale code ):

12:24 so the swank server can't start up, and no amount of lein clean'ing fixes it ):

12:25 hugod: this is lein2 I take it

12:26 antifuchs: yeah (:

12:27 technomancy_: weavejester: what exactly was the trouble you were seeing with tagged literals in lein-ring?

12:27 hugod: antifuchs: did you run `lein install` in lein-ritz too?

12:28 weavejester: technomancy_: I was passing the project map to a function via eval-in-project

12:28 antifuchs: I think I did try

12:28 weavejester: technomancy_: As I didn't want to put too much logic in the plugin, I just passed the whole map

12:28 technomancy_: weavejester: oh, so the form would fail if the project didn't have ordered and clojure 1.4?

12:28 weavejester: technomancy_: But in preview8, the map contains an ordered map literal

12:28 technomancy_: Yep

12:28 technomancy_: I see. hrm.

12:28 hugod: antifuchs: each version of lein-ritz tries to load it's corresponding version of ritz. So in profile.sclj you'll need 0.4.0-SNAPSHOT as well

12:29 weavejester: technomancy_: I solved it just with select-keys - taking only the keys I needed

12:29 technomancy_: I think that's the right solution, I'm just concerned that breakage is going to happen elsewhere.

12:29 hugod: antifuchs: or RITZ_VERSION=0.4.0-SNAPSHOT lein ritz should work with any version of lein-ritz

12:29 technomancy_: the problem is that bugs coming from unordered :repositories would be very nasty and hard to track down =\

12:30 weavejester: technomancy_: Yeah, I probably shouldn't be passing the whole project map in anyway

12:31 technomancy_: well... not in this context anyway

12:31 dsantiago: is this going to cause trouble for configleaf?

12:32 antifuchs: ohhhhhh

12:32 hugod: oho, that might do it. will try when I get home!

12:55 hugod: that RITZ_VERSION string works, but it seems I have to "lein install" in the ritz dir every time

12:56 ah, hm, appears I can do this in the ritz/ dir too, not only the ritz/lein-ritz dir

12:58 hugod: antifuchs: right, to run your local changes you will need to be in the ritz dir

12:58 antifuchs: ok, cool.

12:58 think I got it now (:

12:59 now, to debug why this isn't connecting (:

12:59 hugod: a lot of pieces to get right...

12:59 technomancy_: any windows users running into this? https://github.com/technomancy/leiningen/issues/674

12:59 hugod: antifuchs: 'lein ritz 4005 localhost :log-level :trace' will give you a ton of output

13:00 antifuchs: yeah, it's what I'm doing now (:

13:00 (just not getting a ton of output. don't mind, I'll figure it out)

13:01 hugod: the port and hostname are required in order to specify :log-level

13:02 antifuchs: ah, oops (:

13:03 dsantiago: technomancy_: Not sure I understand the question?

13:04 technomancy_: dsantiago: the project map now contains tagged ordered map literals

13:04 so if you're going to try to read it from the project process, it'll fail unless you have ordered and 1.4+ on your classpath

13:05 dsantiago: Oh, hm. Yeah, well, it needs to handle the project map, so if that's not a data structure from clojure.core, it's gonna have a bad time.

13:05 But why wouldn't that be fairly easily fixable?

13:06 technomancy_: well you have to choose between a dependency upon ordered and the horrors of undefined :repository order

13:08 dsantiago: Sure, sure. I mean, if you're saying just adding an ordered dependency would fix it, that seems OK by me.

13:08 technomancy_: yeah, I guess as long as you don't need to support pre-1.4, you'll be good

13:08 since you can easily just add a dep to configleaf

13:09 dsantiago: Yup.

13:14 scriptor: hmm, the clojure35 coupon for joy of clojure still works

13:16 antifuchs: hugod: yay, it seems to be working (:

13:19 technomancy_: any users of lein trampoline want to review a patch for me?

13:20 antifuchs: hugod: how's it supposed to do backtraces? my canonical example of (/ 1 0) on the REPL just shows "; Evaluation aborted on java.lang.ArithmeticException: Divide by zero."

13:21 nz-_: what is this ritz thing? and how it is different from normal slime?

13:21 technomancy_: it should provide a significant speedup.

13:21 hugod: antifuchs: M-x slime-break-on-exception

13:22 I just changed the default to have it switched off

13:22 antifuchs: nz-: it's a less insane implementation of the swank side; you use normal slime, but ritz on the clojure side

13:22 hugod: huh

13:23 hugod: is that something that the swank decides? that seems odd (:

13:24 hugod: antifuchs: there are some issues with having it on by default - pretty much every exception is regarded as "caught" by the JVM, due to clojure's copious use of try-finally scopes

13:24 antifuchs: hmm. that seems suboptimal

13:24 hugod: So you get to see many exceptions

13:25 The default filters take a stab at just showing you a reasonable subset

13:25 technomancy: emezeske: interested in your thoughts on https://github.com/technomancy/leiningen/commit/f9da16e37a3aa86b21321aceaea40a45541596d7 if you have a moment

13:25 since you and your cohorts are probably the biggest trampoline users

13:26 antifuchs: hugod: so I wonder how swank-clojure does this. it didn't look too spammy, re. backtraces

13:26 emezeske: technomancy: Neat idea!

13:27 technomancy: So it wouldn't have to load the first JVM to know the trampoline command?

13:27 technomancy: emezeske: exactly

13:27 emezeske: I believe that the trampoline task should always be a pure function, so it should be safe to memoize

13:27 emezeske: technomancy: And the project.clj is hashed as part of invalidating the cache?

13:27 hugod: antifuchs: you were not using the jvm debugger there, I think, just seeing the exceptions that are truly uncaught.

13:28 technomancy: aye

13:28 antifuchs: oohhh

13:28 emezeske: That was the one corner case I could think of

13:28 antifuchs: hugod: that makes sense

13:28 hugod: antifuchs: ie, after the stack had been unwound

13:28 emezeske: technomancy: I think that should work great, although I agree it should be opt-in for a while

13:28 antifuchs: yeah, I was wondering about that. good to see it can be un-unwound, too (:

13:29 technomancy: cool

13:30 emezeske: technomancy: Damn it, my IRC client apparently lost it's nickname color cache. You just aren't the same in teal

13:30 technomancy: heh

13:30 is the shasum executable present on OS X and Cygwin?

13:30 scriptor: looks like it's on osx

13:31 technomancy: I wonder if posix specifies a standard name

13:31 emezeske: WTF, shasum comes from the "perl" package on my ubuntu machine

13:32 scriptor: sourcing my shasum gives..weird errors

13:32 technomancy: any cygwinners?

13:32 or (gasp) solarites?

13:32 Licenser: you're on solaris, right?

13:33 scriptor: hmm, might depend on which cygwin packages you install, but I really have no clue

13:33 Licenser: technomancy I use SmartOS yap

13:33 technomancy: Licenser: is shasum present?

13:34 Licenser: on smartOS yes

13:34 technomancy: cool; thanks

13:34 bash doesn't have any equivalent of deleteOnExit, does it?

13:35 Licenser: cksum -x sha256 is also valid on solaris

13:35 technomancy: good to know

13:35 we'll go with shasum unless cygwin hates it

13:35 rlb: technomancy: you'd have to do it yourself I think, via 'trap EXIT ...'

13:35 Licenser: so I think cksum is preffered

13:36 technomancy: Licenser: why's that?

13:37 FWIW it doesn't even need to hash to the same value across machines, just consistently locally

13:40 rlb: thanks

13:42 rlb: do you know if that will trigger if the script "exits" via execing another?

13:44 Chouser: technomancy: from my bash wizard friend: trap 'do something; exit' 0 1 2 3 15

13:44 Licenser: technomancy because it's a pluggable system :) and more guaranteed to be present.

13:44 technomancy: Chouser: the numbers indicate signals?

13:44 Chouser: he says that won't be triggered if you exec

13:45 "put cleanup in a function; call it from both places"

13:45 technomancy: Chouser: oh, I actually do want it triggered for exec

13:45 Chouser: yes, the numbers are signals

13:45 except 0 which is normal exit

13:46 technomancy: err--I don't necessarily need it triggered at the time of exec, I just need it triggered at least when the exec'd process exits

13:47 I guess I can do science to it

13:47 l1x: hey guys, how can i apply a java function to all the members in a hash-set and capture the result (only strings) in a list?

13:48 y3di: has anyone messed around with neo4j?

13:48 Chouser: technomancy: "then don't exec; just run and exit"

13:50 technomancy: it's cleaner if I can exec, but I guess it doesn't matter

13:50 emezeske: l1x: (map (memfn yourMemberFunction) your-hash-set)

13:52 l1x: emezeske: awesome! (map (memfn getCanonicalName) (jmx/mbean-names "hadoop:*")) it just works like charm

13:53 Chouser: technomancy: he also wants me to note that bash, sh, and ksh treat trap differently. This advice only applies to bash.

13:53 wow, memfn!

13:55 nz-: somebody mentioned today about problems with heroku deploy

13:55 Running: LEIN_NO_DEV=y lein deps

13:55 /app/slug-compiler/lib/../../tmp/buildpacks/clojure/bin/compile: line 91: LEIN_NO_DEV=y: command not found

13:55 technomancy: nz-: oh?

13:55 nz-: ! Failed to build.

13:55 ! Heroku push rejected, failed to compile Clojure app

13:55 technomancy: nz-: I fixed that a couple days ago; are you still seeing it?

13:55 nz-: I have same thing noe

13:56 should I update heroku toolbelt?

13:56 SegFaultAX|work2: nz-: I think that's coming from the buildpack.

13:56 technomancy: no, it's not client-side. if you give me the app name I can investigate further

13:56 feel free to /msg me

13:56 nz-: ok, just a minute

14:00 _ulises: nz-, technomancy: I was having the same issue this morning; I haven't checked if it's been fixed since

14:00 nz-, technomancy: I even started with a plain-vanilla clojure project (lein new) to see whether it was anything to do with my old project but nope

14:01 technomancy: _ulises: are you using lein2 locally?

14:01 _ulises: technomancy: no, lein1

14:02 technomancy: _ulises: here's a temporary fix; I should have something better soon: heroku config:add "BUILDPACK_URL=http://github.com/heroku/heroku-buildpack-clojure.git#v4"

14:02 emezeske: btw, just pushed fast trampolines to master. export LEIN_FAST_TRAMPOLINES=y to try it out

14:02 ^ or anyone else interested in faster project boot via trampolines

14:03 _ulises: technomancy: that did it; thanks!

14:03 emezeske: technomancy: woot!

14:04 technomancy: _ulises: did you try lein2 and have problems with it, or are you just on lein1 because you haven't gotten around to upgrading?

14:04 _ulises: technomancy: I haven't gotten round upgrading though it's in my TODO list

14:05 technomancy: should I add that fix to my other projects or wait for a push from you?

14:05 technomancy: _ulises: I hope to have a fix out in a few minutes

14:05 _ulises: technomancy: cool; I'll hang out then

14:05 SegFaultAX|work2: technomancy: What's the easiest way to upgrade lein to 2?

14:05 technomancy: I'm currently on 1.7.1

14:05 technomancy: that config will block you from getting buildpack updates in the future, so you'll want to drop it once this is fixed

14:05 clojurebot: upgrading to lein 2?

14:05 clojurebot: lein is not the best way to learn java

14:05 technomancy: clojurebot: shut up

14:05 clojurebot: Excuse me?

14:06 technomancy: clojurebot: upgrading to leiningen 2?

14:06 clojurebot: upgrading to leiningen 2 is easy with this handy upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading

14:06 technomancy: there we go

14:06 rlb: technomancy: wrt exec, didn't know myself offhand, but I'm not surprised if it doesn't work there. And note that you can also use the symbolic signal names, i.e. EXIT, INT, etc.

14:06 _ulises: technomancy: what was broken if you don't mind me asking?

14:06 technomancy: ^ SegFaultAX|work2: ^

14:06 SegFaultAX|work2: technomancy: Thank'ye

14:06 technomancy: _ulises: I've added support for auto-detecting lein1 vs lein2 and the lein1 section has a bug in detecting whether you want dev/test stuff on the classpath.

14:07 borkdude: So, what must I do to get clojure code highlighted in html5?

14:07 _ulises: technomancy: right

14:07 technomancy: so the alternate workaround is to upgrade to v2 ;)

14:08 technomancy: _ulises: that'd be ideal =)

14:08 _ulises: technomancy: soon enough :)

14:16 ibdknox: Light Table 0.1.0 is up :D

14:16 http://www.chris-granger.com/2012/08/17/light-table-reaches-010/

14:16 technomancy: _ulises, nz-: fix is pushed, just need to wait for it to propagate to the build machines.

14:16 scriptor: (inc ibdknox)

14:16 lazybot: ⇒ 7

14:16 borkdude: ibdknox upgrading

14:17 _ulises: technomancy: thanks and yay \o/

14:18 technomancy: _ulises: ok, it's live now

14:19 antifuchs: ibdknox: ugh, unsigned .jar ):

14:19 ibdknox: os x 10.8 complains heavily and refuses to open it

14:19 _ulises: technomancy: pushing; will keep you updated

14:20 borkdude: ibdknox it seems to hang on "starting server", OSX here

14:21 antifuchs: ibdknox: (of course, java -jar launcher.jar works, but that's not exactly as advertised)

14:21 technomancy: people still run OS X in restricted mode?

14:21 ibdknox: antifuchs: that's OS X being retarded

14:21 I haven't moved to 10.8 yet

14:22 technomancy: they turned it on by default with the latest update... :(

14:22 antifuchs: they did

14:22 technomancy: ibdknox: I would have thought everyone with the slightest bit of technical chops would have turned it off by now

14:22 antifuchs: and I'm not likely to turn it off (:

14:22 ibdknox: technomancy: (me too)

14:22 casion: why would you leave it on?

14:22 dnolen: ibdknox: SWEET

14:22 antifuchs: because I want to see what breaks.

14:22 also, I like getting ridiculed in public

14:23 casion: I wasn't ridiculing you… yet

14:23 borkdude: ibdknox didn't know I had to download a launcher, never mind

14:23 casion: now I think I will though ;)

14:23 technomancy: I guess it makes sense if you want to feel the pain of nontechnical users

14:23 antifuchs: casion: go on, it'll only reduce my motivation to contribute

14:23 casion: 10.8 still isint usable for me anyway, not till avid updates their shit

14:23 antifuchs: I was kidding :(

14:24 antifuchs: ok ok (:

14:24 technomancy: we got bitten by that with the heroku client; all the macoseckists working at heroku turned off restricted mode the day they upgraded, so no one noticed the fact that our installer was getting blacklisted until the support tickets started rolling in.

14:24 antifuchs: so far, 10.8 has worked well for me, and the gatekeeper warnings have not been super annoying

14:25 or rather, this was the first that I saw that wasn't something I could live without

14:25 ibdknox: technomancy: do you remember what you guys had to do to fix it?

14:26 scriptor: ibdknox: small bug, when the tutorial has you enter code in the scratchpad, you can't enter a space in the scratchpad (unless you enter shift+space)

14:26 technomancy: ibdknox: we had to sign up for a bullshit developer package and load a bunch of apple-approved certs into our CI box

14:26 ibdknox: gr

14:26 scriptor: ah, thanks, should be an easy fix :)

14:30 dnolen: ibdknox: you didn't mention ClojureScript support in this version did you?

14:30 antifuchs: well well well. light table seems pretty nice and usable so far

14:30 ibdknox: dnolen: I pulled it, it'll show up in not too long :)

14:30 dnolen: ibdknox: gotcha, cool

14:31 ibdknox: dnolen: it works as far as I know, but didn't have time to really test it and didn't want to release that until it happens

14:33 _ulises: technomancy: success! thanks again

14:35 muhoo: hehehe, google closure makes javascript look like java

14:36 stuartsierra: muhoo: That's kind of the point.

14:36 Or really, the point is to turn JS into a statically-compiled language.

14:37 antifuchs: ibdknox: looking at ritz source code, the function overview of a lot of namespaces shows tons of (defslimefun …) forms

14:37 ibdknox: would be interesting if LT could disambiguate them a bit (:

14:37 ibdknox: antifuchs: you'll be able to specify rules for that

14:38 antifuchs: neat! (:

14:38 ibdknox: antifuchs: didn't make it into this release, but hopefully the next

14:38 scriptor: muhoo: with GWT and all, probably not a coincidence :)

14:38 antifuchs: there's this emacs thing that automatically disambiguates emacs file buffer names. it's really pretty good.

14:39 jkkramer_: ibdknox: on save, table seems to have removed all top-level comments from the file I was working on

14:40 antifuchs: like, have files ~/projects/foo/test/stuff.clj ~/projects/foo/lib/db/stuff.clj and ~/projects/something-else/test/stuff.clj open and it'll name them test/stuff.clj, db/stuff.clj and something-else/stuff.clj respectively. Very handy.

14:40 gfredericks: I'm having a surprisingly hard time coming up with a hacky way to parse some JSON from the middle of some not JSON

14:41 Bronsa: ibdknox: i get "Error: Could not find or load main class lighttable.server"

14:42 wait, i did light update, I'm trying with the launcher, maybe that's it

14:44 muhoo: gfredericks: i'd guess the first task would be to separate out the json from the not-json, then send the json to something like cheshire?

14:44 Bronsa: yeah, that was it

14:45 gfredericks: muhoo: the second part is easy

14:46 nz-: antifuchs: do you happen to remember name for that emacs disambiguation thing?

14:47 technomancy: nz-: it's uniquify

14:54 mattmoss: ,(bytes [1 2 3])

14:54 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [B>

14:55 dnolen: ibdknox: I did notice Light Table seems a bit slow if you load a largish file.

14:56 ibdknox: I mean slow to show the contents of the file initially.

14:56 ibdknox: dnolen: yeah, it's creating a bunch of editors, which is really slow right now

14:57 dnolen: ibdknox: ah individual CodeMirror editors?

14:57 ibdknox: dnolen: yeah. I think we're going to work with Marijn a bit on that :)

14:57 kovasb: I wish it was easy to retain the exact same syntax highlighting, and just move the active editor from cell to cell

14:58 no need to have more than 1 editor at a time, can only type in 1 place at once

14:58 ibdknox: ideally though, the thought was you wouldn't open full files a bunch

14:59 kovasb: ibdknox: evaluating (+ 1 1) in scratch gives me clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: + in this context, compiling:(NO_SOURCE_PATH:2:2)

14:59 Chouser: technomancy: isn't "$INPUT_CHECKSUM" = "" always true on line 250 [this from a friend]

14:59 kovasb: ibdknox: also, the spacebar didn't work while the tutorial mode was active

14:59 ibdknox: kovasb: did you connect to a different project? it's probably in a NS that doesn't exist

15:00 kovasb: yeah, just fixed the spacebar thing

15:00 kovasb: ibdknox: connected to existing project right as the first thing i did

15:00 ibdknox: hm

15:00 it should fix itself if you open an editor

15:00 kovasb: just reloaded. in the user namespace it works

15:01 Chouser: mattmoss: did you want (into-array (map byte [1 2 3]))

15:01 kovasb: went into a namespace, not working

15:05 mattmoss: @Chouser: I was trying to figure out what makes a byte[][] signature using into-array. Figured it out: (into-array (class (byte-array nil)) ...)

15:05 Calling into a Java API that uses byte[][] in a few places.

15:06 Chouser: ah

15:10 mattmoss: another option: (make-array Byte/TYPE 4 4) for a 4x4 byte[][]

15:11 mattmoss: Chouser: Thanks... though I suspect the details of the byte[] values, it is an opaque object handed to me that I have to hand back later... so I don't really know the actual contents/dimensions.

15:12 Chouser: ok

15:34 ibdknox: dnolen: ah, I also just realized I originally pushed one with only optimizations simple. Just uploaded a new 0.1.0 with advanced, that'd probably speed it some (though not immensely)

15:34 dnolen: ibdknox: cool.

15:34 ibdknox: dnolen: to force it to download again, just remove ~/.lighttable/bin/

15:35 dnolen: ibdknox: thx

15:42 eggsby: hmm, what's the simplest way to set http headers for all routes in compojure... just some sort of middleware?

15:46 emezeske: eggsby: That sounds right to me.

15:46 eggsby: just wanted to make sure there wasn't some other convention

15:53 AWizzArd: Are non-primitive type-hints allowed (i.e. useful to not need to type-hint in later use) in deftypes?

15:54 technomancy: Chouser: INPUT_CHECKSUM is set when LEIN_FAST_TRAMPOLINES is on

15:55 but checking for LEIN_FAST_TRAMPOLINES might be better?

15:55 I wanted to also support setting it on a per-project basis with touch .lein-fast-trampolines

15:55 Chouser: ah, I see.

16:07 AWizzArd: Oh hmm. Why is .al not hinted to return an ArrayList :-( (deftype Foo2000 [^ArrayList al])

16:08 amalloy: AWizzArd: within the body of the deftype just referring to al works

16:08 but it's stored as just an Objecr field, so external clients don't know it's an ArrayList

16:10 AWizzArd: Yes, inside the body it’s working. I just thought it would be nice to see it on the outside too. Wouldn’t hurt.

16:10 nyash: hi, just playing with clojure and I am surprised by this behaviour: http://ideone.com/PYfYj Why is the output so different?

16:13 symuyn: Hey, I'm having trouble with a sequence transformation. If I wanted to change (2 0 0 2 5 0 9 0 0 0 10 2) into (() 2 (0 0) 2 () 5 (0) 9 (0 0) 10 () 2), how would I do this?

16:13 The point of this is to count how many zeroes precede (or follow, maybe) each non-zero item.

16:14 eggsby: nyash: quote is a special form, not a function

16:14 xeqi: &(partition-by (partial = 0) '(2 0 0 2 5 0 9 0 0 0 10 2))

16:14 lazybot: ⇒ ((2) (0 0) (2 5) (0) (9) (0 0 0) (10 2))

16:15 xeqi: well, not quite

16:15 emezeske: nyash: Have you used macroexpand to look at what your macro is expanding to?

16:15 nyash: I think if you look at that, you will understand the problem

16:15 symuyn: Hmm, yeah, I can't see how I'd do it with partition, or just partition, xeqi

16:16 nyash: emezeske: ah I see => (str quote (1 2 3)). Any way that I could prevent it from getting inserted?

16:17 eggsby: hmm, is there any way to see what 'let' expands to?

16:18 emezeske: nyash: Since you're writing a macro, you don't need to quote the forms you pass to it

16:18 eggsby: i.e. is it ever possible to see something like (let [x 1 y 2] (+ x y)) as (+ 1 2)

16:18 emezeske: nyash: So just (applies str (1 2 3)) should work just fine

16:18 nyash: emezeske: ah I see thank you.

16:19 eggsby: let expands to let*, but the source for let* is not found... hm

16:20 Raynes: ibdknox: Light table will never be successful unless you go the extra step and have a launcher that downloads an installer that downloads an installer that requires 2 consecutive restarts.

16:21 technomancy: Raynes: implemented in Adobe AIR, naturally?

16:21 Raynes: Even better.

16:21 ibdknox: Raynes: technomancy: have you ever installed VS?

16:21 I shit you not it required 4 restarts

16:21 Raynes: ibdknox: No, but I've heard stories.

16:21 technomancy: wat

16:21 Raynes: 4!?!? I thought it was 2 and *that* horrified me!

16:22 _tca: eggsby: that's not what let does anyway, if you want to see the values in place use symbol-macrolet

16:22 ibdknox: they eventually got it down to 2

16:22 technomancy: restart... is that like when you start and then you start again?

16:22 ibdknox: technomancy: reboots

16:22 Chouser: ,((fn f [xs] (lazy-seq (when (seq xs) (let [[zeros [num & more]] (split-with zero? xs)] (list* zeros num (f more)))))) '(2 0 0 2 5 0 9 0 0 0 10 2))

16:22 technomancy: oh, I've heard of those

16:22 clojurebot: (() 2 (0 0) 2 () ...)

16:22 ibdknox: haha

16:23 technomancy: they're for footwear enthusiasts, right?

16:23 ibdknox: yep! We don't promote shoes with LT

16:23 Raynes: ibdknox: How big is whatever this thing is 'fetching'?

16:23 ibdknox: 28mb I think

16:24 Raynes: Methinks it might have stopped trying.

16:24 ibdknox: Where from?

16:24 ibdknox: s3

16:24 it was going a bit slowly for me eearlier

16:24 Raynes: I'm far enough away from the router to make it moderately slow, but I don't think it has moved in 5 minutes.

16:24 Oh, there it went.

16:25 ibdknox: s3 must be getting hit hard

16:25 Raynes: It didn't occur to me that the bar was so short.

16:25 It was exactly one equal away from being done.

16:25 :p

16:25 symuyn: Jeez louise, Chouser—haha, thank you

16:25 ibdknox: I think there are 20 segments if I remember right

16:25 Chouser: symuyn: :-)

16:25 symuyn: I was hoping it'd be possible without lazy-seq, but, oh well

16:25 Chouser: symuyn: I'm sure there's something simpler, but maybe not that returns a lazy seq

16:26 Raynes: ibdknox: omg block creature thingy cool

16:26 symuyn: Yeah, I mean recursion, of course

16:26 But thank you again

16:26 ibdknox: haha

16:26 Raynes: How long is connecting supposed to take?

16:27 ibdknox: Raynes: however long it would normally take for eval-in-project to spin up for that project

16:27 Raynes: Okay, then should it give me an error if something went wrong?

16:28 ibdknox: I *think* so, but there's definitely a non-zero possibility that something went wrong and I couldn't catch it

16:28 speaking of...

16:28 Raynes: Apparently so.

16:28 amalloy: Chouser, symuyn: zero? breaks on anything but numbers. i'd use #{0} rather than zero? if you're not sure your whole sequence will contain only numbers

16:28 Raynes: It is just sitting there and hates me and stuff.

16:28 ibdknox: technomancy: leiningen calls (system/exit) a lot

16:28 semperos: connecting with lighttable was a little quirky for me today

16:28 Raynes: ibdknox: Was I supposed to have lein-light and stuff set up.

16:28 ?

16:29 amalloy: not more than once per instance, i'd hope, ibdknox

16:29 symuyn: Yeah, amalloy, it's actually not for numbers at all; the predicate can be general of course

16:29 ibdknox: Raynes: nope

16:29 semperos: first attempt at connecting to an existing project brough up no namespaces

16:29 technomancy: ibdknox: always via leiningen.core.main/exit, hopefully?

16:29 which can be suppressed

16:29 ibdknox: ah

16:29 symuyn: amalloy: It's for a sequence of string lines, and I want to determine how many blank lines precede (or succeed) each non-blank line

16:31 Raynes: ibdknox: Good news, looks like it didn't break the second time around.

16:31 ibdknox: yay

16:32 only sort of good news though

16:32 inconsistent bugs are the hardest to fix :p

16:33 Raynes: This looks really cool.

16:33 No paredit, but cool nonetheless.

16:34 ;)

16:36 ibdknox: Yo.

16:36 ibdknox: Can I change the codemirror color theme used?

16:37 ibdknox: Raynes: hm, you could modify the jar, but I haven't made that stuff "easy" yet

16:37 Raynes: Aw. I'd like to use the tomorrow night theme I wrote for refheap.

16:37 Speaking of which, you should look at it and make it default. Or, I mean, look at it.

16:39 ibdknox: You know what would be really cool?

16:39 ibdknox: Raynes: space!

16:39 Raynes: If you could arrange a sort of function-level dependency tree.

16:40 And then rearrange the file based on it.

16:40 ibdknox: Raynes: yeah, that's one of the next things on my list

16:40 Raynes: Not by default, but having it as an option would be cool.

16:40 ibdknox: Raynes: being able to easily navigate the call tree so you can build that context up really quickly

16:40 ooo

16:40 I misunderstood

16:41 you can drag and drop, but yeah, still manual right now

16:41 it probably wouldn't be that hard to have it automatically order it

16:41 AWizzArd: ibdknox: can you give a wc on clj vs. js?

16:41 Raynes: I'd be cool if the var (form?) list was a tree or something.

16:41 ibdknox: AWizzArd: wc?

16:41 AWizzArd: shell tool

16:41 Raynes: NaNNaNNaNNaN

16:42 ibdknox: oh it's all written in CLJ and CLJS

16:42 I haven't written any JS myself

16:42 AWizzArd: Ah (-:

16:42 You let the computer write it for you. Neat.

16:43 And can you give loc of clj vs. cljs?

16:43 ibdknox: overwhelmingly CLJS

16:44 AWizzArd: 20/80 ?

16:44 ibdknox: looks like around 1300 lines of CLJ and 3300 lines of CLJS

16:44 that includes the libs I wrote though

16:44 so that's not quite right

16:44 just a second

16:45 ah, no it doesn't.

16:45 That appears to be the actual breakdown :)

16:46 a lot of that will get cleaned up though

16:46 my suspicion is that in reality LT is about 3500 lines

16:46 Raynes: ibdknox: How many lines of genreated js if you pretty print? ;)

16:46 generated*

16:47 ibdknox: 30k

16:47 lol

16:47 Raynes: Haha

16:47 ibdknox: with simple optimizations on

16:47 in dev?

16:47 I think it was about double

16:47 something stupidly high

16:48 Raynes: ibdknox: refheap has never looked better than it does in light table.

16:48 Even with this hideous color scheme.

16:49 ibdknox: :p

16:49 Raynes: Please, for the love of God, make it possible to change that thing soon.

16:49 I'll go write code on refheap and then copy it back to light table. :P

16:49 ibdknox: hatin' on my colors

17:07 Raynes: ibdknox: So, how do I add functions again?

17:12 Frozenlock: Oh sure, just when I ask technomancy to stop being so awesome so that I could stop being ashamed of myself, ibdknox makes a new move.

17:13 I should stop hanging in #emacs and #clojure, it's hard for my self esteem :(

17:14 technomancy: Frozenlock: or you could help out with Leiningen =)

17:15 newbie tickets: https://github.com/technomancy/leiningen/issues?labels=Newbie&milestone=&page=1&state=open

17:15 devinus: can anybody tell me what neat things are going into clj 1.5?

17:16 hyPiRion: devinus: Reducers is the main thing as of now, I believe.

17:17 devinus: Reducers are the big 1.5 feature?

17:17 Frozenlock: technomancy: I'll take a look!

17:19 hyPiRion: devinus: It's not a gamebreaking feature, but it's the one I know as of now.

17:19 devinus: it sounds interseting

17:20 hyPiRion: Mr. Hickey also decoupled agents earlier today, so that you're now able to choose what thread pool it should be in

17:20 So it's more or less performance all the way (?)

17:21 devinus: oh nice

17:21 i was wondering if there was a way to do that earlier this week

17:43 pepijndevos: What is the most complete JNA wrapper for clojure? The one chouser wrote 3 years ago?

17:50 SegFaultAX|work2: Light Table 0.1.0 is being glitchy :(

17:51 muhoo: https://www.refheap.com/paste/4451 w?

17:51 no checksums available from org.sonatype.aether wat?

17:53 Frozenlock: clojure has been great for my skillset, but absolutely horrible for my self esteem

17:53 these guys are frickin' geniuses

17:54 devn: it's far better to be the worst guy in the band

17:54 Raynes: Than to not be in the band at all.

17:54 technomancy: muhoo: invoking pomegranate directly?

17:55 you can change its checksum policy

17:55 muhoo: technomancy: yes, via add-dependencies

17:55 technomancy: muhoo: but you should yell at the incanter devs; not having checksums sucks

17:55 muhoo: k, will do

17:56 pepijndevos: dasl https://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html

17:58 dnolen: ibdknox: whoa, that's a lot of CLJS

17:58 ibdknox: still, that's suprisingly little code for how much functionality you guys already have.

17:59 bosie: why is this false: (.equals "5" (get "12345" 4))

17:59 dnolen: ,(get "12345" 4)

17:59 clojurebot: \5

17:59 dnolen: (= "5" \5)

17:59 ,(= "5" \5)

17:59 clojurebot: false

17:59 bosie: right

17:59 dnolen: bosie: String & Character are not the same.

18:00 amalloy: i didn't know get worked on strings

18:00 bosie: hm

18:00 SegFaultAX|work2: amalloy: Doesn't get work on any seq?

18:01 nz-: is there somewhere a log of this channel?

18:01 bosie: dnolen: wrapping it in (str) ?

18:01 SegFaultAX|work2: nz-: Your backlog, for starters.

18:01 dnolen: bosie: yeah could do that or just compare to \5

18:01 ,(.equals \5 (get "12345" 4))

18:01 clojurebot: true

18:01 amalloy: SegFaultAX|work2: certainly not

18:01 bosie: dnolen: \5 doesn't work either

18:01 hm

18:01 nz-: anything more reliable?

18:02 bosie: oh

18:02 \5 not "\5"

18:02 dnolen: nz-: http://clojure-log.n01se.net

18:02 SegFaultAX|work2: amalloy: Oh, well sets I guess wouldn't make sense. But surely any fixed key seq, no?

18:03 amalloy: seqs don't have keys

18:03 nz-: ok, thanks

18:04 hyPiRion: get works on sets.

18:04 SegFaultAX|work2: amalloy: Position is a key.

18:04 hyPiRion: ,(get #{1 2 3} 2)

18:04 clojurebot: 2

18:04 nz-: so lein2 preview8 doesn't seem to work with compojure/ring projects

18:05 weavejester: nz-: Try lein-ring 0.7.3 if "lein ring server" is causing problems

18:05 bosie: dnolen: so why can i write \5?

18:05 SegFaultAX|work2: hyPiRion: I wouldn't rely on that though, since the ordering is arbitrary.

18:05 bosie: dnolen: and not like '5' or "5"

18:05 SegFaultAX|work2: bosie: \5 is the character 5. Not the string nor the number, the character.

18:05 technomancy: SegFaultAX|work2: get on sets doesn't use ordering

18:05 amalloy: SegFaultAX|work2: you are saying nonsense to me and to hyPiRion

18:05 hyPiRion: SegFaultAX|work2: Get doesn't work like that.,

18:06 bosie: SegFaultAX|work2: i know

18:06 technomancy: heh

18:06 SegFaultAX|work2: amalloy: Oh? What am I missing?

18:06 hyPiRion: Wow, heh.

18:06 jlewis: amalloy: finally got to the bottom of my bug from the other day, by the way. it turns out that it was caused by http://dev.clojure.org/jira/browse/CLJ-829

18:06 hyPiRion: ,(get #{:a :b :c} :c)

18:06 clojurebot: :c

18:06 Frozenlock: technomancy: I wanted to give a shot at this one https://github.com/technomancy/leiningen/issues/638, but I can't even find where the tests are generated! Could you give me a hint? :)

18:06 jlewis: which was fixed in clojure 1.4. megablah.

18:06 SegFaultAX|work2: Oh, I'm getting nth mixed up with get.

18:06 amalloy: get is not related to indexes, in general

18:06 SegFaultAX|work2: Disregard.

18:07 technomancy: Frozenlock: oh, I think that one's already fixed; it's in the lein-newnew project

18:07 it just hasn't been pulled in by leiningen yet because I need to cut a release

18:07 hyPiRion: Think of sets as maps where both key and value have same value.

18:07 amalloy: jlewis: you had some iterator issue?

18:07 Frozenlock: Oh...

18:07 amalloy: and it's somehow related to transients?

18:08 nz-: weavejester: tried but now it complains about Caused by: java.lang.ClassNotFoundException: clojure.lang.IHashEq

18:08 Frozenlock: Well at least after browsing the source code I have a better understanding of how it works :)

18:09 nz-: but time for bed

18:09 weavejester: nz-: Not sure what would cause that...

18:09 nz-: i'll investigate it more on weekend

18:09 weavejester: Goodnight

18:17 antifuchs: oh bloody swank::%cursor-marker%

18:18 zakwilso1: So lighttable is looking good, but I can't seem to find any way to have it either eval everything in a namespace or in the document. Do I have to use load-file for now, or is there a better way to do this?

18:20 Gnosis-: is there a way to tell the Clojure compiler that a function is pure, for optimization purposes?

18:22 technomancy: Gnosis-: unfortunately not

18:22 SegFaultAX|work2: What additional optimizations could occur if such information was available to the compiler?

18:22 Gnosis-: so the compiler assumes that no functions are pure?

18:23 SegFaultAX|work2: memoization, maybe? I can't think of anything else off the top of my head

18:23 zakwilso1: A sufficiently smart compiler and/or runtime could automatically parallelize or memoize pure functions.

18:24 SegFaultAX|work2: At the cost of infinite memory, maybe.

18:24 bosie: Gnosis-: being able to run it in parallel

18:25 Gnosis-: yeah, that would be nice

18:25 SegFaultAX|work2: Sure, parallelization would be nice. But even if the compiler did know it was pure, it couldn't memoize the calls.

18:27 amalloy: (let [x 1, y 2] (fn [] (+ x y))) could easily be memoized for you

18:27 SegFaultAX|work2: The best it would be able to do is condense calls in a single expression, eg (+ (purefn 2) (purefn 2)) (purefn 2) would only need to be calculated once for that expression.

18:27 Gnosis-: SegFaultAX|work2: well, if the compiler was *really* smart, it could identify cases where a function could be memoized with at most X bytes of storage

18:27 technomancy: you'd need awesome type inference to pull that off

18:27 bosie: technomancy: by awesome you mean?

18:28 SegFaultAX|work2: Gnosis-: The worst-case size for the memoization table would be equal to the domain U co-domain of the function.

18:28 Even haskell doesn't do this.

18:28 Gnosis-: I don't understand "domain U co-domain" but it sounds like it's not feasible :)

18:29 oh wait, okay, I get it

18:29 SegFaultAX|work2: Gnosis-: The union of all possible inputs and all possible outputs.

18:29 Gnosis-: Addition for example (which is obviously pure) would require an infinite amount of memory to memoize.

18:31 Gnosis-: that's assuming the set of input numbers is infinite

18:31 but whatever, this doesn't sound practical for the near future

18:33 y3di: off by 1 errors are the bane of my existance

18:34 got get with the times and go functional

18:35 emezeske: y3di: There are only 3 hard problems in computer science: cache invalidation and naming things.

18:36 SegFaultAX|work2: emezeske: As programmer jokes go, you can't beat Ed, man! !man ed. http://www.gnu.org/fun/jokes/ed-msg.html

18:38 emezeske: SegFaultAX|work2: lol @ emacs file size: 5.89824e37

18:38 technomancy: oooh, palindromic quines: http://www.rebol.org/art-display-article.r?article=j315vt

18:39 oh, not quite. darn.

18:40 http://golf.shinh.org/p.rb?Palindromic+Quine

18:42 dotnull: hello

18:56 eggsby: hey technomancy why does lein new app do clj 1.3.0 and lein new to 1.4.0

18:57 technomancy: eggsby: working on that literally right now =)

18:57 eggsby: :D

18:57 technomancy: forgot to bump to the latest version of the lein new plugin

18:58 Frozenlock: Is there a function to help discover elements in a webpage? (clojure-script) I'm quite new to this and would like to mess around in the repl to make myself confortable with the 'environment'.

18:58 SegFaultAX|work2: What's the best resque-like library for Clojure?

18:59 Lightweight asynchronous job queue.

18:59 technomancy: die roboter!

18:59 it's ... pretty good.

18:59 hyPiRion: technomancy: Was that German?

19:00 technomancy: hyPiRion: http://www.youtube.com/watch?v=wHEoMpMvz7A

19:00 also https://github.com/technomancy/die-roboter

19:00 SegFaultAX|work2: technomancy: Whoa, you enqueue clojure forms as the job?

19:00 technomancy: SegFaultAX|work2: of course

19:01 SegFaultAX|work2: technomancy: That's awesome! (Assuming it isn't abused, of course)

19:01 technomancy: well... the exception transport is questionable.

19:02 SegFaultAX|work2: technomancy: Go on...

19:02 technomancy: I really shouldn't; there are minors present

19:03 daltenburg: ]

19:03 \\\\\\\\\\\\\

19:03 hyPiRion: technomancy: We are liberal, go on.

19:03 technomancy: SegFaultAX|work2: so if an exception occurs remotely, it has to propagate it back to the caller, right?

19:03 soooo in the current implementation, it uses java.io.Serializable and base-64-encoding to generate a form that will eval in the caller to the exception value that occurred remotely.

19:04 amalloy: oh god, i remember that

19:04 technomancy: if I did it from scratch, I'd use java.io.Serializable as the wire format rather than pr-str

19:05 and I may still switch to that once I get a chance to revisit the code

19:05 ANYWAY it works but don't pass around exceptions with ginormous stack traces

19:05 and stop looking at me like that

19:05 hyPiRion: ... interesting.

19:10 eggsby: ibdknox: are you at the point where you are developing light table in light table yet

19:24 danielglauser: eggsby: Yes, they are developing Light Table in Light Table: http://www.chris-granger.com/2012/08/17/light-table-reaches-010/

19:25 "As a matter of fact, we're actually working on Light Table in Light Table now (oh the meta-ness)"

19:31 antifuchs: sooo smalltalk-y (:

19:31 cpinera: Hi all. I'm looking for a code-coverage tool for Clojure. So far I've found radagast not to be maintained anymore and figleaf to be a bit too… minimalistic. guzheng looks more like the basis for such a tool, but not something I could use in a continuous build environment right away. What are you folks using?

19:38 habitmelon: I'm looking to learn clojure, and would like to know if there is a good book or site that any of you would recommend. I'm already proficient in C#, Ruby, Python and JS, if that makes any difference

19:38 I'm familiar with Java, but haven't gone too deeply into it

19:39 ivan: I like Joy of Clojure and 4clojure

19:39 S11001001: habitmelon: watch rhickey's video introducing the language, aimed specifically at java developers. You know C# so you basically know Java

19:39 ivan: and every single rhickey video, of course

19:39 emezeske: habitmelon: I really like the book "The Joy of Clojure". I've heard that "Programming Clojure" is good too.

19:40 habitmelon: Sweet, I'll watch those videos first

19:41 Is the CLR version of Clojure still in active development?

19:41 S11001001: habitmelon: yes, and it is up to date

19:41 uvtc: habitmelon: I wrote up some brief notes that you might find useful: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/ .

19:41 habitmelon: though, those are more aimed at GNU/Linux users.

19:42 habitmelon: thanks utvc!

19:42 uvtc: habitmelon: y/w. :)

19:42 ivan: habitmelon: yes, but no lein, and a lot of Clojure libraries rely on Java libraries

19:42 habitmelon: I use GNU/Linux, as well as OS X and windows

19:42 Ah

20:01 symuyn: (sort-by keyfn coll) compares the values of (keyfn x) for all x from coll. Is there a similar convenience function, but for multiple keyfns?

20:02 S11001001: symuyn: juxt

20:02 (sort-by (juxt first-key second-key ...) coll)

20:02 amalloy: symuyn: "multiple keyfns" doesn't make sense. just compose a keyfn (eg, with juxt) that does what you want

20:02 symuyn: For instance, (whatever [:x :y] [{:x 2, :y 3, :z 0} {:x 2, :y 1, :z 5}) would—hmm.

20:02 muhoo: more interesting trampoline-isms, preview8, on a beaglebone: https://www.refheap.com/paste/4452

20:03 symuyn: Huh, that…actually—oh, right.

20:03 Vectors are comparable. Duh.

20:03 technomancy: muhoo: can you try master?

20:03 symuyn: Heh, thank you. ^_^

20:04 muhoo: technomancy: how do i make standalone jar from master?

20:04 technomancy: muhoo: you can try running bin/release

20:04 muhoo: ah, perfect, thanks, will try

20:05 antifuchs: ok, got ritz to no longer beep at me and display arg lists, too

20:06 now it can show the REPL, perform M-., and give me slime-autodoc arglists with a quicklisp slime (:

20:06 now I sleep

20:16 muhoo: technomancy: works, thanks

20:17 technomancy: muhoo: great

20:17 muhoo: wait, bin/release works, or leiningen master works?

20:17 muhoo: both :-)

20:17 technomancy: sweet

20:17 should have a preview9 release early next week

20:17 muhoo: lein trampoline repl :headless & works on a beagleboard, with master, to be specific

20:17 awesome, thanks!

20:18 technomancy: muhoo: did you see this? https://github.com/technomancy/leiningen/commit/65a574d09a926133cd60d7c5966a6dad1abe0c57#L1R95

20:18 should be especially useful for embedded systems

20:18 muhoo: woo, fast trampoline

20:22 technomancy: http://bace.s3.amazonaws.com/hs_err_pid869.log , maybe unrelated, but interesting

20:23 technomancy: what's the context?

20:24 muhoo: lein trampoline repl :headless (with .lein-fast-trampoline in proj root)

20:24 technomancy: muhoo: is it consistent?

20:24 muhoo: nope, does that about every 3rd invocation

20:25 fast trampoline does appear to be faster tho, thanks

20:27 technomancy: muhoo: and it only happens on arm?

20:27 muhoo: correct, only on this device (device details are in that stack dump)

20:28 technomancy: looks like it's crashing in the reflector, which I'd have a hard time imagining is Leiningen's fault

20:29 muhoo: probably isn't, though there may be some -X jvm args i can do to mitigate

20:30 technomancy: is it possible in nrepl.el to connect to two different projects on two different jvm's yet?

20:31 technomancy: muhoo: no, though someone said they were thinking about adding that

20:31 everyone who's hacked on it so far uses a separate Emacs instance per project

20:35 muhoo: that might do, thanks

20:39 is there a cleaner way to disconnect in nrepl.el than killing *nrepl-connection* buffer?

20:39 technomancy: not yet unfortunately

20:40 there's an open issue for it

20:40 muhoo: well i could just bind that to a keyboard command, and call it done :-)

20:41 (defun nrepl-disconnect (interactive) (kill-buffer "*nrepl-connection*"))

20:41 technomancy: submit a pull request =)

20:44 muhoo: someone did talk about being able to reconnect without losing history. i may have a simpler way to do that

20:44 which is, kill *nrepl-connection* to disconnect, but then when connecting, if *nrepl* already exists, re-use that buffer instead of creating a new one.

20:45 instead of *nrepl*<1>, *nrepl*<2>, etc

21:18 Cheiron: Hi, for a function the defines multiple arities. what is the best practice of documenting the function?

21:19 amalloy: most functions just use prose to describe what various calls do

21:22 Cheiron: so each arity describes what it does

21:22 uvtc: Cheiron: afaik, you can still only put in one docstring to cover all the cases.

21:22 Cheiron: uvtc: any example online?

21:23 speaking of arity, does it decrease performance? (lookup the correct version)

21:23 uvtc: Cheiron: the docstring comes after the function name. Just remember to backslash-escape any double-quote marks (and I suggest using Markdown formatting in your docstring).

21:24 Cheiron: after function name and before args definition vector?

21:24 amalloy: ugh markdown? markdown is great, but for docstrings? i do not recommend

21:24 uvtc: (defn foo "my docstring" ([x] (* x x)) ([x y] (+ x y)))

21:25 Cheiron: amalloy: do you prefer any other format? or just plain Clojure strings?

21:25 amalloy: text. just text, with words

21:26 if you need **bold emphasis** faux-formatting to make you function's description clear at the repl, you probably aren't writing very well

21:26 uvtc: amalloy: Sure. If you want to emphasize some word in your docstring, may as well do so *like this*. I think marginalia assumes docstrings are markdown-formatted. And my understanding is that a future version of autodoc may assume docstrings are markdown and render them as html.

21:27 cjfrisz: Where is a dnolen when you need him?

21:27 Cheiron: Ceylon developers chose MD as the language when documenting code

21:28 uvtc: It's just natural plain text markup as far as I'm concerned. Looks good as plain text and also can be made prettier as html if you so desire.

21:37 hugod: crazy idea - allow defprotocol to re-use an existing interface so that protocols could be added to clojure for the Named, IFn, etc

21:43 _zach: hugod: I

21:44 hugod: I'm curious to know what your intended use-case would be

21:47 hugod: being able to extend support for those protocols onto deftypes, etc

21:51 you might then be able to extend an interface on to another class, which would be nice for interop scenarios

21:51 _zach: hugod: Okay, I understand. I misunderstood your original statement -- this would be nice. :)

21:59 uvtc: Is this naming convention fairly customary: A Clojure lib that wraps a Java lib named "foo" might likely be named "clj-foo". Whereas, a Clojure lib that provides its own implementation of a well-known lib "foo" written in some other language might likely be named "foo-clj".

21:59 For example, clj-time (wraps Joda Time).

21:59 markdown-clj (re-implements markdown in Clojure)

21:59 clojurebot: clojure is like life: you make trade-offs

22:00 uvtc: oh clojurebot, you are indeed very wise.

22:11 S11001001: uvtc: yes, but it's so boring that people keep doing that

22:11 technomancy knows how to name libraries right

22:12 uvtc: S11001001: Ah, you prefer more exciting, more flavorful names.

22:12 Well, I'm glad I was on the right track anyhow.

22:12 S11001001: I think that creativity is an important part of the spirit of programming, and that every aspect of a program should reflect that spirit

22:12 uvtc: I was going to post to the ML to see what others thought of this convention.

22:13 Cheiron: Hi, what would be an idiomatic way to make this interface work in Clojurian way? http://hector-client.github.com/hector//source/content/API/core/1.0-1/me/prettyprint/cassandra/service/ColumnSliceIterator.html

22:14 S11001001: Cheiron: lazy seq instead of stateful iterator

22:16 I can appreciate the desire to get a library out there, not taking time to think of a name, but I like to see some beauty every once in a while

22:17 Cheiron: you have functions you call that take query as args and produce such lazy seqs; the "columns" are vectors or maps containing name, value, whatever else

22:18 Cheiron: eye c

22:25 uvtc: S11001001: I posted my comment to the ML, thinking it might help solidify the standard, while at the same time encourage some fun project names too. :) Maybe it'll start a brief conversation.

22:26 s/the standard/a standard/

22:30 eggsby: what do clojurescript people usually do for ajax? is everyone just using noir/fetch/etc ? or wrapped calls over the closure apis?

22:41 rbxbx: Is there a preferred replacement for clojure.string/replace in 1.4, or are people just rolling their own?

22:42 nevermind, it seems to still exist. Sigh. https://github.com/clojure/clojure/blob/master/src/clj/clojure/string.clj#L238

22:45 Raynes: muhoo: You should go move refheap to compojure.

Logging service provided by n01se.net