0:55cap11235: I'm trying to extend JPanel using gen-class, and I can't find a way to implement a constructor so I can add a KeyListener to it. From what I can tell, :init is only for setting up the :state reference for the class, and calling super's contructors. I tried having it have "this" as a parameter, but I get get an IllegalArgumentException. How can I add my KeyListener?

1:55Drakeson: how about a cache (as in apt-cache update), for instance in order to know which repository to find [the latest of] each artifact from

1:56technomancy: Drakeson: it's a possibility; I haven't really thought it all the way through

1:56 web-based search works well enough that it's not the highest priority for the next release for me

1:58Drakeson: well, that is not just for search, it is to speedup the process of finding the repository that has the latest version of an artifact. If I am not mistaken, it currently hits all the repositories everytime lein deps is issued.

9:27tufflax: It's great that I can do (rest [1 2 3]) on vectors like that, but how can I use that as a vector again? The class of it is clojure.lang.PersistentVector$ChunkedSeq, so underneath somehow it is still a vector, so I should be able to "cast" it back or something, yes?

9:49patrkris: tufflax: the answer may depend on what you're trying to do here

9:49 usually, if you're just looping through a vector to do something to each item, then it doesn't matter that you're not getting a vector back

9:50 but for cases where you need to get a subvector the aptly named subvec function may help you

10:50 pressing \ and *any* other key doesn't do anything. it's as if i hadn't pressed the key at all :p

10:52patrkris: SynrG: I had the same symptoms. It seems that vimclojure does not map keys for starting the REPL and performing evaluation unless it detects that the nailgun server is started. Even though you may have set the localleader to something, I don't think it comes into effect unless some key combination uses it.

10:53patrkris: SynrG: but of course, it could also be a Vim issue. Did you get syntax highlighting working? Just to get an indication whether you installed vimclojure's vim scripts correctly into ~/.vim

13:52_brian2_: noob question> regarding reading in a serialized java object, in java you use type casting to the object to identify it, how does that work in clojure -> http://clojure.pastebin.com/ZUmyyxYx

14:29rhudson: When the object gets serialized, the serialization includes the name (or some indicator) of the class of the object. When you read it back it, you're reconstituting the same class of object.

14:30 In Java, a statically typed language, you have to say what the types of your variables are.

14:30 So when you cast to LMClassifier, you're saying "through this variable I will only perform LMClassifier calls".

14:35rhudson: You shouldn't need to cast it in Clojure. There's only one "compile" method in AbstractExternalizable, which takes a Compilable, so the implementation should be looking at the object, seeing whether it implements Compilable, and making the call if so.

16:11vIkSiT: hmm, I'm trying to write some code that takes in a sentence like - This 'is' a test _sentence_ (quoted word and underscored word), and then performs an operation on it.

16:12 now imperatively, I'd have an array/string, run through each word in that sentence in a loop, do an "if quoted() or if underscored()" on the word, and then perform the relevant operation, and append the changes into the string

16:29clojurebot: "([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."

16:34clojurebot: "([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."

16:34clojurebot: "([x] [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."

17:30 so, I still can't figure out why swank/slime only works right after I install it in emacs with elpa, but fails with "Lisp connection closed unexpectedly: connection broken by remote peer" on subsequent emacs restarts.

17:49 actually, sometimes it works (connects to addr=0.0.0.0/0.0.0.0,port=0,localport=53077) once every 5 times I try to restart and do M-x slime

18:11clojurebot: "([x] [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."

18:14clojurebot: "([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."

18:14rhudson: Rosettacode is a mixed bag. One advantage is that you see the same problem solved in a lot of different languages

20:33hiredman: no, but if you look at the function, and say "how would I implement this" and the way you would implement it could easily yield certain sloppy behaviour, why would you be surprised to see that behaviour?

21:00vIkSiT: hmm. bit stuck on doing this in idiomatic clojure - i have a string to which i want to make a transformation. "this _is_a *good* string". I'd like to replace everything within ** with the match of that word in another dictionary

21:00 (there can be multiple words with ** - I can do single words with re-gsub, for instance)