Re: Question about lein swank and emacs

2010-10-26 Thread David Jagoe
On 26 October 2010 04:36, Mark Engelberg mark.engelb...@gmail.com wrote: When I do restart-inferior-lisp, it says, no inferior lisp process. Yeah, that'll only work if you originally started swank from emacs as the inferior lisp process. If you're doing 'lein swank' on the command line it won't

c.c.monads z Clojure 1.3.0-alpha2

2010-10-26 Thread Jacek Laskowski
Hi, I suppose I should be using appropriate version of clojure-contrib for Clojure 1.3.0-alpha2 as 1.2 gives me CNFE upon loading c.c.monads. Clojure 1.3.0-alpha2 user= (use 'clojure.contrib.monads) CompilerException java.lang.ClassNotFoundException: clojure.set,

Re: Images in autodoc?

2010-10-26 Thread Tom Faulhaber
It's on the roadmap. I haven't really figured out a way to do it that fits in with other uses of doc strings. I do know that I want the images to be able to be embedded in the doc string so that programs like incanter can use the image as part of the narrative, but I want the markup that does it

Clojure performance on shootout

2010-10-26 Thread Marko Kocić
Clojure has recently been added to http://shootout.alioth.debian.org/ benchmarks. I know there are a lot of objections and excuses about this benchmark, but that is defacto go to place when talking about language implementation performance. The problems is that performance is not that great as it

Re: Clojure performance on shootout

2010-10-26 Thread nicolas.o...@gmail.com
Maybe optimizing now is a bit early, as a lot of the performance caracteristics of clojure programs will change with 1.3. Might be better to start writing programs that will be fast with 1.3. On Tue, Oct 26, 2010 at 9:46 AM, Marko Kocić marko.ko...@gmail.com wrote: Clojure has recently been

Re: Clojure performance on shootout

2010-10-26 Thread Santosh Rajan
Here is another speed comparison. Of note is that there is another jvm based lisp dialect kawa. http://per.bothner.com/blog/2010/Kawa-in-shootout/ On Tue, Oct 26, 2010 at 2:16 PM, Marko Kocić marko.ko...@gmail.com wrote: Clojure has recently been added to http://shootout.alioth.debian.org/

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 3:50 AM, Tom Faulhaber tomfaulha...@gmail.com wrote: It's on the roadmap. I haven't really figured out a way to do it that fits in with other uses of doc strings. I do know that I want the images to be able to be embedded in the doc string so that programs like

Re: Images in autodoc?

2010-10-26 Thread Chris
On Oct 26, 3:50 am, Tom Faulhaber tomfaulha...@gmail.com wrote: I do know that I want the images to be able to be embedded in the doc string so that programs like incanter can use the image as part of the narrative, but I want the markup that does it to feel natural to readers who aren't

Re: Clojure performance on shootout

2010-10-26 Thread B Smith-Mannschott
On Tue, Oct 26, 2010 at 11:27, Santosh Rajan santra...@gmail.com wrote: Here is another speed comparison. Of note is that there is another jvm based lisp dialect kawa. http://per.bothner.com/blog/2010/Kawa-in-shootout/ Yes, this one is interesting. Might not figuring out what Kawa is doing

Re: Clojure performance on shootout

2010-10-26 Thread Stuart Halloway
The 1.3 release for Clojure aims for parity with Java performance, with less explicit optimization and hinting than required in 1.2 (or in Java). It would be great to have people in the community share the effort of writing and testing benchmarks, and to facilitate this I have created a

Re: Clojure performance on shootout

2010-10-26 Thread Marko Kocić
It would be very good if 1.3 delivers on its goal, and it is nice to see that performance is important to the core team. Here's the quick test on binarytrees benchmark that I submitted to the shootout. It is not optimized at all, besides eliminating reflection warnings. On my box results for

Re: Clojure performance on shootout

2010-10-26 Thread Meikel Brandmeyer
Hi, On 26 Okt., 13:17, Stuart Halloway stuart.hallo...@gmail.com wrote: As an aside: You will not be able to just run benchmarks carefully tuned for 1.2 under 1.3 and get best performance, as some of the performance tricks are now counter-indicated. Is there some documentation how tuning

Re: Getting this error regarding duck-streams/spit ...

2010-10-26 Thread Dave Ray
Hey. Until this message, I hadn't noticed that duck-streams was deprecated. Is the stuff in clojure.java.io the official replacement for that functionality? So now rather than duck-streams/read-lines, I'd manually combine with-open, clojure.java.io/reader, and line-seq? Just checking. Thanks,

Re: Images in autodoc?

2010-10-26 Thread Chris
Come to think of it, it might be cool to write doc strings in a kind of Clojure-flavored Markdown... that'd give us images, links, lists, formatting, etc. It's also got the benefit of being a familiar format, and easy to read in unprocessed form. Chris On Oct 26, 6:05 am, Chris

Re: Getting this error regarding duck-streams/spit ...

2010-10-26 Thread Sean Devlin
The stuff in Clojure.java.io would be the preferred tool, yes. However, if contrib has something that solves your problem, go ahead and use it. Be careful though, because contrib is much more likely to change than something officially in core. On Oct 26, 8:51 am, Dave Ray dave...@gmail.com

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 9:27 AM, Chris christopher.ma...@gmail.com wrote: Come to think of it, it might be cool to write doc strings in a kind of Clojure-flavored Markdown... that'd give us images, links, lists, formatting, etc.  It's also got the benefit of being a familiar format, and easy

Re: Images in autodoc?

2010-10-26 Thread Chris
On Oct 26, 9:54 am, Andrew Gwozdziewycz apg...@gmail.com wrote: I like that idea, especially if it could be extended to reference other code: Agreed. So now that's links to images, web pages, Clojure vars... anything else? Chris -- You received this message because you are subscribed to the

Detecting More than one matching method

2010-10-26 Thread Maks Romih
Hi! I stumbled on a difference of behavior in using a variable vs. let binding. It may even be a bug in Clojure. Using Java 1.6 and Clojure 1.1 or 1.2, if you execute the following code code (import 'javax.xml.crypto.dsig.XMLSignatureFactory 'javax.xml.crypto.dsig.Transform) (def fac

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 10:30 AM, Chris christopher.ma...@gmail.com wrote: On Oct 26, 9:54 am, Andrew Gwozdziewycz apg...@gmail.com wrote: I like that idea, especially if it could be extended to reference other code: Agreed.  So now that's links to images, web pages, Clojure vars... anything

Re: Images in autodoc?

2010-10-26 Thread Eric Schulte
Chris christopher.ma...@gmail.com writes: On Oct 26, 9:54 am, Andrew Gwozdziewycz apg...@gmail.com wrote: I like that idea, especially if it could be extended to reference other code: Agreed. So now that's links to images, web pages, Clojure vars... anything else? LaTeX equations. Which

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 12:21 PM, Eric Schulte schulte.e...@gmail.com wrote: Chris christopher.ma...@gmail.com writes: On Oct 26, 9:54 am, Andrew Gwozdziewycz apg...@gmail.com wrote: I like that idea, especially if it could be extended to reference other code: Agreed.  So now that's links

Re: Question about lein swank and emacs

2010-10-26 Thread Drew Raines
David Jagoe wrote: On 26 October 2010 04:36, Mark Engelberg mark.engelb...@gmail.com wrote: When I do restart-inferior-lisp, it says, no inferior lisp process. Yeah, that'll only work if you originally started swank from emacs as the inferior lisp process. If you're doing 'lein swank' on the

Re: Images in autodoc?

2010-10-26 Thread Tom Faulhaber
Nah, changing the autodoc generation is easy (though we need to figure out where images go on the input and output sides and move them around, but that shouldn't be too much of a problem). The bigger problem is figuring out what to tell folks who type (doc foo) at the REPL and get a bunch of

ANN: A clojure port of the compiler

2010-10-26 Thread Juha Arpiainen
Hello group! I've been working on a clojure port of the clojure compiler and have just reached a good point to announce the project: the compiler can now compile its own source code and a substantial part of clojure/ core.clj. The code is hosted at http://github.com/jarpiain/cljc and some

Re: Question about lein swank and emacs

2010-10-26 Thread Drew Raines
For some reason I missed the original slime-connect mention. In that case, David's right that there isn't any way apart from TERMing the lein swank process. When I start swank that way I do it within an Emacs shell so that I only have to switch buffers to restart. -Drew On Tue, Oct 26, 2010

Re: Question about lein swank and emacs

2010-10-26 Thread Mark Engelberg
I'm confused. Is there a better way to get a REPL going in Emacs other than lein swank from a command line combined with M-x slime-connect in Emacs? On Tue, Oct 26, 2010 at 10:28 AM, Drew Raines aarai...@gmail.com wrote: For some reason I missed the original slime-connect mention.  In that

Re: Wildcards on multimethod matching

2010-10-26 Thread Paul Gearon
On Sat, Oct 23, 2010 at 5:16 PM, Paul Richards paul.richa...@gmail.com wrote: Hi, I have a multimethod which is dispatched on two arguments: (defmulti bar (fn [x y] [x y])) (defmethod bar [1 2] ..) (defmethod bar [3 4] ..) Is there a way I can define methods on this which use wildcards?

Re: Images in autodoc?

2010-10-26 Thread Chris Maier
On Tue, Oct 26, 2010 at 1:08 PM, Tom Faulhaber tomfaulha...@gmail.com wrote: The bigger problem is figuring out what to tell folks who type (doc foo) at the REPL and get a bunch of gobbledegook back. That's the thing that's been making me look for a better format than markdown. (Autodoc

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 2:06 PM, Chris Maier christopher.ma...@gmail.com wrote: On Tue, Oct 26, 2010 at 1:08 PM, Tom Faulhaber tomfaulha...@gmail.com wrote: The bigger problem is figuring out what to tell folks who type (doc foo) at the REPL and get a bunch of gobbledegook back. That's the

Re: First function

2010-10-26 Thread Brody Berg
Thanks for all the excellent, concise advice! For code and idiomatic improvements, from these messages I have the following - For order 1 access use vector - Use subvectors for efficient partitioning - Case/compare is concise, powerful and readable - Use seq idiom to proceed or

Re: Images in autodoc?

2010-10-26 Thread Timo Mihaljov
On Tue, Oct 26, 2010 at 02:15:21PM -0400, Andrew Gwozdziewycz wrote: Areas likely to include gobbledegook: [...] 2. links (internal. for external links, just use fully qualified URI) Internal links could be easily handled by trying to resolve all `code blocks` with ns-resolve in the namespace

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 4:44 PM, Timo Mihaljov noid@gmail.com wrote: On Tue, Oct 26, 2010 at 02:15:21PM -0400, Andrew Gwozdziewycz wrote: Areas likely to include gobbledegook: [...] 2. links (internal. for external links, just use fully qualified URI) Internal links could be easily

Re: Question about lein swank and emacs

2010-10-26 Thread Mark Engelberg
So what steps do you need to go through so that M-x lein-swank works? (When I type that, nothing happens). On Tue, Oct 26, 2010 at 1:17 PM, Drew Raines aarai...@gmail.com wrote: It's subjective.  I like M-x lein-swank because it retains control of the swank process as an inferior-lisp, which

Re: Images in autodoc?

2010-10-26 Thread Chris Maier
On Tue, Oct 26, 2010 at 4:44 PM, Timo Mihaljov noid@gmail.com wrote: If you wanted to get real fancy, you could even check if the code block is a list, and then resolve each symbol inside the list, so that, for example, resolve's docstring would look like this at the REPL: user= (doc

clojure-contrib 1.3.0-alpha2 deployed to build.clojure.org

2010-10-26 Thread Stuart Sierra
blah -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to

Odds for tail calls in JVM

2010-10-26 Thread Aravindh Johendran
John Rose of Oracle has posted a very articulate message on the chances of having tail calls in the JVM. http://mail.openjdk.java.net/pipermail/mlvm-dev/2010-October/002016.html I feel pessimistic about the chances. I doubt tail calls will be a priority for Oracle and IBM. I don't even see it

Re: Odds for tail calls in JVM

2010-10-26 Thread Aravindh Johendran
Sorry, forgot to post the link discussing upcoming jdk features: http://blogs.sun.com/mr/entry/plan_b_details -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new

Re: Question about lein swank and emacs

2010-10-26 Thread Drew Raines
Mark Engelberg wrote: So what steps do you need to go through so that M-x lein-swank works? (When I type that, nothing happens). Oh. I forgot that's not part of lein proper. Phil posted some code earlier this year that binds a process started by `lein swank` to a *lein-swank* buffer.

challenge with vectors

2010-10-26 Thread Glen Rubin
I have a sequence like this: [ [a b] [a b] [a b] [a b] ] where a and b are numbers. I would like to return the vector and its index for which b is the least in this collection. For example, if my data is as follows [ [22 5] [56 8] [99 3] [43 76] ] I would like to return 3rd vector in the

Re: challenge with vectors

2010-10-26 Thread Stuart Campbell
On 27 October 2010 12:54, Glen Rubin rubing...@gmail.com wrote: I have a sequence like this: [ [a b] [a b] [a b] [a b] ] where a and b are numbers. I would like to return the vector and its index for which b is the least in this collection. For example, if my data is as follows [ [22

Re: challenge with vectors

2010-10-26 Thread Btsai
Is it ok if the index starts at 0? (use '[clojure.contrib.seq :only (indexed)]) (defn get-min-and-index [coll] (apply min-key #(second (second %)) (indexed coll))) user= (get-min-and-index [[22 5] [56 8] [99 3] [43 76]]) [2 [99 3]] On Oct 26, 7:54 pm, Glen Rubin rubing...@gmail.com wrote: I

Re: clojure-contrib 1.3.0-alpha2 deployed to build.clojure.org

2010-10-26 Thread Btsai
Is there still a complete jar somewhere that has all the modules? If so, I can't seem to find it. Or is that a thing of the past now? On Oct 26, 6:03 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: blah -- You received this message because you are subscribed to the Google Groups Clojure

Re: Odds for tail calls in JVM

2010-10-26 Thread Tom Marble
On 10/26/2010 07:34 PM, Aravindh Johendran wrote: John Rose of Oracle has posted a very articulate message on the chances of having tail calls in the JVM. http://mail.openjdk.java.net/pipermail/mlvm-dev/2010-October/002016.html I feel pessimistic about the chances. I doubt tail calls will be

Re: challenge with vectors

2010-10-26 Thread Aravindh Johendran
What kind of an answer are you looking for? Just the quickest way to do it? Do you want an idiomatic clojure solution or are you learning functional programming using clojure? There are many ways to do this. Others have provided cool solutions. Here's a way of doing it if you are interested in

a function to list the namespaces that a namespace refers to ...

2010-10-26 Thread Sunil S Nandihalli
Hello everybody, I currently do the following to find a set of namespaces that a namespace refers to (- 'clojure.contrib.monads ns-refers (map #(- % second meta :ns ns-name)) set) It is not that it is very hard but .. an inbuilt function might be better .. or even better is if somebody just