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

2010-10-26 Thread Btsai
Awesome! Thanks for the great work, Tom :) clojuredocs has quickly become my go-to reference source. On Oct 26, 11:46 pm, Tom Faulhaber wrote: > You remind me that I need to markhttp://richhickey.github.com/clojure... > as obsolete and redirect users to the new place. > > Zack Kim and I are wor

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

2010-10-26 Thread Jacek Laskowski
On Wed, Oct 27, 2010 at 4:37 AM, Btsai wrote: > 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? s/complete/standalone :-) I believe it's http://build.clojure.org/releases/org/clojure/contrib/standalone/1.3

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

2010-10-26 Thread Tom Faulhaber
You remind me that I need to mark http://richhickey.github.com/clojure... as obsolete and redirect users to the new place. Zack Kim and I are working to have clojuredocs pull data from the autodoc system and, at that point, I assume that he'll add deprecation info over there as well. Sorry for an

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

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 f

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 wil

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 wrote: > blah -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

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 wrote: > I have a sequence l

Re: challenge with vectors

2010-10-26 Thread Stuart Campbell
On 27 October 2010 12:54, Glen Rubin 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 5] [56 8] [

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 coll

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.

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 membe

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 ment

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

Re: Images in autodoc?

2010-10-26 Thread Chris Maier
> On Tue, Oct 26, 2010 at 4:44 PM, Timo Mihaljov 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 resolve

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 wrote: > It's subjective.  I like M-x lein-swank because it retains control of > the swank process as an inferior-lisp, which lets you do things

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 4:44 PM, Timo Mihaljov 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 handled by tryi

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 namespac

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 return

Re: Question about lein swank and emacs

2010-10-26 Thread Drew Raines
Mark Engelberg wrote: > 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? It's subjective. I like M-x lein-swank because it retains control of the swank process as an inferior-lisp, which le

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

2010-10-26 Thread Btsai
I'm fairly positive duck-streams is deprecated, as it is no longer present in the clojure-contrib git repository: http://github.com/clojure/clojure-contrib/tree/master/modules/ http://richhickey.github.com/clojure-contrib/ doesn't have the deprecation info most likely because it is the documentat

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

2010-10-26 Thread Victor Olteanu
Thank you Btsai. I checked both http://richhickey.github.com/clojure-contrib/io-api.html#clojure.contrib.io/spit and http://clojuredocs.org/clojure_contrib/clojure.contrib.duck-streams/slurp* and couldn't find any reference to deprecation. If you can confirm that this deprecation was made "official

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 2:06 PM, Chris Maier wrote: > On Tue, Oct 26, 2010 at 1:08 PM, Tom Faulhaber 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

Re: Images in autodoc?

2010-10-26 Thread Chris Maier
On Tue, Oct 26, 2010 at 1:08 PM, Tom Faulhaber 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 already does markdown tra

Re: Wildcards on multimethod matching

2010-10-26 Thread Paul Gearon
On Sat, Oct 23, 2010 at 5:16 PM, Paul Richards 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"? What about som

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 wrote: > For some reason I missed the original slime-connect mention.  In that > case, David's righ

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 a

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 informat

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 gobbl

Re: Question about lein swank and emacs

2010-10-26 Thread Drew Raines
David Jagoe wrote: > On 26 October 2010 04:36, Mark Engelberg 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 i

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 12:21 PM, Eric Schulte wrote: > Chris writes: > >> On Oct 26, 9:54 am, Andrew Gwozdziewycz 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 el

Re: Images in autodoc?

2010-10-26 Thread Eric Schulte
Chris writes: > On Oct 26, 9:54 am, Andrew Gwozdziewycz 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 are increasingly easy to render in HT

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 10:30 AM, Chris wrote: > On Oct 26, 9:54 am, Andrew Gwozdziewycz 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? Well, if the markdown generator

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 (import 'javax.xml.crypto.dsig.XMLSignatureFactory 'javax.xml.crypto.dsig.Transform) (def fac (XMLSignatur

Re: Images in autodoc?

2010-10-26 Thread Chris
On Oct 26, 9:54 am, Andrew Gwozdziewycz 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 Google Groups "C

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 9:27 AM, Chris 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 to read in unprocessed

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 wrote: > Hey. > > Until

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 wrote: > On Oc

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: Clojure performance on shootout

2010-10-26 Thread Meikel Brandmeyer
Hi, On 26 Okt., 13:17, Stuart Halloway 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 against 1.3 works? I got

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 "binar

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 top-leve

Re: Clojure performance on shootout

2010-10-26 Thread B Smith-Mannschott
On Tue, Oct 26, 2010 at 11:27, Santosh Rajan 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 differently yield so

Re: Images in autodoc?

2010-10-26 Thread Chris
On Oct 26, 3:50 am, Tom Faulhaber 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 seeing the image. May

Re: Images in autodoc?

2010-10-26 Thread Andrew Gwozdziewycz
On Tue, Oct 26, 2010 at 3:50 AM, Tom Faulhaber 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 incanter can use the

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ć wrote: > Clojure has recently been added to http://shootout.alioth.debian.org/ > benchmarks. I know ther

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ć wrote: > Clojure has recently been added to http://shootout

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: 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 i

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, compiling:(clojure/contrib/accum