2009/4/23 Christophe Grand <christo...@cgrand.net>: > > Laurent PETIT a écrit : >> 2009/4/23 Christophe Grand <christo...@cgrand.net>: >> >>> Laurent PETIT a écrit : >>> >>>> I guess you're right. But a little warning in the javadoc could help >>>> newcomers not shoot themselves in the foot. >>>> And the problem is, calling directly (second) without calling (first) >>>> would work most of the time. I wanted to make it fail every time => >>>> same behaviour whatever the input data are. >>>> >>>> >>> Such a guarantee implies a side effect on the first seq is realized! >>> >> >> don't understand. >> > > Aren't you proposing that: > (let [[x y] (split-with pred coll)] > (seq y)) > always throws an exception while > (let [[x y] (split-with pred coll)] > (dorun x) > (seq y)) > doesn't?
Yes, throwing an IllegalAccessException in the second case, signaling a violation of the contract by the user, instead of letting the code sometimes work (with certain sequences), sometimes not. But really this is not the main point, the main point is having got rid of the OutOfMemory exception, so with the volatile or whatever trick you'll find in your new book, we're almost done for a better split-with function :-) --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---