Re: clojure-test-mode

2011-11-06 Thread Chris Jenkins
Did you ever figure out what was causing this? I'm on clojure-mode 1.11.2 with Clojure 1.3. When I run clojure-test-run-tests from within emacs, I see "error in process filter: Invalid read syntax: "#"" in the status mini buffer. The tests do seem to run ok but I'm curious what is going on. On 19

Re: How to :use a defrecord from another source file and namespace?

2010-09-07 Thread Chris Jenkins
Hi MichaƂ, Thanks for the explanation. I hadn't made the connection between the fact that defrecord creates a "proper" java type and the fact that a Java class would need to be :import-ed. I agree that creating a make-huss function might be simpler. Part of me is thinking "why don't I fall back on

How to :use a defrecord from another source file and namespace?

2010-09-07 Thread Chris Jenkins
I'm having trouble writing code in one namespace that instantiates a type that is defined in another namespace. I have two source files: other.clj defines a function called my-fn and a type called huss: (ns my-project.other) (defrecord huss [x y z]) (defn my-fn [] (println "my-fn")) core.

Re: Problem reloading source file with imports

2010-08-31 Thread Chris Jenkins
y want to replace the core version with the seq > version without any namespacing, do > > (:refer-clojure :exclude [partition-by]) > (:use [clojure.contrib [seq-utils :only [partition-by]]]) > > does that help? > > --Robert McIntyre > > > > > > > On Mon, A

Re: Problem reloading source file with imports

2010-08-30 Thread Chris Jenkins
Thanks for the pointers you guys. I changed my code to this: (ns test.core (:use [clojure.contrib.seq :only (indexed)])) ... (indexed being the function that I was interested in) and it now works ok. I can reload the file as many times as I like. I must confess that I am rather confused by all

Re: Problem reloading source file with imports

2010-08-30 Thread Chris Jenkins
ently get this warning and don't want to restart the repl > you can do > (ns-unmap 'your-namespace 'offending-function), fix the naked import, > and reload. > > --Robert McIntyre > > > > > On Mon, Aug 30, 2010 at 5:54 AM, Chris Jenkins > wrote: > &

Problem reloading source file with imports

2010-08-30 Thread Chris Jenkins
Since I switched to Clojure 1.2, I see an error message whenever I try to reload a source file that imports anything. The error message is of the form " already refers to xxx", as though it is complaining that it can't import the same thing twice. For example, I have a minimal source file that

Re: Clojure Web Programming group?

2010-08-18 Thread Chris Jenkins
Great idea. I'm trying to figure out web development in Clojure atm and a group to specifically talk about this area would be great. On 18 August 2010 11:20, Shantanu Kumar wrote: > +1 Neat idea. Starting a Google group "Clojure web development" might > be a solution. > > Regards, > Shantanu > >

Re: Testing to see if an object is an element of a sequence

2010-04-13 Thread Chris Jenkins
Thanks guys :-). I didn't know about some and includes?. On 4/13/10, Stuart Halloway wrote: > Hi Chris, > > includes? is in clojure.contrib.seq. Note that it runs in linear time. > > This will feature prominently in the FAQ when I update it. :-) > > Stu > >> Hi, >> >> Is there a standard function

Testing to see if an object is an element of a sequence

2010-04-13 Thread Chris Jenkins
Hi, Is there a standard function to test to see if an object is an element of a sequence? I'm looking for an equivalent of Haskell's elem function. I wrote my own (badly)... (defn elem? [obj l] (if (empty? l) false (if (= obj (first l)) true (elem? obj (rest l) ...but

Best way to cause compilation failure?

2010-02-23 Thread Chris Jenkins
Hi, What's the best way to force compilation to fail? For example, what if invalid arguments are passed into a macro? (throw (InvalidArgumentException.)) seems to do the trick. Is this the best way to do it? Cheers, Chris -- You received this message because you are subscribed to the Google

Re: browsing clojure source code

2010-02-23 Thread Chris Jenkins
If you can get emacs working with swank-clojure (I followed the instructions here http://github.com/jochu/swank-clojure to get it working on Emacs 23 on Linux) then you can interact with the running Clojure process. All you need to do is move the cursor over the symbol of interest and hit ALT-. to

Re: Suggest slime-redirect-inferior-output be default for Swank clojure

2010-01-21 Thread Chris Jenkins
Seconded. I found this very confusing when I first started with Clojure. 2010/1/21 Alex Stoddard > Hello, > > As detailed in Bradford Cross' blog, (http:// > measuringmeasures.blogspot.com/2010/01/agony-of-clojurehadoop-logging- > and-how.html) the rebinding of *out* done in the swank/slime repl

Re: Clojure Box 1.1

2010-01-12 Thread Chris Jenkins
I get the chance. Cheers, Chris 2010/1/11 Shawn Hoover > > On Mon, Jan 11, 2010 at 3:49 PM, Chris Jenkins wrote: > >> Out of curiosity, what configuration do you have in place that's causing >>> clojure.contrib.pprint to be loaded? >>> >>> &

Re: Clojure Box 1.1

2010-01-11 Thread Chris Jenkins
next question is, how can we find out why this is? There would appear to be two possibilities: 1) The IBM JVM is rejecting a valid class file 2) Clojure is emitting invalid bytecode that the Sun JVM doesn't mind but the IBM JVM rejects. 2010/1/11 Chris Jenkins > Incidentally, I just trie

Re: Clojure Box 1.1

2010-01-11 Thread Chris Jenkins
> > Out of curiosity, what configuration do you have in place that's causing > clojure.contrib.pprint to be loaded? > > I'm not sure - all I did was to install Clojure Box and then I immediately saw the error message when it started up. Do you know how I could learn more about the configuration? C

Re: Clojure Box 1.1

2010-01-11 Thread Chris Jenkins
? 2010/1/11 Chris Jenkins > Hi, > > I downloaded Clojure Box 1.1 from here http://clojure.bighugh.com/, > installed it and tried running it on Windows XP. Emacs starts ok and I get > an *inferior-lisp* buffer but I see the following error message: > > user=> user=> java.

Clojure Box 1.1

2010-01-11 Thread Chris Jenkins
Hi, I downloaded Clojure Box 1.1 from here http://clojure.bighugh.com/, installed it and tried running it on Windows XP. Emacs starts ok and I get an *inferior-lisp* buffer but I see the following error message: user=> user=> java.lang.Exception: No such var: swank.swank/ignore-protocol-version (

Re: Trouble with running in jline editor. (newbie question)

2010-01-10 Thread Chris Jenkins
Quick question: what operating system are you using? I would expect your command line to work fine on any *NIX platform. On Windows, you would need to replace the colon : with a semi colon ; 2010/1/10 piscesboy > I placed clojure.jar, jline.jar and jline-0.9.94.jar all in the same > directory.

Re: A Clojure Highlife

2009-11-29 Thread Chris Jenkins
(* y cell-height) >(dec cell-width) (dec cell-height)) > > > with: > > (defn render [#^Graphics g b] > (doseq [y (range height) x (range width)] ... > > No need for the nested doseqs. > > I'm thinking... clojuriffic? clojured? clojonic? :) > > ---

Re: A Clojure Highlife

2009-11-28 Thread Chris Jenkins
Cool - thanks. I didn't know about that function :-) 2009/11/27 John Harrop > On Thu, Nov 26, 2009 at 4:37 AM, Chris Jenkins wrote: >> >> (defn flip-cell [b x y] >> (let [row (nth b y) >> cell (nth row x) >> new-cell (- 1 cell) >> new-ro

Re: A Clojure Highlife

2009-11-26 Thread Chris Jenkins
Thanks for sharing this. Coincidentally, I just wrote my first Clojure program which was... an implementation of Conway's Game of Life :-) I took a different approach - I represented the board as a vector of vectors of integers (1 for alive, 0 for dead) and then implemented a new-board function tha

Re: Setting *warn-on-reflection* such that multiple threads can see it

2009-11-24 Thread Chris Jenkins
That's great - now why didn't I realise that :-) Thanks, Chris 2009/11/24 Christophe Grand > Hi, > > > On Tue, Nov 24, 2009 at 6:38 PM, Chris Jenkins wrote: > >> Is it possible to set *warn-on-reflection* such that it can be seen by >> multiple thread

Setting *warn-on-reflection* such that multiple threads can see it

2009-11-24 Thread Chris Jenkins
Hi, Is it possible to set *warn-on-reflection* such that it can be seen by multiple threads? I can't use def to define *warn-on-reflection* because it is defined in another namespace. I can use set! to change the value of the binding for one thread but this is not seen by other threads: (set! *wa