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

Re: Anonymous Macros

2012-11-06 Thread jaime
gt; 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 >wrote: > >> May I know in what circumstances would an anonymous macro be applied? - I &g

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

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 thoug

Re: why does Clojure need to cache keywords?

2012-07-18 Thread jaime
ly especial when using them with map structure. > > 2012/7/18 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 compar

Re: why does Clojure need to cache keywords?

2012-07-18 Thread jaime
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" 写道: > >> Hello, >> >> When I read the source code keyword, say, Keyword.java (V1.3), I found >> that

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 = (S

Re: interests in Clojure internals

2012-06-08 Thread jaime
7日星期四UTC+8下午8时55分07秒,Ken Causey写道: > > On Thu, Jun 7, 2012 at 3:41 AM, jaime 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 > > o

interests in Clojure internals

2012-06-07 Thread jaime
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 f

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 wrote: > > Is there any materials to introduce how to setup emacs env for a > beginner? > > Yes, this single word: > > "Don't." > > :) &g

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 writes: > > > Curious about which emacs packages folks use for increased Clojure > > productivity (beyond the obvious, like slime/swank-clojure)... > > For any lisp:

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

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

2012-01-12 Thread jaime
th 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 > > &

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

2012-01-10 Thread jaime
#x27;s all the things I'm struggling on... On Jan 10, 4:54 pm, Alan Malloy wrote: > On Jan 9, 9:24 pm, Phil Hagelberg wrote: > > > jaime writes: > > > Later on I tried to add code that can make this possible but I found > > > there's no way to detect if

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

2012-01-09 Thread jaime
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@goog

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 wrote: > 2011/12/16 jaime : > > > Yes this is a good point, but how can I avoid this blowing up problem > > if I&

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 wrote: > On Thu, Dec 15, 2011 at 1:54 PM, Alan Malloy wrote: > > This will print all the debug information at compile

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

2011-12-16 Thread jaime
at 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 wrote: > Hello there, > > I w

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

2011-12-15 Thread jaime
> (println (pr-str &form)) > (println *file*) > (println (meta &form))) > > > > > > > > On Thu, Dec 15, 2011 at 12:48 AM, jaime wrote: > > Hello there, > > > I want to write a function named "debug" which will print out "da

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!

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 wrote: > On Wed, Nov 23, 2011 at 9:48 PM, Alan Malloy wrote: > > Other way round. It behaves like a keyword, looking itself up in a > > map: > > ('

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

2011-10-27 Thread jaime
, 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 >

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

2011-10-27 Thread jaime
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:

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

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

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

Re: Oxjure - Oxford Clojure Group

2011-10-09 Thread jaime
Got it. :-) On Oct 9, 11:00 am, jaime 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 wrote: > > > >

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

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 wrote: > Hi Everyone, > > I'm interested in seeing if there are enough people in Oxford, United > Kingdom to start an

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

Re: implement a shell in repl

2011-09-20 Thread jaime
gt; > (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 wrote: > > > > > > > > > Hi guys, > >

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

implement a shell in repl

2011-09-20 Thread jaime
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 cloj

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 wrote: > On Tue, Aug 16, 2011 at 11:02 AM, Stuart Sierra > > wrote: > > I no longer remember what I was looking

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 wrote: > I found an interesting function "identity" which will do nothing but >

Re: is my understanding correct for function "identity"?

2011-08-14 Thread jaime
ty > > On 14 Aug., 00:25, Alan Malloy wrote: > > > > > > > > > On Aug 13, 12:45 pm, jaime wrote: > > > > I found an interesting function "identity" which will do nothing but > > > only returns the parameter passed to it. The next

is my understanding correct for function "identity"?

2011-08-13 Thread jaime
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 -- Yo

Re: Optimizing JDBC code

2011-08-08 Thread jaime
Thank you for your information! I think I will start with c.j.j's test code :) On Aug 7, 3:08 pm, Sean Corfield wrote: > On Sat, Aug 6, 2011 at 11:04 PM, jaime wrote: > > Hi guys, I just want to learn using databases in Clojure, can you > > suggest where to start? by lo

Re: Optimizing JDBC code

2011-08-06 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 wrote: > I swi

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 wrote: > Hi everyone, > > I

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

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

2011-05-23 Thread jaime
I have more time :-) Thanks, Jaime On May 24, 12:50 am, Tom Van Cutsem 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&quo

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

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 wrote: > On 18 May 2011 09:25, jaime 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 imp

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 dat