Hmmm... interesting point about what's in the docstring for nth and count. This leads me back to my original conclusion, that there isn't a hard and fast rule for "seq"ing arguments in a function. It really depends on the design of the function, and the design needs to be conveyed in the docstring, test cases, and usage documentation. Perhaps people can think of rules for certain pairing of functions/seq types, and I imagine it would be dominated by the data structures themselves (differences between a vector and linked list and a red- black tree, for example).
Anyone have any other good ideas? On Jul 28, 10:11 am, eyeris <drewpvo...@gmail.com> wrote: > It calls nth and count, both of which except a collection, according > to their docstrings. > > On Jul 27, 4:46 pm, Sean Devlin <francoisdev...@gmail.com> wrote: > > > I'm not sure if it should change. > > > I think this depend on the distinction between "seq" and > > "collection". For example, I personally consider a string a seq, but > > not a collection. > > > Is this a proper distinction? > > > On Jul 27, 5:36 pm, eyeris <drewpvo...@gmail.com> wrote: > > > > The docstring should also be changed by replacing "seq" with > > > "collection". > > > > On Jul 27, 12:39 pm, Mark Engelberg <mark.engelb...@gmail.com> wrote: > > > > > Yeah, but this case is different because nth is much faster if the > > > > input is a vector, and calling seq on the input will actually degrade > > > > the performance for vector inputs. > > > > > Maybe you could test for vectorness, and call seq otherwise. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---