[racket] [racket-dev] `string-split'

From: Pierpaolo Bernardi (olopierpa at gmail.com)
Date: Fri May 25 07:55:09 EDT 2012

On Thu, Apr 19, 2012 at 6:55 PM, namekuseijin <namekuseijin at gmail.com> wrote:

> while we're at it, why do you guys make the order or arguments like that?
>
> like, these are easier to read than in the order available in racket:
>
> (string-split "," "6,5,1,12,13,8,15,9,3,7,4,2,14,10,11")
> (sort < '(6 5 1 12 13 8 15 9 3 7 4 2 14 10 11))
> (string-join "," '(6 5 1 12 13 8 15 9 3 7 4 2 14 10 11))
>
> they also seem more sensible, because the more interesting argument
> for such functions is not what is to be operated upon, but the
> operator itself.  Coupled with currying, it'd be heaven... :)

This order looks much better because you use a literal string in the
function call, which is an artificial example.

In real code the string would be the value of a variable or the return
value of a function call, and your example would not look much
different whatever the order of the arguments.

And which of the two arguments is more interesting, varies from case
to case, IMO.

Cheers
P.


Posted on the users mailing list.