Re: deprecating butlast?

2011-11-24 Thread Daniel Janus
On Wednesday, November 23, 2011 10:42:13 PM UTC, Nils Bertschinger wrote: It solves a common problem, namely to drop the last element of a sequence and reads better in this case than the equivalent idiom using drop-last. I don't quite get it. How does (butlast x) read better than

Re: deprecating butlast?

2011-11-23 Thread Nils Bertschinger
Hi, you're right that drop-last is more general than butlast. So why does butlast exist at all? I would say, that it is there for a very good reasons. It solves a common problem, namely to drop the last element of a sequence and reads better in this case than the equivalent idiom using drop-last.

deprecating butlast?

2011-11-22 Thread Daniel Janus
Hi, Why keep both butlast and drop-last in clojure.core? The latter has the advantage that it's lazy and can drop off more than one element from the end of a seq. In contrast, I can't think of any advantage of butlast, except that it seems to be slightly (ca 20%) faster than (doall (drop-last