#clojure log - Nov 18 2011

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

1:23 archaic: i just spent ages figuring out that i needed dollar signs to get at a java enum i.e Renderer$VertexLabel$Position/AUTO is this kind of interop documented anywhere?

1:23 amalloy: archaic: that's the class's name in the jvm, for real

1:24 as specified in the java language specification

1:24 archaic: ahh k . i have never used java before

1:24 amalloy: it's nothing to do with enums in fact

1:24 it's just that Position is an enum class nested inside two other classes, and it "inherits" the name

1:25 and that's just The Way It Is

1:25 archaic: kinda like underscores for hyphens :)

1:30 amalloy: well, except that's clj-specific. doesn't *have* to be that way

1:41 keith_: in clojurescript, is there a special form that emits foo["bar"]

1:42 assuming foo is a regular javascript object

1:42 amalloy: aget

1:43 hiredman: (.bar foo)

1:43 keith_: hiredman: won't that get munged?

1:43 hiredman: depends on information you've not divulged

1:43 keith_: with advanced optimizations

1:44 hiredman: it still depends

1:44 is foo some global object?

1:44 keith_: no it's a local variable

1:44 hiredman: then everything will get munged as it should

1:44 and not as it shouldn't

3:13 daaku: how would one model an operation that involves mapping over a tree recursively & modifying it, while aggregating some information from the nodes and maintaining that thru the entire iteration? would it essentially be like reduce? or is there some better pattern i could use as a reference?

3:21 amalloy: if you need aggregated data, some kind of reduce will likely be needed at some point. but you map be able to use map (or for) for sub-operations, or possibly use a zipper or tree-seq for the walking part

3:47 Raynes: amalloy: He map be able to use map? Sure sign of sleep deprivation.

3:47 amalloy: map map map

3:47 Raynes: Pacman!

4:37 Borkdude: What is the best Common Lisp environment on OSX? (subjective, I know)

4:37 (that's why I wont post it on StackOverflow...)

4:39 Clozure CL maybe?

4:45 bbommarito: Borkdude: LispWorks is a pretty nice one from what I have heard.

4:50 Buddy who works for GS loves Lispworks.

4:52 gko: He uses LW in GS for work?

4:52 bbommarito: No, they use some weird Lisp, but he himself enjoys LW and uses it for personal projects.

4:53 And, since he is such a huge lover of lisp (His license plate is CARCDR for crying out loud), I am assuming LW is a pretty decent lisp.

4:53 Borkdude: bbommarito: ah tnx

4:53 gko: The IDE is nice.

5:07 Borkdude: Actually I just want to use it from emacs

5:07 to run some code from PAIP

5:08 so simple is good here

5:08 it should be easy to get a swank server running

5:10 ah I read here that that is also easy with lispworks

8:23 clgv: can multimethods be overloaded?

8:32 raek: clgv: in what way? varying number of arguments? default arguments?

8:33 clgv: raek: varying number of arguments. in the source it's directing the implementation to 'fn so that should be possible

8:34 raek: yes. just make sure that both the dispatch function and the methods can receive varying number of arguments

8:35 clgv: raek: I did. The tests worked well.

8:36 Chousuke: yeah it should work just fine

9:38 Borkdude: Raynes: I'm trying out lein findn

9:39 Raynes: after I installed it and try it, it says it can't find findfn/core.clj

9:40 Raynes: should I include it in a project or smth? I expected it to "just work"

9:40 Raynes: I wondered if you could use findfn to solve this question on SO: http://stackoverflow.com/questions/8182956/standard-version-or-idiomatic-use-of-fn-f-args-apply-f-args

9:56 Sindikat: hello! how can i launch a Clojure subprocess besides using leiningen? (i am emacs user)

10:02 kephale: you'd really be best off with lein + swank-clojure

10:05 Borkdude: Raynes: strange, if I just use findfn in a project, it can't find the function find-fn either

10:05 kephale: Sindikat: err.. probably should have tagged your handle. then use slime, there is also clojure-jack-in, but i've never used that

10:06 raek: Sindikat: this is the most common way: http://technomancy.us/149

10:07 you have to install clojure-mode in emacs and the swank-clojure leiningen plugin.

10:07 Borkdude: Raynes: ah wait, now it's working inside a project

10:07 Sindikat: raek: yeah, i already read through swank-clojure readme, thanks! currently i'm just playing with clojure-repl

10:08 Borkdude: Raynes: the lein plugin isn't working yet, maybe I should update lein?

10:12 Raynes: ah upgrading to 1.6.2 and then re-installing the plugin worked

10:16 TimMc: $findfn 1 [clojure.core/* clojure.core/*']

10:16 lazybot: []

10:16 TimMc: :-P

10:21 Borkdude: Should find-arg be able to find out what % should be? (find-arg [2 3 4] (map '% [2 3 4]))

10:23 Ah, should call it like this: (find-arg [2 3 4] map '% [2 3 4])

10:23 syntax...

10:24 TimMc: sin tacks

10:28 Borkdude: hmm... (find-arg [-1 6 27] map '% [- + *] [1 2 3] [1 2 3] [1 2 3]) ;=> (clojure.core/trampoline)

10:28

10:29 bhenry: (map trampoline [- + *] [1 2 3] [1 2 3] [1 2 3])

10:29 ,(map trampoline [- + *] [1 2 3] [1 2 3] [1 2 3])

10:29 clojurebot: (-1 6 27)

10:29 bhenry: noice

10:29 TimMc: Wow, so you can use trampoline as a "call" fn.

10:30 clgv: ,(doc trampoline)

10:30 clojurebot: "([f] [f & args]); trampoline can be used to convert algorithms requiring mutual recursion without stack consumption. Calls f with supplied args, if any. If f returns a fn, calls that fn with no arguments, and continues to repeat, until the return value is not a fn, then returns that non-fn value. Note that if you want to return a fn as a final value, you must wrap it in some data structure and un...

10:30 clgv: a function^^

10:32 TimMc: $findarg (some % [nil 2 true false]) 2

10:32 lazybot: []

10:32 Borkdude: Every element will be like: (trampoline - 1 1 1), (trampoline + 2 2 2), (trampoline * 3 3 3). Pretty useless but it works :)

10:32 TimMc: $findarg some % [nil 2 true false] 2

10:32 lazybot: [clojure.set/union clojure.set/intersection clojure.set/difference clojure.core/+ clojure.core/* clojure.core/+' clojure.core/macroexpand-1 clojure.core/comp clojure.core/rationalize clojure.core/macroexpand clojure.core/*' clojure.core/max clojure.core/identity cl... https://gist.github.com/1376743

10:33 TimMc: really?

10:34 ,(map (juxt dissoc macroexpand comp +) [2 nil true false])

10:34 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException>

10:34 TimMc: ,(map (juxt dissoc macroexpand comp +) [2 nil])

10:34 clojurebot: ([2 2 2 2] [nil nil nil nil])

10:35 clgv: $findarg some '% [nil 2 true false] 2

10:35 lazybot: []

10:35 TimMc: clgv: no quoting % in lazybot's findarg

10:35 clgv: oh ok

10:36 $findarg % 2 2 4

10:36 TimMc: Don't know why, come to think of it.

10:36 lazybot: [clojure.core/unchecked-multiply clojure.core/+ clojure.core/* clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-multiply-int clojure.core/*' clojure.core/unchecked-add-int]

10:36 clgv: $findarg '% 2 2 4

10:36 melipone: can I do destructuring in clojure just like in Lisp where a function can return more than one value?

10:36 lazybot: []

10:37 jcromartie: melipone: yes

10:38 TimMc: &(let [[a b] ((juxt + *) 2 3)] (str a " and " b))

10:38 lazybot: ⇒ "5 and 6"

10:39 TimMc: melipone: ^ destructuring in a let binding

10:41 Borkdude: $findarg map (% - + *) [1 2 3] [1 2 3] [1 2 3] [-1 6 27]

10:41 lazybot: clojure.lang.ArityException: Wrong number of args (3) passed to: Symbol

10:41 Borkdude: room for improvement

10:41 jcromartie: melipone: read about let here http://clojure.org/special_forms

10:44 TimMc: Borkdude: Not quite... you're asking for the result of evaluating ('% - + *)

10:44 melipone: Long story short, return a map or vector of the return values.

10:46 $findarg ((constantly 4) %) 4

10:46 lazybot: []

10:46 TimMc: $findarg (constantly 4) % 4

10:46 lazybot: []

10:47 TimMc: I don't know why *that* didn't work.

10:47 Borkdude: timmc I'm asking for %

10:47 TimMc: hrm, right

10:47 Sorry, brain fart.

10:49 Anyway, I don't think there's a function that does that.

10:54 dfilimon: hi! i'm looking for a version of map catered to functions with side-effects

10:54 so, i'm drawing a seq of shapes using map

10:54 but i don't want to get a seq of nils back

10:54 i just want one nil

10:55 clgv: dfilimon: you can use 'doseq

10:56 dfilimon: seems to be like what i need

10:56 will try

10:56 thanks!

10:58 clgv: yup, that works! thanks!

11:33 TimMc: Ugh, I'm having problems with Enlive.

11:34 There's no clear distinction between fns that operate on nodes *now* vs. return a closure to do it later, and no distinction between fns that operate on seqs of nodes vs. single nodes.

11:38 clgv: Is there any implementation of accessing a File via a BlockingQueue in Clojure?

11:52 guess I have to implement a producer+consumer scenario for that one myself

12:01 cemerick: samaaron: I don't think that's going to work :-P

12:02 Can I get you to dump the files into the subdirectory here? https://github.com/cemerick/mostly-lazy

12:25 devn: I wish clojure/conj was every 3 months.

12:26 So many new things to toy with, so many upgraded libraries, so many discussions about what to do next.

12:37 cemerick: devn: not long 'til clojure west :-)

13:01 TimMc: I missed the Conj. :-(

13:02 I didn't think registration would fill up that wuickly.

13:02 *quickly

13:34 alexbaranosky: ~shrimp

13:34 clojurebot: shrimp must be http://www.bolour.com/papers/monads-through-pictures.html

13:40 michael_campbell: It lasted through the entire early bird time.

13:40 but just

13:46 jweiss: how hard is it to run my own clojurebot? is this the place to go? https://github.com/hiredman/clojurebot

13:47 hiredman: I run clojurebot via java -jar clojurebot.jar some-config.clj

13:47 I run 2 instances and I don't know of any others

13:49 the one I run for work does things like running builds and spaming the channel with open pull requests

13:49 jweiss: hiredman: i'm just looking for the eval functionality - teaching coworkers on our internal irc

13:49 hm, lein deps failed - org.clojars.thnetos:opennlp:jar:0.0.3

13:50 hiredman: interesting, maybe thats no longer on clojars, but I still have it in my m2

13:51 jweiss: also conduit-xmpp:conduit-xmpp:jar:1.0.0-SNAPSHOT

13:51 if i'm reading this output correctly

13:51 hiredman: that really shouldn't be required

13:52 jweiss: hiredman, can you push opennlp, or tell me where to find it?

13:53 hiredman: it's someone elses library, they must have moved it

13:56 drewr: perhaps dakrone can be of assistance

13:57 hiredman: jweiss: pull and try again

13:58 the new opennlp bits don't work exactly, but the build and irc+eval should work fine

13:58 I don't have time to fix the opennlp stuff right now

13:58 jweiss: hiredman: that's fine, but i am not getting any new commits

13:59 ah

13:59 hiredman: oh, right, need to push

13:59 jweiss: git pull origin

14:03 R4p70r: Anyone knows if some of the Conj videos are online now?

14:03 Raynes: R4p70r: Not yet.

14:05 hiredman: jweiss: if you need ssl support I have a little command line thing I run that creates an ssl tunnel for the bot

14:05 jweiss: hiredman i don't think i need ssl

14:05 R4p70r: hiredman, dows that use stunnel?

14:05 *does

14:05 ibdknox: ,(group-by :blah [])

14:05 clojurebot: {}

14:05 ibdknox: ,(group-by :blah nil)

14:05 clojurebot: {}

14:06 ibdknox: is there some rhyme or reason to which functions will take nil in place of a collection and not choke?

14:07 technomancy: ibdknox: depending on whether they were implemented before or after Clojure's stance on nil-punning solidified? =)

14:07 cemerick: hah

14:07 hiredman: R4p70r: no

14:07 ibdknox: lol

14:07 :p

14:07 cemerick: ibdknox: anything that processes collections sequentially will generally implicitly `seq` the coll.

14:07 hiredman: rm -rf in out && mkfifo in && mkfifo out && cat in | openssl s_client -connect irc.sa2s.us:6667 -quiet > out & cat out | tee out.log | nc -l localhost 7776 | tee in

14:08 oops, please ignore that host name there

14:08 ibdknox: cemerick: I see

14:08 hiredman: anyway, hostname:port of the server with ssl, and then nc running on the localhost with the port the bot connects to

14:09 cemerick: ibdknox: he says, unconvinced ;-)

14:10 ibdknox: cemerick: haha, well I guess that makes sense, but is a level of indirection that seems a little weird to me. Consistency would be nice.

14:10 cemerick: example of a fn that bombs on nil that you'd expect to succeed?

14:11 hiredman: ibdknox: which functions that take a collection and don't take nil have you puzzled?

14:11 ibdknox: cemerick: hiredman: I don't have a concrete example right now, I was just surprised actually that group-by worked with nil

14:12 cemerick: all due to

14:12 * cemerick ,(seq nil)

14:12 cemerick: ,(seq nil)

14:12 clojurebot: nil

14:12 hiredman: ,(type (lazy-seq nil))

14:12 clojurebot: clojure.lang.LazySeq

14:13 hiredman: ,(seq (lazy-seq nil))

14:13 clojurebot: nil

14:13 hiredman: ,(lazy-seq nil)

14:13 clojurebot: ()

14:13 pmenon: ,(take 10 (range))

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

14:14 ibdknox: cemerick: though to be clear, cleanly handling nil *is* nice, I'm not arguing that.

14:14 cemerick: range has a zero-arg arity? That's new, yeah?

14:14 Raynes: It was in 1.2.0, iIrc.

14:14 ibdknox: cemerick: I thought that was 1.2.0

14:14 cemerick: (iterate inc 0) being less intutive, I guess.

14:15 pandeiro: clojurescript question: is there an easier way to do the equivalent of JS' el.innerHTML = 'foo' than using dom/remove-children + dom/append?

14:15 pmenon: (take 10 (map #(* %1 2) (range)))

14:15 ,(take 10 (map #(* %1 2) (range)))

14:15 clojurebot: (0 2 4 6 8 ...)

14:15 cemerick: Raynes: See? Old. :-|

14:15 ibdknox: pandeiro: (set! el.innerHTML "foo")

14:15 cemerick: "What are these protocols of which you speak?"

14:15 pandeiro: ibdknox: great thanks, much nicer

14:16 ibdknox: pandeiro: you might have to do (.innerHTML el) I don't remember

14:16 I thought the first one worked

14:16 pandeiro: i'll check it out

14:17 dnolen: pandeiro: note that (.innerHTML el) probably won't work for much longer.

14:17 ibdknox: dnolen: when is that going in?

14:17 pandeiro: dnolen: ok, is the first suggestion the recommended idiom then?

14:17 ibdknox: pandeiro: in the future it will be (.-innerHTML el)

14:17 dnolen: ibdknox: just waiting for clojure 1.4.0 alpha1

14:18 hiredman: I think alpha1 is already out

14:18 ibdknox: pandeiro: denoting that it is a property

14:18 dnolen: hiredman: ah, sorry then the next one.

14:18 Raynes: That's a terrible name.

14:18 ibdknox: hiredman: it is, but it doesn't have the new property syntax

14:18 hiredman: right

14:18 Raynes: ibdknox: Maybe we should call them with .$-_*innerHTML

14:18 ibdknox: Raynes: you forgot ^

14:18 Raynes: Damn!

14:19 dnolen: Raynes: heh. I quite like the dash now.

14:19 pandeiro: this is to differentiate properites and argumentless methods?

14:19 dnolen: make understanding what's happening in CLJS much simpler.

14:19 pandeiro: yes

14:20 hiredman: it is kind of horrible given the use of dash for stuff like the implementing fns of methods in gen-class

14:20 dnolen: pandeiro: you can try it out by using the prop-lookup branch of ClojureScript

14:20 pandeiro: has anyone implemented a client-side couchdb lib in cljs yet?

14:21 dnolen: cool i will

14:22 ibdknox: pandeiro: cemerick has some code for that

14:22 TimMc: lein new plugin lein-derps

14:23 cemerick: pandeiro, ibdknox: nothing for cljs, client-side

14:23 clutch will do you server-side

14:24 pandeiro: i am working on something in my free time, but i am still at the bottom of the clj learning curve

14:24 cemerick: pandeiro: do you really want all your users to have open access to your database?

14:24 ibdknox: oh

14:24 pandeiro: cemerick: i think there are use cases

14:24 ibdknox: I misunderstood the question

14:24 cemerick: yeah, there are

14:24 I just don't happen to have them :-)

14:25 pandeiro: cemerick: and i think finer grained read controls may eventually wind up in couch

14:25 cemerick: yeah, maybe

14:27 I've never gotten into the whole couchapp thing. Clever, but…meh.

14:28 pandeiro: cemerick: i hear you, i am not an internet entrepreneur but an educator, so the idea of rapid prototyping functional webapps is interesting, even with the obvious data transparency

14:28 i'm throwing around terms like i know what i am talking about, which i really dont :)

14:29 technomancy: pandeiro: yeah, couch is fantastic for scaling down to personal-level apps

14:30 cemerick: its breadth is remarkable. "I like it for mobile/personal apps." "I like it for chewing through TBs of data."

14:30 pandeiro: technomancy: i understand for enterprisey stuff, you need heavier architecture, but for small groups of students, it's been great... plus the learning curve for couch was easy imo

14:31 dnolen: pandeiro: couchapp is amazing if you have the right concept in mind - http://datacouch.com/#/welcome is pretty sweet

14:31 pandeiro: i am a little embarrassed to put stuff on github with my very feeble skills but otoh i could use feedback/help from better programmers...

14:31 dnolen: seen that, awesome

14:32 technomancy: it would be interesting to see how couchapps could interact with telehash for routing around the brokenness of NAT

14:32 dnolen: pandeiro: a tool chain could leverage scraper wiki + google refine + data couch would be very useful to a log of organizations.

14:32 that could

14:32 log -> lot

14:32 technomancy: pandeiro: bring it to a local meetup, if there's one around

14:33 pandeiro: technomancy: i'm in brazil, do you know of anything?

14:34 technomancy: pandeiro: sorry =\

14:34 closest I know is paraseba in .ar

14:35 cemerick: isn't he running some kind of clojure training down there?

14:35 pandeiro: i will look into it... i guess i can always throw it up on github with appropriate disclaimers, not like i have a rep to lose

14:35 technomancy: cemerick: I thought the training was in canada

14:35 cemerick: hah

14:35 locality often being an antiquated question these days

14:36 technomancy: in general I agree, but there's nothing like a local meetup.

14:36 though... hm. conference calls plus pair.io? maybe.

14:36 pandeiro: technomancy: i really like the idea of yours to use VMs with a pre-setup emacs... i keep thinking of doing the same for cljs/couchapp stuff

14:36 because it took me weeks to figure it out

14:37 but now i have a decent flow, despite being an emacs/clojure noob

14:37 technomancy: cool

14:37 I really hope http://pair.io opens up soon.

14:37 pandeiro: i wondered why you use vagrant as opposed to just a vm image?

14:37 vdi or whatever it is for virtualbox

14:38 technomancy: pandeiro: you can't check VM images into git

14:38 ibdknox: I've been thinking about starting up some Clojure training in the bay area

14:39 pandeiro: i keep secretly hoping some of you guys get into screencasting :)

14:39 Raynes: technomancy: So do I!

14:51 joly: How would I go about accessing javax.print.DocFlavor.INPUT_STREAM.PDF? I've imported javax.print.DocFlavor, but I can't seem to get any farther.

14:52 cemerick: DocFlavor$INPUT_STREAM/PDF

14:52 assuming INPUT_STREAM is an inner class?

14:52 joly: Thanks, totally forgot about that. Yes, it's an inner class.

15:02 Sindikat: hello everyone!

15:03 let's say i want to write a simple game in Clojure. like a roguelike, or IF, or text quest, or RPG. what libraries should i employ to ease my efforts?

15:04 ibdknox: Sindikat: what would you want the library to do?

15:04 pandeiro: is there a shortcut to return true if a map has a key (regardless of value), and false otherwise?

15:04 Sindikat: graphics mostly. colored 2D ascii would be fine

15:04 hiredman: pandeiro: contains?

15:05 Sindikat: also some general algorithms like shortest path and so on

15:05 pandeiro: hiredman: doh, thanks

15:05 ibdknox: Sindikat: I'm fairly certain that doesn't exist for Clojure specifically. You'll need to use a java lib

15:05 Sindikat: the only game "library" I know of is this one: https://github.com/pepijndevos/Begame/

15:07 cemerick: It's unfortunate that ^:foo (Record. 5 6) does not pass along that metadata.

15:07 Sindikat: ibdknox: i guess so

15:07 joly: Sindikat: http://nakkaya.com/2010/06/01/path-finding-using-astar-in-clojure/ is a blog post about an A* implementation

15:07 cemerick: And yet the reader literal does.

15:07 Sindikat: joly: oh, cool!

15:07 hiredman: uh

15:07 ibdknox: Sindikat: writing a game in a functional language is an interesting experiment

15:07 hiredman: cemerick: ^ is a reader macro, what do you expect?

15:08 cemerick: magic dammit, magic

15:08 hiredman: :(

15:08 cemerick: hah

15:08 Sindikat: ibdknox: i don't think it would be particularly hard. i already tried doing such in Python, and the only mutable data were numerous key-value collections, that i stored in JSON files (npcs, weapons etc). otherwise game logic was pretty functional-like

15:09 hiredman: cemerick: I would prefer people learn the difference between read time, macroexpand time, compile time, and runtime

15:09 pandeiro: hiredman: contains? can only do a full match, not say a substring of a key, right?

15:09 ibdknox: Sindikat: I've done it as well :)

15:09 hiredman: pandeiro: check the doc string

15:10 pardon me

15:10 read time, macroexpand time, inline time, compile time, and runtime

15:12 chouser: Interesting. I'm more concerned with the difference between analyze time, emit time, and load time

15:13 hiredman: read time, macroexpand time, inline time, nalyze time, emit time, load time, and runtime

15:13 read time, macroexpand time, inline time, analyze time, emit time, load time, and runtime

15:13 Sindikat: hammer time :)

15:14 stuartsierra: Hammock time.

15:14 hiredman: inline time and analysis are kind of interleaved

15:15 cemerick: yeah, not sure if in-depth understanding of the compiler impl is a healthy thing, guys ;-)

15:15 * cemerick has Compiler.java open anyway — crap!

15:15 chouser: oh, read-eval time

15:15 syntax-quote time

15:16 nickmbailey: does top level code (not in a function) in a :gen-class namespace get evaluated at compile time or run time

15:16 cemerick: In any case, (Foo.) is known to be a ctor form involving an identified class, and we have the meta on that form. Emitting the equivalent of (with-meta (Foo.) {…}) isn't exactly out of reach.

15:17 If Foo implements IObj, of course

15:17 hiredman: cemerick: it is

15:17 you should understand the tools you use

15:17 which is why clojure has an edge, it is understandable

15:20 cemerick: I see no reason to do that

15:23 cemerick: hiredman: I don't either, really.

15:23 * cemerick is weary of editing :-P

15:39 devn: Raynes: I grabbed lein-newnew and am playing with it -- I've created a new template but lein doesn't seem to be picking up the change to my project.clj's description

15:40 Raynes: `lein templates` reflects the original description text in the project.clj -- do i have to manually update my templates?

15:40 Raynes: The documentation you see is the documentation on the actual template function, not the description in project.clj.

15:44 devn: Raynes: you say that you need to have a file on the classpath leiningen/new/blah.clj

15:44 could that live under ~/.lein/templates

15:44 nickmbailey: is it expected that the following code will print "Linux Stuff" when running 'lein compile'? https://gist.github.com/1377678

15:45 Raynes: devn: The idea is that templates are just maven artifacts. But allowing that would just mean adding ~/.lein/templates to the classpath.

15:45 technomancy: ^ How do we feel about that? Is that even possible with a plugin?

15:46 Really though, you could just 'lein install & lein plugin install ..' your template without putting it on maven, if you wanted.

15:46 devn: Raynes: what if I don't want to muck with the classpath? Could there be a default location for templates that is just added by default?

15:46 Raynes: Not sure what you mean by 'muck with the classpath'. You shouldn't ever have to touch the classpath.

15:47 devn: Raynes: I create a template `lein new template sensible_defaults`

15:47 I cd into sensible_defaults and edit project.clj

15:47 at this point the template is on my classpath from lein's perspective

15:48 if I'm somewhere else on the system I don't have access to that template

15:48 Raynes: 'lein install && lein plugin install sensible_defaults 0.1.0'

15:48 devn: ^drop this in the readme please :)

15:48 Raynes: Also, lein-newnew's template template replaces hypens with underscores for you.

15:49 All of the default templates, actually.

15:49 And sure, good idea.

15:49 devn: that's really nice

15:49 Raynes: One more suggestion would be to include more Usage to include the full story

15:50 Raynes: I noticed lein new template foo is missing from usage

15:50 Raynes: It's under 'writing templates'

15:52 devn: Raynes: An example of start->finish i run `lein new template foo`, i edit project.clj, i `lein install`, `lein plugin install sensible_defaults 0.1.0`, then i want to use my template so I ...

15:52 Raynes: not trying to nitpick just advocating a bit more narrative in the README

15:56 Raynes: so, I am clearly not getting it -- I lein install, lein plugin install sensible 0.1.0, lein new sensible foo

15:56 foo only contains a src/ dir with src/foo/foo.clj

15:57 biallym: I have the libraries working correctly with out lein

15:57 Hey so I would like to repackage a set of java libraries for clojure so that the maintainers can host them, and I'm very lost in what i need to do to make that work >.>

15:57 but I would like for lein to be able to install them it's self

15:57 Raynes: devn: So the problem is that your template didn't create the files you wanted?

15:58 devn: Raynes: so, my immediate understanding was totally flawed

16:00 Raynes: I imagined that what would happen was that, after I edited some files and what-not in my sensible/ dir, I could install that, and now I could use that whole thing as a "template", where lein-newnew understood that the project name and so on would change when i created a new project with that template

16:00 Raynes: looking at the default.clj, i see that was totally wrong :)

16:01 Raynes: :p

16:01 devn: Raynes: where is the best place to look in lein-newnew for a good example template

16:01 Raynes: default.clj is a decent example.

16:01 devn: and could I suggest creating an examples/ root-level dir

16:02 Raynes: Well, the idea is that the default templates serve as examples.

16:02 Not that I'm against other examples in an examples directory, but it'll just disappear when lein-newnew moves into Leiningen itself.

16:03 devn: Raynes: *nod*, totally understand, just raising the level of visibility I think would stop people from having the same experience that I had

16:03 *nod*, another totally valid point

16:03 * devn is saying totally a lot today

16:03 Raynes: Mostly, I just need to write a little tutorial.

16:03 On the wiki or something.

16:03 That can persist even when the project moves into Leiningen.

16:04 devn: Raynes: yeah, I'm happy to help out later on this evening

16:04 Raynes: Cool. :>

16:20 hhutch: Raynes: i did not know about lein-newnew, i wrote my own for internal use. that's very handy

16:21 Raynes: Well, I wrote it like 2 days ago.

16:21 ibdknox: hhutch: it's new

16:21 hhutch: ah

16:21 cool. great idea

16:25 yazirian: Has anyone out there taught clojure to a team of average developers? By which I mean, the clojure community seems to be self-selectedly intelligent; I have a BIG upcoming work project, and if it were just me I'd already be wearing out my parentheses, but I have to consider the team of jr. devs that will be developing and maintaining it along with me, and they aren't quite... shall we say, of precisely the same mindset.

16:26 stuartsierra: I taught Clojure to a group of high-school computer science students.

16:26 yazirian: I guess I'm talking about something tangentially related to Neal's talk at the conj, except in a world where tool acceptance is not the obstacle.

16:26 stuartsierra: But they were pretty bright.

16:27 ibdknox: yazirian: what is the current language?

16:27 yazirian: Where did you begin? The official docs, while thorough, are terse and exceptionally technical.

16:27 We're a python shop.

16:27 ibdknox: you should do a workshop, don't just hand them docs

16:27 jodaro: yazirian: unfortunately i've gained little traction in my group

16:27 yazirian: Personally, I've spent a lot of time with the published books as well as videos on for example blip.

16:28 jodaro: i've tried scala and clojure

16:28 hhutch: yazirian: i just went through stuartsierra's 3 day training based on labrepl

16:28 yazirian: But I can't go so far as to take a bunch of guys and dedicate a week of videos and bookreading on them.

16:28 jodaro: this is a mostly perl shop and no one seems to care really

16:28 hhutch: yazirian: that's a good approach to start

16:28 yazirian: jodaro: I'm sort of in the same place.

16:28 jodaro: we have a bunch of java dudes in another country

16:29 and they don't really get it either

16:29 stuartsierra: LabREPL is free, open-source, and full of content: https://github.com/relevance/labrepl

16:29 jodaro: so

16:29 yazirian: Like, I have a strong feeling like I've identified the right approach -- the problem is better suited than it would be in python, it's aggregating a firehose of syslog data

16:29 jodaro: i'd say the hardest part isn't the learning, its the buy-in

16:29 yazirian: I'm fortunate enough that I can just about dictate the tool, actually.

16:29 jodaro: yazirian: thats a good start

16:29 yazirian: Which is a spin on the problem; I'd be dragging them along.

16:29 jodaro: unless you piss them off with it, i guess

16:30 yeah

16:30 yazirian: exactly :)

16:30 stuartsierra: That looks really good, thanks!

16:30 stuartsierra: you're welcome

16:30 hhutch: yazirian: as lame as it may seem, i think the whole "interactive development" really sells clojure to people. When they see someone effeciently working in SLIME/Inferior LISP, it really makes a difference on "buy in"

16:31 yazirian: hhutch: I've had a few of those sorts of moments already, but python and in particular ipython seems to be "close enough" that until they actually do it, they don't see the distinction.

16:31 stuartsierra: That's less of a big deal for Ruby/Python folks, I think. They have similar capabilities.

16:31 ibdknox: Why are monome's so expensive? I want one :(

16:32 yazirian: I don't think syntax is too scary, but then again, I'm anecdotal on my team. :)

16:34 The existing system is already a fairly complex group of python processes interconnected via sysv message queues. That dictates things like futures, maybe a tool like lamina, you know... the complicated stuff around concurrency.

16:35 If the cliff is already steep, it feels like I should be that much more careful to choose the right starting place for training.

16:35 melipone: I'm trying to use with-out-append-writer in clojure.contrib.io but I get error msg "java.lang.Exception: Cannot change an open stream to append mode. (NO_SOURCE_FILE:0)" Any ideas?

16:35 hiredman: stop trying to change an open stream to append mode

16:36 stuartsierra: melipone: what are you calling with-out-append-writer on?

16:36 melipone: just a filename

16:36 "(with-out-append-writer "test.arff")"

16:37 stuartsierra: that should work: probably a bug

16:37 melipone: startsierra: a bug where?

16:37 stuartsierra: in clojure.java.io

16:37 melipone: damn

16:38 stuartsierra: Please file a JIRA ticket.

16:38 zerokarmaleft: ibdknox: i know right, it's just a box with lights for buttons :-/

16:38 stuartsierra: You may be able to work around it by calling `append-writer` instead, or calling the Java Writer constructors directly.

16:38 cemerick: ibdknox: there's cheaper knockoffs

16:38 zerokarmaleft: someone told me at the conj that you could easily construct one yourself for a fraction of the cost

16:38 ibdknox: cemerick: do you know the name of any of them

16:39 melipone: stuartsierra: okay thanks

16:40 cemerick: ibdknox: http://amzn.to/tW7l7m

16:40 No idea of the relative quality/features/ability to be easily integrated with overtone

16:40 zerokarmaleft: ibdknox: http://docs.monome.org/doku.php?id=tech:mk <= kit parts

16:41 ibdknox: zerokarmaleft: interesting

16:41 zerokarmaleft: b/c it ain't manly unless it's 64x64!

16:41 ibdknox: cemerick: yeah, I saw some of these, but it's hard to tell if any of them are worthwhile

16:44 yazirian: Is there a way to make slime open a slime-repl, if it didn't open one already? I'm using emacs-starter-kit v2 on emacs24 and it isn't opening a repl when i slime-connect to the labrepl swank...

16:45 zerokarmaleft: the novation is only $125

16:46 ibdknox: zerokarmaleft: it's very heavily tied with ableton

16:47 zerokarmaleft: yea i wouldn't bet on it being very configurable as a midi controller

16:47 though they do claim that

16:50 candera: Has anyone run across any tools for visualizing static call graphs in Clojure code?

16:50 zerokarmaleft: technomancy: did i miss the leiningen swag handout or are those long-sleeve baseball tees available somewhere?

16:51 technomancy: zerokarmaleft: it's just a cafepress thing: http://www.cafepress.com/technomancy

16:51 haven't quite taken it to the handing-out-free-merchandise level yet =)

16:51 zerokarmaleft: heh, fair enough

16:52 yazirian: n/m fixed by commenting out dev-dependencies in project.clj

16:52 zerokarmaleft: i thought perhaps heroku subsidized your shirts :D

16:52 stuartsierra: melipone: Wait, did you say clojure.contrib.io?

16:52 or clojure.java.io?

16:53 yazirian: stuartsierra: he was looking at contrib

16:53 stuartsierra: well, who knows what state that is in.

16:54 That bug may be fixed in clojure.java.io.

16:54 (Or maybe the offending function doesn't exist.)

16:54 yazirian: it doesn't

16:55 stuartsierra: For good reason, it seems.

16:55 yazirian: haha yeah, if it isn't working :)

17:02 technomancy: only three watchers on https://github.com/trptcolin/reply how can this be‽

17:03 stuartsierra: never heard of it

17:03 ibdknox: I couldn't get it to work

17:04 jodaro: huh

17:04 i get all of those from emacs i think

17:04 re: the bullet points

17:04 technomancy: stuartsierra: it uses jline 2 to provide project-aware completion and other goodies

17:04 hiredman: technomancy: it is newish

17:04 technomancy: also non-broken unicode, yay

17:05 jodaro: yeah, that's largely the reason the leiningen repl hasn't seen much investment too.

17:05 jodaro: oh code completion

17:05 technomancy: "luckily" trptcolin uses vim. =)

17:05 jodaro: thats kinda cool

17:05 ibdknox: hm

17:05 vimclojure does all of that too

17:05 * technomancy has this crazy idea that in the future type hints could be used for actual java method completion.

17:05 technomancy: ibdknox: well don't tell colin!

17:06 hiredman: I enjoy how the dejour link is a 404

17:06 ibdknox: :)

17:06 hiredman: technomancy: the analyzer!

17:06 technomancy: aw yeah

17:06 stuartsierra: Ever notice how periodically someone will say "Why doesn't everybody use X?" only to be followed by "I couldn't get it to work with Y, Z, or Q."

17:07 hiredman: someone should write that java Expr => clojure maps thing

17:07 technomancy: stuartsierra: yeah, I was primarily attempting to counteract the "never heard of it" blocker rather than anything more substantial =)

17:08 hiredman: another potentially awful idea: storing runtime types off a test run and using it to annotate type hints for a given set of defns

17:08 hiredman: and I used up my one night of extracurricular activities recompiling emacs and futzing with the color settings on my monitor

17:08 so not me

17:10 devn: speaking of labrepl...

17:11 * devn git clones labrepl

17:11 hiredman: :(

17:16 ibdknox: for those who didn't see my editor mockups at the conj: http://chris-granger.com/gallery/mockups

17:18 stuartsierra: ibdknox: What is that?

17:18 Raynes: stuartsierra: His dream editor that he'll never write.

17:18 stuartsierra: ah

17:18 ibdknox: lol

17:19 stuartsierra: It's pretty, though.

17:19 ibdknox: why won't I?

17:19 Raynes: Because you're lazy.

17:19 ibdknox: stuartsierra: yeah, just concepts of a clojure focused editor

17:19 well

17:20 I *am* lazy. That's hard to argue against. I also happen to use Clojure an awful lot too though...

17:20 Raynes: ibdknox: Seriously though, if you do pursue it, count me in.

17:20 ibdknox: it's codenamed sona

17:21 Raynes: But it'd probably make more sense a very nice text editor written in Clojure that just happens to have the best Clojure support of all editors ever.

17:21 technomancy: ibdknox: not interested in clooj?

17:21 zerokarmaleft: ibdknox: what's in the nodedefense folder?

17:22 ibdknox: zerokarmaleft: the game I built for the node knockout

17:22 zerokarmaleft: oh yea, i played that...no wonder it was ringing a bell

17:23 ibdknox: technomancy: the implementation would be radically different than the direction clooj is headed in

17:24 Raynes: And wouldn't have such a horrible name either.

17:24 ibdknox: I was thinking of embedded webkit so that it could leverage some the really nice editors already written in JS and could then be completely scripted in cljs

17:24 technomancy: interesting

17:25 ibdknox: plus, trying to embed controls into java textboxes?

17:25 ugh

17:25 technomancy: oh, I was under the impression that the textbox stuff would have to be reimplemented no matter what

17:25 if you're going to get something that's actually usable

17:25 ibdknox: Ideally I'd steal the editor

17:25 which I can do in the JS world

17:25 technomancy: that is to say, I can't imagine clooj is using that because they think it's a good idea long-term.

17:26 ibdknox: writing editors from scratch is a pain in the ass. I know this first hand.

17:26 lol

17:26 hiredman: at some point swing is going to get a webview

17:26 ibdknox: hiredman: swt already has one

17:26 Raynes: clooj could really use seesaw.

17:26 hiredman: yeah, but I dislike swt

17:27 I dunno, I imagine I am not the audience for new things

17:28 ibdknox: probably not

17:28 I'm not sure it'd make sense to think of the emacs folks as the audience for something like this

17:28 hiredman: clojure -> elisp byte code

17:28 ibdknox: textmate did a lot for the rails community

17:28 hiredman: now there's platform power

17:28 technomancy: hiredman: yeah, once that compiler is written we'll have three competing Clojure editors =)

17:29 I wonder if that would make a good long-term seajure hack project

17:30 ibdknox: technomancy: an elisp compiler?

17:30 technomancy: ibdknox: elisp-as-a-compilation-target

17:30 well, elisp or emacs bytecode

17:30 ibdknox: right

17:30 technomancy: modulo all the hosty deftype OO stuff, elisp would be the least semantic distance from clojure

17:30 hiredman: well, I think once we get a nice ir (what chouser was talking about) then other targets are much easier

17:31 technomancy: my main problem is I get bored with compiler books because they go on and on about "here's how you parse languages; this stuff is really hard so pay attention" ... snooooooze

17:32 "you want to write a compiler for a language with a complicated syntax. [...] now you have two problems"

17:32 hiredman: emitting byte code and making the vm deal with the nasty compiler bits like register allocation is pretty nice

17:32 technomancy: hiredman: problem is I don't think byte code is stable between major releases

17:32 also: debuggery

17:36 hiredman: also, symbol macros

17:36 man, that would be excellent

19:04 seancorfield: if I have something I just want to "fire and forget", what's the recommended way?

19:05 in other words, I have a side-effecting function I want called async... I just want it executed "soon" but I don't really care when / where.

19:06 hiredman: future

19:07 seancorfield: 'k... that's what I was considering... just wanted to make sure that was idiomatic :)

19:09 hiredman: it's exactly what you want on the threadpool you want

19:47 slyphon: technomancy: hi!

19:48 technomancy: i'm happy to see leiningen is still alive and well

19:48 kreigly: heylo

19:48 looking for the clojure 1.3.0 equivalent of (gen-and-load-class

19:49 as in (gen-and-load-class 'DeadEnd :extends Throwable)

19:59 no dice?

20:12 hiredman: kreigly: gen-and-load-class was removed many years ago

20:12 pre 1.2 possible pre 1.0

21:02 bobhope: hello clojure friends, I am just starting out with clojure, and I'm having trouble configuring nailgun, leiningen, vimclojure to play nicely

21:03 I added the vimclojure/server as a dev-dependency in my leiningen config

21:03 and I downloaded the nailgun-client and set the vimclojure#NailgunClient variable

21:03 to no avail

21:07 chouser: trying to use overtone. The JVM keeps segfaulting. :-(

21:26 ok, not longer crashing. Also, making no sound.

21:31 leo2007: good morning

21:32 chouser: woo! working now..

21:34 santa_monica_506: is there a way i can mock a deref def in my clojure test?

21:36 chouser: what's a deref def?

21:38 santa_monica_506: something like (def proxy (atom nil)) ... then (.someMethod @proxy arg1 arg2)

23:20 mdh```: my clojure-mode indents cond bad :-(

23:21 bhenry: mdh mine indents weird when using {:keys} destructuring inside of a let.

23:23 mdh```: hmm, yeah basic case of (cond a b \n c d) looks fine

23:24 slyphon: was it clojure that let you put your source in src/com.example.proj instead of src/com/example/proj ?

23:24 sorry, i just remember one of the JVM langugaes was ok with that

23:26 mdh```: this: (cond (or \n) x \n b)

23:38 slyphon: what's the correct version of clojure-contrib to use w/ 1.3 ?

23:38 brehaut: ~contrib

23:39 clojurebot: contribute is http://clojure.org/contributing

23:39 brehaut: bah

23:39 slyphon: hah

23:39 brehaut: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

23:39 basicly, use the individual contrib libs; there is no monolothic contrib any more

23:39 slyphon: oh

23:39 smert

23:40 "i can't believe nobody stepped up to maintain that huge codebase"

23:41 (those were sarcasm quotes)

23:56 brehaut: ,(apropos 'fn)

23:56 clojurebot: (fn? bound-fn letfn fn some-fn ...)

Logging service provided by n01se.net