#clojure logs

2009-12-27

00:04AnniepooI'm not seeing documentation of #= in the list of reader macros
00:04Anniepoo,(doc *read-eval*)
00:04clojurebot"; When set to logical false, the EvalReader (#=(...)) is disabled in the read/load in the thread-local binding. Example: (binding [*read-eval* false] (read-string \"#=(eval (def x 3))\")) Defaults to true"
00:06Anniepooso what's this do?
00:11Anniepoo,(binding [*read-eval* false] (read-string \"#=(eval (def x 3))\"))
00:11clojurebotUnsupported character: \"#=
00:11AnniepooI take it the eval reader evaporated somewhere?
01:00mikehincheyAnniepoo: it's the \ in your code that gives that error
01:28Anniepoothanks Mike, that's a copy/paste from the *read-eval* docs
01:29Anniepoo,(binding [*read-eval* false] (read-string "#=(eval (def x 3))"))
01:29clojurebotjava.lang.RuntimeException: java.lang.Exception: EvalReader not allowed when *read-eval* is false.
01:29mikehincheywhich is what you set in the binding
01:29Anniepooyes, I understand
01:30Anniepooso where the heck's the docs for #=
01:30Anniepoothere's no #= in the reader macros
01:30Anniepoo8c/ I'm trying to work my way thru all the api docs
01:32mikehincheyare the others doc'ed other than clojure.org/reader?
01:32Anniepoothat's all I know of
01:32Anniepoohttp://clojure.org/reader
01:32Anniepoo#= doesn't appear on the reader page
01:33mikehincheyright, I think it was mostly internal, and doesn't work 100%. Not sure if it's a public api or not.
01:34Anniepoook
01:34mikehincheyit's quite useful when you need it, so I hope it gets full support
01:36AnniepooI'm making this injected agent server, it's a security hole, since it allows arbitrary eval
01:37Anniepoohow's it supposed to work?
01:38Anniepoo,(read-string "#=(eval (def x 3))")
01:38clojurebotjava.lang.RuntimeException: java.lang.Exception: EvalReader not allowed when *read-eval* is false.
01:40Anniepoo,(binding [*read-eval* true] (read-string "#=(eval (def x 3))"))
01:40clojurebot#'sandbox/x
01:42mikehincheythat does seem to be a hole, at least in clojurebot
01:43mikehinchey,x
01:43clojurebot3
01:43Anniepooyes
01:43Anniepooclojurebot's real security is simply that killing it isn't important
01:44Anniepooso what's the semantics supposed to be?
01:44mikehincheyor maybe read-string needs to disallow binging *read-eval*
01:45Anniepoothe form following #= is to be evaled and the value inserted?
01:45mikehincheyyes
01:45Anniepoook
01:46Anniepoomaybe it's the hour, but that wasn't clear
01:47Anniepooappreciate the help
01:53Anniepoo8c9 writing this thing is an adventure
01:56Anniepoothe auto doc generator doesn't put the right URL in the Source href apparently
01:56Anniepoo,(doc *print-readably*)
01:56clojurebot"; When set to logical false, strings and characters will be printed with non-alphanumeric characters converted to the appropriate escape sequences. Defaults to true"
06:26vyHow long have clojars.org been down?
06:34unfo-helloh. Should I be able to create sockets from the REPL? I am trying to figure out whether that is my error or if I just fscked up the code :)
06:40LauJensenunfo-: which REPL?
07:04unfo-LauJensen, I used IDEA's clojure plugin and started a new clojure REPL... :-)
07:04LauJensenunfo-: I'm an emacs-guy myself, but I can't imagine a restriction on the REPL which would prevent you from spawning sockets
07:05unfo-LauJensen, ok. well that's good enough for me :)
07:06unfo-http://github.com/unfo/stutter/blob/master/src/bot.clj this is what I am working with
07:07unfo-and when I do (start-bot "mybot" "irc.freenode.net" 6667 "") I get java.net.SocketException: Unrecognized Windows Sockets error: 10106: create (NO_SOURCE_FILE:0)
07:13LauJensen'...Windows...error...'
07:14unfo-yep. I knoez
07:14LauJensenI can't tell you more than your call to create is failing, so you have to figure out how to call it correctly
07:14LauJensenActually I think you should be able to check out http://technomancy.us/swank-clojure and see how he works with sockets
07:15unfo-thanks!
07:25vyunfo-: What does (java.net.Socket. "www.google.com" 80) return?
07:26unfo-vy, same error
07:27vyunfo-: JVM?
07:27unfo-java version "1.7.0-ea"
07:27unfo-Java(TM) SE Runtime Environment (build 1.7.0-ea-b66)
07:27unfo-Java HotSpot(TM) 64-Bit Server VM (build 16.0-b06, mixed mode)
07:28unfo-I was able to create sockets in IDEA on my Scala project whose codebase I am trying to port to Clojure now
07:30unfo-A HA!
07:30unfo-vy, when I started the REPL with java -jar clojure.jar clojure.main
07:30unfo-I was able to create a socket to Google!
07:30LauJensen"I forgot to plug in the internet"
07:30unfo-but from IDEA's plugin I am not
07:31vyunfo-: I think, it has something to do with environment variables.
07:31unfo-IDEA and/or its Clojure plugin is the culprit :)
07:31vySee http://forums.sun.com/thread.jspa?threadID=329241&start=0
07:31LauJensenunfo-: time to try out Emacs perhaps?
07:32vyLauJensen: Can you use SLIME of clojure with CLs (SBCL, CCL, etc.)?
07:33unfo-LauJensen, nah, if anything I'll go with vim ^^
07:33LauJensenunfo-: You mean M-x viper ?
07:33LauJensenvy: Yes
07:33vyIMHO, since Clojure is not that interactive as CL and has no interpreter (but just a compiler), it should prefer using a simple interface (aka haskell-mode) instead of trying to stand in the shoulders of a giant like SLIME.
07:33unfo-LauJensen, but I'll just prolly keep a separate cmd prompt in conj with IDEA for now :-)
07:33unfo-LauJensen, what is this viper?
07:34LauJensenDid you guys catch my screencast showing you how easy it is to set up ?
07:34vyLauJensen: SLIME version?
07:34unfo-LauJensen, I just joined. Please gimme url :-)
07:34LauJensenhttp://www.bestinclass.dk/index.php/2009/12/clojure-101-getting-clojure-slime-installed/
07:34LauJensenLets see if that cant change your mind :)
07:35unfo-^^
07:36unfo-if that is as easy as you make it sound, I shall boot to my ubuntu and try it ^^
07:36LauJensenIts a 12 minute screencast and I'm going real slow, so if you just follow the instructions you can get set up in about 5 minutes
07:37unfo-LauJensen, but what is viper? vi-mode in emacs?
07:38LauJensenunfo-: I'm told that Viper-mode makes Emacs act exactly like Vim for editing - though I don't see why that would be attractive, but usually when people say that Vim is better, I tell them that Vim is M-x viper, because then you get all the integration goodness of Emacs
07:38vyLauJensen: FYI, vimeo is dead slow!
07:38LauJensenvy: Really? Not from here
07:39unfo-LauJensen, I am not saying vim is better, I am saying, I am used to vim (edit/insert mode) + its keybindings :)
07:39unfo-LauJensen, but. time to boot to ubuntu and follow your screencast! :)
07:39LauJensenCool :)
07:39vyLauJensen: Mid. East and Asia colocations of vimeo is crawling.
07:45LauJensenOk, which alternatives work for you guys ?
07:46vyLauJensen: youtube is generally the best -- excluding regional alternatives.
07:49LauJensenk
08:58unfo-yeah! got my ircbot to connect and play PING PONG with server ^^. Thanks vy for helping :-)
09:21LauJensenunfo- congrats, did you get it to work from within IDEA ?
11:49fliebelWhat is the most simple way to parse some command line options? Some list magic? Java lib? Clojure-crontrib?
12:03the-kennyfliebel: I'm sure there are some java classes for this
12:04the-kennyfliebel: Oh, there's also something in contrib
12:04the-kennyhttp://github.com/richhickey/clojure-contrib/blob/ddd7bc2226927634dc0216554194877fa6f170e1/src/clojure/contrib/command_line.clj#L91a
12:18quizmecan you make new hierarchies during runtime?
12:49chouserseems like it might be interesting to use this to install and update clojure and/or lien: http://code.google.com/p/omaha/
12:50chouseroh, it's Windows only
12:53ohpauleezqed: You around?
12:57chouserquizme: yes
12:59quizmechouser thnx
13:08arj_I'm wondering. Is set! only for java or can it be used on refs as well?
13:38quizmeanybody here know of a good P2P library to build a P2P game on?
13:40ohpauleezDepends on what you're going for, but take a look at JXTA
13:40ohpauleezI built a P2P usenet-like system with it for a pet project, pretty powerful
13:41KirinDaveHey folks
13:41KirinDaveIf I'm looking at a clojure profile trace
13:41KirinDavewhat's clojure.lang.RestFn.invoke
13:42ohpauleezYou could also use rendezvous quizme if that seems more appropriate for your game. It really depends the type of data communication your game needs
13:42KirinDaveI'm curious why the code given in http://jng.imagine27.com/articles/2009-12-25-174540_palindromes_clojure.html is very slow compared to SBCL.
13:43quizmeohpauleez thanks i'll look at those.
13:44ohpauleezKirinDave: That is weird, let me look at it. I mean, SBCL is super fast, but it seems odd to be 20x faster
13:45KirinDaveohpauleez: Well it's not 20x faster.
13:45KirinDaveHe only runs it once.
13:45KirinDaveSo derp, yeah, pre-JIT it's going to be slower.
13:45ohpauleezright, there's no priming
13:45KirinDaveBut
13:46KirinDaveIt's still a factor of 5 or so.
13:46KirinDave25ms compared to 120ms.
13:46KirinDave I thought maybe the use of vectors there was the problem
13:47KirinDaveBut I remembered that clojure vectors are not the O(N) beasts everyone seems to expect. So I profiled
13:47KirinDavehttp://gist.github.com/264367
13:47KirinDaveIt looks to me like there is no clear bottleneck.
13:50quizmeohpauleez Rendezvous is called Bonjour now ?
13:51ohpauleeztechnically it's zeroconf
13:51ohpauleezhttp://en.wikipedia.org/wiki/Bonjour_%28software%29
13:51KirinDavequizme: Apple got into a legal battle over the name.
13:51ohpauleezit's just a way to do machine discovery and messaging
13:52KirinDaveSo it seems to me that the algorithm in question just doesn't perform well in clojure, at least by comparison to what SBCL is doing.
13:52KirinDaveOf course, SBCL is notoriously fast.
13:52KirinDaveWith crap like churning through data and recursing big data structures.
13:53KirinDaveAsk it to build a string and it'll fall over and die, ask it to compute factorial 1000 and it'll be done in 4 cpu cycles.
13:53quizmewhich is easier to use? jxta or zeroconf ?
13:55ohpauleezKirinDave: totally, I think it just comes down to that
13:56ohpauleezquizme: it really depends on the type of game you're making and the type of communication you're going to need
13:56KirinDaveHuh, I ran it again with more runs
13:56ohpauleezKirinDave: ie: priming the JVM to jit it?
13:56quizmeohpauleez: pong
13:56KirinDaveohpauleez: well I just ran it like 10 times :D
13:57KirinDaveohpauleez: http://gist.github.com/264369
13:57KirinDaveActually i am slowly seeing more vector stuff rise to the to
13:57ohpauleezquizme: it's a nice simple project to learn the basics of JXTA (discovery, etc)
13:58quizmeohpauleez: yeah. i just want to teach myself p2p programming using clojure
13:58ohpauleezJXTA is a great set of protocols and utilities
13:58ohpauleezand the guy who heads the project is an awesome dude
13:59quizmeohpauleez: k. i'll try JXTA out. is the o'reilly book the best one ?
13:59ohpauleezquizme: for pong, you can probably get away with just tutorials and information online
14:00ohpauleezKirinDave: is the optimized version really that optimized for clojure?
14:01ohpauleezwhen I optimize clojure I do things like primitive types where I can, transient when building via auxiliary functions, pmap when it makes sense, and use agents to disect the problem space
14:02ohpauleezit's optimized in runtime complexity, but not really optimized to play to clojure's strengths
14:02KirinDaveohpauleez: It's "optimized" in that it's complexities are better.
14:02KirinDaveWell
14:02KirinDaveSir
14:02KirinDaveMay I recommend that you tackle the optimization. :D
14:03KirinDaveAs I'd love to see how an experienced clojure-ite would deal with this
14:03KirinDaveThere's no smoking gun in the profiling.
14:03ohpauleezhaha, i did just finish up with qed's optimization, I'll take a stab at it
14:03KirinDaveOkay.
14:03ohpauleeznah, I just looked at the new link you dropped in, nothing super obvious
14:07KirinDaveAnd of course the news.ycomb folks are having a field day. :\
14:10ohpauleezlink?
14:13KirinDaveohpauleez: http://news.ycombinator.com/item?id=1016566
14:13ohpauleezKirinDave: thanks
14:13KirinDaveSorry on the delay
14:13KirinDavegotta be heading out soon, so I gotta make mah latte.
14:24LauJensenEvening gents
14:25ohpauleezevening lau
14:26ohpauleezI haven't watched your web dev video yet, but it's on my TODO list for today
14:29replacaQ: when using "mvn clojure:swank", does anyone know how to up the java vm size? I tried MAVEN_OPTS, but that only influenced the maven's VM, not the swank VM.
14:36arj_I'm wondering. Is set! only for java or can it be used on refs as well?
14:38ohpauleezset! and be used on vars arj_
14:38ohpauleezhttp://clojure.org/Vars#toc1
14:39arj_yeah that's the part I read and I didn't understand it properly
14:39arj_so you say it can, do I need a dosync outside, like ref-set?
14:40ohpauleezref-sets must be in dosyncs. You can use an atom and use swap!s and reset!s
14:41ohpauleezall operations to mutate a ref have to be in a dosync though, that's really their power, being done with an STM
14:41ohpauleezbut you can set! a var
14:42Chousukeonly if it's been thread-locally bound though.
14:42ohpauleezhere's a good resource: http://java.ociweb.com/mark/clojure/article.html#ReferenceTypes
14:42arj_Chousuke: so only if I use like binding or let?
14:42ohpauleezarj_: yeah a binding form
14:43Chousukearj_: binding only
14:43Chousukearj_: let creates locals, which are not vars at all
14:44arj_ok, the link that ohpauleez sent explains it pretty well
14:44arj_thanks :)
14:44ordnungswidrighi all.
14:44ohpauleeztotally welcome
14:44ordnungswidrigwhat's the current state of the art unit test framework?
14:45ordnungswidrigI remember something moved either into contrib or from contrib into core
14:47replacaordnungswidrig: as of the 1.1 branch (master and the 1.1 release candidates), testing is in clojure.test
14:48ordnungswidrigreplaca: ah, thanks. are the docs uptodate on clojure.org or do they refer to 1.0?
14:48replacaclojure.org api docs refer to the master branch
14:49replacayou should see clojure.test in the left column when you jump into the API
14:50ordnungswidrigreplaca: oh, yes.
14:55ordnungswidrighmm, I dislike the selection of fixed-with font at the clojure api page. I'd prefer that my selection in the browser would be used
14:55ohpauleezLauJensen: in the compojure video...
14:55ohpauleezyou used a for, but doesn't it make more sense to use a doseq?
14:56ohpauleezsince you don't need evaluation results
14:57ohpauleezor is the point moot?
15:02ordnungswidrigCan I determine the version of clojure quickly from a REPL?
15:03ohpauleezordnungswidrig: when you start the repl, it'll be the first line printed
15:03ohpauleezfrom the command line
15:03ordnungswidrigohpauleez: I swank-connect to a repl started long time ago :-)
15:04ohpauleezahhh gotcha
15:06ordnungswidrigclojars down?
15:19LauJensenIts answering pings
15:19LauJensenBut other than that yea, its toast
15:21_mstI sent _ato an email last night but haven't heard back unfortunately
15:22_msthis site at meshy.org runs off the same box and seems to be up, so not sure what's going on there...
15:22ordnungswidrig_mst: I guess an update took place :-)
15:22LauJensenWould be nice to see the backtrace
15:23_mstthe new version sure is minimal :)
15:39replacaordnungswidrig: re: fixed width in docs: unfortunately variable width fonts muck up the formatting of lots of doc strings (which include code, indenting, etc.)
15:40replacaordnungswidrig: so even though regular fonts would be preferable, fixed width seems to end up working better
15:40ordnungswidrigreplaca: yes, but the container is a pre, IIRC. And a pre must be rendered with a fixed with font.
15:41replacaordnungswidrig: I'm not getting your point...
15:42ordnungswidrigreplaca: the documentation text is formatted as <pre> which I consider ok following you argument above. but I dislike that the font is specified for the pre by the css stylesheet (in wiki.css) as I, personally, prefer Menlo over Monaco as fixed width font.
15:43ordnungswidrigthe pre is ok, but omit the font declaration in the css. pre is rendered with a fixed width font by default.
15:43replacaordnungswidrig: ahh, ok. That makes sense. I think the problem there was different browsers made radically different choices that messed things up
15:44replacaordnungswidrig: but let me play around with it and see if I can drop the css and have it work right
15:45ordnungswidrigreplaca: I see. IIRC there was a browser which interpreted pre in a way to value the line breaks but to use a proportional font. setting "monospace" as font shall give a reasonable default on many systems.
15:45ordnungswidrigreplaca: or consider a <pre><tt></tt></pre>
15:47replacaordnungswidrig: yeah, I think you're right (re: proportional default). I'll play with some of the other choices you suggest cause I'm not very happy with the current setup either
15:48ordnungswidrigI have a lein dep on clojure-master-1.1.0-SNAPSHOT
15:49ordnungswidrigwhich reports in the repl as 1.1.0-alpha-SNAPSHOT and comes from clojure-1.1.0-master-20091223.150146-8.jar
15:50replacaordnungswidrig: so you should have clojure.test there
15:50ordnungswidrigreplaca: (use :clojure.test) (is (= 1 1)) -> java.lang.Exception: Unable to resolve symbol: is in this context (NO_SOURCE_FILE:2)
15:51replaca(use 'clojure.test)?
15:51ordnungswidrigreplaca: *doh*
15:51replacaI don't think keyword works for the namespace (unless something's changed)
15:52replacagotta go!
15:53ordnungswidrigreplaca: cu!
16:28mebaran151_if I put a seq on an iterator, will the seq immediately consume the iterator or does it keep it pseudo lazy?
17:03ordnungswidrigdoes anybody have a pointer on howto use leining with 1.1-master? I keep having 1.1.0-alpha in bootclassapth
17:06technomancyordnungswidrig: that shouldn't be a problem; stuff on the boot classpath should be shadowed by stuff in the project classpath
17:06technomancyall the project stuff is run in a subclassloader
17:08ordnungswidrighm, I just did a lein self-install and will see if it updated itself. Maybe thats the issue
17:09technomancyself-install is just for pulling in the jar file when all you have is the bin script. haven't got any code to pull in a new version.
17:10ordnungswidrighmm. the repl reports a 1.1-alpha in project.clj I have 1.1.0-master-SNAPSHOT
17:11ordnungswidrigclojure.test exists in the repl. Now I'll try swank
17:11technomancyoh... that's a known issue; the repl task is the one place where a subclassloader is not used
17:11technomancyswank should be better
17:13ordnungswidrighmm, I have (ns foo (:require clojure.test)) (is (= 1 1))
17:13ordnungswidrig-> Unable to resolve symbol: is in this context
17:15ordnungswidrigwhen C-c C-l'ed in emacs
17:18technomancyordnungswidrig: yup
17:18technomancyrequire is not use
17:18ordnungswidrigtechnomancy: *doh* you actually might be correct. I copy-pasted it from the clojure.test docs
17:20technomancyordnungswidrig: yikes; if it really says that you should report it as a bug
17:20ordnungswidrigtechnomancy: see yourself http://richhickey.github.com/clojure/clojure.test-api.html
17:21Chousukethe docs are correct, but misleading.
17:22ordnungswidrigOh man, I doubt I get around use and require...
17:22Chousukeyou should use :require, but the overview obviously assumes you have used :use :)
17:22ordnungswidrigChousuke:
17:23ordnungswidrigChousuke: is there some overview on require and use and import and ns when loading, gen-classing and in the repl?
17:23technomancyordnungswidrig: that's really weird; I don't see why the HTML docs say that
17:23technomancyit's not in the source the docs are generated from
17:23technomancyreplaca: ^ any idea about that?
17:24Chousukewell, import is for java stuff, require is for importing the namespace without importing its names into your current namespace (ie. you need foo/bar to access them) and use just imports the names to your namespace (can access them as just bar)
17:24Chousukeyou shouldn't really use use :)
17:25Chousukerequire supports aliasing the namespace, so it doesn't lead to much more typing either.
17:25ordnungswidrigChousuke: I'll print this one. Thanks.
17:25Chousukethere has been talk about redoing the ns macro to something less confusing
17:25Chousukebut I don't think anyone has yet implemented anything
17:26ordnungswidrigChousuke: I'm currently fighting many loose ends. Clojure is still new for me, back to emacs since a long time. Now on OSX since two weeks (different key in emacs) and so on. Thanks for your help.
17:26ordnungswidrigand good night
17:28technomancyit'd be helpful not to use the word "import" for bringing an ns's vars into another
17:41patrkristhe way to emit from an xml-zip is by using clojure.xml/emit?
17:41patrkris*emit xml
17:42LauJensenThink so
17:45patrkristhanks LauJensen (fellow dane :))
17:45LauJensenuuh :)
17:45patrkrisgode webcasts i øvrigt
17:46patrkris(i'll quit the Danish now :))
17:46LauJensenThanks a lot!
17:52replacatechnomancy, ordnungswidrig: The docs say require because "use" is considered bad form (and may cause problems if there's a conflict). But if you use require, you need to spec the namespace on the funcs. But that's just an example, of course you can use any variation, as appropriate.
17:52replacathat having been said, probably I should just drop the usages altogether from the clojure namespaces
17:53replacathat was more for contrib, where the pages aren't named the same as the namespace
17:53technomancyreplaca: yeah, if the docs for each namespace don't agree about require vs use then it could just be confusing.
17:56replacatechnomancy: well, everything says require now, I think
17:56replacaIt used to say use way back in the google wiki days
17:58technomancylet's just deprecate them both and move on. =)
18:02replacasounds about right :-)
18:21chousermebaran151: it'll stay lazy
18:21mebaran151thanks chouser
18:42ieureHow do I cast a numeric string to an int? e.g. (int "5") just throws: java.lang.String cannot be cast to java.lang.Character.
18:43pdksame way as in java, (Integer/valueOf "5")
18:43pdkgotta remember all the java classes and crap are still accessible through clojure
18:43ieurepdk, I don’t know Java at all. Thanks.
18:43ieureI know they’re accessible. I just don’t know Java.
18:43pdkhm ok
18:44ieureIs that preferable to (Integer. "5")?
18:44pdki dont see much reason to do one over the other
18:44ieureOkay. Thanks.
18:44pdkthough people are probably used to using valueof
18:47ieureI googled, but I think I used the wrong terms.
18:48ieureI really can’t stand Java, but Clojure is interesting to me.
18:48ieureIt makes the Java bits mostly tolerable. I just don’t know the library well.
18:59_mstlooks like clojars is back up
19:17mebaran151how do you install lein plugins: I'd like to push my bdb library to clojars
19:18mebaran151it's the best one I've seen on the internet (I sort of compulsively wrapped everything, and then wrote some nice seq code over it over again)
19:20mebaran151I actually thought parseInt was the more Java-y way to do it
19:35webuseridhi folks,
19:36webuseridI'm new to clojure and java. I've got emacs set up with slime and clojure. I now have a REPL. I was trying to get clojure-processing running. I need to know how I can add libraries to clojure.
19:36pdkyou can load additional jar/class files from the command line with the -cp option
19:37pdke.g. javac -cp misc-classes.jar myprogram.java; java -cp misc-classes.jar myprogram
19:37webuseridI got emacs set up following i
19:38webuseridthis guide. http://www.bestinclass.dk/index.php/2009/12/clojure-101-getting-clojure-slime-installed/
19:38webuseridI don't start clojure manually, emacs does it for me. So how may I go about my way in this case?
19:40webuseridpdk: ^^
19:40technomancywebuserid: if you start a new project with leiningen, (putting all the deps in lib/) you can do M-x swank-clojure-project to set up the classpath for you
19:40technomancyyou don't have to use leiningen, but it's the easiest way to get your dependency jars handled
19:40technomancy(you don't want to do that by hand; it's a huge pain0
19:41technomancy)
19:41webuseridcan i use the "java.library.path" paths?
19:45webuseridtechnomancy: I'm a newbie, what's my best bet to get the darn thing working? :)
19:47technomancywebuserid: for sure the easiest way is to create a project directory if you haven't already and just toss the jars in lib/ inside that. then use M-x swank-clojure-project to launch slime.
19:47webuseridcool.
19:48technomancysee the README under usage
19:48patrkrisis clojure.contrib.zip-filter.xml/xml-> unable to filter on tags that have namespace prefixes?
19:48technomancythe swank-clojure readme, that is
19:48webuseridwas about to ask.
19:48webuseridthanks.
19:51technomancywebuserid: if you use leiningen, you can have it download processing as a dependency by adding [org.clojars.fyuryu/rosado.processing "1.0.7"] to the :deps section of project.clj
19:54webuseridtechnomancy: cool.. I will look into that.
20:00mebaran151yay I pushed my first clojar
20:01mebaran151who would have thought maven could be so .... useful (and not hire fire inspiring in the least)
20:01mebaran151*hair
20:01webuseridtechnomancy: sorry to sound dumb, but how do i get leiningen to set up the project for me.
20:03webuseridDo I have to be root to install using lein?
20:03webuseridtechnomancy: ^^
20:10the-kennywebuserid: What should do leiningen when it "sets up the project"?
20:12webuseridresolve the dependancies?
20:13webuseridHe said I could add clojure-processing as a dependency. I was trying to figure out how and how to get it to play along with emacs and slime.
20:14webuseridthe-kenny: ^^
20:15the-kennywebuserid: If you have all dependencies etc. in your project.clj, just run "lein deps"
20:15webuseridfrom the project directory?
20:15the-kennyAfter that, you can just start a repl in emacs with M-x swank-clojure-project
20:15the-kennyyes
20:15the-kennyit will pull all deps for you and put them in lib/
20:16webuseridcool..
20:16webuseridYou're a star.
20:18the-kennyYou're welcome ;)
20:29webuseridthe-kenny: I get an exception with lein. http://pastebin.com/m7b6c75ae
20:30the-kennywebuserid: Check you sources. Looks like you try to redefine "test"
20:31webuseridthe-kenny: The directory is named test. Perhaps that's why.
20:35webuseridthe-kenny: It's not the directory name. I get the exception again. What do you mean check my sources? I haven't written anything yet to redefine anything.
20:37the-kennywebuserid: hm.. sounds strange
20:58KirinDaveIs there a summary of the performance characteristics of the various clojure data structures?
20:59mitchellhKirinDave: If I recall, the data structures section (or primitives) of the clojure.org website mentions it.
20:59KirinDavehttp://clojure.org/data_structures does not mention.
21:00mitchellhKirinDave: I know Lists = O(1) insert, O(n) lookup (singly linked lists, inserts at head)
21:01the-kennyUhm.. anyone has problems with emacs 23 and (require)?
21:01mitchellhKirinDave: Vectors = O(1) lookup, and I think its average O(logn) insert (or nlogn, I can't remember how they're implemented tbh)
21:01the-kennyI get weird errors, but it works in *inferior lisp*
21:01mitchellhKirinDave: I saw these in a talk, I think its channel 9's interview with Rich Hickey
21:02KirinDavemitchellh: There is no asymmetry in vectors for prepend or append tho, right?
21:02KirinDaveThey're like giant tries.
21:02mitchellhKirinDave: Correct
21:02mitchellhKirinDave: KirinDave:
21:02mitchellherrr
21:02mitchellhKirinDave: http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Rich-Hickey-and-Brian-Beckman-Inside-Clojure/
21:02mitchellhHe goes over imlementation details of the primitives at some point there, just seek until you see a trie drawn, then seek backwards a bit
21:03replacatechnomancy: is there anyway to increase the heap size for swank-clojure through "mvn clojure:swank", lein, or some other mechanism?
21:03KirinDaveFucking silverlight.
21:03KirinDaveI'm not going to install it. I need that shit at work already, and I hate it.
21:03replacamy read of the code says "no"
21:03the-kennyreplaca: Maybe with the "extra-jvm-args" in swank-clojure.el
21:05replacathe-kenny: yeah, I think that works when you start inside emacs. I've been starting externally from maven (to run incanter)
21:05replacamaybe I'll have to switch
21:06KirinDaveSo let me guess
21:07KirinDaveFor problem #1, you made a lazy sequence of multiples of 3 and 5, zipped them, then kept iterating over it while below 1000. :)
21:08KirinDaveDon't even need to zip, I guess.
21:08the-kennywoho, new design for github
21:14replacathe-kenny: what's different?
21:14replacaoh, I see - on the project pages
21:15the-kennyreplaca: Yes, the project page.
22:00tolstoyHm. So, clojure.main doesn't handle -D params automatically?
22:01tolstoyYou have to java -cp ... -Dthis=that clojure.main?
22:01chouserput them before clojure.main on the ... right
22:01tolstoyThat means my shell script invoker needs to be smart.
22:01chouserthe stuff after clojure.main gets passed into your code via *command-line-args*
22:02tolstoyYep, that makes sense, of course.
22:03chouseryeah, the launch script I use picks out -D, -X, -cp ...
22:05tolstoyWorkable enough. Eventually I figure I'll go the leiningen uberjar route for this little app, which solves that prob.
22:06technomancyKirinDave: actually I think append and prepend are asymmetric for vectors
22:06technomancyvectors grow cheaply only at the tail
22:06technomancyreplaca: it might respect JAVA_OPTS, but I haven't confirmed it myself
22:25KirinDavetechnomancy: Hum
22:26KirinDavetechnomancy: We were earlier looking at that news.ycomb example of palindromes.
22:26KirinDaveSo that's why it came up.
22:54_mstKirinDavE: I wrote to the author of that palindromes article to point out that running repeated test runs gets a lot faster
22:55_mstfrom 500ms to around 60-70ms on my machine here
22:55KirinDaveIt never gets to 60-70 on mine.
22:55KirinDavePerhaps you have a more powerful machine.
22:56KirinDaveI never get below the range of 150ms, which is still a bit more than a halving of the total time.
22:59_mstKirinDave: I might've run with -XX:UseAggressiveOpts and -server when I was testing, not sure if that makes a difference
22:59_mstI gave it a quick run with hprof and nothing jumped out as being terribly slow, but I didn't really pick it apart to see how the code worked
23:00KirinDaveYeah
23:00KirinDaveI posted some profile runs earlier
23:00KirinDaveThe vector opts all together do stand out, but only in the 5% of the top 10% range
23:01replacatechnomancy: ok, thanks, I'll give it a try
23:01KirinDave_mst: Unrecognized VM option 'UseAggressiveOpts'
23:02_mstah sorry, -XX:+AggressiveOpts
23:02KirinDaveOh wow
23:02KirinDaveI got some runs down by 90ms.
23:03KirinDaveThat's a heck of a magical invocation there
23:03_mstheheh excellent
23:39replacano luck on JAVA_OPTS via maven. Looks like folks have hacked on some "clojureOptions" stuff, but I don't see how to set it
23:39technomancyreplaca: oh, I meant for leiningen
23:45ozarusanHow do I get from [1 2 3 4] to [1 [2 [3 [4]]]]?
23:47technomancyozarusan: (reduce (fn [acc x] (conj acc (vec x))) [] [1 2 3 4])
23:48ozarusan,(reduce (fn [acc x] (conj acc (vec x))) [] [1 2 3 4])
23:48clojurebotjava.lang.Exception: Unable to convert: class java.lang.Integer to Object[]
23:52tolstoy,(reduce (fn [acc x] (conj acc (vector x))) [] [1 2 3 4])
23:52clojurebot[[1] [2] [3] [4]]
23:58technomancyuh... yeah that's not right