ClojureScript Presentation - video
Hi all, I did not watch the live cast of Rich's presentation on ClojureScript. Could someone please point me to a video or audio recording of the presentation if there's one somewhere on the Web? Thanks, -h. -- 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: Excellent intro to core.logic
Hi, Am Mittwoch, 20. Juli 2011 15:28:58 UTC+2 schrieb Ambrose Bonnaire-Sergeant: I also dropped the whole walkthrough with typedo, and replaced it with an interesting (but much easier) look at geto. See Utility Function: geto for the new section. https://github.com/frenchy64/Logic-Starter/wiki Let me know what you think. Quite nice. Although I found the walkthrough good to get an understanding what's going, just difficult to follow because of the short local names. But it's certainly better too separate out geto. And while we are breaking conventions ;-P: would geto not better be named mapsto? with exchanged argument order? (defn mapsto? [env sym type] (matche [env] ([[[sym :- type] . _]]) ([[_ . ?rest]] (mapsto? ?rest sym type Sincerely Meikel -- 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: BUG REPORT: ClojureScript : Portable Path Support
I know. But the sorts of (presently non-portable) scripts in scripts (see bootstrap, repl) ad-hoc test strategy, etc in ClojureScript are begging for dependency management and a build tool. -- 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: BUG REPORT: ClojureScript : Portable Path Support
If ClojureScript isn't mavenified, how else do you easily make it a dependency in a web application? -- 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: :require farms in Clojure?
Something akin to the clj-nstools ns+ in clojure proper would sure make life easier. -- 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
Need help on Replace
Hello, Alas, spent hours on this but can't get it to work. It's looking for a pattern: r between any vowels, then replace r with l. (clojure.string/replace-first The coror is red. #([aeiou])(?:r) ([aeiou]) #(str %1 l %2)) #CompilerException java.lang.IllegalArgumentException: Wrong number of args (1) passed to: user$eval558$fn (NO_SOURCE_FILE:0) thanks and cheers! Tuba -- 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
Aw: Need help on Replace
Hi, the anonymous function takes only one argument which contains the matches. You have to extract the data from there. user= (clojure.string/replace The coror is red. #([aeiou])(?:r)([aeiou]) (fn [[_complete-match left-vowel right-vowel]] (str left-vowel l right-vowel))) The color is red. Sincerely Meikel -- 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: Anyone on Google+ yet?
Here's mine: http://plus.google.com/106752564906713546161 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: Problem Running ClojureScript on OpenJDK
I just saw this thread and that (use of internal class) does seem to be the problem. I submitted a pull request for this problem a little while ago: https://github.com/clojure/clojurescript/pull/1 On Jul 20, 9:45 pm, db donald.bl...@gmail.com wrote: I had the same problem with open jdk on ubuntu. It looks like open jdk has the class, but drops the 'internal' from the package name. You can remove the 'internal' in two places in compiler.clj and it seems to work. Longer term, the implementation-specific internal package should be removed or some checks for different implementations added. diff --git a/src/clj/cljs/compiler.clj b/src/clj/cljs/compiler.clj index b1f2213..2f1a7ab 100644 --- a/src/clj/cljs/compiler.clj +++ b/src/clj/cljs/compiler.clj @@ -916,11 +916,11 @@ goog.require = function(rule) {Packages.clojure.lang.RT[\v (print js)) (let [filename (.get jse javax.script.ScriptEngine/FILENAME) linenum (or (:line (meta form)) Integer/MIN_VALUE) - ctx (sun.org.mozilla.javascript.internal.Context/ enter)] + ctx (sun.org.mozilla.javascript.Context/enter)] (try (.evaluateString ctx (:global repl-env) js filename linenum nil) (finally - (sun.org.mozilla.javascript.internal.Context/exit + (sun.org.mozilla.javascript.Context/exit (catch Throwable ex ;;we eat ns errors because we know goog.provide() will throw when rel ;;TODO - file bug with google, this is bs error On Jul 20, 10:08 pm, David Soria experimentalwo...@googlemail.com wrote: Okay, it's a GNU classpath problem, as they don't include sun.* namespaces. Sadly javax.script.ScriptEngineManager is available and returns an impl of javax.script.Scriptable, which refers to some rhino engine that is in the classpath, but the concrete needed sun.org.mozilla.internals.Context is not in GNU classpath. Switching from OpenJDK to Oracle JDK solved the problem On Jul 21, 2:37 am, David Soria experimentalwo...@googlemail.com wrote: Hi, I try to run ClojureScript rev e4ad8ed60ca05645e0ac96362d4c6ef1e1a2bd6f my environment is: Fedora Linux 15 java version 1.6.0_22 OpenJDK Runtime Environment (IcedTea6 1.10.2) (fedora-58.1.10.2.fc15- x86_64) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode) After bootstrapping, I try to run the repl and load the cljs compiler. I get this error: Clojure 1.3.0-beta1 user= (require '[cljs.compiler :as comp]) CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: sun.org.mozilla.javascript.internal.Context, compiling:(cljs/ compiler.clj:919) Rhino is installed and correctly loaded into the classpath. $ yum info rhino Loaded plugins: langpacks, presto, refresh-packagekit Installed Packages Name : rhino Arch : noarch Version : 1.7 This looks like a problem with the sun.org.mozilla.javascript.internal package. This is part of sun-jdk and not of openjdk. -- 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: Anyone on Google+ yet?
https://plus.google.com/117357905892731200369 -- LinkedIn: http://www.linkedin.com/pub/roger-austin/8/a4/60 Twitter: http://twitter.com/RogerTheGeek -- 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: :require farms in Clojure?
On Jul 21, 2011, at 2:31 AM, pmbauer wrote: Something akin to the clj-nstools ns+ in clojure proper would sure make life easier. There's no way that `ns` and its constituent pieces are the last word in defining/managing codebase topologies, but they are a bit of a local maxima. ns+ looks nice (I'm surprised I haven't come across it so far), but I'm surprised that there haven't been more attempts to cut a better ns out there. As shown in the hello world example for ns+, it's trivial to augment or entirely replace ns, potentially with very different semantics for e.g. how namespaces map to files, what constitutes a lib, etc. - Chas -- 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: Excellent intro to core.logic
Hi Meikel, On Thu, Jul 21, 2011 at 2:19 PM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am Mittwoch, 20. Juli 2011 15:28:58 UTC+2 schrieb Ambrose Bonnaire-Sergeant: I also dropped the whole walkthrough with typedo, and replaced it with an interesting (but much easier) look at geto. See Utility Function: geto for the new section. https://github.com/frenchy64/**Logic-Starter/wikihttps://github.com/frenchy64/Logic-Starter/wiki Let me know what you think. Quite nice. Although I found the walkthrough good to get an understanding what's going, just difficult to follow because of the short local names. Good to know. I'll be able to skip over the details of `geto` now so a new walkthrough of typedo should be clearer. But it's certainly better too separate out geto. And while we are breaking conventions ;-P: would geto not better be named mapsto? with exchanged argument order? (defn mapsto? [env sym type] (matche [env] ([[[sym :- type] . _]]) ([[_ . ?rest]] (mapsto? ?rest sym type Ah, but is mapsto? a boolean predicate? :) Sure, it acts like it when its arguments are concrete values, but ;) ... maybe there is some virtue in the o suffix. As The Reasoned Schemer puts it, looks can be deceiving. As for the argument order, I tend to agree with you. I think David had some reservations about changing them, but I'm not sure why. Maybe the same reason he put one letter variables everywhere ;-) Good to see you're enjoying yourself! (Go buy The Reasoned Schemer!) Ambrose -- 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: Excellent intro to core.logic
Hi, Am Donnerstag, 21. Juli 2011 15:24:49 UTC+2 schrieb Ambrose Bonnaire-Sergeant: Ah, but is mapsto? a boolean predicate? :) Why should ? denote a boolean predicate? This is logic programming, not functional programming. ;) In Mathematics i is the imaginary unit, in electrical engineering it's the current (with j being the imaginary unit.) Sure, it acts like it when its arguments are concrete values, but ;) ... maybe there is some virtue in the o suffix. This is something I personally don't like at all. What does this code do: (geto x y z)? You can't tell you have to look at the surrounding context. And that context can be arbitrary large. A similar example is Erlang pattern matching. What does this erlang code do: {X, Y} = {1, 2}? You can't tell. You have to look at the context whether X and/or Y are bound there. In clojure (get x y z) is local. You can tell by looking at it, what's going on. Whether now x, y or z are locals or Vars makes no difference to the meaning of the code. (Go buy The Reasoned Schemer!) If you'll give me some time to read it... ;) Sincerely Meikel -- 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: Excellent intro to core.logic
On Thu, Jul 21, 2011 at 9:45 AM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am Donnerstag, 21. Juli 2011 15:24:49 UTC+2 schrieb Ambrose Bonnaire-Sergeant: Ah, but is mapsto? a boolean predicate? :) Why should ? denote a boolean predicate? This is logic programming, not functional programming. ;) In Mathematics i is the imaginary unit, in electrical engineering it's the current (with j being the imaginary unit.) Don't like it, but that's me :) Sure, it acts like it when its arguments are concrete values, but ;) ... maybe there is some virtue in the o suffix. This is something I personally don't like at all. What does this code do: (geto x y z)? You can't tell you have to look at the surrounding context. And that context can be arbitrary large. A similar example is Erlang pattern matching. What does this erlang code do: {X, Y} = {1, 2}? You can't tell. You have to look at the context whether X and/or Y are bound there. You do not need to look at the surrounding code to know what (geto x y z) does. It establishes the geto relation between x y z. x must be some key in, y must be a vector of key-value pairs and z must be a value in y. The relation guarantees this. David -- 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: Excellent intro to core.logic
On Thu, Jul 21, 2011 at 9:54 PM, David Nolen dnolen.li...@gmail.com wrote: On Thu, Jul 21, 2011 at 9:45 AM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am Donnerstag, 21. Juli 2011 15:24:49 UTC+2 schrieb Ambrose Bonnaire-Sergeant: Ah, but is mapsto? a boolean predicate? :) Why should ? denote a boolean predicate? This is logic programming, not functional programming. ;) In Mathematics i is the imaginary unit, in electrical engineering it's the current (with j being the imaginary unit.) Don't like it, but that's me :) Sure, it acts like it when its arguments are concrete values, but ;) ... maybe there is some virtue in the o suffix. This is something I personally don't like at all. What does this code do: (geto x y z)? You can't tell you have to look at the surrounding context. And that context can be arbitrary large. A similar example is Erlang pattern matching. What does this erlang code do: {X, Y} = {1, 2}? You can't tell. You have to look at the context whether X and/or Y are bound there. You do not need to look at the surrounding code to know what (geto x y z) does. It establishes the geto relation between x y z. x must be some key in, y must be a vector of key-value pairs and z must be a value in y. The relation guarantees this. I think I understand where Meikel is coming from. The function can be used in radically different ways, depending on the values of the arguments, which is somewhat unnerving. (I sympathize) Actually, David's explanation would make an excellent docstring for geto. I never really thought how the relation guarantees a contract like this, but now it seems obvious. Ambrose -- 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] ClojureScript
Where is the bug tracker for ClojureScript? For example I would like to report that windows scripts are missing. Regards, Marko -- 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: Excellent intro to core.logic
Hello David, Am Donnerstag, 21. Juli 2011 15:54:56 UTC+2 schrieb David Nolen: This is something I personally don't like at all. What does this code do: (geto x y z)? You can't tell you have to look at the surrounding context. And that context can be arbitrary large. A similar example is Erlang pattern matching. What does this erlang code do: {X, Y} = {1, 2}? You can't tell. You have to look at the context whether X and/or Y are bound there. You do not need to look at the surrounding code to know what (geto x y z) does. It establishes the geto relation between x y z. x must be some key in, y must be a vector of key-value pairs and z must be a value in y. The relation guarantees this. But then the return value (I know that there is no return value) is again boolean. Either it succeeds or not. Either (x, z) ∈ y, or not. But I will shut up now and wait for more Ambrose-Tutorials to learn about logic programming. When this sinks in, I will understand it. Meikell -- 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: Excellent intro to core.logic
Hi, Am Donnerstag, 21. Juli 2011 16:06:23 UTC+2 schrieb Ambrose Bonnaire-Sergeant: You do not need to look at the surrounding code to know what (geto x y z) does. It establishes the geto relation between x y z. x must be some key in, y must be a vector of key-value pairs and z must be a value in y. The relation guarantees this. I think I understand where Meikel is coming from. The function can be used in radically different ways, depending on the values of the arguments, which is somewhat unnerving. (I sympathize) Thanks for explaining my point than I did. Here some examples: logic-introduction.core= (run* [q] (geto 'f [['f :- Integer] ['g :- Integer]] Integer) (== q true)) (true) logic-introduction.core= (run* [q] (exist [a] (geto 'f [['f :- Integer] ['g :- Integer]] a) (== q a))) (java.lang.Integer) logic-introduction.core= (run* [q] (exist [a] (geto a [['f :- Integer] ['g :- Integer]] Integer) (== q a))) (f g) Basically the purpose *why* I call geto are always different (Maybe call is already wrong?). With (get x y z) in pure Clojure that's not the case. Free (fresh?) variables kind of feel like side-effects for my eyes. But again: I have no clue whatsoever about logic programming. Maybe I just have to train to look with the right glasses at the code. Meikel -- 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] ClojureScript
Where is the bug tracker for ClojureScript? Just created: http://dev.clojure.org/jira/browse/CLJS Stu Stuart Halloway Clojure/core http://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: Excellent intro to core.logic
On Thu, Jul 21, 2011 at 10:27 PM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am Donnerstag, 21. Juli 2011 16:06:23 UTC+2 schrieb Ambrose Bonnaire-Sergeant: You do not need to look at the surrounding code to know what (geto x y z) does. It establishes the geto relation between x y z. x must be some key in, y must be a vector of key-value pairs and z must be a value in y. The relation guarantees this. I think I understand where Meikel is coming from. The function can be used in radically different ways, depending on the values of the arguments, which is somewhat unnerving. (I sympathize) Thanks for explaining my point than I did. Here some examples: logic-introduction.core= (run* [q] (geto 'f [['f :- Integer] ['g :- Integer]] Integer) (== q true)) (true) logic-introduction.core= (run* [q] (exist [a] (geto 'f [['f :- Integer] ['g :- Integer]] a) (== q a))) (java.lang.Integer) logic-introduction.core= (run* [q] (exist [a] (geto a [['f :- Integer] ['g :- Integer]] Integer) (== q a))) (f g) Basically the purpose *why* I call geto are always different (Maybe call is already wrong?). With (get x y z) in pure Clojure that's not the case. Free (fresh?) variables kind of feel like side-effects for my eyes. But again: I have no clue whatsoever about logic programming. Maybe I just have to train to look with the right glasses at the code. I think this comes down to the declarative style of logic programming. Think of the call to `geto` like a query. You give the query parameters, and if the query succeeds, `geto` succeeds. In `geto`s case, the query is does the type association [key :- value] occur in the environment? For example: logic-introduction.core= (run* [q] (geto 'f [['f :- Integer] ['g :- Integer]] Integer) (== q true)) (true) This seems like a simple boolean expression, does ['f :- Integer] occur in [['f :- Integer] ['g :- Integer]]? But then you have the added flexibility of adding fresh variables. Suddenly it becomes apparent that the query is really declarative. `geto` says the type association [key :- value] IS in the environment(!), and assigns any fresh variables to make it so. If this assertion fails, then we can consider our program to fail. For example: logic-introduction.core= (run* [q] (exist [a] (geto 'f [['f :- Integer] ['g :- Integer]] a) (== q a))) (java.lang.Integer) Here, `geto` says ['f :- a] _IS_ in [['f :- Integer] ['g :- Integer]], and assigns a to Integer to make it so. The side effect that looks evil (reminds me of passing pointers in C), really is just `geto` being flexible enough to consider its arguments as either inputs or outputs. Hmm, let me know if that made sense. Ambrose -- 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: Problem with Leiningen 1.6.1 in Windoes
Hi Matjaz, that is what i did in the first place; however, i deleted the 1.6.1 jar (which was present), downloaded the new lein.bat 2.0.0, changed that tot 1.6.1. and now get this: D:\src\Clojure\test2lein self-install Downloading Leiningen now... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- 0:00:01 --:--:-- 0 curl: (22) The requested URL returned error: 404 Failed to download https://github.com/downloads/technomancy/leiningen/leiningen- 1.6.1-SNAPSHOT-standalone.jar See README.md for SNAPSHOT build instructions. Thx so far, Arie 2011/7/21 Matjaz Gregoric gre...@gmail.com Could you try using the master version of lein.bat? There have been a couple of patches applied since 1.6.1 that might help with your issue. You can get the latest version here: https://raw.github.com/technomancy/leiningen/master/bin/lein.bat Make sure to change the version number to 1.6.1 before running it. Replace: set LEIN_VERSION=2.0.0-SNAPSHOT with set LEIN_VERSION=1.6.1 Let us know how it went, Matjaz On Wed, Jul 20, 2011 at 2:02 PM, Arie van Wingerden xapw...@gmail.comwrote: Hi, the self-install worked ok, and I checked that the jar is present in: C:\Documents and Settings\Administrator\.lein\self-installs\leiningen-1.6.1-standalone.jar But the lein deps for a project gets stuck: D:\src\Clojure\test2lein deps Exception in thread main java.lang.NoClassDefFoundError: Files\Java\jre6\lib\e xt\QTJava/zip;;;test;src;C:\Documents and Settings\Administrator\/lein\self-ins talls\leiningen-1/6/1-standalone/jar Caused by: java.lang.ClassNotFoundException: Files\Java\jre6\lib\ext\QTJava.zip; ;;test;src;C:\Documents and Settings\Administrator\.lein\self-installs\leininge n-1.6.1-standalone.jar at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: Files\Java\jre6\lib\ext\QTJava.zip;;;test;src;C: \Documents and Settings\Administrator\.lein\self-installs\leiningen-1.6.1-standa lone.jar. Program will exit. It seems the classpath is not being constructed correctly; instead of dots there are slashes and also a mix of back- and forward slashes. Before the invocation of lein the classpath is: CLASSPATH=.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip Any ideas what is (or what I am doing) wrong? Thx, Arie -- 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 -- 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: BUG REPORT: ClojureScript : Portable Path Support
If ClojureScript isn't mavenified, how else do you easily make it a dependency in a web application? Maven doesn't any problems that we have, and would add complexity to the development process and slow us down. Also, we don't want to unthinkingly drag Java presumptions into ClojureScript. Let's wait and collect feedback from the community before pouring any cement on deployment approaches. Stu Stuart Halloway Clojure/core http://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: Excellent intro to core.logic
On Thu, Jul 21, 2011 at 10:27 AM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am Donnerstag, 21. Juli 2011 16:06:23 UTC+2 schrieb Ambrose Bonnaire-Sergeant: You do not need to look at the surrounding code to know what (geto x y z) does. It establishes the geto relation between x y z. x must be some key in, y must be a vector of key-value pairs and z must be a value in y. The relation guarantees this. I think I understand where Meikel is coming from. The function can be used in radically different ways, depending on the values of the arguments, which is somewhat unnerving. (I sympathize) Thanks for explaining my point than I did. Here some examples: logic-introduction.core= (run* [q] (geto 'f [['f :- Integer] ['g :- Integer]] Integer) (== q true)) (true) logic-introduction.core= (run* [q] (exist [a] (geto 'f [['f :- Integer] ['g :- Integer]] a) (== q a))) (java.lang.Integer) logic-introduction.core= (run* [q] (exist [a] (geto a [['f :- Integer] ['g :- Integer]] Integer) (== q a))) (f g) Basically the purpose *why* I call geto are always different (Maybe call is already wrong?). With (get x y z) in pure Clojure that's not the case. Free (fresh?) variables kind of feel like side-effects for my eyes. But again: I have no clue whatsoever about logic programming. Maybe I just have to train to look with the right glasses at the code. Meikel geto establishes a relation and you can find out which values satisfy that relation. Functional programming thinking won't help much here - consider that in pure logic programs order doesn't even matter most of the time - because you are establishing *relations* between values. I don't see the correlation to side-effects here at all since order does not determine the outcome of the program. David -- 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: Problem with Leiningen 1.6.1 in Windoes
It seems like the version in lein.bat is set to 1.6.1-SNAPSHOT instead of just 1.6.1. The line in the lein.bat file should say set LEIN_VERSION=1.6.1 instead of set LEIN_VERSION=1.6.1-SNAPSHOT Matjaz On Thu, Jul 21, 2011 at 4:49 PM, Arie van Wingerden xapw...@gmail.comwrote: Hi Matjaz, that is what i did in the first place; however, i deleted the 1.6.1 jar (which was present), downloaded the new lein.bat 2.0.0, changed that tot 1.6.1. and now get this: D:\src\Clojure\test2lein self-install Downloading Leiningen now... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- 0:00:01 --:--:-- 0 curl: (22) The requested URL returned error: 404 Failed to download https://github.com/downloads/technomancy/leiningen/leiningen- 1.6.1-SNAPSHOT-standalone.jar See README.md for SNAPSHOT build instructions. Thx so far, Arie 2011/7/21 Matjaz Gregoric gre...@gmail.com Could you try using the master version of lein.bat? There have been a couple of patches applied since 1.6.1 that might help with your issue. You can get the latest version here: https://raw.github.com/technomancy/leiningen/master/bin/lein.bat Make sure to change the version number to 1.6.1 before running it. Replace: set LEIN_VERSION=2.0.0-SNAPSHOT with set LEIN_VERSION=1.6.1 Let us know how it went, Matjaz On Wed, Jul 20, 2011 at 2:02 PM, Arie van Wingerden xapw...@gmail.comwrote: Hi, the self-install worked ok, and I checked that the jar is present in: C:\Documents and Settings\Administrator\.lein\self-installs\leiningen-1.6.1-standalone.jar But the lein deps for a project gets stuck: D:\src\Clojure\test2lein deps Exception in thread main java.lang.NoClassDefFoundError: Files\Java\jre6\lib\e xt\QTJava/zip;;;test;src;C:\Documents and Settings\Administrator\/lein\self-ins talls\leiningen-1/6/1-standalone/jar Caused by: java.lang.ClassNotFoundException: Files\Java\jre6\lib\ext\QTJava.zip; ;;test;src;C:\Documents and Settings\Administrator\.lein\self-installs\leininge n-1.6.1-standalone.jar at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: Files\Java\jre6\lib\ext\QTJava.zip;;;test;src;C: \Documents and Settings\Administrator\.lein\self-installs\leiningen-1.6.1-standa lone.jar. Program will exit. It seems the classpath is not being constructed correctly; instead of dots there are slashes and also a mix of back- and forward slashes. Before the invocation of lein the classpath is: CLASSPATH=.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip Any ideas what is (or what I am doing) wrong? Thx, Arie -- 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 -- 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: Problem with Leiningen 1.6.1 in Windoes
Ah indeed that was the problem. Thx, Arie 2011/7/21 Matjaz Gregoric gre...@gmail.com It seems like the version in lein.bat is set to 1.6.1-SNAPSHOT instead of just 1.6.1. The line in the lein.bat file should say set LEIN_VERSION=1.6.1 instead of set LEIN_VERSION=1.6.1-SNAPSHOT Matjaz On Thu, Jul 21, 2011 at 4:49 PM, Arie van Wingerden xapw...@gmail.comwrote: Hi Matjaz, that is what i did in the first place; however, i deleted the 1.6.1 jar (which was present), downloaded the new lein.bat 2.0.0, changed that tot 1.6.1. and now get this: D:\src\Clojure\test2lein self-install Downloading Leiningen now... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- 0:00:01 --:--:-- 0 curl: (22) The requested URL returned error: 404 Failed to download https://github.com/downloads/technomancy/leiningen/leiningen- 1.6.1-SNAPSHOT-standalone.jar See README.md for SNAPSHOT build instructions. Thx so far, Arie 2011/7/21 Matjaz Gregoric gre...@gmail.com Could you try using the master version of lein.bat? There have been a couple of patches applied since 1.6.1 that might help with your issue. You can get the latest version here: https://raw.github.com/technomancy/leiningen/master/bin/lein.bat Make sure to change the version number to 1.6.1 before running it. Replace: set LEIN_VERSION=2.0.0-SNAPSHOT with set LEIN_VERSION=1.6.1 Let us know how it went, Matjaz On Wed, Jul 20, 2011 at 2:02 PM, Arie van Wingerden xapw...@gmail.comwrote: Hi, the self-install worked ok, and I checked that the jar is present in: C:\Documents and Settings\Administrator\.lein\self-installs\leiningen-1.6.1-standalone.jar But the lein deps for a project gets stuck: D:\src\Clojure\test2lein deps Exception in thread main java.lang.NoClassDefFoundError: Files\Java\jre6\lib\e xt\QTJava/zip;;;test;src;C:\Documents and Settings\Administrator\/lein\self-ins talls\leiningen-1/6/1-standalone/jar Caused by: java.lang.ClassNotFoundException: Files\Java\jre6\lib\ext\QTJava.zip; ;;test;src;C:\Documents and Settings\Administrator\.lein\self-installs\leininge n-1.6.1-standalone.jar at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: Files\Java\jre6\lib\ext\QTJava.zip;;;test;src;C: \Documents and Settings\Administrator\.lein\self-installs\leiningen-1.6.1-standa lone.jar. Program will exit. It seems the classpath is not being constructed correctly; instead of dots there are slashes and also a mix of back- and forward slashes. Before the invocation of lein the classpath is: CLASSPATH=.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip Any ideas what is (or what I am doing) wrong? Thx, Arie -- 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 -- 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 -- You received this message because you are subscribed to the Google Groups Clojure group. To post to
Re: Problem with Leiningen 1.6.1 in Windoes
On Thu, Jul 21, 2011 at 8:38 AM, Matjaz Gregoric gre...@gmail.com wrote: It seems like the version in lein.bat is set to 1.6.1-SNAPSHOT instead of just 1.6.1. Would it be helpful to create a 1.6.1-windows tag? -Phil -- 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: :require farms in Clojure?
On Thu, Jul 21, 2011 at 5:59 AM, Chas Emerick cemer...@snowtide.com wrote: There's no way that `ns` and its constituent pieces are the last word in defining/managing codebase topologies, but they are a bit of a local maxima. ns+ looks nice (I'm surprised I haven't come across it so far), but I'm surprised that there haven't been more attempts to cut a better ns out there. As shown in the hello world example for ns+, it's trivial to augment or entirely replace ns Bootstrapping is still a problem as clojure.core/ns is special-cased to always be available in every namespace ever. In our application at work we had to resort to defing ns+ in clojure.core inside user.clj in order for it to be available across the board--pretty cringe-worthy and doesn't compose. Would be happy to come up with a satisfactory solution to this. But nstools addresses one of my one remaining major pain points surrounding Clojure, and I'm looking forward to making better use of it. -Phil -- 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: BUG REPORT: ClojureScript : Portable Path Support
generated JS has path problems on windows Until this gets fixed you can work around this particular problem by using one of the available optimizations. cljsc src {:optimizations :simple} twitterbuzz.js You may also use :whitespace or :advanced in place of :simple above. This will produce one JavaScript file with no goog.addDependency calls. In the index.html file, remove all of the script tags except for the one that pulls in twitterbuzz.js On Jul 20, 10:12 pm, pmbauer paul.michael.ba...@gmail.com wrote: Per instructions from redinger and jgehtland (patch addressing one issue attached). Three separate issues so far re: path support on windows * compiler path regex is not portable, cljs/compiler.clj:1096 (see attached patch, thanks amalloy for the assist) * generated JS has path problems on windows goog.addDependency(* ..\..\..\..\..\..\..\/C:/tmp/clojurescript/samples/twitterbuzz/out/cljs/core.js *, ['cljs.core'], ['goog.string', 'goog.string.StringBuffer', 'goog.object', 'goog.array']); * helper launch scripts on windows (under cygwin), more a feature than bug portable-path-regex.diff 1KViewDownload -- 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: BUG REPORT: ClojureScript : Portable Path Support
Fair enough. But, it would be nice to eventually have a ClojureScript jar available in a public maven repo someplace. Not having one would needlessly complicate projects that already use a maven-based build tool (mvn, lein, cake) and want to depend on it as part of their build. -- 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: BUG REPORT: ClojureScript : Portable Path Support
On Jul 21, 2011, at 12:40 AM, Sean Corfield wrote: On Wed, Jul 20, 2011 at 9:34 PM, pmbauer paul.michael.ba...@gmail.com wrote: Even better would be ClojureScript with maven support Didn't Rich say he hopes Maven doesn't come anywhere near ClojureScript? :) I know. But the sorts of (presently non-portable) scripts in scripts (see bootstrap, repl) ad-hoc test strategy, etc in ClojureScript are begging for dependency management and a build tool. If ClojureScript isn't mavenified, how else do you easily make it a dependency in a web application? ClojureScript should have scripts or other low level methods for doing everything it needs, so that, if one is so inclined, those methods can be applied by higher level tools. It would be a disaster if the main entry point for a ClojureScript REPL or compilation process were via Maven. That is all separate from the provide-ClojureScript-as-a-dependency issue (having a pom file off in the corner so that releases can be pushed out to central will resolve that). - Chas -- 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: BUG REPORT: ClojureScript : Portable Path Support
Fair enough. That addresses my concern. -- 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: Need help on Replace
This works! I really appreciate your help. Thank you very much. On Jul 21, 2:33 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, the anonymous function takes only one argument which contains the matches. You have to extract the data from there. user= (clojure.string/replace The coror is red. #([aeiou])(?:r)([aeiou]) (fn [[_complete-match left-vowel right-vowel]] (str left-vowel l right-vowel))) The color is red. Sincerely Meikel -- 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
what makes this code slow?
The two functions below should return true if the first argument is divisible by any of the prime numbers (ascending) in the second argument, and false otherwise. But the second function is much slower. I haven't been able to figure out why. Can you? Also, if there is a more idiomatic way, please share :) (defn divisable? [n coll] (let [count (count coll) mx (int (Math/sqrt n))] (loop [j 0] (cond (= j count) true ( (nth coll j) mx) true (factor? n (nth coll j)) false :else (recur (inc j)) (defn divisable-slow? [n coll] (let [limit (int (Math/sqrt n))] (not-any? #(factor? n %) (filter #(= % limit) coll -- 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
Being able to use blank?
What is the proper syntax to be able to use blank? ? I've tried a bunch of things in the docs, but either the :require syntax is bad, or I get a Java exception saying blank? not recognized. Method 1 - (ns test-csv (:gen-class) (:use clojure.contrib.command-line) (:use clojure-csv.core) (:require '[clojure.string :as str])) java.lang.RuntimeException: java.lang.Exception: lib names inside prefix lists must not contain periods (test_csv.clj:2) Method 2 - (ns test-csv (:gen-class) (:use clojure.contrib.command-line) (:use clojure-csv.core) (:require clojure.contrib.string)) [compile] Compiling namespace test-csv error evaluating: ((compile-stale source-path compile-path)) java.lang.RuntimeException: java.lang.Exception: Unable to resolve symbol: blank? in this context (test_csv.clj:16) -- 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 that slowness?
Hi all, probably I don't see the forest for trees, but anyhow. In my graph transformation lib I have these functions for applying rules: --8---cut here---start-8--- (defn iteratively Applies the function f with args as long as it returns logical true. Returns the number of successful applications or nil if it couldn't be applied at least once. [r args] (loop [val (apply r args), i 0] (if val (recur (apply r args) (inc i)) (if (zero? i) nil i (defn choose Chooses non-deterministically one of the given funs and applies it. Returns the value of applying the chosen fun. Returns nil if none of the funs was applicable. [ funs] (when (seq funs) (let [fun (rand-nth funs) val (fun)] (or val (recur (remove #(= fun %) funs)) (defn fold-constants [g] (let [start-block (the (vseq g 'StartBlock))] (iteratively pull-up-consts g) (iteratively replace-not g start-block) (iteratively replace-binary g start-block))) (defn fold-constants-with-choose [g] (let [start-block (the (vseq g 'StartBlock))] (iteratively (fn [] (choose #(pull-up-consts g) #(replace-not g start-block) #(replace-binary g start-block)) ;; Takes 3.5 secs (time (fold-constants g)) ;; Takes 450 times longer! (time (fold-constants-with-choose g)) --8---cut here---end---8--- Why does the variant with `choose' take 450 times longer than without? The individual rules match totally disjunctive structures and there's a fixed number of places where a rule can be applied. So even if choose always selects the single applicable rule at last I wouldn't expect a slowdown of more than 3. Any hints? 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: Being able to use blank?
I think it's just a sintax problem. (ns test-csv ... (:require [clojure.string :as str])) -- 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: Being able to use blank?
Thanks. You're right. (:require [clojure.contrib.string :as cstr]) ; str already defined On Jul 21, 3:16 pm, Islon Scherer islonsche...@gmail.com wrote: I think it's just a sintax problem. (ns test-csv ... (:require [clojure.string :as str])) -- 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: Being able to use blank?
2011/7/21 octopusgrabbus octopusgrab...@gmail.com: Thanks. You're right. (:require [clojure.contrib.string :as cstr]) ; str already defined There should be no conflict between the var str (clojure.core/str) and the namespace alias str (clojure.string). Names for vars and namespaces never occur at the same place and cannot be mistaken for each other (by the compiler for sure, but I don't know about humans). Yout first attempt failed because of the quote. since 'x is equivalent to (quote x), this (ns test-csv (:require '[clojure.string :as str])) becomes (ns test-csv (:require (quote [clojure.string :as str]))) which is interpreted as the prefix syntax: (foo [b :as b] [c :as c]) is the same as [foo.b :as b] [foo.c :as c]. However, the stuff that comes first in the vector (b and c) must not have a dot in it, hence the error message. // raek -- 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 that slowness?
On Jul 21, 12:15 pm, Tassilo Horn tass...@member.fsf.org wrote: Hi all, probably I don't see the forest for trees, but anyhow. In my graph transformation lib I have these functions for applying rules: --8---cut here---start-8--- (defn iteratively Applies the function f with args as long as it returns logical true. Returns the number of successful applications or nil if it couldn't be applied at least once. [r args] (loop [val (apply r args), i 0] (if val (recur (apply r args) (inc i)) (if (zero? i) nil i (defn choose Chooses non-deterministically one of the given funs and applies it. Returns the value of applying the chosen fun. Returns nil if none of the funs was applicable. [ funs] (when (seq funs) (let [fun (rand-nth funs) val (fun)] (or val (recur (remove #(= fun %) funs)) (defn fold-constants [g] (let [start-block (the (vseq g 'StartBlock))] (iteratively pull-up-consts g) (iteratively replace-not g start-block) (iteratively replace-binary g start-block))) (defn fold-constants-with-choose [g] (let [start-block (the (vseq g 'StartBlock))] (iteratively (fn [] (choose #(pull-up-consts g) #(replace-not g start-block) #(replace-binary g start-block)) ;; Takes 3.5 secs (time (fold-constants g)) ;; Takes 450 times longer! (time (fold-constants-with-choose g)) --8---cut here---end---8--- Why does the variant with `choose' take 450 times longer than without? The individual rules match totally disjunctive structures and there's a fixed number of places where a rule can be applied. So even if choose always selects the single applicable rule at last I wouldn't expect a slowdown of more than 3. Any hints? (1) The first version is doing way less work. It tries the first rule until it runs out of steam, then the second rule, then the third rule. If the third rule produces a structure that the first rule could have matched, it will never be tried, because the first rule is done. The second version, however, keeps reducing the structure using all three rules until there are no transformation available. (2) Your implementation of choose is pretty inefficient itself. rand- nth is slow, remove is slow...If you're using it in a performance- sensitive area, I would write it differently. Especially, you could probably gain a lot by making choose return a function, rather than immediately execute something, so that it can pre-compute the data that it will use more than once. Something like this (untested): (defn choose Chooses non-deterministically one of the given funs and applies it. Returns the value of applying the chosen fun. Returns nil if none of the funs was applicable. [ funs] (let [fnmap (vec funs)] (fn [] (loop [fns fnmap, tries-left (count fns)] (when-not (zero? tries-left) (let [idx (rand-int tries-left) f (get fns idx) val (f)] (or val (recur (assoc fns idx (get fns (dec tries-left))) (dec tries-left) (defn fold-constants-with-choose [g] (let [start-block (the (vseq g 'StartBlock))] (iteratively (choose #(pull-up-consts g) #(replace-not g start-block) #(replace-binary g start-block) -- 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: what makes this code slow?
nil ache...@gmail.com writes: Hi! The two functions below should return true if the first argument is divisible by any of the prime numbers (ascending) in the second argument, and false otherwise. Without testing, I cannot see that these functions do what you want. At least the second looks like it returns true if n is *not* divisible by any prime in coll. 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: what makes this code slow?
Oh right. What you said is what I meant. I renamed the functions improperly and then fooled myself. But I still can't figure out why the second one is much slower. On Jul 21, 4:09 pm, Tassilo Horn tass...@member.fsf.org wrote: nil ache...@gmail.com writes: Hi! The two functions below should return true if the first argument is divisible by any of the prime numbers (ascending) in the second argument, and false otherwise. Without testing, I cannot see that these functions do what you want. At least the second looks like it returns true if n is *not* divisible by any prime in coll. 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: Why that slowness?
Alan Malloy a...@malloys.org writes: Hi Alan, Any hints? (1) The first version is doing way less work. It tries the first rule until it runs out of steam, then the second rule, then the third rule. If the third rule produces a structure that the first rule could have matched, it will never be tried, because the first rule is done. The second version, however, keeps reducing the structure using all three rules until there are no transformation available. Yes, that's true. However, in my test graph, it's basically a fixed point reduction from 10 elements to 16. The first rule is the only one that is able to produce a new match for the third rule. It pulls constants in trees of binary operations towards the leafs (for commutative, associative ops) so that the third rule can evaluate them. The second and third rule don't influence each other. Hm, it's highly likely that you have to perform the first rule several times to make the third rule applicable at all... (2) Your implementation of choose is pretty inefficient itself. rand- nth is slow, remove is slow...If you're using it in a performance- sensitive area, I would write it differently. Especially, you could probably gain a lot by making choose return a function, rather than immediately execute something, so that it can pre-compute the data that it will use more than once. Something like this (untested): Ok, that's only 397 times slower which might also be a coincidence due to the randomness. :-) (defn choose [ funs] (let [fnmap (vec funs)] Why do you think this performs better than doing (vec funs) as init expression in the loop (and then not returning a function but a value)? (fn [] (loop [fns fnmap, tries-left (count fns)] (when-not (zero? tries-left) (let [idx (rand-int tries-left) f (get fns idx) val (f)] (or val (recur (assoc fns idx (get fns (dec tries-left))) (dec tries-left) 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
Can't find clojure.main in clojurescript's script/repl on Windows
Hi everyone, I'm trying to get the repl for Clojurescript to start under Windows but keep running into the following error: Exception in thread main java.lang.NoClassDefFoundError: clojure/main Caused by: java.lang.ClassNotFoundException: clojure.main at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: clojure.main. Program will exit. I've tried both running the script under cygwin and putting the contents into a batch file and running it with cmd.exe (it shouldn't be a problem since script/repl just contains one command which starts the java runtime with a few options). I've even tried changing the forward slashes in the command to backslashes. Also, I'm running these commands from the clojurescript root directory. Even though it probably won't affect it I've set CLOJURESCRIPT_HOME as well. Any ideas? -- 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: Can't find clojure.main in clojurescript's script/repl on Windows
Did you run script/bootstrap? You need a clojure-1.3 jar in your clojurescript/lib directory. On Thursday, July 21, 2011 at 4:45 PM, Tamreen Khan wrote: Hi everyone, I'm trying to get the repl for Clojurescript to start under Windows but keep running into the following error: Exception in thread main java.lang.NoClassDefFoundError: clojure/main Caused by: java.lang.ClassNotFoundException: clojure.main at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: clojure.main. Program will exit. I've tried both running the script under cygwin and putting the contents into a batch file and running it with cmd.exe (it shouldn't be a problem since script/repl just contains one command which starts the java runtime with a few options). I've even tried changing the forward slashes in the command to backslashes. Also, I'm running these commands from the clojurescript root directory. Even though it probably won't affect it I've set CLOJURESCRIPT_HOME as well. Any ideas? -- 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 (mailto: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 (mailto: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: Can't find clojure.main in clojurescript's script/repl on Windows
Yes. It worked fine. On Thu, Jul 21, 2011 at 5:48 PM, Devin Walters dev...@gmail.com wrote: Did you run script/bootstrap? You need a clojure-1.3 jar in your clojurescript/lib directory. On Thursday, July 21, 2011 at 4:45 PM, Tamreen Khan wrote: Hi everyone, I'm trying to get the repl for Clojurescript to start under Windows but keep running into the following error: Exception in thread main java.lang.NoClassDefFoundError: clojure/main Caused by: java.lang.ClassNotFoundException: clojure.main at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: clojure.main. Program will exit. I've tried both running the script under cygwin and putting the contents into a batch file and running it with cmd.exe (it shouldn't be a problem since script/repl just contains one command which starts the java runtime with a few options). I've even tried changing the forward slashes in the command to backslashes. Also, I'm running these commands from the clojurescript root directory. Even though it probably won't affect it I've set CLOJURESCRIPT_HOME as well. Any ideas? -- 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 (mailto: 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 (mailto: 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 -- 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: Can't find clojure.main in clojurescript's script/repl on Windows
Hmm, I have clojure.jar, but not clojure-1.3.jar in clojurescript/lib On Thu, Jul 21, 2011 at 5:49 PM, Tamreen Khan histor...@gmail.com wrote: Yes. It worked fine. On Thu, Jul 21, 2011 at 5:48 PM, Devin Walters dev...@gmail.com wrote: Did you run script/bootstrap? You need a clojure-1.3 jar in your clojurescript/lib directory. On Thursday, July 21, 2011 at 4:45 PM, Tamreen Khan wrote: Hi everyone, I'm trying to get the repl for Clojurescript to start under Windows but keep running into the following error: Exception in thread main java.lang.NoClassDefFoundError: clojure/main Caused by: java.lang.ClassNotFoundException: clojure.main at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: clojure.main. Program will exit. I've tried both running the script under cygwin and putting the contents into a batch file and running it with cmd.exe (it shouldn't be a problem since script/repl just contains one command which starts the java runtime with a few options). I've even tried changing the forward slashes in the command to backslashes. Also, I'm running these commands from the clojurescript root directory. Even though it probably won't affect it I've set CLOJURESCRIPT_HOME as well. Any ideas? -- 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 (mailto: 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 (mailto: 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 -- 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
clojure.contrib.profile crashes
Hello everybody, I have used the profiler successfully in the past. But some how it is repeatedly crashing with the following stack trace. Value out of range for int: 17069635385 [Thrown class java.lang.IllegalArgumentException] Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.lang.RT.intCast(RT.java:950) 1: clojure.lang.RT.intCast(RT.java:922) 2: clojure.contrib.profile$summarize$fn__3252.invoke(profile.clj:88) 3: clojure.core$r.invoke(core.clj:799) 4: clojure.contrib.profile$summarize.invoke(profile.clj:85) 5: bitvector.core$eval4530.invoke(NO_SOURCE_FILE:1) 6: clojure.lang.Compiler.eval(Compiler.java:5424) 7: clojure.lang.Compiler.eval(Compiler.java:5391) 8: clojure.core$eval.invoke(core.clj:2382) 9: swank.core$eval650$fn__651.invoke(core.clj:409) 10: clojure.lang.MultiFn.invoke(MultiFn.java:163) . . . . Before I bother you all with actual code which might get messy, does anybody have any suggestion as to why this is happening..? Thanks, Sunil. -- 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.contrib.profile crashes
The reason I am not posting the code is because I am not able to reproduce this on a simple case. I was just hoping some of you may have some insight with out the code.. Thanks, Sunil. On Fri, Jul 22, 2011 at 3:29 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hello everybody, I have used the profiler successfully in the past. But some how it is repeatedly crashing with the following stack trace. Value out of range for int: 17069635385 [Thrown class java.lang.IllegalArgumentException] Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.lang.RT.intCast(RT.java:950) 1: clojure.lang.RT.intCast(RT.java:922) 2: clojure.contrib.profile$summarize$fn__3252.invoke(profile.clj:88) 3: clojure.core$r.invoke(core.clj:799) 4: clojure.contrib.profile$summarize.invoke(profile.clj:85) 5: bitvector.core$eval4530.invoke(NO_SOURCE_FILE:1) 6: clojure.lang.Compiler.eval(Compiler.java:5424) 7: clojure.lang.Compiler.eval(Compiler.java:5391) 8: clojure.core$eval.invoke(core.clj:2382) 9: swank.core$eval650$fn__651.invoke(core.clj:409) 10: clojure.lang.MultiFn.invoke(MultiFn.java:163) . . . . Before I bother you all with actual code which might get messy, does anybody have any suggestion as to why this is happening..? Thanks, Sunil. -- 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
How to Return Vector of Vectors
(def accumail-url-keys [CA, STREET, STREET2, CITY, STATE, ZIP, YR, BILL_NO, BILL_TYPE]) (defn ret-params Generates all q-parameters and returns them in a vector of vectors. [all-csv-rows] (let [param-vec [[]] ] (doseq [one-full-csv-row all-csv-rows] (let [accumail-csv-row one-full-csv-row q-param (zipmap accumail-url-keys accumail-csv-row) accu-q-param (first (rest (split-at 3 q-param))) billing-param (first (split-at 3 q-param))] (conj param-vec accu-q-param billing-param))) param-vec)) I combine some internal data with each vector returned from clojure- csv's parse-csv. I want to return all that in a new vector of vectors, but param-vec is empty. What am I doing wrong? tnx cmn -- 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: Can't find clojure.main in clojurescript's script/repl on Windows
That clojure.jar file is clojure 1.3. Something is wrong with the classpath. Here are a couple of things to try: - when using a batch file the classpath must be delimited with semicolons instead of colons - try replacing lib/* with an explicit list everything that is in lib - something like lib/clojure.jar;lib/goog.jar;lib/compiler.jar Just some thoughts On Jul 21, 5:50 pm, Tamreen Khan histor...@gmail.com wrote: Hmm, I have clojure.jar, but not clojure-1.3.jar in clojurescript/lib On Thu, Jul 21, 2011 at 5:49 PM, Tamreen Khan histor...@gmail.com wrote: Yes. It worked fine. On Thu, Jul 21, 2011 at 5:48 PM, Devin Walters dev...@gmail.com wrote: Did you run script/bootstrap? You need a clojure-1.3 jar in your clojurescript/lib directory. On Thursday, July 21, 2011 at 4:45 PM, Tamreen Khan wrote: Hi everyone, I'm trying to get the repl for Clojurescript to start under Windows but keep running into the following error: Exception in thread main java.lang.NoClassDefFoundError: clojure/main Caused by: java.lang.ClassNotFoundException: clojure.main at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: clojure.main. Program will exit. I've tried both running the script under cygwin and putting the contents into a batch file and running it with cmd.exe (it shouldn't be a problem since script/repl just contains one command which starts the java runtime with a few options). I've even tried changing the forward slashes in the command to backslashes. Also, I'm running these commands from the clojurescript root directory. Even though it probably won't affect it I've set CLOJURESCRIPT_HOME as well. Any ideas? -- 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 (mailto: 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 (mailto: 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 -- 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: Can't find clojure.main in clojurescript's script/repl on Windows
Changing colons to semicolons did it! I guess since the classpath is a string that's passed to Java it still treats it like it would any path on Windows, even though I'm using it through Cygwin. Thanks again! On Thu, Jul 21, 2011 at 6:49 PM, Brenton bashw...@gmail.com wrote: That clojure.jar file is clojure 1.3. Something is wrong with the classpath. Here are a couple of things to try: - when using a batch file the classpath must be delimited with semicolons instead of colons - try replacing lib/* with an explicit list everything that is in lib - something like lib/clojure.jar;lib/goog.jar;lib/compiler.jar Just some thoughts On Jul 21, 5:50 pm, Tamreen Khan histor...@gmail.com wrote: Hmm, I have clojure.jar, but not clojure-1.3.jar in clojurescript/lib On Thu, Jul 21, 2011 at 5:49 PM, Tamreen Khan histor...@gmail.com wrote: Yes. It worked fine. On Thu, Jul 21, 2011 at 5:48 PM, Devin Walters dev...@gmail.com wrote: Did you run script/bootstrap? You need a clojure-1.3 jar in your clojurescript/lib directory. On Thursday, July 21, 2011 at 4:45 PM, Tamreen Khan wrote: Hi everyone, I'm trying to get the repl for Clojurescript to start under Windows but keep running into the following error: Exception in thread main java.lang.NoClassDefFoundError: clojure/main Caused by: java.lang.ClassNotFoundException: clojure.main at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: clojure.main. Program will exit. I've tried both running the script under cygwin and putting the contents into a batch file and running it with cmd.exe (it shouldn't be a problem since script/repl just contains one command which starts the java runtime with a few options). I've even tried changing the forward slashes in the command to backslashes. Also, I'm running these commands from the clojurescript root directory. Even though it probably won't affect it I've set CLOJURESCRIPT_HOME as well. Any ideas? -- 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(mailto: 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 (mailto: 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 -- 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: clojure.contrib.profile crashes
What version of Clojure are you running? Cheers, Aaron Bedra -- Clojure/core http://clojure.com On 07/21/2011 06:12 PM, Sunil S Nandihalli wrote: The reason I am not posting the code is because I am not able to reproduce this on a simple case. I was just hoping some of you may have some insight with out the code.. Thanks, Sunil. On Fri, Jul 22, 2011 at 3:29 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com mailto:sunil.nandiha...@gmail.com wrote: Hello everybody, I have used the profiler successfully in the past. But some how it is repeatedly crashing with the following stack trace. Value out of range for int: 17069635385 [Thrown class java.lang.IllegalArgumentException] Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.lang.RT.intCast(RT.java:950) 1: clojure.lang.RT.intCast(RT.java:922) 2: clojure.contrib.profile$summarize$fn__3252.invoke(profile.clj:88) 3: clojure.core$r.invoke(core.clj:799) 4: clojure.contrib.profile$summarize.invoke(profile.clj:85) 5: bitvector.core$eval4530.invoke(NO_SOURCE_FILE:1) 6: clojure.lang.Compiler.eval(Compiler.java:5424) 7: clojure.lang.Compiler.eval(Compiler.java:5391) 8: clojure.core$eval.invoke(core.clj:2382) 9: swank.core$eval650$fn__651.invoke(core.clj:409) 10: clojure.lang.MultiFn.invoke(MultiFn.java:163) . . . . Before I bother you all with actual code which might get messy, does anybody have any suggestion as to why this is happening..? Thanks, Sunil. -- 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: How to Return Vector of Vectors
Simple: conj doesn't mutate the vector, it returns a new vector. Clojure is a (mostly) immutable language, you're trying to solve the problem in a imperative way, you should solve it in a functional way. On Jul 21, 7:48 pm, octopusgrabbus octopusgrab...@gmail.com wrote: (def accumail-url-keys [CA, STREET, STREET2, CITY, STATE, ZIP, YR, BILL_NO, BILL_TYPE]) (defn ret-params Generates all q-parameters and returns them in a vector of vectors. [all-csv-rows] (let [param-vec [[]] ] (doseq [one-full-csv-row all-csv-rows] (let [accumail-csv-row one-full-csv-row q-param (zipmap accumail-url-keys accumail-csv-row) accu-q-param (first (rest (split-at 3 q-param))) billing-param (first (split-at 3 q-param))] (conj param-vec accu-q-param billing-param))) param-vec)) I combine some internal data with each vector returned from clojure- csv's parse-csv. I want to return all that in a new vector of vectors, but param-vec is empty. What am I doing wrong? tnx cmn -- 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 Return Vector of Vectors
And do you have a suggestion for a functional way? On Jul 21, 8:05 pm, Islon Scherer islonsche...@gmail.com wrote: Simple: conj doesn't mutate the vector, it returns a new vector. Clojure is a (mostly) immutable language, you're trying to solve the problem in a imperative way, you should solve it in a functional way. On Jul 21, 7:48 pm, octopusgrabbus octopusgrab...@gmail.com wrote: (def accumail-url-keys [CA, STREET, STREET2, CITY, STATE, ZIP, YR, BILL_NO, BILL_TYPE]) (defn ret-params Generates all q-parameters and returns them in a vector of vectors. [all-csv-rows] (let [param-vec [[]] ] (doseq [one-full-csv-row all-csv-rows] (let [accumail-csv-row one-full-csv-row q-param (zipmap accumail-url-keys accumail-csv-row) accu-q-param (first (rest (split-at 3 q-param))) billing-param (first (split-at 3 q-param))] (conj param-vec accu-q-param billing-param))) param-vec)) I combine some internal data with each vector returned from clojure- csv's parse-csv. I want to return all that in a new vector of vectors, but param-vec is empty. What am I doing wrong? tnx cmn -- 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: what makes this code slow?
The first version stops as soon it encounters the first item in the collection that's too big. The second version filters the whole collection, which may lead to a major slowdown, depending on coll's relative size. It will also hang if coll is infinite. This should be better: (take-while #(= % limit) coll) That said, a properly written loop will always be faster that an idiomatic version using first-order functions. On Jul 22, 12:17 am, nil ache...@gmail.com wrote: Oh right. What you said is what I meant. I renamed the functions improperly and then fooled myself. But I still can't figure out why the second one is much slower. -- 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 Return Vector of Vectors
On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus octopusgrab...@gmail.com wrote: And do you have a suggestion for a functional way? Yes. Change (doseq [one-full-csv-row all-csv-rows] (let [accumail-csv-row one-full-csv-row q-param (zipmap accumail-url-keys accumail-csv-row) accu-q-param (first (rest (split-at 3 q-param))) billing-param (first (split-at 3 q-param))] (conj param-vec accu-q-param billing-param))) to (reduce (fn [one-full-csv-row] (let [q-param (zipmap accumail-url-keys one-full-csv-row) accu-q-param (first (rest (split-at 3 q-param))) billing-param (first (split-at 3 q-param))] [accu-q-param billing-param])) [] all-csv-rows) (This is assuming you want an output of the form [[accu-q-param-1 billing-param-1][accu-q-param-2 billing-param-2]...].) -- 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: How to Return Vector of Vectors
On Thu, Jul 21, 2011 at 10:13 PM, Ken Wesson kwess...@gmail.com wrote: On Thu, Jul 21, 2011 at 8:36 PM, octopusgrabbus octopusgrab...@gmail.com wrote: And do you have a suggestion for a functional way? Yes. Change (doseq [one-full-csv-row all-csv-rows] (let [accumail-csv-row one-full-csv-row q-param (zipmap accumail-url-keys accumail-csv-row) accu-q-param (first (rest (split-at 3 q-param))) billing-param (first (split-at 3 q-param))] (conj param-vec accu-q-param billing-param))) to (reduce (fn [one-full-csv-row] (let [q-param (zipmap accumail-url-keys one-full-csv-row) accu-q-param (first (rest (split-at 3 q-param))) billing-param (first (split-at 3 q-param))] [accu-q-param billing-param])) [] all-csv-rows) Er, that's weird. I don't know what happened there. Obviously that should be (reduce (fn [param-vec one-full-csv-row] (let [q-param (zipmap accumail-url-keys one-full-csv-row) accu-q-param (first (rest (split-at 3 q-param))) billing-param (first (split-at 3 q-param))] (conj param-vec [accu-q-param billing-param]))) [] all-csv-rows) -- 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: what makes this code slow?
Oh good -- take-while will stop right when it encounters the first item it can't take? Perfect. Too bad there is a tradeoff between idioms and performance. Thanks for the help! On Jul 21, 9:15 pm, Dmitry Gutov raa...@gmail.com wrote: The first version stops as soon it encounters the first item in the collection that's too big. The second version filters the whole collection, which may lead to a major slowdown, depending on coll's relative size. It will also hang if coll is infinite. This should be better: (take-while #(= % limit) coll) That said, a properly written loop will always be faster that an idiomatic version using first-order functions. On Jul 22, 12:17 am, nil ache...@gmail.com wrote: Oh right. What you said is what I meant. I renamed the functions improperly and then fooled myself. But I still can't figure out why the second one is much slower. -- 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
[ANN] CongoMongo 0.1.6-SNAPSHOT
On Clojars. Fixes (almost) all reflection warnings but should otherwise be identical to 0.1.5-SNAPSHOT. -- 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: The Last Programming Language
On Tue, Jul 19, 2011 at 9:04 PM, daly d...@axiom-developer.org wrote: On Tue, 2011-07-19 at 20:14 -0400, Adam Richardson wrote: On Tue, Jul 19, 2011 at 6:23 PM, Brian Hurt bhur...@gmail.com wrote: What's this awk-a-mel he speaks of? Ocaml, pronounced oh-camel, I know very well, but I've never heard of this awk-a-mel. :-) Seriously, his pronunciation of ocaml highlights, I think, the core problem of his talk. There has been significant development in languages, just not in the popular languages. It's been over there in the fringe languages. I will confess that as I listened to the presentation (when I got the email with Tim's link, I just started the video while I was working on some drudgery), I felt like he missed some of the language features promoted in functional languages. He worded functional programming contributions in terms of advancing the idea of limiting/protecting variable assignment (immutability), and to me, that's missing the points of first class functions (which, in light of what he says OOP languages brought to the table, actually provided protected function pointers through purely functional languages without any need for OOP) and an emphasis on function purity and limiting the scope of unpure functions (to me, this goes beyond merely protecting assignment.) These omissions, coupled with the mispronunciations of functional programming language names, and the value placed on the last language being homoiconic (without much justification) had me wondering how much he actually has used languages such as OCaml or Haskell. Homoiconic representation is fundamentally important and lacking in other languages. The programs == data idea is what makes the macro facility work, allows dynamic program construction, compile to core, etc. There is a story going around that McCarthy attended a python talk where they made the claim that python IS a lisp-like language. John pointed out that if it lacks homoiconicity it cannot be a lisp. (I probably have the details wrong). Perhaps the last 6 or 7 paragraphs to http://smuglispweeny.blogspot.com/2008/02/ooh-ooh-my-turn-why-lisp.html? Jeff OCaml came from ML but the ideas came before either one. Lisp supported functional programming long before either language. I believe the point Robert was trying to make was that very few languages have increased our stock of fundamental ideas. OCaml is not one of them. Indeed languages (like Spad) built on lisp STILL support ideas I have not seen anywhere else (e.g. dispatching on the return type as well as the argument types). Robert suggests that we need to develop a standard language. Good luck with that. I participated in the reviews of the X3J13 Common Lisp standard (behind the scenes by passing on my comments and markups to people who had the proposal directly). Trying to define a standard programming language would be the ultimate language war. It has been tried several times before (PL/I included everything and C++0x is trying hard to include everything). At best I believe we will muddle along and I will continue to be rejected during job interviews for working in python 2.7 and not knowing python 3.0. Forty years of lisp programming just makes me too old to hire for any real programming job. Heck, I probably don't know the difference between OCaml and awk-a-mel so I clearly cannot program. :-) I don't need to know how many digits somebody can recite Pi to, but I would like to know how his experience with awk-a-mel lead him to believe that functional programming comes down to protecting variable assignment :) That all said, if Clojure is the seed for the last language, I'd be a happy man. I believe that Robert missed the fundamental point though. It is NOT just the space of ideas that makes lisp the right language. Another key reason is impedance matching. (An impedance mismatch is when you hook a soda straw to a firehose). Programs exist to bridge the gap between the idea domain and the machine domain. Some languages are close to the machine, like assembler, so you have to carry your idea all the way to the machine. Some languages are close to the problem (e.g. Mathematica) but the compiler has to cross the gap to the machine. This is where the ability to create domain-specific languages in the same syntax matters. Lisp is the only language I know that allows you to work across the whole spectrum in a single language. It is possible to say (integrate (car x)) which takes the 0 displacement off the x pointer (machine) and then does a mathematical integration routine (problem) and does it all with the same syntax and semantics. I wouldn't worry that we will stop creating new languages. We have yet to explore the space of unicode replacements for the semi-colon (although Fortress is starting). Kanji semi-colons. I can't
Re: Problem with Leiningen 1.6.1 in Windoes
Would it be helpful to create a 1.6.1-windows tag? Yes Phil, it would be nice if we could do this. Matjaz -- 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
ClojureScript announcement video
Video is now available of Rich Hickey's talk at ClojureNYC yesterday announcing ClojureScript. http://blip.tv/clojure/rich-hickey-unveils-clojurescript-5399498 Thanks to the Clojure/core team for getting this online so rapidly! --Chouser -- 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: The Last Programming Language
On Thu, 2011-07-21 at 23:03 -0400, Jeff Dik wrote: On Tue, Jul 19, 2011 at 9:04 PM, daly d...@axiom-developer.org wrote: On Tue, 2011-07-19 at 20:14 -0400, Adam Richardson wrote: On Tue, Jul 19, 2011 at 6:23 PM, Brian Hurt bhur...@gmail.com wrote: What's this awk-a-mel he speaks of? Ocaml, pronounced oh-camel, I know very well, but I've never heard of this awk-a-mel. :-) Seriously, his pronunciation of ocaml highlights, I think, the core problem of his talk. There has been significant development in languages, just not in the popular languages. It's been over there in the fringe languages. I will confess that as I listened to the presentation (when I got the email with Tim's link, I just started the video while I was working on some drudgery), I felt like he missed some of the language features promoted in functional languages. He worded functional programming contributions in terms of advancing the idea of limiting/protecting variable assignment (immutability), and to me, that's missing the points of first class functions (which, in light of what he says OOP languages brought to the table, actually provided protected function pointers through purely functional languages without any need for OOP) and an emphasis on function purity and limiting the scope of unpure functions (to me, this goes beyond merely protecting assignment.) These omissions, coupled with the mispronunciations of functional programming language names, and the value placed on the last language being homoiconic (without much justification) had me wondering how much he actually has used languages such as OCaml or Haskell. Homoiconic representation is fundamentally important and lacking in other languages. The programs == data idea is what makes the macro facility work, allows dynamic program construction, compile to core, etc. There is a story going around that McCarthy attended a python talk where they made the claim that python IS a lisp-like language. John pointed out that if it lacks homoiconicity it cannot be a lisp. (I probably have the details wrong). Perhaps the last 6 or 7 paragraphs to http://smuglispweeny.blogspot.com/2008/02/ooh-ooh-my-turn-why-lisp.html? Jeff Yes, that's the story. --Tim OCaml came from ML but the ideas came before either one. Lisp supported functional programming long before either language. I believe the point Robert was trying to make was that very few languages have increased our stock of fundamental ideas. OCaml is not one of them. Indeed languages (like Spad) built on lisp STILL support ideas I have not seen anywhere else (e.g. dispatching on the return type as well as the argument types). Robert suggests that we need to develop a standard language. Good luck with that. I participated in the reviews of the X3J13 Common Lisp standard (behind the scenes by passing on my comments and markups to people who had the proposal directly). Trying to define a standard programming language would be the ultimate language war. It has been tried several times before (PL/I included everything and C++0x is trying hard to include everything). At best I believe we will muddle along and I will continue to be rejected during job interviews for working in python 2.7 and not knowing python 3.0. Forty years of lisp programming just makes me too old to hire for any real programming job. Heck, I probably don't know the difference between OCaml and awk-a-mel so I clearly cannot program. :-) I don't need to know how many digits somebody can recite Pi to, but I would like to know how his experience with awk-a-mel lead him to believe that functional programming comes down to protecting variable assignment :) That all said, if Clojure is the seed for the last language, I'd be a happy man. I believe that Robert missed the fundamental point though. It is NOT just the space of ideas that makes lisp the right language. Another key reason is impedance matching. (An impedance mismatch is when you hook a soda straw to a firehose). Programs exist to bridge the gap between the idea domain and the machine domain. Some languages are close to the machine, like assembler, so you have to carry your idea all the way to the machine. Some languages are close to the problem (e.g. Mathematica) but the compiler has to cross the gap to the machine. This is where the ability to create domain-specific languages in the same syntax matters. Lisp is the only language I know that allows you to work across the whole spectrum in a single language. It is possible to say (integrate (car x)) which takes the 0 displacement off the x pointer (machine) and then does a mathematical integration routine (problem) and does it all with the same syntax and semantics. I
Self-joins in ClojureQL
SQL allows for self-joins of the form SELECT e.first_name AS 'Employee FN', e.last_name AS 'Employee LN', m.first_name AS 'Manager FN', m.last_name AS 'Manager LN' FROM employees AS e LEFT OUTER JOIN employees AS m ON e.manager =m.id I can't determine a syntax for the same in ClojureQL. The limitation, as I see it is with 'table', which does not support aliasing as far as I can tell. It can take a hashmap in place of a table name, but this doesn't emit the appropriate syntax for a self-join: 'AS' is missing. What is the real purpose of supplying a hashmap to 'table'? Is there a way to do a self-join? -- 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