#clojure log - Nov 19 2011

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

0:29 amalloy: brehaut: spotted at the conj: a shirt reading "Clojure programmers have more fn"

0:29 brehaut: amalloy: lol :)

0:29 jodaro: heh

0:31 brehaut: amalloy: re:syntax highlighting of quotes, i decided that italics is a good style for quoted forms, with non-italics for the unquoted subforms in quasiquotes

0:32 amalloy: brehaut: and `(`(`(foo))) will lean wayyyy to the right?

0:33 brehaut: haha

0:33 i thought about doing something for that but decided not to

0:33 amalloy: just rotate the code 90 degrees for every level of quoting

0:33 it'll teach people to stop trying to nest quoting

0:33 brehaut: lol

0:34 just mark it all black on black and change the contents to [REDACTED]

0:34 amalloy: hah

0:34 brehaut: i think this thing is almost ready to announce on the ML

0:46 Raynes: amalloy: You had some fairly interesting shirts.

0:47 Sadly, my shirts were fairly benign. A family guy shirt that said "Paddle faster, I hear banjos" and another one that said "Those who think they know everything annoy those of us who do."

0:48 brehaut: hmm. i kind of want to highlight deref '@'s the same as functions

0:51 amalloy: brehaut: having spent about two seconds thinking about it, i don't think i'd want that

0:52 so feel free to input that into your weighted-usefulness model

0:52 brehaut: sure :) im experimenting at the moment

0:54 time to cook dinner

1:10 hiredman: https://github.com/hiredman/syntax-quote/blob/master/src/syntax_quote/core.clj#L3

1:23 Raynes: Hah, smacros. smackros.

3:13 daaku: is there a way to resolve a string reference to a qualified symbol like "clojure.string.blank?" without using eval?

3:16 brehaut: ,(symbol "clojure.string" "blank?")

3:16 clojurebot: clojure.string/blank?

3:17 amalloy: i think he's looking for resolve

3:17 ,(resolve (symbol "clojure.string" "blank"))

3:17 clojurebot: nil

3:17 amalloy: ,(resolve (symbol "clojure.string" "blank?"))

3:17 clojurebot: nil

3:17 brehaut: ns not imported?

3:17 amalloy: apparently

3:18 brehaut: ,(resolve (symbol "clojure.core" "when"))

3:18 clojurebot: #'clojure.core/when

3:18 daaku: thanks all, resolve + symbol does the trick

3:21 alex_baranosky: ,(resolve (symbol "clojure.core" "reductions"))

3:21 clojurebot: #'clojure.core/reductions

3:36 Tamytann: Hi

3:36 Is there any live?

3:37 doc lis

3:37 (doc list)

3:37 clojurebot: "([& items]); Creates a new list containing the items."

3:38 amalloy: ~anyone

3:38 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

3:43 Tamytann: Hi clojurebot

3:44 (+ 2 4)

3:44 clojurebot: *suffusion of yellow*

4:15 Tyuio: (doc partial)

4:15 clojurebot: "([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & ...]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."

5:30 mbac: hola

8:58 pauldoo: is there an easy way to convert a javascript object to a human friendly string in clojurescript? (str foo) just says "Object"

9:14 fliebel: When do you use meta data? I feel like it's one of the Clojure gems I'm not making use of. Most often I feel it is easier to just return a vector or map rather than something with meta.

9:15 And then there is still the problem of strings and numbers not supporting meta at all.

9:32 What happens when you recur into a multimethod? It'll go *boom*, right?

9:36 pauldoo: it'll work, but you can only recur into the same exact function, ie you won't get the dynamic dispatch

9:36 (I *think* this is true, but you should try it. my memory is hazy)

9:52 * Saturnation wonders if it is possible to get Leiningen to point at local classes for dependencies...

10:20 shtutgart: is there 'reset' equivalent for the alter-var-root?

10:54 Saturnation: how do you create a URL[] in Clojure?

11:04 brett_h: Saturnation: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/make-array

11:05 Saturnation: thanks

11:05 just found add-classpath, which is ultimately what I'm wanting to do

11:05 and notices that it is deprecated as well :(

11:10 * Saturnation is barking up the wrong tree

11:11 Saturnation: I really just want to add additional local classpaths to Leiningen...

11:41 fliebel: I got a weird exception. If I call a function from the repl, with seemingly the same values, it works, but in some other place it does not. I inserted a print statement right vefore it and the arguments are right. http://pastebin.com/j1c3Rdgz

11:52 ah, solved it. I was doing something silly of course.

12:05 mars42: a question about core logic - is it suitable for solving simple algebraic equations (eg y=a+b with some unknowns)?

12:05 (i dont want a solution, just want to know whether to bother trying)

12:08 ejackson: mars42: nope, it needs the cKanren stuff to be able to do that. But its coming.

12:09 mars42: ejackson: thank you - look forward to that :)

12:09 ejackson: yeah, I'm stupidly excited about that.

12:15 mars42: ejackson: any ETA or is it going to be a while yet

12:20 fliebel: mars42: dnolen or ambrosebs might be able to tell you that, if anyone.

12:24 ambrosebs: cKanren FTW

12:25 mars42: AFAIK the port isn't hard

12:25 cKanren is a clean extension of minikanren

12:26 I'm still going through the cKanren paper

12:26 David has a good idea of what is required

12:27 mars42: ambrosebs: thanks for the info!

12:28 Saturnation: ambrosebs, back in warmer Perth? :)

12:28 ambrosebs: good to be home :)

12:28 Saturnation: Seriously considering moving back to Australia soonish

12:28 ambrosebs: where are you from?

12:28 i just slept 3pm-11pm

12:29 i think i've got a while to adjust!

12:29 Saturnation: Brisbane, spoke to you at the Conj briefly, tall guy with a slightly American accent :)

12:29 currently living in northern Vermont...

12:29 mdh```: wouldn't mind some brissy time

12:31 ambrosebs: it felt like every 4th person I talked to was Australian!

12:32 Saturnation: I thought you said there were only 4 there? :)

12:32 ambrosebs: must have been 4 travelled specifically

12:32 shtutgart: Why don't keywords implement IObj? I'd love to add metadata to them

12:33 ambrosebs: had to have been at least 10 of us

12:33 hiredman: :f is always the same object as :f, so how would you store metadata on one :f but not another?

12:33 mdh```: shtutgart - metadata wouldn't be quarantined by package (is my guess)

12:34 hiredman: mdh```: clojure doesn't have packages

12:34 mdh```: urr namespace

12:34 hiredman: ,(identical? :f :f)

12:34 clojurebot: true

12:34 hiredman: ,(identical? ::f ::f)

12:34 clojurebot: true

12:35 hiredman: ,(identical? 'f 'f)

12:35 clojurebot: false

12:35 hiredman: so symbols can have metadata

12:35 mdh```: ah, indeed

12:37 shtutgart: hiredman: well, then why keywords are the same object? Is it possible to have, say, different, but equal objects for :foo and ^:qux :foo?

12:38 hiredman: :foo is the same object as :foo for a number of reasons, the big one is fast equaity checks

12:39 mdh```: other lisps applly that semantic to symbols as well, (identical? 'f 'f) -> false is a clojureism

12:41 kral: hi

12:43 shtutgart: ok, thanks for explanation. Too bad it's impossible - it'd allow me to have some nice syntax

12:43 kral: hi pals

12:45 shtutgart: kral: hello

12:48 kral: first time here, I've been studying clojure for a month

12:49 but I've done a little lisp in the past

12:50 shtutgart: cool :) feel free to ask your questions

12:53 kral: I'm going to rewrite my website in clojure, so I think that I'll do a lot of questions :)

12:53 ty anyway

13:13 frankieboy: ,(+1 2)

13:13 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

13:16 goodieboy: i'm playing around with macros today, and i'm wondering if it's possible to use ^ without clojure evaluating it as metadata?

13:18 foodoo: Can you define default functions for types that can not be cast to IFn? Take the following expression: (1 < 2); 1 can not be cast to a IFn. But let's suppose the expression is implicitly used as an input to the function (defn f [obj f & args] (apply f obj args)); Is this possible in clojure? Or would this require a reader macro?

13:18 devn: speech recognition software in the terminal does not work so well.

13:24 foodoo: I mean used as the input to the function (fn [obj f & args] (apply f obj args))

13:26 Sindikat: hello everyone

13:27 using clojure with Emacs and swank-clojure. when i try to compile a code having '(use 'clojure.contrib.prxml)' string, it throws 'error: java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate clojure/contrib/prxml__init.class or clojure/contrib/prxml.clj on classpath:'. i've installed clojure-contrib on Ubuntu

13:29 foodoo: Sindikat: are you using Clojure1.2 or Clojure1.3?

13:30 Sindikat: Ubuntu automatically installed clojure-1.2 as dependency

13:31 foodoo: Sindikat: okay. There are several clojure-contrib packages that are not compatible with 1.3. But that doesn't seem to be your problem. I suppose you installed everything with premade packages?

13:31 Sindikat: i think so

13:32 foodoo: Are you familiar with Java? Check your CLASSPATH variable. That's where Java (and therefore Clojure) searches the classes

13:33 Sindikat: no experience with Java on unices. my env variable is empty

13:34 kephale: in clojure repl you can do: (println (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))))

13:35 Sindikat: it gave me (#<URL file:/usr/share/java/clojure-1.2.1.jar>)

13:36 foodoo: you need to add the clojure contrib libraries to your CLASSPATH

13:36 because now you only have clojure on it

13:39 Sindikat: foodoo: how can i do that?

13:42 kephale: Sindikat: is there a reason you aren't using leiningen?

13:43 Sindikat: kephale: well i created a project with it

13:45 kephale: Sindikat: try following the Usage section here: https://github.com/technomancy/swank-clojure

13:45 you might need to also call "lein deps" in the project directory

13:45 Sindikat: hmm, that's what i do

13:46 kephale: assuming that clojure-contrib is listed as a dependency inside your project.clj

13:49 Sindikat: oh, naughty Slime overrided my M-n

14:15 devn: Hello everybody! How goes the clojuring?

14:32 amalloy: ever figure out the problem you and i were looking at?

14:42 amalloy: devn: no, i think there are just so many contexts in which the level to which you can hoist is unclear. i'm putting it aside again; maybe someone will write a purity inferencer i can use :P

14:43 devn: :)

15:04 TimMc: devn: I think I have cubital tunnel syndrome... so not that great.

15:04 gfredericks: TimMc: isn't there a macro for that?

15:05 TimMc: Yes, it's called M-x surgery

15:05 and lots of Ibuprofen.

15:08 amalloy: TimMc: foot pedals!

15:09 TimMc: Maybe that + a one-handed keyboard.

15:10 kephale: facial recognition: smile for meta

15:10 gfredericks: TimMc: there are one-handed dvorak layouts

15:14 theignorati: how do I swap 2 elements in a Java array?

15:14 amalloy: kephale: genius. just give a twisted look of disgust and emacs will type in (flatten ...) for me?

15:14 TimMc: Maybe I should just get one of those EEG thingies.

15:15 amalloy: theignorati: aget/aset

15:15 kephale: amalloy: exactly!

15:16 devn: TimMc: is it your mousing hand?

15:17 TimMc: Are you using dragon dictation or anything like that?

15:19 TimMc: Mousing.

15:20 Well, no. It was, I switched hands.

15:20 amalloy: TimMc: put your mouse in another room. i went without a mouse for a month; it's good for your hands and will help you learn to avoid it when you don't need it

15:21 TimMc: I thought it was carpel tunnel, then a doctor said tendonitis in my forearm, but I just noticed that my right ulnar nerve feels like spaghetti.

15:21 like, multiple pieces

15:21 theignorati: amalloy, what if it's an array of chars?

15:21 amalloy: then use aget and aset

15:21 TimMc: and according to the internets, my ulnar nerve *shouldn't* pop out of that groove when I bend my arm.

15:22 theignorati: what's wrong with (aset (.toCharArray "foofoofoofoofoo") 2 "x")

15:22 amalloy: "x" isn't a character

15:23 theignorati: of course

15:23 thanks

15:25 duck1123`: TimMc: I just got over the same thing in my left wrist

15:25 makes using emacs hell

15:29 gfredericks: amalloy: wrt mouselessness, you use mac?

15:29 amalloy: linux

15:30 TimMc: I use Eclipse at work. It cuts down on keystrokes in some ways (autobuilding and in-memory patching) but requires more mousing.

15:31 gfredericks: amalloy: what window manager?

15:31 TimMc: There's really no alternative for Java.

15:31 amalloy: gfredericks: a pretty stock ubuntu 10.04, so i guess gnome?

15:31 duck1123`: Macs will spit in the face of anyone that tries to go without a mouse. "Here's a dialog for you. good luck dismissing it"

15:32 amalloy: TimMc: it's true, using anything but eclipse is terrible. and you probably have to use the mouse sometimes, but i suspect not as often as you think - there are keyboard shortcuts all over the place

15:32 gfredericks: amalloy: do you do web browsing mouseless?

15:33 amalloy: gfredericks: i *can*, and did during my mouseless period. normally i use the mouse to click on links but the keyboard to scroll

15:33 duck1123`: Conkeror is pretty good, but it's no replacement for Firefox most of the time

15:34 gfredericks: amalloy: I imagine the mouseless browsing experience can vary wildly between websites?

15:35 amalloy: gfredericks: not that much, iirc

15:36 duck1123: For firefox: https://addons.mozilla.org/en-US/firefox/addon/lol/

15:36 amalloy: there are some clever cheats to avoid having to tab through all the links on a page, for example

15:45 TimMc: amalloy: Like incremental link search?

15:45 amalloy: TimMc: that would be handy as a real feature. i just faked it with chrome's search bar

15:46 TimMc: amalloy: ' on Firefox

15:46 amalloy: i'm still waiting for them to rerelease firefox 2

15:47 TimMc: ?

15:47 * amalloy hasn't really been happy with any later releases of firefox

15:49 TimMc: Yeah, it's kind of sad.

15:52 brehaut: amalloy: thats ok, there will be another one in 10 minutes

15:55 gfredericks: Changelog: Reverted to firefox 2

15:56 pandeiro: why doesn't name resolve keywords with '/' in them to their full value?

15:58 brehaut: pandeiro: namespaces

15:58 pandeiro: chromium with the vimium plugin is great for mouseless browsing btw... easy to select any link, button, etc

15:58 brehaut: any way around that?

15:58 gfredericks: pandeiro: ##(str 'user/foo)

15:58 lazybot: ⇒ "user/foo"

15:58 gfredericks: oh wait keywords

15:59 ,(str :user/foo)

15:59 clojurebot: ":user/foo"

15:59 pandeiro: ah ok i can resolve them like that then, thanks gfredericks

15:59 gfredericks: (-> :user/foo str (subs 1))

15:59 pandeiro: yep

15:59 Raynes: &(namespace :user/foo)

15:59 lazybot: ⇒ "user"

16:00 gfredericks: &(namespace (keyword "foo/bar/baz"))

16:00 lazybot: ⇒ "foo/bar"

16:01 amalloy: &(apply str ((juxt namespace name) :foo/bar))

16:01 lazybot: ⇒ "foobar"

16:01 amalloy: hrmph

16:01 pandeiro: ; &((fn [k] (str (namepsace... nevermind amalloy wins

16:02 gfredericks: &(apply str ((juxt namespace (constantly "/") name) :foo/bar))

16:02 lazybot: ⇒ "foo/bar"

16:02 pandeiro: thanks guys

16:02 Raynes: &(clojure.string/join "/" ((juxt namespace name) :foo/bar))

16:02 lazybot: ⇒ "foo/bar"

16:02 Raynes: amalloy: ^ lrn2code

16:02 gfredericks: Raynes: mine had an extra HOF in it

16:03 amalloy: haha confession time: i thought of gfredericks's solution but not Raynes's

16:03 brehaut: &(apply format "%s/%s" ((juxt namespace name) :foo/bar))

16:03 lazybot: ⇒ "foo/bar"

16:03 gfredericks: &((comp (partial apply str) (juxt namespace (constantly "/") name)) :foo/bar)

16:03 lazybot: ⇒ "foo/bar"

16:04 pandeiro: &((fn [k] (str (namepsace k) "/" (name k)) :js/app.js)

16:04 lazybot: java.lang.RuntimeException: EOF while reading, starting at line 1

16:04 pandeiro: lol yeah

16:04 gfredericks: unreadable point-free code FTW

16:04 pandeiro: &((fn [k] (str (namepsace k) "/" (name k))) :js/app.js)

16:04 lazybot: java.lang.RuntimeException: Unable to resolve symbol: namepsace in this context

16:04 pandeiro: daaah

16:04 &((fn [k] (str (namespace k) "/" (name k))) :js/app.js)

16:04 lazybot: ⇒ "js/app.js"

16:06 pandeiro: &((fn [k] (str (namespace k) "/" (name k))) :js/lib/app.js)

16:06 lazybot: ⇒ "js/lib/app.js"

16:06 brehaut: gfredericks: ##((comp str (partial apply symbol) (juxt namespace name)) :foo/bar)

16:06 lazybot: ⇒ "foo/bar"

16:06 brehaut: readable point free

16:07 via egregious hack

16:08 gfredericks: brehaut: I'm not sure what to think of that

16:08 brehaut: at least seven points for not needing the "/" literal

16:08 xenocorp: hey

16:08 gfredericks: xenocorp: hey

16:09 xenocorp: Does anyone have any pointers for getting started? Which IDE/Worflow ?

16:09 workflow*

16:09 brehaut: gfredericks: but minus a lot for the misuse of an interstitial symbol?

16:09 gfredericks: brehaut: only -3

16:09 xenocorp: I've spent 5 hours trying to get Emacs configured and I think I'm literally just too stupid for it

16:09 brehaut: xenocorp: http://dev.clojure.org/display/doc/Getting+Started

16:10 theres a bunch of sub pages for specific enviroments

16:10 xenocorp: Thanks a lot

16:12 robbe-: Hendrik, hoi

16:12 oops

16:17 gfredericks: brehaut: out of curiosity, what is a valid use for an interstitial symbol?

16:17 brehaut: resolving something?

16:19 woo

16:19 piles of javascript worked in IE without fault

16:21 Bahman: Hi all!

16:24 amalloy: brehaut: i was unaware that cheat codes worked in real life, but there is no other explanation

16:25 brehaut: amalloy: it is possible i have had some food related hallucinations

16:25 its more believable than this anyway

16:36 samaaron: ,(+ 2 3)

16:36 clojurebot: 5

16:36 Raynes: samaaron: I hate you. :<

16:36 samaaron: Raynes: that's slightly harsh

16:37 Raynes: samaaron: Your convo with cemerick got posted first and I had my convo with him waaaaaaaaay earlier that day. What makes you so special? That fancy accent? I can do that as well, you know.

16:37 samaaron: Raynes: it's probably because i was wearing blue shoes

16:37 Raynes: Really? Damn. I can't compete with that.

16:38 samaaron: Raynes: read it and weep buster

16:38 btw, did you enjoy the conversation?

16:39 Raynes: You're assuming I listened to it.

16:39 No, I actually did. It was fun. :)

16:39 samaaron: :-)

16:40 should i bother listening to yours when it's released?

16:40 Raynes: Probably not.

16:40 samaaron: ok, thanks for the advice

16:40 Raynes: It is much shorter and orders of magnitudes less interesting.

16:41 samaaron: we can beef it up with some exciting overtone bumpers

16:41 Raynes: Absolutely.

16:41 samaaron: do you have a style of music in mind?

16:41 Raynes: Anything that comes out of overtone is an instant hit.

16:42 amalloy: samaaron: he likes to listen to really crappy music, so see if you can make some

16:42 samaaron: amalloy: crappy i certainly can do

16:42 it'll be as crappy as a pint of bacon

16:42 Raynes: I only listen to the best music.

16:43 samaaron: Raynes: right

16:48 Raynes: samaaron: You used to play with Ioke, didn't you?

16:49 I seem to recall a Sam Aaron from the mailing lists.

16:50 samaaron: Raynes: yep i did

16:50 i really enjoyed what ola was doing with that language

16:50 Raynes: I did everything short of attack Ola Bini at the Conj. I think I may have forced him to shake my hand.

16:51 samaaron: :-)

16:51 you should have stolen his hat

16:52 Raynes: I believe I commented on how he always looked really, really cool.

16:52 He looks like the kind of fellow that rolls out of bed in the morning looking cool.

16:52 Born with a pair of sunglasses and black nail polish.

16:52 samaaron: i believe he was wearing blue nail polish at the conj

16:52 Raynes: It looked very black.

16:52 But I didn't exactly examine his fingernails.

16:53 samaaron: :-)

16:54 Raynes: so are you going to have a go at making the bumpers for your cemerick convo, or would you like me to have a go?

16:54 Raynes: You!

16:54 samaaron: ok

16:55 i'll make it sound like a ring tone interupting your presentation

16:55 fliebel: samaaron: You know what still bothers me? Macros. I have no real right-of-speech since I still have not read the source, but overtone is full of macro, while it does not *seem* to do any fundamentally macro-y business.

16:55 samaaron: fliebel: patches improving the situation will be happily considered

16:56 Raynes: Hah

16:56 samaaron: fliebel: but we do require macros in some scenarios - either that or the use of eval

16:56 fliebel: samaaron: why? (if it can be explained in a sentence or two)

16:56 technomancy: can someone explain to me why it's considered acceptable by some to check in your .classpath file from eclipse so others can use it?

16:57 Raynes: See clojail

16:57 technomancy: that just sounds like a horrible horrible idea

16:57 samaaron: fliebel: because of the way we do local bindings

16:57 Raynes: samaaron: Where did you get your overtone stickers?

16:58 samaaron: Raynes: I made them using an online tool

16:58 Raynes: I'm considering making some clojail stickers.

16:58 Just because.

16:58 samaaron: Raynes: from these guys: http://us.moo.com/products/stickers/

16:58 (although I used the UK branch)

16:59 fliebel: there are cases where I'd like to make non-macro versions of the functionality though

16:59 Raynes: do you have a clojail logo?

16:59 fliebel: samaaron: I'm lost in the files. Where si thins binding thing located?

17:00 Raynes: samaaron: Sadly, no. I think the closest I've got is the clojure-in-a-jail-cell image from my talk.

17:00 fliebel: (ok, I can;t type anymore, I should sleep)

17:02 samaaron: fliebel: look for with-overloaded-ugens

17:02 Raynes: I can't do graphic design. At all.

17:03 fliebel: samaaron: thanks, I'll read a bit. good night :)

17:03 samaaron: fliebel: sleep well

17:05 fliebel: samaaron: ah, so it is for making (+ ugen ...) work?

17:05 samaaron: fliebel: yup

17:06 and we also use macros to allow the defsynth symbol-default bindings to be declared

17:06 fliebel: samaaron: So what happened to contrib.generic.arithmic, or what was it?

17:06 samaaron: making the symbols control proxies as well as binding their internal use inside the synth body to the newly created control proxies

17:07 fliebel: we were using that because it provided multi-method versions of the standard math operators

17:09 but now we just create our own dispatch fn which considers the arguments of the overloaded fns and either calls the original or our special new fn

17:09 * fliebel has 'symbolic computation' pop up in his head, but does not know what it is and if it even applies here.

17:10 fliebel: samaaron: Okay, thanks for the explaination. I'll just have to read the code someday.

17:11 Raynes: samaaron: Did you make the Overtone logo?

17:12 fliebel: I think jeff did that... wow, it's ascii-fied

17:15 Raynes: An awesome clojail logo would be the Clojure logo with a chain wrapped around it and a padlock hanging off the front. Maybe some red horns in there somewhere as well.

17:16 alex_baranosky: Raynes: I think the horns might be cross-mojinating your imagery

17:16 Raynes: Fair enough.

17:17 Just the chain would be fantastic. Nice fat padlock.

17:17 alex_baranosky: maybe a black and white clojure logo, with the chain

17:17 or some other form of jail stripes

17:17 I'm brainstorming mostly

17:18 Raynes: Right. Maybe instead of a padlock, it could be a ball and chain.

17:18 technomancy: what if you had a ball and chain but instead of a ball it was ...

17:18 the clojure logo.

17:18 samaaron: Raynes: no, Jeff Rose's brother made the overtone logo

17:18 Raynes: technomancy: But then what would the chain be holding down? :<

17:19 technomancy: well actually logos that are a direct derivative of the clojure logo are on shaky ground wrt trademark law, so maybe that wouldn't work anyway

17:19 samaaron: I did the asciification of the Overtone logo

17:19 technomancy: oooh, hand-asciified? how artisinal. =)

17:20 alex_baranosky: samaaron: yeah that's a lost art.

17:24 Raynes: I am pretty certain that Clojure and I just broke Github's API.

17:25 Created a repo with my new Github API library and then edited it as well. https://github.com/Raynes/edited-tentacles-test <-- teh brokes.

17:25 alex_baranosky: nice you're taking down the big boys

17:25 Raynes: I actually did it twice with two different repos. Happened both times.

17:25 alex_baranosky: ~tentacles

17:25 clojurebot: Cool story bro.

17:25 k9quaint: tentacle rape

17:26 samaaron: technomancy: alex_baranosky: Hopefully we can keep the craft going

17:27 especially now I've discovered JavE: http://www.jave.de/

17:28 jblomo: i'm generating a class with :gen-class and I'd like to call a static method on 'this'. it looks like I can't just use GeneratedClass/method because GeneratedClass isn't defined yet

17:29 amalloy: jblomo: ...just call a function

17:30 jblomo: i'd like to call a static method that is defined in the generated class's parent

17:30 i guess I could just refer to the parent

17:35 erluko: Consider (map #(/ 1 %) l). If l contains any zeros, an exception will be thrown when the lazy seq is forced. Is there any way to establish and exception handler at the time the lazy seq is created rather than relying on having a try/catch anywhere it might be forced?

17:36 pandeiro: is there something like juxt that would take a collection of functions rather than individual arguments?

17:36 erluko: Clearly the code is just an illustration. I'm not trying to find reciprocals here, just looking at exception handling and laziness.

17:36 amalloy: pandeiro: apply juxt

17:36 pandeiro: functional programming, my name is pandeiro

17:38 alex_baranosky: erluko: you can force the eager execution of the sequence using `doall`

17:38 then catch the exception right there

17:38 amalloy: (map #(try ...) ...)

17:38 theignorati: is there a more efficient way of doing (zipmap (keys bad-map) (map #(if (= String (type %)) (.trim %) %) (vals bad-map))) or is this ok?

17:41 erluko: alex_baranosky: I'm looking for something applicable to lazy seqs that keeps them lazy.

17:42 amalloy: still doesn't feel quite right, but may be the best there is at the moment

17:43 Raynes: I don't know -- seems pretty right to me.

17:44 amalloy: erluko: someone has to be able to handle the exception, at the time the code is executed. so either you wrap the forcing code in a try/catch, or you wrap the generating code

17:44 technomancy: (map (wrap-try #(/ 1 %)) l)

17:49 erluko: (doc wrap-try)

17:49 clojurebot: Gabh mo leithscéal?

17:50 alex_baranosky: ,(doc wrap-try)

17:50 clojurebot: Cool story bro.

17:52 erluko: I've been playing with some samples to find out how much early-exit from reduce and its kin would matter. So far it looks like it could have a large impact, even with my (flawed, exception-based) implementation. This lead me down the path of generalizing the test which injects exception throwing to trigger early exit. It worked until I hit lazy-seqs.

17:52 I'll have to try a different approach

17:52 amalloy: technomancy: that's what you get for extemporizing

17:53 alex_baranosky, erluko: technomancy's point was you could write something like (defn wrap-try [f] (fn [x] (try (f x) (catch Exception _ nil))))

17:53 alex_baranosky: theignorati: maybe use a map utility function such as: https://github.com/AlexBaranosky/Utilize/blob/master/src/utilize/map.clj#L47

17:54 erluko: amalloy: thanks for clarifying. It was so similar to the code that lead me here that I didn't see it.

17:54 amalloy: a little too specific, though, so perhaps (defn wrap-try [f default] (fn [& args] (try (apply f args) (catch Throwable _ default))))

17:54 erluko: ,(shortcut :return (reduce (fn[a b] (if (> a 5000000) (:return a) (+ a b))) 0 (range)))

17:54 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: shortcut in this context, compiling:(NO_SOURCE_PATH:0)>

17:54 erluko: example

17:55 amalloy: erluko: augh don't use exceptions to early-exit from reduce

17:55 just use reductions, and tell it to stop when you want to

17:55 erluko: I said it was ugly.

17:55 It's also much faster than reductions

17:56 I'm exploring the potential benefit of the early-exit proposal, not writing the implementation.

17:56 alex_baranosky: theignorati: so (map-vals bad-map #(if (= String (type %)) (.trim %) %))

17:56 amalloy: someone proposed it?

17:56 erluko: Rich mentioned it at the conj

17:56 There's been talk about it in Haskell. Oleg has an implementation, I believe.

17:56 theignorati: ok thanks

17:57 amalloy: alex_baranosky: c'mon, you have the whole useful library available: (map-val bad-map (to-fix string? (memfn trim)))

17:57 alex_baranosky: amallloy: nice

17:58 theignorati: right string? that was dumb

17:58 erluko: {:shortcut "Elapsed time: 667.912 msecs" :reductions "Elapsed time: 5803.432 msecs"}

18:04 technomancy: every time I read brehaut's blog I feel like I'm getting my daily dose of vitamin C

18:04 just by looking at it

18:04 alex_baranosky: technomancy: where is brehaut's blog?

18:04 technomancy: alex_baranosky: http://brehaut.net/blog/2011/clojure_brush

18:07 alex_baranosky: technomancy: thanks

18:15 chouser: technomancy: yeah, that page tastes like Tang

18:16 samaaron: it's practically effervescent!

18:17 erluko: Anyone interested in the early-exit stuff: https://gist.github.com/1379512

18:51 devn: :)

19:08 justin`: Anyone know how to get the location used for tempfiles in Ring?

19:09 or does it always just use /tmp/ ?

19:10 amalloy: what does ring need temp files for?

19:10 justin`: file uploads

19:10 I think I figured it out actually

19:11 didn't realize there was a createTempFile method for java.io.File

19:28 amalloy: wow, i just realized how clojure.core/assert-args works. that is some sneaky business

20:04 gfredericks: amalloy: it seems straightforward...am I missing something?

20:04 amalloy: gfredericks: how does it get the name of the form?

20:05 gfredericks: ha -- I skipped the exception code cuz I figured it was boring and predictable :)

20:06 oh man -- so it's emitting an &form which refers to the outer defmacro whatsitmajig?

20:07 amalloy: exactly

20:07 gfredericks: so that means assert-args is only useful when defining macros, not functions?

20:07 amalloy: i suppose that's true

20:08 gfredericks: well that was an enjoyable tidbit. thanks.

20:08 * gfredericks vows to use that trick in every project from now on.

20:13 daaku: i seem to be getting a DB exception in korma.core/insert, but can't seem to catch it: https://gist.github.com/a6ee0899a1c1b587450f

20:14 its probably being logged not thrown, but not sure why korma would not throw by default :/

20:20 srid: any go players here?

20:26 * gfredericks googles "gojure"

20:41 Saturnation: project.clj is just a Clojure, right? So I can evaluate within that to define the project?

20:42 gfredericks: Saturnation: looks like it

20:42 I just replaced my project version with (str "foo" "bar") and it accepted it

20:43 Saturnation: OK, so my issue appears to be something else then, thanks :)

20:45 gfredericks: Saturnation: `lein pom` might help you debug your project.clj?

20:51 Saturnation: thanks, all look into tomorrow. Just happy that I've got all the extra-classpath-dirs working at the moment

21:06 amalloy: project.clj doesn't all get evaluated, exactly. it's a little more complicated

21:08 the truth is closer to "none of it gets evaluated", except that you can unquote stuff if you want it to be evaluated

21:40 Saturnation: amalloy, unquote stuff?

21:40 amalloy: ~

21:40 clojurebot: I don't understand.

21:41 amalloy: (defproject myproj "1.0" :dependencies ~(conj [] [clojure (read-version-from-disk)]))

21:41 Saturnation: I was hoping that I could programmatically define my vector for :extra-classpath-dirs, but it didn't really seem to like that

21:41 ah, I think that makes sense now

21:44 sweet, that worked as expected, thanks amalloy

21:44 now I can dynamically read in the java project dependencies and it will just work with leiningen :)

22:33 brehaut: seancorfield: ping?

23:30 * technomancy has already deprecated :use in his heart.

23:34 daaku: technomancy: :require for life?

23:34 technomancy: you know it

23:35 is it totally terrible for a function to use one of its own arities as a reducer?

23:36 daaku: why not letfn?

23:37 amalloy: i don't think so, but i'm also not sure i know what you're asking

23:37 daaku: also, why not :use?

23:38 technomancy: daaku: http://dev.clojure.org/jira/browse/CLJ-879

23:39 daaku: oh, does :only not do what i think it does?

23:39 technomancy: daaku: the problem isn't :only, it's what happens when :only is absent

23:40 daaku: ah, i didn't realize :refer was like :only

23:40 does that exist in 1.3?

23:42 technomancy: I don't think so

23:42 it's just not common since it's not useful on its own

23:45 phdp: Hi, I'm having a small problem with the REPL. I installed Clojure and Lein from source (roughly with this guide: http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html) but when I press on an arrow in the REPL I get, e.g.: user=> (+ 1 2^[[D^[[D^.

23:45 lazybot: The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.

23:46 technomancy: lazybot: botsnack!

23:46 phdp: try installing rlwrap

23:47 phdp: technomancy: Ok thanks!

Logging service provided by n01se.net