On 27.04.2010, at 14:45, Rich Hickey wrote: > I agree. I asked for suggestions for the factory fn in #clojure, but got some > pushback against introducing things in the namespace. I'm still open to > suggestions, here are the issues: > > The generated type name is now imported, so at the very least the factory fn > can't have the same name as the class. Alternatives are create-Foo etc.
How about providing the name of a factory function via an option, with no factory as the default? Something like (defrecord Foo [bar baz] :factory create-Foo) This would avoid the creation of vars that are not explicitly named in the code, and thus bad surprises. 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