#clojure logs

2009-01-21

00:13cooldude127so around what time at night does this channel DIE?
00:15durka42i suppose it depends what you mean by night
00:15durka42i imagine people in germany and such are up earlier than i am
00:16cooldude127ah
00:16ChouserI've been meaning to try to chart the by-hour traffic rate for the average week.
00:16cooldude127idk it's night where i am and this place is dead
00:16hiredman,(Integer/parseint "0" 2)
00:17hiredmanwait
00:17Chouser,(Integer/parseInt "0" 2)
00:17Chouserhe's not here
00:18cooldude127wtf clojurebot?
00:18hiredmananyway
00:19hiredmanI fixed my brain so I know what (Integer/parseInt "0" 2) is
00:19cooldude127,(Integer/parseInt "0" 2)
00:19clojurebot0
00:19hiredmanI sure wish I typed that in on of my repls instead of to clojurebot
00:20cooldude127why?
00:20hiredmanbecause 0 in base two is still 0
00:20cooldude127lol
00:20cooldude127,(Integer/parseInt "10010101" 2)
00:20clojurebot149
00:20cooldude127woo!
00:22durka42what's the darcs equivalent of git clone?
00:22durka42is it get?
00:22cooldude127yes
00:22cooldude127darcs get
01:36Carkhow do i remove a def from a namespace ?
01:40durka42(doc ns-unmap)
01:40cgrand(doc ns-unmap)
01:40clojurebotRemoves the mappings for the symbol from the namespace.; arglists ([ns sym])
01:40clojurebotRemoves the mappings for the symbol from the namespace.; arglists ([ns sym])
01:40cgrand:-)
01:40Carkah thanks
01:42durka42(ns-unmap *ns* 'durka42)
03:20jlicombinatorics will be the end of me.
03:28hiredman,(� S K K :a)
03:28clojurebot:a
04:19ecreti know how to include jar files when using the shell, just include the jars in the 'java -cp xxx.jar clojure.lang.Script file.clj" But I use jochu's emac's addon and am unsure of how to tell it where to look for the jar file. I tried adding the jars to the classpath but doesnt seem to work.
04:37jliwait, so is Clojure under the Eclipse license or the Common Public License?
04:38jliclojure.org says CPL, Google Code says EPL
04:40hoeckecret: do you use slime too? for slime (swank-clojure) there is [m-x] customize-group [RET] swank-clojure
04:40ecrethoeck: yes i use slime
04:40hoeckjli: the latter
04:41hoeckecret: and you need to restart emacs after adding a classpath there
04:42ecrethoeck: neat. Do I add classpaths or library paths?
04:43hoeckthats the same in clojure
04:48ecrethoeck: my default classpaths it seems was ~/.clojure even though i had set my classpaths=anotherfolder in my .emacs file. So I copied my jars into ~/.clojure and it still dont think its working. Is there a command to check which jars are loaded?
04:48ecretin the repl
04:50jlithis page isn't only blank for me, right? http://clojure.org/repl_and_main
04:50karmazillajli: maybe it is in the process of being written
04:50jlijust making sure
04:50hoeckmhh, I don't know one, but to recognize jars you need ~/.clojure/* as a classpath, * adds all jars in this directory to the classpath
04:51hoeck@ecret
04:55hoeckecret: but you can eval (swank-clojure-cmd) in your emacs *scratch* buffer to take a look at how clojure gets started
05:10djpowellI need to write a multi-method that compares a left and right object, where the objects are maps, and the comparison rules depend on a given type key. I want to avoid having to explicit pass left and right to all of the helper functions that will make up each method, so I was considering using dynamic bindings. Are dynamic bindings fairly fast, cause this would be in an inner loop?
05:14ChousukeI'm quite sure they're fairly fast.
05:16ChousukeBut you'll have to test both approaches and see which one is faster.
05:17djpowellYeah, I'll try dynamic binding. I suppose another alternative would be to use macros. Either some complicated macro that handles the limted nested expressions that I need to use; or a capturing macro.
05:20Chousukeremember to get rid of any reflection first, though, if there is any
07:09bOR_hmmm. trying to set up chimp, but running into some newbieness. what is the shortcut for actually sending a s-exp to chimp?
07:10bOR_I can type chimp and get a fine running chimp / clojure instance.
07:10bOR_just don't know how to communicate with it from vim.
07:10bOR_anyone experience with it?
07:10Chousukemaybe you should try gorilla instead? it's apparently supposed to replace chimp
07:11bOR_that's my second option, but I wanted to get this to work.. if I understand correctly, chimp remains in a separate window
07:11bOR_which I think I would favor above split windows.
07:12bOR_<LocalLeader>eb
07:13bOR_is a vim keybinding. just not familiar with what to type to execute it in vim.
07:13bOR_and having some trouble finding it explained.
07:16cgrandrhickey: I like the split betwteen stream and Iter
07:17rhickeycgrand: cool, I'm glad somebody is looking :)
07:17rhickeythe idea is to make streams relatively safe by serializing connections to them
07:17cgrandand I'm happy to see the callable replaced by a fn taking the eos token
07:17rhickeycgrand: yes, I'm anti-sentinel now
07:18rhickeycgrand: so the real question is whether or not to unify map/filter etc to take/return streams/seqs
07:19rhickeyor have map + map-stream
07:19rhickeyseq versions always being derivable from stream versions
07:19rhickeyit begs the nil punning question
07:20rhickeybefore I made them safe I was decided for bifurcation, now I'm tempted
07:21karmazillawill streams be part of 1.0?
07:22rhickeykarmazilla: they need not be if they don't entail breaking changes, what I'm talking about here is the key point
07:23cgrandwhen one wants nil punning, it has to call seq but, it's not different from having to call seq on a vector
07:23cgrandas long as rest returns a Seq
07:24rhickeycgrand: but its not nil punning anymore if one can't, say, use a seq function (like rest/filter) as a predicate
07:25rhickeysequence fns will no longer return ISeqs but just logical collection on which you can call seq
07:26rhickeye.g. you can now say (filter rest colls) to find all colls with more than one element
07:27cgrandyeah I didn't think of that :-(
07:28rhickeyrest could still return a seq, with some new (more aseq) returning the logical collection, but that doesn't help the other sequence fns
07:29rhickeyI've definitely written code which new I had already called seq once and therefore presumed ISeq/nil from all subsequent sequence fns
07:29rhickeyknew
07:31djpowell`I'm implementing something with resultset-seq, that does some iterating of a few resultsets with a little lookahead. Is this something that would be stream-ified? Should I have any concerns with resultset-seq using seqs?
07:33rhickeydjpowell: streams are meant to interoperate with seq code transparently, in particular, streams support a once-and-once only idempotent seq method. I imagine most sequence fns will be written using streams and consumed, at the end of the chain only, as seqs
07:34rhickeybut if you wanted to, you could use streams directly where that made sense. Streams do support puchback
07:34rhickeystill not as easy to reason about as persistent seqs
07:35stuarthallowayrhickey: what is "nil punning"?
07:36stuarthallowayGoogle returns the political works of John Greenleaf Whittier
07:36djpowellI don't quite understand the purpose of streams. Am I likely to run into any problems using the current resultset-seq as it isn't stream-based?
07:37rhickeystuarthalloway: it means leveraging the fact that sequence fns return either ISeq or nil, and using the conditional testability of nil - see (filter rest colls) above
07:37stuarthallowayrhickey: thanks -- is this a well-known term in some book I should have read?
07:37rhickeyusing sequence fns as predicates, saying (if aseq ...)
07:38rhickeystuarthalloway: it's a CL thing
07:38stuarthallowayit's no wonder CL never took off if their vocabulary is full of googlewhacks :-)
07:41djpowellis the problem with using seqs to handle streaming the risk of a closure capturing the head of a seq?
07:43rhickeyfor those who know enough CL and Scheme, this is funny: http://people.cs.uchicago.edu/~wiseman/humor/large-programs.html
07:44rhickeydjpowell: not really, fully lazy seqs would help that too, but in some ways it's not a problem except with people's expectations that laziness == ephemerality
07:45rhickeystreams are ephemeral, but closing over and otherwise aliasing them begs it's own issues
07:47jacky(defn mgroup [n coll]
07:47jacky (if (> n (count coll))
07:47jacky (list coll)
07:47jacky (lazy-cons (take n coll) (recur n (nthrest coll n)))))
07:47jacky;Mismatched argument count to recur, expected: 1 args, got: 2
07:48jackyany idea why this could be happening?
07:48rhickeyjacky: either you want lazy-cons or you want recur, not both
07:49rhickeylazy-cons (a macro) wraps both of the experessions in fns, so the recur in the rest targets that wrapping fn, not mgroup. If you want lazy, just call mgroup
07:50rhickeyi.e. recur is for direct looping, the opposite of laziness
07:50jackyah ok - got it.
07:51rhickeyso, (lazy-cons (take n coll) (mgroup n (nthrest coll n)))
07:51rhickeyor try partition :)
07:51djpowell`When I'm iterating over a seq, is it safe to assume that the portion of the seq that i've iterated past is ephemeral?
07:52jackyI changed the lazy-cons to a cons
07:52rhickeydjpowell: not if you are still using it
07:53jackyNow, it says "Can only recur from tail position". I thought the function is at the tail position..
07:53rhickeylazy seqs are only lazily created, after that they are persistent, and just like any other list, links get gc'ed only when you are not using them anymore
07:53Chouserif you have (cons foo bar), cons is in the tail position, not foo or bar
07:54jackychouser: That is helpful. Is there a definition of what is tail?
07:55djpowell`rhickey: I think that should be fine then. I'm just map-ing and filtering through the seq, so i won't have any references to earlier elements.
07:55rhickeydjpowell`: you should be fine, and don't worry about streams, they'll just slip in under the hood
07:56jackyI would assume that any recursive call with no further expressions to be evaluated is a tail call
07:56rhickeyjacky: the expression whose return value is the return value of the calling function
07:57Chouserin a 'do' (or implicit 'do' like in 'fn', 'defn', etc.): (do a b c) only c is in the tail position, not a, not b, and nothing inside c
07:58djpowell`rhickey: cool. fyi: i'm using resultset-seq to collect together records from different database queries. it all seems really elegant, and runs pretty fast
07:59jackyrhickey: It took a while, but now I understand why cons is in tail and not foo or bar
08:00jackythanks rhickey and chouser
08:12clojurebotsvn rev 1221; wrap bean accessors in prepRet
09:42ChouserIt's a bit impressive how much "Rich and the Contributers" does not sound like a band.
09:43rhickey:)
09:43gnuvincehahaha
09:44rhickeymy last band was called Oh No!!
09:44rhickeylong time ago
09:44gnuvincerhickey: you play music?
09:45rhickeygnuvince: don't all programmers?
09:45gnuvincerhickey: I know a few who don't.
09:45gnuvinceReally?
09:45rhickeyyup
09:46gnuvinceHow did you go from music composition to software development?
09:46vyThis might be a stupid question, but... What's the reasoning behind using vectors instead of lists in function/method arguments, let bindings, etc.?
09:47cooldude127vy: Helps distinguish function calls from other code
09:47gnuvincevy: it's visually distinctive
09:48rhickeyplay music -> have fun -> study music -> try to get record deal -> fail -> run recording studio -> buy computer for recording studio -> teach yourself programming -> switch to programming -> have fun
09:48gnuvinceWow, color me very impressed.
09:48cooldude127Same here
09:49vycooldude127: gnuvince: Just for eye-candiness?
09:49clowsyou missed the -> fail -> get cab license part ;)
09:49cooldude127More for clarity
09:49gnuvinceWith the depth of your knowledge on CS topics, I would've imagined that you had a masters or PhD in CS
09:50rhickeywent back for BS in CS
09:51Chousermy guess has been no PhD, based on how much Clojure is grounded in practicality.
09:51cooldude127Currently doing a BS in CS
09:52ChouserIf I could spend the time and effort to get a PhD, I might never have to write useful code again...
09:52cooldude127Lol
09:52gnuvinceCurrently doing my calculus calsses
09:53gnuvinceAfter that, hopefully a university degree in CS
09:53gnuvinceI got a degree from what we call a cegep in Quebec, which is worse than worthless if you're looking for a programming job.
09:53rhickeyvy: I think it is more than eye-candy. Since almost all data is not in lists and almost all lists are operations, it adds really enhances the understandability IMO
09:54rhickeyILC prelim program: http://www.international-lisp-conference.org/2009/index
09:55gnuvinceSpeaking of which...
09:56gnuvincehttp://lispy.wordpress.com/2008/10/25/lisp50-notes-part-vi-the-future-of-lisp/#comment-2514
09:58rhickeyI guarantee the full day tutorial will be the most in-depth talks I've given on Clojure
09:58gnuvinceAwesome
09:58gnuvinceHopefully it's screencasted
09:58ChouserI wonder if it's cheaper to only go for the first day.
09:59rhickeyChouser: they've done per diem pricing in the past
09:59Lau_of_DKrhickey: When is your tour of Northern Europe scheduled for ?
10:00rhickeyLau_of_DK: QCon London is all that's on the schedule
10:01Lau_of_DKLondon is very cold and misty - Have you considered Copenhagen ?
10:07cooldude127so i'm debating in my date library whether to have blank out fields that aren't specified. like if you only specify year, month, and day, do you want time to be the current time or to be 00:00:00 ?
10:07Chouser0
10:07cooldude127s/have blank/blank
10:08gnuvince00:00:00
10:08cooldude127right now, it gives the current date, such that calling (date) with no args gives the current date. should i have a separate function called (today) for that?
10:09teHello all
10:09Chouserdoes the underlying Java class have the concept of a blank or invalid date?
10:09te<-total clojure noob
10:09Chouserte: hi, welcome!
10:09teDoes anyone have any good tips on learning Clojure?
10:10teI'm very interested -- but I don't know a lick of java or lisp
10:10rhickeyInteresting quote: "Clojure is Python for functional programmers" - http://neopythonic.blogspot.com/2008/11/scala.html?showComment=1230447780000#c9087235066224967849
10:10cooldude127Chouser: by default, it is the current date, but the Calendar class has a clear() method to blank it out
10:10teI've looked at Haskell and Lisp in the past, but Clojure seems more alongm my lines
10:10tealong*
10:12rhickeyte: I realize it costs money, but I don't know of a more from-scratch tutorial than: http://www.pragprog.com/titles/shcloj/programming-clojure
10:12teI'm a big fan of pragprog's stuff -- I believe I have a coupon to use on there
10:12cooldude127so i should have dates, by default, only contain the data the user passes
10:12cooldude127that sounds right, it's least surprising
10:13Chousercooldude127: I think that's right
10:13cooldude127In that case, I think I'll have two other functions, (today) and (now) that give the current date and date/time
10:15Chouserthat sounds right too, though providing those as flags to the regular date ctor fn might work too
10:15cooldude127Chouser: that function has so many args already, it seems more clear to just do a separate function
10:17Chouserok
10:18cooldude127actually, is it that important to have one for date and another for date/time?
10:18Chousukehmm.
10:21cooldude127nvm i just went ahead and made both. all today does is dissoc :hour :minute and :second from now
10:30cooldude127ok now anyone interested, tell me what's wrong or missing from this date library: http://gist.github.com/49656
10:33gnuvincecooldude127: time deltas
10:34cooldude127gnuvince: as in durations?
10:34gnuvinceLike (add-time today (delta {:days 12}))
10:35gnuvinceSo you get today's date plus 12 days (accounting for months, years, etc.)
10:36cooldude127gnuvince: ok
10:36cooldude127i'm not even sure the delta function is necessary
10:36cooldude127just use {:days 12} as a delta
10:36gnuvincePossibly
10:37Chouserdeltas are almost but not quite entirely unlike dates
10:37cooldude127Chouser: that was really confusing
10:37Chouser:days, :hours, :minutes, :seconds, but not :months or :years
10:38cooldude127why not months or years?
10:38Chouserbecause some months are different sizes than others, same for years.
10:39cooldude127oh
10:39karmazillaJoda Time destinguishes between "periods" and "intervals"... Periods are like 1 month, and intervals are some exact amount of millis
10:39cooldude127ah this is annoying. time is stupid
10:39Chousera date is such a messy piece of data
10:40cooldude127it very much is
10:41cooldude127intervals in joda time have a start and end time
10:41cooldude127they can convert to periods and durations
10:42cooldude127i'm starting to think i should add some kind of key to distinguish instants, deltas, intervals, whatever, and use some multimethods
10:44cooldude127ok wtf is this hierarchies stuff? i'm very confused
10:52Chouser,(derive ::Period ::Time)
10:52clojurebotnil
10:52Chouser,(isa? ::Period ::Time)
10:52clojurebottrue
10:54cooldude127brb
11:02cooldude127wow vending machines are a ripoff
11:08cooldude127so should i be using like ::date instead of :date for types?
11:09Chousukecooldude127: :date if you actually expose them to the user as selectors.
11:09rhickeycooldude127: or `Date (note syntax-quote)
11:09rhickey::Date
11:09cooldude127i'm using them as type specifiers, nothing more, does that help?
11:10cooldude127also, is ::Date or ::date preferred?
11:10Chousukefor multimethods? yeah, double-colon is probably better in that case.
11:10cooldude127yeah alright
11:11rhickeyI'd prefer to see upper-case D
11:11cooldude127rhickey: any reason?
11:11rhickeylooks like a type name to me
11:11cooldude127ok
11:11cooldude127rhickey: perhaps the docs could be fixed to use uppercase everywhere
11:12cooldude127it's mixed at the moment
11:27cooldude127ok this hierarchies stuff is actually kinda fun
11:27cooldude127:)
11:30cooldude127ok so now i have two different types: Date and Time, which both derive from Instant
11:31cooldude127Date has year month and day, as well as time zone
11:31danlei`hm ... i'd suggest you start with 1-2-3-5 patterns, which is a common idiom trane himself used quite a lot. also, keep in mind, that in spite of the rapid changes there are only three tonal centers (b, eb, and g).
11:31cooldude127Time has all that plus hours minutes and seconds
11:31danlei`oops
11:31cooldude127c-c-c-combo breaker
11:31cooldude127sorry
11:39cooldude127where does the docstring for a multimethod go?
11:44Chouser(defmulti #^{:doc "does foo things"} foo ::Type)
11:45rhickeyinitial docs for streams: http://clojure.org/streams
11:45rhickeyfeedback welcome
11:46cooldude127sweet
11:46Chouserstreams are going to happen independently of the scope form?
11:47rhickeyChouser: yes, scope likely sooner as it works for lazy-seqs too
11:47cooldude127nice to see that we are condemning straight use of generators.
11:47rhickeycooldude127: right, that's been the challenge here, making something that won't ruin Clojure's approach to things
11:48cooldude127rhickey: i can imagine that was difficult
11:50Chouseranything in the language preventing the aliasing of an Iter?
11:51rhickeyChouser: no, can't be, just the usage pattern of take/return streams
11:51Chouserok
11:51cooldude127what exactly differentiates streams and lazy seqs?
11:52Chouserwhen you call 'rest' on a seq, you get a whole new object. 'next!' on an Iter (on a Stream) changes the existing objects to the new state.
11:53cooldude127oh
11:53rhickeyChouser: this should be the kicker for accidental iter leakage:
11:53rhickeyuser=> (seq (stream-iter [1 2 3]))
11:53rhickeyjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Iter (NO_SOURCE_FILE:0)
11:53Chouserok.
11:54rhickeyuser=> (seq (stream [1 2 3]))
11:54rhickey(1 2 3)
11:54ChouserWill 'scope' be useful to make sure my Iter is detached before my function is done?
11:55Chouserhm, or is the dynamic scope of 'scope' inappropriate, and I should just be careful to use 'detach!' explicitly.
11:55rhickeyChouser: you could use it for that, but I don't see that being the common case, detaching is just for chainable versions of things like take
11:55rhickeywhich would have an explicit call to detach in it
11:56rhickeyscope would be used to close your file for line-stream/seq
11:57rhickeythe vast majority of fns will keep their iter on one stream, embedding it in the generator of another, a la map/filter, or completely use it and toss it like reduce
11:58rhickeyless common would be chainable-take, detaching before returning
11:58Chouserthis is completely separate from LFE and the Haskell slides I was trying to read?
11:59rhickeyChouser: yes, this is a pull model
11:59rhickeyLFE is inversion of control
11:59Chouseryou were interested in LFE primarily for resource management, which you're now planning to handle with 'scope' instead
11:59drewrWhere does eos come from?
12:00gnuvincedrewr: end of sequence
12:00rhickeyChouser: LFE offered resource management and safety, I think scope + safe streams is easier, and definitely faster
12:00drewrOr, what would an eos typically be? A function that you want to dispatch when you're done?
12:00gnuvincedrewr: nil
12:01gnuvince,(cons 3 nil)
12:01clojurebot(3)
12:01cgranddrewr: (Object.) or (gensym)
12:01rhickeydrewr: eos is just a sentinel value not going to be present in the stream, usually a one-off Object, see reduce* in the docs
12:01rhickeybut not a hardwired canonic sentinel
12:02Chousersafe-streams are useful even though we have seqs because they are faster and don't cache?
12:02rhickeysafe streams allow for an allocation-free pipeline
12:02rhickey:)
12:02Chousermmm...
12:02rhickeyalso fully lazy
12:03Chouserno new object per iteration
12:03rhickeywithout allocation, whereas fully lazy seqs will require a Delay alloc
12:03rhickeyno object(s) per iteration stage
12:04gnuvinceIs that following the blog post about laziness in CLojure?
12:04Chouserbecause the things in the stream are not ISeq objects, but just the value objects.
12:04rhickeycurrently 2 per stage (the lazy-cons and the first/rest fn)
12:04rhickeygnuvince: this work has been going on long before that
12:05gnuvincerhickey: okay
12:05rhickeyChouser: right, I'm not counting the values
12:05rhickeya call to pull on a stream just results in a string of calls
12:06rhickeyadd stages and the difference really adds up, rarely less than 2x faster
12:07rhickeyOf course, if you have any significant computation per step that dominates, so the real difference here is for trivial stages
12:08rhickeybut strapping a seq on the end of a stream chain is beautiful, because that's where you really want the persistence, and you only get a single seq chain
12:14Chouserok, sounds great. :-)
12:15rhickeySo the final questions are, is this safe enough to unify with seq versions?, and if so, what's the cost of the requisite (breaking) removal of nil-punning
12:19rhickeyIt seems sad to move away from the canonic recursive versions of things like filter to these imperative ones, OTOH, if people avoid using higher-order fns like filter for perf...
12:21Chousukebetter encapsulate it at the lower level where it's not seen :)
12:24cgrandstupid idea of the day: map on a coll/seq yields a seq, map on a stream a stream
12:25rhickeycgrand: that drops serious perf enhancements of map on coll -> stream
12:26rhickeyalso, I think that the return value should be universal
12:26rhickeyi.e. minimally defined as a logical collection
12:26Chouserwhich is what you'd want primarily as the first step of a chain, where the seq would be attached at a later link?
12:26rhickeyon which seq and stream will work
12:27rhickeyChouser: right, by default sequence fns will call stream on their args
12:29rhickeythe problem with bifircation, either explicitly with different fn names or implicitly by arg type, is the lego-like quality of Clojure is diminished
12:29rhickeybifurcation
12:30rhickeyto unify you have to drop nil punning lest someone change a distant source from seq to stream and break your down-chain pun
12:31ChouserI don't know about "safe enough" but I still think that the loss of nil punning will cause significant but short-term pain
12:31ChouserI don't think it will be much missed 4 months after its gone.
12:31rhickeyChouser: no doubt, quite a bit for me personally :)
12:31cooldude127what's nil punning?
12:32Chousercooldude127: relying on the assumption that an empty seq evaluates as false
12:32cooldude127oh
12:33rhickeyonly ways to mitigate nil punning are: keep rest as a fn of seq-->seq/nil, add a more fn of seq->logical-collection
12:33Chouser(if (rest foo) (recur bar) (all done))
12:33Chouser^ would have to become
12:33Chouser(if (seq (rest foo)) (recur bar) (all done))
12:33rhickeyor add a third condition to truth logic
12:33rhickeyemptiness
12:34rhickeyer, not quite, end-ness
12:34ChouserI don't think emptiness == false is worth it. That way lies madness.
12:34rhickeyChouser: I misspoke - end-ness, not emptiness
12:35rhickeybut possibly hard to discriminate, and a big perf loss, not seriously being considered
12:36cgrandwhat is -end-ness?
12:36Chouserbut once a couple kinds of objects have their own personal mechanism for falseness, everyone will want to do it.
12:36rhickeycgrand: would only apply to seqs and streams, means would produce a nil seq
12:37cgrandah ok
12:38rhickeystreams have a pushback buffer to allow for this (and other) uses
12:38technomancycooldude127: how's that date stuff coming?
12:38rhickeysince asking that question of a stream will pull one item
12:38cooldude127technomancy: pretty well, i'll update the gist with what i have
12:39cooldude127technomancy: updated http://gist.github.com/49656
12:39technomancynice
12:40cooldude127technomancy: i plan to add more types like deltas and intervals
12:40rhickeythe problem with end-ness is that, in order to be fair, it would involve an instanceof check
12:40rhickeynot merely a type == AStream check
12:41rhickeyso that the purely functional camp could get a delay-seq
12:41rhickeyand write fully lazy seqs without using streams
12:47technomancyevery time I go back to ruby I expect it to keep the structure intact around my editing operations
12:49cooldude127lol
12:49cooldude127i love paredit
12:54technomancygist is nice, but I still prefer lisppaste for clojure and elisp code
12:54technomancythough they've been having downtime issues recently
12:55duck1123cooldude127: it's not as cool as you might hope. It still needs work
12:55cooldude127duck1123: i'm about to find out
12:55technomancyduck1123: you mean forking and such?
12:56cooldude127i already see a problem
12:56duck1123I was just hoping it would do a few things, and it just didn't deliver. I only played with it for a little bit
12:56cooldude127gist.el only supports creating new pastes
12:56cooldude127no editing
12:56technomancyin my experience it's better than your average paste mode, but yeah, it doesn't expose a lot of the things that make gist cool.
12:57technomancyand lisppaste's syntax highlighting is hot stuff.
12:57duck1123that was my main complaint. I want to pull an old gist, edit, c-c C-c and be done with it
12:57cooldude127technomancy: what with the parentheses highlighting?
12:57cooldude127duck1123: yeah that would be very cool
12:58technomancyduck1123: shouldn't be too hard to add if you really want it
12:58cooldude127even if we had to have like a ;; -*- gist: 48374 -*- at the top (i don't know if that would actually work)
12:59technomancyduck1123: you better watch out; I'm in a delegating mood these days. yesterday I told cooldude127 to go write a date wrapper for clojure-contrib
12:59technomancy(and to my surprise he actually did)
12:59cooldude127lol
12:59cooldude127I'M BORED
12:59duck1123I saw that, I was without IRC access yesterday, so I just read the logs
12:59cooldude127haha
13:00duck1123cooldude127: does your wrapper do xsd:dateTime?
13:00technomancycooldude127: you hear that? you think *you're* bored; duck1123 reads IRC logs in his spare time. =)
13:00cooldude127duck1123: considering i don't have a clue what you mean, i'm going to say no
13:00cooldude127technomancy: lol
13:01duck1123xsd:dateTime is like 2009-01-21T12:59:59.000-05:00
13:01technomancyduck1123: so you mean parsing it out from a string?
13:01cooldude127duck1123: it doesn't do formatting or parsing yet
13:02cooldude127but i think i might go ahead right now and tackle formatting
13:02duck1123it's suprisingly difficult to do with Java's standard date formatting library
13:02cooldude127why?
13:02cooldude127cuz that's my backend :)
13:02duck1123the only real problem was the -05:00 bit, I had to resort to regexp to fix that part
13:03cooldude127shit
13:04duck1123If you can deal with -0500 it's fine, but if you need that colon in there...
13:05cooldude127i think i'm gonna use a multimethod for this. so basically you can define a function for predefined formats, or pass in a string
13:05Chouserrhickey: fwiw, I don't think either of your ideas for mitigating nil-punning pay for themselves. Just yank that band-aid right off.
13:06ChouserI'll stick around and help answer the "this code used to work but now its an infinite loop" questions that'll come up a few times a day for a couple months. :-)
13:07Chouserbut that leaves the "sufficiently safe" part of the question. In what way are merged seq/stream functions potentially dangerous?
13:10rhickeyChouser: ok, thanks for the help (then and now) :)
13:10cooldude127wtf java? DateFormat itself has only three formats to choose from, but the one you give a string with a format is called SimpleDateFormat?
13:10cooldude127i think we have this backwards
13:11rhickeyChouser: I don't think the streams as I've laid them out are dangerous, they sort of let you work with stateful computational segments in a functional manner
13:12cooldude127do multimethods work such that i can specify a method as the default for just one argument? basically only specialize one if i feel like it?
13:13rhickeythe iters themselves are thread-safe, and streams thread-safe-ize any generator
13:13Chousercooldude127: your dispatch function has to take all the args, but it can ignore all but the first one if it wants to.
13:14cooldude127Chouser: but i want to do it on a per-method basis
13:15Chouserthere's no example of how to create a generator at http://clojure.org/streams, right? I'm not overlooking it?
13:15cooldude127say, have (defmethod blah [:default ::something])
13:15cooldude127and have that work as expected
13:15rhickeyso you could, in a computational step, share an iter between worker threads
13:17Chousercooldude127: I don't think so.
13:17cooldude127dammit
13:17Chousercooldude127: I think there was an item on the old todo list for that, but I don't see it on the issues page.
13:17rhickeyChouser: (fn [eos] ...) in filter* and map* are generators
13:18cooldude127Chouser: it's probably not that big a deal, i think i can do without specializing one of them at all for the sake of simplicity
13:18technomancycooldude127: "Simple" is Javanese for "backwards"
13:18cooldude127lol
13:18cooldude127technomancy: i was gonna have formatting functions specialize on both the date type and the format to use, but i'm gonna just do the format
13:19Chousukeno, actually, simple means it only has one method that does everything.
13:19technomancyah. well 1 is certainly simpler than "many".
13:21Chousercooldude127: what are the possible (or likely) types that your second arg was going to take?
13:22cooldude127Chouser: the dates? most of the time it wouldn't matter, but it could be ::Date or ::Time
13:23cooldude127Chouser: doesn't matter, i think it's better with just one
13:23Chousercooldude127: you can have both ::Date and ::Time derive from ::Object or something, and use that instead of :default.
13:23Chouseroh, ok.
13:23cooldude127they actually do derive from the same thing, i guess i just wanted something more intuitive than [::Instant :short]
13:24rhickeyA generator is literally a fn that takes an eos and returns it or something else
13:24Chouserrhickey: ok, I see that now.
13:24rhickeyI should qualify that, once it returns the eos it should always do so
13:25Chouserso for some spots in my program I might be trying to choose between writing a generator vs. a fn that returns a lazy-cons
13:25Chouserwith merged stream/seq fns, the rest of my program might not care if I change my mind later.
13:26rhickeyChouser: the generator must be stateful, but if your data source is too (e.g. a file/queue etc) streams are best fit
13:26rhickeyyes, unified model would make the choice transparent
13:27Chouserfilter* and map* store their state in the stream created by stream-iter?
13:27cooldude127actually, looking at the DateFormat API, it looks like two arguments specialized is the way to go, as java distinguishes formatting dates and times
13:27rhickeybifurcated model you might say (defstream myfun ...) and get myfun and myfun*
13:28Chouserbut the body of myfun would be the generator.
13:28rhickeyChouser: filter and map have no state of their own, but yes, their source iter does
13:28technomancyI'm seeing this pattern a fair amount where I want to move an element from one ref/seq to another. is there a better way to abstract it? (http://gist.github.com/50091)
13:29rhickeyChouser: take/drop might have an atom around their counter
13:29Chouseroh, is 'range' in those examples returning a seq or a stream?
13:30rhickeyChouser: range supports stream directly, but stream already converts colls and seqs
13:31Chousertechnomancy: were you asking the other day about treating seqs of maps as a sort of database, or was that someone else?
13:31rhickeymost of the work for using just about anything as a stream source is done
13:32technomancyChouser: I was asking about that a while ago, yeah. sounds like Lau's project does that?
13:32Chouserso stream fns make streams from seqs, and seq fns make seqs from streams.
13:32rhickeyChouser: right, that's all transparent
13:32Chousertechnomancy: oh, I didn't mean db in the SQL sense.
13:33Chousertechnomancy: just that I've not seen many attempts to use a seq of maps like that, wanted to make sure this was the same app. :-)
13:33Chousertechnomancy: and asking was wiser than trusting my memory and easier than checking the logs.
13:33technomancyChouser: ah, must have been someone else talking about it here. But I am interested in the idea provided Terracotta can provide persistence.
13:34Chouserrhickey: so if merged, the library fns would return the same type as they're given?
13:34rhickeyChouser: (stream coll/stream/seq/fn) all work
13:34rhickeyChouser: if merged the actual type they return would depend on the implementation, a stream implementation would return a stream, a seq one a seq
13:35rhickeyconsumer wouldn't care, but would probably prefer a stream impl for speed
13:35Chousera "stream implementation" of what? just one fn, right?
13:35technomancyChouser: what do you mean you've not seen many attempts to use a seq of maps as a data base? seems like the most natural thing in the world to me.
13:36Chousertechnomancy: using 'remove' like that will remove all matching maps from the seq, right?
13:36Chousertechnomancy: so why not use a set of maps instead of a seq?
13:36rhickeyChouser: yes, a fn like map/filter
13:36technomancyChouser: interesting. In this case I have a guarantee of uniqueness enforced elsewhere, but it definitely wouldn't hurt to use sets here; you're right.
13:37rhickeyamazingly:
13:37technomancysets are underrated.
13:37rhickey(reduce* + 0 (seq (map* inc (seq (filter* even? (range 1000000))))))
13:37rhickeyis still faster than:
13:37rhickey(reduce + 0 (map inc (filter even? (range 1000000))))
13:37Chousertechnomancy: if (:items @*current-room*) were a set of maps, clojure.set gives you a bunch of functions for working this it.
13:38rhickeyand without the intervening seq calls is twice as fast
13:38technomancyChouser: oh, I see. I was looking for something generalized for any seq.
13:39Chouseris there really no way to use different words for map or map (the fn and the collection, respectively)?
13:39technomancyheh
13:39technomancysmalltalk calls map "collect"
13:39technomancy(the function)
13:39technomancyor you could call the seq a hash-map
13:40Chouserrhickey: that is amazing. But I'm still missing something. if 'map' is the one fn for consuming seqs and streams, will it always return a stream?
13:40rhickeyChouser: yes
13:40technomancyChouser: actually... I don't think I should use a set there now since in the future you could have multiple instances of an item in a room.
13:40Chouserrhickey: oh! I see, that was the point of your example. all caught up now. :-)
13:40technomancyso I think I will write my own move-between-seqs function
13:40rhickeyChouser: most of the standard seq fns would in fact be stream-returning
13:40Chousertechnomancy: but then you can't use 'remove' like that.
13:41Carkrhikey : i'm a bit late on the discussion, removing nil punning is imho a step backward from clojure's practicality
13:41technomancyChouser: correct; that will need to be fixed.
13:41Carkrhickey : though i understand why you would want that
13:42rhickeyCark: If I could have it all I would :)
13:42rhickeybut I still can't figure out how - design == tradeoffs :(
13:42Carkyes
13:42rhickeyCark: I like nil punning as much as anyone does
13:43durka42i don't think nil? is that much of a hassle
13:43Carki'll go light a candle on my dead code then =)
13:43Chouserafter fixing the existing code that breaks, though, it's really not any mental burden, and a pretty light syntactic one
13:43Chouserdurka42: seq
13:44Chouseryou already know you're working with potentially some kind of collection but are using it in a boolean context.
13:44durka42oh, you can't use nil? even
13:44durka42right
13:44technomancyI hadn't spotted that, but it definitely is needed.
13:44rhickeyChouser: only CLers will miss it because they already had it there
13:44danleioh
13:45LordOfTheNoobsIs there any way to tell during macro expansion whether a variable is set yet or not without triggering a read error?
13:45Chouseryou already have to make sure that it's not just a collection (since empty collections are true), and instead was returned by something that made a seq for you.
13:45danlei(if nil 1 2) will be 1?
13:45Chouserdanlei: no
13:45durka42no, but (if [] 1 2) will be
13:45Chouserdurka42: already is!
13:45danleisorry, i'm late to the discussion
13:45durka42bah
13:45danleihm ..
13:45durka42i thought i understood nil punning
13:46rhickeyChouser: true, but all seq fns did that (returned a seq), plus there is the non-local test, using seq fns as predicates
13:46Chouser(if (rest [9]) 1 2) is currently 2, but without nil punning would be 1
13:46durka42isn't calling seq going to be inefficient, since if the collection isn't empty it's going to walk the whole seq?
13:46danleithanks, chouser
13:47rhickeydurka42: no, seq is fast O(1)
13:47ChouserI've already spent the time to check and make sure that when destructing like [a b & c :as all] that 'all' doesn't go through 'seq'. How useful is it to know that, and exploit that knowledge?
13:48rhickeyChouser: the reason not to go through seq there is not to transform the type of all
13:48Chouserrhickey: right! but it wouldn't be a rediculous design for it have gone through seq, so I had to check.
13:49Chousermy point is just that you already have to think carefully before relying on nil punning, so never being able to rely on it isn't going to be much of a mental burden for new code.
13:50Chouserthe syntactic burden of (seq x) is pretty minimal in most of the places where it'll be used.
13:50rhickeyChouser: true, not a burden, just a lost convenience
13:51ChousukeI doubt it'd alienate anyone from clojure either. :/
13:51LordOfTheNoobsnevermind. (ns-resolve namespace symbol) will do, i think.
13:51rhickeyWhen not a funny poem, this is also a cautionary tale; http://people.cs.uchicago.edu/~wiseman/humor/large-programs.html
13:51ChouserLordOfTheNoobs: sorry, you asked at a busy moment
13:52ChouserLordOfTheNoobs: you have a symbol. you saw 'defonce' and 'resolve'?
13:52durka42hehe, hackstincts
13:52technomancyoh cool, the clojure-mode.el guy is no longer MIA. =)
13:53cooldude127OH SHIT, clojure doesn't do isa? recursively through vectors
13:53cooldude127wait, i can make this work
13:53Lau_of_DKrhickey: What is it you like so much about that poem? :)
13:53technomancyLau_of_DK: so your keyword additions should make it upstream soon.
13:53rhickeyLau_of_DK: besides the fact that it rhymes?
13:53Lau_of_DKYea - besides that
13:54Chousercooldude127: are you sure?
13:54cooldude127yeah, turns out the case where i want it to do that is also the overall default case
13:54LordOfTheNoobsI had not seen defonce. It may be useful. Thank you Chouser.
13:54rhickeyit touches on a difference in approach between Scheme/T programmers and CLers, re: purity and pragmatism
13:55technomancywhat's t3?
13:55Chouser,(isa? [::Period ::Time] [::Time ::Time])
13:55clojurebottrue
13:55Lau_of_DKOh I see :) I guess youre right, but we might have to counter with a clojure-rhyme to make it really obvious
13:55rhickeytechnomancy: T was a Scheme-like lisp dialect from Yale
13:56technomancyah
13:56rhickeyT3 the latest version
13:56rhickeyNote this is 20+ years old and we're still talking about the same things, sigh
13:57Lau_of_DKhehe, we were all waitin for you Rich :)
13:57Chouserthat poem's moral might be more obvious to me if I could make sense of the code.
13:57Lau_of_DKWhy did you have to waste all those years playing music?
13:57Chouserheh
13:57Chousukeoh, heh
13:57Chousukethat posting is older than I am :(
13:57technomancyChouser: CL is weeeird
13:57technomancyall trying to save on bytes by picking short function names
13:58rhickeyChouser: it is just highlighting the loss of nil punning in a language that not only had no nil pun, but no nil/false, and no anything-else/truth
13:58rhickeyand the corresponding growth of the code, with no increase in clarity
13:58cooldude127who wants hot date formatting action? http://gist.github.com/49656
13:58ChouserI'm guessing key and a-list are formal args to the fn being defined, and assq is a builtin fn
13:59ChousukeI wonder what it does though
13:59Chouser=> looks like infix, which is confounding.
13:59danleiseems like assoc
13:59danleia lookup
13:59danleimean cl's assoc
14:00durka42Chouser: clojure has :>> or something in condp, right?
14:00Chousukeassociative-list-query? :p
14:00rhickeyhttp://www.delorie.com/gnu/docs/elisp-manual-21/elisp_89.html
14:00Chouserdurka42: yes. also confounding. :-)
14:00Lau_of_DKdurka42: Right - We still dont know who put that smiley in there :(
14:00danlei(assoc 'a '((a . 2))) -> (a . 2)
14:00cooldude127duck1123: http://gist.github.com/49656 how's this for formatting date? i haven't done the format you were talking about, but it could be done with another defmethod. this way there is a uniform way to add formats
14:01technomancywhenever I read too much CL code that tries to save bytes or do other things that made sense in the 80s I always feel like I'm in that music video "Take On Me"
14:01cooldude127technomancy: lol
14:02technomancy(I visualize filesystem functions that support platforms that were on their way out when I was born as big hair.)
14:02technomancyand case-insensitivity as synths
14:02durka42well it's good we have advanced past the dark time when so many were insensitive to case
14:03Chouserah, assq is find and cdr (in this case) is val
14:03technomancycdr is rest
14:03danleiyes
14:03Lau_of_DKChouser: You never lived in the whole car/cdr world?
14:03Chouseryes, I did actually know that.
14:04danlei (cer (assoc 'a '((a . 1) (b . 2))) 1
14:04danlei*cdr
14:04Chouserbut please don't ask me to expand cdaddr
14:05rhickeyan a-list implies a list of pairs
14:05Lau_of_DKIts just a name convention that simplifies alot of stuff Chous'. Instead of parsing seqs to get specific values, you can just (caddardrrarcar seq) and get exactly what you want
14:05rhickeyassoc/assq returns the pair with that key, but he only wants the val, thus cdr, second part of the pair
14:06rhickeybut when not found, assoc/assq returns nil, and in T, (cdr nil) fails
14:07rhickeyso he tries calling cdr conditionally, but T cond fails if no match
14:07Chouseryep, i'm all good up to the second-to-last version
14:07Lau_of_DKrhickey: I didnt really understand - was there no way to obtain those 2x 4x speedgains and integrate streams without giving up nil-punning?
14:07duck1123cooldude127: looks pretty good. I look forward to replacing my date formatting code with something a bit prettier.
14:08rhickeyso he tries to add an else, but cond still failed since nil was not false
14:08cooldude127duck1123: i might restructure the types so that ::Time is just a time, and have ::DateTime be what ::Time is now
14:08rhickeyso he has to capture the value, and test for nil-ness
14:09Chouserfantastic.
14:09rhickeyLau_of_DK: do you find it easy to find 2-4x speed gains?
14:10rhickeyChouser: scary
14:10ChouserI prefer (my-map my-key), personally. :-)
14:10ChousukeI like (key map) if key is a keyword.
14:10rhickeyme too, and lots of those puns will still be in Clojure, (rest nil), nil/false, cond defaults etc
14:11technomancyLau_of_DK: have you noticed imenu misses a lot of defns in clojure-mode?
14:11Lau_of_DKrhickey: No I certainly dont. I just wasnt sure if there was a 3.rd alternative
14:11rhickeyso it won't be that bad
14:11Chouser,(key map)
14:11clojurebotjava.lang.ClassCastException: clojure.core$map__3546 cannot be cast to java.util.Map$Entry
14:11Lau_of_DKtechnomancy: no
14:11duck1123cooldude127: That would probably be the best way. You might also put in common formats like :xsd:dateTime and :rfc822
14:12technomancyLau_of_DK: do you not use imenu, or has it just worked fine for you?
14:12rhickeyLau_of_DK: it ends up there are fundamental relationships between mutability, memory usage, and laziness
14:12cooldude127duck1123: yeah that was the plan. it will be very easy to do that now
14:12Chouserrhickey: right, but I can see why you would want to keep the kind of progressive failure shown by that poem firmly in mind.
14:12Lau_of_DKtechnomancy: I just dont use it/know what it is
14:12rhickeyChouser: exactly
14:12Lau_of_DKrhickey: k
14:12technomancyLau_of_DK: you should check it out some time; it's handy when it works. =)
14:13technomancyit gives you an index of all the defns in the current buffer so you can jump to them easily
14:13Lau_of_DKlink?
14:13rhickeyChouser: because people have asked for each of those T 'features' individually before
14:13technomancyLau_of_DK: do you ido? the ido version is much nicer if you use it
14:14Lau_of_DKido, imenu..what are you talking about!? :)
14:14cooldude127EMACS :)
14:14duck1123cooldude127: It would also be cool if you could do things like (now ::Time) or (now ::Date) <-- replaces (today)
14:15danleihm ...
14:15durka42that sounds like a multimethod to me
14:15danleiif (if nil 1 2) is 2, and it will stay like that
14:15cooldude127durka42: woohoo another case for multimethods!
14:15cooldude127i'm addicted to them
14:15danleibut (if (rest [1]) 1 2) will be 1
14:16cooldude127shit that was for duck1123
14:16danleiwhat exactly will (rest [1]) return?
14:16technomancyif so see the ido-imenu function here: http://github.com/technomancy/emacs-starter-kit/blob/29eb6f508dac5486f0790f4ecb8744bc5920f9df/starter-kit-defuns.el
14:16technomancyLau_of_DK: otherwise just M-x imenu in a non-clojure buffer
14:16danleii think i don't really get it :)
14:16rhickeydanlei: something you could call seq or stream on
14:17rhickey(rest anything) would return something you could call seq or stream on
14:17danleisag what will i have to use to test for emptyness? not nil? i guess ...
14:17rhickeydanlei: seq
14:17technomancyLau_of_DK: weren't you working with me on clojure-mode.el? was that someone else?
14:17rhickeyjust like now
14:18Lau_of_DKtechnomancy: I sure am :)
14:18danleihm .. ok
14:18Chousukedanlei: (if (seq (rest [1])) 1 2) -> 2
14:18stuhood'scuse me... is it possible to get the Var that points to the current function, so that I could have the function print out its own docstring?
14:18Chousukehmm
14:18danleii see
14:18danleithanks
14:18rhickey here's what changes - rest and the sequence fns return a logical-collection, on which you can call seq or stream
14:19duck1123technomancy: is imenu working for you in clojure-mode? I've never been able to get it working right
14:19rhickeyseq will still return a seq object with a valid first, or nil
14:19danleiok
14:19technomancyduck1123: it doesn't work for me either; looking at clojure-mode.el makes me think it was never supported.
14:20rhickeyI could make it so rest still returns nil, and a new fn (more aseq) returned a logical collection
14:20duck1123I would love to have semantic support for clojure. I miss the function names along the side when using ecb
14:20danleiwell,
14:21danleiif you ask me ... i'd like (rest [1]) to return nil, but that's just me
14:21technomancyduck1123: does ECB just rely on imenu?
14:21technomancyduck1123: I'm not likely to fix ECB support itself, but if it relies on imenu, I'm definitely going to try to fix that.
14:21danleii'm not sure if i understand, why you will change it, in the first place
14:22duck1123I think it uses whatever underlying support that imenu uses
14:22technomancyduck1123: cool
14:23duck1123ecb is handy with clojure because you can set it so the slime repl is a compilation buffer. (and thus stays in a certain place)
14:24cooldude127duck1123: WHAT?
14:24cooldude127i didn't know you could do that
14:24technomancyseems like you could do that without ECB
14:24technomancysince ECB does a *lot* of stuff I don't care about. =)
14:24duck1123I think I had to set a regex to match the buffer name, let me look it up
14:25duck1123I keep it off 90% of the time, but every now and then it's handy
14:25cooldude127right now 1/4 of my screen is this chat buffer, 1/8 is slime repl, 1/8 is a bitlbee aim chat, and the whole right half is my date library file
14:26duck1123ecb-compilation-buffer-names
14:31durka42does add-classpath work?
14:31duck1123durka42: it'll always return nil, but it does work
14:31durka42hmm
14:32technomancyduck1123: what kinds of defs should imenu index? def, defn, defn-... any others?
14:32cooldude127technomancy: defmacro?
14:32Chouserdefmulti
14:32duck1123hell, def.*
14:32cooldude127defmethod
14:33technomancymaybe def[-a-z]*
14:33cooldude127that could work
14:34duck1123Chance are, if you're working with a file with a lot of def* forms, you want easy access to those forms.
14:35cooldude127technomancy: does what you're doing affect what shows up with ido-goto-symbol from your starter kit? cuz all i get are any defmethods and defmacros, prolly cuz they are standard CL names
14:36technomancycooldude127: it should fix that, yeah
14:36durka42-cp seems to work where add-classpath fails
14:36cooldude127technomancy: awesome
14:36durka42which seems strange because i thought they were equivalent
14:36duck1123durka42: what are you trying to do?
14:36technomancydurka42: for clojure code or for java jars?
14:37durka42clojure and java jars
14:37durka42i'm trying to use compojure
14:37technomancyare you up to date? a bug in add-classpath was fixed a couple weeks ago
14:37duck1123if you are adding a clojure source directory, make sure you end with a slash
14:37durka42yeah, i'm up to date
14:37durka42hmm
14:38duck1123ie (add-classpath "file:///home/duck/compojure/src/clojure/")
14:40durka42no, it still won't find the compojure jars
14:40durka42even if i explicitly name them
14:41duck1123durka42: Are you running this with jetty? If so, have you tried the old launcher script? (should still work)
14:41durka42the one on wikibooks?
14:42duck1123haven't seen the wiki in a while...
14:43durka42are you referring to this script http://en.wikibooks.org/wiki/Compojure/Getting_Started
14:43duck1123durka42: That looks pretty close to what I have, but mine had a whole lot more
14:44AWizzArdclojurebot: max people
14:44clojurebotmax people is 128
14:45ChouserIs this supposed to work? (definline add [x y] `(+ ~x ~y))
14:45duck1123http://gist.github.com/50145 is my old script/repl file. (I only launch as a servlet now)
14:47karmazillanewsflash: Users world-wide exclaim their excitement! New chunking undo and platform dependent control-key in textjure* is all the rage.
14:48hiredman!
14:49karmazillaYes. Both of them :)
14:51durka42duck1123: yes, that script, with everything added explicitly to the classpath, works. so my problem is solved. it just irks me that (1) add-classpath doesn't work with the same paths as -cp, and (2) the directory above compojure/deps is on the classpath already and there isn't any recursive magic (but i suppose that isn't clojure's fault)
14:53danleido i understand right, that the removal of nil-punning is due to performance issues?
14:53danleiand is there already something up to read about the stream stuff?
14:54Chouserthe removal of nil-punning is not yet decided I think, and there are several options on the table that could yet save nil-punning.
14:54Chousukedanlei: as far as I understand it's to enable unification of stream and seq functions.
14:54Chouserdanlei: http://clojure.org/streams
14:54Chousukethat LFE stuff went way over my head though :/
14:54danleioh, thats already updated to the changes?
14:54danleii'll read it up then, thanks
14:55danleibut i understand right, that that will affect all the seq functions
14:55danleisag so i'll have to stick a seq in front of ... for example (filter #(< 0 %) [1 2 3])
14:57Chousukeonly if you want a seq of it.
14:57danleii mean
14:57danleinow it would return nil
14:57danleibut if i understand right
14:58danleisag it will return a "logical stream"?
14:58Chouserdanlei: what's "sag"?
14:58danleisag and if i want to test it, i'll have to use seq, right?
14:58danleisag oh
14:58danleisag sorry
14:58Chousukewhat.
14:58danleijust ignore it
14:59durka42"a stream will ensure that it only has one iter" -- or else what? does the second thread requesting an iter get an exception? block?
14:59danleiso (if (filter ... will become (if (seq (filter ...
14:59Chousukeyeah
14:59hiredmankarmazilla: most impressive
14:59hiredmanhow do I quit textjure?
14:59technomancydoes this look like a reasonable way to match all def*s? "^\\s *\\((def[^ \t\n]*\\s *\\([-a-zA-Z]+\\)\\)"
14:59karmazillacontrol-Q
14:59technomancy(apart from the fact that Emacs regexs are insane)
14:59karmazillaor alt-F4, or whatever kills a window
15:00technomancyduck1123, Lau_of_DK: ^
15:00hiredmanI see
15:00Chouserdanlei: if stream and seq functions are merged (not yet decided) and no other mitigation options are used (not yet decided) and you use a seq function like 'filter' and you want to know if it's returning an empty thing or not, you will then have to say (if (seq (filter... instead of (if (filter ...
15:00durka42technomancy: on stupid platforms you might need to throw \r in there
15:00technomancydurka42: good catch; thanks
15:00danleiChouser: ok, so i got it right
15:00technomancy[-a-zA-Z] is probably not permissive enough for symbols though
15:00danleiChouser: then,
15:00technomancymaybe I should just use non-whitespace for that again
15:01karmazillahiredman: you can close files and undo... now you want to quit it too?!?
15:01durka42i think so, yes
15:01danleiChouser: richs idea about rest still returning nil and introducing "more" or something
15:01danleiChouser: wouldn't buy that much
15:01durka42karmazilla: i want to recall previous expressions in the repl
15:01karmazillame too :(
15:02Chouserdanlei: that was my conclusion as well
15:02Chouserdanlei: and the other option (of making boolean tests take end-ness as false) scares me
15:02danleiChouser: yes, if thats the way it will be, rest should return that "logical stream" to
15:02danlei*too
15:03Chouserdurka42: like *1 or arrow-up?
15:03durka42i was talking about arrow-up, but both of those are nice
15:04danleiChouser: why exactly does that scare you?
15:04durka42or an ipython-like thing where there's an infinite history (a vector) instead of *1 *2 *3
15:04Chouserdurka42: the problem with that is it'll never let any of those values be gc'd
15:05durka42hmm, true
15:05Chouserbut yes, arrow-up history is definitely needed. but did you notice the automatic multi-line input support?
15:06durka42i did
15:06cooldude127anybody know why C-c C-k doesn't work in slime w/ clojure? or do i need to update my stuff?
15:06durka42but i shall mercilessly compare it to gorilla, which has the same thing but the multiple lines are indented
15:06Chouserso I guess history recall should be triggered when you try to go above the top line or below the bottom line?
15:07Chouserdurka42: ah, good. I haven't tried recent version of gorilla.
15:07durka42or it could be something like M-up (i would suggest C-up but that doesn't work on OSX because Spaces grabs it)
15:07durka42not above the top line -- you want to recall the history with the cursor on the last line
15:08drewrcooldude127: Never had a problem with it. What error do you get?
15:08StartsWithKrhickey: hi, in clojure api docs (add-watch a watcher callback) should be add-watcher.
15:08drewrStartsWithK: Probably should open a ticket.
15:08drewr(with patch :-))
15:08cooldude127drewr: java.lang.IllegalArgumentException: Wrong number of args passed to: basic$compile-file-for-emacs (NO_SOURCE_FILE:0)
15:09Chousercurrntly the cursor can go up into the history -- would it be acceptible to provide simple hotkeys to go up an input-expression at a time, and then to re-send the block under the cursor to the repl again?
15:09danleiChouser: wouldn't (if "", (if {}, (if [], (if ... returning true be the "right thing" in most use cases?
15:09ChouserStartsWithK: the web pages are meant to document the previous release, not svn head.
15:09danleiChouser: oh ... returning false, sorry
15:10teJust bought the Clojure book from pragprog -- I'd like to get Gorilla working
15:10teDo you guys suggest emacs instead?
15:10Lau_of_DKYES
15:10Chouserdanlei: I used to think so, and was pleased by Python's support for this. But a little programming in ruby convinced me the simplicity of its rules are better.
15:10cooldude127what's gorilla?
15:10Chouserte: naw
15:10durka42Chouser: oh, that could work. i was thinking press M-Up and the previous expression appears under the cursor, press M-Up again to back further, fix the error on the current line, and press enter to send it again
15:10Lau_of_DKte: Without the shadow of a doubt, do not get yourself into Vim :)
15:10durka42cooldude127: kotarak's vim mode for clojure
15:11danleiChouser: can you elaborate on why you think it's better?
15:11cooldude127ok C-c C-k works again after updating all my clojure stuff
15:11teUgh -- Tying a language to a specific editor is such a shit way of building a programming language
15:11durka42Gorilla is pretty cool
15:11teI'm gonna try out Gorilla and if all else fails I guess I'll go with Emacs, but that's definitely my worst case scenario
15:11danleiChouser: i mean: in 90% of the cases that would be exactly what you need
15:11teI'm not a fan
15:12Lau_of_DKdurka42: Gorilla is very cool - But Vim is an artifact thats not really comparable to Emacs to be quite honest
15:12RaynesThere is a netbeans plugin, in development, but it's there.
15:12durka42yeah, about that... i installed it and now netbeans doesn't start :(
15:12cooldude127enclojure?
15:12Chouserdanlei: when each type of object can define it's own meaning for 'falseness', it makes it harder to read code.
15:13cooldude127yeah that sounds insane
15:13RaynesIt doesn't work on windows with the current binary release, it is fixed in the SVN and the newest binary release will be at the end of the month.
15:13Chouserdanlei: when is a Date false? never? when it's midnight jan 1 1970?
15:13cooldude127NEVER
15:13danleiChouser: hm .. ok, maybe it's just a personal preference
15:14danleiChouser: just if the structure holding the date is empty
15:14cooldude127with my date library, that is never the case
15:14cooldude127:)
15:14Chouserdanlei: when is a socket false? when there's no more data, or only when the connection has been close, or only when it hasn't ever been opened?
15:15danleiChouser: i'd say: the rule only holds for entitys for which "empty" is an attribute that makes sense
15:15danleiChouser: but i do see your point
15:15Chousereach of these questions is addressed if you have a simple rule like only nil and false are false. Then code ends up like (if (empty? coll)... and (if (invalid? date)... and (if (closed? socket) ...
15:16cooldude127which is much easier to read
15:16karmazilladurka42: I was thinking about making meta-up for going back in repl history. I find it annoying that this might not work on leopard :(
15:17Chouserdanlei: The problem is once the meaning of falseness is dependent on the type of object, people will want their own new types to define their own new meanings
15:17durka42meta is fine, assuming meta is option or the apple key
15:17danleiChouser: that sounds reasonable ... but i must say, i doubt that it would be a problem for me, if things for which "empty" is clearly defined would be false, if they contain nothing
15:17durka42control-arrow keys are taken
15:17durka42unless spaces is configurable
15:17karmazilladurka42: it's the Command (apple) key
15:17danleiChouser: i see, you have some strong points
15:18teI don't have clojure-contrib.jar with my macports install of clojure
15:18cooldude127durka42: spaces is configurable, but i think most would rather leave spaces alone
15:18durka42karmazilla: oh, you can change the modifier for spaces, too
15:18teit seems necessary to use gorilla.jar
15:18danleiChouser: but, from a pragmatic point of view, i don't think i'm convinced
15:18durka42i think the default is control, because i don't remember changing it
15:18danleiChouser: it sure wold be "cleaner"
15:18cooldude127clojure is in macports?
15:18cooldude127wow it is :)
15:18durka42te: i don't know about macports, but contrib is a separate svn repo from clojure core
15:18cooldude127te: you need to check that out separately
15:19tecooldude127: durka42 thanks
15:19durka4220080916 sounds rather old
15:19durka42is that before the google code migration?
15:19cooldude12720081217 is what my macports shows
15:19tei have 80916 i believe
15:19cooldude127i use an svn checkout, but i did port search
15:19tei just pulled clojure down
15:19danleiChouser: thank you for the explanation of your pov
15:20cooldude127te: might want to do a port selfupdate
15:20Chouserdanlei: I think that's my best argument, and if you're not convinced, that's fine. Like I said, I thought it was a feature of Python for quite a while, and later decided it was a mis-feature.
15:20hiredmanclojurebot: latest?
15:20clojurebotlatest is 1221
15:20ChouserBut it's certainly a trade-off, one way or the other.
15:20cooldude127well wtf does that mean
15:20tecooldude127: good idea, doing it right now
15:20durka42well, (date (clojurebot latest)) is 20090121, isn't it
15:20hiredmanthe latest svn rev is 1221
15:20tethere it goes -- 1217
15:21danleiChouser: i understand. i think it really boils down to personal preferences, or "taste", if you will
15:21durka4220081217 refers to a date, and is not related to rev #1221...
15:21cooldude127yes
15:21cooldude127who knows what svn rev that is
15:22durka421173 or thereabouts
15:22hiredmanmost likely 1173
15:22cooldude127oh
15:22hiredmansvn rev 1173
15:22clojurebotsvn rev 1173; updated readme with run and build lines
15:22cooldude127that's not terrible
15:23Chouserdanlei: either that or one of us is wrong but doesn't know it yet. ;-)
15:23cooldude127lol
15:25tehow do I install clojure-contrib on top of clojure.jar
15:25tefrom macports, that is
15:25cooldude127te: checkout clojure-contrib from svn, run ant, and then add clojure-contrib.jar to your classpath
15:26durka42i wonder if latest contrib will play nice with non-latest core
15:26te^^was wondering that myself
15:26cooldude127te is gonna find out :)
15:26te:)
15:26tecooldude127: sorry again, total noob here, how do i modify my classpath
15:26teis there a file or something?
15:27durka42there is an environment variable, $CLASSPATH
15:27cooldude127te: depends on how you're using clojure
15:27durka42also you can path arguments to java
15:27durka42namely -cp
15:27cooldude127te: by your noobness, i assume you're not using emacs
15:27tecorrect sir, in fact, the whole reason im doing this is because id like to start playing with gorilla
15:27teto find out if emacs == necessity
15:28durka42contrib comes with a launch script for bash
15:28cooldude127oh. well idk how gorilla runs clojure or if it just connects to it
15:28durka42gorilla relies on contrib/stream-repl
15:28cooldude127oh
15:28cooldude127this may be outside my expertise
15:29durka42te: are you on linux?
15:29cooldude127he's on os x
15:29cooldude127macports
15:29te^^
15:29durka42oh, right
15:29durka42that
15:29temy clojure.jar is in /opt/local/share/java/clojure/lib/
15:30tecan i just go ahead and move clojure-contrib.jar to that location
15:30tealong with the classes directory?
15:30durka42don't need the classes directory, it's packed into the jar
15:30cooldude127te: the jar should be all that is necessary
15:30durka42but can you launch clojure currently?
15:30teokay cool -- so i can just move her in?
15:30durka42without modifying the classpath
15:30tedurka42: yeah macports makes a little clj.sh script
15:30teclj from the command like runs the REPL
15:30teline*
15:31cooldude127huh, maybe you could paste that script?
15:31durka42lisppaste8: url?
15:31tesure, let me look
15:31lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
15:31tethanks
15:32lisppaste8te pasted "clj macports" at http://paste.lisp.org/display/73989
15:33cooldude127te: this file on its own won't do it
15:33teso maybe i need to add a couple lines to exec java -classpath $cljcontrib
15:33te?
15:33cooldude127te: need to do -classpath $cljjar:/path/to/clojure-contrib.jar ...
15:33durka42what he said
15:35tecooldude127: ah-ha okay
15:35terunning clj...
15:35cooldude127duck1123: how would you think date parsing should work? i realized that java's stuff parses differently for dates, datetimes, and times, so should i do something like (parse-date "2/4/2009" ::Date :short) ? or is that too complex?
15:36cooldude127duck1123: or maybe (parse-dat "2/4/2009" :short-date)
15:37karmazillahow about something like datejs?
15:37cooldude127karmazilla: huh?
15:37karmazillacooldude127: http://www.datejs.com/
15:37duck1123cooldude127: That looks reasonable, I prefer the first one.
15:37tecooldude127: like this? exec java -classpath $cljjar $cljclass $cljjar:/opt/local/share/java/clojure/lib/clojure-contrib.jar
15:38cooldude127te: colon-separated for the classpath
15:38teit is colon separated? no?
15:39cooldude127te: exec java -classpath $cljjar:/opt/local/share/java/clojure/lib/clojure-contrib.jar $cljclass
15:39teah, okay, that's what you mean
15:40cooldude127sorry i didn't see the part that was before
15:40teno problem
15:40cooldude127karmazilla: that's a little over my head
15:40teokay it runs, now to check if it worked...
15:40tecooldude127: how can i make sure i loaded contrib?
15:40cooldude127duck1123: the reason for the second one is that otherwise there is a different arglist for string formats and built-in ones
15:41cooldude127te: (use 'clojure.contrib.def)
15:41karmazillacooldude127: and I imagine that i18n won't make it easier. Yet, it would be pretty cool, methinks :)
15:41duck1123what would a built in one look like?
15:42cooldude127duck1123: the short, medium, long ones
15:42cooldude127(parse-date "2/4/2009" :short-date)
15:42cooldude127vs.
15:42durka42sorry about that
15:42durka42ran out of battery life
15:42cooldude127(parse-date "2/4/2009" "m/d/yyyy")
15:42cooldude127i don't know if either of those are right formats but you get what i mean
15:43durka42te: what did i miss?
15:43hiredmancooldude127: where is this date gist?
15:43duck1123how about (parse-date "2/4/2009" [::Date :short])
15:44cooldude127duck1123: i thought about that
15:44cooldude127hiredman: http://gist.github.com/49656
15:45duck1123or reverse the order, make the default for the last param be DateTime
15:45cooldude127duck1123: what happens to ::Date tho once we are outside the clojure.contrib.date namespace
15:46tebleh lots of errors
15:46cooldude127te: it didn't work then
15:46teit ran with clojure-contrib alright
15:46tebut gorilla.jar not so much
15:46cooldude127 oh
15:46duck1123would it matter? I thought that was a difference between symbols and keywords
15:46tei added to that cljjar line like this:
15:47teexec java -classpath $cljjar:/path/to/clj-contrib.jar:gorilla.jar de.kotka.gorilla $cljclass
15:47cooldude127duck1123: ::Date makes it resolve to :clojure.contrib.date/Date
15:47tei put gorilla.jar into my lib folder
15:47teperhaps i need to specify the full path
15:47durka42need the full/path/to/gorilla.jar again
15:47cooldude127te: i would do that
15:47cooldude127te: in the user package, ::Date becomes :user/Date
15:48cooldude127no not te
15:48cooldude127duck1123: last message i sent to te
15:48teCaused by: java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol (repl_ln.clj:0)
15:48teyucky
15:48cooldude127te: might want to try an up-to-date clojure
15:48teyeah im going to do that right now
15:49durka42repl_ln.clj:0 is most likely an ns line... did that change recently?
15:49tesorry for all the issues, i appreciate the hell
15:49durka42i get te's error when i do (ns 'stuff) instead of (ns stuff)
15:49tehelp*
15:49tehell, too :)
15:49cooldude127lol
15:49karmazillate: if you plan on trying Emacs after gorilla, then textjure might have grown into a fully featured editor by the time you're done :P
15:49teHAHAHA
15:49teoh wait, not laughing at texture
15:50cooldude127lol
15:50tei read that as, "if you have enough problems, maybe you'll start using emacs"
15:50te:)
15:50cooldude127emacs is good :)
15:50cooldude127slime is good
15:50tei just suck at Emacs and don't want to learn it if i can avoid it :)
15:51cooldude127te: which one of us has a working clojure repl ? ;)
15:51ChouserI usually use neither emacs nor gorilla.
15:51ChouserI should do a little screencast or something.
15:51cooldude127Chouser: screencasts are always good
15:52ChouserThough nobody wants to do it my way either, it would just be to prove it's possible. ;-)
15:52gnuvinceChouser: and then you should install Emacs and Slime ;)
15:52karmazillaChouser: what editor do you use? (don't tell me it's pico)
15:52hiredmanthere is a slime.vim that uses screen to send code to a repl
15:52ChouserI use vim
15:52hiredmanit works ok, it is what I use
15:52Chouserhiredman: really? I was sure you used emacs.
15:53cooldude127is there a short way to get to symbols like ::Date from an outside package?
15:53hiredmanhell no
15:53cooldude127ok i'll bbiab, have to leave class :)
15:53mattrepldoes vim have anything like paredit for basic structural editing?
15:53duck1123cooldude127: it looks like aliases work (ie. ::date/Date
15:53hiredmancooldude127: keyword
15:53durka42mattrepl: yes and no, there is surround.vim
15:53Chousercooldude127: not right now. If you look way back to when you started with 'derive' today, you'll see Rich metioned using `Date
15:54durka42mattrepl: in paredit option-shift-(, in vim (in command mode) ys%)
15:54Chousuke::date/Date? :/
15:54Chousukethat looks wrong; should be :date/Date
15:55durka42mattrepl: but it doesn't have ( bound to make ()
15:55duck1123if you alias clojure.contrib.date to date, then ::date/Date will return ::clojure.contrib.date/Date
15:55Chousukeah, it's smart?
15:56duck1123correction :clojure.contrib.date/Date
15:56mattrepldoes it have the ability to yank a sexp? or move the level of a pair?
15:56hiredmanduck1123: with surround.vim "(" makes "()" and other brackets are pound similarly
15:57hiredmanhttp://groups.google.com/group/comp.lang.lisp/msg/81a24e488491e8ff <-- c.l.l posting on lisp+vim tips
15:57durka42hiredman: it does? mine doesn't :\
15:57mattreplhiredman: thanks
15:58hiredmandurka42: huh, maybe that is not surround.vim then
15:58hiredmanmine does that
15:58hiredmanmaybe autoclose.vim?
15:59hiredmanah
15:59hiredmanyes, autoclose.vim http://www.vim.org/scripts/script.php?script_id=1849
15:59durka42yanking an s-exp would just be y% with the cursor on one of the parens
16:01teSomething is screwy with gorilla :\
16:01teI have the current clojure.jar and clojure-contrib.jar, setup the local.properties file in gorilla's dir, run ant, tons of errors
16:02durka42does the local.properties file have the correct paths? :)
16:02duck1123has anyone tried to build clj-doc recently?
16:02durka42what kinds of errors
16:03tedurka42: yeah paths are correct
16:03erohtarhi - i was wondering if there is any way to 'undef' something
16:03durka42(doc ns-unmap)
16:03clojurebotRemoves the mappings for the symbol from the namespace.; arglists ([ns sym])
16:04erohtardurka42: thanks
16:04durka42te: hmm, do you want to pastebin some of the errors
16:04tedurka42: [java] java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol (repl_ln.clj:15)
16:04tethats #1
16:05tecould it be my java setup at this point?
16:05durka42it could be the fact that you don't have the latest clojure.core
16:05durka42let me port install and see
16:06tedurka42: i updated to latest
16:06durka42oh
16:06tei have the latest clojure and clojure-contrib, trying toget gorilla working, triedf the stable gorilla, and now the development versions
16:06teboth spit out errors
16:07temaybe i need the new ant?
16:07durka42no, that's a clojure error i think
16:08durka42i am thinking the old clojure is still getting used somehow
16:09durka42i get that error using the macports one but not using the latest one
16:09tei blew away the old clojure
16:09durka42and you have the latest from google code
16:09tenod
16:11durka42so you run ant in the contrib directory and it spits out that error
16:11LordOfTheNoobs<tech-support-voice> did you leave the old clojure running? </>
16:11tedurka42: no my contrib is compiled
16:11tei then moved it to my ~/clojure directory
16:11teto be with clojure.jar
16:11teim talking about building the gorilla.jar
16:12teit tells me build successful, but i get a mess of errors
16:12karmazillashame you aren't on Windows. It's amazing the kind of issues a reboot can fix on that platform
16:13durka42hmm, try running a repl and use repl-ln
16:13durka42in the directory with clojure.jar, java -cp clojure.jar clojure.main
16:13durka42actually do java -cp clojure.jar:clojure-contrib.jar clojure.main
16:13durka42then type (use 'clojure.contrib.repl-ln)
16:14tejava.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol (repl_ln.clj:0)
16:15durka42then i must insist that your clojure.jar is old
16:15kotarakte: which versions of clojure and contrib are you using?
16:15telet's see, how do i check
16:15kotarakte: where did you get it from?
16:15tegooglecode on both counts
16:16hiredman,(doto "foo" .toUpperCase)
16:16clojurebot"foo"
16:16kotarakThe "december" release?
16:16teclojure_20081217.zip
16:16kotarakok.
16:16kotarakjust a sec
16:16tewant me to try to do this again with contrib?
16:17teerr recompile with contrib, to be sure
16:17tei cant seem to find the original zip i got with contrib in it
16:17durka42i would use the latest clojure svn if that doesn't work
16:17teoh wait, i pulled it from svn
16:17teyeah ill pull the clojure svn and use that with the contrib svn
16:18cooldude`te: that should work, they are happy together
16:18duck1123or http://github.com/kevinoneill/clojure-contrib/zipball/master
16:18kotarakte: you may use Clojure < rev 1192 and contrib < rev 331 and Gorill 1.1.0
16:18kotarakte: later SVN revs with Gorilla 1.1.1
16:19tekotarak: let me try again with the latest contrib/clojure
16:19teshould i try 1.1.1 with those, or the development version?
16:20kotarak1.1.1 is basically identical to dev at the moment.
16:20teokay, ill retry this once i rebuild clojre from svn
16:20kotarakdev is not guaranteed to work at all.
16:21tea simple `ant clean jar`is all i need on the clojure svn repo right?
16:21teno special stuff?
16:22cooldude`te: i think so
16:22kotarakThat should be fine.
16:22FibHm, is there a reason there are fns (not-any?) and (every?) and (not-every?), but no (any?)
16:22ChousukeI think jar depends on clean so "ant jar" should do. maybe even just "ant" :p
16:22teyeah i just ran ant, just wanted to bmake sure there isnt a devil in the details
16:23Chousuke(doc some?)
16:23clojurebotIt's greek to me.
16:23Chousukehmm
16:23Chousukewas it some then :/
16:23Chousuke(doc some)
16:23clojurebotReturns 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 true if :fred is in the sequence, otherwise nil: (some #{:fred} coll); arglists ([pred coll])
16:23FibAh, thanks
16:24teEureka! it compiled kotarak
16:24kotarakte: btw: be warned! Gorilla is... well... not very stable at the moment. I'm working on getting rid of Ruby, though. That should improve the situation.
16:24kotarakte: congrats
16:24cooldude` kotarak: what are you gonna do instead?
16:25tekotarak: is this your project?
16:25tethanks for all your hard work!
16:25kotarakcooldude`: nailgun seems to do the trick.
16:25kotarakte: yep. I'm the author of Gorilla.
16:25tekotarak: what are you going to use instead of ruby
16:25cooldude`kotarak: what's that?
16:26kotarakte, cooldude`: http://www.martiansoftware.com/nailgun/
16:26kotarakBasically command-line interface to a Java server.
16:26teah-ha
16:26tebetter for debugging maybe?
16:26kotarakLet's you build fast unix "commands".
16:26tekotarak: what about Jruby?
16:26cooldude`nifty
16:26tehave you looked at that at all?
16:27kotarakte: no. The Ruby part runs inside Vim. JRuby won't help.
16:27teah
16:27teI played with Jruby a little bit, it's at least a lot faster
16:27Chouserkotarak: ooh, I've been looking for something like nailgun.
16:28kotarakChouser: eclim uses it to make Vim work with Eclipse. :)
16:30Chouserkotarak: does vim have nailgun client built in or something?
16:30durka42(alter-meta! durka assoc :away true)
16:30kotarakChouser: no. You simply call it like a usual unix command.
16:31kotarakstdin, stdout and stderr are forwarded.
16:31kotarakas are command line args.
16:31Chouserso from vim you're "shelling out"
16:31cooldude`i must say, clojure's syntax quote is quite possibly the best thing ever
16:32kotarakChouser: yes. At least more stable (and Vim like) than the Ruby stuff....
16:32Chousukethe biggest complaint about ` I have is that it's a backtick :P
16:32cooldude`lol
16:32cooldude`that's a small complaint
16:32Chousukebut I should be coding with a US layout anyway
16:33tekotarak: how do i connect to the instance of gorilla with vim now?
16:34durka42if you have the plugin loaded, \sr to start a repl
16:34kotarakte: \et to send toplevel expressions, \lw to lookup the docstring of word under the cursor, \sr for starting a repl
16:34kotarakte: There is a help file with all the commands in the doc directory.
16:35tekotarak: yeah, \sr didn't work for me --> ':\sr', right?
16:35durka42no \ is the local leader
16:35durka42if the s just puts you in insert mode, the plugin might not be loaded
16:35Lau_of_DKHow much energy do you guys spend daily, trying to make Vim mimic the awesome power of Emacs just a little bit?
16:35durka42took me a while to get it to load
16:35tedurka42: yeah that's probably it
16:36tei dropped gorilla.vim into ftplugin
16:36tein my ~/vim
16:36Chousuke\ is another character that needs a US layout :/
16:36ChouserLau_of_DK: how many hours have I wasted paging through "I can't get slime working" message on the google group?
16:36durka42Lau_of_DK: and there isn't endless .emacs munging?
16:36Chousukeit's even more painful to type on a finnish layout than `
16:36Lau_of_DKdurka42: No not that Im aware of
16:37Lau_of_DKChouser: I cant say, but I got it working pretty fast
16:37tefuck my vim doesn't have ruby
16:37Lau_of_DKAnyway, SLIME itself shows the superiority of Emacs, that kind of integration of external apps is impossible in Vim, it always ends up being hacks
16:38technomancyLau_of_DK: what are you talking about man vimscript rules
16:38durka42te: oh, also! you have to have .clj file open or the \sr et al mappings aren't loaded
16:38durka42now i really have to go
16:38ChousukeI wish viper.el weren't so buggy though :(
16:38Chousukeit refused to play nice with egg
16:38Lau_of_DKChouser: Is that the sigh of man who knows he's fighting a lost cause?
16:38tedurka42: thanks for all the help
16:38techeers
16:39danleithere is only one problem about emacs: if you manage to lose youre .emacs (which happened to me once), you'll get suicidal :)
16:39cooldude`danlei: github ftw
16:40technomancyindeed; if you're not storing important code in version control, you may very well deserve what you get.
16:41Chouserthe cause of avoiding unhelpful name-calling is indeed almost certainly lost
16:41ChousukeI learned that after I made the mistake of thinking that a one-file project needs no version control
16:41danleii don't have it under version control, and i don't miss it, but i have several backups now (synced often). that won't happen again :)
16:41Chouserbut I will fight on, if through no other means than the occasional emoted sigh
16:41Chousukethough at the time I didn't know of git so setting up a repo would've been painful :/
16:41Lau_of_DKChouser: No body's calling names
16:41rhickeyChouser: lost when?
16:42Chouserrhickey: at the fall of Man, most likely.
16:42Lau_of_DKI just think its an interesting discussion - If you compare writing a book in Notepad vs Word, you have a somewhat accurate description of trying to use Vim for coding compared to Emacs, so its fascinating that some people still linger
16:42teoh god im going to end up learning emacs
16:42teand its going to suck
16:42ecretis it possible to see the jars loaded in the vm when clojure is running?
16:42rhickeyI just hopped on, but am firmly in the no-name-calling camp
16:43Chousukete: viper.el might help you
16:43rhickeyhere and on the group
16:43technomancyte: it's that or learning vimscript
16:43cooldude`is def-java-date-formatter too long a macro name?
16:43Chouserte: you really don't need to. I don't know how much I can help you on the Mac, but I get along just fine using vim with no fancy integrated repl.
16:43Lau_of_DKrhickey: No body is calling anybody anything, Chousers just sad that he's finally realized Vim is inferior to Emacs
16:43ChousukeLau_of_DK: maybe you should stop being so assertive about it :)
16:44Chousukefrom a structural standpoint, emacs is indeed superior, but that doesn't make it any nicer to use ;(
16:45tei dont mean to hate on emacs -- ive tried learning it, but its such an up front cost to learning a language
16:45tei get all excited to learn lisp and its like "oh yeah, dont touch lisp without knowing emacs"
16:45danleirhickey: i've read up on streams and now understand the issue, and its consequences, as far as nil-punning is concerned. sorry for commenting, while being that uninformed. (having thought about it, i, personally, am in favor of the emptyness will act like false in tests proposal)
16:45cooldude`te: i learned it for common lisp. so glad i did :)
16:45teit just kills a lot of the passion of the moment, like "today im going to learn lisp! yay!"
16:45Lau_of_DKI wasnt trying to strike up a flamewar, but in a channel where there are frequently newcomers, there's no sense in "helping" them waste precious time and years in Vim when they can get going in a real IDE from the beginning, I think its quite wrong to give such bad advice
16:45teand then you realize you ahve to learn an editor instead
16:46rhickeydanlei: unfortunately that option is least likely, for performance reasons alone
16:46teit just takes a lot of the fun out of it
16:46iceynow that Clojure is gaining popularity so quickly, has there been any discussion about the creation of a planet.clojure.org?
16:46ChousukeLau_of_DK: see now, that's exactly the wrong way to put it.
16:46hiredmanthere is a yahoo pipe thing that agregates some clojure related feeds
16:46iceyyeah, Bill Clementson's pipe, right?
16:47technomancyte: you could start with elisp. =)
16:47Lau_of_DKte: Dont get all down about it, Emacs is great, when you master it, it'll support you and speed you up like nothing else
16:47hiredmandunno whose it is
16:47Lau_of_DKChousuke: Why do you think so ?
16:47technomancyicey: I was playing around with something actually written in clojure that uses the rome parsing lib
16:47teLau_of_DK: yeah I'm going to learn it I guess, i just think it's kind of a sad state of affairs when langs rely so heavily on editors
16:47tethats my jaded opinion, i suppose
16:47technomancyicey: it worked great, but I haven't gotten around to HTML templating yet.
16:47ChousukeLau_of_DK: you fail to admit that vim has any good qualities.
16:47technomancycan make it public if you want to help
16:48iceytechnomancy: very cool. it'd just be nice to be able to stop in on a planet when making my rounds :D
16:48Lau_of_DKte: Do yourself a big favor and checkout Bill Clements blogposts regarding Emacs + Slime, theyre very good
16:48iceyregarding emacs, the peepcode screncast is pretty decent as well
16:48Chouserte: don't let emacs get in the way of clojure. You don't need it.
16:48technomancyicey: thanks!
16:48Lau_of_DKChousuke: I dont deny it, I just havent come across any of them yet
16:48teChouser: noted
16:48ChousukeLau_of_DK: the modal interface.
16:48cooldude`Chousuke: i'll admit that vim is efficient
16:48iceythat being said, i'm an emacs neophyte; so if there are technical problems with it, I don't know about it.
16:48ChousukeLau_of_DK: it just makes sense.
16:49teill probably end up using the REPL to write code, and then write it down in a separate editor
16:49technomancyicey: lack of concurrency and dynamic binding by default, but they're going to be addressed in the next version
16:49tethats how ive done it with ruby historically
16:49Lau_of_DKte: Go ahead and waste your time if you want
16:49ChouserLau_of_DK: please stop
16:49danleirhickey: well, it's just, what i'd prefer. it surely won't kill me, if i had to use an explicit test. (and chouser had some firm arguments for that) but, btw. if that's the way it will be, i think it would be ok to have rest return a "logical stream". having both, rest and more, wouldn't buy that much.
16:49teLau_of_DK: im an expert on time wasting
16:49Fibclojurebot: paste
16:49clojurebotpaste is http://paste.lisp.org/new/clojure
16:49technomancyLau_of_DK: sheesh; you're not exactly helping
16:49Lau_of_DK:)
16:49ChouserLau_of_DK: learning emacs is a waste of time if your goal is to learn clojure
16:49Lau_of_DKChouser: Dead wrong
16:50tedont worry about him, ive met far more irc'ers with hardcore nerd rage than Lau_of_DK
16:50Lau_of_DKIm not angry, Im just telling you the truth
16:50Lau_of_DKIf you dont want it, thats fine with me :)
16:50tehaha, tbh i just wanted to use the term 'nerd rage'
16:50technomancyit's a good term
16:51ChousukeLau_of_DK: Only Niilo Paasivirta has True Opinions(TM). You are limited to your own opinions
16:51telispers qualify 9/10 for nerg rage
16:51tein my experience
16:51tenerd*
16:51tezerg rage, too
16:51technomancyLau_of_DK: on a more constructive note, I've got imenu support working in clojure-mode, so give it a look.
16:51Chouserbut this isn't just IRC, it's #clojure. We aspire to better than that.
16:51technomancylemme know if it works for you
16:52hiredmanclojurebot: #clojure?
16:52clojurebotclojure is a very attractive hammer with a nice heft to it
16:52technomancycooldude`: were you wanting that too?
16:52cooldude`yes
16:52hiredmanclojurebot: #clojure is <reply>this is not IRC, this is #clojure. We aspire to better than that.
16:52clojurebotc'est bon!
16:52hiredmanclojurebot: #clojure?
16:52rhickeyInteresting JVM/TCO news: http://mail.openjdk.java.net/pipermail/mlvm-dev/2009-January/000331.html
16:52clojurebotthis is not IRC, this is #clojure. We aspire to better than that.
16:52technomancycooldude`: http://github.com/technomancy/clojure-mode/tree/master
16:53technomancyrhickey: wow; that's great. how does stuff percolate up from "prototype" to "openjdk" to "official jdk"?
16:53lisppaste8Fib pasted "zipWith" at http://paste.lisp.org/display/73991
16:54cooldude`technomancy: is there a reason your repo is missing the clojure-paredit and clojure-auto files?
16:54rhickeytechnomancy: still to be seen, but those interested can play with MLVM in progress
16:54FibDoes this look like reasonable clojure style?
16:54technomancycooldude`: it's all inlined now; if you want to enable paredit, you just set a var
16:54cooldude`technomancy: this is your doing?
16:54technomancyit is indeed
16:54cooldude`i must say i rather like that
16:55technomancycooldude`: I like to keep things in as few files as possible as it eases distribution
16:55hiredmantechnomancy: http://weblogs.java.net/blog/robogeek/archive/2009/01/it_will_be_open.html <-- blog post on the relationship between openjdk and sun's jdk releases
16:55technomancycooldude`: also want to push it out to the elisp package archive
16:55technomancyhiredman: thanks
16:55cooldude`technomancy: nifty
16:55cooldude`i use billc's clj-build script to get all my clojure stuff at once, so i wanted to just change the repo i use in that script from jochu's to yours
16:56ChouserFib: not bad. there's no need to put f in the loop, as it can use the original arg
16:56ChouserFib: no need to quote []
16:56technomancycooldude`: jochu has said he's going to pull from mine soon, so that may not be necessary.
16:57tetechnomancy: did you fork jochu's clojure-mode?
16:57technomancyte: I did
16:57cooldude`well i want it now, so even it might be a temporary change
16:57tetechnomancy: hehe just checking which i should grab
16:57technomancycooldude`: but feel free to do whatever. eventually ELPA will be the best place for it
16:57technomancyte: jochu's is the root, but mine is currently more full-featured.
16:57FibChouser: thanks
16:59Chousergenerally functions that build vectors just return them -- if the user passes it to a seq function (like map, filter, etc.) that'll still work, but it leaves open the option of treating it like a vector.
16:59ChouserFib: unless you specifically don't want to promise you'll always be returning a vector.
17:00ChouserFib: and for the record 'map' does essentially the same thing as 'zipWith', but lazily.
17:00cooldude`technomancy: well, it works :) acts weird with some of my macros, but that is probably more my fault for writing weird macros
17:01Fibhmmm
17:01tetechnomancy: -cp /Users/bc/lisp/clojure/clojure/target/clojure-lang-1.0-SNAPSHOT.jar:/Users/bc/.clojure/*:/Users/bc/lisp/clojure/clojure/target/* \ clojure.lang.Repl
17:01tei dont really understand whats going on with target/* and such there
17:01cooldude`but i'll be back later
17:01tei just want to edit Bill's bash script to work for me
17:01tei dont think i even have a .clojure file yet
17:02FibAhh, I see now
17:02Chousukegah :(
17:02Chousukewhy is not egg working
17:02technomancyte: I think he was using an old checkout
17:03Chousukethinks I wnat to write in the buffer when I press U to push changes to an external repo.
17:03technomancyit used to be if you compiled with maven instead of ant, it would put the jar someplace else
17:03technomancycooldude`: some of your macros mess up imenu?
17:03technomancycould I see an example?
17:04technomancyte: you don't need a ~/.clojure dir at all
17:04tetechnomancy: i take it his .clojure/* is where he keeps all of his other jars?
17:04telike swank and such?
17:04technomancyprobably not swank since that's not launched from the shell, but other libs, yes
17:04teerr nevermind
17:05teokay thanks for the help
17:06technomancyte: command-line interaction is definitely a weak spot in clojure right now
17:07rhickeyi.e. (map f coll) ==> (seq (map-stream f coll))
17:08tetechnomancy: here is another question for you, sorry
17:08drewr,(to-array ["foo" "bar"])
17:08clojurebot#<Object[] [Ljava.lang.Object;@1b7a875>
17:08te(add-to-list 'load-path (concat home-dir ".clojure/swank-clojure"))
17:08drewrHow do I get String[]?
17:08tein that instance, if i put swank-clojure/ into .clojure/, will that suffice?
17:09teor is it looking for swank-clojure.el?
17:09rhickey(doc into-array)
17:09clojurebotReturns an array with components set to the values in aseq. The array's component type is type if provided, or the type of the first value in aseq if present, or Object. All values in aseq must be compatible with the component type. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE.; arglists ([aseq] [type aseq])
17:09lisppaste8technomancy pasted "clojure slime setup" at http://paste.lisp.org/display/73992
17:09technomancyte: just pasted what I use
17:09technomancyI keep swank-clojure in ~/src
17:09drewrrhickey: Thanks.
17:10tethe whole directory containing swank-clojure.el and swank-clojure.autoload.el?
17:10teor just those files?
17:10rhickeydrewr: since you have uniform types you don't need to pass a type
17:10technomancyte: the whole git checkout of the swank-clojure repo
17:10teokay that was my issue
17:10tethanks for the paste
17:10technomancyno problem
17:11technomancyte: I'm currently working on a commercial screencast for Clojure that will definitely cover this kind of thing
17:12technomancythough a blog post wouldn't hurt. clementson's is kind of complicated because he wants to support CL at the same time as clojure
17:13teyeah i just want to get started with slime + emacs lickity split
17:13teslime + emacs + clojure of course
17:14technomancyte: the problem with installing stuff manually is that there's no guessable location for these kinds of things, so you can't just toss some code out for other folks to use; it's always going to require a bit of tweaking
17:15teyeah that's a bummer, but a necessary evil i suppose
17:15teportability is a bitch like that
17:15technomancyif I may toot my own horn a bit, you might benefit from the Emacs PeepCode (http://peepcode.com/products/meet-emacs) as well as the Starter Kit (http://github.com/technomancy/emacs-starter-kit.git)
17:16tetechnomancy: im struggling to remember what ive used of yours
17:16technomancybecause of that "not sure where to look" problem, swank-clojure doesn't come with the starter kit, but if you do the checkout and use the code from my paste, you should be good.
17:16tethat was simply bad ass
17:16teticgit?
17:16teditz?
17:16technomancyI played with ditz for a while, but I never ended up contributing any code to it.
17:16tegithub*
17:17technomancymy favourite misspelling is "guthub"
17:17technomancyI had a ditz fork for a while, so you may have used that thinking I wrote it.
17:18technomancymost of my interesting stuff is elisp, though there are some small ruby tools too
17:18teyeah i think it was the preferred fork for awhile
17:18teanyway, i liked ditz a lot
17:18tehavent had much use for it recently
17:18technomancyI should keep forks like that around if people are going to think that I wrote them. =)
17:18tehaha
17:19tetechnomancy: i just may buy that peepcode cast
17:19tei really need to learn emacs
17:19tei spent a lot of time with textmate and vim, always negelcted emacs
17:19tebut lately i want to do lisp and now clojure
17:19teits just a good editor to know enough to use
17:21iceyte: i just bought the peepcode screencast recently; it's good (it was easier for me to learn from than using Learning GNU Emacs)
17:21technomancyI don't have anything against vim, but I think eventually you need to get your hands dirty and modify the behaviour of the editor. And I like Lisp. =)
17:21te:)
17:22iceyI'm a vim guy, but it kind of comes down to the fact that pretty well everything lispy is just better in emacs.
17:22technomancysome day when I have a lot of time on my hands I'm going to sit down and give modal editing a try.
17:22fffeji'm trying to work out why I can use things like clojure.contrib in my emacs - I've got swank-clojure-extra-classpaths set to contain clojure-contrib.jar, my class path definitely contains it - have I missed something?
17:23fffej(can means can't!)
17:23technomancyfffej: does it blow up when you try to require it?
17:23technomancyalso: did you set swank-clojure-extra-classpaths *before* starting SLIME?
17:24fffejtechnomancy: it does blow up with "(setq swank-clojure-extra-classpaths '("~/src/clojure-contrib/clojure-contrib.jar"))" when I use it - let me paste my .emacs to the bin
17:24teicey: send me the emacs cast
17:24te;)
17:25technomancyfffej: what do you mean "when I use it"? when you hit M-x slime or when you eval something like (require 'clojure.contrib.duck-streams)
17:25tei kid, just truthfully broke
17:25lisppaste8fffej pasted "broken .emacs" at http://paste.lisp.org/display/73993
17:25iceyte: i bet you could sell pens at the interstate offramp and make nine bucks; it's not very expensive
17:25fffejtechnomancy: i mean when I evaluate some code that uses it, starting slime is fine
17:25technomancyheh. I'm watching you, te
17:25te:D
17:26tedeposits*
17:26te:)
17:26danlarkin_rhickey: I have another question about the CA :) "your company's name (if applicable)"
17:26danlarkin_rhickey: when is it applicable
17:26danlarkin_if they're sponsoring my work?
17:27technomancyte: thanks! I think you'll get your money's worth. =)
17:27rhickeydanlarkin_: right
17:27technomancythe "contributing" page on clojure.org says you should include your sourceforge username with your CA; should that read Google Code now?
17:27danlarkin_rhickey: ok, thanks. Mailing tonight!
17:29Chouserrhickey: that's really cool about 'map'. Now you can just drop the 'seq' part and find out how life without punning feel.
17:29tetechnomancy: purchased :)
17:29technomancyte: if I'm not around, the #emacs channel is usually pretty helpful too
17:30tenod -- you're more helpful than most though to be honest
17:30tetoo many zealots, not enough irc servers
17:32teanyway, thanks for the help everyone
17:32tei need to go to chinese, but ill be back later to ask more and more questions as i actually begin to code some clojure
17:32te;)
17:32ecretis it possible to see the jars loaded in the vm when clojure is running? I am using emacs swank so I am having issues getting jars included since i am not starting clojure with the standard java -cp classpaths line
17:32technomancyte: well I *am* making money off it, so it's not just a Goodness of the Heart thing =)
17:32fffejI don't suppose I could sponge some generosity - I'm still stuck with getting slime to find my JAR Files :(
17:33tetechnomancy: meh, teaching is a service seldom compensated to the degree it ought to be IMHO
17:33hiredmanecret: you can check the classpath
17:33teappreciation for those who do it regardless is as important as paying for their services
17:34hiredman(System/getProperty "java.class.path")
17:34hiredmanbut that is not all inclusive
17:34technomancyfffej: can you paste the code that gives the error?
17:34rhickeytechnomancy: contributors page fixed - thanks
17:35fffejsure, it's the compojure getting started guide - http://en.wikibooks.org/wiki/Compojure/Getting_Started (the one called hello.clj)
17:36technomancyfffej: so it's the "use" part that is causing the problem?
17:36hiredmanhaha
17:36hiredmanthe anti-lisp
17:36hiredmanwait
17:36hiredmanX-sharp, but it runs on the jvm
17:36fffejtechnomancy: yeah, that causes "NoClassDEfFoundError" - I've checked (System/getProperty "java.class.path") and that contains all the Jar's I'm aiming for
17:36rhickeyChouser: I tried that, it didn't feel too great
17:36teXML-oriented
17:37lisppaste8technomancy pasted "compojure launch from slime" at http://paste.lisp.org/display/73997
17:37technomancyfffej: that's what I use to launch my compojure app from slime
17:37technomancyI keep all the required jars in jars/ in the application root
17:37hiredmanfffej: the getting started guide could be old
17:37fffejthanks all - I'll give it a try and see if it works
17:38ecreti have pretty much the same issue as technomancy
17:38rhickeyChouser: some of the pain is the punning, other is the difference in type, things checking for ISeq
17:39technomancyecret: try adapting that paste to your app; be sure to launch a new instance so you don't have an old slime laying around
17:39rhickeyChouser: I have to find a recipe for exploring this without getting overwhelmed by a ton of breakage
17:41jlirhickey, I think the license page on clojure.org is out of date now, right? http://clojure.org/license
17:42Chouserrhickey: ooh, ISeq, yeah.
17:42rhickeyjli: fixed - thanks
17:42jliwell that was fast :)
17:44technomancyrhickey: while you're at it, the footer copyright still says 2008
17:45stuarthallowayecret: classspath-url-seq at http://github.com/stuarthalloway/programming-clojure/blob/87bd317882f9d3d31df757272984ee93fd535234/examples/utils.clj
17:45waltersrhickey: interesting, so eos is passed explicitly now instead of just being RT.eos() ?
17:45stuarthallowayr/sss/ss
17:46rhickeywalters: yes, the canonic sentinel is not that great, too easy to get in the stream of values
17:46rhickeywalters: in chaining situations
17:46stuarthallowayfffej: the programming clojure project has a clojure+contrib+compojure+jetty preloaded
17:46waltersrhickey: yeah, that was my concern with it; e.g. if you were reflecting on RT, or using Clojure inside a debugging session
17:47rhickeywalters: also, things like (map next! ...) break
17:47waltersah, right
17:47fffej:stuarthalloway thanks, I'll take a look
17:47technomancystuarthalloway: all that stuff loaded from slime?
17:48stuarthallowaytechnomancy: No. I have resolutely ignored slime because of the churn
17:48technomancystuarthalloway: yeah, it is a shame they don't do Real Releases =\
17:48stuarthallowayalthough the classpath-url-seq might be some help troubleshooting it...
17:49stuarthallowaywhen the book is done I might create a website with some pointers for environment setup -- it seems a waste to commit that stuff to dead trees
17:50technomancythat's true; totally makes sense given the medium
17:50Lau_of_DKGentlemen, I'd just like to correct something from our earlier Vim vs Emacs discussion, as Ive been made aware that certain points could easily be taken the wrong way: I didnt not mean to flame Vim-users nor the author of Gorilla or any of those tools, there was no harm meant whatsoever. I really enjoy the friendly and helpful tone of this channel and want to contribute to keeping it that way. I'll try to be more clear in the future.
17:50waltersrhickey: are you planning to change IStream?
17:50rhickeywalters: IStream?
17:51waltersthe Java interface
17:51rhickeywalters: gone
17:51waltersoh, i was looking at some cached version of svn somehow
17:51drewrIs there a builtin or contrib that will do map-val on a hashmap?
17:51LordOfTheNoobsrhickey: I just started looking at clojure a couple days ago. This thing is pretty fantastic from what I've seen so far. Thanks for sharing it.
17:51technomancystuarthalloway: I found for the Emacs screencast having the Starter Kit as a supplement was a huge help
17:52rhickeywalters: It ends up the semantics of stream are so complex, no implementation could significantly differ, so just a concrete class
17:52waltersinteresting
17:52technomancystuarthalloway: I wonder if clojure-in-a-box could function similarly for the book.
17:52stuarthallowaytechnomancy: yes, I think you are right
17:52drewr(map-val #(.toUpperCase %) {:foo "foo" :bar "bar"}) => {:foo "FOO" :bar "BAR"}
17:52stuarthallowaybut it is a timing issue
17:52rhickeyLordOfTheNoobs: thanks, and you're welcome!
17:52achim_prhickey: there seems to be a problem with *io-context* being private but used in macros in the latest svn rev (streams branch):
17:52achim_puser=> (dosync (ref-set (ref 0) 1))
17:52achim_pjava.lang.IllegalStateException: var: clojure.core/*io-context* is not public (NO_SOURCE_FILE:1)
17:52technomancyLau_of_DK: thanks for clearing that up. =)
17:53stuarthallowaytechnomancy: if I had written Clojure-in-a-box in September 08 and tried to keep it up to date I don't know if I would have done anything else! :-)
17:53rhickeyachim_p: ack, will fix - that's halfway changed over to new scope stuff
17:53technomancystuarthalloway: heh
17:54Chousukedrewr: hmm?
17:54technomancyone thing that would help tremendously is if swank-clojure could provide "last known good" revisions that it's been tested with
17:54achim_prhickey: thanks!
17:54hiredmanyou could tell clojurebot what the last known good setup is :P
17:54Chousukedrewr: did you take erc as your repl buffer or something? :P
17:54ecrethiredman, stuarthalloway it does work now thanks
17:54drewrChousuke: No, I asked a question. :-)
17:54fffejtechnomancy: amen to that - i've made some progress (:use [compojure jetty html]) now works, but I still can't get compojure.http servlet to work.
17:55Chousukedrewr: ah, I missed that.
17:56technomancyfffej: speaking of last known good, you could try using all the jars from stuarthalloway's repo; it could be that compojure hasn't been updated or something like that?
17:56technomancyservlets aren't quite my area of expertise
17:57stuarthallowayfffej: I try to keep the various jars in sync, and the (growing) test suite for the book passing. If that isn't true let me know
17:57rhickeyachim_p: fixed rev 1222
17:57rhickeymade public for now
17:58fffejtechnomancy: I could do.. However, I'm paranoid that once I change something with my Emacs/Slime set up I'll never get it working again :) At least now (with your help) I can include clojure.contrib. I'll perhaps try it with a fresh brain in the morning
17:58technomancyclojurebot: latest?
17:58clojurebotlatest is 1221
17:58technomancyfffej: right; if you check your jars into git you can always go back to them.
17:58technomancythat'll help you feel a little more confident about experimenting
17:58duck1123fffej: configuring emacs is the same as forking emacs... use source control
17:59technomancyso true. configuration is code, even if you don't realize it.
17:59hiredmanI think clojurebot's svn checker dies due to oom
17:59fffejtis a good plan, i'll give it a go now
18:00technomancyhiredman: oom?
18:00technomancyout of memory, right
18:00hiredmanout of memory
18:00technomancytoo much XML?
18:00hiredmannah, limited jvm
18:00Chousukemaybe it hsould be refactored to use some svn lib anyway :/
18:01Chousukehiredman: did I break your pqueue by implementing it with sort btw?
18:01clojurebotsvn rev 1222; made AStream Sequential made *io-context* public
18:01hiredmanChousuke: haven't checkout that yet
18:02Chousukehiredman: I couldn't understand your implementation so I rewrote it :P
18:02hiredmanChousuke: you did forget to change one instance of "x" to "pq" :P
18:02hiredmanChousuke: well neither did I, good job
18:03fffejstuarthalloway: I checked out the programming-clojure and ran the tests, should I expect a couple of failures (test-add-message-with-backup) and (run-demos)
18:03Chousukea java priority queue might be even better but that's evil and mutable.
18:03hiredmanyour conj is nice and simple
18:04achim_prhickey: perfect, thanks, slime starts up again
18:04stuarthallowayfffej: hmmm. no
18:06stuarthallowayfffej: can you post a stack trace to http://paste.lisp.org/?
18:07fffejstuart: http://paste.lisp.org/display/74000 - looks like both are file io, so possibly something environmental my side
18:07stuarthallowayfffej: got it, fix in a minute
18:08cooldude`woohoo i love emacs keyboard macros
18:09stuarthallowayfffej: I needed to check a file into the output directory so that git would create the dir on your side. Pull it and see if it is fixed now.
18:09fffejstuarthalloway: sweet, clean run through now
18:09technomancyah, the good old .gitignore files
18:10technomancybites everyone. =)
18:10fffejstuarthalloway: sweet, clean run through now - thanks
18:11stuarthallowaytechnomancy: don't badmouth git within earshot of rhickey, we need to win him over :-)
18:11technomancystuarthalloway: oops!
18:12technomancy(or the test could just check for the existence of the dir)
18:29stuhoodhey gang
18:30stuhoodi want to flatten a sequence of tuples into a sequence, like:
18:30stuhood((:a 1) (:b 2) (:c 3)) => (:a 1 :b 2 :c 3)
18:31stuhoodor convert that first structure directly to a map, if possible
18:31cooldude`stuhood: (apply concat ...) does the first thing
18:31stuhoodahhh
18:32stuhoodthat would be (apply hash-map (apply concat ...))
18:32hiredman,(reduce #(conj % (first %2) (second %2)) '((:a 1) (:b 2) (:c 3)))
18:32clojurebot(3 :c 2 :b :a 1)
18:32cooldude`lol
18:32hiredmanhmmm
18:32cooldude`damnit conj
18:32hiredmanoh
18:32hiredmanduh
18:32hiredman,(reduce #(conj % (first %2) (second %2)) {} '((:a 1) (:b 2) (:c 3)))
18:32clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Keyword
18:33stuhood,(apply hash-map (apply concat ((:a 1) (:b 2) (:c 3))))
18:33clojurebotjava.lang.NullPointerException
18:33hiredmanstuhood: (:a 1) is being evaled to nil
18:34stuhoodyea... my example didn't have good syntax
18:35stuhoodthanks guys, the apply solution should work
18:35hiredman,(reduce #(conj % (first %2) (second %2)) {} [[:a 1] [:b 2])
18:35clojurebotEval-in-box threw an exception:Unmatched delimiter: )
18:36hiredman,(reduce #(conj % (first %2) (second %2)) {} [[:a 1] [:b 2]])
18:36clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Keyword
18:36cooldude`lol
18:38fffejhas the syntax of ns with :import changed recently? Trying to get compojure to work and muching around with the syntax to be (:import (java.net URL)) rather than (:import java.net.URL) appears to have fixed things
18:40technomancystuhood: there's a flatten function in seq-utils in contrib
18:41stuhoodtechnomancy: thanks but if (concat ...) is lazy, then i think i'll be happy with it, and avoid the extra dependency
18:42stuhoodhaha
18:42technomancybtw, would people find it useful if flatten took an optional integer arg to specify how many levels to flatten?
18:44stuhoodtechnomancy: can't hurt?
18:45technomancywell, if nobody's going to use it but me then might as well keep it simple
19:02scottjDid the if enhancement that made it like cond get removed? I'm getting an error saying too many arguments when I pass it 5
19:03cooldude`scottj: might need some vectors, idk
19:05cooldude`now we can parse dates too: http://gist.github.com/49656
19:06cooldude`clojure.contrib.date: now with macro love!
19:08technomancycooldude`: nice! by the time I get back to my web app that was using dates, that will be in contrib and I'll be humming along painlessly.
19:08cooldude`woo!
19:09cooldude`the best part is you can really easily define your own named formats
19:09technomancygood; I do that pretty frequently in Ruby
19:09cooldude`i'm very happy with this code :)
19:10technomancycooldude`: have you talked to anyone about getting it into contrib? unfortunately me thinking it's a good idea won't quite get you there.
19:10cooldude`not yet, but its ready to drop-in, look at the namespace
19:10technomancyright
19:10technomancyI liked the docstrings in mine better, but this is probably more appropriate. =)
19:10cooldude`i'm about to make a change to the syntax of the macros to make them nicer
19:11cooldude`and more consistent
19:11technomancygood thing no one is using it yet. =)
19:11cooldude`lol it's 2 days old, i can change whatever i want
19:11technomancythat's a nice feeling.
19:11technomancyjust remember it won't last forever. =)
19:11cooldude`lol
19:11cooldude`yeah
19:12cooldude`maybe i should combine parsers and formatters, yes?
19:13cooldude`at least from the macro end
20:01cadsI'd like to write a program for writing a representation of a tree, and I'd like to write it in clojure as my first lisp program, as opposed to using cl or scheme. My pseudocode is simple enough that I could write the program easily in ruby or haskell, but I was wondering where I should look for a little clojure tutorial covering the programming environment and some of the functions for dealing with strings and nested lists, and such
20:02technomancyclojurebot: clojure-in-a-box?
20:02clojurebotclojure is a very attractive hammer with a nice heft to it
20:02technomancycads: I've heard good things about clojure-in-a-box
20:02technomancycads: there's a thread on the mailing list about this very topic too
20:02cadscool
20:03cadsit feels like there's very little I'd need to bootstrap myself, and that the community might have like one canonical tutorial
20:04technomancycads: well the classpath can be confusing at first
20:04technomancydo you have an editor preference?
20:05cadsI have not yet played with clojure because of my reluctance to play with emacs
20:05cadsbut I'll get over it, I'd really like to be able to use emacs' power
20:05cadsI used gedit, otherwise
20:06technomancyhmm; I don't think gedit is supported.
20:06technomancyclojure-in-a-box comes pre-configured with emacs and clojure supposedly
20:06technomancyhaven't used it myself since I'm pretty comfortable with Emacs already
20:06cadsbrb
20:07cadscan't find clojure in a box's project page
20:08technomancyoh... clojurebox is windows only; sorry.
20:08technomancyshould do my research. =\
20:08cadsI think I can seriously get over having to use emacs, especially if all I need to learn is how to make a new buffer and involve a REPL
20:09technomancycads: who knows, it may grow on you with time. =)
20:09technomancybeing able to modify the behaviour of your environment at runtime is addictive
20:09cadsI know I'd love to have custom macros for text editing, so far the only problem has been time
20:09technomancycustom macros are only the beginning
20:10technomancy=)
20:10cadshehe, I've heard emacs called the lisp operating system
20:10technomancy(some people think that's a joke, but it's actually true)
20:11technomancycads: you're like the fourth person to come in here today asking about this... I think I'll have to write a blog post about it.
20:11technomancysince it's really not clear how to set things up if you don't know Emacs
20:11cadswell, I think for many people interested in clojure, emacs will be a new thing
20:11technomancytrue
20:12technomancyeveryone who's not already a Smug Lisp Weenie(TM) anyway
20:13cadsI have a deep respect for emacs and its powerful architecture, just that the learning curve hasn't been anything I've had the time to climb
20:13technomancyunderstandable
20:14cadsit's been a matter of learning emacs in order to use haskell mode or SLIME or clojure mode, and I've spent time just learning the language and emacs fell by the wayside
20:15cadswhich is why I think a tutorial that would bootstrap you into a emacs/clojure environment would be a big plus
20:15technomancycads: don't tell anyone, but I've got something in the works
20:15technomancyit's a commercial screencast (http://peepcode.com)
20:15technomancyjust started it this week
20:15cadshaha
20:15cadscool
20:16technomancyI've got one on Emacs (no clojure involved) too, but you might want to wait for the clojure one.
20:16cadsit'll be nice to know it's out there
20:16cadsi think i'll just jump on an emacs tutorial
20:17technomancycool
20:17technomancyi'm hoping to have the clojure one out in early Feb. hopefully 1.0 is released by then.
20:17cadslink me to your blog?
20:18technomancyhttp://technomancy.us
20:18cadsyou seem to be in the know
20:18technomancywell I'm pretty new to clojure, but I've done a lot of lisp in the past
20:19technomancymostly get paid to do Ruby, which is more lisp-like than you'd think
20:19cadsruby is addictive
20:19technomancyheh
20:19technomancyI'm having more fun with clojure these days. Loving how FP turns your brain inside out.
20:19cadstill you hit the wall on computing performance and can't find another language that satisfies your dynamic craving
20:20technomancycan't find another non-lisp language, you mean. =)
20:20cadsI'm hoping clojure will be that :D
20:20technomancydefinitely feels like that for me.
20:21cadswell there are some definite touches of brilliance in ruby, and I'm going to miss some of that really cuddly syntax
20:21technomancyclojure's lambda shorthand is every bit as convenient as ruby blocks IME
20:21cadsruby is much cuddlier than say haskell :D
20:21technomancy(other lisps make you use "lambda", which is a bit long for really small things)
20:22technomancyI need to take off though; good luck getting things figured out.
20:22cadsthanks an good luck in your tutorial endeavor
20:22technomancylater
20:27gnuvince_In streams, if an eos is not explicitly specified, what is the value of eos?
21:06cooldude127this place is dead, let's see if this question helps: my types are specified like ::Date, ::Time, etc. but i want users to be able to define formatters and parsers for dates that specialize on the type from they're own packages. what's the best way to let them do this, short of specifying types like :clojure.contrib.date/Date ?
21:07cooldude127can i use (keyword "clojure.contrib.date" "Date") in my macro?
21:08cooldude127is that anything resembling a good idea?
21:09cooldude127:( stupid dead channel
21:13hiredmancooldude127: clojuebot's plugin stuff has multimethods that register themselves from different namespaces
21:13rhickeygnuvince: an eos is always explicitly specified by some code
21:13cooldude127hiredman: what?
21:13cooldude127hiredman: where is code?
21:13hiredmanclojurebot: where are you?
21:14clojurebothttp://github.com/hiredman/clojurebot/tree/master
21:14cooldude127that's awesome
21:14rhickeygnuvince: and you should never care about the value
21:16gnuvince_I agree about not caring about the value, but it stumped me to see that eos seemed to come out of nowhere.
21:22jliman, why isn't anyone laughing at this guy's jokes? poor guy. http://www.parleys.com/display/PARLEYS/Home#talk=2556139;slide=12;title=The%20future%20will%20be%20about%20programming%20languages
21:26dreishjli: How do you know they aren't?
21:27cooldude127hiredman: that works because the symbols used to dispatch on are defined in the same package as the defmethod call, i want to use already defined keywords in my own package from others
21:27jliBecause you can hear it when they do it a couple of times. And because he talks about how they aren't laughing.
21:34cooldude1271d6
21:34clojurebot3
21:34cooldude127lol clojurebot rolls dice
21:34cooldude1273d6
21:35clojurebot5
21:35cooldude1273d6
21:35clojurebot11
21:35cooldude1273d6
21:35clojurebot5
21:47teI'm baccckkkk
21:47cooldude127wooooo
21:47tehaha
21:47teclojurebot: paste
21:47clojurebotpaste is http://paste.lisp.org/new/clojure
21:49cooldude127simple question: how do i get the unqualified name of a keyword? basically: :clojure.contrib.date/Date -> "Date"
21:50hiredman,(name :clojure.contrib.date/Date)
21:50clojurebot"Date"
21:50hiredman?
21:50cooldude127i honestly didn't expect it to be THAT simple
21:50hiredman,(namespace :clojure.contrib.date/Date)
21:50clojurebot"clojure.contrib.date"
21:50cooldude127sweet
21:56tecooldude127: could you give me a couple lines to test emacs with
21:56tei have swank/slime setup
21:57teand id like to make sure its all working, because it seemed to just switch back to lisp
21:57cooldude127te: just a minute
21:57teno problem
21:57cooldude127:)
21:57tei need to learn emacs and clojure, i just want to make sure my environment is working before i continue
21:58cooldude127te: real quick try *ns*
21:58te#<Namespace user>
21:59cooldude127te: i think you're in good shape, want to test if clojure-contrib is working?
21:59teyes please
21:59cooldude127(use 'clojure.contrib.def)
21:59tewould also be nice to try something that spans a couple lines to make sure its indenting properly
21:59tereturns nil
21:59cooldude127te: that's right. no error
22:00cooldude127te: for indentation, just try to write a simple function
22:06teindentation seems to not be working as planned
22:07te(defn hello [name]\n(str "hello, " name))
22:07tedoesnt seem to indent on the 2nd line
22:09teAnyone know?
22:11arbscht_by \n do you mean `RET' in emacs?
22:11teyes
22:11arbscht_that won't usually indent. try C-j
22:11Carkpress the tab key to indent
22:12hiredmanshouldn't it aut-indent?
22:12te^^that's what i was getting at
22:12arbscht_typically C-j auto indents
22:12arbscht_you can swap those bindings around, of course
22:12tedoesnt seem to be working
22:13arbscht_is the buffer in clojure-mode?
22:13teyes
22:13teim removing my apt-get slime and cl-swank
22:13temaybe thats borking something
22:14teC-j works now
22:14tebut I don't get the cool prompt that materializes from thin air
22:14hiredmanclojurebot: emacs?
22:14clojurebot"Learning Emacs and SLIME was just about the most painful computer experience I've ever been through."
22:14telol
22:14arbscht_it's totally worth it :)
22:14teim excited as hell :P)
22:15teive written hello world, so im well on my way to mastery
22:15te;)
22:16tehttp://12monkeys.co.uk/2009/01/21/the-future-of-lisp.html
22:16tenot what you think...
22:19gnuvince_That,s pretty much what I thought ;)
22:19gnuvince_And I agree
22:19gnuvince_Although I'd extend that to all languages that are not already mainstream (or nearly mainstream)
22:20hiredmanor just "all languages"
22:21tegnuvince_: ive read about 100 times, (so it may just be fashionable right now, but i digress), that lisp will never gain general acceptance due to the strict reliance on emacs/slime
22:21gnuvince_I would argue that C++ does not need a platform to gain access to a lot of libraries.
22:21te^
22:21durka42oh that's what LFE stands for!
22:22gnuvince_Some languages (like Haskell) are somewhere in between: a good amount of libraries, but not a critical mass
22:22tehaskell is very cool
22:22jbondesonhaskell suffers from having academic rather than commercial backing
22:22gnuvince_I don't think it suffers.
22:23Nafaijbondeson: Not in the slightest
22:23gnuvince_They've just recently passed the 1,000 packages mark on Hackage, which is impressive.
22:23NafaiLook at major languages with commercial backing: Java, VB, C#
22:23NafaiSure they are used a lot
22:23NafaiBut do you want to be them? :)
22:24jbondesonhaha
22:24jbondesonnow you're arguing value vs. acceptance
22:24gnuvince_Plus, the Haskell folks are quite happy to "avoid success at all cost"
22:24NafaiYeah, Haskell is doing quite well
22:24tei think that's kind of a quirky, cool community mantra
22:24gnuvince_These days, I play around with Clojure and Haskell.
22:24tethat i think takes some of the pressure off the community at large
22:25jbondesonit's doing well in non-commercial sectors.
22:25Nafaignuvince_: That's about where I'm at
22:25gnuvince_I try to give priority to Clojure, because that would be more helpful (know Java libs for one thing)
22:25jbondesonyou don't see a ton of business use for it (e.g. jobs created)
22:25gnuvince_But I always have this craving to use Haskell too :)
22:25tejbondeson: yeah, not yet, im not sure what to think of that
22:25teperhaps the problem is that people who actually know shit like haskell, clojure, etc. are just too expensive
22:25gnuvince_jbondeson: there are some jobs, but they're in niche markets
22:25jbondesonhard to convince people that "pure" function is viable.
22:26teyou need to attract a lot of crappy programmers to bring down the cost of implementing the language
22:26gnuvince_high assurance software (Galois), banking (Credit Suisse), etc.
22:26jbondesonhell if i show some of my coworkers any clojure code their eyes glaze over and they strart mumbling about the slumbering elder gods
22:26gnuvince_I liked the post of the fellow who said that Haskell was beyond ready for prime time
22:26gnuvince_I agreed with him
22:26teregardless of whether or not haskell, clojure, et al become widely accepted, they are a healthy "third party" that encourages pythons, rubys, perls, etc. to adopt the same functionality
22:27tei cant see that as a bad thing
22:27gnuvince_Great compiler, growing library, great community
22:27Nafaite: Agreed in that regards
22:27teyeah gnuvince_ i definitely agree
22:27blbrownwhat up clojure people
22:27gnuvince_blbrown: hello
22:27teOMG -- We all are agreeing on stuff!
22:27teThis is definitely a healthy community. heh
22:27jbondesonhaskell has all the tools to be prime time, it just lacks marketing.
22:28gnuvince_They need to stop being lazy and evaluate which is the best new logo submission ;)
22:28gnuvince_But more importantly, they just need to write code.
22:29hiredmanclojurebot: haskell?
22:29clojurebotYo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you compute.
22:29gnuvince_Eventually something's gonna stick (like Rails for Ruby)
22:29gnuvince_hahahaa
22:29gnuvince_Nice one :)
22:29jbondesonugh RoR.
22:29teI have a dirty secret
22:29teI drank the Ruby kool aid
22:29jbondeson=/
22:30Chouserdurka42: LFE around here often mean Left Folding Enumerator, not Lisp Flavoured Erlang
22:30teI know... :\ I see the error of my ways
22:30gnuvince_jbondeson: not saying RoR is good (cause it's not IMO), but it's what took Ruby from unknown programming language to semi-mainstream
22:30teHowever I must say the Ruby community is encouraging people to try Haskell, Lisp, etc.
22:30tewhich is damn healthy AFAIC
22:30gnuvince_te: I wrote one of the first RoR tutorials ;)
22:31jbondesonnot going to deny that, it just shows you what you need to get critical mass, and then you ask yourself "do i want that?"
22:31gnuvince_te: http://mirror.monsson.dk/rails/tutorial.html
22:31gnuvince_That was me ;)
22:32teRuby on Rails was poisoned by the idea RoR could be a marketable framework
22:32gnuvince_Rarity of a skill means it's well paid (if it's sought after)
22:32durka42Chouser: that makes sense too
22:32durka42:)
22:33tehow do I modify the look of the user=> prompt in swank-clojure?
22:33hiredmanuser is the namespace you are in
22:33jli(in-ns 'not-user)
22:33jbondesonhaha
22:34telol
22:34arbscht_te: have you loaded slime-repl?
22:34jbondeson(in-ns 'clojure-rocks) ?
22:34tearbscht_: yes
22:34jbondesontrue then it looks like "user>"
22:34tejli: jbondeson: i was talking more about the style of the prompt
22:34hiredmanmaybe the next version of clojure.main will let you bling up the repl
22:34duck1123too bad 'clojure-rocks isn't a valid ns
22:34teas in the color
22:34jbondesonaw
22:35hiredmanduck1123: eh?
22:35jliyour repl prompt is colored?
22:35arbscht_te: that looks like the inferior-lisp prompt, not the slime-repl prompt
22:35hiredman,(in-ns 'clojure-rocks)
22:35clojurebot#<Namespace clojure-rocks>
22:35jbondesonclojure-rocks seems to work for me...
22:35duck1123'clojure.rocks works, but that would be something different
22:35duck1123you can in-ns it, but don't namespaces need 2 parts?
22:35tejli: yes
22:36tearbscht_: ah
22:36hiredmanduck1123: user has only one part :P
22:36jlite, if you updated slime recently, you need to load the slime-repl or slime-fancy contrib thingies
22:37jbondesonjli is right, that one caught me off guard since i hadn't updated in quite a while
22:37tei just pulled down the new repo of slime
22:37tethats all im running with i believe
22:38durka42te: give up on vim?
22:38jlite, what's in your emacs config? you can use something like "(slime-setup '(slime-fancy))" to get the nicer repl
22:38tedurka42: yeah
22:38gnuvince_Hehehe: I hang on a general programming channel (french speaking) and whenever people talk about their threads and mutex and lock problems, I want to tell them to use Clojure :)
22:38gnuvince_(or Haskell)
22:38jlite, and if you use "(slime-setup '(slime-fancy slime-banner))", you'll impress your friends and attract many potential mates.
22:39jbondesonthat worked for you jli?
22:40jlijbondeson, which part? (though everything I've mentioned has worked =))
22:40tefli
22:40Carkgnuvince you're from france ?
22:40tejli: haha
22:40tejli: unfortunately that doesnt work for me :\
22:40jbondesonslime attracting mates! cause i feel like even my wife starts shying away from me when i boot up emacs. course that could be the whiskey... hmmm
22:41jlite, hmm, you might also need "(add-hook 'slime-load-hook (lambda () (require 'slime-banner)))"
22:41gnuvince_Cark: Canada
22:41jliyeah, I think you need that too.
22:41Carkah belgium here
22:42teError in init file: Symbol's function definition is void: slime-setup
22:42gnuvince_Cark: if you want to see what it's like, #programmeur. Most people are Quebecers however, so the channel is usually active between 8AM and 8PM here (which would be +6 for you)
22:42jbondesondid you require slime?
22:42tejbondeson: no not explicitly
22:42jlite, er, you have "(require 'slime)" first, right?
22:42tei didnt need it to get to the repl
22:43teso i didnt know i needed it
22:43Carkgnuvince : i'm a night person as you know =P
22:43tei have it in the load path, and then it autoloads
22:43teperhaps i need those lines after the autoload
22:43jliI don't actually know how any of this works - I just copy configs from Bill Clementson :)
22:43jbondesoni learned how to configure slime the hard way loading different lisps on windows *shudder*
22:44teError in init file: Symbol's value as variable is void: slime
22:44tegrrr
22:45jbondesonadd to your load path
22:45jlier, uh, 0_0 did you quote it?
22:45jbondesonoh
22:45jbondesonyeah
22:45jbondesonhah
22:45teyes
22:45jbondeson(require 'slime) ?
22:45teyes
22:46jbondesonok then make sure you (add-to-list 'load-path "/path/to/slime")
22:46tehm okay i think i fixed it now
22:46tenow it gets angry about "You must specify either a swank-clojure-binary' or a `swank-clojure-jar-path'
22:46jlido you have the friend-impressing, date-getting banner animation?
22:46tehaha im working on it :)
22:47jlite, http://bc.tech.coop/blog/081023.html
22:47terequiring slime makes it want to load lisp
22:47jbondesonjust walk around with your laptop hacking on some clojure in emacs and you'll need a stick to keep em off you
22:47tehahaha
22:48jbondesonnext you'll be loading irc into emacs so you can chat here while coding >_>
22:48cooldude`jbondeson: that's what i do
22:49cooldude`code + repl + irc in same window
22:49jbondesonemacs is my os more than anything...
22:49tecooldude`: i cant wait for my day in the sun like that
22:49cooldude`it's awesome :)
22:50jliand sometimes you get confused and use clojurebot for your repl for extended periods of time?
22:50jbondesonjust have your os load emacs into full screen and you're good to go
22:53cooldude`jli: honestly have tried to do that before
22:55tei think th eorder of my config is all fscked up
22:55teand thats why its not working right
22:55jbondesonthat's easy to do.
22:55cooldude`te: paste it
22:55teclojurebot: url
22:55clojurebotexcusez-moi
22:55teclojurebot: paste
22:55clojurebotpaste is http://paste.lisp.org/new/clojure
22:56lisppaste8te pasted "dotemacs" at http://paste.lisp.org/display/74008
22:56tenote that it'd be nice to throw in jli's sexy slime-fancy banner
22:56jbondesonput slime after swank
22:56duck1123So, are java iterators now streams? (assuming I have that branch)
22:57jbondesoni go: clojure-auto, swank, slime
22:57jbondesonyeah, and rich even fixed the problems in the branch with swank, so it should be good to go.
22:58jbondesonoh, and your clojure config needs to go before the call to auto load
22:59cooldude`jbondeson: you sure about that?
22:59jbondesonpretty, let me double check
23:00jbondesonthat's what i do
23:00cooldude`won't the swank-clojure-config function be unbound until you autoload it?
23:00jbondesonhmmm...
23:00teokay looks like i got it working
23:00tethanks everyone
23:00te:)
23:00jbondesonactually, yeah, i use the vars
23:00jbondesonnot the config call, good catch
23:01cooldude`yeah
23:01cooldude`all swank-clojure-config does is wrap it in an (eval-after-load
23:02jbondesonThe Dude is right.
23:02cooldude`you bet i am
23:02jbondesonthough i don't know if he bowls.
23:02teThe Dude abides
23:06ozy`you guys, the clojure website is horrible
23:06ozy`someone punch Rich Hickley in the soul for me
23:06jbondesonneeds more flash?
23:06ozy`neat language but the documentation is repulsive
23:06ozy`needs more clarity.
23:07hiredmanworked fine so far for me
23:07Carkozy : how is it lacking ?
23:08jbondesonhere you go: http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
23:08jbondesonrich is busy responding to all the feature/bug requests, so cut him a little slack.
23:09ozy`yeah I'll cut him slack for that
23:11jbondesonthere is a ton of user created documentation out there that tends to fill the gap.
23:11durka42those are some good examples
23:11durka42clojurebot: examples?
23:11clojurebotExcuse me?
23:11durka42clojurebot: examples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
23:11clojurebotIn Ordnung
23:11durka42clojurebot: examples?
23:11clojurebotexamples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
23:15jbondesonone of these days i'm going to figure out what the heck is causing clojure+slime to bring emacs to its knees...
23:29teWhoa I think I actually understand a bit of clojure
23:29cooldude`we're proud of you :)
23:29telol
23:29teSo this idea of functions as passable objects
23:29cooldude`is awesome ?
23:29teIs this where lambda comes in?
23:29hiredman...
23:29hiredmanclojurebot: sicp
23:29clojurebotsicp is http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages:Clojure:Chapter_1
23:29jbondesonheh
23:29cooldude`well, it's called (fn) in here
23:29hiredmanhmm
23:30jbondesonlambda calculus is very, very old
23:30hiredman,((? [x] x) :a)
23:30clojurebot:a
23:30teim just trying to understand lambda as it relates to clojure
23:30jbondesoneven non-lambda functions are passable.
23:30teand im about 2 weeks into calculus I, so forgive me for not knowing
23:30jbondesonfunctions are just objects that can be evaluated
23:30hiredmante: http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
23:31hiredmanclojurebot: sicp videos?
23:31clojurebotsicp is http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages:Clojure:Chapter_1
23:31hiredmanclojurebot: sicp videos is http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
23:31clojurebotAck. Ack.
23:32durka42te: lambda calculus != calculus
23:32jbondesonlambda functioms are just 'anonymous'. usually too simple (or specialized through encapsulation)
23:32jbondesoncalculus != calculus =P
23:33durka42so calculus is NaN?
23:33jbondesonprecisely!
23:36jbondesonthough to be precise ther is nothing in mathematics that is NaN. we computer scientists just find it easier to ignore the less, shall we say, concrete numbers.
23:36hiredmandiscrete math++
23:36pjb3TCO on the JVM? http://mail.openjdk.java.net/pipermail/mlvm-dev/2009-January/000331.html
23:37durka42there is no NaN, but there is "don't do that"
23:37durka42as in 1/0
23:38durka42pjb3: that would be nice :)
23:38hiredman,(/ 1 0)
23:38clojurebotjava.lang.ArithmeticException: Divide by zero
23:38durka42,(/ 1.0 0.0)
23:38clojurebotjava.lang.ArithmeticException: Divide by zero
23:39jbondesoni thought they rejected tail recursion for inclusion.
23:39pjb3In Ruby 1.0 / 0.0 returns this object Infinity
23:39durka42this seems like more of a hack tacked on to hotspot than "inclusion"
23:39jbondesonah
23:39hiredmanthey said they were not going to do TCO, but someone else stepped up and did it
23:39pjb3Which I've always thought is weird
23:40jbondesonas long as -1/0 returns object NegativeInfinity
23:40jbondesonand they have a PositiveZero and NegativeZero for limits approaching zero.
23:41pjb3Yeah, 1.0 / 0.0 # => -Infinity
23:41durka42,(* 2 Double/MAX_VALUE)
23:41clojurebotInfinity
23:42cooldude`does clojure-contrib have a string function to turn date-time into DateTime?
23:42jbondesongo go iee floating point spec
23:43pjb3What's fun to do is stick Infinity into a variable, like inf = 1.0 / 0
23:43pjb3then do inf * inf > inf
23:43jbondesonit better return false
23:43pjb3That would have settled a lot of arguments I had with other kids when I was 8 :)
23:43pjb3jbondeson: it does
23:43durka42well, some infinities are bigger than others
23:44jbondeson...
23:44pjb3well, not in Ruby, I guess
23:44jbondesonare we going to have to do a proof by contradiction for that durka? >=|
23:45pjb3,(let [inf (* 2 Double/MAX_VALUE)] (> (* inf inf) inf))
23:45clojurebotfalse
23:45ozy`false in haskell
23:45ozy`(via GMP)
23:47ozy`and in ruby
23:47durka42http://www.sciencenews.org/view/generic/id/9269/title/Math_Trek__Small_Infinity,_Big_Infinity
23:47ozy`(dunno why it wouldn't be)
23:47durka42there are infinitely more real numbers than integers, even though there are an infinite number of each
23:47durka42on the other hand, there are obviously twice as many integers as even integers, but those infinities are the same
23:47ozy`and infinitely more irrationals than rationals
23:48hiredmanozy`: that makes me sad
23:48durka42real := rational U irrational
23:48ozy`hiredman: how's that?
23:48jbondesonyes, but both are uncountable
23:48durka42i think cantor counted the rationals
23:48hiredmanozy`:what if the irrationals vote me off the island?
23:49durka42(in link)
23:49ozy`hiredman: *insert lame joke about a Republican president*
23:50jbondesononly in an abstract way (though what isn't abstract about mathematics)
23:50jbondesonthe idea is that integers are the "smallest" set of infinity
23:50cooldude`canonical way to split a string by another string? is it (.split) ?
23:51jbondesonbah, abstract mathematic just make my head hurt.
23:52durka42hmm
23:52durka42,(> Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY)
23:52clojurebottrue
23:52durka42good :)
23:52jbondesongod i hope so!
23:53durka42,(+ Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY)
23:53clojurebotNaN
23:53durka42,(- Double/POSITIVE_INFINITY Double/NEGATIVE_INFINITY)
23:53clojurebotInfinity
23:53hiredmanheh
23:53durka42apparently abs(+inf) > abs(-inf) ?
23:54jbondesonif -infinity and +infinity were countable you should be able to prove whether -inf + inf == 0
23:54durka42,(- Double/NEGATIVE_INFINITY Double/POSITIVE_INFINITY)
23:54clojurebot-Infinity
23:54durka42,(+ Double/NEGATIVE_INFINITY Double/POSITIVE_INFINITY)
23:54clojurebotNaN
23:54jbondesonand here i said i was getting away from theoretical math
23:55durka42i am not sure -inf + inf = 0
23:55hiredman,(sort [Double/NEGATIVE_INFINITY Double/POSITIVE_INFINITY])
23:55clojurebot(-Infinity Infinity)
23:55durka42like the example about there being twice as many integers as even integers
23:55durka42but those are both aleph-zero
23:56durka42but if you added those infinities i wouldn't expect to get zero...
23:56durka42on the other hand simple intuition doesn't work so well with infinity
23:57jbondesoninfinity and zero, concepts that were better left undefined! ;)
23:57durka42zero is pretty useful :)
23:58jbondesonbut think about it
23:58jbondesonwhat does zero really mean
23:58durka42the amount of work i am getting done right now
23:59jbondesonspeaking of, "Zero: the biography of a dangerous idea" is a good book