Re: Log4j not detected when using recent jars

2010-01-12 Thread Shantanu Kumar
On Jan 12, 10:52 pm, Baishampayan Ghose wrote: > On Tuesday 12 January 2010 07:30 PM, Shantanu Kumar wrote: > > > This behaviour might occur due to an old Apache Commons-Logging JAR, > > several of which have had classpath / class-loading issues. Just a > > thought. > > Which is the recommended

Re: Help needed regarding the "let"

2010-01-12 Thread Mike Hinchey
You are effectively setting buf to null, that is implicit in a let. node-text doesn't persistently hold a reference to the buf does it? In a quick search, I see that StringBuilder will share the char[] with Strings from it's toString. I don't know if substring also shares, it may. Since you're re

Re: Bug with Clojure 1.2 REPL (aka master branch) ?

2010-01-12 Thread David Nolen
Erg. Turns out I was bitten by the Java classpath again. The path must be absolute, no ~ allowed. Thanks all. On Tue, Jan 12, 2010 at 9:58 PM, aria42 wrote: > I was seeing this error too and I reckoned it was because my > clojure.contrib was not compatible with clojure core. I think if > you're

classpath in clojure box

2010-01-12 Thread brian
Hi all, I put the example code from Programming Clojure book here: C:\shcloj-code\code\examples I verified that "introduction.clj" is there. This is cut and pasted from my .emacs file located in c:\program files\brian (setq swank-clojure-classpath (list "c:\shcloj-code\code\examples"))

trying to call jar files in clojure box

2010-01-12 Thread brian
Hi, I am not sure if this is a Clojure Box problem or a compojure problem but in an attempt to try calling external jars files in clojure box,and wanting to try compojure, to eliminate any possible path problems, I've put compojure and all dependancies in the Clojure Box/lib directory. When

Re: clojure.lang.Reflector.invokeMatchingMethod and type hints within macros

2010-01-12 Thread jpraher
after some more debugging, the issue seems more subtle: the method that has declaringClass target.getClass is apparantly of signature (Lcom/sun/jdi/ReferenceType)V; Though both are methods of interface MethodEntryRequest: http://java.sun.com/javase/6/docs/jdk/api/jpda/jdi/com/sun/jdi/request/Metho

Re: Swing unit testing

2010-01-12 Thread Brian Goslinga
On Jan 12, 8:39 am, Eric Thorsen wrote: > Anyone have any recommendation/experience for a unit testing library > for testing swing components? > > Thanks! > Eric We've used FEST [1] in school. It worked, but testing GUI code is horrible. [1] http://fest.easytesting.org/wiki/pmwiki.php -- You re

Re: clojure.lang.Reflector.invokeMatchingMethod and type hints within macros

2010-01-12 Thread jpraher
I looked into the code and found the following Problem with this particiular code (com.sun.jdi) implementation: I think the problem stems from within Reflector.java's invokeMatchingMethod with signature (String methodName, List methods, Object target, Object[] args) : (1) target.getClass() == Eve

Using axis2 from clojure

2010-01-12 Thread Mike Maul
I'm getting ClassNotFoundException: org.apache.axis2.transport.jms.JMSSender from stack trace below org.apache.axis2.deployment.DeploymentException: org.apache.axis2.transport.jms.JMSSender at org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders (AxisConfigBuilder.java:694

Re: What's the idiomatic way to parse a binding form

2010-01-12 Thread Meikel Brandmeyer
Hi, On Jan 12, 12:12 pm, Jarkko Oranen wrote: > > What's the idiomatic Clojure way for extracting values/keys from a > > binding form vector [key1 val1 key2 val2..] ? > > I suppose that depends on what you want, but: > > (apply hash-map keyvals) to make a map or > (map first (partition 2 keyvals

Re: Clojure Box 1.1

2010-01-12 Thread Chris Jenkins
Shawn, Mark, Thanks for the suggestions. I am definitely running as an Administrator and I don't have a .clojure dir in my home directory. The problem definitely seems to be the IBM JVM (on Windows) refusing to load an AOT compiled class in clojure-contrib. I'll investigate further when I get the

Re: Help needed regarding the "let"

2010-01-12 Thread Manish
Thanx for ur response, Actually We are using string builder in our project, String Builder causing the memory leak in as I google, Thats the main reason i want to set the StringBuilder object to nil, We are using the htmlunit core js library for fetching the web pages which require the javascript e

Re: Help needed regarding the "let"

2010-01-12 Thread Manish
Thanx for ur response, Actually We are using string builder in our project, String Builder causing the memory leak in as I google, Thats the main reason i want to set the StringBuilder object to nil, We are using the htmlunit core js library for fetching the web pages which require the javascript e

Re: Log4j not detected when using recent jars

2010-01-12 Thread ataggart
On Jan 12, 2:16 pm, Stuart Halloway wrote: > Is the performance impact of a runtime function call so critical for > logging that we need to do this at macro-expansion-time? Yes, insofar as I don't want performance impact to discourage people from peppering their code with (disabled) log messages.

Re: Contrib Logging change

2010-01-12 Thread ataggart
On Jan 12, 4:46 pm, Timothy Pratley wrote: > My thought would be to drop exceptions from normal logging calls. You mean dropping it from the level-specific macros such as error and fatal? I'm inclined to disagree; being able to access the exception instance itself is a Good Thing. It should b

Re: Bug with Clojure 1.2 REPL (aka master branch) ?

2010-01-12 Thread Timothy Pratley
2010/1/13 David Nolen : > java.lang.NoSuchMethodError: clojure.lang.RestFn.(I)V > (NO_SOURCE_FILE:0) I got this temporarily until I updated both clojure and contrib and did clean builds. Have you tried ant clean;ant ? -- You received this message because you are subscribed to the Google Groups "C

Re: Bug with Clojure 1.2 REPL (aka master branch) ?

2010-01-12 Thread aria42
I was seeing this error too and I reckoned it was because my clojure.contrib was not compatible with clojure core. I think if you're using 1.2 master of clojure you need 1.1 master of contrib. Is that right? On Jan 12, 6:41 pm, David Nolen wrote: > Hullo, > > I'm trying to run the REPL from the c

ANN: clj-doc, a library to generate API documentation for Clojure code to various markup languages.

2010-01-12 Thread Nicolas Buduroi
Hi, I announce my first open source project, it's really small and doesn't have lots of features yet, but I think it can be already useful in its current state. I'll always be open to suggestions to improve it, but as it's only version 0.3, now is the time to get things straight. There's two macro

Bug with Clojure 1.2 REPL (aka master branch) ?

2010-01-12 Thread David Nolen
Hullo, I'm trying to run the REPL from the command line. I note that when I include jars in the classpath, including clojure libraries works fine (via use for example). However when adding libraries of Clojure source directories to the classpath I get a very strange error: user=> (use 'lancet) ja

Re: Contrib Logging change

2010-01-12 Thread Chris Dean
ataggart writes: > Which is why I added the arglist metadata (shown via doc): > [level fmt & args] [level throwable fmt & fmt-args] Ah, good call. I missed that. Cheers, Chris Dean -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: Contrib Logging change

2010-01-12 Thread Phil Hagelberg
Alex Taggart writes: > Ok here's what I threw together:  http://gist.github.com/275527 > > It adds both println-style args as well as a formatting version. > > I like the idea of the level-specific convenience macros behaving like > print, but I'd prefer to move the throwable to be an optional fi

Re: Contrib Logging change

2010-01-12 Thread Timothy Pratley
My thought would be to drop exceptions from normal logging calls. 1) It wont *break* any code, it may change the log output slightly as the exception is rendered by str or format instead of by the java logging formatter. 2) I think this is least surprising. 3) The exception taking java call coul

Re: Lift and bind

2010-01-12 Thread Steven E. Harris
jim writes: > You know, I think you're right. I would refer you to part 2 of > Konrad's monad tutorial, but the link is broken. Check google's cache, > if you want to read an explanation immediately. That's how I've been reading his tutorials, as WordPress isn't delivering the pages. In "A mona

Re: Log4j not detected when using recent jars

2010-01-12 Thread Richard Newman
Is the performance impact of a runtime function call so critical for logging that we need to do this at macro-expansion-time? I would like for logging to be less magical in its implementation. I think Alex's goal was to approach the near-zero cost of Java logging implementations when loggin

Re: Log4j not detected when using recent jars

2010-01-12 Thread Stuart Halloway
Is the performance impact of a runtime function call so critical for logging that we need to do this at macro-expansion-time? I would like for logging to be less magical in its implementation. Stu Without looking too deeply, I think this is an issue with AOT compiling. As the c.c.logging d

Re: possible addition to duck-streams: input-stream

2010-01-12 Thread Stuart Halloway
Awesome. Hoping to work on contrib updater this week. Stu On Mon, Jan 11, 2010 at 21:52, Stuart Halloway wrote: contrib duck-streams has reader, but not an analogous input-stream. I find myself having a byte-level interop need for it. Welcome contribution? Your wish. My command. ;-) htt

Re: Contrib Logging change

2010-01-12 Thread ataggart
On Jan 12, 12:19 pm, Chris Dean wrote: > One downside of the new macros is that there is now one more check done > at runtime for every use.  There used to be just the impl-enabled? and > now there is a instance? call as well. True. One optimization I could make is to cover the most common case

Re: Contrib Logging change

2010-01-12 Thread Chris Dean
Alex Taggart writes: > Ok here's what I threw together: http://gist.github.com/275527 > > It adds both println-style args as well as a formatting version. One downside of the new macros is that there is now one more check done at runtime for every use. There used to be just the impl-enabled? a

Re: Log4j not detected when using recent jars

2010-01-12 Thread ataggart
Without looking too deeply, I think this is an issue with AOT compiling. As the c.c.logging docs note, the logging impl is chosen at macro-expansion-time. If contrib is fully AOTC'd, then that's when the logging impl will be chosen. There's an assembla ticket on it: https://www.assembla.com/spac

Re: Contrib Logging change

2010-01-12 Thread Alex Taggart
Ok here's what I threw together: http://gist.github.com/275527 It adds both println-style args as well as a formatting version. I like the idea of the level-specific convenience macros behaving like print, but I'd prefer to move the throwable to be an optional first arg. I tried to make it so i

Re: Log4j not detected when using recent jars

2010-01-12 Thread Luc Préfontaine
We have been using 1.2.14 for more than a year without any glitches yet. Luc On Tue, 2010-01-12 at 23:22 +0530, Baishampayan Ghose wrote: > On Tuesday 12 January 2010 07:30 PM, Shantanu Kumar wrote: > > This behaviour might occur due to an old Apache Commons-Logging JAR, > > several of which ha

Re: Log4j not detected when using recent jars

2010-01-12 Thread Baishampayan Ghose
On Tuesday 12 January 2010 07:30 PM, Shantanu Kumar wrote: This behaviour might occur due to an old Apache Commons-Logging JAR, several of which have had classpath / class-loading issues. Just a thought. Which is the recommended latest version of log4j? As I can see, 2.0 is too experimental an

Re: Contrib Logging change

2010-01-12 Thread Alex Taggart
My concern is it adds another chance of being tricked, e.g.: (catch Exception e (debug "got exception:" e)) One could be forgiven for thinking this would log a line containing the toString of the exception, but if the logging implementation wasn't configured to display the 'throwable' on debug,

Re: Creating an object given a class object

2010-01-12 Thread .Bill Smith
Sorry, that's true. newInstance doesn't take arguments. For what it's worth, looking up the correct constructor can be a tricky business. If you already know exactly which constructor you want, it's no big deal. On the other hand, if you want to write a general function that takes a class object

Re: What's the idiomatic way to parse a binding form

2010-01-12 Thread Gabi
I only need the simple way. To get a vector and to treats it as a set of key/vals. So, Jarkko's solution is what I was looking for. (apply hash-map keyvals) On Jan 12, 5:49 pm, samppi wrote: > Do you also want the binding to act like let's, with unpacking of > vectors and maps? > > If so, there's

Re: Swing unit testing

2010-01-12 Thread Eric Thorsen
I saw this. I'll give it a try. Thanks, Eric On Jan 12, 10:06 am, Roger Gilliar wrote: > Hi, > > we use Jemmy for this purpose (https://jemmy.dev.java.net/) > > Regards >    Roger -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: C interop lib (JNA wrapper)

2010-01-12 Thread mac
I had apparently forgotten to commit and push the last changes. Sorry for any trouble if anyone is trying to use the library. The callbacks should work now. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@go

Re: What's the idiomatic way to parse a binding form

2010-01-12 Thread samppi
Do you also want the binding to act like let's, with unpacking of vectors and maps? If so, there's no public function that I know of that's set apart for doing this—are you trying to do this in a function or a macro? If you're creating a macro, then it's easy: just splice the binding form into a l

Re: Swing unit testing

2010-01-12 Thread Rob Wolfe
Eric Thorsen napisał(a): > Anyone have any recommendation/experience for a unit testing library > for testing swing components? For simple module testing I use marathon [1] and for this purpose can recommend it. Test scripts can be written in Python not Clojure, though. ;) [1] http://www.marath

Re: Swing unit testing

2010-01-12 Thread Roger Gilliar
Hi, we use Jemmy for this purpose (https://jemmy.dev.java.net/) Regards Roger -- 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 b

Re: Swing unit testing

2010-01-12 Thread Sean Devlin
Eric, Testing view code is very difficult to automate. There's the java.awt.Robot class that Sun provided explicitly for this purpose. In my experience, I try to refactor as much as possible into my controllers (should be easy in Clojure). Also, I put dummy code in each view element and I manuall

Re: Help needed regarding the "let"

2010-01-12 Thread Laurent PETIT
When outside the 'let form, there is no more possibility to access the buffer variable, and if the object it referenced has not been made available elsewhere, it's eligible to garbage collection. What do you expect when you want to "set the value of buffer object to nil" ? 2010/1/12 Manish : > Hi

Swing unit testing

2010-01-12 Thread Eric Thorsen
Anyone have any recommendation/experience for a unit testing library for testing swing components? Thanks! Eric -- 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 memb

Re: Lift and bind (was: Understanding the continuation monad's bind operator)

2010-01-12 Thread Graham Fawcett
Hi, On Mon, Jan 11, 2010 at 8:44 PM, Steven E. Harris wrote: > Konrad Hinsen writes: > >> For a function of a single argument, m-lift and m-fmap are equivalent. > > In Jim Duey's essay Higher Level Monads¹, he writes the following on the > lift operator: > > ,[ m-lift ] > | If you have a fun

Re: Log4j not detected when using recent jars

2010-01-12 Thread Shantanu Kumar
This behaviour might occur due to an old Apache Commons-Logging JAR, several of which have had classpath / class-loading issues. Just a thought. Regards, Shantanu On Jan 12, 5:13 pm, Timothy Pratley wrote: > Hi, > > GOSUB raised this on IRC and I'm stumped as to the behavior, can > anyone help s

Log4j not detected when using recent jars

2010-01-12 Thread Timothy Pratley
Hi, GOSUB raised this on IRC and I'm stumped as to the behavior, can anyone help shed some light? In order to reproduce he provided a leiningen project: http://github.com/ghoseb/test-logging Now running a REPL from those dependencies (note you can just run lein deps; lein repl I am just listing

Re: What's the idiomatic way to parse a binding form

2010-01-12 Thread Jarkko Oranen
On Jan 12, 11:08 am, Gabi wrote: > What's the idiomatic Clojure way for extracting values/keys from a > binding form vector [key1 val1 key2 val2..] ? I suppose that depends on what you want, but: (apply hash-map keyvals) to make a map or (map first (partition 2 keyvals)) & (map second (partition

Re: Help needed regarding the "let"

2010-01-12 Thread Mike Hinchey
One of the big features of Clojure is you can't changes variables after they are initialized - in java terms, they are all final. However, when the let exits, the buffer variable is out of scope, so the StringBuilder object can be gc'd if that's what you're concerned about. Inside the let, you ca

What's the idiomatic way to parse a binding form

2010-01-12 Thread Gabi
What's the idiomatic Clojure way for extracting values/keys from a binding form vector [key1 val1 key2 val2..] ? -- 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 me

Re: Creating an object given a class object

2010-01-12 Thread Shantanu Kumar
On Jan 12, 12:50 pm, Konrad Hinsen wrote: > On 11 Jan 2010, at 23:09, .Bill Smith wrote: > > > Every class object has a newInstance method: > > > user=> (Class/forName "java.util.HashMap") > > java.util.HashMap > > user=> (.newInstance (Class/forName "java.util.HashMap")) > > # > > user=> > > >