Re: Transient Data Structures

2009-08-05 Thread Stu Hood
I really, really like this feature. My only complaint is that you have to use different names for the modifying functions. If the function signatures will be identical to their non-transient variants, then I guess the primary arguments would be: * Clojure convention for names of functions with sid

Re: why is io! not enforced?

2009-06-22 Thread Stu Hood
This won't work unfortunately, because it means that the in-memory transaction has already commited before the disk write is performed by the agent. If the application crashed at that point, your write was not durable. -- Sent from my Palm Pre ataggart wrote: On Jun 20, 4:59 pm, Rowdy Rednos

Metadata for Any Object

2009-04-29 Thread Stu Hood
Hey gang, Metadata support for pure Java objects is not currently supported, because it requires a modification to the object. Additionally, only some Clojure objects support metadata, due to the necessity of implementing the IMeta interface. This can be confusing for new users, and eliminates som

Re: [Discuss] Contribs with dependencies

2009-04-15 Thread Stu Hood
I agree. I think the "breaking into modules" approach is the only scalable solution. Someone else mentioned that clojure-contrib is/shouldbe an incubating area for core, which seems reasonable. There should be a little more pushback when a project wants to make it into contrib, and it should alrea

Re: advice needed converting large files to xml

2009-03-16 Thread Stu Hood
Yea, that would work. I don't think the (fn) should be defined anonymously though, because I could see it being useful on its own. Give it a name! Thanks, Stu On Mon, Mar 16, 2009 at 6:53 PM, Brian Doyle wrote: > > > On Mon, Mar 16, 2009 at 4:21 PM, Stu Hood wrote: > >>

Re: advice needed converting large files to xml

2009-03-16 Thread Stu Hood
If you write your CSV -> XML processing as a function, you could pmap ( http://clojure.org/api#pmap) that function across the list of input files. pmap will transparently create the threads as needed, and it will probably be enough to saturate your disk. Thanks, Stu On Mon, Mar 16, 2009 at 5:56

Re: Performance tips for Clojure

2009-03-14 Thread Stu Hood
There is a interface 'Counted' that a lot of Clojure data structures implement to indicate that they provide O(1) for (count). Thanks, Stu On Fri, Mar 13, 2009 at 4:59 AM, Christophe Grand wrote: > > Christian Vest Hansen a écrit : > > I think that count is O(n) for lists, no? > > > > Count is O

Re: Bytecode optimization

2009-03-14 Thread Stu Hood
Rich has done a lot of work to make sure that when you are working with primitives, the JVM bytecode ends up being very similar to what Java would generate. See http://clojure.org/java_interop#toc36 Thanks, Stu On Thu, Mar 12, 2009 at 6:20 PM, Howard Lewis Ship wrote: > > Well, at some point I'

Re: Laziness madness

2009-03-01 Thread Stu Hood
Laziness hit home for me in Clojure when I noticed that one of our Java library functions, looking for a Collection, had happily accepted a Clojure (map ...) object which was going to expand a small set of integers into much larger objects. Because Clojure deferred the work, they were only generate

Re: Simple math functions should support sequences

2009-02-03 Thread Stu Hood
> but apply works very well for this use case: (apply < (range 10)) > and it stops as soon as it can: Alright, I fold... thanks for clearing things up Christophe! On Tue, Feb 3, 2009 at 3:13 PM, Christophe Grand wrote: > > Stu Hood a écrit : > > I still think the > >

Re: Simple math functions should support sequences

2009-02-03 Thread Stu Hood
> This is a common misconception: passing a seq to apply doesn't force its > evaluation. Ahh, is this because the [& more] portion is itself a lazy sequence? That's very cool =) Hmm, the (reduce + ...) approach works just fine, but if it is already implemented as reduce, it seems like it would be

Re: Synchronization Benchmarks

2009-01-17 Thread Stu Hood
ding :) > > On Fri, Jan 16, 2009 at 4:21 AM, Stu Hood wrote: >>> Ah! but a mere hash table is not bi-directional :-) >> Right =) I got the idea in a Channel 9 video about MS' efforts with STM: >> http://channel9.msdn.com/shows/Going+Deep/Software-Transactional-Memory-

Re: test-is reporting problem

2009-01-15 Thread Stu Hood
You do that. -another Stuart On Thu, Jan 15, 2009 at 10:32 PM, Stuart Sierra wrote: > > I was afraid that would happen. I'll fix it, probably tomorrow. > -the other Stuart > > On Jan 15, 6:27 pm, Stuart Halloway wrote: > > The improved error reposting in test-is breaks some tests, e.g. from >

Re: Synchronization Benchmarks

2009-01-15 Thread Stu Hood
> Ah! but a mere hash table is not bi-directional :-) Right =) I got the idea in a Channel 9 video about MS' efforts with STM: http://channel9.msdn.com/shows/Going+Deep/Software-Transactional-Memory-The-Current-State-of-the-Art/(which reminds me, the spin-lock approach they try is probably fairly