New new

Read this first!

Clojure issue tracking now lives at http://dev.clojure.org/jira, and the wiki is at http://dev.clojure.org. These Assembla pages are kept online for historical interest only.

Note - the work below has been subsumed by reify et al

Docs

(new classname ...) does what it always did

(new [a vector] ...) generates a new instance of an anonymous class, implementing any supplied super class/interfaces

 (new [super? interfaces*] this-name?
  {:volatile [closed-over-locals+] :other-flags tbd}?
  (method [args*] body)* )

Usage:

 

Can be extremely lightweight:

(str (new [] (toString [] "hello")))
"hello"

 


Ideas/scratchpad