#clojure logs

2011-09-12

00:03amalloysconover: https://gist.github.com/1210561 - it's a lot simpler without reductions
00:27sridcould someone tell me why I see "java.lang.Exception: Too many arguments to if" error in http://dpaste.com/613267/ ?
00:28sridhmm, perhaps its something to do with `->` being a macro.
00:30amalloysrid: try macroexpanding that; you should see the issue
00:32amalloyalso GZIPInputStream. isn't a function, so it wouldn't work anyway
00:33sridright, (if ...) is treated as function call and -> passes the value as a 2nd arg
00:35amalloysrid: you might like https://github.com/flatland/useful/blob/develop/src/useful/fn.clj#L48
00:36amalloythen you could write (-> url (URL.) (.openConnection) (.getInputStream) (given (not (running-on-google?)) GZIPInputStream.))
00:36sridhmm, ok. i ended doing this http://dpaste.com/613269/
00:37amalloyright, that's the no-dependencies way, and i've written that a few times myself
00:40sridwhere does `lein deps` cache its downloads? it's not in ~/.lein - nor is it in the project directory. lein deps always leads to ZipException on my linux box.
00:43amalloysrid: ~/.m2
00:43amalloyit uses maven
00:44sridah thanks. the first time it was complaining about failing checksums. i'll just clean that directory and re-run it.
01:25sridthat didn't help. lein deps is always failing to retrieve the appengine jars due to checksum failures. strangely, this only happens on the linux machine.
01:30xiaolongxiasrid: did anyone answer your pallet question?
01:31sridnope, but I gave up on the idea of managing my own VMs as I decided to go with appengine (from heroku)
01:31xiaolongxiaok. you can definately manage *any* computer with pallet
01:32xiaolongxiahowever the process will be slightly different if you don't use jclouds to instantiate the node/instance
03:31thorwili'm trying to cleanup/update my clojure-mode/swank setup
03:31thorwilevaluating (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) fails with
03:31thorwil(void-variable package-archives)
03:42thorwilhttp://code.google.com/p/marmalade/issues/detail?id=10 suggests it's either an outdated package.el, or not having it loaded properly
03:43thorwilbut afaict, my package.el v 0.9 is the latest, and the code for loading it was written by its installation routine
03:46amalloythorwil: have you done (require 'package)?
03:49thorwilamalloy: no. just tried, doesn't work
03:49thorwilhowever, the setq variant from http://code.google.com/p/marmalade/issues/detail?id=10 seems to work
03:51thorwil... but only in so far as not producing an error, as there's no clojure-mode available
03:55thorwilah, i needed a package-refresh-contents
07:41khaliGis there some way to pass a vector as the second argument of proxy?
07:44bsteuberkhaliG: you mean a programmatically generated vector?
07:45bsteuberyou'll have to use a macro for this
07:45khaliGbsteuber, yup, i'm proxying JLabel and want to pass & arguments from my function to the proxy
07:46bsteuberdon't think it's possible from a function
07:47bsteuberand from a macro, the arguments must be already known at compile-time
07:48khaliGah k, so i've no way to dynamically choose a constructor it has to be just one particular one?
07:49khaliGgot d/c - i wrote: ah k, so i've no way to dynamically choose a constructor it has to be just one particular one?
07:50raekkhaliG: you can also use the construct-proxy and init-proxy functions
07:50raekthey are not macros, so you can apply them
07:50bsteuberthere are ways to dynamically invoke constructors with java reflection, but I don't know if this can be combined with proxy or gen-class
07:50khaliGraek, thanks. i'll have a look now
07:50bsteuberah
07:53raekkhaliG: an piece of code that uses the underlying functions of proxy: https://gist.github.com/1098101
07:54bsteuberraek: nice, I've learned something :)
07:54khaliGraek, beautiful, thank you :)
09:02dnolenif somebody's got a spare moment it would be nice to hear if my ClojureScript reify patch works as advertised. http://dev.clojure.org/jira/browse/CLJS-71
09:03jimdueydnolen: Your delimc library sounds pretty cool. Looking forward to using it in the future.
09:05dnolenjimduey: port of the weblocks cl-cont library. Never had much use for it, but perhaps in the JavaScript context it's more relevant.
09:06jimdueyMaybe so. Always so much to learn.
09:09jweissanyone use clj-stacktrace with swank? I followed the instrux on the README and i still get regular java stacktraces in slime
09:11jweissseems like my ~/.lein/init.clj is not being respected, tried adding a :prompt option, that doesn't do anything either.
09:14jweisseven putting :repl-options in my project.clj and running lein swank on command line and connecting with slime-connect, those options do not appear to have any effect
09:20troussanquit
09:33gfrlog_where are folk get their gclosure docs from?
09:34manutterI bought the o'reilly book...
09:35scottjgfrlog_: I think most people are using the online ones and assuming the diffs from version included with cljs are minimal
09:35gfrlog_manutter: you lookup API info in a book? like on paper?
09:35manutterwell, I bought the ebook first
09:35gfrlog_scottj: you're talking about http://closure-library.googlecode.com/svn/docs/index.html, right?
09:36manutterthen I bought the paper book to have something to read while my ebook reader was charging...
09:36scottjgfrlog_: yeah
09:37wilkesgfrlog_: the online docs became a lot more helpful for me when I realized that there was a "File Index" tab :)
09:38gfrlog_wilkes: I think you just solved all my problems.
09:38gfrlog_(inc wilkes)
09:38lazybot⟹ 1
09:41scottjI had that same problem, apparently it's a crappy UI
09:42gfrlog_Typical google. Never giving any thought to their UI. They could take a few lessons from Craigslist.
10:09thorwiltechnomancy: via marmalade, i got clojure-mode 1.7.1 with no clojure-jack-in. i fixed that by removing it and using package-install-from-buffer with 1.10.0 in it
10:12Klemernhey guys
10:12thorwilthough http://marmalade-repo.org only lists 1.10.0, so i don't know what happened, actually
10:13KlemernI saw in clj repo that they removed "throws Exception" clause from all Fn invokes. How will clojure handle uncaught exceptions now?
10:18TimMcKlemern: I suspect they will act like RuntimeException and Error.
10:19TimMcI would imagine the declaration was removed so that interop from the Java side wouldn't involve try/catch(Exception) everywhere...
10:20TimMc...but now I suppose Java interop that wants to catch a NotRuntimeException of some sort will make the IDE complain about the catching of an undeclared checked exception.
10:24KlemernI'm asking because I made a java lib for functional programming and I had this exact problem
10:25Klemerncouldn't throw a checked exception because I had no declaration of exception in function interface
10:25Klemernthough in case of clojure there a RT class between java and clojure code
10:36gfrlog_So as I browse gclosure and think to myself "Everything here is so much more clumsy than jquery", does that mean that 1) I need to suck it up and shut up, or 2) we need a good wrapper library for this stuff?
10:42bsteubergfrlog_: 2) of course :)
10:42gfrlogbsteuber: I mainly hesitate because I got the feeling somewhere that clojure frowned on frivolous wrappers when the interop is just as easy
10:43gfrlogbut gclosure is just so OOPy...
10:43bsteubermany goog namespaces seem almost unusable to me, so verbose and not fitting to clojure
10:43scottjgfrlog_: see pinot as a start
10:43bsteubermost stuff goog.dom functions return aren't even usable as sequences
10:43gfrlogscottj: thanks, taking a look
10:44gfrlogdangit why is somebody using the nick 'as'?
10:47gfrloglooking at pinot brings up an interesting point -- how do we use cljs libraries when compiling? Are we still in the soft-link phase of things?
11:04scottjgfrlog: use cljs-watch and include pinot in your project.clj
11:04gfrlogoh hmm. Okay.
11:05scottjidk where the magic happens
11:05gfrlog:)
11:26edwIs there a way to get a full stack trace out of 'lein compile'? I'm hunting for the source of an exception and I can't see a reference to my code.
12:06technomancythorwil: you got 1.7.1 from a recent install?
12:07technomancyoh, maybe M-x package-refresh-contents (analogous to apt-get update) is needed?
12:07thorwiltechnomancy: i thought i did. not 100% sure
12:09thorwilyes, package-refresh-contents seems necessary
12:16technomancythorwil: the needs of users are fundamentally different from the needs of developers
12:16technomancy*end users
12:22arohnertechnomancy: could you expand on that answer?
12:24technomancyarohner: funny you should ask! http://technomancy.us/151
12:24technomancytl;dr: end users want a single version of each program that gets critical updates without fuss. developers need multiple versions at once and don't want any updates to happen without their knowledge
12:32thorwilgood points. i think it could be handled with one system, though with some modality
12:32thorwiloh, and then there's the purely functional package manager nix: http://nixos.org/nix/
12:34technomancyyeah, that is fascinating.
12:34technomancynew package managers face overwhelming odds against them given that the existing systems _are_ really good at what they do and have had decades of head start.
12:37hiredmanand there is no culture of separating code spaces in C
12:38hiredmanyou can do that with java, just dump all your jars in to /usr/lib/java and run java -cp /usr/lib/java/\*
12:38hiredman:(
12:41choffsteinCan anyone point me towards the restrictions on clojure function names? Even better if there is a regex to match them...
12:42gfrlogchoffstein: are you asking about what the reader recognizes as a symbol?
12:42choffsteinYep
12:43choffsteinI'm trying something like (a-zA-Z)(a-zA-Z0-9)* off the top of my head -- but need to get hyphens in there too
12:43technomancychoffstein: "what the reader accepts" and "what the reader is guaranteed to accept in the future" are two distinct concepts
12:43TimMcchoffstein: There are three sets: 1) Possible symbols, 2) what the reader will accept, and 3) what the reader is *supposed* to accept. (Decreasing subsets.)
12:44choffsteinhmmm, okay
12:44TimMc s/supposed/guaranteed/ I guess
12:44hiredman,'>
12:44clojurebot>
12:44hiredman,'<
12:44clojurebot<
12:44hiredman,'!
12:44clojurebot!
12:44gfrlogchoffstein: the common things you're missing are "-_?!'+/*"...
12:44TimMc,(symbol " ")
12:44clojurebot
12:44pdkhey clojurebot you learned your math symbols
12:44choffsteingfrlog: Right. Perfect.
12:44gfrlogand more
12:45choffsteinokay, here is what I am trying to do
12:45gfrlogchoffstein: also note than a number of them are valid as initial characters
12:45gfrloge.g., -
12:45choffsteinI am trying to read in a .clj file and pull out all the functions that have been declared with defn
12:45gfrlogthe only one I know of that can't be initial is the digit
12:45hiredman,(let [無0] 無)
12:45clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: let requires an even number of forms in binding vector>
12:45TimMcchoffstein: There are also things like '/ which are weird.
12:45gfrlogand then there are the thousands of hiredman characters
12:46hiredman,(let [· 0] ·)
12:46clojurebot0
12:46gfrlogchoffstein: let the reader read the file then :)
12:46gfrlogchoffstein: then you just have to deal with the data structure
12:46choffsteinyeah, that is seeming easier
12:46manutter,(let [無 0] 無)
12:46clojurebot0
12:46TimMcYou don't want to rewrite the Clojure parser.
12:46choffsteinI thought the regex would be fast. Looks like … no
12:46choffsteinyeah, exactly.
12:47gfrlogchoffstein: you also know that you can examine the functions in a namespace at runtime, right?
12:47gfrlogit's not clear if that would help you or not
12:47choffsteingfrlog, that would actually be perfect
12:47gfrlognot that I know the functions off the top of my head...
12:50choffsteinannnddd back to the API :)
12:50gfrlogchoffstein: try (ns-publics (find-ns 'my-ns))
12:51choffsteinany way to load a whole string and eval it? read-string only does one object, right?
12:51gfrlog(read-string (str "(" s ")")) might work
12:51gfrlogdon't know if there's an even easier way
12:52choffsteinload string.
12:52choffsteinThat clojure cheat sheet is more helpful every day. hot damn
12:52pdkwhere is it
12:52TimMcchoffstein: You may wish to turn *read-eval* on or off.
12:53TimMc...although I suppose it is unlikely in Clojure source code!
12:53choffsteinpdk: http://clojure.org/cheatsheet
12:54choffsteinTimMc: I don't quite understand what *read-eval* is for
12:54gfrlogchoffstein: no matter how many times I read the clojure cheat sheet to my son as a bedtime story, I still see things I swear I've never seen before.
12:55gfrlogchoffstein: there's a syntax for telling the reader to eval something: #=(foo bar)
12:55dark_srcVinzent: is there a wiki or help for installing durendal?
12:55choffsteingfrlog: oh. Hmm. never seen that.
12:56gfrlogchoffstein: it's not used too often I don't think. So the *read-eval* var is provided for reading something you don't trust.
12:56TimMc,(read-string "#=(println \"What, me worry?\")")
12:56clojurebot#<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>
12:56choffsteingotcha.
12:56Vinzentdark_src, if you use el-get, just add durendal to your sources
12:56Vinzentif not, you should do ;)
12:57Vinzentbut maybe it's available in the ELPA too
12:57dark_srcVinzent: ok.. (again) I am a emacs newbie ;) will check it out
12:57technomancydark_src: just use marmalade. though the jack-in stuff from durendal has been ported to clojure-mode, so no need if you just want that.
12:58dnolentechnomancy: do you know if the clojure-mode w/ the ClojureScript enhancements made it to marmalade yet?
12:58dark_srcI have spent so much time setting up my clojure environment for emacs
12:58Vinzentoh, didn't know it
12:59dark_srci am pretty sure someone has putup all the common stuff in github or something
12:59dark_srci just don't know where to find it.
13:00dark_srcyou know things like lein,swank,. common shortcuts for clojure on emacs
13:01technomancydnolen: it has, though it's a separate package, not part of clojure-mode.
13:02Vinzentdark_src, maybe technomancy's emacs-starter-kit? It was very helpful for me when I started to use emacs
13:02bhenrydark_src: this doesn't have the new clojure script stuff with it, but it's a great starting point. https://github.com/overtone/live-coding-emacs
13:03dark_srcVinzent: really?
13:03Vinzenttechnomancy, by the way, thank you very much, I've just realized how many cool stuff you have wrote!
13:04dark_srcVinzent: let me check it out.
13:04Vinzentdark_src, yes, but it's not very clojure-specific and imho you have to rebind everything anyway
13:05dark_srcVinzent: too bad
13:06bhenrydark_src: the love-coding-emacs project is clojure specific. clone the project and rename it to .emacs.d and when you launch emacs you can work on clojure out of the box.
13:06Vinzentdark_src, what can i say... it's emacs
13:06bhenrys/love/live
13:06lazybot<bhenry> dark_src: the live-coding-emacs project is clojure specific. clone the project and rename it to .emacs.d and when you launch emacs you can work on clojure out of the box.
13:07dark_srcmy clojure-emacs stuff on github : https://github.com/nishantrayan/home
13:07technomancyVinzent: heh; great
13:07dark_srconly a handfull of stuff for clojure so far.
13:07dark_srcVinzent: I would love to hear your say how much i have missed in this ;)
13:10dark_srclazybot: let me check it out . thanks does it work with lein..swank?
13:10bhenrydark_src: yeah it does. it uses durendal
13:11dark_srcbhenry: thanks mate ;)
13:11Vinzentdark_src, well, I can send you my config so you can compare :) but it's a big mess in its clojure part... I think better to follow bhenry's advice and took that live-coding-emacs setup...
13:14Vinzentyou know, it would be pretty cool to create emacs-based clojure editor with normal shortcuts and easy installation process on both systems
13:15dark_src"both" systems ?
13:15manutteryeah, ubuntu and kubuntu
13:15manutter:)
13:16technomancy"We play both kinds of music here; country _and_ western."
13:16dark_src^_^
13:17gfrlogvim and windows 98?
13:18Vinzentemacs 23 and emacs 24?
13:18gfrlogwait one of them has to be google docs
13:30anttihso I'm trying to connect to a cljs repl from a compojure app running at :9000 but it's not connecting. The sample page works, just not my own. I wonder what the problem is.
13:31anttihare there any known quirks?
13:40dark_srcjust tried live-coding-emacs
13:40dark_srcit does some weird stuff
13:41dark_srcbhenry: my screen refreshes for each line navigation and my source is getting messy! :(
13:41bhenrydark_src: that doesn't happen to me.
13:44dark_srcbhenry: is there any doc or demo on how to work with clojure on live-coding-emacs
13:44gfrlogwaitaminute. If the clojurescript compiler is written in clojure, then shouldn't porting it to clojurescript be as simple as just changing the not-clojurescript parts?
13:45gfrlogis there some more fundamental barrier related to how gclosure is mixed in?
13:45technomancygfrlog: FSVO "just"
13:45gfrlog:)
13:46gfrlogin theory at least it sounds like more of a pure-algorithm sort of thing that could live in both worlds than an inherently java-bound thing
13:46gfrlogignoring, of course, all the gclosure complication
13:49miltondsilvaHi, any ideia why this code blows the stack? http://pastebin.com/iDkHmjQk
13:51gfrlogmiltondsilva: what type are the vertices?
13:51amalloymiltondsilva: you're building up a huge chain of (lazy) map expressions and never realizing any of them, and then at the end you finally realize the whole thing
13:51amalloy$google stackoverflow clojure primes
13:51lazybot[primes - Clojure: Avoiding stack overflow in Sieve of Erathosthene ...] http://stackoverflow.com/questions/2992123/clojure-avoiding-stack-overflow-in-sieve-of-erathosthene
13:52gfrlogoh. so he is.
13:53miltondsilvahm.. and here I thought that I had understood lazy-seqs.. tsk.. thanks amalloy
13:53edwIs there a way to get a full stack trace out of 'lein compile'? I'm hunting for the source of an exception and I can't see a reference to my code.
13:54technomancyedw: you can call clojure.core/compile from the repl
13:54edwtechnomancy: Thanks. I'll check that out.
13:55miltondsilvadoall resolved the issue
13:56choffsteinanyone familiar with lein plugins?
13:57dark_src[1]how do i execute clojure code in live-coding-emacs?
13:57amalloytechnomancy: i wish clojurebot had a ~technomancy i could use like ~anyone, except i'm not sure what i'd want him to respond with
13:58technomancyamalloy: as long as it responds with http://p.hagelb.org/riker.gif at least 7% of the time you have my blessing.
14:00hiredman~technomancy |codes| while wearing gravity boots to increase the blood flow to the face transplant he got after discovering the world does not treat build tool creators kindly
14:00clojurebotIk begrijp
14:00hiredman~technomancy
14:00clojurebottechnomancy is to blame for all failures
14:00hiredmanclose enough
14:00hiredman:)
14:01bhenrydark_src[1]: are you in a lein project ?
14:04edwtechnomancy: My exception was due to having an ":aot mynamespace" and not an ":aot [mynamespace]"; in a perfect world there'd be some more explicit "bad package.clj" exception.
14:05technomancyedw: yeah, it's hard to know where to draw the line for stuff like that; you can't catch all the unsupported behaviours.
14:05dark_src[1]bhenry: its my putty.
14:05edwYeah. For future reference I'll just try to remember that lein outputs "Compiling NSNAME" if it can actually parse the ns list.
14:06dark_src[1]on ubuntu live-coding-emacs works beautifully
14:06dark_src[1]i am impressed ^_^
14:06technomancyedw: a simple check might be nice though; I'd take a patch.
14:09mabes_has anyone seen this error when trying to run clojure-jack-in? "rlwrap: Oops, crashed (caught SIGFPE) "
14:10mabeshas anyone seen this error when trying to run clojure-jack-in? "rlwrap: Oops, crashed (caught SIGFPE) "
14:11pjstadigmabes: nope...sounds like a problem with rlwrap...how did you install rlwrap?
14:11mabesI don't know why rlwrap would even be called for "lein jack-in"... running it by myself in the terminal it works file
14:12pjstadigyou don't have any wrapper scripts for leiningen or anything?
14:12mabespjstadig: with homebrew (OSX) and it hasn't given me any issues...
14:13technomancythe only way that would be possible is if you messed up your clojure-swank-command
14:13pjstadiga difference between CLI and emacs also tends to point towards some kind of environmental difference
14:13technomancyor possibly some nutty shell aliases I guess
14:13mabesI think you are on to something pjstadig... I think I may be using an older and modified lein script that I added some rlwrap stuff too..
14:14technomancyno, rlwrap always crashes if it doesn't have a real terminal; that's standard behaviour
14:14mabestechnomancy: but does the lein script use rlwrap by default?
14:15technomancymabes: only for repl and interactive
14:20TimMcmabes: I assume you have a recent lein? A distressing number of leningen questions can be solved by upgrading.
14:21mabesno.. upgrading now
14:33mabesthanks for the help.. I found the issue.. I am exporting a RLWRAP in my .bashrc file.. if I remove that then it works
14:36choffsteinWill someone with lein plugin experience take a look at https://github.com/newfoundresearch/clj-doc-test for me. I'm getting a "java.lang.ClassNotFoundException: leiningen.doc-test" error I can't seem to scrub out. Would love some insight from anyone with experience.
14:50michaelr525hey!
14:51michaelr525lot's of people here
14:51michaelr525I wonder how many
14:53jorgeb_I can't get lein jack-in to work with Emacs. I have Leiningen 1.6.1.1
14:54choffsteinis it okay to call a macro on a gensym within a macro?
14:54jorgeb_*swank* says lein: command not found
14:55jorgeb_#>lein jack-in says that task doesn't exist.
14:55amalloychoffstein: it's okay to do anything you want
14:55jorgeb_I know lein is in the exec-path
14:58amalloy(but without more specifics, nobody can know whether what you're describing is a good idea)
14:59choffsteinamalloy: Well, really I just didn't know if it was legal.
15:00choffsteinMy guess is I am doing something stupid since I keep getting an "unable to resolve var: " error on my gensymed var.
15:00amalloy~bug report
15:00clojurebotA bug report has three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it is awfully hard to help you.
15:01choffsteinYeah. I know.
15:01choffsteinI was just pushing the source to git so I could show you
15:02amalloy*chuckle*
15:02choffsteinIf you have a spare second … https://github.com/newfoundresearch/clj-doc-test/blob/master/src/leiningen/doc_test.clj
15:03choffsteinI am getting "Caused by: java.lang.Exception: Unable to resolve var: p1__566__571__auto__ in this context" -- but I can't seem to find anything wrong with my gemsym statements.
15:06amalloy&`(map #(foo %) bar)
15:06lazybot⇒ (clojure.core/map (fn* [p1__21711__21712__auto__] (clojure.core/foo p1__21711__21712__auto__)) clojure.core/bar)
15:07amalloywell, that doesn't *look* wrong
15:08amalloybut the error message sounds like it's coming from #(core/doc-test %)
15:08amalloywhich, by the way, is just a cumbersome way to write core/doc-test
15:08choffsteinI know
15:08choffsteinbut it wouldn't take core/doc-test since doc-test is a macro
15:09choffstein"Caused by: java.lang.Exception: Can't take value of a macro: #'clj-doc-test.core/doc-test"
15:09amalloyah
15:09amalloywell then this version won't work either
15:09amalloy&(doc inc)
15:09lazybot⇒ "([x]); Returns a number one greater than num."
15:09amalloy&(let [f-sym 'inc] (doc f-sym))
15:09lazybotjava.lang.Exception: Unable to resolve var: f-sym in this context
15:10choffsteinhmmm
15:11amalloyyou need a version of doc-test that is a function taking a var, instead of a macro taking a symbol
15:12choffsteinokay.
15:21choffsteinI'm having a spot of trouble here. doc-test is supposed to take a symbol (e.g. (doc-test some-func)). If I try to create a function to wrap around doc-test, the var should hold the symbol right? So I can't just call (doc-test some-var) anymore … I would need evaluate some-var in doc-test now?
15:24amalloyyou can't just create a function that wraps around a macro
15:24choffsteinWell, what if I define the macro within the function -- such that the macro is redefined with each function call?
15:25choffsteinso the macro only exists for the life of the function? Would I be able to use the variable bindings of the function then?
15:26hiredmanchoffstein: code inside a fn is only executed when the fn is run, which is after it is compiled, which is after macroexpand time
15:27choffsteinhmm. crap.
15:27hiredmanso not only is defining macros in side a fn bad form, it is also almost completely pointless
15:27choffsteinit would seem my plan of attack is no good.
15:27jorgeb_Does anyone know why lein would claim jack-in is not a task?
15:29hiredmanjorgeb_: wrong version of swank-clojure
15:29kjeldahlHas anybody used congomongo with a unique index and managed to figure out whether an insert failed or not, due to a duplicate key?
15:29hiredmanchoffstein: why not just step back and try to solve your problem instead of working the system
15:30hiredman(you seem to be off yak shaving)
15:31choffsteinhiredman: Well, I am still pretty new to clojure / lisp -- so sometimes I don't know what is "working the system" or "solving the problem" until I get to a dead end :)
15:31jorgeb_hiredman: swank-clojure-1.3.2.jar in .lein/plugins
15:31choffsteinBe back in a couple minutes. Need to get up and stretch the legs out.
15:31hiredmanjorgeb_: and in lib for the project?
15:32jorgeb_hiredman: ah, not there...
15:33kjeldahlAh, Google turned up something set-write-concern which looks like it might solve my problem.
15:33amalloy1choffstein: i seem to have been disconnected. did you figure anything out?
15:35bhenrywhat resources are there for getting a cljs repl that interacts with the browser?
15:36thorwilhmm, is this the best i can do to return a string if it is in a list, otherwise nil? (not-empty (filter #(= % "a") ["a" "b"]))
15:36choffsteinamalloy1: No. I think I am approaching the problem the wrong way.
15:36bhenry&(not-empty (filter irc://irc.freenode.net:6667/#(= % "a") ["a" "b"]))
15:36lazybotjava.lang.ClassNotFoundException: irc://irc.freenode.net:6667
15:37choffsteinBasically, I found a library "clj-doc-string" that pretty much boils down to a macro. So you call "(doc-test my-fn)" and it runs some tests based on your doc-string. I thought it would be cool to write a lein plugin that would automatically rip all your function names and automatically call doc-test on them.
15:38bhenrythorwil: what would you want as input from what output?
15:39choffsteinSo from what I can tell, I have read all the source documents, ripped out the function names -- but now can't figure out a way to call the macro
15:39bhenryother way around*
15:40thorwilbhenry: http://paste.pocoo.org/show/474852/
15:40amalloychoffstein: you can't wrap a function around a macro
15:40choffsteinamalloy: Yeah … I've sort of discovered that :(
15:40amalloyyou have to implement the macro's functionality as a function, and then optionally wrap a macro around that
15:40bhenrythorwil do you know about some?
15:41amalloyfwiw, not-empty is silly there. just use seq
15:41amalloythough ##(doc some) is better
15:41lazybot⇒ "([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"
15:41bhenry,(some #(= % "a") ["a" "b" "c"])
15:41clojurebottrue
15:42amalloy&(some #{"a"} ["a" "b" "c"])
15:42lazybot⇒ "a"
15:42bhenryah. amalloy i was looking for that.
15:42thorwiloh, i was aware of some, but no the #{"a"} construct
15:42bhenryi thought some returned the item, but you have to make the item into a set to use as the predicate
15:43thorwilthanks!
16:30eipiten-workquestion about a namespace conflict I'm getting.
16:30gfrlog~anyone
16:30clojurebotPlease do not ask if anyone uses, knows, is good with, can help you with <some program or library>. Instead, ask your real question and someone will answer if they can help.
16:32eipiten-workI'm require-ing a library that includes a function named get that is conflicting with the core get (I get a warning that the core get is being replaced)
16:33gfrlogyou get the warning when merely require-ing rather than use-ing?
16:33eipiten-workyes
16:33cemerickIt's just a warning. Unless you're aiming to use clojure.core/get in the namespace as well as your library's get, don't worry about it.
16:33gfrlogthe warning references your ns specifically?
16:34technomancywell... it's probably not a good idea to get in the habit of ignoring warnings like that
16:34eipiten-workWARNING: get already refers to: #'clojure.core/get in namespace: clj-facebook-graph.client, being replaced by: #'clj-facebook-graph.client/get
16:34technomancyeipiten-work: (:refer-clojure :exclude [get]) in your ns clause and you can avoid that
16:34gfrlogeipiten-work: and clj-facebook-graph is the library?
16:34technomancyeipiten-work: either that or use :require :as instead of :use
16:35eipiten-workyeah
16:35gfrlogtechnomancy: cemerick: isn't it possible the lib itself is ignoring the warnings?
16:35eipiten-workunfortunately, I need to call get
16:35gfrloghe said he was using :require
16:35cemerickeipiten-work: care to paste you code somewhere?
16:35eipiten-worklater on it pukes with this:
16:35technomancygfrlog: oh, good point.
16:36eipiten-workjava.lang.IllegalStateException: Var clj-facebook-graph.client/get is unbound. (NO_SOURCE_FILE:0)
16:36eipiten-workcemerick: just a sec
16:38gfrlogthe library does seem to be causing it: https://github.com/maxweber/clj-facebook-graph/blob/master/src/clj_facebook_graph/client.clj#L112
16:39gfrlogthere is no refer-clojure in that namespace
16:39mattmitchellanyone have nice idiomatic way/suggestion to split a list of numbers into groups, based on a range? Something like (split-by-range 10 [1 2 12 15 20 100]) => [[1 2] [12 15] [20] [100]] ?
16:39gfrlogassuming that's the lib he's using
16:39gfrlogmattmitchell: how would ##(group-by #(quot % 10) [1 2 12 15 20 100]) do?
16:39lazybot⇒ {0 [1 2], 1 [12 15], 2 [20], 10 [100]}
16:40gfrlogcould then call vals on that
16:40eipiten-workyeah - that's it.
16:40eipiten-workI assume it's something that I'm doing on my end, but I've tried to pare down what I've written and am at a loss
16:40eipiten-workcemerick: http://pastebin.com/EPCZnWvB
16:40gfrlogeipiten-work: I say clone the library, add a refer-clojure, and send a pull request
16:41mattmitchellgfrlog: yeah that's pretty good. Thanks! I'll play around with that.
16:41gfrlogmattmitchell: np
16:41cemerickeipiten-work: so you're getting a client/get is unbound error?
16:42eipiten-workyes
16:42cemerickThat doesn't make a lot of sense.
16:42cemerickWhich version of clojure?
16:42eipiten-work1.2.1, I think
16:45cemerickeipiten-work: so, you get only one warning, and then a runtime error when your code attempts to call client/get?
16:45eipiten-workyes
16:46cemerickeipiten-work: are other vars from that namespace available? e.g. client/post?
16:46hiredmanmost likely client/get is declared
16:46hiredmanand you are missing a binding
16:46cemerickhiredman: appears to be a simple defn in the source *shrug*
16:47gfrlogeipiten-work: are you using the lib from leiningen? I would have tried it out myself right now but the readme doesn't suggest how to get it.
16:47gfrlogs/right/by/
16:47lazybot<gfrlog> eipiten-work: are you using the lib from leiningen? I would have tried it out myself by now but the readme doesn't suggest how to get it.
16:48eipiten-workI am using it via leiningen. version 0.2.0
16:50eipiten-workcemerick: I'm looking at facebook's api to see if there's a post target
16:50cemerickeipiten-work: No, in the same namespace you're aliasing to `client` — there's a `post` fn
16:53danlarkin,(let [e Exception] (new e))
16:53clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: e, compiling:(NO_SOURCE_PATH:0)>
16:53danlarkinwhat's the right way to do that?
16:53eipiten-workstrange. So, I can create a request, but not a post
16:54gfrlogWhen I try to use the lib from a fresh project/repl, I get the same expected warning, but calling client/get seems to go fine
16:55gfrlogdanlarkin: since new is a special form, I'm wondering if that requires interop with the reflection API
16:55danlarkinballs
16:55gfrlog,(let [e Exception] (.newInstance e))
16:55clojurebot#<Exception java.lang.Exception>
16:55gfrlogdanlarkin: not _too_ painful eh?
16:55pjstadigbeat me
16:56danlarkinoh!
16:56gfrlog:)
16:56danlarkinperfect
16:56danlarkinwhy couldn't they have called it .new!
16:56danlarkinthanks
16:56gfrlogcuz that's syntactically prohibited :P
16:56pjstadigdanlarkin: that is non-portable... it will not work in ClojureScript
16:56technomancybecause they didn't know smalltalk?
16:56pjstadigthere's actually already a .new in java
16:56danlarkinpjstadig: THANKS PAUL
16:56pjstadigas a special form
16:56pjstadigor syntax of somekind
16:56technomancyherp derp; we're going to invent something that's like a static method, but is totally different called a constructor.
16:56gfrlogpjstadig: what does it do?
16:56hiredman.newInstance doesn't work for all constructors
16:57pjstadigi guess special form isn't the right word for java
16:57pjstadiggrflog it creates an instance of a non static inner class
16:57gfrlogoh golly inner classes
16:57gfrlogcan those be arbitrarily nested?
16:57pjstadigyou have to have an instance of the outer class and you do x.new FooBar()
16:58gfrlogah yes I have seen that
17:01pjstadighttp://download.oracle.com/javase/tutorial/java/javaOO/nested.html <-- the very last section
17:03hiredmanI imagine those are a java lang notion, and the jvm doesn't care
17:05pjstadigright
17:05pjstadigas i said, there's a .new in java, which is what danlarkin asked
17:06cemerickhrm, I've *never* seen that (outerInstance.new InnerClass())
17:06pjstadigcemerick: i've only seen it a few times
17:08gtrak`if an api is making you do that, it should have used a factory instead
17:08TimMcThat actually tickles some faint memory.
17:09gtrak`i can't see how that's in any way superior to a factory
17:09cemerickThat must have been fun for the poor fools writing Java source parsers.
17:09pjstadiggtrak`: you mean this? http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html
17:09amalloyman, foo.new Bar(). that's something i remember reading once but i've never seen anyone use it
17:10gtrak`pjstadig, no I mean like a GoF static factory pattern factory
17:10cemerickAll that trouble just to avoid the implicit Foo.this ctor reference.
17:10gtrak`doesn't have to be static I guess
17:10cemericks/implicit/explicit
17:10lazybot<cemerick> All that trouble just to avoid the explicit Foo.this ctor reference.
17:10pjstadiggtrak`: i know i was being facetious
17:11gtrak`ya never know :-)
17:11amalloycemerick: i don't follow that last. you're suggesting something instead of the fooInst.new Bar()?
17:12gtrak`pjstadig, though I suppose if you're in #clojure, you're probably not a spring-zombie :-)
17:12pjstadighehe
17:12pjstadigsafe assumption
17:13cemerickamalloy: The reference to Bar's outer instance of Foo is referred to as Foo.this — I presume the ctors for inner classes have a param implicitly added by the compiler to provide that reference. If Foo.this (or the implicit `this` in general) weren't part of the Java regime, then you could just do new Bar(fooInst), and not mess with the "it's a method....no, it's syntax" bizarreness.
17:13amalloyclojurebot: second is <reply>Motion seconded and carried. Next agenda item.
17:13clojurebotIk begrijp
17:14TimMcsecond?
17:14clojurebotMotion seconded and carried. Next agenda item.
17:14TimMcdid you mean seconded?
17:14gtrak`seconds are good time units
17:14gfrlog~second
17:14clojurebotMotion seconded and carried. Next agenda item.
17:14amalloyTimMc: i think i said what i meant, though i'm an idiot re: committee/parliamentary procedure
17:15gfrlogI think it makes sense in present tense
17:15gfrlogas one of those "doing by saying" verbs
17:15gfrloge.g., "I agree.", "I do", etc.
17:15gfrlog"I say there, ..."
17:15TimMcamalloy: I just think it's unlikely to come up normally in the form clojurebot is going to react to
17:16amalloyTimMc: yeah but now i can force him to second things for me
17:16gfrlog~negative-first
17:16clojurebotIt's greek to me.
17:16pjstadigi have this idea for a programming language where all the keywords are UUIDs
17:16TimMcamalloy: ah
17:16hiredmandrewr will use them all
17:17pjstadigso like 'if' would be 'e108d8ad-ce1a-4372-af85-a45e11493408'
17:17TimMcpjstadig: ...
17:17TimMc~guards
17:17clojurebotSEIZE HIM!
17:17hiredmanI like long descriptive identifiers, so you've solved half of that
17:17amalloyholy cow, UUIDs for keywords? is this a great idea or what??
17:17lazybotamalloy: What are you, crazy? Of course not!
17:17pjstadigthey're kinda inconvenient but you could solve that with macros
17:17gfrlog(inc pjstadig)
17:17lazybot⟹ 1
17:18pjstadigmodules would be easy too
17:18hiredmanno no!
17:18hiredmanbuilts should be the base64 encoding of the bytecoded used!
17:18hiredmanbuiltins
17:18pjstadigevery function would be named uniquely so there would be no need for namespaces really
17:18gfrloghiredman: a single bytecode? that'd amount to just a few characters...
17:18hiredmanintrinsics indeed
17:19hiredmangfrlog: if is not a single bytecode
17:19TimMcThat reminds me of my idea to have every string literal require a unique prefix value so that you could always track down how a string was built, back to the original line.
17:19hiredmanclojure's if is not a single bytecode
17:19hiredmanand even if it was just a few characters it would represent the op uniquely
17:21gtrak`pjstadig, it really needs an xml schema to go with it
17:21TimMchiredman: In fact, you could require *every* function to be named in terms of its bytecode. They could then have empty bodies.
17:21pjstadiggtrak`: sure...patches welcome
17:21gtrak`pjstadig, for data corruption
17:22gfrlogTimMc: heck! why not go all the way and just require all code to be written in jvm bytecode!
17:22pjstadigTimMc: yes...that's the next step
17:22gfrlogthen the compiler is just the identity function
17:22pjstadigmove from UUIDs to cryptographic hashes
17:22pjstadigthen a function is just the hash of its code
17:22gtrak`can you put SOAP web services in there, too?
17:22pjstadigtotally unique, and no need to keep the code around
17:23pjstadigit would be a breaking change though, so it would have to be for 2.0
17:23hiredmanpjstadig: so in 2035?
17:24pjstadiggtrak`: we'd have our own version of SOAP called DIRT that uses UUIDs to encode the SOAP and XML
17:24pjstadigso '<' would be 'b8a32ffa-41be-4094-a988-309d850ece23'
17:24gtrak`ah... each instruction can be a session key
17:25pjstadigand '>' would be 'dd773367-1153-4436-9fa3-4529698683dd'
17:25pjstadigand each character would have its own UUID like 'x' would be '1e022e6b-1015-42eb-af76-f79c305a9e7f'
17:25gfrlogman those things are so totally universally unique.
17:25hiredmanmuch better than the uuids that, say, ruby generates
17:26gfrloghiredman: ruby sucks at uuids?
17:26sdeobaldNot nearly as much as Oracle.
17:26eipiten-workcemerick, gfrlong, others: thanks for your help. I kept on cutting and it magically started working after a clean-deps-repl cycle. It would have been nice to know what what going on, but... c'est la vie
17:27gfrlogdef gen_uuid; "f764942f-e92b-4884-84ce-c6eb51eeb0f0"; end
17:27hiredmangfrlog: some of them differ by a single letter, etc
17:27pjstadiggfrlog: nice
17:27gfrlogpjstadig: I stole it from http://xkcd.com/221/
17:28gfrloghiredman: gross; that reminds me of couch's default UUIDs, but those aren't so bad
17:32TimMcpjstadig: I suppose Emacs keybindings would with writing all those UUIDs.
17:32pjstadigabsolutely
17:32pjstadigM-/ completion
17:32TimMchelp with, even
17:32pjstadigi mean i always say, why do something yourself when you can have an IDE or editor or some other tool do it
17:33pjstadigbetter off not knowing the details of things, ya' know?
17:33gfrlogwhen your code consists of nothing but a UUID per line, you have good job security.
17:33TimMcSpeaking if which, this is how all programming languages should be named from now on.
17:33pjstadigalso good security
17:33gfrlog:D
17:34pjstadigbecause if your processing user input, what are the odds that a user is going to guess the UUID of your function's name
17:34gfrlogjust got my 18876972-5bf9-4d51-af3f-4a7fd2e54fa1Script env set up
17:34gfrlogsanitization is a thing of the past
17:34TimMcgfrlog: No more trouble googling for R functions
17:34gfrlogha
17:35gfrlogthe library names could share the first 8 characters of the language name
17:35TimMcAlso, I'm gonna name my kid 76313946-700a-4899-948a-57af06495579
17:35pjstadigoh man, can you imagine how exact google searches will be for my new language?
17:36pjstadigone search result
17:36TimMcpjstadig: Perhaps most importantly, your functions would only be callable via getters.
17:36gfrlogspeaking of which, I wonder if google will return anything for any of the UUID's we've been using yet
17:37gfrlog$google b8a32ffa-41be-4094-a988-309d850ece23
17:37TimMc14d2d103-c079-4dc4-950e-3b3a3185a43e.getFunction("35be73d0-2090-4629-9aba-98b4702f18ca").invoke()
17:37clojurebot27
17:37gfrlog...I guess that means 0 hits?
17:37TimMcSee? clojurebot can already run my code!
17:37TimMcThat's how efficient it is.
17:38gfrlogstrange that getFunction and invoke have normal-looking names
17:38TimMcgfrlog: That's transitional syntax.
17:38gfrlogvery good
17:38TimMcAnything beyond version e72639b9-aff3-4d13-8319-e74980ee7520 would have strict UUID requirements.
17:39pjstadigyeah way too many non-UUIDs...parens, quotes, dot
17:39gfrloglol
17:39pjstadigbut you have to bootstrap amirite?
17:40TimMcof course
17:40gfrlogI can't wait to see the first book from O'Reilly
17:41gfrlogmaybe a centipede would be a good animal?
17:41TimMcIt would have an East Asian giant softshell turtle as the cover animal
17:41TimMcbeing the only individual of its species in existence
17:42amalloyi can already see the language schisming over creative differences like the cover animal
17:42TimMcs/an/the/
17:42gfrlogokay well 75f8f348-be0e-4fb9-8c51-07316c5473a8, which is the superior of the two languages, will have a centipede.
17:43pjstadigamalloy: that's totally fine...forks aren't a problem since all identifiers are globally unique
17:43gfrlogif we gave buildings UUIDs then mailing addresses would be a lot simpler
17:43TimMcWe also need a central site where people can register their function UUIDs (if we're not using the bytecode approach) to *guarantee* uniqueness.
17:44TimMcThat way we can be *double* sure.
17:44pjstadigmaybe we should just generate a new UUID for a function every time you call it, then we wouldn't have to worry about collisions
17:44gfrlogso instead of calling a function by its name directly, you'd have to call another function that looks up what the name for this call should be
17:45pjstadigbrilliant!
17:50TimMcThe type system should also be based around the functions. So, a value would have to be typed as 63415ec4-3fc2-4be4-add3-11e5be07cf6c[2] to be passed to 63415ec4-3fc2-4be4-add3-11e5be07cf6c as the 3rd argument.
17:51pjstadigyeah but those brackets and the number '2' should be UUIDs too
17:51gfrlogbased around the functions?
17:51TimMcOh, obviously.
17:52TimMcpjstadig: Actually, I was envisioning a typedef syntax. Anyway, "2" is not a proper UUID...
17:52gfrlogsomehow this makes me really want to take a class on komolgarov complexity.
17:53gfrlogs/molga/molgo
17:53lazybot<gfrlog> somehow this makes me really want to take a class on komolgorov complexity.
17:54TimMcchannel-sniping
17:54TimMceveryone is reading wikipedia
17:57gtrak`pjstadig, I think I'm going to fork your lang, it's really been getting out of hand
17:57gtrak`but i will strive to stay backwards compatible
17:57gfrlogokay everybody guess what gtrak` will name his fork
17:57gfrlogwe'll see if anyone gets it right
17:58pjstadig604671e6-23b7-4a5b-bf5c-4bda73b24740?
17:58gtrak`haha
17:58gfrlogI guess be68e7e7-e3c9-4d4a-98e5-32d5c846fff5
17:59gtrak`and it will have a millipede
18:23PPPaulwould someone be able to help me out with a simple macro?
18:25neotykGood morning everyone
18:25gfrlog~anyone
18:25clojurebotPlease do not ask if anyone uses, knows, is good with, can help you with <some program or library>. Instead, ask your real question and someone will answer if they can help.
18:26gfrlogPPPaul: I'd be glad to take a look :)
18:26gfrlogneotyk: hello
18:35gfrlogPPPaul: well I'm leaving in a few minutes, so...
18:36PPPaulok... i'll post something on gist for you gfrlog
18:37neotykI'm writing a macro right now as well, please comment https://gist.github.com/1212643
18:37gfrlogneotyk: I don't think one normally uses the hash# suffix outside of a back-quote
18:39gfrlogneotyk: the purpose of using a macro is just so the fourth argument can be a literal expression instead of a function?
18:40PPPaulhttps://gist.github.com/1212685
18:40amalloymore importantly why is this a macro at all?
18:41gfrlogamalloy: the reason I gave would be legitimate, if he really wanted that
18:41amalloymeh. write it as a function and wrap a macro around it
18:41gfrlogamalloy: yeah, that was about to be my advice
18:42amalloyPPPaul: defDBs is confused about the difference between compile time and runtime
18:43neotykgfrlog: so I can attach flash message to any api response and keep it dry
18:43gfrlogneotyk: you should be able to write it as a function where the 4th argument is a function
18:44gfrlogthen if you really want a macro that lets you pass in a body expression, then make a macro that does nothing except turn the 4th arg into a function and call your other function
18:44amalloyPPPaul: see http://stackoverflow.com/q/7313133/625403 for example
18:45PPPaulthanks
18:46gfrlogneotyk: essentially, the macro should only do the task that requires a macro, and defer to a regular function for everything else
18:46neotykgfrlog: I will put it in fn and call from macro
18:47neotykthanks gfrlog amalloy
18:47gfrlogneotyk: it's better for function-composability and it means less debugging macros
18:47gfrlogneotyk: you're welcome
18:53neotykgfrlog: amalloy: body (4th arg) has to be executed in context of binding provided by params#
18:53neotykhow do I rewrite it as fn?
18:55neotykor that should be no problem
18:56amalloyneotyk: well, you didn't make it especially clear that this was for compojure GET stuff
18:57amalloybut now i hate it even more. just make it a middleware that goes around your GET handler
18:59neotykwhen I started writing this macro I felt like yak shaving
18:59amalloy(defn wrap-json-flash [handler] (fn [request] (binding [*my-flash* (:flash request)] (let [ret (handler request)] (assoc ret :flash *my-flash*)))))
19:00amalloyor something similar to that
19:00neotykamalloy: even simpler, handler should not care about :flash
19:02amalloyat this point we're just reinventing a bad version of sandbar though, right?
19:02neotyknever checked sandbar
19:03neotykamalloy: so what you are saying is that it is done already?
19:03neotyklet me run to my browser
19:03amalloyi think so. it's still not clear to me exactly what you want, but it has flash stuff
19:06technomancywe should add some more forms to clojure.test/assert-expr
19:06technomancystuff like (is (re-find [...])) should be able to give more details about the failure
19:07technomancyhas something like that been done?
19:07technomancyit's a defmulti, so it could be done in an external lib
19:08neotykamalloy: what I wanted to get is first sample of sandbar readme :o
19:10amalloytechnomancy: lancepantz has been doing some of that recently, for some internal things less generally-useful than regexes
19:12technomancyamalloy: I've also got a defmethod somewhere here that outputs a . for every passing test, for those that miss ruby's test/unit
19:12amalloy(is (matching? {:foo 2 :bar 9} (...))) tells you what keys were missing
19:12amalloyor something in that vein
19:12technomancyhm... and once you throw in pattern matching...
19:39jlianyone know if someone is working on externs support in clojurescript?
19:39jliI thought I'd have a crack at it if not
19:43scottjjli: is that diff from ^:export ?
19:44hiredmanexterns are a feature of google closure
19:45jliscottj: yeah, it's for asking closure to not rename calls to external functions
20:22brehautmdeboard: link?
20:23jlithe clojure blip.tv channel I think
20:23mdeboardbrehaut: http://vimeo.com/27860102 + slides http://www.scribd.com/doc/62571669/Patterns
20:23brehautthanks
20:23jlioh, vimeo
20:23jliI had the good fortune of seeing it live :)
20:25mdeboardWELL ARENT YOU FANCY
20:25jliYUP
20:25mdeboardagreed
20:28scottjthat presentation is really good
20:29mdeboardBut seriously, this presentation is really good, especialyl since I'm taking discrete math right now and this ties in nicely
20:30technomancyrebranding is totally easy. see? https://github.com/clojure/clojure/pull/6
20:30mdeboardsurprised to hear prolog mentioned, had no idea it was anything besides a toy :P
20:30gfrlogtechnomancy: :P
20:31scgilardisurprisingly short diff
20:31technomancylike a week late for april 1st though, what the heck
20:34mdeboardFun fact, I am a tadpole, so you're correct in doing so
20:34technomancymdeboard: heh. http://www.penny-arcade.com/comic/2003/11/07/
20:35mdeboardlol
20:36mdeboardHm I really don't understand what he's talking about re: open v. closed dispatching. jli or scottj, have any explanation?
20:37jliI think open means extensible outside the library
20:37jlivs. closed, having to add it in the library itself
20:38mdeboardI guess maybe I don't understand dispatching
20:38mdeboardat least how it pertains here
20:38mdeboardnot pertains, but what it means in this context
20:38mdeboardI understand context to be, like, a function does a thing depending on what its input is
20:38amalloyi think his point is you can add new types of patterns yourself
20:39mdeboarder
20:39mdeboardunderstand dispatching to be*
20:39hiredmanI think open vs. closed dispatching refers to patter matching vs. predicate dispatch
20:40hiredmanpattern matching is closed like a cond, predicate dispatch is open like a multimethod
20:40hiredmanif you have a (match [x] ...) there is no way to add a clause to the match outside of editing the code
20:41hiredmanwhere as for predicate dispatch I think the idea is at anytime you can add a clause by saying "oh, and if this set of predicates match, do X" and it adds those predicates to the graph
20:46mdeboardhiredman: Yeah, I've never used a multimethod and haven't really read about them, so tough for me to internalize. Need to crack one of these clj books
20:47brehautmdeboard: have you encountered the visitor pattern?
20:47mdeboardbrehaut: Not afaik
20:47brehautok
20:48brehautwell that comparison wont help then
20:48mdeboardlol
20:50mdeboardbrehaut: I googled it, and I can see the relation
20:50mdeboardroughly
20:52brehautmultimethods are more general (because they dont have to be dispatched on type)
20:53mdeboardbrehaut: I see
20:57mdeboardI don't get the "no need to test a column once a wildcard is encountered in a row
21:00jliI don't remember the specify example - can you remind?
21:42sridhow do I recompile changed files in a REPL?
21:42brehaut(use :reload 'namespace)
21:42brehautor (use :reload-all 'namespace)
23:21jliman, it's hard to debug advanced compiled clojurescript
23:22jliand closure inspector doesn't work on firefox 6
23:48jli whoo, I think I got externs working