Re: Aquamacs Preferences.el

2009-11-10 Thread martin_clausen
If it is only on directory and you are using a recent version of Java / * will pick up all jars in the directory. /mac On Nov 10, 5:08 am, Sean Devlin wrote: > Hello all, > I'm trying to add a directory to my classpath in Aquamacs.  How do I > do this recusively?  Here's what I've got right now

Re: Boggle solver

2009-11-10 Thread jng27
C and Common Lisp versions here --> http://code.google.com/p/boggle-solvers/ Both use the same algorithm and data structures as far as possible. The C version can solve a 1000x1000 board in about 40 seconds. The CL version solves a 1000x1000 board in about 65 seconds on a dual core laptop. Haven

Re: Boggle solver

2009-11-10 Thread james
Please, do as you will with my code! It's free for all to play with. TBH, I'm delighted that someone else can find use for it. I'd love to see what improvements you could make. I've also now posted up on the wiki page some plots of the performance using Incanter http://wiki.github.com/phraemer/Bo

filter using foldr point-free?

2009-11-10 Thread dm
Hi, We can define filter using foldr as under: filter1 p = foldr (\x xs -> (if (p x) then (x:xs) else xs)) [] Can we define filter using foldr but in pointfree style? How? Thanks -DM -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: Avoiding reflection/hinting with byte-array.

2009-11-10 Thread Rich Hickey
On Sat, Nov 7, 2009 at 3:13 PM, Chouser wrote: > > On Sat, Nov 7, 2009 at 2:57 PM, David Brown wrote: >> >> On Sat, Nov 07, 2009 at 11:48:32AM -0500, Chouser wrote: >> >>>This should work: >>> >>>    (defn update1 [#^MessageDigest md, #^bytes item] >>>      (.update md item)) >> >> This does seem

Re: Consistency of the API

2009-11-10 Thread Rich Hickey
On Mon, Nov 9, 2009 at 3:31 PM, Mark Engelberg wrote: > > 2009/11/9 Tiago Antão : >> What is the rationale for even? and contains? having different >> behaviors for the exact same error (ie, one throws the other works >> fine and just returns false on a type error)? From a design >> perspective th

Re: Running out of memory when using loop/recur and destructuring

2009-11-10 Thread Rich Hickey
On Wed, Nov 4, 2009 at 8:47 AM, Christophe Grand wrote: > > On Tue, Nov 3, 2009 at 7:27 PM, Paul  Mooser wrote: >> >> Ah -- I hadn't understood that when using destructuring, that >> subsequent bindings could refer to the destructured elements. I should >> have, since clojure "only" has let*, and

Re: Boggle solver

2009-11-10 Thread james
Nice. As soon as I get a chance I'll modify it to be able to solve arbitrary sized boards. Should be a perfect example to explore and demonstrate clojure's concurrency capabilities. On Nov 10, 5:42 pm, jng27 wrote: > C and Common Lisp versions here -->  http://code.google.com/p/boggle-solvers/ >

Re: Gensym collisions can be engineered.

2009-11-10 Thread John Harrop
On Mon, Nov 9, 2009 at 10:04 PM, Kevin Tucker wrote: > I in CL they can be read but aren't interned in any package so every > time you read it you get a different symbol. Yes, I know; I said that myself in the first post. But your first post inspired in me the idea of simply making symbols that

Re: Using agents and blocking I/O.

2009-11-10 Thread pmf
On Nov 10, 7:07 am, David Brown wrote: > Ok.  So, it's the existence of this future-like entity that blocks > upon deref until filled is indeed somewhat missing.  It's not > particularly difficult to implement. > > This thing could easily create a lazy sequence, in fact, the code > would look a lo

Re: Vector manipulation problem, possible function for a solution.

2009-11-10 Thread John Harrop
On Tue, Nov 10, 2009 at 1:00 AM, Richard Newman wrote: > > I have a vector a [ [2 3] [4 5] [6 7] ] > > > > And I want to be able to get [2 3 4 5 6 7] > > user=> (reduce into [ [2 3] [4 5] [6 7] ]) > [2 3 4 5 6 7] > This and another solution have already been posted, but there's also: (vec (appl

Re: Running out of memory when using loop/recur and destructuring

2009-11-10 Thread John Harrop
On Tue, Nov 10, 2009 at 7:21 AM, Rich Hickey wrote: > Right - pervasive locals clearing will definitely do the trick here. > Interestingly, when I was at Microsoft and asked them about handling > this issue for the CLR they stated plainly it wasn't an issue at all - > their system can fully detec

Re: Running out of memory when using loop/recur and destructuring

2009-11-10 Thread Christophe Grand
On Wed, Nov 4, 2009 at 6:46 AM, John Harrop wrote: > On Tue, Nov 3, 2009 at 1:53 AM, Alex Osborne wrote: >> >> The new loop uses the outer-let to get around this: >> (let [G__13697 s >>       [x & xs] G__13697 >>       y xs] >>   (loop* [G__13697 G__13697 >>           y y] >>          (let [[x &

Re: Using agents and blocking I/O.

2009-11-10 Thread David Brown
On Tue, Nov 10, 2009 at 07:41:41AM -0800, pmf wrote: >> This thing could easily create a lazy sequence, in fact, the code >> would look a lot like the code for seque, with just a separation of >> the writer from the reader.  I'll have to think about it to make sure >> that it can be used safely. >

Re: Using agents and blocking I/O.

2009-11-10 Thread John Harrop
On Tue, Nov 10, 2009 at 10:41 AM, pmf wrote: > On Nov 10, 7:07 am, David Brown wrote: > > Ok. So, it's the existence of this future-like entity that blocks > > upon deref until filled is indeed somewhat missing. It's not > > particularly difficult to implement. > > > > This thing could easily

Re: Using agents and blocking I/O.

2009-11-10 Thread John Harrop
On Tue, Nov 10, 2009 at 11:41 AM, John Harrop wrote: > user=> (take 10 (p-lazy-seq 3 true (thread-local-rand 10))) > (1 2 6 1 5 1 7 8 4 3) > > This should generate the random numbers on multiple threads, using multiple > RNGs. In the limit, on multicore hardware and with a slow enough RNG > imple

Re: ANN: Autodoc for clojure core, first rev

2009-11-10 Thread Tom Faulhaber
On Nov 9, 1:28 pm, Howard Lewis Ship wrote: > It looks very nice ... still I'd love to see something like what > clj-doc does (http://github.com/mmcgrana/clj-doc) ... it adds a text > field that you can type into and it matches the available names > against what you type, hiding the rest. Great

Re: Using agents and blocking I/O.

2009-11-10 Thread Anne Ogborn
Anybody else getting bombarded by multiple copies of this message? --- On Tue, 11/10/09, John Harrop wrote: > From: John Harrop > Subject: Re: Using agents and blocking I/O. > To: clojure@googlegroups.com > Date: Tuesday, November 10, 2009, 8:45 AM > On Tue, Nov 10, > 2009 at 11:41 AM, John Har

Re: Communication in a distributed system

2009-11-10 Thread Jeff Brown
On Mon, Nov 9, 2009 at 1:09 PM, Michael Jaaka wrote: > > Hi! > > Is there any support from Clojure for communication between procesess > by sockets? > I'm interested in communication via RMI. > How about agents? I don't know much about agents exept fact that they > are seen in terms of threads in

Better documentation and error messages are needed for the ns macro

2009-11-10 Thread John Harrop
So I have (ns foo.bar.baz) and I want to grab clojure.contrib.core/seqable? What do I do? (ns foo.bar.baz (use clojure.contrib.core :only seqable?)) # (ns foo.bar.baz (use [clojure.contrib.core :only seqable?])) # (ns foo.bar.baz (:use [clojure.contrib.core :only seqable?])) # etc.

Re: Better documentation and error messages are needed for the ns macro

2009-11-10 Thread Richard Newman
> (ns foo.bar.baz > (:use [clojure.contrib.core :only (seqable?)])) > > (and thus violates the usual clojure rule of using vectors rather > than lists for groupings that are not invocations -- that is, > function calls, macro calls, or special form calls). It works fine with a vector. user=

Re: Better documentation and error messages are needed for the ns macro

2009-11-10 Thread John Harrop
On Tue, Nov 10, 2009 at 9:11 PM, Richard Newman wrote: > > (ns foo.bar.baz > > (:use [clojure.contrib.core :only (seqable?)])) > > > > (and thus violates the usual clojure rule of using vectors rather > > than lists for groupings that are not invocations -- that is, > > function calls, macro ca

Re: Better documentation and error messages are needed for the ns macro

2009-11-10 Thread David Brown
On Tue, Nov 10, 2009 at 09:08:31PM -0500, John Harrop wrote: >In case anyone was wondering, apparently it wants > >(ns foo.bar.baz > (:use [clojure.contrib.core :only (seqable?)])) > >(and thus violates the usual clojure rule of using vectors rather than lists >for groupings that are not invocati