From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73431: Add `setf` support for `stream.el` in ELPA Date: Tue, 24 Sep 2024 09:56:02 -0400 Message-ID: References: <827cc7fc-10be-4b93-bd67-f275193e5d84@protonmail.com> <87ikultl1v.fsf@posteo.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24973"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Okamsn , Nicolas Petton , 73431@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 24 15:57:06 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1st62L-0006Hm-GH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Sep 2024 15:57:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st622-0004rt-QK; Tue, 24 Sep 2024 09:56:48 -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 1st61u-0004rX-Hu for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 09:56:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1st61u-0005AF-7x for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 09:56:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=V6MuDUqKSCvcJ8gHdwqqLgsC0pQE+V4j/saONj99HOI=; b=VjOdZFqC9Z9Sk5s2FT+KMG1xGFFAH3d0mgpbiW5d3hgUt8oTsXGL5AhoahnstXD5jO2tn9Pg5OUQ3E3YVyYvdCiMuC+uE9acZNLxaw2R1M9Q5RZF5Ku0SqC+ekoE/QSyR5hxhHqHO8HKYMhCFWq2qDVhY2CUuNh+kv8ZYZiZs8EchpJ2aURjIZBN7aZpj61WBE9eW/qRdPU2e939YS7Rb1oaotHZDdFS0UsvosLaX20nzobnJ7P5R5SKVhc0dzFIAKTjNTt8B2kfmFopRWEkAdUn+H8EhzHI9GboDWDebkN2l4eTbQVM8LifYMILcoPX9aG75KLasAS9gjssJHVcaw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1st62H-00032l-Ln for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 09:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Sep 2024 13:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73431 X-GNU-PR-Package: emacs Original-Received: via spool by 73431-submit@debbugs.gnu.org id=B73431.172718621011687 (code B ref 73431); Tue, 24 Sep 2024 13:57:01 +0000 Original-Received: (at 73431) by debbugs.gnu.org; 24 Sep 2024 13:56:50 +0000 Original-Received: from localhost ([127.0.0.1]:46510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st625-00032R-MM for submit@debbugs.gnu.org; Tue, 24 Sep 2024 09:56:49 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st61z-00032J-Ea for 73431@debbugs.gnu.org; Tue, 24 Sep 2024 09:56:46 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1AA7C80974; Tue, 24 Sep 2024 09:56:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1727186171; bh=NARRQMRqNTlWrPs+rKUq9xemQYDYOjR/GZkBDpE8OMc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fbjxTO8UUeTtl4mraCBR4lSVeyWQJlragrFycrN6q/lKizvOpxD0jEqO1Jl7z2pV4 EVRu6dQPwHmj73bem1TYBEjIHC0SdkvxVPCDIT3rUHCqz9AbBQxtoAZUTKJPg8g2IK P0cocUK4TlFi5H1225M7aNHx/u9cl3GLm7xsVdsTeUfq1VhrxTpvvVwZPAOCqKoOGO eDlwViRdFDatckdxp1ZAIP3h7/IrULuL7h4OfZDm0+LfzXwjjYuTjb9LeXUN1mSK9U EdM1ezRsN2apdbBoihpCn91XLUkR/eNEQYvfof+z/gWMcxSTnj3dBq6D9+3zJpK5ED 1xPGGRoBO2DCw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 24D5980169; Tue, 24 Sep 2024 09:56:11 -0400 (EDT) Original-Received: from pastel (unknown [45.72.221.103]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E71E9120667; Tue, 24 Sep 2024 09:56:10 -0400 (EDT) In-Reply-To: <87ikultl1v.fsf@posteo.net> (Philip Kaludercic's message of "Tue, 24 Sep 2024 10:15:08 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292335 Archived-At: >> +(defun \(setf\ stream-first\) (store stream) >> + "Set the first element of STREAM to value STORE." >> + (if (stream-empty-p stream) >> + (error "Cannot set first element of empty stream: %s" stream) >> + (setcar (stream--force stream) store))) > > I am not sure what the preferred practice to define generalised setters > is. In gv.el everything is defined using `gv-define-simple-setter' or > `gv-define-setter', which /feels/ more robust? I believe that Stefan > (as the author or gv.el) might be able to explain if this is so or not. Defining \(setf\ FOO\) looks fine to me =F0=9F=99=82 I'm not sure we want to make streams mutable, OTOH. Is there a known use-case for it? Stefan