From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Thu, 23 Nov 2023 20:30:27 -0800 Message-ID: References: <87fs169mjj.fsf@posteo.net> <093f11a1-57c2-5e56-d39b-26fef1c67cbb@gutov.dev> <25942.25061.217864.329049@retriever.mtv.corp.google.com> <87zfzdcz6z.fsf@posteo.net> <763f067b-4ca9-1eba-9f3c-424c38589e9c@gutov.dev> 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="11024"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, emacs-devel@gnu.org To: rms@gnu.org, Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 24 05:31:45 2023 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 1r6Nqy-0002kD-TR for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Nov 2023 05:31:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6Nq4-0000lA-4v; Thu, 23 Nov 2023 23:30:48 -0500 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 1r6Npo-0000gh-RT for emacs-devel@gnu.org; Thu, 23 Nov 2023 23:30:34 -0500 Original-Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6Npm-0004Sw-Ks; Thu, 23 Nov 2023 23:30:32 -0500 Original-Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3b844e3e817so924973b6e.0; Thu, 23 Nov 2023 20:30:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700800229; x=1701405029; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=5pSdn2s/iCiY8Jwm0vBNUzwBzuRNwCr8AepPB+tgLSs=; b=f7+1CequRldkPsr8b3Kmr8Wj+1FJkncmE5noL4sIlRdxXpPucO72Ngkm9EDDqYKNxm XVjHzi0Za9G+YhWotmtKteIfuRk5TB868OBgHXk3Ix5DLmcZcstnK8YdrO1rWffk25Bc o1y2nPcp9RHW3UVhkMhEoaAY8w5jO/Apq6SRoV/q01LqZj62Z/D/XS8qy0kfZDR7T6lP MtzdpAEQnqt065VrVJ5dLBWBcVYRor5m6/rF/9pAA8G1XjIx9ZIPUyM7F+CvPNIDBPLH 66km21OOJIq01SGZA90Gqmtk35+1srP3WAan1cf8+NkzP9nKjANHnmEsKpM2BUWHbux7 Tuqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700800229; x=1701405029; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5pSdn2s/iCiY8Jwm0vBNUzwBzuRNwCr8AepPB+tgLSs=; b=jTQGNI/BsQ+9YbhMBVhkOcoalV5oMLyCjoC93V9Pc/T3gA487lDIhnMxF3Dq+jX9RA MKg5VajFOgPj0SrqaBZvQ9D5LycLO+xjha8Uw4Gmv5Aqc0gRfQvkkd8C+dokQfxpbOi3 vqCtygId3aO6pJ8DD9by+D7y/7FjZbfHgrX34lecvNEGhLYakuvFrToLoEQATN56H6OZ 5MTW6VdmBzj0pYdiYVCKv6u0lM+GjooZ2f+fGHi0Ara9uyDbjRxucGcjvF1jokMHq1o2 FF+kAnvPNhvheAV4NFJqGbCS01WhvChMEK35j5PBGwWHCoQ4PeLFE+Vk5Tv/F29Yvm0J 0XUA== X-Gm-Message-State: AOJu0Ywy4wTc6F+6nWqsGJy9t/3smVi0n2TJ2enQOvM5FsB3MkXLAUuT dDdntdouVjphzduIyw6GowAw6uLIrPc= X-Google-Smtp-Source: AGHT+IGInSHqZz7a5o8S7OgL+W725vc5HhG09A81sy+4oio/XwfsqEEZano2Mp+NBFw52i0L6UWhfQ== X-Received: by 2002:a05:6808:f90:b0:3b5:37c6:6dcb with SMTP id o16-20020a0568080f9000b003b537c66dcbmr2007638oiw.21.1700800228793; Thu, 23 Nov 2023 20:30:28 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id fe25-20020a056a002f1900b006c34f19c459sm1980637pfb.139.2023.11.23.20.30.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Nov 2023 20:30:28 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=jporterbugs@gmail.com; helo=mail-oi1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:313168 Archived-At: On 11/23/2023 7:34 PM, Richard Stallman wrote: > > >> > (`(,hookfun . (,start ,end ,collection . ,plist)) > > > I was not sure which part of the line that rule applies to. > > > > > >> > (`(,hookfun ,start ,end ,collection . ,plist) > > > Would that be equiva;ent? > > I as a reader, trying to understand what that pcase construct did, did > not know they would be equivalent. So this specific piece of > cleverness specifically interfered with my understanding that example > and therefore with my trying to understand pcase. For cases like this, I hope to (at least partially) address it with better documentation. I'm not sure we can expect every instance of 'pcase' in the Emacs codebase to be a good teachable example for how to use 'pcase', but I do think we could achieve that with shortdocs. The shortdocs could start small with almost-trivial examples, and then build up to more-complex forms that show how the pieces interact. Broadly, my goal would be that anyone who already knows Lisp could load up the shortdocs for pcase and get the hang of 95% of it in a few minutes. (I also think we could improve the manuals and the docstring, but I think 'pcase' is a great candidate for teaching by example. The shortdoc system seems ideal for that.)