Adding :svn to *clojure-version*

2009-05-14 Thread lazy1
Hello All, I think it's a good idea to add the subversion revision to *clojure- version*. The below patch will work once someone does "svn ps svn:keywords Revision core.clj". Index: src/clj/clojure/core.clj === --- src/clj/clojure

Re: Adding :svn to *clojure-version*

2009-05-14 Thread lazy1
Also at http://paste.lisp.org/display/80244 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to

Java Class Factory

2009-12-02 Thread lazy1
Hello, I'm trying to create a "factory" method for Java classes, however I'm doing something wrong. (import '(java.util Dictionary HashMap)) (def *containers* { :dict Dictionary :hash HashMap}) (defn new-container [type] (new (*containers* type))) (def d (new-container :dict)) The above gi

Re: Java Class Factory

2009-12-03 Thread lazy1
Hello All, >> What is the right way to do this? > (defn new-container > [type] > (.newInstance (*containers* type))) > (defmacro new-container [type] > `(new ~(*containers* type))) Thanks! These are both great and also very educational. The reason for this coding style is that I'm writing a wr