#clojure log - Sep 17 2010

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

0:01 hiredman: ~translate from zh 青峰乡

0:01 clojurebot: Qingfeng Township

0:01 hiredman: no wonder it didn't work I misspelled translate

0:02 technomancy: hiredman: I pushed the sort-ns stuff I showed you: http://github.com/technomancy/durendal/blob/master/durendal.el

0:02 ended up not calling it Yonderboy after all.

0:03 hiredman: heh

0:03 nice

0:04 The_Jon_Smith: clojure gone rampant?

0:05 technomancy: http://www.discogs.com/artist/Lupus+Yonderboy <= review by a guy who calls himself "monad"

0:05 scottj: technomancy: what do you think of the highlight params in arg list change to swank-clojure? do you think you'll integrate it?

0:06 technomancy: scottj: was just about to take a look

0:07 scottj: ok, don't have to integrate immediately, I've got fixes coming for inside let bindings and in apply, but don't want to keep working on it if I know it won't get integrated since now it's good enough for me

0:07 technomancy: I just want to make sure it works on the packaged release of slime since it sounds like you're using trunk

0:07 scottj: correct

0:08 tomoj: great, the Mapper interface in hadoop 0.20.2 is deprecated in favor of a concrete Mapper class, subclass to extend

0:08 technomancy: half the classes in hadoop are deprecated

0:08 scottj: technomancy: btw I saw an issue or fork that claimed to fix autodoc on trunk. autodoc works for me on trunk

0:10 technomancy: with or without the patch?

0:10 scottj: wo

0:10 technomancy: gotcha

0:10 scottj: I didn't look to see what exactly the patch addressed or how he was loading autodoc

0:11 technomancy: I may have gotten confused since autodoc is also the name of a Clojure project.

0:11 scottj: oh I didn't even think of that who knows, maybe that's what he was talking about

0:11 technomancy: I am actually not a very in-depth slime user myself; I don't use any contribs beyond slime-repl

0:12 scottj: autodoc is so great, otherwise the arglist only updates when you type not when you browse

0:13 technomancy: I really wish the slime maintainers would take my patches to package up slime =\

0:13 maintaining that all in my own fork is a pain

0:13 slyrus: slime-autodoc didn't work for me a while back

0:13 technomancy: do you have to do anything extra beyond loading slime-autodoc.el?

0:13 slyrus: or, I should say, it sort of worked, it just also occasionally hung slime

0:13 which was no fun

0:14 scottj: I use (slime-setup '(slime-fancy))

0:14 slyrus: it would be great if it now worked reliably

0:14 technomancy: if the slime devs were more cooperative I'd have a lot more incentive to spend time getting the extra contribs working.

0:14 slyrus: what's wrong with the slime developers?

0:15 other than, you know, not wanting to make any changes to make life easier for non-CL developers? :)

0:15 technomancy: they're not really interested in producing releases; they just want everyone to follow trunk all the time.

0:15 using ... wait for it ... CVS.

0:15 hiredman: the drugstore?

0:16 technomancy: not much concern with stability or releases.

0:16 slyrus: git://sbcl.boinkor.net/slime.git

0:16 works for me

0:16 technomancy: hiredman: in the words of Scott Chacon: "It's amusing that CVS sucks so much both as a VCS and as a pharmacy."

0:16 slyrus: hey, at least one doesn't have to download a jar off of some random website :)

0:16 technomancy: in the words of Coda Hale: "Is there a guy in an alley with a trenchcoat full of film canisters named RCS, because that would seal the deal."

0:17 scottj: my autodoc does stop working every once in awhile, though I'm not sure if that's ac-slime or swank-clojure, I don't think it's stalled slime itself though

0:18 technomancy: scottj: that slime-setup call doesn't seem to have an effect

0:18 I should be looking for improved eldoc-style arg display in the minibuffer, right?

0:19 scottj: well, with my swank-clojure yeah, but w/o it slime-fancy should give you an updating param list as you move the cursor w/o entering test

0:19 text

0:19 technomancy: right, I've got your patches applied

0:20 I'm not sure what I should be looking for with slime-autodoc and your patches

0:20 but I guess they don't break anything, so I should just take 'em. =)

0:22 scottj: you might have to add slime/contrib to load-path before slime-set slime-fancy thingy

0:22 technomancy: right, got that part to eval

0:22 just doesn't seem to affect my repl

0:23 woo; Leiningen is now certified as 100% clean; no spyware/adware! http://mac.softpedia.com/get/Developer-Tools/Leiningen.shtml

0:23 also: apparently it is 8kb. who knew?

0:25 certifications: because something's gotta go in that empty space in your sidebar.

0:27 scottj: http://img295.imageshack.us/i/screenshot2sy.png/

0:28 technomancy: dang... that looks nice.

0:28 tomoj: where's point?

0:28 scottj: right " of "bar"

0:28 doesn't show up in screenshot for some reason

0:28 tomoj: that's nice, the having to press space thing is weird

0:29 technomancy: Well I went ahead and merged it even without getting it working

0:30 and I added you to the project; so feel free to push future fixes as long as you can confirm they work in the latest slime package and not just trunk.

0:30 anyone else want commit on swank?

0:30 scottj: latest slime through elpa?

0:30 technomancy: right

0:31 is this the fork you were talking about re: autodoc? http://github.com/technomancy/swank-clojure/pull/22

0:33 scottj: yeah

0:34 I wonder why he took arglist-for-echo-area and copied it to be called autodoc

0:35 oh nevermind was reading commits in wrong order

0:36 damn, I should have looked closer at this, it might do exactly what mine does

0:36 technomancy: oh well, you won because you bugged me on IRC first. =)

0:37 even though he submitted his first ... oh well. =\

0:38 scottj: I'm checking his out now to see if it's better

0:41 well to me it doesn't appear to do anything that wasn't already working, I'll ask him to clarify

0:42 it doesn't highlight current param

0:45 hugod: I believe that patch is a port of my original fix, to use rpc

0:45 in which case it doesn't do highlighting

0:45 it just fixed the protocol to not hang

0:46 technomancy: man... you guys know a lot more about slime than I do.

0:48 lancepantz: anyone happen to know anything about the resources directory in jetty?

0:49 i had been under the impression jetty included it on the class path for all contexts, intended for property files

1:20 Bahman: Hi all!

1:20 phobbs: hello

1:20 =]

1:20 lancepantz: hi Bahman

1:21 Bahman: Hey phobbs, lancepantz.

1:21 phobbs: hehe

1:30 thunk: I missed the autodoc discussion a bit ago -- What're the correct incantations to get autodoc working sans hanging repl?

1:30 I'm running slime trunk and I just compiled and installed the newly patched swank-clojure, but I'm still getting the hanging repl.

1:33 technomancy: crazy kids with your trunk software, your long hair, and your loud music.

1:35 pyrtsa: Any Incanter developers up here?

1:36 thunk: This edge, it's sharp! I cut myself!

1:36 pyrtsa: Seems there's a bug in Incanter's $= function; ($= 10 - 1 + 10) returns -1, not 19.

1:38 (I mean, $= macro.)

2:01 slyrus: technomancy: I thought it was us old lisp fogies that were running the trunk software?

2:02 technomancy: yeah, I'm confused

2:02 kids shouldn't be using cvs

2:03 slyrus: the gateway version control system. next thing you know, they'll be wanting to use git.

2:04 however, the loud music, with headphones anyway, sounds like a good idea

2:26 scottj: thunk: new swank-clojure doesn't fix hanging repl though there is a fork that might be merged that apparently does that

2:28 thunk: scottj: Thanks. You mentioned that you're not seeing the hanging repl -- are you running that fork?

2:28 scottj: nope, mine works fine

2:28 thunk: Hrm, any idea why?

2:28 scottj: does yours hang immediately or after a while?

2:30 thunk: It hangs immediately on evaluation of any non-atomic expression

2:30 Like, it hangs on (+ 1 2), but not on 1

2:30 scottj: yeah I don't have that problem. using lein swank , slime-fancy, cvs trunk

2:32 thunk: swank-clojure 1.3.0-SNAPSHOT ?

2:32 scottj: yeah

2:32 thunk: Weird.

2:32 scottj: and I've been using autodoc for ages w/o problem

2:33 * scottj just checked slime-fancy.el to make sure what he thought was autodoc really is. yep!

2:36 scottj: technomancy: just made several improvements. pushed to my fork, how do I add it to your's?

2:37 zmila: ,(let [[f & r] (sorted-set 1 3 2)] [f r])

2:37 clojurebot: java.lang.UnsupportedOperationException: nth not supported on this type: PersistentTreeSet

2:38 zmila: ,(let [ss (sorted-set 1 3 2)] [(first x) (next x)])

2:38 clojurebot: java.lang.Exception: Unable to resolve symbol: x in this context

2:38 zmila: ,(let [ss (sorted-set 1 3 2)] [(first ss) (next ss)])

2:38 clojurebot: [1 (2 3)]

2:38 phobbs: zmila: you're right

2:38 zmila: why nth in set-destruction?

2:39 phobbs: good question

2:39 hiredman: zmila: [] is used for destructuring linear things

2:39 phobbs: sorted-set should be linear

2:39 hiredman: a set is not a linear thing like a list or a vector

2:40 phobbs: ... it's sorted

2:40 hiredman: ,(ancestors (class (sorted-set)))

2:40 clojurebot: #{clojure.lang.IPersistentSet clojure.lang.Sorted java.util.concurrent.Callable clojure.lang.IMeta clojure.lang.Counted clojure.lang.Seqable java.lang.Runnable java.io.Serializable java.util.Collection java.lang.Object java.util.Set clojure.lang.Reversible clojure.lang.IObj clojure.lang.APersistentSet :clojure.contrib.generic/any clojure.lang.IPersistentCollection java.lang.Iterable clojure.lang.AFn clojure.lang.IFn}

2:40 hiredman: ^- not

2:40 phobbs: ,(ancestors (class []))

2:40 clojurebot: #{java.util.List clojure.lang.IPersistentVector java.util.concurrent.Callable clojure.lang.Sequential clojure.lang.IMeta clojure.lang.Indexed clojure.lang.Counted clojure.lang.Seqable java.lang.Runnable java.io.Serializable java.util.Collection clojure.lang.ILookup java.lang.Object clojure.lang.Associative clojure.lang.IEditableCollection clojure.lang.Reversible clojure.lang.IObj clojure.lang.IPersistentStack java.util.Ran

2:41 hiredman: clojure.lang.Sequential

2:41 phobbs: ok

2:41 so you're saying the system happens to be the way it is

2:41 but I'm saying it shouldn't be that way

2:41 hiredman: *shrug*

2:41 phobbs: [f & r] should destructure a sorted set, otherwise it's broken

2:41 zmila: ,(let [[f & r] (seq (sorted-set 1 3 2))] [f r])

2:41 clojurebot: [1 (2 3)]

2:41 phobbs: ah

2:41 nice

2:54 _na_ka_na_: hello people, I want to make search functionality on my web app, is there a standard way or lib to do this?

2:54 predicates can contain (in sql language) IN, NOT IN, <=, >= etc.. and contain numbers as well as strings

3:04 TheBusby: nakana: Apache's solr may be what you're looking for

3:13 _na_ka_na_: TheBusby: I already have a database ... what I'm looking for is .. some standard way to get search parameters from the ui (say json or xml) .. and convert it into clojure predicate function or something like that

3:14 I don't want to invent a my own dsl for this

3:17 tomoj: what's your database?

3:19 I mean, to do the search you're not going to just call filter on all your data with the predicate function, right?

3:20 LauJensen: Good morning guys - You have no idea how tough it was getting in here today :)

3:21 TheBusby: Lau: commute or network?

3:22 thunk: _na_ka_na_: Take a look at Apache Lucene and the way it's used in clojars-web: http://github.com/ato/clojars-web

3:22 LauJensen: Well. I boot up, only to find Awesome broken by an update. Jump out to tty1 to fix it, only to find out that I accidentally installed 'neo keyboard layout' for the ttys (dunno how I did that), so Ive had to sit and guess guys for 40 minutes until I could boot gnome instead

3:23 TheBusby: can't SSH into the box from another machine?

3:23 bobo_: lol

3:23 LauJensen: s/guys/keys/

3:23 sexpbot: <LauJensen> Well. I boot up, only to find Awesome broken by an update. Jump out to tty1 to fix it, only to find out that I accidentally installed 'neo keyboard layout' for the ttys (dunno how I did that), so Ive had to sit and guess keys for 40 minutes until I could boot gnome instead

3:24 TheBusby: I use dwm+dvorak and have run across similar problems in the past. I usually just SSH in to the box if the keymap gets too broken.

3:25 ordnungswidrig: LauJensen: the fun with linux is that you are finally able to fix this in 40 minutes. On a windows box you'd have to reinstall the os and who knows what else, which would take 40 hours...

3:25 bartj: _na_ka_na_, give sphinx a look

3:26 _na_ka_na_, from what I have read, the search index is created from the database tables

3:27 tomoj: none of those provide a prebuilt way to map json into queries, though, do they?

3:27 ordnungswidrig: IntelliJ IDEA now has a "Powersafe mode" what the ???

3:27 LauJensen: This stuff really ticks me off. When you boot your computer in the morning, its because you want to get to work, not to debug your system. Guess I should stop running off the Arch/TESTING repos. Everything on my system is unstable, incl. the kernel

3:27 tomoj: well, if you're using solr for example you can just query solr, so there's no need for clojure code to parse queries

3:27 similarly for the others I imagine

3:27 bobo_: LauJensen: yes, you should stop that

3:28 tomoj: LauJensen: hah. maybe play with the unstable stuff on a non-work box?

3:28 bobo_: i feel dangerus for using chrome unstable on my workbox.

3:28 bartj: _na_ka_na_, you can find a great deal of information here: http://www.quora.com/How-do-Solr-Lucene-and-Sphinx-compare

3:28 _na_ka_na_, which should help you decide

3:29 ordnungswidrig: LauJensen: I know that, I usually run debian unstable. In 99% this gives me an advantage but the 1% days where suddenly "everthing" is broken are annoying

3:30 TheBusby: I recommend having other systems running bleeding edge stuff, but have your desk terminal running something super stable and just leave it on for months.

3:30 bobo_: in what way does it give you an advantage?

3:30 LauJensen: Guess I just should just keep a 2-day old backup which I can revert system files to

3:30 TheBusby: You're not like me, I dont function well if Im not on the bleeding edge

3:30 ordnungswidrig: yea, its weird hearing 'debian' and 'advantage' in the same sentence

3:30 TheBusby: Lau: I do that as well, just not on my main terminal

3:31 ordnungswidrig: bobo_: newer version of git, gnome, X, whatever. debian stable has a slow release cycle

3:31 TheBusby: have two computers sitting side by side, the stable one connected by mouse and keyboard and the other connected via ssh -x

3:31 bobo_: oh yeh true, debian is special in that way

3:31 ordnungswidrig: LauJensen: come on, the debian packaging system is rather well done and the package maintainers do an awesome job.

3:31 LauJensen: renanimg firefox to iceweasel is akword, though

3:31 LauJensen: ordnungswidrig: the maintainers are commited, but apt-get is the worst packagemanager in the history of slow programs

3:32 ordnungswidrig: LauJensen: slow?

3:32 LauJensen: apt-get is über slow. I think its like 110x slower than pacman

3:32 I can do about 80 system upgrades in around 80 seconds. apt-get cant even read its own database in that timeframe

3:33 ordnungswidrig: LauJensen: I must admit that I never took care about that. But you're right, it is surprisingly slow. But I think in the last year it became faster. Might be my faster system.

3:33 LauJensen: But I remember the day, I had to install debian on a system for a hosted application. And there was some problem with the source I was loading, so I did a rebase and it said "rebase command not recognized", and I was like O_o. Then I hit git-version, and it was 1.1 or something like that, and this was 2007. I nearly fell of my chair, then determined never to install that distro anywhere ever again

3:34 I think I'll make a hacked Arch which just reports itself to be Debian in case a customer demands debian

3:34 ordnungswidrig: LauJensen: *g* I suppose this was debian stable?

3:34 LauJensen: ordnungswidrig: apt-get is still slow. And it doesn't clean up right

3:34 ordnungswidrig: yea

3:35 TheBusby: I have better luck with Ubuntu server LTS releases

3:35 ordnungswidrig: debian stable can be expected to be old. Except you hit the first 6 months after releae.

3:35 LauJensen: you're on arch?

3:35 LauJensen: ordnungswidrig: always, yea

3:37 Also, when you install Ubuntu and hit 'sudo netstat -lnput', you almost have to pipe that to 'more', on arch you get zero services on the network

3:37 ordnungswidrig: LauJensen: so I'll try next time I install a desktop.

3:37 LauJensen: ordnungswidrig: I have a screencast where I install Arch and then set it up as a pseduo-clustered Hadoop server :)

3:37 TheBusby: Lau: there is a significant difference between the desktop and server versions...

3:37 LauJensen: Doesn't tell you anything about its desktop capabilities. But be warned, if you dont know Arch, it takes a full day to install and customize

3:37 ordnungswidrig: LauJensen: heard of nixos? Nice concept, isolate every package and every dependency by using hard-links and build a snapshot infrastructure for your system.

3:37 LauJensen: ordnungswidrig: Never heard of it

3:37 ordnungswidrig: LauJensen: about arch: I know how to google

3:37 "In NixOS, the entire operating system — the kernel, applications, system packages, configuration files, and so on — is built by the http://nixos.org/nix from a description in a purely functional build language."

3:38 tomoj: LauJensen: pseudo-clustered means one box acting like a cluster?

3:38 scottj: ,(/ (* 24 60 60) 80)

3:38 clojurebot: 1080

3:38 scottj: just wondering how many times I can run apt-get while you install arch

3:38 LauJensen: tomoj: yea, a cluster only defined in xml, doesn physically exist

3:38 ordnungswidrig: scottj: point for you

3:38 bobo_: i use apt-get at most once a day. its okay if it takes a min

3:38 tomoj: LauJensen: do you use stuartsierra's clojure-hadoop?

3:38 LauJensen: tomoj: yes

3:39 ordnungswidrig: the idea of nixos resembles the idea of persistent data structures in a way

3:39 tomoj: I've been thinking today about my experience with it

3:39 which has been terrible

3:39 LauJensen: really?

3:39 I loved it

3:39 tomoj: so I started trying to think up a replacement

3:39 but I think I just haven't figured out how to use it yet

3:39 I ended up uberjaring every time I wanted to do a run

3:40 and debugging runs that errored out was difficult

3:40 ordnungswidrig: I think nixos has potential: "This builds and starts a virtual machine that contains the new system configuration"

3:40 tomoj: I think what I'd like is to be able to run a job from the repl and have exceptions pop up in the repl

3:40 now I have to figure out if clojure-hadoop can do that...

3:41 ordnungswidrig: what do you guys use hadoop for?

3:41 LauJensen: tomoj: To run it from the repl requires some tricks, since Hadoop only accepts jobs in the jar format right?

3:41 ordnungswidrig: I never hat such big datasets that I was in need for massive job distribution

3:41 tomoj: well..

3:41 clojure-hadoop provides a way to run a job where you don't have to use hadoop's framework

3:42 just for running the job on your local machine to develop/test/debug

3:43 so there must be some way to, from clojure, run a job

3:43 LauJensen: Ok, you mean just to simulate?

3:43 tomoj: I guess I can just call the gen-class's -main function..

3:44 yeah, I had problems with input/output encoding for example, and I just kept uberjaring and running, and only got non-interactive cryptic stacktraces

3:44 ordnungswidrig: I use hadoop for some NLP stuff

3:45 ordnungswidrig: would hadoop be the right to for implementing a recommender system? I mean the training phase?

3:46 tomoj: yes, but have you seen mahout?

3:47 ordnungswidrig: nope

3:47 oh, nice.

3:48 LauJensen: ordnungswidrig: Hadoop is right when you need to run a major (distributed) map-reduce process

3:49 ordnungswidrig: LauJensen: you mean, when couchdb won't fit anymore :)

3:49 _na_ka_na_: tomoj: We are still tinkering to find the right db .. but we've created an interface layer between the app and the db .. so the app is bound to the interface .. one of the first impls is simply a in-memory db .. so my first thoughts are json --> clojure --> db specific .. what do you think?

3:49 LauJensen: ordnungswidrig: no, 'map-reduce process'

3:50 TheBusby: However sick this sounds, I've actually had better luck with small C tools and the bashreduce script...

3:50 ordnungswidrig: LauJensen: just kidding :-)

3:53 LauJensen: TheBusby: Sounds a little sick... We want the big guns :)

3:54 TheBusby: the implementation isn't "enterprisey", but it ends up being much faster than hadoop

3:54 at least for the jobs I need to deal with

3:55 LauJensen: Well, C is sickly fast

3:55 Quite impressive

3:56 ordnungswidrig: TheBusby: do you have many long jobs or very many short ones?

3:56 TheBusby: ordnungswidrig: long jobs

3:56 ordnungswidrig: well, I suppose, a cluster of FPGAs might be even faster

3:57 but we'll have to wait for CiC until we have clojure on an FPGA, right?

3:58 jlk: hello everyone - i've got a bit of a problem with invoking a dynamic method on a java bean object, with the intent of calling a setXXX method using a map as an argument. looking around there seems to be two ways of doing this, one using a macro, which seems to fail when providing functions as arguments, or by using clojure.lang.Reflector, which seems to fail when proving a nil value to (into-array). has anyone had any luck with this

3:58 have any pointers?

3:59 ordnungswidrig: jik: have an example, gist, paste?

4:00 jlk: to clarify, (bean-cfg obj (merge {:name "value"} {:icon nil})) should evaluate as (.setName obj "value") (.setIcon obj nil)

4:00 one idea is using this (clojure.lang.Reflector/invokeInstanceMethod

4:00 obj

4:00 method-name

4:00 (into-array Object [v]))))


4:00 which comes from the pragmatic programmers book

4:00 TheBusby: Oh, one last thing and I'll shut up. Piping things together in bash runs each in piece in parallel, so you're really bound by IO and available CPU.

4:02 jlk: the other is using a macro to expand to (doto obj (.setXXX val)) etc, but i can't seem to get this working when the map is a function

4:05 ordnungswidrig: post your example to http://clojure.pastebin.com/

4:05 jlk: ok - i'll get onto that after tea :)

4:07 LauJensen: http://mailman.archlinux.org/pipermail/arch-dev-public/2010-September/017852.html

4:07 Hard not to think fondly of Slackware...

4:10 TheBusby: LauJensen: if you don't mind my asking, what do you find are the major advantages of awesome of dwm? (just found conkeror and wondering what other goodies you're already aware of ;)

4:10 s/of dwm/over dwm/

4:10 LauJensen: TheBusby: It enabled me to throw the mouse out the window :)

4:10 sexpbot: <TheBusby> LauJensen: if you don't mind my asking, what do you find are the major advantages of awesome over dwm? (just found conkeror and wondering what other goodies you're already aware of ;)

4:12 AWizzArd: Do we have a Swing expert here?

4:13 LauJensen: Gotta boot, I think Ive sorted out the broken cairo package now

4:15 There we go, much better

4:15 AWizzArd: Whats your Swing problem?

4:15 jave: hello all

4:17 AWizzArd: LauJensen: I am not sure what code exactly I am supposed to run in the Swing thread. As I understand it right now *all* code that modifies visible components must be executed via SwingUtilities/invokeLater.

4:18 LauJensen: AWizzArd: Things like setText setForground setBackground etc dont need invokeLater, and somethings like setVerticalPosition of a ScrollPane does

4:18 and sometimes, (future) works just as well :)

4:23 AWizzArd: LauJensen: how can I find out what exactly I should run via invokeLater?

4:23 LauJensen: the docs for invokelater? or trial and error.

4:23 Swing has many many inconsistencies

4:29 AWizzArd: So, the best strategy will be to let all fast running code run in that thread. Gui creation itself, and each modification of it.

4:37 LauJensen: AWizzArd: I know this sounds silly, but because of the amount of inconsistencies I build the main UIs, added the animation, found the 1 component which broke and put that in its own thread

4:57 fliebel: morning

4:58 LauJensen: morning

4:58 bartj: fliebel, morning

5:02 raek: how do I kill from the point to the beginning of the line in emacs?

5:09 r0man: raek: C-u -1 C-k ?

5:09 raek: no, nearly ;)

5:10 raek: C-u 0 C-k

5:11 phobbs: raek: C-k

5:12 LauJensen: raek: C-u 0 C-k, like r0man said

5:13 raek: that did what I wanted. thanks!

5:15 fliebel: Is that the equivalent of d ^ in vim?

5:15 LauJensen: fliebel: frankly, who cares? :)

5:19 phobbs: fliebel: no

5:19 in Vim that would be "d $"

5:19 killing to _end_ of line

5:20 by default there isn't an easy way to kill to beginning of line without a kill-region

5:20 but it's pretty easy to define a function that would

5:21 (defun kill-to-beginning () (interactive) (kill-region (point) (beginning-of-line)))

5:21 LauJensen: Any JFreeChart experts here?

5:21 raek: LauJensen: those who use vim and are happy with it, I guess.

5:21 LauJensen: raek: you mean Chouser?

5:23 phobbs: er, nevermind

5:24 (defun kill-to-beginning () (interactive)

5:24 (kill-region (point)

5:24 (save-excursion (beginning-of-line)

5:24 (point))))

5:24 geh

5:24 that's annoying

5:25 oh right, (line-beginning-position)

5:25 my elisp is so rusty

5:26 I also fail at reading

5:26 durrr

5:27 bed time

5:27 I cannot think

5:27 jlk: ordnungswidrig: hello again, i've posted some examples to http://clojure.pastebin.com/x3ibpy8e

5:28 ordnungswidrig: i had some more, but have managed to delete them!

5:55 zmyrgel: hi, how can I test if a char is present in a string?

5:56 mrBliss: ,(some {\a} "bladibla")

5:56 clojurebot: 1

5:56 mrBliss: ,(some {\a} "blodiblo")

5:56 clojurebot: 1

5:56 mrBliss: not like that :)

5:57 LauJensen: ,((set "hi there") \h)

5:57 clojurebot: \h

5:58 LauJensen: ,((set "nil") \h)

5:58 clojurebot: nil

5:58 bobo_: ,(.contains "asdfasdfasdfasdf" "a")

5:58 clojurebot: true

5:58 mrBliss: forgot the #!

5:58 bobo_: ,(.contains "asdfasdfasdfasdf" "i")

5:58 clojurebot: false

5:58 mrBliss: ,(some #{\a} "blodiblo")

5:58 clojurebot: nil

5:58 mrBliss: ,(some {\a} "bladibla")

5:58 clojurebot: 1

5:58 mrBliss: did it again ;(

5:59 zmyrgel: I think the .contains is a good way to go

5:59 mrBliss: I agree

6:00 LauJensen: Its by far the best of the options shown here

6:01 zmyrgel: its pretty hard to make chess engine with clojure

6:01 shanmu: Hello there, I am a newbie to Clojure, and I learning to process xml with Clojure

6:01 LauJensen: zmyrgel: really, why?

6:02 zmyrgel: LauJensen: can't just rewrite other engines as they aren't done with functional programming

6:02 shanmu: what's the difference between lazy-xml/parse-seq and lazy-xml/parse-tree, I have not been able to get lazy-xml/parse-seq to work with the examples from the source code?

6:03 zmyrgel: that and the fact that I haven't done any 'real' work with clojure :)

6:03 LauJensen: zmyrgel: ok, yes its hard to port imperative code to Clojure, but I think writing a chess engine will be a lot more gratifying in Clojure than any other language, especially PHP and Java

6:03 mrBliss: shanmu: have a look at clojure.xml and clojure.contrib.zip-filter.xml

6:04 zmyrgel: LauJensen: yeah, its been pretty fun coding this.

6:04 shanmu: mrBliss: Thanks, I did look at them and I was able to use them fine. I was interested in lazy-xml since it support xmlpull parsers...

6:05 mrBliss: shanmu: I'm planning to look into that myself sometime in the future

6:06 shanmu: mtBliss: I meant clojure.contrib.lazy-xml

6:06 mrBliss: shanmu: I figured

6:07 shanmu: mrBliss: oh..ok.. I am able to use lazy-xml/parse-trim fine.. its with lazy-xml/parse-seq I have problems

6:15 mrBliss: shanmu: same here :)

6:18 shanmu: mrBliss: :)

6:24 fliebel: I seem to remember there is some magic in Java to concatenate paths, can someone hint me it's location?

6:25 LauJensen: fliebel: java.io.file takes 2 constructors, root path and file, thats sometimes helpful

6:27 cemerick: fliebel: see clojure.java.io/file

6:27 Wraps those ctors nicely

6:27 fliebel: cemerick: Helpful :)

6:29 LauJensen: fliebel: yea cemerick designed them nicely (make-file "<rootpath>/etc/</rootpath" "<filename>rc.conf</filename>"), it really couldn't be any simpler :)

6:30 mrBliss: shanmu: I got it working, have a look at http://github.com/clojure/clojure-contrib/blob/b8d2743d3a89e13fc9deb2844ca2167b34aaa9b6/src/main/clojure/clojure/contrib/lazy_xml.clj#L211

6:32 LauJensen: cemerick: that talk you gave about deployment recently, is it up anywhere?

6:32 cemerick: LauJensen: no; that was a dry run of the draft of a talk I suspect I'll be giving at the conj next month

6:33 LauJensen: Are those all being recorded?

6:33 cemerick: I'll probably keep the lid on the materials until then

6:33 AFAIK, yes

6:33 LauJensen: Great

6:39 shanmu: mrBliss: that example only tests lazy-xml/parse-trim not lazy-xml/parse-seq

6:43 fliebel: What is this supposed to mean? java.lang.Exception: lib names inside prefix lists must not contain periods (site.clj:1)

6:43 neotyk: last Wednesday Amsterdam Clojurians hosted Uncle Bob Martin doing Clojure introduction, here is a recording of it: http://vimeo.com/15046335

6:44 fliebel: neotyk: Cool

6:44 mrBliss: fliebel: you cannot do (use '[clojure xml contrib.io])

6:44 mind the last .

6:45 zmyrgel: Where I can find which chars are allowed in records, function names etc.?

6:46 fliebel: mrBliss: Mine looks like (ns site (:use 'net.chouser.moustache))

6:46 nvm

6:46 quote

6:46 mrBliss: fliebel: indeed

6:47 zmyrgel: "Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, and ? (other characters will be allowed eventually"

6:50 zmyrgel: mrBliss: Thanks. Apparently gotta find new name for my 0x88state record

7:13 How can I make my recur to be in tail position?

7:13 http://pastebin.com/xBei5k5J

7:17 fliebel: zmyrgel: You have some parens mixed up I think, the board at the end is causing trouble

7:18 zmyrgel: A fn is also a recur point, so why the loop?

7:22 zmyrgel: fliebel: no need to supply the arguments

7:22 but I got it going again by replacing (when ..) stuff with cond

7:22 fliebel: okay :)

8:21 _fogus__: ,+

8:21 clojurebot: #<core$_PLUS_ clojure.core$_PLUS_@2dacc6>

8:23 LauJensen: Im having this issue with JFreeChart, where the chart doesnt render if its not inside a JTabbedPane, JScrollPane and JPanel don't work - Anybody know whats up with that?

8:28 * _fogus__ watching uncle bob's intro to Clojure 1.0

8:34 LauJensen: _fogus__: any good?

8:40 AWizzArd: Ive just seen an example now, where updating UI components using invokeLater caused the update to hang

8:41 _fogus__: LauJensen: It's not too bad. Very Uncle Bob-ish (tiny errors, mixed with grand statements, mixed with large errors, mixed with fact)

8:42 LauJensen: hehe

8:42 I'll have to see for myself I guess :)

8:43 fliebel: What is the best way to make data available to a Ring middleware? Lets say I gave a arg to my app, now hanging somewhere in -main, which started a jetty server. How is my poor middleware ever going to get to that arg? It feels wrong to put it somewhere global, so the middleware can access it.

8:46 I could stuff it in an atom somewhere, or do something smart with closures, but it all feels wrong and very tightly coupled.

8:47 cemerick: fliebel: the premise seems like a warning sign

8:47 middleware are ideally pure functions

8:47 fliebel: cemerick: It probably is...

8:47 shoover: fliebel: is it application state, or configuration data?

8:48 fliebel: shoover: Configuration. It's the path where the whole thing is running.

8:48 shoover: I don't see anything wrong with putting that in a global var

8:48 cemerick: that's a perfectly-reasonable var

8:48 fliebel: although I'll have to berate you at some point for caring about where the whole thing is running ;-)

8:49 AWizzArd: LauJensen: Do you have a link to that example?

8:49 LauJensen: AWizzArd: no, its a proprietary system Im working on right now

8:50 shoover: fliebel: Also, if you consistently start java from the application root directory, relative paths in File objects will work fine

8:50 fliebel: shoover: That is the point, it might be started somewhere else, with a path as argument, and I'd like to know where to find my stuff in that case.

8:51 AWizzArd: LauJensen: Can you explain it? The only idea I have is that this update is time consuming and should run in a SwingWorker instead?

8:51 fliebel: cemerick: But I can't define a var inside of -main, can I?

8:51 cemerick: fliebel: you can, but problably wouldn't want to

8:52 .setRootBinding will work, or you can just reset! an atom you put in the var

8:52 Chousuke: alter-var-root rather :P

8:52 fliebel: cemerick: So how do i get my path in a var? Atom?

8:52 cemerick: Chousuke: I'm old-school, I guess. :-P

8:52 LauJensen: fliebel: (app (with-your-middleware your-date) [""] your-handler)

8:52 cemerick: fliebel: Needing to know where the app is running should be absolutely unnecessary, it seems.

8:53 LauJensen: s/date/data/

8:53 sexpbot: <LauJensen> fliebel: (app (with-your-middleware your-data) [""] your-handler)

8:54 shoover: cemerick: One example of that in action is how ring looks for static files, looking in public/

8:55 fliebel: shoover: You pass a path to wrap-file, don't you?

8:55 cemerick: shoover: I think having ring serve static files is a little nutty. *shrug*

8:56 Chousuke: fliebel: couldn't you pass a classpath-relative path?

8:56 cemerick: just about any app container will serve static files better than ring will

8:58 shoover: cemerick: Probably so. Maybe someday I'll have enough traffic to care

8:58 cemerick: eh, it's not a scale thing, it's a separation-of-concerns thing.

8:59 hrm, and a mime-type and etag and ... thing

9:00 shoover: ring can do Content-Type and Last-Modified, at least

9:00 fliebel: cemerick: I don't need to know where my app is running, but rather which dir contains the files to be served. When it's not '.', I'm screwed. So that is why my middleware needs to know where to look. That path is a command-lin arg, so only available in -main currently.

9:01 cemerick: fliebel: just use an app container, and let it serve your files (jetty or tomcat or grizzly or jboss or ... will do)

9:02 fliebel: cemerick: I'd do that for a real server, but this is only sortof a preview thing, which actually parses markdown, and not justs sends html.

9:02 cemerick: shoover: Yeah, it's not a hard problem at all, just something that I don't think should be in the stack at all. More-than-one-way-to-do-it is poisonous over the long haul, especially for commodity functionality.

9:03 fliebel: you're not using jetty already somewhere?

9:03 fliebel: cemerick: Yea, for static files, but I need my Moustache app to parse markdown files, which live on the path variable I'm after.

9:05 shoover: fliebel: Pick one of def, alter-var-root, or binding, and you'll be fine

9:05 cemerick: fliebel: I'd drop them in the classpath, as Chousuke suggested. That's how I access enlive templates.

9:06 shoover: er, not binding, since other threads will probably process the requests

9:06 fliebel: cemerick: Fair enough…

9:08 Cake puts resources on the path, right? So I can use that for testing.

9:10 Hmmm, it seems Leiningen does, but Cake doesn't.

9:11 shoover: cemerick: Container and separation of concerns are such big words, and yet (route/files "/") is so easy. Do you know of any simple recipes to point to for ring+jetty+server static files from the container?

9:14 cemerick: shoover: It (and a pile of other things) become trivial once you internalize the use of war files.

9:14 if you're hosting using embedded jetty, you'd have to dig into jetty's API (which is excellent, and very comprehensive)

9:15 shoover: cemerick: That hasn't happened yet :)

9:16 cemerick: shoover: Further on the dark side, there's jetty-maven-plugin, which will start an embedded jetty server and automatically add your projects' webapp resources to the static file search path.

9:18 lpetit: cemerick: (just arrived in the room) NOOOoooo ! Don't tell me you're rewriting a servlet container in pure clojure for the needs of your generic repl server ! ! ! :)

9:19 cemerick: lpetit: good lord no :-)

9:19 lpetit: feeew

9:19 cemerick: Trying to get folks to reuse webapp deployment tools, etc. :-)

9:19 A common refrain for me these days, it seems.

9:20 lpetit: Any thoughts on a default timeout for REPL invocations?

9:21 lpetit: cemerick: Concerning a user interaction, not an IDE interaction ?

9:22 cemerick: applicable to both, that would apply if no timeout is supplied by the client

9:23 It seems like we shouldn't allow naive usage to spin up an infinite computation.

9:23 lpetit: aren't we supposed to work in asynchronous mode ?

9:23 Oh, it's the timeout for the computation on the server side, sorry

9:23 cemerick: right

9:23 lpetit: 1 minute ?

9:24 cemerick: heh, that's what I had chosen as a first thought

9:24 :-)

9:24 lpetit: Long enough for most computations, small enough so that the user has the patience to wait and not brutally kill his REPL / IDE

9:24 great minds etc. :)

9:27 fliebel: cemerick: I've added my dir to the cp. So far I'm able to load and do clojure stuff from it, but things like clojure.contrib.duck-streams/read-lines really do want a real path.

9:28 cemerick: fliebel: read-lines takes anything that duck-streams/reader will accept, including the URL you'd get from querying the classpath for a resource

9:30 lpetit: FYI, a first cut of the REPL is done -- I'm getting the tests nailed down now. Everything should be in a github repo by noon-ish.

9:30 lpetit: cemerick: lein's support in ccw seems to be within reach of few work. Stephan Mühlstrasser had already done the hard work of understanding how to embed lein in an OSGi plugin (for use of the new "labrepl support" feature he added, which is not working in 0.0.62, but which I have debugged and will be part of 0.0.63). So now, thanks to lein's embedded support functions, it seems quite easy to dynamically generate "push-only" menu en

9:31 cemerick: that got cut off

9:31 "push-only"

9:31 ?

9:31 lpetit: cemerick: wow. Almost wish I hadn't accepted this week-end trip with our friends, so that I could have played with it by tomorrow morning ! :)

9:31 fliebel: cemerick: Sounds good to me… How do I query the cp? I can't go about importing text files, can I?

9:33 cemerick: fliebel: use Class.getResource(). Getting a class from the right classloader (as opposed to just using java.lang.String, etc) is most easily done by referring to the class of a fn in your local namespace.

9:33 lpetit: cemerick: maybe, I must re-read the log's history... anyway I've given the links to yesterday's (or was it wednesday's ?) conversation on #clojure to smuhlst, he's willing to do it (and I'll don't have much time the next 30 days with the preparation of the slides for the conj)

9:33 cemerick: lpetit: well, I still need to get ccw using the new REPL

9:34 That shouldn't take long, though the async nature of it may require a little reorganization.

9:34 lpetit: cemerick: I can help too

9:35 cemerick: Yeah, I'm wondering just how much breakage you're willing to walk into ;-)

9:35 lpetit: hmmm

9:48 fliebel: cemerick: I'm totally lost here… (.getResource Class "index.md") returns nil, and I can't figure out what you mean bu the ClassLoader stuff.

9:49 cemerick: fliebel: That will look for "index.md" via Class' class, which will use the boot classpath, which doesn't include your file.

9:50 Classloader hierarchies are good things to know about.

9:50 fliebel: So I have to have a class in the location I want to use?

9:50 chouser: unfortunately, have also been known to cause brain damage

9:50 cemerick: Anyway, if you have a fn 'foo' in the middleware's namespace, then just do (.getResource (class foo) "index.md")

9:51 hrm, or "/index.md", I forget if a slash prefix is necessary or not

9:51 chouser: not

9:51 ,(.getResource (class (fn [])) "clojure/core.clj")

9:51 clojurebot: nil

9:51 chouser: oh. well, that worked for me just now

9:51 fliebel: Okay, so I'll need to define something there first,

9:51 chouser: ,(.getResource (class (fn [])) "clojure/core__init.class")

9:52 clojurebot: nil

9:52 chouser: hmph

9:53 cemerick: fliebel: that's just a shortcut -- any fn that is loaded in the same classloader as that which contains a path to the dir that index.md is in will work as well

9:53 fliebel: oooh, it gives a java.net.URL

9:53 cemerick: yup

9:53 LauJensen: ,(-> (clojure.lang.RT/baseLoader) (.getResource "clojure/core.clj"))

9:53 clojurebot: nil

9:53 LauJensen: oh well, works when its not in the sandbox

9:54 fliebel: I see :)

9:54 cemerick: ,(-> (fn []) class (.getResource "clojure/core.clj"))

9:54 clojurebot: nil

9:54 cemerick: hrm

9:54 That doesn't seem to be a sandbox issue -- there's no security manager denial.

9:55 LauJensen: cemerick: It works locally and Ive used it in webapps to serve resources from the jar

9:55 cemerick: ,(-> (File. "/") .listFiles seq)

9:55 clojurebot: java.lang.IllegalArgumentException: Unable to resolve classname: File

9:55 LauJensen: -> (-> (clojure.lang.RT/baseLoader) (.getResource "clojure/core.clj"))

9:55 sexpbot: java.lang.SecurityException: Code did not pass sandbox guidelines: ()

9:55 cemerick: ,(-> (java.io.File. "/") .listFiles seq)

9:55 clojurebot: java.security.AccessControlException: access denied (java.io.FilePermission / read)

9:55 LauJensen: $mail Raynes (-> (clojure.lang.RT/baseLoader) (.getResource "clojure/core.clj"))

9:55 sexpbot: Message saved.

9:55 chouser: I knew about RT/baseLoader's .getResource, but didn't realize it was a method of Class.

9:55 LauJensen: cemerick: heard of file-seq ?

9:56 cemerick: LauJensen: yeah, but haven't internalized it nearly as well as I have File's methods

9:56 LauJensen: getResourceAsStream is the most useful in webapps

9:56 cemerick: commence internalization now plz

9:57 cemerick: unlikely. Just like I'll never forget .addActionListener, etc.

9:58 LauJensen: cemerick: Why should you forget that?

9:58 cemerick: Hopefully for a future where I'm not doing swing UIs anymore.

10:01 shoover: But you'd still need cemerick's snippet if for some reason you didn't want the seq to recurse, right?

10:02 * cemerick just wanted to see what the security manager exception looked like from the bot

10:11 LauJensen: shoover: yep

10:26 fliebel: Yeeeeeaaaa! It works! I dumped all my absolute paths for cp relative paths

10:26 arkh: is there a way to enumerate or count the number of running threads?

10:27 chouser: arkh: (keys (Thread/getAllStackTraces))

10:27 arkh: chouser: thank you

10:29 fliebel: Wow, I'm on 8 if I start a frsh repl :-o

10:29 chouser: 4 here

10:30 ,(map #(.getName %) (keys (Thread/getAllStackTraces)))

10:30 clojurebot: java.lang.Exception: No such namespace: Thread

10:30 chouser: ->(map #(.getName %) (keys (Thread/getAllStackTraces)))

10:30 sexpbot: java.lang.SecurityException: Code did not pass sandbox guidelines: ()

10:31 chouser: meh

10:31 ("Reference Handler" "Signal Dispatcher" "main" "Finalizer")

10:31 fliebel: ("Reference Handler" "Finalizer" "Thread-1" "Thread-0" "Signal Dispatcher" "DestroyJavaVM")

10:32 arkh: is there an issue with clojure.java.shell/sh leaving a thread hanging out after it's exec'ed process is finished? For every call of (sh), (count (keys (Thread/getAllStackTraces))) comes back with one addition thread

10:32 AWizzArd: Do you use Nimbus or http://weblogs.java.net/blog/wzberger/archive/2009/11/22/synthetica-blackeye-highlights ?

10:32 chouser: arkh: uh oh.

10:32 AWizzArd: oops, wrong window, that was for LauJensen :)

10:32 arkh: my program won't exit until I call (shutdown-agents)

10:32 chouser: arkh: yeah, that's expected. but the leaked thread is not, I think.

10:32 cemerick: the non-daemon threads in Agent.java strike again

10:33 chouser: cemerick: we also really did have issues when the default was the other way around.

10:33 arkh: at a repl, the prompt returns (so it's not totally blocking) but thread count increments with each call to (sh) still

10:34 chouser: oh, it's using future.

10:35 cemerick: chouser: IIRC, only in cases where mains would send some actions off (or similar) and assume that the related threads would hold the vm open

10:35 arkh: fwiw, future uses clojure.lang.Agent

10:35 chouser: arkh: I would expect those threads to get reused and/or cleaned up eventually

10:36 arkh: chouser: gc might take care of them?

10:36 I'd be ok with that

10:36 chouser: no, but the thread pool executor used by future should.

10:36 arkh: oh

10:38 chouser: you're correct

10:38 : )

10:39 if I do this: (dotimes [_ 10] (let [s (clojure.java.shell/sh "ls")] (prn s))), wait 10 seconds, do it again, I have 6 threads running by the end of it

10:39 chouser: heh, yeah. I just did: (dotimes [_ 1000] (clojure.java.shell/sh "ls") (Thread/sleep 100))

10:39 6 threads immediately afterward

10:40 that runs for almost 2 minutes, so don't get panicky

10:40 arkh: I feel good about using (sh) then - thanks : )

10:40 chouser: It would be nice if Agent named it pool threads better

10:53 hugod: I think I understand part of why the tests fail in c.c.logging - there is interaction between the tests, as if the tests were running in parallel - adding a binding for log/*logging-agent* within each of the failing tests should "fix" them

11:10 stuartsierra: hugod: can you post that somewhere I can look at it later?

11:10 better yet, write a patch :)

11:12 hugod: stuartsierra: where would you like it - the user list? I'm at a loss to explain why there is an interaction

11:17 stuartsierra: hugod: are you on the dev list? I had a thread there about it

11:17 hugod: stuartsierra: membership pending last I checked...

11:19 cemerick: huh, I'm surprised that the conj talks are one / speaker

11:19 stuartsierra: hugod: user list, then

11:25 chouser: cemerick: I'm not too surprised. With one track, they probably just ran out of time slots.

11:26 shoover: oh man, if I can make it to clojure/conj I will know everything I need to about WAR files

11:26 chouser: assuming one talk per hour, we've already got 7 hours per day

11:27 * sdeobald blinks

11:27 cemerick: chouser: Didn't someone on the speakers list say the slots were 30m?

11:27 chouser: cemerick: yep, plus "plenty of time for questions and discussions" or something like that.

11:27 cemerick: oh, that's talk-time, not full-time-on-stage

11:28 chouser: I hope to prepare a couple of interesting things to talk about/collaborate on to fill up the unscheduled time.

11:28 cemerick: I really enjoyed the format of those quickfire talks at ILC.

11:28 chouser: "talk about" in the truely interactive sense -- conversations, not speeches.

11:42 cemerick: I didn't see any of those

11:42 paid for a whole conference and went for one day. :-P

11:43 cemerick: chouser: Right, I forgot you were only there the first day.

11:43 It was a good time.

11:44 chouser: I'm sure it was

11:44 cemerick: I got to have dinner with Rich, Guy Steele, Sussman, Alexy Radul, and a variety of others.

11:44 Quite memorable.

11:44 chouser: wow, awesome.

11:45 I ran into Guy Steele in the hall, but had nothing to say. :-/

11:46 cemerick: I can't say I had anything genius to say, either -- I remember there was a lot of transactional memory talk, as that was apparently the specialty of Victor and one other fellow on Guy's Fortress team.

11:46 I was mostly there to take advantage of the osmosis. :-)

11:47 chouser: yeah, it's good to have other smart people there to ask questions for you. :-)

11:47 cemerick: ha

11:52 fliebel: Anyone knows what this might mean? http://clojure.pastebin.com/r3Wq4P6y I hate stack traces...

11:53 chouser: ,{:a 1 :a 2}

11:53 clojurebot: Duplicate key: :a

11:53 chouser: ,{"" 1, "" 2}

11:53 clojurebot: Duplicate key:

11:53 chouser: maybe something like that?

11:53 ,{nil 1, nil 2}

11:53 clojurebot: Duplicate key: null

11:53 fliebel: Okay… Could be… no idea where though...

11:54 chouser: file_info.clj line 100

11:54 sdeobald: Hmm. I asked this in #leiningen, but I think everyone there is asleep or disinterested: Is there a standard way to force-execute code after `lein repl' finishes requiring in deps?

11:54 fliebel: chouser: That's a Ring files

11:55 sdeobald: Looking at the code, user-init runs before deps are loaded, and the loading of deps with load-hooks only requires (which makes sense).

11:56 Or perhaps there's a more sensible way to get a repl executing code when it starts? I'm sure there's an obvious answer I'm not thinking of.

11:57 ohpauleez: sdeobald: What do you need to run?

11:57 could you just pack it in a function and call it via the repl?

11:57 you can also write your own script and put it in 'scripts'

11:57 sdeobald: ohpauleez: Just a function as an entry point to a back-and-forth between the user and the repl.

11:58 ohpauleez: You may want to look into using a custom script (that in turn calls clojure's Repl stuff)

11:58 sdeobald: 'scripts'? -- is that a standard lein thing?

11:59 Ah

12:00 chouser: fliebel: might be worth looking at that ring line anyway. Looks like the http request is bad somehow.

12:01 fliebel: chouser: Nope, my response is bad I think...

12:01 ohpauleez: sdeobald: Not a core feature, but a common plugin

12:01 sdeobald: ohpauleez: Ah, cool. Thanks.

12:02 hiredman: uh

12:02 ohpauleez: np

12:02 hiredman: does lein repl actually require deps?

12:02 or does it just put lib on the classpath?

12:02 sdeobald: hiredman: heh... just noticed that.

12:03 chouser: nooo.. Uncle Bob lying to the masses...

12:03 sdeobald: The latter.

12:03 hiredman: chouser: stop the presses!

12:03 (actually I am watching his video as we speak)

12:03 chouser: about Clojure, though. Someone is wrong on the internet!

12:03 hiredman: me too

12:03 ohpauleez: link?

12:03 clojurebot: your link is dead

12:04 hiredman: clojurebot: botsnack

12:04 clojurebot: thanks; that was delicious. (nom nom nom)

12:04 cemerick: chouser: what's the offense this time?

12:04 chouser: His intro to def and Var is wrong.

12:04 cemerick: didn't get that far

12:04 chouser: he said redefining a Var is undefined.

12:04 ~17 minutes in

12:04 clojurebot: Gabh mo leithscéal?

12:04 chouser: ohpauleez: http://vimeo.com/15046335

12:04 ohpauleez: chouser: thank you kindly

12:05 hiredman: oh geez

12:05 his code has parens on trailing lines

12:05 chouser: heh

12:06 * hiredman cries

12:06 chouser: gah

12:06 [] is not a Java Vector

12:06 cemerick: jeez, seriously?

12:07 chouser: I'm enjoying his style -- I'm sure many people will find it engaging and interesting.

12:07 adben: Hi everyone,

12:08 I just want to share with you guys, this interesting intro video to clojure, http://vimeo.com/15046335 by Uncle bob martin

12:08 chouser: adben: we were just talking about that. :-)

12:09 hiredman: critiquing that

12:10 cemerick: chouser: I'm upbraiding him now. That vector snafu was bad.

12:11 chouser: he's now introducing defstruct

12:11 cemerick: yeah

12:11 we need to get him in here on a regular basis or something.

12:11 chouser: :-)

12:11 * technomancy o O O ( "defstruct?" )

12:12 technomancy: more like self-defstruct, amirite?

12:12 chouser: heh

12:12 underscore in fn name. heehee

12:13 ohpauleez: hahaha

12:14 chouser: but again, these are all fiddly details. The structure of this talk is good and engaging.

12:15 ,(instance? java.util.HashMap {})

12:15 clojurebot: false

12:15 neotyk: ,(instance? java.util.Map {})

12:15 clojurebot: true

12:15 neotyk: but he attracted a lot of people to this meeting

12:16 chouser: yup, fiddly detail. His point was correct, what he actually said was ... close.

12:16 hiredman: maybe I should get clojurebot's twitter transport working so ub can play with clojurebot via twitter

12:16 neotyk: we never had so many new faces in here so far

12:18 scottj: I can't stand his style, in this talk or his smalltalk one. he strikes me as one of those big idea guys that's not concerned with whether the precise details match up with his vision.

12:18 burritoboy: I have installed clojure and clojure-contrib through homebrew but clojure-contrib doesn't seem available when I try requiring through clj

12:19 chouser: scottj: hm, but at least he's at a repl. you can only get so far from the truth and still get things to actually work.

12:19 neotyk: and it was introduction session, way he is building things one on another was nice

12:19 chouser: neotyk: yes, I agree with that.

12:20 hiredman: burritoboy: don't "install" clojure

12:20 burritoboy: hiredman: why not?

12:20 chouser: I've done a couple intro talks recently and while I said fewer things that were untrue, I'm sure it was less interesting.

12:20 raek: burritoboy: that's usually not how clojure is used

12:21 hiredman: clojure is just another project dependency, so you will specify which versions of clojure/contrib in project.clj or pom.xml and your dependency management will get the right version for your project

12:21 chouser: really?

12:21 * chouser learns

12:21 hiredman: clojurebot: lein?

12:21 clojurebot: lein uberjar bug is usually when you don't have a :main specified correctly: http://groups.google.com/group/leiningen/msg/d0a36ae9b92ab1f1

12:21 hiredman: clojurebot: jerk

12:21 raek: burritoboy: use http://github.com/liebke/cljr or http://github.com/technomancy/leiningen or http://github.com/ninjudd/cake to start up clojure

12:21 clojurebot: I don't understand.

12:22 technomancy: clojurebot: forget lein uberjar bug

12:22 cemerick: I suspect burritoboy is already confused. :-(

12:22 clojurebot: leiningen is a build tool designed not to set your hair on fire (http://github.com/technomancy/leiningen)

12:22 * technomancy grumbles

12:22 cemerick: burritoboy: there are getting started guides here for various environments: http://www.assembla.com/wiki/show/clojure/Getting_Started

12:22 hiredman: chouser: regardless of how you do it, using homebrew/apt-get/whatever system package management is clearly a bad idea

12:23 amalloy: yes. apt-get made things a hassle for me before i tried lein

12:23 chouser: :-(

12:23 cemerick: system package managers make a hash of anything java-library-related, AFAICT

12:24 chouser: I'm pretty sure that's java's fault

12:24 but I guess that's where we are, so ... *sigh*

12:24 technomancy: it's the fault of the don't put everything on the classpath mentality

12:24 cemerick: chouser: that's decidedly not the case IMO

12:25 burritoboy: so, I mean if I am just in the REPL and want to use a clojure-contrib lib then, I have to completely redo how I have clojure set up?

12:25 hiredman: you just have to do it right

12:25 if you want it dirt simple

12:25 clojurebot: dirt simple

12:25 clojurebot: http://www.thelastcitadel.com/dirt-simple-clojure

12:25 cemerick: burritoboy: if the contrib jar is on your classpath to begin with, then you can use contrib libs at your leisure

12:25 technomancy: hiredman: heh; syslink

12:26 hiredman: damn it

12:26 I always do that

12:26 burritoboy: ok cool

12:27 raek: burritoboy: clojure-contrib needs to be on the classpath somehow. that's about it. there are vaious ways of handling the classpath and calling java on the command line might not be the simplest one...

12:27 chouser: "there is no looping construct in clojure except calling yourself"

12:27 scottj: while? :)

12:27 technomancy: wat

12:27 mrBliss: scottj: loop

12:28 burritoboy: raek: yeah, right now my CLASSPATH is blank, so I guess that is the only issue

12:28 scottj: mrBliss: oh I think of loop as a fn with recur as calling itself

12:29 chouser: scottj: that's mostly ok. :-)

12:29 hiredman: there was a time when fns weren't recur targets

12:30 chouser: ,((fn f [a & b] (if (zero? a) (f 1 2 3) :ok)) 0)

12:30 clojurebot: :ok

12:30 chouser: ,((fn f [a & b] (if (zero? a) (recur 1 2 3) :ok)) 0)

12:30 clojurebot: java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 2 args, got: 3

12:30 raek: with leiningen, after creating a project: "lein repl", manually: java -cp 'path/to/clojure.jar:path/to/clojure.contrib.jar:path/to/src/:path/to/another/lib.jar' clojure.main

12:31 burritoboy: if you want to "just get a repl", try cljr. you only need to download one jar, then cljr takes care of everything else

12:33 chouser: s/list/seq/

12:34 burritoboy: raek: I have a repl working just fine, I am just to the next step of needing something from clojure-contrib, looks like I need to do a little more config to get that pulled into my classpath

12:35 cemerick: burritoboy: what language/platform are you most familiar with already?

12:35 burritoboy: cemerick: ruby

12:35 cemerick: unfortunately haven't done any java before

12:36 chouser: burritoboy: Steel yourself. It may hurt, but will be worth it in the end.

12:37 cemerick: burritoboy: Unless you want to learn the JVM bits in earnest right now (nevertheless recommended/necessary at some point), I'd point you at cake.

12:38 astoddard: Naive clojure swank question - it looks like having a big classpath results in very slow swank server startup. I should expect this?

12:38 burritoboy: chouser: yeah, thanks I am doing a little 'clojure for beginners' online class

12:38 cemerick: cool, I will take a look at cake

12:39 cemerick: burritoboy: if you're going to be helping anyone with any java or .NET background, I'd suggest you point them at maven + clojure-maven-plugin

12:40 burritoboy: cemerick: I am mostly being helped now, but I will be sure to point those folks that way, thanks

12:40 cemerick: oh, *you're* in the class -- I read your last msg as you were teaching others :-)

12:41 burritoboy: cemerick: ah, no, pupil here (if you couldn't already tell)

12:42 cemerick: You can go a long ways with just clojure core, a command line REPL, and little JVM-specific knowledge.

12:42 chouser: let does not create a var

12:43 burritoboy: cemerick: I am making headway with clojure core, and REPL, I basically know nothing of the JVM though

12:44 chouser: what about binding? ;)

12:44 Raynes: burritoboy: Which one are you? I'm one of the mentors on that class.

12:44 chouser: burritoboy: good question! binding also does not create a var. :-)

12:45 burritoboy: Raynes: Bobby Wilson

12:45 Raynes: LauJensen: Why should that work?

12:46 chouser: burritoboy: perhaps you're thinking of with-local-vars, but that it pretty rarely used.

12:49 LauJensen: Raynes: you know the deal

12:49 Raynes: LauJensen: No, seriously, I don't have any idea what that does.

12:51 chouser: type hints do not do "strong static typing", nor does hinting a fn's formal args make calls to it any faster.

12:52 LauJensen: Raynes: The deal is, if I cant eval code, I mail you :) And that just lets me get a URL or Stream handle to a resource on the classpath

12:52 I have to jet, good weekend everybody

12:53 ohpauleez: chouser: what brought that up? Just reviewing yesterday's lessons? :)

12:53 * Raynes mutters that RT shouldn't be whitelisted to himself and goes on about his business.

12:54 chouser: ohpauleez: I'm making true statements that contradict or clarify things I'm hearing Uncle Bob Martin say on this recording.

12:54 ohpauleez: ohh, gotcha. I couldn't get more than halfway through

12:54 chouser: ohpauleez: oh?

12:55 whew, done.

12:55 ohpauleez: I appreciated how he went about moving through the topics, and I'm happy to see more talks about clojure being done

12:55 chouser: Now I suppose I should collect these notes and do something useful with them.

12:55 ohpauleez: I fully agree.

12:56 scottj: post them in the comments to the video

12:56 ohpauleez: but I didn't like the general tone

12:57 I tend to type hint when I don't have, for readability. Is this a bad practice that I should break?

12:57 mattrepl: if anyone's been using clj-oauth, please let me know. I'm baffled why it worked with Twitter a month ago, but now it doesn't. but it still works fine with other OAuth services

12:57 cemerick: I do the same thing

12:57 ohpauleez: It's usually done when I clean up comments, reorganize, etc

12:57 mattrepl: I'd like to collect a compatibility list so I can make sure bugs are squashed

12:57 cemerick: I'm not pedantic about it, but I certainly do it to clarify ambiguities

12:57 ohpauleez: same here

12:58 scottj: it beats writing a doc string that just relists all the args and what type they are

12:58 chouser: ohpauleez: I would generally recommend against it.

12:58 generally, type hinting things that don't need to by type hinted will not be checked by the compiler

12:58 ohpauleez: chouser: for style purposes or is there an unseen consequence?

12:59 chouser: ,(let [a "5" b 10] (Integer/valueOf ^Integer a b))

12:59 clojurebot: 5

13:00 ohpauleez: right

13:00 so you're argument is they can be misleading

13:00 or all together wrong

13:00 chouser: the type hint there is no better than a comment in it's effect on the compiler, but looks like its code that matters.

13:00 ohpauleez: ah, gotcha

13:00 Raynes: Oh wow. I have a src directory set up like src/clj src/jvm, and when I add src to the git repo with git add, it only sees src/jvm.

13:00 That is *annoying*

13:01 chouser: Raynes: what?

13:01 cemerick: the src/clj dir is probably empty

13:01 chouser: ah

13:01 Raynes: cemerick: Nosir.

13:01 I can't even add it after the fact. It's as if it simply doesn't see it.

13:02 cemerick: well, you can't add directories...

13:02 chouser: git add is recursive by default

13:02 cemerick: nm then

13:02 Raynes: I know, but there is definitely a file in there.

13:02 cemerick: I always use gitx :-P

13:02 scottj: .gitignore?

13:02 chouser: Raynes: do you have an .ignore setting somewhere?

13:02 what scottj said. :-)

13:03 Raynes: Oh, I think I see what might have caused that.

13:03 Yeah, one of my subdirectories is webrepl, and I had that gitignore'd

13:03 Never would have thought of that.

13:04 This was one of those rare cases where I actually touched the .gitignore file.

13:07 ohpauleez: style suggestion: http://gist.github.com/584553

13:08 don't mind the code, it's more or less justa delay

13:08 scottj: I think ^:foo is ^{:foo true}

13:09 stuartsierra: scottj: only in 1.3 onwards

13:09 ohpauleez: ahh, awesome, thank you scottj

13:09 that's ok, I'm using 1.3

13:09 but should it be done in style 1 or style 2

13:10 Chousuke: I like the second one

13:11 looks somewhat like a decorator

13:11 ohpauleez: that was my thought too, weird. But in the if statement, it looked a little funny

13:28 scottj: testers: what are you using to continually run your tests and display readable results?

13:29 s/results/error messages. it can be hard to see differences in not = form, would be nice to have differences highlighted or something

13:29 ohpauleez: scottj: difftest looks cool

13:30 http://github.com/brentonashworth/lein-difftest

13:31 scottj: ohpauleez: sweet, thanks

13:31 ohpauleez: np

13:40 fliebel: Is there a way to get a defn- form another module? I mean… are they private in the Python or the Java sense of the word?

13:41 Raynes: I believe you can refer to a private var in another namespace with #'someprivatevar, can't you?

13:42 chouser: hm... hinting a static fn's args to be primitive may make some calls to it faster.

13:42 Raynes: yeah, #'other-namespace/var-name

13:42 Raynes: Oh.

13:42 hiredman: fliebel: compile time var resolution is blocked by {:private true} in the vars metadata

13:42 Raynes: I knew it was something like that.

13:42 chouser: that's the var itself. precede with @ if you want the value

13:43 fliebel: Let me see

13:43 hiredman: clojure doesn't have modules

13:43 perhaps you mean namespaces?

13:43 fliebel: yea, those :)

13:43 #'works :)

13:43 hiredman: well, say what you mean then

13:44 technomancy: chouser: some tools will show arglists in a more convenient place than the docstring, so I could see a case for putting human-facing type hints there.

13:44 Raynes: Whoa.

13:44 Play nice. :\

13:44 fliebel: hiredman: I was trying to get a private var form another namespace, but #' seems to work. What exactly does it mean?

13:44 testfoobar: Wow, a decent browser-based irc client!

13:45 hiredman: ,(macroexpand-1 '#'foo)

13:45 clojurebot: (var foo)

13:45 hiredman: clojurebot: special_forms

13:45 clojurebot: Excuse me?

13:45 hiredman: clojurebot: special forms?

13:45 clojurebot: excusez-moi

13:45 hiredman: clojurebot: I hate you

13:45 clojurebot: excusez-moi

13:45 Raynes: http://clojure.org/special_forms#var

13:45 technomancy: hiredman: gotta keep your automaton under control.

13:46 hiredman: there is a list of special forms on the clojure website

13:46 clojurebot: special forms |are| http://clojure.org/special_forms

13:46 clojurebot: Alles klar

13:47 unclebobmartin: Am I here?

13:47 cemerick: unclebobmartin: hey, you made it! :-)

13:47 unclebobmartin: <grin>

13:47 All the way from amsterdam...

13:47 cemerick: chouser: got those notes for unclebobmartin ?

13:47 ;-)

13:48 fliebel: unclebobmartin: Missed your talk there :( I was with the Amsterdam Clojurians just the week before.

13:48 cemerick: unclebobmartin: we were talking about your vid earlier.

13:48 unclebobmartin: Yeah, I saw them on twitter.

13:48 I was trying to be kind to the audience.

13:48 I did the presentation before records were added, and haven't changed it yet...

13:48 cemerick: Indeed, usually a good plan.

13:49 chouser: unclebobmartin: I just added some notes to your video.

13:49 unclebobmartin: Cool, thanks. I'll look them over.

13:49 cemerick: unclebobmartin: I found myself in a pedantic mood today, unfortunately. Glad to have you here, in any case.

13:50 unclebobmartin: The business about [1,2,3] being a vector... I understand that the vector is persistent, but I thought you could still pass it to Java as a java vector. Am I wrong about that?

13:50 cemerick: Clojure vectors are java.util.Lists

13:50 chouser: unclebobmartin: as I mentioned here before you arrived, I've given some intro talks recently and appreciated the way you structured yours -- much more engaging.

13:50 cemerick: so, no, you're right about the interop aspect, but there are huge semantic differences

13:51 unclebobmartin: Please go on...

13:51 cemerick: unclebobmartin: about Clojure vectors?

13:51 chouser: I have some details about that in my vimeo comments

13:51 here: http://vimeo.com/15046335

13:51 unclebobmartin: Yes, the semantic differences.

13:51 scottj: is there a predicate for whether a symbol is bound to a var? I'm trying to test if swank is loaded

13:52 chouser: scottj: try resolve

13:52 ,(resolve 'this.is/not-here)

13:52 clojurebot: nil

13:52 cemerick: chouser: I don't see any comments of yours there?

13:53 chouser: ,(resolve 'clojure.core/map)

13:53 clojurebot: #'clojure.core/map

13:53 chouser: cemerick: they ... just deleted them? and closed the comments!?

13:54 unclebobmartin: I'm looking for comments, but I don't see any on the vimeo page. what am I missing?

13:54 chouser: I didn't save them anywhere else, dangit.

13:54 cemerick: unclebobmartin: All clojure data structures are persistent, for one. Second, those that support efficient lookup are also IFns.

13:54 rhickey: unclebobmartin: Clojure vectors are immutable while Java vectors are not. Clojure vectors are more like Java's ArrayLists in interface. But in all cases, Clojure's collections are different from the Java ones, but implement the read-only portion of the corresponding parent interface, i.e. j.u.List/Map/Set

13:54 chouser: I said all this :-(

13:54 cemerick: chouser: moderated?

13:54 chouser: it was visible. looks like it was then deleted.

13:55 rhickey: chouser: in your comments? I can't see without refreshing, but am still watching

13:55 chouser: rhickey: my comments got deleted

13:55 cemerick: rhickey: they're just gone :-|

13:55 chouser: ok, just found a backup. yay vim.

13:55 * ohpauleez cheers for vim

13:56 unclebobmartin: I"m not an irc wiz. can I reply to someone by just using their name and a colon? Is that a convention or does it keep the reply private?

13:56 fliebel: unclebobmartin: It just notifies the author

13:56 cemerick: unclebobmartin: Yup, that's right. that web irc client I linked for you also supports tab-completion of names.

13:56 unclebobmartin: cemerick: Oh, that's nice!

13:57 cemerick: Yeah, it's pretty decent :-)

13:57 I'd suggest colloquy if you're going to use irc more than occasionally, though.

13:58 rhickey: unclebobmartin: I've got to run, but cemerick and chouser are definitive, especially when combined :)

13:58 cemerick: This sounds like a Voltron episode.

14:00 chouser: ok, my comments: http://gist.github.com/584634

14:01 cemerick: I'm so glad you didn't say "power rangers"

14:01 fliebel: I thought I was supposed to put paths together like (clojure.java.io/file "/source" "/dir/" "/index.md") and Clojure would handle the slashes. But it gives me java.lang.IllegalArgumentException: /dir is not a relative path

14:02 _fogus__: Looks like I missed all the unclebob fun :(

14:03 chouser: _fogus__: he's still here

14:03 unclebobmartin: http://gist.github.com/584634 -- in case you missed my earlier link

14:03 stuartsierra: fliebel: 'file' assumes directory slashes between strings

14:04 fliebel: stuartsierra: I figures that… But now I nee to find another solution… Back to string magic, I guess.

14:04 scottj: (when (resolve 'somelib/foo) (somelib/foo)) doesn't work, is there another way to only eval/compile some code if a required lib is already there?

14:04 bobo_: chouser: very nice put

14:04 unclebob: OK, now I'm using colloquy.

14:04 stuartsierra: fliebel: (file (str ...))

14:08 fliebel: stuartsierra: I only need the path, I was using file to avoid having to deal with slashes or not. So just str with some selective striping will do.

14:08 stuartsierra: o

14:08 k

14:10 hiredman: clojurebot: forget?

14:10 clojurebot: you need to put the verb in pipes

14:11 chouser: scottj: (when-let [foo (resolve 'somelib/foo)] (foo 1 2))

14:11 _fogus__: unclebob: Nice talk. Sounded like a fun group and definitely a fun speaker. :-)

14:13 unclebob: _fogus_: Thanks. I enjoy myself a bit too much with those talks.

14:14 cemerick: unclebob: I saw you were using IDEA -- what's your take on the current status of the clojure support there?

14:14 I stay well-versed with the eclipse and netbeans plugins, but I rarely look in on intellij.

14:14 _fogus__: unclebob: It comes through in the audio. I wish that my talks were as effortless.

14:14 hiredman: also saw your trailing parens

14:15 jstirrell`: ok so I have to submit a school assignment and we can use any language so I'm using clojure. are there any problems with just sticking clojure.jar and a clj file in the same directory and calling clojure.main from the command line? does it matter what my namespace is with this structure? I'm running into wierd errors and im not sure if this is the reason

14:16 bobo_: jstirrell`: if you can, i would use leinigen och cake. makes everything easier.

14:17 ohpauleez: jstirrell`: I also suggest leiningen, and just build a jar or uberjar

14:17 Raynes: hiredman: Somewhere near, Greg Slepak is applauding.

14:17 scottj: cemerick: broken in several ways. someone said a total rewrite is coming soon, not sure if reliable

14:17 chouser: jstirrell`: something like java -cp clojure.jar clojure.main assignment.clj should work just fine

14:17 jstirrell`: yeah i normally do, but I was trying to avoid it to make things as simple as possible for the teacher who probably has never even heard of clojure

14:17 cemerick: scottj: hrm, so basically where it's always been :-|

14:18 I'm nearing the point of putting all my eggs in the eclipse basket. Seems like a pretty good bet.

14:18 scottj: ccw is good, and it's the only one that's been updated in many months I think

14:18 chouser: jstirrell`: uberjar isn't a bad idea either. then users only have to: java -jar your-uber.jar

14:19 jstirrell`: k sweet ill try that

14:19 cemerick: scottj: It definitely has a number of contributors. Laurent, cgrand, myself, and a few others.

14:27 _fogus__: So I guess I don't truly understand the format of the Conj talks. 30mins and then?

14:28 chouser: ...then everybody mobs rhickey until the next talk starts.

14:28 _fogus__: Oh, so I guess I *did* understand. :p

14:28 cemerick: _fogus_: I was poking around the same topic earlier. I'm sure a schedule isn't far away.

14:29 chouser: I don't know either, but I expect unscheduled time to be very enjoyable and maybe even productive.

14:29 jstirrell`: anyone know a good place to put the lein file in gentoo?

14:29 hiredman: ~/bin

14:29 clojurebot: It's greek to me.

14:30 jstirrell`: k thank

14:30 chouser: single track should allow for more ad-hoc activities than if people were off in different rooms

14:30 cemerick: I suspect a number of people will have things running on the side in between talks, after lunch, etc.

14:30 I have one pet topic that I'd like to get something around. Hopefully it'll come off nicely.

14:30 chouser: cemerick: yeah, like that. whatever it is. :-)

14:31 _fogus__: I guess my question is, the talks are 30-mins, and then what happens next? Milling around for 30-mins until the next talk?

14:31 I guess I should wait for a schedule.

14:31 bobo_: im going insane on paredit, is there any good video tutorial anywhere? havent found any

14:32 scottj: chouser: valiant effort. couldn't get your way to work for me so used eval, let me know if I missed something http://gist.github.com/584694

14:33 dnolen: bobo_: visual guide here, http://mumble.net/~campbell/emacs/paredit-beta.html

14:33 scottj: hmm, cemerick's pet topic, could it be ide support? :)

14:33 bobo_: dnolen: thanks il have a look

14:33 cemerick: scottj: no, Laurent is going to cover that ably, I'm sure.

14:34 scottj: _fogus__: does 30 min include questions?

14:34 chouser: scottj: no

14:35 ranjit_c: Can somebody help me figure out what I'm doing wrong in trying to use a library?

14:35 chouser: we'll need at least 30 minutes between talks to get the next speaker's laptop working with the projector

14:35 ranjit_c: if i evaluate this : (use '(clojure.contrib.combinatorics))

14:36 and then this: (doc cartesian-product)

14:36 chouser: scottj: doing def-things in eval like that isn't too horrible

14:36 ranjit_c: i get an error

14:36 i'm not sure why

14:36 chouser: ranjit_c: try (use 'clojure.contrib.combinatorics)

14:37 ranjit_c: that worked, thanks

14:37 i was pretty sure i tried that, but i guess no

14:37 t

14:38 arohner: stupid question: how do you build lein? lein uberjar isn't uber'ing for me

14:38 (no jars included in the uber, except lein.jar)

14:40 ohpauleez: arohner: Pull the git repo, and there are hacking directions in there

14:40 eseentially you use lein and lein compile

14:40 use a stable lein, to compile the dev lein

14:40 then soft link your lein command to the new dev command

14:41 and move the old stable lein to lein-stable

14:41 arohner: ohpauleez: I'm looking at the hacking instructions, and I don't see it

14:41 vlaisney: arohner: you need only to get the script, which downloads and compile lein

14:42 arohner: I'm experimenting with a bug fix. I've made the "normal" lein jar, and now I want to make a standalone jar that I can put in ~/.m2, because that's what the bash script looks for

14:43 and the lein uberjar I built doesn't have the dependency jars, but the one I downloaded does

14:43 jstirrell`: ok anyone have any idea why this program isn't working (it prints 0 for all values) as it's supposed to, but if i just put everything in the repl (not in functions) it works fine?

14:43 http://gist.github.com/584718

14:44 arohner: jstirrell`: map is lazy. It only prints when it has to. The repl forces map to print, but your program doesn't

14:44 sorry, it only *evaluates* when it has to

14:44 jstirrell`: so dorun to the maps should fix that?

14:44 arohner: jstirrell`: yes

14:45 jstirrell`: ok thanks! i thought it was something like that

14:47 ranjit_c: okay, so i've still got a problem

14:47 (doc cartesian-product) works

14:47 clojurebot: "clojure.contrib.combinatorics/cartesian-product;[[& seqs]]; All the ways to take one item from each sequence"

14:47 ranjit_c: but for some reason (cartesian-product (1 2) (3 4)) dies

14:48 sivajag: Hi

14:48 ranjit_c: with the error unable to resolve symbol in this context

14:50 actually now (use 'clojure.contrib.combinatorics) doesn't work either

14:50 i get this error: Could not locate clojure/contrib/combinatorics__init.class or clojure/contrib/combinatorics.clj on classpath:

14:51 is there something i'm supposed to configure in setting up the repl?

14:52 chouser: ranjit_c: (1 2) will try to call function 1 with the argument 2 -- not what you want.

14:52 ranjit_c: quoting it didn't help though

14:53 when i tried it before it worked, but i launched swank from within a copy of incanter i checked out from github

14:53 sivajag_: hey

14:53 poincare101: hello.

14:54 ranjit_c: now when i try it in another directory that i created the (use ...) expression throws an error

14:54 chouser: sivajag_, poincare101: hello

14:55 ranjit_c: perhaps you have some relative path (like ".") in your classpath, in which case the directory you start the jvm in will matter.

14:55 ranjit_c: how can i check that?

14:56 i'm a bit rusty with the shell

14:56 i just tried printenv

14:56 i don't see anything named CLASSPATH

14:56 isn't that what i should see?

14:56 chouser: it completely depends on how you start the jvm, I'm afraid

14:56 ranjit_c: ah

14:57 chouser: I'm not yet familier with any of the way kids are starting clojure these days, but people seem to like cake, lein, etc.

14:57 ranjit_c: i think it's being started by the command "lein swank"

14:57 actually i guess it must be

14:58 then i connect from emacs to the repl

14:58 chouser: ah, yes. so lein is managing your classpath for you. just make sure it knows you want contrib, perhaps via the project.clj file?

14:59 ranjit_c: that's what i would have guessed, but when I looked at the project.clj for incanter i don't think I saw an explicit reference to contrib

14:59 i'll check again

14:59 jstirrell`: sorry for all the noob questions, but what's the best way to directly print a unicode value

15:00 _fogus__: ranjit_c: Incanter is modularized, so the core module might not use contrib.

15:01 ranjit_c: oh so i'm able to see contrib because there's a project.clj further down the tree that includes it?

15:01 shoover: chouser: Are you writing your own shell script launchers?

15:01 ranjit_c: yes there it is

15:01 chouser: shoover: not anymore, I promise!

15:01 _fogus__: ranjit_c: Could be.

15:01 ranjit_c: thanks that makes sense now

15:01 shoover: chouser: just asking :)

15:02 chouser: shoover: I just have what I wrote before lein was a twinkle in technomancy's eye. It hasn't broken badly enough yet for me to fix it.

15:02 ranjit_c: i see a reference to clojure itself

15:02 is that really necessary?

15:02 chouser: er, replace it.

15:02 jcromartie: I am saddened by an apparent mismatch between Clojure and typical relational database schemas.

15:03 _fogus__: ,\u30DE

15:03 clojurebot: \マ

15:03 _fogus__: interesting

15:03 jcromartie: or is it just ORMs and Clojure that I'm having trouble grokking

15:03 shoover: what is that?!

15:04 chouser: jcromartie: ORMs are mismatches personified

15:04 jcromartie: yeah, hmm

15:04 chouser: :-)

15:04 _fogus__: jstirrell`: Is that what you mean? ^^^

15:05 jcromartie: hmm, maybe treat the database itself as a ref...

15:05 or a ref-like object

15:05 hiredman: huh

15:05 a database table is like a vector of maps

15:05 where is the mismatch?

15:07 jcromartie: I guess it's not inehrent

15:07 scottj: vector binding supports :as, does it support defaults?

15:07 _fogus__: ,(str \u30DE \u30A3 \u30AF)

15:07 jcromartie: a database could be designed so that rows are immutable

15:07 clojurebot: "マィク"

15:07 jcromartie: or at least as much as possible

15:07 some way of mapping seqs to database tables would be awesome

15:08 like, say, I've got this accounting system, and I'd like to store bills as an initial state and a seq of changes

15:09 pjstadig: _fogus__: what are you up to? :)

15:09 jcromartie: to just be able to deal with the seq of changes in Clojure and then say "save this" would be nice

15:09 and probably totally doable

15:09 _fogus__: jcromartie: http://github.com/brentonashworth/carte

15:11 pjstadig: Originally trying to answer a question, but now just having fun

15:11 jcromartie: very nice

15:11 thanks

15:11 (_fogus__)

15:15 scottj: is there a shorter version of (defn foo [& [b]] (let [b (or b "default")] b))

15:16 other than keyword args

15:16 and multi fntails

15:19 jcromartie: nilfn?

15:19 fnil

15:21 nevermind

15:21 fnil has a fixed arity

15:21 the result, that is

15:22 chouser: scottj: arity overriding looks pretty nice in this case.

15:23 (defn foo ([] (foo "default")) ([b] b))

15:23 overloading

15:23 scottj: yeah, it doesn't scale well to several args though

15:23 jcromartie: I think it would be clean

15:24 scottj: I hate writing the arg names twice just to define a default value for an optional arg

15:24 jcromartie: if you just mean you have 1, 2, and 3 args, etc.

15:25 chouser: you want something like (defn foo [& [(b "default")]] b) don't you

15:26 scottj: yep, or (defn foo [& [b :or {0 "default"}]..

15:27 chouser: (defn foo [& [b :or {b "default"}]] ...) maybe

15:27 scottj: does :or work in vector binding?

15:27 I couldn't get it to work

15:28 hiredman: :or is a feature of associative destructuring

15:29 [] is for sequential destructuring

15:32 scottj: [] is associative (I know I know)

15:33 hiredman: as a datastructure vectors are associative

15:33 but as a binding form, they are for binding sequential things

15:33 destructuring form rather

15:33 if you want to destructuring something in an associative way use a map desctructur

15:43 bhenry: don't forget clojure.contrib.def/defnk. (defnk foo [positional args :keyword-args "default values"] ...)

15:45 chouser: I think you used to be able to destructure vectors on their indexes, but keyword destructuring took over that syntax

15:45 I'mnot sure.

15:47 hiredman: ,(let [{a 0 b 1} [:A :B :C]] [a b])

15:47 clojurebot: [:A :B]

15:48 hiredman: you can destructure a vector associatively just fine

15:48 scottj: bhenry: but can you invoke a fn from defnk with one optional arg w/o giving a keyword?

15:48 chouser: hiredman: oh, indeed. what was I doing?

15:49 oh, but not the seq that & makes for you, of course.

15:51 hiredman: of course, because it's a seq and not associative in anyway

15:51 chouser: right. I don't know what I was thinking.

15:52 what was that proposed syntax for expressions on the left side

15:52 -> I think.

15:52 sexpbot: java.lang.Exception: Unable to resolve symbol: I in this context

15:53 hiredman: huh?

15:53 chouser: (defn foo [& [(-> (or "default") b)]] b)

15:53 hiredman: eww

15:54 Raynes: o.o

15:54 chouser: heh. I wrote a patch and everything

15:55 but even those of us who were strangely attracted to it knew it wasn't good.

15:55 hiredman: I'm still reeling, tried to get clj-nstools used at work and was shouted down

15:55 chouser: by clojure users?

15:55 hiredman: phil and I even used user.clj to monkey patch clojure.core so ns+ would be available everywhere without an extra use

15:56 yes

15:58 scottj: how do you get lein to user user.clj for repl, swank, test?

15:58 hiredman: you put it in src/

15:58 clojure RT loads it

15:59 scottj: oh I was thinking ~/.clojure/user.clj

15:59 hiredman: clojure RT loads the first user.clj it finds

15:59 fliebel: hiredman: How do you monkey patch something in Clojure?

15:59 hiredman: very carefully

16:00 Raynes: You just need to have access to a monkey and wear and eyepatch.

16:00 an*

16:00 hiredman: with great panache

16:00 with style and grace

16:00 very well

16:01 chouser: (doc intern)

16:01 clojurebot: DENIED

16:01 chouser: ,(doc intern)

16:01 clojurebot: DENIED

16:01 chouser: heh

16:01 not that way, apparently

16:11 fliebel: I fixed a few things in Ring, how can I get Leiningen/Cake to use it?

16:11 lancepantz: fliebel: put it on clojars

16:12 fliebel: lancepantz: Can I just upload my own version, and still call it Ring? Sounds like a confusing action.

16:13 dnolen: fliebel: you can run lein install, no need to push to clojars.

16:13 lancepantz: yes, you just have to change the project.clj of your version to include your group id

16:13 then qualify the dependency with your group id

16:14 fliebel: dnolen: I'll try that first...

16:14 lancepantz: yeah, dnolen's suggestion is easier i suppose

16:16 ninjudd: fliebel: subprojects in cake will also handle that (or 'cake install' for that matter)

16:19 fliebel: ninjudd: What does subprojects do?

16:20 ninjudd: let's you specify a location for the git checkout of a project and pull the dependency from there instead of from clojars

16:21 fliebel: just add something like this to .cake/config

16:21 subproject.ring = /home/fliebel/code/ring

16:22 then do 'cake deps force' whenever you change the code in /home/member:fliebel/code/ring

16:22 arohner: does anyone else occasionally get NPEs when running lein deps?

16:22 fliebel: ninjudd: Useful :) i did it with lein install now

16:22 tesing...

16:24 eshira: hi, im trying to install labrepl. i did a git clone and lein upgrade. but when I do a lein deps, i get these errors: http://gist.github.com/584880

16:24 any ideas?

16:24 bobo_: looks like the jar has gone missing

16:25 hm

16:27 eshira: which one? i don't understand the error message.

16:27 itext?

16:27 bobo_: it cant find itext.jar in any of the maven repos it knows

16:27 what you can do is find that jar somewhere, and use the mvn install command listed in the error

16:28 but you shouldnt have to.

16:28 hiredman: best to complain to the authors that their dependencies aren't right

16:29 bobo_: the jar is there. can you try again eshira ?

16:29 http://repo2.maven.org/maven2/com/lowagie/itext/1.4/

16:29 jstirrell`: if I have a few vars which i just need to increment based on what each character is in a text file, using an agent is ideal right?

16:30 dnolen: jstirrell: why not some atoms?

16:30 jstirrell`: yeah that's what I had originally, just checking

16:31 dnolen: ,(let [x (atom 0)] (swap! x inc) @x)

16:31 clojurebot: 1

16:31 jstirrell`: i was just thinking that the inc could be asynchronous

16:31 eshira: bobo_ i get the same thing

16:32 dnolen: jstirrell: why would it need to be async?

16:32 bobo_: eshira: i belive it worked for me. weird :-/

16:32 jstirrell`: it wouldn't need to be, but it could be? just figured it might be a minor optimization to not block since it's not really necessary

16:33 bobo_: eshira: http://repo2.maven.org/maven2/com/lowagie/itext/1.4/itext-1.4.jar does that link work for you?

16:33 eshira: yep..

16:35 whoops , i didn't include the whole error: http://gist.github.com/584905

16:37 bobo_: im clueless :-(

16:41 eshira: i really want to just kill all my clojure dependencies and libs and start over. i've tried so many different management toools that i bet i have some weird dependency issue

16:41 bobo_: eshira: if you want to remove all maven crap, its in ~/.m2/repositories

16:42 rm -r ~/.m2/repositories is harmless unless you pay for bandwidth :-)

16:42 repository not repositories

16:46 eshira: hah, that worked. rm -r ~/.m2/repository and then lein deps

16:46 who knows what went wrong before.. oh well

17:03 DASONIX: I am here

17:08 hello anyone?:

17:08 anyone here?:

17:08 dakrone_: yes, there are many people here

17:09 ohpauleez: DASONIX: what's up. Just looking for people or do you have a specific question

17:09 DASONIX: good. I'm testing out the clojure irc script... not sure if anything I was typing was making it into the channel :-):

17:09 ohpauleez: ah

17:09 cool

17:10 DASONIX: http://nakkaya.com/2010/02/10/a-simple-clojure-irc-client/:

17:10 loaded it into the REPL and it just works :-):

17:11 speaking of which though. People at my work are excited about clojure. Any good starting points? websites?... I still don't know wth i'm doing, hehe:

17:12 amalloy: labrepl?

17:12 or you could talk to Laujensen about conj-labs if you happen to be in europe

17:13 ohpauleez: DASONIX: amalloy is spot on. Labrepl is a good start: http://github.com/relevance/labrepl

17:13 amalloy: also, the only clojure book i've read was The Joy Of Clojure, so while i can't give a comparative analysis i thought it was quite helpful

17:13 ohpauleez: 2 for 2, I love The Joy of Clojure

17:13 amalloy: and if you/they don't have a grounding in functional programming already, SICP is an excellent resource

17:14 DASONIX: Awsome, yeah i've got a subscription to safari books, I'll have to see if they have it:

17:14 ohpauleez: amalloy: it's as if you're reading an auto response from my brain

17:14 haha

17:14 amalloy: TJOC is still in electronic form; not published yet

17:14 DASONIX: I had a college in course in lisp/scheme years ago... probably could use some freshening up though:

17:14 ohpauleez: it's a Manning Publishing book

17:15 DASONIX: you may be fine with just using labrepl

17:15 amalloy: and SICP is free online: http://mitpress.mit.edu/sicp/

17:15 Raynes: 3 for 3, Joy is awesome.

17:16 DASONIX: We use groovy/grails at work mostly these days.. but some people are beginning to migrate towards finding similar uses for clojure:

17:17 ohpauleez: Clojure + Ring + Moustache/Compojure + Enlive/Hiccup is an amazing stack

17:17 I've had great experiences rolling out solutions and deploying them

17:17 I've even done a system that was half in Python (using Pylons) and half in Clojure (using Moustache), that was just a dream to deploy, scale, and maintain

17:18 and it also handled financial transactions

17:19 amalloy: ohpauleez: what on...that is too many tools i don't know about. tell, tell!

17:19 ohpauleez: DASONIX: Another example of power... I wrote a fully parallel (simple) job queue in 8 total lines of clojure. It took maybe 15 minutes to write and maybe 15 minutes toying at the REPL

17:19 DASONIX: you being serious about the 'dream to deploy'?:

17:19 ohpauleez: totally

17:20 with lein, it's dead simple

17:20 DASONIX: I remember in that college class, functional programming languages could have massive massive precision... hundreds and hundreds of digits :

17:21 ohpauleez: amalloy: what specifically do you want to hear about. I'd love to share any bits of knowledge

17:22 DASONIX: I guess at this point I need to learn the language better :-) :

17:22 ohpauleez: labrepl is a great way

17:22 Very gentle learning curve

17:23 DASONIX: I just basically installed clojure through mac ports :

17:23 amalloy: ohpauleez: well atm i'm not really doing anything in particular. developing a back-end application with no interesting front-end. so i don't need eg compojure, but i don't know what any of the other tools are. are there any you think would be interesting to me given my setup?

17:24 ohpauleez: amalloy: I really like Moustache if I'm building more of RESTful service. Moustache is really just a routing framework, but it lets you do some interesting things

17:24 it's also just a Ring middleware, and it can wrap around any other Ring Middleware

17:25 Enlive is pretty nice for templating.

17:25 As far as community and help goes. There's a dedicated Clojure-web google group

17:26 Compojure html facility is called hiccup, which I've only played with a little, but want to really use in a pet project

17:28 I've done a few different deployment structures: from just the simple run-jetty, to putting a few jetty instances behind NGINX (doing load balancing), to war deployment in tomcat

17:28 I've recently started playing with aleph (asynchronous server technology for clojure)

17:29 once I got my head around it all, it's been pretty nice and am writing a routing library for it

17:31 amalloy: heehee, hiccup

17:31 thanks ohpauleez

17:32 ohpauleez: amalloy: np. Glad to share anytime

17:34 Raynes: (doc map)

17:34 clojurebot: "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."

17:35 _Vi: "Clojure 1.2 is released!" Why there is no refs/tags/1.2.0 in git repo?

17:36 amalloy: http://github.com/clojure/clojure has a tag 1.2.0

17:37 _Vi: amalloy, OK, found. I was using the wrong repository.

17:37 amalloy: _Vi: i had the same problem not too long ago

17:37 Raynes: Somebody should throw the new repo into the title.

17:37 The topic*

17:38 _Vi: Was it "git://github.com/richhickey/clojure.git"?

17:38 Chousuke: yeah

17:38 the url just changed, the repo is still the same :)

17:40 the url is pretty easy to update by editing .git/config

17:40 _Vi: Chousuke, Already done. Set this as "origin" remote and previous URL as "richhickey" remote.

17:41 Chousuke: or git config remote.origin.url url-here

17:41 _Vi: git remote rm origin && git remote add origin http://github.com/clojure/clojure.git # cleaner way

17:42 Chousuke: wonder if that messes with the tracking branches :/

17:43 _Vi: The answer to the mess with "tracking branch" is just don't use tacking (no "pull", always fully specified "push"). But this discussion is for #git channel.

17:43 Chousuke: I find tracking useful

17:44 especially with multiple remotes.

17:44 jjido: is there a way to exit a reduce?

17:44 Chousuke: though I guess you could always use remote/foobranch when you need the remote

17:44 jjido: throw an exception :P

17:45 jjido: Chousuke: is that costly?

17:45 Chousuke: probably

17:45 unless you preallocate the exception

17:45 jjido: I will still do it for now

17:45 Chousuke: but a better way is probably not to use reduce or write a version that allows short-circuiting somehow

17:47 ryszard_: hello

17:47 I am trying to install Leiningen

17:47 I followed the instructions in the readme

17:47 amalloy: ryszard_: on what OS?

17:47 ryszard_: but I am getting this:

17:47 and I am getting this

17:47 http://gist.github.com/585008

17:48 (MacOs X)

17:49 amalloy: ryszard_: i think leiningen relies heavily on bash. i imagine it's clever enough to switch shells for you, bu there could be some issues getting the env vars set up right

17:50 ryszard_: amalloy: I guess that the script itself shouldn't be affected... It uses /bin/sh

17:50 amalloy: however, I suspect this might be a CLASSPATH issue

17:52 sivajag_: ryszard_: did you do lein self-install?

17:53 this task will install all needed jars

17:53 amalloy: ryszard_: yes, self-install is an important step that's easy to forget

17:53 ryszard_: sivajag_: yes, I tried it

17:53 it gives me the exact same error

17:53 amalloy: you can edit `which lein` and add in something to make it echo the classpath, by changing JAVA_CMD from java to echo

17:54 if you can see the actual command line it's using that might give you a clue

17:56 sivajag_: ryszard_: self-install is the task that will download lein jars to your local maven

17:56 ryszard_: sivajag_, amalloy: the CLASSPATH is ::src/:

17:56 sivajag_: the error u r seeing is that lein-standalone jar is missiing

17:56 can u paste the error u get when u do lein self-install

17:57 ryszard_: sivajag_: lein self-install finishes w/o an error

17:57 sivajag_: also can u check whether you have lein jars under

17:57 $HOME/.m2/repository/leiningen/leiningen/

17:58 ryszard_: sivajag_: however, when I try to run lein after it, the error from the gist occurs

17:58 sivajag_: There's /Users/ryszard/.m2/repository/leiningen/leiningen/1.2.0/leiningen-1.2.0-standalone.jar

17:59 sivajag_: what command are you trying to do?

17:59 lein new?

17:59 ryszard_: yes

18:00 sivajag_: in error message

18:00 it looks like u types "lein"

18:00 can you type "lein new"

18:01 ryszard_: sivajag_: same error :(

18:01 sivajag_: lein version

18:01 mm

18:01 can u type "lein version"

18:01 _Vi: Is (read ...) secure? Can we feed data that anonymous send to socket into it?

18:02 scottj: hmm. easy way to pull out the <body> of a string that's html but might be "<p>foo</p>" or "<doctype...head..body..." (e.g. html email). enlive doesn't appear to wrap html in html/body if it's not there

18:02 _Vi: I don't think so

18:03 _Vi: scottj, What can it do? (Input length is limited)

18:03 sivajag_: ryszard_: can u type the output for "lein version"

18:04 _Vi: How to deserialize data from insecure source in oneliner?

18:05 ryszard_: sivajag_: same error. I am pretty convinced my classpath is wrong and the stuff installed by maven is not seen by my java.

18:07 scottj: _Vi: (read-string "#=(println \"here's the trick\")")

18:08 _Vi: Reader macros? Is there way to force reader into some basic always-the-same syntax (where data expected to come, not code).

18:08 sivajag_: ryszard_: the thing lein should load lein jars and clojure jars from maven repo

18:08 scottj: _Vi, I think the bot here has something like that written, it may be a library somewhere

18:09 sivajag_: ryszard_: so I am not sure how the classpath could be bad if u r running using lein

18:09 ohpauleez: Raynes: Can you comment on ^?

18:09 sivajag_: also I am not sure why it is trying to download lein when u just type "lein"

18:09 ohpauleez: ie: on _Vi's request

18:10 Raynes: There is a sandbox library called clj-sandbox that powers sexpbot's Clojure evaluation.

18:10 _Vi: scottj, So there is no easy way to get some structured data from user without opening vulnerability, right?

18:10 Raynes: $google clj-sandbox

18:10 sexpbot: First out of 183 results is: Licenser's clj-sandbox at master - GitHub

18:10 http://github.com/Licenser/clj-sandbox

18:11 sivajag_: anyone has suggestion for a good xmpp library?

18:11 ohpauleez: _Vi: ^

18:11 Raynes: It isn't perfect, but does the trick.

18:11 ohpauleez: Thanks Raynes

18:11 _Vi: Raynes, "isn

18:12 Raynes: (binding [*read-eval* false] (read-string "#=(println \"here's the trick\")"))

18:12 scottj: ^

18:12 _Vi: 't perfect" means "there can be vulnerabilities" or slow or something else safe?

18:13 Raynes: _Vi: It's generally pretty safe. When vulnerabilities are found, they're fixed. There haven't been any found in a while though.

18:13 You can take advantage of the JVM's own sandbox, and construct a sandbox that is as safe or as vulnerable as you want it to be.

18:14 _Vi: At least if there are ways to inject code when reading using "[*read-eval* false]" then they are considered Bugs, not Features and got fixed as security issues, right?

18:24 SirNick: If a function's body defines a macro and that function is not called until runtime, can the macro still be expanded at runtime even though it's after compilation? Or does this cause more compilation?

18:24 chouser: macros aren't expanded at runtime unless you call eval or something

18:25 amalloy: however you declare a macro, it is accessible at (and only at) compile time, in whatever scope the declaration has

18:26 what use case did you have in mind?

18:27 SirNick: I didn't really have a usecase exactly, I was just wondering if there was any reason that would cause on the fly compilation during runtime in some way.

18:27 amalloy: (eval) is pretty much it

18:28 SirNick: Awesome, thanks

18:28 _Vi: "(defn foo [x] (foo x))" ; Why doesn't it warn that "(recur x)" should be used?

18:28 amalloy: because maybe recur x shouldn't be used....?

18:29 _Vi: amalloy, I don't mean this particular function, I mean any function calling itself in a tail position.

18:29 amalloy: especially for lazy sequences, you can't use recur

18:30 ,(source iterate)

18:30 clojurebot: java.lang.Exception: Unable to resolve symbol: source in this context

18:30 thunk: ,(clojure.repl/source iterate)

18:30 amalloy: ,(clojure.repl/source iterate)

18:31 clojurebot: Source not found

18:31 Source not found

18:31 amalloy: clojurebut: lame

18:31 man, i can't even spell clojurebot. guess i'm the lame one

18:32 -> (clojure.repl/source iterate)

18:32 sexpbot: java.lang.ClassNotFoundException: clojure.repl

18:34 kennedywm: Anyone using clojure-clr?

18:35 hiredman: ~def iterate

18:42 _Vi: I.e. is "if we can change tail call to 'recur' and it gives no compiler error then we should change it to 'recur'" holds?

18:42 *Does "..." hold?

18:48 Raynes: -> (doc defn)

18:48 sexpbot: ⟹ "Macro ([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ([params*] body) + attr-map?]); Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with a... http://gist.github.com/585094

18:48 Raynes: There we go. Pretty doc formatting.

18:49 And I totally didn't steal most of that formatting from clojurebot.

18:49 curiouscat: test

18:53 amalloy: _Vi: this comes up fairly often. i'm newish to the clojure community, and what you say makes sense to me. however, i'm pretty sure this has been discussed and declined lots of times

18:54 _Vi: one of the issues is that if the compiler magically converts naive recursion into TC for you, you run the risk of writing code you think is TC but actually is blowing up the stack. the manual (recur) vs (myfunc) makes you think about the difference, and notice when you do it wrong (ie recur illegally)

18:56 jjido: amalloy: what I miss is recur for an enclosing function

18:56 technomancy: what I want is for :| to be an alias for recur

18:56 for the musicians in the audience

18:57 amalloy: jjido: we're waiting for the JVM to implement general tail-call optimization so we can just use theirs, aren't we?

18:57 jjido: (fn [x] #(recur (dec x)))

18:57 technomancy: also we need to raise funds to hire John Rose as a hacker-errant so he can work on awesome JVM features like TCO instead of what his oracle overlords tell him to do.

19:00 hiredman: jjido: not possible given the way functions are implemented and the limitations of the jvm

19:00 checkout trampoline

19:00 jjido: hiredman: yeah thanks

19:01 _Vi: amalloy, ... and people that have got used to real TCO are usually experienced and thinking (Lisps, Schemes, dignified and complicated...) and will cope with the difference, right?

19:01 jjido: what can I do with a quoted value?

19:02 hiredman: clojure totally needs generally TCO, I would use that all the time

19:02 jjido: ,(doc unquote)

19:02 clojurebot: "; "

19:02 hiredman: jjido: a quoted value is the value

19:02 _Vi: hiredman, Means it is unlikely they will do "novice mistakes" of forgetting about "(recur)".

19:03 hiredman: _Vi: recur is there because the general case is currently not possible without using a different call stack which would run counter to clojure's host integration goals

19:04 _Vi: /* Imagining Clojure as some beast which has lost it's tail in some accident */

19:04 ohpauleez: chouser: ping

19:05 _Vi: hiredman, I mean the necessity of doing compiler warning for non-using of "recur".

19:05 hiredman: because it's not always a mistake

19:05 so warning is ridiculous

19:06 if you want to calla the 3 arg body from the 2 arg body of a multifn, you would get a warning

19:06 same for multimethods, etc

19:07 ohpauleez: Has anyone else documented 'show' being broken in 1.3? http://gist.github.com/585121

19:07 _Vi: hiredman, Where is it ridiculous? Can you give an example? Why deliberately non-use of "recur"?

19:07 jjido: hiredman: if the quoted value is '(1 2 3), I can use it as a list. If it is '(fn [] 42), I cannot execute it?

19:09 hiredman: that is also a list

19:09 mrBliss: jjido: use (eval '(fn [] 42))

19:09 hiredman: _Vi: I just gave 2

19:09 mrBliss: that won't execute it, that will turn the list into a function object

19:10 jjido: mrBliss: thanks!

19:10 hiredman: then it is just one step away from being executed...

19:12 _Vi: hiredman, Don't see them (having looked at answers about multimethods and multifn and this is not that). It should where we technically can put "recur" instead of some function call, and "recur" will use that function, but we don't need it.

19:13 hiredman: _Vi: well, I have answered your question, if you don't understand the answer the deficiency lies with you

19:13 _Vi: hiredman, (Still thinking that if we can change some call to "recur" that points to the same thing then we should do it)

19:31 jjido: can I use eval to do contextual scoping?

19:38 eshira: I'm using lein. I :dev-include org.clojars.brandonw/lein-nailgun "1.0.0" and then lein deps. Every other "lein deps" works w/o error, but the other ones end up with: http://gist.github.com/585147 . any ideas?

19:42 and so naturally "lein nailgun" runs but then running vim, I get this: http://gist.github.com/585151

19:50 lazy1: eshira: If you find the solution, let me know :)

19:52 eshira: hah, will do. anyone had success w/ lein-nailgun here

20:12 jjido: can a struct refer to itself? (Java this)

20:23 hiredman: jjido: how could that be possible?

20:23 technomancy: eshira: I've seen that bug elsewhere. very rare, but it's consistently reproducible

20:24 eshira: http://github.com/technomancy/leiningen/issues#issue/105

20:24 possibly an obscure maven bug?

20:25 I don't have anything helpful to say except you're not the first to run into this.

20:25 jjido: hiredman: (let [x (struct mystruct :myself this)] (:myself x))

20:29 _Vi: VimClojure instruction. "\sr (should open a new window)". How to press '\sr'? Is it literal \, S and R?

20:34 eshira: technomancy: thanks, that helps. it prevents me from wasting more time on it ;)

20:35 _Vi: yes, it is "\", or whatever your vim command key is

20:35 _Vi: eshira, Probably I need to install "Gorilla" to make it work.

20:36 eshira: _Vi good luck. I've gotten vimclojure to work once a long time ago, but then I upgraded some things and now my set up is broken

20:36 _Vi: Isn't there a comprehensive guide to install VimClojure (with all deps)?

20:36 eshira: also, if you're using the latest vimclojure (2.2.0-SNAPSHOT), the instructions found at http://kotka.de/projects/clojure/vimclojure.html is outdated I'm pretty sure

20:37 _Vi: "You need a Ruby enabled Vim" Ruby? Dependency hell...

20:37 eshira: I wished. If I ever get the perfect vim + clojure setup then I will write it up, but so far it's just been hours of going in circles

20:38 lancepantz: i just gave up and switched to emacs

20:38 would recommend the same to anyone

20:39 emacs has viper mode- modal, with vim chords- if you want to ease into it

20:39 _Vi: lancepantz, (From emacs I remember only "Ctrl+X, Ctrl+C". I've tried to learn it three-four times, unsuccessfully)

20:39 lancepantz: but even a fully functional vimclojure doesn't compare to slime

20:40 _Vi: lancepantz, Is emacs/slime considered the primary IDE for Clojure?

20:40 lancepantz: by far

20:41 eshira: yeah i might have to do that, at least until vimclojure catches up (which I'm sure it will). but i love vim so much. it will be hard

20:41 lancepantz: 62%, http://cemerick.com/2010/06/07/results-from-the-state-of-clojure-summer-2010-survey/

20:42 ninjudd and myself work on a project called cake, that is ripe for non-emacs integration, it has a persistent vm that's a bit cleaner than nailgun

20:42 some people have been integrating it with textmate

20:43 if one was to take the time, you could get a pretty killer vim integration, but i'm probably not going to be that one :)

20:44 Raynes: lancepantz: Me either. Not until someone writes a Clojure to VimScript compiler.

20:45 lancepantz: http://chasemerick.files.wordpress.com/2010/08/5.png?w=500&h=300

20:45 Raynes: That's a handsome 404 page.

20:47 lancepantz: yeah, ninjudd just told me that, must be in my browser cache

21:27 joegallo: I'm writing a "cleanup my use declarations" function in elisp, http://gist.github.com/585230, does anyone have any advice?

21:27 I don't really have tons of elisp experience.

21:27 bhenry: here's my advice http://github.com/technomancy/durendal

21:28 joegallo: Blast!

21:29 bhenry: although ns-cleanup is still on the to-do. perhaps you could use it as a starting point.

21:30 rickmode: is there a way to do something like instance? or isa? with a protocol?

21:31 nevemind... just saw extends?

21:36 chouser_: rickmode: see also satisfies?

21:40 rickmode: chouser_: ya ... that's the one that seems to work... thanks

22:04 lazy1: I there a library like hiccup to generate XML?

22:08 Raynes: lazy1: There is some stuff in contrib: http://clojure.github.com/clojure-contrib/prxml-api.html

22:08 Not sure if there is anything hiccup-like.

22:08 Oh, I guess it is.

22:08 Neat.

22:19 lazy1: Thanks

22:21 This prints to *out*, can you remind me what should I bind *out* go get a string?

22:27 chouser: just use (with-out-str ....)

22:28 lazy1: Great

23:13 brehaut: is there a clojure feed generation library (RSS, Atom) anywhere?

23:22 in answer to my own question: laujensen's bestinclass.dk has a simple solution in templates.clj

23:53 eshira: lazy1: i got vimclojure working: http://groups.google.com/group/vimclojure/browse_thread/thread/69abeea9f57cb73b/9360432c165c2beb?lnk=gst

23:58 technomancy: joegallo: wow... the timing on that is crazy

23:59 joegallo: I didn't get it to sort long lines that had to wrap though; that would be a neat trick. does yours do that?

Logging service provided by n01se.net