#clojure logs

2009-08-15

00:21lrennholy crap.
00:21lrenn(global-set-key (kbd "C-x C-i") 'ido-imenu)
00:21lrenndo that in a clojure file. Thank you thank you thank you technomancy.
00:24lowlycoderis there anyway to have clojure startup faster?
00:25lowlycoderi'm willing to waste memory / precompile / draw a pentagon & slaughter cute kittens
00:26andyfingerhutSome Common Lisp implementations have the idea of saving a core/dump file at some point after loading whatever you want, with the intent of starting up to that state faster. Does the JVM have such a thing?
00:26hiredmanthe nailgun server from vimclojure
00:26hiredman~nailgun
00:26clojurebotNo entiendo
00:27hiredman~google java nailgun
00:27clojurebotFirst, out of 3420 results is:
00:27clojurebotNailgun: Insanely Fast Java
00:27clojurebothttp://martiansoftware.com/nailgun/index.html
00:27hiredmanit works ok, but it isn't perfect
00:28hiredmanthe easiest way to use it is to grab it from vimclojure
00:28hiredmanI have my netbook start up a nailgun server when it boots, so "clj" brings up an instant repl
00:29lrennoh, ido-imenu isn't part of ido mode. my bad.
00:36andyfingerhutApparently there is no standard for saving a core file in JVMs like some Lisp implementations have (also no Common Lisp standard for it -- implementation-specific). A JSR was proposed but rejected, according to a very recent thread in comp.lang.lisp titled "Q: JVM based Lisp implementations and saving images - possible?"
00:36andyfingerhutnailgun sounds faster, anyway, if that solution works for you.
00:37hiredmansome operating systems like dragonflybsd can "freeze" processes
00:38hiredmannot sure if you can restart the image multiple times though
00:38hiredmanhttp://hackety.org/2008/02/27/dragonflysFreezer.html
00:49lowlycoderwhy does java com.martiansoftware.nailgun.NGServer work; but java -server com.martiansoftware.nailgun.NGServer does not
00:49lowlycoderdoes classpath not apply to -server?
00:55hiredmaneh? works here
01:01andyfingerhutWould it be possible to make something like an immutable Java array in Clojure? By which I mean it would really be immutable, but then you'd lose the ability to efficiently conj on it?
01:02hiredmaneh?
01:02hiredmanI am pretty sure there are no immutable arrays in java
01:03andyfingerhutWell, all the persistent data structures in Clojure actually have their internals mutated in Java code during operations like conj, assoc, etc.
01:04hiredmanerm
01:04andyfingerhutBut I think they are prevented from being mutated by *other* Java code by being private, so no other methods can twiddle with their insides.
01:04andyfingerhutWhat if we put a Java array inside of such a class?
01:04andyfingerhutso only methods written for it would have permission to touch them.
01:05andyfingerhutI don't know if there are other possible advantages, but the one that motivated the thought was saving space for large arrays of Java primitives. That might be a special enough case not to be terribly interesting...
01:08andyfingerhutIt is just bugging me that in order to have something immutable right now, it has to be 3 to 4 times larger, if you only want to stick ints or doubles into it.
01:09andyfingerhutbecause of java.lang.Object and java.lang.Double overheads.
01:39lowlycoderfor vimclojure, what is vimdir=/custom/installation/path/for/vimplugin
01:39lowlycodersupposed to do?
01:39lowlycoderwhat dir is this vimplugin they want?
01:39lowlycoder/usr/share/vim/vim72/plugin?
03:02konrWhat are your editor-to-repl bindings set to?
04:13lowlycoderwhat are good web frameworks for clojure?
04:19arbschtlowlycoder: compojure is quite popular. (feel free to discuss it in #compojure if you're interested)
04:19arbschtothers are listed at http://clojure.org/libraries
04:42konrlisping all night long, lalala
05:40konrargh, I can no longer think
05:40konrI guess I'll sleep with the other tutorial videos turned on
05:41konrtime to cloje my eyes ;)
10:03osaundersIs there a way to break from a map?
10:03carkno
10:03carkbut you don't need it
10:03osaundersWhat do you do instead?
10:03carkremember that map is lazy
10:04carkso you may filter
10:04carkor even filter before maping
10:05carkworst case you still may use loop
10:05osaundersI understand how I would filter before mapping, but how would the other one work?
10:05carkwell that would depend on what you want to do i guess
10:06osaundersOK so how would I write this (Ruby) in Clojure: [1, 2, 3, 4].each { |n| puts n; break if n == 3 }
10:06osaundersI could filter [1 2 3 4] beforehand.
10:06osaundersBut otherwise I don't know.
10:07carkor (map #(if (> % 3) nil %) [1 2 3 4])
10:07carkand take-while not nil
10:07carkactually directly take whil not nil =P
10:08osaunders:-s
10:08osaundersAH
10:09osaunders,(take-while #(not (nil? %)) (map #(if (< % 4)) [1 2 3 4])
10:09clojurebotEOF while reading
10:09osaunders(take-while #(not (nil? %)) (map #(if (< % 4)) [1 2 3 4]))
10:09cark,(take-while (partial >= 3 ) [1 2 3 4])
10:09clojurebot(1 2 3)
10:09carkdo this before maping
10:10carkbut it really depends on your specific case
10:10tomojno reason to map if you just want to print them out
10:10tomojsometimes I feel like it would be useful to have a take-while-inclusive
10:10carkselecting the correct subset of your sequence is a different concern than mapping it
10:11tomojwhich would take while the condition is true AND include the first element for which the condition was false
10:12osaunderscark: I want up to 3. Isn't it < 4 not >= 3
10:12osaundersIt's still just a hypothetical example but I need to know I'm not going insane.
10:12cark,(take-while #(<= % 3) [1 2 3 4])
10:12clojurebot(1 2 3)
10:12carksame thing
10:12tomojthat partial up there says `3 >=`, not `>= 3`
10:13osaunders<= != >= :-)
10:13tomojit's in the opposite order
10:13osaundersAh
10:13osaundersOK, that explains.
10:13tomoj(partial >= 3) is like #(>= 3 %)
10:13osaundersYeah.
10:14carkyep sorry that was introducing a difficulty
10:15carkanyways the thing to remember is that the map operation is only there to map one thing to the other
10:15carkit is not there for selection
10:15tomojit's just like ruby's map
10:15tomojyou can't throw things out
10:15osaundersYeah OK.
10:15osaundersThing is I'm thinking "OK I want to map now and then I'll break here" only you can't do that.
10:16carkbut while thinking like that you mix 2 concerns
10:16tomojyup, filter or take-while first
10:16osaundersSo map with a break becomes (map sth (take-while pred list))
10:16tomojparedit helps with that :)
10:17osaunderscark: Yeah, I can see Clojure's way is better.
10:21osaunderspartial, take-while, conj etc. are called forms not functions right?
10:22carkmhh no
10:22carkthese are functions
10:22osaundersdefn is a form?
10:22carkthat is a form : (map sth (take-while pred list))
10:22osaundersOh.
10:22osaundersA macro isn't a function though?
10:22carkbut you could say the "take-while form is neat"
10:23carka special kind of function
10:23osaundersI thought form was a collective term for macros or functions.
10:23carkform is the all-inclusive thing
10:23carkit orks for special forms too
10:23carkworks
10:23osaundersform isn't the function plus its arguments?
10:24osaunders... as an example.
10:24carkor the macro plus arguments
10:24carkor just the name
10:24osaundersOr just the name?
10:24carkeverything is a form (to me)
10:24osaundersGah.
10:24osaundersUm. :-s
10:24carksome forms are atoms
10:24carksome are lists
10:25osaunders10 is a form to you?
10:25osaunders"blah" is a form to you?
10:25carki'd say that, i might be the only one tho
10:25osaunderslol
10:26osaundersIf the purpose of such a word is for communication it might be a problem if you're the only one.
10:26carkhehe well it's up to you to start the big survey
10:26osaundersDammit >_<
10:27carkif "if" is a special form
10:27carkthat would mean that a form can be a single word
10:27carkor is it the full (if condition true-form false-form) thing ?
10:27tomojCLHS says "form" is "any object meant to be evaluated", "a symbol, compound form, or a self-evaluating object"
10:28osaundersIt might be referring to if in a wider sense.
10:28carkah thanks tomoj
10:28tomojof course CLHS isn't binding here, but...
10:28carkdoes that include literals?
10:28tomojyeah, those are "self evaluating objects"
10:28carkone might say that the reader is evaluating "blahblah"
10:29tomojso, I think `(if condition true-form false-form)` is the "special" form, but "if" is still a form since it's a symbol
10:29osaundersI'm trying to work out what CLHS stands for.
10:29carkok great i'm not the only one then =)
10:29carkcommon lisp hyper-spec
10:29carkan wonderfull document
10:30tomojCLHS's forms don't include [1 2 3] or {:a 3}
10:30tomojI suppose ours do
10:30osaunders"foo" can't be evaluated
10:30osaunders,("foo")
10:30clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn
10:30cark,"foo"
10:30tomoj,"foo"
10:30clojurebot"foo"
10:30clojurebot"foo"
10:30tomoj:)
10:31carkand even more :
10:31cark,("foo" 2)
10:31clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn
10:31carkoh yes =/
10:31carkpff
10:31tomojI did think strings were associative?
10:31carkvectors are, but this cannot be done because clojure uses java strings
10:32osaunders,('(1))
10:32clojurebotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn
10:32carki forgot that for a minute =)
10:32tomoj,(let [{a 2, b 3} "foobar"] [a b])
10:32clojurebot[\o \b]
10:32cark,([0 1 2 3] 2)
10:32clojurebot2
10:32tomojah, that must seq it first?
10:33carksequences are not associative either
10:33carkbecause of O(n) random acess
10:33tomojwell.. does it convert it to a vector of characters first, then, I suppose?
10:34carki guess there's some magic in the destructuring code
10:35osaundersClojure strings are atoms.
10:35osaundersBecause they are Java objects.
10:35osaundersI always thought.
10:35osaundersThey probably should be vectors of characters though imho.
10:35tomojatoms can be forms too
10:36osaundersBut is this really being evaluated:
10:36osaunders,"foo"
10:36tomojin CL atoms are everything except conses
10:36clojurebot"foo"
10:36tomoja bit more difficult to decide what an atom is in clojure, I think
10:36osaundersconses?
10:37tomoja cons is basically a 2-tuple
10:37tomoja pair
10:37tomoj(in CL)
10:37osaundersOK.
10:37carkdoes not exist in clojure
10:37tomojeverything in CL is either an atom or such a pair
10:37tomojbut we also have vectors, maps, seqs, etc..
10:38osaundersYeah I don't think you have pairs as a first-class type in Clojure. I haven't encountered it.
10:38tomojI don't think the atomic/other distinction really makes as much sense in clojure
10:38osaundersActually, I suppose (1 2) is a pair.
10:38tomojnot the same
10:39osaundersWhy?
10:39tomoj(1 2) in CL is (1 . (2 . nil))
10:39tomojthat is, 1 paired with (2 paired with nil)
10:39osaundersCL = Clojure?
10:39tomojCL = common lisp
10:39osaundersOh!
10:39osaundersffs
10:39osaundersI have to re-read everything you said now.
10:39carkthere is no pair in clojure, that would be very wastefull with the jvm
10:39tomojhaha, sorry
10:41osaundersHm.
10:42osaundersThe distinction between a pair and a sequence of two for me was that a pair takes on a new meaning as a result. A sequence is a collection. A pair is a unification.
10:43osaundersIt's possible to unify more things than 2.
10:43tomoj"cons" means something very special in CL, I was just saying even though clojure has "pairs" like (1 2), they are not similar to canses
10:43tomojs/canses/conses/
10:43ckycark: There are ways to "simulate" pairs fairly effectively in the JVM. Have an ArrayList of cons cells (global, I know), then each reference to a cons cell can be represented as an int, the index to that global array. :-P
10:43carkcky : how about garbage collectionthen ?
10:44ckycark: Use weak references. :-P
10:44carkan integer is not a reference
10:44osaunderstomoj: I don't quite understand what's special about conses in CL?
10:44tomojthey're a special data structure
10:45ckycark: No, the ArrayList contains WeakReferences.
10:45tomoja cons can only have 2 elements
10:45osaunderstomoj: I didn't understand that example you gave, I don't know CP.
10:45ckycark: Then, you have a reference queue that gets notified when items get collected.
10:45tomojlists are built out of multiple conses chained together
10:45carkcky: right, but your arraylist will grow indefinitely
10:45ckycark: No, when your reference queue gets notified, then the associated slots can be reused.
10:45tomojso (1 2 3) is (1 . (2 . (3 . nil)))
10:45tomojin clojure (1 2 3) is just (1 2 3)
10:46osaundersSo it can have more than 2?
10:46tomojno, the "." separates elements of the pair
10:46osaundersYou just said it couldn't.
10:46osaundersAh, OK.
10:46osaundersBinary tree.
10:46carkcky: but you would get notified when the content of the conses are freed, which might be before you don't need them (you still hold an index somewhere)
10:46tomojosaunders: yup, but for lists it's just a linked list ending with nil
10:46ckycark: Hmm.
10:47ckycark: I'll think on this some more. :-P
10:47carkhehe ok
10:47tomojso in CL there's (1 2), the list, and (1 . 2) the pair, and they are very different
10:47ckycark: Well played, etc. :-)
10:47tomojin clojure we juts have (1 2) the list
10:47cark=)
10:47tomoj...but we still have a function named "cons" :D
10:48carkindeed there still are some kind of ons cells in clojure but these are not the same as CL cons
10:48cark+c
10:49osaundersThe motivation for pairs is performance?
10:49tomojuhh
10:49carknope, the motivation is these are universal
10:49osaundersBinary tree can be searched faster, can't they?
10:49tomojI'm not sure really, it's just the fundamental building block of CL
10:50carkcons are a good building block, usefull in many ways
10:50osaundersTrees are universal.
10:50osaundersBinary trees are a special type of tree.
10:50carkyes, but you may build tree from cons cells
10:50tomojits just in most cases in CL, they're not binary trees, they're just linked lists
10:50tomojso I don't think binary search was a motivating factor
10:50osaundersHm.
10:51carkyou can build almost any data structure from cons cells
10:51osaundersWhat exactly is a cell?
10:51carka cons cell is a pair =P
10:51osaundersOK. I've got to get this terminology straight.
10:51osaundersSo, thanks.
10:52carkit does not apply to clojure, so you may forget all about it
10:52carki mean while learning clojure
10:52osaundersSure. I'm interested in language design though.
10:55osaundersWhy does (apply println [1 2]) print "1 2\n" not "1\n2\n"?
10:55osaundersOh wait, ignore that.
10:58osaundersOK, confused again :-) What's going on here http://pastebin.com/m3ecc2e6a ?
10:58tomojosaunders: use doseq
10:59tomoj,(doseq [n [1 2]] (println n))
10:59clojurebot1 2
11:00tomojmap is not meant to be used for looping
11:01osaundersUp until now I didn't know how else to do it.
11:01osaundersThanks for the doseq.
11:01carkremember that map is only to transform the items of a list
11:01osaundersI will.
11:02tomojactually, I like this even better: (println (str-join "\n" [1 2]))
11:02tomojneed clojure.contrib.str-utils/str-join
11:02tomojit's a strange thing to loop over a sequence and print each element, to me
11:03carkb
11:03osaundersWhy's that?
11:03tomojI'd rather just functionally transform the sequence into something like the output I want, then print it
11:03tomojminimize the occurrence of side-effects
11:03tomojas much of your code as possible should be purely functional
11:03osaundersI see.
11:06tomoje.g. say you're writing some code that formats and prints a big structured report
11:06tomojif you do the printing deep in the inner loops, to test you have to bother with capturing output and stuff like that
11:06tomojif instead you have a bunch of little functions which do no printing, just build up a string to be printed at the end, you can test each individual function quite easily
11:07osaundersHow would you build up the string without side-effects though?
11:07tomojwell.. it's certainly possible
11:07carkfor this kind of stuff i build a very large structure with lists containing lists, and as the very last step convert the whole thing to a big string
11:08osaundersIs CL purely functional?
11:08tomojbuilding up strings is probably inefficient
11:08carkCL is not purely functional
11:08tomojheck no, CL doesn't even place any particular emphasis on functional
11:08carkclojure is not either
11:08tomojthat's why we're here and not in #lisp :)
11:08osaundersOK.
11:28eevar_tomoj: or because of the java ecosystem
11:28osaundersI'm not here for that.
11:29osaundersasdf?
11:30eevar_CL's package system. which you need to do _anything_ of interest
11:30eevar_even opening a file :p
11:31eevar_*naming
11:35eevar_by package system i mean library management, btw. my english/writing blows ;)
11:35osaundersAre you German by any chance?
11:37eevar_neh, norwegian
11:37osaundersOK.
11:37osaundersNot that it matters.
11:45osaundersApparently the type of expression I mentioned before, (whitespace sensitive) has a name: I-expressions.
11:45osaundersQuote WP: "A more recent variant is I-expressions, which use indentation to indicate parentheses implicitly, and are thus in some ways intermediate between S-expressions and M-expressions."
11:46tomojnice, I didn't know there was a reader syntax for ratios :)
11:46osaunderstomoj: Are you using Clojure for real work?
11:47tomojdoes "real work" mean "getting paid"? then no
11:48tomojI have decided to do my pet project in clojure instead of ruby, though
11:49osaundersFair enough.
11:49osaundersWhat is your pet project, if you don't mind my asking?
11:49tomoja web app for college course planning
11:49tomojspecifically for UT-Austin at this point since parsing course schedules is such a pain
11:49osaundersNeat. Good luck then.
11:50tomojthanks :)
12:00LauJensenTop of the evening gents
12:09tomojthere is no reader syntax for a MapEntry, huh?
12:10tomojis it efficient to use a literal hashmap with one keyval pair instead?
12:10tomojas in:
12:11tomoj,(conj {:a 3} {:b 7})
12:11tomojexcept, what if I'm doing that a whole lot? seems scary to create a new hashmap there in the last argument every single time, but does clojure save this from inefficiency?
12:19tomojwell, that's a silly example :)
13:16Chousuketomoj: (assoc map key val)? :/
13:22tomojyeah :)
13:23tomojI can't remember why I wanted literal mapentries
13:32stuarthallowayI am sitting in a room with Steve Gilardi! Should we have a contributors meeting? :-)
13:56rlbIs there anything like -> that will work in cases where the pass-through should be something other than the first arg?
13:56drewrrlb: not built-in, I don't think
13:56rlbi.e. you want to do something like (foo x (foo y (bar z w)))
13:56rlbI was specifically thinking of something like this:
13:57rlb(-> foo
13:57rlb (re-gsub x %)
13:57rlb (re-gsub y %)
13:57rlb (re-gsub z %)
13:57rlb (re-gsub w %))
13:58rlbfor a sequence of transformations.
13:58stuarthallowayrlb: don't think it exists, but it would be cool if someone wrote a macro like ->, but with a placeholder showing where the argument gets threaded into the next form
13:58rlbright
13:58drewr(-> foo #(re-gsub #"." x %) ...)
13:59rlbThough I suppose you might want to use something other than %
13:59rlbperhaps _ or similar
14:00rlbAnyway, thanks.
14:03Chousukestuarthalloway: isn't there one in contrib?
14:03Chousukelet-> or something
14:03rlbChousuke: Oh, ok, I'll look.
14:04stuarthallowayme too. I have been wrong before. :-)
14:07Chousukehmm, I can't find it. But I did see something like that mentioned on the group once
14:08stuarthallowaygrr, let-> isn't google-searchable
14:08tomojjust found -?> and .?., nifty
14:08Anniepoook, stupid noob question of the morning - I'm not getting the practical application of ->
14:09stuarthallowayAnniepoo: changes order of reading from inside-out to left->right
14:09Anniepooexample?
14:09stuarthalloway(. (. (. this) is) pain)
14:09carkAnniepoo: (-> "a.txt" FileReader. BufferedReader.)
14:09rlbAnniepoo: also helps avoid going of the right side of the page..
14:09stuarthalloway(-> this is easy)
14:10tomoj,(-> {} (assoc :a 3) (assoc :b 1))
14:10Chousuke,(-> "foobar" .toUpperCase (.substring 3))
14:10stuarthallowaywhere's the bot?
14:10Chousukehm. slow :P
14:10Chousukeah, it's gone :(
14:10cark,(let [t {:a {:b {:c 1}}}] (-> t :a :b :c))
14:10carkhum
14:11carkclojurebot is on vacation
14:11tomojmine and cark's examples are sortof silly I suppose
14:12rlb(-> a-file sort reverse take-10)
14:13Anniepooso, what's that expand to?
14:13tomojtake-10?
14:13rlbAssuming I didn't do it wrong (take-10 (reverse (sort a-file)))
14:13rlbtomoj: just a fake example
14:13Anniepooah, thanks
14:13rlbtomoj: i.e. "head -n 10"
14:13Anniepoonow I get it
14:13tomojah
14:14Anniepoook it's left to right
14:14tomojdoes -> have a pronounceable name?
14:15carkthread ?
14:15carkas in thread through
14:15tomojnot very googleable either
14:15tomoj:(
14:16Anniepoook, thanks, leads to second noob question of morning
14:17Anniepoouser=> (macroexpand (-> [1 2 3] sort reverse)) => (3 2 1)
14:17Anniepoowhich looks like it evaluated it
14:17carkyou need to put a '
14:17cark (macroexpand '(-> [1 2 3] sort reverse))
14:17Anniepooah
14:17Anniepoothanks
14:17carkbecause there you're macroexpanding the result
14:18tomojunfortunately that doesn't help all that much
14:18tomojbecause macroexpand isn't recursize
14:18carki mean in your attempt, the thing you're macroexpanding is the result of evualting (-> [1 2 3] sort reverse))
14:18Anniepooyes, I see what my mistake was
14:19Anniepoothe implementation of -> is to take the last item and go (last-thing (-> rest-of-it))
14:20tomojnot really
14:20tomoj(use 'clojure.contrib.repl-utils)
14:20tomoj(source ->)
14:21ChousukeAnniepoo: it puts the first parameter as the second item in the next parameter, then repeats
14:21tomojit just looks like that because of the way macroexpand works
14:21ChousukeAnniepoo: as a special case, a plain symbol is treated as a single-item list
14:22AnniepooYah, Chousuke, that's the thing that I couldn't understand that prompted all this
14:22Chousukemost functions take their primary argument as their first one, so it's pretty convenient.
14:23Anniepoomaybe have a markered version
14:24Anniepoo(-> arg1 arg2 :funcs fun1 fun2 fun3)
14:24Chousukeif you do (-> "foobar" .toUpperCase (.substring 3)) it becomes (-> (.toUpperCase "foobar") (.substring 3)) which becomes (.substring (.toUpperCase "foobar") 3)
14:24tomojis there already something to get full macro expansion?
14:25Chousukemexpand-all in contrib I think
14:25tomojah yes, thanks
14:25Anniepoohope clojurebot isn't sick, or got in an accident, or something
14:26Anniepookidnapped by imperative programmers who are making him do J2EE
14:46rlbSo is (reverse (take 3 (reverse x))) the clojure equivalent of something like (tail 3 x)?
14:48Chouserrlb: http://www.assembla.com/spaces/clojure/tickets/151 would allow (last 3 x), if that's what you mean.
14:48Anniepoonuuurg.....
14:49Chouser'reverse' is hardly ever idiomatic clojure
14:49rlbI just wanted the last N items of the sequence.
14:49Anniepoostart emacs with 'emacs' - try to exit with C-x C-c, it beeps and does nothing
14:49tomoj(drop (- (count coll) n) coll)
14:49Chouserrlb: yeah, that's what the new 'last' would allow. Until then...
14:50Chouseruse tomoj's solution. :-)
14:50rlbtomoj: right
14:50Chouserif it's a vector, you might prefer to use subvec
14:51tomojAnniepoo: that's odd..
14:52AnniepooI'm able to do read and write file
14:52Anniepoo(amazing how these things hang on, I recognize these commands from PMATE, which I used in 1984)
14:52rlbI need to get clojure's operation costs more clearly fixed in my head...
14:53tomojAnniepoo: maybe try C-h k C-x C-c
14:53Anniepooinstalled emacs module to existing cygwin
14:53rlbAnniepoo: or M-x kill-emacs
14:53tomojoh.. cygwin.. :(
14:53rlbAnniepoo: you're probably having keyboard mapping issues.
14:54rlbi.e. if you're on a console (rather than in X).
14:54Anniepooyah, I'm on a console
14:54tomojC-x C-c works in every console I've used, but maybe cygwin is weird
14:54rlbtomoj: I think it can be
14:54tomojonly problems I've had in console is like C-RET and S-up
14:55tomoj(since C-RET == RET)
14:56rlbAnniepoo: you might want to try X (and xterm, emacs in X, etc.). I think there's a command that'll fire up a rootless server if you have the right pkgs installed.
14:56Anniepooyah, typing x gives me a totally blank x desktop
14:56rlbBy default, I still think in scheme/lisp structures...
14:56rlbAnniepoo: I don't think that's what you want.
15:04mebaran151Anniepoo, how recent is your laptop
15:04mebaran151much easier than cygwin is to just use virtualization package
15:04mebaran151like VirtualBox from Sun
15:05AnniepooXP tablet
15:06rlbChouser: fwiw, it was a string -- just wanted the last 4 chars.
15:07Anniepoothanks all, there's a direct windows port as well
15:07AnniepooI'll try that
15:07Anniepooand thanks rlb for helpign with the wierdness with exiting
15:11Chouserrlb: while you certainly can use the seq library on strings, it often works best to use Java methods or the contrib str-utils lib.
15:12rlbChouser: ok, thanks. In the end, I may actually just want a regex for this particular bit.
15:13Chouser,(re-find #".{3}$" "hello there")
15:14rlbChouser: I obviously need to learn java regexes better. I've just been sticking to the really cross-regex-platform bits.
15:15ChouserJava mostly follows perl, though without some of the trickier bits.
15:15AnniepooJava libs wrap many things just to be wrapping
15:16Anniepooyou make a Pattern from the string
15:16Anniepoowhich is just an object that represents the regex pattern
15:16Chouserwell, it supposedly does some "compilation" too. Not sure how much that buys you.
15:17Anniepoothen you get a Matcher, which is an object that seq's sequential matches of a pattern against a string
15:18Chouserand is a scary, mutable thing I'd recommend not touching if at all possible.
15:18AnniepooI got bit by a Matcher once and had to go to the emergency room for shots
15:18ChouserI don't doubt it.
15:19ChousukeMatcher seems like it's unnecessarily mutable :/
15:19Chouserfortunately we have re-seq
15:19Anniepooand totally fail to understand why regex libraries don't just implement the
15:19ChousukeI mean, is creating a new matcher really that expensive? :)
15:19Anniepooemacs/qed/whatever
15:20Anniepoogs/regex/replacement/
15:20Anniepoocommand
15:20rlbChousuke: it may be building DFA, so it could be non-trivial.
15:20rlb(I imagine it is building something like that...)
15:20Chousukerlb: shouldn't that happen when the pattern is compiled, not when it's matched against a string?
15:20rlbs/building DFA/building a DFA/
15:20rlbChousuke: oh, I misunderstood.
15:20Anniepoothe speedup is important if you're using one to find something in the middle of a huge string
15:21rlbChousuke: right -- I would think it was built when the regular expression was created, i.e. at #"foo" time.
15:21ChousukeI read yesterday that you don't actually have to quote parens in emacs regexps, because they're matched against so often.
15:21Anniepooyes, matchers are resettable - they aren't truly seq's
15:22rlbChousuke: right
15:22Chousukeif you want matching groups, THEN you quote the parens.
15:22ChouserAnniepoo: contrib str-utils2 has global search/replace. quite handy.
15:22Chousukewhich is amusing.
15:22rlbChousuke: emacs inverts that.
15:22Chouserwhich is old-school. like sed
15:23Chouserinstead you have to escape groups. and you have to escape the escaping, I beieve, so you end up with "\\\(this\|that\\\)"
15:23Chouseroops
15:23Chouserinstead you have to escape groups. and you have to escape the escaping, I beieve, so you end up with "\\\(this\\|that\\\)"
15:23Chouseror something. anyway, it's painful whatever it is.
15:24rlbChouser: exactly how it depends on whether you're typing in source code, or issuing an interactive expression, i.e. M-x search-regexp, etc.
15:24Chouserah, ok.
15:27rlb(...surprised I'm messing with rss, and also surprised how easy clojure's making it...)
15:31Anniepoofwiw, if you're on winders, the direct winders version is far saner than X or console cygwin versions
15:32Anniepooit's even got a toolbar! 8cD
15:36tomojI always turn that off anyway :)
15:39Anniepooyah, we all do, but it's nice they're not doing the passive-aggressive unix "cross platform == the unix way" thing
15:39Anniepoo(they did ship the windows release with unix line endings)
15:41rlbSo does anyone happen to know if java has a built in table mapping common mime types to file-extensions, i.e. audio/mpeg -> .mp3?
15:42Anniepooyou mean in the core libs? there's probably one in the JAI or Java media libs, but getting to it sounds like a trail of tears
15:43rlbI just didn't know if there was something obvious. In any case, for now I'm fine with just hard-coding a small lookup table.
15:43rlb(and using the last 4 url chars if they match #"\..{3}" (thanks Chouser)
15:43rlb)
15:44Anniepooyou could slurp the RFC off the net and use regex's to extract the information
15:44Anniepoothen if they change the RFC you'd still be right 8cD
15:45rlbNow I just need a (dump-url-to filename)...
15:46tomojduck-streams?
15:47rlbtomoj: not familiar -- I'll have to look.
15:47osaunders(defn factors [n]
15:47osaunders (filter #(zero? (rem n %)) (range n 1 -1)))
15:48osaundersDoes that look OK?
15:48osaundersMore specifically, is it all lazy?
15:49Anniepooyes, but you can apply an increment to range
15:49osaundersI am, -1.
15:49Anniepoorlb, you might find fetch-url on this page useful
15:49Anniepoohttp://gnuvince.wordpress.com/2008/10/31/fetching-web-comics-with-clojure-part-1/
15:50rlbAnniepoo: right, thanks, I was looking at that.
15:50Anniepoothat should move to clojure.contrib somewhere - this is the third time somebody's asked for it in my memory
15:50tomojdoesn't duckstreams fetch urls?
15:51Anniepooreally hate that everything left google code
15:52tomoj(with-open [file (reader "http://www.google.com/&quot;)] (slurp file))
15:52rlbtomoj: it looksl like it.
15:52rlbtomoj: and it has copy -- it looks like it might be exactly what I wanted.
15:52tomojoh.. slurp is wrong there
15:53rlb(with-open [in ... out ...] (copy in out)) etc.
15:53tomojcool
15:53Anniepoo(slurp "http://www.foo.com&quot;) definitely won't work
15:53rlbAnniepoo: you have to have the (reader ...) bit.
15:53Anniepoosure
15:54Anniepoobut it seems unclojurelike
15:54Anniepoowhy shouldn't it just be smart and do the right thing?
15:55Anniepooarguably, there's no point in file IO any more, since files are URL's
15:55rlbThis is really too easy...
15:55AnniepooLOL
15:55rlb(not that I'm complaining, mind you)
15:56tomojoh you can just slurp* the url
15:56tomojwell, if you want to read it instead of copying it I mean
15:56rlbOK, so now I just need some way to insert a progress meter into the stream ;>
15:56Anniepoolovely, that's exactly what's wanted
15:56rlbThough I suppose I can just monitor the file size.
15:57rlbJust set up an agent/thread/whatever.
15:57rlbAnd for the first pass, we'll just pretend like people don't actually care about knowing what's going on.
15:59rlbAnyway, fwiw, what I'm working on is a clojure version of something like hpodder or podget, but one that may be simpler, but is at least more flexible about retention policies, i.e. keep the last N copies of this, but all of this, etc. For example, you might use it to maintain some podcast/news-stream/whatever dirs for mpd from cron.
16:00rlb(at least that's what *I* may use it for)
16:00tomojrlb: what's the interface like?
16:00rlbtomoj: command-line only ATM.
16:00tomojgreat
16:00rlbtomoj: and intentionally simple
16:00tomojI love things that are command-line only
16:00Anniepoohaptic feedback only
16:01tomojhmm.. I wonder if there is java stuff for ncurses
16:01rlbi.e. perhaps "foo rss-update --keep 10 http://....&quot;
16:01rlbi.e. perhaps "foo rss-update --keep 10 --dest some-dir http://....&quot;
16:01rlbnot sure yet
16:02rlbJust got a decent start in under 100 lines of code, though...
16:02AnniepooWhen I get there I want to wrap ImageMagick (a command line image processor, also available as libs) with a clojure binding
16:03rlbAnniepoo: I just heard a long claim that graphicsmagick is much "better" for some definition of better FWIW (no idea myself).
16:03Anniepoolol
16:04tomojthe only thing I know is that rmagick sucks
16:04Anniepooit's a classic old feud between two halves of what was once one OS dev team
16:05rlbYeah, I think the intro quote I saw was this: "ImageMagick uses convoluted and arcane code paths in an apparent attempt to defeat human comprehension""ImageMagick uses convoluted and arcane code paths in an apparent attempt to defeat human comprehension".
16:06Anniepoohttp://www.linux.com/archive/articles/59223
16:06rlbI think it's in some graphicsmagic performance comparison (again, no idea myself).
16:06Anniepooyah, per this GM concentrates on library support, IM concentrates on cmd line usage
16:11AnniepooThe IM syntax is painful, and I'm going to be a heavy user of it over the next 6-12 months, so
16:11Anniepooa wrapper would be a convenience
16:12osaundersIt seems like loop is just fn and let combined but it's a special form.
16:12osaundersWhy is it a special form? There must be something significant about it.
16:15kotarakosaunders: because it creates a recursion point for recur
16:16osaundersfn does that too.
16:16kotarakbut fn does create a class, loop does not
16:16osaundersfn creates a class? A java class?
16:16kotarakyes
16:16osaundersWhy?
16:17kotarakeach fn generates a class, which is instantiated on runtime.
16:17rlbOK, that didn't work at all -- resulting .mp3 is not right (much longer than it should be).
16:17osaunderskotarak: Why is that something you would want to use loop in order to avoid?
16:19osaundersDoes loop exist in other Lisps?
16:19kotarakosaunders: because you then have to instantiate the class, invoke some method on it, etc. while loop just works in the same call stack.
16:19tomojosaunders: not in the same form
16:19kotarakosaunders: yes, but in different form
16:20osaundersDoesn't recur avoid use of call stack anyway?
16:20tomojstuff like: (loop for i from 1 to 5 collecting i) => (1 2 3 4 5)
16:21kotarakosaunders: but the initial entry would require it. And the calling would be awkward: ((fn [a b c] .... (recur x y z)) :initial-a :initial-b :initial-c)
16:21tomojkotarak: how often do you have to instantiate the class?
16:21kotaraktomoj: when you create a function.
16:21osaunderskotarak: Hardly warrants a special form.
16:21tomojah, ok
16:22kotarakosaunders: you don't have to use it.
16:22rlbSo any idea why "wget URL" would get the right content, but duck-stream (copy (reader URL) (writer "filename")) would get something much longer, that's not a proper mp3?
16:22tomojosaunders: so how would you do (loop [a (range 10) b (range 10)] [a b]) ?
16:22rlbIs there some "binary mode" business perhaps?
16:22kotarak((fn [a b] [a b]) (range 10) (range 10))
16:22kotarakNot very nice.
16:23tomojthat's not the same thing
16:23tomojoh, yes it is
16:23tomojI was thinking of "for"
16:25osaundersloop could be implemented as a macro.
16:25osaundersFrom what I've been told so far.
16:25Chousukemaybe loop is a special form because it supports primitives :/
16:25kotarakosaunders: obviously not, since you don't get the recursion point for recur
16:26osaundersYou can recur on a fn.
16:26osaundersCan't you?
16:26Chousukefn arguments are always boxed though.
16:27Chousukeand you'd have to create a class for every loop
16:27kotarakosaunders: I would prefer not to hide things, which generate classes
16:28osaundersIs this right? (fn [y] (let [x y] (recur)) == (loop [x y] (recur))
16:28kotarakno
16:28kotarak(loop [x] (let [x y] (recur))
16:29kotarakoops
16:29kotarakfirst x should b y
16:29kotarakbe
16:29osaundersThat could be simplified to (loop [x y] (recur))
16:30osaundersLoop does binding.
16:30kotarakosaunders: then it doesn't correspond to the fn you gave
16:30osaundersclojure.org/special_forms says: "loop is exactly like let, except that it establishes a recursion point at the top of the loop"
16:30kotarak(fn [y] (recur))
16:31osaundersWait a second.
16:32osaunders((fn [x] (recur)) y)
16:32osaundersYeah I think that's what I want.
16:32osaundersSo I'm saying now: ((fn [x] (recur)) y) == (loop [x y] (recur))
16:33kotarakEffectively, yes but not really.
16:33osaundersApart from the class thing/
16:33osaunders*?
16:33kotarakAs Chousuke said above: fn does not work with primitives
16:33kotarak(it does work, but boxing happens => slow)
16:34osaundersCould you explain that.
16:34osaundersWhat's a primitive and boxing?
16:34tomojalso the fn version is ugly :)
16:34tomojuh, but macro, yeah
16:34Chousukejava has two kinds of variables. primitives, and references
16:34kotarakJava has primitives and corresponding clases. A primitive is a value, but not an object.
16:34kotarak5
16:34Chousukeint, char, long etc. are primitives.
16:34kotarakboxing means wrapping this values into class objects.
16:35kotarakSince all invokation interfaces are based on objects you can't pass in primitives.
16:35kotarakThey have to be boxed.
16:36osaundersSo loop exists for performance reasons only,
16:36Chousukethat, and to avoid generating useless classes
16:36kotarakexactly
16:36osaundersKinda wanky.
16:36osaundersSorry, I'm not used to JVM languages.
16:37osaundersWhy does fn need to generate a class rather than just an instance of a class?
16:37kotarakosaunders: theoretical elegance is sacrificed if necessary in Clojure. It has a very practical point of view.
16:38osaunderskotarak: But it's not necessary.
16:38Chousukeosaunders: how would you have different code for each instance of the class?
16:38Chousukethe java system is not designed for that.
16:38osaundersWell code is data :-P
16:38kotarakplus the closed over values
16:39Chousukeosaunders: in clojure, yeah, but eventually it needs to be compiled to jvm bytecode.
16:39osaundersLame
16:39Chousukeyou're being unnecessarily negative about it :P
16:39osaundersWell, that's subjective.
16:40osaundersThanks for all the info though.
16:40Chousukeand you can actually have multiple instances of the same function (== class)
16:40Chousukefor example, if you have a function that returns a lambda, then there will only be one class for the lambda, but new instances for each call of the factory function.
16:40osaundersYou can have multiple copies of an object too.
16:41osaundersBut we're arguing now.
16:41Chousukeand those instances will have different instance attributes.
16:41Chousukethey won't be copies of each other.
16:41tomojwhy do you care whether it's a special form or macro anyway?
16:41Chousukefn actually is a macro :D
16:41Chousuke(the special form is fn*)
16:42Chousukeand even that might go away
16:42tomojI meant loop
16:42Chousukesince apparently it should be possible to implement fn* with newnew
16:43osaundersIt's hard for me to explain why I care.
16:43osaundersBut this kind of low level elegance or absence of is important in language design.
16:43kotarakosaunders: try, we are patient. :)
16:44Chousukeosaunders: true, but clojure is already very elegant.
16:44osaundersI think it's probably best articulated in Paul Graham's Hundred Year Language essay.
16:44Chousukeosaunders: loop is just a practical choice to solve a problem.
16:45Chousukeif a better solution comes up, loop may well become a macro in the future.
16:45Chousukebut for now, it's a special form
16:45kotarakAs I said: Clojure has a very practical point of view.
16:45osaundersChousuke: loop was created to workaround a problem that in other situations wouldn't exist at all.
16:45Chousukeosaunders: what other situations?
16:46osaundersIf Clojure wasn't implemented on top of the JVM.
16:46tomojthat would be terrible
16:46kotarakChousuke: no autoboxing and TCO support
16:46osaunderstomoj: Why?
16:46Chousukeosaunders: but if Clojure weren't implemented on top of the JVM it would be pointless :)
16:46tomojJVM is part of the whole point imo
16:46Chousukeosaunders: see arc :P
16:46tomojaccess to java libraries is _awesome_
16:46tomojbad libraries are a big problem for a custom lisp
16:47osaundersChousuke: I haven't looked at Arc.
16:47osaundersI think you guys may well be right.
16:48Chousukein the end, programming languages are nothing but tools
16:48osaundersThe cost of needing things like loop is greatly dwarfed by the benefits of being on the JVM.
16:48tomojI think clojure would be nowhere close to where it is today without java
16:48Chousukeusing the JVM as a basis was a practical decision that ensured Clojure has value as a tool.
16:48osaundersChousuke: No, programming languages are more than tools. They are a means of expression.
16:48Chousukeosaunders: but before that, they are tools.
16:48Chousukethe elegance in the implementation comes AFTER that.
16:49osaundersWell it depends how you look at it.
16:49osaundersIf you want something that does a job, then it's a tool.
16:49ChousukeI see Clojure as a rather succesfull attempt to bring elegance to the JVM.
16:50Chousukesure there are warts. but no language is without them
16:50osaundersIf you want something that provides a nice way of thinking and expressing problems/computation then it's a language.
16:50kotarakThat does not depend on the ugliness under the hood...
16:50osaundersYes, and so far Clojure has far fewer warts than any language I've encountered.
16:50osaunderskotarak: I don't agree.
16:51tomoja programming language that is a great means of expression but a useless tool will have few users
16:51ChousukeAnd hopefully Clojure will become popular and drive the JVM to improve as well!
16:51osaunderstomoj: Sure.
16:51osaundersI'm being impractical, granted. Maybe I'm an idealist.
16:52tomojlike, how many people without PhD's ever _use_ the lambda calculus?
16:52AnniepooI'm totally disinterested in learning a toy language. I need to get real work done.
16:53AnniepooI started looking at Clojure and was blown away that the first tutorial I found
16:53osaundersIf you want to get stuff done why bother learning Clojure at all. Java will do all this stuff anyway.
16:53ChousukeClojure is interesting in that it's almost as attractive as the neatest of the toy languages, while maintaining a lot of the practicality.
16:53Chousukeof non-toy languages, that is.
16:53osaundersChousuke: Right. Clojure is a great balance.
16:53kotarakosaunders: turing tar pit alert....
16:53Anniepooosaunders, you are wrong
16:54Anniepoofact - I got interested in Clojure
16:54osaundersIt is despite your arguments very elegant.
16:54osaunders(Clojure)
16:54Chousukeosaunders: java will do it, but you're going to rip your hair out making java do it :P
16:54AnniepooI needed to write a Swing GUI
16:54Anniepooshort time frame
16:54tomojwhy use Java? assembly will do it.
16:55Anniepoofeeling it'd be professionally irresponsible to do it in 'my new toy', I started writing in Java
16:55AnniepooI get into it a ways, see I'll never make it
16:55kotarakWhy assembly? We can wrote down 0s and 1s directly! (turing tar pit alert...)
16:55AnniepooIn desperation, I switch to Clojure
16:56AnniepooI'm late 1 week finishing, abotu the same amount I spent on the failed Java attempt
16:56osaundersAll I'm saying is that language elegance is important. For the same reason why Clojure is a better language than Java. There's a balance. For all of you Clojure is it. Clojure is elegant enough and practical enough. Chousuke said it. All I'm trying to highlight is there are these places where Clojure's elegance is held back by the practicalities you celebrate. I don't mean to suggest that makes Clojure a bad language.
16:56Chousukeosaunders: I think we all agree on that.
16:57osaundersChousuke: Yeah I think we do :-)
16:57ChousukeIf you can think of *practical* ways to make Clojure more elegant, I'm sure everyone will want to hear it!
16:57AnniepooI describe Clojure to other (mostly java) programmers I know as "the lisp guys finally grew up"
16:58osaundersChousuke: I'm always on the look out. So far, so good though.
17:00osaundersUnfortunately in order for me to find these places where the practicality over elegance compromise has been made I have to dig a bit before I can definitely say that elegance has been compromised. Before I started asking about loop I was expecting there to be a reason of elegance behind it's existence. That digging combined with the identification of that compromise seems to piss people off a bit. Which is a shame. I don't mean to do that.
17:00JAS415lisp guys never grow up
17:01osaundersJAS415: Mostly I find people don't grow up. I include myself.
17:01JAS415true
17:04AnniepooI grew up once. Fortunately, I got over it
17:05osaundersAnniepoo: lolz
17:05osaundersHeard of Peter Pans?
17:07Anniepoowell, I was a typical programmer
17:07osaundershttp://www.cbc.ca/canada/story/2008/05/21/f-vp-handler.html
17:07Anniepooabout 2000 I burnt out badly
17:07Anniepoodrove a cab for two years
17:07Anniepoonow I do interesting programming
17:08osaundersGood for you.
17:08Anniepooif it's not interesting I still have an A card
17:08osaundersI'm fairly dissatisfied with the software development industry myself.
17:08osaundersAlthough more with myself.
17:08Anniepoocool
17:10AnniepooI work in Second Life, writing Clojure to support learning in Virtual Worlds
17:10AnniepooI make less than a bus driver
17:10Anniepoo8cD
17:11osaundersWhat a strange world we live in.
17:11AnniepooI don't care that I don't make a lot - I spend most of my waking hours in a virtual world anyway
17:11tomojyou can write clojure in SL?
17:11rlbA key point for loop is exactly that (TCO) -- otherwise you can't recurse without exploding the stack.
17:11osaundersI don't really know much about Second Life.
17:11rlb(in java)
17:12Anniepoono, you have to write the in world stuff in LSL, but it's like javascript and the web
17:12rlbs/without exploding/without risking exploding/
17:12Anniepooyou get out of that world as fast as you can
17:12rlbAnd scheme has a similar syntax (let loop bindings form+)
17:12tomojI know someone else who works in SL
17:13Anniepooyah? Not too many of us
17:13tomojI think for a dept at my university
17:13rlbThough scheme *really* doesn't need it since it guarantees TCO.
17:13Anniepooah, cool
17:13AnniepooI work for U of Houston
17:13technomancyIs there a reason map and filter and friends need a clojure.lang.IFn while alter just needs a Callable?
17:14AnniepooIf I give you a key to the UH-HHP builder bot you could use Clojure to manipulate SL
17:15AnniepooI'm finishing up the bridge now
17:15tomojso you do it by writing bots in clojure?
17:16AnniepooI have a command line driven bot I wrote in C#
17:16kotaraktechnomancy: alter takes a IFn in my version...
17:16Anniepooand an in-world prim making robot that acts as an HTTP server
17:17Anniepooand clojure code that has my business logic
17:17Anniepooand a clojure GUI desktop app, so I can draw out what I want to make without doing it one prim at a time
17:17Anniepoocause I make a lot of repetitive stuff
17:17tomojnice
17:18Anniepoothe C# bot uploads resources like textures
17:18Anniepoofor example, I make these stepped 'concept plates'
17:18technomancykotarak: you're right. oddly enough you can use JRuby procs with alter though.
17:18technomancybut not with map
17:19Anniepooreports back the SL internal UUID
17:19Anniepooand then the clojure code uses that to order the bot to make something and texture it
17:22rlbSo any thoughts about why "wget URL" would get something different from (copy (reader URL) (writer FILENAME))?
17:23tomojrlb: encoding problems? dunno
17:24rlbYeah, it's looking like it.
17:26Anniepooanybody know, if I start a command in the minibuffer in emacs and want to abort, how I do it?
17:26dnolenC-g C-g, ESC ESC
17:26dnolenbut you have to be in the minibuffer I believe
17:26Anniepoothanks
17:27Anniepoono, I mean I start to type C-c C-f som ... oops, didn't want to do that
17:27rlbC-g should nearly always "get you out" of whatever's going on in emacs.
17:28Anniepoothanks
17:30Anniepooemacs is still the horror I left behind back when phones had cords
17:30tomojjust takes a bit of getting used to :)
17:31Anniepoomoving a block of code with the mark commands is NOT as convenient as drag and drop
17:31rlbAnniepoo: it is if you don't want to reach for the mouse ;>
17:32rlbAnniepoo: also newer emacs may support what you want.
17:32rlbNot sure.
17:33Anniepoono drag and drop, but there's cut copy paste on the winders version
17:33rlbAlso I find C-space C-s M-w pretty good much of the time.
17:33AnniepooI'm just totally in suspicious of the dog that bit me mode
17:33rlbi.e. mark, incremental search to other end, then copy (or cut).
17:34rlbC-r if you need to go backwards
17:34AnniepooC-space?
17:34technomancyback when I thought PHP was awesome. =)
17:34rlbAnniepoo: sets the mark
17:34rlbi.e. start the block
17:35rlbsame as C-@ I think
17:35rlb(but much easier to type)
17:36rlbAlso some of the new bits in emacs 23 are quite interesting (IMO). "emacs --daemon", for example.
17:39technomancyI wonder why alter would accept a JRuby proc as an IFn but map would not.
17:39technomancystrange
17:39Anniepoois there something like IntelliJ's ctrl-] ? (which extends the selection to the next node up in the parse tree of the current language)
17:39technomancyah... aliasing call to invoke in Proc fixes it
17:40technomancyoops, never mind
17:40rlbAnniepoo: I think clojure-mode probably allows the normal emacs code traversal commands.
17:41rlbAnniepoo: I don't know if you can use something like ebrowse with clojure.
17:41Anniepoohappy happy joy juy
17:42Anniepoog/juy/s//joy/p
17:42Anniepoo(see, still remembers QED, with horror)
17:43rlbAnniepoo: see "editing programs" in the emacs info pages.
17:44Anniepoothanks
17:44AnniepooI'm going to spend today reading all the emacs docs and I'm making flash cards
17:44Anniepoo8cD
17:45Anniepoomaybe I'll make a moodle course for editing Clojure in emacs when I'm done
17:46rlbAnniepoo: there's also slime, which people seem to like, though I haven't really looked in to it yet. I still do things the hard way most of the time.
17:47Anniepoook, so when I get through with basic emacs learning, my choices are slime or soemthing called 'clojure mode'?
17:49tomojslime is good _with_ clojure mode
17:51tomojyou can compile clojure source files and then play with the results in the slime repl
17:51tomojAnniepoo: http://technomancy.us/126 is a good start
17:51rlbAnniepoo: clojure-mode.clj is what makes it so that when you open a file ending in .clj, the major mode switches to clojure-mode, and then emacs knows specifically about clojure syntax, etc.
17:53bitbcktAnniepoo: also from technomancy is http://github.com/technomancy/emacs-starter-kit
17:54bitbcktAnniepoo: install that and M-x clojure-install will get you up and running with SLIME + clojure
17:54tomojexcept I think you have to install slime beforehand separately, right?
17:54bitbckttomoj: No.
17:54tomojnice :)
17:54bitbcktQuite. :-)
17:57Anniepoook, hang on folks
17:57osaundersWhat's the difference between = and ==?
17:57Anniepooso is there someplace special I should git technomancy's emacs starter kit to?
17:58bitbcktAnniepoo: ~/.emacs.d
17:58Chousukeosaunders: == is for comparing numbers. it's faster.
17:58Anniepoowinders
17:59bitbcktUhm... C:\Documents and Settings\<user>\Application Data\...
17:59bitbcktsomething
17:59osaundersIs == Java == and = Java .equal()?
17:59Chousukeosaunders: no :/
17:59Chousukeosaunders: identical? is java ==
17:59Chousuke== maps to a special method in clojure.lang.Numbers or something
17:59osaundersOh OK.
18:00bitbcktAnniepoo: http://www.gnu.org/software/emacs/windows/Installing-Emacs.html
18:00bitbcktSection 3.5
18:00Chousukethat fft person on the forums is getting obnoxious. ;/
18:00Chousukeon the group, rather :P
18:01bitbcktThe P.S. really makes it.
18:01Chousukehe's started cc'ing people because he thinks Chouser is censoring his posts. :(
18:02ChousukeAnd you know, I'm starting to think he should be censored.
18:02osaundersIs this the Clojure group you're talking about?
18:04bitbcktosaunders: Yes.
18:04osaundersWhat is he saying?
18:04Chousukehe's got something against Rich for saying in his talks that Clojure is fast.
18:05Chouseroh, please please don't copy his statements here. They're on the group if you want to read them.
18:05Anniepoo <bitbckt> Anniepoo: install that and M-x clojure-install will get you up and running with SLIME + clojure
18:05osaundersOK.
18:05bitbcktAnniepoo: ?
18:05Chouserjust search for fft, you'll find all of it.
18:05Anniepoothat's not working
18:05bitbcktExplain.
18:05ChousukeHe's not being very friendly about it, so apparently Chouser censored some of his posts, and now he thinks the mods are out to suppress him. ;/
18:05AnniepooM-x clojure-install says [no match]
18:06bitbckttinfoil hat types are endlessly amusing, to me
18:06Chousukebut now he's spamming my inbox.
18:06Chousukeand I do not appreciate that.
18:06bitbcktAnniepoo: Then it probably didn't load the init.el properly
18:06bitbcktWhere did you extract the starter kit?
18:07AnniepooC:\Documents and Settings\Annie\Application Data\.emacs.d
18:07Anniepoobut in .emacs.d I now have auto-save-list and emacs-starter-kit directories
18:07rlbHmm, I think I need to learn more about java network operations -- using an explicit urlconnection via url.openconnection, etc. works fine. duck-streams don't. I assume it's probably a text/html vs binary issue.
18:08Anniepoothe starter kit dir has .git, elpa, and elpa-to-submit
18:08bitbcktAnniepoo: You need the emacs-starter-key to *be* your .emacs.d
18:08bitbcktNot be within it.
18:08bitbckts/key/kit/
18:17Anniepoook, got it to install
18:18osaundersReadline support for the REPL would be really nice.
18:19tomojuse slime :P
18:19tomojor I think you can do something with JLine
18:19Anniepoosliming away here
18:19bitbcktAnniepoo: :-)
18:19tomojAnniepoo: you may need to tweak your paredit
18:20osaunderstomoj: OK, thanks.
18:20Anniepoook, before tweaking anything need to get some stuff installed and figure out what I'm doing
18:20tomojmine didn't have bindings for paredit-wrap-square or paredit-wrap-curly
18:21Anniepooah, OK
18:21tomojlearning paredit would probably be a good idea sometime too
18:21tomojhttp://mumble.net/~campbell/emacs/paredit.html
18:21rlbexec java -cp /usr/share/java/jline-0.9.94.jar:/usr/share/java/clojure.jar:/usr/share/java/asm3-commons.jar:/usr/share/java/asm3.jar jline.ConsoleRunner clojure.lang.Repl ...
18:22rlbi.e. in a #!/bin/bash script
18:22Anniepoook, lunch, then all this
18:22tomojwhat's the asm stuff for?
18:23rlband you probably want "$@" instead of ...
18:23rlbtomoj: not sure -- I was under the impression that clojure needed that for compilation
18:23tomojah
18:23rlbI just copied that from the debian /usr/bin/clojure-repl (which doesn't use jline)
18:23tomojI haven't tried any advanced stuff yet
18:24tomojyou mean like AOT complation?
18:24rlbnot sure
18:34Chousukeheh
18:34rlbGot it. The problem was that duck-stream (copy in out) doesn't do a binary copy if "in" is a reader. So instead of (reader url) you have to manually create the InputStream, i.e. (.openStream (URL. url)).
18:34ChousukeI guess they should be called seq comprehensions in clojure :P
18:35rlbI think it was doing a Character/TYPE copy -- not quite what I wanted.
18:35mebaran151I always thought the for macro was a little too heavy weight
18:35osaundersChousuke: *shrug*
18:35mebaran151I prefer to map filter and reduce my way to fame and fortune
18:35Chousukemebaran151: you mean the implementation or the usage of it?
18:36mebaran151a little of both
18:36Chousukebecause the implementation is something unbeliveable :P
18:36mebaran151the macro has a little too much magic in it
18:36tomojI have this idea that it's idiomatic to have a function foo which reduces with a function foo*. true or false?
18:36tomojdon't know where I got that idea
18:36Chousukemebaran151: all sufficiently complex macros have a lot of magic in them.
18:36mebaran151foo* is usually like a reduce private version of the function
18:36tomojgreat, that's what I thought
18:36Chousukemebaran151: the point is, it's done for you already so you don't have to do it yourself :)
18:36mebaran151that's why avoid sufficiently complex macros, especially when something like filter map and reduce are pretty good
18:37mebaran151I don't think for makes my code any clearer than a sequence of mappings and filterings
18:37osaundersWhere is str-join defined?
18:37ChousukeI mean, for *works*, there's little doubt of that.
18:37tomojosaunders: clojure.contrib.str-utils
18:38osaundersOK. I think I need to read about libs now.
18:38tomojit's a fairly simple function
18:38Chousukemebaran151: the (IMO) best answer to the clojure golf on the group uses for, though :P
18:39mebaran151but debugging a magical macro can get irksome very quickly
18:39Chousukeyeah but you don't need to debug for :P
18:39tomoj(apply str (interpose \, seq))
18:39Chousukeit's done and debugged already.
18:39mebaran151I meant things you do in for
18:39mebaran151macros obscure the logic
18:40Chousuke... at least until someone goes and adds chunked seq support for it.
18:40Chousukehmm, I guess.
18:40rlbOK, I need to stop this and go work on emacs23 or similar... Thanks all.
18:40mebaran151what are chunked seqs?
18:41Chousukemebaran151: a recent improvement by Rich that allows you to take advantage of the internal structure of some of the persistent data structures (vectors and maps I guess)
18:42tomojjust found a pdf about them http://clojure.googlegroups.com/web/chunks.pdf?gda=WIF8ADwAAAC-wnUK1KQ919yJcmM1ACuZUsYXlXWR5Y8qvjzEXQCX1uwyCdwt79_BXi8-B36MGsn9Wm-ajmzVoAFUlE7c_fAt
18:43ChousukeI guess chunked seqs are mostly hidden inside the seq functions.
18:43mebaran151so wouldn't for automagically use them?
18:43mebaran151because it just expands to a bunch of map and filters right?
18:43Chousuke~def for
18:43Chousukeah, damn
18:43Chousukebut no, for doesn't expand to a bunch of maps and filters :)
18:44osaundersNested recursive loops.
18:45osaundersAt a guess.
18:45mebaran151it seems like you could do much of it using a bunch of map and filter though
18:45Chousukewell, hm.
18:45mebaran151though I've never really explored for in detail enough
18:46AnniepooWhen it's done, it will configure SLIME and swank-clojure, and it will give you instructions on a few lines to add to your personal config (usually found in $HOME/.emacs.d/init.el) so it will work for future sessions.
18:46osaundersAs soon as you have more than one sequence in for you're doing more than map can do.
18:46Anniepoo8cI got no instructions
18:46osaunders(I think)
18:46mebaran151map can take multiple seqs if I remember correctly
18:46osaundersYeah but they don't work in the same way at all.
18:46osaunders,(map + [1 2 3] [1 2 3])
18:46lisppaste8tomoj pasted "mexpanded for" at http://paste.lisp.org/display/85460
18:47osaundersWhere's clojurebot?
18:47Anniepooand M-x slime => [no match]
18:47mebaran151osaunders, that does exactly what I would expect
18:47Anniepooclojurebot got roaring drunk at a bar and went home with an Alice based chatterbot
18:47mebaran151later they cybered
18:48mebaran151osaunders, it returns '(2 4 6)
18:48osaundersmebaran151: Now compare with (doall (for [x [1 2 3], y [1 2 3]] (+ x y)))
18:48osaundersmebaran151: To see what's going on: (doall (for [x my-list, y my-list] [x y]))
18:48Anniepoo(purred she (str "Oooh!" (fully (functional you))))
18:49Chousukemebaran151: but with for you can do (for [x [1 2 3] y [1 2 3] :when (= 5 (+ x y))] [x y])
18:49mebaran151I see
18:49Chousukegives you ([2 3] [3 2])
18:49mebaran151it does a cartesian product
18:49osaundersChousuke: Nice.
18:49tomojyou'd need contrib's combinatorics to easily get away without for, huh?
18:50Chousukemebaran151: with :when, yes.
18:50Chousukemebaran151: there's also :while for stopping early
18:50Chousukeand :let for binding arbitrary stuff in the expression
18:50Chousukeit's very powerful
18:50mebaran151the stopping early is the one thing that you probably couldn't do with map and reduce
18:50osaundersfor reads the keyword?
18:50mebaran151but you could easily get the combinations with reduce
18:50osaunderss/reads/checks/
18:51Chousukemebaran151: reduce is not lazy though ./
18:51Chousukeosaunders: yeah. the keywords are part of for's syntax
18:51mebaran151oh
18:51mebaran151I didn't think of that
18:51mebaran151I should appreciate for more
18:51osaunderslol
18:51osaundersSounds like you do already.
18:51mebaran151but I gotta admit, there's a lot of magic going on
18:51Chousukeyeah.
18:51mebaran151and I'm suspicious of any macro that I couldn't sketch out myself
18:52Chousukethen again, even in plain lets and defns there is a lot of magic going on.
18:52osaundersAre list comprehensions a math thing?
18:52Chousukeever checked out the destructure function?
18:52mebaran151I also try to avoid destructuring :)
18:52osaundersI mean did they originate in math?
18:52mebaran151though I just started using it, and I got admit
18:52Chousukewhy? it's great.
18:52tomojfor was pretty useful to me for finding pythagorean triples
18:52mebaran151it's very convenient
18:52osaundersChousuke: What does it do?
18:53mebaran151sure beats firsting and seconding everything
18:53Anniepoohhmmm....
18:53Chousukeosaunders: the destructure function is what the destructuring macros use to... destructure their argument forms :P
18:54osaundersI'm not even close to understanding how macros work.
18:54Chousukeosaunders: eg, with (let [[x y z] triple] ...) the destructure function is what transforms the [[x y z] triple] into something like [x (nth 0 triple) y (nth 1 triple) z (nth 2 triple)]
18:54mebaran151yeah
18:55Chousukeosaunders: they take in clojure code, do arbitrary transformation with it, and the result is what gets executed.
18:55mebaran151I do a lot of packing things into vector tuples
18:55Chousukeremember, clojure code is just a data structure
18:55mebaran151so destructing is actually a very convenient way
18:55tomojyeah, I do that too
18:55mebaran151to get at those things
18:55mebaran151but I just as often use (first x) (second x) etc
18:55tomojwith the value reduce carries around
18:56osaundersIs destructure a representative name to what it does?
18:56osaundersSeems to be a kind of map from what you've told me so far.
18:57Chousukeosaunders: well, it's not a public function. but it's the magic behind clojure's destructuring :)
18:57tomojit's called destructuring in other languages too
18:57osaundersOK, what is destructuring in general then?
18:57tomojlike a,b = [7,3] in ruby
18:57tomojexcept it's more flexible in clojure
18:58osaundersOh OK.
18:58osaundersAnything in common with pattern matching?
18:58tomojit nests arbitrarily deeply
18:58Chousukeosaunders: the primitive let* special form can only handle bindings in the form [a 1 b 2 c 3 ...]. destructure is used in the let macro to transform the complicated binding vector into the simple sequential form
18:59tomojosaunders: http://clojure.blip.tv/
18:59tomojthe two on data structures are good
18:59rlbosaunders: somewhat related to pattern matching, I'd say, yes.
18:59tomojhaven't gotten to the rest yet
19:00mebaran151list comprehensions were originally a python thing right?
19:00Chousukeprobably not :P
19:00osaundersI know them from Haskell.
19:00Chousukethough I wonder which language had them first.
19:00osaundersI was asking if they came from Mathematics because most stuff in Haskell does.
19:00Chousukebut if your language is less than 50 years old, chances are it wasn't the first at anything.
19:00tomojwikipedia says ones I've never heard of
19:01tomojSETL, AXIOM, NPL
19:01mebaran151the wiki says it's based on set-builder notation
19:02Chousukeheh.
19:02Anniepoo8cX how do I know I'm in clojsure mode?
19:02Chousukeset comprehension for clojure: (set (for ...)) :P
19:02mebaran151I always wished sql worked more like that
19:02mebaran151I actually finished my little library for using bdb like a giant lazy list
19:02tomojAnniepoo: it should say "Clojure" on the mode line
19:02mebaran151that fetches records in a variable chunksize
19:02tomojthough in slime it won't
19:03mebaran151it's been really convenient for just running a filter and then asking for a take on it
19:03osaundersmebaran151: You can say SELECT * FROM table1, table2 WHERE table1id = table2id
19:03mebaran151it never felt natural
19:03mebaran151especially for mapping
19:03osaundersInstead of LEFT JOIN
19:04mebaran151try to get sql to match where colb is 4*col a
19:04mebaran151or something like that
19:04osaunderscolb?
19:04osaundersColumn?
19:04mebaran151yeah
19:04mebaran151where the value in col b is 4 times the value of col a
19:04mebaran151it's doable
19:04mebaran151but it's nasty
19:05osaundersWHERE 4 * a = b?
19:05mebaran151and sometimes the sql engine will forgo optimizing this sort of query with an index
19:05mebaran151on a join?
19:05ChousukeI think I'll take thetime to learn paredit mode
19:05ChousukeI tried using it in slime and it was pretty nice
19:06osaundersI dunno really. I'm no SQL expert. SQL isn't a very nice language. It's barely a language at all in fact.
19:06mebaran151yeah, I had to do some DBA
19:06mebaran151and it's nasty
19:06Chousukethough it was somewhat difficult to tell which s-expr I was editing at which time because of all the closing parens :P
19:06osaundersI consider SQL to be a user inferface not a language.
19:06replacaChousuke: paredit is awesome. Makes emacs feel like a structure editor
19:06osaundersSQI, if you like.
19:06mebaran151I have a layer on top of berkeleydb that lets me lazily evaulate a collection of bdb's and treat them as a table
19:07mebaran151and do all sorts of lazy filtering and mapping on them
19:07osaundersSounds cool.
19:07mebaran151it's nice to pretend your tables are just an infinite list of tuples
19:08osaundersThey kinda are.
19:08osaundersOr at least they should be.
19:08mebaran151yep
19:08mebaran151internally I chunk fetches, so it's actually fairly performant, and using clojure it was incredibly simple to write
19:09osaundersMake a video! :-)
19:24osaundersDoes anyone know what the mdworker process is in OS X?
19:25osaundersOh yeah Google. Duh.
19:32mebaran151I'm gonna blog it up
19:33mebaran151the code is on github if anybody's interested
19:33mebaran151*bitbucket
19:33Anniepoogotta say, this is certainly nonintuitive
19:34mebaran151Chousuke, the example in common lisp of basic list comprehensions uses map and filter essentially
19:35AnniepooI installed the clojure-mode. It ran something when I did it, but now it just treats a new foo.clj buffer as plaintext
19:35mebaran151sight, fighting emacs can be such a terrible pain
19:35mebaran151Anniepoo, you abandoned IntelliJ?
19:36Anniepoono, though Fossi made good arguments for trying emacs
19:36AnniepooI try not to be 'dedicated' to anything,
19:36tomojAnniepoo: you did M-x clojure-install?
19:36osaundersI like Anniepoo already.
19:36Anniepooyes, I did that
19:37Anniepooosaunders, ask on this list abotu projector support in unix ;c)
19:37tomojdid you add a clojure-slime-config to your username.el?
19:37Anniepoono
19:37mebaran151I think sticking with one tool can be a pretty good strategy
19:37mebaran151tool jumping can just be painful at times
19:38AnniepooI agree mebaran
19:38tomojinside emacs.d with the starter kit if you make a username.el (where username is your username) it will be loaded on startup
19:38tomojnot sure how that works with windows
19:38Anniepoook
19:38mebaran151I wouldnt' say be religious about it, but i fyou got a working IDE setup, it's rarely that worth it to chane for ti's own sake
19:39mebaran151projectors are easy to use if you're running a nvidia graphics card on linux
19:39tomojAnniepoo: C-h v user-login-name
19:39tomojuse that with .el
19:39mebaran151I was incredibly surprised how simple nvidia made it by not skimping out on the hardware :)
19:39tomojthen add (clojure-slime-config "/path/to/the/place/you/installed/clojure")
19:39osaundersAnniepoo: Why? Did you write it or something?
19:40Anniepoothe starter kit seems to not have installed clojure-mode or slime
19:40tomojAnniepoo: e.g. I have clojure in /Users/thomasjack/code/clojure/src/clojure/, so I use /Users/thomasjack/code/clojure/src for the clojure-slime-config
19:40tomojyou need to get clojure-mode from elpa first of all
19:40Anniepooosaunders: no, it's a joke - at a clojure talk everybody had a laptop, was supposed to do a 10 minute speed presentation
19:40tomojotherwise you wont have a clojure-install to run, I believe
19:41Anniepooinstead every single one had trouble with unix and the projector
19:41osaundersOh lol
19:41Anniepoogiven how simple this is on winders, I had to laugh
19:41Anniepooah, ok
19:41tomojeven the mac people? odd
19:41mebaran151well X for the longest time assumed configuration was fairly static
19:41AnniepooI've missed a step
19:41mebaran151only recently have they given up that delusion
19:41tomojAnniepoo: M-x package-list-packages
19:42Anniepookk, hang on
19:42mebaran151nvidia is actually easier to get to work on linux than windows ironically
19:42tomojAnniepoo: go to clojure mode and press i, then press x
19:42mebaran151intel still hasn't caught up
19:42tomojAnniepoo: then you probably need to M-x load-library clojure-mode
19:42tomojAnniepoo: then M-x clojure-install
19:43Anniepoook, hang on, how do I copy text out of emacs?
19:43tomoj"M-x load-library RET clojure-mode" rather
19:43tomojdepends on your emacs
19:44osaundersYeah I think I'll leave you guys to your X and Emacs and all that jazz for a few years yet.
19:44tomojfor me it's the same as everything else here, cmd+c
19:44tomojosaunders: are you on windows?
19:44osaundersMac.
19:44tomojyou really should give clojure-mode+slime a try, I think
19:44tomojit's easy with the starter kit and aquamacs
19:45osaundersI know bash well and I've got TextMate. Pretty happy with that. Not for Clojure mind but I probably won't do a lot of programming in Clojure.
19:45tomojah, well then getting clojure-mode+slime set up probably isn't worth it
19:46Anniepoosorry, I got the package names
19:46tomojI'm actually in the process of giving up textmate altogether for emacs
19:46Anniepoobut can't get them copied to paste into pastebot
19:46tomojAnniepoo: what, clojure-mode isn't on the list?
19:48Anniepoowho freaking knows?
19:48tomojwell.. hopefully you would since the list is right there for you to see
19:48Anniepooor at least one page of it
19:48Anniepoo8cD I'm not too good with emacs
19:48Anniepoobut managed to copy to notepad
19:48tomojclojure-mode should be not too far down
19:49Anniepooand yes, clojure-mode is on the list
19:49tomojthen, do what I said :)
19:49tomojmove the point down to the clojure-mode line (click or C-n down there)
19:49tomojpress "i"
19:49tomojthen press "x"
19:49Anniepoodid that
19:50tomojok, then try M-x load-library RET clojure-mode
19:50tomoj(where RET means press return)
19:50Anniepoook, ran some long script
19:50tomojshould say "loading ... done"
19:50tomojas long as it doesn't say "Cannot open load file..." you should be good
19:51tomojnow try M-x clojure-install
19:51tomojit should ask you for a path to install clojure to
19:51Anniepoook
19:51Anniepooit is
19:51Anniepoothanks for the walk thru, BTW
19:51Anniepooaccept the default?
19:51tomojif you like it
19:52tomojwhen it's done installing it should tell you what to add to your username.el
19:52Anniepoobriefly gave an installation failed message
19:52tomojdoh
19:52Anniepoomoving mouse over it erased it
19:53tomojmaybe some incompatibility with your windows version of emacs?
19:53tomojI doubt much of this stuff is tested on windows
19:53Anniepooat one point I was being encouraged to make an Annie.el file
19:53tomojyeah, that's where you'd put the clojure-slime-config line
19:53Anniepoothat's never been done
19:54tomojyou wouldn't need to until after it installed anyway
19:54tomojtry M-x clojure-mode
19:54tomojoh, well, that will probably work anyway
19:54tomojbut that doesn't mean your clojure/slime/etc is installed :(
19:54Anniepoounmatched bracket or quote
19:55tomojyeah, that's because you weren't in a clojure source buffer
19:55tomojtry M-x slime again I suppose
19:55tomojthough if it said installation failed that's probably the case
19:55Anniepoohey, for some really bizarre reason now it's coloring my clojure test file I got here
19:55Anniepoodunno what happened, but it worked
19:56tomojM-x slime worked?
19:56AnniepooI think it's clojure-mode
19:56AnniepooI have syntax coloring and indenting
19:56tomojah, yeah
19:56ChousukeEmacs is really neat once you get into it.
19:57Anniepooyah, this is actually the third time I'm learning it
19:57Chousukethe beginning is a hurdle though. it's not an easy tool.
19:57Anniepoo78-83 I used QED
19:57tomojI imagine it's probably a less pleasant experience on windows as well
19:57Anniepoo84-87 I used PMATE
19:57AnniepooQED is the line oriented ancestor of emacs
19:57lowlycoderanyone knows what rick hickey does for a living? (that allows him to work on clojure?)
19:58AnniepooPMATE was a commercial version
19:58ChousukeI cloned someone's emacs.d from github as a basis for my emacs installation.
19:58ChousukeI got lots of neat features out of the box that I probably wouldn't have found otherwise :P
19:58osaunderslowlycoder: I think Clojure is a freetime hobby thing. I could be wrong though.
19:58Anniepooso I should try M-x slime again?
19:58Anniepoo[no match]
19:58tomojjust to see if maybe it actually worked even though it said it didn't :)
19:59tomojyeah, didn't work
19:59tomojtry C-x b *Messages*
19:59Chousukelowlycoder: Rich used his savings while working on Clojure. That source of money is apparently used up now though.
19:59tomojsee if the install failure message is in there
19:59lowlycoderis there a donation page for him?
19:59lowlycoderi'm prety mpressed by clojure so far
20:01Anniepoodo it, lowlycoder - I'm sure several people on this IRC can give you an addy to send the money
20:02Chousukelowlycoder: there's a donation button on clojure.org
20:04Anniepoook, tomoj, git'ing slime
20:04Anniepoowill put in .emacs.d and try M-x slime again, or do I need M-x clojure-install?
20:04Anniepooand should I get swank first?
20:05tomojuhh
20:05tomojclojure-install is supposed to do everything for you I guess
20:06tomojdid you find the failure message?
20:07Anniepooyah, I think it's not finding the packages somehow
20:07Anniepooso I'm downloading them with these inistructions
20:07Anniepoohttp://riddell.us/tutorial/slime_swank/slime_swank.html
20:08tomojah
20:08tomojwell you already have clojure-mode installed
20:08Anniepooyes
20:08Anniepoobut I got it same way
20:08tomojfor the rest, put them in vendor
20:08Anniepoook, I got a bunch of lisp code
20:08tomojthen instead of editing .emacs, edit .emacs.d/Annie.el
20:08Anniepoovendor?
20:09tomojmake a vendor dir in your .emacs.d
20:09Anniepookk
20:09tomojand then you'll be doing stuff like (add-to-list 'load-path "/path/to/.emacs.d/vendor/slime")
20:12Anniepootesting
20:12tomojand replace the paths to clojure(-contrib)?.jar in that tutorial with whereever you really put them
20:18Anniepoook, so swank-clojure goes in vendor too?
20:18Anniepoo(hate doing this much voodoo)
20:18tomojyup
20:18Chousukeit doesn't really matter where it goes I think. :P
20:18Chousukeas long as it is in load-path
20:19tomojindeed
20:19Anniepoook, cool
20:19tomojI heard somewhere that vendor/ was the conventional place for the starter kit
20:19Chousukemy stuff is scattered around ~/opt/lisp/, ~/.emacs.d/site-lisp/ etc.
20:19Anniepooswank-clojure has two .el files and a directory swank in it
20:20ChousukeAnniepoo: you don't want to touch the contents of the dir. just put the whole dir somewhere and then add it to the load path
20:20Anniepoook
20:20Anniepoomaking sure I got the dir and not the dir that contains the dir
20:21AnniepooI have no .emacs file
20:22tomojindeed, you should not
20:22tomojas I said, use .emacs.d/Annie.el instead
20:22Anniepooah, thanks
20:22Anniepooso add all the tutorial's boilerplate and update the paths
20:23tomojyup
20:23tomojand, don't forget to also update the paths to the clojure jars
20:25Anniepoodo I need to double the backslashes here?
20:26osaundersBaaaaccccccckslllaaaaaasssssshhhh
20:27osaundersIt's got a nice ring to it.
20:27osaundersOr should that be shhling.
20:27Chousukeoh, and useful functions: M-x apropos, M-x describe-key, M-x describe-function
20:27Chousukedescribe-key especially
20:27Chousukejust run it, hit some random combo and discover new stuff!
20:28lisppaste8Anniepoo pasted ".emacs.d" at http://paste.lisp.org/display/85464
20:28tomojit's C-h k here
20:28tomojyou've got an extra .emacs.d in the slime load path
20:29tomojI dunno whether you need to escape the backslashes or not
20:29Anniepoohate voodoo
20:29tomojyes, I think you do
20:30Anniepooneed backslashes or hate voodoo?
20:30tomojneed extra backslashes
20:30tomojhere installing clojure-mode from elpa and doing M-x clojure-install made everything work fine
20:30tomojdidn't have to add anything to my username.el
20:31Anniepoosorry, I'm stuck on winders
20:34Anniepooahh... the installer is failing because it can't find git
20:35Anniepoobut in theory it's all running now
20:36Anniepoohow do I get the buffer into a repl?
20:37tomojM-x slime
20:37tomojoh
20:37tomojif you already have a repl up, go to the source buffer and C-c C-k
20:37Anniepooit's doing something different with the indenting, and it's doing syntax coloring, and it says slime in the bar at the bottom
20:38tomojok, no go to a clojure source buffer with some function and C-c C-k
20:38tomojthen you should be able to call it in the repl
20:38osaundersGood night all.
20:39Anniepoothanks for all the help
20:39tomojworking?
20:39Anniepoothis'd just be impossible on my own
20:40Anniepooit' can't find my function
20:40tomojwell.. is it in a namespace?
20:40Anniepoohmm
20:40tomojotherwise something's not hooked up right
20:40AnniepooI did M-x slime
20:40tomoj(i.e. do you have a call to ns at the top of your clojure source buffer)
20:40Anniepooit asked if I wanted another repl
20:40Anniepooyah, I didn't put one
20:41Anniepoojust (defn foo [x] (+ 3 x))
20:41tomojmaybe try restarting emacs if you haven't already
20:41Anniepoook
20:41tomojjust to be sure all the config is loaded
20:41Anniepoocan't get emacs to exit
20:43AnniepooI'm doing a project for NASA, I'm reading a bunch of astronaut books for background
20:43Anniepoosomebody asked one what the most dangerous thing he ever did was, he said training student pilots
20:44Anniepoofeel like that today (like a dangerous student pilot)
20:44Anniepoodamn
20:44Anniepoorestarted and nothing loads
20:44Anniepoono clojure mode no nothing
20:45tomojhmm
20:46tomojM-x clojure-mode says no match?
20:46Anniepoono, that worked
20:46tomojM-x slime says no match then?
20:46Anniepoonow I got the 2 space indent and syntax highlight
20:46Anniepooah, I see
20:54fsmHello everyone.
20:55fsmIs there a way to solve the problem of having circular dependencies between two namespaces?
20:59Anniepoogoing C-c C-k says not connected
20:59Anniepooslime hung and I restarted
20:59Anniepoonow it's doing that
20:59tomojsomething's wrong with your swank/slime config I suppose
20:59Anniepoook
20:59carkfsm : just don't do it
20:59carkfsm : or use callbacks
21:00Anniepoothere's a user's group meeting coming up
21:00fsm:)
21:00AnniepooI'll get up to speed on emacs and hit up one of the emacs junkies to help me with it
21:00fsmmy situation is, i have a ray-tracer in one namespace that calls shaders in another namespace
21:00fsmsome of those shaders need to call the raytracer to do more shading
21:00Anniepoook
21:00Anniepoofsm, each should 'use' the other
21:01carkwhich one is the boss ? raytracer or shaders ?
21:01Anniepooneither
21:01Anniepooyou're in my address book
21:01AnniepooI'm in your address book
21:01fsmthey can't use each other because clojure silently stops when it hits the recursive 'uses'
21:01fsmas far as i can tell
21:01fsmraytracer is the boss, i guess
21:01AnniepooI've got a mass of code in a dozen namespaces that mostly use each other
21:02carkwhen you call into the shaders, privide them with the raytracer functiobns they might use
21:02Anniepooyou can't forward reference - that one got me once or twice
21:03carkyou're kinda defining an interface
21:03carka protocol really
21:03carklilike shaders are some kind of plugins
21:03fsmi get you
21:03fsmthanks, i will do that now
21:05AnniepooI'm going to take a break and then do some cleanup on prim chalk
21:05Anniepoottyl
21:10technomancyAnniepoo: sorry, I don't have resources to test on Windows
21:10technomancyoh... she left.
21:14fsmthanks, all working now
21:14fsmhave a virtual cup of tea on me: http://tu.be/graphics/teapot2.png
21:30tomojam I supposed to write a build.xml by hand? O_o
22:34fsmI copied the build.xml from clojure-contrib and modified it
22:51Anniepootry (nth 0 '[10 20 30]) in a repl, you'll find it throws a fairly unhelpful exception.
22:51Anniepoominor bug
22:54Anniepoonever mind
22:54Anniepoonoobism strikes badly
23:02tomojI do wish it said what the attempted cast was
23:03tomojit seems all you know is that a vector was cast to something wrong
23:04AnniepooI was trying (nth 0 '[10 20 30])
23:04Anniepoobut yes
23:04tomojyeah
23:04tomojso I guess it tried to cast that vector to an integer
23:05tomojbut it just says "....PersistentVector, ClassCastException"
23:05dmilesAnniepoo: you still working with LibOMV>
23:05tomojrather than "Can't cast a PersistentVector to an Integer" or something useful
23:05dmilesAnniepoo: well secondlife
23:06AnniepooI am still working with both of those
23:06dmilesare you writing the clientlib in clojure?
23:07dmilesor are you using ClojureCLR?
23:07Anniepooneither, the libOMV bot is in C#, and I shell out to it
23:08Anniepoocompared to the time delay while it signs on, the delay for the process launch is trivial
23:08dmilesonce its connected.. you use a socket?
23:08dmilesbetween clojure and the bot
23:08Anniepoothe bot?
23:09dmilesyeah
23:09Anniepoono, the bot's a command line driven bot
23:09Anniepooit just uploads textures
23:09Anniepooso it gets filenames on stdin and responds iwth UUID's
23:09dmilesoh i see.. makes sense you can just batch it out
23:09Anniepooyah, I don't want to play with the bot, it does it's job
23:09Anniepoohttp://slurl.com/secondlife/HHP%20at%20UH/16/15/1001
23:10Anniepoomy current location
23:10Anniepoositting on a builder robot run by clojure
23:10Anniepoofly!
23:19dmilesoh right on.. hrrm canty get above 167m
23:20Anniepooneed a flight feather? IM me , Annie Obscure