#clojure log - Dec 03 2010

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

1:41 technomancy: mmm... aether allows you to customize conflict resolution in dependency graphs.

1:41 * technomancy smells some interesting nonlinearity potential

1:55 zmyrgel: hi, is there a way to track program execution line by line?

1:55 cemerick: technomancy: taking hints from ivy, I guess?

1:57 technomancy: cemerick: I suppose so.

1:57 cemerick: zmyrgel: you might find clojure.contrib.trace interesting.

1:57 technomancy: cemerick: I'm interested in fork-aware dependency resolution. using the group-id has issues.

1:57 as I'm sure you're aware =)

1:58 zmyrgel: cemerick: I would be more interested debugger like approuch

1:58 cemerick: oh, so you're looking for a stepper

1:58 technomancy: my current crackpot theory is you'd need to maintain a mapping of version numbers to git shas so you can track the ancestry of any given version in a fork network to figure out which is newest.

1:59 no idea if that's actually feasible, but it's probably worth some noodling

1:59 zmyrgel: cemerick: yeah, something like that

1:59 cemerick: zmyrgel: People have had good results with JSwat, Enclojure, and cdt

2:00 technomancy: ah, that's what you mean by "fork-aware"

2:00 zmyrgel: my chess game tree just returns nil as result and I think it would be easier to see whats causing it if I can track the program execution step by step

2:00 cemerick: technomancy: yeah, that's a pretty crazy idea. Probably the root any potential solution, though.

2:00 technomancy: rich convinced me linear versions are an artifact of the days of SVN

2:01 cemerick: I'm not sure versioning has ever been linear.

2:02 technomancy: well... from a human perspective it's not, but from a tooling perspective, version strings are just sorted lexographically.

2:02 well not literally lexographically

2:02 but the segments are

2:04 cemerick: Sure.

2:04 technomancy: 1.1.0-master-SNAPSHOT < 1.1.0-new-SNAPSHOT, etc.

2:04 cemerick: My point was, I think wanting to be able to track releases coming out of a branch in SCM is a very recent phenomenon that exposes the issue.

2:05 I'm not even sure that makes sense.

2:05 technomancy: right

2:06 you might want to be able to choose strategies... always pick the newest vs prefer my fork vs prefer master branch, etc.

2:06 cemerick: I remember a brief attempt of mine to ditch all dep mgmt and just use git submodules.

2:07 (for internal stuff, that is)

2:07 technomancy: eep

2:07 cemerick: didn't last long

2:07 That was prior to my deciding to stop bothering with the question and just use mvn.

2:08 There's a lot of craziness in the git model that makes the concept of tracking branch releases a little nuts.

2:08 e.g. consider an impolite rebase

2:09 technomancy: I'm not a fan of git's implementation of submodules

2:09 cemerick: They're essentially useless.

2:10 I think it's telling that they don't track refs, either.

2:11 technomancy: well I don't expect to come up with anything useful in the next six months; just letting it simmer.

2:11 * cemerick is definitely not trying to discourage you :-)

2:13 technomancy: well most of what I've done so far is fairly obvious; just taking patterns that have worked in other contexts and adapting them... nonlinear versions haven't been done in any tool I'm aware of yet.

2:14 of course, it's probably all been figured out by ocaml people years ago in a thesis somewhere...

2:15 p_l|home: hmm... I wasn't aware of the issue with submodules, but that can be redone quite easily, I think

2:16 git, internally, isn't actually a version control system but a content-addressable write-only-with-gc system

2:18 technomancy: in this case I think it's an example of theoretical purity interfering with pragmatism

2:18 but anyway, I must head off; ciao

2:18 p_l|home: technomancy: more like "didn't bother" :)

2:18 content-addressible storage makes it easy to make a versioned filesystem with simple file commands (which is how Plan9 people do it, btw)

2:20 LauJensen: Morning all

2:27 Raynes: LauJensen: Morning.

4:15 bytecolor: trying to implement the first example from: http://clojure.org/libs?responseToken=0cbcb26df92c8eec7f95c8f1abeb68685

4:16 I've put my_utils.clj in ~/.clojure/com/my_company/clojure/examples

4:16 echo $CLASSPATH => /home/bytecolor/.clojure

4:18 using this to print the classpath: http://pupeno.com/blog/printing-the-class-path-in-clojure/

4:18 it does not show ~/.clojure though, and I can

4:18 *can't require the lib

4:18 does it have to be compiled to a .jar?

4:25 kjeldahl_: bytecolor: Are you starting the REPL with the right parameters, and/or from the right location? How are you starting the REPL?

4:26 bytecolor: kjeldahl_: this in in my ~/bin/clj => java -cp ~/.clojure/*: clojure.main "$*"

4:26 I've just started playing with CLASSPATH, I found that example on the net somewhere

4:28 I have clojure.jar and clojure-contrib.jar in ~/.clojure and they both seem to work ok when I run cjl from any location

4:28 kjeldahl_: bytecolor: I'm no expert either, but in my case the clj script is just an alias for clj-env-dir .

4:29 bytecolor: kjeldahl_: where is clj-env-dir?

4:29 kjeldahl_: launchers/bash/clj-env-dir in clojure-contrib

4:29 bytecolor: hrm

4:30 kjeldahl_: You're getting an error when you try to "require" the source code you've written from the examples?

4:31 Raynes: http://blog.raynes.me/?p=48 You'd probably be better off with cljr or cake rather than trying to get things running properly all by your lonesome.

4:31 bytecolor: yes, (require 'com.my-company.clojure.examples.my-utils) => FileNotFoundException

4:32 Raynes: I'll have a look.

4:32 kjeldahl_: Agree. I mostly start a new project using leiningen with dependencies and stuff in place before I dive into the REPL.

4:41 zmyrgel: hi, I have trouble getting my gametree working

4:42 I can build the gametree but when I try to evaluate the tree I get list of functions as a result instead of their result

4:42 Here's relevant code: http://clojure.pastebin.com/f0PmDQ5f

4:45 Raynes: zmyrgel: Doesn't matter all that much, but in case you didn't know, there are some pastebins that directly support Clojure highlighting: gist.github.com, paste.pocoo.org, ideone.com, and I think even pastie.org does now.

4:46 zmyrgel: ok, I'll remember that once I need to paste more code

4:47 any idea why my trampoline fuction won't work?

4:49 oelewapperke: I'm trying to learn a bit of clojure, so I'm trying to define a basic higher-order function like so "(defn m [n] (fn [x] (* x n))", however entering this in repl doesn't return (I've got to CTRL-C it)

4:49 why ?

4:49 Raynes: oelewapperke: You missed a closing parenthesis.

4:50 (defn m [n] (fn [x] (* x n)))

4:50 oelewapperke: I'm an idiot. Thanks

4:50 Raynes: You're welcome. :p

4:51 oelewapperke: what do you use as a clojure editor ? something that can help me with clogin parens etc

4:51 AWizzArd: Is there a way to change the namespace a thread runs in via eval?

4:52 Raynes: AWizzArd: Use binding to rebind *ns*

4:52 I do that in clojail to run code in a sandbox namespace.

4:52 AWizzArd: I will try that.

4:55 Raynes: AWizzArd: (binding [*ns* (create-ns 'blah)] (refer 'clojure.core) (eval '(pr-str *ns*))) ; Example

4:59 bartj: can't I use a "for" while reading from a file with a "with-open"

4:59 here's the paste: http://pastie.org/1344017

5:00 Raynes: bartj: for is lazy

5:01 AWizzArd: Raynes: yes, this binding trick seems to work. I will now try to redefine an existing function with that.

5:01 bartj: Raynes, and hence can't be used with a "with-open" ?

5:01 Raynes: bartj: Your for runs in with-open and creates a lazy-seq, but no work is actually done. The reader is closed after the scope of the with-open is over, so when you finally try to realize the sequence, the work can't be done because the stream is closed.

5:02 bartj: A way around this would be to close the stream yourself *after* you've realized all that you need from the sequence, or do so in the scope of with-open.

5:02 bartj: catch-22?

5:04 Raynes, I tried having a close after the for...no error; but still can

5:05 *can't read the contents

5:05 Raynes: bartj: You'd have to open the stream manually and close it after your println.

5:06 bartj: You can probably just wrap your for in a doall though.

5:06 That will force the entire sequence to be realized.

5:08 bartj: Raynes, thanks!

5:08 Raynes: user=> (with-open [rdr (clojure.java.io/reader "blah")] (doall (for [line (line-seq rdr)] line))) -> ("ohai" "there")

5:09 bartj: Sorry I didn't mention doall first rather than confusing you. I was trying to explain the reason it happened. :>

5:09 bartj: Raynes, I understand your explanation and thank you profusely for being so detailed

5:10 Raynes: bakkdoor|afk: Also, is that your actual code? If so, you realize you aren't really doing anything with that for, right? You could just call doall on the result of line-seq and be done with it.

5:10 Er, bartj.

5:10 Darn tab completion. :<

5:11 notsonerdysunny: Hello everybody .. can anybody help me with this .... http://groups.google.com/group/clojure/browse_thread/thread/9605dee93db81915#

5:14 bytecolor: thanks Raynes, I got cljr up and by dropping the example lib I mentioned in a path specified in the cljr script, it works

5:14 Raynes: bytecolor: Happy it helped. :>

5:14 octe: why does assoc-in work on vectors but not sequences?

5:15 Raynes: &([1 2 3] 1)

5:15 sexpbot: ⟹ 2

5:15 Raynes: &('(1 2 3) 1)

5:15 sexpbot: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn

5:16 octe: &(assoc-in ["a" "b"] [0] "x")

5:16 sexpbot: ⟹ ["x" "b"]

5:16 Raynes: Vectors are like maps of numeric keys to values.

5:16 Sequences aren't.

5:16 octe: &(assoc-in '("a" "b") [0] "x")

5:16 sexpbot: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Associative

5:16 octe: &(nth '("a" "b") 0)

5:16 sexpbot: ⟹ "a"

5:16 octe: well that's annoying

5:17 Raynes: Doing ##(assoc-in ["a" "b"] [0] "x") is like doing ##(assoc-in {0 "a" 1 "b"} [0] "x")

5:17 sexpbot: (assoc-in ["a" "b"] [0] "x") ⟹ ["x" "b"]

5:17 (assoc-in {0 "a", 1 "b"} [0] "x") ⟹ {0 "x", 1 "b"}

5:17 p_l|home: Raynes: so vectors are different from arrays/matrices in clojure? (just lurking here for now, haven't touched clojure in years)

5:18 raek: if you want to "change" something in the middle of a list, you need to create new cons cells for every element before the middle

5:19 p_l|home: raek: no way for in-place modification of a cons cell?

5:19 raek: p_l|home: clojure's vectors are persistent and can share structure. they are distinct from java arrays, Vectors and ArrayLists

5:19 octe: since every way of morphin listish stuff returns sequences (like map, map-indexed) i'm gonna have to keep converting to vectors to be able to use assoc-in too i guess

5:19 raek: p_l|home: no, they are always immutable

5:19 p_l|home: hmm... just gathering some differences from CL, good to know

5:25 raek: octe: yes. calling vec on the lazy sequence returned by map will do the trick

5:26 note that sequences aren

5:26 't really collections in the same as vectors

5:27 octe: well, no, since they're lazy and potentially infinite, etc

5:27 raek: they could be described as state-less iterators

5:27 octe: yeah

5:27 raek: the point is, don't worry about "creating a new collection"

5:32 Raynes: notsonerdysunny: I just replied to your group thread.

5:32 beerpages: Kostenlose mini Homepages für Umfragen, Videos und vielem mehr auf www.beerpages.de - Beispiel: http://www.beerpages.de/view/1P/Magst%20du%20%C3%84pfel%3F

5:33 Raynes: Looks like lpetit got to it before me. :<

5:37 oelewapperke: what is the difference between something like "fn" and "lambda" ?

5:38 Raynes: There isn't one. Just the name is different.

5:38 A function created with fn is a lambda.

5:45 dirchh: Except it looks less intimidating ;)

5:48 oelewapperke: Raynes: and "lambda" just doesn't work in clojure ? strange

5:48 Raynes: oelewapperke: I imagine Rich decided to name it 'fn' because 'fn' is shorter than 'lambda'.

5:50 bartj: I like fn much better than lambda

5:50 the naming convention I mean

5:56 Lajla: Lambda is a pain to type.

5:56 For something that common.

5:56 I like #( ... ) even more.

5:56 Raynes: Agreed.

5:56 Lajla: Hell, I'd say that {x y & r ; body} would be kind of cool.

5:57 Also, most languages that use lambda are kind of praetentious therein, because they aren't lambda abstractions at all.

5:57 Raynes: $he (\x y -> x + y) 2 2

5:57 sexpbot: ⟹4

5:57 Lajla: Hoaskall.

5:57 &he (+) 2 2

5:57 sexpbot: java.lang.Exception: Unable to resolve symbol: he in this context

5:58 Lajla: Bummer

5:58 Ohhh

5:58 $he (+) 2 2

5:58 sexpbot: ⟹4

5:58 Lajla: Raynes, does it also have Ocoaml?

5:58 Raynes: Unfortunately, no.

5:58 It will if I can find a satisfiable sandbox for OCaml.

5:59 Lajla: Raynes, what else does it have?

5:59 C?

5:59 Python?

5:59 clojurebot: python is ugly

5:59 Lajla: Lazy K.

5:59 Raynes: Just Clojure and Haskell.

5:59 Lajla: Ohhh

5:59 So he doesn't ignor eme on hat eh?

5:59 Raynes, you should add brainfuck and Lazy K.

6:00 Raynes: I think it actually does brainfuck.

6:00 Not sure if it still works.

6:00 Lajla: $bf .

6:00 sexpbot: {:ptr 0, :cells {}}

6:00 [0]

6:00 Lajla: Schweet

6:00 Raynes: Guess do.

6:02 s/do/so/

6:02 sexpbot: <Raynes> Guess so.

6:08 fliebel: I commonly hear it said that one big advantage of dynamic langs is that you can change things on the fly on a web server. But if and how is this done in practice?

6:10 p_l|home: fliebel: in case of CL, you usually compile the files with changes you want, then load them. Or type them from the REPL - you keep a REPL open for that

6:10 Raynes: fliebel: The same way you'd do it in a desktop application. You'd just reload code.

6:11 You can require namespaces with a :reload option to reload those namespaces.

6:11 fliebel: So you need to have a repl connected to the actual project and ssh into that?

6:11 Raynes: Besides that, if you have an REPL running in that instance, you can modify things normally.

6:12 p_l|home: I'm not sure about atomicity of reloading in clojure or JVM, the trick with compiling first is done on Common Lisp to have the changes done atomically

6:12 Raynes: fliebel: That's an option. In sexpbot, I've got it set up so that I can shoot it reload commands from IRC rather than use an REPL. You can get pretty creative.

6:13 fliebel: Raynes: So say I have a nice ring app deployed in a servlet, how am I ever going to get a repl on that?

6:14 Raynes: fliebel: Whenever you start your server, start it from an REPL and bind the result to a name. You're pretty much completely in control at that point.

6:15 p_l|home: does clojure-swank allow to start a repl server from the code? If so, just make it start in initalization code of your app, then connect to it over SSH proxy

6:15 Raynes: p_l|home: Yes, I was just about to mention that.

6:16 I used to do something similar in sexpbot pre my reload commands.

6:23 fliebel: Raynes: I was thinking, could I do something like nREPL over SSH?

6:24 Raynes: Probably. I'm not familiar with nREPL.

6:24 fliebel: cemerick: ping

6:24 raek: fliebel: I have used slime over ssh. very convenient.

6:25 fliebel: raek: I'm not using emacs

6:25 raek: ok

6:26 I think lein repl also starts a repl on a socket nowadays

6:26 how's nRepl going, btw?

6:27 * raek ssh -L

6:27 raek: <3

6:27 * fliebel man ssh

6:28 bsteuber: I don't get footnote 113 in JoC

6:28 fliebel: <3

6:29 bsteuber: You might have noticed that we explicitely bound the Var gcd to the memoization of an

6:29 anonymous function. The reason for this is that we also need to cache the intermediate results (Norvig 1991) which

6:29 would not happen if we had instead memoized an existing gcd function

6:29 the code given doesn't seem to memoize the immediate results, though

6:43 zmyrgel: hi, I got my gametree a bit further but now it seems it won't complete the min-max

6:43 I get list of list of numbers instead of number as a result

6:43 Here's the code: http://pastie.org/1344187

6:45 rrc7cz: why does (for [[x y z] [[1 2] [3 4]]] x) return (1 3) but (doseq [[x y z] [[1 2] [3 4]]] x) returns nil?

6:45 zmyrgel: it seems one mix and max iteration would be needed to complete it but I can't tell why it's not doing it already

6:45 Raynes: for collects it's results into a sequence, while doseq is for doing stuff with side-effects.

6:46 You only want to use doseq when you don't care about return results and just need to do something like print something.

6:47 rrc7cz: Raynes: understood, I actually need doall in my case

7:24 is there any reason to discourage rebinding like (let [foo 1 foo (+ foo 2)]? of course the example is bunk, but the idea of refining the symbol's value in multiple steps?

7:27 zmyrgel: if your doing it like that you might as well be doing java :)

7:28 rrc7cz: zmyrgel: but why? I mean I don't see how it's any better by just binding subsequent refinements to a different symbol

7:28 raek: I think it can be legitimate

7:29 Raynes: I'm not sure I really see the point.

7:29 I'd enjoy seeing a legitimate usage for educational purposes.

7:30 rrc7cz: Raynes: so in my case: (let [members (@db name) aliases (foo) members (if members (merge members aliases) aliases)

7:30 zmyrgel: rrc7cz: would seem quite imperative if same symbol gets refined step by step

7:31 rrc7cz: Raynes: actually writing it out now I see the if isn't needed

7:31 zmyrgel: this based on the fugly let-forms found in my own code :)

7:31 rrc7cz: Raynes: but the idea is, load members, then merge in aliases, but it's still "members", I mean why rename it?

7:32 Raynes: I'd do it just so that I was perfectly clear. All of those 'members' could get confusing. Especially in a more complex example.

7:32 fliebel: I think every case where you'd do like that in a let should be handled by ->

7:32 s/should/could/

7:32 sexpbot: <fliebel> I think every case where you'd do like that in a let could be handled by ->

7:33 jgracin: Hi! Where is Clojure's "local-variable clearing" documented?

7:33 bobo_: -> popped into my head directly when i saw that aswell

7:33 rrc7cz: fiebel: actually that's an interesting idea. I'm going to do that

7:33 thanks guys

7:33 fliebel: Oh, this would be nice, a fastcgi impl for ring, so you can run perl, php, python, everything under nice moustache routing and all.

7:42 sholden_: Hi everyone, trying to get started learning clojure. Just got lein installed, now I'm trying to decide what to use for an editor (under ubuntu). What's the most popular route? I know there are several but if one is a bit more popular in the community I'd like to go with that...

7:43 fliebel: I guess I must learn C first to understand FastCGI. Is a struct something like a hash-map? I haven't figured out if they use structs as a sortof JSON, or are converting them to some binary form. :( I would really love ring-fastcgi.

7:44 Raynes: The majority of Clojurians use Emacs with clojure-mode. However, there is some support in Eclipse via the Counterclockwise plugin.

7:44 There is VimClojure for Vim.

7:44 raek: sholden_: if you are comfortable with emacs, I really recommend it

7:44 fliebel: .. what Raynes said

7:44 bobo_: sholden_: emacs and the starterkit is pretty easy to setup

7:44 i think intellij's support got god the other day aswell? havent tried it myself

7:46 sholden_: I've never used emacs... Is it worth it to bite the bullet and learn it at the same time as clojure? Or do you think I should just do one at a time?

7:47 bobo_: sholden_: no, i would use what you already know

7:48 jarpiain: jgracin: http://groups.google.com/group/clojure/msg/9b4e268b85c20cd6

7:48 bobo_: netbeans,intellij and eclipse al have working support

7:48 sholden_: OK. I couldnt get enclojure working but I have the counterclockwise rc installed. I'll stick with that for now. Thanks

7:48 bobo_: or maybe netbeans doesnt anymore? havent tried it in ages

7:49 Raynes: A relatively bright individual with a few hours or so can get the hang of Emacs. It takes a while to reach ninja status. In any case, you should probably just use CCW or something similar for now, and get comfortable with Clojure and make sure you even like it. ;)

7:50 bobo_: one thing at the time is always a good idea

7:50 sholden_: Raynes: OK, I may play with it a bit. Honestly, in the past I saw people complain about emacs lisp and it being complicated with so many parens, but now that I'm coming around to clojure, what had happened was.... ;)

7:51 I think i'll try and get a few hello worlds off in eclipse then take a dive for a while

7:51 Raynes: Clojure doesn't have as many parens as elisp, and encourages good indentation for clarity.

7:52 jgracin: jarpiain: thanks!

7:54 sholden_: Thanks for the help, back to reading!

7:55 bartj: err, is there a diff b/w "error" and "failure" in clojure.test ?

7:58 kjeldahl_: How can I do something like: (map #(%) [1 2 3 4]) . I'm not looking for a "why" answer. ;-)

7:59 Raynes: &(map #(identity %) [1 2 3 4])

7:59 sexpbot: ⟹ (1 2 3 4)

8:00 Raynes: &(map (fn [x] x) [1 2 3 4])

8:00 sexpbot: ⟹ (1 2 3 4)

8:00 Raynes: Pick your poison.

8:01 kjeldahl_: Excellent, thanks.

8:07 fliebel: Awesome! Implementing this for ring will get me there I believe: http://jfastcgi.svn.sourceforge.net/viewvc/jfastcgi/trunk/src/net/jr/fastcgi/impl/RequestAdapter.java?revision=21&view=markup

8:23 If I want to implement an interface in Clojure with deftype or one of those, and use it in Java, will it generate *real* classes, or do I still need gen-class for that?

8:24 chouser: fliebel: deftype and defrecord create real classes

8:25 In order to expose a mechanism to create instances other than the default ctors, however, you'll need to either use Var stuff from the Java side, or gen-class to create some static methods.

8:26 fliebel: chouser: Look at the link above, only some methods.

8:28 chouser: Would I use a record for that?

8:29 chouser: oh, fastcgi. we meet again.

8:29 * chouser circles warily

8:30 fliebel: chouser: ?

8:30 chouser: I've known her for years. Her charms are alluring, but her betrayals cut deep.

8:31 defrecord or deftype should be fine

8:32 fliebel: chouser: Please elaborate, before she betrays me as well.

8:32 chouser: I think it's always been implementation issues. The concept, the protocol, and the performance are all fine.

8:32 fliebel: chouser: I haven't gone past the point of no return yet.

8:33 chouser: but specific implementations on either side seem to frequently have heisenbugs

8:33 the apache mod, the ruby lib, the python lib, etc.

8:33 fliebel: chouser: I will leave all implementation to jfastgci. But I would like to add a ring addapter.

8:34 chouser: I don't think I've tried it from Java yet

8:34 mduerksen: kjeldahl, raynes: (map identity [1 2 3 4]) will do, without the ugly # stuff

8:34 fliebel: chouser: As long as it runs some PHP for me, I'm fine with it.

8:36 kjeldahl_: mduerksen: True, thanks.

8:37 chouser: fliebel: I think the last time I used it was with apache and python. In the end the performance was more consistently fast using the python via regular cgi than via fastcgi.

8:38 fliebel: chouser: Hrm...

8:43 chouser: I think it would respond quickly for a while, then "something" would go wrong and incoming connections would hang several seconds before continuing

8:43 but I also didn't have admin access to the apache process, so could fiddle with things on that end very well

8:44 fliebel: hrm

8:58 Thorn: hello

9:00 fliebel: Thorn: Hi

9:00 Thorn: I have a seq of booleans and I want to find if all of them are true. I do (reduce and foo) but get "Can't take value of a macro"

9:00 what's the workaround?

9:00 fliebel: ever?

9:00 *every?

9:01 Thorn: nice, thanks

9:01 fliebel: &(every? identity [true true true false])

9:01 sexpbot: ⟹ false

9:01 Thorn: how long do you need to learn all of those?

9:02 raek: Thorn: this is a good start: http://clojuredocs.org/quickref/Clojure%20Core

9:02 fliebel: Thorn: I'm still learning. But according to my quiz I know 64% of all functions in core.

9:02 Thorn: lol

9:03 fliebel: Thorn: https://github.com/pepijndevos/clojure-quiz

9:03 neotyk: ,(every? true? [true false true])

9:03 clojurebot: false

9:03 Thorn: I understand some pythonistas hate clojure exactly for this

9:03 fliebel: Thorn: For what?

9:04 chouser: a few hundred uncategorized functions in core?

9:04 fliebel: chouser: In that case I'm one of them.

9:04 Thorn: lots of functions like map/filter/every?/reduce/take/first/rest/etc

9:05 (they've never seen common lisp obviously)

9:06 fliebel: Thorn: There are only a little over 500, adn I think you are officially allowed to call yourself a guru or master or pro or… if you know 200 of them ;)

9:06 neotyk: fliebel: you are called like that if you wrote 200 of them ;-)

9:06 Thorn: that's less than the number of common kanji characters so clojure must be easier than Japanese

9:07 at least

9:07 fliebel: Of which half are macros that are composed of the other 100, and with 100 fns we're comming close to Python ;)

9:07 Python has 67 I believe.

9:07 chouser: common lisp hyperspec lists 978. Clojure has 560. We're well on our way. :-/

9:08 fliebel: Thorn: You can speak Japanese without knowing all of those as well ;)

9:08 neotyk: chouser: what is hyperspec?

9:08 chouser: neotyk: http://www.lispworks.com/documentation/HyperSpec/Front/

9:10 Raynes: fliebel: And of those 500, some of them aren't functions. Your quiz includes stuff like *print-meta*.

9:10 chouser: which are good to know

9:11 fliebel: Raynes: I could do (filter fn?) on the lot… Not sure about it.

9:11 Raynes: fliebel: I think including all vars with documentation is great.

9:11 I learned some new dynamic vars that I didn't know about before.

9:12 fliebel: Raynes: And you use those?

9:12 Raynes: No, but it's nice to know about them. :>

9:13 fliebel: If I need a random Java lib that's not on Maven, am I supposed to add it to Clojars?

9:15 And how do I make something in Clojure that is a valid Enumeration<String>? will a seq or vector-of do?

9:16 kjeldahl_: fliebel: Any reason you can not just copy into your ~/.m2 local maven repo?

9:16 fliebel: kjeldahl_: Because not everyone can access my ~/.m2?

9:16 kjeldahl_: (I'm assuming a lot here, haven't tested myself, only limited experience from java on this)

9:17 fliebel: I was thinking that "lein deps" would copy it into lib together with the rest of the stuff.

9:17 fliebel: kjeldahl_: Yes, but as soon as my project gets on the webs, others need it as well.

9:19 kjeldahl_: fliebel: lein uberjar?

9:20 fliebel: How are the rest of the dependencies deployed then? Fetched by maven automagically? If so, put the jar into the local repo on the deployment machines as well?

9:20 fliebel: kjeldahl_: Meh, I actually wanted to know if it's okay to put java stuff on clojars.

9:21 kjeldahl_: fliebel: Can't help you there, if at all. :-)

9:23 Raynes: fliebel: Yes, it is.

9:24 kjeldahl_: The whole point of dependency management is for people to be able to fetch the dependencies when they're hacking on your project. If he installs his dependency in a local maven repo, other people who want to work on his project wont be able to get it. If you're going to do that sort of thing, you might as well not use a dependency manager at all.

9:25 fliebel: Raynes: Cool

9:25 kjeldahl_: Raynes: Got it now. Didn't get enough context to figure out he was looking for somewhere to stuff a jar for public distribution, not private.

9:26 Raynes: But the Clojars hint is fairly obvious by now.

9:32 fliebel: Can I also use Cake to push to Clojars?

9:33 there doesn't seem to be cake push

9:33 Raynes: fliebel: cake release

9:34 fliebel: It's not in cake help, or I'm overlooking it, or running an outdated cake

9:34 Raynes: cake release has been around for quite a while.

9:35 Just doing 'cake release' builds a jar of your project and pushes it to clojars.

9:35 fliebel: Okay, thanks

9:57 bartj: is there a replace-ignore-case somewhere?

10:00 Raynes: bartj: .replace and clojure.string/replace both take regexes. You can make your regex ignore case. Don't as me how though.

10:00 ask*

10:00 bartj: Raynes, yep, figured that out

10:00 Raynes, Perl regexes tend to spoil you with options

10:13 ,(replace "Б." #"б." "бульвар")

10:13 clojurebot: java.lang.IllegalArgumentException: Wrong number of args (3) passed to: core$replace

10:14 bartj: firstly, I am using the correct string/replace in my code

10:15 am I doing something wrong in the replace function?

10:15 Raynes: &(clojure.string/replace "Б." #"б." "бульвар")

10:15 sexpbot: ⟹ "Б."

10:16 bartj: 

10:16 my screen prints that, is there any utf-8 settings one needs to add to run Clojure?

10:18 tonyl: &(clojure.string/replace "бульвар" #"б." "Б.")

10:18 sexpbot: ⟹ "Б.львар"

10:18 tonyl: not as far as I know, my repl prints it fine

10:27 bhenry: is there something like map that isn't lazy?

10:28 raek: (doall (map ...))

10:29 or (doseq [x xs] ...) if you only care about the side-effetcs

10:29 bartj: what IDE (if any) do you use?

10:29 bhenry: actually i just realized the laziness wasn't my problem. i was mapping over a vector that later gets called as a function of it's keys, so i'll do (vec (msp …)) thanks though.

10:29 bartj: raek, vim :)

10:30 raek: sorry, never used that with clojure :)

10:30 bartj: raek, the problem is not with the IDE

10:31 raek: vim only acts as a terminal?

10:31 bartj: raek, I am currently testing on the repl in a bash shell

10:31 raek: bartj: you can run the following to detect encoding issues: (seq "бульвар")

10:32 if everyting works, you should get (\б \у \л \ь \в \а \р)

10:32 bartj: raek, I get this: (\1 \C \; \L \2 \0 \@)

10:32 Raynes: Yikes.

10:32 raek: oh, are you using line repl?

10:33 *lein

10:33 bartj: yes only the Repl

10:33 raek: then install rlwrap in your OS

10:33 leiningen uses jline if it is not available

10:34 and jline does not have support for UTF-8

10:34 mvid_: is there a way to print the actual text from an array of strings? everything I try just gives me the string addresss

10:34 raek: (rlwrap cannot be distributed with leinigen due to the licenses)

10:35 mvid_: (seq the-array)

10:35 mvid_: i get output like this

10:35 (#<String[] [Ljava.lang.String;@2699146a> #<String[] [Ljava.lang.String;@c0b4ef2> #<String[] [Ljava.lang.String;@3a6bf80b> #<String[] [Ljava.lang.String;@669b824>)

10:36 bartj: I suspect the problem is jline

10:36 let me remove that!

10:36 mvid_, seq it!

10:36 kotarak: mvid_: (map seq the-array)

10:36 Raynes: &(map seq (repeat 3 (into-array String ["a" "b" "c"])))

10:36 sexpbot: ⟹ (("a" "b" "c") ("a" "b" "c") ("a" "b" "c"))

10:37 raek: mvid_: looks like you have an array of arrays of strings

10:37 mvid_: 0.)

10:37 o.)

10:37 maybe?

10:37 ill have to check

10:37 ah

10:38 yes

10:38 that was dumb...

10:38 bartj: raek, yeah, removing jline helped

10:39 raek: bartj: as I said, if you install rlwrap on your system, lein will use that instead. rlwrap does not have this problem.

10:39 bartj: raek, yes, I have; but how does lein come into the picture?

10:39 raek, I do a "sudo apt-get install rlwrap"

10:43 edw: Anyone here use Cascalog (apropos the BackType video)? I'm wondering how to get a query to return a sequence, not print to standard out.

10:45 bartj: Raynes, is the following a bug in replace?

10:46 &(clojure.string/replace "Б." #"б." "бульвар")

10:46 sexpbot: ⟹ "Б."

10:46 bartj: I expect the output to be бульвар

10:46 fliebel: What's up with design patters in Clojure? Just as valid as anywhere else, or OO legacy?

10:46 tonyl: &(clojure.string/replace "бульвар" #"б." "Б.")

10:46 sexpbot: ⟹ "Б.львар"

10:47 tonyl: the string goes first then the match then the replacement

10:47 drdo: fliebel: design patterns are sad things to reuse code by copy pasting

10:47 edw: fliebel: Flamebait? :)

10:48 fliebel: edw: What? Meh I have a book about them right here on my desk, just wondering if it will do me any good.

10:48 bartj: tonyl, the string is Б. and the match is б.

10:48 tonyl: what is the replacement

10:48 bartj: tonyl, and the replacement is the long word: бульвар

10:48 raek: bartj: I think lein will check if rlwrap is on the PATH and if so, use it

10:49 bartj: but strangely this works:

10:49 &(clojure.string/replace "A." #"(?i)a." "xyzpqr")

10:49 sexpbot: ⟹ "xyzpqr"

10:49 bartj: replace seems to despise russian strings?

10:50 raek: &(clojure.string/replace "Б." #"(?i)б." "бульвар")

10:50 sexpbot: ⟹ "Б."

10:50 edw: fliebel: I don't see the GoF book getting much use in a Lisp e.g. Clojure shop.

10:50 tonyl: but #"б." doesn't match in the "Б." string

10:51 but i don't know russian chars

10:51 paulrosania: bartj: your arguments are out of order, you want (replace string pattern replacement), not (replace pattern replacement string)

10:51 fliebel: edw: I hav Head First Design Patters, but your point stands I guess.

10:51 bartj: they are the same; one is lower-case version of the other

10:51 raek: "By default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching can be enabled by specifying the UNICODE_CASE flag in conjunction with this flag."

10:51 p_l|home: fliebel: I believe the canonical quote about GoF pattern book and Lisp was "where Java programmer sees pattern, Lisp programmer sees unnecessary crufty redundance of code"

10:51 tonyl: I would make the regex case insensitive then

10:51 raek: http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html

10:51 &(clojure.string/replace "Б." #"(?iu)б." "бульвар")

10:51 sexpbot: ⟹ "бульвар"

10:52 raek: bartj: :-)

10:52 bartj: raek, oh my god

10:53 raek: I recommend checking out the unicode goodies of that page. for example, there are character classes for letters-of-any-script etc

10:54 edw: fliebel: In my experience, learning how to think in terms of list (sequence?) manipulation, using higher-order functions, is going to significantly improve your productivity. In other words, learn how to look at the world through mapping, reducing, etc. operations.

10:55 bartj: raek, thanks a ton!

10:56 miltondsilva: I'm trying to apply what I've learned in clojure to java/c.. but so far it seems that no matter what I do, java/c forces me to solve problems their way... is there something I'm mising? does somebody have tips on how to improve code quality in the C world by applying thing you learned in lisp/clojure?

10:56 bartj: miltondsilva, declaring all our variables as final would be the first step, IMO

10:56 tonyl: functions free of side effects. make composite functions

10:57 that is what i don in imperative langs

10:57 lucian: miltondsilva: I mark functions as pure and have unit tests for that

10:57 it works very nicely in python

10:57 Raynes: &(letfn [(flip [f & args] (fn [& args] (apply f (reverse args))))] ((flip cons) '(b c) 'a))

10:57 sexpbot: ⟹ (a b c)

10:57 Raynes: My favorite function ever.

10:58 miltondsilva: lucian: thanks never thought of that

10:58 bartj: how do you then handle(change) them?

10:58 lucian: miltondsilva: copies, most likely

10:58 but probably implicit copies through function calls

10:58 am i guessing right?

10:59 rrc7cz: how can I bind swank-clojure to when I boot w/the bin? I've tried: .lein/bin/swank-clojure 4005 "" but it doesn't like it

11:00 lucian: miltondsilva: there's another nice technique in some imperative languages, generators

11:00 miltondsilva: hmm.. ok thanks, I'll go investigate now :) and make some tests

11:00 lucian: miltondsilva: I sometimes write the various steps in some data processing as separate coroutines

11:01 or generators, since i tend to use python

11:01 miltondsilva: and you get both speed (generators are lazy lists) and functional purity/composability

11:01 in an imperative language

11:01 of course, this won't work in java or c

11:02 raek: rrc7cz: lein swank 4005 seems to work for me

11:03 ah, you were using a different binary

11:04 a new leiningen feature?

11:04 rrc7cz: raek: yeah, I'm trying to boot swank w/out a project

11:04 from Git readme: "If you just want a standalone swank server with no third-party libraries, you can just install swank-clojure using Leiningen. ~/.lein/bin/swank-clojure"

11:08 from the src it looks like the port is pulled separately, which isn't a problem for me; I can set the port fine via "swank-clojure XXXX" but when I try to add a host ip it blows up, saying "no value supplied for key:" so I'm guessing it expects a k+v for a map, but I'll have to dig in deeper to see how it parses it

12:04 technomancy: will probably drop jline for Leiningen 2.0; rlwrap is a better solution in every way except for distribution =\

12:05 raek: licenses, rigth?

12:05 technomancy: no, it's just that rlwrap is a C executable

12:05 rather than a jar file

12:06 raek: oh

12:06 technomancy: it's silly that libreadline isn't linked to the JDK; they actually are license-compatible IIUC

12:07 but sun obviously doesn't realize there's such a thing as a command-line

12:09 Raynes: cljandbox? Oh no, not competition.

12:09 Oh, *whew*. It isn't a sandboxing library.

12:09 fliebel: "A collection of Clojure utilities"

12:10 raek: ah, that kind of sandbox...

12:10 cloture: hey all. I am familiar with the benefits of lisp, clojure, etc, but I was wondering if there are any "killer apps" for clojure? Any libraries which really show off clojure's advantages?

12:11 fliebel: cloture: Hm, what about Aleph and ClojureQL?

12:12 dnolen: rhickey: empty is pretty useful. What about empty-transient?

12:12 Raynes: I think ring is a nice example.

12:13 fliebel: Raynes: But ring is not unique to Clojure, Python and Ruby have similar concepts.

12:13 chouser: how hard would it be to have clojure load a .class file in such a way that it could reload a new version of it later, the way it does with deftype classes

12:13 cloture: fliebel: ClojureQL looks interesting. thanks for the suggestion

12:15 hiredman: chouser: can't you just re-use that mechanism

12:15 DynamicClassloader

12:21 cloture: is there a preferred web library for clojure? is momentum towards webjure, compojure, or something else?

12:21 Raynes: cloture: Moustache and Compojure tend to be the most popular.

12:21 cloture: Raynes: thanks

12:24 chouser: hiredman: dunno. I guess I haven't tried.

12:25 sholden: cloture: I just started reading and learning clojure this morning, I'm kind of at the same stage :P

12:25 cloture: sholden gotta start somewhere

12:25 sholden: Im getting the hang of it, but I'm trying to decide what a good app would be to write in it that would flex it and show off a bit

12:26 cloture: yeah I know what you mean

12:27 sholden: at work we have a service that monitors updateable objects (could be 'fetch and cache url' or 'run script' etc)

12:27 and there may be about 1000 of them in the system at a time

12:27 updating 5-30 sec

12:27 might see if i can write a clojure version of that

12:28 hiredman: chouser: you may have to wall hack the var the compiler uses to hold the current classloader

12:29 more maybe not

12:29 looks like classCache is global

12:30 er

12:30 "static"

12:37 pedroteixeira: hi, can anyone confirm that the functions keys and vals produce sequences in correct pair order?

12:37 or one should not assume that.

12:38 ?

12:38 drewr: one should assume that

12:38 pedroteixeira: thanks, drewr. glad about that :)

12:45 fogus`: All: Is this a fair one-sentence summation? --> You can "mix in" partial implementations if you desire, but it only takes effect at the granularity of the protocol and not on a per-function basis.

12:47 In other words, this: https://gist.github.com/727273

12:48 rhickey: fogus`: I don't se the mixin there

12:48 see

12:49 I would reserve the term mixin for uses of extend that build the map using pieces

12:49 fogus`: rhickey: Do you mean a map of str=>fn used by extend?

12:49 oh, I see

12:49 rhickey: and in that sense, you can build a full implementation from partial ones

12:50 fogus`: rhickey: So that's to say that implementations are "mixed" into the map which is then used once in extend?

12:51 rhickey: right

12:51 fogus`: rhickey: OK, I can use that. What would you suggest as a better term in my original statement?

12:52 rhickey: fogus`: one doesn't do mixins via multiple partial extensions?

12:53 or, extension is at the granularity of the entire protocol

12:54 fogus`: rhickey: Thanks! That sounds good. I will expand on the original theme to include some talk about Clojure mixins

12:54 dnolen: oh yeah, I guess empty-transient isn't so useful w/ only two data structures really supporting it. rhickey: have there been any takers on that, bringing transient support to the other data structures?

12:55 rhickey: dnolen: all enhancements to transients will have to wait for pods

12:55 dnolen: rhickey: I see.

13:46 fliebel: What are the latest 2 parameters for Clojars? http://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html

13:50 stuartsierra: Clojars doesn't support deployment via Maven, last I heard.

13:50 fliebel: Huh? So how do I get a jar on there?

13:50 Raynes: Clojars only supports ssh deployment, iirc.

13:50 stuartsierra: SCP

13:50 see clojars.org home page

13:51 fliebel: They assume I can create a pom with leiningen, but I don't have one. can I at least have maven generate me one?

13:51 stuartsierra: no

13:51 copy & modify from another project

13:53 Raynes: cemerick: You were right: syntaxhighlighter evolved is teh awesome: http://blog.raynes.me/?p=82

13:54 Too bad tinymce's visual mode completely borks it, because it 'cleans up' your HTML and removes whitespace.

13:57 cemerick: Raynes: really? wp.com must have fixed a version for what they use -- I can use the WYSIWYG editor with code in a post without a problem..

13:59 Raynes: cemerick: In the visual editor?

13:59 In tinymce, if you switch from HTML to visual, your code is completely mangled.

13:59 cemerick: not on wp.com *shrug8

14:00 s/8/*

14:00 sexpbot: <cemerick> not on wp.com *shrug*

14:00 cemerick: like I say, they may have deployed a patched version of mce

14:00 Raynes: Probably.

14:00 cemerick: In any case, my usual process is to drop code in in the HTML mode, tag it appropriately, and then write around it in the visual editor.

14:00 Raynes: cemerick: Of course, I haven't tried WPs visual editor. I was using scribefire.

14:01 cemerick: WP's editor is the same as scribefires, but you're right in that they might have a patched version.

14:01 Nonetheless, syntaxhighlighter evolved explicitly mentions this flaw, so I'm not sure. I'll try it in a second.

14:01 clojurebot: No entiendo

14:03 Raynes: cemerick: Yup, still mangles it.

14:18 chouser: Hi! Who wants to help me with maven? Some more?

14:19 Raynes: chouser: I want to help you with maven as much as I want to help the government find Julian Assange.

14:19 Ba dum *ding*

14:19 cky: Raynes: Well played.

14:19 chouser: oh, I should say that I did get maven and antlr to play nicely together. The main problem was the antlr maven plugin used antlr 3.0.1, but we needed it to use 3.1.2, which ended up requiring a patch to the plugin itself.

14:19 cky: chouser: Isn't there a #maven channel for that sort of stuff?

14:19 chouser: cky: hm, good point.

14:20 cky: To me, the only relation Maven has to Clojure is the letter "e".

14:21 chouser: cky: well, I'm hoping to use clojure.java.io/resource, but your point is still valid

14:24 on the other hand, I've gotten infinitely more responses to my question here as I have in #maven

14:25 so, I'll go for it anyway. feel free to ignore me.

14:25 Raynes: People here actually like you and know you.

14:25 chouser: If I have a file like src/main/resources/com/mydomain/foo.txt, should I be able to get to it via (clojure.java.io/resource "com/mydomain/foo.txt") ?

14:25 brehaut: chouser: the #mavenites are going to respond to your question, but they are still waiting for the dependant questions to download

14:26 chouser: brehaut: tee hee

14:26 cky: :-)

14:26 stuartsierra: chouser: Yes, after a build.

14:26 chouser: ah!

14:26 seems obvious now that you say it

14:26 stuartsierra: the "process-resources" phase has to run first.

14:27 chouser: hm, still getting nil

14:28 could I have disabled it somehow in my pom?

14:28 stuartsierra: Do "find target -name foo.txt" and see where it shows up

14:29 Wait...

14:29 You may need to add a <resource> directory.

14:29 chouser: ah

14:29 I see a couple for clojure sources. hang on

14:29 stuartsierra: Under <build>, add <resources><resource>src/main/resources</resource></resources>

14:30 I think if you have any resource dirs defined, it overrides the default src/main/resources

14:30 sorry that's <resources><resource><directory>src/main/resources</directory></resource></resources>

14:30 chouser: heh, ok, I think I understand. hang on

14:31 bingo

14:31 stuartsierra: cowabunga

14:31 chouser: thanks bunches!

14:31 stuartsierra: 'welcome

14:33 chouser: is it kosher to make up new dirs in there? like src/main/web-content ...?

14:33 stuartsierra: yes

14:34 Every <resource> will get copied into the JAR, without its base directory

14:34 chouser: but they get merged into the same virtual resource tree, so I'd still need a uniquely named subdir. may not be worth it.

14:34 ok

14:34 stuartsierra: e.g., src/main/web-content/foo.txt becomes "

14:34 "/foo.txt" in the output JAR

14:35 chouser: right

14:35 thanks again, that would have taken me a long time to figure out on my own.

14:36 stuartsierra: np

14:58 kjeldahl: Does anybody have a "cake-swank" emacs function handy? I've tried doing a search and replace on my "lein-swank", but that doesn't seem sufficient...

15:02 Probably related to cake having a different process model.

15:08 hchbaw_: quile:

15:10 kjeldahl: Got it working. Had to modify the string-match parameter to recognize the cake output.

15:12 lpetit: Hello

15:13 mmullins: I'm having trouble with *agent* in clojure-1.3.0-alpha3. It seems to be nil when I expect it not to be. (send (agent 0) (fn [_] (println "*agent* = " *agent*))) gives *agent* = nil. I think in alpha1 and 1.2.0 this gave the agent as I expect. Am I not supposed to do that now?

15:14 lpetit: any ccw users in the place ? I need ideas for a feature I want to add ...

15:14 hiredman: mmullins: it's a known bug

15:14 mmullins: Ahhh ... ok. Thanks.

15:15 hiredman: because of the change that propagates bindings from the thread running the action, to the thread the action is run on

15:15 on the thread the action is sent form *agent* is nil

15:16 mmullins: so is there a way to send the same agent another function from inside one it's doing until that's fixed?

15:17 hiredman: create your own binding of *agent* to the agent you are sending to

15:17 (let [a (agent 0)] (binding [*agent* a] (send a some-action)))

15:18 mmullins: I'll try it. Thanks.

15:30 cloture: I seem to have a problem. I am using leiningen, which had been working fine. However, when I use the "deps" command, it now just sits hangs

15:31 anyone familiar with the issue?\

15:33 hmm. when I remove one of the dependencies there is no problem

15:54 chouser: meh. ring is getting in my way, for perhaps the first time

15:54 hiredman: do share

15:55 chouser: trying to serve static content from resources instead of a file path

15:55 but all the wrap-file stuff assumes otherwise -- breaks in several places

15:56 hiredman: can wrap file take File objects?

15:57 you should be able to generate file objects use the url from one of those getResource methods

16:07 technomancy: cloture: that was a known bug that surfaced in one of the release candidates; it should be fixed on the 1.4.0 release

16:08 cloture: technomancy: okay. thanks for the info

16:12 technomancy: cloture: that is to say, make sure you're running the latest; if it still happens please file a bug

16:18 chouser: hiredman: if you have actually seen working code like that, I'd be interested. My fumbling attempts to do it have all failed.

16:36 bmh: Is there a 'nice' looking way of writing a curried multimethod where the object used for dispatch is not in the first argument position?

16:38 technomancy: ,((comp second list) 1 2 3 4)

16:38 clojurebot: 2

16:39 technomancy: ,((comp class second list) 1 2.0 :three "four")

16:39 clojurebot: java.lang.Double

16:53 cloture: anyone familiar with enlive? does a template have to exist before you use deftemplate? I keep getting a null pointer exception and I'm baffled as to why that is

16:59 dnolen: cloture: the html file the template uses does have to exist.

16:59 cloture: dnolen: okay, I'm a bit confused. enlive doesn't generate the html from the clojure code you supply?

17:01 dnolen: even when it exists I get an error

17:01 dnolen: cloture: the html file need to be in the class path

17:03 cloture: enlive serializes the html file and processes it according to your template definition.

17:03 cloture: dnolen: okay

17:03 eaa: anyone ever experience problems with multimethod dispatch blocking threads? I am getting thread contention in clojure in MultiFn.java:106 when invoking a multimethod from within a pmap via incanter.stats which invokes a multimethod to convert its argument before invoking a Java method

17:04 cloture: thanks for the help

17:04 dnolen: cloture: have you looked at the enlive tutorial I wrote?

17:20 aria42: I have a deftype and it implements IFn for various # of args of invoke. When I use partial on an instance of the type, I get an abstract method error when I execute on a defined invoke

17:21 The issue is the use of apply in partial

17:22 hiredman: aria42: you need to implement the apply method

17:22 rhickey: aria42: just implement applyTo

17:22 aria42: Ah, thanks.

17:23 raek: dnolen: I saw in that tutorial a while go that you called (apply str ...) on the result from enlive. is that really necessary?

17:24 I think the ring SPEC says that the body of the response may be a sequence of strings

17:26 also, I enjoyed the tutorial :-)

17:27 dnolen: raek: it is.

17:27 raek: thx!

18:00 kzar: When I slime-connect to Clojure it works fine except the slime-repl is not put into Clojure mode. Then if I load clojure-mode myself the repl breaks and I can no longer evaluate stuff. Any ideas?

18:04 Oh I found my answer, sorry

18:04 brehaut: i dont think you need to be sorry for solving your own problem

18:06 kzar: Heh I almost said 'sorry' for my eroneous apology, stack overflow Dave heh

18:09 brehaut: kzar: im not familiar enough with SO to understand your reference

18:13 kzar: brehaut: Well if you mess up some recursion, as I often do, you get a stack overflow error and I was joking that would happen to me as I kept apologising for apologising forever. Kind of a terrible joke but there you go heh

18:14 cky: *lol* @ brehaut, I have the same problem myself.

18:14 That I read "stack overflow" as a reference to stackoverflow.com.

18:17 * brehaut has failed as a nerd

18:18 brehaut: i think it might be time to brew tea

19:58 jjido: ##(date)

19:58 sexpbot: java.lang.Exception: Unable to resolve symbol: date in this context

20:02 jjido: &(Date.)

20:02 sexpbot: java.lang.IllegalArgumentException: Unable to resolve classname: Date

20:05 jjido: &(java.util/Date.)

20:05 sexpbot: java.lang.ClassNotFoundException: java.util

20:05 jjido: &(java.util.Date.)

20:05 sexpbot: ⟹ #<Date Fri Dec 03 17:06:07 PST 2010>

20:06 jjido: thanks :D

21:04 talios: is it possible to return a type specific object array in clojure? ( other than the predefined boolean-array, char-array etc. etc. ). I want/need to return SomeFoo[]

21:28 hiredman: talios: have you read the docs on make-array? or into-array?

21:29 talios: aha! I hadn't spotted those two :) Cheers. I refactor the code to use a List<XXX> on the java side anyway. Tho I might revert that for now and favour (make-array) to keep the changes to a minimal in this spike.

21:30 man - it's been way toooo long since I've actully done any clojure.

21:52 RazWelles: ping dmiller2718 -- Do you have any code examples for importing a .Net dll, and instantiating a class and using a method? I can't find any docs for ClojureCLR

22:28 talios: Hrm - I have a namespace with a defn'd function, and a deftype type. The type doesn't seem to be able to see the functions in the namespace surrounding it. Am I missing something simple? https://gist.github.com/8bf96274a6912aaea036

22:34 hiredman: I think there is too much wrong with that to debug via irc, so I would suggest more reading of docs

22:35 for one thing I don't think ^File [] does what you think

22:36 I kind of doubt you've read up datatypes, since I would be surprised if you have a reason to use deftype over defrecord

22:38 talios: mmm, defrecord just seems to add all the keyword accessors, equals/hashcode etc. etc. which I didn't seem to need.

22:42 ^File [] should have been ^File[] anyway - and seems to compile fine.

22:43 hiredman: right, but it doesn't do what you ant

22:43 want

22:43 so unless you understand what and why I suggest you stick with defrecord

22:45 talios: I require the ^File[] so that the interface is satisfied. Without it I get "Can't define method not in interfaces: discoverNamespacesIn"

22:45 hiredman: I suggest you run ^File[] through the reader and see what you get

22:48 dmiller2718: RazWelles: Use (System.Reflection.Assembly/Load "...") for things in the GAC, (System.Reflection.Assembly/LoadFrom "..." for things in your directory.

22:48 RazWelles: dmiller2718, thanks so much!

22:49 talios: hrm - empty list. so how does one type list an array?

22:49 dmiller2718: RazWelles: In the ClojureCLR source, look in Clojure/Clojure.Source/clojure/samples, both celsius.clj and the interop subdir.

22:49 RazWelles: oooh, sweet I'll go grab that from github :D

22:50 dmiller2718, also, thanks for continuing to work on ClojureCLR, I've been waiting for user binaries since the project first started :)

22:50 talios: oh nasty - ok. so clojure doesn't directly support array typehints - nasty.

22:50 * talios shall refactor.

22:51 dmiller2718: RazWelles: thx. Feel free to contact directly with suggestions, etc.

22:51 talios: I suspect that'll leave me back with the original problem tho

22:52 RazWelles: dmiller2718, definitely will do :)!

23:07 talios: Right - so now back to my original problem, after cleaning up that mess of a deftype.

Logging service provided by n01se.net