Re: Literate Programming example
On 11/19/2011 10:21 PM, Daniel Jomphe wrote: With the tools available to us today, there's no reason why we at least shouldn't have everything needed to make literate programming more seamless, more natural. For example, while reading your toy example, I found myself wanting to ask a question or comment on your thoughts a few times. If your book had been displayed on a dynamic website geared towards literate programming, I might have been able to click on a paragraph and write my question/comment right there. And then, after a short conversation there, you would have integrated the fruits of our conversation directly into the end result. Thus each new reader would have been an occasion to improve the book. ...It's nothing surprising since this kind of review system already exists in some publishers' toolkits. Especially with support for discussions and iterations, such infrastructure could be used for design in general. I'm following one or the other Free Software project where an incredible amount of discussions happen regarding work-flow and features. So much thought, so many decisions on details, but for the most part, the implementation is all that remains. But the research, concepts and conscious decisions regarding trade-offs could actually outlive any implementation, they are portable and could be argued to be more valuable. So funny as it might sound, there's a need for literate design! -- Thorsten Wilms thorwil's design for free software: http://thorwil.wordpress.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Literate Programming example
FYI: some time ago the Opensuse project used such a collaborative tool (http://www.co-ment.com) in order to get a shared mindset of its goals. This was the result, see how clicking on higlight words points to their comments: https://lite.co-ment.com/text/lNPCgzeGHdV/view/ On Sat, Nov 19, 2011 at 10:21 PM, Daniel Jomphe danieljom...@gmail.com wrote: With the tools available to us today, there's no reason why we at least shouldn't have everything needed to make literate programming more seamless, more natural. For example, while reading your toy example, I found myself wanting to ask a question or comment on your thoughts a few times. If your book had been displayed on a dynamic website geared towards literate programming, I might have been able to click on a paragraph and write my question/comment right there. And then, after a short conversation there, you would have integrated the fruits of our conversation directly into the end result. Thus each new reader would have been an occasion to improve the book. ...It's nothing surprising since this kind of review system already exists in some publishers' toolkits. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ANN: A new Clojure brush for syntax highlighter
On Sat Nov 19 13:46 2011, Andrew Brehaut wrote: I have written a new brush for the javascript Syntax Highlighter to replace sh-clojure. Rather than using the typical regex system, it has a full parser and simple form annotator. This should result in significantly better highlighting than earlier brushes. You can find the project at https://github.com/brehaut/inc-clojure-brush. It's running on my blog, frinstance http://brehaut.net/blog/2011/ring_introduction and http://brehaut.net/blog/2011/l_systems Key features: * The head of every list is handled as either a function or method call. No need for a list of clojure.core tokens. * Comments, (comment …), and #_ all supported. * Local variables in common core forms are highlighted. * Meta data and quoted forms have additional styling. Looks nice. I think I may just deprecate my project in favour of this one, especially since I don't really have the time to update it these days. One idea that just occurred to me is that there may be a chance to leverage ClojureScript for this. I am not a ClojureScript (or Javascript) expert, but it seems to me that using the ClojureScript reader could help. Nice work. Daniel Solano Gómez signature.asc Description: Digital signature
Static contract checking for Clojure?
I have been thinking about the discussion of queryable programs from Rich's keynote at Clojure Conj. This meaning of this idea is probably more well-defined for other people than it is in my present understanding, but my sense from the talk is that the analysis phase of compilation will leverage core.logic to infer facts about the program and find possible inconsistencies and problems, reporting them as warnings or errors. Yesterday I had an interesting conversation with a functional programmer who is more on the statically typed side of the fence, and I brought up this idea. He told me about some interesting research by Dana Xu on static contracts. Unlike standard (dynamic) contracts, which throw exceptions when the code is exercised at run-time, static contracts seem to be more along the lines of what Rich is talking about. See: http://gallium.inria.fr/~naxu/research/dana-phd.pdf What do you think about this idea? I have just started reading the above pdf... I don't see much of interest when googling for 'static contract Racket' but that would be a closer jump to Clojure if someone figured out how to do this in a Lisp. The Racket community seems the likeliest home for such research. Also, I'm curious to know what other concepts/techniques might be on the table in the plan for Clojure to surpass statically typed languages at their own game (to the extent that their game is all that relevant). Rob -- 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: Static contract checking for Clojure?
On Sun, Nov 20, 2011 at 11:53 AM, Robert Levy r.p.l...@gmail.com wrote: See: http://gallium.inria.fr/~naxu/research/dana-phd.pdf What do you think about this idea? I have just started reading the above pdf... I don't see much of interest when googling for 'static contract Racket' but that would be a closer jump to Clojure if someone figured out how to do this in a Lisp. The Racket community seems the likeliest home for such research. Also, I'm curious to know what other concepts/techniques might be on the table in the plan for Clojure to surpass statically typed languages at their own game (to the extent that their game is all that relevant). Rob That looks really interesting! http://code.google.com/p/jchord/ yet another interesting approach that uses Datalog to analyze Java programs. I think ClojureScript is a fantastic place to try these things out. Currently there's no good way to plug-in custom analysis. So a first step would probably be a design page on what that should look like. For example, it would be nice to be able to run the analyzer w/o compilation. A pluggable stand-alone analyzer would be a big step forward, even if you don't plan to use core.logic with it! However should you decide to use core.logic I think a pretty interesting contract/blame system could be built once we implement the cKanren extensions. David -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
ClojureScript deftype and extend-type differ
Hello all, I ran into an extend-type issue with the ClojureScript compiler output. If there's a better place to report such things, please point me there. If I define a protocol method with multiple arities, implementing it using deftype works as expected, however extend-type does not. The former compiles to a single javascript function, which checks argument length to handle arity. The latter produces two identically named functions, the second of which overwrites the first; hence only one arity is available at runtime. Here's a simplified example. Given a protocol: (defprotocol MyProtocol (something [this] [this x])) I would expect the following two code snippets to compile with functional equivalence. (deftype MyType [] MyProtocol (something [this] ... ) (something [this x] ... )) (deftype MyType []) (extend-type MyType MyProtocol (something [this] ... ) (something [this x] ... )) The former compiles 'something' to a single function. The latter compiles as: myns.MyType.prototype.myns$MyProtocol$ = true; myns.MyType.prototype.myns$MyProtocol$something = function(this$) { ... }; myns.MyType.prototype.myns$MyProtocol$something = function(this$, 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
Re: ClojureScript deftype and extend-type differ
Please open a ticket for this in JIRA, thanks - http://dev.clojure.org/jira/browse/CLJS David On Sun, Nov 20, 2011 at 12:33 PM, Jeff Valk jv-li...@tx.rr.com wrote: Hello all, I ran into an extend-type issue with the ClojureScript compiler output. If there's a better place to report such things, please point me there. If I define a protocol method with multiple arities, implementing it using deftype works as expected, however extend-type does not. The former compiles to a single javascript function, which checks argument length to handle arity. The latter produces two identically named functions, the second of which overwrites the first; hence only one arity is available at runtime. Here's a simplified example. Given a protocol: (defprotocol MyProtocol (something [this] [this x])) I would expect the following two code snippets to compile with functional equivalence. (deftype MyType [] MyProtocol (something [this] ... ) (something [this x] ... )) (deftype MyType []) (extend-type MyType MyProtocol (something [this] ... ) (something [this x] ... )) The former compiles 'something' to a single function. The latter compiles as: myns.MyType.prototype.myns$MyProtocol$ = true; myns.MyType.prototype.myns$MyProtocol$something = function(this$) { ... }; myns.MyType.prototype.myns$MyProtocol$something = function(this$, 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 post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ClojureScript deftype and extend-type differ
Issue opened: http://dev.clojure.org/jira/browse/CLJS-104. Cheers, Jeff -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ClojureScript deftype and extend-type differ
Thanks! Patches welcome as well :) David On Sun, Nov 20, 2011 at 2:07 PM, Jeff Valk jv-li...@tx.rr.com wrote: Issue opened: http://dev.clojure.org/jira/browse/CLJS-104. Cheers, Jeff -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Literate Programming example
On Sunday, November 20, 2011 5:50:31 AM UTC-5, thorwil wrote: I'm following one or the other Free Software project where an incredible amount of discussions happen regarding work-flow and features. So much thought, so many decisions on details, but for the most part, the implementation is all that remains. But the research, concepts and conscious decisions regarding trade-offs could actually outlive any implementation, they are portable and could be argued to be more valuable. You raised my curiosity. Would you mind sharing a link? ;) -- 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: Literate Programming example
On Sunday, November 20, 2011 6:17:13 AM UTC-5, robermann79 wrote: FYI: some time ago the Opensuse project used such a collaborative tool (http://www.co-ment.com) in order to get a shared mindset of its goals. This was the result, see how clicking on higlight words points to their comments: https://lite.co-ment.com/text/lNPCgzeGHdV/view/ Interesting. And funny, considering I bought the cochapter.com domain to do something similar. I'm yet to deliver the application that's planned to power that domain. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ClojureScript deftype and extend-type differ
The correct way to write this extend-type is (extend-type MyType MyProtocol (something ([this] 1) ([this x] x))) The version you posted doesn't work in JVM-Clojure either; I don't have CLJS handy, but I suspect that this version will work fine there. On Nov 20, 11:36 am, David Nolen dnolen.li...@gmail.com wrote: Thanks! Patches welcome as well :) David On Sun, Nov 20, 2011 at 2:07 PM, Jeff Valk jv-li...@tx.rr.com wrote: Issue opened:http://dev.clojure.org/jira/browse/CLJS-104. Cheers, Jeff -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Where can I inqure about bugs?
I am having a lot of trouble finding a place to mention a possible clojure bug. Is this it? I am trying to write a custom comparator, but the comparator never seems to work. I simplified the comparator below. user= (def stringComparator (comparator (fn [a b] (do (println (str comparing ' a ' to ' b ')) (.compareTo a b) #'user/stringComparator user= (.compare stringComparator b a) comparing 'b' to 'a' -1 user= (compare b a) 1 user= (clojure-version ) 1.3.0 Am I doing something wrong? -- 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: Probabilistic programming in clojure
Hello guys, I would like to try out this library, but ran into a problem with Clojure 1.3, 'lein repl' throws an exception, when: *user= (use 'probabilistic-clojure.monadic.demos)* *user= (test-mixture mixture-mem)* *Trying to find valid trace ...* *Starting MH-sampling.* *IllegalArgumentException No value supplied for key: 0.7 clojure.lang.PersistentHashMap.createWithCheck (PersistentHashMap.java:89)* I am a total beginner with Clojure, if you could provide a at least a hint of how to resolve this - I'd appreciate it. P.S. I am using the 1.3 branch by Jeff, that works with Leiningen. Thanks! - Julius On Sun, Nov 20, 2011 at 6:32 AM, Jeff Rose ros...@gmail.com wrote: Cool! I experimented a little bit with Church a while back, but having something like this in Clojure could be really interesting. I don't have much experience with sampling, but if I understand it correctly, your grass-is-wet demo is defining a belief network where each sample taken represents the complete state of the graph, or just the final outcome? What does a sample look like? It would be great if we could use this kind of generative model to create chord sequences, melodies, and rhythms for Overtone. I don't know what kinds of choice points would be appropriate, or if we could train them based on a database of existing progressions? -Jeff On Nov 18, 12:57 am, Nils Bertschinger nils.bertschin...@googlemail.com wrote: Hi everyone, inspired by the bher compiler for the probabilistic scheme dialect MIT Church, I have implemented a version of the probability monad which uses Metropolis Hastings to draw samples from runs of monadic programs. You can find the code on github: https://github.com/bertschi/ProbClojureNice. The monadic version is more a proof of principle and not very fast. It might nevertheless be useful, e.g. for educational purposes. Have a look and decide for yourself ... For the future, I'm working on a different approach to embed probabilistic operations into clojure which scales better and allows to run somewhat larger models. Any comments and feedback are welcome. Best, Nils -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Where can I inqure about bugs?
I think you might be using comparator incorrectly. It appears to expect a function that returns a true/false value: user (source comparator) (defn comparator Returns an implementation of java.util.Comparator based upon pred. {:added 1.0} [pred] (fn [x y] (cond (pred x y) -1 (pred y x) 1 :else 0))) So something like this might work: user (def string-comparator (comparator (fn [a b] (neg? (.compareTo a b) #'user/string-comparator user (string-comparator a b) -1 user (string-comparator b a) 1 user (string-comparator a a) 0 Doesn't seem very useful though. Regards, Stuart On 20 November 2011 14:28, Randy Pensinger rspensin...@gmail.com wrote: I am having a lot of trouble finding a place to mention a possible clojure bug. Is this it? I am trying to write a custom comparator, but the comparator never seems to work. I simplified the comparator below. user= (def stringComparator (comparator (fn [a b] (do (println (str comparing ' a ' to ' b ')) (.compareTo a b) #'user/stringComparator user= (.compare stringComparator b a) comparing 'b' to 'a' -1 user= (compare b a) 1 user= (clojure-version ) 1.3.0 Am I doing something wrong? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Where can I inqure about bugs?
On Sat, Nov 19, 2011 at 7:28 PM, Randy Pensinger rspensin...@gmail.com wrote: user= (def stringComparator (comparator (fn [a b] (do (println (str comparing ' a ' to ' b ')) (.compareTo a b) #'user/stringComparator The docs indicate comparator takes a predicate, i.e., a function that returns truthy or falsey. I changed your definition to this: (def stringComparator (comparator (fn [a b] (do (println (str comparing ' a ' to ' b ')) (neg? (.compareTo a b)) And that worked as expected: user (.compare stringComparator b a) comparing 'b' to 'a' comparing 'a' to 'b' 1 user (.compare stringComparator a a) comparing 'a' to 'a' comparing 'a' to 'a' 0 user (.compare stringComparator a b) comparing 'a' to 'b' -1 -- 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
Re: ClojureScript deftype and extend-type differ
Hi Alan, Good catch. This raises a question though: why do deftype and extend-type take subtly different forms for methods with multiple arities? ;; deftype only works like this: (foo [this] 1) (foo [this x] 2) ;; extend-type only works like this: (foo ([this] 1) ([this x] 2)) This seems a bit odd to me. Though for the record, both the clojure and clojurescript compilers behave the same, so there's no bug. I'll make a note on the JIRA ticket. Cheers, Jeff -- 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: Where can I inqure about bugs?
Yep, exactly what I did. Thank you all! On Nov 20, 4:32 pm, Sean Corfield seancorfi...@gmail.com wrote: On Sat, Nov 19, 2011 at 7:28 PM, Randy Pensinger rspensin...@gmail.com wrote: user= (def stringComparator (comparator (fn [a b] (do (println (str comparing ' a ' to ' b ')) (.compareTo a b) #'user/stringComparator The docs indicate comparator takes a predicate, i.e., a function that returns truthy or falsey. I changed your definition to this: (def stringComparator (comparator (fn [a b] (do (println (str comparing ' a ' to ' b ')) (neg? (.compareTo a b)) And that worked as expected: user (.compare stringComparator b a) comparing 'b' to 'a' comparing 'a' to 'b' 1 user (.compare stringComparator a a) comparing 'a' to 'a' comparing 'a' to 'a' 0 user (.compare stringComparator a b) comparing 'a' to 'b' -1 -- 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
Re: clj-time and clojure 1.3
Thanks. It would be nice if KirinDave id put a notice up. Also, it would be nice if when you search for clj-time and go to getwoven rather than 404-ing it pointed to your version. I have an idea. I notice that you have a pointer to Clojars under Installation. This seems like a nice standard for people to follow. You find the source of something which you try quickly this way. I think the reverse would be nice. If you find clj-time for example by going to Clojars first it would be nice if there was a pointer back to the source that was used to build the jar submitted to Clojars. - Brad On Nov 17, 12:48 pm, Sean Corfield seancorfi...@gmail.com wrote: On Wed, Nov 16, 2011 at 5:39 PM, Sean Corfield seancorfi...@gmail.com wrote: I have taken over clj-time from Mark McGranahan: https://github.com/seancorfield/clj-time (although github seems to be omitting the navigation bar on that repo - I'll open a support ticket). github fixed that problem - apparently it was a weird caching issue... Now if we can get KirinDave to put a notice on his repo saying mine's the master, given that in the absence of the getwoven repo, github now says mine's a clone of his, rather than the getwoven one... -- 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