[racket-dev] take/drop argument order

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Mar 10 16:20:14 EDT 2013

(Sorry for the subject change, I wanted to separate it from the new *f
things.)

So it seems to me that most people agree that the current order for
these things is bad, since I didn't hear from anyone who *likes* the
current order.  (Feel free to mail me off-list if you do.)

Assuming this, here's a suggestion that I made in the past for
resolving this:

* Make the existing `take', `drop', `split-at' accept their arguments
  in *either* order.

* Change the required types for lists to be a null-or-pair, or even
  require a `list?', or require a `list?' but throw an error only if
  scanning gets to a non-null-terminator.  Any of these would make
  sure that the arguments are distinguishable.  (You can currently
  write something like (take 0 1) -- it's not an error.)

* Declare the old index-last order as a compatibility thing.  Have TR
  use sane order only.

* The new *f functions can use only the sane order.

* And another thing that can be done to reduce the name clutter is to
  have only the plain names, but make them accept either an index or a
  predicate.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.