#clojure logs

2010-07-31

00:11cpfrhey how could I extend a java class in clojure
00:21technomancyDrakeson: sure; go ahead and experiment in a branch
00:21technomancyDrakeson: how come though? what's the advantage?
00:22technomancydsantiago: you can do it with leiningen checkout dependencies
00:22technomancybut it's awkward to do with swank by itself
00:29dsantiagoI mean, does that let you maintain two separate repls in slime at the same time?
00:31technomancyoh, connecting to two separate swank servers at once?
00:31technomancyI haven't tried that. it may be possible.
00:31dsantiagoWhen I try it gets rid of the first repl, as far as I can tell.
00:32technomancyI always just keep two separate Emacs instances up
00:33dsantiagoAh, I don't think I can do that on Mac.
00:33dsantiagoThanks.
00:33slyrusyou can already do that on two seperate ports, no?
00:33technomancyyou can, but OS X makes it hard.
00:33technomancyat least for GUI instances
00:34dsantiagoYeah, I gotta use Aquamacs to make it tolerable.
00:34technomancyeep.
00:37leifwhas anyone gotten a successful emacs/slime/nailgun/clojure setup working?
00:37leifwassuming I figure out my regular emacs/slime/clojure problems, it would be nice to stick nailgun in there too
00:37technomancyleifw: what does nailgun get you?
00:37leifwnot like I'm starting and stopping slime all the time, but it would be neat I guess
00:37technomancyyou mean being able to use a single instance from either Emacs or the CLI?
00:37leifwpretty much
00:38technomancyI think a socket-repl would be an easier way to attain that
00:38leifwinteresting
00:38technomancythere's a socket-repl in contrib that's easy to use; just start that and telnet to it
00:38fualodsantiago: Aquamacs makes things hard...
00:38leifw:o
00:39technomancyleiningen 1.3 may allow you to enter multiple tasks at the command line with something like lein clean, jar, test leiningen.test-core, repl
00:39technomancyany objections to using commas as a task separator?
00:40dsantiagoYeah, but what're ya gonna do?
00:41fualoare there any folks that aim to make other implementations of clojure?
00:43technomancyfualo: there's clojureCLR; I think everyone else is waiting for Clojure to be closer t oself-hosting
00:43Scriptorfualo: what do you mean other implementations? As in other backends?
00:44slyrusclojure on CL would be nice :)
00:44technomancyslyrus: you can adapt my clojure-on-elisp compiler to output CL =)
00:45technomancythe one I haven't started
00:45slyrusI assumed the clojure-on-elisp things was a joke, right?
00:45slyrusah, ok.
00:45technomancywell it would be foolish to start a new implementation right now with clojure-in-clojure "just around the corner"
00:45ScriptorI'm working on a kinda-like-clojure-not-really to php compiler
00:46Scriptorif anyone wants to lose their sanity and help :p
00:46slyrustechnomancy: but I'm assuming clojure-in-clojure will still run on the jvm, no?
00:46slyrusit's just that the java bits of the source tree will move to clojure
00:46technomancyslyrus: right
00:46slyrusmy hypothetical clojure-on-cl would not use the jvm
00:47technomancysure, there's plenty of talk of porting to other runtimes
00:47technomancyllvm, JS, etc.
00:48slyrusstm, seqs, the new object model, etc... would all make for a nice lispy dialect on top of, say, SBCL's compiler infrastructure
00:48technomancyslyrus: there's also talk of porting qi to clojure
00:48technomancyno idea how serious that is
00:50dsantiagotechnomancy: Is that take all based on waiting for clojure-in-clojure, or going ahead without it?
00:50technomancythat "plenty of talk" you mean? yeah.
00:52fualotechnomancy: seld hosting?
00:52fualo*self
00:52fualoas in not on jvm?
00:53Scriptorfualo: as in it's all written in clojure, I think
00:53technomancyfualo: no, as in not implemented in the Java Programming Language™
00:53fualoah, cool
00:53slyrustechnomancy: what's wrong with spaces? lein clean jar "test leiningen.test-core" repl
00:53fualoI just wonder if people will split from the jvm...
00:54technomancyslyrus: well it's much more common to want to give an argument to a task than to want to chain tasks
00:54dsantiagoIf there was a version of Clojure that would let me write Cocoa apps, I'd totally use it.
00:54technomancyso spaces are used for that.
00:55dsantiagoSomething like Macruby.
00:55technomancyit's possible
00:56dsantiagoIf I was smart enough to understand all the things clojure does, I'd work on it. I need someone better, though.
00:57technomancymaybe by the time clojure is self-hosting you'll understand it better. =)
00:57dsantiagoThat's what I was hoping for.
00:57dsantiagoIf the STM stuff is rewritten in Clojure, it becomes a lot easier.
00:58slyrustechnomancy: back to the here and now... any chance clojure-mode could do (def...) style processing for (foo/defmoose ...) instead of just (def...)?
00:58slyrusin particular it's the fnparse defrules that are killing my indenting
00:59slyrusbut, besides that, did I say how awesome fnparse is? oh yeah, I think I did -- a couple of times even
00:59technomancyslyrus: it probably could. I'm not sure the specifics of how, but I'm sure it could be done with some elisp pokage.
00:59slyrusaren't you the clojure mode maintainer? :)
01:00slyrusd'oh
01:00slyrusjochu is, I guess
01:00technomancyI'm the ... steward.
01:00technomancymaintainer is kind of a strong word.
01:00slyrusheh
01:01slyrusthe regent
01:03daakui'm reading the docs, but i'm not getting why this wont work in the repl: (gen-class :name user.t1 :extends Exception) (new user.t1)
01:04daakudo i need to trigger some sort of explicit compile on it? or import it?
01:04technomancydaaku: there are less-awkward ways of signaling exceptions than subclassing; have you tried clojure.contrib.condition or error-kit?
01:04technomancybut yeah, you need to perform an explicit compilation step. kind of annoying; better to avoid it if you can.
01:07daakui'm reading about conditions now, but i looked at error-kit and couldn't figure out how to make it "except"
01:07daakuseemed like it continue was the only option, or throwing an exception, which meant the higher level needed another fork
01:07daakui guess i didn't quite get it
01:08technomancyerror-kit is much more involved than c.c.condition
01:09technomancyc.c.condition is really slick. I could see it being part of Clojure itself some day.
01:10daakutechnomancy: i'm having a hard time finding docs for this :(
01:11brehautdaaku have you seen clojuredocs ?
01:11technomancybasically you can raise a map with arbitrary fields and it's treated like an exception
01:11technomancythen you can use the handler-case macro like you'd use try except instead of exception classes you put a predicate there
01:11daakubrehaut: yeah, didn't have anything more
01:12daakutechnomancy: thank you, that makes perfect sense now :)
01:12brehautdaaku aight sorry bout that then
01:12technomancythe first clause to match the raised condition acts as a catch clause
01:12daakuso destructring to match exceptions of sorts?
01:12technomancykind of
01:12daakureminds me of erlang's pattern matching
01:13technomancyanyway, it's under-appreciated.
01:13daakutechnomancy: i'll give it a shot
01:13tomojI wonder if this "Overriding previous definition of reference to.." stuff is nothing to worry about
01:14technomancytomoj: some ns you're using hasn't been updated for Clojure 1.2
01:14tomojah
01:15technomancyprobably something like seq-utils
01:18tomojstrange that it happens during `lein deps`
01:19tomojvirgin project from `lein new`, add swank-clojure 1.3.0-SNAPSHOT to :dev-deps, then `lein deps` gives two of those warnings
01:22technomancytomoj: can't repro here. which lein?
01:23fualocan closures in clojure maintain state with lexically-scoped variables in different invocations?
01:23technomancyfualo: sure, if you close over an atom
01:23technomancyor an agent, ref, etc. but usually an atom.
01:23brehautfualo: have an example http://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/session/memory.clj
01:24tomojtechnomancy: 1.2.0
01:24brehaut;)
01:24fualoah, interesting technomancy...
01:24technomancytomoj: weird... if you can repro with the latest master on git please open a ticket
01:24tomojwill do
01:24fualothanks brehaut
01:25brehautfualo: it has the additional detail of faking an object with a map but you can happily ignore that
01:25technomancyg'night (UGT)
01:28fualothis is a weird question too, but how exactly to closures maintain the values of local variables across calls?
01:28fualoI thought these local variables in the stack were destroyed
01:29brehautfualo thats what 'closure' means really
01:29brehauta closure is not dissimilar to an object with a single method
01:30fualobut there is nothing in the function body that specifically says "keep this around" is there?
01:30brehautthe reference to the name
01:30brehautthe compiler is able to infer that the name comes from a scope outside the function
01:30brehautbased on what you do with that function the compiler can work out how to handle it
01:31brehauti dont know how detailed clojure's compiler is with regard to those sorts of optimisations but there are a lot of options available to it.
01:32brehautif you want to see some mind blowing stuff, have a read about what Steele's original scheme compiler did with lambdas
01:33fualoha, I will
01:33fualothat would be interesting
01:33brehautit is
01:33dsantiagoDumb question: When a closure is made around a local variable, does that variable stay the same every time the closure is invoked, or can it change between invocations?
01:33brehautdsantiago: if its a clojure value (ie immutable) and not wrapped in a ref
01:33brehautthen yes, it stays the same
01:34brehautif its a java object, then maybe not
01:34brehautif its a ref type, you have some fairly clear semantics about how it might change
01:34dsantiagoRight, I'm not talking about immutables in closure specifically, I was actually wondering about other lipss in general.
01:34brehauti couldnt say about lisps in general
01:34brehauti believe schemes variables are by default somewhat similar to clojure's 'var' reftypes
01:35brehautwhich is to say dynamically bound variables
01:35Chousukelocals in other lisps tend to be mutable.
01:35fualoOh, I get it
01:36fualoit's the nested functions in a closure that give it the ability to store state
01:36fualoright?
01:38brehautits more about there being a function defined within a scope, eg (def counter (let [c (atom 0)] (fn [] (swap! c inc))))
01:38brehautin that example you have a fn inside a let
01:39brehaut(that form is sometimes known as let over lambda)
01:39brehautthe let is defining a scope that surrounds the fn, but the fn is passed back as the result of the let expression
01:40brehauti dont think im helping am i?
01:41fualobrehaut: this is!
01:41fualoI am very close to understanding this
01:41brehautexcelent :)
01:41brehautits one of those concepts that is actually quite simple, but seems way more confusing than it really is till you've got a handle on it
01:41dsantiagohttp://letoverlambda.com/index.cl/guest/chap2.html#sec_5
01:41fualobrehaut: and I've been thinking currying was closures for ages
01:41brehautfualo what languages are you coming from?
01:42fualobrehaut: R, Python, C, perl
01:42fualosome lisp
01:42brehautfualo: i can only speak for Python and C. C has nothing like closure, python does although its scoping rules are a bit... curious (though you often dont get bitten by them)
01:43brehautpython doesnt have a construction that is like let, so you would have to use another function to define the scope
01:43fualoso the magic of closures comes from (1) returning functions from functions and (2) lexical scoping?
01:43brehautyes
01:44brehautalthough if you think about (let [a 1] (map #(+ a %) [1 2 3 4]))
01:44brehautthe #( ) fun there is also a closure
01:44brehautso its more about the lexical scoping
01:45brehautdsantiago: excellent link
01:45fualobrehaut: ah, I get it
01:45dsantiagoYeah, answered my question, I think it's a good explanation.
01:45fualoit is the lexical scoping
01:45brehautdsantiago: yes
01:45fualothanks so much brehaut
01:45brehautno worries
01:46fualothat is a great link dsantiago
01:46fualoI may have to get that book
01:46brehautjust dont ask me to explain continations ;)
01:46fualoha
01:46fualoI may have to get that book
01:47fualoI've learned quickly that I can't learn clojure to learn FP... I have to learn FP to learn clojure (well, at least)
01:48brehautfualo: it's best to learn FP in tandem with a language
01:48fualoyea, I am doing that too
01:48fualowith clojure and emacs lisp
01:48brehaut(better yet, languages - a lisp and an ML is ideal in my opinion)
01:48ChousukeRather you can learn Clojure without knowing FP, picking up the basics, and once you have learned enough FP, you get to relearn Clojure the right way :P
01:49brehautfualo: you might find a more gentle introduction to FP than Let over lambda a less punishing introduction
01:49brehautit gets pretty deep pretty fast
01:49fualoah, good to note
01:50fualoI looked at The Little Schemer, but the format is... difficult
01:50brehautthe little schemer is a fantastic book
01:50brehautbut its unussual
01:50brehautmy recollection is that by the end of it you will know how to write a Y implementation
01:50fualoY implementation?
01:51slyrusy combinator?
01:51brehautThe applicative order fixed point y combinator
01:51brehaut(or some permutation of those words)
01:51absalomI took Robinb Popplestone's famous class on scheme.
01:52absalomGood class.
01:52brehautfualo: http://www.dreamsongs.com/NewFiles/WhyOfY.pdf
01:52absalomDevoted two sessions to the gamma combinator too.
01:52absalomNo one understood it at the end though.
01:52brehautheh
01:52Chousukewhat helped me to understand FP was thinking of code as expressing a transformation, instead of a seriers of instruction
01:52Chousukes
01:53absalomWrite some programs in an applicative style.
01:53brehautfor me it was sitting down and learning the λ calc
01:53brehautand writing a lazy interpreter for it
01:53absalomPeople are better at understanding things once they have a motivation for them.
01:53brehauttotally
01:54callen-nycjavascript is remarkably good at teaching people the value of closures and currying, in my experience.
01:54callen-nycthe only people whom I know personally that know what currying is are js hackers :P
01:54fualoR has been pretty good too
01:54brehautcallen-nyc: it was originally a scheme derivative wasnt it?
01:54callen-nycR is a little domain specific for a lot of people to stretch their wings though.
01:54callen-nycbrehaut: it still is.
01:54absalomHmm- maybe it is remarkably good at teaching that to a small percentage of javascript programmers.
01:54callen-nycbrehaut: it's just scheme + prototypes + weird types + DOM
01:54brehautcallen-nyc: what i meant to say is it didnt have the c family syntax
01:54callen-nycabsalom: I don't really care about the bottom 50%
01:55callen-nycbrehaut: I don't really focus on syntax.
01:55absalomOK, well I was talking abiout the bottom 90% ;)
01:55callen-nycsyntax doesn't change how I think about a problem, semantics do.
01:55brehautsure, but JS syntax is a bit of a mine field
01:55absalomthere are a lot of javascript programmers.
01:55callen-nycbrehaut: you can make a turing tarpit with no alphanumerics in js.
01:55brehauti wrote nothing but javascript professionally for about 2 years
01:56callen-nycabsalom: there are a lot of ditch diggers. I bet most of 'em are mediocre.
01:56absalomYeah, well js is a weird combination of genius and idiocy.
01:56fualoI'm not sure now if R has closures in the same way as clojure
01:56brehautfunction cons(h,t) { return function p(acc) { return acc(h, t); }; };
01:56callen-nycabsalom: luckily idiocy can be overcome but genius cannot be injected.
01:57callen-nycthis is what I get for reinstalling my clojure setup, lein's completely changed.
01:57absalomHmm.. if you had had to work with some of the js code I have had to fix you would not be so sanguine aboiut the idiocy, I think.
01:57callen-nycabsalom: I can't speak to your woes, I work for a company that has some excellent js people
01:57callen-nycI write my own, but either way.
01:57brehautcallen-nyc: i feel your pain
01:58callen-nycbrehaut: what happened to lein swank?
01:58absalomJavascript is basically a deeply flawed prefix Lisp.
01:58callen-nycI'm bloody mad now.
01:58brehautcallen-nyc: no idea sorry, ive never used swank
01:58callen-nycabsalom: eh. no macros though. scarcely counts.
01:58absalommeh.. there were no macros in early lisps either.
01:58callen-nycabsalom: early lisps were 30 years ahead of their time
01:59callen-nycalthough I've seen people run js through a cpp, that hardly counts.
01:59callen-nycabsalom: actually, if you really want a powerful expression of code-is-data, you want Io/Ioke/Seph
01:59callen-nycabsalom: ridiculous faculties for traversing the code and making arbitrary modifications.
02:00brehautcallen-nyc: you can do clever things with js eval and script language="my dsl"
02:00callen-nycbrehaut: I'm spoiled by Io, I'm afraid.
02:00callen-nycyou can monkeypatch a single operator or expression at will anywhere in your code.
02:00callen-nycyou traverse it like a native data structure.
02:00callen-nycit's nuts.
02:04absalomsorry- my internet connection is flaky.
02:04callen-nycabsalom: welcome back.
02:04callen-nycabsalom: you missed me waxing rhapsodic about Io :P
02:04absalomwww
02:04absalomfunny
02:05callen-nyc?
02:05absalomthere are limits to nostalgia
02:05callen-nycdoes anyone know what happened to lein swank?
02:05callen-nycabsalom: careful, you're in a lisp channel.
02:06absalomThat said- never did Io.
02:06absalomheh ;)
02:06callen-nycabsalom: has the most powerful metaprogramming faculties I've ever seen.
02:06absalomWell, I am something of a CLer
02:06callen-nycabsalom: you can swap-out a single operation or expression out of any part of your code at will
02:06callen-nycabsalom: you traverse it like a native data structure.
02:06callen-nyctotally absurd.
02:07absalomAnd I am in fact experiencing some stage of Kuibler-Ross's formula with Cl as a parameter...
02:07absalomreally?
02:07brehautabsalom: hah
02:07absalomYoui see that is my self-destructie nature manifesting itself...
02:08absalomThe good lord knows that the last thing I should do is go investigate IO.
02:08callen-nycuh, right then.
02:09absalomIf I had just decided to do Java a few years ago.. but the ni suppose you must know that story.
02:10absalomI mean, I suppose most of the core clojure developers could have been core JBoss developers had they wanted to be so.
02:11absalomBut I have been waiting for Lisp to win for a _long_ time.
02:12tomojcallen-nyc: what do you mean what happened to it?
02:13callen-nyctomoj: "that's not a task"
02:13absalomBut I am pretty much at the acceptance point with CL...
02:13callen-nycabsalom: "win"
02:13callen-nycabsalom: oi vey. winning is making money.
02:13tomojcallen-nyc: do you have swank-clojure in your dev-deps?
02:13callen-nycabsalom: if you're making money and using tools you enjoy, nobody can fault you.
02:14callen-nyc [swank-clojure "1.2.0"]
02:14callen-nyc [leiningen/lein-swank "1.1.0"]
02:14tomojdid you run `lein deps`?
02:14absalomIt is basicalky dead as a serious implementation language and no amount of wizard coding will bring it back.
02:14callen-nyc :| yes.
02:14tomojget rid of the lein-swank dep, no longer needed
02:14tomojlein -v?
02:14callen-nyctomoj: secondary desperate cargo cult measure
02:14callen-nyctomoj: not my original attempt.
02:14callen-nycLeiningen 1.2.0 on Java 1.6.0_21 Java HotSpot(TM) Client VM
02:14tomojhmm
02:14tomojand swank-clojure's jar is in lib/dev?
02:14callen-nycstill not working.
02:15callen-nycswank-clojure-1.2.0.jar
02:15absalomMeh- ther is a limit to how much you can force an unpopular language in your subordinates before they rebel abd you get ousted.
02:15tomojodd
02:15callen-nyctomoj: believe it or not, I'm not incompetent, merely incredibly unlucky.
02:15callen-nyctomoj: incredibly, incredibly unlucky.
02:15absalomI speak from experience ;)
02:15callen-nyctomoj: I bump into everything like this.
02:15callen-nyctomoj: rare apt bug? I'll trip right over.
02:15tomojdoes `lein help` list the swank task?
02:15callen-nyctomoj: unusual apache behavior? I'll be the one to drown.
02:16callen-nyctomoj: nosir.
02:16brehautcallen-nyc: things like that are why i'm a non-tool using primate
02:16tomojmaybe try swank-clojure 1.3.0-SNAPSHOT instead
02:16tomojyou shouldn't have to.. but that's currently working for me
02:16callen-nycbrehaut: things like that are why I gave up on virtualenv in python-land.
02:16callen-nyc[org.clojure/clojure "1.2.0-beta1"] relevant?
02:16tomojno, I have that too
02:16callen-nycretrying.
02:17brehautcallen-nyc: yup. ive found the sanest i get is a text editor, a repl and a virtualbox image for each project
02:17callen-nycbrehaut: no dice grandma.
02:17absalomThe thing is that people are sonditioned to hatre lisps enough that a lisp has to have a lot of cheese to win.
02:17callen-nycer
02:17callen-nyctomoj: no dice grandma.
02:17absalomerr- conditioned to
02:18absalomI wonder if clojure has enough cheese.
02:18callen-nycabsalom: are you using cheese the way jwz did?
02:18absalomI mean it as the reward the mous gets if he crosses the barrier
02:19absalomthe reward.
02:19callen-nyc(= your-usage jwz-style) returns true then.
02:19absalomC; clearly lacked cheese...
02:19absalomerr- CL
02:20callen-nycabsalom: clj is attracting ruby people because of the concurrency, state containment, and speed.
02:20absalomFor clojure to be accepted it will have to have a better pain to cheese ratio than CL...
02:20callen-nycabsalom: combined with relative power.
02:20hiredmanclojurebot: bonnie is <reply>my bonnie lies over the ocean, my bonnie lies over the sea
02:20clojurebotc'est bon!
02:20callen-nycabsalom: so I'd say there's cheese for people who've been constrained by slow VMs and want a faster but still powerful lang.
02:20tomojcallen-nyc: your project.clj looks like this? https://gist.github.com/1d865ae756aa70d04889
02:20absalomYeah, but this all looks so simple if you aare a Lisper.
02:20brehautcallen-nyc: that applies to python folk to i think
02:20callen-nycbrehaut: *coughs*
02:21brehautsorry?
02:21callen-nycbrehaut: I know low level langs, but yeah, clojure is the best overall compromise I can come up with for what I want to do.
02:21callen-nycbrehaut: I'm a professional py/django guy :P
02:21brehautcallen-nyc: ah right :) ive done that too
02:21absalomAnyway, as a professional Python programmer I can say, without fear of contradition, that Norvig is wrong. Python is not an acceptable Lisp.
02:22brehautmy current hobby project is rebuilding my django powered whole site in clj
02:22callen-nycbrehaut: on my second django/generalist job right now.
02:22absalomI can even tell you where he goes wrong.
02:22callen-nycbrehaut: I have a mini CMS that has gone from sinatra + mysql -> django + postgres -> flask + mongodb
02:22brehautcallen-nyc: cool :) my django/py job got crushed by the recession
02:22callen-nycabsalom: where?
02:22callen-nycbrehaut: :(
02:22callen-nycbrehaut: I work for a startup out in MV.
02:22absalomIt is where he considers eval to be an important language feature.
02:23brehautim in new zealand, its basicly a wasteland of .net shops
02:23callen-nyctomoj: it wasn't dev-dependencies before, fixed that
02:23absalomand one that
02:23brehautor (shudder) php
02:23callen-nyctomoj: that still didn't fix it though.
02:23absalomakes python lisp=equivalent.
02:23tomojso, do you have swank-clojure in lib/dev for real this time?
02:23callen-nycabsalom: in a very-very-very-very crude way, he's right
02:23callen-nycabsalom: but not meaningfully so, making you practically speaking, correct.
02:24callen-nycbrehaut: Columbus, OH is where I was before NYC / SF
02:24callen-nycbrehaut: .NET wasteland too
02:24absalomyes, but he didn;t say "tarpit-acceptable lisp"
02:24callen-nycabsalom: I know, that's why I qualified my statement.
02:24callen-nycbrehaut: I spent 3 years working in C# before django
02:24absalomyeah, zactly.
02:24callen-nycbrehaut: there are actually clojure shops in MV.
02:24callen-nycbrehaut: (mountain view, bay area)
02:24brehautcallen-nyc: i became a javascript programmer because i detest C#2 so much
02:24brehautcallen-nyc: thanks :)
02:24absalomI mean, I knew P Greenspun..
02:25callen-nycbrehaut: I'm around startup people who know what MV means too much, sorry :P
02:25callen-nyctomoj: yessir
02:25absalomAnd you, Mr Norvig, are no P Greenspun
02:25callen-nyctomoj: and it's a snapshot version
02:25callen-nycstill no dice.
02:25brehautcallen-nyc: no problem :) i only know one bay area guy
02:25callen-nyctomoj: wait
02:25callen-nyctomoj: just got a java exception.
02:26absalomAnyway, the more I look at clojure the more I think that it might be acceptable...
02:26callen-nyctomoj: NO_SOURCE_FILE:1 :P
02:26callen-nycabsalom: I showed it to a java guy recently
02:26callen-nycabsalom: middle-aged
02:26callen-nycabsalom: he screeched at the parentheses
02:26tomojwhat's the actual exception?
02:26callen-nycabsalom: I literally couldn't get him to look past those.
02:26callen-nycCaused by: java.lang.NumberFormatException: For input string: "[PORT=4005]" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
02:26callen-nyclein swank [PORT=4005] [HOST=localhost]
02:27absalomWell, if you come from CL land...
02:27brehautcallen-nyc: my coworkers reaction to F# code is the dual 'Wheres the braces?!'
02:27absalomclojure has some defects.
02:27absalomBut..
02:27tomojcallen-nyc: did you actually type "lein swank [PORT=4005] [HOST=localhost]" ?
02:27callen-nycbrehaut: I like F#, but I'm unwilling to work in Microsoft-land again.
02:27callen-nyctomoj: cargo cult. yes.
02:27absaloma lot of them are basically unavoidable if you targert the JVM...
02:27callen-nyctomoj: feel free to swat me if this was braindead
02:27tomojone would type "lein swank 4005 localhost"
02:27absalomUnless you want to target it with an inerpreter.
02:28tomojbut those are the defaults, so just "lein swank"
02:28brehautcallen-nyc: i have little choice about .net land, and until clojure.clr is more ready, F# is the best ive got
02:28callen-nyctomoj: brilliant. trying it now.
02:28brehautcallen-nyc: anyway, anything is better than VBScript
02:28callen-nyctomoj: socket opened. your patience is that of a saint and you are more manly than an emu. Thank you.
02:28absalomAnyway, even for the hardcore Cler...
02:28callen-nycbrehaut: friend of mine back in Columbus works in VB6 full-time
02:29callen-nycbrehaut: that said, he spends very little of his week actually working.
02:29absalomClojure is a lot closer than python is.
02:29brehautcallen-nyc: VB6 is terrible, but VBScript is actually worse
02:29callen-nycbrehaut: I remember.
02:29callen-nycpainfully.
02:29absalomThe other thing is that..
02:29callen-nycbrehaut: I'm glad most of my work was new C# dev
02:29absalomCl can't change
02:29callen-nycbrehaut: I actually got to stay in .NET 3 most of the time.
02:29callen-nycabsalom: standards blah blah blah
02:29brehaut.net 3+ is managable
02:29absalomIt;s probably the best fixed spec ever made, but...
02:29callen-nycbrehaut: expression treeeeeeees
02:30brehautcallen-nyc: a moderately useful type inferencer :)
02:30brehautcallen-nyc: also mona^H^H^H^HLinq
02:30absalomanyway, I have been more and more and more won over by clojure's rationale, but...
02:31callen-nycbrehaut: hahahaha.
02:31callen-nycbrehaut: I know some die-hard microsofties
02:31callen-nycbrehaut: I kept trying to explain to them that LINQ was monads expressed in ORM syntax
02:31callen-nycbrehaut: they didn't bloody believe me.
02:31brehauthah
02:31absalomAs a Cler I am used to doing as lot of imperatiove progtamming, mixed with a lot of functional stuff.
02:31brehauti think the smartest thing microsoft ever did was put the C# team down the hall from the F# team, and the F# team down the hall from the haskell guys
02:31callen-nycbrehaut: they thought monads was some ridiculous http://arsenal.theoffside.com/files/2010/04/doc-brown-300x295.jpg thing.
02:32callen-nycbrehaut: yeah, MS has some good language design these days.
02:32callen-nycbrehaut: the guy heading C# is sensible.
02:32absalomSome stuff is better modeled with mutable state.
02:32callen-nycbrehaut: but. I refuse to be tied to an ecosystem I can't control
02:32callen-nycbrehaut: thusly, I stopped devving on my mac, and stopped working in .NET :P
02:32callen-nycabsalom: some, da.
02:32callen-nycabsalom: hence refs. :)
02:32brehauti can imagine the haskell guys sitting there going 'wow, this is really amazing math. lets make it usable by programmers' and the F# guys going 'wow, this is really amazing haskell stuff, lets make it usable to real programmers' and the C# guys going 'wow, this is cool F# stuff, lets make it usable to real programmers'
02:33brehautand the VBnet net guys are just drooling
02:33callen-nyctomoj: working brilliantly. I'd send you beer if I could.
02:33absalomYep.. But it's syntactic overhead, at least
02:33callen-nycbrehaut: lmfao.
02:33callen-nycabsalom: concurrency and
02:33callen-nycabsalom: immutability are the only sensible defaults in the coming future.
02:33callen-nycabsalom: you know this.
02:34absalomThe problem with fuinctional programming is that in the end everything looks like a function to the fuintional programmer.
02:34absalomYeah, I do..
02:34callen-nycabsalom: I know core FreeBSD devs who are aware of this, and they've been in C-land for like, 20 years.
02:34absalomwell, at least I do know that I am not smart enough to manually manage concurrency.
02:34callen-nycabsalom: as soon as I started explaining clojure in terms of true immutability she brightened right up.
02:35absalomYeah- I am doing 3D animation stuff right now and..
02:35absalomHmm- actually bad example...
02:36absalomBu it's a good question...
02:36absalomTheoretically speaking, which problems can be parallized?
02:37absalomerr- parallelized...
02:37brehautabsalom: thats rather a broad question isnt it?
02:37absalomClojure is a bet on "a lot"
02:37callen-nycabsalom: it's actually not
02:37absalomIndeed it is.
02:37callen-nycabsalom: a bigger bet on parallelism is more like haskell and map-reduce databases.
02:38absalomI mean if it turned out that no one cared much about parallelizing computations for consumer software...
02:38callen-nycabsalom: parallelism depends on the composition of the work, how much of it is computation versus data processing, and how independent the computations are.
02:38callen-nycabsalom: there is no 'consumer software'
02:38absalomHmm- but the whole point of mapreduce is tht i requires no language support.
02:38callen-nycabsalom: people are using clojure to deploy services, not desktop software.
02:38brehautabsalom: there are things that cant be 'parallized' that can be 'concurrent' though right?
02:38callen-nycbrehaut: yes.
02:39absalomSure- but where is the win there?
02:39callen-nycabsalom: scaling
02:39brehautmaking concurrent code composable and reasonable makes for some rather clear solutions to otherwise hairy problems
02:39callen-nycabsalom: independent jobs can be worked on in parallel
02:40absalomI mean I am mainly playing devil's advocate here, but..
02:40callen-nycabsalom: otherwise you'd have to work on them serially with a context switch
02:40brehautabsalom: figured :)
02:40callen-nycabsalom: which sucks.
02:40absalomLet me give you a great example of scaling an parallelism
02:41absalomI work for an animation studio right now, writing animation software...
02:41absalomSometimes they need to render things
02:41brehautabsalom: that sounds like you are entering the embarrassingly parallel territory pretty easily
02:41absalomThey achieve parallelism very easily: the software ios designed so that no frame depends on another.
02:42absalomDo they can use a process for each frame if they want.
02:42absalom*So
02:42absalomAnd they can break rendering up over, literally, hundreds of machines, with thousands of cores.
02:43absalomThat is parallelism.
02:43callen-nycthat's because graphics are ridiculously parallel
02:44absalomThe thing is.. we are talking about things that can be easily broken up into dicrete chunks.
02:44callen-nycthere's zero dependent computation frame to frame.
02:44callen-nycabsalom: thank god, otherwise 3d would be a ridiculously hard problem.
02:44absalomit gets more complicated if you have dependencies on other computations, but...
02:44brehauti cant help but think that this is rapidly devolving into an Internet Argument here (ie, violently in agreement)
02:45absalomsure..
02:45absalomI mean I just wonder to what degree this will be the case.
02:45absalomI think you are right that its the best ase for clojure.
02:46brehautabsalom: actually, clojure is turning into a pretty damn fine web back end tool too
02:46absalomCause the only way I see for people to keep selling more powerful computers is more cores.
02:46brehauteven asside from the concurrency aspect
02:46callen-nycabsalom: people aren't going to use clojure for rendering, if at all, for a long time
02:46callen-nycabsalom: services mate.
02:46absalomsure, but is it beer than CL for that?
02:46absalomerr- better
02:46callen-nycabsalom: yes and no.
02:47callen-nycabsalom: sbcl is pretty wicked if you annotate the types, but clojure has the potential to be faster.
02:47absalomI mean with hunchentoot and parenscript and JSON libs and etc...
02:47callen-nycabsalom: hunchentoot sucks compared to what clojure already has.
02:47callen-nycabsalom: I'm sorry but come on.
02:47absalomCl was without a doubt the most capable web language three years ago...
02:47callen-nycabsalom: I'd rather work in raw aleph than hunchentoot.
02:47callen-nycabsalom: you been reading too much PG mah boy.
02:47absalommeh..
02:47callen-nycabsalom: less kool-aid
02:48absalomI d=never took him too seriously.
02:48absalomexcept when I read his intro book back in the 90s in school.
02:48absalomANSI common lisp is a good book
02:49absalomNo Kool-AID there..
02:49callen-nycabsalom: makin' me feel young.
02:49absalomI really believe that based on my own expereince...
02:49callen-nycabsalom: I was referring to essays that resuscitated CL for awhile.
02:49absalomworking in CL-WHO and parenscript is an enlughtening esperience
02:49absalomAnd I say that as someon who ha managed some very successful sites
02:50callen-nycdid Norvig really say python = Lisp because of fucking eval()?
02:50callen-nycdid he think eval() was novel or something?
02:50absalomYeah, well I found PG less and less convincing as he went on...
02:50callen-nycI'm sorry, I just find that baffling.
02:51callen-nycabsalom: he's doing alright now that he's moved from programming advice to business advice.
02:51absalomthe thing is that when I say that CL+hunchentoot +CL-WHO+parenscript was very comnpelling for me at that time it has nothing to do with Graham..
02:51absalomNone of those things existed when he wrote beating the averages.
02:51callen-nycabsalom: I grok.
02:52callen-nycabsalom: I figured when you started talking mid-90s
02:52callen-nycnot a lot of options back then.
02:52absalomI had just come from several years managing websites that got millions of hits a day and were written in Java and.. pain.
02:52callen-nycabsalom: I had my share of battling jboss.
02:53callen-nyckinda disturbs me how hard RedHat pushes jboss.
02:53callen-nycthey shouldn't be so opinionated about app infrastructure.
02:53absalomThe sad thing is that I was the one who decided to do Java.. no one else to blame.
02:53absalomwell, except management.
02:54brehautsurely its not as bad as aspnet webforms
02:54absalomHmm.. nor sure, but...
02:55absalomit got pretty bad as nepotism added more and more contractors to the mix...
02:55absalomJava works pretty well if you don;t change your mind, ever.
02:55brehauthaha
02:55brehautbbl; giant (cyclopean?) pile of dishes to deal with
02:56absalomBut actually you know John Foderaro once famously called CL a programmer amplifier...
02:56absalomJava was initially designed, explicitly I think, to be a programmer dampener.
02:57brehautabsalom: i thought the goal was to drag C++ programmers half way to lisp?
02:57absalomI mean you can;t look at Java 1.0 and think anything else.
02:57absalomNah, that is just Guy Steele trying to verbalkly shower.
02:58absalomThe oiujnt was that all programmers were heretofore going to be pretty equal.
02:58absalomerr- point
02:58absalomNo cleverness allowed.
02:58callen-nycbrehaut: nah. java is pretty weak in terms of power, especially early on.
02:58callen-nycbrehaut: what abs said. no cleverness allowed.
02:58callen-nycbrehaut: java was designed to commoditize programming/programmers
02:58brehautcallen-nyc: be that as it may, C++ was pretty weak in terms of sensible
02:58absalomexactly...
02:59callen-nycbrehaut: luckily? the complexity of massive java projects beat them.
02:59brehauthaha
02:59kaiwrenbrehaut: They got a quarter way there when IntelliJ first came out. Java is barely manageable only with an AST IDE. Ditto C#.
02:59absalombut at least you can be crazy productive in C++ if you are ohne of the ten guys in the world who actually understands it.
02:59kaiwrenBut any language benefits from an AST IDE.
02:59callen-nycabsalom: I know some competent C++ people
02:59callen-nycabsalom: they establish known patterns of working, and *STICK TO THAT*
03:00absalomSure.. competent.
03:00callen-nycabsalom: I mean, they work fast.
03:00absalomI know some people qho can make C++ look like Lisp...
03:00callen-nycabsalom: as do I.
03:00absalomerr- well maybe one, actually.
03:00callen-nycabsalom: guy I know works in signal processing and some other things
03:00callen-nycabsalom: dude's a master of qt and boost.
03:01absalomBut template meta-programming is a rather bad analogue for macros.
03:01absalomEquivalent, but...
03:01callen-nycabsalom: everything in C++ has to be quite static.
03:01absalomSo the point of Java 1.0 was to make all programmers the same.
03:01callen-nycabsalom: templates are a space/time trade-off
03:02callen-nycabsalom: guess which one they chose to axe? :P
03:02absalomWithin a certain delta.
03:02callen-nycabsalom: that might explain why yegge emphasized typing speed so much
03:02callen-nycabsalom: within that certain delta, WAM matters :D P
03:02callen-nyc:P
03:02absalommeh- yegge was sort of right about that I think...
03:03absalomNot that you would know it fomr my typing, but..
03:03absalomI hate laptop keyboards...
03:03callen-nycabsalom: I work at a dual-display + desktop mouse/keyboard hooked into a laptop
03:04callen-nycabsalom: honestly, I type quite fast on my laptop, but I do it rarely for programming.
03:04absalomEven if you only keep 60 lines a day you probably type thousands getting there.. not being able to type introduces pathilogies.
03:04absalomerr- pathologies
03:04absalomas for spelling...
03:04callen-nycabsalom: I do spend a lot of time hacking in a repl
03:04callen-nycabsalom: typing speed helps, but history recall helps more.
03:04absalomBut my point is that Java was meant to keep you from being clever..
03:04absalomBut that didn;t work...
03:05absalomPeople started leaving Java for clearly worse engineered things like Python...
03:05callen-nycabsalom: 'worse'
03:05absalomSo they started adding cleverness to Java...
03:05callen-nycabsalom: at the VM level, sure. at the language level, Python is pretty tolerable.
03:05nteonabsalom: what do you mean by worse engineered?
03:05absalomBut since Java was initially designed to prohibit cleverness...4
03:06absalomCan you write a compiler that will compile all legal Python code to something efficient?
03:06absalomNo, of course not...
03:06callen-nycabsalom: PyPy ++ RPython
03:06callen-nycabsalom: the JIT is making a lot of progress
03:06callen-nycabsalom: Lisp/Clojure aren't perfectly static/able to be compiled down either
03:07callen-nycabsalom: it's the trade-off you choose to make up-front.
03:07absalomDoes CPython have reasonable garbage collection?
03:07absalomYeah, but why make an unnecessary tradeoff?
03:08absalomPython is ad-hoc.
03:08brehautabsalom: CPython has a fairly standard refcount system. releases memory early, slows stuff down a bit
03:08callen-nycabsalom: unnecessary?
03:08callen-nycabsalom: what do you think you're coding in with clojure exactly?
03:08absalomI men, if it weren't I wouldn't be in this channel. I would stick with Python.
03:08callen-nycabsalom: it's a dynamic type system
03:08callen-nycabsalom: it has similar performance limitations as python, but with some edges over it + running on the JVM
03:08absalommeh.. let's talk about a tale of two pythons...
03:09callen-nycyou sound drunk.
03:09nteonhaha
03:09callen-nycor sleep deprived.
03:09absalomthe first python was a compiler developed at CMU...
03:09nteon\quit
03:09nteonbah
03:09absalomhmm- do you not sdee aht I am getting at cullen?
03:10callen-nycabsalom: you seem to be finding the liquor cabinet just fine
03:10callen-nyc :P
03:10absalomPython was developed in an ad-hoc manner that makes it almost impossible to compile it to efficient code.
03:10callen-nycthe ad-hoc nature isn't all that relevant to its performance limitations.
03:10callen-nycit's a far more structured and disciplined language than ruby.
03:10absalomPerhaps..
03:11absalomBut I tend to put them in pretty much the same category.
03:11callen-nycit's just a sequence of decisions that led to a whole language, upon which there is a determinable set of performance limitations given known runtime technologies.
03:11absalomThouh of course Ruby's implementation is terrible...
03:11callen-nycI repeat, Clojure is dynamically typed and is a JVM language, it can't be "compiled down" any more than python can.
03:11callen-nycabsalom: it's improved greatly, of late.
03:12callen-nycabsalom: ruby 1.9 put it on par with the best of python.
03:12callen-nycit continues to improve in performance more quickly than python, in fact.
03:12callen-nycCPython is a reference implementation. period.
03:12callen-nycif you want fast, use pypy-jit
03:12absalomClojure is derived fron a series of languages that were designed to be compiled to efficient machine code.
03:13callen-nycabsalom: if that were the case it wouldn't be dynamically typed and it wouldn't be on the JVM
03:13callen-nycabsalom: I think you're misconstruing something.
03:13absalomYou really need to go back and look at the history of Lisp cullen.
03:13absalomCL, for instance, was never statically typed.
03:14callen-nycabsalom: you know nothing about me
03:14callen-nycreally, nothing.
03:14absalomBut one of the explicit goals of the standardization process was to some up with a language that could be compiled to efficient native code.
03:14callen-nycabsalom: and it's rude for you to suggest I need to go read some eldritch material just because it satisfies your hipster obscurity ethic.
03:14callen-nycabsalom: I'm done with this conversation, please sober up.
03:14absalommeh...
03:16absalomIt's rude of you to insist that people who correct your misonceoptions are being rude to you.
03:17callen-nycabsalom: you know nothing of what I know. Stop.
03:18absalomIt is certaily true that it was an explicit goal of the designers of CL that CL be comilable to reasonably efficient machine code. That is just a statement of fact, and you can discover it if you go back and look at the documents.
03:19absalomMany of the design decisions made during the standardization process were made for that reason.
03:20absalomThat CL is dynamically typed is not particularly material.
03:53daakutechnomancy: thanks for building lein int!
04:31callen-nychow would I go about expressing arity and slicing programmatically?
04:31callen-nyclike python's [] slicing syntax.
04:37tomojis that two separate questions?
04:37tomojor does python's [] slicing syntax express arity programmatically?
04:38callen-nyctomoj: indirectly, in terms of how clojure seems to use arity.
04:38callen-nyctomoj: you may consider it two different questions if it makes it easier for you to answer.
04:39tomojI don't understand either question then :)
04:39callen-nyctomoj: rephrase
04:40callen-nyctomoj: [element0, element1, element2, element3][0] returns element0
04:40tomojdoes (fn [a b]) express arity, but not "programmatically"?
04:40callen-nyctomoj: yes.
04:41callen-nyctomoj: I'm sending something a list, I want to fetch an arbitrary selection from the list without expressing manual arity like
04:41callen-nyc[obj1 obj2 obj3]
04:41tomojmanual arity?
04:41callen-nyc[0, 1, 2, 3, 4, 5][:3] returns [0, 1, 2] in python
04:41tomojyou must speak a different language than I :(
04:42callen-nycokay lets go ahead and pass on arity.
04:42callen-nycand ignore the pattern matching.
04:42callen-nycslicing.
04:42callen-nycsee the python slice above?
04:42callen-nychowdoidothat?
04:42tomoj-> (subvec [0 1 2 3 4 5] 0 3)
04:42sexpbot=> [0 1 2]
04:43callen-nycsubvector I take it that means? thank you.
04:43callen-nyctoo bad I can't make that into a reader macro :P
04:43callen-nycclojure.lang.ArraySeq cannot be cast to clojure.lang.IPersistentVector
04:43brehautcallen-nyc: nth is the equivalent of the index i believe
04:44tomojsubvec only works on vectors
04:44callen-nyctomoj: re-split returns lists :(
04:44brehautcallen-nyc: or get if you have a vector
04:44tomoj-> (take 3 [0 1 2 3 4 5])
04:45sexpbot=> (0 1 2)
04:45callen-nyctake 3 works
04:45callen-nycfor a list without needing to cast, that is.
04:46callen-nycthankee. :)
04:51tomoj-> (class (seq (into-array [1 2 3])))
04:51sexpbot=> clojure.lang.ArraySeq
04:51tomojthings that look like lists often aren't lists :(
04:52callen-nycbwaha.
04:52callen-nycI fixed ellipsize.
04:52callen-nycbloodying annoying the way Halloway wrote the example
04:52callen-nychad a space between the ellipsis and the final word.
04:52callen-nycfixed :P
04:53callen-nyc(trivial I know)
04:54defnhey all
04:55callen-nycdefn: hahahaha. HN reader identified.
04:56defncallen-nyc: :X
04:56callen-nycdefn: nice name.
04:56callen-nycdefn: I work for a company that's in walking distance of Runa.
04:58defncallen-nyc: cool. My name IRL is Devin -- I actually had defn before I started messing with clojure
04:58callen-nycdefn: I'm sure a few educated guesses would suss my name out.
04:58defn:)
04:58defnnice use of the word suss
04:58defni need to use that more often
04:58callen-nycdefn: nutty parents, loved words.
04:59defncallen-nyc: I'm almost definitely not qualified to work for Runa, but God would it be a great opportunity to dig in deep and cut off my friends and family for a year or so
05:00callen-nycdefn: where are you now?
05:00defnWisconsin :\
05:00callen-nycdefn: I have an ex-girlfriend I still talk to out there.
05:00callen-nycdefn: I did the cut-off thing about two years ago, NYC was a part of that.
05:00somniumdefn: ever been to/driven through Beloit?
05:00defnhopefully she doesn't have the same name as my girlfriend
05:00callen-nycdefn: kinda don't miss them anymore, kinda wish I settle too.
05:00defnsomnium: yes
05:00callen-nycdefn: I sincerely doubt you would be foolish enough to date this woman.
05:01somniumdefn: cool, I went to school there
05:01defnBeloit College?
05:01somniumyeah
05:01defnCan you loan me a few grand?
05:01somniumheh
05:01defn:D
05:01defnI almost went to Beloit College, but the artsy emo kids made me want to stick my hand in a wood chipper
05:02defnthat, and it was insanely expensive
05:02somniumits gone up I here
05:02callen-nyclmao.
05:02somniumI graduated 2003
05:02defnI think it's something like 34k or something per semester
05:03somniumthey used to give away a lot of scholarships
05:03callen-nycegads.
05:03defnyeah they still do actually -- i could have competed for one of them, but I would have been forced into an area of study
05:03defnthey have a massive endowment
05:04defnWhich admittedly may have been a better plan seeing as I dropped out of college
05:04callen-nyc...did something change about the ^ reader macro?
05:04callen-nycdefn: I left after a single quarter ;)
05:04defncallen-nyc: yeah I think that's deprecated callen-nyc, or at least, it's going to be
05:05callen-nycdefn: I'm definitely raising a reader exception trying to use it.
05:05callen-nycwhat's the bloody meta macro now?
05:05defn(meta)
05:05defn:)
05:05callen-nycokay so there is none.
05:05callen-nycfrick.
05:05defnare you on 1.2.0-RC1
05:05callen-nyclet's consult Mr. project.clj...
05:05callen-nyc-beta1
05:05somniumthere never was a meta macro
05:06defnwhat am i thinking of
05:06callen-nyc^blah
05:06defni thought ^ was once upon a time the meta macro
05:06callen-nyc...yeah me too.
05:06callen-nycit was in 1.0 I thought.
05:07callen-nychas this been deleted from everyone's collective memory like a b horror movie?
05:07somniumthat puts meta data on symbols at read time, not the same as (with-meta)
05:07defnyeah I'm sure of it because I got a lot of warnings throughout 1.1.0 as a result of ^ in libs I was using
05:07defnahh somnium sure
05:07defn,^{:a 1 :b 2} [1 2 3]
05:07clojurebot[1 2 3]
05:08defn,(meta ^{:a 1 :b 2} [1 2 3])
05:08clojurebot{:a 1, :b 2}
05:08defn,(with-meta ^{:a 1 :b 2} [1 2 3])
05:08clojurebotjava.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$with-meta
05:08defnoopsie-daisies
05:09defn,(with-meta ^{:a 1 :b 2} [1 2 3] {:tags "vector"})
05:09clojurebot[1 2 3]
05:09defn,(meta (with-meta ^{:a 1 :b 2} [1 2 3] {:tags "vector"}))
05:09clojurebot{:tags "vector"}
05:09callen-nycyou've lost me.
05:10defncallen-nyc: http://clojure.org/metadata
05:10callen-nycdefn: that's all well and good, I knew that
05:10somniumits come up before, the disparity between ^ and (with-meta ...), Im sure there's more than one example in the logs
05:11callen-nycdefn: it's just that when I first learned Clojure, 1.0 prevailed and ^ worked as a reader macro for (meta )
05:11defnsomnium: indeed
05:11defncallen-nyc: yeah that's changed, now you use ^ like with-meta, and you use (meta) to return the metadata on the object
05:12defnsomnium: correct that if it's spotty please -- it's 4:00 AM :)
05:12callen-nycyeah I'm not following. I'll have to hash it out in my swank repl.
05:12callen-nycI'm looking at the doc for with-meta and meta, I see nuhzink that would indicate ^ would be useful/necessarty
05:13somniummy understanding, which may be outdated, was that ^ is for type hints, and (with-meta ...) is for application-level metadata
05:14Lajla->{:key (+ 1 2)}
05:14sexpbot=> {:key 3}
05:14defnsomnium: that is sounding closer to the truth, but I specifically remember refactoring some code to use (meta) instead of ^obj
05:14Lajla->(eval {:key (list '+ 1 2 3)})
05:14sexpbotjava.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/eval)
05:14somniumalthough people still do (ns ^{:doc "blah blah" blah ...})
05:15somniumfor "constant metadata" I guess, though now Im inventing terms
05:15LajlaLacous Somniorum
05:15LajlaSomnium, esne somians?
05:15defnbah humbug to ns metadata
05:16callen-nycdefn: sounds like global state vars to me.
05:17defnI think it's just being "fancy". No need for frills on an NS macro.
05:18tomojclojure-mode doesn't like ns metadata
05:18tomojtherefore I don't like ns metadata
05:19somniumall hail clojure-mode
05:19defnLong live the Mode.
05:19callen-nychahahaha. major modes in emacs dictating programming practices.
05:19callen-nycI'm guilty of the same in js :P
05:20defnhttp://clojure-log.n01se.net/date/2009-09-29.html#i43
05:20defnrhickey: manic12: not necessarily, the point of deprecating ^ was so that it could replace #^
05:21callen-nycasdfsdf. I knew it.
05:21callen-nycalso, #^ isn't working either.
05:23tomoj-> (meta ^{} [])
05:23sexpbot=> nil
05:23tomoj-> (meta ^{} ())
05:23sexpbot=> nil
05:23tomojoh, hmm
05:23tomoj(meta ^{} ()) is {:line 1} for me
05:24somnium,(meta ^String ())
05:24clojurebot{:tag java.lang.String}
05:24callen-nyc, ^String
05:24clojurebotEOF while reading
05:25callen-nyc,#^String
05:25clojurebotEOF while reading
05:25callen-nyc,(meta String ())
05:25clojurebotjava.lang.IllegalArgumentException: Wrong number of args (2) passed to: core$meta
05:25callen-nyc,(meta ^String ())
05:25clojurebot{:tag java.lang.String}
05:25callen-nyc,(meta #^String ())
05:25clojurebot{:tag java.lang.String}
05:25callen-nyc...okay?
05:31defn,*clojure-version*
05:31clojurebot{:interim true, :major 1, :minor 2, :incremental 0, :qualifier "master"}
05:32defncallen-nyc: what are you looking to do
05:34callen-nycsleep, in a moment.
05:34defncallen-nyc: heh
05:35defncallen-nyc: can you go tell Runa to hire me when you wake up?
05:35callen-nycI'm still in NYC, haven't moved to Mountain View yet
05:35callen-nycwork from home.
05:35defnah, can't say who you're working for?
05:35callen-nychahaha. not publicly in IRC ;)
05:39defn:)
05:39callen-nycdefn: I'm racking out. Later.
05:39defncallen-nyc: good talking to you, tell those Runa dudes I said hello :)
08:55pdk(doc iterate)
08:55clojurebot"([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"
08:58pdk(doc char?)
08:58clojurebot"([x]); Return true if x is a Character"
09:03serp_,(take 5 (iterate inc 1))
09:03clojurebot(1 2 3 4 5)
09:09Lajla->(take 5 (iterate #(* % %) 2))
09:09sexpbot=> (2 4 16 256 65536)
09:29raek,(derive :c :p)
09:29clojurebotjava.lang.AssertionError: Assert failed: (namespace parent)
09:30raek,(derive (make-hierarchy) :c :p)
09:30clojurebot{:parents {:c #{:p}}, :ancestors {:c #{:p}}, :descendants {:p #{:c}}}
09:33pdk(let [myfn (fn [x] (lazy-seq (cons x (myfn (inc x))))] (myfn 1))
09:33pdk,(let [myfn (fn [x] (lazy-seq (cons x (myfn (inc x))))] (take 5 (myfn 1)))
09:33clojurebotUnmatched delimiter: ]
09:33pdk,(let [myfn (fn [x] (lazy-seq (cons x (myfn (inc x)))))] (take 5 (myfn 1)))
09:33clojurebotjava.lang.Exception: Unable to resolve symbol: myfn in this context
09:33pdkbah
09:34pdkis there a way to define a function in a let block that's recursive but not tail recursive
09:34pdkaside from just making it its own helper function with an obscure name or something
09:35raekpdk: I know of two ways: (fn my-fn [x] ...) gives a name to the function itself, (letfn [(myfn [x] ...]) combines this with let
09:36pdkhmmm
09:36raek,(fn foo [] foo)
09:36clojurebot#<sandbox$eval500994$foo__500995 sandbox$eval500994$foo__500995@12f9b2e>
09:36pdkthe way with just fn my-fn might involve changing less code though is it considered bad practice in light of letfn
09:36pdk,(let [myfn (fn myfn [x] (lazy-seq (cons x (myfn (inc x)))))] (take 5 (myfn 1)))
09:36clojurebot(1 2 3 4 5)
09:36pdk\o/
09:36pdkcool beans
09:37raekeither that or the letfn version is fine, I think
09:38raek,(letfn [(myfn [x] (lazy-seq (cons x (myfn (inc x)))))] (take 5 (myfn 1)))
09:38clojurebot(1 2 3 4 5)
09:38raeknot a very big difference
10:19pdkwhen you curry a function with partial are the provided arguments evaluated every time the curried function is called or just evaluated once and memorized in the function for each time you call it
10:19pdksay if i have (first x) or something like that as one of the provided arguments to the curried function and i don't want it to be the same value forever
10:21pdk(doc partial)
10:21clojurebot"([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & more]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."
10:26pdkhmm
10:26pdkprobably shouldn't count on %1 %2 etc working in partial forms
10:33gerryxiaoslime git not work now?
10:34gerryxiaoi got connection refused error
10:35gerryxiaogit.boinkor.net[0: 2001:858:745:a0e4:200:1aff:fe19:d355]: errno=Connection refused
10:35gerryxiaofatal: The remote end hung up unexpectedly
10:36gerryxiaoany ideas?
11:20raekI'm doing some Scheme now and I've started to miss Clojure's ability to do destructuring in let
11:20raekdoes Scheme have something similar?
11:21gfrlogdoesn't clojure have a built-in queue data structure hiding somewhere?
11:21raekgfrlog: clojure.lang.PersistenQueue
11:21qbgraek: The implementation may have a version of DESTRUCTURING-BIND
11:21gfrlogthanks
11:22raekqbg: doesn't look like it in my case. (i'm using dr scheme)
11:22qbg,(into clojure.lang.PersistentQueue/EMPTY [1 2 3])
11:22clojurebot#<PersistentQueue clojure.lang.PersistentQueue@6b58d153>
11:22gfrlogso there aren't any clojure.core functions for it?
11:22qbgPLT Scheme/Racket is full of stuff, so there must be something somewhere
11:22raekyes, conj, peek and pop
11:23gfrlogthis leads to a more general question regarding efficiency...if I use general seq functions a such a class, will it retain the efficiency characteristics of the original class, or might it end up morphing into a linked list or something?
11:23raek,(let [q (into clojure.lang.PersistentQueue/EMPTY [1 2 3])] [(seq (conj q 4)) (peek q) (seq (pop q))])
11:23clojurebot[(1 2 3 4) 1 (2 3)]
11:24raekthe sequence functions return sequences, so yes, you cannot do e.g. append to the back on vectors after you have got a seq on it
11:25raekthe functions that returns a data structure of the same kind are listed on the data structures page on clojure.org
11:25raekqbg: thanks anyway, will continue to look
11:28gfrlograek: thanks
11:53BahmanHi all!
11:55gfrloghi
11:56gfrlog,(let [tell-bahman-hi #(println "Hi Bahman!")] (tell-bahman-hi))
11:57clojurebotHi Bahman!
11:57Bahmangfrlog: Hello there! Weird way to say Hi however I liked it :-)
11:57gfrlogon second thought I would have had him use "Bahman: hi!"
11:58bozhidargfrlog: you might have skipped the let part though ;-)
11:58gfrlogoh certainly, but I wanted to give the function a name
11:58gfrlogideally I would use (defn tell-bahman-hi ...) but clojurebot would have glared
12:00bozhidargfrlog: fair is fair
12:02gfrlog,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
12:02clojurebot((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
12:08qbg,(symbol (apply str (reverse "eval")))
12:08clojurebotlave
12:08qbg,(symbol "eval")
12:08clojureboteval
12:08qbg,(resolve (symbol
12:08clojurebotEOF while reading
12:08qbg,(resolve (symbol "eval"))
12:08clojurebot#'clojure.core/eval
12:09qbg,((resolve (symbol "eval")) '(+ 2 2))
12:09clojurebot4
12:09qbgUh oh...
12:16gfrlog,((resolve (symbol "eval")) '(def gfrlog "glaven"))
12:16clojurebotDENIED
12:16gfrlog,eval
12:16clojurebot#<core$eval clojure.core$eval@9524c6>
13:19raek,((resolve (symbol "eval")) (list (symbol "def") 'raek-was-here "hello"))
13:19clojurebot#'sandbox/raek-was-here
13:20raek*evil grin*
13:20raek,raek-was-here
13:20clojurebot"hello"
13:21raek->((resolve (symbol "eval")) (list (symbol "def") 'raek-was-here "hello"))
13:21sexpbotjava.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/resolve)
13:29jstirrell /msg nickserv identify giovanni
13:29jstirrellas
13:30jstirrelldamn i suck at irc
13:46technomancyoh snaaaap!
13:47gfrlogit's okay, to everyone else it looked like "********"
13:48maravillasheh
15:25arohnersigh. Why did Sun decide that Integer and String should be final?
15:27qbgString being final means you can't (without using reflection) violate invariants it imposes
15:28arohneryes, but there are nice things you can do with subclassing, without changing the behavior at all
15:28qbgThe class library depends on String's behaviour, so that is enforced.
15:29kotarakOh magic #clojure channel with thy infinite wisdom and knowledge! What might be the name and the author of the paper looking into the comparison operators, which clojure's = follows as far as I know? (Something with equal? equiv?)
15:29qbgegal
15:29qbgBy Baker IIRC
15:29kotarakAh. Thank thou, magic channel.
15:33kotarakHere the link FWIW: http://home.pipeline.com/~hbaker1/ObjectIdentity.html
16:06tomojoh, I figured out why clojure-mode doesn't like ns metadata
16:06tomojit's looking for #^ and not ^
16:06tomojif you add a ? after the # on line 703, it works fine
16:08LauJensentomoj: technomancy is still maintaing that right?
16:08tomojdunno
17:06lozhtomoj: raek put some fixes for that in his branch of clojure mode in the last couple of days
17:13tomojcool, thanks
17:26rubydiamondanybody uses safari books online service
17:34kencauseyrubydiamond: I used to, what do you want to know?
17:34rubydiamondkencausey: how is it
17:35kencauseyIt's pretty good, it all depends on whether they have books you value.
17:35kencauseyI dropped it primarily to save money but also because in a way I've outgrown the library, I'm a little too far out on the bleeding edge for publishing now.
17:37rubydiamondhmm
17:37kencauseyI suggest you browse the library and decide whether you can find at least 20-30 books you think you might want to reference in the next year
17:37rubydiamondkencausey: if i buy $10 month a plan, does it mean I can access all the books
17:38rubydiamondkencausey: okay..
17:38kencauseyNot really, you add a book to your library, it must stay there 30 days, taking up a slot
17:38kencauseyand you have a limitted number of slots
17:38kencauseywhere do you see a $10 a month plan?
17:39kencauseyI kept it as long as I did partially because I had a grandfathered 14.95 rate for what is now 22.99
17:39rubydiamondkencausey: there is one with 5 slots $10 a month
17:40kencauseylink? I know that used to have that but I don't see it on the site now
17:40kencauseys/that/they/
17:40sexpbotlink? I know they used to have they but I don't see it on the site now
17:40kencauseythanks but no thanks sexpbot
17:41rubydiamondBasic Starter - 5 slot Bookshelf
17:41rubydiamondit's $9.99 per month
17:42kencauseythat sounds right, but I don't see it anywhere anymore
17:42rubydiamondhmm
17:42rubydiamondI can see it
17:42kencauseyon https://ssl.safaribooksonline.com/subscribe ?
17:43rubydiamondkencausey: suppose I have 5 books in my slot
17:43rubydiamondcan i change atleast one of them to other ones
17:43kencauseyeach one will have a 30 day countdown from the moment add it
17:43kencauseys/add it/you add it/
17:43sexpboteach one will have a 30 day countdown from the moment you add it
17:43kencauseyuntil that timer counts down, it can't be removed from the slot
17:44rubydiamondkencausey: that's bad
17:44rubydiamondthere are folders too
17:44kencauseyI rarely found it a problem in practice, but I had 10 slots
17:44kencauseyI think the folder don't change anything, they are just organizational tools
17:44kencauseyThe really only relate to those users with more slots
17:45kencauseyI suggest you go with the free trial though and decide for yourself
17:45kencauseyI didn't fiddle with it much in the last year or so, it's possible something has changed and I did not realize it.
17:45rubydiamondhmm
17:46rubydiamondokay... slots concet is not that good
17:47rubydiamondconcept*
17:47kencauseywell, they can'
17:47kencauseyt complete kill their print business yet ;)
17:47kencausey$43 a month for total free access doesn't seem unreasonable to me
17:48kencauseythat's like 1.5 books a month, maybe
17:48rubydiamondkencausey: right
17:48rubydiamondthanks kencausey
17:49kencauseysure
18:55fielcabralHello #clojure peeps. I'm a java programmer learning clojure.
18:56brehauthi fielcabral
18:56fielcabralhi brehaut
18:58danlarkinhi fielcabral
18:58fielcabralhi dan larkin
19:11tomojslyrus: so how do you use the json.clj parser?
19:12defnhello
19:12fielcabralhi defn
19:12tomojoh, got it
19:13raekclojure.contrib.json?
19:13clojurebotclojureql is http://gitorious.org/clojureql
19:14tomoj(:product @(:result ((<document>) (h/make-state "{\"foo\":\"bar\"}"))))
19:14tomoj:/
19:22dashok so i just watched _Are We There Yet?_ and all I can say is "it's about time somebody said this stuff"
19:24dashwhat should I read next? :)
19:36defndash: I think I've watched that lecture like 8-9 times :\
19:36dashoh?
19:37defndash: I have a mess of stuff for you to check out
19:37defnIn fact (makes a todo) I'm going to post a huge backlog of all the links I have with some descriptions, but in the meantime:
19:38defndash: http://delicious.com/thinkpaste/clojure
19:38defnthat's all of my clojure stuff to-date
19:38fielcabraldash what is "are we there yet?"
19:38defnfielcabral: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
19:39fielcabralthank you
19:39defnyw
19:43flintfdash: I've been watching the full disclojure series and finding them to be pretty good
19:45dashflintf: url?
19:46flintfdash: http://vimeo.com/channels/fulldisclojure
19:46dashah, so just language tutorials.
19:47dash(disclaimer: I am a Python hacker looking for ideas to steal.)
19:47flintfah, still you might find some good stuff in there
19:51fielcabralSee you later guys.
19:55ihodesgot a little typo to (?) report: on http://clojure.github.com/clojure/clojure.string-api.html under Overview, (ns your.namespace.here
19:55ihodes (:require '[clojure.string :as str])) is there; but there should be no apostrophe before the [clojure.string...
19:59brehautdash, you would probably get a lot of mileage about of reading about clojure's sequence library and seeing how you could use similar ideas with itertools
19:59dashbrehaut: Nah, that's hardly interesting
19:59dashit's the ideas about value, state, identity, and time that are interesting.
19:59brehautdash: each to their own then :P
20:00brehautbut sequence is an important abstraction there!
20:00dashbrehaut: oh?
20:00brehauta sequence is not just a data structure
20:00brehautyou could concievably have (for example) a sequence of mouse possitions over time
20:01dashok, so if it's not just a data structure, what else is it
20:01brehautpurely mechanically its basicly just an interface. similar to iter in python
20:01ihodesseq is an API in clojure
20:02ihodesa seq needs to implement 'rest' 'first' and 'cons'
20:02dashsure, what i've read about clojure's interfaces has been quite nice
20:02ihodessorry–i'm probably stepping into a conversation that goes way back before i entered the room
20:02brehautihodes: not really
20:03brehautdash, sequences allow you to take something that would be loopy or iterative and break it down into its fundamental computational parts
20:03lancepantz_dnolen: you around?
20:04brehautdash: the same as iterators do in oo langs. learning about how you can compose sequence manipulations is really powerful and applicable to a wide variety of languages
20:08raekactually, seqs don't implement cons...
20:09raekmodulo some technicalities, first and rest is the whole interface
20:10raeksequences do what iterators do in other languages, but does not have the flaw that they mutate
20:10dashbrehaut: sure. but like you said, python already has that
20:10brehautdash yes im quite aware, but you were asking for ideas you could steal right?
20:10dashbrehaut: and you're not missing much, i just got here myself :)
20:11dashbrehaut: sure, but i want clojure's _good_ ideas
20:11dashlike persistent data structures and concurrency and such-like. )
20:11dash:)
20:11raekmaking iterators immutable is one of clojure's best ideas
20:11dashyep.
20:12brehautraek: yes definately
20:12dashI think there are ways that the epochal time model can be combined with an object-oriented language.
20:13raekthere's nothing that's in the way of implementing that model in a class-based system
20:13dashwell. i'm not even talking about classes, particularly.
20:13raekit's just that the standard libraries are built with mutable objects in mind
20:14raekI was going to write object oriented, but when adhering to the epochal time model, I don't know if I would consider it object oriented anymore :)
20:15dashraek: well, there's a language called E
20:15raekmaybe we will talk about Epochal Oriented Programming in the future..
20:15dashit both has a principled model of time and concurrency _and_ is object oriented :)
20:15dashhttp://erights.org/
20:16javeis there some triple-store with clojure bindings?
20:16dashand, not surprisingly, has a good set of persistent data structures
20:17raeka solid foundation for great ideas...
20:17dashso... basically i am contemplating a variant of python where the literals produce immutable lists/maps :)
20:18raekhrm, there is tuple-list, set-frozenset, dictionary-____
20:19raekok, maybe tuples aren't considered to be immutable lists
20:20raekpython has gone some of the way by providing immutable data structures with value semantics
20:20raekit's great to be able to have, for example, sets as keys in dictionaries
20:21raek*frozensets
20:21raekI like your idea. python is my second favorite programming language... :)
20:24dashraek: yes, lack of immutable maps is the killer
20:26raekalso, is there any way of "updating" python's tuples and frozensets (in a persistent manner)?
20:27raekI guess you can do splicing as with string...
20:27raek(also, +1 for immutable strings...)
20:27raekor should I say, "inc"
20:29dashraek: what's the difference between "updating" and making a new one? :)
20:29raekI was thinking about making a new one that shares structure with the old one
20:30raeki.e. don't copy everything
20:30dashoh
20:30dashimplementation detail! ;)
20:31raekwell, one of the neat things with persistent datastructures is constant time updating
20:31dashsure
20:31dashbut you can go back and implement that whenever you like :)
20:32raekclojure's data structures are actually pretty simple
20:32dashsure
20:33raekI recommend reading http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/ and peeking into the source code
20:35raekanyway, it's amazing that persistent data structures practically can promise the same time complexity as mutable ones
20:35dashmostly my interest here is driven by working on a large scale python project and having to deal with the uncertainty promulgated by a big mess of mutable global state
20:35dashraek: yeah i'm mostly familar with older techniques like trailers and so forth
20:36raekI've heard about the Global Interpreter Lock
20:37dashyeah that's just an optimization introduced because they didn't want unsynchronized access to dicts
20:38dashand lists, etc
20:38dashAnyway that's not a concern for me, our app is single threade.
20:38dashd
20:38brehautdash did you see the comments GvR made about CSP stuff and future pythons ?
20:39dashyes, it's rather depressing
21:00dashaah, and rich hickey's amazon bookshelf lists _Lisp in Small Pieces_
21:00dashawesome.
21:06defnraek: nice reading material
21:06defnthanks for that link
21:32raekindentation and font-lock to the people
21:32raekhttp://github.com/raek/clojure-mode/commits/master
21:33raekgood night
21:33danielfmnice!
21:50defnooh ahh
22:27technomancyis test! a decent name for a lein task that cleans and fetches deps before running the tests?
22:27technomancyAntoine de Saint-Exupery would hate it, but I'm thinking about adding it to the next lein.
22:34defnAntoine de Saint-Exupery was a sap.
22:35lancepantz_technomancy: i think it would make sense as an option to the test task
22:43defnhttp://feeds.feedburner.com/jobsrubynow?format=xml -- could someone tell me how to parse this?
22:44duck1123Hey guys. Is Clojure still finicky about running with custom classloaders? I wrote an Openfire plugin using Clojure, but when I try to load it, I get an error that it can't find clojure/core.clj on the classpath
22:44defnim trying to do: (parse (slurp "http://feeds.feedburner.com/jobsrubynow?format=xml&quot;))
22:44defnbut it throws an exception
22:48daakui'm at a point where i think some of my code could be split into a library. i want to basically create a new git repo for this library, but keep using it in it's source form since i'm actively developing both, rather than have to create a jar and install it to my local repo in a static fashion
22:48daakuanyone have suggestions on how best to go about this?
22:49duck1123well, actually, I see clojure/core_init.class in the clojure jar. (1.2.0-master-SNAPSHOT) and since this error is coming from clojure.lang.RT I know it's loaded
22:50rhudsondefn: leave out the slurp call -- xml/parse expects a string arg to be a URI
22:51defnrhudson: oh duh
22:51defnthanks rhudson
22:52technomancylancepantz_: appending ! is like an option. =)
22:52technomancythe task definition is just (doto project clean deps task)
22:52technomancywhich is why I would even consider adding it to begin with
22:53defni sort of like being forced to throw another flag on there
22:53defnor at least that's the behavior id generally expect
22:53defnlein test --deps
22:53technomancydefn: the definition of the test task is _much_ cleaner if you assmue all its arguments are test namespaces to run.
22:54defnwell then you've made up your mind! :)
22:54technomancyI do it right now with a shell alias lcdt = lein clean && lein deps && lein test
22:54lancepantz_i don't think either is correct
22:54technomancywell, the question is whether to add this one-liner task or to just have people make a shell alias for it.
22:54clojurebotmax people is 283
22:55lancepantz_i should say, i don't think either one is incorrect :)
22:56lancepantz_the counter argument to the bang is that your doing something that is lispesque in bash
22:56technomancywe'll also add a method to chain tasks, but it seems like 90% of the usage of chaining tasks would just be for these three together.
22:56lancepantz_"idiomatic bash" is a flag
22:56lancepantz_but it is a clojure tool, so a bang make sense
23:04mister_mwhy should I learn clojure instead of python
23:04rhudsonwhy not learn them both?
23:05mister_mif I thought I had the capacity to retain them both I probably would give that a try
23:06rhudsonyou might surprise yourself
23:06rhudsonWhat languages do you know now?
23:06mister_mI suppose you might be right
23:07mister_mI wouldn't say that I really 'know' any, but I have some experience with java and C++
23:07lancepantz_mister_m: what are your goals?
23:08lancepantz_to get a job? to learn?
23:08lancepantz_enlightenment? :)
23:08mister_mlancepantz, I'd choose enlightenment and education
23:09lancepantz_*cough* clojure *cough*
23:09mister_m:)
23:09lancepantz_look over the first few chapters of the SICP
23:09defnforgive my ignorance: http://feeds.feedburner.com/jobsrubynow?format=xml --> How can I get a collection of titles from that XML?
23:09lancepantz_it kinda touched me personally
23:09rhudsonmister_m, then I'd say Clojure over Python, if you have to choose, in that Python is closer to the same kind/style/philosophy of language of C++ & Java
23:10lancepantz_defn: have gist of what you have so far?
23:10mister_mwhat do you guys think of scheme?
23:10defnlancepantz_: yeah one sec
23:10rhudsonI.e. you'll learn more learning Clojure than learning Python, I believe
23:11defnlancepantz_: http://gist.github.com/502905
23:11defnpractically nothing there :)
23:11lancepantz_i like scheme, but sicp is my only experience with it
23:11defni just havent worked with xml much, and the clojure.xml documentation is nil all the way around
23:12rhudsondefn: it looks like that feed is RSS2, so you need to understand that schema
23:12mister_mI'm a little apprehensive wth scheme and other lisps, becuause the community is so fragmented
23:14mister_mbetween all the different implementations
23:14defnrhudson: how do you mean? I see: :rss, :item, :title
23:15rhudsondefn: it means I *don't* know the RSS2 schema, so I couldn't have said offhand how to find a title. :)
23:16defnheh
23:17Scriptormister_m: plt racket seems to be the major implementation rightn ow
23:17Scriptor*now
23:17rhudsonBut if tthere's a :title tag, you could use xml-seq to visit all the nodes in the doc, filter out the ones with tag=:title, and pull out the content
23:18defnthere we go :)
23:18defnthanks rhudson
23:18defnwow that's slow...
23:24defnim thinking im doing something wrong :)
23:25BahmanHi all!
23:25rhudsondefn: I did like (->> url xml/parse xml-seq (filter #(= (:tag %) :title) (mapcat :content))
23:28notsonerdysunnyHi all.. I am a newbie to both enclojure and netbeans. I am trying to build labrepl. The build seems successfull. However when I try to start the repl, it is telling me that the clojure-master-1.2.0-snapshot.jar and the corresponding clojure-contrib<..>.jar is not available.. when I try to rebuild .. I noticed that the maven build is unable to download those files due to non-availability of...
23:28notsonerdysunny...the resource.. How can I fix this?
23:36defnrhudson: what's the diff between xml-seq and zip/xml-zip
23:38lancepantz_heh, someone needs to make something that's like paste-bin, but an irc channel with a repl bot
23:38rhudsondefn: xml-seq gives you a sequence of nodes, in depth-first order.
23:38lancepantz_so we could all go to like #clj-8317313 and load an ns
23:38lancepantz_and all share a repl
23:38defnthat's an awesome idea
23:38rhudsonzip/xml-zip gives you a "zipper" over the same tree, which lets you move around the tree and edit it
23:39defnlancepantz_: seriously. cool idea.
23:39lancepantz_yeah, i realized i got your solution 10 minutes after rhudson had it
23:39defnthen if you need to hop namespaces: /join #clj-ns2
23:39lancepantz_right
23:40defn(ns clj-ns2 (:use clj-8317313))
23:40defnbadda bing badda boom
23:40lancepantz_yeah, that'd be cool
23:40defni dont know how honest to god useful itd be
23:40defnbut it could be fun for sure :)
23:41rhudsonMaybe limit execution to some fraction of a second.
23:42defnor maybe just say: fuck it. let's get dirty.
23:42defnsandboxes are nice because you think: "this is great. ill be able to stop everything naughty from happening automagically"
23:42rhudsonWhoever's paying for the cycles might not see it quite the same way...
23:42defnbut then you realize it screws up all sorts of things you want to do
23:43defnrhudson: fair enough but I mean, I think as long as there was a nice layer that stopped you from reading/modifying files outside of the classpath or project-dir
23:43defnthen id be obliged to trust people
23:46rhudsonWell, I think most of the things we want to illustrate to each other don't take that long to run, and a time limit would prevent e.g. both deliberate and accidental infinite loops
23:46defnyeah but sometimes stuff takes time
23:46rhudsontrue
23:46defnlike let's say we were working on a big xml document and we wanted to parse out XYZ and then do all sorts of computationally intensive things
23:47lancepantz_maybe allow people to authenticate to it
23:47defnlancepantz_: not a bad idea
23:47lancepantz_and if you're authed then you are allowed more cycles
23:47defnactually putting it on freenode might be a bad idea
23:47lancepantz_it would have to be
23:47defnrate limiting would screw things up
23:48defnif i printed 300 lines to the REPL youd be scrolling while i was still typing
23:48defnperhaps spawning a little irc network where one person plays the host
23:49lancepantz_there would be some limits with an irc interface
23:49lancepantz_i think to solve what you're proposing you would want to make it a web app
23:50lancepantz_how do they do those clojure sites, is that html5 stuff?
23:50lancepantz_not java applets i assume
23:50defnsimple JS
23:50defnand by "clojure sites" which do you mean?
23:50defnlike "try clojure"?
23:50lancepantz_like try clojure
23:50defnyeah that's just JS
23:50rhudsonThere's a Mac text editor (the name of which I'm forgetting at the moment) that allows multiple people to work on the same doc peer-to-peer. Something like that for programming would be cool
23:50defnyou can get fancy with some HTML5 and CSS3 magic
23:50defnrhudson: subethaedit
23:50rhudsonright
23:50defnare you guys emacs users?
23:51defnhttp://www.emacswiki.org/emacs/Rudel
23:51rhudsonI swore off emacs years ago
23:51defnsharing a repl is hard...
23:52defnlancepantz_: if you wanna try out Rudel I've been curious to see if they've made any progress
23:52lancepantz_looks interesting, i will sometime
23:52defnlancepantz_: with cake eval we might be able to do some of this stuff with a text editor
23:53lancepantz_it'd be possible