#clojure logs

2010-07-02

00:01ysphwould it be possible/worthwhile to implement Haskell style type declarations for clojure fns?
00:02hiredmanmeh
00:03hiredmanclojure is a dynamic language
00:03qbgPossible? Probably
00:04qbgWhy would you want to?
00:06ysphwell, 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
00:07ysphand enforcing it as a contract for using the function gives you a heads up when you're doing something stupid
00:08hiredmanclojurebot: deft?
00:08clojurebotdeft is http://gist.github.com/128259
00:11ysphhiredman: thanks, i'll play around with that, looks interesting
00:15hiredmanysph: meh
00:17ysphit 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?
00:17yspha 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
00:18ysphs/or/of
00:19tomojI'd like to see an attractive statically typed lisp
00:20ysphthere is a typed scheme
00:21qbgFrom reading the docs on Typed Racket, it looks okay until you get to the interesting stuff...
00:22qbgFor example, the type signature for map
00:24ysphyes, that is ugly
00:28RaynesHaskell people just cannot stand things without type declarations.
00:30Raynesysph: 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.
00:31RaynesThat said, I do enjoy Haskell's type declarations.
00:32RaynesMostly 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.
00:39ysphi'm hoping that most of the fear of dynamic typing is really a fear of loose typing
00:43tomoj"you can tell what a function does by its type signature" is freakin awesome
00:44tomojhoogle practically writes your programs for you
00:44hiredmanwhy?
00:44clojurebothttp://clojure.org/rationale
00:44hiredman^-
00:49rubydiamondHi guys ..I installed sbcl with homebrew on my mac
00:49rubydiamondget this error 'can't find core file at /usr/local/lib/sbcl//sbcl.core
00:49rubydiamond'
00:49rubydiamondfor running sbcl..
00:49hiredmanI'd suggest you try #lisp
00:50rubydiamondhiredman: M-x slime gives me No such file/directory found lisp
00:53hiredmanI meant the irc channel
00:53hiredmanthis is #clojure, which is not common lisp
01:00slyrusrubydiamond: what hiredman said. there are usually at least one or two sbcl developers hanging around #lisp.
01:05rubydiamondslyrus: okay
01:35thunkRad! Agast!
01:35hiredmanhttps://twitter.com/technomancy/status/17538042860
01:40thunkAquaman! You go ... talk to some fish!
01:40thunkhttp://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=23456906
03:11rubydiamondNeed help in starting up swank-clojure
03:13rubydiamondhow to install maven-clojure-plugin in maven
03:20rubydiamondhelp me
03:21LauJensenMorning all
03:26tomojrubydiamond: hello
03:26rubydiamondtomoj: hey
03:26rubydiamondI have git cloned swank-clojure
03:26tomojdon't bother
03:26rubydiamondnow how to run the server
03:27tomojunless you want to run the very latest?
03:27tomoj1.2.1 isn't bad
03:27rubydiamondtomoj: okay.. but basically I don't know how to run the swank-clojure server
03:27tomojright, hang on
03:27rubydiamondhttp://github.com/technomancy/swank-clojure
03:27tomojgotta fetch my example pom from my other computer
03:27tomojyou have maven installed already?
03:28rubydiamondtomoj: yes
03:31rubydiamondtomoj: I also don't know how to install maven-clojure-plugin in maven
03:32tomojsorry
03:32tomojworking on an example but I just got a new computer so everything is not set up yet
03:32tomojtook me forever to figure out how to get gist.el to work after I screwed up the auth info
03:32tomojhttps://gist.github.com/df9986f7b9aff72e71cb
03:33tomojoh except 1.3.1 is the newest version looks like of clojure-maven-plugin
03:33tomojbut put that in your project root, fix it up with your info
03:34tomojput your clojure source files in ./src/main/clojure/com/example/foo.clj
03:34tomoj`mvn clojure:swank` to start the swank server
03:34rubydiamondtomoj: where to put that pom.xml
03:34tomojin the root of your project
03:35tomoje.g. ~/code/clojure/foo-project/pom.xml might have ~/code/clojure/foo-project/src/main/clojure/com/example/foo.clj
03:35rubydiamondtomoj: I just created mkdir clojure-proj
03:36rubydiamondshould i put pom.xml in it
03:36tomojsure
03:36tomojnew to *nix?
03:36rubydiamondtomoj: not new to unix.. but don't know much about maven
03:37tomojgood luck
03:37tomojyou can get a long way with just `mvn clojure:swank8
03:38rubydiamondlooks like it's downloading lots of files for `mvn clojure:swank`
03:38rubydiamondtomoj: should I wait till downloads finishes
03:39tomojyep
03:39rubydiamondtomoj: got an error :( https://gist.github.com/6ae464a51a9089c50c45
03:41rubydiamondtomoj: any idea?
03:41dr_benwayhello 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?
03:42rubydiamondtomoj: you there?
03:42tomojuhh
03:42tomojgist your pom.xml
03:42tomojdid you just use mine without changing it?
03:43hoeckdr_benway: I guess the idiomatic way is to use (into #{} my-seq)
03:44rubydiamondtomoj: yep
03:44rubydiamondtomoj: https://gist.github.com/9c7d3f3e3aadb5fbefc7
03:44dr_benwayhoeck: oh cool - i was assuming that would put the sequence itself in the set. much better: thanks!
03:45tomojwell, that doesn't make sense
03:45tomojooh
03:45tomojI suppose it does
03:45rubydiamondtomoj: ?
03:45tomojI tried it and it worked for me
03:45tomojbut this could be because I had used leiningen earlier today
03:45tomojso I already have those jars
03:46tomojtrying again
03:46rubydiamondtomoj: nice
03:46tomojit worked again
03:47rubydiamondtomoj: :(
03:47rubydiamondtomoj: I have only pom.xml in my project
03:47rubydiamondno other file
03:47rubydiamondis it beacause of it
03:47tomojno, that works for me too
03:48tomojit downloads clojure, contrib, swank-clojure, and clojure-maven-plugin
03:48tomojyou didn't change my pom.xml at all?
03:48rubydiamondtomoj: nope
03:48tomojare you on a linux?
03:48rubydiamondtomoj: I am on mac
03:48tomojI don't know why it would make a difference
03:48tomojgist `mvn -v`
03:49rubydiamondtomoj: here is the whole log https://gist.github.com/6f5f6543fad66dbe9fa9
03:49rubydiamondtomoj: doing
03:49rubydiamondtomoj: it said Can't find Apache
03:50tomojhuh
03:50tomojgist whatever the output of `mvn -v` is
03:50tomojoh
03:50tomojdon't type the ``
03:50tomojmvn -v
03:50rubydiamondtomoj: https://gist.github.com/a548f55c7fe71d3db506
03:51tomojwell, I have maven 2.2.1
03:52tomojsame java version
03:52tomojI don't know how that could cause this
03:52rubydiamondtomoj: so basically maven is not able to find repositories of clojures right?
03:52tomojhmm, weird
03:53tomojhttp://clojars.org/repo/org/clojure redirects to http://build.clojure.org/releases/org/clojure/
03:53tomojwhere snapshots are not to be found
03:54tomojhow come I can still download them???
03:54rubydiamondtomoj: changing the url to http://build.clojure.org/releases/
03:55rubydiamondsame error
03:55tomojmy logs say downloading http://clojars.org/repo//org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-20100623.220259-87.pom
03:55tomojbut that's a 404
03:55tomojvery odd
03:55rubydiamondtomoj: it must be picking those from your local repo
03:56tomojI deleted them, though
03:56tomojmaybe there is a cache somewhere
03:56rubydiamondtomoj: is there any alternative for above repo path
03:56tomojI'm trying to figure out what's going on
03:56tomojthe snapshots must have moved
03:59tomojmaybe 1.2.0 is being released?
04:00rubydiamondtomoj: hmm
04:03tomojhmm
04:03tomoj1.2 milestone is dated yesterday
04:03tomojbut there are still open tickets
04:03rubydiamondtomoj: does it mean that there is bug in maven i have
04:04tomojI don't think so
04:06rubydiamondshould I remove master in 1.2.0-master-SNAPSHOT
04:06tomojwon't help I believe
04:06tomojtry changing the version for clojure-maven-plugin to 1.3.3
04:07rubydiamondokay
04:07rubydiamondsame error
04:07tomojmy logs still say they're downloading a file that gives me a 404 in the browser
04:09tomojgist the output of `mvn help:effective-pom`
04:10tomojanyway, I know how to fix this I think
04:10tomojI'm just puzzled that it still works for me
04:13tomojrubydiamond: https://gist.github.com/875abdebfad975244775
04:13tomojtry that pom
04:16cais2002hi, anybody used the clojure-twitter packge?
04:18mikemcais2002: i'm playing with it
04:19cais2002mikem, great! did u build it using ant or lein?
04:19mikemlein
04:19cais2002any changes to the codes required?
04:20mikemcais2002: yeah, i actually do have some modifications
04:20mikemlet me put them on github... give me a few minutes
04:21cschreinerRegarding naming conventions in Clojure: Is there something obvious I should look at, except existing sourcecode?
04:21tomojhttp://www.assembla.com/wiki/show/clojure/Clojure_Library_Coding_Standards is somewhat helpful
04:22cschreinerI am primarily thinking about names of params
04:22cschreinertomoj: having a look
04:23rubydiamondtomoj: trying it
04:23tomojin one of the books there was a little table with some more idiomatic variable names listed I believe
04:24cschreinertomoj: yeah, that was very helpful!
04:24cschreiner(the assembla link)
04:28rubydiamondtomoj: Connection opened on local port 4005
04:28cschreinerWhen we are talking about the nameing convention coll, is this for map as well?
04:28rubydiamondtomoj: thanks it worked..
04:28tomojcool
04:28cschreinerlike Coll => map, vectors, lists etc?
04:28tomojmaps are colls, but..
04:28tomoj"m" is often used for maps
04:28cschreineris it okay to prepend m like m-stuff ?
04:29tomojm-stuff seems quite strange to me
04:29tomojbut I am not a stylistic expert
04:29cschreinerI want to communicate that I am using a map
04:29cschreinerI guess m should be enough, stating the rest in the docstring
04:30tomojhungarian notation is rare
04:30LauJensencschreiner: And what is the map containing?
04:31Chousukeif it's "any map" then m or map (if you don't need the function) is fine
04:31tomojyes, if it's not just a map, it probably has a better name
04:32cschreinerLauJensen: It contains columns for a css table
04:32LauJensenok, so something like column-map would be my pick
04:33tomojoh, yes, *-map seems much less strange
04:33cschreinerit really helps using eldoc to have a somewhat verbose sign
04:35cschreineranyway, thanks for your input
04:36tomojhuh, assoc steals 'map
04:43LauJensentomoj: Is that giving you problems?
04:48tomojnope
04:48tomojthe only problems it could create would be for assoc itself
05:00LauJensenYea, which is why I was wondering why you brought it up
05:04tomojsurprising
05:04tomojI would've expected 'm
05:04tomojjust a gut reaction against shadowing
06:20dr_benwayhey, can someone explain the difference between :when and :when in e.g. a for loop?
06:20dr_benwayoops, :when and :while, sorry
06:27mikemdr_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)
06:28dr_benwayok, so :while should be more efficient for things like (for [a (range 100) b (range 100) :while (< b a)] ...)
06:30mikemyeah, then the loop stops the first time (< b a) is false
06:30mikemdr_benway: http://pastebin.com/xRYAp8j0
06:31BahmanHi all!
06:32dr_benwaymikem: gotcha - thanks
07:39dabdI 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?
07:53AWizzArdUh, Google bought ITA
07:53AWizzArdThis means that Google is now the biggest Lisp employer in the world.
07:53LauJensenConversion to Python, here we go!
09:47DeusExPikachuis 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)))
09:50chouserDeusExPikachu: you can use clojure.lang.Reflector
09:50DeusExPikachuchouser, short example please?
09:50chouseractually, if it's a no-arg ctor, you can use newInstance
09:51chouser,(let [c java.util.Date] (.newInstance c))
09:51clojurebot#<Date Fri Jul 02 06:59:43 PDT 2010>
09:51DeusExPikachuah, newInstance the method
09:53DeusExPikachucool and if there are args?
09:53chouserthen you need either Reflector or eval
09:55chouser,(clojure.lang.Reflector/invokeConstructor Integer (to-array ["45"]))
09:55clojurebot45
09:55DeusExPikachuk, 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
09:58chouseractually, classes created by reify that are closures will have ctor args for all the things they close over
09:58chouserbut if you're creating instances with reify, why would you need some other way (like .newInstance) to make instances anyway?
09:59DeusExPikachuchouser, lets say you're given an instance from reify from someone else's code
09:59DeusExPikachuand you want to make a new instance, that's all
09:59chouserI don't see how you could do that sensibly.
10:00chouserunless you promise that instance implements some particular interface for making new instances.
10:00chouserlike a .clone method or something
10:17digashnow 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:20thorstadti don't know; it seems to me that promise fulfills a role in deterministic computation
10:21thorstadtif something happens that would result in a promise not being delivered, perhaps you should use an agent instead
10:21thorstadt*something could happen ...
10:23digashagent 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:24digashi did use agents but the state was useless to it and future macro is much more succinct
10:25chouserI've certainly used a hacked-together deref-with-timeout on either future or promise, I forget which.
10:26digash(when-not (deref (future (long-computation)) 10) (throw (Exception. "timeout")))
10:26chouseryou can poll using 'future-done?' :-/
10:26chouseractually, you can use .get with a timeout, looks like.
10:27digashyes, that is what i am doing, but it leaks future abstraction
10:28chouserjava.util.concurrent.Future is a documented interface
10:28digash,(doc future)
10:28clojurebot"([& 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:28digashdoes not mention it
10:28chouserif future's docstring stated that the thing it returns implemented j.u.c.Future, would that satisfy you?
10:30digashit is a solution, but i would prefer some kind of deref or await-for on clojure side
10:30smclarnonis there a simple way to provide a noop proxy for an interface (without implement all of the methods)?
10:30digashit seems like a common pattern to me and the .get usage looks ugly because it brings in timeunit
10:31digash(.get init 30 (java.util.concurrent.TimeUnit/SECONDS)
10:31thorstadtwould be nice to have actors, eh?
10:32digashthorstadt: i am not sure how actors will help more than agents already do in this case.
10:33thorstadtwell, you mentioned that the statefulness of agents bothered you
10:33arohnersmclarnon: I think you'd just have to do (proxy TheClass (foo [] ) (bar []) (baz []))
10:34arohnersmclarnon: if it's a pain, you can probably write a function to do it for you
10:36smclarnonarohner: yeah, its a pain, was curious if someone had already written that function to make it easier :)
10:36digashthere 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:36arohnersmclarnon: not that I'm aware of
10:36chousersmclarnon: you want the default method impls to return nil instead of throwing an exception?
10:37digashjust found this http://bit.ly/dB9z8P somebody actually wrote a blog about it
10:41smclarnonchouser: 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:41smclarnoner, changed
10:58rbxbxDear 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:59chousersmclarnon: you may be able to use init-proxy to provide a collection for which all values are fns that return nil
11:00rbxbx" (λ x . x)
11:00rbxbxjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Character (NO_SOURCE_FILE:0)
11:00rbxbx"
11:12rbehi
11:12rbeI am trying to use (compile) at runtime and I get the following exception: java.lang.Exception: *compile-path* not set
11:14rbeAt the REPL everything is fine… I try to dynamically call functions from a namespace included at runtime.
11:17rbeI included classes/ in my classpath...
11:20rbe,(+ 1 1)
11:20clojurebot2
11:25rbe(doc compile)
11:25clojurebot"([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:25chousersmclarnon: http://gist.github.com/461507
11:29chouserrbxbx: I don't understand what you're asking.
11:30chouserrbe: you're trying to create new .class files at runtime? creating a build tool or something?
11:31rbechouser: 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:32chouserrbe: .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:34rbechouser: i like to keep the opportunity to have .class files (maybe for distribution)
11:34rbechouser: 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:35chouserok. 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:36rbechouser: 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:36rbechouser: so.. what am i missing?
11:37chouser(binding [*compile-path* "classes"] (compile ...))
11:37rbe*duh*
11:37rbethanks a lot
11:37chouserthe repl does that for you. if you start your program outside of the repl, you have to do it yourself.
11:37chouseractually, the repl uss (System/getProperty "clojure.compile.path" "classes")
11:38rbethx
11:38chousernp
11:39rbewith my actual solution to use (require) … what is the difference?
11:39chouserrequire doesn't call compile
11:39chouserno .class files will be written
11:39rbeah I just checked the dirs… I see
11:54polypusbest way to get integer part of a float or ration, i.e 1.3 -> 1 ?
11:54polypusratio*
11:58nachtalp polypus: quot maybe?
11:59polypusnachtalp: ty
12:01nachtalp:)
14:43jfieldsis it idiomatic to name an arg you aren't planning to use _ ?
14:43jfieldsI thought I saw that somewhere, but I didn't see it in the style guide (maybe I missed it?)
14:45serp_yup
14:45serp_according to Programming Clojure it is
14:46chouseryes it is
14:46rbxbxthat's idiomatic of FP, and programming in general, to some extent.
14:47chouserscala uses _ to mean other specific things
14:47rbxbxoh true, it's used as args for anonymous functions, right?
14:48rbxbxsimilar to % ?
14:48chouserprobably ought to be in the coding standards doc.
14:48chouserrbxbx: yeah I think so. but each _ means the next arg I think, so _ _ _ where clojure uses %1 %2 %3
14:48rbxbx*nod*
14:58rbxbxAnyone had luck bootstrapping a compojure 0.4.0 app? I queried #compojure, but I believe they're all asleep.
15:02arohnerrbxbx: what do you mean bootstrapping?
15:02rbxbxjust installing deps, at this point.
15:02rbxbxit's choking on the commons-codec jar and jetty.
15:03rbxbxhttp://gist.github.com/461745
15:03arohnerrbxbx: compojure-0.4.0-RC3 worked for me, I haven't tried the official release yet
15:04arohnerrbxbx: but those jars are in my lib/, so I guess lein found them at some point
15:04rbxbxthat failed in similar fashion.
15:05rbxbxI have them in the projects lib directory as well
15:05rbxbxhm.
15:05rbxbxrobert@rbxbx-3:~/dev/clomodoro(master+)$ ls lib/
15:05rbxbxclojure-contrib.jar commons-io-1.4.jar jetty-util-6.1.15.jar
15:05rbxbxclojure.jar grizzly-http-servlet-1.9.10.jar servlet-api-2.5-20081211.jar
15:05rbxbxcommons-codec-1.4.jar grizzly-http-webserver-1.9.10.jar
15:05rbxbxcommons-fileupload-1.2.1.jar jetty-6.1.15.jar
15:05rbxbxeck, that didn't format nicely at all. sorry.
15:07rbxbxoh well, shall continue pushing forth. thanks :)
15:07arohnerrbxbx: yeah, sorry I'm not more help. one thing you can try is downloading those manually and putting them in lib
15:08arohnerthough it's also weird that lein wants to d/l them again. Maybe the MD5s don't match?
15:08rbxbxperhaps!
15:08arohnerlein typically only downloads artifacts once, unless they're snapshot versions
15:08rbxbxmy lein/maven/java-ecosystem experience is pretty limited, so I wouldn't be surprised if it was something obvious.
15:09rbxbxthey should be in the individual project's lib directory, correct?
15:09arohnerrbxbx: yes
15:18bobo_what did someone mean by "arg's your not planning to use"?
15:18bobo_then why have them?
15:18bobo_*confused*
15:19rbxbxif in destructuring something you pulled out additional params, but you weren't concerned with one of them, you might call it _
15:19rbxbxthere're better examples, but I'm at a loss for the moment.
15:19rbxbxit comes up often enough though.
15:20bobo_hm, ok
15:20chouseror if you're fitting your function to some given interface, so the caller is going to pass you something you don't need.
15:20chouser,(map (fn [[_ v]] (inc v)) {:a 1 :b 2 :c 3})
15:20clojurebot(2 3 4)
15:22rbxbxthat's probably a more common example.
15:26chouserwell, that's actually desctructuring there. :-)
15:31bobo_ok, i think i somewhat got it. thnx :-)
16:10arohnerif I were to play with one of rhickey's numeric branches, which would be the best?
16:10rhickeyarohner: equiv
16:10arohnerrhickey: thanks!
16:22cemerickrhickey: any thoughts on that case-related snafu I posted to the dev list?
16:23hiredmanwhat should the hash code for nil be then?
16:27rhickeyhiredman: it is 0
16:30rhickeycemerick: I'm not sure with fallbacks that case will be much better than cond, which is your alternative when hashcodes collide
16:32cemerickrhickey: people shouldn't have to care about hashcodes
16:32rhickeycemerick: they can avoid case then
16:32cemerickthe overwhelmingly common case will be that hashcodes will be distinct
16:33cemerickoh, that's not right -- surely the use of hashcodes is an impl detail of case, not part of its semantics
16:34rhickey:) 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:35cemerickheh
16:35cemerickI was waiting for it :-)
16:36rhickeyyou could probably handle the dupes on the macro side before entering the perfect hashing code and Java-side logic
16:39puredangerwe 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:39puredangeranyone interested in this work?
16:40puredangerwe're finding it very helpful in working with record-heavy code
16:40cemerickrhickey: I wonder if, for now, special-casing 0 and nil makes sense, as other collisions will be remarkably uncommon.
16:41puredangercemerick: it's actually pretty easy to get collisions with small string values too
16:41rhickeycemerick: no interest in special casing, the hash clash was reported almost immediately with another case
16:42cemericknm, then
16:42cemerickpuredanger: that doesn't make me feel so great. Lots of linked lists in those hashtables, eh?
16:43puredangercemerick: not sure if you mean what I think you mean but that's unlikely to be an issue in our usage
16:44puredangercemerick: or are you talking about the hashcodes? (I was thinking records)
16:47cemerickpuredanger: yes, I was referring to hashmaps using small strings as keys.
16:47cemerickInteresting first search result: http://www.drmaciver.com/2008/07/javalangstringhashcode/
16:48cemerickcomparing badly with .NET's String .hashCode
16:48puredangercemerick: I actually ran into a subtle bug in some ASM code once that was exposed based on some short enumerated constant field names
19:19raekis [& {:keys [a b]}] destructuring the ideomatic way of doing named arguments in clojure 1.2?
19:24tomojyeah
19:24tomojthere are more options available though
19:30tomojhmm
19:30tomoj$((fn [& {:keys [a b] :as opts :or {b 3}}] [a b opts]) :c 2 :a 4)
19:30sexpbot=> [4 3 {:a 4, :c 2}]
19:31tomojso :or provides default values for bindings but doesn't change what :at sees
19:31tomojdoes anyone else think that should be changed?
20:44jasappI'm horribly confused.
20:44jasappCould someone point me towards the most recent way to setup slime, and clojure?
20:45jasappOne that doesn't require maven, or ant.
20:45tomojno
20:45tomojwell, someone probably can
20:45tomojdo you mean that you don't want to use maven at all?
20:45tomojor just that you don't want to write maven xml?
20:46jasappmost of the time, I'm not working with a project, and I just want to play at the repl.
20:46tomojoh
20:46tomojthen yeah, you shouldn't need maven
20:46jasappI liked the method of just doing M-x slime, and a repl appeared.
20:46tomojdo you have slime already installed?
20:46jasappI have the latest version from git
20:47tomojwell, I can't help you then
20:47tomojthere is an easy way to get set up if you use only the slime from elpa
20:47tomojI dunno how to do it if you want your own slime, surely someone around here does though
20:48jasapplet me grab elpa real quick, and get slime that way
20:49tomojdelete your other slime, then
20:49tomojI was actually just working on some instructions
20:49tomojbut they're not done yet
20:50jasapp:-/
20:50jasappI use my other slime with sbcl
20:51slyrusjasapp: I have a similar setup, but don't have time to go into it right now.
20:51slyruscatch me later and I'll walk you through it
20:51jasappOk
20:53jasappfor the mean time, I've just installed elpa, and removed my version of slime
20:57arkhare the items in a vector called "elements"?
20:57jasappsorry, what's the easy way with elpa?
20:58polypusor elephants: [:elephant :elephant :elephant]
20:58polypus:)
22:11bortrebIf 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:16tomojjasapp: well..
22:16tomojit used to work for me
22:16tomojnow today I'm getting an error from "M-x slime"
22:16jasappheh
22:16jasappI don't remember this being so complicated.
22:17tomojtry installing clojure-mode and slime-repl from elpa
22:18jasappI did, I've been trying to get that working for the last hour.
22:18jasappI think it's time for a beer, that usually helps with stuff like this.
22:19tomojdo you get the "Searching for program: no such file or directory, lisp" error?
22:19jasappyes
22:19tomojwonder if there was a version bump recently
22:20tomojcould've sworn that used to work for me
22:20jasappI found some instructions on using both sbcl, and clojure, so I'm trying those now.
22:20cemerickbortreb: mutually circular dependencies are not automagically resolved by the clojure compiler, no.
22:21somniumsimple lisp reader in ~100 lines (with reader-macros and quasiquote)
22:21somniumhttp://gist.github.com/462218
22:21somnium<3 monads
22:22cemericknice
22:22bortrebyes, 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:22cemericksomnium: 'course, the hard part is doing it from a bootstrapping context ;-)
22:23bortrebI'm trying to port Jake2 to clojure :)
22:23somniumcemerick: true, but this is going to js :)
22:23KirinDaveI saw something today that made me so glad I have Clojure to focus on for server and scripting dev
22:23KirinDavehttp://sayspy.blogspot.com/2010/07/two-types-of-people-who-cause-biggest.html
22:23KirinDaveThis guy is a “voice of reason” for python. h8.
22:25cemerickbortreb: if you can produce interfaces for both classes, and genericize the respective usages, then you can make it happen
22:25cemerickThen 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:26cemerickgnarly, but doable
22:27bortrebcool
22:28bortrebor just replace the other java file with clojure too :)
23:30herdrickswank-clojure question:
23:30benatkinis there a simple way to list the methods in a Java class from the repl?
23:30herdrickdo you still use swank-clojure-extra-vm-args ? or is that obsolete?
23:30herdrickfor example, (setq swank-clojure-extra-vm-args (list "-server" "-Xmx1000M"))
23:31herdrickis what one used to use to set the Java heap space
23:33aedonbenatkin: look at show from clojure.contrib.repl-utils
23:37tomojherdrick: how are you starting swank?
23:38herdricktomoj: lein swank
23:38herdrickoh, i suppose that's where i need to make a change
23:39tomojyep
23:41tomojit seems like the only way with leiningen is to use JAVA_OPTS