[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add seq-shuffle
From: |
Stefan Kangas |
Subject: |
Re: Add seq-shuffle |
Date: |
Sun, 15 Sep 2024 04:58:39 -0700 |
Adam Porter <adam@alphapapa.net> writes:
> I think it should be filled because it's not an uncommon thing to want
> to do (e.g. it's needed in Listen.el and Elfeed), and it's not obvious
> how to do it from scratch, especially in a performant way. A "naive"
> implementation, without regard for performance, can perform quite poorly.
>
> That there are different sequence types, each with their own
> characteristics, further complicates the matter. For newer Elisp
> programmers, who may be unfamiliar with the various types and
> performance issues in Elisp, having a built-in function to do it
> correctly and quickly would be helpful.
>
> As it is, we have had various implementations in various third-party
> libraries for years, each with the same purpose but doing it slightly
> differently. As an example from other languages, Python provides the
> random.shuffle function for sequences. It would seem natural for
> Emacs's seq library to provide a similar function.
>
> It's not a big deal, but if I had a vote, it would be to include such a
> function in seq.el.
Makes sense to me, FWIW.
I have had slow and naive implementations of it in my init file at
various times myself.
- Re: Add seq-shuffle, (continued)
- Re: Add seq-shuffle, Emanuel Berg, 2024/09/16
- Re: Add seq-shuffle, Adam Porter, 2024/09/16
- Re: Add seq-shuffle, Emanuel Berg, 2024/09/17
- Re: Add seq-shuffle, Philip Kaludercic, 2024/09/17
- Re: Add seq-shuffle, Adam Porter, 2024/09/17
- Re: Add seq-shuffle, Emanuel Berg, 2024/09/17
- Re: Add seq-shuffle, Yuri Khan, 2024/09/17
Re: Add seq-shuffle, Adam Porter, 2024/09/14
Re: Add seq-shuffle, Hugo Thunnissen, 2024/09/15