#clojure logs

2009-12-02

00:05solussdcan somebody provide a usage example of condp?
00:29_ato,(condp = 4, 4 :four, 5 :five, :other)
00:29clojurebot:four
00:30_ato,(condp = 5, 4 :four, 5 :five, :other)
00:30clojurebot:five
00:30_ato,(condp = 6, 4 :four, 5 :five, :other)
00:30clojurebot:other
00:30_atooh wait.. he left
00:31alexykI've run mvn compile on a project with a clojure script reading from a database. It tried to run it, in fact. Does compile execute, or is it a maven-clojure plugin effect?
00:33_atoyes compile will execute stuff at the top-level
00:33_atobest not to have stuff at the top-level that actually does things, wrap it into a main function
00:36alexyk_ato: thx!
00:55alexykis there an update-in! for transients?
00:57carkif you need update-in for transients, you might be not using them the way they should
01:01alexykcark: I was scanning a giant stream of tweets and incrementing a hash map for each user_id when his twit is seen. _mts suggested transients and it shaved 1/3 of time. Now I want to build a map for graph, for each user_id adding in_reply_to to the nested map. Apparently you use update-in for updating the nested one, instead of just inc for user_id->count. So I was thinking of using transient on that, too, to save time, if possible, -- is it wrong?
01:01alexyki.e. where I have assoc! now I'd like update-in! if it exists...
01:02carkah i understand your problem
01:02carkmhh
01:03carki guess that's your project =P anyways update-in is easy to write
01:03carkhave a look at the source
01:06carkdid you try parallelising instead of going the non-functional way ?
01:07carkwhich is non-functional as well but you know =)
01:10alexykwell I just used the "transient magic" folks added, and want to generalize
01:14duncanmdum de dum
01:17tomojdoes anyone know anything about lazy json?
01:19hiredmanalexyk: have you tried just using a concurrent hashmap?
01:19alexykhiredman: where do I get that?
01:20hiredmanalexyk: java.util.concurrent maybe
01:20hiredman~google java concurrent hashmap
01:20clojurebotFirst, out of 7960 results is:
01:20clojurebotConcurrentHashMap (Java 2 Platform SE 5.0)
01:20clojurebothttp://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html
01:20alexykhiredman: ah, a non-clojure one
01:21alexykworth trying I guess
01:21alexykespecially given I may need to unleash concurrency on it -- but then non-clojure concurrency too, right?
01:22hiredmanthe argument for immutable datastructures is largely that you don't have to lock them
01:23alexykwell I don't know how to do Java concurrency from Clojure :(
01:23hiredmanit's the same thing
01:23hiredman,(import 'java.util.concurrent.ConcurrentHashMap)
01:23clojurebotjava.util.concurrent.ConcurrentHashMap
01:23hiredman(ConcurrentHashMap.)
01:23hiredman,(ConcurrentHashMap.)
01:23clojurebot#<ConcurrentHashMap {}>
01:24alexykshould I stick it into an atom or something?
01:24hiredman,(doto (ConcurrentHashMap.) (.put :a 1))
01:24clojurebot#<ConcurrentHashMap {:a=1}>
01:24hiredmannope
01:24hiredmanclojure reference types are for hold immutable values
01:24hiredmana ConcurrentHashMap is not immutable
01:24alexykwill it block on two threads trying to update the same key?
01:24alexykor, how do I share it across agents?
01:24hiredmanalexyk: I imagine so, but I've never really used it
01:25hiredmanalexyk: (def m (ConcurrentHashMap.))
01:25hiredmanthen each agent just pounds on m
01:25hiredmanI would definitely read the javadocs for it
01:25alexykah nice, so I don't have to wrap it into an agent.
01:26hiredmanalthough concurrenthashmap is mutable, it is designed to be pounded on concurrently
01:27hiredmanjava.util.concurrent is full of goodies
01:29alexyknice
01:30hiredman,(:a (doto (ConcurrentHashMap.) (.put :a 1)))
01:30clojurebot1
01:41hiredman"For example, we could lock Rich Hickey in a basement and put him on a tofu-and-lettuce diet."
01:41hiredmanhoho
01:42duncanmhiredman: clojure makes me think that S-Expression syntax might actually have a chance in a mainstream, i disagree with what he said about the syntax
01:43duncanmi.e. Point #2
01:43carkwhat's the link of this ?
01:43duncanmhttp://www.tbray.org/ongoing/When/200x/2009/12/01/Clojure-Theses
01:43carkthanksµ
01:43duncanmhiredman: i wrote a comment, but he needs to moderate it before it shows up
01:44hiredman*shug*
01:45duncanmit's perhaps moot talking about this here, everyone here already bought into the sexpr syntax
01:45hiredmanmy ideas of what is readable seem to be out of whack with even #clojure
01:45duncanmhiredman: are you talking about syntax-things like different macros?
01:45alexykthe comment on prefix languages filling mind and stack ones not makes sense, I'm still grappling with S-exps
01:45hiredmanI have no problem with partials and double parans
01:46hiredman,(-> 5 range ((partial map inc)))
01:46clojurebot(1 2 3 4 5)
01:46hiredmanthat sor tof thing
01:46duncanmhiredman: yeah, so i find the -> syntax to be difficult too, cuz i never learned it
01:46duncanmhiredman: but most people are still talking at the (+ 1 1) level
01:46alexykthe question is, are you born homoiconic or you can become one by choice :)
01:46duncanmalexyk: that stack argument is silly too, just read from right to left
01:47duncanmwell, from inside out
01:47hiredmanalexyk: that is interesting
01:47hiredmanI mean, far from hard to read I find it pleasing
01:47alexykduncanm: exactly, I was thinking, reverse the damn thing and make it suffix
01:47alexykI wonder what Hebrew and Arabic programmers think
01:47hiredmanit tickles some aesthetic region in my brain
01:47duncanmalexyk: no no, the issue about 'memory' has to do with composition - if you use LET judiciously, there's no differece, right?
01:48alexyksince it already must look "suffix" to them
01:48alexykduncanm: yeah, that's what I like about ocaml. let ... in let ... in let ... x
01:48duncanmalexyk: why can't you write that in Clojure?
01:48alexykduncanm: I guess I can :)
01:49alexykI'm just learning
01:49alexykhiredman: so a partial is true curried?
01:49hiredmanI have a parser written in fnparse somewhere that turns expressions like that into valid clojure
01:49duncanmyou can write the same thing in clojure, it's just not done because it's not really necessary
01:49hiredmanalexyk: just for a single application
01:49carkoh reading this i wonder where i can download the widefinder data
01:50carki've been reading technomancy's solution on this blog
01:50hiredmancark: it's a big log
01:50carkand i don't underqstand why he use hashmaps
01:50carkright, but where is it?
01:50carki tried to find it, but nope couldn't find it
01:50alexykcark: twbray lurks here I believe
01:50duncanmcark: he prolly isn't keen on paying the bandwidth for people to download that log
01:51duncanmit's like 8GB?
01:51hiredman40
01:51alexykI think it's on Tim's box, 45GB
01:51alexykyou have to look serious and he'll get you an account
01:51duncanmcark: and his experiment is only interesting if you have one of those heavy iron machines
01:51carksure, but the widefinder thing, everybody talks about it, the data must be somewhere !
01:51twbraycark: See http://wikis.sun.com/display/WideFinder/Infrastructure
01:51twbrayPlus I'll send you a pointer to the 100K-line sample if you email me
01:52duncanmhey twbray
01:53alexykhiredman: what's a "single application"? within a single statement?
01:53duncanmtwbray: am i correct to say that you're not actually against TCO, you just like having the loop/recur syntax? cuz we can still keep that even with TCO... ;-)
01:53carkah right there's no link, need to mail it
01:53hiredmanalexyk: huh?
01:53hiredmanoh right
01:54hiredmanpartial
01:54alexykyeah
01:54duncanmclojurebot: (doc ->)
01:54clojurebotExcuse me?
01:54duncanmoh, how does that work again?
01:54twbrayduncanm: TCO, when used as a way to enable iteration without busting the stack, seems misleading, compared to recur
01:54duncanmhiredman: i should learn to use ->
01:55hiredman(partial + 1) can be applied, but ((partiial + 1) 2) cannot
01:55duncanmtwbray: huh? but the syntactic structure is the same
01:55twbrayduncanm: But I'm in a minority there
01:55carktwbray : ref are not better or worst than agent, these are completely differen, also i don't understand "you can't have send inside a send"
01:55carki do send inside a send quite a lot !
01:55duncanmtwbray: (loop [i 10] (if (zero? i) 'end (recur (dec i)))) that sorta counts down from 10
01:55duncanmyou like that
01:55twbraycark: Really? I was sure I got an error message on that
01:56carkreally =)
01:56duncanmtwbray: (let loop ((i 10)) (if (zero? i) 'end (loop (dec i)))) is the equivalent in Scheme, with TCO
01:56alexykcan recur be used in the tail of a defn calling itself in the last line, or only in a loop?
01:56duncanmalexyk: it works with defns too
01:56twbrayalexyk: recur has to be in the tail position (compile checks)
01:56alexykok
01:57alexyktwbray: right, last line before calling itself :)
01:57hiredmansomething somewhere is eating my bandwidth
01:57duncanmtwbray: so i still don't understand
01:57alexykhiredman: aliens
01:57twbrayalexyk: It's *not* calling itself, it's executing a GOTO and overwriting the "argument" variables
01:58hiredman"If during the function execution any other dispatches are made (directly or indirectly), they will be held until after the state of the Agent has been changed."
01:58alexyktwbray: right, that's what I meant. on the high level it's calling itself, in reality doing a goto.
01:58carkand even then , there is a function to dispatch right away
01:58twbrayhiredman: Damn, wonder what it was I saw. I'm *sure* I saw an error message complaining about colliding sends or some such.
01:59cark,(doc release-pending-sends)
01:59clojurebot"([]); Normally, actions sent directly or indirectly during another action are held until the action completes (changes the agent's state). This function can be used to dispatch any pending sent actions immediately. This has no impact on actions sent during a transaction, which are still held until commit. If no action is occurring, does nothing. Returns the number of actions dispatched."
01:59twbrayOn tail calls, I said my piece in http://www.tbray.org/ongoing/When/200x/2009/10/27/Recur and the commenters said LOTS more.
01:59hiredmanI haven't used agents that much
01:59alexyktwbray: what's your feeling on Clojure vs Scala, in a few words?
01:59hiredmanso I am not familiar with modes of failure/exceptions
02:00duncanmtwbray: the only thing i wanna add (and perhaps someone said that already) is that loop/recur as a syntax is orthogonal to TCO
02:00twbrayalexyk: Am now moving on to Scala. Seems to have too much syntax, but very friendly to Java programmers.
02:00carktwbray : the one thing you need to understand is that there is no opposition btween agents and refs, any non-trivial multi-threaded program will use both
02:00_atotwbray: I agree with you on (recur). I like it. I think it makes it more explicit what's going on, instead of the tail position being somehow magical. It makes it harder to break code relying on TCO when it's explicit
02:01hiredmanclojurebot: tell me about scala
02:01clojurebotUnfortunately the standard idiom of consuming an infinite/unbounded resource as a stream can be problematic unless you're really careful -- seen in #scala
02:01alexyktwbray: I've done Scala first and now learn Clojure. I like both. :)
02:01twbraycark: My position is that if you can use agents you should because they're much easier to reason about.
02:01duncanm_ato: but the two things are not really related, what if there's TCO *and* recur?
02:01carkbut they are orthogonal to refs
02:01carksee agents as a way to fire up a thread, and refs as a way to share data
02:01twbraycark: Yes, but there are lots of places where you could reasonably pick either.
02:02carkwell i think you eventually learn when to use either one, their capabilities are very well advertised by ritch
02:02carkand limitations
02:02twbraycark: We know that people find it difficult to think about concurrency. Agents reduce the mental load substantially more. That's very important.
02:03twbrayI thought my example showed that.
02:03hiredmancark: agents are not just a way to fire up a thread
02:03hiredmanthey are a reference type
02:04twbrayhiredman is right; there's no guarantee that (send) fires up a thread.
02:04_atoduncanm: if the JVM supported real TCO (eg for mutual recursion) then it'd still be nice to make it explicit. I'm don't feel really strongly about it, I wouldn't complain if Clojure did implement magic TCO, it just seems safer to make it explicit
02:04carkhiredman : sure, they're not just data containers though
02:04alexyktwbray: I think without OO Java people are lost, but for data mining Clojure shines as it's concise. It's for all those business logics mumbo-jumbo you seem to need OO, account and such. And in Scala you can get a Java class directly, while in Clojure I may feel lost; also there's no material .class in the jars, I feel robbed! Overall it's refreshing, and you get more work done faster, IMHO.
02:04duncanm_ato: i can agree to that
02:04hiredmanthey are a way of giving identity to a set of states over time
02:05duncanm_ato: that's my point exactly - i can appreciate why people like the loop/recur syntax, but that has nothing to do with TCO
02:05hiredmangrrr
02:05alexyktwbray: my current grasp is that Clojure is the ML of Java, while Scala is Haskell of it. Or something like that.
02:05carkright, but you need to keep simplified view in your head to think easily, let me tickle you some more, hiredman : a transaction is just a lock
02:05hiredman*snort*
02:05twbrayduncanm: If you have recur and trampoline, the number of cases where TCO is really necessary/useful falls to a level that's not interesting.
02:06_atoheh, Scala is the C++ to Java's C
02:06_atoadd every feature you could possibly think of
02:06alexyk_ato: I'd say Ada even
02:06hiredmanchouser did a nice diagram break down of the reference types
02:06twbrayRight, Scala seems very big
02:06hiredmaneveryting is big next to a lisp
02:06twbrayhiredman: Erlang isn't.
02:07_atoit's an interesting language, in the sense it's interesting to try playing with a whole bunch of different ideas, but I wouldn't want to use it for a real project
02:07duncanmtwbray: i always thought the resistence to TCO has to do with the change in style: the structure of loop/recur is very different from for/while loops, learning to do that took me some time
02:07hiredmanfine! everything except prolog
02:07_atofor the same reason I don't like using C++ for real projects, there's just too much you have to know
02:07duncanmtwbray: and that's why i find it so strange that there are people like you, who are comfortable with loop/recur, and still resist TCO
02:07twbray_ato: They're rebuilding the Twitter back-end largely in Scala
02:07alexyktwbray: not really once you dig into it. My current feeling is Clojure and Scala are about the same core size in spirit. You use the sane few things most of the times, FP-wise, plus you get your objects and generics in Scala.
02:07alexyksame, not sane
02:07alexyk:)
02:08alexyksome Scala things are insane, namely implicits
02:08_atoyeah, it's probably fine if you do the same thing many C++ shops do and select a subset of the language that you'll agree to use
02:09hiredmanhttp://clojure.googlegroups.com/web/clojure-conc.png?gda=IlegQ0IAAAB9TgGpbzbMg0BCq3i8IqXn0WHwACj5HnNv70z9VRAgAqHYMl6i8-XQPbzBSKhW_SJV4u3aa4iAIyYQIqbG9naPgh6o8ccLBvP6Chud5KMzIQ
02:09twbrayduncanm: recur is simply a direct syntactic expression of what TCO actually does. I think the structure of programs should express their run-time semantics as directly as possible.
02:10carkhiredman: that's a very important diagram, but only tells half the story
02:10hiredmantwbray: very understandable as you abstracted farther and farther away from the machine
02:10duncanmtwbray: heh, by now we're entering a full-on discussion, so let's not do that - all i wanted to say is, loop/recur is not incompatible with TCO
02:10twbrayduncanm: agree
02:11hiredmancark: it is, each reference type associates a series of values/states with an identity
02:11duncanmtwbray: (one more little thing), do you think it's a *good thing* that the stack blows up if you write tailcalls in a non-TCO language?
02:11hiredmanand each one has semantics for moving from one value to the next
02:11hiredmanthat diagram describes them
02:12twbrayduncanm: Never really thought about it that much. I've done enough OS/compile work to be unsurprised when recursive algorithms fail to work for iterating over large datasets :)
02:13twbrayI love recur because it feels like the natural idiom for iterating in an immutable-data environment.
02:13_atoduncanm: do you mean as opposed to something like stackless python where you can keep growing the "stack" until you run out of memory?
02:14duncanm_ato: i dunno how stackless python works
02:14_atostackless python just allocates the stack on the heap
02:14hiredmanpeople seem to want to use agents as a papered over executor, but they provide more than that
02:14_atoso it can grow
02:14_atoas large as it wants
02:14duncanmmy understanding is that Scheme added TCO because they don't want to have any explicit loop constructs in the language
02:15duncanmso they have TCO, and you have to 're-learn' your loops because you need to phrase it as a tailcall
02:15carkhiredman : still i'd put ref not too far away from atoms, the agents waaaaay over there on the other side
02:15twbrayduncanm: Same story with Erlang. All looping via tail calls.
02:15duncanmwith loop/recur, you've already *learned* how to phrase a loop as a tailcall, you just name it differently
02:15duncanmtwbray: so there you go!
02:16twbrayduncanm: you name it *accurately* :)
02:16hiredmancark: deck chairs on the titanic
02:16duncanmtwbray: okay, i can agree to that too
02:16duncanmtwbray: we can have a TCO language *with* loop/recur as a syntax,
02:17duncanmwouldn't that make everyone happy? (except those who haven't learned to phrase loops as tailcalls, yet)
02:17_atohiredman, cark: so what fits in the "X"? refs in a future? ;-)
02:17twbrayFeels a little more natural in Erlang because everything is a process and you're usually sitting there processing a message and calling yourself to receive the next one. The name of the procedure is usually something like foo_loop.
02:18duncanmtwbray: and that's *exactly* what Scheme does
02:18hiredman_ato: the X indicates unfilled :P
02:18carkhow could we have a coordinated asynchronous thing ?
02:19hiredmanI am still hoping someday to get someone in #java to turn in a trampoline of Callables as a solution to a recursive homework problem
02:19carkmaybe using an agent to run a transaction =P
02:19_atomaybe coordinated asynchronous means "eventually consistent"
02:20duncanmhiredman: heh, depends on which school they go to, they could get extra points at some places for doing that ;-)
02:20hiredmansure
02:22duncanmsyntax-wise, i find languages like Scala and Haskell to be a lot more difficult than Clojure/Lisp
02:22hiredmanHaskell at least has the λ calculus going for it
02:22duncanmhiredman: that points-free style has me scratching my head every single time
02:23duncanmhiredman: but you like partials, so maybe you're good with things like that ;-P
02:23_atoyeah, I agree. Haskell's pattern matching stuff is pretty readable, but I'm not a fan of the function compoisition and currying
02:23hiredman:O
02:23carkfeels like forth
02:24hiredmanall is function composition
02:24hiredmanthe rest is smoke and mirrors
02:24duncanm_ato: i've been trying to learn more about pattern matching, i suppose it gets to be really handy when coupled with a type system
02:24hiredmanI wrote an interpreter for a stack language in sh a few months ago
02:25duncanm_ato: i know PLT Scheme has a pretty involved MATCH macro, someone could probably port it to Clojure
02:25hiredman(turns out you can fake linked lists in sh)
02:25hiredmanclojure has at least two match macros already
02:25_atoduncanm: well normal Haskell style using recursion a lot where Clojure uses higher-level functions
02:25hiredmanone in contrib
02:25alexyktwbray: did you look at OCaml? it dominated WF until the C++ monstrosity!
02:26_atothat's where Haskell's pattern matching is pretty nice. It's also used for multi-methods
02:26_atobut Clojure's destructuring gets you 80% of the way there anyway
02:26duncanm_ato: i was gonna mention destructuring precisely
02:26hiredmanI could never keep interested in haskell, I started looking at it after clojure
02:26twbrayalexyk: I'm looking for something with a more mainstream smell, that buys you a concurrency win with a moderate amount of code that's comprehensible by mere mortals.
02:27duncanmtwbray: i feel like clojure's popularity now cuz mean that lisp could enter the mainstream
02:27duncanms/cuz/could/
02:27alexyktwbray: then Clojure, Scala, or F#. *# you hate, so the race is on! :)
02:27carkduncann: wew that's still a long shot
02:27duncanmi guess java started the first step with GCs, and then Ruby got people comfortable with blocks
02:28wavisduncanm: have you looked at Scala? It has really good pattern matching.
02:28twbrayalexyk, duncanm: Don't count Erlang out.
02:28wavisThe one thing I miss in clojure, actually. but not much.
02:28hiredmanfyi, #scala is different from #clojure
02:28duncanmtwbray: i find erlang to be a lot more esoteric than clojure (but i know scheme ;-)
02:28alexyktwbray: you called the strings putrid, not us :)
02:29alexykhiredman: don't peg it too narrowly, we're all in JVM after all
02:29hiredmanalexyk: I just said "different"
02:29_atoheh, yeah. Someone at work the other day was complaining about the closures being added to JDK 7 as complicated. I don't think he realised that the Ruby blocks he was so fond of were just closures wearing a different shirt
02:29duncanmi'm surprised that the DSL crowd hasn't embraced lisp macros more
02:29carklet there be love between jvm brothers =)
02:29duncanm_ato: that's so funny
02:29twbray_ato: Difference is, Ruby blocks aren't bolted onto a widely-deployed 15-year-old design.
02:30duncanmtwbray: explain?
02:30duncanmoh oh, java
02:30duncanmtwbray: ahh. C# shows that there's a way to go forward
02:30_atotwbray: yeah that is true, but Java already fudges it all over the place with Runnables and such anyway
02:30_atojust less ceremony
02:30twbrayRuby is built from the ground up around the notion of blocks, your typical Rails coal-miner has no idea what a closure is.
02:31duncanmi wrote matz a few years ago asking him the difference between blocks and Procs
02:31twbrayduncanm: What "return" does.
02:31duncanmhe was very nice and wrote back saying that if he were smarter earlier, he'd just have procs
02:31duncanmtwbray: as a smalltalker, i think it's silly that you can't pass 2 lambdas (blocks/procs/whatever) to ruby methods
02:32twbrayIf you're in the java ecosystem and you want closures, use JRuby or Clojure or Scala. Don't try to bolt them on the side of the java language.
02:32twbrayduncanm: In theory, I agree with you. In practice, the single-block idiom hits this huge 80/20 sweet spot and is so easy to understand.
02:32hiredmanhttp://www.oreillynet.com/ruby/blog/2007/10/fun_with_unicode_1.html <-- I always thought the λ alias was cute
02:33duncanmtwbray: it's the TCO discussion all over again, i don't understand what *good* the restriction brings to the table
02:33twbrayReadability, clarity
02:34duncanmyou think having a comma after the } makes it not readable?
02:34duncanmdo_something ({|x| x}, {|y| y}) two blocks
02:34duncanmi dunno, i'm not really good with ruby
02:35duncanmi lost interest once i found out i can't pass more than one block ;-)
02:35twbrayI think Ruby has a bunch of small design choices that in aggregate make it tremendously seductive to a large number of programmers, more so than many languages that may actually have more flexibility and generality.
02:35twbrayFortunately, Ruby has probably enough flexibility and generality
02:35alexyktwbray: yeah, Ruby is a Hello Kitty of languages
02:35duncanmoh man, not to brag, but my favorite bug of all time is in Ruby 1.8
02:35tomojI guess you can do do_something(->{|x| x}, ->{|y| y}) now?
02:36twbray"Why Ruby Is An Acceptable Lisp" http://www.randomhacks.net/articles/2005/12/03/why-ruby-is-an-acceptable-lisp
02:36hiredmanruby doesn't have s-expressions :(
02:37tomojhear, hear
02:37alexykcan you have a lisp reader for ruby syntax?
02:37duncanmtomoj: how do i write (lambda (x) x) in Ruby?
02:37duncanmalexyk: if you write one
02:37twbrayalexyk: Ruby syntax is actually very complex
02:38duncanmalexyk: i was thinking of doing it the other day, we can use the duby stuff from headius
02:38duncanmit's not quite real ruby, but it could be interesting
02:38_atoI guess it's one of those mainstreamness thing. People think closures, S-expressions and macros are "weird", so they go to something that feels "simpler" on the surface, but is not really
02:38tomojduncanm: well, used to be lambda {|x| x}
02:38duncanmahh
02:38tomojnow I believe you can do -> {|x| x}
02:39duncanmokay, i got it, here's my magic trick in Ruby 1.8
02:39duncanmirb(main):001:0> x = 5 => 5
02:39twbrayduncanm: I think duby is very interesting.
02:39duncanmirb(main):004:0> lambda {|x| x}.call(10)
02:39duncanmwhat's the value of 'x' now?
02:40duncanmirb(main):005:0> x
02:40duncanm=> 10
02:40duncanmtada!
02:40duncanmsadly (fortunately?) they fixed that in ruby 1.9
02:40hiredmanI think headius mentioned refs in duby
02:41duncanmno one finds my magic trick cool?
02:41hiredman2009:Nov:10:12:49:01 headius : rhickey: btw, I want to try writing a plugin for Duby that adds first-class lang support for clojure refs, collections, and stm
02:41hiredmanduncanm: I am very impressed
02:42duncanmhiredman: thanks ;-P
02:42hiredman20 days ago, so he should be done...
02:42_atoduncanm: I'm afraid I had seen that trick before, but it is nonetheless impressive
02:42duncanmoh, the body of the lambda could be anything, btw
02:44tomojhmm
02:44tomojthinking about it now that seems horribly bad to me
02:44duncanm_ato: my other favorite is how loop variables in python remain in scope even outside of the loop
02:44tomojbut I don't remember ever having a problem with it when I coded ruby
02:45duncanmtomoj: the trick is, you wouldn't know if you did! ;-)
02:46_atoduncanm: yeah the python one is not so bad though. it's just got a different scoping model
02:46tomojduncanm: well, hopefully if it caused a bug, I would have noticed
02:46duncanm_ato: true
02:47alexykhow do you do integral division?
02:47tomojthough I guess I never worked on any ruby projects of any significant size... going in tomorrow to take a first look at the large 0% test coverage codebase I'll be working with :(
02:48twbray,(quot 10 3)
02:48clojurebot3
02:48twbrayakexyk: there
02:48alexykthx! and how is mod different from rem?
02:48tomojI vaguely remember that (quot x y) is much faster than (int (/ x y))
02:49_ato,(mod -1 3)
02:49clojurebot2
02:49_ato,(rem -1 3)
02:49clojurebot-1
02:49alexykah, for negatives
02:49duncanm,(doc ->)
02:49clojurebot"([x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."
02:50hiredman->> is neat too
02:50tomojhiredman: you really like them arrows, eh?
02:50duncanmi need some examples and a macro-expander ;-)
02:50tomojhuh, what do we need EBNF for?
02:51tomojthere is barely any syntax at all
02:51hiredman:(
02:51duncanmso let's see
02:51hiredmanand who can read an EBNF form
02:51esjsyntax ? (func & args) :)
02:51duncanm(-> 5 range ((partial map inc)))
02:51duncanmlet's take out the partial first....
02:51hiredman,(macroexpand-1 '(-> 1 inc inc))
02:51clojurebot(clojure.core/-> (clojure.core/-> 1 inc) inc)
02:52alexyk_ato: so there's no update-in! for transient maps?
02:52hiredman,(macroexpand-1 '(clojure.core/-> 1 inc))
02:52clojurebot(inc 1)
02:52duncanmhiredman: so (-> x foo bar baz) is (baz (bar (foo x)))
02:52hiredmanyes
02:52duncanmokay
02:52_atoalexyk: no, seemingly not. :( have to roll your own.
02:52duncanmit feels a little bit like that (.. x) syntax, okay....
02:53duncanmi'll have to see if i can rewrite some of my code to do that
02:53duncanmto use that
02:53hiredman(-> x foo (bar baz)) is (bar (foo x) baz)
02:53alexyk_ato: I'm too new to clojure, not to mention transients.
02:53duncanmhiredman: aha, again kinda similar to the dot syntax
02:53hiredmanduncanm: -> seems to be recommended as more general than ..
02:53_atoalexyk: well I guess it's because update-in is for nested datastructures and it'd be uncommon to have nested transients
02:54duncanmhiredman: can i use -> in place of the dot syntax?
02:54hiredmandot syntax?
02:54vyFor instance, if you'd need to understand what "require" does, first you'll need to read "require" from API, and because of it doesn't say anything useful and points to you "ns", you then continue with reading "ns" API reference. After reading the whole page for 3-4 times, you still don't understand what "ns" does and why you are here while just looking for a simple "require" problem, you feel inclined to press Alt+Tab.
02:54_atoactually, this is a total hack but: (binding [assoc assoc!] (update-in ...)) would probably work :p
02:54tomojvy: sure, examples would be nice
02:54hiredman_ato: cute
02:54duncanmhiredman: . and ..
02:54hiredman,(-> "foo" .toUpperCase)
02:55clojurebot"FOO"
02:55duncanmoh!
02:55duncanminteresting
02:55alexyk_ato: thanks! feels right. will try to place that around my nested map after it finishes plain run
02:55duncanm,(-> "foo" count)
02:55clojurebot3
02:55duncanmoh neat
02:55tomojfeels right?
02:55hiredmanduncanm: because it just expands to (x y)
02:55hiredman(.toUpperCase "foo")
02:55alexyktomoj: gotta go by gut for now :)
02:55hiredmanit's just a game with symbols
02:55duncanm(-> "foo" .toUpperCase count)
02:55duncanm,(-> "foo" .toUpperCase count)
02:55clojurebot3
02:56hiredmanclojurebot: macros?
02:56clojurebotHoly Crap.
02:56duncanmha, it's awesome that i can mix methods and functions
02:56hiredmanclojurebot: macro |are| just a game with symbols
02:56clojurebotc'est bon!
02:56duncanmhiredman: so now i get why this is useful, there are times when i was looking for precisely this macro
02:56hiredmannuts
02:56hiredmanclojurebot: forget macro |are| just a game with symbols
02:56clojurebotI forgot macro |are| just a game with symbols
02:56hiredmanclojurebot: macros |are| just a game with symbols
02:56clojurebotOk.
02:57duncanmhiredman: and what's ->> ?
02:57hiredmanit drops the arg in the last place instead of the first
02:57hiredman,(->> range 5 (map inc))
02:57clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn
02:57hiredmaner
02:57hiredman,(->> 5 range (map inc))
02:57clojurebot(1 2 3 4 5)
02:58hiredman(-> (range 5) (map inc)) => (map inc (range 5))
02:58hiredmaner
02:58hiredman->>
02:58duncanmhiredman: can we do the same exercise again? (->> x foo bar baz) -> ?
02:59hiredmanduncanm: for single arg functions there is no difference
02:59duncanmah so
02:59hiredman,(macroexpand-1 '(-> a (b c)))
02:59clojurebot(b a c)
02:59hiredman,(macroexpand-1 '(->> a (b c)))
02:59clojurebot(b c a)
02:59duncanmokay!
03:00duncanmhiredman: man, this is getting close to 'flip' in Haskell ;-)
03:00hiredman:P
03:00hiredmanI asked rich about adding flip
03:00duncanmhaha
03:00_ato->> is often useful for seq as things like map and reduce and filter have the seq in the last position
03:00hiredmanhe asked me when I ever needed it and I had to admit, I only ever used it for golfing
03:01_ato-> is often useful for colls and java objects, as conj, assoc etc take the coll as the first argument
03:01hiredman->, ->>, doto, partial, and juxt
03:01hiredmanand comp
03:02duncanmthese are all macros, right? or are comp/partial/juxt functions?
03:02_atothose three are just functions
03:02defn-> is the only macro
03:02defn->> rather
03:03duncanmoverusing -> and ->> kinda leads to writing a 'new' language, cuz you're introducing new syntax for something really fundemental
03:03hiredman,(-> 321 Integer/toString ((partial repeat 2)) ((juxt first (comp reverse second))) ((partial apply concat)))
03:03clojurebot(\3 \2 \1 \1 \2 \3)
03:03defni feel like -> and ->> are sort of bastardizations
03:03defnthey're novel
03:04_ato-> is just like foo().bar().baz().boom() in java
03:04hiredmanthey are takes on the thrush combinator
03:04defn^
03:04defnsee the homoiconic blog
03:04defnhttp://github.com/raganwald/homoiconic/blob/master/2008-10-30/thrush.markdown
03:04duncanm_ato: now that i've learned about ->, i can see that .. is kinda redundent
03:04defn.. came after -> IIRC
03:04hiredmanthey happen to be macros, which is nice, because you can then use .Methods
03:05hiredmandefn: are you sure?
03:05duncanm_ato: -> is like a super .., that allows for both methods and functions
03:05defnhiredman: someone told me that once, no proof...
03:05_atoyeah
03:05duncanm_ato: are you on twitter?
03:05_atoI never use ..
03:06_ato@atosborne, but I don't post very often
03:06defnI prefer the -> to .. I suppose
03:06defnbut I think it's a matter of taste
03:06duncanmyeah, i use .. quite often, but now that i know ->, i'm definitely switching over
03:06hiredmanI use -> at the repl all the time, so my code tends to have a lot of it
03:06duncanmdeep inside, hiredman is a haskeller ;-)
03:06defn(.. ) seems more clojure-esque
03:06duncanmnext he'll be asking for (1 `+` 1)
03:06duncanm;-)
03:06defnbut again, sort of a style choice
03:07hiredman(-> xml-source keep throwing functions at it until I get what I want)
03:07defn*nod*
03:07duncanmi'd say we should just rename -> to be ..
03:07duncanmor is it ->> ?
03:07defnthey behave almost identically
03:07defni believe
03:07duncanmright
03:08hiredmanhttp://gist.github.com/184831
03:08duncanmhiredman: heh
03:08tomojhiredman: is that readable to you?
03:08_atoO.o
03:08hiredmanvertical like that, sure
03:08defn-> seems more appropriate for clojure (stuff), whereas (.. ) seems more appropriate for java stuff
03:09defnis that fair?
03:09duncanmdefn: but that's arbitrary
03:09defnno, it'd idiomatic
03:09defnit's*
03:09tomojI can see what it does basically, but it doesn't look good to me :)
03:09duncanmhiredman: would it help if you did a let and named (partial map :content) and (partial map first) ?
03:09hiredman~ticket search keywords
03:09clojurebot("#154: (keyword \"a/b\") => ns nil, name a/b; should be ns a, name b" "#154: (keyword \"a/b\") => ns nil, name a/b; should be ns a, name b" "#154: (keyword \"a/b\") => ns nil, name a/b; should be ns a, name b" "#64: GC Issue 61: \t Make Clojure datatype Java Serializable" "#174: Make c.l.Keyword Serializable" "#174: Make c.l.Keyword Serializable" "#6: GC Issue 1:\t:validator as keyword arg for ref/atom/agent" "#122: GC I
03:09_atothe ((partial ...)) stuff is just to get the functionality of ->> but inside -> right?
03:09tomojflipping out the arrow would make it much worse I suspect, though
03:10hiredman_ato: more or less
03:10defn,(doc ->>)
03:10clojurebot"([x form] [x form & more]); Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc."
03:10tomojbut the problem is, I guess, that you want to mix -> and ->> style together
03:10hiredmantomoj: turning into a point free function would get rid of a lot of the parens
03:10duncanmdefn: i don't see why there needs to be such a strong line to distinguish function calls and method calls
03:10_atoheh, doing that never occurred to me, interesting, but it looks kind of crazy :D
03:10defnduncanm: im not drawing one
03:11defni just think they sort of belong to separate tasks
03:11duncanmdefn: you're saying .. for methods and -> for functions, pretty much
03:11hiredman,(-> 5 range (->> (map inc)))
03:11clojurebot(1 2 3 4 5)
03:11defn*sort of*
03:11defnduncanm: it's a matter of taste
03:11defni dont think you should do it any which way
03:11defnbut for me i like to sort of discriminate on that criteria yes
03:12defnit seems useful to me
03:12_atoI'd probaby favour (-> foo bar (->> (map :content)) blah)
03:12duncanmdefn: for me, simply having .foo is enough
03:12defnduncanm: fair enough
03:12hiredmanI like point free using comp, but -> just flows better at the repl
03:12duncanmdefn: in fact, i wish i could write (map .toUpperCase ["foo" "bar"]) instead of #(.toUpperCase %)
03:12hiredmanand I end up just pasting that code over
03:12defni like the #()
03:13defnI find that very easy to understand and use
03:13duncanmdefn: oh, i like it too, for writing quick little things
03:13duncanmbut i think one reason why it's useful is for times like what i had above
03:13defni like it for everything -- again, it makes sense to me
03:13duncanmdefn: there are times when it's useful to name the argument
03:13defnduncanm: we all have a lot of choices to make
03:14defnduncanm: there are many you can make in clojure
03:14defnduncanm: i think we're arguing semantics
03:14duncanmdefn: and i say let's remove the extraneous ones ;-)
03:14duncanmi'm not arguing ;-P
03:14duncanmi *just* learned -> not 5 mins ago
03:14hiredman,(pl (map λx (.toUpperCase x) ["foo" "bar"]))
03:14clojurebot("FOO" "BAR")
03:14duncanmhiredman: what's pl?
03:15hiredmana little macro I wrote
03:15defnduncanm: i am for the happy medium between duplicate functionality and bare functionality
03:15defnexpressivity is important
03:15hiredman(pl stands for pointless)
03:15duncanmheh
03:15duncanmmaybe i should spend some time and learn this point-free style
03:16duncanmi suppose it's like learning to write loops in loop/recur/tco compared to for/while
03:16hiredman,(pl (↕map ["foo" "bar"] λx (.toUpperCase x)))
03:16clojurebot("FOO" "BAR")
03:16defnhiredman: did you just map UTF-8 lambda x across...
03:16duncanmonce you know it, it's very evident
03:16defnwtf
03:16duncanmdefn: it's a macro
03:16defnthat's crazy
03:16defnand awesome
03:16hiredmanit does a lot of rewriting
03:16_atoand pointless :p
03:16defnstill novel and awesome
03:16defn:)
03:17hiredmanhttp://github.com/hiredman/odds-and-ends/blob/master/functional.clj
03:17_atohehe
03:18hiredman~macros
03:18clojurebotHoly Crap.
03:18hiredman:|
03:18tomojwhat is that assert crap
03:18hiredman~macros
03:18clojurebotmacros are just a game with symbols
03:18duncanmhttp://calculist.blogspot.com/2008/03/when-to-use-point-free-style.html - a guy from school wrote this
03:18hiredmantomoj: tests of the macro expansion
03:19duncanm"The reason why pointful style can be so helpful is it allows us to think about the definition of a computation in terms of particular examples."
03:19duncanmi really agree with that
03:19hiredmanis the expanded form equal to some other form
03:19tomojhiredman: yes, but, did you write your own test framework?
03:20hiredman,(doc assert)
03:20clojurebot"([x]); Evaluates expr and throws an exception if it does not evaluate to logical true."
03:20tomojoh :)
03:20hiredmanI'm generally not much of a tester, but pl is rather brittle
03:21hiredman*very* brittle after I added the λ
03:22duncanmoh man
03:22duncanmhiredman: you know this stuff, right?
03:22duncanm4.1 The owl
03:22duncanm((.)$(.))
03:22duncanmThe owl has type (a -> b -> c) -> a -> (a1 -> b) -> a1 ->
03:22duncanmc, and in pointful style can be written as f a b c d = a b
03:22duncanm(c d).
03:22hiredmannope
03:22duncanmhttp://www.haskell.org/haskellwiki/Pointfree
03:22hiredmandidn't get far enough into haskell
03:23duncanm((.)$(.)) they should call this the boobies-and-bling-bling combinator ;-P
03:24hiredmanthat is some type signature though
03:24hiredmanhuh
03:25hiredmanI don't think those signatures match (the pointful definition, and the signature), but I am no haskeller
03:26_atooh no, don't show hiredman that, he'll get ideas about how to make his code even more impenetrable to the mere mortal!
03:26hiredmanhaskell type signatures interest me the most about haskell
03:26_ato;-)
03:26duncanmhiredman: at my school, there was a research project to do Typed Scheme
03:26duncanmhiredman: it lets you write scheme code, and then using a macro, add haskell-like type-signatures
03:26hiredmanclojurebot: deft?
03:27clojurebotdeft is http://gist.github.com/128259
03:27duncanm(: add1: Integer -> Integer) (define (add1 x) (+ x 1)) -- something like that
03:28hiredmanI gut fustrated chasing a null pointer exception and wrote deft
03:28hiredmangot
03:28hiredmanduncanm: yeah, I've seen a blog post or two
03:28duncanmheh
03:29duncanmokay, bed time
03:29hiredmanclojure would be like #^([Integer] Integer) (defn add1 [x] (+ x 1))
03:29hiredmanor something
03:30hiredmannice that #^ associates with the next form
03:31alexykhow do you :use clojure.contrib.str-utils2 :as s2 in (ns ...)?
03:32hiredman(ns foo.bar (:require [clojure.contrib.str-utils2 :as s2]))
03:32alexykah
03:54_atonetworks are funny. I can only download from gitorius directly at 7 kb/s. If I proxy through a machine in the US then I can download at 500kb/s
05:05cgrandalexyk: update-in! is ambiguous: do you want only the root map to be transient, the child maps too, or to transientize the child maps as needed (and then you have to do some bookkeeping or to traverse the whole datastructure to call persistent! on each nested transient)
05:05cgranddamn, I'm too slow :-(
05:11thehcdreamerIs there a date library in clojure-contrib or somewhere else?
05:18markgunnelsthehcdreamer: Not that I have seen. For all of my stuff, I use joda-time with some wrappers to make it clojuresque.
05:19markgunnelsI'd share but my mf'in git server is down.
05:33thehcdreamermarkgunnels: thanks. I want to do things like (date/sum [date1] [date2]) or (date/since [date])
05:33thehcdreamerbut I could write my own easily
05:34esji've just started using Joda-time myself, and I think it could be what you what
05:35esjit has concepts of periods and intervals
05:35esjand is not nearly as capricious as Java Date.
06:42tomojI think the probability that I'll achieve nirvana while watching a talk by a language's lead developer is directly proportional to my love for that language
07:35adityo~max people
07:35clojurebotmax people is 218
07:35adityoawesome
07:40_atospeaking of which the mailing list is getting close to 3000
07:43powr-tocis it possible to configure leiningen to use local dependencies?
07:44powr-toci.e. jars inside a local lib/ directory that are proprietary and not contained within a repo?
07:45liebke_ato: you're just who I was looking for. Clojars is throwing an sql error when I try to add a new member to the incanter group. Have you seen this before?
07:46_atopowr-toc: install them to your local maven repository (for lein projects: "lein install")
07:47_atothat'll put them in ~/.m2
07:47powr-toc_ato: I'm not too familiar with maven... Does that require setting up some kind of server?
07:48_atopowr-toc: no. the local repository is ~/.m2/repository. Leiningen uses it to cache all the jars it downloads
07:48_atoliebke: oh dear
07:48duncanm_ato: what time zone are you in? do you ever sleep?
07:49liebke_ato: the error message is: java.lang.Exception: transaction rolled back: column name is not unique
07:49_atoduncanm: Australian Eastern Standard Time (GMT+1100). I occasionally sleep. :-)
07:50powr-tocok... so by install into ~/.m2/repository, do you mean I just need to copy the jar file in there, or do I need to do something special for the associated meta-data etc? It's a 3rd party plain old java jar.
07:50duncanm_ato: ahh, pretty much the opposite of where i am
07:52_atoliebke: err oops. I put "unique" on the group name column. That was stupid. I'll fix it
07:52_atopowr-toc: hmmm... we should add a command to lein for doing that.
07:53_atopowr-toc: if you copy it into the right place it should work, I think.
07:53powr-toc_ato: yeah, that'd be handy
07:53liebke_ato: great, thanks! Clojars has been extremely useful to me, so thanks for building it :)
07:53_atopowr-toc: try putting it at something like ~/.m2/repository/myjar/myjar/1.0.0/myjar-1.0.0.jar
07:58ambientbtw, how would submitting a project that has JNI elements in it to Clojars work?
07:58ambientif I made a lib and included win32 and linux binaries in it
08:00ambientit's just a bit of a hassle to download libraries from github and install them by hand, some alleviation to that process would be appreciated
08:01_atoliebke: should be fixed
08:03ambientdoes maven include some kind of a packaging system?
08:04_atoambient: so I'm no expert on JNI, but I've looked at what SqliteJDBC does (Clojars currently uses it even) and it manages to bundle linux, win32 and mac binaries all the same jar
08:04ambientcool, thanks. i have to take a look how it's done then :)
08:04_atothe problem is the JVM can't load native libs directly from inside a jar
08:05_atoso what SqliteJDBC does is checks os.name property
08:05_atopicks the appropriate lib for the current OS
08:05_atoand unpacks it into a temporary file using Class.getResourceAsStream("libsomething.so") and File/createTempFile
08:05_atoit then calls System/load on that temp file and marks it for deletion on exit
08:06ambientcheers. that was helpful
08:07_atono worries. :) I haven't tried it, but that's the approach I'd take. If we can figure out a method that works well it seems that would make a good Leiningen plugin
08:36liebke_ato: add member is working now, thanks!
09:00ordnungswidrigaloha
09:01chouserordnungswidrig: good morning
09:02rfgpfeiffer,(defprotocol foo)
09:02ordnungswidrigme wants functional api without exceptions :-)
09:02clojurebotDENIED
09:03chouserheh. wrap with binding or wrap with try/catch
09:04ordnungswidrigchouser: wrapping is possible but does not match my development model.. I consider brancher either library :-)
09:04ordnungswidrigs/\(branch\)er/\1ing/
09:05chouseryeah, I was just noting the similarity in that both demand a dynamic-scope wrapper around the calls, either with try or binding.
09:05ordnungswidrigyes, and I don't like either :-)
09:06ordnungswidrigI notice that having such wrapper like a macro "with-db" can be useful. But only as a add-on to a pure function interface.
09:07ordnungswidrigOne can use multiple function implementation with different arity for example.
09:08chouseryes, I agree that's usually better.
09:10ordnungswidrighmm, If I have (defn fromdb ([db query] ...) ([query] ...)) where the second form will call (fromdb db-in-scope query) can I generalize this.
09:11ordnungswidrigI suppose a macro to redefine a function f can do.
09:11chousersure, with a macro
09:11chouserright
09:11chouser(defmacro defn-with-query [name args & body] ...)
09:12ordnungswidrigchouser: like a (redefn-with-curry-from-scope fromdb db-in-scope)
09:14angermanis there a function that would turn (10 11 9 12 13) into (10 (10+11) (10+11+9) ... (10+11+9+12+13))?
09:15chouserangerman: seq-utils reductions
09:17chouser,(use '[clojure.contrib.seq-utils :only (reductions)])
09:17clojurebotnil
09:18chouser,(reductions + [10 11 9 12 13])
09:18clojurebot(10 21 30 42 55)
09:18angermannice
09:22ordnungswidrigdo I remember correctly that ouside let bindings will be captured in a defn while bindings with "binding" will not?
09:22rfgpfeifferrhickey: (defprotocol foo)(isa? (class (reify [foo])) foo) returns false
09:24rfgpfeifferwill this be changed?
09:24rfgpfeifferit works on interfaces
09:24rfgpfeiffer(isa? (class (Thread/currentThread)) Runnable) is trie
09:26chouserrfgpfeiffer: the interface name is user.foo
09:27rfgpfeifferit works with user.foo
09:28angermanwhat would be the appropriet datastructure to use for a sparse vector?
09:31ordnungswidrigangerman: finger tree :-)
09:32angermanhmm...
09:32cemerickis there a bleeding-edge clojure maven repo somewhere?
09:33rhickeyprotocols are very much not about hierarchy. One should never do isa? with a protocol interface - why? - because not all extenders of a protocol will have a type relationship with it. You can do satisfies? if need be, but the whole point of polymorphism is to free us from having to ask things what they are
09:34rhickeycemerick: http://build.clojure.org/
09:34cemerickrhickey: that doubles as a maven repo?
09:34rhickeycemerick: somehow
09:34cemerickhuh
09:34cp2mornin rhickey
09:35cemerickmaven is totally opaque to me at the moment
09:35rhickeyhttp://groups.google.com/group/clojure/browse_frm/thread/8270d639913c2f01
09:36rhickeyhttp://build.clojure.org/snapshots
09:36rhickeycp2: hey
09:36cemerickOK, the /snapshots dir definitely looks like a repo
09:37cp2i havent really been keeping track too much on clojure, anything new/cool happen lately? :D
09:37ordnungswidriggnah, dumping a complete coudbdb as json to a repl console might kill your emacs.
09:38liwpordnungswidrig: after things calm down you can clear the slime buffer, which will make things happier again
09:39liwpordnungswidrig: C-c C-o - slime-repl-clear-output I believe will do the trick
09:39chousercemerick: ah, thanks for reminding me -- I gotta put that versions string change in so there can be a "new" branch snapshot as well
09:39angermanhere's my first shot at a LibSVM model file parser
09:39angermanhttp://gist.github.com/247236
09:39ordnungswidrigliwp: C-c C-o doesn't work. Hoever it is written to *inferior-lis* anyways
09:40cemerickchouser: yeah, I saw that thread, and was equally confused
09:40chouser:-)
09:40cemerickI'm rapidly being reminded why I stayed in ant-land for so long
09:40chouserlein is going to get me into maven the way clojure got me into java
09:41chouserheh
09:41cemerickha
09:41cemerickthat's where I've always been, too :-(
09:42cemerickit's all such an amazing about of busywork
09:43lpetitchouser: maven is not so bad. It's just that it sometimes does not seem simple to do simple things with it. But once lein will become more heavy when user stories are added to it (add other remote repos, how to manage licenses, how to do unit tests, and then functional tests, what about generating cross reference docs, etc.), it will get closer to maven.
09:43lpetitlein is a learning process to maven :)
09:43chousermy point exactly.
09:43ordnungswidrigclojure and couchdb go so well togethr: (map :value (:rows (view-get host db design view { :key "item" :limit 10 })))
09:45ordnungswidrigTo throw a idea into the pool on build systems. I like make for it's attempt to be dependencies triggered, say a jarfile depends on some class-files. I like maven for it's high abstraction and not to be file-based.
09:45chouserrhickey: "par" is the only other public branch that's particularly alive, right?
09:46ordnungswidrigI think of a tool which is dependency-based, say, the execution of some test-cases depend on some class-files are avaiable which depend some other classes are loadable by a classloader: either as a class file which is then compiled or as a class which can be loaded from a 3rd party jar.
09:46rhickeychouser: yes
09:47ordnungswidrigSo dependency is logical (class A depends on the availability of class B) and not physical, like make (file A.class depends on file B.class) or declarative like maven (project A depends on project B)
09:47cemerickso, will a http://build.clojure.org/releases appear eventually as well, then?
09:49chouseroh dear
09:50chousershoot. I just pushed private branches to github.
09:50ordnungswidrigchouser: private in a sense of offending or business secrets?
09:50chouserno, not that bad.
09:51cemerickchouser: push -f
09:51ordnungswidrigchouser: or both? :-)
09:51chouserjust me mucking around in clojure sources, now on the official github repo. :-/
09:51chousercemerick: ?
09:51djpowellhow do protocols redefine their interfaces? just by calling .defineClass again? does that have any caveats?
09:52cemerickchouser: you can just back up the ref(s) involved and push -f to bring the remote back to where it was
09:52rhickeyhttp://github.com/guides/remove-a-remote-branch
09:54chouserwow. magical.
09:54chouserthanks guys
09:54fliebelHas anyone ever tried Robocode with Clojure?
09:55rhickeydjpowell: they define a new interface, with the same name, in a new classloader. iff the interface has changed (i.e. generated different bytecode), then implementing deftypes/reify and protocol callers will need to be reloaded
09:59chouserShouldn't (satisfies? ::Foo (reify [Foo]) return true?
09:59chouserat least when you close all the parens?
10:00rhickey(satisfies? P (reify [P]))
10:00rhickeytrue
10:01rhickeygiven: (defprotocol P)
10:01chouserright. coulda sworn I tried that.
10:01rhickeynot ::P
10:01chouserdo we ever use ::Proto anymore?
10:02rhickeydid we ever?
10:02rhickeyonly: ::ADataType
10:02chouseroh, ok.
10:03rhickeyI haven't figured out if getting rid of the tag is possible given the latest dynamic type stuff
10:03chouserI *did* try it. but I think that was before a recent bug fix and multiple (defprotocol Foo)s were breaking it. Or something.
10:03chouseranyway, works now, thanks.
10:03rhickeygreat!
10:04rhickeydocs ok for everyone?
10:05chouserindentation of first example in (doc defprotocol) seems broken
10:08chousername mismatch in the defprotocol interface paragraph
10:08chousermy.ns/Protocol vs my.ns.MyProtocol
10:11rhickeythe protocol is my.ns/Protocol, and the interface my.ns.MyProtocol
10:11chouserwhere is My coming from?
10:12rhickeyoh, that :)
10:12chouser:-)
10:12rhickeywill fix, thanks
10:16chouserit seems a bit funny for deftype to have fields before protocols, when both are included.
10:16chousermaybe that's just java syntax working on my subconcious
10:20cemerickso, I've set a dependency in a pom to 1.1.0-alpha-SNAPSHOT, but maven is looking for http://build.clojure.org/snapshots/org/clojure/clojure/1.1.0-alpha-SNAPSHOT/clojure-1.1.0-alpha-SNAPSHOT.pom, rather than finding the latest version and getting http://build.clojure.org/snapshots/org/clojure/clojure/1.1.0-alpha-SNAPSHOT/clojure-1.1.0-alpha-2009xxxxxxxx.pom. Thoughts?
10:20chouserrhickey: no mention in deftype that you can use hints to get primitive field types
10:21lpetit~types
10:21clojurebotPardon?
10:28cemerickooh, setting <version> to 1.1.0-alpha-20091110.180127-1 prompted maven to download ..../1.1.0-alpha-SNAPSHOT/clojure-1.1.0-alpha-20091110.180127-1.jar -- but how did it know to use the 1.1.0-alpha-SNAPSHOT directory?
10:30lpetitrhickey: if I want different protocol P implementations for a set of types #{T1, T2, T3} which will share the same fields set definition, what would be the best way to do it ? And what would be the easiest way to "transform" an instance from type T1 to type T2 ?
10:31angermanwith what -Xms parametes is the slime clojure repl started by default?
10:36angermanrhickey: what whould be a sane way to handle 45000 x 250 floats in clojure?
10:36opqdonutdepends pretty much on the access pattern
10:36chouserangerman: probably a Java array. :-/
10:37opqdonutyeh, probably
10:37chouserno other containers of primitives in Clojure (yet)
10:37angermanso I somehow need to know the size beforehand :(
10:37chouserangerman: depending on what you're doing with it, there may be a Java lib that abstracts away the ugliness for you a bit.
10:38duncanmwhat's the overhead of Array vs. ArrayList?
10:38chouserangerman: vectors of primitives are planned I think, but probably not until after clojure-in-clojure.
10:38chouserArrayList can't do primitives either, can it?
10:38duncanmoh, right right....
10:39chousermaybe primitives aren't required.
10:41angermanso I somehow need to insert them into an Array. (then I probably could turn that into a matrix from incarnater)
10:41chouseryou can't just use an incanter matrix from the beginning?
10:42angermanso I need to do two runs over the data, first one, figuring out the metrics, second one loading the data.
10:42angermanchouser: I haven't found a "set value V at (x,y)"
10:42angermanthat's probably the only thing that matlab does nicely. :/
10:42chouserhuh
10:42chouserI don't know incanter at all.
10:44angermanincanter goes like this: I'll make you an array from data: ... though I think there is an (add row/add col) functionallity
10:44liebkeangerman: you can call .set on incanter matrices, (.set foo row col val)
10:45liebkeit changes the matrix in place
10:45angermanliebke: ok, that seems nice.
10:45angermanliebke: still, i should know the matrix size beforehand, no?
10:45liebkeyou have access to all the Colt matrix methods
10:46liebkeyes, unless you want to construct it with bind-rows, etc
10:46angermanliebke: I'm trying to get a LibSVM binding for clojure. (which if it would work, could be interesting for incanter i think)
10:46liebkeyes, that could be interesting
10:48angermanI will persue the non-pure-java road though, as the binaries of libsvm work pretty speedy and it seems to be the same approach R and Matlab use
10:49chouserNo interface for Throwables. :-(
10:50angerman?!
10:51chouserI can't use deftype to make my own Exception type because there's no abstract interface for that 'throw' will take.
10:52chousersomeday gen-class may die. But not today.
11:06powr-tocpresumable "lein repl" includes the project on the classpath?
11:09fliebelSecond try: Has anyone ever tried to make a bot with Robocode with Clojure?
11:15liebkepowr-toc: yes, the project is included in the classpath.
11:16powr-tochmmm maybe I have a namespace issue then
11:17liebkewhen I say the project is included, I mean your project classes and dependencies
11:18powr-tocyes, that's what I meant too :-)
11:18liebke:)
11:18schafHi
11:19schafhow close is clojure 1.1? Is it recommended to use 1.0 when wanting to use clojure in a project or is it better to start with the development version right away?
11:19chouserschaf: based on a recent poll ... :-)
11:20chouser30% of respondants are using 1.0 -- the rest are using some pre-release snapshot of 1.1
11:20schafchouser: based on "1.1 is really close and not many new changes will happen" or "dev is all moving.."
11:21powr-tochow about leiningen? Are people using stable or the git master?
11:21tcrayfordhave to use the git master for emacs/slime integration
11:21powr-toctcrayford: ahh cool... that's something I was wanting
11:22tcrayfordsee http://wiki.github.com/technomancy/leiningen/emacs-integration
11:22chouserthere are a couple things in 1.0 and master that will probably be deprecated for 1.1, meaning they will work but we should try to stop using them.
11:23powr-toctcrayford: that looks pretty sweet
11:23chouserbut off the top of my head, I can't think of any code that would work in 1.0 but not in 1.1
11:23tcrayfordI'm still getting my head round figuring lein/emacs/slime out
11:23chouser1.1 is probably pretty much feature-frozen. Not sure about how soon it might be released though.
11:23tcrayfordbeen a while since I've used any of them (switched to textmate for a bit)
11:25rdsrHi all, I can't seem to add documentation to a lexically scoped function created with letfn
11:25rdsrthis throws an error
11:25powr-tocliebke: Am I missing something, I've run "lein repl" and (all-ns) does not include my namespace as specified by defproject
11:25rdsr(letfn [(fun
11:26rdsrthis throws an error (letfn [(fun "documentation" [] 1)] 1)
11:26chouserrdsr: that's not currently supported
11:26rdsrIs this a bug, or am I doing something wrong
11:26rdsr?
11:26rdsroh ok thks chouser
11:27chouserrdsr: how would you get at those docs if it were?
11:28rdsrI was thinking more from the point of the person reading the code
11:28liebkepowr-toc: yeah, i don't see my namespace when I do (all-ns), but I can load my classes
11:29rdsrWell I guess I can just add a side comment :)
11:29chouserrdsr: sounds good. :-)
11:30noidiaargh... I'm reading the reddit comments of Tim Bray's latest Clojure post and I'm starting to really appreciate the lack of smug Clojure weenies :)
11:31powr-tocliebke: Ok... So you need to do a (require 'myproject) even after a "lein repl"... Is this a feature?
11:31liebkeyes
11:31liebkelein repl just makes sure everything is on the classpath, you still need to require/use it
11:32powr-tocliebke: I clearly don't fully understand clojure namespaces, but would it not make more sense to require it automatically?
11:32powr-tocor is it because requiring a namespace can have side-effects?
11:33liebkenot necessary, it doesn't know what options you might supply to 'use'
11:35powr-tocmakes sense I guess... it's just another thing for me to remember... Presumably it'd be easy to write your own lein task that started a repl with the REPL initialised with require etc...
11:38liebkeyou can just create a user.clj file that will require anything you need.
11:40chouserha! this is great http://www.reddit.com/r/programming/comments/aa44a/eleven_theses_on_clojure/c0gl2oy
11:41chouser"Baked in 375 degrees for 30 minutes, placed in an oiled bowl, kneaded for 10 minutes, mixed flour and water"
11:41cemerickchouser: so having a 1.1.0-new-SNAPSHOT just a matter of updating version.properties?
11:42chousercemerick: for clojure itself, apparently, yes. The consequences for the maven builder or people using maven to consume the builds are all beyond me.
11:43powr-tocliebke: Good idea... how is it I can put user.clj on the lein repl classpath, drop it in src?
11:44cemerickthere's the matter of clojure-contrib's branch proliferation, too.
11:45cemerickSeems like if one is following the edge, pushing a build into an internal repo is the way to go for now....especially since I'm totally out of my depth with maven still.
11:45leafw_is there any reason why test.clj contains the docs first as a comment and then, identical, as a documentation of the namespace?
11:47chouseryes, when the comments at the top of a file match exactly the namespace docstring, Clojure will automatically generate a .. er... no, nevermind.
11:47leafw_I've seen this in some files of clojure contrib as well
11:47chousertest.clj came from contrib
11:48chouserbefore namespaces supported docstrings, the contrib libs documented themselves in comments
11:48leafw_and I wonder how will something like test/junit.clj go for clojure-on-clojure
11:48chousersomeone went through and copied those into the namespace docstrings at some point. *shrug*
11:49leafw_chouser: I understand there is a history to it. What bothers me is that readability is diminished by the duplication--and both versions may differ subtly
11:49chouserwell, you asked for the reason. *more shrugging*
11:49leafw_ok
11:49leafw_doesn't damage anything anyway
11:51chouserwhy would junit.clj be an issue for clojure-in-clojure?
11:51chouseryou could use it to generate junit-compatible xml results for your ClojureScript project! :-)
11:51leafw_just being pedantic/idealist, forget it. The short version: clj remains attached to JVM with junit
11:52chouserI'm afraid we'll have more issues with things like throwing Throwables
11:53chouserdoes .Net have a class named Throwable? Does Objective-C? Javascript?
11:54gravityIs anyone else's swank-clojure HEAD broken? I get 'Cannot open load file" "swank-clojure-autoload"' when trying to execute clojure-slime-config
11:54leafw_no idea chouser
11:55leafw_what clj doesn't have at the moment is a dead-easy ClojureInterpreter, like the PythonInterpreter for jython or the org.jruby.Ruby, etc.
11:56leafw_I had to create my own, and it wasn't entirely clear at the beginning how to do it.
11:56leafw_for embedding clojure, that is.
11:56chouserhuh. you did it though?
11:56leafw_yeah
11:56chouserin a context where you couldn't have a DynamicClassloader, or... ?
11:57leafw_in a context where I needed a trivial way to give clojure a string with code and get back the result, run within a specific namespace.
11:58chouserI'm just wondering why you didn't want to use 'eval'
11:59leafw_if there is an easier way to do it, I'd appreciate comments: http://tinyurl.com/yl3fc62
12:01ohpauleezleafw_: Why didn't you use eval? And did have a look at how the jsr-223 bindings were done
12:02leafw_the meat of the evaluation is at line 262
12:02leafw_uses Compiler.eval
12:02chouserleafw_: that's pretty cool -- nice for giving a repl in a restricted JVM environment for example.
12:02chouser(binding [*ns* (the-ns 'foo)] (eval (read-string "::bar")))
12:03chouseroh, you are using eval. huh.
12:03leafw_ohpauleez: I need help understanding what you asked for.
12:03leafw_chouser: I needed way to let the user change the namespace too, via normal in-ns etc.
12:03ohpauleezSomeone has made jsr-223 (embedded Java scripting) bindings for clojure.
12:03ohpauleezlet me dig it up
12:03ohpauleezI haven't looked at it, so I'm not sure how they did it
12:04leafw_this class I pasted shows up as a JFrame with a "screen" text area and a prompt
12:04leafw_ohpauleez: ok, I understand.
12:04ohpauleezYeah, I'm looking at your code now, pretty cool for sure
12:06leafw_it enables me to type in any clojure code, just as you would from a command line started with clojure.main
12:07leafw_but if you look at the similar classes for jython, jruby, javascript or beanshell, they are ... infinitely shorter, because those JVM languages have already a "X-Interpreter" class that does it all.
12:08technomancypowr-toc: right now "lein repl" is implemented in the shell script. after 1.0 it will be moved to clojure code so niceties like auto-requiring your :main namespace can happen automatically
12:08powr-toctechnomancy: cool
12:09technomancybut I don't use it personally; I stick with swank. so I need other people to tell me what's useful. =)
12:10chouserleafw_: there are easier ways, I think.
12:10leafw_chouser: this class is a compromise ... had to handle streams from files and from text areas, and had to wait until concluding each task, etc.
12:11chouserleafw_: I think I'm doing something similar here: http://tinyurl.com/y9dpwzq/textjure.clj#LID245
12:11leafw_written in clojure, that's not fair :)
12:12chouser:-)
12:12chouserbut... why are you writing in Java when you have clojure already?
12:12leafw_and yes it looks very similar.
12:13leafw_chouser: because initially I didn't know enough clojure, and it was easier to embed into our build system
12:13chouserok
12:13leafw_I see now that I could just have reduced the java side to about 1 single line of code.
12:14chouserthere's also some potentially useful pieces in clojure.contrib.repl-ln and even clojure.main
12:14leafw_I did that for the neuronal identification tool ... just an invoke.
12:18powr-toctechnomancy: I think I'll probably use slime, but i can imagine using a raw repl when sshd into a server, so it might be handy then
12:21technomancy"Aquamacs defaults to putting the *scratch* buffer into text-mode, not into lisp-interaction-mode." *facepalm*... wow.
12:21technomancyno wonder people have trouble getting stuff installed. =(
12:21leafw_chouser: textjure.clj is indeed similar, but I can't see how to bring about the previous prompt entry, and the code history doesn't go to the top window (is this intended? If so, what is the top window for?)
12:21alinphi guys
12:22alinphow can I swith the current namespace to something like: org.test.mytests
12:22bitbcktEw. Aquamacs.
12:22alinp?
12:23ohpauleezalinp: (ns my-new-ns.my-sub-ns)
12:24chouserleafw_: I think there's no command history support yet, and the top window is meant for editing a source file
12:24ohpauleezalinp: for more info http://java.ociweb.com/mark/clojure/article.html#Namespaces
12:24alinpthanks ohpauleez
12:24ohpauleezalinp: np
12:24leafw_chouser: you have in there some cool macros for handling key bindings
12:24chouserleafw_: yeah -- that's what I was working on when I got distracted by other things
12:25chouserleafw_: the keybindings aren't 100% yet, but I have grand plans. :-P
12:25leafw_ok
12:25powr-toctechnomancy: Though it might be nice if the lein script would use rlwrap if it was installed for lein repl
12:25leafw_keyword expansion would be great--it's the sort of thing I'm missing most in my interpreter.
12:25technomancypowr-toc: yeah, may add that
12:26technomancyproblem is I really hate coding shell scripts
12:26powr-toctechnomancy: yeah, me too :-)
12:26leafw_yours is a cross in usage between my interpreter and the script editor http://pacific.mpi-cbg.de/wiki/index.php/Using_the_Script_Editor
12:27leafw_a script editor written in clojure, with keyword expansion, history, a prompt, and syntax highlighting, and vi bindings, now that would be something :)
12:28chouserleafw_: that's the plan
12:29chouserand it's only been about a year since I was last making any progress on it. :-P
12:29leafw_working on such a project can hardly be justified, considering the existence of many good editors.
12:29chouseryes
12:29chouserall of which are insufficient
12:29leafw_true.
12:29chouserwell. barely sufficient, which is perhaps worse.
12:30leafw_I've already built two, but in java.
12:30leafw_and both are short.
12:33chouserI really just want a modern emacs that supports vi bindings as first-class citizens.
12:34jasappchouser: a vi guy?
12:35leafw_chouser: viper doesn't quite cut it, if that's what you mean
12:36ohpauleezclojure is the first lisp that I'm ok with editing in vim (which I use as my standard editor)
12:36ohpauleezI think the community has done a great job at offering real support across the board
12:36leafw_ohpauleez: Mikel put a lot of work to make that happen
12:37jasappI think that's nice
12:37ohpauleezfor sure
12:37jasappI remember being ridiculed mercilessly for not using emacs when hacking common lisp
12:37jasappthe clojure group seems much more friendly
12:38chouserleafw_: right
12:38bitbcktjasapp: Here, you might be gently ribbed. But only in good fun. :-)
12:39chouseryeah, I don't love vim, but I do love the keybindings.
12:39jasappbitbckt: I gave up years ago, and now I just use emacs :)
12:39chouservimscript is atrocious, and somehow the multitude of script language bindings don't actually help much.
12:40bitbcktjasapp: See? Isn't that easier?
12:41jasappbitbckt: 6 years later, but at the time it wasn't so nice
12:41bitbcktSuch is life.
12:41jasappmy wife still remembers how I was grumpy for months about switching
12:41ohpauleezhaha
12:42KirinDave_Hah
12:42KirinDave_Which editor people use is like high school dramas.
12:42KirinDave_"o/ So freakin' important. These things matter."
12:43powr-toctechnomancy: I've sent you a github pull request, that'll use rlwrap if it's installed
12:43KirinDave_"Nothing will ever be more important than the editor you use right here, right now."
12:43hamzahey guys, is it possible to have a map that retains its insert order while iterating?
12:43jasappKirinDave_: I agree completely
12:43KirinDave_I mean, is there anyone who really uses one editor exclusively?
12:43bitbcktKirinDave_: +1
12:43KirinDave_I mean, really.
12:43KirinDave_If you don't know vi+m, good luck when you're admining remote boxes over a slow link or when you go to a really bare-bones install.
12:43bitbcktI find the whole "war" really very amusing.
12:44ambalekit seems like different editors suit different projects
12:44KirinDave_If you don't know emacs, have fun reinventing your wheel again and again.
12:44chouserKirinDave_: I have *tried* many editors, but I use vim for everything at the moment.
12:44KirinDave_chouser: I'm talking about exclusive use, in practice.
12:44KirinDave_chouser: You never use any other editors, ever? :)
12:45chouserhamza: possible, yes, but none of clojure's built-in maps do that.
12:45ohpauleezhamza: not to my knowledge. You could prefix your inserts and use a sorted map
12:45cemerickIf I'm grokking things right, clojure's pom isn't at all useful for building it, correct?
12:45powr-tocorg-mode keeps me tied to emacs :-)
12:45ohpauleezgah, chouser beat me to it
12:46KirinDave_powr-toc: There are many replacements to it. :)
12:46cemerickoh, hah, it's autogenerated from ant
12:47powr-tocKirinDave_: Heresy! Nothing could replaceme org-mode!
12:47hamzachouse: thanks..
12:47chousercemerick: oh! ah
12:48chousercemerick: now I see why I didn't have to change it manually. :-)
12:48cemerickchouser: yeah. The current setup seems a little nutty, but makes sense given that ant is the blessed build tool
12:48ohpauleezTo anyone's knowledge, has someone attempted a mechanize project for clojure? something like tying together htmlunit and enlive in a clojure way
12:48chouserarray-maps keep things in reverse insertion order these days, though that's probably not guaranteed.
12:48cemerickIt wouldn't be difficult to make the pom functional on its own, though.
12:48powr-tocKirinDave_: Seriously, what org-mode replacements are there? vimoutliner??
12:49powr-tocorg-babel's clojure support is pretty sweet
12:50lisppaste8rhickey pasted "cast your vote!" at http://paste.lisp.org/display/91445
12:52bitbcktrhickey: A.
12:52cemerickrhickey: C
12:53cemerick#clojure is the American Idol of lisp channels :-P
12:53bitbckthah
12:53rhickeycemerick: i.e. votes equally rigged?
12:54cemerickrhickey: heh, the analogy just keeps on truckin' :-D
12:54KirinDave_powr-toc: I use OmniFocus.
12:54leafw_is there any cost for an implicit this, making this a reserved keyword?
12:54chouserA doesn't allow for optional per-method 'this', right?
12:54KirinDave_I used to use org-mode, but I needed synching that isn't so brittle.
12:54cemerickrhickey: you have your original preference written in a sealed envelope, I presume?
12:54wilkesrhickey: C
12:55patrkrisAre Clojure's references inspired by the ones found in Standard ML? Or are they at least comparable to those?
12:55rhickeyleafw_: won't be a reserved keyword in any case
12:55rhickeychouser: right, no per method
12:55rhickeycemerick: I could be done already, just surveying the resistance :)
12:56powr-tocKirinDave_: I head that was quite good... but does it have clojure integration? :-)
12:56KirinDave_powr-toc: I suppose if you want to to make an applescript bridge, yes.
12:57chouserI don't like C. Anymore. :-)
12:59bitbcktHmm.
12:59cemerickrhickey: ^^ ;-)
13:00rhickeycemerick: for C? what about the recur mismatch?
13:00bitbcktI find C noisy.
13:00bitbcktAnd though I like A, the recur issue remains.
13:01cemerickrhickey: that's a small price to pay for consistency everywhere else
13:01chouserI'm tempted by B with always required this (so no extra vector nesting)
13:02cemerickI really dislike implicit arguments in general.
13:02chousernaming it at the top of whatever block weakens the argument against implicit a bit
13:03rhickeychouser: always required for reify and implicit this for deftype?
13:03chousermaking it required would serve as a reminder and make it easier to have crystal-clear error messages.
13:04chouserrhickey: required for deftype too, if any methods are given.
13:04ohpauleezI too really dislike implicit args, but I think I could like naming it at the top of a block
13:04ohpauleezI can't come up with a case where that doesn't work for me or would cause a serious issue
13:06chouserfor the methody things, there is inherent mismatch as demonstrated by recur and outside calls taking different arg counts. That first arg really is special (moreso than say in Python methods), and that mismatch will show up somewhere, it's just a question of where.
13:07chouserdo you want it in the 'recur' args? or in the formal method args? If the latter, you can make the difference a bit more explicit by putthing the name at the top
13:09chouserB gives you no false consistency that leaks out around 'recur', and with required 'this's you reduce the [] noise a bit and remind everyone the scope and name of the symbol you're introducing.
13:10cemerickit seems that any degree of implicitness only benefits writers, not readers. Further, making the arg explicit can be used to usefully communicate what's happening to the callee. e.g. _ generally means 'this' isn't used at all, etc
13:10rhickeythe simplest case with B + required this is: (reify this ActionListener (actionPerformed [evt] ...))
13:10rhickeyor (reify _ ActionListener (actionPerformed [evt] ...))
13:11hiredmanI don't like implicit args, but if it is such a blight, then by all means, make it go away (implicit)
13:11rhickeyunused but required at top seems like baggage
13:12chouserI'm still against implicit, but maybe could go along with elided
13:13chouserextend-class still needs explicit though, becuase those things aren't methods, they're functions. no use in pretending otherwise.
13:13cp2http://www.jroller.com/scolebourne/entry/closures_in_jdk_7
13:14defnWhat is something like "this", called? I am trying to find a wikipedia entry or something to get a little context on the current conversation
13:18lisppaste8rhickey annotated #91445 "protocol grouping - vote!" at http://paste.lisp.org/display/91445#1
13:19Chousukesecond one gets my vote. easier to handle with paredit :P
13:19defnWithout knowing a heck of a lot about the underlying differences, I prefer X
13:19hiredmandefn: safe bet, X has always been the coolest letter
13:20defnhaha
13:20chouserX
13:21chouserChousuke: get a better editor. ;-)
13:21Chousuke:P
13:21defnoooo! Them's fightin' words!
13:21ChousukeI would, but I haven't found any yet
13:21cemerickX
13:21rhickeycan we please not talk about editors (again) right now?
13:22Chousukeheh.
13:22hiredmanX
13:22chouserI thought that's just what people say when anyone complains about lisp syntax.
13:22ChousukeX looks a bit pythonic I guess
13:22rhickeyI forgot to mention a benefit of Y is that 'this' at top could be optional, and not in [] when specified
13:22cp2rhickey: Y
13:23chouserthere are a couple pain points with Clojure's tendency to keep nesting levels shallow, (indentation support and macros that have to parse/produce the critters) but the benefits are worthwhile and widespread.
13:24rhickeybtw, if anyone has any write-in ballots for these, feel free
13:25chouserI'd rather have [this] only when required than [Proto (method) ...] always
13:26cemerickit looks like no clojure artifacts have been added to the snapshots repo since 11/26
13:27defnHuh...http://en.wikipedia.org/wiki/Template:Sound_change -- Hadn't ever heard of Lenition, Epenthesis, or Cheshirisation
13:28defnsome of those seem like a good way to describe the differences between A,B,C or X,Y.
13:33rhickeydefn: huh, don't see it right off
13:36tcrayfordtest
13:55arj_a silly question, how do I undef a function in a namespace?
13:56arj_ah ns-unmap
13:56arj_:)
13:56leafw_,(doc ns-unmap)
13:56clojurebot"([ns sym]); Removes the mappings for the symbol from the namespace."
14:02hamzait seems that assoc adds to the beginning of the map is there a way to get it to add to the end of a map,
14:02hamza,(assoc (assoc {:a :b} :c :d) :e :f)
14:02clojurebot{:e :f, :c :d, :a :b}
14:02hamzai am trying to get {:a :b :c :d :e :f}
14:03Chousukemaps are unordered
14:03hamzai am trying to calculate a SHA1 hash and i need to keep the order in order to get a correct hash
14:03Chousukethere's sorted-map though.
14:04hamza,(doc sorted-map)
14:04clojurebot"([& keyvals]); keyval => key val Returns a new sorted map with supplied mappings."
14:04hamzawhat does it sort based on?
14:04hamzakeys?
14:04Chousukeyeah.
14:06hamzaisn't it not possible even if i am going to use it once? i won't add or remove anything it has to keep order once..
14:11fliebelWhat is the use of using defn- or starting function names with '-'? http://www.fatvat.co.uk/2009/05/clojure-and-robocode.html
14:12the-kennyfliebel: - is the default prefix for :gen-class to generate java-functions, defn- creates private functions
14:20alexyksomnium: ping
14:21jasappalexyk: congomongo trouble?
14:23alexykjasapp: I'm just wondering how to serialize joda DateTime
14:24jasappahh
14:25jasappthat's funny, I'm working on saving dates right now
14:26alexykjasapp: well, it eats java.util.Date, apparently
14:26jasappI'm taking the lazy route, and just converting them to ms
14:26jasapphmm
14:26alexykjasapp: my original was even lazier, with string
14:27jasappnice
14:28jasappjoda takes java.util.Date, or ClojureDBObject takes it?
14:28twbrayWondering how to use FileInputStream.read since it wants a byte[] argument...
14:28alexykjasapp: the beauty of it you can inspect in shell. congomongo eats Date
14:29stuartsierratwbray: (make-array Byte/TYPE *buffer-size*)
14:29twbraystuartsierra coolio, thanks
14:31hamzahow can i force this to evaluate?
14:31hamza,(str (take 2 (repeat "0")) "asd")
14:31clojurebot"clojure.lang.LazySeq@9c1asd"
14:32stuartsierrahamza (apply str ...)
14:32hamza,(apply str (take 2 (repeat "0")) "asd")
14:32clojurebot"clojure.lang.LazySeq@9c1asd"
14:33KirinDave_Uh
14:33KirinDave_,(apply str (take 2 (repeat "O")))
14:33clojurebot"OO"
14:33stuartsierra,(str (apply str (take 2 (repeat "0"))) "asd")
14:33clojurebot"00asd"
14:33hamzaoh ok threat them seperatly..
14:33hamzathen
14:33KirinDave_Unless you want to explicitly conj them.
14:33KirinDave_Yes.
14:33stuartsierrayes, for 'apply' only the last argument is treated as a sequential thing
14:35twbrayUrgh, turns out my attempt to be clever using NIO's mmap-like interface in the Wide Finder code was entirely self-defeating. The Java platform rocks... except when it doesn't.
14:35twbrayFileInputStream.read is like 5* faster.
14:35bitbckthaha
14:39gbtyou live and learn. or in my case, live, learn, forget then recur
14:51chousertwbray: I've had some success speeding up regex on large files via mmap. However it's a bit of a cheat because of character encoding.
14:52chouserhamza: did you look at using a vector of pairs instead of trying to find an order-preserving map?
14:59alexykhow do you create a java.util.Date out of a string?
15:00rhickey,(java.util.Date. " Wed Dec 02 14:59:31 EST 2009")
15:00clojurebot#<Date Wed Dec 02 11:59:31 PST 2009>
15:00hamzachouser: i wrote the order as meta data then when calculating hash iterate using that order if meta data is availible.
15:01chousermabes: ok.
15:01mabeschouser: ?
15:01chousermabes: uh. sorry, bad tab completion.
15:01chouserhamza: ok.
15:01chouser:-)
15:01alexykrhickey: thx!
15:01ordnungswidrigalexyk: you should use DateFormat to parse the Date
15:01mabeslol
15:02ordnungswidrigalexyk: java.text.DateFormat
15:02alexykok
15:03ordnungswidrigrhickey: the constructor java.lang.Date(String) is deprecated since 1.1 :-)
15:03ordnungswidrigrhickey: that was really oldschool.
15:03hiredmanordnungswidrig: SimpleDateFormat
15:03ordnungswidrighiredman: yes, or like that.
15:04hiredmanDateFormat is pretty ridiculous
15:04hiredmanhuh, someone opened a google code issue
15:04chouserheh
15:05chouseroh, I even noticed -- didn't realize I was reading from google code instead of assembla.
15:05hamzaguys, how would you turn this in to string?
15:05hamza,(interleave (repeat \%) (partition 2 "0221caf96a"))
15:05clojurebot(\% (\0 \2) \% (\2 \1) \% (\c \a) \% (\f \9) \% (\6 \a))
15:06hamza"%02%21%ca..."
15:08chouser,(apply str (map (fn [[a b]] (str "%" a b)) (partition 2 "0221caf96a")))
15:08clojurebot"%02%21%ca%f9%6a"
15:08hiredman,(->> "0221caf96a" (partition 2) (apply concat) (interleave (repeate \%)) (apply str))
15:08clojurebotjava.lang.Exception: Unable to resolve symbol: repeate in this context
15:08hiredman,(->> "0221caf96a" (partition 2) (apply concat) (interleave (repeat \%)) (apply str))
15:08clojurebot"%0%2%2%1%c%a%f%9%6%a"
15:09hiredmanuh
15:09chouseryou want apply concat after interleave
15:10chouser,(->> "0221caf96a" (partition 2) (interleave (repeat "%")) (apply concat) (apply str))
15:10hiredman,(->> "0221caf96a" (partition 2) (interleave (repeat \%)) flatten (apply str))
15:10clojurebot"%02%21%ca%f9%6a"
15:10clojurebot"%02%21%ca%f9%6a"
15:10rhickeyso, one problem I have with plan B before is, when people leave out 'this', and get an error, they'll have no idea what to put where
15:11rhickeythose explicit top-level thises kind of float around
15:12chouser4 top-level args is a lot, I guess. Rivals a fully-loaded defn
15:13rhickeyalso when you think about it, the proper place for this in deftype is (first) with the fields
15:13rhickeythose are the enclosing local bindings
15:14chouserhm
15:14chouser,(loop [[a b & r] "0221caf96a" c ""] (if a (recur r (str c \% a b)) c))
15:14clojurebot"%02%21%ca%f9%6a"
15:14rhickeyI'm not advocating that
15:16chouser(deftype Foo this [a b c]) can be optional without [], though that strands reify a bit
15:16rhickeybut it looks like 2 binding lists in a row
15:17alexykdo folks know why joda DateTime is preferable to java.util.Date, or is it?
15:17rhickeytop-level this makes a lot more sense in refiy than in deftype - in reify there is an object in play, deftype is a spec for a set of objects
15:17chouseralexyk: immutable values and apparently handles the subtle complexities of dates with less fail
15:18chouserrhickey: you want implicit this for deftype, don't you.
15:18rhickeyyeah
15:18rhickeyor explicit arg everywhere
15:19rhickey(reify this ...) is a lot like (fn this ...
15:19chousertop-level for reify is better than, for example, what proxy does now.
15:20chouserbecause of no closures, deftype will hardly ever be nested at all -- just in do forms from macros.
15:20rhickeyI'm really surprised we haven't seen more of the thisfn problem with proxy
15:21rhickeychouser: right
15:21chouserI guess you could 'let' proxy's this if you really needed to. Not sure I've *ever* put a proxy in a proxy though.
15:21rhickeybut I want people to be able to nest reify in macros without worry
15:21rhickeychouser: it would come from a proxy-emitting macro
15:21chouserah
15:22rhickeythat was the thisfn problem, thisfn was implcit this in fn, then macros would emit hidden nested fns, and thisfn meant something not apparent
15:23rhickey(refiy ... (foo [] (bar this)) ;bar emitting reify would redefine 'this'
15:24chouseraccording to the IRC logs, some of my earliest comments here were advocating more arc-like anaphoric macros
15:24rhickeyI'm committed to not following proxy here
15:24rhickeyanaphora == bad
15:25jasappwhy do you say it's bad?
15:26chousernames that show up without declaration and change their value at various scopes implictly can get very confusing very fast.
15:26Chousukealmost like mutable variables :o
15:27chouserand although implicit 'this' on unnested deftypes isn't clearly less bad...
15:28jasappchouser: I see
15:28chouser*is* clearly less bad
15:29michaeljaakahi, how to get sequence droping x first elements ?
15:29chouser(doc drop)
15:29clojurebot"([n coll]); Returns a lazy sequence of all but the first n items in coll."
15:29michaeljaakaok :)
15:31michaeljaaka(doc nthnext)
15:31clojurebot"([coll n]); Returns the nth next of coll, (seq coll) when n is 0."
15:32michaeljaakawhat is the difference between drop and nthnext ?
15:33Chousukedrop uses rest?
15:33chouserhuh. I guess that's it. drop is fully lazy -- doesn't do anything at all when you first call it.
15:34chousernthnext eagerly walks and returns nil if the result is empty
15:34rhickeyyou can pun with *next
15:43chouserhehe. Java 7 using #() as syntax for closures?
15:43rhickeyisn't that great? not final though
15:45pjb3So I have a question about hot-deploying code changes to a running clojure app
15:45pjb3let's say I have a multi-threaded clojure app running
15:45pjb3and I'm able to connect to it via some sort of remote repl
15:45the-kenny(slime :p)
15:45pjb3would it be thread safe to re def a function in that repl?
15:46the-kennypjb3: I think so. I didn't have any problems
15:46pjb3yeah, I'm assuming you could
15:47pjb3I guess the only weirdness you could have is that while another thread is in process, it could execute the old function once and then the new function, right?
15:48alexyksomnium: ping
15:48pjb3So I guess the question I'm asking is what happens when you re-define a root binding in threads that may be in process already using that binding?
15:48the-kennypjb3: Yeah, it will execute the old function until it's finished and call the new function next time. That's what I'm experiencing
15:49pjb3what's the scope of "finished" though?
15:49hiredmanthe lexical scope of the function
15:50hiredmanalthough, for example, recur will recur to the old function
15:50pjb3oh, so if you have a function that calls foo, sleeps for 10 seconds, then calls foo again
15:50hiredmanrecur being an intra function construct
15:50pjb3and you redefine foo during that 10 seconds
15:50pjb3the second call to foo will be the old one
15:50hiredmanno
15:51rhickeypjb3: currently every use of a defn var, i.e. each call, pulls from the var and will see the latest. In the new branch is code that will provide another flavor of 'direct' linking that would require reload in order to see new version
15:52defnthe number of nick hilights I receive in this channel is staggering
15:53chouserheh
15:53pjb3rhickey: ok, so in general, re-defining a function that could be being used by multiple threads should be safe though?
15:53pjb3for the purposes of real-time code updating
15:53hiredman(defn foo [] (prn 1)) (future (foo) (Thread/sleep 10000) (foo)) (Thread/sleep 1000) (defn foo [] (prn 2))
15:54rhickeysafe - they would never see a broken reference to a fn or a broken fn definition
15:54hiredmanthe only issue is if you wanted to update several functions at once
15:54hiredmandefrefn
15:54pjb3hiredman: sure, I could see where that would be a problem
15:55hiredmanfortunately sticking fns in refs is easy and painless
15:55chouserooh, a var-ref-fn
15:58rhickeyyou could have transactionally updatable sets of functions, but you could only call them in transactions if you wanted to only see consistent sets
15:59hiredmanoh
15:59hiredmanright
15:59hiredmanhmmm
16:00akuakuhi everyone
16:00akuakuI've been playing around with Clojure for some months
16:01akuakuis there some Document/Page with some info on currently planned features
16:01akuakulike this "new" branch?
16:01Chousukeakuaku: on assembla
16:01hiredman~assembla
16:01clojurebotassembla is http://www.assembla.com/spaces/clojure
16:01the-kennyakuaku: There's assembla
16:02the-kennyakuaku: and the irc-logs from this channel :)
16:02akuakuah, nice
16:03alexykrhickey: thanks for the gist http://gist.github.com/247172, very clear demo of styles
16:03akuakuthe IRC seems to be the design documents ,-)
16:04rhickeyalexyk: yw
16:05hiredman~logs
16:05clojurebotlogs is http://clojure-log.n01se.net/
16:07hamzadoesn't contains? work on vectors?
16:07hamza,(contains? ["V" "a"] "V")
16:07clojurebotfalse
16:08hamzawhy false?
16:09Chousuke~contains?
16:09clojurebotcontains? is for checking whether a collection has a value for a given key. If you want to find out whether a value exists in a Collection (in linear time!), use the java method .contains
16:09technomancyhamza: contains? checks for set membership
16:09technomancyset-like
16:09hiredmandid you read the docstring for contains?
16:09hiredman,(doc contains?)
16:09clojurebot"([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constant or logarithmic time; it will not perform a linear search for a value. See also 'some'."
16:09ChousukeSeriously, this is probably the #1 FAQ :D
16:10hiredmannah
16:10hiredmanreally?
16:10technomancyfeels like it recently
16:10technomancypossibly even beating out "map is LAZY."
16:18alexykif I write ocaml-style, let ... in let ... in, it looks like: (let [...] (let [...] ... )) -- I have to keep track of all closing parens. Is there a way not to pile them in the back?
16:19hiredmanalexyk: clojure's let is sequential anyway
16:19djorkhmm, you know scriptjure is giving me ideas
16:19djorklike writing ObjC from Clojure
16:19alexykah, should I just have one let?
16:19hiredmanso there is really no point to nesting let like that
16:20hiredmanalexyk: yes
16:20akuaku,(let [x 5, x (+ 5 x)] x)
16:20clojurebot10
16:20alexyk(let [x blah y f(x) z g(y]) right
16:20alexykniceee
16:22chouserbut not actually f(x) :-)
16:23akuakuall this new stuff from "new" won't be in 1.1, am i right?
16:23akuakukinda scary seeing a language changing so fast ;-)
16:24alexyk(f x), granted :)
16:24chouserakuaku: not in 1.1: correct. scary: of course not!
16:26akuakuwell i am hesitating to try "new", are there some backwards incompatible changes?
16:27chouserakuaku: I can't think of any. But if you've been on 1.0, master has several nice enhancements you can enojoy without the volatility of the features in 'new'
16:32chouserI think the only things that had to change in contrib have been naming conflicts, resolved with less promiscuous :use clauses.
16:32akuakuc.c.test-is is gone ???
16:33chouserakuaku: it's clojure.test now
16:33akuakuchouser: it's official now, awesome
16:33chouserthere are some breaking changes there
16:34chouser'are' has a new syntax
16:35akuakui've used it only twice
16:36akuakuit runs! (with 'are' commented out)
16:36ohpauleezdjork: re: writing ObjC from in Clojure: It's easier when you have a Clojure in Clojure
16:36djorkhmm, what do you mean?
16:36ohpauleezlook at PyPy: Because you have a nice framework for accessing all the steps in reading and evaling
16:36alexyksay I have a huge map like, {:a 1 :b 2} and want a fast but lazy way to feed it to a database as submaps, {:a 1} {:b 2}, how can I split it nicely?
16:36ohpauleezand you can use Clojure to change it
16:36djorkhmm
16:36ohpauleezyou can do what PyPy does
16:37ohpauleezAny language frontend to any language backend
16:37ohpauleezor platform-backend
16:37djorkeither way, anything that saves me from writing heaps more ObjC
16:37akuakuchouser: you're in the core team, or just using bleeding-edge?
16:37hiredmanalexyk: seq on a Map will return a sequence of map entries
16:38chouserI think the core team is rhickey. :-)
16:38hiredman,(seq {:a 1 :b 2})
16:38clojurebot([:a 1] [:b 2])
16:38alexykhiredman: yeah, but they're vectors and I need maps.
16:38hiredmanalexyk: uh
16:38alexykand I want the conversion to be fast
16:38hiredman,(map (partial apply hash-map) {:a 1 :b 2})
16:38clojurebot({:a 1} {:b 2})
16:38hiredman,(map (partial apply array-map) {:a 1 :b 2})
16:38clojurebot({:a 1} {:b 2})
16:39hiredmanetc
16:40chouser,(use '[clojure.contrib.seq-utils :only (partition-all)])
16:40clojurebotnil
16:40chouser,(map #(into {} %) (partition-all 3 {1 2 3 4 5 6 7 8 9 10}))
16:40clojurebot({1 2, 3 4, 5 6} {7 8, 9 10})
16:40ohpauleezI would use into like chouser, but I like hiredman's approach.
16:41hiredmanit depends what you mean by sub map
16:41alexykchouser: is your thing faster? :) hiredman: submap is exactly a key-value pair converted to a single-key map
16:41hiredmaneach entry it to its own map, or partition the map
16:41ohpauleezis there a good reason for partitioning it alexyk?
16:42chouserI have no idea which is faster.
16:42alexykohpauleez: feeding to congomongo for storage
16:42chouserI just assumed you want more than one key/val per map.
16:43alexykhiredman: we're really getting a vector back, correct?
16:43chouser,(class (first {:a 1}))
16:43clojurebotclojure.lang.MapEntry
16:43ohpauleezI would just make the call treat each key and value separate
16:44hiredman,(ancestors clojure.lang.MapEntry)
16:44clojurebot#{java.util.concurrent.Callable clojure.lang.ILookup java.lang.Object java.util.RandomAccess clojure.lang.IMeta clojure.lang.APersistentVector java.lang.Runnable clojure.lang.Associative clojure.lang.Sequential java.util.Collection java.util.List clojure.lang.Obj clojure.lang.Indexed clojure.lang.IMapEntry java.io.Serializable clojure.lang.Streamable clojure.lang.AMapEntry java.lang.Iterable clojure.lang.IPersistentStack
16:44chouserheh
16:44hiredmanso you are getting a lot of things
16:45alexykI meant clojurebot prints the result of hiredman's (map ... (seq <map>) as (...), but it's a [...] in fact
16:45alexykor is it
16:45chouser,(sort (map #(symbol (.getSimpleName %)) (ancestors clojure.lang.MapEntry)))
16:45clojurebotjava.lang.RuntimeException: java.lang.IllegalArgumentException: No matching field found: getSimpleName for class clojure.lang.Keyword
16:46hiredmanlousy generics
16:46chouser,(sort (map #(symbol (.getSimpleName %)) (supers clojure.lang.MapEntry)))
16:46clojurebot(AFn AMapEntry APersistentVector Associative Callable Collection Comparable Counted Entry IFn ILookup IMapEntry IMeta IObj IPersistentCollection IPersistentStack IPersistentVector Indexed Iterable List Obj Object RandomAccess Reversible Runnable Seqable Sequential Serializable Streamable)
16:46chouserIt's an Obj *and* and Object. Also, an IObj.
16:47hiredmanalexyk: the print output looks like a vector because clojure.lang.MapEntry is a Vector
16:47hiredmanbut it is also all those other things
16:47hiredmanthe print representation just comes from Vector
16:49alexykare these all Java classes in ancestors? I thought Clojure is not OO :)
16:50enolots are interfaces
16:51rhickeywon't it be great when they are all protocols?
16:51hamza~line-seq
16:51clojurebotI don't understand.
16:51hiredmanjust dreamy
16:52chouser,(map count ((juxt filter remove) #(.isInterface %) (supers clojure.lang.MapEntry)))
16:52enorhickey: where can I find docs/notes on protocol?
16:52clojurebot(24 5)
16:52hamzawhat was the command to get the url to func definition?
16:52rhickeyhttps://www.assembla.com/wiki/show/clojure/Protocols
16:52enothx
16:52rhickeyhttps://www.assembla.com/wiki/show/clojure/Datatypes
16:53hiredman~def +
16:53hiredman~source add
16:54ska2342hi, would a link to a new article on Clojure in the German Linux Magazin (available online) be worth a post to the group? (and a shameless self-plug it would be :-)
16:54hamza~def line-seq
16:54hamzahiredman: thanks..
16:55hiredmanthat was new
16:55schaf5Hi, I want to use slime and swank-clojure from elpa, but when starting I get an error: http://gist.github.com/247640
16:56schaf5sorry, closed the client..
16:57schaf5did someone look at the swank/slime/clojure problem I posted?
16:58schaf5I am somewhat lost as to what causes that
16:58ska2342schaf5: yes, and I try to remember what I did when I saw that last, but I never used ELPA.
16:59ska2342what is your value of swank-clojure-binary in emacs, do you use it at all?
16:59ska2342alternatively what is swank-clojure-java-path?
17:02schaf5ska2342: I think that is the problem, I will look into customize and come back
17:03ska2342schaf5: better try my username at googles mail if you want to really reach me, I'm not much of a chatter
17:04schaf5ska2342: thanks :)
17:06alexykhow do you lazily chunk a seq?
17:06alexykinto chunks of size n
17:06chouser,(parition 3 (range 10))
17:06drewr,(partition 5 (range 20))
17:06alexykah, partition-all right?
17:06clojurebotjava.lang.Exception: Unable to resolve symbol: parition in this context
17:06clojurebot((0 1 2 3 4) (5 6 7 8 9) (10 11 12 13 14) (15 16 17 18 19))
17:06schaf5ska2342: I have not set swank-clojure-binary
17:06chouser:-(
17:07chouserheh. drewr wins
17:07alexykchouser: I saw you imported partition-all above
17:07drewrhe shoots he scores
17:07schaf5ska2342: I have set the swank-clojure-classpath to point somewhere where clojure.jar and clojure-contrib.jar reside
17:07drewralexyk: that allows your seq to not be evenly divisible
17:08ska2342schaf5: could you send or post your full emacs config concerning swank, slime and clojure-mode?
17:08alexykdrewr: partition-all vs partition?
17:08drewr,(partition 3 (range 10))
17:08clojurebot((0 1 2) (3 4 5) (6 7 8))
17:08drewralexyk: yes, see how partition chops off the 9
17:08alexykthat's bad
17:08drewr,(partition-all 3 (range 10))
17:08clojurebot((0 1 2) (3 4 5) (6 7 8) (9))
17:09alexykand that's good :)
17:10alexykwhy would anybody need the original partition...
17:10ska2342schaf5: what is swank-clojure-cmd in Emacs?
17:11chouseralexyk: I think the argument is that partition-all requires the consumer of the seq to handle differently-sized sub-seqs, which can be cumbersome.
17:13chouser,(map (partial apply rem) (partition-all 2 (range 11)))
17:13clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$rem
17:13chouser,(map (partial apply rem) (partition 2 (range 11)))
17:13clojurebot(0 2 4 6 8)
17:14ska2342schaf5: AFAI understand, the auto-install adds clojure to slime-lisp-implementations using swank-clojure-cmd. For me (non ELPA) that slime variable contains the shell script I use to start Clojure, from shell as well as emacs
17:16ska2342would someone be interested in a link to a new (German) article which was published today in Linux Magazin (and which I wrote, so I don't want to shamelessly post to the group)?
17:16schaf5http://gist.github.com/247657
17:16schaf5here is my config atm
17:17schaf5ska2342: I did not auto-install because I wanted the 1.1 snapshot
17:17chouserska2342: perfectly fine here. probably ok on the google group too. Though if you post to reddit I think it gets picked up by the clojure pipe.
17:18ska2342schaf5: huh? I thought we're talking about an ELPA install here? I will happily sent you my setup via mail if you contact me
17:18ska2342OK, here goes... criticism welcome http://www.linux-magazin.de/Heft-Abo/Ausgaben/2010/01/Nebenlaeufig
17:20chouserthe-kenny: the key is if you want the data in question to participate in equality tests or not. if not, must be metadata. if so, must not be.
17:21ska2342the-kenny: think of it as kind of orthogonal to the original/payload data.
17:21chouserheh. google translate decided to fix up the word order of the clojure examples.
17:21chouserprintln user => ( "Hello World")
17:21akuakuska2342: nice article
17:21the-kennyska2342: I'll read this, looks cool :)
17:22schaf5ska2342: I send you a mail
17:22the-kennychouser, ska2342: hm... tank you, I'll think about that
17:22chouserthe-kenny: I know that's hardly a concrete example. I have a friend who bugs me for better examples of metadata fairly regularly
17:23ska2342schaf5: (or "send" "sent")
17:23chouserthe-kenny: twiw, metadata is relatively rarely used in the bulk of the code I've written.
17:23chouserfwiw
17:24ska2342the-kenny: Perls and Rubys "tainted" feature is often mentioned
17:24the-kennychouser: Yes, same for my code
17:24schaf5ska2342: true
17:24alexykok I partition into chunks, and need to insert each into a db. E.g., I try:
17:24alexyk (doseq #(mass-insert! :mis %) (partition-all 18 (map (partial apply hash-map) (for [x (range 10) y (range 10)] [x y]))))
17:24alexykget: java.lang.IllegalArgumentException: doseq requires a vector for its binding (NO_SOURCE_FILE:0)
17:25alexykshould I convert each chunk into a vector or use something other than doseq?
17:26akuakui've kinda saw metadata as generalized annotations
17:26akuakumostly used by the compiler
17:26alexykah I probably swapped the order
17:26ohpauleezakuaku: metadata is more than that
17:27ohpauleezit allows you to do programatic bookkeeping
17:27ohpauleezand a host of other things
17:27alexykbut it still wants a vector...
17:27akuakuwell generalized annotations ;-)
17:27ska2342schaf5: please try again
17:28schaf5ska2342: is at googlemail.com right?
17:28alexykok got it: (doseq [x (partition-all 18 (map (partial apply hash-map) (for [x (range 10) y (range 10)] [x y])))] (println (count x))); are there other ways to do it?
17:28ska2342schaf5: true
17:29schaf5ska2342: I sent it there and got no error return mail
17:32alexykis there a way to kill the current computation in repl without killing the whole repl?
17:33ohpauleeznot that I know of
17:33ohpauleezif you use Jline or something like it, you'll have a history of your REPL though
17:34ohpauleezalexyk: did you do repeat or repeatedly? :)
17:34alexykohpauleez: no... I data-mine Twitter :)
17:34ohpauleezahhh
17:34alexykand if I invoke a thing which turns out too slow, it keeps chewing on it
17:34alexykcan you serialize a hash-map?
17:35hiredman,(prn (into (hash-map) {:a 1 :b 2}))
17:35clojurebot{:a 1, :b 2}
17:37djork,(seq? [])
17:37clojurebotfalse
17:37djorkintriguing
17:37akuaku,(seq? [1])
17:37clojurebotfalse
17:37hiredmanvectors are not sequences
17:38djorkno, but lists are?
17:38djork,(seq? '())
17:38clojurebottrue
17:38akuaku,(sequential? [])
17:38clojurebottrue
17:38alexykI mean serialize into a byte stream
17:38djorkI see
17:39hiredman,(.getBytes (prn-str (into (hash-map) {:a 1 :b 2})))
17:39clojurebot#<byte[] [B@e046e>
17:40akuaku,(ancestors (class (hash-map)))
17:40clojurebot#{java.util.concurrent.Callable clojure.lang.IEditableCollection clojure.lang.ILookup java.lang.Object clojure.lang.IMeta java.lang.Runnable clojure.lang.Associative clojure.lang.Obj java.io.Serializable java.lang.Iterable clojure.lang.Counted clojure.lang.IFn :clojure.contrib.generic/any java.util.Map clojure.lang.APersistentMap clojure.lang.Seqable clojure.lang.IObj clojure.lang.IPersistentCollection clojure.lang.AFn cl
17:40alexykhiredman: so prn serializes into a string... I guess sexps have their use :)
17:40chouseralexyk: clojure-contrib repl-utils add-break-thread!
17:41akuakualexyk: you can use the java way too
17:41alexykchouser: I guess it's a function :)
17:42akuakuit implements Serializable
17:42alexykhiredman: you don't really need the (into (hash-map) ...) there do you?
17:42akuakusmall map literals arent hash-maps
17:43akuaku,(class {1 2})
17:43clojurebotclojure.lang.PersistentArrayMap
17:43alexykhiredman: andd it's the same as (into {} ...) is it?
17:43alexykah no
17:44alexyk,(class (into (hash-map) {:a 1 :b 2}))
17:44clojurebotclojure.lang.PersistentArrayMap
17:44alexyk,(class (into {} {:a 1 :b 2}))
17:44clojurebotclojure.lang.PersistentArrayMap
17:44alexykso?
17:45akuakualexyk: does it matter in your app?
17:45alexykakuaku: I have a huge map, just want to understand why hiredman used (into (hash-map) ...) on a literal
17:46alexykmy map is generated from data though
17:46akuakualexyk: ArrayMaps get convertet into HashMaps when they get bigger then 8 pairs
17:47alexykah ok
17:47alexykbut above (into (hash-map) ...) is doing nothing
17:47alexykapparently
17:47akuaku,(class (hash-map))
17:47clojurebotclojure.lang.PersistentArrayMap
17:48hiredmanalexyk: you specified hash-map
17:48akuaku(clojure.lang.PersistentHashMap.)
17:48hiredmanso I was specificly making a hash-map
17:48akuaku,(clojure.lang.PersistentHashMap.)
17:48clojurebotjava.lang.IllegalArgumentException: No matching ctor found for class clojure.lang.PersistentHashMap
17:49akuaku,(clojure.lang.PersistentHashMap/create nil)
17:49clojurebotjava.lang.IllegalArgumentException: More than one matching method found: create
17:50akuaku,(class clojure.lang.PersistentHashMap/EMPTY)
17:50clojurebotclojure.lang.PersistentHashMap
17:50chouserthe behavior of array-maps and hash-maps changed a while ago. literals used to follow different rules
17:52akuakuso now the (size <= 8) -> ArrayMap rule is consistent?
17:52akuakui think i remember that (hash-map) created real hashmaps
17:58chouser,(class (apply array-map (range 16)))
17:58clojurebotclojure.lang.PersistentArrayMap
17:58chouser,(class (apply array-map (range 100)))
17:58clojurebotclojure.lang.PersistentArrayMap
17:58chouser,(class (assoc (apply array-map (range 16)) :x :y))
17:58clojurebotclojure.lang.PersistentArrayMap
17:59chouser,(class (assoc (apply array-map (range 32)) :x :y))
17:59clojurebotclojure.lang.PersistentHashMap
17:59_ato,(class (assoc (apply array-map (range 31)) :x :y))
17:59clojurebotjava.lang.ArrayIndexOutOfBoundsException: 31
17:59_ato,(class (assoc (apply array-map (range 30)) :x :y))
17:59clojurebotclojure.lang.PersistentHashMap
17:59_ato,(class (assoc (apply array-map (range 18)) :x :y))
17:59clojurebotclojure.lang.PersistentHashMap
17:59chouserarray-map and hash-map always return their appropriate type. don't rely on the concrete return value of assoc or dissoc, ever.
18:15djorkobjclj is underway
18:18tcrayfordis that clojure on obj-c?
18:20mtmdjork: are you going to host that on github?
18:20djorkyeah
18:20djorkno
18:20mtmsweet
18:21mtmoops
18:21djorkit's objc generation from clojure
18:22mtmis this to target iPhone specificaly or OS X in general? or does that even matter?
18:23djorkiPhone for now
18:23djorkbut not specifically
18:23djorkjust want to gen classes and headers and all that jazz
18:23djorkmacros for templating
18:23mtmvery nice
18:23djorkto cut down on the MOUNTAIN of code required for ObjC apps
18:23the-kennys/like/likes/
18:24hiredmanhttp://gist.github.com/222974
18:25djorknice
18:25djorkmight borrow a bit from that
18:30alexykI get: java.lang.OutOfMemoryError: PermGen space -- when doing mass-insert! from congomongo. What does it mean?
18:33Chousukethat sounds like a rather nasty error :P
18:33mtmPermGen issues are usually related to classes not getting GCed
18:37headiusI heart permgen errors
18:38mtmalexyk: was the jvm is question up for a while? do you get these problems with a freshly started jvm?
18:39alexykfor a while... never saw this in Scala, must be a Java proxy thing?
18:39alexykyou dynamic people :)
18:40alexykI'm stuffing mongo db via congomongo, which uses mongo-java-driver
18:40alexykI was doing a mass-insert; need to understand why would that generate a bunch of classes, -- it should "just" stick json into the DB; but perhaps mongo java generates json classes
18:40headiusthat's weird
18:41headiuswhat's congomongo?
18:41mtmsorry, I'm clueless regarding mongo
18:41alexykcongomongo is clojure wrapper for mongo db by somnium
18:41headiusI'd be surprised if an existing library caused this...it's most likely something in clojure or a clojure-based library
18:41headiusmmm yeah
18:41jasappalexyk: pretty anxious?
18:42mtma brief explanation of PermGen issues: http://my.opera.com/karmazilla/blog/2007/03/13/good-riddance-permgen-outofmemoryerror
18:42alexykjasapp: not really, just annoyed at how hard it is to handle a billion tweets in any way. BDB is rock-solid but stolid, mongo is new and fast but things are tricky
18:42mtmprobably doesn't help you much though
18:43jasappdo you have one of those direct tweet hoses?
18:43alexykyeah
18:43alexykone of 'em gardenhoses
18:43jasappwhat are you working on, if you don't mind me asking?
18:44alexykdata mining research in academia
18:44alexykI've processed it in Scala and now try Clojure
18:44alexykBDB and now Mongo
18:44jasappwhat's giving you trouble in mongo?
18:44headiusundeploys are a problem on all servers...doesn't seem like that's what's causing this
18:45alexykalthough BDB allows for concurrency and I'd like to try unleashing a bunch of readers in clojure on it
18:46alexykI only saw this when trying mass-insert! from congomongo
18:47jasapphow many tweets is breaking it?
18:47headiussounds like a congomongo bug, perhaps caused by some aspect of clojure (like a loop re-spinning a new class or something)
18:47headiusanyway...ttfn
18:47headiusgood luck :)
18:49hiredmanthe only variable is the mongo db insert?
18:50alexykhiredman: yep
18:50alexykbreaks after about 20 chunks of 10000 each, mass-insert! 'ed
18:51hiredmanI'd drop a line to the clojure mongo db devs
18:54jasappalexyk: can you post a contrived example?
18:54alexykjasapp: without much data it'd be useless
18:55hiredmanmaybe run some kind of profiler
18:57hiredmanhttp://wiki.caucho.com/Java.lang.OutOfMemoryError:_PermGen_space
19:29jimdueyHi all, first time on #clojure
19:30carkwelcome =)
19:34hamzacan someone tell me what is wrong with this?
19:34hamza,(into-array Byte/TYPE [1 2 3 4 5 6 7 8])
19:34clojurebotjava.lang.IllegalArgumentException: argument type mismatch
19:37cark,(into-array Byte/TYPE (map byte [1 2 3 4 5 6 7 8]))
19:37clojurebot#<byte[] [B@cb1594>
19:37hamzacool thanks..
19:37carkthese are Integer
19:42chouser(byte-array (map byte [1 2 3 4 5 6 7 8]))
19:43hamzaif i have a 4 byte array containing a ip is it safe to cast each cell to int and concat them to build a ip? instead of using inetaddress class..
19:45chouser"safe"?
19:45Chousukeit's probably not safe, but it will probably work if you do it right :P
19:45hamzahehe, i am doing it like so (interleave (map int buff) (repeat "."))
19:46ChousukeI guess that would work. though are you sure the octets are in the correct order? :P
19:48hamzadidn't thought of that buffer is in big endian, i should go back and read endianness :)
19:48cark,(apply str (interpose \, (map int (into-array Byte/TYPE (map byte [200 201 202 203])))))
19:48clojurebot"-56,-55,-54,-53"
19:49carkbytes are signed on the jvm
19:49Chousukeoh, right. :P
19:49carki can't imagine why they did it like that but they sure did
19:51carki don't have byte-array in my 1.0 clojure =/
19:51hiredman(into-array Byte/TYPE ...)
20:04technomancywould a defmethod to make print-dup understand java.util.Dates be appropriate for core, or would that just open the floodgates to add Any Old Deprecated Class in?
20:04rhickeytechnomancy: at some point I gess Clojure should take a stand on Joda time
20:06technomancyisn't there a motion to add a joda-like library to the JDK though?
20:07rhickeytechnomancy: probably
20:11technomancywould probably be easy to write a compatibility layer between the JDK version and joda though
20:11rhickeytechnomancy: do you have a pointer to the proposal?
20:11technomancyI feel like now that dependency handling is less painful I'm much less reluctant to pull in joda... I resisted when I first heard of it, but things have changed.
20:11technomancylemme see
20:12defnOpenJDK is supposedly going to have closures??
20:12technomancyas of a year ago it was "unlikely to make it into JDK7": https://jsr-310.dev.java.net/servlets/ReadMsg?list=dev&amp;msgNo=1389
20:12technomancybut I don't know if that changed with the new timeline
20:13defnI read something today that sounded like OpenJDK7 would have closures
20:13technomancyI suppose this is a better link: https://jsr-310.dev.java.net/
20:15defntechnomancy: http://www.javaworld.com/community/?q=node/3719
20:15defnsee also: http://weblogs.java.net/blog/editor/archive/2009/11/19/devoxx-surprise-out-nowhere-closures-jdk-7
20:15carkbut the question is : will it change anything for clojure ?
20:16defnwhether it does or not I don't know, but what I do know is that some of the justification behind this decision is that it makes the JVM play nice with other languages
20:16defnif they're serious about making the JVM easier to put clojure on top of, that's good news
20:16defnerr easier to put other languages on top of*
20:17cp2to me it seems as if closures will just be inlined at compile time
20:17cp2but if they have "real" closures
20:17cp2thent hats awesome
20:17defncp2: that's how i understand it as well
20:17defnbut at least this is progress
20:17cp2mhm
20:29notallamaa closure is just a first class function with lexical scope, right? i'm never sure, because that seems too simple to bother giving it a special name.
20:42hiredmannotallama: a truck is just a big car
20:52technomancyhiredman: 4 of 7 clojure users in Seattle are named kevin
20:52technomancyaccording to the google map
20:52danlarkinconspiracy?
20:53technomancyclearly
20:53cark1 out of 1 clojure users are named Sacha in belgium, that's what i call a strong correlation
20:57hiredmantechnomancy: huh
20:57carkhum there is a tom also
20:58cp2theres a clojure map?
20:59chousercp2: (hash-map)
20:59chouserteehee
20:59cark=)
20:59cp2>:|
21:01hiredmanclojurebot: google map?
21:01clojurebotFirst, out of 105000000 results is:
21:01clojurebotGoogle Maps
21:01clojurebothttp://maps.google.com/
21:01hiredman:|
21:01hiredmanwhat is the url for the map?
21:01chouserclojurebot: clojure map?
21:01clojurebotclojure is the bestest programming language available.
21:02chouserclojurebot: google clojure map?
21:02clojurebotFirst, out of 12100 results is:
21:02clojurebotClojure - data_structures
21:02clojurebothttp://clojure.org/data_structures
21:02chousersee, I told you
21:02chouserclojurebot: google google clojure map?
21:02clojurebotFirst, out of 9630 results is:
21:02clojurebotProposal: Extend behavior of hash-map - Clojure | Google Groups
21:02clojurebothttp://groups.google.com/group/clojure/browse_thread/thread/b94b395074a4ac3d
21:03chousercp2: http://tinyurl.com/ye8nzvt -- google map of clojure users
21:03cp2cool stuff
21:04cp2haha for a second there i thought the greek writing for greece said 'emacs'
21:07alexykhiredman: ping
21:07hiredmantechnomancy: that, unfortunately, means we can never meet, because if we did, our quatum wave forms would collapse, and a scottish guy with a japanese sword will yell "THERE CAN BE ONLY ONE!"
21:08alexykhiredman: PermGen again, can partial do that? (doseq [x (partition-all 10000 (map (partial apply hash-map) (seq reps)))] (.print System/err ".") (mass-insert! :reps x))
21:09hiredmando what?
21:09hiredmanthe perm gen
21:09hiredmanhmmmmm
21:09hiredmansounds plausable
21:10hiredman(def x (partial apply hash-map)) and replace (partial apply hash-map) with x
21:10alexykhiredman: and def is outside doseq correct
21:11hiredmanyes
21:11hiredmansomewhere top level
21:11KirinDave_Ugh
21:11KirinDave_I love erlang but I wish I had macros right about now.
21:11alexykbtw clojure doesn't have a (defvar *global* ...) does it?
21:11KirinDave_alexyk: I forget, how is defvar different from def?
21:12alexykKirinDave_: that's what I'm implicitly asking :)
21:12hiredmandefvar from common lisp?
21:12KirinDave_Didn't it allow you to pass a default value?
21:12alexykyeah
21:12hiredmanmy understanding is defvar in common lisp is for dynamic vars, correct?
21:12KirinDave_Like, instead of setting, defvar defined a variable and if it wasn't already set, set it? iirc.
21:13KirinDave_hiredman: Trying to apply deductive logic to common lisp is a dangerously arrogant thing to try. ;)
21:13alexykwell I read 1/3 practical common lisp a while ago and that's about my lisp exposure
21:13hiredmanbecause all clojure vars can be dynamically rebound
21:13hiredmanKirinDave_: :P
21:14hiredmanclojurebot: what does the hyperspec tell us?
21:14clojurebotwhat is wrong with you
21:14hiredmanclojurebot: if I were to consult the hyperspec, would I discover?
21:14clojurebothyperspec is not applicable
21:14cp2clojurebot: make yourself useful and fetch me a sandwich
21:14clojurebota is b
21:14cp2:|
21:15alexykclojurebot: remember scalabot?
21:15clojurebotIt's greek to me.
21:15alexykclojurebot: do you love lambdabot?
21:15clojurebotYou will not become skynet
21:16arbscht_defonce is similar to defvar
21:16arbscht_def is more like defparameter
21:21erikcwHas lazy-cons been removed from the core?
21:21alexykhiredman: so I do: (def hashify (partial apply hash-map)), then (map hashify mydata). Should I use defn in hashify or def is fine?
21:24alexykdef works, still I wonder why not defn.
21:24chousererikcw: yes, lazy-cons has been superceded by lazy-seq
21:25hiredmanalexyk: defn creates a fn
21:25hiredmanpartial creates a fn
21:25hiredmanyou don't want a fn in a fn
21:25hiredmanyou just want a fn
21:25erikcwchouser: I'm porting an example. is the api the same?
21:26chousererikcw: no. full description here: http://clojure.org/lazy
21:26alexykah! so fn eats a class as on JVM we can't have fn outside of a class, right
21:26hiredmanyes
21:26hiredmanthe problem is partial generates a new fn each time it is called
21:26hiredman(fn [x] (apply hash-map x)) inline in the map should fix it too
21:27hiredman:(
21:27alexykand it looked so lovely
21:27hiredman(this is the problem)
21:27hiredmanpoor first class functions
21:28alexykso... if it's in the map, with (fn ...), this anonymous fn will not eat a class? or it will be GC'ed?
21:29hiredmanit will generate a single class
21:29hiredmanhmmmm
21:29hiredmanhave you tested with the new version yet?
21:30hiredmanI am not 100% sure that partial like that would be the problem
21:31chousercalling partial doesn't generate a new class
21:32chouseris that the question?
21:32devlinsfchouser: I thought partial did. Does comp generate a new class?
21:32chouserno
21:33hiredman:D
21:33chousermacros can cause classes to be generated at compile or eval time
21:33devlinsfHmm... help me out here. I thought each new closure generated a new class
21:33chousereval can cause classes to be generated
21:33devlinsfIs this wrong?
21:34chousercompiling partial generates 5 classes. calling partial generates an instance of one of them
21:34devlinsfAh
21:36devlinsfchouser: Why 5? partial only has 4 (documented) arities. Oh is this also in the wrong direction?
21:36devlinsf*or
21:36chousernope, right direction. partial itself is a fn, so compiles to a class
21:36alexykhiredman: each cycle takes about an hour, we'll see in about half hour. But I also increased PermSize to 1g just in case.
21:36alexykif it works, I'll play with isolating partial
21:37alexykchouser: I do everything in repl now, no compiling
21:37TheBusbyAnyone else start using the "emacs starter kit" to get emacs/clojure/slime working? Curious if anyone knew how to disable the 70 character line wrap that's set by default....
21:37chouseralexyk: I'm not just talking about AOT compiling.
21:37hiredmanalexyk: clojure always compiles
21:37alexykok
21:37alexykciti never sleeps, clojure always compiles :)
21:37chouserEach top-level form you enter in the repl gets compiled, so classes are generated at that moment.
21:38alexykchouser: where do they live? in ram?
21:38chouseralexyk: yes
21:38alexykchouser: so if partial leads to classes being generated, does it eat into PermGen space?
21:39chouser*compiling* partial generates classes, but you probably did that with ant ...or downloaded a jar and didn't do it at all.
21:39hiredmanchouser: but a call to partial creates a new fn
21:39chouserunless you're using eval, all compilation is completed before your code starts getting run.
21:40chouserhiredman: yes, a new instance of an existing class. regular heap, not permgen
21:40_atoTheBusby: try M-x auto-fill-mode
21:41_atoor M-x set-fill-column
21:41hiredmanmmmm
21:41cemerickchouser: I'm entirely unsure, but it looks like builds marked as 'new' aren't getting into the snapshots maven repo.
21:42cemerick-> http://build.clojure.org/snapshots/org/clojure/clojure/maven-metadata.xml
21:42chousercemerick: I was under the impression dynsinger had to do something manual to get 'new' rolling.
21:42cemerickah-ha
21:43chouserbut which he couldn't do until the versions produced by the branches were different
21:43KirinDave_hiredman: May I recommend a more competent browser? :)
21:43cemerickstranger than that is the timestamp in that file is from today, the last build in http://build.clojure.org/snapshots/org/clojure/clojure/1.1.0-alpha-SNAPSHOT/ is from 11/26, but depending on 1.1.0-alpha-SNAPSHOT retrieves a build from today. :-/
21:44KirinDave_hiredman: Although, I gotta say that's a beast of a js job.
21:44TheBusbyato: perfect, thanks!
21:44hiredmanKirinDave_: nope
21:45KirinDave_hiredman: Good point there really aren't any.
21:45KirinDave_Just shades of suck
21:46chouser,(apply = (map #(class (partial + %)) (range 10)))
21:46clojurebottrue
21:47chouserevery time you call partial with 2 args, you get an instance of the same class.
21:47chouser,(class (partial 1 2))
21:47alexykchouser: I have no ant or jars here, only repl, define partial there... in a doseq. Is it still eval'd once?
21:47clojurebotclojure.core$partial__5267$fn__5269
21:47chouser,(class (partial 2 3))
21:47clojurebotclojure.core$partial__5267$fn__5269
21:48chouseralexyk: you have a clojure.jar with .class files in it?
21:48alexykchouser: I use a regular clojure.jar
21:49chouseralexyk: when clojure.jar was produced, 'partial' was compiled and it produced 5 .class files that are now sitting in that normal clojure.jar
21:49alexykah
21:54chouserthey're even named to include the word "partial". You can look inside the .jar and find them.
23:06technomancyTheBusby: even better: (remove-hook 'coding-hook 'local-comment-auto-fill)
23:19TheBusbytechnomancy: thank you! Any chance you know how to fix saveplace/save-place as well?
23:20technomancyTheBusby: not sure... I only now realized it wasn't working.
23:21technomancyTheBusby: try this: (setq-default save-place t)
23:21TheBusbyno luck
23:22TheBusbyI believe I'm using head for, git://github.com/technomancy/emacs-starter-kit.git
23:22technomancyhmm; setq-default works for me
23:45TheBusbytechnomancy: where do you have your saveplace.elc or saveplace.el.gz stored?
23:46technomancyTheBusby: /usr/local/share/emacs/23.1.50/lisp/
23:48TheBusbyyou wouldn't be chance know how to get a log, or debug report out of emacs to try and figure out what the problem is would you?
23:48technomancyTheBusby: not unless you're seeing an actual error.
23:48TheBusbyI tried reinstalling on a different clean ubuntu-server system and I'm still having the same problem
23:48technomancycould try the #emacs channel
23:49TheBusbyokay, thanks ;)
23:51TheBusbyer, no luck, evidently when I create a ~/.emacs file with only (require 'saveplace) and (setq-default save-place t) everything works fine
23:51TheBusbyit's only when the rest of the ESK is setup does the problem occur
23:52TheBusbyevidently there is a problem with how the ESK has save-place write the history to disk...
23:52technomancyTheBusby: you mean ~/.emacs.d/places ?
23:53technomancyyou could set the save-place-file var to something else I guess
23:53technomancybut there shouldn't be a problem with that value
23:53TheBusbyplaces isn't being used evidently
23:54TheBusbyit's using ~/.emacs-places
23:56TheBusbyevidently if I don't use the ESK, it read/writes place info from ~/.emacs-places
23:57TheBusbyif I use the ESK, the it'll read from ~/.emacs-places but write to ~/.emacs.d/places
23:57technomancyyou can remove the line in starter-kit-misc.el that sets that