#clojure log - Jul 02 2010

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

0:01 ysph: would it be possible/worthwhile to implement Haskell style type declarations for clojure fns?

0:02 hiredman: meh

0:03 clojure is a dynamic language

0:03 qbg: Possible? Probably

0:04 Why would you want to?

0:06 ysph: well, i for one enjoy Haskell's type declarations, in the realm of pure functions, you can often tell what a function does just from looking at the declaration

0:07 and enforcing it as a contract for using the function gives you a heads up when you're doing something stupid

0:08 hiredman: clojurebot: deft?

0:08 clojurebot: deft is http://gist.github.com/128259

0:11 ysph: hiredman: thanks, i'll play around with that, looks interesting

0:15 hiredman: ysph: meh

0:17 ysph: it could be that i just don't grok the dynamic way, is it that people in favor or static typing are overly paranoid, aren't thinking in the right terms, a combination thereof?

0:17 a primary reason for my concern is that one of my co-workers who might otherwise be interested in clojure is put off by dynamic typing

0:18 s/or/of

0:19 tomoj: I'd like to see an attractive statically typed lisp

0:20 ysph: there is a typed scheme

0:21 qbg: From reading the docs on Typed Racket, it looks okay until you get to the interesting stuff...

0:22 For example, the type signature for map

0:24 ysph: yes, that is ugly

0:28 Raynes: Haskell people just cannot stand things without type declarations.

0:30 ysph: I don't really get caught up in dynamic vs static typing. The errors are always going to be there. You'll just find them at different times. Static typing wont save you from screwing up your application so horribly that a runtime error makes your eyes bleed.

0:31 That said, I do enjoy Haskell's type declarations.

0:32 Mostly for their aesthetic value though. I've never really been able to grok the whole "You can tell what a function does by it's type signature" stuff.

0:39 ysph: i'm hoping that most of the fear of dynamic typing is really a fear of loose typing

0:43 tomoj: "you can tell what a function does by its type signature" is freakin awesome

0:44 hoogle practically writes your programs for you

0:44 hiredman: why?

0:44 clojurebot: http://clojure.org/rationale

0:44 hiredman: ^-

0:49 rubydiamond: Hi guys ..I installed sbcl with homebrew on my mac

0:49 get this error 'can't find core file at /usr/local/lib/sbcl//sbcl.core

0:49 '

0:49 for running sbcl..

0:49 hiredman: I'd suggest you try #lisp

0:50 rubydiamond: hiredman: M-x slime gives me No such file/directory found lisp

0:53 hiredman: I meant the irc channel

0:53 this is #clojure, which is not common lisp

1:00 slyrus: rubydiamond: what hiredman said. there are usually at least one or two sbcl developers hanging around #lisp.

1:05 rubydiamond: slyrus: okay

1:35 thunk: Rad! Agast!

1:35 hiredman: https://twitter.com/technomancy/status/17538042860

1:40 thunk: Aquaman! You go ... talk to some fish!

1:40 http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=23456906

3:11 rubydiamond: Need help in starting up swank-clojure

3:13 how to install maven-clojure-plugin in maven

3:20 help me

3:21 LauJensen: Morning all

3:26 tomoj: rubydiamond: hello

3:26 rubydiamond: tomoj: hey

3:26 I have git cloned swank-clojure

3:26 tomoj: don't bother

3:26 rubydiamond: now how to run the server

3:27 tomoj: unless you want to run the very latest?

3:27 1.2.1 isn't bad

3:27 rubydiamond: tomoj: okay.. but basically I don't know how to run the swank-clojure server

3:27 tomoj: right, hang on

3:27 rubydiamond: http://github.com/technomancy/swank-clojure

3:27 tomoj: gotta fetch my example pom from my other computer

3:27 you have maven installed already?

3:28 rubydiamond: tomoj: yes

3:31 tomoj: I also don't know how to install maven-clojure-plugin in maven

3:32 tomoj: sorry

3:32 working on an example but I just got a new computer so everything is not set up yet

3:32 took me forever to figure out how to get gist.el to work after I screwed up the auth info

3:32 https://gist.github.com/df9986f7b9aff72e71cb

3:33 oh except 1.3.1 is the newest version looks like of clojure-maven-plugin

3:33 but put that in your project root, fix it up with your info

3:34 put your clojure source files in ./src/main/clojure/com/example/foo.clj

3:34 `mvn clojure:swank` to start the swank server

3:34 rubydiamond: tomoj: where to put that pom.xml

3:34 tomoj: in the root of your project

3:35 e.g. ~/code/clojure/foo-project/pom.xml might have ~/code/clojure/foo-project/src/main/clojure/com/example/foo.clj

3:35 rubydiamond: tomoj: I just created mkdir clojure-proj

3:36 should i put pom.xml in it

3:36 tomoj: sure

3:36 new to *nix?

3:36 rubydiamond: tomoj: not new to unix.. but don't know much about maven

3:37 tomoj: good luck

3:37 you can get a long way with just `mvn clojure:swank8

3:38 rubydiamond: looks like it's downloading lots of files for `mvn clojure:swank`

3:38 tomoj: should I wait till downloads finishes

3:39 tomoj: yep

3:39 rubydiamond: tomoj: got an error :( https://gist.github.com/6ae464a51a9089c50c45

3:41 tomoj: any idea?

3:41 dr_benway: hello all, i'm trying to convert a sequence into a hash-set. (reduce conj #{} my-seq) is my best guess so far - is that The Right Way?

3:42 rubydiamond: tomoj: you there?

3:42 tomoj: uhh

3:42 gist your pom.xml

3:42 did you just use mine without changing it?

3:43 hoeck: dr_benway: I guess the idiomatic way is to use (into #{} my-seq)

3:44 rubydiamond: tomoj: yep

3:44 tomoj: https://gist.github.com/9c7d3f3e3aadb5fbefc7

3:44 dr_benway: hoeck: oh cool - i was assuming that would put the sequence itself in the set. much better: thanks!

3:45 tomoj: well, that doesn't make sense

3:45 ooh

3:45 I suppose it does

3:45 rubydiamond: tomoj: ?

3:45 tomoj: I tried it and it worked for me

3:45 but this could be because I had used leiningen earlier today

3:45 so I already have those jars

3:46 trying again

3:46 rubydiamond: tomoj: nice

3:46 tomoj: it worked again

3:47 rubydiamond: tomoj: :(

3:47 tomoj: I have only pom.xml in my project

3:47 no other file

3:47 is it beacause of it

3:47 tomoj: no, that works for me too

3:48 it downloads clojure, contrib, swank-clojure, and clojure-maven-plugin

3:48 you didn't change my pom.xml at all?

3:48 rubydiamond: tomoj: nope

3:48 tomoj: are you on a linux?

3:48 rubydiamond: tomoj: I am on mac

3:48 tomoj: I don't know why it would make a difference

3:48 gist `mvn -v`

3:49 rubydiamond: tomoj: here is the whole log https://gist.github.com/6f5f6543fad66dbe9fa9

3:49 tomoj: doing

3:49 tomoj: it said Can't find Apache

3:50 tomoj: huh

3:50 gist whatever the output of `mvn -v` is

3:50 oh

3:50 don't type the ``

3:50 mvn -v

3:50 rubydiamond: tomoj: https://gist.github.com/a548f55c7fe71d3db506

3:51 tomoj: well, I have maven 2.2.1

3:52 same java version

3:52 I don't know how that could cause this

3:52 rubydiamond: tomoj: so basically maven is not able to find repositories of clojures right?

3:52 tomoj: hmm, weird

3:53 http://clojars.org/repo/org/clojure redirects to http://build.clojure.org/releases/org/clojure/

3:53 where snapshots are not to be found

3:54 how come I can still download them???

3:54 rubydiamond: tomoj: changing the url to http://build.clojure.org/releases/

3:55 same error

3:55 tomoj: my logs say downloading http://clojars.org/repo//org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-20100623.220259-87.pom

3:55 but that's a 404

3:55 very odd

3:55 rubydiamond: tomoj: it must be picking those from your local repo

3:56 tomoj: I deleted them, though

3:56 maybe there is a cache somewhere

3:56 rubydiamond: tomoj: is there any alternative for above repo path

3:56 tomoj: I'm trying to figure out what's going on

3:56 the snapshots must have moved

3:59 maybe 1.2.0 is being released?

4:00 rubydiamond: tomoj: hmm

4:03 tomoj: hmm

4:03 1.2 milestone is dated yesterday

4:03 but there are still open tickets

4:03 rubydiamond: tomoj: does it mean that there is bug in maven i have

4:04 tomoj: I don't think so

4:06 rubydiamond: should I remove master in 1.2.0-master-SNAPSHOT

4:06 tomoj: won't help I believe

4:06 try changing the version for clojure-maven-plugin to 1.3.3

4:07 rubydiamond: okay

4:07 same error

4:07 tomoj: my logs still say they're downloading a file that gives me a 404 in the browser

4:09 gist the output of `mvn help:effective-pom`

4:10 anyway, I know how to fix this I think

4:10 I'm just puzzled that it still works for me

4:13 rubydiamond: https://gist.github.com/875abdebfad975244775

4:13 try that pom

4:16 cais2002: hi, anybody used the clojure-twitter packge?

4:18 mikem: cais2002: i'm playing with it

4:19 cais2002: mikem, great! did u build it using ant or lein?

4:19 mikem: lein

4:19 cais2002: any changes to the codes required?

4:20 mikem: cais2002: yeah, i actually do have some modifications

4:20 let me put them on github... give me a few minutes

4:21 cschreiner: Regarding naming conventions in Clojure: Is there something obvious I should look at, except existing sourcecode?

4:21 tomoj: http://www.assembla.com/wiki/show/clojure/Clojure_Library_Coding_Standards is somewhat helpful

4:22 cschreiner: I am primarily thinking about names of params

4:22 tomoj: having a look

4:23 rubydiamond: tomoj: trying it

4:23 tomoj: in one of the books there was a little table with some more idiomatic variable names listed I believe

4:24 cschreiner: tomoj: yeah, that was very helpful!

4:24 (the assembla link)

4:28 rubydiamond: tomoj: Connection opened on local port 4005

4:28 cschreiner: When we are talking about the nameing convention coll, is this for map as well?

4:28 rubydiamond: tomoj: thanks it worked..

4:28 tomoj: cool

4:28 cschreiner: like Coll => map, vectors, lists etc?

4:28 tomoj: maps are colls, but..

4:28 "m" is often used for maps

4:28 cschreiner: is it okay to prepend m like m-stuff ?

4:29 tomoj: m-stuff seems quite strange to me

4:29 but I am not a stylistic expert

4:29 cschreiner: I want to communicate that I am using a map

4:29 I guess m should be enough, stating the rest in the docstring

4:30 tomoj: hungarian notation is rare

4:30 LauJensen: cschreiner: And what is the map containing?

4:31 Chousuke: if it's "any map" then m or map (if you don't need the function) is fine

4:31 tomoj: yes, if it's not just a map, it probably has a better name

4:32 cschreiner: LauJensen: It contains columns for a css table

4:32 LauJensen: ok, so something like column-map would be my pick

4:33 tomoj: oh, yes, *-map seems much less strange

4:33 cschreiner: it really helps using eldoc to have a somewhat verbose sign

4:34 * cschreiner could extend eldoc to include the docstring in the minibuffer

4:35 cschreiner: anyway, thanks for your input

4:36 tomoj: huh, assoc steals 'map

4:43 LauJensen: tomoj: Is that giving you problems?

4:48 tomoj: nope

4:48 the only problems it could create would be for assoc itself

5:00 LauJensen: Yea, which is why I was wondering why you brought it up

5:04 tomoj: surprising

5:04 I would've expected 'm

5:04 just a gut reaction against shadowing

6:20 dr_benway: hey, can someone explain the difference between :when and :when in e.g. a for loop?

6:20 oops, :when and :while, sorry

6:27 mikem: dr_benway: I'm guessing here, but :when would be sort of like a filter which iterates *when* the predicate is true (skipping values for which the predicate is false), and :while would iterate *as long as* the predicate is true (terminating the loop as soon as the predicate is false)

6:28 dr_benway: ok, so :while should be more efficient for things like (for [a (range 100) b (range 100) :while (< b a)] ...)

6:30 mikem: yeah, then the loop stops the first time (< b a) is false

6:30 dr_benway: http://pastebin.com/xRYAp8j0

6:31 Bahman: Hi all!

6:32 dr_benway: mikem: gotcha - thanks

7:39 dabd: I set up swank clojure as described here http://github.com/technomancy/swank-clojure/blob/master/README.md but I would like to run a standalone repl from emacs. How do I do that?

7:53 AWizzArd: Uh, Google bought ITA

7:53 This means that Google is now the biggest Lisp employer in the world.

7:53 LauJensen: Conversion to Python, here we go!

9:47 DeusExPikachu: is it possible to create a new instance of a class where the class is in a var, without using eval? I can only do this: (def bar (class foo)) (def baz (eval `(new ~bar)))

9:50 chouser: DeusExPikachu: you can use clojure.lang.Reflector

9:50 DeusExPikachu: chouser, short example please?

9:50 chouser: actually, if it's a no-arg ctor, you can use newInstance

9:51 ,(let [c java.util.Date] (.newInstance c))

9:51 clojurebot: #<Date Fri Jul 02 06:59:43 PDT 2010>

9:51 DeusExPikachu: ah, newInstance the method

9:53 cool and if there are args?

9:53 chouser: then you need either Reflector or eval

9:55 ,(clojure.lang.Reflector/invokeConstructor Integer (to-array ["45"]))

9:55 clojurebot: 45

9:55 DeusExPikachu: k, hmm but if you use reify to make the instance, you can use closures and pretty much all instancese will have no arg ctorrs.. cool

9:58 chouser: actually, classes created by reify that are closures will have ctor args for all the things they close over

9:58 but if you're creating instances with reify, why would you need some other way (like .newInstance) to make instances anyway?

9:59 DeusExPikachu: chouser, lets say you're given an instance from reify from someone else's code

9:59 and you want to make a new instance, that's all

9:59 chouser: I don't see how you could do that sensibly.

10:00 unless you promise that instance implements some particular interface for making new instances.

10:00 like a .clone method or something

10:17 digash: now that deref can block on future indefinitely, i think there should be deref with timeout or await-for should take future, what do people think?

10:20 thorstadt: i don't know; it seems to me that promise fulfills a role in deterministic computation

10:21 if something happens that would result in a promise not being delivered, perhaps you should use an agent instead

10:21 *something could happen ...

10:23 digash: agent has state, which i do not care about, i just want to try a computation and if it did not succeed in a certain period of time, just timeout

10:24 i did use agents but the state was useless to it and future macro is much more succinct

10:25 chouser: I've certainly used a hacked-together deref-with-timeout on either future or promise, I forget which.

10:26 digash: (when-not (deref (future (long-computation)) 10) (throw (Exception. "timeout")))

10:26 chouser: you can poll using 'future-done?' :-/

10:26 actually, you can use .get with a timeout, looks like.

10:27 digash: yes, that is what i am doing, but it leaks future abstraction

10:28 chouser: java.util.concurrent.Future is a documented interface

10:28 digash: ,(doc future)

10:28 clojurebot: "([& body]); Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block."

10:28 digash: does not mention it

10:28 chouser: if future's docstring stated that the thing it returns implemented j.u.c.Future, would that satisfy you?

10:30 digash: it is a solution, but i would prefer some kind of deref or await-for on clojure side

10:30 smclarnon: is there a simple way to provide a noop proxy for an interface (without implement all of the methods)?

10:30 digash: it seems like a common pattern to me and the .get usage looks ugly because it brings in timeunit

10:31 (.get init 30 (java.util.concurrent.TimeUnit/SECONDS)

10:31 thorstadt: would be nice to have actors, eh?

10:32 digash: thorstadt: i am not sure how actors will help more than agents already do in this case.

10:33 thorstadt: well, you mentioned that the statefulness of agents bothered you

10:33 arohner: smclarnon: I think you'd just have to do (proxy TheClass (foo [] ) (bar []) (baz []))

10:34 smclarnon: if it's a pain, you can probably write a function to do it for you

10:36 smclarnon: arohner: yeah, its a pain, was curious if someone had already written that function to make it easier :)

10:36 digash: there were couple of things but succinctness of future macro and the locality of the code that lead me to use future in that case

10:36 arohner: smclarnon: not that I'm aware of

10:36 chouser: smclarnon: you want the default method impls to return nil instead of throwing an exception?

10:37 digash: just found this http://bit.ly/dB9z8P somebody actually wrote a blog about it

10:41 smclarnon: chouser: essentially, yes. it'd be nice to pass in a catch-all fn to generate-proxy so the default throwing of UnsupportedOpEx could be changesd

10:41 er, changed

10:58 rbxbx: Dear clojurians, any idea as to why this doesn't work? I have a hunch that I'm getting my various list structures confused (or rather, I know that to be true, just not sure how to fix it)

10:59 chouser: smclarnon: you may be able to use init-proxy to provide a collection for which all values are fns that return nil

11:00 rbxbx: " (λ x . x)

11:00 java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Character (NO_SOURCE_FILE:0)

11:00 "

11:12 rbe: hi

11:12 I am trying to use (compile) at runtime and I get the following exception: java.lang.Exception: *compile-path* not set

11:14 At the REPL everything is fine… I try to dynamically call functions from a namespace included at runtime.

11:17 I included classes/ in my classpath...

11:20 ,(+ 1 1)

11:20 clojurebot: 2

11:25 rbe: (doc compile)

11:25 clojurebot: "([lib]); Compiles the namespace named by the symbol lib into a set of classfiles. The source for the lib must be in a proper classpath-relative directory. The output files will go into the directory specified by *compile-path*, and that directory too must be in the classpath."

11:25 chouser: smclarnon: http://gist.github.com/461507

11:29 rbxbx: I don't understand what you're asking.

11:30 rbe: you're trying to create new .class files at runtime? creating a build tool or something?

11:31 rbe: chouser: yes… not a build tool but a very own "application server" based on ring… i like to supply modules under the modules/ directory as jars or .clj files … these clj files should be compiled when accessed first time

11:32 chouser: rbe: .clj files are always compiled into memory before being run. You're sure that's not good enough? you want the compilation saved to disk as well?

11:34 rbe: chouser: i like to keep the opportunity to have .class files (maybe for distribution)

11:34 chouser: i just replaced (compile) with (require) and it works, but i really like to understand why *compile-path* was set and worked at REPL but not at runtime

11:35 chouser: ok. then you just need to make sure that *compile-path* is bound to the directory where you want those .class files dumped when you call compile

11:36 rbe: chouser: when i use (set!) or (def) clojure 1.2.0 complains about that… if i accept the default "classes" it throws the exception java.lang.Exception: *compile-path* not set

11:36 chouser: so.. what am i missing?

11:37 chouser: (binding [*compile-path* "classes"] (compile ...))

11:37 rbe: *duh*

11:37 thanks a lot

11:37 chouser: the repl does that for you. if you start your program outside of the repl, you have to do it yourself.

11:37 actually, the repl uss (System/getProperty "clojure.compile.path" "classes")

11:38 rbe: thx

11:38 chouser: np

11:39 rbe: with my actual solution to use (require) … what is the difference?

11:39 chouser: require doesn't call compile

11:39 no .class files will be written

11:39 rbe: ah I just checked the dirs… I see

11:54 polypus: best way to get integer part of a float or ration, i.e 1.3 -> 1 ?

11:54 ratio*

11:58 nachtalp: polypus: quot maybe?

11:59 polypus: nachtalp: ty

12:01 nachtalp: :)

14:43 jfields: is it idiomatic to name an arg you aren't planning to use _ ?

14:43 I thought I saw that somewhere, but I didn't see it in the style guide (maybe I missed it?)

14:45 serp_: yup

14:45 according to Programming Clojure it is

14:46 chouser: yes it is

14:46 rbxbx: that's idiomatic of FP, and programming in general, to some extent.

14:47 chouser: scala uses _ to mean other specific things

14:47 rbxbx: oh true, it's used as args for anonymous functions, right?

14:48 similar to % ?

14:48 chouser: probably ought to be in the coding standards doc.

14:48 rbxbx: yeah I think so. but each _ means the next arg I think, so _ _ _ where clojure uses %1 %2 %3

14:48 rbxbx: *nod*

14:58 Anyone had luck bootstrapping a compojure 0.4.0 app? I queried #compojure, but I believe they're all asleep.

15:02 arohner: rbxbx: what do you mean bootstrapping?

15:02 rbxbx: just installing deps, at this point.

15:02 it's choking on the commons-codec jar and jetty.

15:03 http://gist.github.com/461745

15:03 arohner: rbxbx: compojure-0.4.0-RC3 worked for me, I haven't tried the official release yet

15:04 rbxbx: but those jars are in my lib/, so I guess lein found them at some point

15:04 rbxbx: that failed in similar fashion.

15:05 I have them in the projects lib directory as well

15:05 hm.

15:05 robert@rbxbx-3:~/dev/clomodoro(master+)$ ls lib/

15:05 clojure-contrib.jar commons-io-1.4.jar jetty-util-6.1.15.jar

15:05 clojure.jar grizzly-http-servlet-1.9.10.jar servlet-api-2.5-20081211.jar

15:05 commons-codec-1.4.jar grizzly-http-webserver-1.9.10.jar

15:05 commons-fileupload-1.2.1.jar jetty-6.1.15.jar

15:05 eck, that didn't format nicely at all. sorry.

15:07 oh well, shall continue pushing forth. thanks :)

15:07 arohner: rbxbx: yeah, sorry I'm not more help. one thing you can try is downloading those manually and putting them in lib

15:08 though it's also weird that lein wants to d/l them again. Maybe the MD5s don't match?

15:08 rbxbx: perhaps!

15:08 arohner: lein typically only downloads artifacts once, unless they're snapshot versions

15:08 rbxbx: my lein/maven/java-ecosystem experience is pretty limited, so I wouldn't be surprised if it was something obvious.

15:09 they should be in the individual project's lib directory, correct?

15:09 arohner: rbxbx: yes

15:18 bobo_: what did someone mean by "arg's your not planning to use"?

15:18 then why have them?

15:18 *confused*

15:19 rbxbx: if in destructuring something you pulled out additional params, but you weren't concerned with one of them, you might call it _

15:19 there're better examples, but I'm at a loss for the moment.

15:19 it comes up often enough though.

15:20 bobo_: hm, ok

15:20 chouser: or if you're fitting your function to some given interface, so the caller is going to pass you something you don't need.

15:20 ,(map (fn [[_ v]] (inc v)) {:a 1 :b 2 :c 3})

15:20 clojurebot: (2 3 4)

15:22 rbxbx: that's probably a more common example.

15:26 chouser: well, that's actually desctructuring there. :-)

15:31 bobo_: ok, i think i somewhat got it. thnx :-)

16:10 arohner: if I were to play with one of rhickey's numeric branches, which would be the best?

16:10 rhickey: arohner: equiv

16:10 arohner: rhickey: thanks!

16:22 cemerick: rhickey: any thoughts on that case-related snafu I posted to the dev list?

16:23 hiredman: what should the hash code for nil be then?

16:27 rhickey: hiredman: it is 0

16:30 cemerick: I'm not sure with fallbacks that case will be much better than cond, which is your alternative when hashcodes collide

16:32 cemerick: rhickey: people shouldn't have to care about hashcodes

16:32 rhickey: cemerick: they can avoid case then

16:32 cemerick: the overwhelmingly common case will be that hashcodes will be distinct

16:33 oh, that's not right -- surely the use of hashcodes is an impl detail of case, not part of its semantics

16:34 rhickey: :) yes, of course, but that's how it is right now. It could include branching logic on dupe, but much more work. Patch welcome

16:35 cemerick: heh

16:35 I was waiting for it :-)

16:36 rhickey: you could probably handle the dupes on the macro side before entering the perfect hashing code and Java-side logic

16:39 puredanger: we have a defrecord2 now that creates a constructor function for you (that takes a field map) and also support for printing records in a reader-friendly form

16:39 anyone interested in this work?

16:40 we're finding it very helpful in working with record-heavy code

16:40 cemerick: rhickey: I wonder if, for now, special-casing 0 and nil makes sense, as other collisions will be remarkably uncommon.

16:41 puredanger: cemerick: it's actually pretty easy to get collisions with small string values too

16:41 rhickey: cemerick: no interest in special casing, the hash clash was reported almost immediately with another case

16:42 cemerick: nm, then

16:42 puredanger: that doesn't make me feel so great. Lots of linked lists in those hashtables, eh?

16:43 puredanger: cemerick: not sure if you mean what I think you mean but that's unlikely to be an issue in our usage

16:44 cemerick: or are you talking about the hashcodes? (I was thinking records)

16:47 cemerick: puredanger: yes, I was referring to hashmaps using small strings as keys.

16:47 Interesting first search result: http://www.drmaciver.com/2008/07/javalangstringhashcode/

16:48 comparing badly with .NET's String .hashCode

16:48 puredanger: cemerick: I actually ran into a subtle bug in some ASM code once that was exposed based on some short enumerated constant field names

19:19 raek: is [& {:keys [a b]}] destructuring the ideomatic way of doing named arguments in clojure 1.2?

19:24 tomoj: yeah

19:24 there are more options available though

19:30 hmm

19:30 $((fn [& {:keys [a b] :as opts :or {b 3}}] [a b opts]) :c 2 :a 4)

19:30 sexpbot: => [4 3 {:a 4, :c 2}]

19:31 tomoj: so :or provides default values for bindings but doesn't change what :at sees

19:31 does anyone else think that should be changed?

20:44 jasapp: I'm horribly confused.

20:44 Could someone point me towards the most recent way to setup slime, and clojure?

20:45 One that doesn't require maven, or ant.

20:45 tomoj: no

20:45 well, someone probably can

20:45 do you mean that you don't want to use maven at all?

20:45 or just that you don't want to write maven xml?

20:46 jasapp: most of the time, I'm not working with a project, and I just want to play at the repl.

20:46 tomoj: oh

20:46 then yeah, you shouldn't need maven

20:46 jasapp: I liked the method of just doing M-x slime, and a repl appeared.

20:46 tomoj: do you have slime already installed?

20:46 jasapp: I have the latest version from git

20:47 tomoj: well, I can't help you then

20:47 there is an easy way to get set up if you use only the slime from elpa

20:47 I dunno how to do it if you want your own slime, surely someone around here does though

20:48 jasapp: let me grab elpa real quick, and get slime that way

20:49 tomoj: delete your other slime, then

20:49 I was actually just working on some instructions

20:49 but they're not done yet

20:50 jasapp: :-/

20:50 I use my other slime with sbcl

20:51 slyrus: jasapp: I have a similar setup, but don't have time to go into it right now.

20:51 catch me later and I'll walk you through it

20:51 jasapp: Ok

20:53 for the mean time, I've just installed elpa, and removed my version of slime

20:57 arkh: are the items in a vector called "elements"?

20:57 jasapp: sorry, what's the easy way with elpa?

20:58 polypus: or elephants: [:elephant :elephant :elephant]

20:58 :)

22:11 bortreb: If I write two java files that are mutually dependent, I can send them both to javac and the compiler will "take care of it" Is there any way to achieve this effect with a mutually dependent .java and .clj file?

22:16 tomoj: jasapp: well..

22:16 it used to work for me

22:16 now today I'm getting an error from "M-x slime"

22:16 jasapp: heh

22:16 I don't remember this being so complicated.

22:17 tomoj: try installing clojure-mode and slime-repl from elpa

22:18 jasapp: I did, I've been trying to get that working for the last hour.

22:18 I think it's time for a beer, that usually helps with stuff like this.

22:19 tomoj: do you get the "Searching for program: no such file or directory, lisp" error?

22:19 jasapp: yes

22:19 tomoj: wonder if there was a version bump recently

22:20 could've sworn that used to work for me

22:20 jasapp: I found some instructions on using both sbcl, and clojure, so I'm trying those now.

22:20 cemerick: bortreb: mutually circular dependencies are not automagically resolved by the clojure compiler, no.

22:21 somnium: simple lisp reader in ~100 lines (with reader-macros and quasiquote)

22:21 http://gist.github.com/462218

22:21 <3 monads

22:22 cemerick: nice

22:22 bortreb: yes, you can't directly do it, but I was wondering if there was any way to take two mutually dependent java files, rewrite one in clojure, and get the darn thing to compile

22:22 cemerick: somnium: 'course, the hard part is doing it from a bootstrapping context ;-)

22:23 bortreb: I'm trying to port Jake2 to clojure :)

22:23 somnium: cemerick: true, but this is going to js :)

22:23 KirinDave: I saw something today that made me so glad I have Clojure to focus on for server and scripting dev

22:23 http://sayspy.blogspot.com/2010/07/two-types-of-people-who-cause-biggest.html

22:23 This guy is a “voice of reason” for python. h8.

22:25 cemerick: bortreb: if you can produce interfaces for both classes, and genericize the respective usages, then you can make it happen

22:25 Then you late-bind the implementation of each via static init on either side (via a require in the java side, and an eval'ed import on the clojure side)

22:26 gnarly, but doable

22:27 bortreb: cool

22:28 or just replace the other java file with clojure too :)

23:30 herdrick: swank-clojure question:

23:30 benatkin: is there a simple way to list the methods in a Java class from the repl?

23:30 herdrick: do you still use swank-clojure-extra-vm-args ? or is that obsolete?

23:30 for example, (setq swank-clojure-extra-vm-args (list "-server" "-Xmx1000M"))

23:31 is what one used to use to set the Java heap space

23:33 aedon: benatkin: look at show from clojure.contrib.repl-utils

23:37 tomoj: herdrick: how are you starting swank?

23:38 herdrick: tomoj: lein swank

23:38 oh, i suppose that's where i need to make a change

23:39 tomoj: yep

23:41 it seems like the only way with leiningen is to use JAVA_OPTS

Logging service provided by n01se.net