Clojurescript libraries for MVC and state management

2012-05-17 Thread Murtaza Husain
Hi, Are there any clojurescript libraries / frameworks for mvc, or state management ? I have come across clojurescript one and waltz. Thanks, Murtaza -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Clojurescript libraries for MVC and state management

2012-05-17 Thread Shantanu Kumar
Probably a canonical catalog of Clojure libraries with corresponding description, project URL and Lein dependency coordinates would be nice to have. One list here: http://clojure-libraries.appspot.com/ but not sure if it has info on CLJS libs. Shantanu On May 17, 6:37 am, Murtaza Husain

Re: Clojure Bee iPhone app updated

2012-05-17 Thread nicolas.o...@gmail.com
Any android port in the pipeline? -- 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

Re: Clojure Bee iPhone app updated

2012-05-17 Thread Roberto Mannai
Looks interesting. Does it work off-line with local docs or require an Internet connection? BTW, do you know any Web Repl working on an iPhone or iPad? I tryied: - http://tryclj.com/ (well, it works but does not support a copy/past action) - http://lotrepls.appspot.com/ (it requires a submit via

core.logic, goals and facts

2012-05-17 Thread Brent Millare
I'm taking a more serious dive into logic programming and I have a question about facts. *Is it true that that goals and facts are the same in that you can use unification and conde to get the same effect? So querying a conde of multiple unifications is like stating a bunch of facts of a

Re: core.logic, goals and facts

2012-05-17 Thread Ambrose Bonnaire-Sergeant
On Thu, May 17, 2012 at 7:19 PM, Brent Millare brent.mill...@gmail.comwrote: I'm taking a more serious dive into logic programming and I have a question about facts. *Is it true that that goals and facts are the same in that you can use unification and conde to get the same effect? So

Re: Clojure Bee iPhone app updated

2012-05-17 Thread Kyle Oba
I only have plans to build it out on iOS. Sorry. On Wednesday, May 16, 2012 11:32:07 PM UTC-10, Nicolas Oury wrote: Any android port in the pipeline? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Clojure Bee iPhone app updated

2012-05-17 Thread Kyle Oba
It works offline. Metadata is slurped up for all the libraries and packed into the app. So, at the moment, no Internet connection required. On Wednesday, May 16, 2012 11:53:03 PM UTC-10, robermann79 wrote: Looks interesting. Does it work off-line with local docs or require an Internet

Re: Idiomatic usage of partial

2012-05-17 Thread Tim Visher
On Wed, May 16, 2012 at 1:57 PM, Murtaza Husain murtaza.hus...@sevenolives.com wrote: What is the idiomatic use of partial. I understand it helps create closures, however the reader notation also allows to the same. So when should partial be use dover other forms of creating functions. I have

Re: Idiomatic usage of partial

2012-05-17 Thread Tim Visher
On Wed, May 16, 2012 at 1:57 PM, Murtaza Husain murtaza.hus...@sevenolives.com wrote: What is the idiomatic use of partial. I understand it helps create closures, however the reader notation also allows to the same. So when should partial be use dover other forms of creating functions. Also,

Re: Assuring avalaibility of ring web apps

2012-05-17 Thread Tim Visher
On Wed, May 16, 2012 at 3:13 AM, Murtaza Husain murtaza.hus...@sevenolives.com wrote: Is there a lein plugin which can monitor and restart the app if it is down ( such as nodejs's forever) ? I just noticed this part of your question. In your context (EC2) it should be exceedingly simple do

Re: Clojure Bee iPhone app updated

2012-05-17 Thread Leo Noordhuizen
Hello, It looks quite nice. Im hoping for an Android version though Leo Noordhuizen On Thu, May 17, 2012 at 11:53 AM, Roberto Mannai roberm...@gmail.comwrote: Looks interesting. Does it work off-line with local docs or require an Internet connection? BTW, do you know any Web Repl

Avoid duplicate computation in commute?

2012-05-17 Thread Warren Lynn
Hi, The duplicate computation in commute seems to me quite a blemish on clojure's beauty. I even see somebody's code with comments pre- compute x because otherwise commute will call it twice. So I need to keep that fact in the back of my mind when using it? That is not what I was hoping for. I

Re: Idiomatic usage of partial

2012-05-17 Thread greg r
The reader notation is limited to the arity of the number of arguments provided. partial allows variable arity. Check out pages 67-68 of Clojure Programming. Regards, Greg On Wednesday, May 16, 2012 1:57:40 PM UTC-4, Murtaza Husain wrote: Hi, What is the idiomatic use of partial. I

does delay in calling clojure from java happen only once ?

2012-05-17 Thread raschedh
I use clojure more and more in production. To use it even more there, I need to be certain about the answer of the following question. My experiments lead me to the conjecture, that the answer is yes. But a proof can only be given by someone, who is familiar with clojure's implementation of which

NullPointerException

2012-05-17 Thread Sargash
Hi! I have a problem. With that code: ; === ; ex 1.17 multiply (defn ex1_17 [] (defn double [x] (+ x x)) (defn halve [x] (/ x 2)) (defn * [a b] (cond (= b 0) 0 (even? b) (* (double a) (halve b)) :else (+ a (* a (- b 1)

Re: NullPointerException

2012-05-17 Thread eniotna
Hi, Look at your parenthesis. You did not close your first function. Antoine 2012/5/17 Sargash gerby...@gmail.com Hi! I have a problem. With that code: ; === ; ex 1.17 multiply (defn ex1_17 [] (defn double [x] (+ x x)) (defn halve [x] (/ x 2))

Re: NullPointerException

2012-05-17 Thread Raoul Duke
On Thu, May 17, 2012 at 10:55 AM, eniotna eniotn...@gmail.com wrote: Look at your parenthesis. You did not close your first function. some day we'll have the technology to let the compiler tell us that, instead of spewing some horrible, pointless, stack trace? -- You received this message

Re: NullPointerException

2012-05-17 Thread eniotna
Furthermore, The syntax you're using is not correct. If you want to define functions inside your function ex1_17, use letfn. Something along the line: (defn ex1_17 [] (letfn [(double [x] (+ x x)) (halve [x] (/ x 2)) (mult [a b] (cond (= b 0) 0

Re: NullPointerException

2012-05-17 Thread eniotna
2012/5/17 Raoul Duke rao...@gmail.com On Thu, May 17, 2012 at 10:55 AM, eniotna eniotn...@gmail.com wrote: Look at your parenthesis. You did not close your first function. some day we'll have the technology to let the compiler tell us that, emacs told me. But i'm sure some other editors

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread Softaddicts
This has nothing to do directly with Clojure :) The JVM needs to load the class(es) involved. It involves obtaining the class files from disk or cache if lucky (an already opened jar file ?). Then some wiring has to be done to insure that the references needed from the class(es) are met, After

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread raschedh
Thank you, for your answer. It doesn't convince me, though. I am well aware of the class loading mechanism of the JVM. But if I compile against, say guava-12.0.jar (beautiful stuff by the way), and use those classes at runtime, there is no delay in using them whatsoever. At least not a delay of

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread Softaddicts
Ah, do you compile your Clojure code to Java prior to using it (AOT compilation) ? If not, you must add the clojure compilation time to spit out the class(es) byte code. Here we deliver AOTed components so there's no compilation overhead, we do this for other reasons than this very small

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread raschedh
Yes, I do compile my clojure code ahead of time (AOT) to byte code. Does that mean, that your, ahead of time compiled clojure code, has no noticeable delay, when you first call it ? If in the middle of the lifetime of an app, this delay happens, i can not consider it small, if 1 requests are

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread Softaddicts
Compared to Java, not noticeable if any. We run our app in production on cluster of small computers. We replaced component written mostly in Java by Clojure equivalents without any degradation in service time. We used clojure from java a number of times using Java callable interfaces generated in

Re: NullPointerException

2012-05-17 Thread Armando Blancas
The redefinition of functions somehow is spooking the compiler. But if you're at the REPL you should be seeing these warnings (are you doing AOT compile?) WARNING: double already refers to: #'clojure.core/double in namespace: user, being replaced by: #'user/double WARNING: * already refers to:

Re: NullPointerException

2012-05-17 Thread Alan Malloy
There's nothing wrong is a pretty strong statement. It works, but it is definitely the wrong way to do things. Using a letfn, or external helper functions, is a much better approach. On May 17, 12:19 pm, Armando Blancas abm221...@gmail.com wrote: The redefinition of functions somehow is spooking

Re: Idiomatic usage of partial

2012-05-17 Thread Alan Malloy
#() syntax can accept as many arguments as you like. For example, you can define partial using #(): (defn partial [f args] #(apply f (concat args %))) On May 16, 7:13 pm, greg r gsra...@bellsouth.net wrote: The reader notation is limited to the arity of the number of arguments provided.  

Re: NullPointerException

2012-05-17 Thread Moritz Ulrich
It's called Emacs + Paredit :-) On Thu, May 17, 2012 at 8:00 PM, Raoul Duke rao...@gmail.com wrote: some day we'll have the technology to let the compiler tell us that, instead of spewing some horrible, pointless, stack trace? -- Moritz Ulrich -- You received this message because you are

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread raschedh
Hm. I do have the feeling, that we do not understand each other. Code is always unambigous. I give an example, and give my question another run. (ns p.x (:gen-class :methods [ ^{:static true} [f [] String] ])) (defn -f [] hello, world) Fire up a REPL, make sure, p/x.clj is in your

Re: NullPointerException

2012-05-17 Thread Armando Blancas
There's nothing wrong is a pretty strong statement. LOL. Perhaps as strong as it is definitely the wrong way to do things? Jeez. Pedantry is the wrong way to welcome newbies to this board. -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread raschedh
The following makes it clearer: package e; import p.x; public final class E { public static void main(String[] args) { System.out.println(before); for (int i = 0; i 100; ++i) { System.out.println(x.f()); } } Now: After launching, the string `before' gets

Re: NullPointerException

2012-05-17 Thread Raoul Duke
On Thu, May 17, 2012 at 12:52 PM, Armando Blancas abm221...@gmail.com wrote: Pedantry is the wrong way to welcome newbies to this board. stop with your pedantry about there must be no pedantry? -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: NullPointerException

2012-05-17 Thread Evan Mezeske
On Thursday, May 17, 2012 12:52:27 PM UTC-7, Armando Blancas wrote: There's nothing wrong is a pretty strong statement. LOL. Perhaps as strong as it is definitely the wrong way to do things? Jeez. Pedantry is the wrong way to welcome newbies to this board. Far from being pedantic,

Re: NullPointerException

2012-05-17 Thread Armando Blancas
-- it's also just plain wrong. Those are not local functions: def always operates at top-level. Big deal. You see what I mean? Pedantry is contagious. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Avoid duplicate computation in commute?

2012-05-17 Thread Stuart Sierra
I think the point with `commute` is to allow for more concurrency at the expense of more computation. If you want assurance that your function is only called once, you can use `alter`. Keep in mind that *any* code in a Ref transaction has the potential to be called more than once if there's a

Re: NullPointerException

2012-05-17 Thread Raoul Duke
On Thu, May 17, 2012 at 1:25 PM, Armando Blancas abm221...@gmail.com wrote: -- it's also just plain wrong.  Those are not local functions: def always operates at top-level. Big deal. You see what I mean? Pedantry is contagious. er, i should think it *is* a big deal: programming languages

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread Softaddicts
It's the time to get all the related classes loaded needed to support the Clojure code and yes it's a one time cost. The first reference to x gets this triggered. Luc The following makes it clearer: package e; import p.x; public final class E { public static void main(String[]

Re: Clojure Bee iPhone app updated

2012-05-17 Thread Kyle Oba
Hi Leo, At this time, there is only plans for the iOS app. However, since so many people are interested in the Android version, it's a possibility. Best, Kyle On Thursday, May 17, 2012 2:19:05 AM UTC-10, DonLeo wrote: Hello, It looks quite nice. Im hoping for an Android version though

Re: NullPointerException

2012-05-17 Thread Evan Mezeske
On Thursday, May 17, 2012 1:25:45 PM UTC-7, Armando Blancas wrote: -- it's also just plain wrong. Those are not local functions: def always operates at top-level. Big deal. You see what I mean? Pedantry is contagious. Well, I guess if trying not to give newcomers blatantly false

Re: Assuring avalaibility of ring web apps

2012-05-17 Thread Stuart Sierra
This is probably outside the scope of what Lein and Clojure do, but it's a well-studied problem for JVM apps. AWS itself has a variety of solutions, such as Elastic Beanstalk and Cloud Formation. At the OS-level, there's monit and its kin. -S -- You received this message because you are

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread Stuart Sierra
Yes, Clojure has a runtime which is initialized the first time you call any Clojure code. The initialization never happens more than once. -S -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Avoid duplicate computation in commute?

2012-05-17 Thread DAemon
Would some of this difficulty be ameliorated by calling memoize on the function that you use? That way, if it's an expensive function, and the value hasn't changed, it's just looked up rather than recalculated. - DAemon On Fri, May 18, 2012 at 6:28 AM, Stuart Sierra

Re: does delay in calling clojure from java happen only once ?

2012-05-17 Thread raschedh
Ah, cool ! Thank you very much for this insider knowledge, Mr. Sierra !!! Great. That means more clojure in production. Hurrah !!! Thanks again. Heinz. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Avoid duplicate computation in commute?

2012-05-17 Thread Warren Lynn
Thanks and these are certainly workable solutions. But is there any particular reason why with commute the update function is ALWAYS called twice, even when no other thread changed the ref value at the commit time? That is what bothers me. On May 17, 5:46 pm, DAemon forsakendae...@gmail.com

Re: Avoid duplicate computation in commute?

2012-05-17 Thread DAemon
The reason that comes to mind most easily for me is that of deciding which notion of equality to use for 'the value of Ref hasn't changed'. Also, short of keeping a counter on the Ref of the number of times it's been changed, and comparing on that, there's no other way to tell that no other

Re: Avoid duplicate computation in commute?

2012-05-17 Thread Warren Lynn
But I thought for a ref, all the checking if an another thread has changed the value behind my back facility/logic is already there (otherwise how can dosync and alter work, right?). So why not using that? I did send the question to Rich but not sure he will have time to attend this. I am still

Re: Avoid duplicate computation in commute?

2012-05-17 Thread DAemon
Aren't alter and dosync just using LockingTransactions, which use the Java locking stuff under the hood? On Fri, May 18, 2012 at 9:28 AM, Warren Lynn wrn.l...@gmail.com wrote: But I thought for a ref, all the checking if an another thread has changed the value behind my back facility/logic is

Re: [ANN] Clojure Namespace Browser (clj-ns-browser 1.0.0)

2012-05-17 Thread thenwithexpandedwingshesteershisflight
it's ok I found the problem: it was due to another dependency, Aleph 0.2.1-SNAPSHOT, which depends on Apache HTTP components which are older versions than those used by ns-browser On Thursday, May 17, 2012 11:34:44 AM UTC+10, Andy Fingerhut wrote: Did you use the instructions under Install

Let over Lambda

2012-05-17 Thread P Martin
Hi everyone, I was perusing Amazon for some books on Clojure and Lisp and came across Let Over Lambda. From its reviews, it seems that this book may be useful for macro development in Clojure. Has anyone else read this book? Do you think it would be a good book for Clojure work? Thanks! --

Re: Let over Lambda

2012-05-17 Thread Andreas Kostler
It treats reader macros in some detail which is not really applicable to Clojure but it's a fun book :) On 18 May 2012 11:53, P Martin rawkso...@gmail.com wrote: Hi everyone, I was perusing Amazon for some books on Clojure and Lisp and came across Let Over Lambda. From its reviews, it seems

Re: defstruct defrecord metadata

2012-05-17 Thread Frank Siebenlist
Is this thread related to http://dev.clojure.org/jira/browse/CLJ-304 ? Would be nice to address that issue. -FrankS. On May 16, 2012, at 6:54 AM, Tim Visher wrote: On Tue, May 15, 2012 at 12:11 PM, JDuPreez jacques...@gmail.com wrote: Maybe I should post my solution to this problem here?

Re: docstrings of if-let and when-let incorrect

2012-05-17 Thread Frank Siebenlist
Christophe Grand was experimenting with some extensions to if-let and when-let that had implicit ANDs for the let-forms: https://github.com/cgrand/parsley/blob/master/src/net/cgrand/parsley/util.clj It feels intuitive to me to allow multiple if-let-forms like cgrand implements, and I can