Re: Namespaces, use, and refer

2009-03-03 Thread Christophe Grand
Konrad Hinsen a écrit : > On 03.03.2009, at 00:53, Laurent PETIT wrote: > > >> I'm able to do that from the REPL when done one by one : >> (clojure.core/ns-unmap *ns* (quote filter)) >> (clojure.core/defn filter [] "oh my!") >> >> thus correctly redefining the binding of filter for the rest of

Re: Namespaces, use, and refer

2009-03-03 Thread Laurent PETIT
So there we are with a version of defn, which I called defn! because it is even more agressive than defn in its side effects, that could solve your problem : (defmacro defn! "Like defn, but first ensures that if name is bound to something (e.g. the name of a function in a 'used' or 'required'

Re: Namespaces, use, and refer

2009-03-03 Thread Laurent PETIT
Now that I rethink about it, wouldn't this version using eval be less than ideal as far as AOT compilation is concerned ? 2009/3/3 Laurent PETIT > So there we are with a version of defn, which I called defn! because it is > even more agressive than defn in its side effects, that could solve your

Re: conditions in monad comprehensions

2009-03-03 Thread Konrad Hinsen
On 02.03.2009, at 19:52, Konrad Hinsen wrote: > At first look it seems your simplified version is indeed equivalent. > I will look at it again tomorrow after a good night's sleep :-) At second look, I still agree, so I update the implementation in clojure.contrib.monads. Konrad. --~--~-

Re: Waterfront 148 (was: Waterfront - The Clojure-based editor for Clojure)

2009-03-03 Thread Konrad Hinsen
On 27.02.2009, at 15:14, Itay Maman wrote: > Revision 148 is available for download at > http://sourceforge.net/project/platformdownload.php?group_id=249246 > It addresses some of the requests that were raised in this discussion: > > * Changed default location of the divider > * Fixed the "comman

Re: Namespaces, use, and refer

2009-03-03 Thread Laurent PETIT
Please forgive about this defn! macro, it does not seem to play well in practice. I now share Konrad's thoughts : I don't know if what he want is feasible without changes in clojure, or use of clojure non-public APIs. 2009/3/3 Laurent PETIT > Now that I rethink about it, wouldn't this version u

Re: Waterfront 148 (was: Waterfront - The Clojure-based editor for Clojure)

2009-03-03 Thread Tom Ayerst
If you pull trunk out of subversion you can build it locally with Ant. Would that do it? https://waterfront.svn.sourceforge.net/svnroot/waterfront/trunk Cheers Tom 2009/3/3 Konrad Hinsen > > On 27.02.2009, at 15:14, Itay Maman wrote: > > > Revision 148 is available for download at > > http:/

Roman Numerals

2009-03-03 Thread David Sletten
Here's a little toy to practice my basic Clojure skills. I didn't see any similar topic in the archives, so here we go... This code performs conversions between Roman and Arabic numerals. Roman numerals are represented as strings and Arabic numerals are just integers. Arabic numerals in the

Re: new Clojure article

2009-03-03 Thread Rich Hickey
On Mar 2, 8:40 pm, Mark Volkmann wrote: > On Mon, Mar 2, 2009 at 7:05 PM, Chouser wrote: > > > On Mon, Mar 2, 2009 at 7:53 PM, Mark Volkmann > > wrote: > > >> Currently what the article says about Vectors is "They are ideal when > >> items need to be retrieved by index, but not efficient whe

Compiling problem.

2009-03-03 Thread zodoz
I'm just larning Clojure and have been able to figure out everything so far via trial-and-error. However, I cannot for the LIFE of me figure out how to compile anything. I have tried every possible setup I can think of and I all I have is a sneaking suspicion that its a Vista issue. Below I hav

Re: new Clojure article

2009-03-03 Thread Mark Volkmann
On Tue, Mar 3, 2009 at 6:22 AM, Rich Hickey wrote: > > On Mar 2, 8:40 pm, Mark Volkmann wrote: >> On Mon, Mar 2, 2009 at 7:05 PM, Chouser wrote: >> >> > On Mon, Mar 2, 2009 at 7:53 PM, Mark Volkmann >> > wrote: >> >> >> Currently what the article says about Vectors is "They are ideal when >>

Re: new Clojure article

2009-03-03 Thread Mark Volkmann
On Mon, Mar 2, 2009 at 8:45 PM, MikeM wrote: > >> At the end of the Vectors section I say this: >> "All the code examples provided above for lists also work for vectors." >> >> Do you think I should provide more detail than that? > > I missed that sentence. I think it's helpful to know that some

Re: Compiling problem.

2009-03-03 Thread Mark Volkmann
On Tue, Mar 3, 2009 at 12:58 AM, zodoz wrote: > > I'm just larning Clojure and have been able to figure out everything > so far via trial-and-error.  However, I cannot for the LIFE of me > figure out how to compile anything.  I have tried every possible setup > I can think of and I all I have is

emacs / swank / slime startup problem - ClassNotFoundException: swank.swank

2009-03-03 Thread Korny Sietsma
Hi folks; I have an intermittent problem that's driving me nuts. I'm running the emacs-starter-kit setup for editing clojure, recently updated from git, and when I first run "M-x slime", I often get the following messages: user=> user=> java.lang.IllegalArgumentException: URI has an authority com

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Rich Hickey
On Mar 3, 1:58 am, Raffael Cavallaro wrote: > On Mar 2, 10:41 pm, Jeffrey Straszheim > wrote: > > > First off, Clojure is not Common Lisp (to say the least), so I don't think > > we necessarily need to create as stateful a library as the original Cells. > > I've used Cells-like architectures b

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Rich Hickey
On Mar 2, 10:41 pm, Jeffrey Straszheim wrote: > There are a lot of "toy" cells implementations for Clojure, but as far as I > can tell none of them are really full-production ready libraries like K. > Tilton's. I'm planning on starting a GUI based project and something cell's > like would be v

Re: new Clojure article

2009-03-03 Thread MikeM
> > The only function I could find that takes a vector and returns a list > instead of a vector or a sequence is the reverse function. Are there > others? Map and other lazy functions currently return a LazySeq - (map #(+ %) [1 2 3]) => (2 3 4) cons currently returns a Cons type - (cons 0 [1 2

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Anand Patil
On Mar 3, 1:04 pm, Rich Hickey wrote: > I think it is important to embrace asynchrony and concurrency as > Clojure does. Any Cells-for-Clojure that presumes the world is a > single synchronous chain of events would be a misfit. The whole notion > of a 'current step' is suspect. I'd appreciate it

Re: Waterfront 148 (was: Waterfront - The Clojure-based editor for Clojure)

2009-03-03 Thread Konrad Hinsen
On Mar 3, 2009, at 11:46, Tom Ayerst wrote: > If you pull trunk out of subversion you can build it locally with > Ant. Would that do it? Definitely, thanks! I pulled the latest revision and built it by typing "ant". No compilation errors, but I can't run it either: Can't load plugin custo

Re: emacs / swank / slime startup problem - ClassNotFoundException: swank.swank

2009-03-03 Thread Bradbev
On Mar 3, 4:46 am, Korny Sietsma wrote: > Hi folks; > > I have an intermittent problem that's driving me nuts. > I'm running the emacs-starter-kit setup for editing clojure, recently > updated from git, and when I first run "M-x slime", I often get the > following messages: > user=> user=> java.l

Re: Roman Numerals

2009-03-03 Thread Chouser
On Tue, Mar 3, 2009 at 6:40 AM, David Sletten wrote: > > I'd appreciate any feedback regarding my Clojure style. Any more > natural ways to do things? Looks good, thanks for sharing. > (defn roman? [roman-string] >   (and (not (empty? roman-string)) >        (re-matches >         #"(?:M{0,3})(?

doall, dorun, doseq, for

2009-03-03 Thread Mark Volkmann
Does this seem like a good way to choose between doall, dorun, doseq and for to evaluate all the items in sequences? Ask these questions: Do you already have the lazy sequence in a variable or do you still need to build it? If you already have it, use dorun or doall. Otherwise use doseq or for.

Re: doall, dorun, doseq, for

2009-03-03 Thread Laurent PETIT
Hello Mark, Just one point : 2009/3/3 Mark Volkmann > > Does this seem like a good way to choose between doall, dorun, doseq > and for to evaluate all the items in sequences? > > Ask these questions: > > Do you already have the lazy sequence in a variable or do you still > need to build it? > I

Re: doall, dorun, doseq, for

2009-03-03 Thread Mark Volkmann
On Tue, Mar 3, 2009 at 9:12 AM, Laurent PETIT wrote: > Hello Mark, > > Just one point : > > 2009/3/3 Mark Volkmann >> >> Does this seem like a good way to choose between doall, dorun, doseq >> and for to evaluate all the items in sequences? >> >> Ask these questions: >> >> Do you already have th

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Raffael Cavallaro
On Mar 3, 8:04 am, Rich Hickey wrote: > If B and C depend on A in such > a way that their values must be coordinated in order to be valid and > consistent, then maybe they shouldn't independently depend on A, > instead a transaction should fire on changes to A, which in turn > updates B and C

Re: doall, dorun, doseq, for

2009-03-03 Thread Laurent PETIT
2009/3/3 Mark Volkmann > > On Tue, Mar 3, 2009 at 9:12 AM, Laurent PETIT > wrote: > > Hello Mark, > > > > Just one point : > > > > 2009/3/3 Mark Volkmann > >> > >> Does this seem like a good way to choose between doall, dorun, doseq > >> and for to evaluate all the items in sequences? > >> > >>

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Jeffrey Straszheim
Access to the previous value is an interesting idea. I'm thinking of putting together a lib where all updates are collection into transactions (which would run *inside* of Clojure transactions, but would have their own semantics also). Something like this: (update-model (update x 3) (upda

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Jeffrey Straszheim
I've actually been looking at Rete. However, for my present purposes I want something that just does computation dependency graphs. Rete is way heavier than I'm currently thinking. On Mar 3, 8:12 am, Rich Hickey wrote: > On Mar 2, 10:41 pm, Jeffrey Straszheim > wrote: > > > > > There are a lo

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Jeffrey Straszheim
I've actually been looking at Rete. However, for my present purposes I want something that just does computation dependency graphs. Rete is way heavier than I'm currently thinking. On Mar 3, 8:12 am, Rich Hickey wrote: > On Mar 2, 10:41 pm, Jeffrey Straszheim > wrote: > > > > > There are a lo

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Jeffrey Straszheim
I'm pretty sure I don't want an agent based model. I want clear transactional semantics. However, there is no reason both should not exist. On Mar 3, 9:11 am, Anand Patil wrote: > On Mar 3, 1:04 pm, Rich Hickey wrote: > > > I think it is important to embrace asynchrony and concurrency as > >

Re: doall, dorun, doseq, for - Debugging as a side effect?

2009-03-03 Thread Peter Wolf
RE: Side Effects What about logging? Without a debugger I use lots of print's to debug my code... and that often produces confusing results as things may not get evaluated in the order I expect. For that matter, now that we have integrated Java debuggers, what does setting a breakpoint real

Re: doall, dorun, doseq, for

2009-03-03 Thread Chouser
On Tue, Mar 3, 2009 at 10:03 AM, Mark Volkmann wrote: > > Does this seem like a good way to choose between doall, dorun, doseq > and for to evaluate all the items in sequences? > > Ask these questions: > > Do you already have the lazy sequence in a variable or do you still > need to build it? > I

Re: Compiling problem.

2009-03-03 Thread zodoz
*sigh*... Still no joy. I've looked around for how to use the command and I finally got it to stop giving me directory permission errors, but Java still does not seem to be liking it. I am now running it with "java -classpath .;src;classes -jar clojure.jar", but when I run (compile 'test) or (c

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Anand Patil
On Mar 3, 3:22 pm, Raffael Cavallaro wrote: > On Mar 3, 8:04 am, Rich Hickey wrote: > > >  If B and C depend on A in such > > a way that their values must be coordinated in order to be valid and > > consistent, then maybe they shouldn't independently depend on A, > > instead a transaction shou

Re: Compiling problem.

2009-03-03 Thread Laurent PETIT
You cannot have both a classpath full of jars and directories (via the -cp option) and run directly from a jar. Try java -classpath .;src;classes;clojure.jar clojure.main" instead (http://clojure.org/repl_and_main) 2009/3/3 zodoz > > *sigh*... Still no joy. I've looked around for how to use

Re: doall, dorun, doseq, for

2009-03-03 Thread Meikel Brandmeyer
Hi, Am 03.03.2009 um 16:42 schrieb Chouser: If you have a lazy sequence with side-effects, you almost certainly don't want to let it out of your sight. You're likely to get very strange behavior unless you're exceedingly careful. Most likely, if you've got a lazy seq with side effects you sho

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Raffael Cavallaro
On Mar 3, 10:45 am, Anand Patil wrote: > Cells don't update until all of their parents have reported in, ie > reached the current step. This bit is important (i.e., no update until all parents are current) and constitutes an implicit notion of current step. It still doesn't get you time lags

Re: doall, dorun, doseq, for

2009-03-03 Thread Laurent PETIT
2009/3/3 Meikel Brandmeyer > Hi, > > Am 03.03.2009 um 16:42 schrieb Chouser: > > If you have a lazy sequence with side-effects, you almost certainly >> don't want to let it out of your sight. You're likely to get very >> strange behavior unless you're exceedingly careful. Most likely, if >> yo

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Anand Patil
On Mar 3, 3:38 pm, Jeffrey Straszheim wrote: > I'm pretty sure I don't want an agent based model.  I want clear > transactional semantics.  However, there is no reason both should not > exist. I think you can get solid transactions with lazy agents, since an update corresponds to a single step/d

Re: doall, dorun, doseq, for

2009-03-03 Thread Meikel Brandmeyer
Hi Laurent, Am 03.03.2009 um 17:03 schrieb Laurent PETIT: Why should there ever be the need to call dorun? If you still want to force a veeerry long seq for side effect, without fearing to face an OutOfMemory error ? (let [some-lng-seq ] (dorun some-lng-seq) ...) H

Re: doall, dorun, doseq, for

2009-03-03 Thread Chouser
On Tue, Mar 3, 2009 at 10:56 AM, Meikel Brandmeyer wrote: >> >> This means that dorun should almost always show up right next to the >> form producing the lazy seq, which means doseq is very likely a better >> choice, as it is more efficient and usually more succinct than dorun >> combined with a

Re: doall, dorun, doseq, for

2009-03-03 Thread Laurent PETIT
Correct. It seems that we are agreeing that we agree :-) 2009/3/3 Meikel Brandmeyer > Hi Laurent, > > Am 03.03.2009 um 17:03 schrieb Laurent PETIT: > > Why should there ever be the need to call dorun? >>> >> >> >> If you still want to force a veeerry long seq for side effect, without >> fearing

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Jeffrey Straszheim
I don't think I gain anything here, however, over just updating the graph in a dosync block, except I add a bunch of asynchronicity that I then have to block to avoid. With agents it also becomes more difficult to do static analysis on the graph. On Tue, Mar 3, 2009 at 11:12 AM, Anand Patil < ana

Re: Waterfront 148 (was: Waterfront - The Clojure-based editor for Clojure)

2009-03-03 Thread Itay Maman
Konrad, Your installation is probably fine. The problem lies in the FileNameExtensionFilter class. It was only introduced in Java6. Therefore, despite the fact that you now have binaries that are compatible with your JVM, the program does not run. I'll try to fix this soon. I'll post a message w

Re: So what do we want for a Cells-alike ?

2009-03-03 Thread Stuart Sierra
On Mar 2, 10:41 pm, Jeffrey Straszheim wrote: > There are a lot of "toy" cells implementations for Clojure, but as far as I > can tell none of them are really full-production ready libraries like K. > Tilton's.  I'm planning on starting a GUI based project and something cell's > like would be ver

Re: Compiling problem.

2009-03-03 Thread zodoz
Same thing. I even tried putting (compile 'test.test) in the src/test/ test.clj file and loading it with "java - classpath .;src;classes;clojure.jar clojure.main src/test/test.clj". If it helps, the full error I am getting now is: java.io.IOException: The system cannot find the path specified (t

Re: ANN: Preliminary Clojure Support in Buildr

2009-03-03 Thread Daniel Spiewak
Warning: if you're using a clone of my Git repository, you will probably need to reclone from scratch, otherwise things will no longer work. Because of some changes in the upstream Buildr SVN repository, everybody on the project has been doing a ton of rebasing lately. This means that the latest

Re: Waterfront 148 (was: Waterfront - The Clojure-based editor for Clojure)

2009-03-03 Thread Konrad Hinsen
Itay, > Alternatively hoping that this is the only Java6-only dependency in > the code, you can also apply this patch to clj/net/sourceforge/ > waterfront/ide/plugins/file.clj (I didn't test is though - I am away > from my machine, so no warranty...) Thanks for the quick fix, it works! I can no

Question on names of errors in error-kit

2009-03-03 Thread samppi
Small questions on error-kit—which I love and think that all clojure- contrib libraries should use—why do defined errors such as *error*, *number-error*, etc. have names surrounded by asterisks? According to this thread—http://groups.google.com/group/clojure/browse_thread/ thread/65d98eda2d1154b2—

Re: doall, dorun, doseq, for

2009-03-03 Thread Mark Volkmann
On Tue, Mar 3, 2009 at 9:42 AM, Chouser wrote: > > If you have a lazy sequence with side-effects, you almost certainly > don't want to let it out of your sight.  You're likely to get very > strange behavior unless you're exceedingly careful.  Most likely, if > you've got a lazy seq with side effe

Re: Waterfront - The Clojure-based editor for Clojure

2009-03-03 Thread aperotte
Hi, I'm using linux (Ubuntu) and none of the above scripts worked for me. I added the ${DP}/bin directory to the classpath list to get it to work. #!/bin/sh DP="${0%/*}" java -cp ~/src/clojure/clojure.jar:${DP}/clj:${DP}/java - Dnet.sourceforge.waterfront.plugins=${DP}/clj/net/sourceforge/ water

contrib build errors after javadoc => repl-utils

2009-03-03 Thread Perry Trolard
Hi Christophe Grand or other contrib committers, clojure.contrib.javadoc should be removed from the list of libs to compile in the build.xml file; as it stands, building with ant throws the Exception that fires when c.c.javadoc is compiled. Best, Perry --~--~-~--~~~--

Re: contrib build errors after javadoc => repl-utils

2009-03-03 Thread Stephen C. Gilardi
Hi Christophe Grand or other contrib committers, clojure.contrib.javadoc should be removed from the list of libs to compile in the build.xml file; as it stands, building with ant throws the Exception that fires when c.c.javadoc is compiled. Best, Perry Fixed. Thanks for the report! --Steve

Game of Life

2009-03-03 Thread lps540
I've written a small example of Conway's Game of Life using Clojure and Swing. Comments/critiques are welcome. http://lpsherrill.blogspot.com/2009/02/conways-game-of-life.html Thanks, Larry --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Game of Life

2009-03-03 Thread Phil Hagelberg
lps540 writes: > I've written a small example of Conway's Game of Life using Clojure > and Swing. Comments/critiques are welcome. Interesting program! (for [x (range 32) y (range 48)] (ref-set cells (assoc (deref cells) [x y] (= 0 (rand-int 5) While

test-clojure: trouble with the latest Clojure SVN version

2009-03-03 Thread Frantisek Sodomka
There is a problem with the latest Clojure SVN version. Try running in clojure-contrib: ant test_clojure It generates failures and errors. There is some confusion between "nil" and "()" by the reader/compiler it seems. Also: user=> (pop '(1 2 3)) java.lang.ClassCastException: clo

Re: Game of Life

2009-03-03 Thread Larry Sherrill
Hi Phil, Thanks for the tips. Yes, alter and doseq do look better. As far as the "running" variable, there is one thread painting the squares and another thread responding to the mouse click on start/ stop. This was the only way I could think of that the user could stop the paint thread, using a

Waterfront 148 (was: Waterfront - The Clojure-based editor for Clojure)

2009-03-03 Thread Itay Maman
Adler, Konard: Thank you guys for the patches. -Itay On Mar 3, 9:14 pm, aperotte wrote: > Hi, > > I'm using linux (Ubuntu) and none of the above scripts worked for me. > I added the ${DP}/bin directory to the classpath list to get it to > work. > > #!/bin/sh > DP="${0%/*}" > java -cp ~/src/clo

Re: Game of Life

2009-03-03 Thread Mark Volkmann
On Tue, Mar 3, 2009 at 2:03 PM, lps540 wrote: > > I've written a small example of Conway's Game of Life using Clojure > and Swing. Comments/critiques are welcome. > > http://lpsherrill.blogspot.com/2009/02/conways-game-of-life.html The paint-cells function can be shorted by using doseq and destr

Re: test-clojure: trouble with the latest Clojure SVN version

2009-03-03 Thread Stephen C. Gilardi
On Mar 3, 2009, at 3:39 PM, Frantisek Sodomka wrote: There is a problem with the latest Clojure SVN version. Try running in clojure-contrib: ant test_clojure I confirmed that r1321 passes the tests and r1322 fails. To run the tests, I use: cd /the/path/to/my/clojure-contrib a

Re: Game of Life

2009-03-03 Thread Mark Volkmann
On Tue, Mar 3, 2009 at 2:03 PM, lps540 wrote: > > I've written a small example of Conway's Game of Life using Clojure > and Swing. Comments/critiques are welcome. Instead of all the uses of (- x 1), (- y 1), (+ x 1) and (+ y 1), I think it's more idiomatic to use (dec x), (dec y), (inc x) and (i

Re: Game of Life

2009-03-03 Thread Stephen C. Gilardi
On Mar 3, 2009, at 3:03 PM, lps540 wrote: I've written a small example of Conway's Game of Life using Clojure and Swing. Comments/critiques are welcome. Very nice example! Here's a more compact determine-new-state: (defn determine-new-state [x y] (let [count (reduce + (for [dx [-1 0 1] dy

Re: Compiling problem.

2009-03-03 Thread zodoz
I found the solution (though I'm still in the process of understanding why it works): java -cp clojure.jar;.\src;.\classes clojure.lang.Repl user=> (compile 'test.test) On Mar 3, 10:56 am, zodoz wrote: > Same thing.  I even tried putting (compile 'test.test) in the src/test/ > test.clj file and

Re: Compiling problem.

2009-03-03 Thread Achim Passen
Hi! Are you using the release version from clojure.org? I remember this one having a strange *compile-path* default when started as clojure.main (something like "/Users/rich/..."), but defaulting to "classes" when started as clojure.lang.Repl ... Kind regards, achim Am 03.03.2009 um 22:2

Re: Roman Numerals

2009-03-03 Thread Michel S.
Hello, Chouser has commented extensively, so I'll just put in my two cents. On Mar 3, 6:40 am, David Sletten wrote: > > Incidentally, the "cond" form in roman-to-arabic-aux seems to me   > harder to read in Clojure than it would be in CL with its additional   > set of grouping parentheses. When

Re: test-clojure: trouble with the latest Clojure SVN version

2009-03-03 Thread Rich Hickey
On Mar 3, 3:58 pm, "Stephen C. Gilardi" wrote: > On Mar 3, 2009, at 3:39 PM, Frantisek Sodomka wrote: > > > There is a problem with the latest Clojure SVN version. Try running in > > clojure-contrib: ant test_clojure > > I confirmed that r1321 passes the tests and r1322 fails. > > To run the te

Re: emacs / swank / slime startup problem - ClassNotFoundException: swank.swank

2009-03-03 Thread Korny Sietsma
Thanks - that seemed to fix it! - Korny On Wed, Mar 4, 2009 at 1:34 AM, Bradbev wrote: > > On Mar 3, 4:46 am, Korny Sietsma wrote: >> Hi folks; >> >> I have an intermittent problem that's driving me nuts. >> I'm running the emacs-starter-kit setup for editing clojure, recently >> updated from

Clojure + Terracotta: the Next Steps

2009-03-03 Thread Paul Stadig
I've done some more work on Clojure + Terracotta. I moved my code into a Terracotta Integration Module (TIM), which allows the bundling and reuse of the Terracotta configuration, but also provides for class replacement so that clustered versions of some classes can be written without necessarily h

Re: Game of Life

2009-03-03 Thread Larry Sherrill
Thanks everyone for the suggestions. Very helpful. On Mar 3, 2:03 pm, "Stephen C. Gilardi" wrote: > On Mar 3, 2009, at 3:03 PM, lps540 wrote: > > > I've written a small example of Conway's Game of Life using Clojure > > and Swing. Comments/critiques are welcome. > > Very nice example! > > Here's

Re: Game of Life

2009-03-03 Thread Laurent PETIT
Hello Larry, is there a reason why the code of this port of Game of Life does not seem to be under an open source license (e.g. EPL, etc.) ? I was interested in playing with your code, but I'm a bit reluctant when I see an "all rights reserved" in the top of the file ... It seems to me like your

Re: Game of Life

2009-03-03 Thread Stephen C. Gilardi
On Mar 3, 2009, at 4:03 PM, Stephen C. Gilardi wrote: (defn determine-new-state [x y] (let [count (reduce + (for [dx [-1 0 1] dy [-1 0 1]] (if (cells [(+ x dx) (+ y dy)]) 1 0)))] (or (and (cells [x y]) (> count 2) (< count 5)) (= count 3 I'm guessing

Re: doall, dorun, doseq, for

2009-03-03 Thread Chouser
On Tue, Mar 3, 2009 at 2:54 PM, Mark Volkmann wrote: > > I agree that using doseq instead of dorun results in code that is > easier to read. I don't understand though why it is more efficient. > They both walk the entire sequence, neither holds onto the head and > both return nil. Why is doseq mo

Re: Question on names of errors in error-kit

2009-03-03 Thread Chouser
On Tue, Mar 3, 2009 at 2:10 PM, samppi wrote: > > Small questions on error-kit—which I love and think that all clojure- > contrib libraries should use—why do defined errors such as *error*, > *number-error*, etc. have names surrounded by asterisks? Thanks for the endorsement! Have you used cont

Re: Question on names of errors in error-kit

2009-03-03 Thread David Nolen
I appreciate that they stand out. Again, this is similar to the constants conversation earlier, visually marking the intended use is a good habit, IMHO. Of course this doesn't mean that error-kit should define the base error this way, but I intend to keep on wrapping my errors in earmuffs :) Davi

Re: Question on names of errors in error-kit

2009-03-03 Thread Chouser
On Tue, Mar 3, 2009 at 10:36 PM, David Nolen wrote: > I appreciate that they stand out.  Again, this is similar to the constants > conversation earlier, visually marking the intended use is a good habit, > IMHO.  Of course this doesn't mean that error-kit should define the base > error this way,

Re: Game of Life

2009-03-03 Thread Timothy Pratley
Just because there is always another way :P (defn determine-new-state [x y] (let [alive (count (for [dx [-1 0 1] dy [-1 0 1] :when (cells [(+ x dx) (+ y dy)])] :alive))] (if (cells [x y]) (< 2 alive 5) (= alive 3 --~--~--

Re: Game of Life

2009-03-03 Thread Larry Sherrill
> Am I "over interpreting" the meaning of the copyright clause at the top of > the published code ? Yes. I hesitated to put it there but went ahead out of habit. :> I'll either remove it or stick some minimal open source license on it. Thanks for pointing that out. On Mar 3, 4:53 pm, Laurent PE

Re: Question on names of errors in error-kit

2009-03-03 Thread David Nolen
capitals seems pretty weird for a Lisp. Now that I think about it, perhaps foo-error isn't so bad. David On Tue, Mar 3, 2009 at 10:54 PM, Chouser wrote: > > On Tue, Mar 3, 2009 at 10:36 PM, David Nolen > wrote: > > I appreciate that they stand out. Again, this is similar to the > constants > >

Re: Game of Life

2009-03-03 Thread Stephen C. Gilardi
On Mar 3, 2009, at 11:01 PM, Timothy Pratley wrote: Just because there is always another way :P (defn determine-new-state [x y] (let [alive (count (for [dx [-1 0 1] dy [-1 0 1] :when (cells [(+ x dx) (+ y dy)])] :alive))] (if (cells [x y])

Re: contrib build errors after javadoc => repl-utils

2009-03-03 Thread Christophe Grand
Stephen C. Gilardi a écrit : >> Hi Christophe Grand or other contrib committers, >> >> clojure.contrib.javadoc should be removed from the list of libs to >> compile in the build.xml file; as it stands, building with ant throws >> the Exception that fires when c.c.javadoc is compiled. >> >> Best, >

Re: Waterfront - The Clojure-based editor for Clojure

2009-03-03 Thread Michael Wood
On Tue, Mar 3, 2009 at 9:14 PM, aperotte wrote: > > Hi, > > I'm using linux (Ubuntu) and none of the above scripts worked for me. > I added the ${DP}/bin directory to the classpath list to get it to > work. > > #!/bin/sh > DP="${0%/*}" > java -cp ~/src/clojure/clojure.jar:${DP}/clj:${DP}/java - >