On Aug 16, 2009, at 7:32 AM, Nicolas Oury wrote:
> after having spend a bit of time optimizing the n-body benchmark, I > had > an idea for another implementation of structures. > > - Create a java object Structure, that contains a pointer to a > persistent hash map and a private abstract class Field, containing a > method set and a method get, both takes a Structure object as well as > the usual arguments). > > - When the user want to define a new structure type foo with fields > a b > and c, > * create an object Foo inheriting Structure with fields a, b and c. > * create a static initial persistent hash-map whose entries > corresponding to a b and c contain an object of type Field referencing > to the field a, b and c. Much of what you've described is either provided by "newnew", or is relatively easy to produce with a couple of macro wrappers involving gen-interface and newnew: http://www.assembla.com/wiki/show/clojure/New_new The sands are shifting in that area though, as it's definitely bleeding-edge. I'm certain contributions are welcome, but be prepared for some potential whiplash as the details are worked out. Cheers, - Chas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---