Re: Has anyone on this group ever tried Forth?

2009-04-12 Thread Tom Ayerst
Obtuse, maybe, then again many people say the same of Lisps (and pretty much any Functional language, and APL...). it depends on the objectives of the author and familiarity of the reader. IMHO The Forth sweet spot has always been near or on the metal; it has an extremely small footprint in those

Re: Clojure plugin for IntelliJ IDEA published

2009-03-10 Thread Tom Ayerst
Liking it so far. Can you get jline style functionality into the REPL, I really miss it. Cheers Tom 2009/2/27 AndrewC. > > > > On Feb 26, 7:08 pm, CuppoJava wrote: > > Hello Ilya, > > Thanks for the workaround. > > > > I'm glad to hear you're working on a "surround with" feature. Some > > ot

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

Re: Internal structure of evaluation results

2009-03-02 Thread Tom Ayerst
Hi David, I think part of the problem is that you missed the name space from the data you retrived with find-doc. meta isn't in the user namespace so you need to specify it. user=> (find-doc "metadata") ... - *clojure.core/*meta ([obj]) Returns the metadata of obj, retu

Re: Please help me get rid of my mutable code.

2009-02-26 Thread Tom Ayerst
If most of the state is in the sprites and they don't co-ordinate then could you make the sprites agents and use watchers to manage their forward notifications. Any global state (the event loop) can be managed functionally by recursively passing the updated state as a parameter into the event funct

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-24 Thread Tom Ayerst
This is an interesting idea and a lightweight IDE distributed in contrib would be a great addition IMHO. I have tried it (on Windows using a pre-lazy version of clojure) and it doesn't react to any events (though it does repaint after other apps windows are dragged over it). What version of cloju

Re: alternate syntax

2009-02-23 Thread Tom Ayerst
http://xkcd.com/297/ 'nuff said ;-) Tom 2009/2/23 Vincent Foley > > I'm opposed to this idea. I don't think we should pander to the > masses by creating a schism between new and experienced users. New > users should be introduced to the real thing immediately and it is up > to the tutorials

Re: General Question Clojure(Lisp) Idiom, cross cutting? What is the terminology

2009-02-20 Thread Tom Ayerst
You probably don't want to be doing this. Your function looks like it could use a lazy sequency and a filter. e.g. (doseq [e (filter odd? [1 2 3 4 5 6 7])] (prn e)) You can get a long way with partition, for, filter and reduce; It is a pain to get your head around it at first if your are not us

Re: IntelliJ Plugin -- Wonderful News!

2009-02-16 Thread Tom Ayerst
Team City is not an IDE, it is a continuous integration server. I think Jetbrains give it away to Intellij licensees. Tom 2009/2/16 Johan Berntsson > > I see that IntelliJ has a free edition called TeamCity. Will the > clojure plugin work on that IDE too? > > On Feb 6, 7:33 am, Peter Wolf wro

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-16 Thread Tom Ayerst
Also, don't forget that Jambi is a vanilla GPL 2.0, so make sure all your licenses are compatible and you don't mind publishing your source (personally I don't, but you should be aware). Tom 2009/2/16 levand > > I agree, Jambi is a better all-round product... but why the Swing > hate? It's fin

Re: Calling static methods without reflection?

2009-02-11 Thread Tom Ayerst
Hi James, You can acheive the same thing with type hints: (defn abs [#^Double x] (Math/abs x)) Cheers Tom 2009/2/11 Jason Wolfe > > Never mind, silly me. Of course, the identity of the method is not > the issue, it's the type of the argument. > > user> (defn abs [x] (let [x (double x)]

Re: IntelliJ Plugin -- Wonderful News!

2009-02-06 Thread Tom Ayerst
That is excellent news. Now I just to learn enough Clojure to properly contribute to a pukka open Source project so I can get a free copy ;-) 2009/2/6 Peter Wolf > > Check out this email! IntelliJ is going to get a *really* good plugin > for Clojure :-D > > I have gladly turned control of the

Re: London Clojurians

2009-02-05 Thread Tom Ayerst
Feb 3, 12:54 pm, Tom Ayerst wrote: > > I suggest we work to James' schedule and talk about Compojure in our > first > > meet; how does that sound? > > > > I don't have access to a private venue. If anyone else does that would > be > > cool, ot

Re: London Clojurians

2009-02-03 Thread Tom Ayerst
Reeves > > On Feb 2, 9:37 am, Tom Ayerst wrote: > > Is there anyone getting together in London to discuss Clojure? > > If so, can anyone play? > > If not, would anyone be interested? > > I'm in London, and I might be interested. I tend to hav

London Clojurians

2009-02-02 Thread Tom Ayerst
Hi, Is there anyone getting together in London to discuss Clojure? If so, can anyone play? If not, would anyone be interested? Cheers Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: Distributed Clojure

2009-01-30 Thread Tom Ayerst
I think you have to decide what you are aiming for. Is this a "solution" or another tool in the toolkit. I think Rich noted a while back that Clojure can access many distribution technologies. So if you want a solution right now you can wrap one of those up and off you go. If you want a "distri

Re: Agent watchers on Refs

2009-01-27 Thread Tom Ayerst
I thought the validator just set "Agent has errors" and you have to check it explicitly. Tom 2009/1/27 MikeM > > > > Were watchers synchronous, they would have to run post-transaction > > (else a watcher action failure could cause a transaction rollback, > > leaving already notified watchers co

Re: Agent watchers on Refs

2009-01-26 Thread Tom Ayerst
I used a couple of watchers to push model updates onto the EDT in a Swing app; it 'just worked'. I haven't pushed the envelope on it but the abstraction is clear and clean IMHO. Tom 2009/1/26 Rich Hickey > > > > On Jan 25, 4:06 pm, Stuart Sierra wrote: > > Hi Rich, all, > > > > Ever since t

Re: Basic about setting upp Clojure and editor enviroment

2009-01-21 Thread Tom Ayerst
Sadly, it would not install for me. I am running 3.4.1 and I do Java dev so I should have all the dependencies. It installs without complaint but comes up broken in the about plugins and there is no function ality to be found. Tom 2009/1/21 lpetit > > Hello, > > If you want to give a "try" to

Re: Basic about setting upp Clojure and editor enviroment

2009-01-21 Thread Tom Ayerst
If you are an emacs fan I am told Clojurebox, no contest. If you are not comfortable with emacs I would recommend using a basic editor (if you want syntax highlighting you could use JEdit with the clojure config (search for it in the e-mail archive)) and a repl running from the commeand line (for

Re: [ANN] Dejcartes

2009-01-20 Thread Tom Ayerst
Mark, Thanks for doing this, I haven't had a chance to look at it yet but its been on the wish list for a while. Cheers Tom 2009/1/20 Mark Fredrickson > > Hello friends, > > I would like to announce a super-pre-alpha release of Dejcartes, a > Clojure wrapper around the JFreeChart charting lib

Re: Problem with simple web-app

2009-01-15 Thread Tom Ayerst
Oops, sorry, wrong group, I have posted to the compojure list now. 2009/1/15 Tom > > Hi, > > I am trying an example in Stuart Halloway's book but I am not getting > anywhere: > > loading the following: > > (ns reader.snippet-server > (:use [compojure html http jetty file-utils] >example

Re: How To Load Source File

2009-01-14 Thread Tom Ayerst
Glad to help. If you haven't found it yet the wiki is very helpful, especialyy: http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started If you want to spend some money Stuart Halloway's book is excellent http://www.pragprog.com/titles/shcloj/programming-clojure Cheers Tom 2009/1/14 On

Re: How To Load Source File

2009-01-14 Thread Tom Ayerst
This works for me in every configuration I could think of (at worst I get java.io.FileNotFoundException). Are you running a plain cmd prompt? (not MSys or cygwin) How did you launch clj? Rgds. Tom 2009/1/14 Onorio Catenacci > > Hi all, > > I'm new to Clojure and new to Lisp but not new to

Re: Clojure now running in production

2009-01-13 Thread Tom Ayerst
2009/1/13 Luc Prefontaine > Hi everyone, > > as of yesterday pm, Clojure is running in a live system in a big > veterinarian hospital. > > Congratulations, its always a real buzz to get something out and running in the wild, building it on something really new like Clojure must make it even bett

Re: YACS - Yes another one (Snake that is)

2009-01-12 Thread Tom Ayerst
hing like YACC? > > On Jan 12, 1:15 pm, "Tom Ayerst" wrote: > > For example, I am pretty sure I don't need to wrap 'send' in 'dosync' (it > > works without it). > > > > Tom > > > > 2009/1/12 Tom Ayerst > > > >

Re: How can I be useful to Clojure?

2009-01-12 Thread Tom Ayerst
1Learn Clojure 2Use it to solve real problems 3Help other people learn it 4Give feedback to Rich about issues so he can improve the implementation 5Maybe submit some useful generic pieces to Clojure Contrib 6Develop the first Killer App (Personally I'm still on 1 / 2) Chee

Re: YACS - Yes another one (Snake that is)

2009-01-12 Thread Tom Ayerst
For example, I am pretty sure I don't need to wrap 'send' in 'dosync' (it works without it). Tom 2009/1/12 Tom Ayerst > Hi, > > Following in a growing tradition I have written YACS (Yet Another Clojure > Snake); this one uses an Agent to hold the state and

YACS - Yes another one (Snake that is)

2009-01-12 Thread Tom Ayerst
Hi, Following in a growing tradition I have written YACS (Yet Another Clojure Snake); this one uses an Agent to hold the state and has separate GUI and model threads using invokeLater to update the GUI from the model in a thread safe way. At least that was the plan. My specific aims were to prac

Re: In core structure editor, anyone?

2009-01-09 Thread Tom Ayerst
Time to bug Chouser again ;-) How's textjure coming along? 2008/12/30 Chouser > > On Tue, Dec 30, 2008 at 1:24 AM, falcon wrote: > > > > How's textjure coming along? > > Not ready yet. :-/ Current sub-project: setting up sufficiently > flexible system to handle vi-style keybindings. > > --C

Re: yet another Clojure snake

2009-01-08 Thread Tom Ayerst
2009/1/8 Tom Ayerst > 2009/1/8 Mark Volkmann > >> >> > while cleanly painting the board; the two thread >> > approach flickers terribly when the snake is short. >> >> I could be wrong, but I don't think that flicker is related to my >> choice

Re: yet another Clojure snake

2009-01-08 Thread Tom Ayerst
2009/1/8 Mark Volkmann > > On Thu, Jan 8, 2009 at 11:05 AM, Tom Ayerst wrote: > > The point, for me, is that Mark Engelberg's construct allowed the system > to > > work with no mutation > > I don't yet see how that is possible. We agree then. > ..

Re: yet another Clojure snake

2009-01-08 Thread Tom Ayerst
gds. Tom 2009/1/8 Mark Volkmann > > On Thu, Jan 8, 2009 at 5:08 AM, Tom Ayerst wrote: > > > > Using loop - recur means there are now two threads in the code (The app > loop > > and Swing event loop) and these must be coordinated. This is, I think, > why > >

Re: yet another Clojure snake

2009-01-08 Thread Tom Ayerst
Hi Mark, I don't think this approach works in Clojure / Swing, but I may be mistaken, I often am. The issue is the event thread. In Abhishek's original and it's derivatives the Swing event thread is used and the timer pushes events into it so key press events and the game timer run in the same

Re: yet another Clojure snake

2009-01-07 Thread Tom Ayerst
Honestly? The second one, but I did say I didn't like the 'big let' style, maybe that is why. Cheers Tom 2009/1/7 Mark Volkmann > > On Wed, Jan 7, 2009 at 3:13 AM, Tom Ayerst wrote: > > Hi Mark, > > > I agree they could be inlined, but I find that style

Re: Very noob file reading and printing question

2009-01-07 Thread Tom Ayerst
uess. > > > On Wed, Jan 7, 2009 at 8:17 AM, Tom Ayerst wrote: > >> Thanks Barry, I now see what I did. >> >> I tried doseq early but it didn't print anything. I had: >> (with-open [r (reader "doc.txt")] >>(doseq [line (line-seq r)

Re: Very noob file reading and printing question

2009-01-07 Thread Tom Ayerst
cleaner version using doseq: > (use 'clojure.contrib.duck-streams) > > (with-open [r (reader "doc.txt")] > (doseq [line (line-seq r)] (println line))) > > > On Wed, Jan 7, 2009 at 7:27 AM, Tom Ayerst wrote: > >> Thanks Brian. >> >&

Re: Very noob file reading and printing question

2009-01-07 Thread Tom Ayerst
Thanks Brian. I finally nailed it with: (use '[clojure.contrib.duck-streams :only (reader)]) (with-open [r (reader "doc.txt")] (dorun (for [line (line-seq r)] (do (println line) Cheers Tom 2009/1/6 Brian Doyle > > On Tue, Jan 6, 2009 at 4:47 PM, Tom Ayerst

Re: yet another Clojure snake

2009-01-07 Thread Tom Ayerst
Hi Mark, I think the def inside a defn has to go, it looks like an accident in waiting. I think you are replacing globals with a "god" structure (game) which passed to every function, I think you need to abstract more. I'm afraid I don't like the "big let" style and I found it hard to follow some

Re: Very noob file reading and printing question

2009-01-06 Thread Tom Ayerst
> > On Tue, Jan 6, 2009 at 5:26 PM, Tom Ayerst wrote: > > Hi, > > > > How do I read and print a text file? I can read it, its the printing > that > > is the problem, I feel it should be obvious but I keep tripping myself > up. > > (The context is I need t

Very noob file reading and printing question

2009-01-06 Thread Tom Ayerst
Hi, How do I read and print a text file? I can read it, its the printing that is the problem, I feel it should be obvious but I keep tripping myself up. (The context is I need to extract data line by line, translate the line format and save it for a legacy app) Thanks Tom --~--~-~--~--

Re: yet another Clojure snake

2009-01-06 Thread Tom Ayerst
What is interesting to me (and as it should be, I guess) is that as the code gets more 'functional', it gets easier to work with, which is nice. Cheers Tom 2009/1/6 Rich Hickey > > On Tue, Jan 6, 2009 at 2:07 PM, Stuart Halloway > wrote: > > > > Hi Rich, > > > > Thanks for the suggestion. I h

Re: yet another Clojure snake

2009-01-06 Thread Tom Ayerst
Hi Stuart, There is a bug in end-game? which means it never ends. I'm not sure if this is the most idiomatic way to fix it but it seems to work. < (defn end-game? [{:keys [apple snake]}] < (cond < (lose? snake) (do (reset-game) "You lose!") < (win? snake) (do (reset-game) "You win!")))

Re: yet another Clojure snake

2009-01-06 Thread Tom Ayerst
Hi, I hope you don't mind, rather than comment on the code I made some changes (many lifted from Abhishek and Mark's implementation): add-points only creates one point and it doesn't move anything so name should change, suggest new-point (maybe new-head as it is always used by the snake?) def

Re: literate snake

2009-01-04 Thread Tom Ayerst
I tidied up a couple of things: Changed function name 'verify-direction' to 'new-direction' (it is more than a simple verification) Passed 'direction' and 'snake-head' to 'new-direction' to avoid accessing global state from inside the function Used destructuring to simplify let statement in new-hea

Re: literate snake

2009-01-02 Thread Tom Ayerst
Also; I think the 'get' is necessary on the get-snake-head and get-snake-body. 2009/1/2 Tom Ayerst > That def inside a function doesn't look right but I'm a noob at this too. > I managed to run the snake off the board which suggests the concurrency is > not quite

Re: literate snake

2009-01-02 Thread Tom Ayerst
That def inside a function doesn't look right but I'm a noob at this too. I managed to run the snake off the board which suggests the concurrency is not quite right. I would use 'cell' instead of 'grid'. Cheers Tom 2009/1/2 Mark Volkmann > > I've written a new version of the snake program th

Re: making code readable

2008-12-31 Thread Tom Ayerst
"'Redundant comments are useless' is the mantra of the dilettante, the amateur, and the cowboy."dilettante, the amateur, and the cowboy"", ouch. Redundant comments are... redundant (hence the name), and a support overhead and a source of misunderstanding if they are not updated in line with the cod

Re: making code readable

2008-12-29 Thread Tom Ayerst
A useful comment addition: How do I run it? Cheers Tom 2008/12/29 Mark Volkmann > > On Mon, Dec 29, 2008 at 3:58 PM, Chouser wrote: > > > > On Mon, Dec 29, 2008 at 4:40 PM, Mark Volkmann > > wrote: > >> > >> I think that's supposed to be + instead of *, at least Common Lisp > >> seems to us

Re: making code readable

2008-12-29 Thread Tom Ayerst
all your braces on the last line etc); you need to be thinking Lisp not Java, Ruby or whatever. Tom Ayerst 2008/12/29 Randall R Schulz > > On Monday 29 December 2008 09:11, lpetit wrote: > > You should consider using docstrings for documenting functions > > There's a big di