Re: logging

2010-09-15 Thread ataggart
We are speaking of two different things. SLF4J is a facade, like commons-logging (and to some extent c.c.logging). Their intent is to allow *libraries* to make logging calls, but leave the actual logging implementation up to the runtime application. This in principle allows multiple libraries' lo

Re: simplest graphics?

2010-09-15 Thread Lee Spector
On Sep 15, 2010, at 1:57 PM, Alan wrote: > This looks a lot like what I would do - I'm afraid I don't have any > brilliant insights for you. I do have a couple ways you could make > this smaller, though: > > - Instead of (atom ()) and convoluted swap! logic, what about (atom > []) and (swap! sha

Re: Feature idea: meta-macros

2010-09-15 Thread ngocdaothanh
> consider using or writing a preprocessor like m4 Could you elaborate on that? -- 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 p

Re: logging

2010-09-15 Thread Daniel Simms
On Wed, Sep 15, 2010 at 12:23 PM, ataggart wrote: > If you really need logging, then log4j is probably your best bet > anyway. Or SLF4J, which seems to be the way many (most?) java libraries depend on a some logging library. -- You received this message because you are subscribed to the Google

Re: stm vs. gc question

2010-09-15 Thread Laurent PETIT
beware pushing analogies too far ? :) 2010/9/15 Raoul Duke > hi, > > people have likened stm to gc. what would then be likened to memory > region inference? > > hrm. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, sen

stm vs. gc question

2010-09-15 Thread Raoul Duke
hi, people have likened stm to gc. what would then be likened to memory region inference? hrm. -- 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 moderat

Re: Feature idea: meta-macros

2010-09-15 Thread Nicolas Oury
You can also use binding eval evil brother : alter-var-root. On Wed, Sep 15, 2010 at 8:04 PM, Richard Newman wrote: > My suggestion is inline with other commenters: use binding. If that doesn't > satisfy you, consider using or writing a preprocessor like m4. > > -- > You received this message bec

Re: logging

2010-09-15 Thread ataggart
On Sep 15, 3:29 am, Jeff Rose wrote: > Hi ataggart, thanks for responding.  For one it made me realize that > the reason I wasn't getting any output by default is because I > happened to have log4j in my classpath for the current project (sucked > in as a dep for a sub-dependency).   If you real

Re: Feature idea: meta-macros

2010-09-15 Thread Richard Newman
My suggestion is inline with other commenters: use binding. If that doesn't satisfy you, consider using or writing a preprocessor like m4. -- 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

Re: Feature idea: meta-macros

2010-09-15 Thread Pedro Henriques dos Santos Teixeira
On Wed, Sep 15, 2010 at 3:35 PM, Luke VanderHart wrote: > Unless I misunderstand something, (binding...) wouldn't work for this > because I'd have to wrap all of the code I wanted to be "modified" > within a (binding...) form. Fine if it's one source file, not so fine > if I have dozens... Or am I

Re: Feature idea: meta-macros

2010-09-15 Thread Luke VanderHart
Oh, you're right, of course. Still, that doesn't quite meet the case I described, since the bindings won't effect any spawned threads/agents. On Sep 15, 2:47 pm, Alan wrote: > Binding uses dynamic scope, not lexical scope, right? So any functions > called before the binding expires will be affec

Re: Feature idea: meta-macros

2010-09-15 Thread Alan
Binding uses dynamic scope, not lexical scope, right? So any functions called before the binding expires will be affected by the new bindings, not just the code explicitly within its lexical scope. On Sep 15, 11:35 am, Luke VanderHart wrote: > Unless I misunderstand something, (binding...) wouldn

Re: Feature idea: meta-macros

2010-09-15 Thread Luke VanderHart
Unless I misunderstand something, (binding...) wouldn't work for this because I'd have to wrap all of the code I wanted to be "modified" within a (binding...) form. Fine if it's one source file, not so fine if I have dozens... Or am I missing something? On Sep 15, 2:26 pm, Nicolas Oury wrote: > Y

Re: Feature idea: meta-macros

2010-09-15 Thread Nicolas Oury
Your example can be solved with (binding ...) For the proposal, I think it's a bad idea : huge potential for abuse (and importing abuse from other namespaces written by other people) and little benefit. I wouldn't be so strongly against it if it was in a delimited scope. In any case, you can pro

Re: Feature idea: meta-macros

2010-09-15 Thread Alan
My guess is no. It would remove a huge benefit of Clojure, which is that you can tell, without having to look over the whole codebase, exactly what a given form does. (my-thing 20 [x y]) invokes my-thing, a function or macro, with 20 as its first argument, and then a vector of locals. No need to hu

Feature idea: meta-macros

2010-09-15 Thread Luke VanderHart
The ability to use macros to do code generation and transformation is extremely useful. However, you still have to explicitly "call" the macro everywhere you want it to be used. In many scenarios, it might be desirable to do code transformation/generation on code, without explicitly modifying that

Re: simplest graphics?

2010-09-15 Thread Alan
This looks a lot like what I would do - I'm afraid I don't have any brilliant insights for you. I do have a couple ways you could make this smaller, though: - Instead of (atom ()) and convoluted swap! logic, what about (atom []) and (swap! shapes conj new-shape)? - Similarly don't use (list shape-

Re: Clojure ensure

2010-09-15 Thread Daniel Gagnon
On Wed, Sep 15, 2010 at 10:44 AM, Stuart Halloway wrote: > Encounter time. I am sitting next to Rich as I write this. > Guaranteed or implementation detail? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojur

Re: simplest graphics?

2010-09-15 Thread Lee Spector
On Sep 15, 2010, at 8:32 AM, Lee Spector wrote: > > The code below is still more than I would like, and I'm wondering if there's > a more concise way to do this (again, without additional libraries). One way > to reframe my question is to imagine that you're in front of a class (as I > will be

Re: Clojure ensure

2010-09-15 Thread Stuart Halloway
Encounter time. I am sitting next to Rich as I write this. Stu > Ok, I have a 1 and 2 :) > > So is it pessimistic or optimistic? So encounter time ensure or commit > time ensure? > > On Sep 14, 9:36 pm, Stuart Halloway wrote: >> Actually, the second one is basically it. (Except that I don't kn

Re: simplest graphics?

2010-09-15 Thread Lee Spector
On Sep 14, 2010, at 4:59 PM, Alan wrote: > I think you could just keep a vector of (color,shape) pairs as an > atom, and reify a subclass of JPanel whose paint() method closes > around that atom, calling (.draw shape color). Then as long as you > call repaint every time you modify the atom, you s

Re: logging

2010-09-15 Thread Jeff Rose
Hi ataggart, thanks for responding. For one it made me realize that the reason I wasn't getting any output by default is because I happened to have log4j in my classpath for the current project (sucked in as a dep for a sub-dependency). It's a bit frustrating that the behavior is different depend