[racket-dev] take/drop argument order
An hour ago, Asumu Takikawa wrote:
> On 2013-04-11 12:05:59 -0400, Eli Barzilay wrote:
> > Remove the `*f' functions from the interface, and change the
> > non-`*f' functions to accept keywords as follows:
> >
> > (take #:num N L)
> > (take #:while P L)
> > (take #:until P L)
>
> I like this suggestion since keywords seem like a nice Rackety
> solution.
>
> On the other hand, does this solve the original problem? As I
> understand, the original objection was that the `take` arguments
> should look familiar to someone from Clojure, Haskell, etc.
Yeah, you're right. Maybe do the overloading either-order thing in
addition to the keywords? The main problem that it solves then is the
many bindings.
In any case, given that nobody seems sufficiently interested, maybe
it's best to remove the new functions for this release to avoid code
depending on it which will make later changes more difficult?
> Also, what happens if I wrote the following?
>
> (take #:while P L 5)
That would do the same as specifying both `#:while' and `#:until',
which is most likely an error. (Although it might be a combination of
all of the conditions, but that seems like an overkill
generalization.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!