[racket-dev] take/drop argument order
Late reply, but better than never.
On 2013-03-10 16:20:14 -0400, Eli Barzilay wrote:
> 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.
I'm fine with this.
> * 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.)
I would much prefer a `list?` if backwards compatibility for this isn't
a concern. Has anyone *ever* used the "feature" that `take` can operate
on non-lists?
> * 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.
I'm less sure about this change, since the `f` suffix isn't particularly
verbose and the integer case is likely more common, but I'm not opposed
to it either.
Cheers,
Asumu