Re: New release of the enclojure plugin is up.

2009-04-06 Thread Michael Wood
On Tue, Apr 7, 2009 at 7:45 AM, billh04 wrote: > > I downloaded and installed NetBeans and the Enclojure plugin. > > I am not clear on how to setup the "main" class. > > I modified the "main" class generated by the template to look like the > following: > > = > (defn -

Re: New release of the enclojure plugin is up.

2009-04-06 Thread billh04
I downloaded and installed NetBeans and the Enclojure plugin. I am not clear on how to setup the "main" class. I modified the "main" class generated by the template to look like the following: = (defn -main ([args] (startNewAchiTask)) ([ ] (-main nil))) ===

Re: ANN: Pretty printer is now part of contrib

2009-04-06 Thread Laurent PETIT
Hi, 2009/4/6 Tom Faulhaber > Another question is whether we should duplicate the classes and > the .clj files in the jar or should we just compile all of them. Is > there some value to having the source there? There certainly some value for both scenario : having classes seems an absolute req

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread samppi
In addition, it's a bad idea to have these two superficially similar functions have the same name, "file". If, in the end, both are to be kept public, then I think they should at least be given different names. On Apr 6, 10:35 am, Victor Rodriguez wrote: > Hello, > > On Mon, Apr 6, 2009 at 10:06

Re: clojure + android

2009-04-06 Thread Onorio Catenacci
On Apr 6, 12:28 pm, Nick Levine wrote: > Apologies for what might be multiple postings. Looks like google > swallowed the first one without chewing. > > I've been trying to get clojure +androidgoing but without much > success. In case it's relevant, I'm on Windows (XP) and the java > version is 1

Re: clojure + android

2009-04-06 Thread Onorio Catenacci
On Apr 6, 12:28 pm, Nick Levine wrote: > Apologies for what might be multiple postings. Looks like google > swallowed the first one without chewing. > > I've been trying to get clojure + android going but without much > success. In case it's relevant, I'm on Windows (XP) and the java > version is

New release of the enclojure plugin is up.

2009-04-06 Thread Eric Thorsen
There is a new release of the Enclojure plugin that addresses many of the items I have seen discuss here recently with regards to managing classpaths in REPLs as well as many other Clojure development scenarios. The plugin supports several use cases for the clojure.main REPL use: a. Project based

Re: keyword and /

2009-04-06 Thread Andrew Rimes
On 6-Apr-09, at 6:22 PM, Stephen C. Gilardi wrote: > The call to keyword here: > > user=> (:the/key {(keyword "the" "key") "the val"}) > "the val" > > creates a keyword whose namespace part is "the" and whose name part > is "key" just like :the/key. > > Does this accomplish what yo

Re: keyword and /

2009-04-06 Thread Stephen C. Gilardi
The call to keyword here: user=> (:the/key {(keyword "the" "key") "the val"}) "the val" creates a keyword whose namespace part is "the" and whose name part is "key" just like :the/key. Does this accomplish what you're after or are you specifically requesting that (keyword "

keyword and /

2009-04-06 Thread Andrew Rimes
Hello, This tripped me up today: user=> (:the/key { :the/key "the val"}) ; ok "the val" user=> (:the/key { (keyword "the/key") "the val"}) ; returns nil? nil Shouldn't both return "the val"? Thanks, Andrew --~--~-~--~~~---~--~~ You received this message becau

clojure + android

2009-04-06 Thread Nick Levine
Apologies for what might be multiple postings. Looks like google swallowed the first one without chewing. I've been trying to get clojure + android going but without much success. In case it's relevant, I'm on Windows (XP) and the java version is 1.6.0_13. I followed http://riddell.us/tutorial/a

Re: Clojure, Android and Emacs on Ubuntu tutorials

2009-04-06 Thread Nick Levine
I've been trying to get Clojure/Android up and running today. The pure java example in http://riddell.us/tutorial/android/android.html works fine. I tried the "hello world" example as in http://riddell.us/tutorial/clojure_android/clojure_android.html and get the following message from the emulat

Experiments in unit testing

2009-04-06 Thread James Reeves
Hi folks, A while ago I started writing a unit testing library called Fact that was a cross between Haskell's QuickCheck, and Ruby's RSpec. I've done a lot of work with it, and some people might conceivably be interested in how I got on with it, so this post is to chart what I found whilst playin

Re: Simple dosync/alter question

2009-04-06 Thread David Sletten
On Apr 6, 2009, at 9:02 AM, bgray wrote: > > I have a some what (I believe) easy question. Could someone let me > know what I'm doing wrong? A simplified version of what I'm trying to > do looks like this: > > user=> (def foo (ref 0)) > #'user/foo > user=> (defn square [x] (* x x)) > #'user/sq

Re: ANN: Pretty printer is now part of contrib

2009-04-06 Thread Tom Faulhaber
There are a bunch of things in the build file that "do nothing without complaining" when clojure.jar isn't set. I didn't want to make a radical change to the build file with this checkin but I didn't want users to not get the pretty printer and wonder why either. More generally, I think we need

Re: Simple dosync/alter question

2009-04-06 Thread David Nolen
I think what you want is: (def foo (ref 0)) (defn square [x] (* x x)) (defn square-ref [x] (dosync (ref-set foo (square x (square-ref 2) On Mon, Apr 6, 2009 at 3:02 PM, bgray wrote: > > I have a some what (I believe) easy question. Could someone let me > know what I'm doing wrong? A simpli

Re: Simple dosync/alter question

2009-04-06 Thread Paul Stadig
Alter expects a function that take the current value of the ref it will alter as the first arg. I think what you want to do is ref-set. user=> (doc alter) - clojure.core/alter ([ref fun & args]) Must be called in a transaction. Sets the in-transaction-value of ref to:

Simple dosync/alter question

2009-04-06 Thread bgray
I have a some what (I believe) easy question. Could someone let me know what I'm doing wrong? A simplified version of what I'm trying to do looks like this: user=> (def foo (ref 0)) #'user/foo user=> (defn square [x] (* x x)) #'user/square user=> (defn square-ref [x] (dosync (alter foo square x

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread Victor Rodriguez
Hello, On Mon, Apr 6, 2009 at 10:06 AM, James Reeves wrote: > ... > The problem with having java-utils/file and duck-streams/file is that > you lose the ability to load both namespaces at the same time without > defining an exception for the file function. This does not seem like > an ideal solu

Re: How do you handle different string encodings?

2009-04-06 Thread Daniel Jomphe
I finally worked it all out. For future reference, here's a record of my research on this: http://stackoverflow.com/questions/715958/how-do-you-handle-different-string-encodings Daniel Jomphe wrote: > I made some progress. > > [By the way, NetBean's console displays *everything* 100% fine. >  I

Re: A syntax feature request: splitting literal strings

2009-04-06 Thread Laurent PETIT
2009/4/4 samppi > > I don't really want it so much for documentation strings—they're > already formatted in a standard way [...] Well, they certainly are formatted in *a* standard way :-), e.g. they have a "hard-coded" formatted only suitable as-is for 80 columns wide terminals :-) Indeed, for

Re: A syntax feature request: splitting literal strings

2009-04-06 Thread Laurent PETIT
2009/4/6 Nathan Kitchen > > On Apr 4, 4:16 pm, Stuart Sierra wrote: > > This can be macro-ized: > > > > (defmacro bigstr [& strings] > > "Concatenates strings at compile time." > > (apply str strings)) > > > > user> (macroexpand-1 '(bigstr "This is a really long string " > >

Re: A syntax feature request: splitting literal strings

2009-04-06 Thread Nathan Kitchen
On Apr 4, 4:16 pm, Stuart Sierra wrote: > This can be macro-ized: > > (defmacro bigstr [& strings] > "Concatenates strings at compile time." > (apply str strings)) > > user> (macroexpand-1 '(bigstr "This is a really long string " > "that I just felt like using "

Re: proposed new contrib: java-utils

2009-04-06 Thread Perry Trolard
Hi Stuart, I had occasion to wrap java.util.Properties. If there's interest, may be a good candidate for c.c.java-utils. It's pasted in below, & attached in the group at http://clojure.googlegroups.com/web/props.clj Feel free to change as you see fit. Best, Perry (ns props ; Conv

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread Jason Sankey
James Reeves wrote: > On Apr 6, 11:29 am, Jason Sankey wrote: >> I think there may be a misunderstanding over "combining" here - I read >> Stuart's mail to mean there was no obvious way to combine >> duck-streams/file and java-utils/file, whereas this implementation shows >> java-utils/file style

Re: No I/O in STM transactions?

2009-04-06 Thread Hugh Winkler
On Mon, Apr 6, 2009 at 12:58 AM, Dex Wood wrote: > > If you want to do I/O from a transaction, just use an agent to do the > I/O.  Since the agent is only sent off at commit, you don't have to > worry about retries.  This doesn't answer your questions about > idempotent I/O, but I think it is a s

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread James Reeves
On Apr 6, 11:29 am, Jason Sankey wrote: > I think there may be a misunderstanding over "combining" here - I read > Stuart's mail to mean there was no obvious way to combine > duck-streams/file and java-utils/file, whereas this implementation shows > java-utils/file style behaviour only? As far a

lazy seqs (was Re: proposed new contrib: java-utils)

2009-04-06 Thread Stuart Halloway
r652 is a breaking change to contrib. (powers-of-2) and (fibs) are now functions and do not hold their heads. primes is still a sequence because it needs to hold past values for efficiency. Stuart > On Apr 5, 2009, at 4:27 PM, Stuart Halloway wrote: > >> At quick glance it looks to me that a

Re: ANN: Pretty printer is now part of contrib

2009-04-06 Thread Stuart Halloway
Hi Tom, I think that the ant test tasks should depend on the compilation tasks, and that users will just have to specify a clojure.jar. Either that or the default test suite should be smart enough to skip the pretty printer tests with ant.jar not specified. Stuart > By (semi-)popular deman

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread Jason Sankey
James Reeves wrote: > On Apr 6, 4:10 am, Stuart Sierra wrote: >> I don't see an obvious way of combining them. > > What about something like: > > (defn- normalize-separator > [filepath] > (.. (str filepath) > (replace \\ File/separatorChar) > (replace \/ File/separatorChar))) > > (

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread Michael Wood
On Mon, Apr 6, 2009 at 10:40 AM, James Reeves wrote: > > On Apr 6, 4:10 am, Stuart Sierra wrote: >> I don't see an obvious way of combining them. > > What about something like: > > (defn- normalize-separator >  [filepath] >  (.. (str filepath) >    (replace \\ File/separatorChar) >    (replace \

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread James Reeves
On Apr 6, 4:10 am, Stuart Sierra wrote: > I don't see an obvious way of combining them. What about something like: (defn- normalize-separator [filepath] (.. (str filepath) (replace \\ File/separatorChar) (replace \/ File/separatorChar))) (defn file [filepath & more] (reduce