Optimize .addComponent?

2011-06-23 Thread Antonio Recio
I would like to use only one time .addComponent and don't repeat it each time that I need to add something. How I can do it? Perhaps with doto? Are there other way? It is possible to optimize it more? (defn -init [this] (let [app this] (.setMainWindow this (doto (Window. Test

Re: Optimize .addComponent?

2011-06-23 Thread Laurent PETIT
If your code does not grow beyond what you show us, it seems like a good compromise. If you want to be more DRY, here's my take: (defn add-components! [composite components] (doseq [component components] (.addComponent composite component))) (defn -init [this] (let [app this]

Re: Optimize .addComponent?

2011-06-23 Thread Antonio Recio
I obtain an error: javax.servlet.ServletException: java.lang.IllegalArgumentException: Wrong number of args (3) passed to: vapp$add-components-BANG- java.lang.IllegalArgumentException: Wrong number of args (3) passed to: vapp$add-components-BANG- -- You received this message because you are

Re: Optimize .addComponent?

2011-06-23 Thread Laurent PETIT
oops, def of add-components should read (defn add-components! [composite components] of course ... 2011/6/23 Laurent PETIT laurent.pe...@gmail.com: If your code does not grow beyond what you show us, it seems like a good compromise. If you want to be more DRY, here's my take: (defn

Re: Screencast: Clojure + Emacs + slime + swank + cake + Overtone

2011-06-23 Thread lambdatronic
Lee, You're just making a simple typo. To get the REPL to switch to the source file's namespace, you have several options: 1) With the point in the source file, press C-c M-p ENTER 2) With the point in the REPL, type ,in ENTER overtoneproject.core ENTER 3) With the point in the REPL,

Re: Screencast: Clojure + Emacs + slime + swank + cake + Overtone

2011-06-23 Thread Lee Spector
Thanks so much, Gary. The quoting error is something that I should have seen but didn't :-(, and the two other methods are also great to know about. I'm still having no luck getting load to find things, but I suspect that that is a similarly basic mistake... -Lee On Jun 23, 2011, at 10:08

getMethods

2011-06-23 Thread Antonio Recio
I have found a function to get the methods of the classes in the book The Joy of Clojure, and I would like to use it in REPL. Instead of java.awt.Frame I would like to specify the library that I want writing something like (methods any.library). Which is the way to get it? (for [method (seq

Re: Radically simplified Emacs and SLIME setup

2011-06-23 Thread gaz jones
this is really great, thanks for putting this together. i have a (possibly daft) question -- is there a neat way to kill/restart the underlying process. i have looked for a *ahem* clojure-jack-off function or equivalent but couldnt find one in the source. i am just killing it from the terminal at

Re: Radically simplified Emacs and SLIME setup

2011-06-23 Thread Sam Ritchie
This should do the trick, though I'm not set up with jack-in to test: At the REPL, type comma (the character ,), then sayoonara. On Thu, Jun 23, 2011 at 11:20 AM, gaz jones gareth.e.jo...@gmail.comwrote: this is really great, thanks for putting this together. i have a (possibly daft)

Re: getMethods

2011-06-23 Thread Michael Wood
On 23 June 2011 17:04, Antonio Recio amdx6...@gmail.com wrote: I have found a function to get the methods of the classes in the book The Joy of Clojure, and I would like to use it in REPL. Instead of java.awt.Frame I would like to specify the library that I want writing something like (methods

Re: ANN: Hafni

2011-06-23 Thread Dave Ray
Hi, This looks pretty cool. I'd love to see a larger example of how you'd apply arrows to managing UI state. From my limited understanding, functions are arrows, but arrows are not functions. The examples you give fall pretty much in the functions are arrows camp, meaning that the code could be

Re: Radically simplified Emacs and SLIME setup

2011-06-23 Thread gaz jones
awesome, it works. many thanks :D i clearly need to read the slime manual On Thu, Jun 23, 2011 at 10:24 AM, Sam Ritchie sritchi...@gmail.com wrote: This should do the trick, though I'm not set up with jack-in to test: At the REPL, type comma (the character ,), then sayoonara. On Thu, Jun 23,

Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread B Smith-Mannschott
user (name 'a/b/c) c user (namespace 'a/b/c) a/b Is this intentional? I would have expected a/b/c to be rejected as a symbol name since we use slashes to separate namespace from name and conventionally use . to indicate hierarchy in namespace names. // Ben -- You received this message because

Workers

2011-06-23 Thread Dave Ray
Hi there, I'm playing with a little problem (calculating pi) that is trivially parallelizable in that I can easily break the calculation up into a bunch of chunks, send them off to workers and gather the results back together. The one additional requirement I have is that I'd like the process to

Re: getMethods

2011-06-23 Thread Stuart Halloway
I have found a function to get the methods of the classes in the book The Joy of Clojure, and I would like to use it in REPL. Instead of java.awt.Frame I would like to specify the library that I want writing something like (methods any.library). Which is the way to get it? (for [method (seq

Re: Radically simplified Emacs and SLIME setup

2011-06-23 Thread Phil Hagelberg
Sam Ritchie sritchi...@gmail.com writes: This should do the trick, though I'm not set up with jack-in to test: At the REPL, type comma (the character ,), then sayoonara. You can also just kill the *swank* buffer. -Phil -- You received this message because you are subscribed to the Google

Re: Generating API docs for clojure 1.3 projects

2011-06-23 Thread Tassilo Horn
Shantanu Kumar kumar.shant...@gmail.com writes: Hi! Autodoc is superb! However having run into dependency issues with Autodoc myself, I think it would be cool if you can specify Clojure and Contrib JARs as only dev-dependencies so that they don't clash with the ones the user depends on too.

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Ken Wesson
On Thu, Jun 23, 2011 at 11:55 AM, B Smith-Mannschott bsmith.o...@gmail.com wrote: user (name 'a/b/c) c user (namespace 'a/b/c) a/b Is this intentional? I would have expected a/b/c to be rejected as a symbol name since we use slashes to separate namespace from name and conventionally use .

Conversion of one java example to clojure?

2011-06-23 Thread Antonio Recio
I have tried to translate an example of vaadin in java to clojure. But I get errors. This is the java code: Panel panel = new Panel(Split Panels Inside This Panel); HorizontalSplitPanel hsplit = new HorizontalSplitPanel(); panel.setContent(hsplit); Tree tree = new Tree(Menu,

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread B Smith-Mannschott
On Thu, Jun 23, 2011 at 18:48, Ken Wesson kwess...@gmail.com wrote: On Thu, Jun 23, 2011 at 11:55 AM, B Smith-Mannschott bsmith.o...@gmail.com wrote: user (name 'a/b/c) c user (namespace 'a/b/c) a/b Is this intentional? I would have expected a/b/c to be rejected as a symbol name since we

Re: Conversion of one java example to clojure?

2011-06-23 Thread Ambrose Bonnaire-Sergeant
What is the Java source for setting up the Window object? Ambrose On Fri, Jun 24, 2011 at 1:24 AM, Antonio Recio amdx6...@gmail.com wrote: I have tried to translate an example of vaadin in java to clojure. But I get errors. This is the java code: Panel panel = new Panel(Split Panels Inside

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Stuart Halloway
My question probably should have been: is it intentional that the Clojure reader accepts symbol names containing more than one slash, producing a namespace portion of the symbol containing slashes in its name? The docs (http://clojure.org/reader) are specific: '/' has special meaning, it

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Sean Corfield
On Thu, Jun 23, 2011 at 10:40 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: The docs (http://clojure.org/reader) are specific: '/' has special meaning, it can be used once in the middle of a symbol to separate the namespace from the name, e.g. my-namespace/foo. '/' by itself names the

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Ken Wesson
On Thu, Jun 23, 2011 at 1:48 PM, Sean Corfield seancorfi...@gmail.com wrote: The docs say what '/ means (by itself) and what 'a/b means (used once - we'll put aside the imprecision of in the middle of a symbol) I think that's fairly clear: that the portions of the symbol to each side of the /

Re: Conversion of one java example to clojure?

2011-06-23 Thread Ambrose Bonnaire-Sergeant
Does Window's add() method take multiple arguments? It looks like you're passing 4 arguments to it. Also (tree Tree. Menu) should be (tree (Tree. Menu)) Same with (vsplit VerticalSplitPanel. (add (Label. upper panel) (Button. lower panel Could you post the

Re: Conversion of one java example to clojure?

2011-06-23 Thread Antonio Recio
There are not window in the java code, anyway I have added it in the clojure code (could be deleted). The window java code could be something like this: setMainWindow(new Window(Test application)); -- You received this message because you are subscribed to the Google Groups Clojure group. To

[ANN] Clojure 1.3 Beta 1

2011-06-23 Thread Chris Redinger
Clojure 1.3 Beta 1 is now available at http://clojure.org/downloads All of you that were waiting for the official beta, now's your chance to start using it! We look forward to your feedback. Here are the list of changes: 0 Changes from 1.3 Alpha 7 to 1.3 Beta 1 1 Changes from 1.3 Alpha 7 to

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread B Smith-Mannschott
On Thu, Jun 23, 2011 at 19:48, Sean Corfield seancorfi...@gmail.com wrote: On Thu, Jun 23, 2011 at 10:40 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: The docs (http://clojure.org/reader) are specific: '/' has special meaning, it can be used once in the middle of a symbol to separate

Re: Conversion of one java example to clojure?

2011-06-23 Thread Mark Rathwell
It looks like you may also be thinking that you are creating local bindings in the 'add' call, but you actually need to create those bindings in a let. Also,'app' is bound to 'this' but never used. I think something like this may be closer to what you are trying to do: (defn -init [this] (let

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Ken Wesson
On Thu, Jun 23, 2011 at 2:47 PM, B Smith-Mannschott bsmith.o...@gmail.com wrote: On Thu, Jun 23, 2011 at 20:20, Ken Wesson kwess...@gmail.com wrote: On Thu, Jun 23, 2011 at 1:48 PM, Sean Corfield seancorfi...@gmail.com wrote: The docs say what '/ means (by itself) and what 'a/b means (used

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Stuart Halloway
On Thu, Jun 23, 2011 at 10:40 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: The docs (http://clojure.org/reader) are specific: '/' has special meaning, it can be used once in the middle of a symbol to separate the namespace from the name, e.g. my-namespace/foo. '/' by itself names the

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Sean Corfield
On Thu, Jun 23, 2011 at 11:20 AM, Ken Wesson kwess...@gmail.com wrote: On Thu, Jun 23, 2011 at 1:48 PM, Sean Corfield seancorfi...@gmail.com wrote: The docs say what '/ means (by itself) and what 'a/b means (used once - we'll put aside the imprecision of in the middle of a symbol) I think

Re: Conversion of one java example to clojure?

2011-06-23 Thread Antonio Recio
Before I have forgotten to post the source of the function add (https://groups.google.com/d/topic/clojure/N1wmlOrGYj0/discussion): (defn add [composite components] Avoid repetition of .addComponent Instead of (doto (Window. \foo\) (.addComponent (Label. \bar\)) (.addComponent (Button.

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Ken Wesson
On Thu, Jun 23, 2011 at 3:29 PM, Sean Corfield seancorfi...@gmail.com wrote: On Thu, Jun 23, 2011 at 11:20 AM, Ken Wesson kwess...@gmail.com wrote: On Thu, Jun 23, 2011 at 1:48 PM, Sean Corfield seancorfi...@gmail.com wrote: The docs say what '/ means (by itself) and what 'a/b means (used

Complement to clojure survey

2011-06-23 Thread Milton Silva
As suggested by Chas Emerick here: http://cemerick.com/2011/06/15/the-2011-state-of-clojure-survey-is-open/#comments I've created the following survey: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dFFJTTZWT2lXR1N1dTJTWk5mdjZXZlE6MQ -- You received this message because you are

Freelance Friday @MadLab Every Friday!

2011-06-23 Thread Natalie Whittaker
Title: Freelance Friday in July Location: MadLab Description: Bring together the Manchester freelance community. Start Time: 10:00 Date: Every Friday End Time: 17:00 Are you free on Fridays? …. if you are come along to our Freelance Friday. The doors are open to anyone who is looking for a space

Re: Complement to clojure survey

2011-06-23 Thread Aaron Bedra
On 06/23/2011 04:22 PM, Milton Silva wrote: As suggested by Chas Emerick here: http://cemerick.com/2011/06/15/the-2011-state-of-clojure-survey-is-open/#comments I've created the following survey: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dFFJTTZWT2lXR1N1dTJTWk5mdjZXZlE6MQ

Re: Complement to clojure survey

2011-06-23 Thread Milton Silva
done ;) btw, why do you find it useful to use more than one? or is it a necessity? On Jun 23, 9:44 pm, Aaron Bedra aaron.be...@gmail.com wrote: On 06/23/2011 04:22 PM, Milton Silva wrote: As suggested by  Chas Emerick here:

Re: Complement to clojure survey

2011-06-23 Thread Aaron Bedra
I start with Leiningen because it is simple. I end up on Maven when Leiningen can't provide what I need. This list includes but is not limited to: * Projects that have multiple local project dependencies, all in the build chain * Projects that have native (JNI) code that need to be built

Re: Complement to clojure survey

2011-06-23 Thread Phil Hagelberg
Aaron Bedra aaron.be...@gmail.com writes: I start with Leiningen because it is simple. I end up on Maven when Leiningen can't provide what I need. This list includes but is not limited to: * Projects that have multiple local project dependencies, all in the build chain Have you looked

setting the classpath in cake+slime (was Re: Screencast: Clojure + Emacs + slime + swank + cake + Overtone)

2011-06-23 Thread Lee Spector
I wrote (below) about being unable to get load to work from the slime repl after completing the emacs/cake/swank/slime setup that Sam presented in helpful video. Now I think it's a more general problem of not setting the classpath correctly. If I try to :use something in the ns form in a

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Sean Corfield
On Thu, Jun 23, 2011 at 1:04 PM, Ken Wesson kwess...@gmail.com wrote: Both of them. But the context of that phrase originally was used once in the middle of a symbol, so it was referring to symbols with only one /. Which is the whole point: the docs ascribe meaning to a/b and to / but do not

Re: Complement to clojure survey

2011-06-23 Thread Aaron Bedra
On 06/23/2011 05:56 PM, Phil Hagelberg wrote: Aaron Bedraaaron.be...@gmail.com writes: I start with Leiningen because it is simple. I end up on Maven when Leiningen can't provide what I need. This list includes but is not limited to: * Projects that have multiple local project

Re: Conversion of one java example to clojure?

2011-06-23 Thread .Bill Smith
Why is brownFox a function instead of a string constant? -- 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

Re: Complement to clojure survey

2011-06-23 Thread Phil Hagelberg
Aaron Bedra aaron.be...@gmail.com writes: Hah; I have been looking for people to test the new native deps support in Leiningen for weeks. Where have you been? =) My native deps problem is the one that I replied to on the list when you asked for help. It is not just including a native dep,

Re: Complement to clojure survey

2011-06-23 Thread Aaron Bedra
On 06/23/2011 11:25 PM, Phil Hagelberg wrote: Aaron Bedraaaron.be...@gmail.com writes: Hah; I have been looking for people to test the new native deps support in Leiningen for weeks. Where have you been? =) My native deps problem is the one that I replied to on the list when you asked for

Re: Can the namespace portion of a symbol contain slashes?

2011-06-23 Thread Ken Wesson
On Thu, Jun 23, 2011 at 7:59 PM, Sean Corfield seancorfi...@gmail.com wrote: On Thu, Jun 23, 2011 at 1:04 PM, Ken Wesson kwess...@gmail.com wrote: Both of them. But the context of that phrase originally was used once in the middle of a symbol, so it was referring to symbols with only one /.