Re: idiomatic clojure of this java style ?

2010-04-25 Thread gary ng
On Sat, Apr 24, 2010 at 12:56 PM, Allen Johnson wrote: > Here's my attempt. I don't think you can do much about the imperative > style when you are calling Java APIs unless someone was nice and wrote > a clojure wrapper. But I'm just a n00b. > thanks for the help. When deployed to GAE, I got the

Re: idiomatic clojure of this java style ?

2010-04-24 Thread Allen Johnson
Oops, just saw the error in send-message as I replied. StatusMap should (get recipient). (defn send-message! [xmpp recipient body] (let [status (.sendMessage xmpp (create-message recipient body)) result (.. status getStatusMap (get recipient))] (= SendResponse$Status/SUCCESS result))

Re: idiomatic clojure of this java style ?

2010-04-24 Thread Allen Johnson
Here's my attempt. I don't think you can do much about the imperative style when you are calling Java APIs unless someone was nice and wrote a clojure wrapper. But I'm just a n00b. --- (ns example.servlet.xmpp (:use[clojure.contrib.logging]) (:import [xmpp.package.here XMPPServiceFactory M

idiomatic clojure of this java style ?

2010-04-24 Thread gary ng
Hi, As a newbie learning clojure, I would like to code in clojure rather than 'java disguised as clojure' and I am wondering what would it looks like for the following typical java(shown below) implementation. which has: 1. a static class member for the logger 2. and typical imperative style codi