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
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))
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
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