#clojure log - Sep 12 2011

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

0:03 amalloy: sconover: https://gist.github.com/1210561 - it's a lot simpler without reductions

0:27 srid: could someone tell me why I see "java.lang.Exception: Too many arguments to if" error in http://dpaste.com/613267/ ?

0:28 hmm, perhaps its something to do with `->` being a macro.

0:30 amalloy: srid: try macroexpanding that; you should see the issue

0:32 also GZIPInputStream. isn't a function, so it wouldn't work anyway

0:33 srid: right, (if ...) is treated as function call and -> passes the value as a 2nd arg

0:35 amalloy: srid: you might like https://github.com/flatland/useful/blob/develop/src/useful/fn.clj#L48

0:36 then you could write (-> url (URL.) (.openConnection) (.getInputStream) (given (not (running-on-google?)) GZIPInputStream.))

0:36 srid: hmm, ok. i ended doing this http://dpaste.com/613269/

0:37 amalloy: right, that's the no-dependencies way, and i've written that a few times myself

0:40 srid: where 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.

0:43 amalloy: srid: ~/.m2

0:43 it uses maven

0:44 srid: ah thanks. the first time it was complaining about failing checksums. i'll just clean that directory and re-run it.

1:25 that 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.

1:30 xiaolongxia: srid: did anyone answer your pallet question?

1:31 srid: nope, but I gave up on the idea of managing my own VMs as I decided to go with appengine (from heroku)

1:31 xiaolongxia: ok. you can definately manage *any* computer with pallet

1:32 however the process will be slightly different if you don't use jclouds to instantiate the node/instance

3:31 thorwil: i'm trying to cleanup/update my clojure-mode/swank setup

3:31 evaluating (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) fails with

3:31 (void-variable package-archives)

3:42 http://code.google.com/p/marmalade/issues/detail?id=10 suggests it's either an outdated package.el, or not having it loaded properly

3:43 but afaict, my package.el v 0.9 is the latest, and the code for loading it was written by its installation routine

3:46 amalloy: thorwil: have you done (require 'package)?

3:49 thorwil: amalloy: no. just tried, doesn't work

3:49 however, the setq variant from http://code.google.com/p/marmalade/issues/detail?id=10 seems to work

3:51 ... but only in so far as not producing an error, as there's no clojure-mode available

3:55 ah, i needed a package-refresh-contents

7:41 khaliG: is there some way to pass a vector as the second argument of proxy?

7:44 bsteuber: khaliG: you mean a programmatically generated vector?

7:45 you'll have to use a macro for this

7:45 khaliG: bsteuber, yup, i'm proxying JLabel and want to pass & arguments from my function to the proxy

7:46 bsteuber: don't think it's possible from a function

7:47 and from a macro, the arguments must be already known at compile-time

7:48 khaliG: ah k, so i've no way to dynamically choose a constructor it has to be just one particular one?

7:49 got d/c - i wrote: ah k, so i've no way to dynamically choose a constructor it has to be just one particular one?

7:50 raek: khaliG: you can also use the construct-proxy and init-proxy functions

7:50 they are not macros, so you can apply them

7:50 bsteuber: there are ways to dynamically invoke constructors with java reflection, but I don't know if this can be combined with proxy or gen-class

7:50 khaliG: raek, thanks. i'll have a look now

7:50 bsteuber: ah

7:53 raek: khaliG: an piece of code that uses the underlying functions of proxy: https://gist.github.com/1098101

7:54 bsteuber: raek: nice, I've learned something :)

7:54 khaliG: raek, beautiful, thank you :)

9:02 dnolen: if 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

9:03 jimduey: dnolen: Your delimc library sounds pretty cool. Looking forward to using it in the future.

9:05 dnolen: jimduey: port of the weblocks cl-cont library. Never had much use for it, but perhaps in the JavaScript context it's more relevant.

9:06 jimduey: Maybe so. Always so much to learn.

9:09 jweiss: anyone use clj-stacktrace with swank? I followed the instrux on the README and i still get regular java stacktraces in slime

9:11 seems like my ~/.lein/init.clj is not being respected, tried adding a :prompt option, that doesn't do anything either.

9:14 even 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

9:20 troussan: quit

9:33 gfrlog_: where are folk get their gclosure docs from?

9:34 manutter: I bought the o'reilly book...

9:35 scottj: gfrlog_: I think most people are using the online ones and assuming the diffs from version included with cljs are minimal

9:35 gfrlog_: manutter: you lookup API info in a book? like on paper?

9:35 manutter: well, I bought the ebook first

9:35 gfrlog_: scottj: you're talking about http://closure-library.googlecode.com/svn/docs/index.html, right?

9:36 manutter: then I bought the paper book to have something to read while my ebook reader was charging...

9:36 scottj: gfrlog_: yeah

9:37 wilkes: gfrlog_: the online docs became a lot more helpful for me when I realized that there was a "File Index" tab :)

9:38 gfrlog_: wilkes: I think you just solved all my problems.

9:38 (inc wilkes)

9:38 lazybot: ⟹ 1

9:41 scottj: I had that same problem, apparently it's a crappy UI

9:42 gfrlog_: Typical google. Never giving any thought to their UI. They could take a few lessons from Craigslist.

10:09 thorwil: technomancy: 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:12 Klemern: hey guys

10:12 thorwil: though http://marmalade-repo.org only lists 1.10.0, so i don't know what happened, actually

10:13 Klemern: I saw in clj repo that they removed "throws Exception" clause from all Fn invokes. How will clojure handle uncaught exceptions now?

10:18 TimMc: Klemern: I suspect they will act like RuntimeException and Error.

10:19 I would imagine the declaration was removed so that interop from the Java side wouldn't involve try/catch(Exception) everywhere...

10:20 ...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:24 Klemern: I'm asking because I made a java lib for functional programming and I had this exact problem

10:25 couldn't throw a checked exception because I had no declaration of exception in function interface

10:25 though in case of clojure there a RT class between java and clojure code

10:36 gfrlog_: 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:42 bsteuber: gfrlog_: 2) of course :)

10:42 gfrlog: bsteuber: I mainly hesitate because I got the feeling somewhere that clojure frowned on frivolous wrappers when the interop is just as easy

10:43 but gclosure is just so OOPy...

10:43 bsteuber: many goog namespaces seem almost unusable to me, so verbose and not fitting to clojure

10:43 scottj: gfrlog_: see pinot as a start

10:43 bsteuber: most stuff goog.dom functions return aren't even usable as sequences

10:43 gfrlog: scottj: thanks, taking a look

10:44 dangit why is somebody using the nick 'as'?

10:47 looking 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:04 scottj: gfrlog: use cljs-watch and include pinot in your project.clj

11:04 gfrlog: oh hmm. Okay.

11:05 scottj: idk where the magic happens

11:05 gfrlog: :)

11:05 * gfrlog hates magic

11:26 edw: Is 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:06 technomancy: thorwil: you got 1.7.1 from a recent install?

12:07 oh, maybe M-x package-refresh-contents (analogous to apt-get update) is needed?

12:07 thorwil: technomancy: i thought i did. not 100% sure

12:09 yes, package-refresh-contents seems necessary

12:10 * thorwil once again wishes for a grand unified package management across distributions, languages and plugin systems

12:16 technomancy: thorwil: the needs of users are fundamentally different from the needs of developers

12:16 *end users

12:22 arohner: technomancy: could you expand on that answer?

12:24 technomancy: arohner: funny you should ask! http://technomancy.us/151

12:24 tl;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:32 thorwil: good points. i think it could be handled with one system, though with some modality

12:32 oh, and then there's the purely functional package manager nix: http://nixos.org/nix/

12:34 technomancy: yeah, that is fascinating.

12:34 new 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:37 hiredman: and there is no culture of separating code spaces in C

12:38 you can do that with java, just dump all your jars in to /usr/lib/java and run java -cp /usr/lib/java/\*

12:38 :(

12:41 choffstein: Can anyone point me towards the restrictions on clojure function names? Even better if there is a regex to match them...

12:42 gfrlog: choffstein: are you asking about what the reader recognizes as a symbol?

12:42 choffstein: Yep

12:43 I'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:43 technomancy: choffstein: "what the reader accepts" and "what the reader is guaranteed to accept in the future" are two distinct concepts

12:43 TimMc: choffstein: 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:44 choffstein: hmmm, okay

12:44 TimMc: s/supposed/guaranteed/ I guess

12:44 hiredman: ,'>

12:44 clojurebot: >

12:44 hiredman: ,'<

12:44 clojurebot: <

12:44 hiredman: ,'!

12:44 clojurebot: !

12:44 gfrlog: choffstein: the common things you're missing are "-_?!'+/*"...

12:44 TimMc: ,(symbol " ")

12:44 clojurebot:

12:44 pdk: hey clojurebot you learned your math symbols

12:44 choffstein: gfrlog: Right. Perfect.

12:44 * cemerick winces, waits for the topic of 'standardization' to come up :-P

12:44 gfrlog: and more

12:45 choffstein: okay, here is what I am trying to do

12:45 gfrlog: choffstein: also note than a number of them are valid as initial characters

12:45 e.g., -

12:45 choffstein: I am trying to read in a .clj file and pull out all the functions that have been declared with defn

12:45 gfrlog: the only one I know of that can't be initial is the digit

12:45 hiredman: ,(let [無0] 無)

12:45 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: let requires an even number of forms in binding vector>

12:45 TimMc: choffstein: There are also things like '/ which are weird.

12:45 gfrlog: and then there are the thousands of hiredman characters

12:46 hiredman: ,(let [· 0] ·)

12:46 clojurebot: 0

12:46 gfrlog: choffstein: let the reader read the file then :)

12:46 choffstein: then you just have to deal with the data structure

12:46 choffstein: yeah, that is seeming easier

12:46 manutter: ,(let [無 0] 無)

12:46 clojurebot: 0

12:46 TimMc: You don't want to rewrite the Clojure parser.

12:46 choffstein: I thought the regex would be fast. Looks like … no

12:46 yeah, exactly.

12:47 gfrlog: choffstein: you also know that you can examine the functions in a namespace at runtime, right?

12:47 it's not clear if that would help you or not

12:47 choffstein: gfrlog, that would actually be perfect

12:47 gfrlog: not that I know the functions off the top of my head...

12:50 choffstein: annnddd back to the API :)

12:50 gfrlog: choffstein: try (ns-publics (find-ns 'my-ns))

12:51 choffstein: any way to load a whole string and eval it? read-string only does one object, right?

12:51 gfrlog: (read-string (str "(" s ")")) might work

12:51 don't know if there's an even easier way

12:52 choffstein: load string.

12:52 That clojure cheat sheet is more helpful every day. hot damn

12:52 pdk: where is it

12:52 TimMc: choffstein: You may wish to turn *read-eval* on or off.

12:53 ...although I suppose it is unlikely in Clojure source code!

12:53 choffstein: pdk: http://clojure.org/cheatsheet

12:54 TimMc: I don't quite understand what *read-eval* is for

12:54 gfrlog: choffstein: 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:55 choffstein: there's a syntax for telling the reader to eval something: #=(foo bar)

12:55 dark_src: Vinzent: is there a wiki or help for installing durendal?

12:55 choffstein: gfrlog: oh. Hmm. never seen that.

12:56 gfrlog: choffstein: 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:56 TimMc: ,(read-string "#=(println \"What, me worry?\")")

12:56 clojurebot: #<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>

12:56 choffstein: gotcha.

12:56 Vinzent: dark_src, if you use el-get, just add durendal to your sources

12:56 if not, you should do ;)

12:57 but maybe it's available in the ELPA too

12:57 dark_src: Vinzent: ok.. (again) I am a emacs newbie ;) will check it out

12:57 technomancy: dark_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:58 dnolen: technomancy: do you know if the clojure-mode w/ the ClojureScript enhancements made it to marmalade yet?

12:58 dark_src: I have spent so much time setting up my clojure environment for emacs

12:58 Vinzent: oh, didn't know it

12:59 dark_src: i am pretty sure someone has putup all the common stuff in github or something

12:59 i just don't know where to find it.

13:00 you know things like lein,swank,. common shortcuts for clojure on emacs

13:01 technomancy: dnolen: it has, though it's a separate package, not part of clojure-mode.

13:02 Vinzent: dark_src, maybe technomancy's emacs-starter-kit? It was very helpful for me when I started to use emacs

13:02 bhenry: dark_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:03 dark_src: Vinzent: really?

13:03 Vinzent: technomancy, by the way, thank you very much, I've just realized how many cool stuff you have wrote!

13:04 dark_src: Vinzent: let me check it out.

13:04 Vinzent: dark_src, yes, but it's not very clojure-specific and imho you have to rebind everything anyway

13:05 dark_src: Vinzent: too bad

13:06 bhenry: dark_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:06 Vinzent: dark_src, what can i say... it's emacs

13:06 bhenry: s/love/live

13:06 lazybot: <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:07 dark_src: my clojure-emacs stuff on github : https://github.com/nishantrayan/home

13:07 technomancy: Vinzent: heh; great

13:07 dark_src: only a handfull of stuff for clojure so far.

13:07 Vinzent: I would love to hear your say how much i have missed in this ;)

13:10 lazybot: let me check it out . thanks does it work with lein..swank?

13:10 bhenry: dark_src: yeah it does. it uses durendal

13:11 dark_src: bhenry: thanks mate ;)

13:11 Vinzent: dark_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:14 you know, it would be pretty cool to create emacs-based clojure editor with normal shortcuts and easy installation process on both systems

13:15 dark_src: "both" systems ?

13:15 manutter: yeah, ubuntu and kubuntu

13:15 :)

13:16 technomancy: "We play both kinds of music here; country _and_ western."

13:16 dark_src: ^_^

13:17 gfrlog: vim and windows 98?

13:18 Vinzent: emacs 23 and emacs 24?

13:18 gfrlog: wait one of them has to be google docs

13:30 anttih: so 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:31 are there any known quirks?

13:40 dark_src: just tried live-coding-emacs

13:40 it does some weird stuff

13:41 bhenry: my screen refreshes for each line navigation and my source is getting messy! :(

13:41 bhenry: dark_src: that doesn't happen to me.

13:44 dark_src: bhenry: is there any doc or demo on how to work with clojure on live-coding-emacs

13:44 gfrlog: waitaminute. 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:45 is there some more fundamental barrier related to how gclosure is mixed in?

13:45 technomancy: gfrlog: FSVO "just"

13:45 gfrlog: :)

13:46 in 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:46 ignoring, of course, all the gclosure complication

13:48 * gfrlog notes that try-clojurescript.[com|org] is available

13:49 miltondsilva: Hi, any ideia why this code blows the stack? http://pastebin.com/iDkHmjQk

13:51 gfrlog: miltondsilva: what type are the vertices?

13:51 amalloy: miltondsilva: 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:51 $google stackoverflow clojure primes

13:51 lazybot: [primes - Clojure: Avoiding stack overflow in Sieve of Erathosthene ...] http://stackoverflow.com/questions/2992123/clojure-avoiding-stack-overflow-in-sieve-of-erathosthene

13:52 gfrlog: oh. so he is.

13:52 * gfrlog is ashamed.

13:53 miltondsilva: hm.. and here I thought that I had understood lazy-seqs.. tsk.. thanks amalloy

13:53 edw: Is 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:54 technomancy: edw: you can call clojure.core/compile from the repl

13:54 edw: technomancy: Thanks. I'll check that out.

13:55 miltondsilva: doall resolved the issue

13:56 choffstein: anyone familiar with lein plugins?

13:57 dark_src[1]: how do i execute clojure code in live-coding-emacs?

13:57 amalloy: technomancy: 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:58 technomancy: amalloy: as long as it responds with http://p.hagelb.org/riker.gif at least 7% of the time you have my blessing.

14:00 hiredman: ~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:00 clojurebot: Ik begrijp

14:00 hiredman: ~technomancy

14:00 clojurebot: technomancy is to blame for all failures

14:00 hiredman: close enough

14:00 :)

14:01 bhenry: dark_src[1]: are you in a lein project ?

14:04 edw: technomancy: 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:05 technomancy: edw: yeah, it's hard to know where to draw the line for stuff like that; you can't catch all the unsupported behaviours.

14:05 dark_src[1]: bhenry: its my putty.

14:05 edw: Yeah. For future reference I'll just try to remember that lein outputs "Compiling NSNAME" if it can actually parse the ns list.

14:06 dark_src[1]: on ubuntu live-coding-emacs works beautifully

14:06 i am impressed ^_^

14:06 technomancy: edw: a simple check might be nice though; I'd take a patch.

14:09 mabes_: has anyone seen this error when trying to run clojure-jack-in? "rlwrap: Oops, crashed (caught SIGFPE) "

14:10 mabes: has anyone seen this error when trying to run clojure-jack-in? "rlwrap: Oops, crashed (caught SIGFPE) "

14:11 pjstadig: mabes: nope...sounds like a problem with rlwrap...how did you install rlwrap?

14:11 mabes: I don't know why rlwrap would even be called for "lein jack-in"... running it by myself in the terminal it works file

14:12 pjstadig: you don't have any wrapper scripts for leiningen or anything?

14:12 mabes: pjstadig: with homebrew (OSX) and it hasn't given me any issues...

14:13 technomancy: the only way that would be possible is if you messed up your clojure-swank-command

14:13 pjstadig: a difference between CLI and emacs also tends to point towards some kind of environmental difference

14:13 technomancy: or possibly some nutty shell aliases I guess

14:13 mabes: I 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:14 technomancy: no, rlwrap always crashes if it doesn't have a real terminal; that's standard behaviour

14:14 mabes: technomancy: but does the lein script use rlwrap by default?

14:15 technomancy: mabes: only for repl and interactive

14:20 TimMc: mabes: I assume you have a recent lein? A distressing number of leningen questions can be solved by upgrading.

14:21 mabes: no.. upgrading now

14:33 thanks for the help.. I found the issue.. I am exporting a RLWRAP in my .bashrc file.. if I remove that then it works

14:36 choffstein: Will 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:50 michaelr525: hey!

14:51 lot's of people here

14:51 I wonder how many

14:53 jorgeb_: I can't get lein jack-in to work with Emacs. I have Leiningen 1.6.1.1

14:54 choffstein: is it okay to call a macro on a gensym within a macro?

14:54 jorgeb_: *swank* says lein: command not found

14:55 #>lein jack-in says that task doesn't exist.

14:55 amalloy: choffstein: it's okay to do anything you want

14:55 jorgeb_: I know lein is in the exec-path

14:58 amalloy: (but without more specifics, nobody can know whether what you're describing is a good idea)

14:59 choffstein: amalloy: Well, really I just didn't know if it was legal.

15:00 My guess is I am doing something stupid since I keep getting an "unable to resolve var: " error on my gensymed var.

15:00 amalloy: ~bug report

15:00 clojurebot: A 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:01 choffstein: Yeah. I know.

15:01 I was just pushing the source to git so I could show you

15:02 amalloy: *chuckle*

15:02 choffstein: If you have a spare second … https://github.com/newfoundresearch/clj-doc-test/blob/master/src/leiningen/doc_test.clj

15:03 I 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:06 amalloy: &`(map #(foo %) bar)

15:06 lazybot: ⇒ (clojure.core/map (fn* [p1__21711__21712__auto__] (clojure.core/foo p1__21711__21712__auto__)) clojure.core/bar)

15:07 amalloy: well, that doesn't *look* wrong

15:08 but the error message sounds like it's coming from #(core/doc-test %)

15:08 which, by the way, is just a cumbersome way to write core/doc-test

15:08 choffstein: I know

15:08 but it wouldn't take core/doc-test since doc-test is a macro

15:09 "Caused by: java.lang.Exception: Can't take value of a macro: #'clj-doc-test.core/doc-test"

15:09 amalloy: ah

15:09 well then this version won't work either

15:09 &(doc inc)

15:09 lazybot: ⇒ "([x]); Returns a number one greater than num."

15:09 amalloy: &(let [f-sym 'inc] (doc f-sym))

15:09 lazybot: java.lang.Exception: Unable to resolve var: f-sym in this context

15:10 choffstein: hmmm

15:11 amalloy: you need a version of doc-test that is a function taking a var, instead of a macro taking a symbol

15:12 choffstein: okay.

15:21 I'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:24 amalloy: you can't just create a function that wraps around a macro

15:24 choffstein: Well, what if I define the macro within the function -- such that the macro is redefined with each function call?

15:25 so the macro only exists for the life of the function? Would I be able to use the variable bindings of the function then?

15:26 hiredman: choffstein: code inside a fn is only executed when the fn is run, which is after it is compiled, which is after macroexpand time

15:27 choffstein: hmm. crap.

15:27 hiredman: so not only is defining macros in side a fn bad form, it is also almost completely pointless

15:27 choffstein: it would seem my plan of attack is no good.

15:27 jorgeb_: Does anyone know why lein would claim jack-in is not a task?

15:29 hiredman: jorgeb_: wrong version of swank-clojure

15:29 kjeldahl: Has anybody used congomongo with a unique index and managed to figure out whether an insert failed or not, due to a duplicate key?

15:29 hiredman: choffstein: why not just step back and try to solve your problem instead of working the system

15:30 (you seem to be off yak shaving)

15:31 choffstein: hiredman: 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:31 jorgeb_: hiredman: swank-clojure-1.3.2.jar in .lein/plugins

15:31 choffstein: Be back in a couple minutes. Need to get up and stretch the legs out.

15:31 hiredman: jorgeb_: and in lib for the project?

15:32 jorgeb_: hiredman: ah, not there...

15:33 kjeldahl: Ah, Google turned up something set-write-concern which looks like it might solve my problem.

15:33 amalloy1: choffstein: i seem to have been disconnected. did you figure anything out?

15:35 bhenry: what resources are there for getting a cljs repl that interacts with the browser?

15:36 thorwil: hmm, 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:36 choffstein: amalloy1: No. I think I am approaching the problem the wrong way.

15:36 bhenry: &(not-empty (filter irc://irc.freenode.net:6667/#(= % "a") ["a" "b"]))

15:36 lazybot: java.lang.ClassNotFoundException: irc://irc.freenode.net:6667

15:37 choffstein: Basically, 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:38 bhenry: thorwil: what would you want as input from what output?

15:39 choffstein: So 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:39 bhenry: other way around*

15:40 thorwil: bhenry: http://paste.pocoo.org/show/474852/

15:40 amalloy: choffstein: you can't wrap a function around a macro

15:40 choffstein: amalloy: Yeah … I've sort of discovered that :(

15:40 amalloy: you have to implement the macro's functionality as a function, and then optionally wrap a macro around that

15:40 bhenry: thorwil do you know about some?

15:41 amalloy: fwiw, not-empty is silly there. just use seq

15:41 though ##(doc some) is better

15:41 lazybot: ⇒ "([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:41 bhenry: ,(some #(= % "a") ["a" "b" "c"])

15:41 clojurebot: true

15:42 amalloy: &(some #{"a"} ["a" "b" "c"])

15:42 lazybot: ⇒ "a"

15:42 bhenry: ah. amalloy i was looking for that.

15:42 thorwil: oh, i was aware of some, but no the #{"a"} construct

15:42 bhenry: i thought some returned the item, but you have to make the item into a set to use as the predicate

15:43 thorwil: thanks!

16:30 eipiten-work: question about a namespace conflict I'm getting.

16:30 gfrlog: ~anyone

16:30 clojurebot: Please 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:32 eipiten-work: I'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:33 gfrlog: you get the warning when merely require-ing rather than use-ing?

16:33 eipiten-work: yes

16:33 cemerick: It'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:33 gfrlog: the warning references your ns specifically?

16:34 technomancy: well... it's probably not a good idea to get in the habit of ignoring warnings like that

16:34 eipiten-work: WARNING: get already refers to: #'clojure.core/get in namespace: clj-facebook-graph.client, being replaced by: #'clj-facebook-graph.client/get

16:34 technomancy: eipiten-work: (:refer-clojure :exclude [get]) in your ns clause and you can avoid that

16:34 gfrlog: eipiten-work: and clj-facebook-graph is the library?

16:34 technomancy: eipiten-work: either that or use :require :as instead of :use

16:35 eipiten-work: yeah

16:35 gfrlog: technomancy: cemerick: isn't it possible the lib itself is ignoring the warnings?

16:35 eipiten-work: unfortunately, I need to call get

16:35 gfrlog: he said he was using :require

16:35 cemerick: eipiten-work: care to paste you code somewhere?

16:35 eipiten-work: later on it pukes with this:

16:35 technomancy: gfrlog: oh, good point.

16:36 eipiten-work: java.lang.IllegalStateException: Var clj-facebook-graph.client/get is unbound. (NO_SOURCE_FILE:0)

16:36 cemerick: just a sec

16:38 gfrlog: the library does seem to be causing it: https://github.com/maxweber/clj-facebook-graph/blob/master/src/clj_facebook_graph/client.clj#L112

16:39 there is no refer-clojure in that namespace

16:39 mattmitchell: anyone 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:39 gfrlog: assuming that's the lib he's using

16:39 mattmitchell: how would ##(group-by #(quot % 10) [1 2 12 15 20 100]) do?

16:39 lazybot: ⇒ {0 [1 2], 1 [12 15], 2 [20], 10 [100]}

16:40 gfrlog: could then call vals on that

16:40 eipiten-work: yeah - that's it.

16:40 I 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:40 cemerick: http://pastebin.com/EPCZnWvB

16:40 gfrlog: eipiten-work: I say clone the library, add a refer-clojure, and send a pull request

16:41 mattmitchell: gfrlog: yeah that's pretty good. Thanks! I'll play around with that.

16:41 gfrlog: mattmitchell: np

16:41 cemerick: eipiten-work: so you're getting a client/get is unbound error?

16:42 eipiten-work: yes

16:42 cemerick: That doesn't make a lot of sense.

16:42 Which version of clojure?

16:42 eipiten-work: 1.2.1, I think

16:45 cemerick: eipiten-work: so, you get only one warning, and then a runtime error when your code attempts to call client/get?

16:45 eipiten-work: yes

16:46 cemerick: eipiten-work: are other vars from that namespace available? e.g. client/post?

16:46 hiredman: most likely client/get is declared

16:46 and you are missing a binding

16:46 cemerick: hiredman: appears to be a simple defn in the source *shrug*

16:47 gfrlog: eipiten-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:47 s/right/by/

16:47 lazybot: <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:48 eipiten-work: I am using it via leiningen. version 0.2.0

16:50 cemerick: I'm looking at facebook's api to see if there's a post target

16:50 cemerick: eipiten-work: No, in the same namespace you're aliasing to `client` — there's a `post` fn

16:53 danlarkin: ,(let [e Exception] (new e))

16:53 clojurebot: #<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: e, compiling:(NO_SOURCE_PATH:0)>

16:53 danlarkin: what's the right way to do that?

16:53 eipiten-work: strange. So, I can create a request, but not a post

16:54 gfrlog: When 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:55 danlarkin: since new is a special form, I'm wondering if that requires interop with the reflection API

16:55 danlarkin: balls

16:55 gfrlog: ,(let [e Exception] (.newInstance e))

16:55 clojurebot: #<Exception java.lang.Exception>

16:55 gfrlog: danlarkin: not _too_ painful eh?

16:55 pjstadig: beat me

16:56 danlarkin: oh!

16:56 gfrlog: :)

16:56 danlarkin: perfect

16:56 why couldn't they have called it .new!

16:56 * danlarkin grumbles

16:56 danlarkin: thanks

16:56 gfrlog: cuz that's syntactically prohibited :P

16:56 pjstadig: danlarkin: that is non-portable... it will not work in ClojureScript

16:56 technomancy: because they didn't know smalltalk?

16:56 pjstadig: there's actually already a .new in java

16:56 danlarkin: pjstadig: THANKS PAUL

16:56 pjstadig: as a special form

16:56 or syntax of somekind

16:56 technomancy: herp derp; we're going to invent something that's like a static method, but is totally different called a constructor.

16:56 gfrlog: pjstadig: what does it do?

16:56 hiredman: .newInstance doesn't work for all constructors

16:57 pjstadig: i guess special form isn't the right word for java

16:57 grflog it creates an instance of a non static inner class

16:57 gfrlog: oh golly inner classes

16:57 can those be arbitrarily nested?

16:57 pjstadig: you have to have an instance of the outer class and you do x.new FooBar()

16:58 gfrlog: ah yes I have seen that

17:01 pjstadig: http://download.oracle.com/javase/tutorial/java/javaOO/nested.html <-- the very last section

17:03 hiredman: I imagine those are a java lang notion, and the jvm doesn't care

17:05 pjstadig: right

17:05 as i said, there's a .new in java, which is what danlarkin asked

17:06 cemerick: hrm, I've *never* seen that (outerInstance.new InnerClass())

17:06 pjstadig: cemerick: i've only seen it a few times

17:08 gtrak`: if an api is making you do that, it should have used a factory instead

17:08 TimMc: That actually tickles some faint memory.

17:09 gtrak`: i can't see how that's in any way superior to a factory

17:09 cemerick: That must have been fun for the poor fools writing Java source parsers.

17:09 pjstadig: gtrak`: you mean this? http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html

17:09 amalloy: man, foo.new Bar(). that's something i remember reading once but i've never seen anyone use it

17:10 gtrak`: pjstadig, no I mean like a GoF static factory pattern factory

17:10 cemerick: All that trouble just to avoid the implicit Foo.this ctor reference.

17:10 gtrak`: doesn't have to be static I guess

17:10 cemerick: s/implicit/explicit

17:10 lazybot: <cemerick> All that trouble just to avoid the explicit Foo.this ctor reference.

17:10 pjstadig: gtrak`: i know i was being facetious

17:11 gtrak`: ya never know :-)

17:11 amalloy: cemerick: i don't follow that last. you're suggesting something instead of the fooInst.new Bar()?

17:11 * gfrlog seconds amalloy's question

17:12 gtrak`: pjstadig, though I suppose if you're in #clojure, you're probably not a spring-zombie :-)

17:12 pjstadig: hehe

17:12 safe assumption

17:13 cemerick: amalloy: 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:13 amalloy: clojurebot: second is <reply>Motion seconded and carried. Next agenda item.

17:13 clojurebot: Ik begrijp

17:14 TimMc: second?

17:14 clojurebot: Motion seconded and carried. Next agenda item.

17:14 TimMc: did you mean seconded?

17:14 gtrak`: seconds are good time units

17:14 gfrlog: ~second

17:14 clojurebot: Motion seconded and carried. Next agenda item.

17:14 amalloy: TimMc: i think i said what i meant, though i'm an idiot re: committee/parliamentary procedure

17:15 gfrlog: I think it makes sense in present tense

17:15 as one of those "doing by saying" verbs

17:15 e.g., "I agree.", "I do", etc.

17:15 "I say there, ..."

17:15 TimMc: amalloy: I just think it's unlikely to come up normally in the form clojurebot is going to react to

17:16 amalloy: TimMc: yeah but now i can force him to second things for me

17:16 gfrlog: ~negative-first

17:16 clojurebot: It's greek to me.

17:16 pjstadig: i have this idea for a programming language where all the keywords are UUIDs

17:16 TimMc: amalloy: ah

17:16 hiredman: drewr will use them all

17:17 pjstadig: so like 'if' would be 'e108d8ad-ce1a-4372-af85-a45e11493408'

17:17 TimMc: pjstadig: ...

17:17 ~guards

17:17 clojurebot: SEIZE HIM!

17:17 hiredman: I like long descriptive identifiers, so you've solved half of that

17:17 amalloy: holy cow, UUIDs for keywords? is this a great idea or what??

17:17 lazybot: amalloy: What are you, crazy? Of course not!

17:17 pjstadig: they're kinda inconvenient but you could solve that with macros

17:17 gfrlog: (inc pjstadig)

17:17 lazybot: ⟹ 1

17:18 pjstadig: modules would be easy too

17:18 hiredman: no no!

17:18 builts should be the base64 encoding of the bytecoded used!

17:18 builtins

17:18 pjstadig: every function would be named uniquely so there would be no need for namespaces really

17:18 gfrlog: hiredman: a single bytecode? that'd amount to just a few characters...

17:18 hiredman: intrinsics indeed

17:19 gfrlog: if is not a single bytecode

17:19 TimMc: That 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:19 hiredman: clojure's if is not a single bytecode

17:19 and even if it was just a few characters it would represent the op uniquely

17:21 gtrak`: pjstadig, it really needs an xml schema to go with it

17:21 TimMc: hiredman: In fact, you could require *every* function to be named in terms of its bytecode. They could then have empty bodies.

17:21 pjstadig: gtrak`: sure...patches welcome

17:21 gtrak`: pjstadig, for data corruption

17:22 gfrlog: TimMc: heck! why not go all the way and just require all code to be written in jvm bytecode!

17:22 pjstadig: TimMc: yes...that's the next step

17:22 gfrlog: then the compiler is just the identity function

17:22 pjstadig: move from UUIDs to cryptographic hashes

17:22 then a function is just the hash of its code

17:22 gtrak`: can you put SOAP web services in there, too?

17:22 pjstadig: totally unique, and no need to keep the code around

17:23 it would be a breaking change though, so it would have to be for 2.0

17:23 hiredman: pjstadig: so in 2035?

17:24 pjstadig: gtrak`: we'd have our own version of SOAP called DIRT that uses UUIDs to encode the SOAP and XML

17:24 so '<' would be 'b8a32ffa-41be-4094-a988-309d850ece23'

17:24 gtrak`: ah... each instruction can be a session key

17:25 pjstadig: and '>' would be 'dd773367-1153-4436-9fa3-4529698683dd'

17:25 and each character would have its own UUID like 'x' would be '1e022e6b-1015-42eb-af76-f79c305a9e7f'

17:25 gfrlog: man those things are so totally universally unique.

17:25 hiredman: much better than the uuids that, say, ruby generates

17:26 gfrlog: hiredman: ruby sucks at uuids?

17:26 sdeobald: Not nearly as much as Oracle.

17:26 eipiten-work: cemerick, 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:27 gfrlog: def gen_uuid; "f764942f-e92b-4884-84ce-c6eb51eeb0f0"; end

17:27 hiredman: gfrlog: some of them differ by a single letter, etc

17:27 pjstadig: gfrlog: nice

17:27 gfrlog: pjstadig: I stole it from http://xkcd.com/221/

17:28 hiredman: gross; that reminds me of couch's default UUIDs, but those aren't so bad

17:32 TimMc: pjstadig: I suppose Emacs keybindings would with writing all those UUIDs.

17:32 pjstadig: absolutely

17:32 M-/ completion

17:32 TimMc: help with, even

17:32 pjstadig: i mean i always say, why do something yourself when you can have an IDE or editor or some other tool do it

17:33 better off not knowing the details of things, ya' know?

17:33 gfrlog: when your code consists of nothing but a UUID per line, you have good job security.

17:33 TimMc: Speaking if which, this is how all programming languages should be named from now on.

17:33 pjstadig: also good security

17:33 gfrlog: :D

17:34 pjstadig: because if your processing user input, what are the odds that a user is going to guess the UUID of your function's name

17:34 gfrlog: just got my 18876972-5bf9-4d51-af3f-4a7fd2e54fa1Script env set up

17:34 sanitization is a thing of the past

17:34 TimMc: gfrlog: No more trouble googling for R functions

17:34 gfrlog: ha

17:35 the library names could share the first 8 characters of the language name

17:35 TimMc: Also, I'm gonna name my kid 76313946-700a-4899-948a-57af06495579

17:35 pjstadig: oh man, can you imagine how exact google searches will be for my new language?

17:36 one search result

17:36 TimMc: pjstadig: Perhaps most importantly, your functions would only be callable via getters.

17:36 gfrlog: speaking of which, I wonder if google will return anything for any of the UUID's we've been using yet

17:37 $google b8a32ffa-41be-4094-a988-309d850ece23

17:37 TimMc: 14d2d103-c079-4dc4-950e-3b3a3185a43e.getFunction("35be73d0-2090-4629-9aba-98b4702f18ca").invoke()

17:37 clojurebot: 27

17:37 gfrlog: ...I guess that means 0 hits?

17:37 TimMc: See? clojurebot can already run my code!

17:37 That's how efficient it is.

17:38 gfrlog: strange that getFunction and invoke have normal-looking names

17:38 TimMc: gfrlog: That's transitional syntax.

17:38 gfrlog: very good

17:38 TimMc: Anything beyond version e72639b9-aff3-4d13-8319-e74980ee7520 would have strict UUID requirements.

17:39 pjstadig: yeah way too many non-UUIDs...parens, quotes, dot

17:39 gfrlog: lol

17:39 pjstadig: but you have to bootstrap amirite?

17:40 TimMc: of course

17:40 gfrlog: I can't wait to see the first book from O'Reilly

17:41 maybe a centipede would be a good animal?

17:41 TimMc: It would have an East Asian giant softshell turtle as the cover animal

17:41 being the only individual of its species in existence

17:42 amalloy: i can already see the language schisming over creative differences like the cover animal

17:42 TimMc: s/an/the/

17:42 gfrlog: okay well 75f8f348-be0e-4fb9-8c51-07316c5473a8, which is the superior of the two languages, will have a centipede.

17:43 pjstadig: amalloy: that's totally fine...forks aren't a problem since all identifiers are globally unique

17:43 gfrlog: if we gave buildings UUIDs then mailing addresses would be a lot simpler

17:43 TimMc: We also need a central site where people can register their function UUIDs (if we're not using the bytecode approach) to *guarantee* uniqueness.

17:44 That way we can be *double* sure.

17:44 pjstadig: maybe 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:44 gfrlog: so 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:45 pjstadig: brilliant!

17:50 TimMc: The 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:51 pjstadig: yeah but those brackets and the number '2' should be UUIDs too

17:51 gfrlog: based around the functions?

17:51 TimMc: Oh, obviously.

17:52 pjstadig: Actually, I was envisioning a typedef syntax. Anyway, "2" is not a proper UUID...

17:52 gfrlog: somehow this makes me really want to take a class on komolgarov complexity.

17:53 s/molga/molgo

17:53 lazybot: <gfrlog> somehow this makes me really want to take a class on komolgorov complexity.

17:54 TimMc: channel-sniping

17:54 everyone is reading wikipedia

17:57 gtrak`: pjstadig, I think I'm going to fork your lang, it's really been getting out of hand

17:57 but i will strive to stay backwards compatible

17:57 gfrlog: okay everybody guess what gtrak` will name his fork

17:57 we'll see if anyone gets it right

17:58 pjstadig: 604671e6-23b7-4a5b-bf5c-4bda73b24740?

17:58 gtrak`: haha

17:58 gfrlog: I guess be68e7e7-e3c9-4d4a-98e5-32d5c846fff5

17:59 gtrak`: and it will have a millipede

18:23 PPPaul: would someone be able to help me out with a simple macro?

18:25 neotyk: Good morning everyone

18:25 gfrlog: ~anyone

18:25 clojurebot: Please 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:26 gfrlog: PPPaul: I'd be glad to take a look :)

18:26 neotyk: hello

18:35 PPPaul: well I'm leaving in a few minutes, so...

18:36 PPPaul: ok... i'll post something on gist for you gfrlog

18:37 neotyk: I'm writing a macro right now as well, please comment https://gist.github.com/1212643

18:37 gfrlog: neotyk: I don't think one normally uses the hash# suffix outside of a back-quote

18:39 neotyk: the purpose of using a macro is just so the fourth argument can be a literal expression instead of a function?

18:40 PPPaul: https://gist.github.com/1212685

18:40 amalloy: more importantly why is this a macro at all?

18:41 gfrlog: amalloy: the reason I gave would be legitimate, if he really wanted that

18:41 amalloy: meh. write it as a function and wrap a macro around it

18:41 gfrlog: amalloy: yeah, that was about to be my advice

18:42 amalloy: PPPaul: defDBs is confused about the difference between compile time and runtime

18:43 neotyk: gfrlog: so I can attach flash message to any api response and keep it dry

18:43 gfrlog: neotyk: you should be able to write it as a function where the 4th argument is a function

18:44 then 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:44 amalloy: PPPaul: see http://stackoverflow.com/q/7313133/625403 for example

18:45 PPPaul: thanks

18:46 gfrlog: neotyk: essentially, the macro should only do the task that requires a macro, and defer to a regular function for everything else

18:46 neotyk: gfrlog: I will put it in fn and call from macro

18:47 thanks gfrlog amalloy

18:47 gfrlog: neotyk: it's better for function-composability and it means less debugging macros

18:47 neotyk: you're welcome

18:53 neotyk: gfrlog: amalloy: body (4th arg) has to be executed in context of binding provided by params#

18:53 how do I rewrite it as fn?

18:55 or that should be no problem

18:56 amalloy: neotyk: well, you didn't make it especially clear that this was for compojure GET stuff

18:57 but now i hate it even more. just make it a middleware that goes around your GET handler

18:59 neotyk: when I started writing this macro I felt like yak shaving

18:59 amalloy: (defn wrap-json-flash [handler] (fn [request] (binding [*my-flash* (:flash request)] (let [ret (handler request)] (assoc ret :flash *my-flash*)))))

19:00 or something similar to that

19:00 neotyk: amalloy: even simpler, handler should not care about :flash

19:02 amalloy: at this point we're just reinventing a bad version of sandbar though, right?

19:02 neotyk: never checked sandbar

19:03 amalloy: so what you are saying is that it is done already?

19:03 let me run to my browser

19:03 amalloy: i think so. it's still not clear to me exactly what you want, but it has flash stuff

19:06 technomancy: we should add some more forms to clojure.test/assert-expr

19:06 stuff like (is (re-find [...])) should be able to give more details about the failure

19:07 has something like that been done?

19:07 it's a defmulti, so it could be done in an external lib

19:08 neotyk: amalloy: what I wanted to get is first sample of sandbar readme :o

19:10 amalloy: technomancy: lancepantz has been doing some of that recently, for some internal things less generally-useful than regexes

19:12 technomancy: amalloy: I've also got a defmethod somewhere here that outputs a . for every passing test, for those that miss ruby's test/unit

19:12 amalloy: (is (matching? {:foo 2 :bar 9} (...))) tells you what keys were missing

19:12 or something in that vein

19:12 technomancy: hm... and once you throw in pattern matching...

19:39 jli: anyone know if someone is working on externs support in clojurescript?

19:39 I thought I'd have a crack at it if not

19:43 scottj: jli: is that diff from ^:export ?

19:44 hiredman: externs are a feature of google closure

19:45 jli: scottj: yeah, it's for asking closure to not rename calls to external functions

20:21 * mdeboard is watching dnolen's presentation at NYC Clojure group

20:22 brehaut: mdeboard: link?

20:23 jli: the clojure blip.tv channel I think

20:23 mdeboard: brehaut: http://vimeo.com/27860102 + slides http://www.scribd.com/doc/62571669/Patterns

20:23 brehaut: thanks

20:23 jli: oh, vimeo

20:23 I had the good fortune of seeing it live :)

20:25 mdeboard: WELL ARENT YOU FANCY

20:25 jli: YUP

20:25 mdeboard: agreed

20:27 * gfrlog wonders how much that video overlaps with the upcoming SL talk

20:28 scottj: that presentation is really good

20:28 * mdeboard had no idea dnolen was uber genius

20:28 * gfrlog suspected as much

20:28 * mdeboard reads 'gfrlog' as "girlfrog" every time

20:29 * gfrlog meant the dependent clause of mdeboard's /me statement, not the whole thing

20:29 * gfrlog heard that from stuartsierra too

20:29 * gfrlog wishes rebranding were easy

20:29 mdeboard: But seriously, this presentation is really good, especialyl since I'm taking discrete math right now and this ties in nicely

20:30 technomancy: rebranding is totally easy. see? https://github.com/clojure/clojure/pull/6

20:30 mdeboard: surprised to hear prolog mentioned, had no idea it was anything besides a toy :P

20:30 gfrlog: technomancy: :P

20:31 scgilardi: surprisingly short diff

20:31 technomancy: like a week late for april 1st though, what the heck

20:34 * lava` read's mdeboard's MOM as "girlfrog" every time

20:34 mdeboard: Fun fact, I am a tadpole, so you're correct in doing so

20:34 * lava` drats

20:34 technomancy: mdeboard: heh. http://www.penny-arcade.com/comic/2003/11/07/

20:35 mdeboard: lol

20:36 Hm I really don't understand what he's talking about re: open v. closed dispatching. jli or scottj, have any explanation?

20:37 jli: I think open means extensible outside the library

20:37 vs. closed, having to add it in the library itself

20:38 mdeboard: I guess maybe I don't understand dispatching

20:38 at least how it pertains here

20:38 not pertains, but what it means in this context

20:38 I understand context to be, like, a function does a thing depending on what its input is

20:38 amalloy: i think his point is you can add new types of patterns yourself

20:39 mdeboard: er

20:39 understand dispatching to be*

20:39 hiredman: I think open vs. closed dispatching refers to patter matching vs. predicate dispatch

20:40 pattern matching is closed like a cond, predicate dispatch is open like a multimethod

20:40 if you have a (match [x] ...) there is no way to add a clause to the match outside of editing the code

20:41 where 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:46 mdeboard: hiredman: 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:47 brehaut: mdeboard: have you encountered the visitor pattern?

20:47 mdeboard: brehaut: Not afaik

20:47 brehaut: ok

20:48 well that comparison wont help then

20:48 mdeboard: lol

20:50 brehaut: I googled it, and I can see the relation

20:50 roughly

20:52 brehaut: multimethods are more general (because they dont have to be dispatched on type)

20:53 mdeboard: brehaut: I see

20:57 I don't get the "no need to test a column once a wildcard is encountered in a row

21:00 jli: I don't remember the specify example - can you remind?

21:42 srid: how do I recompile changed files in a REPL?

21:42 brehaut: (use :reload 'namespace)

21:42 or (use :reload-all 'namespace)

23:21 jli: man, it's hard to debug advanced compiled clojurescript

23:22 and closure inspector doesn't work on firefox 6

23:48 whoo, I think I got externs working

Logging service provided by n01se.net