Re: core.async question - canceling thread

2014-01-22 Thread Praki Prakash
What is the task doing? If it is in a tight loop, it must check explicitly
whether the interrupt flag is set and abort. If it is waiting on some
resource, it will receive InterruptedException.

Regards,
Praki Prakash


On Wed, Jan 22, 2014 at 11:20 AM, Mark Engelberg
mark.engelb...@gmail.comwrote:

 On Wed, Jan 22, 2014 at 2:51 AM, Jozef Wagner jozef.wag...@gmail.comwrote:

 You can put the computation into a future, and cancel the future after
 the timeout.


 I experimented with that, but it didn't seem to work.  I suspect that
 canceling a future doesn't really do what I think it should do.  I would
 appreciate some further clarity on how future cancellations work, and if
 someone thinks it applies here, would like to see concretely how to do it.

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN: Clojure High Performance Programming

2013-11-21 Thread Praki Prakash
Hi Shantanu,

Congrats on the book. Looks like it's going to be a great read and no doubt
a much needed book on the subject of performant code.

Regards,
Praki Prakash


On Thu, Nov 21, 2013 at 11:09 AM, Shantanu Kumar
kumar.shant...@gmail.comwrote:



 On Thursday, 21 November 2013 21:39:36 UTC+5:30, Gary Johnson wrote:

 This looks incredible! Just bought a copy. Congratulations, Shantanu!


 Thanks, Gary!

 Those who might look for a Kindle edition can find it here:

 http://www.amazon.com/Clojure-Performance-Programming-Shantanu-Kumar-ebook/dp/B00GTE1RVW/ref=sr_1_2?s=digital-textie=UTF8qid=1385043536sr=1-2keywords=packt+publishing

 Shantanu

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: My recap of Clojure/conj 2013

2013-11-20 Thread Praki Prakash
Please accept my thanks as well!

Regards,
Praki Prakash


On Wed, Nov 20, 2013 at 6:25 PM, Eduardo Lávaque eduanlava...@gmail.comwrote:

 Thanks for this Logan. :)

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN: Clojure 1.4.0-beta1

2012-02-03 Thread Praki Prakash
I use mvn -X to diagnose such issues. mvn can also produce detailed
reports on dependency and much more (mvn site -- I think).

HTH

On Fri, Feb 3, 2012 at 9:19 AM, Tassilo Horn tass...@member.fsf.org wrote:
 Stuart Sierra the.stuart.sie...@gmail.com writes:

 Hi Stu,

 Clojure 1.4 goes beta! This release is essentially the same as
 1.4.0-alpha5.  It will hit the Maven Central repository in a few
 hours.

 Great news, I'd very much like to test-drive it before the 1.4.0
 release.  Is there anything better than downloading its JAR and
 replacing the clojure-1.3.0.jar in my project with it?

 As soon as I change my [org.clojure/clojure 1.3.0] dependency to
 1.4.0-alpha5 (beta1 seems not have arrived yet) or [1.3.0,), maven
 gets messed up when fetching dependencies...

 Right now, my minimized test project deps are

  :dependencies [[org.clojure/clojure 1.3.0]
                 [ordered 0.3.0]
                 [org.clojure/tools.macro [0.1.1,)]]

 which works fine.  Now I've seen that ordered-1.0.0 is out.  That still
 works fine.

  :dependencies [[org.clojure/clojure 1.3.0]
                 [ordered 1.0.0]
                 [org.clojure/tools.macro [0.1.1,)]]

 Now trying to get the clojure snapshot breaks maven's dependency
 management.

  :dependencies [[org.clojure/clojure 1.4.0-alpha5]
                 [ordered 1.0.0]
                 [org.clojure/tools.macro [0.1.1,)]]

 It errors because it couldn't download
 org.clojure:clojure:jar:1.3.0-alpha5.  But why 1.3.0-alpha5?!?

 Strangely, when reverting my test project to an older ordered version,
 it works fine again.

  :dependencies [[org.clojure/clojure 1.4.0-alpha5]
                 [ordered 0.3.0]
                 [org.clojure/tools.macro [0.1.1,)]]

 Argh, I'll never understand maven.  Is there something option to make it
 show the dependency tree?  I mean, tools.macro doesn't seem to have any
 dependencies declared and ordered 1.0.0 has clojure [1.2.0,1.3.0] as
 dependency.  But why on earth does maven then try to get 1.3.0-alpha5?

 And is there a way to influence external deps?  For example, I'm pretty
 sure that the ordered library works just fine with 1.4.0.  Currently, it
 seems to me that in order to upgrade my own project to 1.4.0, I have to
 wait until all my dependencies also added 1.4.0 as a allowed dependency,
 which might take ages and hinders early test-driving and adoption of new
 clojure releases.

 Sorry, that mail was not intended to become a long rant.  But I'm really
 interested to know how others deal with the maven hell.

 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



-- 
(praki)

-- 
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: I don't understand how to instantiate a closure library object

2012-01-10 Thread Praki Prakash
On Tue, Jan 10, 2012 at 2:22 PM, billh2233 bill.har...@gmail.com wrote:
 I'm trying to instantiate a new goog.fx/Animate object, but the
 constructor doesn't return anything:

  (:require [goog.fx :as fx])
  (let [anim (fx/Animation (array 22 33) (array 44 55) 1000 nil)]
    anim: #undefined end anim
    ...

(let [anim (fx/Animation. (array 22 33) (array 44 55) 1000 nil)]

(period after fx/Animation.)

-- 
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: ClojureScript – inter-namespace usage

2012-01-09 Thread Praki Prakash
I bind *print-fn* and it seems to work fine in my snapshot of master
pulled on 12/14.

On Mon, Jan 9, 2012 at 6:16 PM, David Nolen dnolen.li...@gmail.com wrote:
 binding works just fine in CLJS. That it doesn't work with required vars
 sounds like a bug.

 On Monday, January 9, 2012, Stuart Sierra the.stuart.sie...@gmail.com
 wrote:
 Hi Shantanu,

 #1 is a bug.

 #2 is not possible because `import` doesn't exist in ClojureScript: it
 doesn't differentiate between host classes and ClojureScript code. Protocols
 and types should be accessible with normal `require` in ClojureScript.

 #3 seems unlikely to be implemented. ClojureScript doesn't have Vars, and
 it doesn't have threads, so there's not much for `binding` to do. I could
 see `with-redefs` being supported, however.

 -S

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



-- 
(praki)

-- 
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: Late provide error in compiling clojurescript files

2012-01-04 Thread Praki Prakash
Thanks for your response Benjamin. I was leaning towards cyclic
dependency myself. I couldn't get closurebuilder.py (which apparently
detects cyclic dependencies) but couldn't get it to run on my source.
After your response, I did a dependency analysis by hand and found no
cycles. However, I narrowed down this error to only hyphenated
namespaces. After some more snooping around, I found the cause to be
requiring foo.bar-baz as foo.bar_baz (in some places). I suspect that
this confused the dependency analysis. I don't fully understand
how/why it works when I compile again but, boy, am I glad to have
cljs-watch work! Big time saver!

Hopefully, someone from the clojurescript compiler team can enlighten on this.

On Wed, Jan 4, 2012 at 7:44 AM, Benjamin Teuber bsteu...@googlemail.com wrote:
 Hi,

 I just had the same problem and discovered it was a cyclic dependency
 - maybe you want to check for that, too..

 Regards Benjamin

 On Jan 3, 9:19 am, Praki praki.prak...@gmail.com wrote:
 Hi,

 I have a silly problem compiling my cljs files. I have to run the
 cljsc command twice in succession to generate javascript source. The
 first compilation results in:

 ERROR: JSC_LATE_PROVIDE_ERROR. required foo.bar namespace not
 provided yet at /home/.../src/../target/classes/public/js/core.js line
 18 : 12

 Please note that my core.cljs requires foo.bar namespace. The second
 cljsc command works without any error.

 I doubt that clojurescript compiler requires running it multiple times
 in succession and suspect some problem in my usage of it. I would
 expect closure compiler to process the transitive dependencies
 correctly.

 I see the same issue with cljs-watch which is a major productivity
 issue for me.

 Has anyone else encountered this issue? Does anybody know the cause of
 this error?

 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



-- 
(praki)

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-28 Thread Praki Prakash
On Thu, Jul 28, 2011 at 5:20 PM, Tal Liron tal.li...@gmail.com wrote:

 jQuery is not so much an elephant as it is a mammoth. It was one of
 the first clientside-JS frameworks to reach a broad audience, but it
 also one of the worst. It incorporates so many terrible JS practices,
 performs miserably, and really can make anyone dislike JS. People have
 mentioned other clientside frameworks. Let me mention also Ext JS,
 which I believe knocks the socks off the rest. It is crafted with a
 real appreciation of JS, and that love may rub off you a little as you
 work with it.


I am not a front-end developer but I am currently stuck prototyping using
JQuery. I am
also not a JS expert. I am curious: can you list JQuery's issues and how it
uses JS badly?
Or, provide some references?
-- 
(praki)

-- 
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: First foray into profiling

2011-01-09 Thread Praki Prakash
It is most likely the transport used between your profiler front-end and the
JVM backend. Right click on the entry point you are interested in and
display it as a subtree. VisualVM and YourKit profilers show time
percentages based on the time spent in that method which is want you want to
see.

Praki

On Sun, Jan 9, 2011 at 10:52 AM, Mark Engelberg mark.engelb...@gmail.comwrote:

 On Sun, Jan 9, 2011 at 3:15 AM, Mark Engelberg mark.engelb...@gmail.com
 wrote:
  In the meantime, I fired up the lein repl which did start up in
  -server mode, and tried to do some profiling.  It tells me 80% of its
  time is being spent in:
  sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run()

 To be clear, I have absolutely no idea what this
 TCPTransport$ConnectionHandler class does, or why its run method would
 be called as a result of my code, let alone why it is taking 80% of
 the run time.  I'm doing nothing requiring internet connectivity, or
 communication between programs.  Any ideas about this?

 --
 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.comclojure%2bunsubscr...@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: Knuth's literate programming tangle function in Clojure

2010-12-26 Thread Praki Prakash
Tim,

This approach is very interesting. My choice of mode for LP has always been
noweb-mode but it doesn't seem to work with my version of emacs anymore. My
current approach is to embed prose and clojure code in a latex document and
generate a .tex file with formatted clojure code and .clj containing only
clojure code. Needless to say, it is a hack and I would like to see if I can
adopt your approach.

However, I have a question on mapping of line numbers in clojure stacktrace
to its source. AFAIK, there is no support in clojure compiler for #LINE
directive. In my case, a code is always in one location and I just replace
latex lines with empty lines. How do you address this issue?

Thanks,
Praki
On Sat, Dec 25, 2010 at 10:01 PM, Tim Daly d...@axiom-developer.org wrote:

  ;  0 AUTHOR and LICENSE
 ;  1 ABSTRACT and USE CASES
 ;  2 THE LATEX SUPPORT CODE
 ;  3 IMPORTS
 ;  4 THE TANGLE COMMAND
 ;  5 SAY
 ;  6 READ-FILE
 ;  7 ISCHUNK
 ;  8 HASHCHUNKS
 ;  9 EXPAND
 ; 10 TANGLE




-- 
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 1.2 Beta 1

2010-07-14 Thread Praki Prakash
I think my number crunching code would benefit immensely from
equals/equiv code. When can we hope to see a release containing
equals/equiv effort?

Thanks

On Wed, Jul 14, 2010 at 10:42 AM, Stuart Halloway
stuart.hallo...@gmail.com wrote:
 Later release.

 I didn't see mention of the new equals/equiv work.
 Is this going into a later beta or is this work tentatively going into
 a later release?


-- 
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: Suggestions for a file and line implicit argument in macros

2010-07-14 Thread Praki Prakash
I have the same problem and implicit file/line arguments would be very
useful to me as well.


On Wed, Jul 14, 2010 at 8:21 AM, Nicolas Oury nicolas.o...@gmail.com wrote:
 Dear all,
 I am using a lot of macros with a quite complex syntax and I would like to
 be able to report error nicely.
 I haven't been able to find a way to report the file and (most importantly)
 the line of the macro whose evaluation produce an error.
 Have I missed some way of doing that?
 Would two implicit arguments file and line be useful for others, or I am
 the only one that needs something like that?

 Best regards,
  Nicolas
 PS: and congratulations and thanks so much for Clojure 1.2 beta 1.


-- 
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: Perplexing bug

2010-06-09 Thread Praki Prakash
BTW, I am using 1.2.0-master-SNAPSHOT for clojure and clojure-contrib
but clojure-http-client is 1.0.0-SNAPSHOT. I will try this with the
most recent version.

Thanks

On Wed, Jun 9, 2010 at 10:35 AM, Moritz Ulrich
ulrich.mor...@googlemail.com wrote:
 I'm not sure if this is related, but in recent Snapshots of
 clojure-http-client, the namespace was renamed to clojure-http.client.
 This was a small issue with my fork from clojure-couchdb.

 (I think clojure-http-client really needs a stable release for clojure 1.1.0)

 On Wed, Jun 9, 2010 at 7:31 PM, Praki praki.prak...@gmail.com wrote:
 I started using one-jar to package my clojure code as a single
 executable jar and ran into a problem right away with loading of
 classes. I have a very simple project at g...@github.com:fgx3prak/
 bug.git that crashes in the same manner as my real code base and think
 that the underlying problem is the same.

 The source looks like this:

 (use 'clojure.http.client)
 (ns bug
  (:use clojure.http.client))

 In short, mvn compile works fine the first time but fails after that.
 If I have only one of use or ns, there is no error. I believe that
 the combination of use and ns represents the condition under which
 the bug manifests itself in the real code.

 I haven't been able to figure out the cause of this problem. I have
 already looked at verbose:class output and AFAIK clojure.http.client
 class is getting loaded completely. Is there any way to get a trace of
 clojure class loading?

 Any help/hints greatly appreciated!  Thanks!

 Exception in thread main java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at clojure.lang.RT.loadClassForName(RT.java:1578)
        at clojure.lang.RT.load(RT.java:399)
        at clojure.lang.RT.load(RT.java:381)
        at clojure.core$load$fn__4506.invoke(core.clj:4893)
        at clojure.core$load.doInvoke(core.clj:4892)
        at clojure.lang.RestFn.invoke(RestFn.java:409)
        at clojure.core$load_one.invoke(core.clj:4717)
        at clojure.core$compile$fn__4511.invoke(core.clj:4904)
        at clojure.core$compile.invoke(core.clj:4903)
        at clojure.lang.Var.invoke(Var.java:365)
        at clojure.lang.Compile.main(Compile.java:56)
 Caused by: java.lang.NullPointerException
        at clojure.core$refer.doInvoke(core.clj:3276)
        at clojure.lang.RestFn.invoke(RestFn.java:411)
        at clojure.lang.AFn.applyToHelper(AFn.java:163)
        at clojure.lang.RestFn.applyTo(RestFn.java:133)
        at clojure.core$apply.invoke(core.clj:542)
        at clojure.core$load_lib.doInvoke(core.clj:4769)
        at clojure.lang.RestFn.applyTo(RestFn.java:143)
        at clojure.core$apply.invoke(core.clj:542)
        at clojure.core$load_libs.doInvoke(core.clj:4788)
        at clojure.lang.RestFn.applyTo(RestFn.java:138)
        at clojure.core$apply.invoke(core.clj:544)
        at clojure.core$use.doInvoke(core.clj:4868)
        at clojure.lang.RestFn.invoke(RestFn.java:409)
        at bug__init.load(Unknown Source)
        at bug__init.clinit(Unknown Source)
        ... 13 more

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



-- 
http://www.google.com/profiles/praki.prakash

-- 
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: Perplexing bug

2010-06-09 Thread Praki Prakash
Same story with the latest snapshot of clojure-http-client. Same thing
happens with compojure.core.


 BTW, I am using 1.2.0-master-SNAPSHOT for clojure and clojure-contrib
 but clojure-http-client is 1.0.0-SNAPSHOT. I will try this with the
 most recent version.

 Thanks

 ulrich.mor...@googlemail.com wrote:
 I'm not sure if this is related, but in recent Snapshots of
 clojure-http-client, the namespace was renamed to clojure-http.client.
 This was a small issue with my fork from clojure-couchdb.


-- 
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: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Praki Prakash
 personally, I like strip or trim than chomp/chop.


+1

Seeing how Clojure dropped/changed many classic Lisp monikers, there
is no reason to use comp/chop which may be familiar to somebody with
Perl/Python but confusing to others.

-- 
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: Has deftype changed?

2010-04-18 Thread Praki Prakash
Thanks Andrew.

I did catch 'this' argument requirement sometime back but the 'new' bit
escaped me.

Praki

On Sat, Apr 17, 2010 at 6:16 PM, Andrew Stein steinl...@gmail.com wrote:


 (deftype Bar [a b c d e])
 (def b (new Bar 1 2 3 4 5))

 There are a few other syntax changes too, defrecord replaces extending
 IPersistenMap, and you need to include 'this' in protocol fun
 implementations ...


 http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/deftype

 http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/defrecord

 On Apr 17, 4:37 pm, Praki praki.prak...@gmail.com wrote:
  I am seeing compilation errors in my code with deftype. I just updated
  my project dependencies and probably pulled in the latest clojure
  package. Anyway, the following code from wiki doesn't work anymore.
  Pointers to any late breaking changes much appreciated!
 
  TIA
 
  (deftype Bar [a b c d e])
  (def b (Bar 1 2 3 4 5))
 
  Expecting var, but Bar is mapped to class package.Bar
[Thrown class java.lang.Exception]
 
  Restarts:
   0: [ABORT] Return to SLIME's top level.
 
  Backtrace:
0: clojure.lang.Compiler.lookupVar(Compiler.java:5677)
1: clojure.lang.Compiler.isMacro(Compiler.java:5178)
2: clojure.lang.Compiler.macroexpand1(Compiler.java:5233)
3: clojure.lang.Compiler.analyzeSeq(Compiler.java:5305)
4: clojure.lang.Compiler.analyze(Compiler.java:5140)
5: clojure.lang.Compiler.access$100(Compiler.java:35)
6: clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:417)
7: clojure.lang.Compiler.analyzeSeq(Compiler.java:5319)
8: clojure.lang.Compiler.analyze(Compiler.java:5140)
9: clojure.lang.Compiler.analyze(Compiler.java:5101)
   10: clojure.lang.Compiler.eval(Compiler.java:5377)
   11:
 
  --
  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.comclojure%2bunsubscr...@googlegroups.com
  For more options, visit this group athttp://
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
http://www.google.com/profiles/praki.prakash

-- 
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: Has deftype changed?

2010-04-18 Thread Praki Prakash
That was my interpretation as well. I now have defrecord instead of deftype
everywhere. It looks like deftype was refactored into deftype and defrecord.
deftype implements none of the usual interfaces (IPersistentMap) whereas
defrecord does.

Praki

On Sun, Apr 18, 2010 at 11:33 AM, ataggart alex.tagg...@gmail.com wrote:

 My sense from the changes is that defrecord is the map-like one,
 whereas deftype is the lower-level construct used to implement stuff
 like clojure collections.  I imagine users will use defrecord more
 often than deftype.


 On Apr 18, 10:49 am, Rob Lachlan robertlach...@gmail.com wrote:
  For deeftype, has the syntax for field accessors changed too?
 
  I can't get it to work:
 
  user (deftype someType [b f])
  user.someType
  user (def y (new someType 2 3))
  #'user/y
  user (:b y)
  nil
  user (:f y)
  nil
 
  defrecord works as expected, though.
 
  On Apr 17, 6:16 pm, Andrew Stein steinl...@gmail.com wrote:
 
 
 
 
 
   (deftype Bar [a b c d e])
   (def b (new Bar 1 2 3 4 5))
 
   There are a few other syntax changes too, defrecord replaces extending
   IPersistenMap, and you need to include 'this' in protocol fun
   implementations ...
 
  
 http://richhickey.github.com/clojure/clojure.core-api.html#clojure.co
 ..
 
   On Apr 17, 4:37 pm, Praki praki.prak...@gmail.com wrote:
 
I am seeing compilation errors in my code with deftype. I just
 updated
my project dependencies and probably pulled in the latest clojure
package. Anyway, the following code from wiki doesn't work anymore.
Pointers to any late breaking changes much appreciated!
 
TIA
 
(deftype Bar [a b c d e])
(def b (Bar 1 2 3 4 5))
 
Expecting var, but Bar is mapped to class package.Bar
  [Thrown class java.lang.Exception]
 
Restarts:
 0: [ABORT] Return to SLIME's top level.
 
Backtrace:
  0: clojure.lang.Compiler.lookupVar(Compiler.java:5677)
  1: clojure.lang.Compiler.isMacro(Compiler.java:5178)
  2: clojure.lang.Compiler.macroexpand1(Compiler.java:5233)
  3: clojure.lang.Compiler.analyzeSeq(Compiler.java:5305)
  4: clojure.lang.Compiler.analyze(Compiler.java:5140)
  5: clojure.lang.Compiler.access$100(Compiler.java:35)
  6: clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:417)
  7: clojure.lang.Compiler.analyzeSeq(Compiler.java:5319)
  8: clojure.lang.Compiler.analyze(Compiler.java:5140)
  9: clojure.lang.Compiler.analyze(Compiler.java:5101)
 10: clojure.lang.Compiler.eval(Compiler.java:5377)
 11:
 
--
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.comclojure%2bunsubscr...@googlegroups.com
For more options, visit this group athttp://
 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.comclojure%2bunsubscr...@googlegroups.com
   For more options, visit this group athttp://
 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.comclojure%2bunsubscr...@googlegroups.com
  For more options, visit this group athttp://
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
http://www.google.com/profiles/praki.prakash

-- 
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: Simple functional programming lexicon?

2010-03-17 Thread Praki Prakash
I spent a lot of time trying to understand monads in Haskell, which led to
reading Category Theory. It's an alluring subject and one can spend a lot
time following the concepts and terminology. But, the good news is that, one
doesn't need an advanced degree in math to appreciate monads in FP. A really
helpful paper that explains the motivation for Monads is this:
http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf

As others have mentioned, Haskell is heavy in its use of monads and  many
other  algebraic structures. I don't know why the two languages feel so
different with respect to the level of formalism you need to use them. But,
Haskell is one of the most mind bending programming language there and well
worth the study.

Praki
On Wed, Mar 17, 2010 at 5:16 PM, Ben Armstrong synerg...@gmail.com wrote:

 On 17/03/10 04:54 PM, David Nolen wrote:

 To me the beauty of Clojure isn't that you _don't_ need a strong academic
 background or even much exposure to FP to approach the language. Clojure is
 relatively free of FP jargon, instead we have Rich Hickey Jargon. I jest
 :)


 Very good.  And so far, my experience has borne this out.  It is
 approachable, elegant, immediately usable.  It's just that I am curious, so
 I would like to be able to have at least a basic idea of what these other
 conversations are about, even if I can't entirely follow every argument.

  But seriously, in my personal opinion Monads are relatively useless in the
 context of Clojure. They are necessary in pure FP languages like Haskell
 because otherwise it's impossible get any real applications written. This is
 not to say they are not useful, you just don't need to know a damn thing
 about them to have fun in Clojure.


 OK.  That puts it a bit more in perspective.  Also, once I was online
 again, I reached for Wikipedia to see if I could find an article written to
 be understood by those outside the field.  Actually, the first two
 paragraphs here were helpful to get at least a basic grasp of what Monads
 are about:

 http://en.wikipedia.org/wiki/Monad_(functional_programming)http://en.wikipedia.org/wiki/Monad_%28functional_programming%29

 The overview here is certainly more readable than the foldoc entry I read,
 and it, in turn links to a page on monad as used in category theory which
 is, I am sure, readable by mathematicians, but which again left me
 scratching my head just as the foldoc entry had.  So I guess it's not so
 much FP that I find hard to grok as it is the math from which it has
 borrowed some terminology.

  Having hacked on Clojure for a a year and half now I think the best
 approach is to learn those aspects of Clojure that are most useful to you.
 You certainly don't need to pick up everything at once. I still don't
 completely grok deftype/protocols or the more involved concurrency
 constructs. This hasn't stopped me from writing many useful programs.


 Most useful to me, or at least most interesting ...  I can't say that at
 this point I can see where I'm going to use this.  But it certainly *is*
 intriguing ... including the bits that right now are a hard to follow at
 least in part due to the unfamiliar terms.

  If you _do_ want to get deeper in Clojure's philosophy you can't beat Rich
 Hickey's Amazon Bookshelf.


 I'm not sure at this point how deep I want to go.  Nice resource, though.

 Ben



 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
http://www.google.com/profiles/praki.prakash

-- 
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: Leiningen, Clojure and libraries: what am I missing?

2010-03-04 Thread Praki Prakash
Lein could be a step in the right direction, but I wonder how it will
manage to evolve given the complex tools it uses internally.

I have also seen a weird issue in my code base which has two classes
derived from java.lang.Exception. If I do a clean and try compile, I
get an error saying that my.package.MyException class not found. My
workaround is, set :namespaces to only those Exception derived
classes, compile and then set :namespaces to :all.

Maybe I am missing some cool lein thing here or lein needs quite a bit
of work in dependency handling. I am tempted to just stick to mvn
which is quite mature and well-documented. Any clojure-specific needs
could be addressed through a plug-in.

Comments, thoughts?

Thanks,
Praki

On Thu, Mar 4, 2010 at 5:52 AM, Stuart Halloway
stuart.hallo...@gmail.com wrote:
 Hi Jan,

 My 2c: Leiningen is an important step, but there is still plenty to do.

 My workflow: I am developing multiple Clojure libraries and applications,
 with some of the dependencies changing daily. Whenever I want to make a
 change, I:

 In the project being changed:
 git tag a new version number
 update the project.clj to a new version number
 run lein pom and lein jar
 copy the new files to a repos (clojars)

 In projects that depend on changed project
 update the dependency in project.clj (if it is hard coded and not =)
 run lein deps

 This seems adequate to me (although there could be a bit more automation).
 The problem of snapshot dependencies remains. The solution that springs to
 mind here is to get projects off snapshots (presumably by releasing more
 incremental versions). Library authors: please release lots of versions! (or
 tell me why this is a bad idea).

 Some needs I see:

 (0) More point releases of key libs (or some other solution to the snapshots
 problem)

 (1) Unify around the project structure imposed by lein, and/or

 (2) Improve the project structure imposed by lein, if it is broken in some
 specific way. (Maybe add a well-known config file for adding elements to the
 classpath?)

 (3) lein deps (or some other task) to clean up old jars. Right now I am
 deleting them by hand from the lib directory. (Is this already solved?)

 Stu

 I haven't hacked on new Clojure stuff for the past two months or
 so. Now, having updated my repositories, I find that everybody just
 dropped ant and moved to leiningen.

 I tried to make sense of things, but can't. I must be missing something
 big here.

 It seems that leiningen assumes that you are building an application. It
 downloads all dependencies and can build an uberjar for you. That's
 great, but what if what I have is a bunch of libraries, all being
 developed and modified?

 Also, I now have at least six clojure jars in ~/.m2 (huh?!), along with
 a collection of other assorted stuff. I don't want to use any of these
 clojure jars, I have a checked out git repo with clojure and this is the
 only code I want to run. Also, swank-clojure insists on having its own
 clojure jar in ~/.swank-clojure (why?).

 I used to have a bunch of directories with git repos. I would update
 those, run ant to gather code into jars, fiddle with the classpath in my
 custom-crafted clj script, symlink things around. It was about as bad as
 with Common Lisp. But now things got worse -- I no longer feel in
 control of anything. Some things won't build, lein tells me about
 artifacts (huh?!), things get installed in weird places. My clj script
 that gets run by SLIME form Emacs can't find libraries that leiningen
 downloaded.

 How do people deal with this?

 As a more general observation, I think that a large part of Perl's and
 Python's success was a unified way of dealing with libraries. There
 are certain directories where you can drop libraries and expect them to
 work (be found). There is ONE way of running the VM (one script, blessed
 by the language creator). Then on top of that there is CPAN, which plugs
 into that, downloading dependencies and dropping libraries into those
 well-known directories. It isn't perfect, but it works, and is
 predictable.

 Shouldn't we have a well-known Single Setup for Clojure as well?

 I am very worried that Clojure is rapidly going the Common Lisp way,
 with each developer having his own precious carefully crafted
 setup. Every system is different, everyone uses a different script to
 run clojure programs, there is no single place to drop your libraries
 into, and libraries have no conventions on where their code is (what do
 I add to classpath once I have a library checked out?). I thought
 Leiningen was supposed to solve these issues, but either I am missing
 something, or it is really a tool to manage dependencies for a single
 application.

 --J.

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