[m-users.] The new random module(s)
jfischer at opturion.com
Fri Sep 6 15:30:55 AEST 2019
On Fri, 6 Sep 2019, Zoltan Somogyi wrote:
> On Thu, 5 Sep 2019 21:09:17 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:
>> Hi Mark,
>> On Thu, 5 Sep 2019, Mark Brown wrote:
>>> On Thu, Sep 5, 2019 at 4:09 PM Julian Fondren <jfondren at minimaltype.com> wrote:
>>>> In the permute_array/permute_list future,
>>>> will permute_X be added for other data structures?
>>> I wasn't planning to. Permutation is (mathematically) usually only
>>> defined for sets and sequences so I'm not sure what you'd be expecting
>>> for other library types. I suppose there could be a set permutation
>>> predicate that returns a randomly ordered list of the elements.
>>> In my view, the reason to put them in the random module is that they
>>> are more related to each other, and to the other predicates that do
>>> random stuff, than they are to predicates that merely work on lists or
>>> arrays. But no matter, I can add list.random_permutation now unless
>>> anyone else wants to add their opinion?
>> I disagree: I expect to find generic operations on lists in the list
>> module and generic operations on arrays in the array module.
> For me, when I think of generic operations on lists or arrays, random shuffling
> never enters my mind. I am guessing Mark's preference for locating these
> operations in the random module also comes from this: randomness has
> nothing to do with the usual operations on lists or arrays.
Since the majority are in favour of putting them in the random module,
I'm not going to argue against it (too much). That will at least be
an improvement over the existing situation ;-)
More information about the users