From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: Add seq-shuffle Date: Sun, 15 Sep 2024 01:45:01 -0500 Message-ID: <6c627288-4531-49a5-9593-c4f35ccb8b04@alphapapa.net> References: <86ldzuy8u4.fsf@hugot.nl> <86ikuxe8iu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25261"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: devel@hugot.nl, Emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 15 08:46:00 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1spj1E-0006RA-Gp for ged-emacs-devel@m.gmane-mx.org; Sun, 15 Sep 2024 08:46:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spj0R-0001qN-F4; Sun, 15 Sep 2024 02:45:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spj0O-0001pP-LN for Emacs-devel@gnu.org; Sun, 15 Sep 2024 02:45:08 -0400 Original-Received: from dormouse.elm.relay.mailchannels.net ([23.83.212.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spj0M-0000N0-UP; Sun, 15 Sep 2024 02:45:08 -0400 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1AAC51A20A0; Sun, 15 Sep 2024 06:45:04 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a296.dreamhost.com (100-96-66-112.trex-nlb.outbound.svc.cluster.local [100.96.66.112]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id A58A91A3CBA; Sun, 15 Sep 2024 06:45:03 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1726382703; a=rsa-sha256; cv=none; b=EBa1m6L1vV8przbG6hXjhEAAMqKXICdkjDgl07g21c7gyxUKwQn+cGQTPY2qYRw2stEGtK Mj2Y0iZD3pCoDMQy1D3Ei0rA/+FWQiqI2OukFx4Vw2dbpPWMzMu9iN4zWDH5Oy5keuKNVt kz135L6lGTZQqVfOzw5D7HbGBK1vJpCsitpDc+vUeRGhWvM2HVy4T3TT7ZuCdvx/du743t LUI/HTlFi88O5XXqaE8i0TRaY132+psr5BR3EyQHXpj1wTtabJtfsuuYUfK7yQBQ1d4n31 ItoFXcWDWeDbG+rfG/3KWEqYK+QxBv6+8ZMl3LV2cIonW/unOCuKwgS6dLDiKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1726382703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lL4Fq+Kla6IQVKWW7t7oX6a2Lu+4aQzZTAn+Oms65ao=; b=xDvmC6docPuxalnRAXQG33c0HxHK0lu0b16A5LUvMm5ugM/+6YeJehlgW+DOesUKg86L0P Get3PqbHcyP/JkjBZOJxCVo/NR5ldyTYXpp1Xd+blm1k4Xzb9xzBRbatfDEATTKGyCpF4f j8tGQHL8zo0iFBqpqrgTyjyd8mJd7cSOjKmr6iIGJnmK47hTCk6UXk/cZgm0Tj4rESMJKt HCfrK36LsI6UZe7BN04j5x2BzHcEUriLvo/MXYDk9LbUBNn+KsnpGkPRazoWG3Yk563DDX tlMt9w4UTJHpOaP3Mr/EmJxbjg/9WR+UTbYVq6IETz6XvAtViM9D5r6x1yuTBQ== ARC-Authentication-Results: i=1; rspamd-5b46bcd97f-jjkmk; auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net X-MailChannels-Auth-Id: dreamhost X-Shoe-Slimy: 2fcb88125a035707_1726382703907_3733674253 X-MC-Loop-Signature: 1726382703907:1428552652 X-MC-Ingress-Time: 1726382703907 Original-Received: from pdx1-sub0-mail-a296.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.66.112 (trex/7.0.2); Sun, 15 Sep 2024 06:45:03 +0000 Original-Received: from [10.66.37.213] (unknown [91.193.232.98]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: adam@alphapapa.net) by pdx1-sub0-mail-a296.dreamhost.com (Postfix) with ESMTPSA id 4X5z7M0rYXz7j; Sat, 14 Sep 2024 23:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1726382703; bh=lL4Fq+Kla6IQVKWW7t7oX6a2Lu+4aQzZTAn+Oms65ao=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=lmjIEX4Ctx/bvqnh0MxOMh8y27oOQV5bm92pdzhsx2rgmM88XDZPeLQuXNFikm4tj J+uQD3jmiYE9fIBELIMQlVUJJaZfu81X8d7lBRk3v7dw9qT06HITCKVnOG1mOzxgC+ mYh0xgPPPggHN3eN6qwPo1UC9JjVV6SE/WxDs5Ob9FHZFNoYBDxI+iINIbrNuI+04L kRyYnoYxn5uz9SPNyyc+xkCyuxc6NFPPBjrvPUCEpQOvGiQBekP71Gf1DcJdW5IOYP DSxYZ4j7iNo0NU70EPkj5BJpsMD3ZFJn7E6gCa3N+KFr67uf33P+GRX9lqxTkthFam 95PPYPB/Y+45Q== Content-Language: en-US In-Reply-To: <86ikuxe8iu.fsf@gnu.org> Received-SPF: neutral client-ip=23.83.212.50; envelope-from=adam@alphapapa.net; helo=dormouse.elm.relay.mailchannels.net X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323632 Archived-At: On 9/15/24 01:27, Eli Zaretskii wrote: >> Date: Sat, 14 Sep 2024 20:44:16 -0500 >> Cc: Emacs-devel@gnu.org >> From: Adam Porter >> >> Thanks, this is a gap in functionality that should be filled. > > Not every gap _should_ be filled, no. Only those we think (and have > some basis to think) it is going to be missed by enough real-life Lisp > programs. > > So saying "should be filled" without explaining why you think it > should be filled is less convincing than it could have been. Thus, I > urge you to add motivation for your opinion. TIA. 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. --Adam