3:49clojurebot: "([s] [s startparse]); Parses and loads the source s, which can be a File, InputStream or String naming a URI. Returns a tree of the xml/element struct-map, which has the keys :tag, :attrs, and :content. and accessor fns tag, attrs, and content. Other parsers can be supplied by passing startparse, a fn taking a source and a ContentHandler and returning a parser"

4:21clojurebot: "([f & maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping(s) from the latter (left-to-right) will be combined with the mapping in the result by calling (f val-in-result val-in-latter)."

7:06avital: Hi. Just installed clojure-mode using ELPA and I can't seem to use clojure-contrib. I am trying to eval (use 'clojure.contrib.json.read) and I get a FileNotFoundException. Anything from clojure core works. It was my understanding that clojure-mode should support clojure-contrib immediately. I searched google and couldn't find any record of such an issue. Anyone have an idea?

9:49cemerick: rhickey: so, my first question: was it intentional to make all non-primitive args into defclass ctors Object?

9:51rhickey: there isn't yet the plumbing under the hood to distinguish locals of non-primitive types, but eventually I'd like to enforce via explicit types for construction and storage

9:53cemerick: rhickey: FWIW, I'd be very happy with two ctors: one typed, and one untyped. The reason being, I'd like to be able to drop IDerefs into those ctors as desired, and I'd make the associated .field getters unpack those IDerefs as necessary. Perhaps stuff like that should go into a layer on top of defclass, but that's one aspect of our typical usage.

9:55rhickey: cemerick: I don't get that, you couldn't put the IDeref into a field of the type of the thing it held

14:22patrkris: A question I want to ask to ensure that I understand Clojure correctly: It doesn't make much sense to have a reference (be that a var, a ref or an agent) to an object from Java-world, since that object can mutate, and thus we cannot get a consistent "snapshot" of that object's state/value?

14:27chouser: patrkris: you're thinking about it correctly, but the answer may depend. For example if you can treat that java object as if it were immutable (copy on write, for example) it might be useful to keep in a reference object.

14:28 Or if the object is immutable despite coming from Java-world, like java.lang.String.

14:29chouser: but yes, if it's a big ol' regular Java application object with pile of getters and setters and no sane way to make copies ... Clojure can't do much to help you with the concurrency nightmare that will ensue.

14:29 maybe you can put it in an agent and promise not to use the mutators directly (even though nothing is actually stopping you) and *maybe* that'll be better than a lock.

14:48chouser: ordnungswidrig: the compiler could replace some self-calls with 'recur' automatically, but recur does not act the same as a self call (different stack impact) so it'd be up to the programmer to correctly understand the meaning the compiler would assign in each case.

14:54chouser: it's interesting (to me anyway) to trace the potential problems to any combination of closure and dynamic binding

14:55cemerick: rhickey: well, I don't really see :map there as anything like IThis or IThat. The latter just adds an interface, the former actually injects implementations. The two are totally separate beasts in my head.

14:55rhickey: cemerick: presuming deftype won't have IPM as default (it won't, because making your types map when they are not otherwise collections is a big deal that will eventually bite you once you have more protocols in play), something that *did* have it by default might qualify for another name. I'd love to replace defstruct with defstruct on deftype but it has a few capabilities that don't work well

14:56 one problem is that anything like that will need 2 version (type and class)

14:56cemerick: I think it's worth thinking about whether lazy-seq and friends should automatically capture the bindings of the current thread-local. I'm sure that's something that's been mulled over; I'm not sure I have an opinion at the moment.

14:57chouser: lazy-seqs and high-order functions all use closures, and we think of closures in terms of their lexical scope, but once they're getting passed around their dynamic scope can be who-knows-what (other thread, outside the (binding ...), on a different terracotta server, etc.)

14:59technomancy: I've started seeing errors like "java.lang.NoSuchMethodError: clojure.lang.RestFn: method <init>()V not found"; I may have screwed my build up (using git master). any idea what kind of problem would cause an exception like that?

14:59Chousuke: cemerick: if the var access were inside lazy-seq, something could be done, but...

15:01Raynes: technomancy: Not sure. The swank-clojure that was installed by clojure-install about a week ago.

15:01cemerick: rhickey: I think my only point is that, if there were such a generalization, then people could compose whatever set of impls and therefore semantics on top of deftype without having all these siloed def-* sitting around.

15:03Chousuke: cemerick: though I think there is a ticket on assembla about providing a function wrapper that captures the dynamic environment and re-establishes it when the function gets called

15:03rhickey: cemerick: so overall, I don't think injection should be emphasized

15:04cemerick: rhickey: Yeah, I know. I presume we wade straight into the maw of trait-like issues. My talk about having a generalized mechanism is pretty much hand-waving, hoping you'll pull another rabbit out of your hat.

15:15ordnungswidrig: hiredman: what is then the "official" source for a decent flip? Your functional.clj?

15:15hiredman: ordnungswidrig: I dunno that there is one, if you need one you might ask rhickey about adding one to core, when I asked he said he had never needed one, and I realized I never used it outside of golfing

15:17 hiredman: I have a function that takes to args and I want to partial it but I need to fix the second arg so (partial (flip f) a) would be a perfect fit. I realize that (fn [b] (f a b)) would work also.

15:37twbray: Have a program that sends off a bunch of I/O intensive functions with send-off, they grind away and something reports a NPE with the helpful label (NO_SOURCE_FILE:0). What are some digging tools to find out what's blowing up?

16:10 as an easter-egg in the graphical version of a repl, lazy-cat should be replaced with a tiny version of that image

16:15annealer: if somebody would help me, that would be fabulous. im trying to programatically call a macro. the name is in a string, like "GET". i would like to somehow call that macro. i cant figure it out. eval complains it cant find it in the current namespace

16:34clojurebot: "([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return true if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"

18:20 I'm trying to do a cumulative sum of a sequence, with the twist that I want each the summed sequence to add up to a threshold, and then roll to the next element. IE, if my threshold is 10, I want the elements of the returned sequence to be the cumulative sum since the last element, until that reaches 10, then I want a new element.

19:12bradford: when i eval exprs in a remore repl using contrib.server-socket, the text going to the output stream for the remore process can be valid exprs, or string repreentations fo java objects or exceptions. the latter can not be read with (read %). what is the best strategy for reading input from the strem from the remote repl?

19:12esj: sadly everything I say is badly distorted by misunderstanding. What I mean is, my solution was to reduce the first sequence, and do the binding to the last element of the growing 'reduced' sequence with the (conj (drop-last seq) new), which was said to be bad ? Why so ?

19:14Chousuke: drop-last of a sequence needs to walk the entire sequence.

19:23Chousuke: but if you have a (drop-last 20000 some-source) where some-source has 40k items, and then only process the first 10000, it's going to realise only the first 30000

19:24 though in that case just processing (take 10000 some-source) would be more efficient.

19:24 but I guess sometimes you might not know how much you need to process, but still want to make sure some stuff at the end is excluded...

19:26_ato: esj: I think with the way you're using it, it should be fine. The main difference between your way and mine (if I'm understanding yours correctly) is mine is lazy and yours is eager. Either might be better depending on what you want to do with the result