Re: A* Graphe implementation
There's also: http://nakkaya.com/2010/06/01/path-finding-using-astar-in-clojure/ Sent from my iPhone On 17.06.2013, at 00:59, Mark Engelberg mark.engelb...@gmail.com wrote: http://clj-me.cgrand.net/2010/09/04/a-in-clojure/ -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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
Thank you for the AOT fixes! On Mon, Jun 17, 2013 at 7:10 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Fantastic news! On Mon, Jun 17, 2013 at 1:04 PM, David Nolen dnolen.li...@gmail.comwrote: 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. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
Need to render some entities moving across a grid
I'm implementing a program D. Hofstadter describes in *Fluid Concepts: * https://github.com/vemv/jumbo/* *Even in the original text, concurrency/parallelism is a crucial part of the domain so Clojure is super well-suited. While visualising the carried-in process is not a goal of the project, providing a rendering of the 'entities' of the modelled world would help a lot explaining my program to others (which I have to). The thing is - I haven't ever done significant graphics programming - I don't know e.g. what libraries to use, how to create smooth movements, keep the code high-level... and sadly I don't have a lot of time in my hands. Would anyone knowledgeable in the matter mind coding a quick-and-dirty solution for me? I could buy you a couple books in exchange hahaha. You'd have exactly one week, and I of course would provide all needed information/feedback. Feel free to reply here or contact me at vemv [at] vemv [dot] net. Thanks for your time! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
I need a configuration solution
I need a configuration solution -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
Any suggestions for configuration solution in Clojure or Java world?
After suffer xml or properties configuration for long time, I'm looking for a new configuration solution for Clojure or Java. I hope below features, priority from high to low: 1. readable format and easy to write. XML is the opposite example, which is not easy to edit and not readable. I like Json or YAML, especially JSON. 2. support difference environments. The difficult things I have are distributes difference package for difference environments (dev, gamma or online). My practice are write difference set of configuration files for each environment, for example we have database-dev.properties and database-online.properties for respectively dev and online environment, then pass a argument to startup script to control which file to load. it's just work, but the problem are there are only small part of config is difference between and dev and online, but I have to rewrite and maintain all config in two files. 3. easy to organize if there are a lot of configuration files. It's very common that there are many configurations distributes in difference files. Sometimes one file's configuration need override another. we need a solution to management them. 4. we can very easy override configuration by CLI argument or system environment variable. Sometimes we have to temporarily change configuration for debug or troubleshooting purpose. I hope we can easy to override configuration not change the configuration files. For the #1, the HOCON ( https://github.com/typesafehub/config ) is the best config syntax what I have ever seen. But I didn't find out a solution which can satisfy rest of other features. Do you have any suggestions? thanks -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
I need a configuration solution
I need a configuration solution -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: I need a configuration solution
Hi Mingqi, Could you please give us some more context? What kind of configuration are you trying to manage? Cheers, Chris On 17 June 2013 10:45, Mingqi mingqi.s...@gmail.com wrote: I need a configuration solution -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: In what OS do you code?
Robert, the Leiningen survey might under-report Windows-based usage of Clojure, as I think Eclipse+Counter-clockwise is especially popular there. On 17 June 2013 02:03, Robert Levy r.p.l...@gmail.com wrote: There's the State of Clojure Survey: http://cemerick.com/2012/08/06/results-of-the-2012-state-of-clojure-survey/. I think Chas usually asks for ideas on what the questions should be, so that might be a good question to suggest next time around. The Leiningen survey asks that question and finds 79% Linux vs only 62% Mac https://lein-survey-2013.herokuapp.com/results The Leiningen results likely mirror Clojure OS preference more generally, since the vast majority of Clojure users use Leiningen. On Fri, Jun 14, 2013 at 11:15 AM, Raoul Duke rao...@gmail.com wrote: Thanks for all the responses, it looks like Linux is the predominant OS in the Clojure community. er, wow. that's a bit of a leap, isn't it? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: I need a configuration solution
On Monday, June 17, 2013 3:55:18 PM UTC+8, Chris Ford wrote: Hi Mingqi, Could you please give us some more context? What kind of configuration are you trying to manage? Cheers, Chris On 17 June 2013 10:45, Mingqi mingq...@gmail.com javascript: wrote: I need a configuration solution -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. 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: I need a configuration solution
Chris, I'm sorry for that. This email is only for test. I send a email a few minutes before this but not appear in group after post, so I quickly post this only for test. More context in my another post subject are Any suggestions for configuration solution in Clojure or Java world? On Monday, June 17, 2013 3:55:18 PM UTC+8, Chris Ford wrote: Hi Mingqi, Could you please give us some more context? What kind of configuration are you trying to manage? Cheers, Chris On 17 June 2013 10:45, Mingqi mingq...@gmail.com javascript: wrote: I need a configuration solution -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. 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: In what OS do you code?
from the Counterclockwise docs: the preferred way to create a new project is via the New Leiningen Project Wizard On Mon, Jun 17, 2013 at 1:33 AM, Chris Ford christophertf...@gmail.comwrote: Robert, the Leiningen survey might under-report Windows-based usage of Clojure, as I think Eclipse+Counter-clockwise is especially popular there. On 17 June 2013 02:03, Robert Levy r.p.l...@gmail.com wrote: There's the State of Clojure Survey: http://cemerick.com/2012/08/06/results-of-the-2012-state-of-clojure-survey/. I think Chas usually asks for ideas on what the questions should be, so that might be a good question to suggest next time around. The Leiningen survey asks that question and finds 79% Linux vs only 62% Mac https://lein-survey-2013.herokuapp.com/results The Leiningen results likely mirror Clojure OS preference more generally, since the vast majority of Clojure users use Leiningen. On Fri, Jun 14, 2013 at 11:15 AM, Raoul Duke rao...@gmail.com wrote: Thanks for all the responses, it looks like Linux is the predominant OS in the Clojure community. er, wow. that's a bit of a leap, isn't it? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
Re: Any suggestions for configuration solution in Clojure or Java world?
We built our own tool using zookeeper. We need to manage clusters of nodes, clearly property files were not scalable enough to be of any help here. All the configuration values are written using Clojure expressions, not just EDN like stuff, we do eval code loaded in the configuration to provide extensibility. We wrote a DSL to maintain the configuration. You can then implement versioning, rollbacks, whatever features you may need. When a node boots, it needs a 4 lines property file to find its root in the cluster configuration. Any process on the node pulls it's configuration from this root. This approach might be too heavy for your needs however. Luc P. After suffer xml or properties configuration for long time, I'm looking for a new configuration solution for Clojure or Java. I hope below features, priority from high to low: 1. readable format and easy to write. XML is the opposite example, which is not easy to edit and not readable. I like Json or YAML, especially JSON. 2. support difference environments. The difficult things I have are distributes difference package for difference environments (dev, gamma or online). My practice are write difference set of configuration files for each environment, for example we have database-dev.properties and database-online.properties for respectively dev and online environment, then pass a argument to startup script to control which file to load. it's just work, but the problem are there are only small part of config is difference between and dev and online, but I have to rewrite and maintain all config in two files. 3. easy to organize if there are a lot of configuration files. It's very common that there are many configurations distributes in difference files. Sometimes one file's configuration need override another. we need a solution to management them. 4. we can very easy override configuration by CLI argument or system environment variable. Sometimes we have to temporarily change configuration for debug or troubleshooting purpose. I hope we can easy to override configuration not change the configuration files. For the #1, the HOCON ( https://github.com/typesafehub/config ) is the best config syntax what I have ever seen. But I didn't find out a solution which can satisfy rest of other features. Do you have any suggestions? thanks -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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. -- Softaddictslprefonta...@softaddicts.ca sent by ibisMail from my ipad! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
ANN: modern-cljs dependencies updated
Hi all, I updated the libs which https://github.com/magomimmo/modern-cljs depends on: - now you need at least lein 2.1.2 version (I used lein 2.2.0). Use $ lein upgrade to upgrade it - lein-cljsbuild 0.3.2 - lein-ring 0.8.5 In july I should have the time to go on with the next couple of tutorials covering testing. HIH Mimmo -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: In what OS do you code?
On Sun, Jun 16, 2013 at 4:40 AM, Korny Sietsma ko...@sietsma.com wrote: How are all the Linux users handling Java installation? Using an official Oracle installer, or your package manager somehow, or something else? Or using (gasp) openJDK? I'm on Ubuntu and I use OpenJDK 7 which is the default JDK. I don't know why you gasp at OpenJDK, but it works great and I never had any problems with it. Plus, I trust the OpenJDK package to get more security updates than Oracle's official JDK. Seriously. I do have the official Oracle JDK 7 installed (for testing), plus early builds of JDK 8 (for playing around with it). Ubuntu makes that easy due to update-java-alternatives, so having multiple versions installed is really not an issue. If you're on Ubuntu and you want the official Oracle JDK (both 7 and previews of 8), you only need to use this PPA: https://launchpad.net/~webupd8team/+archive/java -- Alexandru Nedelcu https://bionicspirit.com -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- 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.
type-hints positioning convention?
Hi all, It seems to me that return type-hints can go either right after defn, or after the doc-string. I generally, put the return type-hints right before the argument vector and it seems to get rid of reflection. However, I just had a look at core.contrib.strutils2 and the author(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: In what OS do you code?
Windows 7 at work, Ubuntu at home. Both have good and bad points, I'm quite happy coding in either (once properly set up). On Friday, 14 June 2013 15:46:37 UTC+2, Erlis Vidal wrote: Hi, I'm a bit curious to know in what OS do you code. Do you prefer iOS, Linux, Windows? Why is that? Because the tools? The environment? Thanks! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: In what OS do you code?
Sorry, didn't mean to dismiss OpenJDK - in the past, every time I've tried it I've had performance issues or compatibility issues. Admittedly, I haven't tried it for a few years - I'd be very happy if it is now fast and reliable enough for everyday use! - Korny On 17 June 2013 21:51, Alexandru Nedelcu m...@alexn.org wrote: On Sun, Jun 16, 2013 at 4:40 AM, Korny Sietsma ko...@sietsma.com wrote: How are all the Linux users handling Java installation? Using an official Oracle installer, or your package manager somehow, or something else? Or using (gasp) openJDK? I'm on Ubuntu and I use OpenJDK 7 which is the default JDK. I don't know why you gasp at OpenJDK, but it works great and I never had any problems with it. Plus, I trust the OpenJDK package to get more security updates than Oracle's official JDK. Seriously. I do have the official Oracle JDK 7 installed (for testing), plus early builds of JDK 8 (for playing around with it). Ubuntu makes that easy due to update-java-alternatives, so having multiple versions installed is really not an issue. If you're on Ubuntu and you want the official Oracle JDK (both 7 and previews of 8), you only need to use this PPA: https://launchpad.net/~webupd8team/+archive/java -- Alexandru Nedelcu https://bionicspirit.com -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- 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. -- Kornelis Sietsma korny at my surname dot com http://korny.info .fnord { display: none !important; } -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: Need to render some entities moving across a grid
For something quick and dirty, have you taken a look at quil? It's pretty easy to get started. https://github.com/quil/quil On Monday, June 17, 2013, vemv wrote: I'm implementing a program D. Hofstadter describes in *Fluid Concepts: * https://github.com/vemv/jumbo/* *Even in the original text, concurrency/parallelism is a crucial part of the domain so Clojure is super well-suited. While visualising the carried-in process is not a goal of the project, providing a rendering of the 'entities' of the modelled world would help a lot explaining my program to others (which I have to). The thing is - I haven't ever done significant graphics programming - I don't know e.g. what libraries to use, how to create smooth movements, keep the code high-level... and sadly I don't have a lot of time in my hands. Would anyone knowledgeable in the matter mind coding a quick-and-dirty solution for me? I could buy you a couple books in exchange hahaha. You'd have exactly one week, and I of course would provide all needed information/feedback. Feel free to reply here or contact me at vemv [at] vemv [dot] net. Thanks for your time! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.comjavascript:_e({}, 'cvml', 'clojure@googlegroups.com'); Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com javascript:_e({}, 'cvml', 'clojure%2bunsubscr...@googlegroups.com'); For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com javascript:_e({}, 'cvml', 'clojure%2bunsubscr...@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: Any suggestions for configuration solution in Clojure or Java world?
I have wrapped up the Typesafe Config pieces, that can read EDN and HOCON in: https://github.com/ohpauleez/confil The project should be considered pretty alpha and the general interface may change. I also have plans to make two supplemental project: confil-literals (that bring along reader literals for various config entries), and confil-archaius ( https://github.com/Netflix/archaius ). Paul On Monday, June 17, 2013 12:36:35 AM UTC-7, Mingqi wrote: After suffer xml or properties configuration for long time, I'm looking for a new configuration solution for Clojure or Java. I hope below features, priority from high to low: 1. readable format and easy to write. XML is the opposite example, which is not easy to edit and not readable. I like Json or YAML, especially JSON. 2. support difference environments. The difficult things I have are distributes difference package for difference environments (dev, gamma or online). My practice are write difference set of configuration files for each environment, for example we have database-dev.properties and database-online.properties for respectively dev and online environment, then pass a argument to startup script to control which file to load. it's just work, but the problem are there are only small part of config is difference between and dev and online, but I have to rewrite and maintain all config in two files. 3. easy to organize if there are a lot of configuration files. It's very common that there are many configurations distributes in difference files. Sometimes one file's configuration need override another. we need a solution to management them. 4. we can very easy override configuration by CLI argument or system environment variable. Sometimes we have to temporarily change configuration for debug or troubleshooting purpose. I hope we can easy to override configuration not change the configuration files. For the #1, the HOCON ( https://github.com/typesafehub/config ) is the best config syntax what I have ever seen. But I didn't find out a solution which can satisfy rest of other features. Do you have any suggestions? thanks -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: In what OS do you code?
Windows 8 at work Windows 2008 Server at home Lot of Node.js, C#, Java, PHP coding. Few Clojure, only spikes or little sample, using REPL, sometimes lein Angel Java Lopez @ajlopez On Fri, Jun 14, 2013 at 10:46 AM, Erlis Vidal er...@erlisvidal.com wrote: Hi, I'm a bit curious to know in what OS do you code. Do you prefer iOS, Linux, Windows? Why is that? Because the tools? The environment? Thanks! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
'foldcat' slower than 'mapv' even for 10,000 elements
Hi again, I'm finding that (r/foldcat (r/map f coll)) is consistently slower than a simple mapv, even for a collection of 10,000 elements and more! The fn I'm mapping is a stemming algorithm, not too heavyweight but not too lightweight either... is anyone else finding this strange or am I missing something? Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
Jenkins, clojure, ring...
Hi guys; I am trying to setup CI server with jenkins. I would like after pushing to mercurial, i just refresh the browser and see the changes. I use lein ring server-headless to run the server. I can shell the command in jenkins using something like nohup lein ring server-headless The problem is, during the next build, how will the first process be killed so that it can be run again ? Josh -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: Clojure in production
Hi Plinio, we released today in production a clj/cljs application which implements an animated/interactive bubble chart on client side by getting tha data (in edn format) from the the server. The client has been implemented by using clojurescript and the following main libs: - domina - c2 - d3 The server has been implemented by using clojure and the following libs: - compojure - korma - necessary-evil - timbre - clj-logging-config The edn format is exchanged between the server and client by using shoreleave-remote-ring and shoreleave-remote. We're very happy with both clojure and clojurescript. In a couple of week we're going to release the bubble-chart component on github. Mimmo On Jun 10, 2013, at 11:47 PM, Plínio Balduino wrote: Hi there I'm writing a talk about Clojure in the real world and I would like to know, if possible, which companies are using Clojure for production or to make internal tools. Thank you Plínio Balduino -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: Clojure in production
Hi Plinio, We use Clojure for nearly everything we do at Runa (we also have a little bit of Ruby and JS in our stack). For more info, see http://www.workatruna.com/clojure.html. Rob On Mon, Jun 17, 2013 at 6:49 AM, Giacomo Cosenza mimmo.cose...@gmail.comwrote: Hi Plinio, we released today in production a clj/cljs application which implements an animated/interactive bubble chart on client side by getting tha data (in edn format) from the the server. The client has been implemented by using clojurescript and the following main libs: - domina - c2 - d3 The server has been implemented by using clojure and the following libs: - compojure - korma - necessary-evil - timbre - clj-logging-config The edn format is exchanged between the server and client by using shoreleave-remote-ring and shoreleave-remote. We're very happy with both clojure and clojurescript. In a couple of week we're going to release the bubble-chart component on github. Mimmo On Jun 10, 2013, at 11:47 PM, Plínio Balduino wrote: Hi there I'm writing a talk about Clojure in the real world and I would like to know, if possible, which companies are using Clojure for production or to make internal tools. Thank you Plínio Balduino -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: translating Common Lisp to Clojure?
The BIG problem is that Common Lisp is mutable. Creating a DSL for common lisp, creatin cons, managing syntax, and so on, no probl. Even manage a Lisp-2. But as you have that fucken fset, you have to do counterClojure. Ask Deuce guy : http://skillsmatter.com/podcast/scala/deuce-is-not-yet-emacs-under-clojure?goback=.gde_1058217_member_247374970 -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: type-hints positioning convention?
I don't know what core.contrib.strutils2 is, but it sounds like old contrib pre-clojure-1.3. See http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go The type-hints-before-the-argument-vector syntax was introduced in Clojure 1.3 along with primitive type hints, so I would consider it the more current style. The older type-hint-before-the-symbol syntax is still supported, and probably won't go away any time soon. -S On Monday, June 17, 2013 7:59:47 AM UTC-4, Jim foo.bar wrote: Hi all, It seems to me that return type-hints can go either right after defn, or after the doc-string. I generally, put the return type-hints right before the argument vector and it seems to get rid of reflection. However, I just had a look at core.contrib.strutils2 and the author(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: type-hints positioning convention?
On 17/06/13 17:03, Stuart Sierra wrote: The type-hints-before-the-argument-vector syntax was introduced in Clojure 1.3 along with primitive type hints, so I would consider it the more current style. The older type-hint-before-the-symbol syntax is still supported, and probably won't go away any time soon. -S I see... thanks Stuart :) Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
Feedback request: Spec for meta testing-lib
The goal is to have an extensible, simple core for a testing lib, where all other Clojure testing libs can be rewritten as extensions to it. A common motivation is that people want to mix and match aspects/features of different testing lib. But really, each person wants this for different reasons. What we have in common though is wanting it to exist. Here's the spec: https://github.com/evanescence/test2/blob/master/SPEC.md The current incarnation is the result of several weeks of collaborative brainstorming and obsessive tweaking and refining. We think it can currently cover about 99% of testing use-cases as-is. So, I'd like to present it to the wider community for discussion. Note: there's a debate going on in IRC over nouns vs verbs, i.e. whether Runner and Reporter should be Run and Report, or Run-fn and Report-fn, or something else. But I'm hoping we can put off that topic until after the more fundamental aspects of the spec are discussed. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: type-hints positioning convention?
After some investigation, the before-the-arglist syntax only seems useful for defining fn's that return primitive types. They don't seem to help resolve reflection calls. (require '[clojure.tools.analyzer :refer [ast]]) ; this creates a double-emitting fn (ast (fn (^double [^double a] a))) ; = ;{:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type D}), ;double return type here ; ... ; :tag nil} ; no tag ; this creates a regular old fn (ast (fn (^String [a] 1))) ; = ;{:op :fn-expr, ; ... ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type Ljava/lang/Object;}), ;object return type ; ... ; :tag nil} ; no tag ; this creates a String-hinted fn (ast ^String (fn a [a] 1)) ;{:op :meta, ; ... ; :expr ; {:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ;:arg-types (#Type Ljava/lang/Object;), ;:return-type #Type Ljava/lang/Object;}), ; ... ; :tag String}} I don't see where before-the-arglist is useful outside of primitive fns. Thanks, Ambrose On Mon, Jun 17, 2013 at 7:59 PM, Jim - FooBar(); jimpil1...@gmail.comwrote: Hi all, It seems to me that return type-hints can go either right after defn, or after the doc-string. I generally, put the return type-hints right before the argument vector and it seems to get rid of reflection. However, I just had a look at core.contrib.strutils2 and the author(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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+unsubscribe@**googlegroups.comclojure%2bunsubscr...@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+unsubscribe@**googlegroups.comclojure%2bunsubscr...@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 clojure@googlegroups.com Note that posts 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: Any suggestions for configuration solution in Clojure or Java world?
I like carica for configuration: https://github.com/sonian/carica I switched a project over from the typesafe config package (with my own very thin Clojure wrapper around it) to carica and found it really nice to work with. Josh -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: type-hints positioning convention?
so how about this then? nREPL server started on port 43830 REPL-y 0.2.0 Clojure 1.5.1 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) user= (set! *warn-on-reflection* true) true user= (defn foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (foo jim) jim user= (.length (foo jim)) *Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved.* 3 user= (defn foo ^String [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 user= (defn ^String foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 it worked both times didn't it? Jim On 17/06/13 17:59, Ambrose Bonnaire-Sergeant wrote: After some investigation, the before-the-arglist syntax only seems useful for defining fn's that return primitive types. They don't seem to help resolve reflection calls. (require '[clojure.tools.analyzer :refer [ast]]) ; this creates a double-emitting fn (ast (fn (^double [^double a] a))) ; = ;{:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type D}), ;double return type here ; ... ; :tag nil} ; no tag ; this creates a regular old fn (ast (fn (^String [a] 1))) ; = ;{:op :fn-expr, ; ... ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type Ljava/lang/Object;}), ;object return type ; ... ; :tag nil} ; no tag ; this creates a String-hinted fn (ast ^String (fn a [a] 1)) ;{:op :meta, ; ... ; :expr ; {:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ; :arg-types (#Type Ljava/lang/Object;), ;:return-type #Type Ljava/lang/Object;}), ; ... ; :tag String}} I don't see where before-the-arglist is useful outside of primitive fns. Thanks, Ambrose On Mon, Jun 17, 2013 at 7:59 PM, Jim - FooBar(); jimpil1...@gmail.com mailto:jimpil1...@gmail.com wrote: Hi all, It seems to me that return type-hints can go either right after defn, or after the doc-string. I generally, put the return type-hints right before the argument vector and it seems to get rid of reflection. However, I just had a look at core.contrib.strutils2 and the author(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com mailto:clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com mailto:clojure%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com mailto:clojure%2bunsubscr...@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: type-hints positioning convention?
Yes, it did. That's interesting. I have no idea where the .length method is being inferred from in the last example. Carry on :) Ambrose On Tue, Jun 18, 2013 at 1:10 AM, Jim - FooBar(); jimpil1...@gmail.comwrote: so how about this then? nREPL server started on port 43830 REPL-y 0.2.0 Clojure 1.5.1 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) user= (set! *warn-on-reflection* true) true user= (defn foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (foo jim) jim user= (.length (foo jim)) *Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved.* 3 user= (defn foo ^String [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 user= (defn ^String foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 it worked both times didn't it? Jim On 17/06/13 17:59, Ambrose Bonnaire-Sergeant wrote: After some investigation, the before-the-arglist syntax only seems useful for defining fn's that return primitive types. They don't seem to help resolve reflection calls. (require '[clojure.tools.analyzer :refer [ast]]) ; this creates a double-emitting fn (ast (fn (^double [^double a] a))) ; = ;{:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type D}), ;double return type here ; ... ; :tag nil} ; no tag ; this creates a regular old fn (ast (fn (^String [a] 1))) ; = ;{:op :fn-expr, ; ... ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type Ljava/lang/Object;}), ;object return type ; ... ; :tag nil} ; no tag ; this creates a String-hinted fn (ast ^String (fn a [a] 1)) ;{:op :meta, ; ... ; :expr ; {:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ;:arg-types (#Type Ljava/lang/Object;), ;:return-type #Type Ljava/lang/Object;}), ; ... ; :tag String}} I don't see where before-the-arglist is useful outside of primitive fns. Thanks, Ambrose On Mon, Jun 17, 2013 at 7:59 PM, Jim - FooBar(); jimpil1...@gmail.comwrote: Hi all, It seems to me that return type-hints can go either right after defn, or after the doc-string. I generally, put the return type-hints right before the argument vector and it seems to get rid of reflection. However, I just had a look at core.contrib.strutils2 and the author(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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
Re: type-hints positioning convention?
Seems like there's some trickery involved with using Vars. This example seems to use reflection. user= (.length ((fn ^String [^String s] (.substring s 0 (.length s))) a)) Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved. 1 Thanks, Ambrose On Tue, Jun 18, 2013 at 1:15 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Yes, it did. That's interesting. I have no idea where the .length method is being inferred from in the last example. Carry on :) Ambrose On Tue, Jun 18, 2013 at 1:10 AM, Jim - FooBar(); jimpil1...@gmail.comwrote: so how about this then? nREPL server started on port 43830 REPL-y 0.2.0 Clojure 1.5.1 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) user= (set! *warn-on-reflection* true) true user= (defn foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (foo jim) jim user= (.length (foo jim)) *Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved.* 3 user= (defn foo ^String [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 user= (defn ^String foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 it worked both times didn't it? Jim On 17/06/13 17:59, Ambrose Bonnaire-Sergeant wrote: After some investigation, the before-the-arglist syntax only seems useful for defining fn's that return primitive types. They don't seem to help resolve reflection calls. (require '[clojure.tools.analyzer :refer [ast]]) ; this creates a double-emitting fn (ast (fn (^double [^double a] a))) ; = ;{:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type D}), ;double return type here ; ... ; :tag nil} ; no tag ; this creates a regular old fn (ast (fn (^String [a] 1))) ; = ;{:op :fn-expr, ; ... ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type Ljava/lang/Object;}), ;object return type ; ... ; :tag nil} ; no tag ; this creates a String-hinted fn (ast ^String (fn a [a] 1)) ;{:op :meta, ; ... ; :expr ; {:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ;:arg-types (#Type Ljava/lang/Object;), ;:return-type #Type Ljava/lang/Object;}), ; ... ; :tag String}} I don't see where before-the-arglist is useful outside of primitive fns. Thanks, Ambrose On Mon, Jun 17, 2013 at 7:59 PM, Jim - FooBar(); jimpil1...@gmail.comwrote: Hi all, It seems to me that return type-hints can go either right after defn, or after the doc-string. I generally, put the return type-hints right before the argument vector and it seems to get rid of reflection. However, I just had a look at core.contrib.strutils2 and the author(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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
Re: type-hints positioning convention?
OK now I'm confused! If you are using an unnamed fn form there is only one place to put the return type-hin,t and that is between the 'fn' and the '[...]' ...but, you've just demonstrated that this causes reflection...where else can we put it? Jim On 17/06/13 18:33, Ambrose Bonnaire-Sergeant wrote: Seems like there's some trickery involved with using Vars. This example seems to use reflection. user= (.length ((fn ^String [^String s] (.substring s 0 (.length s))) a)) Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved. 1 Thanks, Ambrose On Tue, Jun 18, 2013 at 1:15 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com mailto:abonnaireserge...@gmail.com wrote: Yes, it did. That's interesting. I have no idea where the .length method is being inferred from in the last example. Carry on :) Ambrose On Tue, Jun 18, 2013 at 1:10 AM, Jim - FooBar(); jimpil1...@gmail.com mailto:jimpil1...@gmail.com wrote: so how about this then? nREPL server started on port 43830 REPL-y 0.2.0 Clojure 1.5.1 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) user= (set! *warn-on-reflection* true) true user= (defn foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (foo jim) jim user= (.length (foo jim)) *Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved.* 3 user= (defn foo ^String [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 user= (defn ^String foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 it worked both times didn't it? Jim On 17/06/13 17:59, Ambrose Bonnaire-Sergeant wrote: After some investigation, the before-the-arglist syntax only seems useful for defining fn's that return primitive types. They don't seem to help resolve reflection calls. (require '[clojure.tools.analyzer :refer [ast]]) ; this creates a double-emitting fn (ast (fn (^double [^double a] a))) ; = ;{:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type D}), ;double return type here ; ... ; :tag nil} ; no tag ; this creates a regular old fn (ast (fn (^String [a] 1))) ; = ;{:op :fn-expr, ; ... ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type Ljava/lang/Object;}), ;object return type ; ... ; :tag nil} ; no tag ; this creates a String-hinted fn (ast ^String (fn a [a] 1)) ;{:op :meta, ; ... ; :expr ; {:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ;:arg-types (#Type Ljava/lang/Object;), ;:return-type #Type Ljava/lang/Object;}), ; ... ; :tag String}} I don't see where before-the-arglist is useful outside of primitive fns. Thanks, Ambrose On Mon, Jun 17, 2013 at 7:59 PM, Jim - FooBar(); jimpil1...@gmail.com mailto:jimpil1...@gmail.com wrote: Hi all, It seems to me that return type-hints can go either right after defn, or after the doc-string. I generally, put the return type-hints right before the argument vector and it seems to get rid of reflection. However, I just had a look at core.contrib.strutils2 and the author(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com mailto:clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com mailto:clojure%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to
Re: type-hints positioning convention?
I'm not sure. I guess we're stuck with tagging locals at that point? Thanks, Ambrose On Tue, Jun 18, 2013 at 1:38 AM, Jim - FooBar(); jimpil1...@gmail.comwrote: OK now I'm confused! If you are using an unnamed fn form there is only one place to put the return type-hin,t and that is between the 'fn' and the '[...]' ...but, you've just demonstrated that this causes reflection...where else can we put it? Jim On 17/06/13 18:33, Ambrose Bonnaire-Sergeant wrote: Seems like there's some trickery involved with using Vars. This example seems to use reflection. user= (.length ((fn ^String [^String s] (.substring s 0 (.length s))) a)) Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved. 1 Thanks, Ambrose On Tue, Jun 18, 2013 at 1:15 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Yes, it did. That's interesting. I have no idea where the .length method is being inferred from in the last example. Carry on :) Ambrose On Tue, Jun 18, 2013 at 1:10 AM, Jim - FooBar(); jimpil1...@gmail.comwrote: so how about this then? nREPL server started on port 43830 REPL-y 0.2.0 Clojure 1.5.1 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) user= (set! *warn-on-reflection* true) true user= (defn foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (foo jim) jim user= (.length (foo jim)) *Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved.* 3 user= (defn foo ^String [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 user= (defn ^String foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 it worked both times didn't it? Jim On 17/06/13 17:59, Ambrose Bonnaire-Sergeant wrote: After some investigation, the before-the-arglist syntax only seems useful for defining fn's that return primitive types. They don't seem to help resolve reflection calls. (require '[clojure.tools.analyzer :refer [ast]]) ; this creates a double-emitting fn (ast (fn (^double [^double a] a))) ; = ;{:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type D}), ;double return type here ; ... ; :tag nil} ; no tag ; this creates a regular old fn (ast (fn (^String [a] 1))) ; = ;{:op :fn-expr, ; ... ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type Ljava/lang/Object;}), ;object return type ; ... ; :tag nil} ; no tag ; this creates a String-hinted fn (ast ^String (fn a [a] 1)) ;{:op :meta, ; ... ; :expr ; {:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ;:arg-types (#Type Ljava/lang/Object;), ;:return-type #Type Ljava/lang/Object;}), ; ... ; :tag String}} I don't see where before-the-arglist is useful outside of primitive fns. Thanks, Ambrose On Mon, Jun 17, 2013 at 7:59 PM, Jim - FooBar(); jimpil1...@gmail.comwrote: Hi all, It seems to me that return type-hints can go either right after defn, or after the doc-string. I generally, put the return type-hints right before the argument vector and it seems to get rid of reflection. However, I just had a look at core.contrib.strutils2 and the author(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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
Re: type-hints positioning convention?
Typehints for functions are only useful on vars. There is no code anywhere, as far as I know, that looks at the metadata attached to anonymous functions. On Monday, June 17, 2013 11:04:45 AM UTC-7, Ambrose Bonnaire-Sergeant wrote: I'm not sure. I guess we're stuck with tagging locals at that point? Thanks, Ambrose On Tue, Jun 18, 2013 at 1:38 AM, Jim - FooBar(); jimpi...@gmail.comjavascript: wrote: OK now I'm confused! If you are using an unnamed fn form there is only one place to put the return type-hin,t and that is between the 'fn' and the '[...]' ...but, you've just demonstrated that this causes reflection...where else can we put it? Jim On 17/06/13 18:33, Ambrose Bonnaire-Sergeant wrote: Seems like there's some trickery involved with using Vars. This example seems to use reflection. user= (.length ((fn ^String [^String s] (.substring s 0 (.length s))) a)) Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved. 1 Thanks, Ambrose On Tue, Jun 18, 2013 at 1:15 AM, Ambrose Bonnaire-Sergeant abonnair...@gmail.com javascript: wrote: Yes, it did. That's interesting. I have no idea where the .length method is being inferred from in the last example. Carry on :) Ambrose On Tue, Jun 18, 2013 at 1:10 AM, Jim - FooBar(); jimpi...@gmail.comjavascript: wrote: so how about this then? nREPL server started on port 43830 REPL-y 0.2.0 Clojure 1.5.1 Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) user= (set! *warn-on-reflection* true) true user= (defn foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (foo jim) jim user= (.length (foo jim)) *Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length can't be resolved.* 3 user= (defn foo ^String [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 user= (defn ^String foo [^String s] (.substring s 0 (.length s))) #'user/foo user= (.length (foo jim)) 3 it worked both times didn't it? Jim On 17/06/13 17:59, Ambrose Bonnaire-Sergeant wrote: After some investigation, the before-the-arglist syntax only seems useful for defining fn's that return primitive types. They don't seem to help resolve reflection calls. (require '[clojure.tools.analyzer :refer [ast]]) ; this creates a double-emitting fn (ast (fn (^double [^double a] a))) ; = ;{:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type D}), ;double return type here ; ... ; :tag nil} ; no tag ; this creates a regular old fn (ast (fn (^String [a] 1))) ; = ;{:op :fn-expr, ; ... ; ({:op :fn-method, ; ... ; :arg-types (#Type Ljava/lang/Object;), ; :return-type #Type Ljava/lang/Object;}), ;object return type ; ... ; :tag nil} ; no tag ; this creates a String-hinted fn (ast ^String (fn a [a] 1)) ;{:op :meta, ; ... ; :expr ; {:op :fn-expr, ; ... ; :methods ; ({:op :fn-method, ;:arg-types (#Type Ljava/lang/Object;), ;:return-type #Type Ljava/lang/Object;}), ; ... ; :tag String}} I don't see where before-the-arglist is useful outside of primitive fns. Thanks, Ambrose On Mon, Jun 17, 2013 at 7:59 PM, Jim - FooBar(); jimpi...@gmail.comjavascript: wrote: Hi all, It seems to me that return type-hints can go either right after defn, or after the doc-string. I generally, put the return type-hints right before the argument vector and it seems to get rid of reflection. However, I just had a look at core.contrib.strutils2 and the author(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. 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 clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first
Re: Any suggestions for configuration solution in Clojure or Java world?
I glanced at this a while back - does carica support java -jar myuberjar.jar config.clj type invocation, or is it strictly compile the config in a la bundle into the class path? I generally ship the same uberjar around for prod/dev/etc. along with a per-environment config.clj file, and that seems to work great. Would like something to parse configs (so carica looks really good) but I don't like the idea of a preprod.jar , prod.jar etc. On 17 June 2013 18:08, josh rotenberg joshrotenb...@gmail.com wrote: I like carica for configuration: https://github.com/sonian/carica I switched a project over from the typesafe config package (with my own very thin Clojure wrapper around it) to carica and found it really nice to work with. Josh -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
Graph API
Hello, I want to create a graph API similar to what core.matrix is for matrices. I have created some protocols which every graph implementation has to satisfy and a prototype implementation. Now I want your feedback on these protocols. Which functions do you want to see which aren't there? Which functions should be changed? Are there problems with the general design? Have you any other feedback? Here are the protocol definitions: (defprotocol PGraph Minimal functionality of a graph. (directed? [g] Returns true if the graph is directed and false if the graph is undirected. If it is undirected, all functions taking two nodes must be commutative with regard to these nodes.) (nodes [g] Returns a set or sequence of all nodes of the graph. May not contain duplicates.) (has-edge? [g n1 n2] Returns true if the graph g has an edge from node n1 to node n2.) (direct-successors [g n] Returns a set or sequence of all nodes n2 for which (has-edge? g n n2) returns true. May not contain duplicates.)) (defprotocol PPredecessorGraph Optional functionality of a graph which can give a list of all direct predecessors of a node. (direct-predecessors [g n] Returns a set or sequence of all nodes n2 for which (has-edge? g n2 n) returns true. May not contain duplicates.)) (defprotocol PEditableGraph Minimal functionality of an editable graph. (mutable? [g] Returns true if the graph is mutated in place. If true is returned, the other functions change the graph passed as the first argument and return the same graph object. If false is returned, the functions return a new graph and the old graph is unchaged.) (add-node [g n] Adds the node n to the graph g. If it already contained n, the graph will not be changed.) (remove-node [g n] Removes the node n from the graph g. If it did not contain n, the graph will not be changed.) (add-edge [g n1 n2] Adds an edge from node n1 to node n2 to the graph g. If one or both of the nodes is not present it will be added to the graph. If the edge was already present, the graph will not be changed.) (remove-edge [g n1 n2] Removes the edge from node n1 to the node n2 from the graph g. If it did not contain the edge, the graph will not be changed.)) (defprotocol PWeightedGraph Functionality of a graph whose edges can be weighted. (edge-weight [g n1 n2] Returns the weight of the edge from node n1 to node n2.)) (defprotocol PEditableWeightedGraph Functionality of a weighted graph whose weights can be changed. (update-edge-weight [g n1 n2 f] Updates the weight of the edge from node n1 to node n2, where f is a function taking the old value and returning the new one. If the graph did not contain the edge, it will be created.)) (defprotocol PNodeDataGraph Functionality of a graph which stores data with its nodes. (node-data [g n] Returns the data of the node n.)) (defprotocol PEditableNodeDataGraph Functionality of a graph which stores editable data with its nodes. (update-node-data [g n f] Updates the data of the node n, where f is a function taking the old value and returning the new one. If the graph did not contain the node, it will be added.)) (defprotocol PEdgeDataGraph Functionality of a graph which stores data with its edges. (edge-data [g n1 n2] Returns the data of the edge from node n1 to node n2.)) (defprotocol PEditableEdgeDataGraph Functionality of a graph which stores editable data with its edges. (update-edge-data [g n1 n2 f] Changes the data of the edge from node n1 to n2, where f is a function taking the old value and returning the new one. If the graph did not contain the edge, it will be added.)) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: Any suggestions for configuration solution in Clojure or Java world?
Last year I released milieu which I developed at Draker, Inc. I have a few improvements (more features, some of them inspired by caricajure) slated for a release soon. On Jun 17, 2013 12:17 PM, Dick Davies rasput...@hellooperator.net wrote: I glanced at this a while back - does carica support java -jar myuberjar.jar config.clj type invocation, or is it strictly compile the config in a la bundle into the class path? I generally ship the same uberjar around for prod/dev/etc. along with a per-environment config.clj file, and that seems to work great. Would like something to parse configs (so carica looks really good) but I don't like the idea of a preprod.jar , prod.jar etc. On 17 June 2013 18:08, josh rotenberg joshrotenb...@gmail.com wrote: I like carica for configuration: https://github.com/sonian/carica I switched a project over from the typesafe config package (with my own very thin Clojure wrapper around it) to carica and found it really nice to work with. Josh -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
Medical Diagnostic (Expert System)
Hello everyone, I'm a beginner programmer of Clojure language and I have a projet where i need to translate a discusion between a patient and a system to an expert system in clojure.So first here are the basis rules : Rule1 : If hedeach then prescribe analgesichttp://traduction.sensagent.com/analgesic/en-en/ . Rule 2 : if hedeach and sore throat and cough then flu. Rule 3 : if exhausion and hedeach then fever (priority 10). Rule 4 : if hedeach and sore throat then angina (priority 90). Rule 5 : if exhausion then stress (priority 90). And here is the discusion betwwen the patient and the system : Patient : I have a hedeach. System : I suggeste to take an analgesic.Do you have :No, sore throat ? Patien : Yes. System : Do you have a cough ? Patient : No, why ? System : if you have a hedeach and sore throat and cough, I would conclude that you have a flu.It seems like you do not have a flu.Do you feel exhausion recently? Patient : Yes. System : It seems you have an angina or a stress. thank you for your help :) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: Graph API
I think that there's already a project working on this called Loom. The furthest-developed fork is here: https://github.com/aysylu/loom which appears to have protocols for graphs, bindings to Titanium (the Clojurewerkz graph DB library), visualization support, and implementations of several algorithms. Maybe there's a way to incorporate these projects? On Monday, June 17, 2013 3:38:45 PM UTC-4, Stephen Kockentiedt wrote: Hello, I want to create a graph API similar to what core.matrix is for matrices. I have created some protocols which every graph implementation has to satisfy and a prototype implementation. Now I want your feedback on these protocols. Which functions do you want to see which aren't there? Which functions should be changed? Are there problems with the general design? Have you any other feedback? Here are the protocol definitions: (defprotocol PGraph Minimal functionality of a graph. (directed? [g] Returns true if the graph is directed and false if the graph is undirected. If it is undirected, all functions taking two nodes must be commutative with regard to these nodes.) (nodes [g] Returns a set or sequence of all nodes of the graph. May not contain duplicates.) (has-edge? [g n1 n2] Returns true if the graph g has an edge from node n1 to node n2.) (direct-successors [g n] Returns a set or sequence of all nodes n2 for which (has-edge? g n n2) returns true. May not contain duplicates.)) (defprotocol PPredecessorGraph Optional functionality of a graph which can give a list of all direct predecessors of a node. (direct-predecessors [g n] Returns a set or sequence of all nodes n2 for which (has-edge? g n2 n) returns true. May not contain duplicates.)) (defprotocol PEditableGraph Minimal functionality of an editable graph. (mutable? [g] Returns true if the graph is mutated in place. If true is returned, the other functions change the graph passed as the first argument and return the same graph object. If false is returned, the functions return a new graph and the old graph is unchaged.) (add-node [g n] Adds the node n to the graph g. If it already contained n, the graph will not be changed.) (remove-node [g n] Removes the node n from the graph g. If it did not contain n, the graph will not be changed.) (add-edge [g n1 n2] Adds an edge from node n1 to node n2 to the graph g. If one or both of the nodes is not present it will be added to the graph. If the edge was already present, the graph will not be changed.) (remove-edge [g n1 n2] Removes the edge from node n1 to the node n2 from the graph g. If it did not contain the edge, the graph will not be changed.)) (defprotocol PWeightedGraph Functionality of a graph whose edges can be weighted. (edge-weight [g n1 n2] Returns the weight of the edge from node n1 to node n2.)) (defprotocol PEditableWeightedGraph Functionality of a weighted graph whose weights can be changed. (update-edge-weight [g n1 n2 f] Updates the weight of the edge from node n1 to node n2, where f is a function taking the old value and returning the new one. If the graph did not contain the edge, it will be created.)) (defprotocol PNodeDataGraph Functionality of a graph which stores data with its nodes. (node-data [g n] Returns the data of the node n.)) (defprotocol PEditableNodeDataGraph Functionality of a graph which stores editable data with its nodes. (update-node-data [g n f] Updates the data of the node n, where f is a function taking the old value and returning the new one. If the graph did not contain the node, it will be added.)) (defprotocol PEdgeDataGraph Functionality of a graph which stores data with its edges. (edge-data [g n1 n2] Returns the data of the edge from node n1 to node n2.)) (defprotocol PEditableEdgeDataGraph Functionality of a graph which stores editable data with its edges. (update-edge-data [g n1 n2 f] Changes the data of the edge from node n1 to n2, where f is a function taking the old value and returning the new one. If the graph did not contain the edge, it will be added.)) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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
First day with Macros
Hi, My target is to have something like this: (servlet ArticlesServlet (do-get [this request response] (println Get Request)) (do-post [this request response] (println Post Request))) I started with this: (defmacro servlet [servlet-name meths] `(reify Servlet (for [meth ~@meths] (let [[method-name params body] meth camel-case-method-name (hyphenated-camel-case method-name)] (~camel-case-method-name ~@body) But of course, it is not working :) I get: CompilerException java.lang.RuntimeException: Unable to resolve symbol: camel-case-method-name in this context Why? And of course, feel super free to correct my Macro :) 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.
Re: Graph API
Take a look at Tinkerpop's blueprints for a well tested Java API and Archimedes for simple graph operations in Clojure. http://www.tinkerpop.com/ https://github.com/clojurewerkz/archimedes As far as the suggested protocols go, I would suggest doing something useful with them before opening it up to the community for comments. There's not much there to discuss in terms of merits or anything else. -Zack On Monday, June 17, 2013 4:14:34 PM UTC-4, dgrnbrg wrote: I think that there's already a project working on this called Loom. The furthest-developed fork is here: https://github.com/aysylu/loom which appears to have protocols for graphs, bindings to Titanium (the Clojurewerkz graph DB library), visualization support, and implementations of several algorithms. Maybe there's a way to incorporate these projects? On Monday, June 17, 2013 3:38:45 PM UTC-4, Stephen Kockentiedt wrote: Hello, I want to create a graph API similar to what core.matrix is for matrices. I have created some protocols which every graph implementation has to satisfy and a prototype implementation. Now I want your feedback on these protocols. Which functions do you want to see which aren't there? Which functions should be changed? Are there problems with the general design? Have you any other feedback? Here are the protocol definitions: (defprotocol PGraph Minimal functionality of a graph. (directed? [g] Returns true if the graph is directed and false if the graph is undirected. If it is undirected, all functions taking two nodes must be commutative with regard to these nodes.) (nodes [g] Returns a set or sequence of all nodes of the graph. May not contain duplicates.) (has-edge? [g n1 n2] Returns true if the graph g has an edge from node n1 to node n2.) (direct-successors [g n] Returns a set or sequence of all nodes n2 for which (has-edge? g n n2) returns true. May not contain duplicates.)) (defprotocol PPredecessorGraph Optional functionality of a graph which can give a list of all direct predecessors of a node. (direct-predecessors [g n] Returns a set or sequence of all nodes n2 for which (has-edge? g n2 n) returns true. May not contain duplicates.)) (defprotocol PEditableGraph Minimal functionality of an editable graph. (mutable? [g] Returns true if the graph is mutated in place. If true is returned, the other functions change the graph passed as the first argument and return the same graph object. If false is returned, the functions return a new graph and the old graph is unchaged.) (add-node [g n] Adds the node n to the graph g. If it already contained n, the graph will not be changed.) (remove-node [g n] Removes the node n from the graph g. If it did not contain n, the graph will not be changed.) (add-edge [g n1 n2] Adds an edge from node n1 to node n2 to the graph g. If one or both of the nodes is not present it will be added to the graph. If the edge was already present, the graph will not be changed.) (remove-edge [g n1 n2] Removes the edge from node n1 to the node n2 from the graph g. If it did not contain the edge, the graph will not be changed.)) (defprotocol PWeightedGraph Functionality of a graph whose edges can be weighted. (edge-weight [g n1 n2] Returns the weight of the edge from node n1 to node n2.)) (defprotocol PEditableWeightedGraph Functionality of a weighted graph whose weights can be changed. (update-edge-weight [g n1 n2 f] Updates the weight of the edge from node n1 to node n2, where f is a function taking the old value and returning the new one. If the graph did not contain the edge, it will be created.)) (defprotocol PNodeDataGraph Functionality of a graph which stores data with its nodes. (node-data [g n] Returns the data of the node n.)) (defprotocol PEditableNodeDataGraph Functionality of a graph which stores editable data with its nodes. (update-node-data [g n f] Updates the data of the node n, where f is a function taking the old value and returning the new one. If the graph did not contain the node, it will be added.)) (defprotocol PEdgeDataGraph Functionality of a graph which stores data with its edges. (edge-data [g n1 n2] Returns the data of the edge from node n1 to node n2.)) (defprotocol PEditableEdgeDataGraph Functionality of a graph which stores editable data with its edges. (update-edge-data [g n1 n2 f] Changes the data of the edge from node n1 to n2, where f is a function taking the old value and returning the new one. If the graph did not contain the edge, it will be added.)) -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,
Re: First day with Macros
Unquoting 'camel-case-method-name' is going to try and replace the symbol with it's value during compile-time in the context of the macro itself. also, reify isn't going to work if you need a named class to actually wire up your servlet, for example with a web.xml. Also, consider that you'll need some AOT compilation for the container to actually see the servlet class. On Mon, Jun 17, 2013 at 4:38 PM, Hussein B. hubaghd...@gmail.com wrote: Hi, My target is to have something like this: (servlet ArticlesServlet (do-get [this request response] (println Get Request)) (do-post [this request response] (println Post Request))) I started with this: (defmacro servlet [servlet-name meths] `(reify Servlet (for [meth ~@meths] (let [[method-name params body] meth camel-case-method-name (hyphenated-camel-case method-name)] (~camel-case-method-name ~@body) But of course, it is not working :) I get: CompilerException java.lang.RuntimeException: Unable to resolve symbol: camel-case-method-name in this context Why? And of course, feel super free to correct my Macro :) 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: First day with Macros
Here is my fourth attempt: (defmacro servlet [servlet-name meths] `(reify Servlet (for [meth ~meths] (let [[method-name args body] ~meth camel-case-method-name (hyphenated-camel-case ~method-name)] (camel-case-method-name ~args ~@body) Still it is not working :( How to fix it? On Tuesday, June 18, 2013 12:04:50 AM UTC+2, Gary Trakhman wrote: Unquoting 'camel-case-method-name' is going to try and replace the symbol with it's value during compile-time in the context of the macro itself. also, reify isn't going to work if you need a named class to actually wire up your servlet, for example with a web.xml. Also, consider that you'll need some AOT compilation for the container to actually see the servlet class. On Mon, Jun 17, 2013 at 4:38 PM, Hussein B. hubag...@gmail.comjavascript: wrote: Hi, My target is to have something like this: (servlet ArticlesServlet (do-get [this request response] (println Get Request)) (do-post [this request response] (println Post Request))) I started with this: (defmacro servlet [servlet-name meths] `(reify Servlet (for [meth ~@meths] (let [[method-name params body] meth camel-case-method-name (hyphenated-camel-case method-name)] (~camel-case-method-name ~@body) But of course, it is not working :) I get: CompilerException java.lang.RuntimeException: Unable to resolve symbol: camel-case-method-name in this context Why? And of course, feel super free to correct my Macro :) 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 clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. 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: First day with Macros
here's a starting point: https://github.com/mmcgrana/ring/blob/master/ring-servlet/src/ring/util/servlet.clj#L149 On Mon, Jun 17, 2013 at 6:12 PM, Hussein B. hubaghd...@gmail.com wrote: Here is my fourth attempt: (defmacro servlet [servlet-name meths] `(reify Servlet (for [meth ~meths] (let [[method-name args body] ~meth camel-case-method-name (hyphenated-camel-case ~method-name)] (camel-case-method-name ~args ~@body) Still it is not working :( How to fix it? On Tuesday, June 18, 2013 12:04:50 AM UTC+2, Gary Trakhman wrote: Unquoting 'camel-case-method-name' is going to try and replace the symbol with it's value during compile-time in the context of the macro itself. also, reify isn't going to work if you need a named class to actually wire up your servlet, for example with a web.xml. Also, consider that you'll need some AOT compilation for the container to actually see the servlet class. On Mon, Jun 17, 2013 at 4:38 PM, Hussein B. hubag...@gmail.com wrote: Hi, My target is to have something like this: (servlet ArticlesServlet (do-get [this request response] (println Get Request)) (do-post [this request response] (println Post Request))) I started with this: (defmacro servlet [servlet-name meths] `(reify Servlet (for [meth ~@meths] (let [[method-name params body] meth camel-case-method-name (hyphenated-camel-case method-name)] (~camel-case-method-name ~@body) But of course, it is not working :) I get: CompilerException java.lang.RuntimeException: Unable to resolve symbol: camel-case-method-name in this context Why? And of course, feel super free to correct my Macro :) 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 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 clojure@googlegroups.com Note that posts 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.
Performance optimizations dealing with java collections
I'm working on a small clojure program which pulls data from a custom memory-backed data store via a java api. When looking at performance, there is a hotspot at the point of interaction with this API. One of the fields of each record being exported contains a list of lists of strings (ListListString) with about 60-150 items in the outer list and 5 items in the inner list. The problem is that at the point of assimilating this java data type into clojure, there are a couple calls taking ~30-40% of the execution time. Here are the senarios; I'm just starting to get familiar with clojure internals, so forgive obvious blunders in this. Processing it as: (map parse-field (.getAllFields datastore)) with parse-field defined like: (defn parse-field [^List field] ...) or (if I change the API call) (defn parse-field [^[Ljava.lang.String; field] ...) it calls clojure.lang.RestFn.invoke() which wants to build an ArraySeq, which calls java.lang.Class.getComponentType, which is a killer (20 of 50 seconds on 500 records). With parse-field using destructuring, on either the List or String array, clojure.lang.RT.nthFrom() is invoked, which calls java.lang.Class.isArray (https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L773), which is a killer as well. So I inlined parse-field and used loop/recur (instead of map) and .get on the list to get the next item, but this still results in the RestFn.invoke()-ArraysSeq-Class.getComponentType path. This is related to http://dev.clojure.org/jira/browse/CLJ-1200, although called via a different path. Does anyone have any ideas on how I could avoid these calls? Thanks, Tim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: Medical Diagnostic (Expert System)
Look for Charles Forgy and the RETE algorithm. It is the basis for most expert systems. Tim Daly -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: First day with Macros
I can't speak to the issues that Gary raised, but I can help you with your macro. (defmacro servlet [servlet-name meths] `(reify Servlet ~@(for [meth meths] (let [[method-name args body] meth method-name (hyphenated-camel-case method-name)] `(~method-name ~args ~@body) The key here is to keep track of when things are run. The `for` must be run at compile time in order to generate the code we want, so we have to escape it with ~@. The code that the `for` creates (in the form of a list) must then be (quasi-)quoted again by the backtick. Macros certainly take some getting used to. On Tue, Jun 18, 2013 at 8:12 AM, Hussein B. hubaghd...@gmail.com wrote: Here is my fourth attempt: (defmacro servlet [servlet-name meths] `(reify Servlet (for [meth ~meths] (let [[method-name args body] ~meth camel-case-method-name (hyphenated-camel-case ~method-name)] (camel-case-method-name ~args ~@body) Still it is not working :( How to fix it? On Tuesday, June 18, 2013 12:04:50 AM UTC+2, Gary Trakhman wrote: Unquoting 'camel-case-method-name' is going to try and replace the symbol with it's value during compile-time in the context of the macro itself. also, reify isn't going to work if you need a named class to actually wire up your servlet, for example with a web.xml. Also, consider that you'll need some AOT compilation for the container to actually see the servlet class. On Mon, Jun 17, 2013 at 4:38 PM, Hussein B. hubag...@gmail.com wrote: Hi, My target is to have something like this: (servlet ArticlesServlet (do-get [this request response] (println Get Request)) (do-post [this request response] (println Post Request))) I started with this: (defmacro servlet [servlet-name meths] `(reify Servlet (for [meth ~@meths] (let [[method-name params body] meth camel-case-method-name (hyphenated-camel-case method-name)] (~camel-case-method-name ~@body) But of course, it is not working :) I get: CompilerException java.lang.RuntimeException: Unable to resolve symbol: camel-case-method-name in this context Why? And of course, feel super free to correct my Macro :) 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 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 clojure@googlegroups.com Note that posts 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.
Heroku Clojure scheduled tasks versus worker threads
How would you sum up the differences? Does the worker thread simply run all the time? Wouldn't that run up the dyno usage? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: 'foldcat' slower than 'mapv' even for 10,000 elements
Interesting. A possibly stupid question: the input coll is a vector, right? Can you provide a representative example? 2013/6/17 Jim - FooBar(); jimpil1...@gmail.com Hi again, I'm finding that (r/foldcat (r/map f coll)) is consistently slower than a simple mapv, even for a collection of 10,000 elements and more! The fn I'm mapping is a stemming algorithm, not too heavyweight but not too lightweight either... is anyone else finding this strange or am I missing something? Jim -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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+unsubscribe@**googlegroups.comclojure%2bunsubscr...@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+unsubscribe@**googlegroups.comclojure%2bunsubscr...@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 clojure@googlegroups.com Note that posts 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: In what OS do you code?
Gentoo on my pcs and servers. + the occasional ssh shell from my keyboarded android tablet. 2013/6/17 Angel Java Lopez ajlopez2...@gmail.com Windows 8 at work Windows 2008 Server at home Lot of Node.js, C#, Java, PHP coding. Few Clojure, only spikes or little sample, using REPL, sometimes lein Angel Java Lopez @ajlopez On Fri, Jun 14, 2013 at 10:46 AM, Erlis Vidal er...@erlisvidal.comwrote: Hi, I'm a bit curious to know in what OS do you code. Do you prefer iOS, Linux, Windows? Why is that? Because the tools? The environment? Thanks! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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
Thank you! On Monday, June 17, 2013 8:10:19 AM UTC+3, Ambrose Bonnaire-Sergeant wrote: Fantastic news! On Mon, Jun 17, 2013 at 1:04 PM, David Nolen dnolen...@gmail.comjavascript: 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 clojurescrip...@googlegroups.com javascript:. To post to this group, send email to clojur...@googlegroups.comjavascript: . Visit this group at http://groups.google.com/group/clojurescript. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: Any suggestions for configuration solution in Clojure or Java world?
Josh, thank your suggestions. I glanced Carica found look very simple (I hate complex) and nice. Could you share your practices how to deal with difference environments, dev and online? thanks On Tue, Jun 18, 2013 at 1:08 AM, josh rotenberg joshrotenb...@gmail.comwrote: I like carica for configuration: https://github.com/sonian/carica I switched a project over from the typesafe config package (with my own very thin Clojure wrapper around it) to carica and found it really nice to work with. Josh -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: In what OS do you code?
Linux Mint everywhere, but any distro is fine as long as I can run a tiling window manager (i3) and vim on it. People complaining about the hassle really should give Ubuntu/Mint or one of the other really user focused distros a try if they haven't recently, it's really not very difficult anymore. On Friday, June 14, 2013 6:46:37 AM UTC-7, Erlis Vidal wrote: Hi, I'm a bit curious to know in what OS do you code. Do you prefer iOS, Linux, Windows? Why is that? Because the tools? The environment? Thanks! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: Heroku Clojure scheduled tasks versus worker threads
Heroku cron jobs and workers are prorated like dynos. They run in their own processes. So does booting into heroku bash or heroku console. Workers generally consume a queue. I'm not sure what you mean by worker thread though. Workers don't run in a thread, and you can launch plain old threads whenever you want to in your Clojure code. Heroku isn't going to bill you for threads. Perhaps I've misunderstood. On Monday, June 17, 2013 7:27:21 PM UTC-5, Jonathon McKitrick wrote: How would you sum up the differences? Does the worker thread simply run all the time? Wouldn't that run up the dyno usage? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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 clojure.lang.Compiler.LOADER is null in clojure 1.5.1
在 2013年5月9日星期四UTC+8下午2时00分54秒,Stream写道: Hi all i wanna change the classloader of Clojure RT. in 1.5.1 so , i try to clojure.lang.Var.pushThreadBindings(clojure.lang.RT.map( clojure.lang.Compiler.LOADER, cl) ); but throws exception that cojure.lang.Compiler.LOADER is null Caused by: java.lang.NullPointerException at clojure.lang.RT.baseLoader(RT.java:2043) at clojure.lang.RT.load(RT.java:417) at clojure.lang.RT.load(RT.java:411) at clojure.lang.RT.doInit(RT.java:447) at clojure.lang.RT.clinit(RT.java:329) ... 9 more However this is work in the 1.4.0 someone could tell me what had happened in 1.5.1 thanks -- Sorry , i have disappear a month for my own things.. the problem is still hung. i don't how to resolve it , except back version of clojure to 1.4.0 The intention is that vertx project http://vertx.io/ use clojure as one of scriptlang to execute some logical so, i have own classloader which is cl, could load any other lib of jar dynamically. as @atkaaz desc, it seems LOADER has set NULL. and reason @sean corfield has given. i hope someone could give me a idea thanks again. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
Newbie dependency loading issue
Hi, I want to get the clojure.math.numeric-tower namespace into my code using: (require '[clojure.math.numeric-tower :as math]) I also follow the directions on the github for the library to add a lein dependency in Eclipse. Unfortunately, the code does not find the library, even though the lein project pulls in the required jar. FileNotFoundException Could not locate clojure/math/numeric_tower__init.class or clojure/math/numeric_tower.clj on classpath: clojure.lang.RT.load What am I doing wrong? I am using Eclipse Juno and the CCW plugin. Thanks! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: Graph API
Loom was indeed working on this, and it's a very nice library. One thing that I particularly liked about Justin's design, was the ability to run a graph algorithm without worrying about conforming to a particular graph representation. See for example the bread first search function, here: https://github.com/jkk/loom/blob/master/src/loom/alg_generic.clj#L110 All the bfs function requires is a neighbors function and and a start vertex. Simple and easy to use. Justin had said that he won't be actively developing loom for the forseeable future; I was hoping to develop it further, but I only got as far as implementing a max flow algorithm before the rest of my life got in the way of my plans. I know that Aysylu was doing a fair amount of work on loom, so I'd guess that her repo is the most advanced one. Stephen: I think the set of protocols above is good, better than Loom's in fact; notably, the decision to make direct-predecessors optional is the correct one, and a lot of graph libraries get that wrong. If you want to compare how loom did it: https://github.com/jkk/loom/blob/master/src/loom/graph.clj On Monday, June 17, 2013 1:14:34 PM UTC-7, dgrnbrg wrote: I think that there's already a project working on this called Loom. The furthest-developed fork is here: https://github.com/aysylu/loom which appears to have protocols for graphs, bindings to Titanium (the Clojurewerkz graph DB library), visualization support, and implementations of several algorithms. Maybe there's a way to incorporate these projects? On Monday, June 17, 2013 3:38:45 PM UTC-4, Stephen Kockentiedt wrote: Hello, I want to create a graph API similar to what core.matrix is for matrices. I have created some protocols which every graph implementation has to satisfy and a prototype implementation. Now I want your feedback on these protocols. Which functions do you want to see which aren't there? Which functions should be changed? Are there problems with the general design? Have you any other feedback? Here are the protocol definitions: (defprotocol PGraph Minimal functionality of a graph. (directed? [g] Returns true if the graph is directed and false if the graph is undirected. If it is undirected, all functions taking two nodes must be commutative with regard to these nodes.) (nodes [g] Returns a set or sequence of all nodes of the graph. May not contain duplicates.) (has-edge? [g n1 n2] Returns true if the graph g has an edge from node n1 to node n2.) (direct-successors [g n] Returns a set or sequence of all nodes n2 for which (has-edge? g n n2) returns true. May not contain duplicates.)) (defprotocol PPredecessorGraph Optional functionality of a graph which can give a list of all direct predecessors of a node. (direct-predecessors [g n] Returns a set or sequence of all nodes n2 for which (has-edge? g n2 n) returns true. May not contain duplicates.)) (defprotocol PEditableGraph Minimal functionality of an editable graph. (mutable? [g] Returns true if the graph is mutated in place. If true is returned, the other functions change the graph passed as the first argument and return the same graph object. If false is returned, the functions return a new graph and the old graph is unchaged.) (add-node [g n] Adds the node n to the graph g. If it already contained n, the graph will not be changed.) (remove-node [g n] Removes the node n from the graph g. If it did not contain n, the graph will not be changed.) (add-edge [g n1 n2] Adds an edge from node n1 to node n2 to the graph g. If one or both of the nodes is not present it will be added to the graph. If the edge was already present, the graph will not be changed.) (remove-edge [g n1 n2] Removes the edge from node n1 to the node n2 from the graph g. If it did not contain the edge, the graph will not be changed.)) (defprotocol PWeightedGraph Functionality of a graph whose edges can be weighted. (edge-weight [g n1 n2] Returns the weight of the edge from node n1 to node n2.)) (defprotocol PEditableWeightedGraph Functionality of a weighted graph whose weights can be changed. (update-edge-weight [g n1 n2 f] Updates the weight of the edge from node n1 to node n2, where f is a function taking the old value and returning the new one. If the graph did not contain the edge, it will be created.)) (defprotocol PNodeDataGraph Functionality of a graph which stores data with its nodes. (node-data [g n] Returns the data of the node n.)) (defprotocol PEditableNodeDataGraph Functionality of a graph which stores editable data with its nodes. (update-node-data [g n f] Updates the data of the node n, where f is a function taking the old value and
Re: Newbie dependency loading issue
What did you put in your project.clj file? On Mon, Jun 17, 2013 at 6:30 PM, P Martin prof.pmarti...@gmail.com wrote: Hi, I want to get the clojure.math.numeric-tower namespace into my code using: (require '[clojure.math.numeric-tower :as math]) I also follow the directions on the github for the library to add a lein dependency in Eclipse. Unfortunately, the code does not find the library, even though the lein project pulls in the required jar. FileNotFoundException Could not locate clojure/math/numeric_tower__init.class or clojure/math/numeric_tower.clj on classpath: clojure.lang.RT.load What am I doing wrong? I am using Eclipse Juno and the CCW plugin. Thanks! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.
Multiple args: opts map vs inline arguments
Hey folks, What'c considered more idiomatic when having multiple, optional arguments? (defn foo1 [a b args] (let [opts (apply hash-map args] ...)) or (defn foo2 [a b opts] ...) Cheers, Omer -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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 args: opts map vs inline arguments
According, to the library coding standards, the first is better: (release-sharks 2 :laser-beams true); good (release-sharks 2 {:laser-beams true}) ; bad http://dev.clojure.org/display/design/Library+Coding+Standards On Tuesday, June 18, 2013 5:26:15 PM UTC+12, Omer Iqbal wrote: Hey folks, What'c considered more idiomatic when having multiple, optional arguments? (defn foo1 [a b args] (let [opts (apply hash-map args] ...)) or (defn foo2 [a b opts] ...) Cheers, Omer -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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: In what OS do you code?
OS X on the working machine, Ubuntu on the servers. For my project it makes little difference, especially with *brew* on the mac. Currently moving from vi to emacs. On Saturday, June 15, 2013 1:46:37 AM UTC+12, Erlis Vidal wrote: Hi, I'm a bit curious to know in what OS do you code. Do you prefer iOS, Linux, Windows? Why is that? Because the tools? The environment? Thanks! -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to 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.