2010/12/22 Mark Engelberg <mark.engelb...@gmail.com> > I've decided to go with the old gen-class approach (mainly so I can > take advantage of the "state" option). > I'm running into a problem implementing Iterable. > The following lines in gen-class create a conflict: > :implements [java.lang.Iterable] > :methods [[iterator [] java.util.Iterator]] > > It compiles, but when I instantiate a class, I get an error message of > a duplicate method name&sig. I've narrowed it down to a problem with > the signature of the iterator method (if I loosen the return type to > Object, the class instantiates fine). > Any ideas what's wrong with that signature for iterator?
Yes, I don't have a REPL at hand, but my guess is that you should just drop the corresponding :methods ... line. You don't need to repeat methods sigs inherited from classes / interfaces, :methods is for declaring public methods beyond that. (And so it seems that not only is it not needed, but rather that you must not do it). HTH, -- Laurent -- 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