Re: [PSA] Clojars scp disabled until further notice
Please count me in for $500 this month. Contact me off-list user d, domain athena dot com with info where I should send money. I ran the scala-tools.org Scala JAR repo for many years with the help of a few other folks. I understand the challenges of running a repo... the expectation that everything is done perfectly *and* that folks shouldn't have to pay for any of it. Happy to chat off-list about my experience and lend some insights that you may or may not find valuable. -- 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/d/optout.
Re: Weird core.async/ClojureScript not workings...
I continue to see the issue with 1878/0.1.0-SNAPSHOT, but when I rolled back to 1859, the issue went away. Thanks Keith! On Tue, Sep 17, 2013 at 6:42 AM, David Nolen dnolen.li...@gmail.com wrote: Works fine for me using core.async master. I just ran `lein install` from the core.async directory and changed project.clj core.async to: [core.async 0.1.0-SNAPSHOT] David On Mon, Sep 16, 2013 at 11:29 PM, Keith Irwin ke...@devtrope.com wrote: I'm having the same issue. Here's a project with a timeout loop demonstrating the problem: https://github.com/zentrope/clock Using core.async SNAPSHOT and any clojurescript release after 1859 seems to break along the same lines as the OP. Other elements I have going: - cljsbuild 0.3.3 - prismatic 0.1.2 but they don't seem to cause issues with 1859. If you've got any tips on using core.async master (maybe using lein's checkout feature?) I wouldn't mind trying that. On Sep 16, 2013, at 3:32 PM, David Nolen dnolen.li...@gmail.com wrote: Which versions of ClojureScript and core.async are you using? David On Mon, Sep 16, 2013 at 5:25 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Howdy, I'm using core.async and ClojureScript and it seems that inside a go block, if/when/loop/while code is never executed. For example: (def dog33 (go (if true (.log js/console it's true) (.log js/console it's false prints neither it's true nor it's false, but (def dog33 (go (do (.log js/console it's true) (.log js/console it's false prints both. I'm doing lein cljsbuild auto to generate the JavaScript. Any pointers would be appreciated. Thanks, David -- Brick Alloy http://brickalloy. https://telegr.am/ Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- -- 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. -- Brick Alloy http://brickalloy.com https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post
Weird core.async/ClojureScript issues
Howdy, I'm using core.async and ClojureScript and I'm running into a weird problem... basically if/when/loop constructs don't work anymore in go blocks in ClojureScript. For example: -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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.
Weird core.async/ClojureScript not workings...
Howdy, I'm using core.async and ClojureScript and it seems that inside a go block, if/when/loop/while code is never executed. For example: (def dog33 (go (if true (.log js/console it's true) (.log js/console it's false prints neither it's true nor it's false, but (def dog33 (go (do (.log js/console it's true) (.log js/console it's false prints both. I'm doing lein cljsbuild auto to generate the JavaScript. Any pointers would be appreciated. Thanks, David -- Brick Alloy http://brickalloy. https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Weird core.async/ClojureScript not workings...
[org.clojure/clojurescript 0.0-1878] [org.clojure/core.async 0.1.222.0-83d0c2-alpha] [[lein-cljsbuild 0.3.2]] On Mon, Sep 16, 2013 at 3:32 PM, David Nolen dnolen.li...@gmail.com wrote: Which versions of ClojureScript and core.async are you using? David On Mon, Sep 16, 2013 at 5:25 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Howdy, I'm using core.async and ClojureScript and it seems that inside a go block, if/when/loop/while code is never executed. For example: (def dog33 (go (if true (.log js/console it's true) (.log js/console it's false prints neither it's true nor it's false, but (def dog33 (go (do (.log js/console it's true) (.log js/console it's false prints both. I'm doing lein cljsbuild auto to generate the JavaScript. Any pointers would be appreciated. Thanks, David -- Brick Alloy http://brickalloy. https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- Brick Alloy http://brickalloy.com https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Multiple Clojure contexts in the same JVM
Sweet. Thanks! On Tue, Aug 20, 2013 at 3:51 PM, Toby Crawley t...@tcrawley.org wrote: David Pollak writes: I have an application where I need multiple independent Clojure contexts running in the same JVM. You can use ShimDandy[1] to load multiple Clojure runtimes in the same JVM, and call into those runtimes from Java. That's what Immutant[2] and the Clojure language module for Vert.x[3] use currently to achieve runtime isolation. One gotcha with loading multiple Clojure runtimes is memory leaks - if you intend to load and unload more than a couple of runtimes, you'll quickly exhaust permgen. The workaround there is to wait for Clojure 1.6.0 (assuming CLJ-1125[4] gets applied), or use a fork of Clojure that has the CLJ-1125 fixes in it[5]. The ShimDandy docs are completely non-existent at this point, but an example of usage is [6]. If you have interest in using it, I'm happy to help you get started, and to write some docs. [1]: https://github.com/projectodd/shimdandy [2]: http://immutant.org/ [3]: https://github.com/vert-x/mod-lang-clojure [4]: http://dev.clojure.org/jira/browse/CLJ-1125 [5]: https://clojars.org/org.clojars.tcrawley/clojure [6]: https://github.com/vert-x/mod-lang-clojure/blob/master/lang-module/src/main/java/io/vertx/lang/clojure/ClojureVerticleFactory.java -- Toby Crawley http://immutant.org | http://torquebox.org -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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.
Multiple Clojure contexts in the same JVM
Howdy, I have an application where I need multiple independent Clojure contexts running in the same JVM. I've played around with a custom classloader, but when I try to eval code (calling RT.eval.invoke via reflection), I wind up with: java.lang.ClassCastException: clojure.core$eval1 cannot be cast to clojure.lang.IFn It seems that someplace the clojure.lang.IFn interface is being loaded around my classloader. Can someone point me to a way to run multiple Clojure contexts in the same JVM? Thanks, David PS -- Interestingly, invoking RT.loadResourceScript via reflection works just fine... so my current workaround is to do that... but it's less than optimal. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Multiple Clojure contexts in the same JVM
Sean, Thanks for the response. The issues that I've come across using code similar to yours is that if there are two people sharing the same namespace, they will over-write each others' stuff. I guess I'll wait for 1.6 unless others have ideas. Thanks, David On Tue, Aug 20, 2013 at 1:55 PM, Sean Corfield seancorfi...@gmail.comwrote: Just FYI (and you probably already know this David), most of the clojure.lang.RT class is considered an implementation detail and is subject to change without notice. I believe 1.6 will bring a new API that is intended to provide a supported way to embed Clojure into JVM-based applications. Based on posts I've seen on the mailing lists from Clojure/core folks, I've restricted my use to just RT.var() and I load source files like this: RT.var( clojure.core, load ).invoke( filepath ); RT.var( my.namespace, my-fun ).invoke( 1, 2, 3 ); // (my.namespace/my-fun 1 2 3) RT.var( my.namespace, my-var ).deref(); // access my.namespace/my-var directly // same as (deref #'my.namespace/my-var) I haven't pushed too much at the boundaries of classloaders tho' so there may well be dragons there, but the above works for me for embedding Clojure in an existing JVM-based web application. Sean On Tue, Aug 20, 2013 at 1:35 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Howdy, I have an application where I need multiple independent Clojure contexts running in the same JVM. I've played around with a custom classloader, but when I try to eval code (calling RT.eval.invoke via reflection), I wind up with: java.lang.ClassCastException: clojure.core$eval1 cannot be cast to clojure.lang.IFn It seems that someplace the clojure.lang.IFn interface is being loaded around my classloader. Can someone point me to a way to run multiple Clojure contexts in the same JVM? Thanks, David PS -- Interestingly, invoking RT.loadResourceScript via reflection works just fine... so my current workaround is to do that... but it's less than optimal. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: core.async channel GUID
That's what I went with. Thanks! On Wed, Aug 7, 2013 at 4:47 PM, Brandon Bloom brandon.d.bl...@gmail.comwrote: You can emulate this relatively easily with a pair of serialize/deserialize functions which read/write to a global atom containing a map. On Wednesday, August 7, 2013 7:15:55 PM UTC-4, David Pollak wrote: Howdy, I'm working on bridging between core.async channels in the browser and on the server. It would be very useful to have a GUID associated with the channel so that when I serialize a message that contains a channel, I can send the GUID instead and on the other side, create a proxy channel so that the client or server and send a reply message to the channel and it will be sent over the wire. Would it be possible to add a GUID to the channel? Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: core.async channel GUID
And here's a blog post about it: http://blog.goodstuff.im/clojure_http_channels On Wed, Aug 7, 2013 at 4:47 PM, Brandon Bloom brandon.d.bl...@gmail.comwrote: You can emulate this relatively easily with a pair of serialize/deserialize functions which read/write to a global atom containing a map. On Wednesday, August 7, 2013 7:15:55 PM UTC-4, David Pollak wrote: Howdy, I'm working on bridging between core.async channels in the browser and on the server. It would be very useful to have a GUID associated with the channel so that when I serialize a message that contains a channel, I can send the GUID instead and on the other side, create a proxy channel so that the client or server and send a reply message to the channel and it will be sent over the wire. Would it be possible to add a GUID to the channel? Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Do you like the Clojure syntax?
A couple of quick reactions... The survey itself is too flat. It's like asking do you like red or green? Well... I like green on my walls, but I like red on my ties. Scala has macros and a much richer syntax (although doing anything like core.async with Scala macros might be like putting tabsco on an open cut... just sayin') so I don't think the syntax and the macro stuff is a one-to-one mapping. People learn to work with a variety of syntaxes and are successful with them. Java and C++ have viscously awful syntax, yet they are very popular and most users of the languages don't notice. Both C and Lisp model an abstract computer and have syntax that reflects the computer that they model and to my mind, that helps the user of each language grok the abstract computer they are programming. I'd like a two-way mapping between a Clojure and an Excel-like formula language. That way people could write one-liner Clojure functions in a syntax that non-programmers are already comfortable with. I'm noodling with something like that right now. I think Jay and Colin are saying something very, very important: Clojure feels uncomfortable until it feels very comfortable and then there's no going back. I am not yet comfortable with Clojure's syntax, but I totally appreciate it. But I'm doing work in Scala, Java, and Clojure all for pay all in the same week every week... and bouncing among all three makes getting comfortable with Clojure a little slow. Further, I fear (deeply... in my bones) that once I am comfortable with Clojure, doing Scala will be as disgusting as doing Java is after 7 years of Scala. :-( On Mon, Aug 12, 2013 at 12:52 AM, Răzvan Rotaru razvan.rot...@gmail.comwrote: Hi, I'm curious about the general opinion on the Clojure syntax, whether people actually like it or just use it because it provides macros. So I would like to ask you to participate in a poll. Thank You. Here's the link: https://docs.google.com/forms/d/1GSgfkeThpUYlgFVzhhNIgA1JbTilu6S9eudq_Sbxl34/viewform Răzvan -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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.
core.async channel GUID
Howdy, I'm working on bridging between core.async channels in the browser and on the server. It would be very useful to have a GUID associated with the channel so that when I serialize a message that contains a channel, I can send the GUID instead and on the other side, create a proxy channel so that the client or server and send a reply message to the channel and it will be sent over the wire. Would it be possible to add a GUID to the channel? Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: RPC over channels
This is a tough and interesting issue. Let's put aside the whole RPC issue for a moment and look at how code progressed from C-land to Java-land. In C, the developer had to check return values from function calls to see if the function succeeded. That led to ignoring return values or testing with a nested block of code: if (succeeded(open_file(name, file_struct))) { if (succeeded(do_something_else(...))) { do work; } else { close resources; release memory; return error; } } else { close resources; release memory; return error;} Java improved on this with exceptions and garbage collection: try { File f = open_file(name); try { Something s = do_something_else(...) } finally { close f; } catch (...) { // handle inner and outer errors } Add ARM (automatic resource management) and you have something that looks a lot like a supervisor in Erlang (in my opinion)... basically you run all your code and the exception handlers handle the exceptional situations. So, this works for both local calls and remote calls (putting aside the marshalling of parameters and state across address spaces) as long as the number of threads of execution can be handled by the runtime/operating system. But in the JVM, we can no longer build systems that cause threads to block on the execution of off-process code because we will need a lot more threads than the OS (because the JVM is native threaded and can have about 4K threads) can provide. This is where core.async is particularly nice (it's double extra nice in JavaScript-land where there's only 1 thread, so blocking is verboten). Basically, rather than having nested call-back functions (like our C-style nested if statements), core.async re-writes the code such that where there are blocking calls to a channel, the code is re-written so that it is in effect a series of call-backs, but the code that the developer writes is linear. Put another way, core.async gives us the syntax of a normal flow, but with the performance of releasing the thread until a result is available and then continuing the logical computation. I think the idea of extending the ideas in core.async to accessing remote systems makes a lot of sense. Call it RPC. Call it something else... but it's the same concept... you give the developer linear looking code that does the right thing with off-process calls. The right thing being releasing the current JVM thread until the answer comes back, dealing correctly with timeouts, and correctly handing failures by releasing resources as well as invoking appropriate exception handling code (supervisor?). If we don't have a nice layer like this, we're stuck writing code like: (let [v (alt! (some_call_to_external_system_that_returns a channel) (timeout 1000))] (if (not (timeout? v)) (do something with v) (raise error))) Where we are repeating the boilerplate of timeouts and we probably have to test v against nil (the channel is closed) and exceptions. Instead, if we have: (rpc #(handle_error %) 1000 ;; default timeout (let [v call_to_external_system] (do something with v))) And we do the same deep walking with the rpc macro that's done with the go macro so we identify all the remote calls and turn them into the go-based code with alt! and the timeout boilerplate. And then we've got a nice rpc system layered on top of core.async that has default timeouts... and if rpc supports nesting, then we can tune the timeout for a given call. So, I think the concepts and the code in core.async lend themselves directly to building an rpc-style system where the boilerplate for dealing with invoking off-process resources and getting the results from these off-process resources with correct timeout, exception handling, and resource release. On Fri, Aug 2, 2013 at 6:46 AM, Timothy Baldridge tbaldri...@gmail.comwrote: RPC ties a local process (and all the memory its currently using) to a remote process. It glosses over the fact that that the link between these two processes is quite unreliable. In his thesis, Joe Armstrong also points that this system is not only susceptible to hardware/network failure, it's also very susceptible to programming failures. A bug in your code could cause every 100th RPC call to fail, for example. So instead of all of this, Erlang (or actually Erlang's OTP libraries) proposes a different view: 1) all messages are sent async and unreliable. This is the way networks are designed anyways, if you sent a message to a remote system and it gets thrown into a queue, you really don't know what happens to that message in the end, except by asking the remote system again, and again until you finally get an ACK. 2) If we follow the above model, then we can start programming in a fail-fast mode. This is what OTP is based on. Supervisor processes that reset dead sub processes. This is also why I'm not a fan of populating error messages across channels. Instead, errors should kill go blocks, and then those blocks
Re: core.async JAR
I've found the core.async files are in snapshots... this line in project.clj works for me: :repositories {sonatype-oss-public https://oss.sonatype.org/content/repositories/snapshots/} On Fri, Jul 5, 2013 at 12:24 AM, James Reeves ja...@booleanknot.com wrote: On 4 July 2013 15:20, pmf phil.fr...@gmx.de wrote: Is there a prebuilt binary JAR of core.async available somewhere? I did not find it on Clojars. If you want it as a dependency, add the following repository to your project file: :repositories {sonatype-oss-public https://oss.sonatype.org/content/groups/public/} And then add the dependency: [org.clojure/core.async 0.1.0-SNAPSHOT] - James -- -- 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: How to implement a distributed and concurrent system in Clojure?
Please keep in mind that Scala's Actor Model is a very thin piece of code that is not inherently distributed. There are a ton of issues in Scala related to crossing address spaces. Scala is not nearly as biased to immutability as Clojure. Sure, there are case classes, but case classes can easily contain mutable data. When I wrote Goat Rodeo (http://goatrodeo.org), I wrote a compiler plugin that guaranteed immutability and serializability of the data structures used for Goat Rodeo's Actor-based messaging... and this lead to the second issue... Having a class-based design means that one has to deal with serializing/deserializing class-based data structures. This is a huge problem. It means that the inter-process data structures must contain class signatures... and for distributed systems that are going to have 100% uptime, that means version and class signatures so that a message sent from a version 1 system can be deserialized on a version 2 system even if the class has changed. Long story short... Akka, the only popular distributed system in Scala, is marginally better than RMI/J/EE, so for enterprise java shops, it's great (much like Spring was.) But it's not something to aspire to. If I get some time, I'll work on a distributed version of core.async. The only real challenge I can see is marshalling a Channel identifier across address spaces. Everything else should be a walk in the park. On Wed, Jul 3, 2013 at 5:26 PM, Hussein B. hubaghd...@gmail.com wrote: Hi, I read recently on the internet that Clojure concurrency tools make it easy to implement a highly concurrent system but on a single machine. But how to implement a highly concurrent system that runs on a multiple machines? Erlang, Elixir and Scala have the Actors model. Please correct me if I'm wrong. Thanks for help and 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. -- -- 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: core.async
On Sun, Jun 30, 2013 at 3:00 AM, Brandon Bloom brandon.d.bl...@gmail.comwrote: I don't think it's published to a maven repository yet. You can check it out, install it with `lein install`, then depend on it via [core.async 0.1.0-SNAPSHOT] Thanks! I flew over to China (from SFO) and played with core.async on the way over. OMG... it's just totally amazing... both at the conceptual level and at the execution level (okay, I haven't instrumented it, but some of the basic games I've been playing with it have been spectacular.) I've thrown a challenge to the Lift community to build something like it in Scala while I am traveling in July... but I think in a language without full macro support, it will be very difficult. The original (now dead) Scala Actor implementation tried to do continuations (which is what you need to make 'go' work without blocking a thread while waiting on channels), but failed in the execution (lots of exceptions for flow of control, lots of nasty limitations that were not compiler enforced... and when you're dealing with a statically typed language, the compiler should enforce the rules). Anyway, the core.async stuff is really, really nice. Hats off and a huge way to go, dudes! to the team that made it happen. Looking forward to it being published (even as SNAPSHOT) in a Maven repo. Rock on! On Sat, Jun 29, 2013 at 2:50 PM, David Pollak dpollak...@gmail.comwrote: What's the entry in project.clj to use the core.async stuff? Thanks! On Sat, Jun 29, 2013 at 9:44 AM, Joseph Smith j...@uwcreations.comwrote: It seems to me that the Clojure space suffers from an unusual malady: it's busy sitting here quietly advancing half of applied computer science, and no one seems to notice the full extent of its import. And it makes me sound like a broken record with my colleagues: Oh! Clojure has... --- Joseph Smith @solussd On Jun 29, 2013, at 6:07 AM, Peter Taoussanis ptaoussa...@gmail.com wrote: Oh man, how is everyone _not_ running around screaming about this right now? It seems to me that the Clojure space suffers from an unusual malady: it's busy sitting here quietly advancing half of applied computer science, and no one seems to notice the full extent of its import. Man, I'm sometimes forced to just stop for a moment and sit in awe at how lucky I've been to see this stuff develop and to get to use it. Clojure was huge. And before we're close to digesting its potential, there's protocols. And Clojurescript. Then Datomic. Reducers. Now this. And it's not about everything being necessarily _novel_, though there is often novelty. For me it's largely about the cohesiveness of the design and the consistency of the overarching vision. Everything _fits_. I feel like I'm using tools and ideas that weren't just developed with care, or cleverness, or experience, but all of those things in a kind of harmony that's vanishingly rare to find in any field. I honestly feel like I'm witnessing history being made. Thank you Rich Hickey, and everyone else in this community for making my work every day so enjoyable. - Peter Taoussanis -- -- 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
Offline Clojure docs
Folks, Is there an offline package of Clojure docs (the full core.* api docs, cheat sheets, etc.)? I'm traveling with intermittent Internet connectivity (I'm in China now and it's marginal but I'm going to the UP in Michigan where there's no Internet within 15 miles of where I'm staying). With all the travel and flying and such, it'd be great to have all the docs without having to clone all the various source repositories. Thanks for your help. 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 --- 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: Microsoft Rx -style operations with core.async
On Mon, Jul 1, 2013 at 7:46 AM, Brandon Bloom brandon.d.bl...@gmail.comwrote: Two bits of core.async feedback: 1) The (let [c chan] (go ...) c) pattern is *extremely-common*. Might be nice to have something like (go-as c ...) that expands to that pattern. 2) It's somewhat annoying to always have to consider boolean false all the time. Since nil signifies a closed channel, if, when, if-let, and when-let are extremely convenient. Unfortunately, they are subtly bugged! You need nil? checks everywhere, cluttering up relatively nice code. It'd be really nice to have a closed token that one could construct a channel with so the token could be at the app level... although I guess this wouldn't deal with the if-let/when-let issue. On Sun, Jun 30, 2013 at 5:27 PM, Brandon Bloom brandon.d.bl...@gmail.comwrote: Hi all, Today, primarily for my own edification, I've been implementing as many Microsoft Reactive Extensions operators as I can using core.async. The results have been *spectacular*. core.async is an absolute pleasure to work with. I'm so happy with how they have turned out, that I really want to share. You can find my work-in-progress here: https://github.com/brandonbloom/asyncx The primary file of interest is: https://github.com/brandonbloom/asyncx/blob/master/src/asyncx/core.clj At the time of this message, I've implemented the bulk of the relevant operators described here: http://msdn.microsoft.com/en-us/library/hh242961(v=vs.103).aspx All of my implementations utilize parking operations, so this library should be fully portable to ClojureScript. My notes describe any difference from Rx, notable omissions, and known issues: https://github.com/brandonbloom/asyncx/blob/master/notes I'll probably work more on this tonight and will update my notes as I go. Rich team: I understand that you guys will probably take a run at implementing this sort of library in the not too distant future. Please let me know if and how I can contribute to that effort. Cheers, Brandon -- -- 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/L4nEVho555k/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. -- -- 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: Offline Clojure docs
Thanks everyone for the super helpful suggestions! On Mon, Jul 1, 2013 at 9:04 AM, Mark Engelberg mark.engelb...@gmail.comwrote: Download here: https://github.com/clojure/clojure/tree/gh-pages -- -- 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: core.async
Thanks! On Mon, Jul 1, 2013 at 8:13 AM, Sean Corfield seancorfi...@gmail.comwrote: On Sun, Jun 30, 2013 at 4:42 PM, David Pollak dpollak...@gmail.com wrote: Looking forward to it being published (even as SNAPSHOT) in a Maven repo. It's accessible like this: (defproject async 0.1.0-SNAPSHOT :description FIXME: write description :url http://example.com/FIXME; :license {:name Eclipse Public License :url http://www.eclipse.org/legal/epl-v10.html} :repositories {sonatype-oss-public https://oss.sonatype.org/content/groups/public/} :dependencies [[org.clojure/clojure 1.5.1] [org.clojure/core.async 0.1.0-SNAPSHOT]]) -- 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: core.async
What's the entry in project.clj to use the core.async stuff? Thanks! On Sat, Jun 29, 2013 at 9:44 AM, Joseph Smith j...@uwcreations.com wrote: It seems to me that the Clojure space suffers from an unusual malady: it's busy sitting here quietly advancing half of applied computer science, and no one seems to notice the full extent of its import. And it makes me sound like a broken record with my colleagues: Oh! Clojure has... --- Joseph Smith @solussd On Jun 29, 2013, at 6:07 AM, Peter Taoussanis ptaoussa...@gmail.com wrote: Oh man, how is everyone _not_ running around screaming about this right now? It seems to me that the Clojure space suffers from an unusual malady: it's busy sitting here quietly advancing half of applied computer science, and no one seems to notice the full extent of its import. Man, I'm sometimes forced to just stop for a moment and sit in awe at how lucky I've been to see this stuff develop and to get to use it. Clojure was huge. And before we're close to digesting its potential, there's protocols. And Clojurescript. Then Datomic. Reducers. Now this. And it's not about everything being necessarily _novel_, though there is often novelty. For me it's largely about the cohesiveness of the design and the consistency of the overarching vision. Everything _fits_. I feel like I'm using tools and ideas that weren't just developed with care, or cleverness, or experience, but all of those things in a kind of harmony that's vanishingly rare to find in any field. I honestly feel like I'm witnessing history being made. Thank you Rich Hickey, and everyone else in this community for making my work every day so enjoyable. - Peter Taoussanis -- -- 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: [ClojureScript] ANN: core.match 0.2.0-beta2
Awesome! On Mon, Jun 17, 2013 at 1:04 AM, David Nolen dnolen.li...@gmail.com wrote: At long last I've come around to overhauling core.match. Changes/Fixes/Enhancements are documented here: http://github.com/clojure/core.match/blob/master/CHANGES.md core.match should no longer have AOT issues as far as I know and many long outstanding bugs have been eliminated. The ClojureScript support is now more or less at parity with Clojure JVM. Less obvious - because of the overhaul, addressing issues should now be considerably simpler. Feedback very welcome and I promise to be more responsive on core.match issues moving forward :) http://github.com/clojure/core.match David -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups ClojureScript group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescr...@googlegroups.com. Visit this group at http://groups.google.com/group/clojurescript. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: license of Javascript files generated by Clojurescript?
The license of the JavaScript generated by the ClojureScript compiler is the license of the source code that was compiled. And that license may be my company owns it and it's proprietary and we're not licensing it to anyone else. Even the FSF does not assert a GPL over code compiled by GCC even though GCC is GPL. Compiling code is not linking as per the GPL. Linking to a library is linking and that's why there's the LGPL... allowing non-free software to link to the library. With all this being said, the only thing you have to worry about is if you make a change to the ClojureScript compiler itself or another Clojure-related library. Those are licensed under the EPL which requires that you make open the changes you make to EPL code. Does that help? On Wed, Jun 12, 2013 at 5:06 AM, PTCMHB phuthuycuoimayhut...@gmail.comwrote: Hi all, Sorry if this question is too silly: in EPL's FAQ[1], number 26: *Some free software communities say that linking to their code automatically means that your program is a derivative work. Is this the position of the Eclipse Foundation?* ** No, the Eclipse Foundation interprets the term derivative work in a way that is consistent with the definition in the U.S. Copyright Act, as applicable to computer software. Therefore, linking to Eclipse code might or might not create a derivative work, depending on all of the other facts and circumstances. can somebody tell me at a very basic level: when the javascript files generated by Clojurescript considered a derivative work? If so, is having a webapp on the Internet considered distribution in compiled form? [1]: http://www.eclipse.org/legal/eplfaq.php -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: license of Javascript files generated by Clojurescript?
Unless one of the folks working on ClojureScript says otherwise, I would find it a real difficult interpretation of the EPL as applied to ClojureScript to be more restrictive than the GPL. On Wed, Jun 12, 2013 at 2:29 PM, PTCMHB phuthuycuoimayhut...@gmail.comwrote: Thanks David, I was confused because when using clojurescript we can't avoid using functions from core libraries and after compiled down to javascript, (parts of) those functions will appear on the final javascript file. So those clojurescript-origin compiled forms are considered unmodified libraries which are allowed to re-distributed by EPL. -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: idiot question about macros
Ben, Thanks for the feedback... and I'm sorry it to so long to say thanks (I've been traveling). In terms of the lack of being hygienic, I discuss that in the next paragraph in the blog post the OP took the macro from. But I really appreciate your thoughts on error messages. As I develop macros, I'll work hard to make sure the end users (who may not be me) get better feedback. Rock on. David On Fri, Jun 7, 2013 at 4:43 PM, Ben Wolfson wolf...@gmail.com wrote: On Fri, Jun 7, 2013 at 12:30 PM, David Pollak feeder.of.the.be...@gmail.com wrote: On Fri, Jun 7, 2013 at 11:14 AM, Ben Wolfson wolf...@gmail.com wrote: The macro (which IMO is terrible and shouldn't be emulated) Why do you think the macro is terrible? It's unnecessarily unhygienic: user (require '[clojure.core.match :refer [match]]) nil user (defmacro match-func [ body] `(fn [~'x] (match [~'x] ~@body))) #'user/match-func user ((match-func [s] x) 1) 1 user ((match-func [[q s]] [q s]) [1 2]) [1 2] user ((match-func [[q x]] [q x]) [1 2]) nil user Proper use requires knowing how it's implemented, and its error messages are opaque: user (match-func [a s] s) CompilerException java.lang.AssertionError: Pattern row 1: Pattern row has differing number of patterns. [a s] has 2 pattern/s, expecting 1 for occurrences [x], compiling:(NO_SOURCE_PATH:1) It wouldn't be hard to catch that error and alert the user before passing it on to core.match/match. (Though, to be fair, lots of clojure macros seem to take the view that enforcement of proper syntax is someone else's problem.) (I also favor More Parens for grouping purposes; I think it's ugly and hard to read when you write (match-func pattern1 action1 pattern2 action2) and have them all mixed up together like that. But that also applies to core.match itself, so. I will say that insofar as this is a macro for defining functions, it would be better if the actions to be taken on successful matches were wrapped in implicit dos, which is something that's only possible if the pattern row/action pairs are themselves delimited by parens or something paren-like.) -- Ben Wolfson Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drinks for pleasure. [Larousse, Drink entry] -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: idiot question about macros
On Fri, Jun 7, 2013 at 11:14 AM, Ben Wolfson wolf...@gmail.com wrote: On Fri, Jun 7, 2013 at 11:09 AM, larry google groups lawrencecloj...@gmail.com wrote: I am very stupid and I am having trouble figuring out how to read this: (defmacro match-func [ body] `(fn [~'x] (match [~'x] ~@body))) ((match-func [q :guard even?] (+ 1 q) [z] (* 7 z)) 33) ;; 231 What? Why 231? Because 7 * 33 = 231. The macro (which IMO is terrible and shouldn't be emulated) Why do you think the macro is terrible? creates a function of one argument that matches its argument with match/action expressions given in its invocation. So (match-func [q :guard even?] (+1 q) [z] (* 7 z)) expands into (fn [x] (match [x] [q :guard even?] (+ 1 q) [z] (* 7 z))) i.e., match the argument with q if it's even and return (+ 1 q); otherwise, match it with z and return (* 7 z). Since 33 is odd, you get 231. In general, using macroexpand-1 is very useful for figuring out what's happening with a macro. The article is here: http://java.dzone.com/articles/my-first-clojure-macro I especially struggle with the longer version: (defmacro match-pfunc [ body] Create a partial function that does pattern matching. (let [rewrite (mapcat (fn [x] [(first x) true]) (partition 2 body))] `(fn ([x#] (match [x#] ~@body)) ([x# y#] (cond (= :defined? x#) (match [y#] ~@rewrite) (= :body x#) '(~@body)) The article says: What this gives us is a function than can be invoked with a single parameter: (pf 44) And it can be invoked with 2 parameters: (pf :defined? 44) I keep looking at these 2 lines thinking maybe they reveal how different parameters cause a different action to be triggered, but I am unable to make sense of it: `(fn ([x#] (match [x#] ~@body)) ([x# y#] The anonymous fn is simply being returned? Is it returned at compile time, or run 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. -- Ben Wolfson Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drinks for pleasure. [Larousse, Drink entry] -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Why the CLR languages fail?
On Wed, Jun 5, 2013 at 11:55 PM, Zed Becker zed.bec...@gmail.com wrote: Why do the languages running on the CLR (ironRuby, ironPython, ironScheme, ScalaCLR) FWIW -- Scala on the CLR has always been a Microsoft funding issue. When Martin's lab got a grant for ScalaCLR, it did the work. When the funding went away, the work stopped. There was never a large pull to Scala on the CLR and given F# on the CLR, there was never any need for Scala on the CLR. do not get to live long enough in the sunshine, whereas same languages get embraced by the Java runtime, and live in the limelight? Chas did a survey in 2012, which gave very negative results for clojureCLR, with 70% people having no motivation to even play with it, and almost no production use. How can ClojureCLR be protected from dwindling? -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Making things go faster
Folks, I'm skipping Midge for the time being. I've written up a little more on my environment for other newbies: http://blog.goodstuff.im/clojure_setup I plan to read more of Chas' book on my NYC flight on Saturday. Thanks, David On Wed, Jun 5, 2013 at 2:44 AM, Chas Emerick c...@cemerick.com wrote: Hi David, It's odd/interesting that you're finding yourself restarting the JVM regularly. For many years, I've developed Clojure with very rare restarts; especially if my baseline project configuration is stable, I often have REPL sessions that last days. (Random thought: it'd be cute if various development environments regularly plinged `(.. java.lang.management.ManagementFactory getRuntimeMXBean getUptime)` so as to show uptime of your REPL/runtime.) Stuart's clojure.tools.namespace patches over a couple of long-standing trapdoors around code loading, but I've always preferred simply loading files/expressions into the REPL, much as we described in the 'REPL-oriented Programming' chapter in the book. I generally prefer to have as complete an understanding as possible of what's being loaded / being done to my REPL, and so various automated tools have never appealed to me. As for testing, I've always used `clojure.test`, so re-running tests after changing them or the code under test has always been just a `(test-ns *ns*)` away. This was actually a primary objective of mine in porting `clojure.test` to [clojurescript.test]( https://github.com/cemerick/clojurescript.test), which carries forward all of the former's dynamic-runtime facilities like `test-ns` and `run-all-tests`, despite the lack of first-class namespaces and the static nature of ClojureScript compilation and Closure optimization. In any case, whatever you do, any workflow that results in your bouncing the JVM is a broken one, and any tools/libraries/frameworks/whatever that push you in that direction are to be avoided IMO. Cheers, - Chas On Jun 4, 2013, at 4:51 PM, David Pollak wrote: Folks, I've been doing Clojure coding for the last couple of weeks and really love the language... and the community is fantastic. But the development cycle is slow. I'm coming from mostly Scala and a little Java. In Java, there's no REPL or anything... but the compile/test cycle is very fast. So, I can make a few changes to code, type mvn test and see the results typically in less than 2 seconds (my MacBook Pro and my Linux desktop). In Scala, the compile cycles are slower than in Java because the Scala compiler is doing a whole ton more. But in sbt (Simple [ha ha] Built Tool), one is always building/testing in the same JVM instance so the JVM is warmed up. A change code and run tests cycle is typically as fast as it is in Java. For example, Changing something significant in the net.liftweb.util package and doing a recompile and test takes about 9 seconds. This is running 450 tests. My Clojure development cycle is much slower. On my MacBook Pro (3rd gen i7 quadcore processor, 16GB of ram), each time I make a change and re-run the test for Plugh ( https://github.com/projectplugh/plugh ) it takes about 20 second and there are only 4 tests. On my desktop Linux box (i7-3770 with 32gb of RAM) it takes about 4 seconds to run the 4 tests. I also ran stuff on a very old ThinkPad (core 2 duo with 4GB ram running Linux Mint 15) and the test cycle takes 12 second. So... the questions: * Is there a faster cycle than to change code, change tests and type lein test to see the results? * Is there a way to keep everything in a hot JVM (I've done a little research on Nailgun... but it seems to be out of vogue) so there's no JVM start-up penalty? * Is there a reason for the huge disparity between my MacBook Pro and my desktop box? Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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
core.match -- adding extractors?
Howdy David Co., One of the *really* nice things about Scala's pattern matching is the ability to extend pattern matching using extractors. The research is presented in http://lampwww.epfl.ch/~emir/written/MatchingObjectsWithPatterns-TR.pdf The practical aspects allow testing and transforming at pattern matching time. For example: object AsInt { def unapply(in: String): Option[Int] = try {Some(in.toInt)} catch {case e: Exception = None} } foo match { case AsInt(number) = number + 1 case _ = 0 } More importantly, one can use extractors to test external things: object AsJsonFile { def unapply(fileName: String): Option[JSON] = ... // find the file, load it and parse it as JSON } What are your thoughts on adding extractors to the pattern matcher? Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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.
Making things go faster
Folks, I've been doing Clojure coding for the last couple of weeks and really love the language... and the community is fantastic. But the development cycle is slow. I'm coming from mostly Scala and a little Java. In Java, there's no REPL or anything... but the compile/test cycle is very fast. So, I can make a few changes to code, type mvn test and see the results typically in less than 2 seconds (my MacBook Pro and my Linux desktop). In Scala, the compile cycles are slower than in Java because the Scala compiler is doing a whole ton more. But in sbt (Simple [ha ha] Built Tool), one is always building/testing in the same JVM instance so the JVM is warmed up. A change code and run tests cycle is typically as fast as it is in Java. For example, Changing something significant in the net.liftweb.util package and doing a recompile and test takes about 9 seconds. This is running 450 tests. My Clojure development cycle is much slower. On my MacBook Pro (3rd gen i7 quadcore processor, 16GB of ram), each time I make a change and re-run the test for Plugh ( https://github.com/projectplugh/plugh ) it takes about 20 second and there are only 4 tests. On my desktop Linux box (i7-3770 with 32gb of RAM) it takes about 4 seconds to run the 4 tests. I also ran stuff on a very old ThinkPad (core 2 duo with 4GB ram running Linux Mint 15) and the test cycle takes 12 second. So... the questions: * Is there a faster cycle than to change code, change tests and type lein test to see the results? * Is there a way to keep everything in a hot JVM (I've done a little research on Nailgun... but it seems to be out of vogue) so there's no JVM start-up penalty? * Is there a reason for the huge disparity between my MacBook Pro and my desktop box? Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: core.match -- adding extractors?
On Tue, Jun 4, 2013 at 2:12 PM, David Nolen dnolen.li...@gmail.com wrote: I've looked at extractors a little bit, but I would need to investigate further. Does this offer any more power than supporting arbitrary function application in patterns? The only advantage to function application is that you could conceivably memoize the results of the unapply because they are not supposed to be side-effecting. Also, I'm unlikely to dive into any feature addition related issues until all these pressing bugs in JIRA are squashed. No worries. I will not open a ticket at this time. I just want to put the idea out there. On Tue, Jun 4, 2013 at 4:17 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Howdy David Co., One of the *really* nice things about Scala's pattern matching is the ability to extend pattern matching using extractors. The research is presented in http://lampwww.epfl.ch/~emir/written/MatchingObjectsWithPatterns-TR.pdf The practical aspects allow testing and transforming at pattern matching time. For example: object AsInt { def unapply(in: String): Option[Int] = try {Some(in.toInt)} catch {case e: Exception = None} } foo match { case AsInt(number) = number + 1 case _ = 0 } More importantly, one can use extractors to test external things: object AsJsonFile { def unapply(fileName: String): Option[JSON] = ... // find the file, load it and parse it as JSON } What are your thoughts on adding extractors to the pattern matcher? Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Making things go faster
Thanks for pointing me in the right direction. I did a quick blog post to help other newbies: http://blog.goodstuff.im/clojure_workflow On Tue, Jun 4, 2013 at 1:54 PM, Tim Visher tim.vis...@gmail.com wrote: On Tue, Jun 4, 2013 at 4:51 PM, David Pollak feeder.of.the.be...@gmail.com wrote: So... the questions: * Is there a faster cycle than to change code, change tests and type lein test to see the results? * Is there a way to keep everything in a hot JVM (I've done a little research on Nailgun... but it seems to be out of vogue) so there's no JVM start-up penalty? * Is there a reason for the huge disparity between my MacBook Pro and my desktop box? http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded Seems relevant. :) I don't have time to write it down, but much of what you're doing isn't very idiomatic and there's vast opportunities for improvement. Someone'll let you know. :) -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Future/Promise and not using threads
Okay... I wrote my own: https://github.com/projectplugh/plugh/blob/master/src/plugh/util/misc.clj#L51 One can register for on-done and on-fail. I'll work on adding fail-fast and also map (so one can transform the future and execute code when the transformed future has been realized/delivered/finished). Thanks for your help! On Thu, May 30, 2013 at 2:17 AM, Gary Trakhman gary.trakh...@gmail.comwrote: by the second future, I mean an instance of http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html , which just has to conform to the interface, and doesn't actually have to execute on a different thread. Clojure's 'future' function returns an instance of one of these that uses the unbounded agent thread-pool, but you would be free to return one using reify or something. https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6320 On Thu, May 30, 2013 at 5:14 AM, Gary Trakhman gary.trakh...@gmail.comwrote: Maybe an easy solution: wrap the first future in another future that blocking-derefs, then performs your extra computation? Do an extra 'realized?' check for the optimization you mention. That would still consume threads in the case that it's not realized, but I think it gets you what you want. On Thu, May 30, 2013 at 5:09 AM, Mark Engelberg mark.engelb...@gmail.com wrote: According to this article, Clojure does not yet have this facility: http://java.dzone.com/articles/promises-and-futures-clojure This is something that is being worked on and discussed, though: http://dev.clojure.org/display/design/Promises https://groups.google.com/forum/#!topic/clojure-dev/7BKQi9nWwAw/discussion http://dev.clojure.org/display/design/Async+blocks I've been hearing a lot about Tellman's lamina library as a rich Clojure toolset for working with asynchronicity. I haven't had a need for it myself, but you might want to check it out and see if it has relevance to what you 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. -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Future/Promise and not using threads
Paul, Thanks... but I want the opposite of delay. Basically, I do not want to consume a thread waiting for a Future to be satisfied. I want to continue a computation on a different thread once the Future/Promise is satisfied. Why? Think of a web app that's serving either a long poll or a web socket. Basically, you don't want to consume a thread waiting for some computation to take place. Rather, you want the computation to take place and then for the computation of sending the result to continue/resume once the computation has completed. Futures/Promises are excellent vehicles for this, especially when functions close over local scope and most of the local scope is persistant) and we use them extensively in Lift-land. I will move a lot of the stuff I've developed in Lift-land over to Clojure as many of the constructs will, I believe, play as well on Clojure as they do on Scala. Thanks, David On Thu, May 30, 2013 at 12:36 PM, Paul deGrandis paul.degran...@gmail.comwrote: I'm not entirely sure what you're trying to accomplish in a larger context, but perhaps you're looking for something like this? (delay (deref (future (and (Thread/sleep 2000) (+ 1 2) ... or maybe you want just `delay` Cheers, Paul On Thursday, May 30, 2013 6:09:02 AM UTC-7, David Pollak wrote: Okay... I wrote my own: https://github.com/**projectplugh/plugh/blob/** master/src/plugh/util/misc.**clj#L51https://github.com/projectplugh/plugh/blob/master/src/plugh/util/misc.clj#L51 One can register for on-done and on-fail. I'll work on adding fail-fast and also map (so one can transform the future and execute code when the transformed future has been realized/delivered/finished). Thanks for your help! On Thu, May 30, 2013 at 2:17 AM, Gary Trakhman gary.t...@gmail.comwrote: by the second future, I mean an instance of http://docs.oracle.com/** javase/6/docs/api/java/util/**concurrent/Future.htmlhttp://docs.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html , which just has to conform to the interface, and doesn't actually have to execute on a different thread. Clojure's 'future' function returns an instance of one of these that uses the unbounded agent thread-pool, but you would be free to return one using reify or something. https://github.com/clojure/**clojure/blob/master/src/clj/** clojure/core.clj#L6320https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6320 On Thu, May 30, 2013 at 5:14 AM, Gary Trakhman gary.t...@gmail.comwrote: Maybe an easy solution: wrap the first future in another future that blocking-derefs, then performs your extra computation? Do an extra 'realized?' check for the optimization you mention. That would still consume threads in the case that it's not realized, but I think it gets you what you want. On Thu, May 30, 2013 at 5:09 AM, Mark Engelberg mark.en...@gmail.comwrote: According to this article, Clojure does not yet have this facility: http://java.dzone.com/**articles/promises-and-futures-**clojurehttp://java.dzone.com/articles/promises-and-futures-clojure This is something that is being worked on and discussed, though: http://dev.clojure.org/**display/design/Promiseshttp://dev.clojure.org/display/design/Promises https://groups.google.com/**forum/#!topic/clojure-dev/** 7BKQi9nWwAw/discussionhttps://groups.google.com/forum/#!topic/clojure-dev/7BKQi9nWwAw/discussion http://dev.clojure.org/**display/design/Async+blockshttp://dev.clojure.org/display/design/Async+blocks I've been hearing a lot about Tellman's lamina library as a rich Clojure toolset for working with asynchronicity. I haven't had a need for it myself, but you might want to check it out and see if it has relevance to what you 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 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 an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://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 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
Patching core.match
Howdy, I'm looking to patch core.match. There are a couple of cases where the pattern matcher eliminates rows (basically, if you're pattern matching against a Map, a row containing a map that has all wildcards will be considered a wildcard row and all the subsequent rows will be removed). Here's a couple of tests that fail: (deftest map-pattern-match-bind-2 (is (= (let [xqq {:cz 1 :dz 2}] (match [xqq] [{:z a :zz b}] [:a0 a b] [{:cz a :dz b}] [:a2 a b] :else [])) [:a2 1 2]))) (deftest map-pattern-match-bind-3 (is (= (let [xmm {:bz 2}] (match [xmm] [{:az a}] [:a0 a] [{:bz b}] [:a1 b] :else [])) [:a1 2]))) I've been reading through the core.match code to try to fix the code so that map matches are not treated as wildcards. As far as I can tell, if I add a magic null guard into specialize-map-pattern-row, then the row will not be treated as a wildcard... but my attempts to add a guard have been less than successful. Any help or pointers would be greatly appreciated. Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Patching core.match
I'm mailing my CLA to Rich right now. I'll do a pull request for the new tests and the changed code. Please look at the pull request and fix/apply it when I've been added to the Clojure contributors. On Wed, May 29, 2013 at 12:36 PM, David Nolen dnolen.li...@gmail.comwrote: Good catch - please file a ticket here http://dev.clojure.org/jira/browse/MATCH. Please attach any work-in-progress patch you may have there and I'll review. Before I can apply any work you've done you need to send in your Contributor Agreement (CA) - http://clojure.org/contributing Thanks, David On Wed, May 29, 2013 at 3:27 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Howdy, I'm looking to patch core.match. There are a couple of cases where the pattern matcher eliminates rows (basically, if you're pattern matching against a Map, a row containing a map that has all wildcards will be considered a wildcard row and all the subsequent rows will be removed). Here's a couple of tests that fail: (deftest map-pattern-match-bind-2 (is (= (let [xqq {:cz 1 :dz 2}] (match [xqq] [{:z a :zz b}] [:a0 a b] [{:cz a :dz b}] [:a2 a b] :else [])) [:a2 1 2]))) (deftest map-pattern-match-bind-3 (is (= (let [xmm {:bz 2}] (match [xmm] [{:az a}] [:a0 a] [{:bz b}] [:a1 b] :else [])) [:a1 2]))) I've been reading through the core.match code to try to fix the code so that map matches are not treated as wildcards. As far as I can tell, if I add a magic null guard into specialize-map-pattern-row, then the row will not be treated as a wildcard... but my attempts to add a guard have been less than successful. Any help or pointers would be greatly appreciated. Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Patching core.match
David, I'm the king of process in Lift-land and we have a ton of process that makes people unhappy. I'm happy to follow the Clojure community process and respect this community. Rock on! David On Wed, May 29, 2013 at 12:57 PM, David Nolen dnolen.li...@gmail.comwrote: It's actually nice to use pull requests as a form of review and I don't discourage that at all. But in order to facilitate the process it's easier if you attach the patch yourself to the ticket as we're not allowed to actually merge in pull requests. I know, I know, it's a bit of rigamarole but that's the steps outlined by Clojure. Thanks again, David On Wed, May 29, 2013 at 3:47 PM, David Pollak feeder.of.the.be...@gmail.com wrote: I'm mailing my CLA to Rich right now. I'll do a pull request for the new tests and the changed code. Please look at the pull request and fix/apply it when I've been added to the Clojure contributors. On Wed, May 29, 2013 at 12:36 PM, David Nolen dnolen.li...@gmail.comwrote: Good catch - please file a ticket here http://dev.clojure.org/jira/browse/MATCH. Please attach any work-in-progress patch you may have there and I'll review. Before I can apply any work you've done you need to send in your Contributor Agreement (CA) - http://clojure.org/contributing Thanks, David On Wed, May 29, 2013 at 3:27 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Howdy, I'm looking to patch core.match. There are a couple of cases where the pattern matcher eliminates rows (basically, if you're pattern matching against a Map, a row containing a map that has all wildcards will be considered a wildcard row and all the subsequent rows will be removed). Here's a couple of tests that fail: (deftest map-pattern-match-bind-2 (is (= (let [xqq {:cz 1 :dz 2}] (match [xqq] [{:z a :zz b}] [:a0 a b] [{:cz a :dz b}] [:a2 a b] :else [])) [:a2 1 2]))) (deftest map-pattern-match-bind-3 (is (= (let [xmm {:bz 2}] (match [xmm] [{:az a}] [:a0 a] [{:bz b}] [:a1 b] :else [])) [:a1 2]))) I've been reading through the core.match code to try to fix the code so that map matches are not treated as wildcards. As far as I can tell, if I add a magic null guard into specialize-map-pattern-row, then the row will not be treated as a wildcard... but my attempts to add a guard have been less than successful. Any help or pointers would be greatly appreciated. Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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
Re: Patching core.match
David, I figured out something of a hack... in MapPattern, I just put a guard around all the wildcard patterns. ;-) The patch and tests are uploaded to Jira. I look forward to helping as I can on core.match Thanks for your excellent work! David On Wed, May 29, 2013 at 12:57 PM, David Nolen dnolen.li...@gmail.comwrote: It's actually nice to use pull requests as a form of review and I don't discourage that at all. But in order to facilitate the process it's easier if you attach the patch yourself to the ticket as we're not allowed to actually merge in pull requests. I know, I know, it's a bit of rigamarole but that's the steps outlined by Clojure. Thanks again, David On Wed, May 29, 2013 at 3:47 PM, David Pollak feeder.of.the.be...@gmail.com wrote: I'm mailing my CLA to Rich right now. I'll do a pull request for the new tests and the changed code. Please look at the pull request and fix/apply it when I've been added to the Clojure contributors. On Wed, May 29, 2013 at 12:36 PM, David Nolen dnolen.li...@gmail.comwrote: Good catch - please file a ticket here http://dev.clojure.org/jira/browse/MATCH. Please attach any work-in-progress patch you may have there and I'll review. Before I can apply any work you've done you need to send in your Contributor Agreement (CA) - http://clojure.org/contributing Thanks, David On Wed, May 29, 2013 at 3:27 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Howdy, I'm looking to patch core.match. There are a couple of cases where the pattern matcher eliminates rows (basically, if you're pattern matching against a Map, a row containing a map that has all wildcards will be considered a wildcard row and all the subsequent rows will be removed). Here's a couple of tests that fail: (deftest map-pattern-match-bind-2 (is (= (let [xqq {:cz 1 :dz 2}] (match [xqq] [{:z a :zz b}] [:a0 a b] [{:cz a :dz b}] [:a2 a b] :else [])) [:a2 1 2]))) (deftest map-pattern-match-bind-3 (is (= (let [xmm {:bz 2}] (match [xmm] [{:az a}] [:a0 a] [{:bz b}] [:a1 b] :else [])) [:a1 2]))) I've been reading through the core.match code to try to fix the code so that map matches are not treated as wildcards. As far as I can tell, if I add a magic null guard into specialize-map-pattern-row, then the row will not be treated as a wildcard... but my attempts to add a guard have been less than successful. Any help or pointers would be greatly appreciated. Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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
Re: Compiling ClojureScript to JavaScript inside an app
Awesome! Thanks! On Wed, May 29, 2013 at 1:52 PM, Dave Ray dave...@gmail.com wrote: Hi David. Himera by Fogus is a ClojureScript compiler as a service which seems like it may be an example of what you're looking for. https://github.com/fogus/himera Cheers, Dave On Wed, May 29, 2013 at 1:49 PM, David Pollak feeder.of.the.be...@gmail.com wrote: Howdy, I'm looking to embed the ClojureScript compiler into an app I'm building (I'm packaging the app via uberjar). I'm trying to figure out how to compile ClojureScript to JavaScript in memory so that I get JavaScript stuff that I can shuttle off to places that can run JavaScript. Are there any examples of running the ClojureScript compiler inside an uberjar'ed app? Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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. -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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.
Compiling ClojureScript to JavaScript inside an app
Howdy, I'm looking to embed the ClojureScript compiler into an app I'm building (I'm packaging the app via uberjar). I'm trying to figure out how to compile ClojureScript to JavaScript in memory so that I get JavaScript stuff that I can shuttle off to places that can run JavaScript. Are there any examples of running the ClojureScript compiler inside an uberjar'ed app? Thanks, David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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.
Future/Promise and not using threads
Howdy, I'm looking at using Future/Promise to be thread-friendly in some code. Background... Lift has Futures (or LAFuture... yeah... go ahead make fun of the name... pronounce it with a French accent)... with Lift futures, one can do: future.foreach(v = /* do something with the value */) If the Future has been realized (or satisfied in Lift parlance), then the function executes in the current thread. If the Future has not been realized, the function is executed on a thread-pool thread once the Future has been realized. This means that we don't have to consume threads waiting for a Future to finish its work... and we can continue a computation on the thread-pool thread once the future has finished. Is there a way to get a code block to execute when a Future (or Promise) is realized? As an adjunct to that question... in Lift, we have fast-fail Futures. You can pass in List[Future[Box[X]]] and get a Future[Box[List[X]]]... but the Box will be Empty if any of the Futures fail (return an Empty Box or a Failure Box). The advantage is that if you fork off a bunch of requests to external systems you can fail-fast with your uber request if any of the systems fail. Is there a similar facility in Clojure. Thanks for your time and your help? David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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: Some feedback on coding style
Mark and James, Thank you for your input. There are two reasons why I don't want to simply test for nil as the result of running the pattern match: - The right side of the pattern can be side-effecting. For example, if you are servicing a web request, there may be database calls, etc. Therefore, I need a test that does not have side effects. - There may be a choice of multiple partial functions where the best choice is chosen (e.g., 3 different partial functions can serve a web request, but given the response type weighting, we may want to choose the JSON response, but we don't know which response type to choose until we've checked what the possibilities are) Anyway, using the joys of arity, I've solved the problem. (pf 33) ;; apply the partial function to 33 (pf :defined? 33) ;; is the function defined at 33 I blogged about the design choices at http://blog.goodstuff.im/first_clojure_macro Thanks! David On Sat, May 25, 2013 at 11:26 AM, James Reeves ja...@booleanknot.comwrote: In Scala, PartialFunction is a trait, which in Clojure I'd represent using a protocol: (defprotocol Partial (defined-at? [x])) (defn partial-fn [guard f] (reify Partial (defined-at? [x] (guard x)) clojure.lang.IFn (invoke [f x] {:pre [(guard x)]} (f x And then, when I have a mechanism to create a partial function, I'd then work on a macro to transform: (pfn [x :guard even?] (/ x 2)) Into: (partial-fn even? (fn [x] (/ x 2))) I'm not sure how much benefit you'd get out of partial functions that are not part of the core language. You'd need to write a fair bit of infrastructure around them, but it might be worth it. In Clojure, it seems quite common to use functions that return nil to achieve the same effect as partial functions, and there are several functions and macros, like some- and keep, that support that idiom. - James On 25 May 2013 17:14, David Pollak feeder.of.the.be...@gmail.com wrote: Hello, This is my first post to this group. If my post or the tone of my post is not up to this communities standards, please give me feedback so that I can integrate with the community. I'm coming from Scala-land. In Scala, there's a PartialFunction: http://www.scala-lang.org/archives/downloads/distrib/files/nightly/docs/library/index.html#scala.PartialFunction The key take-away for PartialFunctions is ... is a unary function where the domain does not necessarily include all values of type A. The ability to test a PartialFunction to see if the domain includes a particular value is very helpful. pf.isDefinedAt(x) allows testing to see if the function is defined at a given value of x. But a PartialFunction is a subclass of Function, so PartialFunctions can be applied: pf(x) The Scala compiler will take a pattern and turn it into a PartialFunction: def pf: PartialFunction[String, Number] = { case = 0 // special case blank to zero case x if isInt(x) = x.toInt case x if isDouble(x) = x.toDouble case x if isBigInt(x) = asBigInt(x) } Another property of PartialFunction is they can be composed: pf = pf1 orElse pf2 orElse pf3 // pf isDefinedAt any place any of the partial functions are defined We use PartialFunctions extensively in Lift to allow choosing if a particular URL should be served by Lift, if it should be served by a particular REST handler, etc. For example, defining a REST route in Lift: serve { case api :: user :: AsLong(userId) :: _ GetJson _ = User.find(userId).map(_.toJson) } As I've been learning Clojure in preparation for a presentation at Strange Loop and as part of a new project I've been working on ( http://blog.goodstuff.im/plugh), I am looking to bring the best things in Lift into the Clojure code I write. Clojure's pattern matching stuff is pretty nifty. I especially like how you can extract values out of a Map (this is *so* much more powerful that Scala's pattern matching, even with unapply... but I digress). So, I wrote a macro (it's my first, so feedback on the style for the macro itself): (defmacro match-func [ body] `(fn [~'x] (match [~'x] ~@body))) This creates a function that is the application of the match to a parameter, so: ((match-func [q :guard even?] (+ 1 q) [z] (* 7 z)) 33) ;; 231 I am struggling with the right style for how to create something that's both a function: (def my-test (match-func [q :guard even?] (+ 1 q) [z] (* 7 z))) (my-test 33) And also something that can be tested for definition at a given value. Put another way, if Clojure had something that's both a function and a thing that could be asked if it's defined for a given input, how would one in Clojure apply that thing and also ask that thing if it was defined? Thanks for reading my long question and I look forward to feedback. David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http
Re: Some feedback on coding style
Thanks! On Sun, May 26, 2013 at 6:27 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Hi David, Clojure can generate auto-syms with a trailing #. user= `(fn [x#] x#) (clojure.core/fn [x__349__auto__] x__349__auto__) Thanks, Ambrose On Mon, May 27, 2013 at 9:08 AM, David Pollak feeder.of.the.be...@gmail.com wrote: Mark and James, Thank you for your input. There are two reasons why I don't want to simply test for nil as the result of running the pattern match: - The right side of the pattern can be side-effecting. For example, if you are servicing a web request, there may be database calls, etc. Therefore, I need a test that does not have side effects. - There may be a choice of multiple partial functions where the best choice is chosen (e.g., 3 different partial functions can serve a web request, but given the response type weighting, we may want to choose the JSON response, but we don't know which response type to choose until we've checked what the possibilities are) Anyway, using the joys of arity, I've solved the problem. (pf 33) ;; apply the partial function to 33 (pf :defined? 33) ;; is the function defined at 33 I blogged about the design choices at http://blog.goodstuff.im/first_clojure_macro Thanks! David On Sat, May 25, 2013 at 11:26 AM, James Reeves ja...@booleanknot.comwrote: In Scala, PartialFunction is a trait, which in Clojure I'd represent using a protocol: (defprotocol Partial (defined-at? [x])) (defn partial-fn [guard f] (reify Partial (defined-at? [x] (guard x)) clojure.lang.IFn (invoke [f x] {:pre [(guard x)]} (f x And then, when I have a mechanism to create a partial function, I'd then work on a macro to transform: (pfn [x :guard even?] (/ x 2)) Into: (partial-fn even? (fn [x] (/ x 2))) I'm not sure how much benefit you'd get out of partial functions that are not part of the core language. You'd need to write a fair bit of infrastructure around them, but it might be worth it. In Clojure, it seems quite common to use functions that return nil to achieve the same effect as partial functions, and there are several functions and macros, like some- and keep, that support that idiom. - James On 25 May 2013 17:14, David Pollak feeder.of.the.be...@gmail.comwrote: Hello, This is my first post to this group. If my post or the tone of my post is not up to this communities standards, please give me feedback so that I can integrate with the community. I'm coming from Scala-land. In Scala, there's a PartialFunction: http://www.scala-lang.org/archives/downloads/distrib/files/nightly/docs/library/index.html#scala.PartialFunction The key take-away for PartialFunctions is ... is a unary function where the domain does not necessarily include all values of type A. The ability to test a PartialFunction to see if the domain includes a particular value is very helpful. pf.isDefinedAt(x) allows testing to see if the function is defined at a given value of x. But a PartialFunction is a subclass of Function, so PartialFunctions can be applied: pf(x) The Scala compiler will take a pattern and turn it into a PartialFunction: def pf: PartialFunction[String, Number] = { case = 0 // special case blank to zero case x if isInt(x) = x.toInt case x if isDouble(x) = x.toDouble case x if isBigInt(x) = asBigInt(x) } Another property of PartialFunction is they can be composed: pf = pf1 orElse pf2 orElse pf3 // pf isDefinedAt any place any of the partial functions are defined We use PartialFunctions extensively in Lift to allow choosing if a particular URL should be served by Lift, if it should be served by a particular REST handler, etc. For example, defining a REST route in Lift: serve { case api :: user :: AsLong(userId) :: _ GetJson _ = User.find(userId).map(_.toJson) } As I've been learning Clojure in preparation for a presentation at Strange Loop and as part of a new project I've been working on ( http://blog.goodstuff.im/plugh), I am looking to bring the best things in Lift into the Clojure code I write. Clojure's pattern matching stuff is pretty nifty. I especially like how you can extract values out of a Map (this is *so* much more powerful that Scala's pattern matching, even with unapply... but I digress). So, I wrote a macro (it's my first, so feedback on the style for the macro itself): (defmacro match-func [ body] `(fn [~'x] (match [~'x] ~@body))) This creates a function that is the application of the match to a parameter, so: ((match-func [q :guard even?] (+ 1 q) [z] (* 7 z)) 33) ;; 231 I am struggling with the right style for how to create something that's both a function: (def my-test (match-func [q :guard even?] (+ 1 q) [z] (* 7 z))) (my-test 33) And also something that can be tested for definition at a given value. Put another way, if Clojure had something that's both a function
Some feedback on coding style
Hello, This is my first post to this group. If my post or the tone of my post is not up to this communities standards, please give me feedback so that I can integrate with the community. I'm coming from Scala-land. In Scala, there's a PartialFunction: http://www.scala-lang.org/archives/downloads/distrib/files/nightly/docs/library/index.html#scala.PartialFunction The key take-away for PartialFunctions is ... is a unary function where the domain does not necessarily include all values of type A. The ability to test a PartialFunction to see if the domain includes a particular value is very helpful. pf.isDefinedAt(x) allows testing to see if the function is defined at a given value of x. But a PartialFunction is a subclass of Function, so PartialFunctions can be applied: pf(x) The Scala compiler will take a pattern and turn it into a PartialFunction: def pf: PartialFunction[String, Number] = { case = 0 // special case blank to zero case x if isInt(x) = x.toInt case x if isDouble(x) = x.toDouble case x if isBigInt(x) = asBigInt(x) } Another property of PartialFunction is they can be composed: pf = pf1 orElse pf2 orElse pf3 // pf isDefinedAt any place any of the partial functions are defined We use PartialFunctions extensively in Lift to allow choosing if a particular URL should be served by Lift, if it should be served by a particular REST handler, etc. For example, defining a REST route in Lift: serve { case api :: user :: AsLong(userId) :: _ GetJson _ = User.find(userId).map(_.toJson) } As I've been learning Clojure in preparation for a presentation at Strange Loop and as part of a new project I've been working on ( http://blog.goodstuff.im/plugh), I am looking to bring the best things in Lift into the Clojure code I write. Clojure's pattern matching stuff is pretty nifty. I especially like how you can extract values out of a Map (this is *so* much more powerful that Scala's pattern matching, even with unapply... but I digress). So, I wrote a macro (it's my first, so feedback on the style for the macro itself): (defmacro match-func [ body] `(fn [~'x] (match [~'x] ~@body))) This creates a function that is the application of the match to a parameter, so: ((match-func [q :guard even?] (+ 1 q) [z] (* 7 z)) 33) ;; 231 I am struggling with the right style for how to create something that's both a function: (def my-test (match-func [q :guard even?] (+ 1 q) [z] (* 7 z))) (my-test 33) And also something that can be tested for definition at a given value. Put another way, if Clojure had something that's both a function and a thing that could be asked if it's defined for a given input, how would one in Clojure apply that thing and also ask that thing if it was defined? Thanks for reading my long question and I look forward to feedback. David -- Telegram, Simply Beautiful CMS https://telegr.am Lift, the simply functional web framework http://liftweb.net Follow me: http://twitter.com/dpp Blog: http://goodstuff.im -- -- 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.