sending errors to the ui - web development using luminus
Dear How to send validate the input and then send all errors at a time .? I am using luminus , the doc shows send one error at a time. Thanks in advance A -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
Also fails on Linux ott@mercury:.../Debug\lein upgrade 8:34 0 Downloading Leiningen to /home/ott/.lein/self-installs/leiningen-2.3.0-standalone.jar now... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 403 /home/ott/bin/lein: line 63: download_failed_message: command not found ott@mercury:./Debug\wget https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.0-standalone.jar 8:35 1 --2013-08-09 08:35:29-- https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.0-standalone.jar Resolving leiningen.s3.amazonaws.com (leiningen.s3.amazonaws.com)... 205.251.242.192 Connecting to leiningen.s3.amazonaws.com (leiningen.s3.amazonaws.com)|205.251.242.192|:443... connected. HTTP request sent, awaiting response... 403 Forbidden 2013-08-09 08:35:30 ERROR 403: Forbidden. On Fri, Aug 9, 2013 at 7:21 AM, Sean Corfield seancorfi...@gmail.comwrote: I'm still getting the 403 forbidden error. Mac and Windows. On Thu, Aug 8, 2013 at 10:06 PM, Phil Hagelberg p...@hagelb.org wrote: On Thursday, August 8, 2013 8:52:47 PM UTC-7, Frank Hale wrote: Looks like I was way too fast. Upgrading just worked for me. Thank you! I got the ACL wrong on the initial upload but fixed it a few minutes after the email went out. -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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- With best wishes,Alex Ott http://alexott.net/ Twitter: alexott_en (English), alexott (Russian) Skype: alex.ott -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
ANN: Ribol 0.1.5 - Conditional Restart Library for Clojure
Check out the Tutorial and Examples here: https://github.com/zcaudate/ribol ribol ribol is a conditional restart library for clojure inspired by errorkit, having a more readable syntax, and designed with the base clojure.lang.ExceptionInfo type in mind. https://github.com/zcaudate/ribol#installationInstallation: In project.clj, add to dependencies: [im.chit/ribol 0.1.5] https://github.com/zcaudate/ribol#providesProvides - Issue (exception) handling using maps for data as opposed to typed classes - Passing data along with exceptions - Tight integration with ex-info and ex-data - Five different issue handlers - catch, continue, choose, escalate and default Comparison with other Libraries There are two other conditional restart libraries for clojure - errorkit and swell - errorkit provided the guiding architecture for ribol. However, ribol updates errorkit with more options for controlling exceptions, uses ex-info which is part of core and has an updated and more understandable syntax. - swell was written specifically to work with the slingshot try+/catch+ packages and I thought that the two together carried too much baggage. ribol has no such dependencies. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Debugging a custom reader literal for a sorted-set
This ticket may be related, http://dev.clojure.org/jira/browse/CLJ-1093 On Friday, August 9, 2013 12:08:06 AM UTC+2, Jozef Wagner wrote: It may be a bug somewhere in a Compiler. I've lost track at https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6624 after debugging this: user (def x `(quote ~(list 1 (clojure.lang.PersistentTreeMap/create (seq [1 2 3 4]) #'user/x user x (quote (1 #sorted-map (1 2 3 4))) user (.eval (clojure.lang.Compiler/analyze clojure.lang.Compiler$C/EXPRESSION x)) (1 #sorted-map (1 2 3 4)) user (eval x) (1 {1 2, 3 4}) JW On Thursday, August 8, 2013 10:14:57 PM UTC+2, David James wrote: I'd really appreciate if others could take a look. I wonder if it may be a Clojure reader bug. On Thu, Aug 8, 2013 at 3:55 PM, Jozef Wagner jozef@gmail.com wrote: It seems there is something else in data reader which causes this change. user= (class '#foo/sm (1 2 3 4)) clojure.lang.PersistentArrayMap user= (class (read-string #foo/sm (1 2 3 4))) clojure.lang.PersistentTreeMap It's quite puzzling. In both cases the evaluation does not take place, but still the transition to PersistentArrayMap occurs. JW On Thursday, August 8, 2013 9:49:24 PM UTC+2, David James wrote: That's a good point about: user= eval (to-sorted-map '(1 2 3 4))) {1 2, 3 4} But this should work, right? user= (assoc #sorted-map (:a 1 :b 2) :c 3) {:c 3, :a 1, :b 2} ; incorrect -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
RE: [ANN] Leiningen 2.3.0 released
Also here on linux. Unfortunately, after upgrading the bash script, so it leaves a broken install. Phil From: clojure@googlegroups.com [clojure@googlegroups.com] on behalf of Alex Ott [alex...@gmail.com] Sent: 09 August 2013 07:36 To: clojure@googlegroups.com Subject: Re: [ANN] Leiningen 2.3.0 released Also fails on Linux ott@mercury:.../Debug\lein upgrade 8:34 0 Downloading Leiningen to /home/ott/.lein/self-installs/leiningen-2.3.0-standalone.jar now... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 403 /home/ott/bin/lein: line 63: download_failed_message: command not found ott@mercury:./Debug\wget https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.0-standalone.jar 8:35 1 --2013-08-09 08:35:29-- https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.0-standalone.jar Resolving leiningen.s3.amazonaws.comhttp://leiningen.s3.amazonaws.com (leiningen.s3.amazonaws.comhttp://leiningen.s3.amazonaws.com)... 205.251.242.192 Connecting to leiningen.s3.amazonaws.comhttp://leiningen.s3.amazonaws.com (leiningen.s3.amazonaws.comhttp://leiningen.s3.amazonaws.com)|205.251.242.192|:443... connected. HTTP request sent, awaiting response... 403 Forbidden 2013-08-09 08:35:30 ERROR 403: Forbidden. On Fri, Aug 9, 2013 at 7:21 AM, Sean Corfield seancorfi...@gmail.commailto:seancorfi...@gmail.com wrote: I'm still getting the 403 forbidden error. Mac and Windows. On Thu, Aug 8, 2013 at 10:06 PM, Phil Hagelberg p...@hagelb.orgmailto:p...@hagelb.org wrote: On Thursday, August 8, 2013 8:52:47 PM UTC-7, Frank Hale wrote: Looks like I was way too fast. Upgrading just worked for me. Thank you! I got the ACL wrong on the initial upload but fixed it a few minutes after the email went out. -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.commailto: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.commailto:clojure%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.commailto:clojure%2bunsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.commailto: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.commailto:clojure%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.commailto:clojure%2bunsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- With best wishes,Alex Ott http://alexott.net/ Twitter: alexott_en (English), alexott (Russian) Skype: alex.ott -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
On Friday, 9 August 2013 03:58:40 UTC+8, Jace Bennett wrote: Thanks, Mike. I guess my simple example is too simple. Out of the hypothetical, have you used techniques like this? Not exactly your use case, but I've written probably the two most complex games so far in Clojure... games have a lot of state and interaction with the environment that needs setting up but I still manages to make the game updates themselves purely functional, without any use of macros. Just a thin non-functional wrapper is generally all you need. Also core.matrix maintains a map of available implementations which is probably pretty analogous to your endpoint map. I have this nagging feeling that there is a more direct and idiomatic way to glean this sort of information from my code. I mean, that's why we use AST's, right? So we can process them? I shouldn't need a data structure like the endpoint map in the first place. I just don't know how to capitalize on this rather abstract and vague notion. Well at some point, if you are going to make the endpoints work at all, they have to be declared. And this declaration has to result in a runtime structure that can be queried as required, which implies some form of state. There are many ways you could express your endpoints: - Pure data (nested maps, vectors, keyword etc.) - but this still needs something else to perform the side effects required to make them live) - Function calls of the create-endpoint type - Some form of macros But whichever you use, you will ultimately need to have some functionality to translate these declarations into a data structure that stores your endpoint. How do folks usually go about it when they have a desire to query the running system about its shape and structure? I would store the information about the running system in a single, immutable persistent data structure (usually nested maps+vectors+sets, occasionally records and immutable Java types). Store this in either an atom, an agent or a ref (depending on how you want to handle concurrent access and updates - typically an atom is sufficient unless you care about transactional updates to this state) On Thu, Aug 8, 2013 at 2:36 AM, Mikera mike.r.an...@gmail.comjavascript: wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Prefer writing pure functions (without side effects) - these are easier to reason about, easier to test, simpler to write correctly and easier to plug together / compose via higher order functions. For example, in your endpoint example I would probably just use three functions: - a pure add endpoint metadata to an endpoint map function - an impure update endpoints function that updates endpoints using an endpoint map - a function that calls both of the above to declare and launch a new endpoint There might be a few other helper functions as well but hopefully you get the idea. On Thursday, 8 August 2013 03:19:15 UTC+1, Jace Bennett wrote: Thanks to the community for a wondrous programming environment. I discovered SICP last year, and fell in love with the idea of lisp. But I've come to a point where I think I need practice on moderately sized projects before more reading will help. When starting on almost any moderately scoped effort, I quickly run into a class of problems which I think may be a fit for macros, but I want to understand what is the idiomatic way to approach them in clojure. Most of my professional experience is in .NET, and that is probably coloring my thought patterns a bit. In that context, I often use reflection scans and type metadata to configure infrastructural bits and dry things up. Instead of having to explicitly register components in the more dynamic areas of my app, I use conventions to select components to register from the metadata I have about my code. I can imagine using macros in clojure to accumulate metadata about my declarations so that I can query them at runtime. For example, maybe a defendpoint macro that sets up a handler AND adds it to the routing table (or more directly an endpoint map which I then use to make routing decisions among other things). Admittedly, something about the sound of the phrase it's just data tells me I'm sniffin up the wrong tree here. But I don't know how to turn that nagging feeling into working code. Is this a reasonable use of the macro? What about doing the registration at macro-expansion time vs emitting runtime code to do it? How should one approach the problems space otherwise? Thanks for your time. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to
Re: butlast with reducers
Gaving slept on it I realize that by adding before popping I allowed the buffer to grow to n+1 thus causing a realloc. (defn drop-last [n coll] (reducer coll (fn [f1] (let [buffer (java.util.ArrayDeque. (int n))] (fn self ([] (f1)) ([ret x] (let [ret (if (= (count buffer) n) (f1 ret (.pop buffer)) ret)] (.add buffer x) ret))) (defn take-last [n coll] (reify clojure.core.protocols.CollReduce (coll-reduce [this f1] (clojure.core.protocols/coll-reduce this f1 (f1))) (coll-reduce [_ f1 init] (clojure.core.protocols/coll-reduce (clojure.core.protocols/coll-reduce coll (fn [^java.util.Deque q x] (when (= (count q) n) (.pop q)) (.add q x) q) (java.util.ArrayDeque. (int n))) f1 init On Thu, Aug 8, 2013 at 3:34 PM, Christophe Grand christo...@cgrand.netwrote: ArrayDeque based versions: (defn drop-last [n coll] (reducer coll (fn [f1] (let [buffer (java.util.ArrayDeque. (int n))] (fn self ([] (f1)) ([ret x] (.add buffer x) (if (= (count buffer) n) ret (f1 ret (.pop buffer) (defn take-last [n coll] (reify clojure.core.protocols.CollReduce (coll-reduce [this f1] (clojure.core.protocols/coll-reduce this f1 (f1))) (coll-reduce [_ f1 init] (clojure.core.protocols/coll-reduce (doto (clojure.core.protocols/coll-reduce coll (fn [^java.util.Deque q x] (.add q x) (when ( (count q) n) (.pop q)) q) (java.util.ArrayDeque. (int n))) prn) f1 init On Thu, Aug 8, 2013 at 3:16 PM, Christophe Grand christo...@cgrand.netwrote: You need to use a buffer to defer calls to the reduced function (defn drop-last [n coll] (reducer coll (fn [f1] (let [buffer (atom clojure.lang.PersistentQueue/EMPTY)] (fn self ([] (f1)) ([ret x] (let [b (swap! buffer conj x)] (if (= (count @buffer) n) ret (do (swap! buffer pop) (f1 ret (peek b))) An array or a ring buffer should be used instead of the atom and persistent queue combo to reduce allocation. take-last is harder because you can't know when the reduction is over when using #'reducer, so you have to implement CollReduce yourself: (defn take-last [n coll] (reify clojure.core.protocols.CollReduce (coll-reduce [this f1] (clojure.core.protocols/coll-reduce this f1 (f1))) (coll-reduce [_ f1 init] (clojure.core.protocols/coll-reduce (clojure.core.protocols/coll-reduce coll (fn [q x] (let [q (conj q x)] (if (= (count q) n) q (pop q clojure.lang.PersistentQueue/EMPTY) f1 init again, use of a mutable array/buffer would be preferable. hth, Christophe On Thu, Aug 8, 2013 at 1:00 PM, Jozef Wagner jozef.wag...@gmail.comwrote: Is it possible to implement efficient butlast (and drop-last, take-last) with reducers? The only solution I can think of needs additional reduce to compute count, which may often be undesirable. Or is it OK to say that reducers are not designed for such cases? JW -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- On Clojure http://clj-me.cgrand.net/ Clojure Programming http://clojurebook.com Training, Consulting Contracting http://lambdanext.eu/ -- On Clojure http://clj-me.cgrand.net/ Clojure Programming http://clojurebook.com Training, Consulting Contracting http://lambdanext.eu/ -- On Clojure http://clj-me.cgrand.net/ Clojure Programming http://clojurebook.com Training, Consulting Contracting http://lambdanext.eu/ -- -- 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
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
On Friday, 9 August 2013 05:07:10 UTC+8, Jonathan Fischer Friberg wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Problem with this is that you don't really know when you need them unless you know what they do. I'm not saying don't learn how macros work. Learning is always good. My recommendation is just that your default approach should be to avoid using them unless you have tried very hard to achieve your goal with pure functions first, and convinced yourself that it isn't possible. Macros are only *needed* IMHO when one of the following applies: - You want to create new language/DSL syntax that isn't expressible with normal function application rules (e.g. short-circuiting evaluation, new control structures etc.) - You need to do custom code generation at compile time for some good reason (e.g. performance, since macros enable you to do compile-time specialisation of code) I wrote about these and gave some examples in a blog post a few months back for anyone interested: http://clojurefun.wordpress.com/2013/01/09/when-do-you-need-macros-in-clojure/ On Thu, Aug 8, 2013 at 9:58 PM, Jace Bennett jace.b...@gmail.comjavascript: wrote: Thanks, Mike. I guess my simple example is too simple. Out of the hypothetical, have you used techniques like this? I have this nagging feeling that there is a more direct and idiomatic way to glean this sort of information from my code. I mean, that's why we use AST's, right? So we can process them? I shouldn't need a data structure like the endpoint map in the first place. I just don't know how to capitalize on this rather abstract and vague notion. How do folks usually go about it when they have a desire to query the running system about its shape and structure? On Thu, Aug 8, 2013 at 2:36 AM, Mikera mike.r.an...@gmail.comjavascript: wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Prefer writing pure functions (without side effects) - these are easier to reason about, easier to test, simpler to write correctly and easier to plug together / compose via higher order functions. For example, in your endpoint example I would probably just use three functions: - a pure add endpoint metadata to an endpoint map function - an impure update endpoints function that updates endpoints using an endpoint map - a function that calls both of the above to declare and launch a new endpoint There might be a few other helper functions as well but hopefully you get the idea. On Thursday, 8 August 2013 03:19:15 UTC+1, Jace Bennett wrote: Thanks to the community for a wondrous programming environment. I discovered SICP last year, and fell in love with the idea of lisp. But I've come to a point where I think I need practice on moderately sized projects before more reading will help. When starting on almost any moderately scoped effort, I quickly run into a class of problems which I think may be a fit for macros, but I want to understand what is the idiomatic way to approach them in clojure. Most of my professional experience is in .NET, and that is probably coloring my thought patterns a bit. In that context, I often use reflection scans and type metadata to configure infrastructural bits and dry things up. Instead of having to explicitly register components in the more dynamic areas of my app, I use conventions to select components to register from the metadata I have about my code. I can imagine using macros in clojure to accumulate metadata about my declarations so that I can query them at runtime. For example, maybe a defendpoint macro that sets up a handler AND adds it to the routing table (or more directly an endpoint map which I then use to make routing decisions among other things). Admittedly, something about the sound of the phrase it's just data tells me I'm sniffin up the wrong tree here. But I don't know how to turn that nagging feeling into working code. Is this a reasonable use of the macro? What about doing the registration at macro-expansion time vs emitting runtime code to do it? How should one approach the problems space otherwise? Thanks for your time. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:.
Re: Confused by var eval behaviour
You are right, it's beacsue of print-dup. Hence it works only on functions which aren't closures: = (let [a nil x (fn [] a)] (eval [x])) IllegalArgumentException No matching ctor found for class user$eval3989$x__3990 Why is emitValue used? Regular code forms (as returned by the reader) don't usually contain functions. When the compiler doesn't know how to evaluate some value it treats it as a constant. Constants are serialized in the class and read back/instanciated when the class is loaded. On Thu, Aug 8, 2013 at 6:30 PM, Jamie Brandon ja...@scattered-thoughts.netwrote: The Fn case works because print-dup is defined on fns: user= (binding [*print-dup* true] (println (fn [] nil))) #=(user$eval2502$fn__2503. ) nil user= (read-string #=(user$eval2502$fn__2503. )) #user$eval2502$fn__2503 user$eval2502$fn__2503@19037d90 I still can't figure out why Compiler.emitValue is used though. Am I right in thinking that clojure.core/eval is not calling the function that the compiler uses, but instead serializing everything and pushing it through the same pathway as compiling text files? On 8 August 2013 16:43, Christophe Grand christo...@cgrand.net wrote: Right now I ca't figure why the fn case is working but the anonyous Var is failing because the vars are specially handled: else if(value instanceof Var) { Var var = (Var) value; gen.push(var.ns.name.toString()); gen.push(var.sym.toString()); gen.invokeStatic(RT_TYPE, Method.getMethod(clojure.lang.Var var(String,String))); } Christophe On Thu, Aug 8, 2013 at 4:44 PM, Jamie Brandon ja...@scattered-thoughts.net wrote: What if it isn't inside a constant? user= (eval `(fn [] ~#'x)) #user$eval1366$fn__1367 user$eval1366$fn__1367@15dbb76 user= (with-local-vars [x nil] (eval `(fn [] ~x))) CompilerException java.lang.NullPointerException, compiling:(NO_SOURCE_PATH:1:1) How about functions? These are unreadable but they still eval correctly inside constants. user= (letfn [(x [] nil)] (eval x)) #user$eval1377$x__1378 user$eval1377$x__1378@5fea6729 user= (letfn [(x [] nil)] (eval [x])) [#user$eval1381$x__1382 user$eval1381$x__1382@e3b7c27] user= (read-string #user$x user$x@1981e4d) RuntimeException Unreadable form clojure.lang.Util.runtimeException (Util.java:219) user= (defn x [] nil) #'user/x user= (eval x) #user$x user$x@14ff1714 user= (eval [x]) [#user$x user$x@5892d4a8] user= (read-string #user$eval1381$x__1382 user$eval1381$x__1382@e3b7c27) RuntimeException Unreadable form clojure.lang.Util.runtimeException (Util.java:219) On 8 August 2013 14:58, Christophe Grand christo...@cgrand.net wrote: The error is caused by the fact that eval sees the var as a constant (or part of) and tries to serialize the constant. #Var: --unnamed-- is unreadable while #'user/x is that explains teh difference in behaviour. On Thu, Aug 8, 2013 at 3:40 PM, Jamie Brandon ja...@scattered-thoughts.net wrote: This has me stumped: user= (with-local-vars [x nil] (eval x)) #Var: --unnamed-- user= (with-local-vars [x nil] (eval [x])) CompilerException java.lang.NullPointerException, compiling:(NO_SOURCE_PATH:1:1) By comparison: user= (def x nil) #'user/x user= (eval #'x) #'user/x user= (eval [#'x]) [#'user/x] -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- On Clojure http://clj-me.cgrand.net/ Clojure Programming http://clojurebook.com Training, Consulting Contracting http://lambdanext.eu/ -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails
Re: [ANN] Leiningen 2.3.0 released
same here! can we get the 2.3.0.-jar from clojars? does anybody know? Jim On 09/08/13 08:14, Phillip Lord wrote: Also here on linux. Unfortunately, after upgrading the bash script, so it leaves a broken install. Phil From: clojure@googlegroups.com [clojure@googlegroups.com] on behalf of Alex Ott [alex...@gmail.com] Sent: 09 August 2013 07:36 To: clojure@googlegroups.com Subject: Re: [ANN] Leiningen 2.3.0 released Also fails on Linux ott@mercury:.../Debug\lein upgrade 8:34 0 Downloading Leiningen to /home/ott/.lein/self-installs/leiningen-2.3.0-standalone.jar now... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 403 /home/ott/bin/lein: line 63: download_failed_message: command not found ott@mercury:./Debug\wget https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.0-standalone.jar 8:35 1 --2013-08-09 08:35:29-- https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.0-standalone.jar Resolving leiningen.s3.amazonaws.comhttp://leiningen.s3.amazonaws.com (leiningen.s3.amazonaws.comhttp://leiningen.s3.amazonaws.com)... 205.251.242.192 Connecting to leiningen.s3.amazonaws.comhttp://leiningen.s3.amazonaws.com (leiningen.s3.amazonaws.comhttp://leiningen.s3.amazonaws.com)|205.251.242.192|:443... connected. HTTP request sent, awaiting response... 403 Forbidden 2013-08-09 08:35:30 ERROR 403: Forbidden. On Fri, Aug 9, 2013 at 7:21 AM, Sean Corfield seancorfi...@gmail.commailto:seancorfi...@gmail.com wrote: I'm still getting the 403 forbidden error. Mac and Windows. On Thu, Aug 8, 2013 at 10:06 PM, Phil Hagelberg p...@hagelb.orgmailto:p...@hagelb.org wrote: On Thursday, August 8, 2013 8:52:47 PM UTC-7, Frank Hale wrote: Looks like I was way too fast. Upgrading just worked for me. Thank you! I got the ACL wrong on the initial upload but fixed it a few minutes after the email went out. -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.commailto: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.commailto:clojure%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.commailto:clojure%2bunsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.commailto: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.commailto:clojure%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.commailto:clojure%2bunsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- With best wishes,Alex Ott http://alexott.net/ Twitter: alexott_en (English), alexott (Russian) Skype: alex.ott -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group.
Re: [ANN] Leiningen 2.3.0 released
Hey guys, I've hacked together a temporary fix for people who really, really, really want to use 2.3.0 right away, or have broken their lein script and just want to solve this the easy way. I would NOT recommend people to upgrade right now, just wait until the jar has been set up with the right acl. (I would be surprised if that's not the first thing Phil would do in the morning.) If you've not tried to upgrade, do so and get the error message in your face: lein upgrade should do the trick. Then go to the directory ~/.lein/self-installs (or your equivalent directory on Windows). Download https://github.com/hyPiRion/leiningen-2.3.0-tempfix/raw/temporary-fix/target/leiningen-2.3.0-standalone.jar (wget/curl) and save it in the folder. Ensure that it has the name leiningen-2.3.0-standalone.jar. That's all you need to do to get 2.3.0 working. Again: this is just a temporary fix, and it is packaged by me, not Phil. However, it should be equivalent in terms of functionality, and there shouldn't be any need to replace the jar once it's downloaded. I'll remove the repo with the temporary fix once it is possible to download the official release once again. -- Jean Niklas -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [proposal] simplified but extensible ns declaration
So, my proposal got no comments -- not surprising, it was too long. So I decided to just implement it instead.It's not terribly usable at the moment, because it needs to be use'd before it can be, er used. Here are a rough set of exemplars that give an idea of what I have in mind. . https://github.com/phillord/namespace-experiments/blob/master/src/namespace/examples.clj The main advantage of it, is that it is extensible; I find myself reusing large chunks of namespace declarations repeatedly. It's just an experiment, and not mean as a usable package, but comments welcome. Phillip Lord phillip.l...@newcastle.ac.uk writes: At the risk of continuing an already long thread on the namespace declaration, I want to present my proposal for changing the namespace declaration. Unlike Greg's proposal, it is not about changing the syntax, but fundamentally changes the nature of the declaration. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
The upgrade ended up breaking lein on my system. This fix worked for me. Thanks! On Friday, August 9, 2013 5:30:42 AM UTC-4, Jean Niklas L'orange wrote: Hey guys, I've hacked together a temporary fix for people who really, really, really want to use 2.3.0 right away, or have broken their lein script and just want to solve this the easy way. I would NOT recommend people to upgrade right now, just wait until the jar has been set up with the right acl. (I would be surprised if that's not the first thing Phil would do in the morning.) If you've not tried to upgrade, do so and get the error message in your face: lein upgrade should do the trick. Then go to the directory ~/.lein/self-installs (or your equivalent directory on Windows). Download https://github.com/hyPiRion/leiningen-2.3.0-tempfix/raw/temporary-fix/target/leiningen-2.3.0-standalone.jar (wget/curl) and save it in the folder. Ensure that it has the name leiningen-2.3.0-standalone.jar. That's all you need to do to get 2.3.0 working. Again: this is just a temporary fix, and it is packaged by me, not Phil. However, it should be equivalent in terms of functionality, and there shouldn't be any need to replace the jar once it's downloaded. I'll remove the repo with the temporary fix once it is possible to download the official release once again. -- Jean Niklas -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Confused by var eval behaviour
Ah, I found out that java bytecode can't contain data literals so the compiler has to emit a constructor instead. Also, since the jvm doesn't gc classes there might be confusing memory leaks if you could embed a closure in evaluated code. On 9 August 2013 09:13, Christophe Grand christo...@cgrand.net wrote: You are right, it's beacsue of print-dup. Hence it works only on functions which aren't closures: = (let [a nil x (fn [] a)] (eval [x])) IllegalArgumentException No matching ctor found for class user$eval3989$x__3990 Why is emitValue used? Regular code forms (as returned by the reader) don't usually contain functions. When the compiler doesn't know how to evaluate some value it treats it as a constant. Constants are serialized in the class and read back/instanciated when the class is loaded. On Thu, Aug 8, 2013 at 6:30 PM, Jamie Brandon ja...@scattered-thoughts.net wrote: The Fn case works because print-dup is defined on fns: user= (binding [*print-dup* true] (println (fn [] nil))) #=(user$eval2502$fn__2503. ) nil user= (read-string #=(user$eval2502$fn__2503. )) #user$eval2502$fn__2503 user$eval2502$fn__2503@19037d90 I still can't figure out why Compiler.emitValue is used though. Am I right in thinking that clojure.core/eval is not calling the function that the compiler uses, but instead serializing everything and pushing it through the same pathway as compiling text files? On 8 August 2013 16:43, Christophe Grand christo...@cgrand.net wrote: Right now I ca't figure why the fn case is working but the anonyous Var is failing because the vars are specially handled: else if(value instanceof Var) { Var var = (Var) value; gen.push(var.ns.name.toString()); gen.push(var.sym.toString()); gen.invokeStatic(RT_TYPE, Method.getMethod(clojure.lang.Var var(String,String))); } Christophe On Thu, Aug 8, 2013 at 4:44 PM, Jamie Brandon ja...@scattered-thoughts.net wrote: What if it isn't inside a constant? user= (eval `(fn [] ~#'x)) #user$eval1366$fn__1367 user$eval1366$fn__1367@15dbb76 user= (with-local-vars [x nil] (eval `(fn [] ~x))) CompilerException java.lang.NullPointerException, compiling:(NO_SOURCE_PATH:1:1) How about functions? These are unreadable but they still eval correctly inside constants. user= (letfn [(x [] nil)] (eval x)) #user$eval1377$x__1378 user$eval1377$x__1378@5fea6729 user= (letfn [(x [] nil)] (eval [x])) [#user$eval1381$x__1382 user$eval1381$x__1382@e3b7c27] user= (read-string #user$x user$x@1981e4d) RuntimeException Unreadable form clojure.lang.Util.runtimeException (Util.java:219) user= (defn x [] nil) #'user/x user= (eval x) #user$x user$x@14ff1714 user= (eval [x]) [#user$x user$x@5892d4a8] user= (read-string #user$eval1381$x__1382 user$eval1381$x__1382@e3b7c27) RuntimeException Unreadable form clojure.lang.Util.runtimeException (Util.java:219) On 8 August 2013 14:58, Christophe Grand christo...@cgrand.net wrote: The error is caused by the fact that eval sees the var as a constant (or part of) and tries to serialize the constant. #Var: --unnamed-- is unreadable while #'user/x is that explains teh difference in behaviour. On Thu, Aug 8, 2013 at 3:40 PM, Jamie Brandon ja...@scattered-thoughts.net wrote: This has me stumped: user= (with-local-vars [x nil] (eval x)) #Var: --unnamed-- user= (with-local-vars [x nil] (eval [x])) CompilerException java.lang.NullPointerException, compiling:(NO_SOURCE_PATH:1:1) By comparison: user= (def x nil) #'user/x user= (eval #'x) #'user/x user= (eval [#'x]) [#'user/x] -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- On Clojure http://clj-me.cgrand.net/ Clojure Programming http://clojurebook.com Training, Consulting Contracting http://lambdanext.eu/ -- -- 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
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
Thanks again, Mike. That's really helpful. I'll take a look at the core.matrix stuff to try and understand implementation and motivation better. What games did you make? I'd love to check them out. Jace On Fri, Aug 9, 2013 at 4:10 AM, Mikera mike.r.anderson...@gmail.com wrote: On Friday, 9 August 2013 05:07:10 UTC+8, Jonathan Fischer Friberg wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Problem with this is that you don't really know when you need them unless you know what they do. I'm not saying don't learn how macros work. Learning is always good. My recommendation is just that your default approach should be to avoid using them unless you have tried very hard to achieve your goal with pure functions first, and convinced yourself that it isn't possible. Macros are only *needed* IMHO when one of the following applies: - You want to create new language/DSL syntax that isn't expressible with normal function application rules (e.g. short-circuiting evaluation, new control structures etc.) - You need to do custom code generation at compile time for some good reason (e.g. performance, since macros enable you to do compile-time specialisation of code) I wrote about these and gave some examples in a blog post a few months back for anyone interested: http://clojurefun.wordpress.com/2013/01/09/when-do-you-need-macros-in-clojure/ On Thu, Aug 8, 2013 at 9:58 PM, Jace Bennett jace.b...@gmail.com wrote: Thanks, Mike. I guess my simple example is too simple. Out of the hypothetical, have you used techniques like this? I have this nagging feeling that there is a more direct and idiomatic way to glean this sort of information from my code. I mean, that's why we use AST's, right? So we can process them? I shouldn't need a data structure like the endpoint map in the first place. I just don't know how to capitalize on this rather abstract and vague notion. How do folks usually go about it when they have a desire to query the running system about its shape and structure? On Thu, Aug 8, 2013 at 2:36 AM, Mikera mike.r.an...@gmail.com wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Prefer writing pure functions (without side effects) - these are easier to reason about, easier to test, simpler to write correctly and easier to plug together / compose via higher order functions. For example, in your endpoint example I would probably just use three functions: - a pure add endpoint metadata to an endpoint map function - an impure update endpoints function that updates endpoints using an endpoint map - a function that calls both of the above to declare and launch a new endpoint There might be a few other helper functions as well but hopefully you get the idea. On Thursday, 8 August 2013 03:19:15 UTC+1, Jace Bennett wrote: Thanks to the community for a wondrous programming environment. I discovered SICP last year, and fell in love with the idea of lisp. But I've come to a point where I think I need practice on moderately sized projects before more reading will help. When starting on almost any moderately scoped effort, I quickly run into a class of problems which I think may be a fit for macros, but I want to understand what is the idiomatic way to approach them in clojure. Most of my professional experience is in .NET, and that is probably coloring my thought patterns a bit. In that context, I often use reflection scans and type metadata to configure infrastructural bits and dry things up. Instead of having to explicitly register components in the more dynamic areas of my app, I use conventions to select components to register from the metadata I have about my code. I can imagine using macros in clojure to accumulate metadata about my declarations so that I can query them at runtime. For example, maybe a defendpoint macro that sets up a handler AND adds it to the routing table (or more directly an endpoint map which I then use to make routing decisions among other things). Admittedly, something about the sound of the phrase it's just data tells me I'm sniffin up the wrong tree here. But I don't know how to turn that nagging feeling into working code. Is this a reasonable use of the macro? What about doing the registration at macro-expansion time vs emitting runtime code to do it? How should one approach the problems space otherwise? Thanks for your time. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
I agree! :) On Fri, Aug 9, 2013 at 10:10 AM, Mikera mike.r.anderson...@gmail.comwrote: On Friday, 9 August 2013 05:07:10 UTC+8, Jonathan Fischer Friberg wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Problem with this is that you don't really know when you need them unless you know what they do. I'm not saying don't learn how macros work. Learning is always good. My recommendation is just that your default approach should be to avoid using them unless you have tried very hard to achieve your goal with pure functions first, and convinced yourself that it isn't possible. Macros are only *needed* IMHO when one of the following applies: - You want to create new language/DSL syntax that isn't expressible with normal function application rules (e.g. short-circuiting evaluation, new control structures etc.) - You need to do custom code generation at compile time for some good reason (e.g. performance, since macros enable you to do compile-time specialisation of code) I wrote about these and gave some examples in a blog post a few months back for anyone interested: http://clojurefun.wordpress.com/2013/01/09/when-do-you-need-macros-in-clojure/ On Thu, Aug 8, 2013 at 9:58 PM, Jace Bennett jace.b...@gmail.com wrote: Thanks, Mike. I guess my simple example is too simple. Out of the hypothetical, have you used techniques like this? I have this nagging feeling that there is a more direct and idiomatic way to glean this sort of information from my code. I mean, that's why we use AST's, right? So we can process them? I shouldn't need a data structure like the endpoint map in the first place. I just don't know how to capitalize on this rather abstract and vague notion. How do folks usually go about it when they have a desire to query the running system about its shape and structure? On Thu, Aug 8, 2013 at 2:36 AM, Mikera mike.r.an...@gmail.com wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Prefer writing pure functions (without side effects) - these are easier to reason about, easier to test, simpler to write correctly and easier to plug together / compose via higher order functions. For example, in your endpoint example I would probably just use three functions: - a pure add endpoint metadata to an endpoint map function - an impure update endpoints function that updates endpoints using an endpoint map - a function that calls both of the above to declare and launch a new endpoint There might be a few other helper functions as well but hopefully you get the idea. On Thursday, 8 August 2013 03:19:15 UTC+1, Jace Bennett wrote: Thanks to the community for a wondrous programming environment. I discovered SICP last year, and fell in love with the idea of lisp. But I've come to a point where I think I need practice on moderately sized projects before more reading will help. When starting on almost any moderately scoped effort, I quickly run into a class of problems which I think may be a fit for macros, but I want to understand what is the idiomatic way to approach them in clojure. Most of my professional experience is in .NET, and that is probably coloring my thought patterns a bit. In that context, I often use reflection scans and type metadata to configure infrastructural bits and dry things up. Instead of having to explicitly register components in the more dynamic areas of my app, I use conventions to select components to register from the metadata I have about my code. I can imagine using macros in clojure to accumulate metadata about my declarations so that I can query them at runtime. For example, maybe a defendpoint macro that sets up a handler AND adds it to the routing table (or more directly an endpoint map which I then use to make routing decisions among other things). Admittedly, something about the sound of the phrase it's just data tells me I'm sniffin up the wrong tree here. But I don't know how to turn that nagging feeling into working code. Is this a reasonable use of the macro? What about doing the registration at macro-expansion time vs emitting runtime code to do it? How should one approach the problems space otherwise? Thanks for your time. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
Obviously I've encountered the advice no macros unless you know you need them before. And I even sort of know the syntax and what they do. I don't think that's my problem. I think I've lived a life without macros. I mean, clearly dynamic-functional and even OOP styles are perfectly capable of building most anything (within my now constrained view of what is feasible). And my head is full of techniques (what an experienced lisper might call workarounds) to deal with their limitations, so I'm habituated to the pain, and the narrow view of 'what is feasible'. So, it's not about whether I need a macro at all, because I could deal indefinitely. There are an endless supply of problems I could solve without them. It's about wisdom, discerning whether its a good tradeoff to use a macro in a given situation. I wish this was the kind of thing that could be taught. Instead, I fear, it must be learned. On Fri, Aug 9, 2013 at 9:50 AM, Jace Bennett jace.benn...@gmail.com wrote: Thanks again, Mike. That's really helpful. I'll take a look at the core.matrix stuff to try and understand implementation and motivation better. What games did you make? I'd love to check them out. Jace On Fri, Aug 9, 2013 at 4:10 AM, Mikera mike.r.anderson...@gmail.comwrote: On Friday, 9 August 2013 05:07:10 UTC+8, Jonathan Fischer Friberg wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Problem with this is that you don't really know when you need them unless you know what they do. I'm not saying don't learn how macros work. Learning is always good. My recommendation is just that your default approach should be to avoid using them unless you have tried very hard to achieve your goal with pure functions first, and convinced yourself that it isn't possible. Macros are only *needed* IMHO when one of the following applies: - You want to create new language/DSL syntax that isn't expressible with normal function application rules (e.g. short-circuiting evaluation, new control structures etc.) - You need to do custom code generation at compile time for some good reason (e.g. performance, since macros enable you to do compile-time specialisation of code) I wrote about these and gave some examples in a blog post a few months back for anyone interested: http://clojurefun.wordpress.com/2013/01/09/when-do-you-need-macros-in-clojure/ On Thu, Aug 8, 2013 at 9:58 PM, Jace Bennett jace.b...@gmail.comwrote: Thanks, Mike. I guess my simple example is too simple. Out of the hypothetical, have you used techniques like this? I have this nagging feeling that there is a more direct and idiomatic way to glean this sort of information from my code. I mean, that's why we use AST's, right? So we can process them? I shouldn't need a data structure like the endpoint map in the first place. I just don't know how to capitalize on this rather abstract and vague notion. How do folks usually go about it when they have a desire to query the running system about its shape and structure? On Thu, Aug 8, 2013 at 2:36 AM, Mikera mike.r.an...@gmail.com wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Prefer writing pure functions (without side effects) - these are easier to reason about, easier to test, simpler to write correctly and easier to plug together / compose via higher order functions. For example, in your endpoint example I would probably just use three functions: - a pure add endpoint metadata to an endpoint map function - an impure update endpoints function that updates endpoints using an endpoint map - a function that calls both of the above to declare and launch a new endpoint There might be a few other helper functions as well but hopefully you get the idea. On Thursday, 8 August 2013 03:19:15 UTC+1, Jace Bennett wrote: Thanks to the community for a wondrous programming environment. I discovered SICP last year, and fell in love with the idea of lisp. But I've come to a point where I think I need practice on moderately sized projects before more reading will help. When starting on almost any moderately scoped effort, I quickly run into a class of problems which I think may be a fit for macros, but I want to understand what is the idiomatic way to approach them in clojure. Most of my professional experience is in .NET, and that is probably coloring my thought patterns a bit. In that context, I often use reflection scans and type metadata to configure infrastructural bits and dry things up. Instead of having to explicitly register components in the more dynamic areas of my app, I use conventions to select components to register from the metadata I have about my code. I can imagine using macros in clojure to accumulate metadata about my declarations so that I can query them at runtime. For example, maybe a defendpoint macro that
[ANN] jvm.tools.analyzer 0.4.3 - CLJS hygienic transformation
Hi, [org.clojure/jvm.tools.analyzer 0.4.3] jvm.tools.analyzer now supports transformations on CLJS code. https://github.com/clojure/jvm.tools.analyzer Examples: Normal AST generation: (cljs.tools.analyzer/ast 1);= {:op :constant, :env {:ns {:defs {a {:column 18, :line 2, :file nil, :name cljs.user/a}}, :name cljs.user}, :context :statement, :locals {}}, :form 1} Hygienic transformation: (cljs.tools.analyzer.hygienic/macroexpand '(let [a 1 a a b a a a] a));= (let* [a 1 a11306 a b a11306 a11307 a11306] (do a11307)) Please report any bugs. Thanks, 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: IDE feature
Le vendredi 9 août 2013, Sean Corfield a écrit : On Thu, Aug 8, 2013 at 5:00 PM, Mark Engelberg mark.engelb...@gmail.comjavascript:; wrote: Getting back to the point of the original post, one of the nice features of DrRacket is that when you type `]`, it automatically puts either ']' or ')' Having used DrRacket quite a bit lately, I do not find its handling of parens to be particularly good. Regardless of whether I set it to auto-close each opening paren or not, I constantly find myself with a missing paren or an extra paren, or an incorrect mix of closing ))]))] somewhere. It's not a problem I ever have in Emacs working on Clojure - with paredit. this is like closing off a thought. Paren matching is currently more arduous in Clojure, because you really do have to pay attention to which kind of delimiter you're closing off and type the right one, so I would love Well, that's why folks advocate paredit - that problem simply goes away. Yes, paredit is a bit of a pain to get used to at first, but it really does remove a whole slew of issues around parentheses in code, and it really does make you a lot more productive, especially once you learn the structural editing commands (I am surprised at how many times I use paredit-convolute-sexpr What does it do? (first time I encounter it) to help reorganize code - I'm almost at the point of binding it to a key sequence!). -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.comjavascript:; Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com javascript:; For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com javascript:;. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
[Mac OS X 10.8.4] I followed this same procedure as Sean and it worked for me last night. On Thursday, August 8, 2013 9:16:06 PM UTC-7, Sean Corfield wrote: It failed for me on Mac OS X 10.8.4 - this has also been a problem on Windows for me (which doesn't have curl / wget anyway). Can we please get the Leiningen JAR posted somewhere that is not prone to this sort of SSL problem? (! 536)- lein upgrade The script at /Developer/workspace/worldsingles/build/bin/lein2 will be upgraded to the latest stable version. Do you want to continue [Y/n]? y Upgrading... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 100 126 100 1260 0261 0 --:--:-- --:--:-- --:--:-- 336 100 11353 100 113530 0 11459 0 --:--:-- --:--:-- --:--:-- 101k Manual self-install is deprecated; it will run automatically when necessary. Downloading Leiningen to /Users/sean/.lein/self-installs/leiningen-2.3.0-standalone.jar now... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 403 Failed to download https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.0-standalone.jar It's possible your HTTP client's certificate store does not have the correct certificate authority needed. This is often caused by an out-of-date version of libssl. Either upgrade it or set HTTP_CLIENT to turn off certificate checks: export HTTP_CLIENT=wget --no-check-certificate -O # or export HTTP_CLIENT=curl --insecure -f -L -o It's also possible that you're behind a firewall haven't yet set HTTP_PROXY and HTTPS_PROXY. Thu Aug 08 21:10:48 (sean)-(jobs:0)-(/Developer/workspace/worldsingles) (! 537)- HTTP_CLIENT=curl --insecure -f -L -o lein upgrade Downloading Leiningen to /Users/sean/.lein/self-installs/leiningen-2.3.0-standalone.jar now... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 403 /usr/bin/lein: line 63: download_failed_message: command not found Thu Aug 08 21:11:19 (sean)-(jobs:0)-(/Developer/workspace/worldsingles) On Thu, Aug 8, 2013 at 8:28 PM, Phil Hagelberg ph...@hagelb.orgjavascript: wrote: Hello everyone. I'm happy to announce the release of Leiningen version 2.3.0. This version contains mostly minor fixes, but some highlights include faster test runs when using selectors (by skipping fixtures), better support for detecting ambiguous version resolutions via :pedantic, and fixes to better isolate different profiles in different :target-paths. * Add `:eval-in :pprint` for debugging. (Phil Hagelberg) * Support cleaning extra dirs with `:clean-targets`. (Yoshinori Kohyama) * Test-selectors skip fixtures too, not just running tests. (Gary Fredericks) * Place licenses and readmes into jars. (Phil Hagelberg) * Include LICENSE as separate file in templates. (Wolodja Wentland) * Allow aborting on ambiguous version resolution with `:pedantic`. (Nelson Morris, Phil Hagelberg) * Scope `:compile-path` and `:native-path` under profile-specific target dir. (Phil Hagelberg) * Fix bug where uberjar filename would include provided profile. (Phil Hagelberg) * Deprecate explicit `self-install` command. (Phil Hagelberg) * Fix bugs around long lines in jar manifests. (Leon Barrett) * Support nested checkout dependencies. (Phil Hagelberg) * Fix bugs around `:filespecs`. (Jean Niklas L'orange) As usual, you can get the latest version by running `lein upgrade`. Thanks to all the contributors who helped make this happen. happy hacking, Phil -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
For a pretty decent cover of when and how to use macros, On Lisp[1] is a pretty good book. It's written mainly for Common Lisp but most of it translates to Clojure well enough. I find that for common code, writing macros isn't so useful as most of the goods ones are already part of clojure.core. But if you ever find yourself in the position where you'd really like to have a control structure just for your program, or introduce a compile-time code generator, or subtly add a new paradigm to the language, a macro is your ticket. 1. http://code.google.com/p/onlisp/ On Friday, August 9, 2013 9:55:14 AM UTC-4, Jace Bennett wrote: Obviously I've encountered the advice no macros unless you know you need them before. And I even sort of know the syntax and what they do. I don't think that's my problem. I think I've lived a life without macros. I mean, clearly dynamic-functional and even OOP styles are perfectly capable of building most anything (within my now constrained view of what is feasible). And my head is full of techniques (what an experienced lisper might call workarounds) to deal with their limitations, so I'm habituated to the pain, and the narrow view of 'what is feasible'. So, it's not about whether I need a macro at all, because I could deal indefinitely. There are an endless supply of problems I could solve without them. It's about wisdom, discerning whether its a good tradeoff to use a macro in a given situation. I wish this was the kind of thing that could be taught. Instead, I fear, it must be learned. On Fri, Aug 9, 2013 at 9:50 AM, Jace Bennett jace.b...@gmail.comjavascript: wrote: Thanks again, Mike. That's really helpful. I'll take a look at the core.matrix stuff to try and understand implementation and motivation better. What games did you make? I'd love to check them out. Jace On Fri, Aug 9, 2013 at 4:10 AM, Mikera mike.r.an...@gmail.comjavascript: wrote: On Friday, 9 August 2013 05:07:10 UTC+8, Jonathan Fischer Friberg wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Problem with this is that you don't really know when you need them unless you know what they do. I'm not saying don't learn how macros work. Learning is always good. My recommendation is just that your default approach should be to avoid using them unless you have tried very hard to achieve your goal with pure functions first, and convinced yourself that it isn't possible. Macros are only *needed* IMHO when one of the following applies: - You want to create new language/DSL syntax that isn't expressible with normal function application rules (e.g. short-circuiting evaluation, new control structures etc.) - You need to do custom code generation at compile time for some good reason (e.g. performance, since macros enable you to do compile-time specialisation of code) I wrote about these and gave some examples in a blog post a few months back for anyone interested: http://clojurefun.wordpress.com/2013/01/09/when-do-you-need-macros-in-clojure/ On Thu, Aug 8, 2013 at 9:58 PM, Jace Bennett jace.b...@gmail.comwrote: Thanks, Mike. I guess my simple example is too simple. Out of the hypothetical, have you used techniques like this? I have this nagging feeling that there is a more direct and idiomatic way to glean this sort of information from my code. I mean, that's why we use AST's, right? So we can process them? I shouldn't need a data structure like the endpoint map in the first place. I just don't know how to capitalize on this rather abstract and vague notion. How do folks usually go about it when they have a desire to query the running system about its shape and structure? On Thu, Aug 8, 2013 at 2:36 AM, Mikera mike.r.an...@gmail.com wrote: I'd suggest avoiding macros until you absolutely know that you need them. Usually they aren't necessary. Prefer writing pure functions (without side effects) - these are easier to reason about, easier to test, simpler to write correctly and easier to plug together / compose via higher order functions. For example, in your endpoint example I would probably just use three functions: - a pure add endpoint metadata to an endpoint map function - an impure update endpoints function that updates endpoints using an endpoint map - a function that calls both of the above to declare and launch a new endpoint There might be a few other helper functions as well but hopefully you get the idea. On Thursday, 8 August 2013 03:19:15 UTC+1, Jace Bennett wrote: Thanks to the community for a wondrous programming environment. I discovered SICP last year, and fell in love with the idea of lisp. But I've come to a point where I think I need practice on moderately sized projects before more reading will help. When starting on almost any moderately scoped effort, I quickly run into a
Re: IDE feature
On Fri, Aug 9, 2013 at 6:58 AM, Laurent PETIT laurent.pe...@gmail.com wrote: What does it do? (first time I encounter it) DrRacket? It's the standard IDE for the Racket language (and all of its teaching subsets etc). -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
Phil Hagelberg writes: On Thursday, August 8, 2013 8:52:47 PM UTC-7, Frank Hale wrote: Looks like I was way too fast. Upgrading just worked for me. Thank you! I got the ACL wrong on the initial upload but fixed it a few minutes after the email went out. -Phil -- https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.0-standalone.jar is still AccessDenied for me. -- Moritz Ulrich -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
On Aug 9, 2013, at 11:01 AM, Andrew Stine wrote: For a pretty decent cover of when and how to use macros, On Lisp[1] is a pretty good book. It's written mainly for Common Lisp but most of it translates to Clojure well enough. I find that for common code, writing macros isn't so useful as most of the goods ones are already part of clojure.core. But if you ever find yourself in the position where you'd really like to have a control structure just for your program, or introduce a compile-time code generator, or subtly add a new paradigm to the language, a macro is your ticket. 1. http://code.google.com/p/onlisp/ I think that On Lisp is completely awesome -- one of the best technical books of any kind that I've ever read. However, my recollection is that the macro stuff, in particular, doesn't translate so well to Clojure because the differences between Common Lisp and Clojure macros are pretty fundamental. Or at least that has been my impression and I mostly stopped writing macros when I switched from Common Lisp to Clojure because I found the differences confusing. Your experience may be different but I thought that a warning might be in order. -Lee -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
On Fri, Aug 9, 2013 at 12:14 AM, Phillip Lord phillip.l...@newcastle.ac.uk wrote: Unfortunately, after upgrading the bash script, so it leaves a broken install. I keep my lein script under Git so it was easy to revert, but we're still on 2.1.3 because I ran into a number of problems with 2.2.0 (that I no longer remember but I did post notes about them here a while back). I was just hoping to see if those problems were fixed in 2.3.0. I'll search the archives and see if I can find my post (and then I'll look at the 2.3.0 release notes). -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
Gmail search is defeating my efforts to locate what my problems with 2.2.0 were so I'll just wait until I can download 2.3.0 and re-run all our tests anyway. Sigh. On Fri, Aug 9, 2013 at 8:12 AM, Sean Corfield seancorfi...@gmail.com wrote: On Fri, Aug 9, 2013 at 12:14 AM, Phillip Lord phillip.l...@newcastle.ac.uk wrote: Unfortunately, after upgrading the bash script, so it leaves a broken install. I keep my lein script under Git so it was easy to revert, but we're still on 2.1.3 because I ran into a number of problems with 2.2.0 (that I no longer remember but I did post notes about them here a while back). I was just hoping to see if those problems were fixed in 2.3.0. I'll search the archives and see if I can find my post (and then I'll look at the 2.3.0 release notes). -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: IDE feature
I'll bet Laurent means paredit-convolute-sexpr :-) Ambrose On Fri, Aug 9, 2013 at 11:09 PM, Sean Corfield seancorfi...@gmail.comwrote: On Fri, Aug 9, 2013 at 6:58 AM, Laurent PETIT laurent.pe...@gmail.com wrote: What does it do? (first time I encounter it) DrRacket? It's the standard IDE for the Racket language (and all of its teaching subsets etc). -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: IDE feature
Ah, yes... it turns this ( | represents the cursor ): (f a b (g c d |e f)) into this: (g c d (f a b e f)) I find I use it most often when moving `let` forms around, but also for other constructs occasionally. Sean On Fri, Aug 9, 2013 at 8:15 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: I'll bet Laurent means paredit-convolute-sexpr :-) Ambrose On Fri, Aug 9, 2013 at 11:09 PM, Sean Corfield seancorfi...@gmail.com wrote: On Fri, Aug 9, 2013 at 6:58 AM, Laurent PETIT laurent.pe...@gmail.com wrote: What does it do? (first time I encounter it) DrRacket? It's the standard IDE for the Racket language (and all of its teaching subsets etc). -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Commercial Users of Functional Programming (Sep 22-24, Boston): Call for Participation
Functional programming has been at the forefront of a new generation of programming technologies: Companies employing functional programming use it to enable more effective, robust, and flexible software development. The annual CUFP workshop is designed to serve the growing community of commercial users of functional programming: Practitioners meet and collaborate; language designers and users can share ideas about the future of their languages; experts share their expertise on practical functional programming. CUFP 2013 begins with a day of talks about industrial applications of functional programming, followed by two days of tutorials by top-notch language experts including advanced tutorials on special topics. More information about CUFP 2013 is available on the CUFP web site at http://cufp.org/conference/schedule Registration is available at: https://regmaster3.com/2013conf/ICFP13/register.php Note that early-registration discounts end August 22. TALKS, SEPTEMBER 22 Keynote: Small Talk Dave Thomas, TBA. Analyzing PHP statically (Julien Verlaguet, Facebook) Introducing Erlang to OpenX (Anthony Molinaro, OpenX) Redesigning the Computer for Security (Tom Hawkins, BAE Systems) End to end Reactive Programming (Jafar Husain, Netflix) Medical Device Automation using Message-Passing Concurrency in Scheme (Vishesh Panchal BobBurger, Beckman Coulter Inc.) Enabling Microservice Architectures with Scala (Kevin Scaldeferri, Gilt Groupe) Functional Infrastructures (Antoni Batchelli, PalletOps) Realtime MapReduce at Twitter (Sam Ritchie, Twitter Inc) Functional Probabilistic Programming (Avi Pfeffer, Charles River Analytics) Building a commercial development platform Haskell, an experience report. (Gregg Lebovitz, FP Complete) Common Pitfalls of Functional Programming and How to Avoid Them: A Mobile Gaming Platform Case Study (Yasuaki Takebe, GREE, Inc) Building scalable, high-availability distributed systems in Haskell (Jeff Epstein, Parallel Scientific) Functional Reporting (Edward Kmett, SP Capital IQ) Enterprise Appointment Scheduling with Haskell (Ryan Trinkle, skedge.me) Programming Map/Reduce in Mathematica (Paul-Jean Letourneau, Wolfram) TUTORIALS, SEPTEMBER 23 T1: Haskell Day 1 (Andres Löh) T2 - OCaml tutorial (Yaron Minsky Anil Madhavapeddy) T3 - Erlang 101 - Your introduction to Concurrency and Multi-core (Francesco Cesarini Simon Thompson) T4 - (Systematic generation of optimal code with MetaOCaml) Oleg Kiselyov T5 - (Erlang Web frameworks) Steve Vinoski TUTORIALS, SEPTEMBER 24 T6 - Haskell Day 2 (Simon Marlow) T7 - Clojure tutorial (Luke Vander Hart) T8 - The Seductions of Scala (Dean Wampler) T9 - Bending Clojure to your will: Macros and Domain Specific Languages (Leonardo Borges) T10 - Scalding - The Scala Tool for Data Analytics in Hadoop Systems (Dean Wampler) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
`lein upgrade` Just Worked™ for me. On Fri, Aug 9, 2013 at 11:48 AM, Marcus Blankenship mar...@creoagency.com wrote: No good deed goes unpunished, so here's my error *after* upgrading… Error occurred during initialization of VM java/lang/ClassNotFoundException: error in opening JAR file /Users/marcus/.lein/self-installs/leiningen-2.3.0-standalone.jar Any ideas? On Aug 8, 2013, at 8:28 PM, Phil Hagelberg p...@hagelb.org wrote: Hello everyone. I'm happy to announce the release of Leiningen version 2.3.0. This version contains mostly minor fixes, but some highlights include faster test runs when using selectors (by skipping fixtures), better support for detecting ambiguous version resolutions via :pedantic, and fixes to better isolate different profiles in different :target-paths. * Add `:eval-in :pprint` for debugging. (Phil Hagelberg) * Support cleaning extra dirs with `:clean-targets`. (Yoshinori Kohyama) * Test-selectors skip fixtures too, not just running tests. (Gary Fredericks) * Place licenses and readmes into jars. (Phil Hagelberg) * Include LICENSE as separate file in templates. (Wolodja Wentland) * Allow aborting on ambiguous version resolution with `:pedantic`. (Nelson Morris, Phil Hagelberg) * Scope `:compile-path` and `:native-path` under profile-specific target dir. (Phil Hagelberg) * Fix bug where uberjar filename would include provided profile. (Phil Hagelberg) * Deprecate explicit `self-install` command. (Phil Hagelberg) * Fix bugs around long lines in jar manifests. (Leon Barrett) * Support nested checkout dependencies. (Phil Hagelberg) * Fix bugs around `:filespecs`. (Jean Niklas L'orange) As usual, you can get the latest version by running `lein upgrade`. Thanks to all the contributors who helped make this happen. happy hacking, Phil MARCUS BLANKENSHIP \\\ Owner, Problem Solver, Thinker \\\ 541.805.2736 \ @justzeros \ skype:marcuscreo -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
Lucky… On Aug 9, 2013, at 9:06 AM, Tim Visher tim.vis...@gmail.com wrote: `lein upgrade` Just Worked™ for me. On Fri, Aug 9, 2013 at 11:48 AM, Marcus Blankenship mar...@creoagency.com wrote: No good deed goes unpunished, so here's my error *after* upgrading… Error occurred during initialization of VM java/lang/ClassNotFoundException: error in opening JAR file /Users/marcus/.lein/self-installs/leiningen-2.3.0-standalone.jar Any ideas? On Aug 8, 2013, at 8:28 PM, Phil Hagelberg p...@hagelb.org wrote: Hello everyone. I'm happy to announce the release of Leiningen version 2.3.0. This version contains mostly minor fixes, but some highlights include faster test runs when using selectors (by skipping fixtures), better support for detecting ambiguous version resolutions via :pedantic, and fixes to better isolate different profiles in different :target-paths. * Add `:eval-in :pprint` for debugging. (Phil Hagelberg) * Support cleaning extra dirs with `:clean-targets`. (Yoshinori Kohyama) * Test-selectors skip fixtures too, not just running tests. (Gary Fredericks) * Place licenses and readmes into jars. (Phil Hagelberg) * Include LICENSE as separate file in templates. (Wolodja Wentland) * Allow aborting on ambiguous version resolution with `:pedantic`. (Nelson Morris, Phil Hagelberg) * Scope `:compile-path` and `:native-path` under profile-specific target dir. (Phil Hagelberg) * Fix bug where uberjar filename would include provided profile. (Phil Hagelberg) * Deprecate explicit `self-install` command. (Phil Hagelberg) * Fix bugs around long lines in jar manifests. (Leon Barrett) * Support nested checkout dependencies. (Phil Hagelberg) * Fix bugs around `:filespecs`. (Jean Niklas L'orange) As usual, you can get the latest version by running `lein upgrade`. Thanks to all the contributors who helped make this happen. happy hacking, Phil MARCUS BLANKENSHIP \\\ Owner, Problem Solver, Thinker \\\ 541.805.2736 \ @justzeros \ skype:marcuscreo -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. MARCUS BLANKENSHIP \\\ Owner, Problem Solver, Thinker \\\ 541.805.2736 \ @justzeros \ skype:marcuscreo -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: IDE feature
Suppose I start out writing this: (if some-expr (let [x (something y)] (process x)) (deal-with ...)) and I get to the ... and realize I need x in that expression as well. I just place my cursor before (process x) and do M-x conv RET and I get this code: (let [x (something y)] (if some-expr (process x) (deal-with x))) Similarly I can go from: (let [x (something y)] (if some-expr (process x) (deal-with y))) to: (if some-expr (let [x (something y)] (process x)) (deal-with y)) with a convolute (cursor in front of (process x) again) followed by a forward barf C-} after moving the cursor down two lines - convolute leaves it in front of (if ...). Sean On Fri, Aug 9, 2013 at 8:49 AM, Laurent PETIT laurent.pe...@gmail.com wrote: Le vendredi 9 août 2013, Sean Corfield a écrit : Ah, yes... it turns this ( | represents the cursor ): (f a b (g c d |e f)) into this: (g c d (f a b e f)) I find I use it most often when moving `let` forms around, but also for other constructs occasionally. Sorry, maybe it's just me, but I still fail to see how to use it to help with moving let. Could you elaborate a little example with let ? Sean On Fri, Aug 9, 2013 at 8:15 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: I'll bet Laurent means paredit-convolute-sexpr :-) Ambrose On Fri, Aug 9, 2013 at 11:09 PM, Sean Corfield seancorfi...@gmail.com wrote: On Fri, Aug 9, 2013 at 6:58 AM, Laurent PETIT laurent.pe...@gmail.com wrote: What does it do? (first time I encounter it) DrRacket? It's the standard IDE for the Racket language (and all of its teaching subsets etc). -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to
Re: Interest in a commercial IDE for Clojure?
Hi Colin, I'm a long time IntelliJ user and I would gladly pay for a serious Clojure plugin. Francesco On Saturday, July 27, 2013 1:54:58 PM UTC+2, Colin Fleming wrote: Hi all, I was planning to wait a little longer before going public, but since it's pretty relevant to the other IntelliJ thread going on at the moment I thought I'd jump in. For the last couple of months of happy unemployment I've been working on a fork of La Clojure which is now about 70% migrated to Clojure and significantly improved. It's a lot of work to develop a tool like this, and one of the options I'm considering is starting a company to develop it as a commercial product - JetBrains have never maintained development of La Clojure very actively. I've been doing a little market research but there's really not much data around about whether there are enough people working with Clojure to sustain a product like that, and also the community is currently very focused on open source. One problem is that the IDE space is already fairly fractured - there's Emacs and CCW, Clooj, Sublime Text and the promise of Light Table at some point, and of course the current public version of La Clojure. But there's still not a great option for something that's powerful but easy to use - CCW is probably the closest thing to this right now. However I think it's telling that a large fraction of people in the State of Clojure 2012 survey still identified development tools as a major pain point. I think that the IntelliJ platform is a fantastic base to build something like this on. Clojure as a language makes it pretty challenging to develop a lot of the great functionality that JetBrains are famous for, but I think there's scope to do a lot of great things. Certainly for mixed Clojure/Java projects it would be difficult to beat, but even for Clojure only projects I can imagine a lot of fantastic functionality built on their infrastructure. My plan would be to release a standalone IDE and a plugin for people using IntelliJ Ultimate for web dev, Ruby/Python or whatever. Since it's mostly Clojure now (and I'm migrating what's left as I get to it) there's a real possibility of a Clojure plugin/extension API. I envision charging PyCharm/RubyMine type prices, say $200 for company licenses or $100 for individual developers. So, I'd love to hear what people think. I'd appreciate it if we could stay away from the politics of open source vs proprietary - several people have told me privately that they'd rather use OSS and that's fine, proprietary isn't for everyone. What I'd like to know is if the idea is appealing to many people here? In case it's a concern for anyone, I've discussed this with JetBrains. Thanks for any feedback, Cheers, Colin -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[ANN] Compliment - a completion library you deserve
Dear community, I've just released the initial version of my clojure-complete fork, Compliment. I decided to move it into a separate project after I rewrote most of it. Here is project's link: https://github.com/alexander-yakushev/compliment . There is a rationale in README, where I explain why I had to write this fork (initially the reason was clojure-complete being very slow to work on Android with Emacs' ac-complete, then other reasons turned up). You can see examples of what Compliment can do here: https://github.com/alexander-yakushev/compliment/wiki/Examples . Right now only Emacs is supported as a client, via my yet another fork, of ac-nrepl: https://github.com/alexander-yakushev/ac-nrepl-compliment . Finally, I don't want to seem like I'm hijacking clojure-complete's positions. It's just that clojure-complete happens to be a faithful swank-clojure's completion port, and it is pretty rigid; I think there is much to be improved in this area. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
Hi Jace, this is my first answer in this group. Maybe I'm at the same point you are, except my background is in Java, so I just want to share what I understood in the hope to expand your question for the comunity. I found myself to use a lot of code generation in Java to have the glue among components written for me by various technologies. Maybe this is the same you do with reflection. Lot of metadata and conventions above configuration to avoid configuration getting more complex than the system itself. Maybe functions are your components in Clojure and you can explore defined functions with ns functions (http://clojure.org/Namespaces). I think these are the metadata you talk about and you don't need to accumulate them in macros. I don't know how to explore functions metadata (i.e. their arguments) but it shoud be a matter of function itself to establish its arguments meaning. Maybe you can use macros to have the glue code written for you or maybe you can use other functions for this purpose. You cannot learn about this in 21 days (http://norvig.com/21-days.html). I found this interesting link googling the sentence: Bad programming is easy. Idiots can learn it in 21 days, even if they are Dummies. found in HtDP ( http://www.ccs.neu.edu/home/matthias/HtDP2e/) :) I don't know how SICP compares to HtDP but thank you for the reference. I can point you to the next book I'll read about macros: let over lambda (http://letoverlambda.com/), but as stated in the introduction macros are the last step to become a well rounded (Lisp) programmer, maybe other aspects of FP itself should be known before. In the hope this little can be useful, Luca Il giorno giovedì 8 agosto 2013 04:19:15 UTC+2, Jace Bennett ha scritto: Thanks to the community for a wondrous programming environment. I discovered SICP last year, and fell in love with the idea of lisp. But I've come to a point where I think I need practice on moderately sized projects before more reading will help. When starting on almost any moderately scoped effort, I quickly run into a class of problems which I think may be a fit for macros, but I want to understand what is the idiomatic way to approach them in clojure. Most of my professional experience is in .NET, and that is probably coloring my thought patterns a bit. In that context, I often use reflection scans and type metadata to configure infrastructural bits and dry things up. Instead of having to explicitly register components in the more dynamic areas of my app, I use conventions to select components to register from the metadata I have about my code. I can imagine using macros in clojure to accumulate metadata about my declarations so that I can query them at runtime. For example, maybe a defendpoint macro that sets up a handler AND adds it to the routing table (or more directly an endpoint map which I then use to make routing decisions among other things). Admittedly, something about the sound of the phrase it's just data tells me I'm sniffin up the wrong tree here. But I don't know how to turn that nagging feeling into working code. Is this a reasonable use of the macro? What about doing the registration at macro-expansion time vs emitting runtime code to do it? How should one approach the problems space otherwise? Thanks for your time. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
The difficulty with On Lisp when applied to Clojure is that the specific macros On Lisp demonstrates either depend on state, which Clojure avoids, or are already present in Clojure core. (if-let is a big one in my book.) Some of them also run into conflicts with Clojure implicit gensyming. I don't suggest it for the specific macros it demonstrates, but because it demonstrates very clearly what they are for, why and where you would use them, and how, in general, they are used. I also don't write macro much anymore in Clojure but that's mostly because Clojure has a few macros already which handle most of the things I would do with them in Common Lisp. On Friday, August 9, 2013 11:13:44 AM UTC-4, Lee wrote: On Aug 9, 2013, at 11:01 AM, Andrew Stine wrote: For a pretty decent cover of when and how to use macros, On Lisp[1] is a pretty good book. It's written mainly for Common Lisp but most of it translates to Clojure well enough. I find that for common code, writing macros isn't so useful as most of the goods ones are already part of clojure.core. But if you ever find yourself in the position where you'd really like to have a control structure just for your program, or introduce a compile-time code generator, or subtly add a new paradigm to the language, a macro is your ticket. 1. http://code.google.com/p/onlisp/ I think that On Lisp is completely awesome -- one of the best technical books of any kind that I've ever read. However, my recollection is that the macro stuff, in particular, doesn't translate so well to Clojure because the differences between Common Lisp and Clojure macros are pretty fundamental. Or at least that has been my impression and I mostly stopped writing macros when I switched from Common Lisp to Clojure because I found the differences confusing. Your experience may be different but I thought that a warning might be in order. -Lee -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Compliment - a completion library you deserve
Looks *very* cool. I like the drop-down list in ac-nrepl-compliment. On Friday, August 9, 2013 12:19:40 PM UTC-4, Alexander Yakushev wrote: Dear community, I've just released the initial version of my clojure-complete fork, Compliment. I decided to move it into a separate project after I rewrote most of it. Here is project's link: https://github.com/alexander-yakushev/compliment . There is a rationale in README, where I explain why I had to write this fork (initially the reason was clojure-complete being very slow to work on Android with Emacs' ac-complete, then other reasons turned up). You can see examples of what Compliment can do here: https://github.com/alexander-yakushev/compliment/wiki/Examples . Right now only Emacs is supported as a client, via my yet another fork, of ac-nrepl: https://github.com/alexander-yakushev/ac-nrepl-compliment . Finally, I don't want to seem like I'm hijacking clojure-complete's positions. It's just that clojure-complete happens to be a faithful swank-clojure's completion port, and it is pretty rigid; I think there is much to be improved in this area. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
structure-related support for editing code as text
The recent discussion of paredit reminded me that some Lisp editors have simple features that let you deal with code structurally, in a sense, while also editing it as text and using fairly standard GUI gestures. I haven't seen these yet in the Clojure world. One that I've found helpful is that clicking on a bracket selects the entire structure that it delimits. This makes it very natural to use sequences of click, cut, click, paste to move chunks of structure around. Another is mouse copy: Clicking on a structure (either a literal or a delimiter) while holding down a modifier key copies what you clicked on to the insertion point. For people who don't like paredit for one reason or another (like me), these can be really useful. And I wouldn't expect them to be too hard to add to existing IDEs. And FWIW, some ancient Lisp environments, like on the Xerox Interlisp machines, had much more exotic features along these lines. -Lee -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Compliment - a completion library you deserve
Indeed! Seems to be pretty cool! Thanks for the compliments! :) Best, jaju On Fri, Aug 9, 2013 at 10:38 PM, Andrew Stine illuminati1...@gmail.comwrote: Looks *very* cool. I like the drop-down list in ac-nrepl-compliment. On Friday, August 9, 2013 12:19:40 PM UTC-4, Alexander Yakushev wrote: Dear community, I've just released the initial version of my clojure-complete fork, Compliment. I decided to move it into a separate project after I rewrote most of it. Here is project's link: https://github.com/alexander-** yakushev/compliment https://github.com/alexander-yakushev/compliment . There is a rationale in README, where I explain why I had to write this fork (initially the reason was clojure-complete being very slow to work on Android with Emacs' ac-complete, then other reasons turned up). You can see examples of what Compliment can do here: https://github.com/alexander-** yakushev/compliment/wiki/**Exampleshttps://github.com/alexander-yakushev/compliment/wiki/Examples. Right now only Emacs is supported as a client, via my yet another fork, of ac-nrepl: https://github.com/alexander-**yakushev/ac-nrepl-complimenthttps://github.com/alexander-yakushev/ac-nrepl-compliment. Finally, I don't want to seem like I'm hijacking clojure-complete's positions. It's just that clojure-complete happens to be a faithful swank-clojure's completion port, and it is pretty rigid; I think there is much to be improved in this area. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Debugging a custom reader literal for a sorted-map
Should I file a bug report at this point? (Correcting the email title.) On Fri, Aug 9, 2013 at 3:04 AM, Jozef Wagner jozef.wag...@gmail.com wrote: This ticket may be related, http://dev.clojure.org/jira/browse/CLJ-1093 On Friday, August 9, 2013 12:08:06 AM UTC+2, Jozef Wagner wrote: It may be a bug somewhere in a Compiler. I've lost track at https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6624 after debugging this: user (def x `(quote ~(list 1 (clojure.lang.PersistentTreeMap/create (seq [1 2 3 4]) #'user/x user x (quote (1 #sorted-map (1 2 3 4))) user (.eval (clojure.lang.Compiler/analyze clojure.lang.Compiler$C/EXPRESSION x)) (1 #sorted-map (1 2 3 4)) user (eval x) (1 {1 2, 3 4}) JW On Thursday, August 8, 2013 10:14:57 PM UTC+2, David James wrote: I'd really appreciate if others could take a look. I wonder if it may be a Clojure reader bug. On Thu, Aug 8, 2013 at 3:55 PM, Jozef Wagner jozef@gmail.com wrote: It seems there is something else in data reader which causes this change. user= (class '#foo/sm (1 2 3 4)) clojure.lang.PersistentArrayMap user= (class (read-string #foo/sm (1 2 3 4))) clojure.lang.PersistentTreeMap It's quite puzzling. In both cases the evaluation does not take place, but still the transition to PersistentArrayMap occurs. JW On Thursday, August 8, 2013 9:49:24 PM UTC+2, David James wrote: That's a good point about: user= eval (to-sorted-map '(1 2 3 4))) {1 2, 3 4} But this should work, right? user= (assoc #sorted-map (:a 1 :b 2) :c 3) {:c 3, :a 1, :b 2} ; incorrect -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
Hey everyone; sorry for the chaos around this release. The upload process is now fully automated[1] to reduce manual error, and I'm going to make sure a few other people have access to the S3 bucket so if something like this happens again it can be fixed when I'm not around. There's been one bug found in this release[2] that you might want to be aware of if you produce regular jars with AOT. (uberjars are not affected) The issue comments contain a workaround, but we'll be cutting a 2.3.1 release in a few days. -Phil [1] - https://github.com/technomancy/leiningen/commit/9d93cdd19eaf2cd5f73242bc75c3115181326287 [2] - https://github.com/technomancy/leiningen/issues/1283 -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[ANN] Clojure Cheatsheet for Emacs
Hi, I find the Clojure Cheatsheet http://clojure.org/cheatsheet really useful, but since I often need at those times I don't have wifi, I've packaged it up into an Emacs plugin: https://raw.github.com/krisajenkins/clojure-cheatsheet/master/screenshot1.png In the hope that someone else finds it useful too, the project's here on Github https://github.com/krisajenkins/clojure-cheatsheet, along with installation instructions. Any feedback is welcomed. :-) Cheers, Kris -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Clojure Cheatsheet for Emacs
Thank you so much... Actually was kinda funny, I typed something like clojure cheatsheet offline and your github link was one of the first, and I was very surprised... Wow, it is possible that I didn't know of it ? Well now I understand why I didn't know of it yet, it is only few hours old ;) On Friday, August 9, 2013 10:30:46 PM UTC+2, Kris Jenkins wrote: Hi, I find the Clojure Cheatsheet http://clojure.org/cheatsheet really useful, but since I often need at those times I don't have wifi, I've packaged it up into an Emacs plugin: https://raw.github.com/krisajenkins/clojure-cheatsheet/master/screenshot1.png In the hope that someone else finds it useful too, the project's here on Github https://github.com/krisajenkins/clojure-cheatsheet, along with installation instructions. Any feedback is welcomed. :-) Cheers, Kris -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Negation in core.logic
Sorry to post on an old thread, but just in case someone comes here from Google: I'm just playing with core.logic, and I think I found a way to negate a goal... I don't know if this is advisable or not, but it seems to work: (== 0 (count (run* [arg] (goal arg -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Negation in core.logic
I've since added an experimental Prolog style negation as failure constraint `nafc`. On Fri, Aug 9, 2013 at 5:19 PM, Alex Dowad alexinbeij...@gmail.com wrote: Sorry to post on an old thread, but just in case someone comes here from Google: I'm just playing with core.logic, and I think I found a way to negate a goal... I don't know if this is advisable or not, but it seems to work: (== 0 (count (run* [arg] (goal arg -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proposal] Simplified 'ns' declaration
Now that refer is part of require, I don't think the existing syntax is too hard for new comers. The only thing I would suggest is adding the ability to :rename to require. That is, now that :refer is in require, require can handle anything except :rename and :exclude. I'm not concerned with :exclude since IMO it probably does more harm than good. However, if one wants to rename, one still has to use refer or use in the ns macro. If on the other hand rename were added to require, we could forget about use and refer entirely in the ns macro, which would simply things a lot for new comers. (Of course, it would still be helpful for them to learn about use and refer, but they could get quite far without knowing about them.) So something like: (:require [clojure.string :refer [reverse] :rename {join str-join}]) On Tuesday, August 6, 2013 11:06:52 AM UTC-7, Tassilo Horn wrote: Sean Corfield seanco...@gmail.com javascript: writes: Deprecating (not removing) :use from ns seems reasonable but I really don't see any value in a new unified syntax - esp. since it would have to support the legacy syntax for several releases alongside (and then you'd have to consider whether mixed syntax should be supported - ugh!). I totally agree with Sean. Maybe deprecate :use, and keep the rest as it is. The current syntax is really not hard, and it's very good that the keywords map 1-to-1 to the functions of the same name. Check the docs for `require`, then you know what `(:require ...)` does. The same goes for `use` and `import`. You don't have that match with the new proposed syntax where you have to ask yourself is a vector with nested vector the syntax for `require` or `import` or whatnot?. And the only benefit seems to be that it's a bit more concise in some cases. I don't care if my ns declaration is 20 or only 12 lines long. It should be clear, and that's what the current syntax achieves. 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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Clojure Cheatsheet for Emacs
Very nice, Kris! In case anyone wants to use the Clojure cheatsheet offline using a web browser, in a form similar to the on-line one that includes the tooltips, there is a git command documented at the link below to create a full local copy of it on your computer: http://jafingerhut.github.io Then just open the index.html file with your browser. The links to the different variants of the cheatsheet all work off-line. Some of the links later in that page require being on-line (e.g. to get the PDF version of the cheatsheet, or to the actual Github version of the repo). Andy On Fri, Aug 9, 2013 at 1:59 PM, Simone Mosciatti mweb@gmail.com wrote: Thank you so much... Actually was kinda funny, I typed something like clojure cheatsheet offline and your github link was one of the first, and I was very surprised... Wow, it is possible that I didn't know of it ? Well now I understand why I didn't know of it yet, it is only few hours old ;) On Friday, August 9, 2013 10:30:46 PM UTC+2, Kris Jenkins wrote: Hi, I find the Clojure Cheatsheet http://clojure.org/cheatsheet really useful, but since I often need at those times I don't have wifi, I've packaged it up into an Emacs plugin: https://raw.github.com/krisajenkins/clojure-cheatsheet/master/screenshot1.png In the hope that someone else finds it useful too, the project's here on Github https://github.com/krisajenkins/clojure-cheatsheet, along with installation instructions. Any feedback is welcomed. :-) Cheers, Kris -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: ANN: paredit-widget, simple swing-based clojure paredit widget
Hello Kovas, I had the chance to quickly play a little bit with the widget as integrated into nightcode, and it's already really enjoyable ! I think that it would indeed be fair to have a way to put it off. As a reminder, find below the possibilities of switching it off, as currently offereded by Counterclockwise: - permanently for all the new editors to be opened : a global switch, application wide, via the Clojure Editor Preferences Panel - toggling it on/off for the current editor : Alt + D ( D as a reminder of toggle [D]efault editing mode ) - block the paredit behavior *just for the next keystroke*, really useful when you're lost and REAAALLY want this *damn* paren to be deleted without paredit interfering: It's the Esc Key. It only jumps out of paredit mode for the next keystroke where paredit would have been triggered. Note that those features are not found in paredit.clj, they are in the Eclipse part of Counterclockwise. They are dependent on the state of the editor / application. Note also that the only features that are disabled are those that override the meaning of code letters: adding parens while typing ( with a selection, etc. The features that require an explicit keyboard shortcut such as those for slurp/barf/select up-right-left-down/raise over/... are not disabled since they don't interfere with classic coding keys. Cheers, -- Laurent 2013/8/6 kovas boguta kovas.bog...@gmail.com: Its just a matter of removing the event handlers that got added in the first place. I'll think about what the best way of exposing those via the api is. In the meantime feel free to look at the source, its not very complicated when it gets down to the paredit-widget function. On Tue, Aug 6, 2013 at 12:51 PM, Zach Oakes zsoa...@gmail.com wrote: I'll try adding a way to toggle paredit, but it'll be complicated since I will probably have to re-create and re-load all open files, unless paredit-widget provides a way to disable paredit from a JTextArea that previously had it added. As for evaluating selected expressions, I definitely intend on adding that soon. On Tuesday, August 6, 2013 2:44:51 PM UTC-4, Lee wrote: On Aug 6, 2013, at 2:15 PM, kovas boguta wrote: Cool! I just cloned the repo and tried it out. Seems to work pretty well. I just tried it too, mainly to see if there was a way to turn paredit off... and I don't see one. Is there one? I really dislike paredit. Also, is there not a way to evaluate a selected expression in the edit window, or am I just missing it? I do think that's an important core feature of Clooj and of most Clojure/Lisp IDEs. -Lee -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Negation in core.logic
On Fri, Aug 9, 2013 at 4:19 PM, Alex Dowad alexinbeij...@gmail.com wrote: (== 0 (count (run* [arg] (goal arg What this is actually doing (run* [q] ;;... some stuff -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Negation in core.logic
Sorry - gmail spasm What I was trying to say is that what I think your code is doing is running a Clojure expression once and unifying with 0. It's equivalent to precomputing that outside of the run*: (let [result (count (run* [arg] (goal arg))] (run* [q] ;; whatever-else-you-were doing (== 0 result))) Now, of course that expression could use some projected value or be embedded in a goal that gets tested multiple times, but chances are that the naive uses of that are probably not doing what you really want to do. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
Thanks everyone. Good stuff. I have Let over Lambda, but I didn't glean what I wanted from it (or probably even what it wanted from me). I'll pick up On Lisp. I didn't realize it was focused on macros. Also, I think Luca has given me a clue. I used code gen techniques long before I started using reflection based techniques. Macros are more like code gen, so I'll think back to those techniques, and search for analogues and maybe even epiphanies. I think I had the ideas of dynamism and DRY complected (sorry, had to). The dynamism will obviously require state. The DRY shouldn't. But in C# I've usually gone dynamic to get dry. Out of curiousity, where do the defs go? Could one iterate over all the vars in the runtime environment? Would I just get pointers to native code? On Fri, Aug 9, 2013 at 1:04 PM, Andrew Stine illuminati1...@gmail.comwrote: The difficulty with On Lisp when applied to Clojure is that the specific macros On Lisp demonstrates either depend on state, which Clojure avoids, or are already present in Clojure core. (if-let is a big one in my book.) Some of them also run into conflicts with Clojure implicit gensyming. I don't suggest it for the specific macros it demonstrates, but because it demonstrates very clearly what they are for, why and where you would use them, and how, in general, they are used. I also don't write macro much anymore in Clojure but that's mostly because Clojure has a few macros already which handle most of the things I would do with them in Common Lisp. On Friday, August 9, 2013 11:13:44 AM UTC-4, Lee wrote: On Aug 9, 2013, at 11:01 AM, Andrew Stine wrote: For a pretty decent cover of when and how to use macros, On Lisp[1] is a pretty good book. It's written mainly for Common Lisp but most of it translates to Clojure well enough. I find that for common code, writing macros isn't so useful as most of the goods ones are already part of clojure.core. But if you ever find yourself in the position where you'd really like to have a control structure just for your program, or introduce a compile-time code generator, or subtly add a new paradigm to the language, a macro is your ticket. 1. http://code.google.com/p/**onlisp/http://code.google.com/p/onlisp/ I think that On Lisp is completely awesome -- one of the best technical books of any kind that I've ever read. However, my recollection is that the macro stuff, in particular, doesn't translate so well to Clojure because the differences between Common Lisp and Clojure macros are pretty fundamental. Or at least that has been my impression and I mostly stopped writing macros when I switched from Common Lisp to Clojure because I found the differences confusing. Your experience may be different but I thought that a warning might be in order. -Lee -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: ANN: paredit-widget, simple swing-based clojure paredit widget
Hi Laurent, Thanks for the ideas; I'll think about how to implement them with a sensible API. I have one question which you might have some expertise on: How does eclipse / CCW deal with the alt/option key on the Mac? The issue is that option+key on mac is generally intercepted and turned into an international unicode character. For instance on my keyboard option+s gets realized as ß . (Another major annoyance is that these do not cause key-events, but rather input-method-events, but I digress) The hack that I'm using now is to just have a map like {ß s ∂ d ...} to map them back to their original keys, before sending them to the paredit keymap. The problem is that this mapping is not gonna be consist for international keyboards. Rummaging through your code, I could only find keymaps where the meta key has already been resolved. Do you have any idea how eclipse achieves this? Is it a matter of SWT working differently than awt/swing? Or do have any other ideas for a systematic solution? Thanks! On Fri, Aug 9, 2013 at 2:43 PM, Laurent PETIT laurent.pe...@gmail.comwrote: Hello Kovas, I had the chance to quickly play a little bit with the widget as integrated into nightcode, and it's already really enjoyable ! I think that it would indeed be fair to have a way to put it off. As a reminder, find below the possibilities of switching it off, as currently offereded by Counterclockwise: - permanently for all the new editors to be opened : a global switch, application wide, via the Clojure Editor Preferences Panel - toggling it on/off for the current editor : Alt + D ( D as a reminder of toggle [D]efault editing mode ) - block the paredit behavior *just for the next keystroke*, really useful when you're lost and REAAALLY want this *damn* paren to be deleted without paredit interfering: It's the Esc Key. It only jumps out of paredit mode for the next keystroke where paredit would have been triggered. Note that those features are not found in paredit.clj, they are in the Eclipse part of Counterclockwise. They are dependent on the state of the editor / application. Note also that the only features that are disabled are those that override the meaning of code letters: adding parens while typing ( with a selection, etc. The features that require an explicit keyboard shortcut such as those for slurp/barf/select up-right-left-down/raise over/... are not disabled since they don't interfere with classic coding keys. Cheers, -- Laurent 2013/8/6 kovas boguta kovas.bog...@gmail.com: Its just a matter of removing the event handlers that got added in the first place. I'll think about what the best way of exposing those via the api is. In the meantime feel free to look at the source, its not very complicated when it gets down to the paredit-widget function. On Tue, Aug 6, 2013 at 12:51 PM, Zach Oakes zsoa...@gmail.com wrote: I'll try adding a way to toggle paredit, but it'll be complicated since I will probably have to re-create and re-load all open files, unless paredit-widget provides a way to disable paredit from a JTextArea that previously had it added. As for evaluating selected expressions, I definitely intend on adding that soon. On Tuesday, August 6, 2013 2:44:51 PM UTC-4, Lee wrote: On Aug 6, 2013, at 2:15 PM, kovas boguta wrote: Cool! I just cloned the repo and tried it out. Seems to work pretty well. I just tried it too, mainly to see if there was a way to turn paredit off... and I don't see one. Is there one? I really dislike paredit. Also, is there not a way to evaluate a selected expression in the edit window, or am I just missing it? I do think that's an important core feature of Clooj and of most Clojure/Lisp IDEs. -Lee -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Lisp newbie seeks (macro?) wisdom - instrumentation and app metadata
I remember this talk to be very informative, I'm sure you'll find it useful: http://www.infoq.com/presentations/Clojure-Namespaces-Vars-Symbols Den lördagen den 10:e augusti 2013 kl. 00:21:02 UTC+2 skrev Jace Bennett: Out of curiousity, where do the defs go? Could one iterate over all the vars in the runtime environment? Would I just get pointers to native code? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
Hi Phil, all, I'm still seeing the error which (I think) others have been reporting here: vagrant@precise32:/tmp$ lein upgrade Downloading Leiningen to /home/vagrant/.lein/self-installs/leiningen-2.3.0-standalone.jar now... /home/vagrant/bin/lein: line 57: /home/vagrant/.lein/self-installs/leiningen-2.3.0-standalone.jar.pending: No such file or directory /home/vagrant/bin/lein: line 63: download_failed_message: command not found vagrant@precise32:/tmp$ please advise? Thanks! John On Friday, August 9, 2013 3:17:58 PM UTC-5, Phil Hagelberg wrote: Hey everyone; sorry for the chaos around this release. The upload process is now fully automated[1] to reduce manual error, and I'm going to make sure a few other people have access to the S3 bucket so if something like this happens again it can be fixed when I'm not around. There's been one bug found in this release[2] that you might want to be aware of if you produce regular jars with AOT. (uberjars are not affected) The issue comments contain a workaround, but we'll be cutting a 2.3.1 release in a few days. -Phil [1] - https://github.com/technomancy/leiningen/commit/9d93cdd19eaf2cd5f73242bc75c3115181326287 [2] - https://github.com/technomancy/leiningen/issues/1283 -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
On Friday, August 9, 2013 6:32:06 PM UTC-7, John Jacobsen wrote: please advise? Thanks! Hm; looks like self-install is getting invoked too soon. Not sure why it was working for me earlier. Try setting `export HTTP_CLIENT=wget -O` for now. -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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
That worked for now, thanks! On Friday, August 9, 2013 10:58:30 PM UTC-5, Phil Hagelberg wrote: On Friday, August 9, 2013 6:32:06 PM UTC-7, John Jacobsen wrote: please advise? Thanks! Hm; looks like self-install is getting invoked too soon. Not sure why it was working for me earlier. Try setting `export HTTP_CLIENT=wget -O` for now. -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 --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Leiningen 2.3.0 released
Yup, this killed my whole team for half a day today since I'd pushed the 2.3.0 script to our repo after the upgrade worked for me, and then hit the road for So. Cal. and everyone else then had a broken build for the rest of the day because the upgrade process broke due to this 403 forbidden issue again. I've just reverted us to 2.1.3 again. Can we _please_ get the Leiningen artifacts placed somewhere that doesn't cause all sorts of SSL problems? This has been a repeated problem over the last several releases. Mac and Windows users have been s.o.l. each time until it is resolved. Perhaps put Leiningen JARs on Clojars instead of this flaky custom location? Sean On Fri, Aug 9, 2013 at 6:32 PM, John Jacobsen eigenhom...@gmail.com wrote: Hi Phil, all, I'm still seeing the error which (I think) others have been reporting here: vagrant@precise32:/tmp$ lein upgrade Downloading Leiningen to /home/vagrant/.lein/self-installs/leiningen-2.3.0-standalone.jar now... /home/vagrant/bin/lein: line 57: /home/vagrant/.lein/self-installs/leiningen-2.3.0-standalone.jar.pending: No such file or directory /home/vagrant/bin/lein: line 63: download_failed_message: command not found vagrant@precise32:/tmp$ please advise? Thanks! John On Friday, August 9, 2013 3:17:58 PM UTC-5, Phil Hagelberg wrote: Hey everyone; sorry for the chaos around this release. The upload process is now fully automated[1] to reduce manual error, and I'm going to make sure a few other people have access to the S3 bucket so if something like this happens again it can be fixed when I'm not around. There's been one bug found in this release[2] that you might want to be aware of if you produce regular jars with AOT. (uberjars are not affected) The issue comments contain a workaround, but we'll be cutting a 2.3.1 release in a few days. -Phil [1] - https://github.com/technomancy/leiningen/commit/9d93cdd19eaf2cd5f73242bc75c3115181326287 [2] - https://github.com/technomancy/leiningen/issues/1283 -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Negation in core.logic
Hi, Norman Richards, In the example, arg and goal were not literal but were meant to be replaced with something appropriate to whatever you are trying to do. Yes, unless you use a projected value, it is equivalent to precomputing it outside the run*. The point was that, although very hacky, there is a way to create a goal which succeeds if, and only if, another goal fails. Having said that, David Nolen's nafc constraint sounds much better and I am going to check it out right now. On Sat, Aug 10, 2013 at 12:05 AM, Norman Richards o...@nostacktrace.comwrote: Sorry - gmail spasm What I was trying to say is that what I think your code is doing is running a Clojure expression once and unifying with 0. It's equivalent to precomputing that outside of the run*: (let [result (count (run* [arg] (goal arg))] (run* [q] ;; whatever-else-you-were doing (== 0 result))) Now, of course that expression could use some projected value or be embedded in a goal that gets tested multiple times, but chances are that the naive uses of that are probably not doing what you really want to do. -- -- 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 a topic in the Google Groups Clojure group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/hz63yeQfiQE/unsubscribe. To unsubscribe from this group and all its topics, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.