Re: :require farms in Clojure?

2011-07-20 Thread stu
one day we could have: (ns myproject (:require subproject.* :as :suffix) to require subproject.foo1 subproject.foo2... Thanks Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note

:require farms in Clojure?

2011-07-19 Thread stu
:as a] [foo.baz.b :as b] [foo.baz.c :as c...])) Is there an idiomatic way of coalescing these :require clauses into a :require farm that can be simply :require'd or is this the wrong way to manage namespaces in Clojure projects? Any advice much appreciated, Stu -- You received

Looking for examples of using Java iterators from Clojure...

2011-07-09 Thread stu
() until isDone() and using currentSegment() to retrieve the point coordinates. I'd guess this kind of iterator is widely used in the Java world, so can some kind person point to an example of Clojure code using a Java iterator in this way? Thanks in advance, Stu -- You received this message

Idiomatic way to reference a bundled data file from Clojure source?

2011-06-28 Thread stu
)/... construct but this kind of approach doesn't seem a good fit for Clojure or for the JVM facilities it provides. Can anyone point to a Clojure project that does this well? Thanks, Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: Idiomatic way to reference a bundled data file from Clojure source?

2011-06-28 Thread stu
to Dave and Stephen for your answers--just what I needed. Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first

Hygenic approach for using Java2D from Clojure?

2011-06-28 Thread stu
for safely using mutable Java objects in Clojure--especially with Clojure parallel programming constructs in mind. Thanks in advance, Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note

Re: 2D graphics options with Clojure?

2011-05-01 Thread stu
have any Clojure examples of Batik use I could look at? Thanks, Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient

2D graphics options with Clojure?

2011-04-29 Thread stu
is also an option via the Gnome Java bindings and Java interop? Are there other options that I'm missing that anyone would like to report on? Thanks in advance, Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

How to access specific java.awt.Color constructor?

2011-04-09 Thread stu
, but I think I'm missing something with the rest of the Color constructor. I've tried changing the components to a vector of floats or a Java array of floats with no luck. This is with Clojure 1.2 and the Java Platform SE 6 AWT classes. Any advice much appreciated. Stu -- You received

Re: How to access specific java.awt.Color constructor?

2011-04-09 Thread stu
with that constructor. Thanks Alan -- I realize now there's a subtle but important distinction there when doing Java interop. Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from

Re: Polymorphic functions in Clojure (or how to stop thinking in objects)...

2011-03-17 Thread stu
Hi, I wanted to take the opportunity to thank the people who responded to my question on thinking beyond O-O. The replies form a very useful slice through Clojure design strategies and idiomatic use of the language. Thanks! Stu -- You received this message because you are subscribed

Polymorphic functions in Clojure (or how to stop thinking in objects)...

2011-03-14 Thread stu
structures than vectors and structs for the shapes so they carry some kind of type information? I can see how a draw multi-method would work if the individual shapes could be distinguished, or am I going about this the wrong way? Any advice much appreciated, Stu -- You received this message because

Idiomatic way to handle name shadowing?...

2011-03-10 Thread stu
of naming changes to avoid the problem, e.g. (defstruct vector ...) and (defn vector+ ...) but not sure if that's making best use of Clojure namespaces? Any advice much appreciated, Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group

Re: Idiomatic way to handle name shadowing?...

2011-03-10 Thread stu
in the (ns...) form as shown here, Clojure developers don't need to choose non-shadowed names like vector or (defn vector+), but rather use the more natural forms and use (ns...) clauses to make everything clear as needed? Thanks, Stu -- You received this message because you are subscribed to the Google

Re: Transient Data Structures

2009-08-05 Thread Stu Hood
with side-effects, * An additional interface check in conj/assoc? But if after calling (conj v 1), you can't use the 'v' reference anymore, then did you really cause a side effect? Its another tree falling in the woods situation. Thanks, Stu On Wed, Aug 5, 2009 at 9:05 AM, Rich Hickey richhic

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

Metadata for Any Object

2009-04-29 Thread Stu Hood
. I know global state is Considered Harmful, but I think this would clarify the usage of metadata, and remove duplication in the implementation of Clojure. Thoughts? Stu --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

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

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: 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 hls...@gmail.com wrote: Well

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 christo...@cgrand.netwrote: Christian Vest Hansen a écrit : I think that count is O(n) for lists

Re: Laziness madness

2009-03-01 Thread Stu Hood
generated when they were actually needed, and saved memory the rest of the time. Thanks, Stu On Mon, Mar 2, 2009 at 1:17 AM, Laurent PETIT laurent.pe...@gmail.comwrote: Hello, The way I think about it is am I in a portion of code that does pure functional stuff, or am I doing side effects ? A pure

Re: Simple math functions should support sequences

2009-02-03 Thread Stu Hood
be very easy to allow (+) to take a sequence. I still think the ( (range 10)) ... use case is really worthwhile though, and I don't see a way to accomplish it with reduce. Thanks, Stu On Tue, Feb 3, 2009 at 1:36 PM, Christophe Grand christo...@cgrand.netwrote: Hello, stuhood a écrit

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 christo...@cgrand.netwrote: Stu Hood a écrit : I still think the ( (range 10

Re: Synchronization Benchmarks

2009-01-17 Thread Stu Hood
change that is commutative/indempotent. Also, RWDict fell apart on a quad core machine (independent of the number of writes): I'll try with the alternative fairness setting like you suggested. Thanks, Stu On 1/16/09, Christian Vest Hansen karmazi...@gmail.com wrote: Another thing you might want

Re: Synchronization Benchmarks

2009-01-15 Thread Stu Hood
: http://github.com/stuhood/clojure-conc/tree/master/results Two conclusions: 1. The overhead for STM with low contention is very reasonable, 2. Optimism + MVCC + persistence fall down when faced with a majority of writes. (see the 100% write case in the writes graph.) Thanks, Stu On Thu, Jan 15

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 the.stuart.sie...@gmail.com wrote: I was afraid that would happen. I'll fix it, probably tomorrow. -the other Stuart On Jan 15, 6:27 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: The improved error