#clojure logs

2009-03-13

00:00arohner_amap, areduce, etc
00:00arohner_see the java interop section of clojure.org
00:00RaynesWhy hasn't Rich released a new version yet? You'd think with all the huge changes he would because there is no telling how many people are downloading the old version and doing stuff with it only to find out their code is no longer compatible with new clojure.
00:00Guest46760arohner_: will do. thx
00:04cooldude227it would be kinda nice to have releases more often. that way, most people can be working off the same point
00:05cooldude227without missing out on big stuff
00:05ChouserI think he doesn't like the overhead of a release -- bring the docs up to date, do the build, package, collect changelogs, announce, etc.
00:06cmvkk_what's the plan anyway? is there going to be a 1.0 or something? just 'eventually'?
00:06cooldude227sounds right, that stuffs totally bitchy
00:06rzezeskicooldude227, I think Howard Lewis Ship setup a nightly build at some point, maybe people could use that. Although I imagine Rich has reasons of his own for why it is the way it is
00:06durka42if you're going to use a "nightly", just use svn
00:06cooldude227or git
00:06cooldude227:)
00:07cmvkk_but then you have to have ant!
00:07Chouserthe major version number will be based on the years since release
00:07rzezeskiwell what I'm saying is...for people who don't want/cant build it, or pull from git (my company network blocks git) then there is a common place people can pull binaries from, and the zip name could have a timestamp built into it so people can easily compare what they have
00:07durka42like C++0x?
00:07Chouserso for it to still be called 1.0, he's got to get it out by Nov 2009.
00:08ChouserI think.
00:08cmvkk_I....kind of get it?
00:08RaynesI don't.
00:09Chouserthe minor will count the number of releases within that year
00:09cmvkk_but the next release will start with 1, or what? because this last release didn't have version numbers or anything.
00:09rzezeskibecause they weren't really releases, more like "snapshots"
00:09Chouserso the first stable release before Nov will be 1.0, then 1.1, 1.2, etc. The first stable release after Nov will be 2.0
00:10cmvkk_and that seems like a bad release policy. majors are for major changes, etc. Why bother changing the major if the code isn't any different?
00:10Chouserunless of course he changes his mind before then.
00:10cmvkk_and what if you want to change the code a lot during the middle of the year?
00:10RaynesThat's just... Unnecessary.
00:11durka42i agree, seems a little arbitrary
00:11Raynes"Experimental 2.0 release" I always hated those.
00:11cmvkk_anyway, is there a 'road map' to the next release? Things that need to get coded/decided?
00:11p_lRaynes: Talking about Oracle? xD
00:12cmvkk_obviously if things like the lazyness change are still going on, it's too early to be setting things in stone.
00:12Raynesp_l: Nope, lots of other stuff.
00:12p_land yeah, releasing a very untested thing as 2.0, like Oracle, is a bad idea
00:13rzezeskiDoes anyone know if Stu has a set release date for his book? Is he still waiting on 1.0?
00:13durka42i thought there was a deadline, maybe May?
00:14RaynesApril last time I checked.
00:14Chouserhttp://clojure-log.n01se.net/date/2008-10-14.html#09:53
00:14RaynesI still say that Stu jumped the gun big time writing a book so early.
00:15RaynesImagine if Rich hadn't hacked out the fully lazy implementation in time. And he almost didn't. :|
00:16cmvkk_Chouser, I see. Wouldn't that make the current release 1.0 then?
00:16cmvkk_since it was the first release after that thursday.
00:16rzezeskiRaynes, OTOH, having a book so early could help adoption
00:16rzezeskiI guess it's a double edged sword of sorts
00:16Raynesrzezeski: That cuts both ways.
00:17RaynesNot much use for a book if everything in it is outdated next year :p
00:17Chousercmvkk_: *shrug*
00:17rzezeskibut at some point, Clojure needs to stabilize, and not let perfect get in the way of good
00:18cmvkk_yeah. when i talk about the future, i'm mostly wondering what breaking changes have yet to occur.
00:23arohner_can I call alter inside an alter?
00:25hiredmanarohner_: ew
00:25cooldude227sounds like trouble
00:25arohner_yeah, that's what I was thinking
00:25arohner_turns out I don't need to
00:26cooldude227good
00:40RaynesI predict myself learning factor in the far future "just cuz".
00:40duncanmi'd like to learn a stack-based language
00:41RaynesI just want to learn it because it looks so fuckin' cool.
00:41duncanmlooks?
00:41RaynesOf course if Clojure never makes it mainstream factor wont even be in the books, but still, it looks awesome.
00:42RaynesThe postfix syntax, the heavy documentation and the dinosaur on the front page all conspired to make me put it on my "Tolearn" list.
00:46cooldude227factor is a fun language, and it has libraries for EVERYTHING
00:46cooldude227the emacs mode, fuel, is almost as good as SLIME
00:46duncanmi'm surprised - who writes them?
00:46cooldude227a lot are from slava himself, but there are quite a few from other random people
00:50RaynesIs factor everyones secret pleasure or something?
00:50Raynes:o
00:50RaynesI don't see any electronic ink about it :\
00:51RaynesOh, it's newer than I thought. 03.
00:51cooldude227dealing with stack is really hard to wrap your head around
00:51RaynesI predict the userbase skyrocketing in 2070 long after I'm dead.
00:51cooldude227s/stack/the stack/
01:05RaynesA guy on stackoverflow.com replied to a post "Will you ever use factor?" with this: fun for aside language based stack a in point the see don't I but, Forth resembles it and briefly Factor studied I
01:05Raynes(apply str (reverse (interpose " " (.split "fun for aside language based stack a in point the see don't I but, Forth resembles it and briefly Factor studied I" " "))))
01:05Raynes,(apply str (reverse (interpose " " (.split "fun for aside language based stack a in point the see don't I but, Forth resembles it and briefly Factor studied I" " "))))
01:05clojurebot"I studied Factor briefly and it resembles Forth but, I don't see the point in a stack based language aside for fun"
01:05RaynesI always forget that darn ,
01:06p_lheh. till one starts working in various small environments, I guess... Open Firmware etc.
01:08hiredmanfreebsd's boot loader is in Forth
01:08hiredmanor at least one stage of it is
01:10durka42http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/boot/forth/
01:12hiredman~google freebsd forth boot
01:12clojurebotFirst, out of 8470 results is:
01:12clojurebotThe Boot Process (FreeBSD) � UNIX Administratosphere
01:12clojurebothttp://administratosphere.wordpress.com/2008/03/01/the-boot-process-freebsd/
01:16RaynesWhoa.
01:16RaynesSlava Pestovs home page has a total of 4 views since 1994.
01:23durka42from that link -- if the kernel fails to load, you a get a forth prompt to fix it
01:24hiredmanthere are a few different prompts you can end up at
01:24p_lmany big iron systems have that capability
01:25hiredmanbig iron like my msi wind
01:26p_lWell, I'm pretty sure it runs a backward-compatible BIOS for IBM-PC :P
01:26p_lthat doesn't mean that FreeBSD can't use it's much more powerful bootloader :)
01:26p_land frankly speaking, "config mode" is a great function to have
01:28p_lit's great when instead of going nuts when my VMS install refuses to boot, I only have to change the boot command to BOOT/R5:1 and it will drop me in config manager
03:26Mechow would i do something like (apply and '(true true false))
03:27Cark,(doc every?)
03:27clojurebot"([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
03:27Mecah hah, thanks
03:31RaynesWhy do all good ideas come in while you're in bed and half asleep?
03:33Mecbecause you're not thinking as "clearly" so you're not constrained to your normal thought processes
04:09Mecis there a library function that calls a function with an initial value, then calls the funciton with the result, and again on the result, and putting them all in a list?
04:11Puzzleriterate
04:11Mecoo nifty, thanks
04:12Mecthat just makes my life a million times easier, i keep getting random errors trying to implement it myself
04:48AWizzArdclojurebot: max people
04:48clojurebotmax people is 162
04:48AWizzArdwoohoo ;)
05:06Meci use (first (filter ..)) an aweful lot, is there an equivalent library construct?
05:09cgrandMec: no and it was recently discussed on the ML (subject: "filter1 interseting?")
05:20Mec(first (drop-while )) is about the same but sounds closer to it's purpose
05:24AWizzArdyes, especially this (first (filter ..)) is a common pattern
05:28Mecit's such a common idea but for some reason hard to put a simple name to
05:31AWizzArdin Common Lisp it is called find
05:31AWizzArdbut that name is already used
05:32cgrandfirst-match? seek?
05:32Mecseek's not bad
05:33cgrandor hide it into destructuring (let [[x] (filter ...) ...] ...)
05:38AWizzArdseek would be good if destructuring is not an option
05:39AWizzArdthe problem with first-match is, that it indeed does reduce the complexity of the code, but it is not shortening the overall pattern.
05:44karmazillaoverloading 'find' is not an option?
05:49cgrandThe two overlaod would be too different : map * object -> map-entry vs seq * pred -> object
05:50karmazillayes, you're right about that
06:00Mecif I'm performing the same computation at the init of a loop and at the recur, is there a better pattern to use?
06:01Mechmm nvm i dont even need to recur that value
06:03HolcxjoFYI: Yesterday's talk by Rich was taped and "will be posted in approximately 48 hours" at http://skillsmatter.com/podcast/java-jee/clojure-for-java-programmers
06:05Mecis it the same talk as the current clojure for java?
06:08cgrandMec: can't you put that computation at the start of the loop body?
06:08cgrandHolcxjo: thx
06:09Meccgrand: yup
06:09kotarakHolcxjo: is this a "general overview" talk? That would be not thaat interesting. (I know the general overview already. ;) ) Wasn't there also a more in detail talk? Will it also be podcasted?
06:19Holcxjokotarak: Yes, he gave a general introduction to Clojure. IT was aimed at Java programmers
06:24lisppaste8mec pasted "ugly nested loop" at http://paste.lisp.org/display/76951
06:25Mecplease tell me there's a more graceful way, that's just hideous, but i dont know how to use 'for for this
06:25Drakesonhow should I check (cond) based on class of data? (= (class x) java.lang.String) ?
06:26MecDrakeson: looks like that should work
06:26Drakesonyeah, but is there a shorthand for that? somehow using #^String?
06:27Mec,(= (class "abc") String)
06:27clojurebottrue
06:32lisppaste8cgrand annotated #76951 "re: ugly nested loop" at http://paste.lisp.org/display/76951#1
06:34Meci try to stay away from max-key because it calls pred too many times
06:35Mechmm maybe not in this situation
06:36cgrandit will call first ~2*n times (instead of n times) but first is cheap
06:38Mecright i was thinking back to another way i used it
06:44Mecalors au lit
07:55HolcxjoMec: I submitted a bug about max-key doing double evalutations -- let's see if it gets accepted -- http://bit.ly/hqivY
07:55HolcxjoBah -- gone already
07:58kotarakHolcxjo: did you talk to rhickey before submitting the bug?
08:00Chousukewouldn't max-key be equal to (max (map k xs))?
08:02Holcxjokotarak: No, I thought he can always close it as invalid if he doesn't like it
08:02kotarakHolcxjo: He prefers discussing such things before the bug is opened.
08:03Holcxjooops
08:03Chousuke~source max-key
08:04Holcxjochousuke: No, max-key returns the element that maximises (k element)
08:05Chousukeah, indeed.
08:06ChousukeI wonder how often k will actually be expensive to calculate, though :/
08:07HolcxjoChousuke: indeed -- but how expensive is my method? Not very either, I assume -- believing Rich's mantra of ephemeral garbage being cheap
08:07ChousukeI suppose
08:10banisterfienddoes clojure have its own good standard lib or does it just use the java lib?
08:18Chousukebanisterfiend: there's clojure.core and .contrib
08:18Chousukebanisterfiend: they don't do everything; using the java libs is perfectly fine and encouraged, even :)
08:19Chousukethough my guess is that we'll see a "pure clojure" standard library if people get serious about implementing clojure on non-java platforms
08:19banisterfiendyeah but it's a bit ugly and unwieldy isn't it? wouldn't ppl prefer to use a library that is designed with lisp/clojure in mind
08:20Chousukenah
08:20Chousukea lot of the java stuff works just fine with clojure.
08:20Chousukepeople will write wrappers and libraries for the stuff that doesn't.
08:21Chousukebut to take an example, clojure.core has very few string functions
08:21banisterfiendyeah
08:21Chousukebecause the java String methods provide everything that is needed.
08:21banisterfiendscala is having the same issue it looks like
08:22Chousukeit's not really an "issue". it's a feature :)
08:22banisterfiendsome ppl say a language written on the jvm is both a blessing and curse, a blessing because all the libs are already tehre, but a curse in that using them feels like you're stepping outside the language into java-land, and you have to manually write a bunch of wrappers
08:23Chousukethe java integration in clojure tries to be as seamless as possible.
08:23banisterfiendyeah fair enough
08:23banisterfiendis 'programming clojure' a good book in your opinion?
08:23Chousukein the best case, the only thing that tells you you're using a java method is that the operator starts with a . :)
08:24ChousukeI haven't read it, but I have heard a lot of good things about it.
08:57etnthi folks, is possible to combine clojure and j2me ?
09:15etntprobably not then...
09:15kotaraketnt: you might ask some time later on.
09:15kotarakWhen more people from NA are active.
09:15etntok, will do, thx
09:16kotarakOr you can ask on the google group. There's a wider audience.
09:21ChouserI don't think I've heard of anyone trying.
09:29pjstadig~pjstadig entered the room and suddenly...
09:29clojurebotCLABANGO!
09:34pjstadigclabango.com is up
09:34karmazillathat is one ugly monkey :)
09:36pjstadigthe eyes are...interesting
09:36kotarakyeah. It sure smoked the wrong things.
09:36karmazillaso, what is clabango?
09:36pjstadigclojurebot: clabango is http://www.clabango.com/
09:36clojurebotIn Ordnung
09:36kotaraka port of django to clojure, IIRC
09:37pjstadigclojurebot: clabango is <reply>http://www.clabango.com/
09:37clojurebotc'est bon!
09:37pjstadigdanlarkin is holding out on us
09:38karmazillaI notice Lau have a clabango repo on github but it is empty
09:39pjstadigya he was trying to encourage danlarkin
09:40karmazillais it based on ring?
09:41pjstadigi haven't seen any code myself
09:41karmazillathe mystery framework
10:12danlarkin karmazilla: yes, madison is based on ring
10:16karmazillawhat do you do for models/ORM that django has?
10:18danlarkindon't have any yet :-/
10:26danlarkinme too
10:50DrakesonOK, I got fed up! I want to help improve access to documentations, from the repl (or slime). First I want to make sure what works and what doesn't.
10:50Drakeson1. Can `doc' and `repl-utils/javadoc' be unified?
10:51Chouserprobably. if javadoc sees the arg is a var not a class, it could do what doc does.
10:52Drakesonis there any imaginable ambiguity as to which one should act?
10:52cgrandright now javadoc works also on instances
10:55DrakesonOK, so that one needs fixing (merging javadoc into doc, if possible)
10:55Drakeson2. Can we get a "more..." or "examples..." link in the output of `doc'? The link should be automatically generated. I am not advocating putting the link inside the doc-string.
10:57Drakeson3. Where should examples go (I want to help gather snippets and examples, when there is a *one* cannonical place for such).
10:58Chouser~examples
10:58clojurebotexamples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
11:01Drakesonthat's not good enough, I prefer somewhere on github.
11:02Drakeson(since writing code in a textarea in a web-browser is much more fun than using a Real Editor)
11:03Drakesonwhat do you think of a clojure-examples package?
11:03Drakesons/package/repos on github
11:07Drakesonis there any copyright or licensing issue with snippets posted on http://groups.google.com/group/clojure ?
11:10DrakesonThere are many nice examples in the mailing-list or in the google-group that can picked up, polished, and put in an examples repository. Do I have to care about copyright for small pieces of code from those places?
11:11Chouserprobably :-(
11:12AWizzArdyou could ask the authors for permission
11:13danlarkinthose in the US, at least, have copyright on whatever they produce as soon as it's produced
11:13Drakesonregardless of the "size"?
11:13danlarkinyup
11:14kotarakIn Germany you cannot resign your copyright. No public domain here..
11:14Chouserthat's why rhickey is a bit of a stickler about people not just randomly posting patches to the list
11:14DrakesonI guess Stallman has a point ;)
11:15Drakesonwhat should I do? should I gather them and put the posters name beside it?
11:15Drakesonwhat if I "rewrite" the example?
11:15danlarkinone could argue that by submitting their work to a public mailing list they're licensing it for redistribution...
11:16AWizzArdBut it should be possible in most/all contries to license the use.
11:16AWizzArdDrakeson: A simple rewrite won't do, it must be your own work.
11:16AWizzArdRenaming vars/functions is not enough.
11:17Chouserpeople will probably not be very possessive about code they posted to the group
11:17AWizzArdChouser: I was thinking about licensing it for 20$ per LOC.
11:17danlarkinindeed, just renaming things would be a derivative work
11:17ChouserAWizzArd: good luck with that.
11:17AWizzArd;)
11:18ChouserDrakeson: for any example you want to use, I imagine you could contact the author and most would easily grant permission for republishing or fixing up or whatever you need.
11:18AWizzArdTwo US experts suggestd a few days ago to eliminate the laws regarding copyrights/patents completely.
11:19danlarkinI don't know if completely would be a good idea... but author's life + 75 years is a little much
11:19DrakesonChouser: that takes care of the mailing list, how about wikipedia?
11:20danlarkinDrakeson: I think when you contribute to wikipedia you implicitly license your contribution CC?
11:20ChouserDrakeson: the wiki books may have excplicit licensing coverage for submissions -- you could look for that.
11:20pjstadigis there a TOS for wikibooks?
11:20pjstadigmight have licensing
11:21pjstadigi think the Clojure Google Group should be renamed to the VIM Google Group
11:21pjstadighehe
11:22hiredman*cough*
11:23hiredmanI think traffic analysis of group and irc traffic will show far more emacs
11:24hiredmanfor about a week technomancy and cooldude127 would talking emacs in here for hours at a time
11:24kotarakpjstadig: I'm sorry
11:25kotarakBut there are also lots of SLIME questions also....
11:25DrakesonOK, I imagine copyright can be dealt with by using enough communication. Now the next issue is how should it be organized. A flat directory of small files (possibly one per symbol, like defn.clj, ns.clj, etc.)? a few large .clj files with sections coded in the comments, (;;;SYMBOL: defn), etc?
11:26eevar2<-- vim guy turning to the dark side just because of lisps
11:26AWizzArdeevar2: you mean you now try Emacs?
11:27eevar2emacs+slime seems to have an edge over vim for cl/clojure, yup
11:27AWizzArdThe Clojure support for Vim seems to be pretty good.
11:27AWizzArdI am not so sure if emacs+slime+Clojure have an edge over VimClojure+Gorilla.
11:27pjstadigkotarak: np. I was just joking
11:28pjstadigthough if there is enough traffic about it VimClojure could maybe have its own list
11:28AWizzArdeevar2: for Common Lisp it is maybe true. I am using the emacs+slime+Clojure combo only because I am used to use emacs since many years, in which I was doing Common Lisp.
11:28pjstadignot that it's at that point yet...it's not overwhelming just yet
11:29durka42Drakeson: if you're putting this on something like github i'd suggest lots of small files, easier for linking and updates
11:29AWizzArdMaybe kotarak would like to implement a simplified version of Vim, written in Clojure? ;)
11:29danlarkinnooo not another clojure text editor
11:30hiredmanwe should stop talking about this or we might wake Lua "Emacs is minfestly better, and if you disgree you are blinded by religion" DK
11:30pjstadigAWizzArd: so you're saying I should learn vim?
11:30eevar2pjstadig, shoot for netbeans ;)
11:30hiredmanmanifestly
11:30pjstadigi've always used Eclipse for java, and tried it for Lisp too with my school projects
11:31pjstadigbut broke down and learned emacs
11:31pjstadigthen just figured emacs is the way to go with clojure since it's a lisp
11:31Drakesondurka42: good point.
11:32AWizzArdThis is what I right now think too. But Enclojure (+ NetBeans) can potentially become the leading environment for Clojure.
11:33pjstadigi used to use netbeans, but found it slow and unintuitive, but maybe i'll have to cave
11:33pjstadigany test-is experts?
11:33pjstadigi'm trying to run the clojure.contrib.test-clojure.predicates tests on Clojure+TC
11:34AWizzArdI think on modern computers it really is not too slow anymore. That it eats a few hundred mbs of ram means nothing to those with 2+ gigs. It is what Emacs was for 32mb machines some years ago.
11:36pjstadigner'mind
11:36pjstadigi think it's another array.clone() problem in PersistentArrayMap
11:43pjstadigsweet
11:43pjstadigpredicates passes now
11:44pjstadigdanlarkin: terracotta work is proceeding, how's the second half of our plan for world domination? (i.e. clabango)
11:44pjstadig:)
11:45danlarkinha!
11:46danlarkinwell enough
11:48danlarkinneeds man hours
11:52pjstadigpost to github and get some collab goin' on
11:56danlarkinaye I know I totally should
11:56danlarkinmaybe tonight after work I'll actually do it
12:09jayfieldssax is the way to go for parsing xml in clojure?
12:13ChouserI always recommend xmpp if you can handle a 3rd-party jar
12:14Chouserclojure.xml for sax or clojure.contrib.lazy-xml for either sax or xmpp
12:18jayfieldsthanks Chouser
12:18replaca_Q: what's the syntax for throwing a "main" func into my file? I don't see it on clojure.org
12:18cgrandChouser: do you mean XmlPull?
12:20kotarakreplaca_: (ns my.class (:gen-class)) (defn -main ...))
12:21hiredmanreplaca_: do mean main as in java's main?
12:21Lau_of_DKHey all
12:21cgrand(:gen-class :main true)
12:21hiredman^-
12:21Chousercgrand: yes, Xml Pull Parser
12:21replaca_Hmm, I'm not after a "java main" but rather a "clojure main". Is this a sensible idea? That is, a func that's invoked with the command line args
12:21Chouseroh
12:21Chouserxpp
12:21Chouser:-)
12:22hiredmanreplaca_: just put a function call the end of your file
12:22hiredman(main)
12:22Chouserhttp://www.extreme.indiana.edu/xgws/xsoap/xpp/
12:23replaca_hiredman: but then it gets called when I load the file as a ref, doesn't it? What I'm looking for is the equiv of python's if __name__ == "__main__":
12:24replaca_so when a load a file as a main thhing from the coomand line it's run, but not when it's simply referred to
12:25hiredmanreplaca_: ah
12:25replaca_*cdomand = command, but you knew that
12:25kotarakreplaca_: (ns my.class (:gen-class)) (defn -main ...) ; see replaca_: (ns my.class (:gen-class)) (defn -main ...)
12:25kotarakoops
12:26kotarakreplaca_: http://clojure.org/compilation was intended after the "see"
12:27replaca_kotarak: yeah, I don't want to make a java class here. Not the goal. I'm thinking like a pythonista here, but that's a good way to think for various kinds of scripting things
12:27hiredmanreplaca_: that is trickier, I think the best way would be to put functions in a seperate library file/namspace so you can refer to them
12:27hiredmanand your consumer of the lib in it's own namespace, maybe with just a (main)
12:29replaca_hiredman: OK, maybe I'll have to do that. I think we should think about how this might work well in clojure since it's a super valuable idiom in python (and, iirc, in perl as well)
12:29hiredmanyou might be able to work something around *file*
12:30hiredmanreplaca_: take it to the group
12:30replaca_it lets you write scriptable units that can stand on their own as scripts or can be used as the basis for other things or repl use as a bundle of func
12:30hiredmanclojurebot: latest?
12:30clojurebotlatest is 1327
12:30replaca_hiredman: that sounds like being sent to the principal :-)
12:31kotarakThis was discussed on the group already. I remember there was no non-hacky way to solve the problem and gen-class is maybe the Right Way.
12:31Chouserthere was a proposal that looked pretty good, but it didn't go anywhere iirc.
12:32replaca_kotarak: yeah, but once you do gen-class, you're not scripting anymore
12:32Chouserfor a var that would let you determine if your script was the command-line's "main" or not.
12:33hiredmanactually
12:33hiredmanhmmm
12:33replaca_Chouser: or maybe just a clojure invocation that would call a specific func with args
12:33replaca_seems like it shouldn't be too difficult
12:34replaca_a variation on the clojure.main invocation
12:34replaca_where the first arg was a func name
12:34hiredmanreplaca_: -e
12:35hiredman% java clojure.main -i f.clj -e "(f)"
12:35hiredman:foo
12:35replaca_hiredman: yeah, that might be a reasonable sol'n, but it doesn't give me command line args (or does it set *command-line-args*)
12:36replaca_?
12:36hiredmanwhere f.clj contains (defn f [] (println :foo))
12:36hiredmandunno if that works with files properly namespaced and what not
12:36replaca_oh yeah, that should set *command-line-args*. Let me try it. Thanks!
12:37replaca_hiredman: we'll find out!
12:37hiredmanyou have to namespace qualify the function
12:37replaca_yup
13:20hiredmanhmmm
13:20hiredmanvimclojure seems to time out or something
13:20kotarakhiredman: another issue?
13:21hiredmanwhen I start vim it works fine, but if stop and come back to vim it doesn't work
13:21kotarakWhat do you stop? The server?
13:21hiredmanugh
13:21hiredmaner
13:21hiredmanstop vimming
13:21hiredmanleaving vim open
13:21hiredmanwell, it started working now
13:22kotarakThere is no persistent connection. So there is nothing to time out.
13:22hiredmanhmmm
13:22hiredman\ep just worked, but \sr is not working
13:22kotarakWhat is the error message?
13:23hiredmanno error
13:23kotarakSo what happens?
13:24hiredmanI think it may not be a timeout thing
13:25hiredman\sr doesn't seem to work on files with no namespace
13:25kotarakAs I said: there is nothing to timeout. The first invocation might be slower, because the server has to load the nails classes but afterwards there should be much of delay.
13:26hiredmanI type \sr, and end up replacing whatever character is under the cursor with 'r'
13:26hiredmanbut \ep works
13:26kotarakwhat does :nmap \sr say?
13:27kotarakThe namespace is not interesting for \sr. It must only be a Clojure buffer.
13:27hiredmanNo mapping found
13:27kotarakThen the mapping was not setup correctly or it was removed somehow.
13:27hiredmanhmmmm
13:27kotarakWhat does :nmap \ep say?
13:27hiredmanif I switch to another tab (with an open clojure file) there is a mapping
13:28hiredmananother open clojure file
13:28kotarakWhat filetype has the original buffer?
13:28hiredmanf.clj
13:28hiredmanis the name of the file
13:28kotarakset filetype? (<- including ?)
13:29Lau_of_DKSlime, Swank, everything is updated to the latest rev of Clojure?
13:29hiredmanfiletype=clojure
13:29kotarakhmmm... then something went wrong when setting up the buffer key mappings.
13:29kotarakTry :e
13:29hiredmanchanges nothing
13:30kotarakHmmm...
13:31hiredman:(
13:32kotarakhiredman: For now I can only think of :bd and reloading the file completely.
13:33kotarakDid you get an error when first loading the file?
13:33hiredmannope
13:33kotarakThat might also prevent correct setup.
13:33kotarakhmmm
13:33hiredmanok
13:34hiredmanthe \sr binding doesn't apear to happen for any files opened other then the file specified on the command line
13:34hiredmanif I vim foo.clj then within the running vim :tabe bar.clj \sr works for foo.clj and not for bar.clj
13:35kotarakOk. Let me try here with tabs.
13:35durka42WFM :\
13:35durka42although i'm using macvim not console vim
13:36hiredmanand it is only the \sr binding that seems to vanishor not get made
13:37hiredmanif I bind \sr my self in the other tabs it works fine
13:37kotarakWFM also....
13:38hiredman*sigh*
13:38hiredmancomputers
13:38kotarakwhich kind of vim do you use? terminal or gvim?
13:39hiredmanterminal right now
13:39kotarakOk. Let me try there.
13:42kotarakHmm... Also works in the terminal...
13:44durka42me too
13:45durka42with vim 7.2
13:45kotarak7.2.22 in terminal, 7.2.108 in gvim
13:46hiredman7.2.69
13:46hiredmanI think, but I am not 100% sure I had this same behaviour last night with gvim
13:48kotarakI don't get this "for foo.clj and not for bar.clj" thing.... It should either work always or never... hrmph..
13:50hiredmanah
13:50hiredmanI had pasted the remapping example from the readme in my .vimrc
13:51hiredmanremoving that, made \sr work everywhere
13:51hiredmankind of weird
13:51kotarakHmm... that suggests, that the FileType autocmd is not triggered for the file on the command line. :(
13:53kotarakI hate special cases
14:16rzezeskikotarak, you were right about autoclose, it can act a little funky, especially with Clojure code and undo operations
14:20durka42the problem i have with autoclose is occasionally when i press ESC it decides to overwrite the next few characters with close-parens
14:21Lau_of_DKdurka durka
14:21Lau_of_DKAre you guys still using Vim? I mean seriously, this is 2009.... Heard of Emacs anyone?
14:22rzezeskidurka42, yea I don't think I'm going to use it much longer
14:23RaynesLau_of_DK: I agree.
14:23tashafaemacs+slime ftw
14:23gnuvincewhois Lau_of_DK
14:23RaynesEven though I use Enclojure.
14:23Lau_of_DKhehe
14:23gnuvinceVim is just fine.
14:24Lau_of_DKI mean, Vim... you might as well use nano
14:24Lau_of_DKIts old, outdated, lacks every feature in the book...
14:24Lau_of_DKOh well, theres freedom to choose I guess :)
14:24gnuvinceLau_of_DK: you obviously don't know anything about Vim if you think it's the same as nano.
14:24rzezeskiLau_of_DK, I don't want to trade my superb text editor, not an OS
14:24rzezeski;)
14:24durka42nano is pretty terrible, it can't even handle long lines
14:24rzezeskifor an OS*
14:25Lau_of_DK~ all Im saying is, that before I used to be a slow developer, always being retrained by my software, when suddenly...
14:25clojurebotCLABANGO!
14:25Lau_of_DKEMACS! hit me
14:25Lau_of_DK :)
14:25ayrnieunano is absolutely wretched, should have never existed, has no merit, should not be used or recommended to anybody. Using its vi 'mockulation' twice in two days causes brain damage most of the time.
14:25albinovim is the shiznit Lau :)
14:26tashafahow is enclojure now these days? I used it a while ago and got discouraged when I was learning clojure
14:26Lau_of_DKhehe
14:28rzezeskiWell, I used to be an Emacs only user, and then I switched to Vim and saw the light (ie, superior key bindings) and never looked back :)
14:29Lau_of_DKSo you didnt just consider M-x viper? :)
14:29rzezeskiediting modes is where its at
14:30digash`EMACS? Who uses that thing? It was, like, hacked in '80. And it uses this weird language called LISP.
14:30rzezeskidoes viper give me modes?
14:31ayrnieurzez - yes.
14:31javuchihello
14:31Chouserrzezeski: yep -- viper mode and viper-got-disabled mode
14:31javuchiwhat IDE do you prefer to use with clojure?
14:31Lau_of_DKrzezeski: This is all you need to know http://xkcd.com/378/
14:31Lau_of_DKjavuchi: Emacs of course, coupled with Swank-clojure and slime
14:31dnolenhaha, javuchi: you just came into the middle of Vim vs. Emacs, things never change.
14:32Raynestashafa: It's good now. It's good enough for everyday editing.
14:32rzezeskiLau, I've seen that one before, very funny
14:32ayrnieujavuchi - I like unix for my integrated development environment^W^W^Wopen tool platform^W^W^Woperating system
14:32RaynesI use it and nothing else.
14:32RaynesAlso, anyone complains about Emacs being bloated and being an OS in a window needs to leave this channel and kill themselves.
14:32Raynes:|
14:32ayrnieuRaynes - suppose that someone compliments it for those very features.
14:33javuchii know emacs, but also like netbeans
14:33javuchiLau_of_DK: why emacs?
14:33RaynesI hate netbeans but love Enclojure.
14:33Lau_of_DKM-x netbeans
14:33RaynesIt cuts both ways.
14:33p_lRaynes: it could be worse, you might be forced to use Eclipse
14:33Raynesjavuchi: M-x haskell-mode
14:33Raynesp_l: I actually like Eclipse, but I don't like clojure-dev
14:33Lau_of_DKjavuchi: First of it can do everything. Secondly you can compile straight to another buffer, and get some interactive development going, thirdly, there are no real alternatives
14:34javuchii use emacs for CL
14:34javuchiis it that good with clojure?
14:34RaynesI would use emacs for Clojure if it wasn't for having to compile Clojure code and jar it myself.
14:34RaynesI'm lazy.
14:34RaynesAnd I don't like ant.
14:35javuchii'm confused, there are 3 things:
14:35javuchiclojure-mode
14:35Lau_of_DKjavuchi: http://bc.tech.coop/blog/081023.html
14:35dnolenjavuchi: it's getting better. The release of cl-format 2.0 fixes one of the major missing things for which is readable macro-expansions.
14:35javuchiswank-clojure
14:35p_lRaynes: I've got rid of Eclipse after it eating too much memory :)
14:35javuchiclojure-extra
14:35Lau_of_DKjavuchi: http://bc.tech.coop/blog/081023.html
14:35dnolenjavuchi: clojure-mode is just syntax highlight
14:35ayrnieuthanks for putting those on separate lines, javuchi.
14:35Lau_of_DKExplains it all I think
14:36dnolenjavuchi: swank-clojure is for SLIME interaction
14:36RaynesIf you have the memory why not use it?
14:36p_lRaynes: it gets a little bad when Eclipse stops fitting into memory
14:37javuchithanks Lau_of_DK
14:37p_land FF isn't memory friendly too (and you need to use it at the same time)
14:37Lau_of_DKnps
14:37Raynesp_l: Never happened too me on my 2g machine.
14:37Lau_of_DKjavuchi: On the same blog, you can also find a post which gives the greater overview of Emacs/Slime/Clojure, but it doesnt sound like you need it
14:37p_lRaynes: I had 512M :D
14:37RaynesUnderstandable.
14:38javuchiLau_of_DK: i'm used to slime
14:38Lau_of_DKThen just start hacking
14:38p_lRaynes: changing it to 1.5G still didn't liberate me from constant swapping
14:38javuchiLau_of_DK: but, in fact, this is the first time i'm goint to test clojure
14:38javuchii don't even know how to start it!
14:38Lau_of_DKIf you find Technomancy's Clojure-mode on Github it has an installer branch, which will clone, clojure, contrib, swank, slime and set it all right up for you
14:38Lau_of_DKIve only heard good things about it javuchi
14:39Lau_of_DKThen technomancy is your friend
14:39dnolenjavuchi: Lau_of_DK is right, I've set up a bunch of beginners with emas-starter-kit it works great. otherwise bill clementson's blog post covers the details for experience users.
14:39Lau_of_DKhttp://github.com/technomancy/clojure-mode/tree/installer
14:39Lau_of_DKCheck that out
14:40dnolenemacs-starter-kit, i mean, also done by technomancy.
14:40javuchiso ok, where to absolutly start?
14:40javuchidon't confuse me :)
14:40dnolenhaha, if you know emacs+slime, just do bill clementson, if you don't technomancy
14:41kotarakI just have to get the installation easier and some user education on how to setup a namespace, and one can omit the S from SLIME. hehe. ;)
14:42javuchitechnomancy is another mode?
14:42javuchiso there are FOUR modes?
14:42hiredmantechnomancy is a dude
14:42Raynesjavuchi: It's the same mode. Technomancy just slaps everything together.
14:42hiredmannot an emacs mode
14:43RaynesI wonder how many people have disregarded Clojure as soon as they read "Emacs" in the wiki.
14:43RaynesI would guess a good 10-20 people.
14:44hiredmandamn it
14:44javuchiemacs is a beast because it is completely different to the rest of the world
14:44albinoLisps have always had that problem, learning emacs+lisp at the same time is daunting
14:45javuchii'm using it for years and still don't remember how cut/paste shortcuts are!!
14:45Raynesalbino: And Clojure has IDE's being made, and one of them is pretty good for general Clojure development.
14:45kotarakalbino: what does shiznit mean?
14:46Rayneskotarak: Mean's 'shit'.
14:46kotarakOh. Ok.
14:46kotarakAt least it's usable shit.
14:47albinokotarak: http://www.urbandictionary.com/define.php?term=shiznit "the shit"
14:47hiredman,(?map range $ 3 inc � inc)
14:47clojurebotjava.lang.Exception: Unable to resolve symbol: ?map in this context
14:47hiredman,(pl (?map range $ 3 inc � inc))
14:47clojurebot(2 3 4)
14:47albinoRaynes: yeah, that's good news
14:47kotarakgeez... slang...
14:48Lau_of_DKhiredman: w00t?
14:48javuchi1Raynes: an IDE being done?
14:48Raynes javuchi1: 2 actually.
14:48hiredmanLau_of_DK: ?
14:48dnolen3 if you include Emacs ;)
14:48RaynesThere is Enclojure for netbeans, and it's pretty decent for everyday development.
14:48Lau_of_DK(:map range $ 3 inc - inc?)) ?
14:49albinoSorry, I forget they're are probably lots of people here who aren't from the US
14:49RaynesClojure-dev which... Well, it's Clojure-dev, lets just say that.
14:49hiredmanclojurebot: pl?
14:49clojurebotexamples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
14:49javuchi1i had problems with netbeans ide
14:49hiredmanclojurebot: transform?
14:49clojurebottransform is http://github.com/hiredman/odds-and-ends/blob/8a84e6ddbad9d71f714ba16c3e1239633228a7eb/functional.clj
14:50RaynesWho was it that said choosing between an IDE and Emacs is choosing whether you want something that just works good enough or something you can configure until the end of time.
14:50RaynesIt's actually a very true statement.
14:50RaynesIt's the compile and build button that got me.
14:50Raynes:D
14:50Lau_of_DKYou mean S-tab in emacs? :)
14:51Lau_of_DKhiredman: Man thats nasty - What is that dot character you use ?
14:51hiredmaninterpunc
14:51hiredman
14:51RaynesLau_of_DK: Last time I checked, you couldn't automatically compile and build a clojure jar automatically without an ant script or something of the sort in Emacs.
14:52RaynesNoticed how I said automatically twice?
14:52javuchi1anyway, even if you waste your time configuring emacs, it is not going to get as good as Netbeans for the languages that Netbeans support well
14:52Lau_of_DKRaynes: I can set it up for you if you like, Emacs makes computing a breeze (see butterfly mode pasted above)
14:52javuchi1netbeans is an order of magnitude better for java/ruby/c
14:52Lau_of_DKjavuchi1: Its already better than netbeans in my oppinion
14:54javuchi1in which directory to install clojure-mode?
14:55Lau_of_DKYou choose
14:55Lau_of_DKin .emacs just do (add-to-list 'load-path "/path/to/clojure-mode")
14:55RaynesAny, you will be putting the path to it in your emacs configuratio..
14:55Lau_of_DKBut Bill will set you right up :)
14:55RaynesWhat he said.
14:55Lau_of_DKslowmo :)
14:55Raynes:p
14:56javuchi1Lau_of_DK: i want a general instalation
14:56javuchi1 /usr/share/site-lisp??
14:57pjstadigi put mine in ~/.emacs.d/clojure-mode
14:58RaynesEmacs Haskell-mode is awesome.
15:00Lau_of_DKpjstadig: I did the same :)
15:00javuchi1oh my god!
15:00javuchi1it runs SBCL!
15:01RaynesI'll have to say that I like the name more than anything else >_>
15:01Lau_of_DK~ you thought you liked it better than anything else, when suddenly...
15:01clojurebotCLABANGO!
15:02kotarakLau_of_DK: www.clabango.com
15:02javuchi1how to setup clojure-mode?
15:02Raynes:|
15:02javuchi1i cannot imagine windows users trying to configure this
15:03javuchi1it would be vey funny
15:03javuchi1;)
15:03kotarakjavuchi1: windows users can use clojure-box
15:03Raynesjavuchi1: I did, and I succeeded.
15:03Lau_of_DKjavuchi1: Read and understand that blog post from Bill C
15:03Lau_of_DKHe takes you through setup and installation step by step
15:03RaynesI'm a windows user, and I did very will install Clojure mode and get it working before ending up using Enclojure anyways.
15:03Rayneswell*
15:04javuchi1for configuring SBCL/slime I just did apt-get install sbcl slime
15:04RaynesI downloaded the snapshot!
15:04RaynesCause that's how I roll.
15:04Raynes:)
15:04Lau_of_DKlol
15:05cmvkk_I just typed my e-mail address as @gmail.clj :/
15:05pjstadighaha
15:06Lau_of_DKlol
15:06kotarakhehe :)
15:06pjstadig~suddenly
15:06clojurebotCLABANGO!
15:06pjstadigLau_of_DK: clabango.com is live
15:06kotarakThe next level is (@ user gmail.clj) ;)
15:07Lau_of_DKpjstadig: Whats its purpose? Just for launching CottaBango ?
15:07danlarkinterrabango
15:07pjstadighehe
15:07danlarkinhahah oh god
15:07danlarkinthe monkey!!
15:07pjstadigterraclotta
15:08javuchi1errrr
15:08javuchi1how to use ant????
15:08javuchi1hahaha
15:08Lau_of_DKwell, you type "ant"
15:08cmvkk_usually just typing 'ant' works.
15:08Lau_of_DKcopyclabangocats all over
15:08javuchi1i don't have it installed
15:09Lau_of_DKon Linux, sudo apt-get install ant
15:09Lau_of_DKon Windows, 1) Install Linux 2) sudo apt-get install ant
15:09Lau_of_DKOn Mac its the same as Windows
15:09cmvkk_what if they're using redhat or gentoo or something?
15:09Lau_of_DKSame as Mac :)
15:09kotarakcmvkk_: 1) install debian 2) sudo apt-get install ant
15:10javuchi1it uses gcj
15:10javuchi1isn't that beast dead already?
15:10javuchi1who uses gcj?
15:11Lau_of_DKit does
15:12hiredmaneh
15:14javuchi1fuck! how to install git on debian?
15:14pjstadiggit-core
15:14Raynesapt-get git
15:14RaynesNaw, I don't know.
15:14Lau_of_DKjavuchi1: No swearing on this channel, you know how Rich gets
15:14kotarakapt-get install mercurial
15:14hiredmanis this a brand new install or something? it sounds like you don't have anything installed
15:14pjstadigapt-get install git-core
15:14Lau_of_DKjavuchi1: on debian you need the backports probably, git-core there is 1.6
15:14pjstadigoh
15:15pjstadigi don't know about debian, i'm on ubuntu
15:15Raynesapt-get 1 large supreme pizza delivered to 54334 state highway 13 eldridge please.
15:15javuchi1i don't use git nor ant for nothing
15:15javuchi1Des:2 http://ftp.debian.org lenny/main git-core 1:1.5.6.5-3 [3426kB]
15:16javuchi1do i need a special version of slime too?
15:16Lau_of_DKjavuchi1: You might need Ubuntu :)
15:17Drakesonjavuchi1: http://github.com/nablaone/slime/commits/master
15:17javuchi1Lau_of_DK: debian is right
15:17durka42Raynes: http://www.beigerecords.com/cory/Things_I_Made/PizzaParty
15:18Lau_of_DKjavuchi1: Not for you :)
15:18Drakesonjavuchi1: have you read this ---> http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started#Emacs_.2F_Slime_Integration
15:18javuchi1i'm simply too lazy and like to protest
15:19Drakesonjavuchi1: you need upstream versions of swank-clojure and slime for things to work with clojure.
15:20Drakesonjavuchi1: actually, I get my slime from git://git.boinkor.net/slime.git
15:21javuchi1there is a lot of things to do
15:24javuchi1eeeemmmm
15:24javuchi1there is a problem
15:24Drakeson?
15:24javuchi1I actually don't want to substitute my default lisp-program
15:24javuchi1which is sbcl
15:24Drakesonyou don't need to
15:24DrakesonI run clojure by M-- M-x slime RET clojure RET
15:25Drakesonsbcl is the main.
15:26javuchi1somebody should be packaging this for ubuntu/debian
15:26Drakesonjavuchi1: let me try to streamline what needs to be done to get clojure+slime under debian. (btw, what is the version of emacs that you are using?)
15:26javuchi1i'm using plain Lenny
15:27javuchi1slime from repos
15:27eevardo I have to add params to get swank-clojure starting the server jvm, or does it pick that version by default?
15:27Drakesondon't use slime from repos.
15:27javuchi1Drakeson: until now i was happy
15:28Drakesonjavuchi1: I cannot remember the details but someone in #emacs was having problems with slime (from repos) + clojure.
15:28javuchi1i'm downloading the git version
15:28javuchi1i have a slow connection
15:29javuchi1i can't understand why it occupes so much space!!
15:29Drakesonjavuchi1: let me try to streamline what needs to be done to get a debian+emacs+slime+clojure setup.
15:29javuchi1Receiving objects: 30% (4257/13782), 6.57 MiB | 34 KiB/s
15:30javuchi1nice Drakeson
15:30Drakesonprobably other people have written about it, though :p
15:31javuchi1http://riddell.us/clojure/
15:31javuchi1may be that?
15:32javuchi1it's an impressive amount of things to do
15:33javuchi1somebody should be packaging this
15:33Drakesonyou don't need to do all that.
15:33javuchi1if i were a debian developer, i would do
15:33Raynesdurka42: I cross-platformized my reader. (.replaceAll (.replaceAll (slurp f) "\r" " ") "\n" ""))
15:33durka42nice
15:34pjstadigi had started working on a debian package for clojure
15:34RaynesBefore someone askes me why I didn't use filter, I had to have a space in place of the \r\n or \n's.
15:34pjstadigi'm not a debian developer though
15:34Drakesonjavuchi1: the problem is that things are changing to quickly at the moment. packaging would only make sense when the rate of important changes slows down.
15:35pjstadigpackaging would make sense if it was automated like with a nightly build
15:35hiredmanRaynes: use map
15:35durka42also, replaceAll takes a regex
15:35hiredmanit sure does
15:35ChousukeRaynes: I think that would be nicer with ->; (-> (slurp f) (.replaceAll "\r" " ") (.replaceAll "\n" " ")) :)
15:35RaynesOh really? Cool.
15:35hiredmanand reading a file into a string is icky
15:35Raynes...
15:35mecolinhello
15:36Drakesonpjstadig: imagine a post laziness package, with half clojure-contrib stuff not yet updated to the new API.
15:36Chouser(apply str (map #(get {\r \space \n nil} % %)) (slurp f)))
15:36hiredman(not that it stops me from doing it)
15:36javuchi1why slime is so big?
15:36Chousukejavuchi1: git downloads the entire history.
15:36javuchi1Receiving objects: 33% (4569/13782), 12.05 MiB | 31 KiB/s
15:36Chousukejavuchi1: you might want to do git clone --depth 1
15:36javuchi1Chousuke: how to avoid that?
15:36durka42(reduce #(.replaceAll %1 (first %2) (second %2)) (slurp f) {"\r" " ", "\n" ""})
15:36pjstadigi'm just saying. everyone does it manually now. no reason it couldn't be packaged for easier install
15:37RaynesI give up.
15:37Chousukepjstadig: not until 1.0 at least :)
15:38Drakesonjavuchi1: the whole slime + history is about 54M
15:38mecolinhow to resolve the following problem, exception: java.lang.ClassNotFoundException: clojure.lang.LazyCons (clojure and clojure-contrib from trunk)
15:38javuchi1this simply gets people out of clojure
15:38pjstadighas anyone thought about how to make clojure work with #! scripts?
15:38javuchi1i have a slow connection
15:38pjstadigi know there's a hack in the wiki
15:38javuchi1its too long
15:39Chousukemecolin: the code you're trying to run is not full-lazy compatible.
15:39pjstadigbut something that sets up the classpath and such
15:39Drakesonjavuchi1: I see your point. 50M of 54M slime is just history.
15:39javuchi1pjstadig: a package will be REALLY welcom
15:39Chousukepjstadig: #! is a comment in clojure so all you need is a launcher script.
15:40RaynesIs my code /really/ all that bad :\
15:40javuchi1pjstadig: even it is a very experimental one
15:40pjstadigright but you can't use a launcher script as a #! for another bash script
15:40durka42Chouser: need \return and \newline
15:40durka42Raynes: no
15:41Chousukepjstadig: hmm.
15:41Chouserdurka42: ah, sure enough. I should have warned that was untested. :-/
15:41ChouserRaynes: no, what you had was perfectly fine.
15:41Lau_of_DK(ns my-domain
15:41Lau_of_DK (:use (compojure html http validation control))
15:41Lau_of_DK (:load "csv"
15:42Lau_of_DK "logic"
15:42Lau_of_DK "graphics"))
15:42Lau_of_DK
15:42Lau_of_DKWhy does this boork in the latest rev of Clojure?
15:42pjstadighmm
15:42javuchi1i have to go now. almost an our and haven't finished even 50% of the installation!!
15:42javuchi1too much
15:42Drakesonwhat does deployment in github mean? can we make it create a zip file of the sources only (excluding certain directories?)
15:42javuchi1i'll continue tomorrow
15:42pjstadig#!/home/paul/bin/clojure
15:42pjstadig(println "test")
15:42pjstadigthat worked with a launcher script
15:42mecolinChousuke: how can I convert this code to fully-lazy compatible ?
15:42pjstadigi thought bash had a problem with it last time i tried
15:43Chousukemecolin: hm
15:43hiredmanerm
15:43kotarakpjstadig: it's not portable. depends on the system you are running.
15:43Chousukemecolin: http://clojure.org/lazy
15:43pjstadigspecifically Stephen Gilardi's launcher from clojure-contrib
15:44pjstadigso what would you have to do a simple binary launcher?
15:44durka42couldn't you do #!/bin/bash /path/to/script
15:44hiredmanuh
15:45hiredmanbash would expect /path/to/script to be a bash file, I believe
15:45pjstadigkotarak: you mean the path? or the method?
15:45kotarakpjstadig: using a #! script as #! for another one
15:45pjstadigk
15:45durka42oh, i see
15:46pjstadigwell at least if i can get it to work on my computer I can write clojure scripts, which would be fun
15:46hiredmanI seem to recall that #! is not handled by the shell
15:46Drakesonpjstadig: what about the startup time? is it not too long for a script?
15:47hiredman"The shebang is actually a human-readable instance of a magic number in the executable file"
15:47kotarakI recall something like the #! is exec() and hence must be binary. But that was for older unixes.
15:48hiredmaninteresting
15:48Lau_of_DKOk - Where is include-js in the latest compojure?
15:49pjstadigDrakeson: maybe, but I might find application for it
15:49pjstadigit would be a way to sharpen my clojure foo
15:49pjstadigand more fun!
15:50Lau_of_DKI asked you boys a question...
15:50pjstadigCLABANGO!
15:50digash`pjstadig: you can use #/usr/bin/env clj
15:50Raynesdurka42: Thanks for bringing it to my attention that replaceAll takes a regex. :D
15:51digash`pjstadig: #!/usr...
15:51durka42although not a clojure regex literal, which is slightly annoying
15:51pjstadigso if got all of the clojure.contrib.test-clojure tests (except for the evaluation test suite) running on TC
15:51pjstadignot that they're comprehensive
15:52pjstadigeven loading clojure.contrib.test-clojure.evaluation throws an error
15:52pjstadiguser=> (require 'clojure.contrib.test-clojure.evaluation)
15:52pjstadigjava.lang.Exception: Can't take value of a macro: #'clojure.core/if (evaluation.clj:169)
15:53pjstadigwhich is (I think) what one of the tests is testing
15:53pjstadigi think it's confused
15:53Drakesonpjstadig: I didn't follow the discussion above, and I don't know if the #! problem is solved. I just tested and I can write clj scripts. (#!/usr/bin/clj)
15:53danlarkinDrakeson: it depends on your OS
15:54danlarkinfor instance, I have to do #!/usr/bin/env clj
15:54Drakesondanlarkin: what is your OS?
15:54ChousukeDrakeson: that's the better way in any case
15:54danlarkinosx
15:54Chousukeer
15:54Chousukedanlarkin:
15:54kotarakah, ye olde env hack... :)
15:54danlarkinI *believe* POSIX specifies that you can't hash-bang a non-binary file
15:55danlarkinthat's why you've gotta use the aforementioned env hack
15:55hiredmanerm
15:55p_l... non-binary?
15:55danlarkinp_l: shell script
15:56kotarakp_l: eg. a shell script, everything starting in #!
15:56p_ldanlarkin: on POSIX, everything is a binary stream of octets
15:56p_l(or should be)
15:56durka42http://en.wikipedia.org/wiki/Shebang_(Unix)#Solving_shebang_problems_with_the_env_program
15:56kotarakand you may only pass _one_ argument.
15:57digash`$ file ~/bin/clj ==> clj: a bash script text executable
15:57p_l#! is just conventional magic number for specifying interpreter (mind you, ELF header also contains link to an interpreter)
15:57danlarkinwe're not all using ELF binaries
15:57p_ldanlarkin: it's just an example
15:58danlarkinalso of note, "#!/usr/bin/env clj" didn't work when "~/bin" was on my PATH, but did when I changed it to "$HOME/bin"
15:59vydanlarkin: That's why people distrubute .bat and .sh files together.
15:59Drakesondanlarkin: I always put $HOME in the path, instead of ~
15:59kotarakdanlarkin: ~ is shell magic
16:00pjstadigdanlarkin: yeah what's your problem dude! ;)
16:00danlarkin:'(
16:01Drakesonis it possible to compile a wrapper to native code?
16:01pjstadiggcj!
16:01ChouserDrakeson: not sure, but I once tried to compile a rapper to native code.
16:01Chouser~haskell
16:01clojurebotYo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you compute.
16:02Drakesonlike putting something in clojure's ant that builds a "happy non-text binary" executable to keep some OS's happy
16:03mattreplDrakeson: with JNA, yes. if it's a C shared library (or C++ without symbol name mangling)
16:04kotarakDrakeson: int main(int argc, char *argv[]) { char *args[] = { "/usr/bin/java", "-cp", "clojure.jar", "my.main.class" }; execv(args[0], args); return -1 }
16:04Chouserwhoa. C.
16:05pjstadigyeah no kidding dude
16:05pjstadigwould it be that much trouble to have a simple binary wrapper
16:05danlarkinthere's always hashdot
16:05pjstadigbut you'd probably want to setup the classpath with more than clojure.jar
16:05Raynes(.replaceAll (slurp f) "\r(\n)?" " ")) :D
16:06hiredmanjava picks up the CLASSPATH environment variable if not overriden by -cp
16:06pjstadigeven through a wrapper?
16:07kotarakpjstadig: one can also access the in environment.
16:07kotarakah, yes.
16:07hiredmanpjstadig: I believe so
16:07kotarakThe Java also inherits the environment from the parent process.
16:07pjstadigit would be nice, though, if the wrapper would automatically pickup things in the ~/.clojure or /usr/lib/clojure directory or something
16:08DrakesonI guess a C wrapper is not perfect but might be good enough.
16:08danlarkinthe clj script should do that
16:08danlarkinDrakeson: look at hashdot
16:08pjstadigbut the clj script cannot be used for #! scripts
16:09hiredmanlisppaste8: url?
16:09lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
16:09pjstadigat least not portably
16:09danlarkinpjstadig: hm? why not?
16:09pjstadighaha
16:09lisppaste8hiredman pasted "how I manage my classpath" at http://paste.lisp.org/display/76979
16:09pjstadigi thought that's what the whole discussion was about
16:09kotarakpjstadig: but the C wrapper could just execute "sh clj-script"....
16:10pjstadigkotarak: true
16:10Drakesonhiredman: I just use java 6 :p
16:11durka42Drakeson: how does that help?
16:11hiredmanyes, please explain
16:12Drakesondurka42,hiredman: instead of putting all .jar files in the env var CLASSPATH, you can just say, e.g. export CLASSPATH="$HOME/.local/share/java/*"
16:12Drakeson(that's where I put my jars)
16:13hiredmaninteresting
16:13Drakeson(actually I symlink the actual clojure.jar, etc. into that directory)
16:15Drakesonalso I symlink swank-clojure/swank into that directory. To make swank happy as well, I actually have to set: export CLASSPATH="$HOME/.local/share/java:$HOME/.local/share/java/*"
16:17DrakesonI think a good clj script wrapper (whether it can be compiled by java or written in C), should behave like python. (you set PYTHONPATH and PYTHONSTARTUP in your path).
16:27Drakesondanlarkin: hashdot looks interesting, though apt-cache search hashdot returns nothing.
16:28danlarkinthat's a shame
16:28danlarkinit seems useful
16:31pjstadighashdot looks interesting
16:31pjstadiganyone using it with clojure?
16:31Drakesonpjstadig: it even has clj.hdp in it
16:31Drakesonhow can I run java as client? clj script runs java server by default. java -help | grep client returns nothing
16:32pjstadig-server just uses a bigger starting heap
16:33hiredmanpjstadig: nope
16:33hiredman-server uses the hotspot vm, which does jiting and all kinds of optimizing
16:33Drakesonit's startup takes much longer
16:33pjstadigd'oh
16:33hiredman-client does not
16:33pjstadigoh right
16:33pjstadigyeah
16:34Drakesona short-lived script wrapper should use the client, then
16:34pjstadigi knew that somewhere in the deep recesses of my brain
16:34pjstadigcan't you change the clj script?
16:35hiredmaneveryone should just setup their OS to fire up nailgun
16:35hiredmanat boot
16:35Drakesonsure. I just cannot figure the right command line option for java to run the client
16:35Drakesonmy java somehow does not have -client :(
16:35pjstadigo
16:35hiredman*shrug*
16:36hiredmanmaybe 6 is all hotspot now?
16:37kotarakhiredman: nailgun works surprisingly smooth for its last update in 2005 :)
16:37hiredmanyeah
16:37hiredmanng clojure.main starts up so fast
16:38pjstadigapt-get ??
16:39kotarakwell, that's because the JVM is already running :) So starting up is maybe so wrong word... ;)
16:40hiredmanwell
16:40hiredmanthe repl starts
16:40danlarkinOoo nailgun looks very useful
16:41pjstadignailgun + hashdot
16:42hiredmanI may have to setup crontab on my machines to fireup nailgun at boot
16:43Drakesonapt-cache search nailgun nope :(
16:43kotarakhttp://www.martiansoftware.com/nailgun/index.html
16:44Drakesonwhat does it do? does it keep them all in a single process or it forks for every new "sub-shell"?
16:44pjstadighaha
16:44pjstadigi love the google ads on that site
16:45hiredmanyou get a single vm instance
16:45pjstadig"Grex 23 Gauge Pin Nailer"
16:45kotarakDrakeson: the client is like the X Windows system: it just relies cli arguments and I/O
16:45kotarakrelays
16:47Drakesonpjstadig: get ad-block-plus firefox extention and filter google-analytics :p
16:48Drakesonkotarak: so if there is any problem the whole vm goes belly up? (for instance, I got 2 jvm crashes this week)
16:49bitbcktclojurebot: ~haskell
16:49clojurebotYo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you compute.
16:49kotarakDrakeson: well. If you kill the vm, it's dead, I suppose. Then you have to restart it.
16:50bitbckt,(doc send)
16:50clojurebot"([a f & args]); Dispatch an action to an agent. Returns the agent immediately. Subsequently, in a thread from a thread pool, the state of the agent will be set to the value of: (apply action-fn state-of-agent args)"
16:50bitbckt(sorry... showing off)
16:50bitbckthiredman: :D
16:50pjstadig~suddenly
16:50hiredmanbitbckt: ?
16:50clojurebotCLABANGO!
16:51bitbckthiredman: showing off clojurebot to great acclaim
16:51Drakesonis it possible to have the vm in a "forkable" state, and have very quick forks (just memcpy the appropriate memory area to the new vm process for forking)?
16:51hiredman~roulette
16:51clojurebotclick
16:51hiredman~roulette
16:51clojurebotbang
16:52bitbcktone of my favorites...
16:52kotarakDrakeson: forking on any sane unix is copy-on-write. And hence fast. But it's not portable, eg. to Windows, AFAIK.
16:52p_lnot to WinAPI
16:53bitbcktclojurebot: brain dump
16:53clojurebotbrain dump is http://clj.thelastcitadel.com/clojurebot
16:53kotarakforking is indeed similar to clojure's persistent collections :)
16:53bitbckthmm
16:54DrakesonI only ever have to do with Unices. Do I qualify to get a fast fork?
16:54kotarakYou probably do, but does the JVM support forks?
16:55hiredmanbitbckt: that's been throwing execptions, and I haven't dealt with it
16:55hiredman~google java fork
16:55clojurebotFirst, out of 221000 results is:
16:55clojurebotfork process in Java
16:55clojurebothttp://www.velocityreviews.com/forums/t151556-fork-process-in-java.html
16:59Drakesonseriously, can I achieve that using JNI or JNA? (I don't need platform independence, as much as Sun needed to appeal to Windows developers).
16:59p_lDrakeson: Windows isn't the only other OS :)
16:59kotarakDrakeson: you can probably go down to a call to fork() in the libc. But don't ask what happens afterwards....
17:00kotarakYou have to the children/parent checking and the like.
17:00kotarakto do
17:01bitbckthiredman: ah. that's alright... I just wanted to find something 'impressive' for it to say for the live audience ;-)
17:02hiredmanaudience?
17:02bitbckteasy crowd
17:02bitbcktyeah... asking about bots, and yours came to mind as a good example
17:02Drakesonis it written in clojure?
17:02hiredmanclojurebot: where are you?
17:02clojurebothttp://github.com/hiredman/clojurebot/tree/master
17:02hiredmanyes
17:03hiredman~def count
17:03hiredman~jdoc String
17:04waltersDrakeson: i think the right approach is to just fix the VM startup in general
17:05waltersDrakeson: right now it involves unzipping jar files - that's *broken*
17:05waltersDrakeson: should just be mmap() on a binary format
17:05waltersDrakeson: it also re-verifies the jars which is also busted
17:06gnuvince_Hello
17:07DrakesonI have yet to hear a good thing about java other than the sheer size of its library :(
17:07durka42gnuvince: congratulations!
17:07pjstadiggnuvince_: congrats! which unis?
17:07bitbcktgnuvince_: great!
17:08Drakeson~ congraJulations!
17:08clojurebotexcusez-moi
17:08bitbckt>_<
17:08gnuvince_pjstadig: two universities in Quebec, Universit� de Montr�al and Universit� de Sherbrooke.
17:09waltersDrakeson: heh, well i appreciate the available tools and the general maturity of the platform, but this particular issue is just one of those things that should have been fixed long ago
17:09kotarakDrakeson: hotspot jit
17:09gnuvince_I now need to figure where I'll go :)
17:09hiredmanwhich you get from -server
17:09kotarakgnuvince_: Uh. Die Qual der Wahl. The agony of choice. (freely translated)
17:13pjstadiggnuvince_: easy, just go to the better one. :)
17:14Drakesonkotarak: I am new to java, and I hate the "premature-standardized APIs" in java. python interfaces are better designed, IMHO. I haven't got to a point to see JIT optimization in action, yet, so my opinion might change.
17:14gnuvince_pjstadig: I have other criterias :)
17:15Drakesongnuvince_: I would go to the larger city. (is Sherbrooke even a city?)
17:16hiredmanthe library has all kinds of cool stuff in it, but a lot of it is not "maintence script" type stuff
17:16kotarakDrakeson: I also thought "Ugh, Java... Big... Slow..." (That's why I almost missed Clojure) But a lot of people with a lot more knowledge than me (eg. rhickey) told me that there is Java and that there is the JVM. That these are two horses of a different color and that the JVM is quite a nice piece of software engineering.
17:17p_lkotarak: there's also "-server" command line switch
17:17cp2p_l: -server is automagically implied in java 6
17:17Drakesonkotarak: I appreciate JVM itself, but reading tons of javadocs or java-examples-written-by-idiots-over-the-interwebs is giving me headaches.
17:17hiredmanlike, when was the last time you wrote a python script that used a threadpool?
17:17p_lcp2: good to hear. i still add it manually anyway
17:18cp2p_l: ;)
17:18ChousukeDrakeson: javadoc is still good
17:18p_lhiredman: over 2 years, cause python threading is broken by design
17:18hiredmanp_l: and it does state wrong of course :P
17:18kotarakDrakeson: see: fighting off Python missionaries is giving me headaches. So nothing is perfect. ;)
17:19p_lhiredman: I don't have anything against state... I have a lot against GIL :D
17:21hiredmanthe point is, lots of the java "standard" library is threading stuff
17:22hiredmanso, yeah, java libraries are great, but not really targeted at light scripting tasks
17:23p_land applications where "enterprise" && "good" actually try not to contradict themselves they don't use much of it :P
17:23hiredmanwhat?
17:23p_lhiredman: message passing :)
17:24hiredmanuh
17:25hiredmanmessage passing if anything requires dealing with threading and state even more, you just have the library do it for you
17:26p_lhiredman: but you can make it a FIFO operation, a'la erlang :)
17:26hiredmanp_l: but you have to manage the queue, pass messages to the corrent process, etc
17:27hiredmancorrect
17:27hiredman(erlang process)
17:27hiredmanthe erlang process have to run on something... (threads)
17:28hiredmangreen or otherwise
17:28p_lhiredman: erlang processes use shared-nothing architecture, so threading primitives are much simpler
17:28p_lwhile what you will see getting taught often will be mutexes everywhere >_>
17:29DrakesonI am trying to gather examples over the net, and put them in git://github.com/gilaras/clojure-example.git
17:30hiredmanp_l: what I am trying to say is, java provides the stuff you could use to "build" erlang in its libraries
17:31Drakesonhiredman: java (+clj) might be the way to the future. It has many mistakes to fix first, though.
17:31hiredmanregardless of the interface the erlang lanuage provides to programmers, all the bookkeeping and what-not is done somewhere by someone
17:31hiredman*shrug*
17:32hiredmanDrakeson: whichever, I am just saying that the java libraries provide a lot of cool stuff, that you will never see if all you do is write little one off scripts
17:33hiredmanI've been exposed to way more of java's standard libraries since starting with clojure then I was when I ever bothered to write java
17:34hiredmanDrakeson: what issues?
17:34Chousukeone point for Clojure for the fact that that JVM advances are separate from Clojure advances.
17:34ChousukeIf the JVM gets fast startup due to modularisation or some other trickery, Clojure benefits immediately.
17:34Drakesonhiredman: I do care about "one-off" scripts, or startup time, etc.
17:35p_lDrakeson: make a "java machine" like lispmachines and have it provide a preloaded, established and optimized image? :D
17:35kotarakWell, there are screws and nails... one tool to saw them all?
17:35Chousukep_l: or he could run a java VM on the background for clojure :)
17:36slashus3p_l: How is the performance on JDK7?
17:36hiredmanDrakeson: I don't see that improving any time soon, if you look at what java provides that is clearly not the niche they where trying to fill
17:36p_lslashus3: I haven't run anything to test performance, but I can say that X11 is as broken as it have been since 1.0
17:36Chousukehiredman: actually, I think they're taking startup time very seriously nowadays
17:36pjstadigrhickey: how'd the interview go?
17:38p_lslashus3: I remember however my friends reactions to 1.5 and 1.6 (and compared to me, who mainly just used java apps, he was a hardcore java programmer) and he was quite enthusiastic about 1.7 :)
17:38ChousukeIt probably won't be until after JDK8 that there will be any really visible changes though.
17:39hiredmanChousuke: which is, what?, at least two years down the road
17:39p_lI can say though that JDK7 is better at memory management than Firefox :>
17:39p_lmy netbeans process is actually apparently getting _smaller_
17:39hiredmanif you want to use clojure for little one off scripts, nailgun seems the way to go
17:39Drakesonto appeal to "script kiddies", or the "open-source community" they should take scripting seriously. "Small useful scripts" is the entry point for many future contributors.
17:40ChousukeDrakeson: "script kiddie" is a very negative term :/
17:40Chousukeno-one wants to appeal to them
17:40p_lthey make interesting wall decorations though
17:41hiredmanthe skillsmatter podcast is still "coming soon" :(
17:43p_l1) track the kiddie down 2) "hire" a security consultant for 10k classified as damages 3) call law enforcement
17:44RaynesI just realize I have Clojure plastered over everything I do on the internet. It's in my signature on forums, it's in my profiles on websites. It's even on my twitter.
17:44RaynesO_O
17:44DrakesonChousuke: I didn't mean script kiddie. I meant "script" + "kiddie" (literally), like high school or undergrads kids trying to write small scripts, as opposed to "enterprise oldies".
17:44kotarakhiredman: "skillsmatter podcast"?
17:45hiredmanhttp://skillsmatter.com/podcast/java-jee/clojure-for-java-programmers
17:45RaynesO_O
17:45kotarakUh. Bots writing bots. In true Lisp spirit of macro writing macros. :)
17:47hiredman~hiredman is also <reply>#who: I heard hiredman failed the turing test.
17:47clojurebotAlles klar
17:47hiredman~hiredman
17:47clojurebothiredman is an evil genius.
17:47durka42~hiredman
17:47clojurebothiredman is a three-toed sloth
17:47Chousukehm
17:47Chousukeif you write a macro-writing macro that writes macro-writing macros, is that an infinite loop? :/
17:48p_lChousuke: yes
17:48RaynesChousuke: Yes.
17:48RaynesA very /advanced/ infinite loop.
17:48hiredmanChousuke: while it does write the macro, it may not call the macro
17:48kotarakChousuke: or will there be The First Macro? Deep down in the lower-levels of the systems?
17:48hiredmanmight not
17:50pjstadiglater people
17:50Drakesonthat's just a chain of 4 macros! (defmacro foo [] `(defmacro bar [] ....))
17:51p_lalso, the fact it's an infinite loop might not be that bad. Look in the mirror
17:52kotarakThere are theories, that the universe could create itself with some loop in time. Maybe it made just *poof* and there was lisp?
17:53p_lkotarak: there are theories that the world is a holographic projection of a 2D plane...
17:57RaynesThere are theories that Rich Hickey is John McCarthy is God and that he wrote the universe in LISP.
17:58Chousukeyes, yes, I also have a theory that there is a unicorn on my backyard.
17:59cp2yes, and the goa'uld actually did enslave earth with their damn pyramid ships
18:00ChousukeQuite a theory, considering I live in a block of flats. :p
18:00Chousukebut I can hypothesise a backyard for my theory.
18:01Raynescp2: Stargate SG1!!!
18:01cp2yes :)
18:01cp2i knew at least one of you
18:01p_lbtw, the 2d plane one actually has some experimental backing ;-)
18:01cp2liked stargate
18:01Raynes(:
18:01cp2i watched all of sg-1 and atlantis in about 2 months
18:01cp2with minor breaks, of course
18:01kotarakp_l: the "loop in time" one, also
18:01cp2and waiting between downloads
18:02Raynesp_l: I also have a theory as to how we can surpass the speed of light.
18:02RaynesBy coding it in Clojure!
18:02cp2all my theories involve using a gameshark
18:03triddellHey, anyone here good at upgrading old code to the updated lazy stuff? Remember the old ants.clj? I think the ants are very lazy nowdays because the code doesn't fully run now. It probably only needs a couple changes but I don't know what they would be.
18:03RaynesMutable state taste like bacon.
18:04cp2triddell: mostly the only thing that has to be changed is lazy-cons to cons
18:04p_l... that's a bad analogy <--- loves fried bacon
18:04cp2i ran ants.clj recently and iirc thats all that needed changing
18:04Drakesoncp2: and rest -> next ?
18:04cp2er, i think
18:04cp2dont remember
18:05triddellI don't see lazy-cons
18:05kotaraktriddell: http://clojure.org/lazy has some hints how to port the code
18:05Raynes(doc lazy-cons
18:05clojurebotNo entiendo
18:05Raynes-_-
18:05Raynes(doc lazy-cons)
18:05clojurebotexcusez-moi
18:05RaynesO.O
18:05cp2what
18:05cp2lol
18:05triddellI don't see lazy-cons or rest in the code.
18:05hiredman(doc lazy-seq)
18:05clojurebotTakes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls. Any closed over locals will be cleared prior to the tail call of body.; arglists ([& body])
18:05Rayneswut
18:06hiredmanlazy-cons doesn't exist anymore
18:06Raynes:o
18:06RaynesI see.
18:06RaynesYou guys are tricking me to make me look stupid.
18:06cp2no, i said you need to change any lazy-cons call to cons
18:06cp2there might be others
18:06cp2but i dont remember
18:07cp2(for ants.clj)
18:07kotaraktriddell: compile your clojure with -Dclojure.assert-if-lazy-seq=true, that should give some warnings for nil punning in ants.clj
18:08kotarakif there is any, of course
18:08triddellkotarak: k, thanks for the link
18:22replaca_Back to the Lisp is God theme, this is a classic: http://xkcd.org/224/
18:46triddellFYI: the current ants.clj *already* supports the latest clojure :-)
18:49kotarakhehe :)
19:15danlarkintada! http://github.com/danlarkin/madison/tree/master
19:16kotarak~and suddenly...
19:16clojurebotCLABANGO!
19:17durka42that will never get old will it
19:18danlarkinnow I have a ton of work to do :-o
19:19kotarakdanlarkin: wait till the bug reports come in.... :]
19:19kotarakReleasing half past midnight is not a good idea....
19:20danlarkinhaha oh I don't know if there'll be bug reports... it's barely usable right now
19:20kotarakdanlarkin: haha there will, there will. users generally expect every release to be perfect!
19:21danlarkinruh roh
19:22cemerickdoes anyone know of a trie implementation in clojure?
19:23kotarakaren't vectors tries?
19:24cemerickperhaps, but they're implemented in java
19:24kotarakAh. Ok.
19:57hiredman,(doc nth)
19:57clojurebot"([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences."
20:26dreishOoh, neat: apply can apply macros.
20:28Chousukehuh?
20:28dreish,(apply #'when 1 2 ())
20:28clojurebot(if 1 (do 2))
20:28Chousuke:|
20:28kotarakThat's because the macro property is in the metadata of the Var.
20:28dreishGood call.
20:29kotarakwhen directly wouldn't work.
20:29Chousukethat's rather cool
20:29Chousukenow I wonder if it's actually usefuls
20:29Chousuke-s
20:29dreishWell, I was wondering how it might be possible to do an interpreted eval, since e.g., apply is 1000x faster than eval.
20:30Chousuke,(apply #'when [1 2 3])
20:30clojurebot(if 1 (do 2 3))
20:30kotarakclojurebot: eval
20:30clojureboteval is sometimes useful - but only sometimes
20:30dreishYes, I know.
20:30kotarakhmmm....
20:30kotarakclojurebot: eval
20:30clojureboteval is DENIED
20:30kotarakaha
20:30kotarakclojurebot: eval
20:30clojureboteval is evil
20:31dreishUsually I'm the one delivering this lecture.
20:31dreishNo, wait, I'm always telling people not to use macros.
20:31kotarakThat's also a good idea.
20:31kotarakBecause most of the time they really want a function.
20:32dreishYes.
20:33dreishI think it's a symptom of a desire to grok Lisp by shortcut.
20:34dreish"I hear macros are great" or "I hear eval is some mysterious wizardry", therefore, "I want to dive in and immediately write everything with macros and eval."
20:34kotarakJust a few days ago, someone recognised the limits of macros just be himself. Without help. That was a glorious moment. :)
20:39Chousermacros have limits?
20:39kotarakYes. Indeed they have.
20:39dreishThey're limited in the means of combinaaation.
20:40kotarak(def x [1 2 3]) (some-macro x) ; the macro sees x, not [1 2 3].
20:40Chouser@(resolve x)
20:41ChouserI'm just rousing rabble. don't mind me.
20:41kotarakChouser: please.... (defn foo [x] (some-macro x)) (foo [1 2 3])
20:42kotarakThis defn is a common "use case", people have with macros....
20:42dreishOther drawbacks to appeal to people who think they're some sort of all-purpose optimizing inliner: they increase the size of the code and force the JVM to do more work to optimize and inline.
20:42kotarakAnd their "solution" is almost always eval.... -.-
20:42Chouserwhy not use eval?
20:42Chouseroh.
20:42dreishBecause eval is about 1000x slower than apply. :)
20:42Chousersorry, I don't know why I'm saying any of these things
20:42Chouseras if we don't all have better things to do
20:43kotarakChouser: maybe because I say the things, I said above to often? ;)
20:43Chouserperhaps I'm in rhickey withdrawal
20:44dreishYou should be happy he's out spreading the gospel.
20:44dreishhttp://twitter.com/_benb/statuses/1324431942
20:46kotarak"factoring primes" ... I see the next speed discussion coming up...
20:46dreishTrue fact: the most efficient algorithm to factor a prime x is [1 x].
20:51Chousermaybe an array...
20:51Chousersee? what's wrong with me. argumentative for no good reason.
20:52dreishOh, that wasn't Clojure, that was a hypothetical language specifically written and optimized for returning two numbers.
20:53gnuvince_"Another macro bytes the dust"
20:59powr-tocLooking at core.clj, what are the (def unquote) and (def unquote-splicing) for?
21:00powr-tocare they defined later, elsewhere/
21:00powr-toc?
21:00dreish,'~foo
21:00clojurebot(clojure.core/unquote foo)
21:00hiredman,(macroexpand ~foo)
21:00clojurebotjava.lang.Exception: Unable to resolve symbol: foo in this context
21:00dreishIt's got to have something to resolve to.
21:00hiredmanjerk
21:00hiredman,(macroexpand '~foo)
21:00clojurebot(clojure.core/unquote foo)
21:01hiredman,(macroexpand '~@foo)
21:01clojurebot(clojure.core/unquote-splicing foo)
21:01shooverChouser: the good old days were when rhickey used to pop in from the airport when out giving talks. now he just hangs out in the pubs with the Londoners
21:01powr-tocdreish: cheers
21:01dreishPop in from the airport? As in, not spend a long time away?
21:01shooverpop into #clojure
21:02dreishAh right.
21:02dreishWell, when you put it that way, it does fill me with a jealous rage.
21:06slashus2I have noticed. If you use the Math/pow function for smaller powers you get a lot more overhead than if you just used (* 3 3 3) . I was experimenting with creating a macro like (defmacro ** [number power] `(* ~@(repeat power number))) , which creates a multiplication like the latter. It seems to be more efficient for smaller powers than the Math/pow function call.
21:08slashus2up to a certain point.