#clojure logs

2011-11-18

01:23archaici 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?
01:23amalloyarchaic: that's the class's name in the jvm, for real
01:24amalloyas specified in the java language specification
01:24archaicahh k . i have never used java before
01:24amalloyit's nothing to do with enums in fact
01:24amalloyit's just that Position is an enum class nested inside two other classes, and it "inherits" the name
01:25amalloyand that's just The Way It Is
01:25archaickinda like underscores for hyphens :)
01:30amalloywell, except that's clj-specific. doesn't *have* to be that way
01:41keith_in clojurescript, is there a special form that emits foo["bar"]
01:42keith_assuming foo is a regular javascript object
01:42amalloyaget
01:43hiredman(.bar foo)
01:43keith_hiredman: won't that get munged?
01:43hiredmandepends on information you've not divulged
01:43keith_with advanced optimizations
01:44hiredmanit still depends
01:44hiredmanis foo some global object?
01:44keith_no it's a local variable
01:44hiredmanthen everything will get munged as it should
01:44hiredmanand not as it shouldn't
03:13daakuhow 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?
03:21amalloyif 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
03:47Raynesamalloy: He map be able to use map? Sure sign of sleep deprivation.
03:47amalloymap map map
03:47RaynesPacman!
04:37BorkdudeWhat is the best Common Lisp environment on OSX? (subjective, I know)
04:37Borkdude(that's why I wont post it on StackOverflow...)
04:39BorkdudeClozure CL maybe?
04:45bbommaritoBorkdude: LispWorks is a pretty nice one from what I have heard.
04:50bbommaritoBuddy who works for GS loves Lispworks.
04:52gkoHe uses LW in GS for work?
04:52bbommaritoNo, they use some weird Lisp, but he himself enjoys LW and uses it for personal projects.
04:53bbommaritoAnd, 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.
04:53Borkdudebbommarito: ah tnx
04:53gkoThe IDE is nice.
05:07BorkdudeActually I just want to use it from emacs
05:07Borkdudeto run some code from PAIP
05:08Borkdudeso simple is good here
05:08Borkdudeit should be easy to get a swank server running
05:10Borkdudeah I read here that that is also easy with lispworks
08:23clgvcan multimethods be overloaded?
08:32raekclgv: in what way? varying number of arguments? default arguments?
08:33clgvraek: varying number of arguments. in the source it's directing the implementation to 'fn so that should be possible
08:34raekyes. just make sure that both the dispatch function and the methods can receive varying number of arguments
08:35clgvraek: I did. The tests worked well.
08:36Chousukeyeah it should work just fine
09:38BorkdudeRaynes: I'm trying out lein findn
09:39BorkdudeRaynes: after I installed it and try it, it says it can't find findfn/core.clj
09:40BorkdudeRaynes: should I include it in a project or smth? I expected it to "just work"
09:40BorkdudeRaynes: 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
09:56Sindikathello! how can i launch a Clojure subprocess besides using leiningen? (i am emacs user)
10:02kephaleyou'd really be best off with lein + swank-clojure
10:05BorkdudeRaynes: strange, if I just use findfn in a project, it can't find the function find-fn either
10:05kephaleSindikat: err.. probably should have tagged your handle. then use slime, there is also clojure-jack-in, but i've never used that
10:06raekSindikat: this is the most common way: http://technomancy.us/149
10:07raekyou have to install clojure-mode in emacs and the swank-clojure leiningen plugin.
10:07BorkdudeRaynes: ah wait, now it's working inside a project
10:07Sindikatraek: yeah, i already read through swank-clojure readme, thanks! currently i'm just playing with clojure-repl
10:08BorkdudeRaynes: the lein plugin isn't working yet, maybe I should update lein?
10:12BorkdudeRaynes: ah upgrading to 1.6.2 and then re-installing the plugin worked
10:16TimMc$findfn 1 [clojure.core/* clojure.core/*']
10:16lazybot[]
10:16TimMc:-P
10:21BorkdudeShould find-arg be able to find out what % should be? (find-arg [2 3 4] (map '% [2 3 4]))
10:23BorkdudeAh, should call it like this: (find-arg [2 3 4] map '% [2 3 4])
10:23Borkdudesyntax...
10:24TimMcsin tacks
10:28Borkdudehmm... (find-arg [-1 6 27] map '% [- + *] [1 2 3] [1 2 3] [1 2 3]) ;=> (clojure.core/trampoline)
10:28Borkdude
10:29bhenry(map trampoline [- + *] [1 2 3] [1 2 3] [1 2 3])
10:29bhenry,(map trampoline [- + *] [1 2 3] [1 2 3] [1 2 3])
10:29clojurebot(-1 6 27)
10:29bhenrynoice
10:29TimMcWow, so you can use trampoline as a "call" fn.
10:30clgv,(doc trampoline)
10:30clojurebot"([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:30clgva function^^
10:32TimMc$findarg (some % [nil 2 true false]) 2
10:32lazybot[]
10:32BorkdudeEvery element will be like: (trampoline - 1 1 1), (trampoline + 2 2 2), (trampoline * 3 3 3). Pretty useless but it works :)
10:32TimMc$findarg some % [nil 2 true false] 2
10:32lazybot[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:33TimMcreally?
10:34TimMc,(map (juxt dissoc macroexpand comp +) [2 nil true false])
10:34clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException>
10:34TimMc,(map (juxt dissoc macroexpand comp +) [2 nil])
10:34clojurebot([2 2 2 2] [nil nil nil nil])
10:35clgv$findarg some '% [nil 2 true false] 2
10:35lazybot[]
10:35TimMcclgv: no quoting % in lazybot's findarg
10:35clgvoh ok
10:36clgv$findarg % 2 2 4
10:36TimMcDon't know why, come to think of it.
10:36lazybot[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:36clgv$findarg '% 2 2 4
10:36meliponecan I do destructuring in clojure just like in Lisp where a function can return more than one value?
10:36lazybot[]
10:37jcromartiemelipone: yes
10:38TimMc&(let [[a b] ((juxt + *) 2 3)] (str a " and " b))
10:38lazybot⇒ "5 and 6"
10:39TimMcmelipone: ^ destructuring in a let binding
10:41Borkdude$findarg map (% - + *) [1 2 3] [1 2 3] [1 2 3] [-1 6 27]
10:41lazybotclojure.lang.ArityException: Wrong number of args (3) passed to: Symbol
10:41Borkduderoom for improvement
10:41jcromartiemelipone: read about let here http://clojure.org/special_forms
10:44TimMcBorkdude: Not quite... you're asking for the result of evaluating ('% - + *)
10:44TimMcmelipone: Long story short, return a map or vector of the return values.
10:46TimMc$findarg ((constantly 4) %) 4
10:46lazybot[]
10:46TimMc$findarg (constantly 4) % 4
10:46lazybot[]
10:47TimMcI don't know why *that* didn't work.
10:47Borkdudetimmc I'm asking for %
10:47TimMchrm, right
10:47TimMcSorry, brain fart.
10:49TimMcAnyway, I don't think there's a function that does that.
10:54dfilimonhi! i'm looking for a version of map catered to functions with side-effects
10:54dfilimonso, i'm drawing a seq of shapes using map
10:54dfilimonbut i don't want to get a seq of nils back
10:54dfilimoni just want one nil
10:55clgvdfilimon: you can use 'doseq
10:56dfilimonseems to be like what i need
10:56dfilimonwill try
10:56dfilimonthanks!
10:58dfilimonclgv: yup, that works! thanks!
11:33TimMcUgh, I'm having problems with Enlive.
11:34TimMcThere'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:38clgvIs there any implementation of accessing a File via a BlockingQueue in Clojure?
11:52clgvguess I have to implement a producer+consumer scenario for that one myself
12:01cemericksamaaron: I don't think that's going to work :-P
12:02cemerickCan I get you to dump the files into the subdirectory here? https://github.com/cemerick/mostly-lazy
12:25devnI wish clojure/conj was every 3 months.
12:26devnSo many new things to toy with, so many upgraded libraries, so many discussions about what to do next.
12:37cemerickdevn: not long 'til clojure west :-)
13:01TimMcI missed the Conj. :-(
13:02TimMcI didn't think registration would fill up that wuickly.
13:02TimMc*quickly
13:34alexbaranosky~shrimp
13:34clojurebotshrimp must be http://www.bolour.com/papers/monads-through-pictures.html
13:40michael_campbellIt lasted through the entire early bird time.
13:40michael_campbellbut just
13:46jweisshow hard is it to run my own clojurebot? is this the place to go? https://github.com/hiredman/clojurebot
13:47hiredmanI run clojurebot via java -jar clojurebot.jar some-config.clj
13:47hiredmanI run 2 instances and I don't know of any others
13:49hiredmanthe one I run for work does things like running builds and spaming the channel with open pull requests
13:49jweisshiredman: i'm just looking for the eval functionality - teaching coworkers on our internal irc
13:49jweisshm, lein deps failed - org.clojars.thnetos:opennlp:jar:0.0.3
13:50hiredmaninteresting, maybe thats no longer on clojars, but I still have it in my m2
13:51jweissalso conduit-xmpp:conduit-xmpp:jar:1.0.0-SNAPSHOT
13:51jweissif i'm reading this output correctly
13:51hiredmanthat really shouldn't be required
13:52jweisshiredman, can you push opennlp, or tell me where to find it?
13:53hiredmanit's someone elses library, they must have moved it
13:56drewrperhaps dakrone can be of assistance
13:57hiredmanjweiss: pull and try again
13:58hiredmanthe new opennlp bits don't work exactly, but the build and irc+eval should work fine
13:58hiredmanI don't have time to fix the opennlp stuff right now
13:58jweisshiredman: that's fine, but i am not getting any new commits
13:59jweissah
13:59hiredmanoh, right, need to push
13:59jweissgit pull origin
14:03R4p70rAnyone knows if some of the Conj videos are online now?
14:03RaynesR4p70r: Not yet.
14:05hiredmanjweiss: if you need ssl support I have a little command line thing I run that creates an ssl tunnel for the bot
14:05jweisshiredman i don't think i need ssl
14:05R4p70rhiredman, dows that use stunnel?
14:05R4p70r*does
14:05ibdknox,(group-by :blah [])
14:05clojurebot{}
14:05ibdknox,(group-by :blah nil)
14:05clojurebot{}
14:06ibdknoxis there some rhyme or reason to which functions will take nil in place of a collection and not choke?
14:07technomancyibdknox: depending on whether they were implemented before or after Clojure's stance on nil-punning solidified? =)
14:07cemerickhah
14:07hiredmanR4p70r: no
14:07ibdknoxlol
14:07ibdknox:p
14:07cemerickibdknox: anything that processes collections sequentially will generally implicitly `seq` the coll.
14:07hiredmanrm -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:08hiredmanoops, please ignore that host name there
14:08ibdknoxcemerick: I see
14:08hiredmananyway, hostname:port of the server with ssl, and then nc running on the localhost with the port the bot connects to
14:09cemerickibdknox: he says, unconvinced ;-)
14:10ibdknoxcemerick: 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:10cemerickexample of a fn that bombs on nil that you'd expect to succeed?
14:11hiredmanibdknox: which functions that take a collection and don't take nil have you puzzled?
14:11ibdknoxcemerick: hiredman: I don't have a concrete example right now, I was just surprised actually that group-by worked with nil
14:12cemerickall due to
14:12cemerick,(seq nil)
14:12clojurebotnil
14:12hiredman,(type (lazy-seq nil))
14:12clojurebotclojure.lang.LazySeq
14:13hiredman,(seq (lazy-seq nil))
14:13clojurebotnil
14:13hiredman,(lazy-seq nil)
14:13clojurebot()
14:13pmenon,(take 10 (range))
14:13clojurebot(0 1 2 3 4 ...)
14:14ibdknoxcemerick: though to be clear, cleanly handling nil *is* nice, I'm not arguing that.
14:14cemerickrange has a zero-arg arity? That's new, yeah?
14:14RaynesIt was in 1.2.0, iIrc.
14:14ibdknoxcemerick: I thought that was 1.2.0
14:14cemerick(iterate inc 0) being less intutive, I guess.
14:15pandeiroclojurescript question: is there an easier way to do the equivalent of JS' el.innerHTML = 'foo' than using dom/remove-children + dom/append?
14:15pmenon(take 10 (map #(* %1 2) (range)))
14:15pmenon,(take 10 (map #(* %1 2) (range)))
14:15clojurebot(0 2 4 6 8 ...)
14:15cemerickRaynes: See? Old. :-|
14:15ibdknoxpandeiro: (set! el.innerHTML "foo")
14:15cemerick"What are these protocols of which you speak?"
14:15pandeiroibdknox: great thanks, much nicer
14:16ibdknoxpandeiro: you might have to do (.innerHTML el) I don't remember
14:16ibdknoxI thought the first one worked
14:16pandeiroi'll check it out
14:17dnolenpandeiro: note that (.innerHTML el) probably won't work for much longer.
14:17ibdknoxdnolen: when is that going in?
14:17pandeirodnolen: ok, is the first suggestion the recommended idiom then?
14:17ibdknoxpandeiro: in the future it will be (.-innerHTML el)
14:17dnolenibdknox: just waiting for clojure 1.4.0 alpha1
14:18hiredmanI think alpha1 is already out
14:18ibdknoxpandeiro: denoting that it is a property
14:18dnolenhiredman: ah, sorry then the next one.
14:18RaynesThat's a terrible name.
14:18ibdknoxhiredman: it is, but it doesn't have the new property syntax
14:18hiredmanright
14:18Raynesibdknox: Maybe we should call them with .$-_*innerHTML
14:18ibdknoxRaynes: you forgot ^
14:18RaynesDamn!
14:19dnolenRaynes: heh. I quite like the dash now.
14:19pandeirothis is to differentiate properites and argumentless methods?
14:19dnolenmake understanding what's happening in CLJS much simpler.
14:19dnolenpandeiro: yes
14:20hiredmanit is kind of horrible given the use of dash for stuff like the implementing fns of methods in gen-class
14:20dnolenpandeiro: you can try it out by using the prop-lookup branch of ClojureScript
14:20pandeirohas anyone implemented a client-side couchdb lib in cljs yet?
14:21pandeirodnolen: cool i will
14:22ibdknoxpandeiro: cemerick has some code for that
14:22TimMclein new plugin lein-derps
14:23cemerickpandeiro, ibdknox: nothing for cljs, client-side
14:23cemerickclutch will do you server-side
14:24pandeiroi am working on something in my free time, but i am still at the bottom of the clj learning curve
14:24cemerickpandeiro: do you really want all your users to have open access to your database?
14:24ibdknoxoh
14:24pandeirocemerick: i think there are use cases
14:24ibdknoxI misunderstood the question
14:24cemerickyeah, there are
14:24cemerickI just don't happen to have them :-)
14:25pandeirocemerick: and i think finer grained read controls may eventually wind up in couch
14:25cemerickyeah, maybe
14:27cemerickI've never gotten into the whole couchapp thing. Clever, but…meh.
14:28pandeirocemerick: 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:28pandeiroi'm throwing around terms like i know what i am talking about, which i really dont :)
14:29technomancypandeiro: yeah, couch is fantastic for scaling down to personal-level apps
14:30cemerickits breadth is remarkable. "I like it for mobile/personal apps." "I like it for chewing through TBs of data."
14:30pandeirotechnomancy: 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:31dnolenpandeiro: couchapp is amazing if you have the right concept in mind - http://datacouch.com/#/welcome is pretty sweet
14:31pandeiroi 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:31pandeirodnolen: seen that, awesome
14:32technomancyit would be interesting to see how couchapps could interact with telehash for routing around the brokenness of NAT
14:32dnolenpandeiro: a tool chain could leverage scraper wiki + google refine + data couch would be very useful to a log of organizations.
14:32dnolenthat could
14:32dnolenlog -> lot
14:32technomancypandeiro: bring it to a local meetup, if there's one around
14:33pandeirotechnomancy: i'm in brazil, do you know of anything?
14:34technomancypandeiro: sorry =\
14:34technomancyclosest I know is paraseba in .ar
14:35cemerickisn't he running some kind of clojure training down there?
14:35pandeiroi 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:35technomancycemerick: I thought the training was in canada
14:35cemerickhah
14:35cemericklocality often being an antiquated question these days
14:36technomancyin general I agree, but there's nothing like a local meetup.
14:36technomancythough... hm. conference calls plus pair.io? maybe.
14:36pandeirotechnomancy: 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:36pandeirobecause it took me weeks to figure it out
14:37pandeirobut now i have a decent flow, despite being an emacs/clojure noob
14:37technomancycool
14:37technomancyI really hope http://pair.io opens up soon.
14:37pandeiroi wondered why you use vagrant as opposed to just a vm image?
14:37pandeirovdi or whatever it is for virtualbox
14:38technomancypandeiro: you can't check VM images into git
14:38ibdknoxI've been thinking about starting up some Clojure training in the bay area
14:39pandeiroi keep secretly hoping some of you guys get into screencasting :)
14:39Raynestechnomancy: So do I!
14:51jolyHow 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:52cemerickDocFlavor$INPUT_STREAM/PDF
14:52cemerickassuming INPUT_STREAM is an inner class?
14:52jolyThanks, totally forgot about that. Yes, it's an inner class.
15:02Sindikathello everyone!
15:03Sindikatlet'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:04ibdknoxSindikat: what would you want the library to do?
15:04pandeirois there a shortcut to return true if a map has a key (regardless of value), and false otherwise?
15:04Sindikatgraphics mostly. colored 2D ascii would be fine
15:04hiredmanpandeiro: contains?
15:05Sindikatalso some general algorithms like shortest path and so on
15:05pandeirohiredman: doh, thanks
15:05ibdknoxSindikat: I'm fairly certain that doesn't exist for Clojure specifically. You'll need to use a java lib
15:05ibdknoxSindikat: the only game "library" I know of is this one: https://github.com/pepijndevos/Begame/
15:07cemerickIt's unfortunate that ^:foo (Record. 5 6) does not pass along that metadata.
15:07Sindikatibdknox: i guess so
15:07jolySindikat: http://nakkaya.com/2010/06/01/path-finding-using-astar-in-clojure/ is a blog post about an A* implementation
15:07cemerickAnd yet the reader literal does.
15:07Sindikatjoly: oh, cool!
15:07hiredmanuh
15:07ibdknoxSindikat: writing a game in a functional language is an interesting experiment
15:07hiredmancemerick: ^ is a reader macro, what do you expect?
15:08cemerickmagic dammit, magic
15:08hiredman:(
15:08cemerickhah
15:08Sindikatibdknox: 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:09hiredmancemerick: I would prefer people learn the difference between read time, macroexpand time, compile time, and runtime
15:09pandeirohiredman: contains? can only do a full match, not say a substring of a key, right?
15:09ibdknoxSindikat: I've done it as well :)
15:09hiredmanpandeiro: check the doc string
15:10hiredmanpardon me
15:10hiredmanread time, macroexpand time, inline time, compile time, and runtime
15:12chouserInteresting. I'm more concerned with the difference between analyze time, emit time, and load time
15:13hiredmanread time, macroexpand time, inline time, nalyze time, emit time, load time, and runtime
15:13hiredmanread time, macroexpand time, inline time, analyze time, emit time, load time, and runtime
15:13Sindikathammer time :)
15:14stuartsierraHammock time.
15:14hiredmaninline time and analysis are kind of interleaved
15:15cemerickyeah, not sure if in-depth understanding of the compiler impl is a healthy thing, guys ;-)
15:15chouseroh, read-eval time
15:15chousersyntax-quote time
15:16nickmbaileydoes top level code (not in a function) in a :gen-class namespace get evaluated at compile time or run time
15:16cemerickIn 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:17cemerickIf Foo implements IObj, of course
15:17hiredmancemerick: it is
15:17hiredmanyou should understand the tools you use
15:17hiredmanwhich is why clojure has an edge, it is understandable
15:20hiredmancemerick: I see no reason to do that
15:23cemerickhiredman: I don't either, really.
15:39devnRaynes: 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:40devnRaynes: `lein templates` reflects the original description text in the project.clj -- do i have to manually update my templates?
15:40RaynesThe documentation you see is the documentation on the actual template function, not the description in project.clj.
15:44devnRaynes: you say that you need to have a file on the classpath leiningen/new/blah.clj
15:44devncould that live under ~/.lein/templates
15:44nickmbaileyis it expected that the following code will print "Linux Stuff" when running 'lein compile'? https://gist.github.com/1377678
15:45Raynesdevn: The idea is that templates are just maven artifacts. But allowing that would just mean adding ~/.lein/templates to the classpath.
15:45Raynestechnomancy: ^ How do we feel about that? Is that even possible with a plugin?
15:46RaynesReally though, you could just 'lein install & lein plugin install ..' your template without putting it on maven, if you wanted.
15:46devnRaynes: 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:46RaynesNot sure what you mean by 'muck with the classpath'. You shouldn't ever have to touch the classpath.
15:47devnRaynes: I create a template `lein new template sensible_defaults`
15:47devnI cd into sensible_defaults and edit project.clj
15:47devnat this point the template is on my classpath from lein's perspective
15:48devnif I'm somewhere else on the system I don't have access to that template
15:48Raynes'lein install && lein plugin install sensible_defaults 0.1.0'
15:48devn^drop this in the readme please :)
15:48RaynesAlso, lein-newnew's template template replaces hypens with underscores for you.
15:49RaynesAll of the default templates, actually.
15:49RaynesAnd sure, good idea.
15:49devnthat's really nice
15:49devnRaynes: One more suggestion would be to include more Usage to include the full story
15:50devnRaynes: I noticed lein new template foo is missing from usage
15:50RaynesIt's under 'writing templates'
15:52devnRaynes: 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:52devnRaynes: not trying to nitpick just advocating a bit more narrative in the README
15:56devnRaynes: so, I am clearly not getting it -- I lein install, lein plugin install sensible 0.1.0, lein new sensible foo
15:56devnfoo only contains a src/ dir with src/foo/foo.clj
15:57biallymI have the libraries working correctly with out lein
15:57biallymHey 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:57biallymbut I would like for lein to be able to install them it's self
15:57Raynesdevn: So the problem is that your template didn't create the files you wanted?
15:58devnRaynes: so, my immediate understanding was totally flawed
16:00devnRaynes: 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:00devnRaynes: looking at the default.clj, i see that was totally wrong :)
16:01Raynes:p
16:01devnRaynes: where is the best place to look in lein-newnew for a good example template
16:01Raynesdefault.clj is a decent example.
16:01devnand could I suggest creating an examples/ root-level dir
16:02RaynesWell, the idea is that the default templates serve as examples.
16:02RaynesNot that I'm against other examples in an examples directory, but it'll just disappear when lein-newnew moves into Leiningen itself.
16:03devnRaynes: *nod*, totally understand, just raising the level of visibility I think would stop people from having the same experience that I had
16:03devn*nod*, another totally valid point
16:03RaynesMostly, I just need to write a little tutorial.
16:03RaynesOn the wiki or something.
16:03RaynesThat can persist even when the project moves into Leiningen.
16:04devnRaynes: yeah, I'm happy to help out later on this evening
16:04RaynesCool. :>
16:20hhutchRaynes: i did not know about lein-newnew, i wrote my own for internal use. that's very handy
16:21RaynesWell, I wrote it like 2 days ago.
16:21ibdknoxhhutch: it's new
16:21hhutchah
16:21hhutchcool. great idea
16:25yazirianHas 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:26stuartsierraI taught Clojure to a group of high-school computer science students.
16:26yazirianI 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:26stuartsierraBut they were pretty bright.
16:27ibdknoxyazirian: what is the current language?
16:27yazirianWhere did you begin? The official docs, while thorough, are terse and exceptionally technical.
16:27yazirianWe're a python shop.
16:27ibdknoxyou should do a workshop, don't just hand them docs
16:27jodaroyazirian: unfortunately i've gained little traction in my group
16:27yazirianPersonally, I've spent a lot of time with the published books as well as videos on for example blip.
16:28jodaroi've tried scala and clojure
16:28hhutchyazirian: i just went through stuartsierra's 3 day training based on labrepl
16:28yazirianBut I can't go so far as to take a bunch of guys and dedicate a week of videos and bookreading on them.
16:28jodarothis is a mostly perl shop and no one seems to care really
16:28hhutchyazirian: that's a good approach to start
16:28yazirianjodaro: I'm sort of in the same place.
16:28jodarowe have a bunch of java dudes in another country
16:29jodaroand they don't really get it either
16:29stuartsierraLabREPL is free, open-source, and full of content: https://github.com/relevance/labrepl
16:29jodaroso
16:29yazirianLike, 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:29jodaroi'd say the hardest part isn't the learning, its the buy-in
16:29yazirianI'm fortunate enough that I can just about dictate the tool, actually.
16:29jodaroyazirian: thats a good start
16:29yazirianWhich is a spin on the problem; I'd be dragging them along.
16:29jodarounless you piss them off with it, i guess
16:30jodaroyeah
16:30yazirianexactly :)
16:30yazirianstuartsierra: That looks really good, thanks!
16:30stuartsierrayou're welcome
16:30hhutchyazirian: 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:31yazirianhhutch: 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:31stuartsierraThat's less of a big deal for Ruby/Python folks, I think. They have similar capabilities.
16:31ibdknoxWhy are monome's so expensive? I want one :(
16:32yazirianI don't think syntax is too scary, but then again, I'm anecdotal on my team. :)
16:34yazirianThe 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:35yazirianIf the cliff is already steep, it feels like I should be that much more careful to choose the right starting place for training.
16:35meliponeI'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:35hiredmanstop trying to change an open stream to append mode
16:36stuartsierramelipone: what are you calling with-out-append-writer on?
16:36meliponejust a filename
16:36melipone"(with-out-append-writer "test.arff")"
16:37stuartsierrathat should work: probably a bug
16:37meliponestartsierra: a bug where?
16:37stuartsierrain clojure.java.io
16:37meliponedamn
16:38stuartsierraPlease file a JIRA ticket.
16:38zerokarmaleftibdknox: i know right, it's just a box with lights for buttons :-/
16:38stuartsierraYou may be able to work around it by calling `append-writer` instead, or calling the Java Writer constructors directly.
16:38cemerickibdknox: there's cheaper knockoffs
16:38zerokarmaleftsomeone told me at the conj that you could easily construct one yourself for a fraction of the cost
16:38ibdknoxcemerick: do you know the name of any of them
16:39meliponestuartsierra: okay thanks
16:40cemerickibdknox: http://amzn.to/tW7l7m
16:40cemerickNo idea of the relative quality/features/ability to be easily integrated with overtone
16:40zerokarmaleftibdknox: http://docs.monome.org/doku.php?id=tech:mk <= kit parts
16:41ibdknoxzerokarmaleft: interesting
16:41zerokarmaleftb/c it ain't manly unless it's 64x64!
16:41ibdknoxcemerick: yeah, I saw some of these, but it's hard to tell if any of them are worthwhile
16:44yazirianIs 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:45zerokarmaleftthe novation is only $125
16:46ibdknoxzerokarmaleft: it's very heavily tied with ableton
16:47zerokarmaleftyea i wouldn't bet on it being very configurable as a midi controller
16:47zerokarmaleftthough they do claim that
16:50canderaHas anyone run across any tools for visualizing static call graphs in Clojure code?
16:50zerokarmalefttechnomancy: did i miss the leiningen swag handout or are those long-sleeve baseball tees available somewhere?
16:51technomancyzerokarmaleft: it's just a cafepress thing: http://www.cafepress.com/technomancy
16:51technomancyhaven't quite taken it to the handing-out-free-merchandise level yet =)
16:51zerokarmaleftheh, fair enough
16:52yaziriann/m fixed by commenting out dev-dependencies in project.clj
16:52zerokarmalefti thought perhaps heroku subsidized your shirts :D
16:52stuartsierramelipone: Wait, did you say clojure.contrib.io?
16:52stuartsierraor clojure.java.io?
16:53yazirianstuartsierra: he was looking at contrib
16:53stuartsierrawell, who knows what state that is in.
16:54stuartsierraThat bug may be fixed in clojure.java.io.
16:54stuartsierra(Or maybe the offending function doesn't exist.)
16:54yazirianit doesn't
16:55stuartsierraFor good reason, it seems.
16:55yazirianhaha yeah, if it isn't working :)
17:02technomancyonly three watchers on https://github.com/trptcolin/reply how can this be‽
17:03stuartsierranever heard of it
17:03ibdknoxI couldn't get it to work
17:04jodarohuh
17:04jodaroi get all of those from emacs i think
17:04jodarore: the bullet points
17:04technomancystuartsierra: it uses jline 2 to provide project-aware completion and other goodies
17:04hiredmantechnomancy: it is newish
17:04technomancyalso non-broken unicode, yay
17:05technomancyjodaro: yeah, that's largely the reason the leiningen repl hasn't seen much investment too.
17:05jodarooh code completion
17:05technomancy"luckily" trptcolin uses vim. =)
17:05jodarothats kinda cool
17:05ibdknoxhm
17:05ibdknoxvimclojure does all of that too
17:05technomancyibdknox: well don't tell colin!
17:06hiredmanI enjoy how the dejour link is a 404
17:06ibdknox:)
17:06hiredmantechnomancy: the analyzer!
17:06technomancyaw yeah
17:06stuartsierraEver 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:07hiredmansomeone should write that java Expr => clojure maps thing
17:07technomancystuartsierra: yeah, I was primarily attempting to counteract the "never heard of it" blocker rather than anything more substantial =)
17:08technomancyhiredman: 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:08hiredmanand I used up my one night of extracurricular activities recompiling emacs and futzing with the color settings on my monitor
17:08hiredmanso not me
17:10devnspeaking of labrepl...
17:11hiredman:(
17:16ibdknoxfor those who didn't see my editor mockups at the conj: http://chris-granger.com/gallery/mockups
17:18stuartsierraibdknox: What is that?
17:18Raynesstuartsierra: His dream editor that he'll never write.
17:18stuartsierraah
17:18ibdknoxlol
17:19stuartsierraIt's pretty, though.
17:19ibdknoxwhy won't I?
17:19RaynesBecause you're lazy.
17:19ibdknoxstuartsierra: yeah, just concepts of a clojure focused editor
17:19ibdknoxwell
17:20ibdknoxI *am* lazy. That's hard to argue against. I also happen to use Clojure an awful lot too though...
17:20Raynesibdknox: Seriously though, if you do pursue it, count me in.
17:20ibdknoxit's codenamed sona
17:21RaynesBut 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:21technomancyibdknox: not interested in clooj?
17:21zerokarmaleftibdknox: what's in the nodedefense folder?
17:22ibdknoxzerokarmaleft: the game I built for the node knockout
17:22zerokarmaleftoh yea, i played that...no wonder it was ringing a bell
17:23ibdknoxtechnomancy: the implementation would be radically different than the direction clooj is headed in
17:24RaynesAnd wouldn't have such a horrible name either.
17:24ibdknoxI 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:24technomancyinteresting
17:25ibdknoxplus, trying to embed controls into java textboxes?
17:25ibdknoxugh
17:25technomancyoh, I was under the impression that the textbox stuff would have to be reimplemented no matter what
17:25technomancyif you're going to get something that's actually usable
17:25ibdknoxIdeally I'd steal the editor
17:25ibdknoxwhich I can do in the JS world
17:25technomancythat is to say, I can't imagine clooj is using that because they think it's a good idea long-term.
17:26ibdknoxwriting editors from scratch is a pain in the ass. I know this first hand.
17:26ibdknoxlol
17:26hiredmanat some point swing is going to get a webview
17:26ibdknoxhiredman: swt already has one
17:26Raynesclooj could really use seesaw.
17:26hiredmanyeah, but I dislike swt
17:27hiredmanI dunno, I imagine I am not the audience for new things
17:28ibdknoxprobably not
17:28ibdknoxI'm not sure it'd make sense to think of the emacs folks as the audience for something like this
17:28hiredmanclojure -> elisp byte code
17:28ibdknoxtextmate did a lot for the rails community
17:28hiredmannow there's platform power
17:28technomancyhiredman: yeah, once that compiler is written we'll have three competing Clojure editors =)
17:29technomancyI wonder if that would make a good long-term seajure hack project
17:30ibdknoxtechnomancy: an elisp compiler?
17:30technomancyibdknox: elisp-as-a-compilation-target
17:30technomancywell, elisp or emacs bytecode
17:30ibdknoxright
17:30technomancymodulo all the hosty deftype OO stuff, elisp would be the least semantic distance from clojure
17:30hiredmanwell, I think once we get a nice ir (what chouser was talking about) then other targets are much easier
17:31technomancymy 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:32technomancy"you want to write a compiler for a language with a complicated syntax. [...] now you have two problems"
17:32hiredmanemitting byte code and making the vm deal with the nasty compiler bits like register allocation is pretty nice
17:32technomancyhiredman: problem is I don't think byte code is stable between major releases
17:32technomancyalso: debuggery
17:36hiredmanalso, symbol macros
17:36hiredmanman, that would be excellent
19:04seancorfieldif I have something I just want to "fire and forget", what's the recommended way?
19:05seancorfieldin 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:06hiredmanfuture
19:07seancorfield'k... that's what I was considering... just wanted to make sure that was idiomatic :)
19:09hiredmanit's exactly what you want on the threadpool you want
19:47slyphontechnomancy: hi!
19:48slyphontechnomancy: i'm happy to see leiningen is still alive and well
19:48kreiglyheylo
19:48kreiglylooking for the clojure 1.3.0 equivalent of (gen-and-load-class
19:49kreiglyas in (gen-and-load-class 'DeadEnd :extends Throwable)
19:59kreiglyno dice?
20:12hiredmankreigly: gen-and-load-class was removed many years ago
20:12hiredmanpre 1.2 possible pre 1.0
21:02bobhopehello clojure friends, I am just starting out with clojure, and I'm having trouble configuring nailgun, leiningen, vimclojure to play nicely
21:03bobhopeI added the vimclojure/server as a dev-dependency in my leiningen config
21:03bobhopeand I downloaded the nailgun-client and set the vimclojure#NailgunClient variable
21:03bobhopeto no avail
21:07chousertrying to use overtone. The JVM keeps segfaulting. :-(
21:26chouserok, not longer crashing. Also, making no sound.
21:31leo2007good morning
21:32chouserwoo! working now..
21:34santa_monica_506is there a way i can mock a deref def in my clojure test?
21:36chouserwhat's a deref def?
21:38santa_monica_506something like (def proxy (atom nil)) ... then (.someMethod @proxy arg1 arg2)
23:20mdh```my clojure-mode indents cond bad :-(
23:21bhenrymdh mine indents weird when using {:keys} destructuring inside of a let.
23:23mdh```hmm, yeah basic case of (cond a b \n c d) looks fine
23:24slyphonwas it clojure that let you put your source in src/com.example.proj instead of src/com/example/proj ?
23:24slyphonsorry, i just remember one of the JVM langugaes was ok with that
23:26mdh```this: (cond (or \n) x \n b)
23:38slyphonwhat's the correct version of clojure-contrib to use w/ 1.3 ?
23:38brehaut~contrib
23:39clojurebotcontribute is http://clojure.org/contributing
23:39brehautbah
23:39slyphonhah
23:39brehauthttp://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
23:39brehautbasicly, use the individual contrib libs; there is no monolothic contrib any more
23:39slyphonoh
23:39slyphonsmert
23:40slyphon"i can't believe nobody stepped up to maintain that huge codebase"
23:41slyphon(those were sarcasm quotes)
23:56brehaut,(apropos 'fn)
23:56clojurebot(fn? bound-fn letfn fn some-fn ...)