Re: Need help for the macro with defn and defmacro inside
Hi, I think you have some misunderstandings here how things work. * the # notation works only *inside* a syntax-quote. * you have to create locals with # notation. * var is a special form which looks up the Var named by the given Symbol. (defmacro create-database-methods [table] (let [kw-table (keyword table)] `(do (defn ~(symbol (str drop- table)) [] (try (drop-table ~kw-table) (catch Exception _))) (defn ~(symbol (str insert- table)) [data#] (insert-value ~kw-table (keys data#) (vals data#))) (defn ~(symbol (str update- table)) [id# attribute-map#] (update-values ~kw-table [id=? id#] attribute-map#)) (defmacro ~'select-userentry [id# body#] `(with-transaction (with-query-results rs [~~(str select * from table where id=?) ~id#] ~...@body#)) Note: this will only work with a literal string as table argument! (create-database-methods table) As a general advice: you are probably better of writing these as functions and then specialise them via currying. (defn drop [table] (try (drop-table table) (catch Exception _))) (defmacro create-database-methods [table] (let [kw-table (keyword table)] `(do (def ~(symbol (str drop- table)) (partial drop ~kw-table)) ...))) Hope this helps. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Windows: SLIME/Swank freezes on GUI-related input. (Was: Stumped - Java hangs when using Swing in Slime)
As of Clojure 1.1.0, the problem still persists. Apparently, it seems to be linked to Slime input that involves GUI- related system calls. On my system (Windows XP SP3, 32 Bit, JRE 1.6.0_18, JDK 1.6.0_12) it can be reproduced as follows: 1. Install Clojure Box 1.1.0 (January 5, 2010) 2. Start the Slime REPL and enter these lines: (use 'clojure.contrib.repl-utils) (javadoc snafu) Result: The Slime REPL stalls and doesn't return a result. 4. Visit the *inferior-lisp* REPL buffer and place your cursor at the command line. Press 'return'. Result: The Slime thread continues and opens a Javadoc browser window. The Slime REPL returns. When the above lines are entered directly into the *inferior-lisp* buffer they get executed promptly and without errors. I haven't noticed any such problems on my Mac and Linux boxes. On Windows, I keep some Elisp around to swiftly revive a stuck Slime session: (defun slime-poke-clojure () (interactive) (slime-send-to-process \n)) (defun slime-send-to-process (command) (interactive) (let ((slime (slime-inferior-process))) (if slime (comint-redirect-send-command-to-process command (process-buffer slime) slime nil t) (message No Slime process running. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojure slides
http://github.com/stuarthalloway/clojure-presentations Creative Commons License. Enjoy. Stu Looks like I'll be doing a talk on clojure next week at the local java user group. Any recommendations on slides I can steal? :) -- Omnem crede diem tibi diluxisse supremum. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? Rich -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
On Mar 4, 2010, at 8:00 AM, Rich Hickey wrote: On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? Rich +1 It was very disconcerting when I first subscribed. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
On 4 March 2010 09:56, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? The headers already contain these (amongst others) that can reliably (even more so than the subject) be used to group emails into folders: Mailing-list: list clojure@googlegroups.com; contact clojure+own...@googlegroups.com List-ID: clojure.googlegroups.com Sender: clojure@googlegroups.com e.g. in gmail I use the following filter: Matches: list:(clojure.googlegroups.com) Do this: Skip Inbox, Apply label clojure -- Michael Wood esiot...@gmail.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
Hi, On Mar 4, 2:00 pm, Rich Hickey richhic...@gmail.com wrote: It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? Mailing lists usually generate a List-Id header, which identifies the mail to come from a list and in particular from which list. So it should be easy to filter mail based on this header field. Adding a tag to the Subject header field is rather a hack. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
+1 many quick interfaces show only the title. Adding [clojure] would be fine. On Thu, Mar 4, 2010 at 10:05 AM, Johnny Kwan johnny.c.k...@gmail.comwrote: On Mar 4, 2010, at 8:00 AM, Rich Hickey wrote: On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
Rich Hickey richhic...@gmail.com writes: On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? It pollutes the Subject line for no good reason, anyone can filter based on headers anyway. This is useful only for people who don't filter their mail and drop everything into one huge inbox. --J. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
True what said, but sometimes I filter things on subject instead of list as it is all the same for me (e.g. clojure and compojure-list on the same label) and there it can be useful as well. Now I have compojure (low-volume) and clojure (high-volume) split up and it's just not worth it for the seldom appearing compojure-mails, but to see it's a compojure-thing is useful still. If some want it, +1 for me as well. If the objections to the tag are well-motivated and blocking, no sweat. 2010/3/4 Jan Rychter j...@rychter.com: Rich Hickey richhic...@gmail.com writes: On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? It pollutes the Subject line for no good reason, anyone can filter based on headers anyway. This is useful only for people who don't filter their mail and drop everything into one huge inbox. --J. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- Communication is essential. So we need decent tools when communication is lacking, when language capability is hard to acquire... - http://esperanto.net - http://esperanto-jongeren.nl Linux-user #496644 (http://counter.li.org) - first touch of linux in 2004 -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
Hi Jan, My 2c: Leiningen is an important step, but there is still plenty to do. My workflow: I am developing multiple Clojure libraries and applications, with some of the dependencies changing daily. Whenever I want to make a change, I: In the project being changed: git tag a new version number update the project.clj to a new version number run lein pom and lein jar copy the new files to a repos (clojars) In projects that depend on changed project update the dependency in project.clj (if it is hard coded and not =) run lein deps This seems adequate to me (although there could be a bit more automation). The problem of snapshot dependencies remains. The solution that springs to mind here is to get projects off snapshots (presumably by releasing more incremental versions). Library authors: please release lots of versions! (or tell me why this is a bad idea). Some needs I see: (0) More point releases of key libs (or some other solution to the snapshots problem) (1) Unify around the project structure imposed by lein, and/or (2) Improve the project structure imposed by lein, if it is broken in some specific way. (Maybe add a well-known config file for adding elements to the classpath?) (3) lein deps (or some other task) to clean up old jars. Right now I am deleting them by hand from the lib directory. (Is this already solved?) Stu I haven't hacked on new Clojure stuff for the past two months or so. Now, having updated my repositories, I find that everybody just dropped ant and moved to leiningen. I tried to make sense of things, but can't. I must be missing something big here. It seems that leiningen assumes that you are building an application. It downloads all dependencies and can build an uberjar for you. That's great, but what if what I have is a bunch of libraries, all being developed and modified? Also, I now have at least six clojure jars in ~/.m2 (huh?!), along with a collection of other assorted stuff. I don't want to use any of these clojure jars, I have a checked out git repo with clojure and this is the only code I want to run. Also, swank-clojure insists on having its own clojure jar in ~/.swank-clojure (why?). I used to have a bunch of directories with git repos. I would update those, run ant to gather code into jars, fiddle with the classpath in my custom-crafted clj script, symlink things around. It was about as bad as with Common Lisp. But now things got worse -- I no longer feel in control of anything. Some things won't build, lein tells me about artifacts (huh?!), things get installed in weird places. My clj script that gets run by SLIME form Emacs can't find libraries that leiningen downloaded. How do people deal with this? As a more general observation, I think that a large part of Perl's and Python's success was a unified way of dealing with libraries. There are certain directories where you can drop libraries and expect them to work (be found). There is ONE way of running the VM (one script, blessed by the language creator). Then on top of that there is CPAN, which plugs into that, downloading dependencies and dropping libraries into those well-known directories. It isn't perfect, but it works, and is predictable. Shouldn't we have a well-known Single Setup for Clojure as well? I am very worried that Clojure is rapidly going the Common Lisp way, with each developer having his own precious carefully crafted setup. Every system is different, everyone uses a different script to run clojure programs, there is no single place to drop your libraries into, and libraries have no conventions on where their code is (what do I add to classpath once I have a library checked out?). I thought Leiningen was supposed to solve these issues, but either I am missing something, or it is really a tool to manage dependencies for a single application. --J. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
artifacts (huh?!), things get installed in weird places. My clj script that gets run by SLIME form Emacs can't find libraries that leiningen downloaded. lein deps copies dependencies into the project's lib directory. Various other lein commands assume lib/*.jar is on the classpath, and if you are writing scripts you should assume that classpath as well. Is this good enough? Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? -1. The metadata is already available where metadata is supposed to be (the headers). Clojure does metadata right, the mailing list should too. :-) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
I agree that this would obstruct the subject line needlessly, a particularly inconvenient thing for anyone who (like me) often reads list emails on devices with very small screens. The list is high-volume enough that I suspect the vast majority of readers filter list emails away from their main inbox. If this is right, the demand for subject-line differentiation is probably low. On 3/4/10, Jan Rychter j...@rychter.com wrote: Rich Hickey richhic...@gmail.com writes: On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? It pollutes the Subject line for no good reason, anyone can filter based on headers anyway. This is useful only for people who don't filter their mail and drop everything into one huge inbox. --J. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- Sent from my mobile device -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
The .m2 folder is a Maven 2 convention. Leiningen uses Maven internally. .m2 contains your local repository - the single standard place where stuff gets downloaded to. When doing lein deps in a project folder any dependencies are downloaded to your local repo first (unless you already had the library in your .m2 folder) and then copied to the projects local lib folder. Maven is largely convention based, if anything about leiningen seems weird and you can't find it in the lein docs try browsing the Maven 2 docs. On Mar 4, 2:33 pm, Jan Rychter j...@rychter.com wrote: I haven't hacked on new Clojure stuff for the past two months or so. Now, having updated my repositories, I find that everybody just dropped ant and moved to leiningen. I tried to make sense of things, but can't. I must be missing something big here. It seems that leiningen assumes that you are building an application. It downloads all dependencies and can build an uberjar for you. That's great, but what if what I have is a bunch of libraries, all being developed and modified? Also, I now have at least six clojure jars in ~/.m2 (huh?!), along with a collection of other assorted stuff. I don't want to use any of these clojure jars, I have a checked out git repo with clojure and this is the only code I want to run. Also, swank-clojure insists on having its own clojure jar in ~/.swank-clojure (why?). I used to have a bunch of directories with git repos. I would update those, run ant to gather code into jars, fiddle with the classpath in my custom-crafted clj script, symlink things around. It was about as bad as with Common Lisp. But now things got worse -- I no longer feel in control of anything. Some things won't build, lein tells me about artifacts (huh?!), things get installed in weird places. My clj script that gets run by SLIME form Emacs can't find libraries that leiningen downloaded. How do people deal with this? As a more general observation, I think that a large part of Perl's and Python's success was a unified way of dealing with libraries. There are certain directories where you can drop libraries and expect them to work (be found). There is ONE way of running the VM (one script, blessed by the language creator). Then on top of that there is CPAN, which plugs into that, downloading dependencies and dropping libraries into those well-known directories. It isn't perfect, but it works, and is predictable. Shouldn't we have a well-known Single Setup for Clojure as well? I am very worried that Clojure is rapidly going the Common Lisp way, with each developer having his own precious carefully crafted setup. Every system is different, everyone uses a different script to run clojure programs, there is no single place to drop your libraries into, and libraries have no conventions on where their code is (what do I add to classpath once I have a library checked out?). I thought Leiningen was supposed to solve these issues, but either I am missing something, or it is really a tool to manage dependencies for a single application. --J. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: name clash/problem with refer
On Mar 3, 11:03 pm, Meikel Brandmeyer m...@kotka.de wrote: Almost correct: (use '[clojure.contrib.string :exclude (repeat)]) That did it. Thanks! I finally had to do this to get the whole package to load: user= (use '[clojure.contrib.string :exclude (repeat butlast reverse get partition drop take)]) I wonder if it would make sense to rename some of those functions to reduce the number of clashes with core. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: name clash/problem with refer
Hi, On Mar 4, 4:11 pm, cageface milese...@gmail.com wrote: I wonder if it would make sense to rename some of those functions to reduce the number of clashes with core. It's considered a feature that the names of core are duplicated for similar functionality. This might or might not be a good thing. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On Mar 4, 8:52 am, Stuart Halloway stuart.hallo...@gmail.com wrote: My 2c: Leiningen is an important step, but there is still plenty to do. Oh yeah. Some needs I see: (0) More point releases of key libs (or some other solution to the snapshots problem) Yes! (1) Unify around the project structure imposed by lein, and/or As many of you know, I've always been tepid on lein. I'd rather go with Maven whole-hog, because that offers the most robust model for incorporating Java libraries. The more we can leverage the Java tool set, the better. I'd rather lein were just a thin POM generator for those who can't stand writing XML. -SS -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Using deftype to define mutually recursive data inside agent
deftype just defines a map-like structure with fixed fields; it isn't going to change the way you deal with that structure in an Agent. -SS On Mar 3, 5:02 am, zahardzhan zahardz...@gmail.com wrote: Sorry my english I use in my small clojure program one complicated mutually-recursive data structure that represents an agent-in-environment. This structure is clojure agent which have self-reference inside himself and reference to environment, where environment is set of agents: (let [a (agent {:some state})] (send a assoc :self (delay a) ;; this is self-reference :env (ref (delay (set a ;; this is reference to environment in which agent live (await a) a) ;; my agent Is there a better way to declare this agent using deftype? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: name clash/problem with refer
I wonder if it would make sense to rename some of those functions to reduce the number of clashes with core. Preferred is (require '[clojure.contrib.string :as str]) Stu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: recursive call boxing primitives?
On Mar 1, 5:33 pm, John Lawrence Aspden aspd...@googlemail.com wrote: Is the reason the Clojure version is slow that recursive calls to draw- tree are boxing and unboxing primitive types? Recursive calls, like all Clojure function calls, force boxing. This may or may not have anything to do with the performance difference you are seeing. True primitive support for function arguments is planned for a future release. -SS -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On 04.03.2010, at 14:33, Jan Rychter wrote: It seems that leiningen assumes that you are building an application. It downloads all dependencies and can build an uberjar for you. That's great, but what if what I have is a bunch of libraries, all being developed and modified? That's my situation as well. I did start to use Leiningen, but only for producing releases for the outside world. On my development machine, it's the source code directories of all libraries that are on my classpath. That way I am sure which version of the code I am running. with Common Lisp. But now things got worse -- I no longer feel in control of anything. Some things won't build, lein tells me about artifacts (huh?!), things get installed in weird places. My clj script that gets run by SLIME form Emacs can't find libraries that leiningen downloaded. How do people deal with this? Here's what works for me. Each of my libraries is one project in the sense of swank-clojure. I use swank-clojure-project to start Clojure inside slime, and that takes care of my classpath. All I need to do is have the right stuff in the lib subdirectory of each project, so that's where are all the configuration is done. Instead of doing something like lein deps to fill the lib subdirectories, I decided to manage them manually and have only soft links in there that point to the real jars and source directories. There's one soft link to the clojure jar (the one I rebuild after each git pull from github), one for clojure-contrib (same principle), and one for swank-clojure (same again). All other dependencies on Clojure libraries are soft links to the source code directory inside the respective project directories. Dependencies on external Java libs are soft links to the jar files, which reside in a single place on my hard disk. As a more general observation, I think that a large part of Perl's and Python's success was a unified way of dealing with libraries. There are certain directories where you can drop libraries and expect them to work (be found). There is ONE way of running the VM (one script, blessed by the language creator). Then on top of that there is CPAN, which plugs into that, downloading dependencies and dropping libraries into those well-known directories. It isn't perfect, but it works, and is predictable. Right, but its imperfections have bothered me often enough. For once, if you have different applications that require different versions of the same library, you are in for a major headache. Python setuptools and its eggs are a partial solution, but add a lot of complexity of their own. Another source of endless frustration is maintaining a personal library installation on a machine where I don't have administrator rights and need to work with multiple Python versions. It's possible, but it's a big mess and I need to be very careful to be sure that I really use the version that I need. I am not too unhappy with the JVM approach to configurability via classpath, but it requires a layer of management tools and/or conventions to be productive. What doesn't fit with my JVM world-view is Maven, and thus leiningen. Their dependency handling model is clearly geared towards application deployment rather than library development. Moreover, I think their model is too complicated, making it difficult to predict which jars will end up being used where. But perhaps that's just my lack of experience. Shouldn't we have a well-known Single Setup for Clojure as well? It would perhaps be a good idea to have one default setup, with the option for expert users to roll their own. For newcomers the current situation is definitely too messy. I add to classpath once I have a library checked out?). I thought Leiningen was supposed to solve these issues, but either I am missing something, or it is really a tool to manage dependencies for a single application. That's my view of what it is, but I can't claim much experience with it. Konrad. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
Garth, J, It is precisely the point that I would like to differentiate emails away from my main inbox. I use thunderbird as my mail reader and I cannot find a way to differentiate clojure emails. I use the mailing list tag as a way to filter all other groups and they all seem to use the [groupname] tag convention. If you know of a way to filter emails by list-id in thunderbird I will withdraw the suggestion. Tim Garth Sheldon-Coulson wrote: I agree that this would obstruct the subject line needlessly, a particularly inconvenient thing for anyone who (like me) often reads list emails on devices with very small screens. The list is high-volume enough that I suspect the vast majority of readers filter list emails away from their main inbox. If this is right, the demand for subject-line differentiation is probably low. On 3/4/10, Jan Rychter j...@rychter.com wrote: Rich Hickey richhic...@gmail.com writes: On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? It pollutes the Subject line for no good reason, anyone can filter based on headers anyway. This is useful only for people who don't filter their mail and drop everything into one huge inbox. --J. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
Lein could be a step in the right direction, but I wonder how it will manage to evolve given the complex tools it uses internally. I have also seen a weird issue in my code base which has two classes derived from java.lang.Exception. If I do a clean and try compile, I get an error saying that my.package.MyException class not found. My workaround is, set :namespaces to only those Exception derived classes, compile and then set :namespaces to :all. Maybe I am missing some cool lein thing here or lein needs quite a bit of work in dependency handling. I am tempted to just stick to mvn which is quite mature and well-documented. Any clojure-specific needs could be addressed through a plug-in. Comments, thoughts? Thanks, Praki On Thu, Mar 4, 2010 at 5:52 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: Hi Jan, My 2c: Leiningen is an important step, but there is still plenty to do. My workflow: I am developing multiple Clojure libraries and applications, with some of the dependencies changing daily. Whenever I want to make a change, I: In the project being changed: git tag a new version number update the project.clj to a new version number run lein pom and lein jar copy the new files to a repos (clojars) In projects that depend on changed project update the dependency in project.clj (if it is hard coded and not =) run lein deps This seems adequate to me (although there could be a bit more automation). The problem of snapshot dependencies remains. The solution that springs to mind here is to get projects off snapshots (presumably by releasing more incremental versions). Library authors: please release lots of versions! (or tell me why this is a bad idea). Some needs I see: (0) More point releases of key libs (or some other solution to the snapshots problem) (1) Unify around the project structure imposed by lein, and/or (2) Improve the project structure imposed by lein, if it is broken in some specific way. (Maybe add a well-known config file for adding elements to the classpath?) (3) lein deps (or some other task) to clean up old jars. Right now I am deleting them by hand from the lib directory. (Is this already solved?) Stu I haven't hacked on new Clojure stuff for the past two months or so. Now, having updated my repositories, I find that everybody just dropped ant and moved to leiningen. I tried to make sense of things, but can't. I must be missing something big here. It seems that leiningen assumes that you are building an application. It downloads all dependencies and can build an uberjar for you. That's great, but what if what I have is a bunch of libraries, all being developed and modified? Also, I now have at least six clojure jars in ~/.m2 (huh?!), along with a collection of other assorted stuff. I don't want to use any of these clojure jars, I have a checked out git repo with clojure and this is the only code I want to run. Also, swank-clojure insists on having its own clojure jar in ~/.swank-clojure (why?). I used to have a bunch of directories with git repos. I would update those, run ant to gather code into jars, fiddle with the classpath in my custom-crafted clj script, symlink things around. It was about as bad as with Common Lisp. But now things got worse -- I no longer feel in control of anything. Some things won't build, lein tells me about artifacts (huh?!), things get installed in weird places. My clj script that gets run by SLIME form Emacs can't find libraries that leiningen downloaded. How do people deal with this? As a more general observation, I think that a large part of Perl's and Python's success was a unified way of dealing with libraries. There are certain directories where you can drop libraries and expect them to work (be found). There is ONE way of running the VM (one script, blessed by the language creator). Then on top of that there is CPAN, which plugs into that, downloading dependencies and dropping libraries into those well-known directories. It isn't perfect, but it works, and is predictable. Shouldn't we have a well-known Single Setup for Clojure as well? I am very worried that Clojure is rapidly going the Common Lisp way, with each developer having his own precious carefully crafted setup. Every system is different, everyone uses a different script to run clojure programs, there is no single place to drop your libraries into, and libraries have no conventions on where their code is (what do I add to classpath once I have a library checked out?). I thought Leiningen was supposed to solve these issues, but either I am missing something, or it is really a tool to manage dependencies for a single application. --J. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from
Re: name clash/problem with refer
On Mar 4, 7:21 am, Stuart Halloway stuart.hallo...@gmail.com wrote: Preferred is (require '[clojure.contrib.string :as str]) That's an easy solution. 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
Re: group tag for clojure newsgroup
Hi Tim, I just downloaded Thunderbird to take a look, and I haven't tested this, but you might try the following (have you already tried this? you mentioned List-ID, so maybe this doesn't work...): - Open the filters dialog, click New - Create a new filter (click the + in the top list) - In the dropdown to select the message header to filter by, choose Customize - Add List-ID as a new message header, click Add, click OK - In the dropdown, select the new List-ID header (it's not selected by default even after the new addition) - For the match pattern, use contains and clojure@googlegroups.com If this doesn't work, let me know and I'll try troubleshooting it on my mail. Garth On Thu, Mar 4, 2010 at 9:53 AM, Tim Daly d...@axiom-developer.org wrote: Garth, J, It is precisely the point that I would like to differentiate emails away from my main inbox. I use thunderbird as my mail reader and I cannot find a way to differentiate clojure emails. I use the mailing list tag as a way to filter all other groups and they all seem to use the [groupname] tag convention. If you know of a way to filter emails by list-id in thunderbird I will withdraw the suggestion. Tim Garth Sheldon-Coulson wrote: I agree that this would obstruct the subject line needlessly, a particularly inconvenient thing for anyone who (like me) often reads list emails on devices with very small screens. The list is high-volume enough that I suspect the vast majority of readers filter list emails away from their main inbox. If this is right, the demand for subject-line differentiation is probably low. On 3/4/10, Jan Rychter j...@rychter.com wrote: Rich Hickey richhic...@gmail.com writes: On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? It pollutes the Subject line for no good reason, anyone can filter based on headers anyway. This is useful only for people who don't filter their mail and drop everything into one huge inbox. --J. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.comclojure%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 post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.comclojure%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 post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
Sorry, made a mistake. List-ID header contains clojure.googlegroups.com Mailing-list header contains clojure@googlegroups.com Note the @. On Thu, Mar 4, 2010 at 12:06 PM, Garth Sheldon-Coulson g...@mit.edu wrote: Hi Tim, I just downloaded Thunderbird to take a look, and I haven't tested this, but you might try the following (have you already tried this? you mentioned List-ID, so maybe this doesn't work...): - Open the filters dialog, click New - Create a new filter (click the + in the top list) - In the dropdown to select the message header to filter by, choose Customize - Add List-ID as a new message header, click Add, click OK - In the dropdown, select the new List-ID header (it's not selected by default even after the new addition) - For the match pattern, use contains and clojure@googlegroups.com If this doesn't work, let me know and I'll try troubleshooting it on my mail. Garth On Thu, Mar 4, 2010 at 9:53 AM, Tim Daly d...@axiom-developer.org wrote: Garth, J, It is precisely the point that I would like to differentiate emails away from my main inbox. I use thunderbird as my mail reader and I cannot find a way to differentiate clojure emails. I use the mailing list tag as a way to filter all other groups and they all seem to use the [groupname] tag convention. If you know of a way to filter emails by list-id in thunderbird I will withdraw the suggestion. Tim Garth Sheldon-Coulson wrote: I agree that this would obstruct the subject line needlessly, a particularly inconvenient thing for anyone who (like me) often reads list emails on devices with very small screens. The list is high-volume enough that I suspect the vast majority of readers filter list emails away from their main inbox. If this is right, the demand for subject-line differentiation is probably low. On 3/4/10, Jan Rychter j...@rychter.com wrote: Rich Hickey richhic...@gmail.com writes: On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? It pollutes the Subject line for no good reason, anyone can filter based on headers anyway. This is useful only for people who don't filter their mail and drop everything into one huge inbox. --J. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.comclojure%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 post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.comclojure%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 post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: group tag for clojure newsgroup
Garth, Worked. Thank you. Rich, consider the question closed. Tim Garth Sheldon-Coulson wrote: Hi Tim, I just downloaded Thunderbird to take a look, and I haven't tested this, but you might try the following (have you already tried this? you mentioned List-ID, so maybe this doesn't work...): - Open the filters dialog, click New - Create a new filter (click the + in the top list) - In the dropdown to select the message header to filter by, choose Customize - Add List-ID as a new message header, click Add, click OK - In the dropdown, select the new List-ID header (it's not selected by default even after the new addition) - For the match pattern, use contains and clojure@googlegroups.com mailto:clojure@googlegroups.com If this doesn't work, let me know and I'll try troubleshooting it on my mail. Garth On Thu, Mar 4, 2010 at 9:53 AM, Tim Daly d...@axiom-developer.org mailto:d...@axiom-developer.org wrote: Garth, J, It is precisely the point that I would like to differentiate emails away from my main inbox. I use thunderbird as my mail reader and I cannot find a way to differentiate clojure emails. I use the mailing list tag as a way to filter all other groups and they all seem to use the [groupname] tag convention. If you know of a way to filter emails by list-id in thunderbird I will withdraw the suggestion. Tim Garth Sheldon-Coulson wrote: I agree that this would obstruct the subject line needlessly, a particularly inconvenient thing for anyone who (like me) often reads list emails on devices with very small screens. The list is high-volume enough that I suspect the vast majority of readers filter list emails away from their main inbox. If this is right, the demand for subject-line differentiation is probably low. On 3/4/10, Jan Rychter j...@rychter.com mailto:j...@rychter.com wrote: Rich Hickey richhic...@gmail.com mailto:richhic...@gmail.com writes: On Mar 4, 2:56 am, TimDaly d...@axiom-developer.org mailto:d...@axiom-developer.org wrote: For the other groups that I subscribe to, the email subjects are always prefixed with the group name, e.g. Re: [sage-devel] This is the mail subject This makes it possible to reliably group the emails into folders. Is it possible to do the same for Clojure and Clojure-dev? It is possible for me to put a [Clojure] prefix on the emails. Does anyone have any objections to that? It pollutes the Subject line for no good reason, anyone can filter based on headers anyway. This is useful only for people who don't filter their mail and drop everything into one huge inbox. --J. -- You 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 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 post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated -
Re: Leiningen, Clojure and libraries: what am I missing?
Hi, On Thu, Mar 04, 2010 at 07:11:59AM -0800, Praki Prakash wrote: I have also seen a weird issue in my code base which has two classes derived from java.lang.Exception. If I do a clean and try compile, I get an error saying that my.package.MyException class not found. My workaround is, set :namespaces to only those Exception derived classes, compile and then set :namespaces to :all. You have to :require the namespaces implementing the exceptions in the files were you use the Exceptions. This will resolve the dependency problem. See here: http://tr.im/FNmt Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On 4 March 2010 10:19, Stuart Sierra the.stuart.sie...@gmail.com wrote: As many of you know, I've always been tepid on lein. I'd rather go with Maven whole-hog, because that offers the most robust model for incorporating Java libraries. Out of interest, what scenarios does Maven account for that Leiningen currently does not? The more we can leverage the Java tool set, the better. I'd rather lein were just a thin POM generator for those who can't stand writing XML. I personally favour the opposite approach :). Whilst Java provides a lot of useful functionality, I've never been particularly impressed with the way most Java libraries are designed. - James -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On Thu, Mar 4, 2010 at 10:59 AM, Konrad Hinsen konrad.hin...@fastmail.netwrote: Right, but its imperfections have bothered me often enough. For once, if you have different applications that require different versions of the same library, you are in for a major headache. Python setuptools and its eggs are a partial solution, but add a lot of complexity of their own. Another source of endless frustration is maintaining a personal library installation on a machine where I don't have administrator rights and need to work with multiple Python versions. It's possible, but it's a big mess and I need to be very careful to be sure that I really use the version that I need. Imperfections meaning it's perfectly broken :) That's why tools like virtualenv exist for Python. David -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On Thu, Mar 4, 2010 at 8:33 AM, Jan Rychter j...@rychter.com wrote: Also, I now have at least six clojure jars in ~/.m2 (huh?!), along with a collection of other assorted stuff. I don't want to use any of these clojure jars, I have a checked out git repo with clojure and this is the only code I want to run. Also, swank-clojure insists on having its own clojure jar in ~/.swank-clojure (why?). Except the libraries you're consuming with Lein might require specific versions of Clojure and not the bleeding edge. I used to have a bunch of directories with git repos. I would update those, run ant to gather code into jars, fiddle with the classpath in my custom-crafted clj script, symlink things around. It was about as bad as with Common Lisp. But now things got worse -- I no longer feel in control of anything. Some things won't build, lein tells me about artifacts (huh?!), things get installed in weird places. My clj script that gets run by SLIME form Emacs can't find libraries that leiningen downloaded. In my experience haven gone through everything you've described Lein has made things at least an order of magnitude simpler. You no longer have to do things by hand. Even better you can use other people's libraries in a much more straightforward manner. Case in point Penumbra, an OpenGL library for Clojure. To get Penumbra to work w/o Lein you need to: a) get the Penumbra library from source b) get the LWJGL 2.2.2 jars and native libraries c) know how to set your class path to point to not only the jars but to the correct native libraries for you particular platform/architecture. This is nightmarish to say the least. Now with lein to use Penumbra you only have to remember 3 commands lein deps lein native-deps (I added this) lein swank (just slime-connect from Emacs) For most libraries it's just, lein deps, lein swank. As a more general observation, I think that a large part of Perl's and Python's success was a unified way of dealing with libraries. There are certain directories where you can drop libraries and expect them to work (be found). There is ONE way of running the VM (one script, blessed by the language creator). Then on top of that there is CPAN, which plugs into that, downloading dependencies and dropping libraries into those well-known directories. It isn't perfect, but it works, and is predictable. As has been said one place presents serious problem for anything beyond the simplest libraries with only trivial dependencies. I'm not saying lein is the end all be all. But it removes a fairly serious pain point for Clojure - managing your classpath and using other people's libraries. David -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Using deftype to define mutually recursive data inside agent
You can use *agent* from inside an agent thread to obtain the current agent. On Mar 3, 2:02 am, zahardzhan zahardz...@gmail.com wrote: Sorry my english I use in my small clojure program one complicated mutually-recursive data structure that represents an agent-in-environment. This structure is clojure agent which have self-reference inside himself and reference to environment, where environment is set of agents: (let [a (agent {:some state})] (send a assoc :self (delay a) ;; this is self-reference :env (ref (delay (set a ;; this is reference to environment in which agent live (await a) a) ;; my agent Is there a better way to declare this agent using deftype? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojure slides
Wilson MacGyver wrote: Looks like I'll be doing a talk on clojure next week at the local java user group. Any recommendations on slides I can steal? :) Feel free to use mine - http://www.slideshare.net/zaph0d/introduction-to-clojure Regards, BG -- Baishampayan Ghose b.gh...@ocricket.com oCricket.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On 4 Mar 2010, at 19:38, David Nolen wrote: Imperfections meaning it's perfectly broken :) That's why tools like virtualenv exist for Python. I'd say it's New Jersey style: good enough for 90% of the users, but indeed fundamentally broken. Konrad. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
ANN: Conjure 0.4
After months of work, Conjure 0.4 is finally released. Conjure is a Rails like web framework for Clojure. With in only a few seconds, you can start a web server with a database backend and an MVC clojure framework running it all. You can download 0.4 here: http://github.com/macourtney/Conjure/downloads A tutorial updated for 0.4 is posted here: http://wiki.github.com/macourtney/Conjure/hello-world-tutorial-2 How-tos are posted: http://wiki.github.com/macourtney/Conjure/how-to Google group: http://groups.google.com/group/clojure-conjure?hl=en Conjure 0.4 includes the following new features: New view helper functions including link-to, form-for, all of the standard form input and widget functions, image-tag, stylesheet-link- tag, javascript-include-tag and mail-to. Ajax support using ajax-link-to and ajax-form-for. Scaffolding which works much like Rails scaffolding, but with more features out of the box. Scaffolds already support ajax, pick up all of your controllers automatically and have a nice default layout using the Crystal X web design template. Xml view templates using prxml. Mysql support. Session management and a database session store. Logging using clojure.contrib.logging already set up using java.util.logging. You can, of course, change the backend logging library to anything clojure.contrib.logging supports. And more... A full list of new features can be found at: http://wiki.github.com/macourtney/Conjure/conjure-04-features -Matt Courtney -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: ANN: Conjure 0.4
Wow :-) Can't wait for seeing a presentation on Vimeo by Sean ;-) 2010/3/4 Matt macourt...@gmail.com: After months of work, Conjure 0.4 is finally released. Conjure is a Rails like web framework for Clojure. With in only a few seconds, you can start a web server with a database backend and an MVC clojure framework running it all. You can download 0.4 here: http://github.com/macourtney/Conjure/downloads A tutorial updated for 0.4 is posted here: http://wiki.github.com/macourtney/Conjure/hello-world-tutorial-2 How-tos are posted: http://wiki.github.com/macourtney/Conjure/how-to Google group: http://groups.google.com/group/clojure-conjure?hl=en Conjure 0.4 includes the following new features: New view helper functions including link-to, form-for, all of the standard form input and widget functions, image-tag, stylesheet-link- tag, javascript-include-tag and mail-to. Ajax support using ajax-link-to and ajax-form-for. Scaffolding which works much like Rails scaffolding, but with more features out of the box. Scaffolds already support ajax, pick up all of your controllers automatically and have a nice default layout using the Crystal X web design template. Xml view templates using prxml. Mysql support. Session management and a database session store. Logging using clojure.contrib.logging already set up using java.util.logging. You can, of course, change the backend logging library to anything clojure.contrib.logging supports. And more... A full list of new features can be found at: http://wiki.github.com/macourtney/Conjure/conjure-04-features -Matt Courtney -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
ANN: Pittsburgh Clojure Users Group
We're having a meetup for Pittsburgh-area Clojure programmers. The first meeting is Wednesday March 10th at 7pm at The Library (on Carson Street). The plan for now is to have shorter talks and presentations, followed by general discussion and possibly some (hopefully fun!) coding. We welcome anyone with interest in Clojure, from those who currently hate all the parentheses to those who don't even see the parens anymore. I hope you can make it! For more information, see: http://www.meetup.com/Clojure-PGH/ Regards, Joe -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On Mar 4, 8:33 am, Jan Rychter j...@rychter.com wrote: I haven't hacked on new Clojure stuff for the past two months or so. Now, having updated my repositories, I find that everybody just dropped ant and moved to leiningen. How do people deal with this? I don't have any good answers for you; I just want to say I feel your pain. The situation is worse on Windows, where I can't even get leiningen to work at all. Luckily I'm only working on one clojure project, so I just copy clojure.jar and clojure-contrib.jar into my project's lib directory, as well as a faked version of swank-clojure.jar (just a zipfile of swank source, renamed to .jar). That works well enough for me. Then I have a tiny little Rakefile that builds a classpath string from the contents of lib/, and has two tasks: run tests, and start a repl (which I rarely use anymore, since I got swank-clojure working). As a more general observation, I think that a large part of Perl's and Python's success was a unified way of dealing with libraries. There are certain directories where you can drop libraries and expect them to work (be found). There is ONE way of running the VM (one script, blessed by the language creator). Then on top of that there is CPAN, which plugs into that, downloading dependencies and dropping libraries into those well-known directories. It isn't perfect, but it works, and is predictable. Actually, I have noticed a move towards using tools like virtualenv for Python projects, precisely because depending on system-wide libraries makes it too non-obvious exactly what your external dependencies are, as well as creating potential version conficts. -- Chris -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojure slides
thank you, going though it now. :) On Thu, Mar 4, 2010 at 2:56 PM, Baishampayan Ghose b.gh...@ocricket.com wrote: Wilson MacGyver wrote: Looks like I'll be doing a talk on clojure next week at the local java user group. Any recommendations on slides I can steal? :) Feel free to use mine - http://www.slideshare.net/zaph0d/introduction-to-clojure Regards, BG -- Baishampayan Ghose b.gh...@ocricket.com oCricket.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 -- Omnem crede diem tibi diluxisse supremum. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On 5 March 2010 04:39, Chris Perkins chrisperkin...@gmail.com wrote: The situation is worse on Windows, where I can't even get leiningen to work at all. Luckily I'm only working on one clojure project, so I just copy clojure.jar and clojure-contrib.jar into my project's lib directory, as well as a faked version of swank-clojure.jar (just a zipfile of swank source, renamed to .jar). That works well enough for me. Then I have a tiny little Rakefile that builds a classpath string from the contents of lib/, and has two tasks: run tests, and start a repl (which I rarely use anymore, since I got swank-clojure working). Windows seems to be a second class citizen as far as clojure tools go. I wasn't able to figure out how to get it going on Windows either which makes things much harder considering so many clojure projects are now using it. Getting swank-clojure going in Windows is also a pain. To install it the recommended way via ELPA you need to patch the ELPA source code first. This isn't documented at the swank-clojure site either. I'm hopeful this situation will improve going forward but right now things are still very bleeding edge. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Using deftype to define mutually recursive data inside agent
ataggart alex.tagg...@gmail.com writes: You can use *agent* from inside an agent thread to obtain the current agent. Is this documented? -- Steven E. Harris -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On 05/03/2010, at 5:29 AM, David Nolen wrote: On Thu, Mar 4, 2010 at 10:19 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote: As many of you know, I've always been tepid on lein. I'd rather go with Maven whole-hog, because that offers the most robust model for incorporating Java libraries. If Lein evolves to to handle dependencies of dependencies and intelligently generates the classpath based on these dependencies (instead of copying files around) what advantage does Maven really have? The tools (e.g. Archiva, Nexus et al), documentation, IDE support, integration with other languages e.g. mixed Java/Clojure/Scala/Groovy projects. The more clojure integrates with the existing ecosystem, the more likely it is to succeed, especially in a viral sense. This is the essence of clojure being a JVM language with great integration with Java. Personally I wish that leiningen effort was instead put towards polyglot maven http://polyglot.sonatype.org/ Antony Blakey - CTO, Linkuistics Pty Ltd Ph: 0438 840 787 Nothing is really work unless you would rather be doing something else. -- J. M. Barre -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
If Lein evolves to to handle dependencies of dependencies and intelligently generates the classpath based on these dependencies (instead of copying files around) what advantage does Maven really have? The tools (e.g. Archiva, Nexus et al), documentation, IDE support, integration with other languages e.g. mixed Java/Clojure/Scala/Groovy projects. The more clojure integrates with the existing ecosystem, the more likely it is to succeed, especially in a viral sense. This is the essence of clojure being a JVM language with great integration with Java. Well said! Here's a pair of helpful links or anyone who wants to Maven + Clojure for a spin: http://pupeno.com/blog/how-to-create-a-clojure-application/ http://github.com/talios/clojure-maven-plugin And for those who haven't tried it, you can run 'mvn clojure:repl' in your project to get a REPL running with all the dependencies (including transitive ones) defined in your pom.xml -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlin...@gmail.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Some basic guidance to designing functional vs. state parts of app
Thank you all, the replies so far and the questions have already deepened my understanding considerably! Looking forward to more. I think a bit more discussion like this (not necessarily my quite skimpy example) would be quite valuable to many like me. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
mutable half-edge data structures to immutable languages
I have implemented the half-edge data structure several times now for mesh representation. Basically there are three main data structures (vertex, edge, face). I'll explain them a bit, but I think this is a more functional programming/Clojure question than actual geometry. A vertex is a corner of a polygon, which is shared among the intersecting faces. It has a position in space (x,y,z) and an edge reference that connects to it. It can be any edge that touches it. A face is a polygon, who's shape is determined by a loop of edge structures. It only needs one edge reference. A edge is the most complex structure. It is a loop around a face, so it has a next and a previous preference to the next and previous edge in the looped, linked-list. It also has a pair reference that references the edge structure on the adjacent face. Thus for two connect vertices, there are two edges along it. One for each face, unless the face isn't connect to an adjoining face at that edge (like the edge of a plane) and the pair reference is then null. And edge also holds a vertex and face reference that is attached to it. So two edges can be on the same face, but will have different vertex references and two edges can be on different faces and the same vertex. A better description of all this is here: http://www.flipcode.com/archives/The_Half-Edge_Data_Structure.shtml Anyway, my question is how to efficiently work with this kind of structure in Clojure or any other functional language using immutable data structures? If I make a face, it needs an edge reference. If I make a vertex, it needs a vertex reference. I've rigged it up before using integer indices instead of references and just planned ahead for which new edge will have what index. However, this seems to have gotten more difficult when I start modifying the topology of the mesh. For example, if I have a cube and a delete a face, I would normally delete the face and change the neighboring edges since they're mutable. However, this seems a lot trickier with immutable structures. I think I can generalize the question into a graph question. I have three kinds structures that link together as I described. How could a delete and add new connections efficiently and intuitively? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
I am also on Windows and have struggled a good deal with Leiningen (I would like to avoid wrangling classpaths myself as far as possible). I finally got Leiningen to run, but some features like lein swank still elude me (though this is a problem of swank-clojure and not of Leiningen). I agree that Windows is a second class citizen as far as clojure tools go. For most of my clojure work I run Ubuntu inside VirtualBox - but I would rather use clojure + tools from Windows directly. Felix On 5 Mrz., 00:32, Glen Stampoultzis gst...@gmail.com wrote: On 5 March 2010 04:39, Chris Perkins chrisperkin...@gmail.com wrote: The situation is worse on Windows, where I can't even get leiningen to work at all. Luckily I'm only working on one clojure project, so I just copy clojure.jar and clojure-contrib.jar into my project's lib directory, as well as a faked version of swank-clojure.jar (just a zipfile of swank source, renamed to .jar). That works well enough for me. Then I have a tiny little Rakefile that builds a classpath string from the contents of lib/, and has two tasks: run tests, and start a repl (which I rarely use anymore, since I got swank-clojure working). Windows seems to be a second class citizen as far as clojure tools go. I wasn't able to figure out how to get it going on Windows either which makes things much harder considering so many clojure projects are now using it. Getting swank-clojure going in Windows is also a pain. To install it the recommended way via ELPA you need to patch the ELPA source code first. This isn't documented at the swank-clojure site either. I'm hopeful this situation will improve going forward but right now things are still very bleeding edge. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Need help for the macro with defn and defmacro inside
Oh, thanks Meikel, I don't have a strong knowledge of how those symbol, gensym and symbolic quote and unquote work? It's like a puzzle, but I think I know a bit more with 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
Re: Leiningen, Clojure and libraries: what am I missing?
Hi, On Mar 5, 1:03 am, Felix Breuer fe...@fbreuer.de wrote: I agree that Windows is a second class citizen as far as clojure tools go. Oh please stop that. I have a stable setup of Gradle + Clojuresque + VimClojure on Windows. Granted setting up VimClojure on Windows is tricky due to Vim and Windows specifics, but it's doable. However the Gradle + Clojuresque part is as easy and trivial as it can get. And this setup survived already a few updates of the different components without blowing up a single time. I type gradle runServer in the morning and get a running Jetty/Nailgun combination for dynamic development with VimClojure - without thinking a single time about the classpath. Which actually consists of several checked out other projects (enlive, ring, fleetdb, ...). They were modified non- intrusively to use clojuresque instead of maven/ant/lein/whatever as build system. It checks the interdependencies and rebuilds the required jars if necessary. A change in a dependency is immediately picked up. If necessary, I can fix a known-to-work version in my local repository with a few commands. All without virtualbox, VMWare or whatever. So if one tool doesn't fill your need, then choose another. I apologise for sounding a little harsh. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Using deftype to define mutually recursive data inside agent
Hi, On Mar 5, 2:57 am, Steven E. Harris s...@panix.com wrote: ataggart alex.tagg...@gmail.com writes: You can use *agent* from inside an agent thread to obtain the current agent. Is this documented? Yes. http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/*agent* Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On Thu, Mar 4, 2010 at 7:03 PM, Jan Rychter j...@rychter.com wrote: As a more general observation, I think that a large part of Perl's and Python's success was a unified way of dealing with libraries. There are certain directories where you can drop libraries and expect them to work (be found). There is ONE way of running the VM (one script, blessed by the language creator). Then on top of that there is CPAN, which plugs into that, downloading dependencies and dropping libraries into those well-known directories. It isn't perfect, but it works, and is predictable. One huge drawback I've found with clojure (which it doubtless inherited from Java) is that you need an actual jarfile in your classpath, not just the directory containing the jarfile. martin -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
Hi, On Mar 5, 7:47 am, Martin DeMello martindeme...@gmail.com wrote: One huge drawback I've found with clojure (which it doubtless inherited from Java) is that you need an actual jarfile in your classpath, not just the directory containing the jarfile. With newer Java versions you can specify wildcards. java -cp lib/ \* ... will pick up everything in lib for the classpath. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Leiningen, Clojure and libraries: what am I missing?
On 5 Mar, 01:03, Felix Breuer fe...@fbreuer.de wrote: I am also on Windows and have struggled a good deal with Leiningen (I [...] On 5 Mrz., 00:32, Glen Stampoultzis gst...@gmail.com wrote: On 5 March 2010 04:39, Chris Perkins chrisperkin...@gmail.com wrote: The situation is worse on Windows, where I can't even get leiningen to work at all. Luckily I'm only working on one clojure project, so I [...] Windows seems to be a second class citizen as far as clojure tools go. I wasn't able to figure out how to get it going on Windows either which makes things much harder considering so many clojure projects are now using it. [...] First of all have you ever tried this script? http://github.com/technomancy/leiningen/blob/master/bin/lein.bat Secondly have you seen this thread? http://groups.google.com/group/leiningen/browse_thread/thread/2474d2e9019ee29c There was almost no feedback at all. Have you reported any issue with Leiningen on Windows? http://github.com/technomancy/leiningen/issues Leiningen is not perfect and I'd like to improve this tool (including Windows version), but so far I can see only some general complaining. Please report concrete issues and we will be able to make concrete improvements. Br, Rob -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en