On Jan 27, 2011, at 6:02 PM, Meikel Brandmeyer wrote: > > I kind of miss the difference in ugliness. If you want default values for > your structs you also need a factory function. So unless you write the > factory function for each struct, you'll also need a defstructx.
> records will be the way to go. Even today. And I'm yet to see a reasonable > example, where structs have any advantage over records. records might not be > perfect at the moment, but neither are structs… In some cases (maybe rare, but they happen to include the one that motivated me to raise the issue) nil defaults are sufficient, and structs provide those while unadorned records don't. Several others have also provided nice code to recover other struct features like keyword args and IFn implementation (or to provide something better) with records, and that's great, but that code isn't yet built in. While your bottom-line usage examples for structs and records are roughly equivalent in ugliness your record examples require inclusion of the to-factory and defrecordx definitions. I prefer to keep my own code as concise and simple as possible, so I'll probably keep using defstruct until roughly equivalent functionality is provided for records out of the box. -Lee -- 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