Passing a collection to a function that expects a lazy seq is not always an error. The seq library encourages it by calling (seq) on those collections for you. I suppose all lazy functions could emit a warning when they have to call (seq) on their arguments, based on some global variable like *warn-on-non-lazy-seq*, similar to *warn-on- reflection*. However, I don't have a good grasp on whether these types of mistakes are widespread enough to warrant such a change.
On Jul 24, 10:50 am, Dragan Djuric <draga...@gmail.com> wrote: > Is there an automatic way to discover such error? These types of > errors could be discovered by the compiler. How am I going to see if I > get an ISeq in my clojure code? I would have to dig... > > On Jul 24, 3:37 pm, eyeris <drewpvo...@gmail.com> wrote: > > > On Jul 24, 6:17 am, Dragan Djuric <draga...@gmail.com> wrote: > > > > Sometimes (or maybe always?) it is mentioned in the doc. In my > > > opinion, this is one of the cases where dynamic languages do not > > > excel. If we had typing, that would be solved by implementing Lazy > > > "interface". > > > We do have types and we do have a lazy interface. The lazy interface > > is ISeq. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---