[CLJ-692] Should "some" be using "seq?" rather than "seq" ? Created: 16/Dec/10 Updated: 08/Jul/11 Resolved: 27/Dec/10
|Affects Version/s:||Release 1.2|
Mac OS X Java 6
Very minor, but noticed while browsing that "some" is defined as:
The "(seq coll)" call will potentially generate an unused seq each time.
|Comment by Fogus [ 27/Dec/10 7:57 AM ]|
The `seq` function is the idiomatic way to ask the question "does this collection have something in it?" and is the correct approach in the case of `some`. If we were to use `seq?` then we would be asking an entirely different question: "does this collection implement the ISeq interface". In the case of using `seq?`, `some` would no longer work against the seq abstraction. It's tempting to look at the name `seq` and `seq?` and assume that they mean similar things. The type-based predicates are tricky.
|Comment by Matthew Phillips [ 08/Jul/11 3:28 AM ]|
Thanks for the informative comment Michael. I was just watching Rich's talk on seq's, and remembered making this noob bug report: sorry!