#clojure logs

2010-03-12

00:15technomancyslyphon: so am I going to see a docs patch for leiningen coming from you soon? =)
00:16slyphonuh, sure!
00:16technomancyyou just mentioned a few concepts that were missing from the readme that I had just taken for granted
00:17psykoticjoshua-choi: regarding your earlier question, what you need is a right fold, not a left fold like reduce.
00:17joshua-choiYeah, I know. :)
00:17technomancyif you don't have time for a patch it would be great if you could just send something to the mailing list mentioning the things that weren't clear... while it's still fresh in your mind.
00:17joshua-choiThe problem is with my parser, which is LL
00:17joshua-choiI had no problem with digits before decimal points
00:18slyphontechnomancy: sure, i'll take a whack at it tomorrow or the next day
00:18joshua-choiI could just consume all the digits and then run a function on the whole sequence, but I want to minimize memory
00:18joshua-choiFor demonstration purposes
00:19technomancyslyphon: no pressure, just thought it'd be good to get a fresh perspective
00:19slyphonsure
00:19technomancyeasy to miss that when you're heads-down in the code for a while
00:19psykoticwell, this function you want to compute is provably not computable that way. suppose you see 0.1.... and you want to compute the intermediate result. well, you do 0.1 + 0.1 * (recurse on the ...)
00:19slyphoni know how that is
00:20psykoticwhich is not a tail call
00:21psykotichere's one trick you can do if you know someone has already spent the memory on reading in the input string
00:21psykoticyou scan forwards to the end of the decimal sequence and then scan backwards
00:22psykoticin that case you are not using extra memory on your own behalf, but you are using the memory already used by the caller in constructing the input string, etc
00:22psykoticbut if you are reading from a lazy seq, you don't have that luxury
00:22tomojwhy would you scan backwards?
00:23psykotica right fold over the forward-direction sequence is the same as a left cold over the backward-direction sequence
00:23psykoticit's the usual foldl/foldr identity
00:23psykoticerr, left fold, not cold :)
00:24tomojand somehow that gives you a way to go from [3 5 2 1] to 0.3521?
00:24psykoticlet me show you with an example
00:26psykotichere's the foldr version
00:26psykotic(letfn [(foldr [f val coll] (if (seq coll) (f (first coll) (foldr f val (rest coll))) val))] (foldr #(+ %1 (* 0.1 %2)) 0.1 [1 2 3 4]))
00:26psykotic,(letfn [(foldr [f val coll] (if (seq coll) (f (first coll) (foldr f val (rest coll))) val))] (foldr #(+ %1 (* 0.1 %2)) 0.1 [1 2 3 4]))
00:26clojurebot1.23401
00:27psykotichere's the reverse/reduce version:
00:27psykotic,(reduce #(+ %2 (* 0.1 %1)) (reverse [1 2 3 4]))
00:27clojurebot1.234
00:28psykoticsorry, for the earlier i meant
00:28psykotic,(letfn [(foldr [f val coll] (if (seq coll) (f (first coll) (foldr f val (rest coll))) val))] (foldr #(+ %1 (* 0.1 %2)) 0 [1 2 3 4]))
00:28clojurebot1.234
00:29psykoticin any case, they use the same amount of memory in this case--it's just a question of whether it's in a data structure (the reverse) or on the call stack (the foldr)
00:29psykoticbut the point is that if you already have something like a vector, then you can reverse with no extra storage overhead using rseq
00:29psykotic,(reduce #(+ %2 (* 0.1 %1)) (rseq [1 2 3 4]))
00:29clojurebot1.234
00:30tomojok
00:31tomojoh, by "scan forwards to the end of the decimal sequence", did you just mean that you find where it ends?
00:31psykoticyes
00:31tomojah, ok
00:31psykoticso then you know the slice, you slice it, then use rseq to reverse it
00:31tomojI had thought you meant you should do both a foldr and a foldl
00:32psykoticwell, you do foldl for the integral part and foldr (or foldl/rseq) for the fractional part
00:33tomojI see
00:44psykoticalternatively...
00:45psykotic,(/ (reduce #(+ %2 (* 10 %1)) 0 [1 2 3 4]) 1000.0)
00:45clojurebot1.234
00:46tomojbut then you have to count the sequence, right?
00:46psykoticthat's right
00:47psykotic,(reduce #(* %2 10) 1 [1 2 3 4])
00:47clojurebot40
00:47psykotic,(reduce #(* %1 10) 1 [1 2 3 4])
00:47clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--4943$fn
00:47psykoticheh
00:48psykoticbut yeah, you can't escape what i said earlier about computing this function requiring a certain amount of space, either your own or someone else's
00:49psykoticin this case, the space is taken up by the integer
00:49psykoticfor my technique to work in general, you'll need arbitrary-precision integers, like BigInteger, which aren't constant storage, so this technique is deceptive
00:50psykoticessentially, i'm just using the integer as a vector of digits
00:50psykoticbetter constant factor on the storage, but asymptotically the same
00:58psykotic,(letfn [(parse-fraction [xs] (* 0.1 (/ (reduce #(+ %2 (* 10 %1)) 0 xs) (reduce (fn [x _] (* x 10)) 0.1 xs))))] (parse-fraction [1 2 3 4]))
00:58clojurebot0.12340000000000001
01:04psykoticincidentally, this is a good example of where folds can be fused using the tupling transform:
01:04psykotic,(letfn [(parse-fraction [xs] (let [[m n] (reduce (fn [[a b] x] [(+ x (* a 10)) (* b 10)]) [0 0.1] xs)] (* 0.1 (/ m n))))] (parse-fraction [1 2 3 4]))
01:04clojurebot0.12340000000000001
01:06psykotic(letfn [(parse-fraction [xs] (let [[m n] (reduce (fn [[a b] x] [(+ x (* a 10)) (* b 10)]) [0 1.0] xs)] (/ m n)))] (parse-fraction [1 2 3 4]))
01:06psykotic,(letfn [(parse-fraction [xs] (let [[m n] (reduce (fn [[a b] x] [(+ x (* a 10)) (* b 10)]) [0 1.0] xs)] (/ m n)))] (parse-fraction [1 2 3 4]))
01:06clojurebot0.1234
01:14joshua-choiThanks to everyone's help, I've fixed my parser. You all rock.
01:18psykoticsomeone should do a tutorial that shows how easy it is to do undo in applications based on functional programming
01:18psykoticthat's one of the really compelling use cases, imo
01:19psykoticevery large application i've worked on has had some half-assed way of doing undo that did deep copies of the relevant parts of the object graph and shit like that
01:19psykoticit's super wasteful. persistent data structures makes it lightweight and easy.
01:50zmila,,(doc every?)
01:50clojurebot"([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
01:51tomoj,,,,(doc every?)
01:51clojurebot"([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
01:51tomojweird
01:51psykotici cry every time i type every? instead of all? :)
01:51psykotictwo wasted characters, man, TWO!
01:52psykotic,(doc some?)
01:52clojurebotPardon?
01:52psykotic,(doc any?)
01:52clojurebotExcuse me?
01:52tomoj,(doc some)
01:52clojurebot"([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"
01:52psykoticoh right, it isn't necessarily boolean
01:52tomojsome returns booleany things
01:52tomojyeah
01:53tomojhmm "booleany" seems better than I thought at first
01:53tomojbecause it really just returns any kind of thing
01:54tomojisn't pred in that doc a bit misleading?
01:54tomojsince it might not be a predicate?
01:54zmilapsykotic - lol!
01:55psykoticbtw, a pet peeve about the name 'some' (aside from the fact that 'any' is one character shorter) is that it has the wrong connotations
01:56psykoticthis goes back to some of aristotle's syllogisms actually. does 'some' imply that more than one member must satisfy the predicate? in human language, that's usually the case
01:57psykoticalthough you could say the same about every? in human language, if something is true for all members, it connotes that the set of members is nonempty, etc
01:59tomojyes
01:59tomoj(any even? numbers) vs (some even? numbers)
02:00tomojboth of those are awesome, though
02:00psykoticbtw, i'm not sure why every? isn't symmetric with some by returning the last logical true element, rather than 'true'
02:00psykoticthat's a weird asymmetry
02:00tomojbah
02:00tomojand you'd call it every ?
02:00psykotici suppose so. or all :)
02:00tomojah
02:00tomojany/all is cool
02:00psykoticmy point is that this would restore the symmetry with 'and' and 'or'
02:01psykoticright now there's a weird asymmetry
02:01tomojbut I don't think the last logical true element is ever useful...
02:01tomojthat seems a weird thing to return to me
02:01psykoticwell, think about 'and'
02:01tomojooh shit
02:01psykoticit's the same thing
02:01tomojyeah
02:01psykoticall is just 'and' folded over the sequence
02:01tomojthat sounds immensely useful, actually
02:02tomojwait.. I think I was confused
02:02tomojI know getting the first logical true value in a seq would be useful
02:03psykoticagain, look at 'and'. it's the exact same thing.
02:03tomojall would simultaneously check that all of them were logical true and also give you the last element?
02:03psykotic,(and true 42)
02:03clojurebot42
02:03zmilalast logical true = (apply and (map pred coll))
02:03psykotic,(and true 42 666 -1)
02:03clojurebot-1
02:03psykoticzmila: except and is a macro, but yeah
02:03tomoj,(and true 42 nil -1)
02:03clojurebotnil
02:03tomojI don't often need that
02:03tomojor maybe I do and just don't know it
02:04psykotic(and x y) is basically (when x y)
02:05psykoticthat's pretty useful
02:05tomojok, so a list of things to do that can short-circuit, maybe?
02:05psykoticnah, not short circuit
02:05psykoticsome doesn't short circuit either
02:05tomojsure it does..
02:05psykoticoh right, for lazy seqs
02:06psykoticanyway, every? presumably also short circuits
02:06tomojyeah, so you could have a bunch of lazy seqs representing a calculation chain maybe?
02:06psykotic,(every? identity [false (println "asdf")])
02:06clojurebotasdf
02:06tomojand at any point you can short-circuit and fail, otherwise you get the end result
02:07psykotic,(every? identity (lazy-seq (cons false (lazy-seq (cons (println "asdf") nil)))))
02:07clojurebotfalse
02:07psykoticright
02:10psykoticand in any case, it's the aesthetic asymmetry that i don't like more than anything :)
02:11tomojyes, it is strange
02:11tomojbut I figured maybe it's tied to actual use patterns
02:11psykoticif and was called and? and returned 'true' when operands were all logical true, i would be equally revolted
02:12tomojas in, rich put it what he actually wanted
02:12tomojbut I don't place much confidence in my ability to imagine use cases for functions
02:12psykoticmy preference would be any and all without any questionmarks and with the semantics i outlined.
02:13psykotic1. they are short and symmetric in their names
02:13psykotic2. they are symmetric in their semantics
02:13psykotici think the every? and some? names come from scheme
02:13tomojyes, I like it too
02:13tomojbut can you describe a simple use case for all ?
02:14tomojperhaps I should adopt the backtick convention and ask about `all`
02:15psykoticyou want to ensure that all elements have a certain property, and return some feature of the last element
02:16psykoticadmittedly it's less common than wanting to know the first element satisfying some property
02:16tomojright
02:16tomojwhat I can't imagine is a typical feature that is also a property
02:16psykoticthey don't have to be the same
02:16psykoticyou can do (or (pred x) (feature x))
02:16tomojbut with `all` ?
02:17tomoj(all identity ...) maybe
02:17psykotic,(every? #(when (% < 10) (* % %)) (range 10))
02:17clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn
02:17psykoticokay, i clearly need to put on my prefix goggles :)
02:18psykotic,((every? #(when (< % 10) (* % %)) (range 10))
02:18clojurebotEOF while reading
02:18tomojbad luck :(
02:18psykotic,(every? #(when (< % 10) (* % %)) (range 10))
02:18clojurebottrue
02:18tomojok, so I see how that works
02:18tomojbut using when like that in a #() seems strange to me
02:19tomojI can imagine it being useful though
02:21psykotic,(letfn [(all [f xs] (reduce #(when-let [x (f %2)] x) nil xs))] (all #(when (< % 10) (* % %)) (range 10)))
02:21clojurebot81
02:21tomojhuh, you can't apply and
02:21tomojthat sucks
02:21psykoticit's a macro :)
02:22tomojis that what you have to do to get around that?
02:22tomojyou've brought up an interesting area of my ignorance
02:23tomojthe fn there, #(when-let [x (f %2)] x)
02:23tomojthe body of the fn is a macro
02:23tomojso at macro-time, this is expanded into only function and special forms, before being compiled into bytecode?
02:23psykoticit does a when test using the last binding in the [...]
02:23tomojyeah, I can figure out how it works, just fuzzy on the actual runtime behavior
02:24Chousukemacros don't exist at runtime
02:24Chousukewell, unless you use eval
02:24tomojright, so it's just special forms and fns that get compiled into bytecode for that #() ?
02:24psykotic,(letfn [(and* [& xs] (reduce #(and %2 %1) xs))] (apply and* (range 1 10)))
02:24clojurebot1
02:25psykotic,(letfn [(and* [& xs] (reduce #(and %1 %2) xs))] (apply and* (range 1 10)))
02:25clojurebot9
02:25Chousuketomoj: well, yes, because the macro expands to those :)
02:25tomojok
02:26tomojso the reader reads "some" and resolves that into a function object
02:26Chousukeno, the reader makes a symbol
02:26tomojoh, then the evaluation happens after, right
02:27Chousukethe compiler resolves it into a var, and at runtime the value of the var is acquired and then called
02:27tomojand syntax like "#{}" reads to a set, or evaluates to a set?
02:27Chousukereads as a set, and evaluates into one
02:27tomojaha
02:27tomoj,(eval #{})
02:27clojurebotDENIED
02:28tomojer, of course
02:28Chousukeit reads as a set of symbols, but evaluates into a set of the values of the symbols
02:28tomojbut it's #{}
02:28psykoticthe fact that it reads into a set can be tested using a macro
02:28Chousukethat is, if it had something in it.
02:28tomojwow
02:28tomojI don't think I ever fully grokked homoiconicity before
02:28tomojin clojure's rich landscape at least
02:29tomojno pun intended
02:29psykoticfor shame, there is no letmacro :)
02:30Chousukein Common lisp, a vector reads as a vector of symbols, but also evaluates into one
02:30Chousukeso if you want a vector of values, you need to do `#(,foo ,bar)
02:31tomojseriously?
02:31ChousukeWell, as far as I know, yes.
02:32psykoticthat is correct
02:32tomojnever saw that syntax before
02:32psykoticit's one of the things i hate about cl
02:33psykoticbasically, it's intended to be symmetric with '(...) for constructing lists in the reader
02:33Chousukehuh. why wouldn't they just have #(foo bar) and '#(foo bar) then :P
02:34psykoticsince vectors are not used to represent code in common lisp, that was a horrible idea
02:34psykotici agree
02:34psykoticanyway, that is the explanation i heard.
02:34psykotici'd love to read something like 'The Design and Evolution of C++' for Common Lisp that documents all the weird design decisions and trade offs for compatibility or coherence with the existing compilers and lisp variants out there at the time
02:35psykotici picked up a few bits and pieces from reading cll over the years
02:35greghYou are in a maze of twisty parentheses, all alike.
02:35greghYou are eaten by a defun.
02:36psykoticnomnomnom
02:58psykotici wonder who would win a longest-names contest--java or objective c programmers?
02:58psykoticjava programmers are the usual whipping boys but i think objective c would win
02:59ChousukeIt's not really fair for ObjC because parameters are interleaved
03:00Chousukeso while the name is longer, it's also much more readable than a shorter, but still long, name in java :P
03:00psykotici'm referring to things like KeyAndValueArrayIndex for what a good programmer would call 'i'
03:00psykoticit makes code unreadable
03:01ChousukeI don't think I've ever seen things ike that :P
03:01Chousukelike*
03:01psykotici was looking at some of wil shipley's code
03:01psykotiche's the guy who wrote delicious library, omniweb, etc
03:02psykotiche also admits to using proportional fonts for his code, so maybe i should just write him off as altogether demented :)
03:02Chousukeheh :P
03:03tomojpsykotic: stringByAddingPercentEscapesUsingEncoding
03:03tomojthat's what they call urlencode
03:03tomojI did too
03:03tomojthankfully they brought someone else in to do the iphone stuff :)
03:04psykoticwhen your identifiers are longer than the implementation... :)
03:04tomojit's somewhat suprising to me
03:05tomojthat everything apple has made uses that shit
03:05psykotici like names like i, x, y, when they are narrow scope and generic/non-specific. for example, in haskell flip (x,y) = (y,x) is perfect. the x and y have no meaning, they only there to convey structure.
03:05psykoticflip (firstValue, secondValue) = (secondValue, firstValue) is much less readable
03:05tomojI dunno, maybe I can imagine finding those long names useful
03:05tomojin an alternate universe where I'm a weirdo
03:05psykoticheh
03:05hiredmanclojurebot: the evolution of lisp?
03:05clojurebotLisp isn't a language, it's a building material.
03:06psykoticthe case i usually here for something like KeyAndArrayValueIndex, etc, is that if you have deeply nested for loops, then you get confused about the meaning of i and j, etc
03:06tomojlike in the tool vs. language user debate
03:06psykoticat which point i want to say, don't do that
03:06tomojobj-c is much toolier I guess, so maybe tool people like it
03:06psykotici actually like objc as a language
03:06psykotici'm less a fan of some of the conventions
03:06tomojI hate it but I never did any C
03:07Chousukepsykotic: of course, the better solution in most cases is to use a foreach or something :P
03:07greghmathematicians have been using single letter variable names for centuries, it works just fine :)
03:07psykoticChousuke: indeed
03:07Chousukeindexes are silly
03:07tomojyes
03:07tomojjavascript annoyed me the other day with that
03:07Chousukegregh: not only that, but single letter names with various subscripts!
03:08hiredmanhttp://interglacial.com/~sburke/pub/Evolution-of-Lisp.ps.gz is good, but not so detailed about common lisp as to go into why its vectors are the way they are
03:08psykoticChousuke: when you need to mutate, they're useful, especially when you don't have pointers, or if the iterator/cursor isn't a pointer directly
03:08greghChousuke: and that's arrays :)
03:09Chousukegregh: arrays, or some weird set of different but related values :P
03:09psykoticbtw a trick i find useful in clojure and haskell is a sort of 'key path' that can be used as both a functional getter and a setter
03:09psykoticwhen used for lookup, it just reduces the keys over the initial input map
03:09greghif only fortran supported subscripts! oh wait, that's in fortress now
03:10ChousukeIt's often impossible to read maths unless they actually tell you what the variables are first
03:10greghsame with programs
03:10hiredmanpsykotic: have you seen update-in and get-in?
03:10Chousukethere's a lot of common knowledge of course
03:10psykotichiredman: no? link?
03:10hiredman,(doc update-in)
03:10clojurebot"([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."
03:10psykotichiredman: doh, yeah that's exactly what i wrote myself
03:11Chousukebut if you take a random wikipedia article on abstract math, it's not going to be easy to understand ;/
03:11tomojalso assoc-in
03:11psykoticit would be nice if this interoperated smoothly with clojure.zip
03:11psykoticright now i don't see a way of going from a zipper to a 'key path'
03:12psykoticnot terribly difficult to code yourself, mind
03:12tomojhmm, I haven't really used zippers much
03:12tomojis there anything already there for using zip paths as getters/setters?
03:13tomojhaven't looked at it in a while so I don't really remember how it works
03:13psykoticzippers are useful when you want to do several updates in a batch a la these *-in functions
03:13psykoticoleg's page has a neat example of using a file system zipper for doing concurrent transactions
03:13tomojsounds awesome
03:14psykoticclojure.zip is a 'one-hole context' zipper, oleg's can have an arbitrary number of holes, corresponding to concurrent users
03:14tomojI think I saw a presentation about the file system built on zippers before
03:15hiredman,(pl (↕map range $ 3 λx (inc x)))
03:15clojurebot(1 2 3)
03:15hiredmandone with zippers
03:15psykotic,(doc pl)
03:15clojurebot"([& forms]); replaces a $ b with (a b) walking right to left replaces a · b with (comp a b) left to right ⌽a with (uncurry a) left to right ↕a with (flip a) left to right"
03:15hiredmanpl is a toy of mine
03:16tomojdoes it map to something googleable?
03:16hiredmanno
03:16hiredmansource is around
03:16hiredmanclojurebot: transform?
03:16clojurebottransform is http://github.com/hiredman/odds-and-ends/blob/8a84e6ddbad9d71f714ba16c3e1239633228a7eb/functional.clj
03:16psykotictomoj: yeah, the file system talk is great
03:17psykoticwhen i first read it years ago, it also cemented the connection in my head between zippers and delimited control
03:17tomojhiredman: you just made up the language?
03:17hiredmanum
03:17hiredman,(macroexpand '(pl (↕map range $ 3 λx (inc x))))
03:17clojurebot(do ((flip map) (range 3) (fn [x] (inc x))))
03:17hiredmanI dunno that I would call it a language
03:18tomojwell, I mean, your choice of what these funky symbols do under the macro
03:18tomojI figured "pl" was the name of some other language or theory of lambda calculus or something
03:18hiredmanpointless
03:18tomojah
03:19psykoticlambdabot on #haskell has a @pl command for converting any term to pointless (and unreadable) form
03:20psykoticbotfight!
03:21hiredmanclojurebot: so and so likes haskell!
03:21clojurebothaskell is Yo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you don't compute.
03:22unfo-lol :D
03:23tomojpsykotic: so what do you think should be done about literate clojure?
03:23psykotichiredman: btw, regarding editing things functionally, have you read conal's blog posts on 'semantic editor combinators'?
03:24tomojI saw that, pretty awesome
03:24psykotichttp://conal.net/blog/posts/semantic-editor-combinators/
03:24tomojI'm barely touching true FP magic, I think
03:24psykoticsome of them also apply to zippering
03:24hiredmanpsykotic: I have not
03:26tomojpsykotic: so are you suggesting we need a better clojure.zip, or clojure.contrib.general-zip or something?
03:26hiredman(but I will have soon)
03:26psykotictomoj: well, i only started clojuring a few days ago, i figure i'll write my own stuff if need be
03:26hiredmanclojure.zip could use more usage
03:27psykoticzippers are super nice but a little scary at first
03:27psykoticthere's a great paper by norman ramsey on using zippers in combination with a few top-level ml-style refs (a la clojure)
03:28psykoticit's one of the few papers on real-world non-trivial uses of them
03:28psykotichttp://www.cs.tufts.edu/~nr/pubs/zipcfg-abstract.html
03:28psykoticthe refs are basically used for circularity
03:29psykoticthat's one of the issues with zippers--they only work for acyclic data structures directly, so you need to 'break cycles' with something like references
03:29psykoticof course, they need not be mutable references--you can also just use labels that are resolved functionally through a top-level state map of some sort
03:30hiredmanmmmm
03:34tomojpsykotic: it sounds to me like that could have applications in doing neural net calculations functionally, yeah?
03:35psykoticdunno, it seems like that is easily done using standard functional techniques?
03:36psykoticdon't you generally evaluate those layer by layer?
03:39tomojsometimes, yes
03:39tomojbut the kinds I am interested in are not easily layered
03:40psykotici guess the standard c approach is queue-based for those?
03:41psykotici.e. you evaluate some, if they trigger, you enqueue the targets, etc
03:41tomojunless there is some way to go from a directed graph to a set of layers, even with cycles?
03:41tomojah, I see
03:42tomojbut don't you still end up with this awful complexity if all your edges are refs?
03:43psykoticit doesn't seem so bad. you're just associng once per candidate node
03:44psykoticwhere zippers shine is when you have really deep structures
03:44psykotichere you can just use a one-level labels to data map
03:45psykoticso, the data for a node would store any internal state, plus a list of (weight, label) pairs for outgoing connections
03:45tomojah, and then you look up the label in a ref'd map to get the node?
03:45psykoticit's not refed
03:46tomojwell, you've got an immutable map which contains ref values, then?
03:46psykoticno
03:46psykoticno refs anywhere. the labels serve the indirection purpose.
03:46psykoticyou can think of them as functional refs, if you will, and this one-level map as the 'heap'
03:46tomojok, but where does the activation value go
03:47tomojeach node has a ref pointing to its internal state?
03:47psykotic{:node1 {:activation :outgoing [[:node2 12] [:node3 666]]} ...}
03:47psykoticthat's your computation state
03:47psykoticerr, :activation 42
03:48tomojand you just put the whole thing under one big ref?
03:48psykoticthere's no ref!
03:48tomojgoddammit
03:48psykotichehe
03:48psykoticor is the point to do this concurrently?
03:48tomojI feel like descartes
03:48tomojyes, concurrency would be nice
03:49psykoticwell, let's just do it the obvious functional way first
03:49psykoticthe point is that you have this map that represents the current state of your neural net
03:49psykoticeach round you have a list of initial candidate nodes to examine for firing
03:49tomojthen an update step is just a function on the map, and you get the next state back?
03:50psykoticas you examine those, you update the state map by associng new data under the examined node labels, enqueue the connected nodes for examination, etc, until there are no more candidates, and at the end you got the final state for that round
03:50psykoticyes
03:50psykoticthis is just the standard way of doing graphs functionally
03:51tomojok, so each update step itself would iterate through a function on a queue of candidates returning another queue?
03:52psykoticthere would be a step function that takes a node label, the current state map, and returns a list of other nodes to examine, plus the new updated state map
03:52psykoticthen there is an outer function that repeatedly pulls stuff off the front of a list of candidates, call this step function, conjs the returned list of nodes onto its work list,
03:52psykoticrinse and repeat until the work list is empty
03:53psykoticsomething like that. rather than approach this directly, try to wrap your head around how you implement graph algorithms functionally, it's really the same thing
03:53psykoticthe only difference is that here we have some auxiliary data per node aside from the usual adjacency lists
03:53tomojok
03:53tomojI will have to review graph algorithms, it's been a while
03:54psykotictry something simple like a BFS
03:54psykoticwith special focus on how you deal with cycles
03:54tomojwill do
03:55tomojbut, do you think that in the concurrent case, zippers would help?
03:55psykoticnot really
03:55psykoticthe structure here is flat, zippers don't shine
03:55tomojjust curious, because following up on understanding the simple functional case will take me a while
03:55psykoticif you wanted to do this concurrently, you'd make the map go from labels to refs to data
03:56psykoticbut don't worry about that now
04:06psykoticbtw, regarding paths and zippers, one very useful thing is a function that takes a list of paths and factors them into common prefixes as much as possible
04:06psykoticit's the core function also used in the trie data structure
04:06psykoticonce you have that, you can very efficiently take a list of paths and associated update functions and run them as a single 'transaction' using a zipper, very efficiently
04:26Licenser_morning my lispy friends!
04:34invis87Hi all
04:34invis87Could you help me ? How can I write a function which print some message different times. Something like this: (defn my-hi [x] (while (not (zero? x)) ((println "hi") (dec x))))
04:35psykotic,(letfn [(say-hi [n] (dotimes n (println "hi")))] (say-hi 10)
04:35clojurebotEOF while reading
04:35Chousuke(dec x) doesn't actually decrease x :)
04:35Chousukebut if you don't want to cheat using dotimes, you need to use recursion
04:36invis87how :)
04:36Chousukesomething like (defn hi [x] (when-not (zero? x) (println "hi") (recur (dec x))))
04:37invis87So I cant use it like while in java ?
04:37Chousukeno.
04:37invis87without recursion
04:37invis87hmm, thanks
04:37Chousukethere is a while in Clojure, but it's for java interop mostly
04:37Chousukemost of the time you're dealing with immutable values, so while is completely pointless :)
04:38Chousukebecause the condition of the while would be immutable too
04:38BlktChousuke: (dec 2) => 1 in repl
04:38ChousukeBlkt: yes, and that doesn't change 2
04:38Blktah, rebinding
04:38Blkttrue
04:38invis87(def x 5) , => x
04:38invis875
04:38invis87(dec x)
04:38invis874
04:39invis87but
04:39invis87x
04:39invis875
04:39invis87:D
04:39Chousukeyes.
04:39Blktyy
04:39Chousukethat's the point
04:39Chousukeit takes a while to wrap your brain around those semantics, but it makes many things a lot easier
04:40Chousukeif you program using immutable values, you never need to worry about someone else corrupting your data
04:40invis87How I can write function like my-hi without while or like-while ?
04:40Chousukeyou can pass your data structures wherever you want and just assume that they are not affected by it at all.
04:41Chousukeexactly because they are immutable.
04:42Chousukeinvis87: well, the simplest way would of course be (dotimes [i 10] (println "hi"))
04:42invis87hmm
04:42invis87))
04:42Chousukeor you can use the loop special form, but it's pretty much equivalent to the recursive function approach
04:42bsteuberinvis87: when you really *want* to change something, there are vars, refs, atoms and agents - but most of the time you won't
04:42invis87but dotimes is macro
04:43Chousukeinvis87: yes, it expands to a loop
04:43Chousukebut loops in clojure are not like loops in java. They're recursive, which means you still can't modify things arbitrarily and need to use recur to "restart" the loop
04:44invis87wow
04:44invis87So there no loop without recursion ?
04:44Chousukepretty much.
04:44invis87it is like O_o
04:44invis87for me
04:44hiredman,(macroexpand '(dotimes [n 1e50M] (println n)))
04:44clojurebot(let* [n__5299__auto__ (clojure.core/int 1E+50M)] (clojure.core/loop [n (clojure.core/int 0)] (clojure.core/when (clojure.core/< n n__5299__auto__) (println n) (recur (clojure.core/unchecked-inc n)))))
04:45Chousukebut that's not a problem, since non-recursive loops don't make sense in a functional program anyway
04:45hiredmanI can't say I care for that cast to int and the unchecked-inc
04:45Chousukehiredman: it's optimised for speed and side-effects I suppose :P
04:45hiredman:/
04:46tomojpsykotic: that sounds awesome
04:47Chousukeinvis87: The key to functional programming is that you always need to capture the return value of things :)
04:47psykoticChousuke: you can easily have both. you simply check on entry to the loop if the thing fits in an unboxed integer.
04:48psykoticyou know the bound ahead of time
04:49hiredman,(macroexpand-1 '(dotimes [n m] (println n)))
04:49clojurebot(clojure.core/let [n__5299__auto__ (clojure.core/int m)] (clojure.core/loop [n (clojure.core/int 0)] (clojure.core/when (clojure.core/< n n__5299__auto__) (println n) (recur (clojure.core/unchecked-inc n)))))
04:50Chousukeinvis87: Because functions (ideally) have no side-effects, the only way they can communicate with the caller is by their return value. Clojure isn't pure though, so sometimes you write non-functional code where that doesn't apply, but that's another story
04:50psykoticwhen i say ahead of time, i obviously mean on entry to the loop--the termination condition isn't dynamically reevaluated with each iteration
04:50psykotichence, you can just have two code paths
04:50hiredmansure
04:50psykoticat the very least it should throw an exception for bounds that don't fit in an unboxed integer
04:51tomojlike if you tried to pass a long in?
04:51Chousuke,Integer/MAX_INT
04:51clojurebotjava.lang.Exception: Unable to find static field: MAX_INT in class java.lang.Integer
04:51Chousukehm, what's the field ;/
04:51tomoj,Integer/MAX_VALUE
04:51clojurebot2147483647
04:51tomojsoo...
04:51psykotic2 billion isn't that many iterations
04:51tomojwow
04:52Chousukefor side-effects I would say it is. :/
04:52hiredman,(int 1e100000M)
04:52clojurebot0
04:53Chousukehm, that's not very good behaviour
04:53hiredman,(int 1e1000M)
04:53clojurebot0
04:53tomoj,(dotimes [i 1e1000M] (println "hello"))
04:53clojurebotnil
04:54hiredman
04:54ChousukeI think that ought to be fixed :P
04:55ChousukeCould probably just throw an exception on more than MAXINT iterations. If you need more you can always write your own loop
04:55tomoj,(int (inc (long Integer/MAX_VALUE)))
04:55clojurebot-2147483648
04:55hiredmanclojurebot: whose job is it to fix it?
04:55clojurebotwho's job is it to keep hiredman in line? is <reply>That's my job
04:57psykotichiredman: you wrote clojurebot?
04:57hiredmanI guess
04:57psykotici guess java makes it easy to jail something like a bot
04:57psykoticor the jvm rather
04:58Chousukewell, clojurebot's sandbox is far from perfect :P
04:58hiredmanyes
04:58ChousukeI guess you can't take over the machine it runs on, but I'm sure there are ways to DoS clojurebot
04:59greghask him to evaluate the ackermann function for suitable inputs, for example
05:00tomojwouldn't it time out?
05:01greghtime out or space out, whichever comes first :)
05:01psykoticdoes the jvm support 'jail compartments' for pieces of running within the same jvm?
05:02hiredman,(apply trampoline (repeat 2 (fn a [x] #(x a)) )
05:02clojurebotEOF while reading
05:02psykotic*pieces of code
05:02hiredman,(apply trampoline (repeat 2 (fn a [x] #(x a))))
05:02psykotichiredman: speaking of which, have you considered auto-paren closing :)
05:02clojurebotExecution Timed Out
05:02hiredmanpsykotic: nope
05:03greghI guess that's a pretty short timeout
05:03hiredmanif I recall it is ten seconds
05:04psykoticbtw, one thing i often wish for is a lazy print/println
05:04psykoticor at least chunky semilazy
05:04hiredmanuh, what?
05:04psykoticas in, won't coerce to str directly but will doseq as a seq of chars
05:05psykoticmaybe it's because i'm used to ghci
05:05psykoticit's nice to be able to println an infinite sequence and ctrl-c in the middle
05:06psykoticit would also mean you could have clojurebot print some prefix of an infinite sequence with ... after a certain point
05:06greghit might be easiest to just write one whenever you need that
05:06psykoticand hack slime's repl to use mine, yeah
05:09psykoticright now all the print-method implementations print directly using .write
05:10hiredman,(doc *print-level*)
05:10clojurebot"; *print-level* controls how many levels deep the printer will print nested objects. If it is bound to logical false, there is no limit. Otherwise, it must be bound to an integer indicating the maximum level to print. Each argument to print is at level 0; if an argument is a collection, its items are at level 1; and so on. If an object is a collection and is at a level greater than or equal to the value bound to *print-le
05:11psykoticthat doesn't apply to a flat sequence
05:12psykoticanyway, the whole printer infrastructure is 1960s lisp
05:12hiredman,(doc *print-length*)
05:12clojurebot"; *print-length* controls how many items of each collection the printer will print. If it is bound to logical false, there is no limit. Otherwise, it must be bound to an integer indicating the maximum number of items of each collection to print. If a collection contains more items, the printer will print items up to the limit followed by '...' to represent the remaining items. The root binding is nil indicating no limit."
05:12psykotichiredman: useful
05:12psykoticit doesn't change the fact that the printer is ugly imperative style
05:14psykotic,(binding [*print-length* 10] (println (repeat 42)))
05:14clojurebot(42 42 42 42 42 42 42 42 42 42 ...)
05:14psykoticby ugly imperative style i mean the fact that it doesn't separate the physical printing from the formatting
05:15psykoticfor the simplest things like length and depth truncation, it's fortunate that top-down dynamic binding lets you do most of what you want
05:16psykotichiredman: i guess you've read 'the design of a pretty printing library' by hughes?
05:16psykoticit's 15 years old at this point
05:16psykoticGHC has an updated version designed by simon peyton jones
05:19psykoticdumb question, for map destructuring patterns, is there a way to bind the unmatched remainder of the map?
05:19psykoticsomething like :rest to go with :as
05:27triyoAre there any technical papers available on Clojure implementation?
05:29tomojpsykotic: I don't think so
05:30tomojyou specifically want to drop the keys you explicitly pick out?
05:30psykoticif you think of a vector as a map from integers, then it's the same as & xs in vector binding patterns
05:30psykoticso yes
05:31psykoticobviously not too hard to call disj myself :)
05:32tomojdissoc?
05:36psykotictypo, yes
06:47powr-tocIs there a way to use clojure.contrib.repl-ln with swank/slime?
06:52Fossipowr-toc: as in? you want a repl in emacs?
06:54powr-tocFossi: No, I already have a swank repl... It's just repl-ln from contrib has better line number support... as the swank repl doesn't seem to display line numbers for snippets evaluated into swank... I was wondering if repl-ln might do the job, but I guess it wont work
06:54Fossihmmm. i'd guess not
06:55powr-tocI just wish swank would track the line numbers for evaluated snippets when stack traces are thrown.
06:56Fossinever occured to me that would be useful
06:58powr-tocFossi: well, during development I evaluate most of my programs inside Emacs/Swank, so when it blows up with a stacktrace, it'd be nice to know what lines it's referring to
07:12cemerickswank doesn't include line numbers when it eval's a file?
07:14Fossican you easily extend a gen-classed class? you have to compile and then you can proxy it, right?
07:14Fossidamn, i guess i will need another gen-class though
07:18Fossiwow. my hands actually still know the paredit keys. that's cool.
07:19Maddas:-)
08:28LauJensenAnybody got a link to a solid study on the correlation between size of code-base and maintenance costs?'
08:31caljuniorhttp://users.jyu.fi/~koskinen/smcosts.htm
08:31caljuniorold and rather general but possibly helpful.
08:40etateehh JDK doesn't include the server hotspot vm on 32bit windows??
08:42cemericketate: really? I seem to remember using -server successfully in 32-bit windows.
08:43etatecemerick: yeah i just installed the latest JDK, and no -server
08:43cemerickhuh. Maybe that changed with 1.6?
08:43cemerickalmost certain I ran -server with 1.5
08:44etatecemerick: oh wait, no its there... just not in the right place
08:44cemerickoh, you mean the actual .dll
08:45etatecemerick: no i mean when i installed it it created 2 JREs, one in the jdk folder and one in program files
08:45cemerickoh, right
08:45etatecemerick: my system for some reason only knows about the one in program files, which is the wrong one
08:46etatecemerick: even though its not in path... i suspect system32 weirdness
08:46cemericketate: well, for you :-) Client vm is far better for 90% of users.
08:46etatecemerick: whys that?
08:46etatecemerick: oh i see :)
08:46cemerickfaster startup time and shorter gc pauses
08:46cemerickthe selection of the java vm is driven by the registry, not the path
08:48etatecemerick: man i'm new to windows :( how can i change it in the registry?
08:49cemericketate: regedit.exe, and have fun
08:49cemericktry to not break anything, tho :-)
08:49etatecemerick: am on windows 7 i think it works a bit different
08:49cemerickah, can't help you there
08:49cemerickI think there's a java control panel where you can change it easily, but I'm nowhere near a windows box.
08:50etatelucky you
08:50etatethings were so much easier in linux *sigh*
08:51cemerickI do touch windows for testing and such -- I generally ensure that I never install the consumer jre's, and then you're fine.
08:51cemerickif you set JAVA_HOME, that might resolve things for you simply
09:05cemerickfogus: a little crazy, huh :-)
09:05fogusCrazy yes
09:06caljuniorLauJensen: http://sunset.usc.edu/csse/TECHRPTS/2008/usc-csse-2008-808/usc-csse-2008-808.pdf
09:06LauJensencaljunior: Thanks - I'll go have a look
09:09etatecemerick: JAVA_HOME is set to the right JDK :/
09:09cemericketate: it needs to be pointed at the JDK's jre
09:09cemericknot the JDK top level
09:09etatecemerick: oh i'll try that, i was just reading that apparently theres a java in system32
09:10cemerickthe 1.1.6 one, perhaps
09:10cemerickor a shim that bootstraps based on the registry settings
09:12caljuniorthe site seems to be a goldmine for software development cost modelling: csse.usc.edu/csse/research/COCOMOII/cocomo_papers.htm
09:15LauJensenGreat!
09:17sunny36This is probably a stupid question. What kind of app should I write to learn to learn clojure? I've been doing katas and it's starting to get bored.
09:24etatecemerick: wow this really sucks, i can't actually add a jre to the java config panel because it doesn't save my changes
09:24zmilasunny36 - try to solve project euler promblems :)
09:25sunny36zmila: I've tried a number of those as well. Those are mostly math problems.
09:26cemericketate: to back up a bit: why do you care what jre is used? Any dev tool with its salt will allow you to set JAVA_HOME and be done with it.
09:27cemerickused by default*, I mean
09:29wthiddenhow long does a paste.lisp.org take to arrive here?
09:29cemerickwthidden: that bot's been dead for a while, I think
09:30wthidden<sigh/>
09:30The-Kennywthidden: If it's working, almost instantly
09:30cemerick...which hasn't been true for weeks :-|
09:30etatecemerick: i want to be able to do java -server at the cmd line without it breaking
09:31wthiddenok... then i'll do it the hardway http://paste.lisp.org/display/96284
09:31cemericketate: OK, but why? Building up command line invocations by hand is generally a bad idea IMO, so surely you're using some tool to do it.
09:31wthiddeni'm having issues with loading/finding a java static class
09:31vyfogus: IIRC, you were mentioning about a small script that parses Clojure source code to extract the API docs. What's the status of it?
09:31wthiddenI see most of the classes just not the static sub-classes.
09:32cemerickotherwise, it's a windows sysadmin issue, and you know what I know in that dept. already :-)
09:32etatecemerick: when i load these commands in a bash script it has this issue too
09:32etatecemerick: sorry, a .bat script
09:32rhickeycemerick: saw your tweet - so, what are the big missing items or pain points for Clojure IDE users? (other than loneliness :)
09:33etatecemerick: i've fixed it anyhow by deleting the standard jre
09:33cemericketate: ah, nuclear's always the best option :-D
09:34cemerickrhickey: ha
09:34etatecemerick: mwahaha :)
09:34cemerickrhickey: better put on your chasm-crossing suit
09:34rhickeycemerick: fwiw I'm sympathetic to your premise
09:35ttmrichtersunny36: Pick something you're interested in day-to-day. Make simple software to help automate it.
09:35cemerickrhickey: anyway, this is an entirely social problem. Maybe Eric has something different to say, but I don't think there's anything missing from clojure itself that would make a world-beating IDE out of reach.
09:35iceyi'm pretty convinced that if someone repackaged emacs and called it "awesomeEd 0.2" or something appropriately web 2.0, that it would get a lot less pushback
09:35cemerickReally, I'd say enclojure (and, I hear, the intellij plugin) are getting pretty close in that regard.
09:36etatecemerick: enclojure is uber slow on my machine... dual core :/
09:36etatecemerick: sorry i mean, netbeans
09:37etatecemerick: i think whats missing from enclojure is paredit
09:38cemerickrhickey: the biggest issues IMO are (a) initial contact with clojure right now is, more often than not, in conjunction with emacs, which is a *huge* warning flag for a super-supermajority of developers, (b) IDE options are generally not mentioned by clojure advocates, and (c) there is, shall we say, a certain smugness among emacs users towards even the concept of IDEs that is unproductive.
09:39cemericketate: I'm in NB and enclojure all day, every day. Not sure what to say there.
09:39etaterhickey: well lispworks is basically emacs :>
09:39cemericketate: um, wow, no :-)
09:39etatecemerick: it has the same keys, buffer concepts
09:40cemericketate: bindings and buffers are both inconsequential
09:40rhickeyetate: I never used the emacs bindings in LW
09:40cemerickNetBeans, Eclipse, and IntelliJ all have emacs bindings and buffers too, so that's clearly not the differentiating factor.
09:41etatei think paredit is the most important thing in any Lisp IDE
09:41cemerickanyway, the differences among editors is moot for this conversation IMO. I take it as a premise that people like the environments they like -- I just don't want that getting in the way of clojure adoption (or, at least, honest evaluation of it).
09:41rhickeycemerick: so, the dev who wants to try Clojure and not emacs at the same time - what are the hurdles IYO?
09:42cemerickrhickey: perception of the clojure community as accepting/supportive of *only* emacs as the development environment.
09:44zmilanot only, i use Eclipse with CCW - it's buggy, but Eclipse is the IDE we use for other projects (java, html)
09:44rhickeycemerick: well you can't expect emacs fans to advocate for netbeans, and the numbers are there right now
09:44etatecemerick: i don't know, when i first came to clojure (yesterday), i thought there were more ide options than i expected.
09:44rhickeycemerick: maybe people like you need to write more articles about enclojure?
09:45etatecemerick: the biggest problem is the alpha tag attached to enclojure, a lot of devs would feel uncomfortable with this - and fwiw i think its less alpha than many beta open source projects
09:45The-KennyIs there an article or a site which lists the ide-choices with screenshots etc.?
09:45The-KennyMaybe a wiki
09:47cemerickrhickey: yeah, and I may do that. But then, I might do that once, or whatever. It's very hard to make a dent compared to those that are passionate about their environment (which one sorta has to be if one is to use emacs effectively).
09:48LauJensenrhickey: Is there an interest on your part in adopting something other than Emacs ?
09:48sattvikI am a long-tim Vim user. I tried out Emacs for some Lisp development, and I agree that it probably provides a better Clojure/Lisp development experience than Vim. However, trying to learn Emacs is a huge hurdle for someone for whom Vim is second-nature. I am fairly happy with VimClojure, though. It's not perfect or as nice as SLIME, but works well enough.
09:48cemerickSometime next month, I'm going to be upgrading across the board, that'll be a good time to do a screencast or something about enclojure...and maybe see how far along the intellij plugin has come.
09:49cemerickIf the latter is really good, that would be a big breakthrough -- having a commercial vendor behind a plugin like that would help a lot.
09:51iceyMaybe if there was some *very short* documentation about the absolute basics in emacs people would be less scared of it
09:52iceyi.e. "Open a file with C-x C-f", "Save with C-x C-s", "Paste with C-y" etc
09:52iceyin other words, show them how it can be a regular old text editor first... then later they can figure out the cool parts
09:53tr8drmy 2 cents: the problem with emacs as an environment is that there is a lot more investment in IDEs for languages such as java. With clojure one may be in a multi-language environment. The investment in the last 10 yrs or more has been in IDEs
09:53sattvikicey: If it's a question of people who aren't used to vim or emacs, the tutorial that comes with emacs isn't bad.
09:54Chousuketr8dr: emacs is actually capable of functioning as an IDE
09:54cemerickicey: sorry, educating the masses about emacs is a nonstarter.
09:54iceyI guess I just don't see why; you're not talking about introducing people to emacs to do HTML
09:54icey(or PHP for example)
09:54tr8drI've used emacs for many yrs, but IMO, is the best editor for sure, but poor relatively when it comes to the many facilities available in an IDE
09:55Chousuketr8dr: and I don't just mean because it has tools and you can use them together. there's a library for implementing IDE features like refactoring, managing projects, and what have you. and then they have implementations of IDEs for C, C++ and Java at least :P
09:56cemerickicey: because software development is done in one of four environments, and I want the clojure community to grow without boiling the ocean of development environments.
09:56Chousukein a way, emacs is like the JVM
09:56Chousukea platform
09:56icey(fwiw I learned emacs specifically for Clojure about 6 months ago; I'm not an emacs pro or anything like that. I think the FUD seriously outweighs the difficulties of picking up the basics)
09:57fogusvy: Did I say that?
09:57tr8drI'll admit that I switched over to IDEs 5-6 yrs ago, so the state of the art in emacs may have changed. I used to use IDE-like facilties for C++ and found them lacking
09:57tr8drregardless of merit, most professional developers use IDEs.
09:58tr8drand don;t want to muck around with elisp and other stuff to get a functional env
09:58cemericktr8dr: +1 there
09:58rhickeyA big argument for IDEs is that if people are already using them for Java, and want to integrate Clojure with their Java projects, asking them to move to emacs is a non-starter, ditto asking them to switch IDEs
09:58LauJensenI'm very fond of Emacs and didn't think it overly difficult to pick up - but are there valid reasons for switching to Enclojure et al ?
09:59LauJensen(except what Rich just said, in better Java integration)
09:59RaynesNot really.
09:59tr8drthe ideal for me would be a full emacs editor embedded in eclipse
09:59cemerickLauJensen: if you're happy with emacs, probably not. Maybe if you need to do a significant amt of java dev.
09:59sattviktr8dr: That depends on the shop. I've been in many places where IDEs aren't used at all. In some cases where IDEs are used, it's because it is required.
09:59LauJensenk
10:00vyfogus: IIRC, you will be using it for the book and stuff.
10:00Chousukefor clojure work, my ideal would be an editor extensible in lisp, with vi-like editing controls, SLIME-style lisp integration and paredit
10:00Chousukeemacs fails at the vi-like editing :P
10:00Chousukebut otherwise it's good
10:01cemerickrhickey: switching IDEs isn't a big deal for, say, the top quarter of java devs -- who often use multiple IDEs in a week anyway. So, making it clear that there's a solid plugin for one of the three will ensure that they'll give clojure a whirl.
10:01mattreplChousuke: viper mode?
10:01cemerickmake it seem like emacs is the only sane choice, and they'll just shrug and fiddle with scala/groovy/jruby/whatever some more
10:01Chousukemattrepl: doesn't play nice with paredit
10:01fogusvy: Ah yes. That is still internal to chouser and myself and is pretty rough. It does what we need and only what we need, but after the book is done there might be some general value for others
10:01Chousukemattrepl: and I won't write lisp without paredit :P
10:02rhickeycemerick: you seem to be asking for people to behave differently, which can't be a serious option
10:02mattreplrightfully so
10:02sattvikChousuke: Bingo. I want to like Emacs, but I'm hooked editing in vi mode. I use it everywhere: my shell, my browser, my editor, etc.
10:02cemerickrhickey: really? where?
10:03etatesattvik: viper-mode ?
10:03Chousukesattvik: emacs actually can do vi-like editing very well if that's all you want, but it really causes problems, because many of the other emacs addons are not written with vi-like controls in mind
10:03mattrepletate: see above, incompatible with paredit
10:04licoressein a (proxy [JPanel MouseListener ....] ...) how do I override the constructor?
10:04etatemattrepl: can't you just rebind the paredit keys? :)
10:04Chousukeetate: you would need to rebind *viper* keys so that it calls paredit functions
10:04mattrepldunno, not sure how viper-mode works (I'm quite happy using common emacs bindings when in emacs)
10:04Chousukeetate: one of the most apparent problems is dd deleting a whole line
10:05Chousukeetate: which is not good for lisp code, since it'll break the structure often
10:05etateChousuke: can't you rebind dd so that it kills sexp instead of the actual line, actually ctrl-W also kills the structure
10:05rhickeycemerick: that the collective voice of CLojure users is making it seem like emacs is the only viable choice, mostly by not talking about other choices they don't use. Or are people actively saying emacs is the only viable choice?
10:06etaterhickey: I don't think its the only viable choice, theres enclojure, vim-clojure, ccw.. its just the best choice. :)
10:07ChousukeI think emacs is the most popular, and perhaps most mature, choice.
10:07Chousukebestness depends on your needs, of course
10:07mattrepleven when developing mixed JVM-language projects I always go back to using emacs/slime. even if it means launching an app from Eclipse or IDEA with a swank socket open
10:07Chousuke:P
10:07LauJensenLast time I used Enclojure it certainly left me with the feeling that Emacs was the only viable pick - VimClojure is also quite good, but requires a fondness for Vim which I dont have
10:07rhickeycemerick: I know I've mentioned alternative environments for as long as they have existed, and presented from within Enclojure at JavaOne script bowl last year. http://clojure.org/getting_started seems fair
10:08Chousukeit might also be that many clojure programmers have lisp background and thus would favour emacs over Java IDEs
10:08rhickeycemerick: so, without putting words in your mouth, how do we improve the IDE story?
10:09sattviketate: I tried it, but what I use is more than just movement and simple edit commands. There are other things such as switching between buffers, windows, and using other Vi plugins. I could probably spend a lot of time adapting to Emacs and playing with bindings, but it's not worth it to me. I have found tools that make Lisp/Clojure development in Vim good enough.
10:11cemerickrhickey: oh, I wouldn't suggest that emacs fans talk up enclojure or anything, but if one is interested in seeing clojure usage grow, one should not suggest to devs coming from a totally java background (for example) learn emacs as a first step. I've seen this happening, and intervened as well as I could, but I can't be everywhere. :-)
10:12rhickeycemerick: so a call to emacs fans to mention all the choices?
10:12licoresselooking for a rather complete example of proxy with overrides etc
10:12cemerickrhickey: yeah, I think what you've put out is great. I guess it all comes down to whether us non-emacs users can generate enough noise to counter the acolytes. ;-)
10:12licoressemy problem is that I get no error messages when the fn definitions are wrong
10:13cemerickrhickey: well, I suppose people need to decide whether they care about emacs or clojure more
10:13cemerickIf the latter, one wouldn't reasonably suggest the former in many, many settings.
10:14dcnstrctcemerick, I was just about to ask a question about setting up swank/clime for clojure... what do you recommend instead of emacs ?
10:14ChousukeI can't honestly suggest IDE plugins to most people since I have no idea how well they work
10:14ChousukeI can at best say "There are IDE plugins, you might want to try them"
10:14cemerickChousuke: that's honestly good enough
10:14rsynnottpoor emacs!
10:14rsynnottNo-one loves it
10:15licoresseI do!
10:15cemerickdcnstrct: enclojure for NetBeans is what I use all day, and it's very nice; I also hear good things about the intellij plugin
10:15cemerickrsynnott: inch wide, and miles deep, they do. :-)
10:16rsynnottI had a look at enclojure at some point; I found netbeans to be unreasonably slow
10:16rsynnott(though possibly it's the fault of my computer)
10:16rsynnottI'm an emacs person myself
10:16cemerickdcnstrct: you can poke into #enclojure for support with that, and there's a google group. I think there's forums for the intellij plugin.
10:17dcnstrctI was hoping you had some vi solution that works kind of like slime. I want something terminal based so I can make use of every pixel of resolution on this 10" netbook.
10:17ChousukeVimClojure supports swank somehow I think
10:17dcnstrctcan enclojure do a "full screen" mode ?
10:17dcnstrctI'll check out VimClojure
10:18Chousukeor might not be swank, but an integrated repl anyway
10:18cemerickdcnstrct: netbeans has a nice full screen mode
10:18RaynesThe only people who prefer Vi(m) over Emacs are just too afraid of change. /intentionalflamebait
10:18Chousuke:P
10:18cemerick:-(
10:19ChousukeI still navigate using arrows in emacs
10:19sattvikdcnstrct: VimClojure is pretty good. If you use screen or have two terminals open, you can run a REPL in one of them and Vim in the other.
10:19ChousukeI just can't learn the modifier key ways of emacs
10:19RaynesChousuke: So do I. :>
10:19Chousukethough often I also use search to navigate
10:19etatesattvik: emacs doesn't play well with screen :(
10:20Chousukewhich is faster than arrows or meta-whatever
10:20RaynesI'm ashamed to say that I use the scroll wheel and left mouse button more than I should. :(
10:21Chousukeheh
10:21Chousukethe scroll wheel in my mouse is broken, and I still haven't been bothered by that enough to buy a new one :P
10:22ChousukeI barely use it even when browsing
10:22pjacksonWhilst I was trying to learn C-{n,p} etc. I bound the arrow keys to (insert "no"), or something equally annoying.
10:22pjacksonI had it down within the day.
10:23nubaxmonad
10:23dcnstrctI will give both VimClojure and Enclojure(fullscreen) a shot before I circle back around to trying to fix slime/swank/emacs
10:23nubaand vimperator
10:23nubaChousuke: will get you a long way mouseless
10:23RaynesXMonad is great for a while, but then it gets old.
10:23Chousukenuba: yeah, I use vimperator
10:23Chousukenuba: on OS X though
10:23dcnstrctI like Awesome for a window manager
10:23RaynesProbably not so much "fixing" as much as it is "doing it right". :p
10:23nubaRaynes: have you tried tiling window managers and then went back for the world of resize/move/etc. ?
10:24Chousukenuba: the only app that really needs a mouse is the finder :(
10:24RaynesBut "doing it right" is relative, because there are many different ways to do it right.
10:24Raynesnuba: Yes. Several.
10:25RaynesI used XMonad for several months, and Bluetile for about 1 and a half.
10:25RaynesI ended up full circle back at Metacity.
10:25licoresseA window manager I like a lot on OS X is SizeUp
10:25sattvikdcnstrct: With a proper classpath set up, you can run something like http://gist.github.com/330413 to set up nailgun and start a REPL.
10:25nubaRaynes: would you be willing to say more about it? I've switched to xmonad last month after trying stumpwm for a while and being a compiz whiz (scale and groups and etc) for some years before that
10:26nubaRaynes: i've grown tired of moving windows and resizing windows around
10:26nubaRaynes: and i'm pretty happy with xmonad atm. but a new perspective is always good to hear.
10:26RaynesI just got tired of the way things looked, and configuration to make it better was too much of a pain. That and a couple of bugs such as the infamous gray-swing-window bug and such.
10:27nubaRaynes: so you actually fine-tuned it with xmonad-contrib before giving up ?
10:27RaynesIf you have one thing the size you need it, then nothing else on the screen is the size you need it, and changing the sizes takes longer for me with the keyboard. This is probably a side effect of a small monitor.
10:27RaynesI didn't do much 'fine tuning'.
10:28Raynes'Fine tuning' to get things the way I wanted would have been more frustrating and time consuming then pkill xmonad && metacity -replace
10:29Raynes;)
10:29nubaI can relate to that in a way, I use two screens, the notebook's large and high-res monitor and a smaller one, 15" LCD and 1024x768. its stellar on the larger and not quite so in the smaller one.
10:29nubaon the fine tuning, i saw a bunch of xmonad.hs then cooked up my own setup from that. and i'm pretty happy about it now.
10:29nubabut thanks for sharing!
10:30RaynesBluetile was nice and I would have stuck with it, if not for general ugliness, inefficiency, and buggyness.
10:30dcnstrcthttp://awesome.naquadah.org/ <-- anyone who likes xmonad should at least glance at this project sometime if not try it.
10:31RaynesFor example, if you have Firefox maximized over other not-maximized windows, then clicking on the area where the border of one of those windows is below firefox, IN Firefox, latches on and resizes the window below it.
10:31RaynesI use firefox as an example because it's usually maximized, but it applies to any window that overlaps other windows.
10:36MecIs there a clearn/better/more idiomatic way to do any of this: http://go.pastie.org/866621 it seems a bit clumsy
10:38psykoticwow, i missed an emacs slug fest
10:38LauJensenWhat is the Weapon of Choice for non Emacers, Enclojure of IntelliJ ? I'm a little scared about the 'alpha' on Enclojure's website :)
10:39MecI tried those two, gave up and went back to clojurebox
10:39psykotici actually hope that attention on editor integration won't become too fragmented. frankly, slime integration still isn't that great--if enclojure, etc, isn't even up to that standard, it's a call to arms for us emacsers
10:41psykoticand regarding the 'identification' of a language with an editor, it didn't seem to hurt the uptake in ruby when rails hit the scene and was almost identical with use of textmate
10:41psykoticof course, textmate has a 'slightly' smoother learning curve
10:41cemerickpsykotic: slightly? ;-)
10:41psykoticwell, it's also a glorified version of notepad, so how hard could the learning curve possibly be? :)
10:41cemerickpsykotic: I find enclojure very pleasant, FWIW.
10:42cemericknah, that's not fair to textmate
10:42psykotici hear it's improved; i haven't tried it around the time when rails came out and dhh's screencasts convinced me to look at it
10:42psykotic*since around the time
10:43SynrGi haven't used enclojure for anything serious, yet. just dabbling around. looks slick, tho. my big objection is it's overkill on my poor little eeepc
10:43psykoticcemerick: are there any clojure-related features of enclojure that aren't in slime?
10:43cemerickbut regardless, emacs has a reputation (well-earned) that doesn't help clojure given the need to fight the lisp reputation in some circles (ill-earned IMO)
10:43SynrGresource usage probably isn't the worst part (i did put 2G ram in it). it wants a lot of screen real estate
10:43cemerickpsykotic: probably not, but that's besides the point.
10:44psykoticcemerick: maybe besides your point, but i wanted to know :)
10:44caljuniorI used textmate exclusively until Lau's screencasts helped me get started with emacs
10:44cemerickI've not used slime in years, so I'm not the one to comment on comparisons.
10:44caljuniorthe textmate clojure bundle has some serious issues though
10:44cemerickyeah, TM can't support anything lispy.
10:45psykoticon the flip side, if clojure had been identical with something like eclipse, me and a lot of other people might not have tried it :)
10:45caljuniorwell, paren support is actually quite good
10:45psykotici think clojure's lisp roots helped its initial growth a lot
10:46psykoticemacs is part of that
10:46SynrGi tried to like emacs. maybe i just didn't try hard enough
10:46Chousukeparedit was what finally sold emacs to me
10:46psykoticnot a big fan of paredit
10:46Chousukeand git, and org-mode, and the latex environment... :P
10:46Chousukemagit*
10:46psykotici've had arguments with riastradh about this endlessly, heh
10:47psykoticorg-mode on the other hand... <3 :)
10:47Chousukepsykotic: all the mismatched brackets I would have without paredit would drive me nuts
10:47psykoticparen pair highlighting is enough for me
10:48ChousukeWell, yeah, but if the editor can ensure that the parens are always matched, why not let it do that?
10:48caljuniorI think textmate is actually a rather important gateway editor for new clojurians. Especially for those coming from dynamic languages.
10:49psykoticmy problem with paredit and even more 'real' structure editors is that they don't allow you to go move between two valid states via invalid states
10:49psykoticthey try to ensure that every step is structurally well formed
10:49etatepsykotic: there aren't many invalid states to get into though (comments & ctrl-w being the main exceptions)
10:50cemerickcaljunior: Interesting point. TM's bundle system isn't up to snuff for a lisp, tho. I wonder what could be done to get around that.
10:50psykotici guess in general what i like about emacs is that it's a text editor, and i think a lot of this structural editing gets in the way of that, it's too confusing for me
10:50zmilajust found waterfront - simple clojure ide, core written in java, the rest in clojure
10:50LauJensenOk - So bottom line is that there is no viable alternative to Emacs ?
10:50psykoticEMACS WINS. FLAWLESS VICTORY!
10:50etatepsykotic: once you get used to it it makes you much more productive with editing lisp code
10:50cemerickLauJensen: you forgot the ;-) at the end of that
10:51LauJensencemerick: It was a serious question, trying to sum up your discussion above
10:51etatepsykotic: i'd say paredit is actually the best reason to program in lisp
10:51psykoticetate: i gave it a fair shake a few years ago when i hung out on #scheme with riastradh, and it never grew on me
10:51caljuniorcemerick: I actually don't agree. TM lisp support is sufficient. It's the classpath definitions that in the TM bundle that have issues.
10:51cemerickLauJensen: well, the above discussion is most emacs users talking.
10:51etatepsykotic: it takes a while to get used to
10:51LauJensenI only use Emacs because its the best - if something better comes along, I'm not bound to any oath of loyalty
10:51psykoticLauJensen: turncoat!
10:51Chousukepsykotic: paredit is confusing initially, but once you realise that it's just doing what you would do manually anyway, it's great. :)
10:52psykoticokay, maybe i'll try it again
10:52psykoticbtw, there are lots of emacs things i still haven't seen to the same extent elsewhere
10:52psykoticlike... align.el
10:52cemerickcaljunior: huh, last I looked at it, all of the parsing in TM bundles was regex-based. Makes things difficult.
10:52psykotici hear there's an align extension for vim but i looked at the code and it's kind of pathetic
10:52LauJensenparedit is horrible - like crutches for text editing
10:52Chousukecrutches? :/
10:53psykoticcemerick: for what it's worth, emacs's syntax tables are also regex based, and equally pathetic
10:53ChousukeLauJensen: you're not editing just text, you're editing lisp code
10:53cemerickinteresting
10:53psykotici hate emacs syntax tables
10:53etateLauJensen: paredit is a way of making parens disappear
10:53LauJensenetate: Routines handles that just fine
10:53ChousukeLauJensen: it has a certain structure, and paredit just enforces that structure and makes editing it more natural
10:53psykoticthe few modes that do real parsing tend to be pretty extreme
10:53The-KennyLauJensen: You're not editing text - You're editing threes based on parens
10:53psykoticlike yegge's js2-mode
10:53caljuniorkey point is that paren support (highlighting etc) works well in textmate.
10:53psykoticor cedet/semantic
10:54psykoticsemantic _completely_ reimplements lex and yacc in emacs lisp, on top of eieio, which is a clos reimplementation in elisp
10:54caljuniorthere is a nagging issue with compile step and path with spces
10:54psykoticit's... pretty insane
10:54ChousukeLauJensen: plain text editing *can* do what paredit does with lisp code, but it's more cumbersome :)
10:54caljuniorspaces
10:54psykoticChousuke: emacs already has sexp-based navigation without paredit
10:54LauJensenChousuke: I've already tried it, so the sales-pitch is useless :)
10:54etateChousuke: not always, i mean think about transposing sexps, removing the outer sexps, inserting inner sexps
10:55The-Kennypsykotic: But it doesn't support {} and []
10:55etateChousuke: that kind of thing takes time to do by hand
10:55psykoticetate: transpose-sexp has been in emacs forever, outside paredit
10:55Chousukepsykotic: it's not just navigating that paredit does.
10:55psykoticsame with forward-sexp, mark-sexp, etc
10:55psykotici know that some of the inside/outside stuff isn't in emacs by default
10:55Chousukepersonally, I use the paren matching, barf and slurp
10:56etatepsykotic: what about alt arrow up
10:56psykoticwhich one is that?
10:56etatepsykotic: remove outer sexp
10:56Chousukeand those are enough to keep me addicted :P
10:56Chousukeoh, and kill-sexp as well
10:56Chousukeit's essential
10:56psykoticChousuke: dude, that's also a default emacs feature
10:57psykoticlisp.el
10:57psykoticit also has up/down-list for inside/outside navigation
10:57psykoticwhat it doesn't have are things like kill outer sexp
10:57Chousukepsykotic: well, one less source of addiction for paredit then
10:57psykotichehe
10:58Chousukepsykotic: but emacs still doesn't keep the structure sane by default
10:58psykoticright
10:58psykoticbut like i said, i enjoy having the default editing be text editor like
10:58psykoticwhen i want to edit/navigate structurally, i'll use explicit commands
10:59psykoticbut i'll use this opportunity to reevaluate paredit, so it's been useful to chat about it
10:59etatehow do you find all the methods that are bound to a java interface from clojure?
10:59ChousukeI'm so used to paredit that I can't imagine myself wanting to edit lisp code as text.
10:59psykoticbtw, i have some of my own code that i think is a million things nicer to use than transpose-sexp
10:59psykotici call it drag-sexp (i have versions for words, lines, etc, as well)
10:59psykoticit acts like cell motion in org-mode
10:59psykoticfor tables
11:00Chousukehm, can you give an example? :/
11:00ChousukeI haven't done any tables in org-mode
11:00psykoticbasically you can drag 'units' (like sexps) around and it maintains intraunit point positioning
11:00psykotici never liked emacs's transpose semantics, so maybe it's just me
11:02psykoticwell, it's not just org mode tables that work like that, outline items work the same way
11:02psykoticwhen you drag them up/down, in/out, it maintains your point positoning within that outline element
11:06psykoticif you want to play around with it, i posted some of my code here: http://gist.github.com/328872
11:08neotykHi *
11:10The-Kennypsykotic: Not just dragging. You can do the same with meta + arrow keys
11:10The-Kennywhich is a feature I miss in *every* other writing application
11:10psykoticThe-Kenny: you mean org-mode?
11:10The-Kennypsykotic: Yes ;) But more small things from org-mode. Like re-ordering outlines with just meta + arrow keys
11:11psykoticright
11:11The-KennyA simple and fast way to restructure outlines
11:11psykoticusing org-mode made me addicted to the 'kinetic' feel of moving things around
11:11The-KennySame for tables
11:11psykotictranspose-paragraphs, etc, is shit in comparison
11:11psykoticso that's why i wrote that code i posted
11:11psykotici use it all the time now, whereas i never used transpose
11:12psykoticorg-mode is pretty much a masterclass in awesomeness from beginning to end
11:13psykotici know some emacs people dislike it because it's a bit aggressive with overriding emacs defaults, but it generally IMPROVES on those defaults
11:14neotykhow cool, I'm checking out orgmode.org
11:15neotykthanks psykotic and The-Kenny
11:15psykotici have an ongoing org-table hack that is nearing completion. have you ever seen http://cleanupdata.com/?
11:15The-Kennyneotyk: Also check out one or two screencasts about it. We told you almost nothing about it.
11:15psykoticanyway, i have a sort of emacs/org-mode equivalent of that in the works. what it basically does is record macros on org-mode table cells and replay them LIVE as you type on other rows
11:15The-Kennyneotyk: Oh, and it's integrated in emacs. You really need to fetch it, if you want the latest version
11:15psykoticit's mostly a novelty but it's pretty awesome
11:16psykoticthe best intro i've seen is carsten dominik's google techtalk
11:16psykotic(he's the creator)
11:17The-Kennypsykotic: there's a new one by dominik which is good to
11:17psykoticoh?
11:17The-Kennypsykotic: wait a second
11:18The-Kennyhm... searching history just crashed my browser
11:18psykoticbtw one of my favorite new org-mode things is mac-org-protocol
11:18The-Kennyah, found it: http://emacsworld.blogspot.com/2010/03/new-org-mode-talk-from-carsten-dominik.html
11:18psykoticit lets you easily fire things to org-mode/remember with something liek quicksilver
11:19The-Kennypsykotic: Hm.. I tried getting mac-org-protocol, but all it did was open my finder :D
11:19psykoticit's set up to grab as much app context as possible, using applescript
11:19psykoticso for example if you use safari, it will grab the current url as context
11:20psykoticoh i see, that screencast is about org-protocol as well
11:20The-KennyHuh, it is?
11:21psykoticsorry, haha, i was looking at a google search result
11:21psykotichttp://www.mail-archive.com/emacs-orgmode@gnu.org/msg14279.html
11:25triyowith defmathod, how do I go about defining an optional method argument?
11:25triyoif possible
11:29etatehmm, this may sound silly but how do i ensure a value returned is of a specific type
11:29etatefor example in Java you can do IClass class = meth();
11:30etatein clojure just meth() is returning the wrong type
11:30nubadont mess with meth
11:30nubaits dangerous
11:31psykoticfucks up your teeth
11:32Raynesinb4heynowdon'tbeusingfowllanguagewehostchildrenandadultsalike
11:33psykoticsorry, i'll be nice and church-like
11:33Raynespsykotic: I know. I find it silly as well. :(
11:33dcnstrctdoes anyone know what version of swank/slime will work properly with this guide ? http://riddell.us/tutorial/slime_swank/slime_swank.html or does anyone have a guide for installing swank/slime that works with the latest sources from git ?
11:34psykoticetate: i guess the easiest would be to write a simpler helper function that asserts on the class and otherwise returns the value
11:34clojurebotclasspath is (System/getProperty "java.class.path")
11:35etatepsykotic: i want to access the value as an IClass rather than as a native ref
11:35dcnstrctbtw I tried enclojure... with the latest nebeans on ubuntu... massive fail.. the create project system pukes with some mysterious error I can't decipher :(
11:35etatepsykotic: in Java its just IClass x = getValue()
11:36SynrGdcnstrct: latest netbeans on ubuntu? if it's based on the debian one it is ooold
11:37SynrGdcnstrct: i have given up waiting for packaging for netbeans. i just use upstream's installer. works fine on debian squeeze.
11:37joshua-choiI’m wondering something: Rich strongly states that we should always use (seq ...) instead of (not (empty? ...)). Why?
11:38psykoticetate: something like this?
11:39dcnstrctSynrG, 6.8
11:39psykotic,(letfn [(with-class [cls x] (assert (= (class x) cls)) x)] (with-class java.lang.Integer 42))
11:39clojurebot42
11:39dcnstrctSynrg, I'll google for upstream's installer and try it
11:39psykotic,(letfn [(with-class [cls x] (assert (= (class x) cls)) x)] (with-class java.lang.Integer "foo"))
11:39clojurebotjava.lang.Exception: Assert failed: (= (class x) cls)
11:39AWizzArdjoshua-choi: this is idiomatic in Clojure, I guess because it is shorter
11:40SynrGdcnstrct: i just mean the one from netbeans.org itself
11:40psykoticetate: you can wrap that around any call to check the class
11:40SynrGworking fine with openjdk
11:40psykoticsorry, that's actually too strict, equality rather than isa
11:40etatepsykotic: the thing is i know what the class is, the problem is its the wrong class :)
11:41psykoticwhat do you mean by the wrong class?
11:41etatepsykotic: oh no wait its not... the error must come from something else
11:42etatepsykotic: i just tried (class x) on the value and its the right class.. still crashes my jvm hmmm
11:49sattvikjoshua-choi: I think it's from Clojure's Lisp roots. Booleans in Clojure, I believe, are an artifact of running in the JVM.
11:50Chousukejoshua-choi: using seq is an idiom, and (not (empty? ...)) needlessly goes against that idiom
11:52Chousukethey both convey the same information, but the former is more familiar to clojurians
11:52psykoticespecially seeing that empty? is a macro for (not (seq ...)). every time you write that, i reaed it as (not (not (seq ...)) :)
11:58MecIs there anything you can do when you want to use -> but sometimes the expression needs to go 2nd, last, or somewhere in the middle?
11:58joshua-choiChousuke: seq creates a sequence object. Does empty? also create a sequence object?
12:00lpetitjoshua-choi: it is idiomatic in the following piece of code : (if-let [s (seq smthing)]) versus (if (not (empty? smthing)) (let [s (seq smthing)] ...) I guess
12:01joshua-choiThe former seems better, since if empty? creates a seq object, then the latter creates the same seq object twice.
12:01joshua-choiOh, and it’s shorter. :)
12:02lpetitquite shorter :-)
12:02psykoticmec: i posted a macro for this a while ago.
12:03psykoticmec: http://gist.github.com/328830
12:03Mecpsykotic: thanks
12:04Mecon the off chance i need to include an anonymous function, does it have to be % as the placeholder?
12:04psykoticno, of course, just replace the '% with whatever placeholder
12:05Mecah ok
12:05psykoticbut it should work with anonymous functions
12:05psykotictry it. i call macroexpand-all on the arguments first, so anonymous function macros like that should have expanded away the %'s by the time i do my codewalking
12:05Mecah i see
12:05MecI'll play around with it
12:18psykoticso, i'm using paredit and i remember why i hate it. half of its commands beyond lisp.el are only needed because of paredit's bondage and discipline wrt structural consistency.
12:18psykoticserenity now
12:20ChousukeDoes that matter? :/
12:20ChousukeI use only about three paredit features
12:21psykotici like C-k
12:21psykoticbut i basically dislike the fundamental philosophy behind paredit. org-mode is the anti-paredit
12:21Chousukeyeah, that's my favourite, too. :P
12:21psykoticorg-mode lets you type text as you want and it tries to make sense of it
12:21psykoticparedit is a cruel taskmaster
12:21Chousukebut they're for two purposes
12:22Chousukeorg-mode accepts free-form text because that's how it's designed. but your lisp compiler won't accept free-form text
12:22psykotici've known riastradh for years and i feel like he's standing over my desk, snapping a whip while yelling 'STRUCTURAL CONSISTENCY, SLAVE!'
12:22Chousukeor I guess I should say reader
12:22psykoticwell, i know lisp syntax
12:23psykoticthe point is that when i'm typing, i want to be the one in control
12:23Chousukebut what do you need to control? :/
12:23psykoticmy point is that a lot of things in paredit are only there because of the need for each intermediate state to be consistent
12:23ChousukeI've never found paredit actually obstructing what I need to do.
12:23psykotice.g. barf/slurp
12:24psykoticbed time, later
12:24Chousukethe downside of manual control is that you have to track parentheses manually
12:25Chousukehighlighting helps, but with paredit the need disappears completely.
12:25Knekkwhat's the way to turn ((1 2) (3 4)) into (1 2 3 4)
12:27Chousukein clojure or in paredit? :P
12:27Chousukeyou can apply concat for flattening one level, or use flatten
12:27Knekksorry, clojure :)
12:27Knekkflatten is a contrib?
12:28dnolenclojure.contrib.seq-utils I think
12:28Knekkthank you
12:29S11001001Knekk: remember that strings aren't sequential, but they are seq-able
12:30KnekkS11001001: I will try to remember, even tho it doesn't have a bearing on my current problem :)
12:31Knekkis S11001001 a bot?
12:33S11001001Knekk: it's unlikely
12:35hiredmanclojurebot: whose job is it to enforce the turing test?
12:35clojurebotlatest is 1382
12:35hiredman:/
12:38hiredmanclojurebot: latest?
12:38clojurebotlatest is 1382
12:39hiredmanclojurebot: forget latest is 1382
12:39clojurebotI forgot latest is 1382
12:39hiredmanclojurebot: latest?
12:39clojurebotlatest is 1382
12:39hiredmanLIAR
13:01slyphontechnomancy: hey, just sent you a message on github
13:01slyphonre: leiningen notes
13:03technomancyslyphon: awesome; thanks
13:03slyphonsure, i hope it's useful
13:58etateis there something obvious i'm missing here wrt to gen-class.. (ns foo.bar (:gen-class)) then calling (foo.bar.) gives me a class not found exception
13:58S11001001etate: only works when compiling file
13:59etateS11001001: with (compile "foo.bar.clj") >
13:59etate?
13:59hiredmanthat is not right
13:59etatebecause that doesn't work either: string cannot be cast to clojure.lang.Named
13:59hiredmandid you read the docstring for compile?
14:00hiredmanhave you read the compile documentation on clojure.org?
14:00etateno i kindof assumed ctrl-c ctrl-c compiled the code :
14:00etate:/
14:00hiredmanthere is compiling and then there is aot compiling
14:01hiredman,(doc compile)
14:01clojurebot"([lib]); Compiles the namespace named by the symbol lib into a set of classfiles. The source for the lib must be in a proper classpath-relative directory. The output files will go into the directory specified by *compile-path*, and that directory too must be in the classpath."
14:01hiredman~compiling
14:01clojurebotExcuse me?
14:01hiredmanclojurebot: compile?
14:01clojurebotthe unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation
14:02hiredmanand your file name and namespace don't match up, so aot compilation won't work, regardless
14:02hiredman~namespace
14:02clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
14:03etatehiredman: by single segment namespaces, does that mean i shouldn't have just one dir with lots of .clj files in it?
14:03hiredmanhuh? no
14:04hiredmanwhy would you think that?
14:05hiredmanas long as your namespaces are all dir.filename having one directory full of files is no problem
14:05etatehiredman: because if a segment of a namespace corresponds to a directory in a classpath, having it just one level deep is a single segment?
14:05etatehiredman: oh okay
14:05hiredmanetate: "they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj"
14:05hiredmanit does not say they correspond to directories
14:07etatein other words if i add /clojure/ to classpath, and it contains ./foo/file.clj within it, the namespace correspondence will be foo.file?
14:07hiredmanyes
14:07etateokay, sorry for the mild stupidity
14:15etatehmm still doesn't work
14:15etate:(
14:15hiredmanhave you read the compile documentation on clojure.org?
14:17etatehiredman: yes
14:18etatehiredman: i created a folder c:\clojure\foo, with a file c:\clojure\foo\bar.clj
14:19etatehiredman: then i created a folder c:\clojure\classes and c:\clojure\foo\classes, then i added c:\clojure\, c:\clojure\foo and c:\clojure\classes, c:\clojure\foo\classes to the class path
14:19radsis there any difference between (declare *foo*) and (def *foo*)?
14:19etatehiredman: then i did (compile 'foo.bar) -> error cannot find foo__init.class
14:20etatesorry bar__init.class
14:20hiredmanwhy do you have a c:\clojure\foo\classes?
14:20Mecrads: declare is for when you want to use a var in a definition before it is defined, and then later defined with def
14:20etatehiredman: i was checking to see if it helped
14:20SynrG,(doc def)
14:20clojurebotDENIED
14:20hiredmanetate: why do you think it would help?
14:20SynrGoh, so you're like that, are you?
14:21etatehiredman: because the other classes folder didn't
14:21nteonclojurebot: def?
14:21clojurebotThat is the one thing Clojure can not do.
14:21nteonheh
14:22StartsWithKetate, http://paste.pocoo.org/show/188909/
14:22hiredmanetate: and how are you compiling?
14:24etatehiredman: (compile 'foo.bar)
14:25hiredmanand how did you set your classpath?
14:25etateStartsWithK: I can't really see what i'm missing from that paste, the differences are that you're using a src folder in your classpath whereas i'm using the base c:\clojure folder
14:25etateStartsWithK: also you have a lib with clojure in it which i don't have, clojure is found elsewhere
14:26hiredmanetate: "found elsewhere" is not a good idea
14:26StartsWithKetate, just start from this and expand to your use case, so you can see when things fail
14:26etatehiredman: I used (add-to-list 'swank-clojure-classpath dir)
14:26hiredman
14:27hiredmanand what does (System/getProperty "java.class.path") say?
14:28etatehiredman: i can't really paste it because its too long, but it includes those dirs... however what i notice is that the other classpaths that work point to .jar files
14:28SynrGhmm, does clojurebot just not like me, or did i ask it a naughty question?
14:28SynrG,(def declare)
14:28clojurebotDENIED
14:28etatehiredman: all the ones that point to dirs don't seem to work
14:28hiredmanjar files in a classpath are the same as a directory containing the contents of a directory
14:28SynrGi guess it's just me :)
14:29SynrGoops
14:29SynrG,(doc declare)
14:29clojurebot"([& names]); defs the supplied var names with no bindings, useful for making forward declarations."
14:29hiredmanare you using relative or absolute paths?
14:29SynrGbut to:
14:29etatehiredman: absolute, with a trailing slash
14:29SynrG,(doc def)
14:29clojurebotDENIED
14:29SynrGmy repl says:
14:29SynrGSpecial Form Please see http://clojure.org/special_forms#def
14:30SynrGso why is repl (1.1.0) smarter than clojurebot?
14:30hiredmanetate: and what if you don't use slime?
14:30etatehiredman: could not locate foo/bar__init.class
14:31hiredmanthat is from the repl?
14:31hiredman(clojure.main, not slime)
14:32FossiSynrG: clojurebot is just locked up, so nobody takes control of it or crashes it
14:34etatehiredman: i get a different error now
14:35etatehiredman: the system cannot find the path specified
14:35hiredmanhow are you starting clojure?
14:35etatehiredman: i start it with clojure box and a modified default.el
14:35hiredman 11:31 hiredman : etate: and what if you don't use slime?
14:35etatehiredman: if i don't use slime i get the file not found error whilst writing the class
14:36hiredman,(doc *compile-path*)
14:36clojurebot"; Specifies the directory where 'compile' will write out .class files. This directory must be in the classpath for 'compile' to work. Defaults to \"classes\""
14:36hiredmanthe compile-path defaults to a relative path
14:38etatehiredman: the compile path was set to "classes" which i thought was correct, i tried using an absolute path to the classes dir in c:\\clojure\\ and same error
14:38hiredmanetate: what do you mean "tried"
14:38hiredmanyou changed *compile-path*?
14:38etatehiredman: as in i added "c:\\clojure\\classes\\" to class-path
14:38etatehiredman: no, should i do that?
14:39hiredman*compile-path* and classpath have no connection, except for compilation to work the directory specified in the former must be in the latter
14:40hiredmandoing things with the classpath does not effect *compile-path* at all
14:41etatehiredman: well the basedir c:\\clojure\\ is on the classpath and contains a dir named "classes" which is empty
14:41hiredmanso?
14:42etateso if *compile-path* is set to "classes" and its relative to the classpath, then that should be correct right?
14:42psykoticno
14:42StartsWithKetate, relative to "user.dir" property
14:42psykoticthere's a million directories on the class path
14:42hiredmanetate: how would having the output directory be relative to the classpath possibly work?
14:43hiredman^- what psykotic said
14:43etatehmm good point
14:45etatein other words i should find a way to add to the *compile-path*
14:45hiredmanthere is one compile-path
14:45hiredmanit is not like the classpath, again, how would it work if it had multiple paths?
14:45hiredmanyou can change the compile-path a few ways
14:47Drakeson1. is it possible to use build.xml and project.clj together? or, 2. are there any examples for porting build.xml to project.clj?
14:47hiredmanif you are at the repl you can use binding or maybe set! to change it
14:48hiredmanDrakeson: no and no
14:49etatehiredman: is that wise though? because the clojure classes dir contains a lot of clojure specific code
14:49hiredmanetate: um
14:50Drakesonhiredman: I see.
14:50hiredmanetate: your project should not be in the same directory as clojure
14:50hiredmanyou should build a clojure jar and put that on your classpath
14:51etatehiredman: right, but when java starts its relative to the clojure dir i believe
14:51etatehiredman: or maybe not
14:51Drakesonhiredman: do you happen to know a project using project.clj that also compiles some java sources?
14:51hiredmanDrakeson: there is a lein plugin that does java compilation
14:52hiredmanclojurebot: lein-java
14:52clojurebotHuh?
14:52hiredmanclojurebot: google lein-java
14:52clojurebotFirst, out of 362000 results is:
14:52clojurebotantoniogarrote&#39;s lein-javac at master - GitHub
14:52clojurebothttp://github.com/antoniogarrote/lein-javac
14:52Drakesonhiredman: thanks :)
14:52psykoticno, it's relative to the current working directory at the time of execution...
14:52psykoticit doesn't matter where the clojure jar is. how could it?
14:53hiredmanwell, it matters for the classpath
14:53psykoticsure
14:53psykotici'm talking about user.dir
14:54hiredmansure
14:54psykoticetate: iirc, the getting started page has a good overview of this stuff.
14:54etatepsykotic: i think its the swank-clojure that starts java
14:54etatei just downloaded clojure box so i have no idea where the java process is starting
14:55psykoticthat's the problem with bundles like that
14:55psykoticanyway, i still don't understand why you're putting all your code in the clojure dir
14:56etatepsykotic: i'm not... my code is in c:\\clojure\\ but the clojure dir is under c:\\cygwin\\...
14:56psykoticah, i see what you're getting at
14:56etatebut yeah theres nothing in the default site-lisp that says anything about starting the java process, mmy guess is swank-clojure starts it
14:56hiredmanthen why would you care about the classes directory the clojure build process uses?
14:57psykotici guess because the user.dir is in the clojure directory
14:57etatehiredman: i'm just trying to figure out where this relative "classes" dir is lol
14:57hiredmanI doubt it
14:57etateor supposed to be
14:57hiredmanetate: it doesn't have to be relative, you can change it
14:57hiredman(System/getProperty "user.dir")
14:58etateOMG
14:58etateIT WORKS
14:58psykotichigh five :)
14:58etateare there any side effects to me changing *compile-path*? apart from the set! i mean
14:59The-KennyMaybe (binding ...) works
14:59hiredmanany classes you generate using compile will go in that directory
15:00etatehiredman: is there a way of having different projects generate in different classes directories without having to start a different process
15:00etateuser.dir is == c:\\windows\\system32 anyway :/
15:00hiredmanetate: is there a real reason you need to aot compile?
15:01etatehiredman: AOT = ahead of time?
15:01hiredmanyes
15:01hiredmanwhat compile does
15:02etatehiredman: yeah i'm trying to extend a java class
15:03etatehiredman: and i don't want to do it dynamically with proxy for efficiency reasons
15:03hiredmanwhat version of clojure are you using?
15:03hiredmando you really need a stable name? I would look at reify
15:04technomancyetate: you should probably write it in proxy first and get it working, then switch to gen-class once you have profiled it and determined that it's an actual bottleneck
15:04technomancybecause it's probably not
15:04StartsWithKgen-class is not realy fast
15:04StartsWithKit may even be slower than a proxy
15:04hiredmanright
15:04hiredmangen-class generates a stub that calls out to the clojure functions
15:04hiredmansimilar to proxy
15:06etatetechnomancy: its not just for efficiency, its also to be able to have static methods, a main etc
15:06hiredmanI really recommend against tieing yourself to aot (as it is largly a deadweight)
15:06etatehiredman: a deadweight? what do you mean?
15:06hiredmanit will drag you to the bottom and you will drown
15:07etatehaha
15:07hiredmanI mean for the pain it causes it gives you relatively little
15:07StartsWithKbut there is a catch :)
15:07StartsWithKhow do you start a clojure app
15:07StartsWithKhihihi
15:08hiredmanjava -cp whatever foo.clj
15:08StartsWithKyou can or :gen-class to get main
15:08hiredmaner
15:08StartsWithKor yes yes
15:08hiredmanjava -cp whatever clojure.main foo.clj
15:08StartsWithKand now you have a problem
15:08StartsWithKyour ide will eval foo.clj
15:08etateso proxy is the same as gen-class but easier to use?
15:08etateand gen-class provides main but thats the only benefit?
15:08hiredmanStartsWithK: only if your ide sucks
15:08StartsWithKas your 'main' is outside of any function in that case
15:08StartsWithKhiredman, all ides suck
15:09hiredmanjava -cp whatever clojure.main -e "(use 'foo.bar) (go-web-go)"
15:09StartsWithK:)
15:10hiredmanetate: oh, you can do other things with it, and if you really really need to generate classes with a stable name for some brain dead java
15:10etatethe problem i was having was that i couldn't easily see how to extend java classes which extend other classes and call static methods etc from a proxy
15:10hiredmanhow do static methods matter in this?
15:11hiredmanclojure has better "static methods" than java, they are called fns
15:11etatetake a look at this java code: http://www.jmonkeyengine.com/wiki/doku.php/tutorial_1_-_learning_jme_2
15:12etateto me it makes it easier to think about a gen-class extending the simplegame class than a proxy
15:12hiredmanI don't see any static methods
15:12Apage43... I don't see what's so difficult about that
15:12Apage43main() isn't pulled off SimpleGame
15:12Apage43only simpleInitGame() is, no probs proxying that
15:12etateApage43: main isn't but rootNode & ConfigShowMode etc are
15:13Apage43those are static?
15:13etateno
15:13hiredmanugh
15:14etatebare in mind i've been in clojureland 2 days, so i basically suck
15:14hiredmanI think you will need to use reflection to get rootNode in anycase
15:14Apage43probably..
15:15Apage43bleh.. that's a kind of icky API.
15:15etateyeah its hard to make sense of it for me
15:15hiredmanthis seems like one of those "here is a simple thing for newbies to use, no one will seriously use it, so we'll just do it badly" kind of things
15:15etatelol
15:16etatethe best part is that the java doc link is broken
15:17hiredman:/
15:19etatehiredman: yesterday i got to the root of the JVM crash btw, it turned out that in one of the ogre4j functions, it returns a RenderList that upon access crashes the JVM.
15:19etatehiredman: i tried all the methods on it and most crash :(
15:19hiredmanfun
15:20etatehiredman: so one 3d rendering lib has a bad API, the other is really unstable :(
15:20Apage43does whatever library do 3d?
15:20Apage43Have you considered just using JOGL/JSR-231?
15:21Apage43or what all libs have you looked at
15:21duncanmla la la
15:21etateApage43: jogl / lwjgl involve writing an engine from scratch
15:22etateApage43: other than that i've looked at the jmonkey and ogre4j
15:22Apage43what's that going to manage for you, moving stuff around?
15:22Apage43Collisions?
15:22etateApage43: skeletal animation, collisions, easy shaders, access to d3d or opengl
15:23etateetc etc
15:23hiredmanI think Lua did some work with jme
15:24etatehiredman: i was looking mainly at doing something in clojure
15:24hiredmannot the language
15:24hiredmanLauJensen
15:24hiredmanhe is, uh, some german guy?
15:25chouserDenmark
15:25hiredmansome dane
15:25hiredmanwait
15:25hiredmanthats not right either
15:26etatehiredman: hmm it looks like the basegame class has a nicer api
15:26chouseroh, you're right. Netherlands
15:27hiredmanclojurebot: lua?
15:27clojurebotExcuse me?
15:27hiredmanclojurebot: LauJensen is some dane
15:27clojurebotYou don't have to tell me twice.
15:27chouserWell, european mainland anyway. Close enough.
15:29Apage43etate: it looks like it's BaseSimpleGame where all those static bits are set up
15:30etateApage43: theres also BaseGame, which is i think where i'll start
15:30etatehttp://www.jmonkeyengine.com/wiki/doku.php/starter:simplegame
15:30Apage43http://code.google.com/p/jmonkeyengine/source/browse/branches/2.0/src/com/jme/app/BaseSimpleGame.java <-- Here's what all SimpleGame does for you
15:31SynrGFossi: i figurede as much. but i don't know what it was about my request that made it objectionable is all. it seemed rather strange.
15:31SynrGFossi: the ,(doc def) request, that is
15:31etateApage43: nice thanks ! :)
15:32FossiSynrG: i bet def is blocked in any form
15:32Apage43You could write a java class that extends it and toss in some getter methods for the fields you want
15:32Apage43Or reflection -is- an option
15:33etateApage43: would it not be simpler to just use gen-class, as in why do i need reflection?
15:33hiredmanyou could use clojure.asm to generate bytecode directly :D
15:33Apage43using clojure.contrib.reflect, from within a proxied method, you should be able to get rootNode with (get-field (.getClass this) "rootNode" this)
15:33etatehiredman: theres a clojure.asm? :D
15:34Fossietate: crystalspace 4 the win
15:34Fossionly has a swig api though
15:34hiredmanit's the ASM bytecode engineering library
15:34hiredmanit is what clojure uses to generate jvm bytecode
15:35etateApage43: in baseclass rootNode gets created by a Node class. Can i use reflection whilst using gen-class?
15:35Apage43rootNode is a field on the base class of type Node.
15:36Apage43get-field gets the current value of the field
15:36SynrGFossi: ah. i hadn't considered that possibility. makes sense.
15:36FossiSynrG: well, it's overly protective, but better safe than sorry :)
15:36Apage43I also don't know how you get at the "this" object using gen-class
15:36Apage43in proxy, its passed implicitly as a fn arg.
15:37etateApage43: i think you get to it when defining a method (defn x [this])
15:37Apage43ah
15:37Apage43then it should work then
15:38etateApage43: also are you sure rootNode is a field on the baseclass?
15:38Apage43as long as you make the call to get-field after rootNode has been set
15:38Apage43etate: rootNode is defined on BaseSimpleGame.java
15:38Apage43which SimpleGame extends.
15:38etateApage43: right, but if i extend BaseGame instead of SimpleGame, I don't have to use reflection anymore right ? :D
15:39Apage43Course, since there's no rootNode to get at
15:40radsis there a way to add a class path to leiningen project without replacing one of the existing ones?
15:40etatehmm ConfigShowMode however is defined on AbstractGame which BaseGame extends
15:40etatebut its an enum, not a class
15:41Apage43that.. is an enum
15:41Apage43hmm
15:42etatemaybe i can just skip create a class that doesn't use any of these base classes, and use that as the base game class
15:43Apage43enum shouldn't be a problem since they are static.
15:43etateah
15:43robwolferads: no, but why do you want to do that?
15:44etateApage43: so a java enum with the fields NeverShow, AlwaysShow etc, what is the equivalent in clojure of static fields?
15:44etateApage43: i don't mean Config/StaticField, i mean how can i create one that is exactly the same as the java enum, without using that enum
15:45Apage43you want to create a new enum?
15:46etateApage43: right, but that corresponds exactly to a Java enum
15:47Apage43I don't think you're going about this the right way =P
15:49etateApage43: lol, okay i'll try extending the base class instead of trying to write the abstract class by hand, that will probably be easier
15:49Apage43com.jme.app.AbstractGame.ConfigShowMode/NeverShow is a problem?
15:50etateApage43: no that will most probably work :)
15:51Apage43er
15:51Apage43Might have to be AbstractGame$ConfigShowMode/NeverShow
15:51Apage43since ConfigShowMode is a subclass
15:58Fossiare you guys making a game?
15:58etateFossi: trying to get a renderer working first :D
15:59chousersweet. compile-time infinite recursion.
16:00hiredmanstack blowing or just looping?
16:01Fossietate: well, that's one part :)
16:01Fossietate: i'm currently making a game for android, so maybe you guys wanna share some insight with functionally programming a renderer
16:02radsrobwolfe: for a config directory
16:02remleduffOK, two days later I guess I give up on vimclojure again :(
16:02chouserstack blowing.
16:03chouserlooks a lot like (defmacro foo [] `(foo))
16:03remleduffWhat are the current best instructions for installing emacs?
16:03remleduffI mean clojure in emacs
16:03remleduffOn windows
16:04etateFossi: sure, i'll share once i can get something running :D
16:04javeis there a .info version of the clojure reference doc?
16:05Fossietate: as said, i guess i could provide some insight into crystalspace, but i never used it from java. you using ogre?
16:05robwolferads: there is "resources" directory meant for that purpose
16:05javeso info-lookup-symbol can be used in emacs?
16:05etateFossi: no, i tried ogre yesterday but it crashes the JVM so i'm using jmonkeyengine now, to see if that works better
16:06Fossiah, never used it, but heard some stuff
16:06Fossiactually using CS from clojure would be worth a shot for fun
16:07Fossibut well, too many projects, not nearly enough time ;D
16:08etateFossi: why crystal space?
16:11Fossietate: because it's a good engine and i've been around (and a bit of contributing) for about 7 years or such ;)
16:12etateFossi: i'll check it out :)
16:16Fossicould somebody point me to a more sane AOT compile example than the one in the docs?
16:17hiredmaneh?
16:17hiredmanwhat is wrong with the one in the docs?
16:18Fossiwasn't there some way of calling the compiler directly?
16:18hiredmanwhat do you mean?
16:18hiredman(compile 'clojure.examples.hello) looks pretty direct to me
16:19Fossisorry, from the commandline
16:20Fossiah, -e is what i was looking for
16:26Fossii'm too stupid to get this stuff compiled ;D
16:26Fossimy emacs can't write to 'classes' and from the commandline i can't seem to get the classpath right ;D
16:28Fossiah, is that alive and kickin'
16:28Fossilast time i did some clojure that was still wip
16:29Fossithen again, i need ant to compile the stuff for android, so i should most likely add another target to it
16:30hiredmanandroid doesn't have a jit or a good gc
16:31hiredman(well it has a jit now, but it is not on by default)
16:31Fossioh, clojars <3
16:31Fossithat's a good deed
16:31Fossihiredman: i know
16:31hiredmanclojure leans hard on the jit and the gc
16:31Fossihiredman: i'm still doing this ;p
16:32Fossithe gc is absolutely killing it
16:32Fossithen again, i can't really get myself to do this in java. i just wait until the gc gets better
16:32Fossiit's not really bareable for java either
16:32hiredmanI know technomancy is looking at duby for android developement
16:33seangroveHey all, how can I take a sequence of strings and combine them into one string with spaces separating them?
16:33Fossiplus i want to fiddle with the dexer again some time again and finally make that faster
16:33seangroveMap won't work because that will of course return another string
16:33seangroveI suppose I could just do it recursively
16:33Fossiso that might be a way to get a faster repl
16:33Fossi(and hopefully swank/slime)
16:33headiusyay duby
16:33hiredman,(reduce (partial str " ") ["a" "b" "c"])
16:33clojurebot" abc"
16:34hiredmanbleh
16:34hiredman,(reduce (partial partial format "%s %s") ["a" "b" "c"])
16:34clojurebot#<core$partial__5034$fn__5044 clojure.core$partial__5034$fn__5044@1d26ddd>
16:34hiredman:/
16:35hiredman,(reduce #(format "%s %s" % %2) ["a" "b" "c"])
16:35clojurebot"a b c"
16:35The-Kenny,(reduce #(str %1 (partial " " %2)) [1 2 3])
16:35clojurebot"1clojure.core$partial__5034$fn__5036@17c814dclojure.core$partial__5034$fn__5036@10cf661"
16:35The-Kenny,(reduce #(str %1 (str " " %2)) [1 2 3])
16:35clojurebot"1 2 3"
16:36hiredman,(reduce (comp (partial apply format "%s %s") list) ["a" "b" "c"])
16:36clojurebot"a b c"
16:36seangroveHeh
16:38hugod,(reduce str (interpose " " ["a" "b" "c"]))
16:38clojurebot"a b c"
16:39joshua-choiI’ve been actually trying developing with the REPL now. I get it now; it’s really nice; much better than running tests repeatedly. JLine also helps a *lot*.
16:39hiredmanhugod: use apply in that case
16:40Fossistr-join ;D
16:40hiredmanFossi: write a stack lisp that compiles to bytecode without needing a runtime
16:40Fossithought about it
16:40Fossitoo crazy though
16:40Fossii wouldn't finish in ages
16:41nteon,(reduce (fn [a b] (str a " " b) ["a" "b" "c"])
16:41clojurebotEOF while reading
16:42nteon,(reduce (fn [a b] (str a " " b)) ["a" "b" "c"])
16:42clojurebot"a b c"
16:42nteonhugod: yours is better :)
16:48stacktraceris there a way to allow a lambda to be called with more args than it uses?
16:48stacktracerfor example:
16:48stacktracer,(#(print %) "Hello, world!")
16:48clojurebotHello, world!
16:48stacktracer,(#(print "Goodbye") "Hello, world!")
16:48clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--5579$fn
16:49stacktracercan I make the second one work without doing (fn [_] ...) ?
16:49hiredman,(#(do %& (print :a)) :b :c :d)
16:50clojurebot:a
16:50hiredmanin short, no
16:50stacktracerokey dokey -- thanks hiredman
17:07etateOMFG FINALLY... ogre4j starting to work :)
17:39rem7is there a way to set the repl to print really big numbers not truncated?
17:45remleduffHow can I tell if elpa has successfully downloaded swank-clojure and if it's active correctly after restarting?
17:46hiredmanM-x slime
17:46remleduffThat says, "[No match]"
17:47remleduffI have this in my *Messages* though: File mode specification error: (file-error "Cannot open load file" "swank-clojure-autoload")
17:58remleduffAny ideas how I get past: swank-clojure.el:48:1:Error: Cannot open load file: swank-clojure-autoload when trying to M-x package-install swank-clojure ?
18:06remleduffAny ideas why "M-x slime" doesn't do anything at all? :|
19:05miltondsilvaabout memoize, kotarak and cgrand have posted some very nice aditions to it but, shouldn't the caching be done on the JVM side? Souldn't high-level languages abstract you from memory managment? What am I missing?
19:11nteonis there a way to specify a method signature for a static method/function on a gen-class namespace?
19:16Chousukemiltondsilva: memoize is not memory management, it's a caching "decorator" for functions
19:26slyphonso, what's the idiomatic way to throw exceptions in your code? I'm used to defining a root exception for my project and subclassing that, but that seems like it would be very cumbersome in clojure
19:27hiredman(throw (RuntimeException. "blah blah stuff happened"))
19:27slyphonso just use RuntimeException?
19:28hiredmanor don't throw exceptions
19:28hiredmanclojurebot: exceptions?
19:28slyphonhrm
19:28clojurebothttp://paste.lisp.org/display/74305
19:28hiredmanyou could just pick one
19:28slyphonok
19:29slyphonrhickey: is the "ants" demo and talk a good place to learn about how to structure code to take advantage of STM?
19:30slyphoni'm starting to work on a video encoding task management engine in clojure, and i'm a little confused at what level i should be using ref/atom/agent
19:30rhickeyslyphon: It's a good start, but all situations are different, so not a fixed model
19:32rhickeyslyphon: try to find the 'identities' in your problem space - these should get the refs in the first cut at a model. e.g. if a person was an entity in your domain, his arm wouldn't be an identity
19:32slyphonTHANKS, SPRINT!
19:32rhickeyslyphon: try to find the 'identities' in your problem space - these should get the refs in the first cut at a model. e.g. if a person was an entity in your domain, his arm wouldn't be an identity
19:32rhickeyhave you read http://clojure.org/state ?
19:34slyphoni'm sort of modeling an RDBMS row as a struct-map, and it seems that the row will have columns that are immutable and others that are mutable, the mutable ones seem to me to be a natural fit with refs
19:35slyphon"If this struct was a part of an index of this collection of structs, i wouldn't want to have to change the whole collection just because i'm going to update *blah* on this 'row'"
19:35slyphonrhickey: i'll just read that page again
19:36hiredmanhow big are your rows?
19:36miltondsilvaChousuke: the problem is, I'm now at a point where I need to memoize a great number of functions in order to optimize my program. so shouldn't this be done automatically?
19:36hiredmanbleh
19:36hiredmanthat is not the question
19:36slyphonhiredman: about 17 cols
19:37hiredmanhow often will you mutate multiple columns in a row?
19:37slyphonfairly often
19:37hiredmanhmm
19:38slyphonit's keeping track of the state of an encoding job as it gets taken by an encoder and processed
19:38slyphonincluding progress updates, timestamps to indicate how long it's been running for, how long it waited to get picked up, etc.
19:38slyphonright now we have it in a mysql db, but it's causing all sorts of issues, because using the db as a queue is "doing it wrong"
19:39slyphongah, he're my train stop
19:39slyphoni'll bbialb
19:45rhickeywhat's the current Clojure textmate bundle?
19:47rhickeythis http://github.com/nullstyle/clojure-tmbundle looks pretty old
19:53Chousukemiltondsilva: you can't automatically memoize functions
19:53Chousukemiltondsilva: it only works for pure ones
19:55miltondsilvaChousuke: I know.... but being lazy as I am, I was hoping there was a switch called memoize-all-pure-fns
19:55Chousukewell, you can write a small wrapper macro that defines and memoizes a function
19:56miltondsilvaChousuke: if not that than something like defn-memoized
19:58miltondsilvaI could if I knew how to write macros... ah well guess this is a good time to learn ;)
20:01Chousukestart with writing out the code you want manually
20:01Chousukethen write a *function* that produces that code. ie. a list.
20:01Chousukethen change defn to defmacro :P
20:03miltondsilvathanks but as I said I'm lazy and I'm also lucky contrib has a defn-memo ^^
20:03Chousukeheh
20:14nathanmarzany tips on writing unit tests for code that uses agents?
20:14nathanmarz"lein test" just hangs when the tests finish
20:14krumholt_how can i predict how many elements of a lazy-seq will be realised? for example i don't want the following to fail
20:14krumholt_,(first (lazy-seq [(/ 1 2) (/ 1 2) (/ 1 0)]))
20:14clojurebotjava.lang.RuntimeException: java.lang.ArithmeticException: Divide by zero
20:18tomojkrumholt_: I don't think it works that way
20:19tomoj,(first (lazy-seq (cons (/ 1 2) (lazy-seq (cons (/ 1 0) nil)))))
20:19clojurebot1/2
20:20tomoj,(lazy-seq (cons (/ 1 2) (lazy-seq (cons (/ 1 0) nil))))
20:20clojurebotjava.lang.ArithmeticException: Divide by zero
20:20tomoj,(doc lazy-seq)
20:20clojurebot"([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls."
20:21tomojyour body is that vector, so your call to lazy-seq returns a LazySeq which, when realized, evaluates that vector
20:21tomojevaluating that vector causes the divide by zero error
20:21krumholt_tomoj, ok
20:21tomojto get lazy-seqs you would normally use the seq library
20:22krumholt_is that from contrib or in clojure.core?
20:22tomojwell, it's not a specific library really
20:22tomojlots in core, some stuff in contrib
20:22tomojjust in general functions which return lazy seqs
20:23tomoje.g.
20:23tomoj,(map / (reverse (range 1 5)))
20:23clojurebot(1/4 1/3 1/2 1)
20:23tomojthat's lazy
20:23tomojso this blows up
20:23tomoj,(map / (reverse (range 5)))
20:23clojurebotjava.lang.ArithmeticException: Divide by zero
20:23tomoj,(first (map / (reverse (range 5))))
20:23clojurebot1/4
20:24tomojbut that works
20:24krumholt_ok
20:24tomojif you need to build a lazy-seq manually using the `lazy-seq` function, the pattern I've seen most is (lazy-seq (cons ... ...))
20:25tomojor sometimes lazy-cat
20:26krumholt_tomoj, ok i thought that (lazy-seq [1 2 3]) would do that
20:27tomojno, vectors aren't lazy, so
20:27krumholt_tomoj, ah ok i understand
20:27krumholt_thanks
20:27krumholt_,(seq? [1 2 3])
20:27clojurebotfalse
20:27tomojif you've already got [1 2 3] no reason to turn it into a lazy seq
20:27tomojon the other hand, you might have a macro which reads a vector and lazily evaluates its members... but that seems strange
20:28tomoj,(doc macrolet)
20:28clojurebotPardon?
20:29tomoj,(require '[clojure.contrib.macro-utils :as macro-utils])
20:29clojurebotnil
20:33krumholt_i think it is because of chunked sequences
20:36tomojchunking can cause problems, yes
20:36tomojare you doing side-effects?
20:37tomoj,(take 5 (map #(do (println %) %) (range 10)))
20:37clojurebot(0 1 2 3 4)
20:38tomojwell, it prints out 0-10 as well
20:38krumholt_tomoj, no side effects
20:39krumholt_just calculations that might fail
20:39tomojah
20:39krumholt_but if they do i don't want that to happen before it's there turn to execute
20:39Licenserharr harr harr
20:40tomojkrumholt_: are you using `take` to grab some results off the seq of calculations?
20:40krumholt_no just first
20:40tomojah, same problem there
20:40tomoj,(first (map #(do (println %) %) (range 10)))
20:40clojurebot0
20:40clojurebot0 1 2 3 4 5 6 7 8 9
20:40krumholt_,(first (lazy-seq (cons (/ 1 2) (cons (/ 3 4) (cons (/ 1 0) (cons (- 1 2) nil))))))
20:40clojurebotjava.lang.RuntimeException: java.lang.ArithmeticException: Divide by zero
20:41tomojyou need more lazy-seqs :)
20:41krumholt_i think it is because of chunks but its not that bad
20:42krumholt_i'll wrap the statements in delays
20:52tomoj,(macro-utils/macrolet [(lazy-vec [v] (when (seq v) `(lazy-seq (cons ~(first v) (lazy-vec ~(next v))))))] (first (lazy-vec [(/ 2) (/ 1) (/ 0)])))
20:52clojurebotjava.lang.Exception: No such var: sandbox/lazy-vec
20:52hiredmanuh
20:53hiredmankrumholt_: lazy-seq does not reach into cons and make it lazy
20:53hiredmanyour lazy-seq there returns a strict list
20:53tomojlazy-vec doesn't :)
20:53tomojbut, I have no idea why you'd want lazy-vec, really
20:53hiredmanlazy-seq basicly makes a thunk
20:53hiredmanthat has nothing to do with chucnks
20:54pdkif you did (lazy-seq (cons (...))) then it would have to evaluate the cons before it could pass it as an argument to lazy-seq
20:54remleduffWow, rebooting fixed swank!
20:54remleduffDoes anyone know the magic to make [] work with paredit?
20:54hiredmanpdk: lazy-seq is a macro, so that is not true
20:55tomojremleduff: https://gist.github.com/15c936da860edf2fa016
20:55tomojremleduff: you probably don't need all of that
20:55remleduffHehe, thanks tomoj :)
20:56tomojoh, also
20:56tomojyou should be using paredit-beta.el
20:56krumholt_hiredman, i thought lazy-seq qould take my seq and make it lazy
20:56tomojhttp://mumble.net/~campbell/emacs/paredit-beta.el
20:56tomojvectors aren't seqs
20:57tomojlazy-seq doesn't really do that for seqs either
20:57hiredmankrumholt_: you don't have a seq, you have a list
20:57krumholt_(seq? (list 1 2 3))
20:57krumholt_,(seq? (list 1 2 3))
20:57clojurebottrue
20:58hiredmanok, you don't have a list, you have a function call that returns a non-lazy list
20:58tomoj,(first (lazy-seq (list 1 2 (/ 0))))
20:58clojurebotjava.lang.RuntimeException: java.lang.ArithmeticException: Divide by zero
20:58tomojthe list is a seq, yes, but lazy-seq can't just magically make it a lazy seq
20:58hiredman,(first (lazy-seq 1 (lazy-seq (/ 0))))
20:58clojurebotjava.lang.RuntimeException: java.lang.ArithmeticException: Divide by zero
20:58tomojlazy-seq just lazily evaluates its body, which in my example is (list 1 2 (/ 0))
20:58tomojevaluating that throws an error
20:58hiredman,(first (lazy-seq (cons 1 (lazy-seq (/ 0)))))
20:58clojurebot1
20:59tomojyeah, need a string of lazy-seqs if you're doing this manually
20:59hiredmanif you look at the definition for lazy seq producing functions they are recursive
20:59krumholt_ok i think i get it
20:59krumholt_thanks all
21:00tomojthough my lazy-vec above is an attempt to evaluate a vector lazily through a macro
21:00tomojso (first (lazy-vec [(/ 1) (/ 0)])) returns 1
21:00etateman i just made the best color-theme evar
21:01hiredman,(letfn [(map’ [f [x & xs]] (when x (lazy-seq (cons (f x) (map’ f xs)))))] (map’ inc (range 3)))
21:01clojurebot(1 2 3)
21:01tomojetate: are you sharing?
21:01etatetomoj: sure if you want it
21:01tomojI made my own too but don't really like it
21:01etatetomoj: i just spent the last 40 mins making this one :)
21:02etatetomoj: the region highlighting kind of sucks but i'll paste it
21:02tomojthanks
21:03etatehttp://gist.github.com/331038
21:03etatetomoj: let me know what you think
21:05tomojetate: looks pretty nice
21:05tomojdidn't cover everything mine did so remnants are left :(
21:05etatetomoj: yeah its not complete yet :)
21:06tomojI think some of the near-whites are too bright for me, but I like your basic idea better than my weird combination of a bunch of colors that don't go together
21:07etatetomoj: as in the strings or functions?
21:08etatetomoj: i think you're right though there are some subtle inconsistencies... i'll continue hacking it :)
21:08tomojjust in general the colors are too similar to me
21:08tomojI look like http://tomojack.com/stuff/sshots/color.png
21:09etatetomoj: thats not my theme, thats yours?
21:10tomojyeah
21:10tomojcomparatively I have lots of different colors
21:11etatetomoj: yeah i think too many colours makes it look inconsistent personally
21:11tomojyeah, I didn't like picking them and am not satisfied
21:11etatetomoj: i try and choose a palette and go for pastel colours
21:13tomojnext time maybe I'll try using a palette, good idea
21:15etatetomoj: :) i'm just hacking mine now i'll paste the next version :D
21:16hiredmantomoj: have you tried rainbox parens?
21:17hiredmanrainbow
21:26remleduffWhat's the "correct" way to turn on paredit mode now actually? I'm a little confused with all the seemingly different documentation
21:30etateremleduff: either M-x paredit-mode, or set it in .emacs
21:32etateremleduff: to set it in .emacs you use (add-to-list 'load-path "/path/to/paredit/"), then (autoload 'paredit-mode "paredit") .. then add hooks to your modes so: (add-hook 'clojure-mode-hook (lambda () (paredit-mode +1)))
21:33etatetomoj: got a new version which is much more colourful
21:33remleduffestate: OK, I'm trying to stick to ELPA as much as possible and thought I was doing too much manually
21:34etateremleduff: o, i can't really comment since i don't know how ELPA works
21:34etatetomoj: http://gist.github.com/331058
21:39etateis there a clojure-indent ?
21:45tomojhiredman: I haven't
21:57psykoticremleduff: with ELPA, you don't need to worry about adding it to the path or autloading, but you still need to activate it where appropriate, either manually or with mode hooks
22:06remleduffpsykotic: Thanks, I think I understand
22:07psykotic(autoloading is 'lazy loading'. it creates a stub function that loads the .el file the first time it is called)
22:08remleduffWhat I have now is: (require 'paredit) (add-hook 'clojure-mode-hook (lambda () (paredit-mode +1))) and then the magic to make [] and {} work as well
22:10remleduffWhere is swank-clojure.jar supposed to come from? I've been searching clojars for something to add to project.clj but am I missing something?
22:11psykoticyou don't need to require it
22:11psykoticelpa adds autoloads and things like that for you automatically
22:13remleduffHmm, if I didn't require it, I get errors when I try to do: (define-key paredit-mode-map (kbd "M-[") 'paredit-wrap-square)
22:14psykoticah yeah. for defining keys you need more than the autload
22:14hiredmantomoj: there is a rainbow-paren-mode that colors parens based on nesting depth
22:14psykoticthe usual way people do that is add a hook to paredit-mode itself
22:14hiredmanit's very colorful
22:14psykoticie they have a lambda which on load of paredit fixes up the mode map
22:15psykoticthat way it's deferred, and by the time the lambda body executes, it will actually have been loaded, and variables like paredit-mode-map, etc, will exist
22:16psykoticlook at this guy's .emacs: http://www.freebsd.org/doc/en/books/developers-handbook/emacs.html
22:17psykoticparticular the my-lisp-mode-hook
22:17psykoticdo something similar for paredit
22:17psykoticthen you don't need the require and the autoload will do
22:20slyphonhrm
22:21slyphonit'd be interesting if you could coordinate updates between STM and say, an RDBMS
22:21remleduffIsn't C-k supposed to do something, even though I'm in paredit mode?
22:21slyphonyeah, it kills the sexp, without destroying the delicate balance of sexps
22:22slyphonhttp://www.emacswiki.org/emacs/PareditCheatsheet
22:22slyphon"paredit-kill"
22:22remleduffI typed: (defun awesome-p () t)
22:22kwertiiIs there a Clojure time/date library, or some other way to avoid using the obscene GregorianCalendar stuff from Java?
22:22remleduffI put the point after the paren, and hit C-k
22:22psykotickwertii: i think a lot of people using jota
22:22slyphonafter which paren?
22:22remleduffBut it deleted the following line, I thought it was supposed to delete the sexp
22:22remleduffI can't get it to delete any sexps :)
22:23kwertiipsykotic: Joda?
22:23kwertiipsykotic: cool, thanks
22:24psykotickwertii: yes, sorry, all this java stuff is new to me
22:24kwertiipsykotic: found it, looks good
22:24remleduffpsykotic, after either paren, for the first (), it does nothing. At the end of the line, it deletes the following newline
22:25remleduffHmm, maybe I'm misunderstanding the tutorial I'm reading
22:26psykoticif it behaves differently than normal C-k, then it's working :)
22:28psykoticalways read the docs. it's pretty explicit about what happens. C-h k C-k
22:29psykoticbasically, if you've got a sexp spread over multiple lines, then C-k doesn't gobble up everything in one go, it acts like normal C-k
22:29psykoticif you want to kill the whole multi-line sexp, i think you need to put the cursor on the opening bracket
22:46remleduffAny idea why M-x swank-clojure-project might just sit there polling slime.5548 forever?
22:46iceyremleduff: that's happened to me before when my swank server didn't start properly
22:46somniumremleduff: probably no swank-clojure.jar in ./lib, but check *inferior-lisp* for more info
22:47iceyi'm trying to think back to what caused it, but i think i was missing something on my classpath
22:47remleduffsomnium: I'm pretty sure that's my problem, but where do I get swank-clojure.jar?
22:47somniumremleduff: [swank-clojure "1.1.0"]
22:48remleduffGreat, I've been searching for that for a while, thanks. swank-clojure doesn't come up if you search on clojars
22:51somniumhmm, swank alone gets a hit. but yeah, thats a bit confusing
22:51remleduffYay, it worked!
22:56psykoticyou're launching with lein swank, right?
22:57remleduffNo, M-x swank-clojure-project for the moment
22:57psykoticah right
22:59remleduffIs the completion style when I hit <TAB> configurable when there are multiple matches?
22:59remleduffI'd rather get something like ido instead of a big buffer listing all the completions available
23:01hiredmanthere is something called autocomplete which will popup a sort of overlay for completions
23:02psykotichiredman: with slime?
23:04psykoticah this, http://www.emacswiki.org/emacs/AutoComplete
23:04remleduffDo you know if slime-fuzzy-complete-symbol will work?
23:04psykoticiirc slime's fuzzy complete is not done in emacs but host-side
23:04psykoticbut someone reimeplemtned the algorithm in emacs separately, so you could probably hook that in
23:06remleduffThere seems to be something called "company-mode" in ELPA, I'll see if that will work
23:06remleduff"company = complete anything". It also is rough to google for
23:08psykoticif you don't know any emacs lisp, hooking these things up to slime might not be that easy
23:09somniumauto-complete rocks -- typing more than 3 chars feels like a chore
23:12psykoticit's pretty crazy that it uses overlays, haha
23:12psykotici guess it creates one for each row of the completion box
23:13psykoticand presumably it has to temporarily pad lines with spaces if the box extends beyond some given line's contents, etc
23:16remleduffIs autoinstall something that existed pre-ELPA, or some competitor or... ?
23:16psykoticpreeexisted
23:16psykoticactually, it might not, now that i think about it
23:17remleduffI feel like I'm asking too much emacs stuff here, sorry people who want to hear about clojure
23:18kwertiican you set JVM command-line arguments in Leiningen (to enable remote debugging)?
23:18somniumemacs digressions are fairly common in this channel
23:18tomojkwertii: for what, lein-swank?
23:18tomojI mean, how are you starting the jvm?
23:18tomojguess it doesn't matter, I don't know the answer :(
23:19kwertiitomoj: yeah, or anything, really. I'm starting with lein swank, but I imagine it would be the same for lein repl or whatever
23:23kwertiiNot what I had in mind, but you can set the JAVA_OPTS env variable to affect the JVM launched by Leiningen...
23:23psykoticthere's something called eval-in-project
23:24psykoticit takes a handler arg that's called on the java task before execution, and it can set jvm args
23:25psykoticbut there don't appear to be hooks for the existing eval-in-project uses
23:26psykotickwertii: is that a general java thing?
23:26kwertiipsykotic: yep, at least with the Sun JVM
23:26psykoticoh, i see, it's in the lein shell script
23:27remleduffThe only thing I see is the JAVA_OPTS environment variable
23:27kwertiiahh, so it is
23:27remleduffI wonder why lein-repl is implemented in the shell script rather than using eval-in-project
23:28psykoticit would be nice if eval-in-project used some *special-vars* for jvm args, etc
23:28psykoticthe current handler approach is nice if you are in control of the eval-in-project invocation, but it doesn't help you much if you want to alter existing eval-in-project uses elsewhere
23:30psykoticremleduff: i avoid using lein repl, it doesn't seem to work very well
23:31remleduffYeah, the current way it's implemented means it gets leiningen's classpath rather than the project's
23:32remleduffWell, that's oversimplifying, it adds everything in lib as well
23:33remleduffSo I guess it's basically the project's classpath
23:39MecWhat font do you guys like best for code?
23:39arbschtinconsolata
23:42Apage43I am pretty partial to Inconsolata
23:43Apage43use Consolas at work though, next best since it ships with office 07.
23:43MecI dont think i have that one
23:44hiredmanI prefer Consolas to Inconsolata, but mostly use DejaVu Sans Mono because it has the best unicode coverage
23:45Meci do have that one
23:52Mechey lookie there, emacsW32 where have you been all my life
23:58remleduffsomnium: Now that I have autocomplete installed, how do I get it to work with clojure?
23:59psykoticconsolas looks like garbage with a non-windows font renderer
23:59psykoticmonaco looks good on a mac, imo
23:59iceypsykotic: yeah i use monaco and like it