Re: Writing a simple nrepl middleware and client

2012-12-26 Thread jaime
It looks like your connection is broken somehow, this might be caused by an 
OS level issue(firewall etc.) but not the application itself. To test if 
this is due to an OS level issue, I suggest you to try connect nREPL by 
telnet, here's how to start nREPL in a TTY mode, in any REPL session type 
following:
-

(use 'clojure.tools.nrepl.server)

(require '[clojure.tools.nrepl.transport :as t])

(*defonce* server (start-server :transport-fn t/tty :port 999))
-

then use telnet to connect to your new started nREPL server: telnet 
localhost 999.
In my opinion, if you can get through by this way, then it's the app issue; 
otherwise it may caused by OS setting/issue.

I wrote a small nREPL client(but in Lua: 
https://github.com/xiejianming/lua_nrepl_client) before. Something might 
cause your interest is that, by using this tool, you can check bencoded 
(default encoding protocol used by nREPL) messages sent by nREPL server 
directly; and you can also check something I call naked message from 
server. Just hope this will help you a little bit


在 2012年12月27日星期四UTC+8上午6时55分53秒,frye写道:

 Hi all, 

 I'm trying to put together some nrepl 
 middlewarehttps://github.com/clojure/tools.nrepl#middleware. 
 To get a basic understanding, I thought I would implement some simple nrepl 
 middleware in a test project as seen in *A)*. I can execute `M-x 
 nrepl-jack-in`. But executing the client, gives me an empty result 
 (`repl/response-values` pulls nil out of ()). So I tried a bare bones 
 communication example in the middleware 
 pagehttps://github.com/clojure/tools.nrepl#talking-to-an-nrepl-endpoint-programmatically
  (see *B*), but am still getting an error.  

 I like the example 
 givenhttps://github.com/technomancy/leiningen/blob/master/sample.project.clj#L138in
  the leiningen sample project. But it seems I need to get the basics 
 working in *A)* and *B)*, first. 

 Any insights here? Ultimately, I would like to create nrepl middleware for 
 i) Clojurescript compilation (*cljsbuild auto* (yes, I've already looked 
 at *hiredman/nrepl-cljs-middleware*)) and ii) a browser-connected repl 
 (*cljsbuild 
 repl-listen*). I want to have these facilities in a `*M-x nrepl-jack-in*` 
 session. 


 *A) basic nrepl middleware*


- project.clj (https://www.refheap.com/paste/7875) 
- middleware.clj (https://www.refheap.com/paste/7874) 
- client.clj (https://www.refheap.com/paste/7876) 


 *B) lein repl*

 $ lein new thing
 ...
 $ cd thing/
 $ lein repl

 nREPL server started on port 38789
 ...
 user= (require '[clojure.tools.nrepl :as repl])
 nil

 user= 
 user= (with-open [conn (repl/connect :port 38789)]
   #_=  (- (repl/client conn 1000)
   #_=(repl/message {:op eval :code (+ 2 3)})
   #_=repl/response-values))

 Exception in thread nREPL-worker-2 nil 
 user= java.net.SocketException: Broken pipe
   at java.net.SocketOutputStream.socketWrite0(Native Method)
   at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
   at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
   at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
   at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
   at clojure.tools.nrepl.transport$bencode$fn__214.invoke(transport.clj:81)
   at clojure.tools.nrepl.transport.FnTransport.send(transport.clj:27)
   at 
 clojure.tools.nrepl.middleware.pr_values$pr_values$fn$reify__479.send(pr_values.clj:23)
   at 
 clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__536$fn__538.invoke(interruptible_eval.clj:171)
   at clojure.core$comp$fn__4034.invoke(core.clj:2278)
   at 
 clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__529.invoke(interruptible_eval.clj:137)
   at clojure.lang.AFn.run(AFn.java:24)
   at 
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:619)




 Thanks in advance 

 Tim Washington 
 Interruptsoftware.ca 


 

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Anonymous Macros

2012-11-06 Thread jaime
May I know in what circumstances would an anonymous macro be applied? - I 
just don't think there's a way to define anonymous macro but maybe we can 
make a workaround by manipulating the macro syntax...

在 2012年11月7日星期三UTC+8上午8时17分37秒,Sean Neilan写道:

 Is there any way to write an anonymous macro in Clojure?

 This post:
 http://stackoverflow.com/questions/4074961/anonymous-macros-in-clojure
 says it's possible with some hacks and in version 1.3 Clojure will have 
 some kind of support for this.

 Thank you for your time.

 -Sean



-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Anonymous Macros

2012-11-06 Thread jaime
Well, logically the difference between a function and macro is just that 
the parameters will be evaluated in a function call but will not in a macro 
call. I suppose you can use anonymous function to achieve what you may want 
in a LET statement. 

And as SunNing said, Clojure will use meta tag :macro true of *Var* to 
identify a macro, but those var-look things defined within LET bindings are 
not *Vars*(they called locals?), I guess we are not able to make any 
'anonymous macros' there.

Maybe you can give us a more specific scenario of your requirement so that 
we can figure out how to make it work without 'anonymous macros'.

在 2012年11月7日星期三UTC+8上午11时12分24秒,Sean Neilan写道:

 I was hoping to write a macro inside of a let statement. The macro would 
 be returned from the let and keep closures to whatever was defined in the 
 let.
 Also, if possible, define multiple global macros inside of a let statement 
 so it's as if the let is returning multiple values.


 On Tue, Nov 6, 2012 at 9:07 PM, jaime xieji...@gmail.com javascript:wrote:

 May I know in what circumstances would an anonymous macro be applied? - I 
 just don't think there's a way to define anonymous macro but maybe we can 
 make a workaround by manipulating the macro syntax...

 在 2012年11月7日星期三UTC+8上午8时17分37秒,Sean Neilan写道:

 Is there any way to write an anonymous macro in Clojure?

 This post:
 http://stackoverflow.com/**questions/4074961/anonymous-**
 macros-in-clojurehttp://stackoverflow.com/questions/4074961/anonymous-macros-in-clojure
 says it's possible with some hacks and in version 1.3 Clojure will have 
 some kind of support for this.

 Thank you for your time.

 -Sean

  -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: generate two defns in macro

2012-08-21 Thread jaime
I don't see there's a way to eliminate out most parenthesis like this 
either. Maybe you can try to spit them out to somewhere and then read them 
back again...but you probably don't want to do this. ;-)

在 2012年8月21日星期二UTC+8下午11时00分31秒,Maris写道:


 Nothing is wrong with do block.I just thought maybe there is some 
 trick

 Fair enough.


 On Tuesday, 21 August 2012 15:55:04 UTC+1, lpetit wrote:

 Hello, 

 What's wrong with having 2 fns inside the top level do ?

 In Clojure, top level dos are split so that their children forms are 
 evaluated in sequence, as if you would have written them without the do.

 HTH,

 -- 
 Laurent

 2012/8/21 Maris maris.o...@gmail.com

 I want a macro that generates two defn's.

 (defn vote-suspend [this] (deref (.state this)))
 (defn vote-resume [this state] (reset! (.state this) state))

 I have written this:

 (defmacro suspendable [prefix]
   `(do (defn ~(symbol (str prefix suspend)) [~'this] (deref (.state 
 ~'this)))
(defn ~(symbol (str prefix resume)) [~'this ~'state] (reset! 
 (.state ~'this) ~'state

 It works but it has both defn's in *do *block*.*

 (*do* (clojure.core/defn vote-suspend [this] (clojure.core/deref 
 (.state this))) (clojure.core/defn vote-resume [this state] 
 (clojure.core/reset! (.state this) state)))


 is it possible to generate defn's without *do* ?


 I tried this:

 (defmacro suspendable [prefix]
   (list `(defn ~(symbol (str prefix suspend)) [~'this] (deref (.state 
 ~'this)))
 `(defn ~(symbol (str prefix resume)) [~'this ~'state] (reset! 
 (.state ~'this) ~'state

 But it creates parentheses around defn:

 user  (macroexpand-1  '(suspendable vote-))
 ((clojure.core/defn vote-suspend [this] (clojure.core/deref (.state 
 this))) (clojure.core/defn vote-resume [this state] (clojure.core/reset! 
 (.state this) state)))


 Maybe splice it?

 (defmacro suspendable [prefix]
   ~@(list `(defn ~(symbol (str prefix suspend)) [~'this] (deref 
 (.state ~'this)))
   `(defn ~(symbol (str prefix resume)) [~'this ~'state] 
 (reset! (.state ~'this) ~'state

 *Attempting to call unbound fn: #'clojure.core/unquote-splicing*  

 *unquote-splicing* must be inside syntax-quote block, right ?

 This creates parentheses again:

 (defmacro suspendable [prefix]
   `( ~@(list `(defn ~(symbol (str prefix suspend)) [~'this] (deref 
 (.state ~'this)))
 `(defn ~(symbol (str prefix resume)) [~'this ~'state] 
 (reset! (.state ~'this) ~'state)

 Is it not possible to return two sexp's from a macro ?

 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

why does Clojure need to cache keywords?

2012-07-18 Thread jaime
Hello,

When I read the source code keyword, say, Keyword.java (V1.3), I found that 
when we intern a keyword,   (if I understand it correctly)  it uses a 
cache for keywords:
=
public static Keyword intern(Symbol sym) {
if (sym.meta() != null)
sym = (Symbol) sym.withMeta(null);
*Util.clearCache(rq, table);*
Keyword k = new Keyword(sym);
ReferenceKeyword existingRef = table.putIfAbsent(sym,
new WeakReferenceKeyword(k, rq));
if (existingRef == null)
return k;
Keyword existingk = existingRef.get();
if (existingk != null)
return existingk;
// entry died in the interim, do over
table.remove(sym, existingRef);
return intern(sym);
}
==

well, I just don't understand why we need caching for keywords. Anyone 
could give me a hint?

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: why does Clojure need to cache keywords?

2012-07-18 Thread jaime
I doubt because keyword will use its internal Symbol object to compare with 
each other (or other objects), it means it's Symbol's interned strings(ns  
name) make the comparison fast but not this caching stuff. I found a 
find() method in source code but not sure if the cache is relevant to 
this method.

在 2012年7月18日星期三UTC+8下午4时52分25秒,dennis写道:

 Compare keywords can be very fast.
 在 2012-7-18 PM4:51,jaime xiejianm...@gmail.com写道:

 Hello,

 When I read the source code keyword, say, Keyword.java (V1.3), I found 
 that when we intern a keyword,   (if I understand it correctly)  it uses 
 a cache for keywords:
 =
 public static Keyword intern(Symbol sym) {
  if (sym.meta() != null)
 sym = (Symbol) sym.withMeta(null);
 *Util.clearCache(rq, table);*
  Keyword k = new Keyword(sym);
 ReferenceKeyword existingRef = table.putIfAbsent(sym,
  new WeakReferenceKeyword(k, rq));
 if (existingRef == null)
  return k;
 Keyword existingk = existingRef.get();
 if (existingk != null)
  return existingk;
 // entry died in the interim, do over
 table.remove(sym, existingRef);
  return intern(sym);
 }
 ==

 well, I just don't understand why we need caching for keywords. Anyone 
 could give me a hint?

 -- 
 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 post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: why does Clojure need to cache keywords?

2012-07-18 Thread jaime
make senseI just came up with this similar answer on my way 
home...Thanks.

在 2012年7月18日星期三UTC+8下午6时56分42秒,dennis写道:

 I think this cache is just the same with String.intern method in java,it 
 just want to reduce the cost (memory  cpu) of producing keywords 
 frequently especial when using them with map structure.

 2012/7/18 jaime xiejianm...@gmail.com

 I doubt because keyword will use its internal Symbol object to compare 
 with each other (or other objects), it means it's Symbol's interned 
 strings(ns  name) make the comparison fast but not this caching stuff. I 
 found a find() method in source code but not sure if the cache is 
 relevant to this method.

 在 2012年7月18日星期三UTC+8下午4时52分25秒,dennis写道:

 Compare keywords can be very fast.
 在 2012-7-18 PM4:51,jaime xiejianm...@gmail.com写道:

 Hello,

 When I read the source code keyword, say, Keyword.java (V1.3), I found 
 that when we intern a keyword,   (if I understand it correctly)  it uses 
 a cache for keywords:
 ==**===
 public static Keyword intern(Symbol sym) {
  if (sym.meta() != null)
 sym = (Symbol) sym.withMeta(null);
 *Util.clearCache(rq, table);*
  Keyword k = new Keyword(sym);
 ReferenceKeyword existingRef = table.putIfAbsent(sym,
  new WeakReferenceKeyword(k, rq));
 if (existingRef == null)
  return k;
 Keyword existingk = existingRef.get();
 if (existingk != null)
  return existingk;
 // entry died in the interim, do over
 table.remove(sym, existingRef);
  return intern(sym);
 }
 ==**

 well, I just don't understand why we need caching for keywords. Anyone 
 could give me a hint?

 -- 
 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 post.
 To unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en

  -- 
 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 post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




 -- 
 庄晓丹 
 Email:killme2...@gmail.com xzhu...@avos.com
 Site:   http://fnil.net
 Twitter:  @killme2008





-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: interests in Clojure internals

2012-06-08 Thread jaime
I glanced at the contents and it looks like this is a cool thing that I'm 
looking for. I will spend some time on it. Thank you Ken.

BTW, how can I view the second link (ending with .pamphlet) in a browser? I 
tried it in Chrome but it just gave me a plain text without any format.

在 2012年6月7日星期四UTC+8下午8时55分07秒,Ken Causey写道:

 On Thu, Jun 7, 2012 at 3:41 AM, jaime xiejianm...@gmail.com wrote: 
  Hello everyone, 
  
  I really have interests in internals of Cojure. I'm not talking about 
  massive details of its implementation but rather some kind of 
  overview/architecture of the language itself. I also know that reading 
  source code is one of the best ways to understand it but it's not easy 
 for 
  me to start because I don't have a big picture. 
  
  Is there any introduction articles/books online that could be reached? 
 even 
  a few pieces that talk about its internal could be great helps too. Or 
 maybe 
  some materials/books about language/compiler designing could help me 
 better 
  understand these stuffs?? 

 While I think the project is still in a very incomplete stage you can 
 find quite a bit of information in Tim Daly's re-organization of the 
 Clojure source code in literate form: 

 http://daly.axiom-developer.org/clojure.pdf 
 http://daly.axiom-developer.org/clojure.pamphlet 

  
  Thanks, 
  Jaime 


-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

interests in Clojure internals

2012-06-07 Thread jaime
Hello everyone,

I really have interests in internals of Cojure. I'm not talking about 
massive details of its implementation but rather some kind of 
overview/architecture of the language itself. I also know that reading 
source code is one of the best ways to understand it but it's not easy for 
me to start because I don't have a big picture.

Is there any introduction articles/books online that could be reached? even 
a few pieces that talk about its internal could be great helps too. Or 
maybe some materials/books about language/compiler designing could help me 
better understand these stuffs??

Thanks,
Jaime

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Which emacs packages?

2012-03-15 Thread jaime
Ha~! :) :)

在 2012年3月13日星期二UTC+8下午12时50分06秒,Cedric Greevey写道:

 On Mon, Mar 12, 2012 at 11:09 PM, jaime xiejianm...@gmail.com wrote:
  Is there any materials to introduce how to setup emacs env for a 
 beginner?

 Yes, this single word:

 Don't.

 :)



-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Which emacs packages?

2012-03-12 Thread jaime
Is there any materials to introduce how to setup emacs env for a beginner?

在 2012年3月9日星期五UTC+8上午2时06分49秒,Tassilo Horn写道:

 AndyK andy.kri...@gmail.com writes:

  Curious about which emacs packages folks use for increased Clojure
  productivity (beyond the obvious, like slime/swank-clojure)...

 For any lisp:

   - paredit
 http://www.emacswiki.org/emacs/ParEdit
   - highlight-parentheses
 http://www.emacswiki.org/emacs/HighlightParentheses

 For any programming:

   - highlight-symbol
 http://www.emacswiki.org/emacs/HighlightSymbol

 Bye,
 Tassilo



-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Performance of thread-local binding

2012-03-04 Thread jaime
Interesting

在 2012年3月4日星期日UTC+8上午8时56分56秒,Mikhail Kryshen写道:

 If I understand Clojure's dynamic vars correctly, in a context where some
 var *bar* is already thread-bound, the following code:

  (binding [*bar* new-val]
(foo))

 is semantically equivalent to:

  (let [old-val *bar*]
(set! *bar* new-val)
(try
  (foo)
  (finally
(set! *bar* old-val

 The latter version appears to be 3 to 4 times faster if (foo) does nothing.

 The binding macro in the first version expands to something like:

  (push-thread-bindings (hash-map (var *bar*) new-val))
  (try
(foo)
(finally (pop-thread-bindings)))

 So the binding macro uses some stack implementation instead of just
 remembering the old value on the JVM call stack like the faster version
 does. I am probably missing something, but why do dynamic vars need to
 have their own stack for bindings?

 Also I noticed that replacing (hash-map (var *bar*) new-val) with
 {(var *bar*) new-val} in the above macro expansion makes it about 1.5-2
 times faster. This could also be fixed in the source of the binding
 defmacro by changing the following line:

  (push-thread-bindings (hash-map ~@(var-ize bindings)))

 to:

  (push-thread-bindings ~(apply hash-map (var-ize bindings)))

 --
 Mikhail



-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Struggling in making a sub-process work in an interactive way

2012-01-12 Thread jaime
Well actually I also tried commons-exec but it's the same as
clojure.java.shell - they run system command directly, after execution
they return and terminate. That's not the way I want

On Jan 13, 2:42 am, Denis Labaye denis.lab...@gmail.com wrote:
 Hi,

 In Java you would do it with common-exec:http://commons.apache.org/exec/

 So add the deps to your project.clj :

 :dependencies [[org.apache.commons/commons-exec 1.1]]

 And use Clojure's Java interop.

 Keep us posted, I will need to do the same thing soon :)

 Denis







 On Wed, Jan 11, 2012 at 4:05 AM, jaime xiejianm...@gmail.com wrote:
  I didn't read your code carefully yet but I think you're meaning to
  copy streams between my Clojure code and the sub-process, actually
  I've tried this but this is probably not what I want.
  I might not make myself clear. So here I go again:
   1. I writing a program which will open an OS shell (that means cmd
  under Windows and bash under Linux) as sub-process
   2. this shell thing will not terminate while my code is still
  running, all system commands such as dir/ls/cat etc. will be thrown
  into     the shell's input-stream to execute and the result is pulled
  from shell's output-stream/err-stream
   3. because when the shell will finish its execution is
  unpredictable, I chained an echo stop-sign command to original
  command so that the program can get the sign when execution done. E.g.
  for command dir, I will throw dir echo stop-sign to the shell,
  when a stop-sign is captured then it knows the execution finished
   4. it works well so far but when the system command is interactive
  one such as 'time' (in Windows), the program will hang; if there are
  ways to know when to require user input then I can resolve this in the
  code, but the answer is NO. I didn't find a way to detect this
   5. thus I tried to find out any workarounds but failed. I also tried
  the way you mentioned here, it can work in an interactive way but in
  this case I cannot get the control back.

  That's all the things I'm struggling on...

  On Jan 10, 4:54 pm, Alan Malloy a...@malloys.org wrote:
   On Jan 9, 9:24 pm, Phil Hagelberg p...@hagelb.org wrote:

jaime xiejianm...@gmail.com writes:
 Later on I tried to add code that can make this possible but I found
 there's no way to detect if a command requires user's input and thus
  I
 have to find another way to make it work - but I didn't success and
 have been struggling for a workaround for a long while

 anyone has any idea?

As far as I know this is impossible to do without bringing in
third-party libraries; this is just a (rather serious) shortcoming of
the JDK. I haven't looked into it enough to know which libraries would
offer it though.

   This should be possible if you don't mind suiciding your own process's
   stdin/stdout, by blindly forwarding all your input and output through
   the child. But if you send the child some input it didn't need, and it
   terminates, and then later you need your own stdin again, some pieces
   will be missing.

   I was going to attach a simple proof of concept to this, but I can't
   seem to get it right. So instead, here's what I was trying to do, and
   if someone wants to take it up this might be something useful to work
   from:

   (ns fork.core
     (:require [clojure.java.io :as io])
     (:import (java.io PipedReader PipedWriter))
     (:gen-class))

   (defn -main [ args]
     (println Start typing, I'll cat it back atcha!)
     (let [child (- (Runtime/getRuntime) (.exec /bin/cat))
           cin (.getInputStream child)
           cout (.getOutputStream child)

           in-pipe-in (PipedReader.)
           in-pipe-out (PipedWriter. in-pipe-in)

           out-pipe-in (PipedReader.)
           out-pipe-out (PipedWriter. out-pipe-in)

           in *in*, out *out*] ;; avoid dynamic-binding issues
       (future (io/copy in in-pipe-out)) ;; read my stdin...
       (future (io/copy in-pipe-in cout)) ;; write it to child's stdin

       (future (io/copy cin out-pipe-out)) ;; read child's stdout...
       @(future (io/copy out-pipe-in out)) ;; write it to my stdout, and
   wait for it to finish
       (let [exit-code (.waitFor child)]
         (println Child process finished with exit code exit-code)
         exit-code)))

  --
  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 post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

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

Re: Struggling in making a sub-process work in an interactive way

2012-01-10 Thread jaime
I didn't read your code carefully yet but I think you're meaning to
copy streams between my Clojure code and the sub-process, actually
I've tried this but this is probably not what I want.
I might not make myself clear. So here I go again:
  1. I writing a program which will open an OS shell (that means cmd
under Windows and bash under Linux) as sub-process
  2. this shell thing will not terminate while my code is still
running, all system commands such as dir/ls/cat etc. will be thrown
into the shell's input-stream to execute and the result is pulled
from shell's output-stream/err-stream
  3. because when the shell will finish its execution is
unpredictable, I chained an echo stop-sign command to original
command so that the program can get the sign when execution done. E.g.
for command dir, I will throw dir echo stop-sign to the shell,
when a stop-sign is captured then it knows the execution finished
  4. it works well so far but when the system command is interactive
one such as 'time' (in Windows), the program will hang; if there are
ways to know when to require user input then I can resolve this in the
code, but the answer is NO. I didn't find a way to detect this
  5. thus I tried to find out any workarounds but failed. I also tried
the way you mentioned here, it can work in an interactive way but in
this case I cannot get the control back.

That's all the things I'm struggling on...

On Jan 10, 4:54 pm, Alan Malloy a...@malloys.org wrote:
 On Jan 9, 9:24 pm, Phil Hagelberg p...@hagelb.org wrote:

  jaime xiejianm...@gmail.com writes:
   Later on I tried to add code that can make this possible but I found
   there's no way to detect if a command requires user's input and thus I
   have to find another way to make it work - but I didn't success and
   have been struggling for a workaround for a long while

   anyone has any idea?

  As far as I know this is impossible to do without bringing in
  third-party libraries; this is just a (rather serious) shortcoming of
  the JDK. I haven't looked into it enough to know which libraries would
  offer it though.

 This should be possible if you don't mind suiciding your own process's
 stdin/stdout, by blindly forwarding all your input and output through
 the child. But if you send the child some input it didn't need, and it
 terminates, and then later you need your own stdin again, some pieces
 will be missing.

 I was going to attach a simple proof of concept to this, but I can't
 seem to get it right. So instead, here's what I was trying to do, and
 if someone wants to take it up this might be something useful to work
 from:

 (ns fork.core
   (:require [clojure.java.io :as io])
   (:import (java.io PipedReader PipedWriter))
   (:gen-class))

 (defn -main [ args]
   (println Start typing, I'll cat it back atcha!)
   (let [child (- (Runtime/getRuntime) (.exec /bin/cat))
         cin (.getInputStream child)
         cout (.getOutputStream child)

         in-pipe-in (PipedReader.)
         in-pipe-out (PipedWriter. in-pipe-in)

         out-pipe-in (PipedReader.)
         out-pipe-out (PipedWriter. out-pipe-in)

         in *in*, out *out*] ;; avoid dynamic-binding issues
     (future (io/copy in in-pipe-out)) ;; read my stdin...
     (future (io/copy in-pipe-in cout)) ;; write it to child's stdin

     (future (io/copy cin out-pipe-out)) ;; read child's stdout...
     @(future (io/copy out-pipe-in out)) ;; write it to my stdout, and
 wait for it to finish
     (let [exit-code (.waitFor child)]
       (println Child process finished with exit code exit-code)
       exit-code)))

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Struggling in making a sub-process work in an interactive way

2012-01-09 Thread jaime
Hello there,

I'm writing some code, int my code it does following things (under
Windows):
1. create a sub-process by (.exec (Runtime/getRuntime) cmd) named
shell
2. get input-stream, output-stream and err-stream from the shell
object
3. send commands to shell by dropping line into the output-string
then get any result from input-stream/err-stream

now it works fine for NON-interactive command such as dir or help,
but it will hang when I send the shell commands that require user
input, such as time. I think the reason is that my code doesn't
detect any input requirement so the shell keep waiting for an input
infinitely.

Later on I tried to add code that can make this possible but I found
there's no way to detect if a command requires user's input and thus I
have to find another way to make it work - but I didn't success and
have been struggling for a workaround for a long while

anyone has any idea?

Thanks,
Jaime

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: want to make a 'debug' function, how to get current source and line number?

2011-12-17 Thread jaime
Wow yes, by using *print-length* I can control the amount of items to
be printed in a collection. That's cool, thank you.

On 12月17日, 上午7时34分, Cedric Greevey cgree...@gmail.com wrote:
 2011/12/16 jaime xiejianm...@gmail.com:

  Yes this is a good point, but how can I avoid this blowing up problem
  if I'm not handling a single variable (just as the code in my last
  post)?

 Someone else indicated that just using pr-str and using the
 *print-length* and *print-level* vars can avoid the problem.

 Or, you could map my (if ...) expression over all of the variables.

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: want to make a 'debug' function, how to get current source and line number?

2011-12-16 Thread jaime
Thank all of you for the information. I finally picked up an approach
of using form and *file*, and here's my code snippet of the
function:
==
(defmacro debug
  Print debug info.
  [ variables]
  (let [datetime 2011-12-17 01:59:37
naked-msg (str Debug:  datetime  in  *file* @ (:line
(meta form)))]
  (if (empty? variables)
(println naked-msg)
`(let [kvs# (zipmap (map #(str %  =) '~variables)
(vector ~@variables))]
   (println (str ~naked-msg :) kvs#)
==
Basically it works for me now.But yes, in my code I don't know how
to avoid blowing up problem if there's any loong seq variable
there being debugged - if you have any ideas about fixing this issue,
please let me know.

And about the tricky thing by using exception to capture file name 
line number - even though it's also the first idea came into my mind
but - I didn't tried that way because I think this might not be a good
solution. Comparing with using form, which solution would you prefer
and why? (I prefer to use form because I think this is more efficient
(but I don't have a proof.))

On 12月15日, 下午1时48分, jaime xiejianm...@gmail.com wrote:
 Hello there,

 I want to write a function named debug which will print out date-
 time msg + current source-line + etc. info, but I don't know how to
 get the current source and line number of the running point (just like
 what REPL does when encounter any exceptions) ...

 Got any ideas?

 Thanks!

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: want to make a 'debug' function, how to get current source and line number?

2011-12-16 Thread jaime
Yes this is a good point, but how can I avoid this blowing up problem
if I'm not handling a single variable (just as the code in my last
post)?

On 12月16日, 上午5时09分, Cedric Greevey cgree...@gmail.com wrote:
 On Thu, Dec 15, 2011 at 1:54 PM, Alan Malloy a...@malloys.org wrote:
  This will print all the debug information at compile time, which is
  usually not what you want. I have a little macro I use called ?, which
  looks like:

  (defmacro ? [x]
   `(let [x# ~x]
  (prn '~x '~'is x#)
  x#))

  You could add file and line information to this fairly simply:

  (defmacro ? [x]
   (let [line (:line (meta form))
 file *file*]
 `(let [x# ~x]
(println (pr-str '~x) is (pr-str x#)
 (str ; ( ~file : ~line )))
x#)))

  And use it like so:

  user (let [x 10]
 (+ 5 (? x)))
  x is 10 ; (NO_SOURCE_FILE:1)
  15

 You might want to change

 (pr-str x#)

 to something like

 (pr-str
   (if (seq? x#)
 (let [s (Object.)]
   (if (= (nth x# 11 s) s)
 x#
 (concat (take 10 x#) ['...])))
 x#))

 which will print sequences longer than ten elements as (1 2 3 4 5 6 7
 8 9 10 ...) and prevent infinite seqs from blowing things up. Or more
 generally you might want to go through pprint which lets you set
 *print-len* and *print-level* to generally control the printing of
 very large and/or deeply-nested structures. But that adds a new
 dependency that needs to be required anywhere you use the macro ...

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: want to make a 'debug' function, how to get current source and line number?

2011-12-15 Thread jaime
Great! that's exactly what I want. Thank you!
This is the first time I meet form, is there any document about
this 'form' or relevant things?

On 12月15日, 下午9时19分, Jay Fields j...@jayfields.com wrote:
 This should get you started:

 (defmacro debug [x]
   (println x)
   (println (pr-str form))
   (println *file*)
   (println (meta form)))







 On Thu, Dec 15, 2011 at 12:48 AM, jaime xiejianm...@gmail.com wrote:
  Hello there,

  I want to write a function named debug which will print out date-
  time msg + current source-line + etc. info, but I don't know how to
  get the current source and line number of the running point (just like
  what REPL does when encounter any exceptions) ...

  Got any ideas?

  Thanks!

  --
  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 post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


want to make a 'debug' function, how to get current source and line number?

2011-12-14 Thread jaime
Hello there,

I want to write a function named debug which will print out date-
time msg + current source-line + etc. info, but I don't know how to
get the current source and line number of the running point (just like
what REPL does when encounter any exceptions) ...

Got any ideas?

Thanks!

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Lookup on a symbol?

2011-11-24 Thread jaime
But we still don't know why it behaves like this and for what
reason. does (:a 1 2) returns 2 make any sense??

On Nov 24, 3:30 pm, Sean Corfield seancorfi...@gmail.com wrote:
 On Wed, Nov 23, 2011 at 9:48 PM, Alan Malloy a...@malloys.org wrote:
  Other way round. It behaves like a keyword, looking itself up in a
  map:
  ('x '{x 1 y 2}) yields 2. You see the same behavior with (reduce :and
  [5 10]), yielding 10.

 Ah... I didn't realize that the lookup could be done without an
 exception on non-collections!

 (:a 1 2) yields 2 which surprises me a bit... I'd expect an error
 because 1 is not a collection that :a can look itself up in.

 Learn something new every day! :)
 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View --http://corfield.org/
 World Singles, LLC. --http://worldsingles.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: (dir *ns*) doesn't work??

2011-10-27 Thread jaime
Oh yes you guys are right. I should have look at the source first:
(defmacro dir
  Prints a sorted directory of public vars in a namespace
  [nsname]
  `(doseq [v# (dir-fn '~nsname)]
 (println v#)))

from it, we can see the quote thing. Thank you all. I got it now!

On Oct 27, 5:12 pm, Ben Smith-Mannschott bsmith.o...@gmail.com
wrote:
 dir is a macro. It doesn't evaluate its arguments. So when you say
 (dir *ns*), Clojure sees: show me what's in the namespace named
 *ns*, and there is no such namespace because *ns* is the name of a
 variable which contains the name of the current namespace.

 Dir is this way because for interactive use, it's convenient not to
 have to quote the symbol naming the namespace.  So (dir user) and (dir
 clojure.core) should work.

 In your situation you'll want to call dir-fn, which is a function that
 will evaluate its arguments, so:

 if we assume (= *ns* 'user) (i.e. you're currently in the namespace user)
 (dir-fn *ns*)
 is equivalent to
 (dir-fn 'user)
 and
 (dir user)

 HTH
 // Ben







 On Thu, Oct 27, 2011 at 10:57, jaime xiejianm...@gmail.com wrote:
  Hi there, when I tried to execute (dir *ns*) in REPL, I found it
  doesn't work -- with exception of:
           Exception No namespace: *ns* found  clojure.core/the-ns
  (core.clj:3689)
  I'm not sure if I used it the right way. Following are my execution
  tries:
  =
  Clojure 1.3.0
  user= (doc dir)
  -
  clojure.repl/dir
  ([nsname])
  Macro
   Prints a sorted directory of public vars in a namespace
  nil
  user= (dir *ns*)
  Exception No namespace: *ns* found  clojure.core/the-ns (core.clj:
  3689)
  user= *ns*
  #Namespace user
  user= (the-ns *ns*)
  #Namespace user
  user= (the-ns 'user)
  #Namespace user
  user=
  =
  Any suggestions??

  --
  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 post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: repl output for list seems inconsistent and a holdover from yesteryear

2011-10-26 Thread jaime
More reasonable..

On Oct 27, 7:15 am, Stuart Halloway stuart.hallo...@gmail.com wrote:
  checking out the Try Clojure:

  if you type the following, you get output that matches what you typed
  in every case except for lists.

  Vectors: -- [1 2 3 4]
  [1 2 3 4]

  Maps: -- {:foo bar 3 4}
  {:foo bar 3 4}

  Lists: -- '(1 2 3 4)
  (1 2 3 4)  - *INCONSISTENT* why not render this as '(1 2 3 4) ...
  this would make much more sense to newbies.

  Sets: -- #{1 2 3 4}
  #{1 2 3 4}

 This is an interesting question. Consistency is important, but consistency 
 with what? Your mental model for what happens at the REPL needs to keep the 
 R, E, and P steps clearly separate.

 Working backward:  the P (Print) prints things in a way that they can be read 
 back, where possible:

 (read-string [1 2 3 4])
 = [1 2 3 4]

 (read-string (1 2 3 4))
 = (1 2 3 4)

 (read-string #{1 2 3 4})
 = #{1 2 3 4}

 (read-string {1 2 3 4})
 =  {1 2, 3 4}

 If the P part of the REPL put a tick in front of lists, they would not read 
 back correctly:

 (read-string '(1 2 3 4))
 = (quote (1 2 3 4))             INCONSISTENT

 Now to the R (Reader) part. If, as you suggest, the tick were part of the 
 reader syntax for lists, you could fix the inconsistency above:

 ;; hypothetical Clojure with '(...) list literals
 (read-string '  '(1 2 3 4))
 = (1 2 3 4)

 Finally, consider the poor E (Evaluator) in this scenario.  The evaluator 
 must (1) evaluate lists except (2) *not* evaluate lists that are protected by 
 quote. But now that the tick is part of the syntax you have two challenges:

 (1) Since the tick no longer prevents evaluation, you have to spell out the 
 quote (and still use the tick!)

 ;; hypothetical literal list
 (quote '(1 2 3))

 (2) Since the tick is required as part of list syntax, your programs have to 
 be written with ticks everywhere like this:

 '(defn hello-world
   []
   '(println hello)

 You have to understand R, E and P as separate steps to understand the REPL.

 As a side note, it is worth mentioning that the REPL is composed of three 
 simple parts, and that interactive shells that do not have this factoring are 
 much less useful. Imagine if your language didn't separate reading and 
 evaluating. You would need JSON or something to serialize data...

 Stu

 Stuart Halloway
 Clojure/corehttp://clojure.com

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Literate programming

2011-10-26 Thread jaime
is there a place introducing (e.g. overview) more about Literate? have
no ideas about this stuff.

On Oct 27, 3:06 am, d...@axiom-developer.org wrote:
 I see that my Literate Programming session is beginning to gain some
 traction. I would encourage you to bring examples. We can discuss the
 merits and possibly gain some new insights. If nothing else, please
 sign up for the Literate Software session at Clojure-Conj. I promise
 to keep it short.

 Literate programming can take various forms. I am working on a survey
 of literate software. I came across an interesting non-latex example
 worth sharing:

 http://jashkenas.github.com/coffee-script/documentation/docs/nodes.html

 Notice how well they have documented an apparently simple line as in:

   exports.Base = class Base

   The Base is an abstract base class for all nodes in the syntax tree.
   Each subclass implements the compileNode method, which performs the
   code generation for that node. To compile a node to JavaScript, call
   compile on it, which wraps compileNode in some generic extra smarts,
   to know when the generated code needs to be wrapping up in a
   closure. An options hash is passed and cloned throughout, containing
   information about the environment from higher in the tree (such as
   if a returned value is being requested by the surrounding function),
   information about the current scope, and indentation level.

 Notice how this is not only giving trivial information (e.g. Base is
 an abstract base class) but WHY it exists (..as a base for all nodes in
 the syntax tree). It gives operational information (to compile a node..)
 as well as information about the effect (..which wraps...). It shows
 how global information is used (An options hash..) and WHY (containing
 information about the environment...)

 Code only tells you HOW something is done at the time it is done.
 It's like having a recipe without an idea what you would make.

 If our standards of documentation were raised to this level then large
 systems like Axiom, Clojure, and ClojureScript would be much easier to
 maintain and modify in the long term.

 If you want your code to live beyond you, make it literate.

 Tim Daly
 d...@literatesoftware.com

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: ANN: clojure.java.jdbc 0.0.7

2011-10-11 Thread jaime
will the 1.0.0 be included in core or contrib package?

On Oct 12, 5:37 am, Sean Corfield seancorfi...@gmail.com wrote:
 Changes in 0.0.7:

 * Fix JDBC-9 by renaming duplicate columns instead of throwing an exception.
   - thanx to Peter Siewert!
 * Fix JDBC-16 by ensuring do-prepared works with no param-groups provided.
 * Fix JDBC-17 by adding type hints to remove more reflection warnings.
   - thanx to Stuart Sierra!
 Documentation:
 * Address JDBC-4 by documenting how to do connection pooling.

 Plans:

 Once JDBC-3 / JDBC-15 have been addressed (use of deprecated
 struct-map stuff), I'll declare 0.1.0 and ask Clojure/core what would
 be needed for a 1.0.0 release. Feel free to provide feedback for
 future development here:

 http://dev.clojure.org/display/design/java.jdbc

 Earlier changes...

 Changes in 0.0.6:

 * Move former tests to test-utilities namespace - these do not touch a 
 database
 * Convert old test examples into real tests against real databases
   - tested locally against MySQL, Apache Derby, HSQLDB
   - build system should run against Apache Derby, HSQLSB
   - will add additional databases later
 * Fix JDBC-12 by removing batch when doing a single update
 * Remove wrapping of exceptions in transactions to make it easier to
 work with SQLExceptions

 Changes in 0.0.5:

 * Add prepare-statement function to ease creation of PreparedStatement
 with common options:
   - see docstring for details
 * with-query-results now allows the SQL/params vector to be:
   - a PreparedStatement object, followed by any parameters the SQL needs
   - a SQL query string, followed by any parameters it needs
   - options (for prepareStatement), a SQL query string, followed by
 any parameters it needs
 * Add support for databases that cannot return generated keys (e.g., HSQLDB)
   - insert operations silently return the insert counts instead of
 generated keys
   - it is the user's responsibility to handle this if you're using
 such a database!

 Changes in 0.0.4:

 * Fix JDBC-2 by allowing :table-spec {string} at the end of
 create-table arguments:
   (sql/create-table :foo [:col1 int] [col2 :int] :table-spec
 ENGINE=MyISAM)
 * Fix JDBC-8 by removing all reflection warnings
 * Fix JDBC-11 by no longer committing the transaction when an Error occurs
 * Clean up as-... functions to reduce use of (binding)
 * Refactor do-prepared*, separating out return keys logic and
 parameter setting logic
   - in preparation for exposing more hooks in PreparedStatement
 creation / manipulation

 Changes in 0.0.3:

 * Fix JDBC-10 by using .executeUpdate when generating keys (MS SQL
 Server, PostgreSQL compatibility issue)

 Changes in 0.0.2:

 * Fix JDBC-7 Clojure 1.2 compatibility (thanx to Aaron Bedra!)

 Changes in 0.0.1 (compared to clojure.contrib.sql):

 * Exposed print-... functions for exception printing; no longer writes
 exceptions to *out*
 * Add clojure.java.jdbc/resultset-seq (to replace
 clojure.core/resultset-seq which should be deprecated)
 * Add support for naming and quoting strategies - 
 seehttp://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/NameMapping...
   - The formatting is a bit borked, Tom F knows about this and is
 working on an enhancement to auto-doc to improve it
 * Add ability to return generated keys from single insert operations,
 add insert-record function
 * Clojure 1.3 compatibility
 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View --http://corfield.org/
 World Singles, LLC. --http://worldsingles.com/
 Railo Technologies, Inc. --http://www.getrailo.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


where can I find the official statement about changes from 1.2 to 1.3?

2011-10-09 Thread jaime
When I tried to answer a question (from other people) about why in 1.3
we need to explicitly declare ^:dynamic for a Var, I found I cannot
find an official document about this change from 1.2 (or older
version) to 1.3. I went to github (https://github.com/clojure/clojure/
blob/master/changes.md) but only found description like 1.1 Earmuffed
Vars are No Longer Automatically Considered Dynamic -- at first
glance I thought that the explicit declaration thing is only for
earmuffed Vars but when I tried it in a 1.3 REPL, I found we need to
explicitly declare all Vars to ^:dynamic if we want a rebinding.

Where can I find the official statement about this change (or other
similar changes)?

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Oxjure - Oxford Clojure Group

2011-10-09 Thread jaime
Got it. :-)

On Oct 9, 11:00 am, jaime xiejianm...@gmail.com wrote:
 Why not use this group directly?? I personally think separating people
 in different groups will disperse people's attention only.what is
 the benefit?

 On Oct 8, 7:49 pm, Folcon fol...@gmail.com wrote:







  Hi Everyone,

  I'm interested in seeing if there are enough people in Oxford, United
  Kingdom to start an Oxford Clojure group. I'm willing to run the group in my
  spare time, but it would be useful to see if there are people here who would
  be interested in joining.

  I don't know if this is the right place to make such an announcement, but I
  think I need to start somewhere ;).

  I've visited the Cambridge Clojure group in the past and they
  are definitely a great bunch of people, but I've found it quite hard to find
  the time to regularly go. I've yet to visit the London group and hope to
  have the opportunity to do so in the future. So I think there is a need for
  Oxford to have it's own group.

  Please chime in with thoughts and ideas. I was thinking of setting up a
  meeting in the next week or two.

  Folcon

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Oxjure - Oxford Clojure Group

2011-10-08 Thread jaime
Why not use this group directly?? I personally think separating people
in different groups will disperse people's attention only.what is
the benefit?

On Oct 8, 7:49 pm, Folcon fol...@gmail.com wrote:
 Hi Everyone,

 I'm interested in seeing if there are enough people in Oxford, United
 Kingdom to start an Oxford Clojure group. I'm willing to run the group in my
 spare time, but it would be useful to see if there are people here who would
 be interested in joining.

 I don't know if this is the right place to make such an announcement, but I
 think I need to start somewhere ;).

 I've visited the Cambridge Clojure group in the past and they
 are definitely a great bunch of people, but I've found it quite hard to find
 the time to regularly go. I've yet to visit the London group and hope to
 have the opportunity to do so in the future. So I think there is a need for
 Oxford to have it's own group.

 Please chime in with thoughts and ideas. I was thinking of setting up a
 meeting in the next week or two.

 Folcon

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


implement a shell in repl

2011-09-20 Thread jaime
Hi guys,

I want to implement a shell on top of REPL but without any ideas on
how to do it. Could you please suggest?

What I want is something that can let user do things like:
1. in REPL, user enter (myshell) (or some other command name)
2. then a prompt string will show up so that user can interact
with Clojure
3. built-in commands support is possible
4. prompt for user input is possible (I think this is the most
import part that I want, but I don't know how I can make REPL prompts
a user input...)
5. real Clojure form can be dispatch to REPL and the shell can
show the result returned by REPL

is there any project already on this, or is it possible to implement
it in some kind of ways??

Thanks,
Jaime

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: How to attach debugger on clojure's repl ?

2011-09-20 Thread jaime
I'm also looking forward the same thing..

On Sep 20, 12:24 am, cran1988 rmanolis1...@hotmail.com wrote:
 I am looking forward for a debugger like in CLISP , SBCL etc..
 Is there any solution out there ?
 Are you going to develop such a tool and you need help ?

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: implement a shell in repl

2011-09-20 Thread jaime
Good point. I think I need to find out how to make the shell prompt
for user input, e.g. when the user log into a system, the shell will
prompt to ask for a password

On Sep 20, 4:03 pm, Sanel Zukan san...@gmail.com wrote:
 I had quite similar task, integrating custom shell with clojure repl,
 where all expressions between parenthesis
 were interpreted as clojure code and rest as custom shell programs.

 The best way to do this is to explore (clojure.main/repl) function.
 One of the parameters will be :eval function; there clojure repl will
 send
 all expressions for evaluation. It could look like this:

 (defn evaluate [expr]
   (if (re-find #^(.*)$ expr)
     (eval expr)
     ;; here you call some java code for executing system commands
     ;; like (.exec (Runtime/getRuntime) expr) or something like that
 ) )

 (clojure.main/repl
     :eval evaluate)

 With clojure.main/repl you can do even more: write custom input,
 output and such. Feel free to explore it ;)

 Sanel

 On Sep 20, 9:38 am, jaime xiejianm...@gmail.com wrote:







  Hi guys,

  I want to implement a shell on top of REPL but without any ideas on
  how to do it. Could you please suggest?

  What I want is something that can let user do things like:
      1. in REPL, user enter (myshell) (or some other command name)
      2. then a prompt string will show up so that user can interact
  with Clojure
      3. built-in commands support is possible
      4. prompt for user input is possible (I think this is the most
  import part that I want, but I don't know how I can make REPL prompts
  a user input...)
      5. real Clojure form can be dispatch to REPL and the shell can
  show the result returned by REPL

  is there any project already on this, or is it possible to implement
  it in some kind of ways??

  Thanks,
  Jaime

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: implement a shell in repl

2011-09-20 Thread jaime
This may not work the way I want...but yes I will give it a shot. :-)

On Sep 21, 2:08 am, Ken Wesson kwess...@gmail.com wrote:
 Wouldn't the simplest way be to simply use the REPL itself as the
 shell, with a few things defined like this?

 (def dir (atom (System/getProperty user.home)))

 (defn pwd [] @dir)

 (defn cd [dir] (reset! @dir dir))

 (defn ... )

 --
 Protege: What is this seething mass of parentheses?!
 Master: Your father's Lisp REPL. This is the language of a true
 hacker. Not as clumsy or random as C++; a language for a more
 civilized age.

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: clojure.java.jdbc input on JDBC-3 (esp. Stuart Sierra!)

2011-08-16 Thread jaime
Not related to this topic, but just wonder if it's possible to have
c.j.j to support Unicode? And if it's already there, how can I use it
for Unicode?

On Aug 17, 2:17 am, Sean Corfield seancorfi...@gmail.com wrote:
 On Tue, Aug 16, 2011 at 11:02 AM, Stuart Sierra

 the.stuart.sie...@gmail.com wrote:
  I no longer remember what I was looking at when I wrote that ticket. :)
  Maybe I just wasn't aware of `insert-records`.

 Cool.

 Any thoughts on the struct-map issue? resultset-seq currently uses a
 deprecated feature - it should just use regular maps, right? I'm not
 familiar enough with struct-maps to understand the full implications
 of switching that out...
 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View --http://corfield.org/
 World Singles, LLC. --http://worldsingles.com/
 Railo Technologies, Inc. --http://www.getrailo.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: is my understanding correct for function identity?

2011-08-14 Thread jaime
Hey guys, the clojuredocs link seems interesting and a good place for
studying/referencing Clojure. :-)

On Aug 15, 12:11 am, abp abp...@googlemail.com wrote:
 I wanted to add the map/cycle sample, then thougt of clojuredocs and
 here you go:

  http://clojuredocs.org/clojure_core/clojure.core/identity

 On 14 Aug., 00:25, Alan Malloy a...@malloys.org wrote:







  On Aug 13, 12:45 pm, jaime xiejianm...@gmail.com wrote:

   I found an interesting function identity which will do nothing but
   only returns the parameter passed to it. The next minute I came up a
   question: then what's the purpose of this function? -- I've tried to
   figure out reasons of existence of identity.

   The only reason that I can imagine is this: because we often use
   higher-order functions, these higher-order functions will accept
   functions as its parameters, in such a situation, when we want to use
   a higher-order function but don't want to pass any real functions to
   it, then we can use function like identity and identity here is
   just to fill the role of parameter of higher-order function.

   Guys, is my guess correct or not? Are there other reasons for
   identity's existence?? Are there other functions for the same purpose?

  One of my favorite uses of identity is for use with partition-by:

  user (partition-by identity '(a a b a a a a c c d))
  ;; ((a a) (b) (a a a a) (c c) (d))

  I sometimes speculate that, while identity is plenty useful, if your
  program contains the characters (identity, you probably don't know
  how to program.

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: is my understanding correct for function identity?

2011-08-14 Thread jaime
It's great to hear so many useful responses/tips -- it's really
helpful for people who is leaning Clojure, especially for a beginner
like me. Thank you all! -:)

On Aug 14, 12:45 am, jaime xiejianm...@gmail.com wrote:
 I found an interesting function identity which will do nothing but
 only returns the parameter passed to it. The next minute I came up a
 question: then what's the purpose of this function? -- I've tried to
 figure out reasons of existence of identity.

 The only reason that I can imagine is this: because we often use
 higher-order functions, these higher-order functions will accept
 functions as its parameters, in such a situation, when we want to use
 a higher-order function but don't want to pass any real functions to
 it, then we can use function like identity and identity here is
 just to fill the role of parameter of higher-order function.

 Guys, is my guess correct or not? Are there other reasons for
 identity's existence?? Are there other functions for the same purpose?

 Thanks,
 Jaime

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


is my understanding correct for function identity?

2011-08-13 Thread jaime
I found an interesting function identity which will do nothing but
only returns the parameter passed to it. The next minute I came up a
question: then what's the purpose of this function? -- I've tried to
figure out reasons of existence of identity.

The only reason that I can imagine is this: because we often use
higher-order functions, these higher-order functions will accept
functions as its parameters, in such a situation, when we want to use
a higher-order function but don't want to pass any real functions to
it, then we can use function like identity and identity here is
just to fill the role of parameter of higher-order function.

Guys, is my guess correct or not? Are there other reasons for
identity's existence?? Are there other functions for the same purpose?

Thanks,
Jaime

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Optimizing JDBC code

2011-08-07 Thread jaime
Hi guys, I just want to learn using databases in Clojure, can you
suggest where to start? by looking at source code of clojure.java.jdbc/
clojure.contrib.sql or there's some tutorial/document that I can start
with?

Thanks,
Jaime

On Aug 7, 1:51 pm, Shoeb Bhinderwala shoeb.bhinderw...@gmail.com
wrote:
 I switched to clojure.java.jdbc. Found no difference at all. It is
 still about 10 times slower than java.

 On Aug 6, 8:54 pm, Sean Corfield seancorfi...@gmail.com wrote:







  On Sat, Aug 6, 2011 at 4:51 PM, Shoeb Bhinderwala 

  shoeb.bhinderw...@gmail.com wrote:
   In one test case, I loaded 69,099 records. The Java code took 5
   seconds to execute the query and create as many objects. Clojure code
   took 50.43 seconds.

  Try using clojure.java.jdbc instead of clojure.contrib.sql. c.j.j is the
  maintained version of c.c.sql and has had a number of enhancements such as
  removing all the Java reflection that was being done.
  --
  Sean A Corfield -- (904) 302-SEAN
  An Architect's View --http://corfield.org/
  World Singles, LLC. --http://worldsingles.com/
  Railo Technologies, Inc. --http://www.getrailo.com/

  Perfection is the enemy of the good.
  -- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Announcement: stockings clojure library for easy access to financial data

2011-06-08 Thread jaime
I tried to run the example behind a proxy but the connection failed.
Anyone who knows how to resolve this??

I'm using Eclipse and plugin counterclockwise, the Eclipse itself can
check for update behind the proxy.

Thanks,
Jaime

On Jun 1, 3:09 am, fxt f...@fxtlabs.com wrote:
 Hi everyone,

 I just wanted to announce release 1.0 of my latest project: 
 stockings.https://github.com/fxtlabs/stockingshttp://stockings.fxtlabs.comhttp://clojars.org/com.fxtlabs/stockings

 I mentioned some of this work to some of you at the last Bonjure
 (Montreal Clojure User Group) meeting, so I thought someone might be
 interested.

 Stockings is a Clojure library that gives you easy access to financial
 data such as current and historicalstockquotes, current currency
 exchange rates,stocksymbol suggestions,stockand company info by
 trading exchanges and industry sectors, and more.

 It integrates information from different web services in a consistent
 way, doing all the error handling, JSON, XML, and CSV parsing, and all
 the other quirky data massaging for you.

 I hope some of you will find it useful. Any feedback is welcome.

 Thank you,

 fxt

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: interest in STM, where can I start to get knowing well about it?

2011-05-23 Thread jaime
Tom,

I had a fast view on the first several slides (slides about your MC-
STM implementation version 1), and found it concise and precise and
could be a good resource for demonstration/comprehension on basic STM
concepts/mechanism. Great job! I will definitely come back to this
useful slide when I have more time :-)

Thanks,
Jaime

On May 24, 12:50 am, Tom Van Cutsem tomvc...@gmail.com wrote:
 If you are more interested in the semantics of STM (such as how is commute
 different from alter?), rather than in the actual Java implementation, I
 wrote a little meta-circular STM system in Clojure that could be helpful:
 https://github.com/tvcutsem/stm-in-clojure

 Kind regards,
 Tom

 2011/5/19 MohanR radhakrishnan.mo...@gmail.com







  So I think readng the actual STM source with Java' features might
  help.

  Are there actually books on this topic ? Peter Van roy's Data flow
  concurrency book ?

  Thanks,
  Mohan

  --
  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 post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: interest in STM, where can I start to get knowing well about it?

2011-05-23 Thread jaime
huh, I do not know this topic well, any good resource for this??

On May 19, 3:59 pm, MohanR radhakrishnan.mo...@gmail.com wrote:
 So I think readng the actual STM source with Java' features might
 help.

 Are there actually books on this topic ? Peter Van roy's Data flow
 concurrency book ?

 Thanks,
 Mohan

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


interest in STM, where can I start to get knowing well about it?

2011-05-18 Thread jaime
Hi All,

I have interest in the implementation of STM, anyone who can suggest
where I can start to find out how it was implemented?
I can probably go read the source code but I'm just a fresher of
Clojure and also need some guides/materials about the internal
mechanism, I guess it likes kind of database implementation (locks 
latches), but I'm not familiar with that field either.

BTW, I got a Java background and know a little about LISP.

Thanks!

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: interest in STM, where can I start to get knowing well about it?

2011-05-18 Thread jaime
Thank you Michael, the link you gave is what I want!

On May 18, 8:15 pm, Michael Wood esiot...@gmail.com wrote:
 On 18 May 2011 09:25, jaime xiejianm...@gmail.com wrote:

  Hi All,

  I have interest in the implementation of STM, anyone who can suggest
  where I can start to find out how it was implemented?

 This might be a good place to start:

 http://java.ociweb.com/mark/stm/

  I can probably go read the source code but I'm just a fresher of
  Clojure and also need some guides/materials about the internal
  mechanism, I guess it likes kind of database implementation (locks 
  latches), but I'm not familiar with that field either.

  BTW, I got a Java background and know a little about LISP.

  Thanks!

 --
 Michael Wood esiot...@gmail.com

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: interest in STM, where can I start to get knowing well about it?

2011-05-18 Thread jaime
Yes I think I also need to read the source code. Thanks~

On May 18, 8:49 pm, Stefan Kamphausen ska2...@googlemail.com wrote:
 Hi,

 I don't think, there is any way around reading LockingTransaction.java in
 the source-code of Clojure. But it's just around 500 LoC, so it's not too
 bad.

 Regards,
 Stefan

-- 
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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en