From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Thu, 16 Nov 2023 09:18:11 -0800 Message-ID: References: <87fs169mjj.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19100"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Richard Stallman , emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 16 18:18:53 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 1r3g0z-0004li-CU for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Nov 2023 18:18:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3g0T-0005RW-RV; Thu, 16 Nov 2023 12:18:21 -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 1r3g0R-0005RF-W9 for emacs-devel@gnu.org; Thu, 16 Nov 2023 12:18:20 -0500 Original-Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3g0P-0005Aj-T0 for emacs-devel@gnu.org; Thu, 16 Nov 2023 12:18:19 -0500 Original-Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2800bdf888dso794394a91.1 for ; Thu, 16 Nov 2023 09:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700155095; x=1700759895; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=J0lx2AeEhe+yDp8mEcLlDI4hjk9GmKD1WTE8awnMqro=; b=ffnQxFzHpMGN+lp0q5kJla202s/oaq8yqeeUAA6zJVrCTXiTjmDk5RCl3I5MGvKhMh LCSg2AFRlg414JBExoxwwEtNsaWosE3vXZzkGz7lud+dImr107cuz6G54rI3rwVx1cxZ ZfbeiwdxrBxmea4SMGDZiFyP/FZj2cjEXKHDtW5TX9NYReb1mupuhw5D7c7ABfzHadHD C3P9CJlPp3XjbCuaqZxw/Sa2aj+ga6MciYOXcg6XUAljgZNBWqLpwSgHn+8spL1p4sxT +gSAOnyjdYozNsHv4V4EKadInfN0cCLaa2qowP4e9/iXMkbw0Ne+v523CNWv/48k8czs cEMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700155095; x=1700759895; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=J0lx2AeEhe+yDp8mEcLlDI4hjk9GmKD1WTE8awnMqro=; b=g2G/uId8jciU0NCTOdV4KMYA0KMjnNox1UIJwctRKT8D5kUKPLZ1Cj7aEgaYwCChtN d0RPKfEod+ILwQJVWSZWUJUP1jQs0+HoVv869wovVqRLbdntbEoJ9ylb2g+HDhRB/nvb CCaovDt3CphHODPOZ1/xafDg1hfsKPbnck0CIlkDjnu5tlPW4aAPK5V+doTHrkdjci7f m5HJ5iYvTBQHaYatGrEIfhJ2BnP1Oz6KOQe5wb7aKcIfdQ9D8bkoKTAV000AZxUW6BwN Iw5kKCKUkepJTmFmcc16MtAIUvK4b3f27W2I8HxYpl6bLymDINmzlkzipmHs1QHlirtF iNhA== X-Gm-Message-State: AOJu0YxYvGB5c+Fa0DHE6bv9+cr9nFIkaT98jnnCyRFAEgBSGccUmBMH 9vy2/lZ/RAZJs663irFnoEUEdCBLuFzVoMtsYvM0LQ== X-Google-Smtp-Source: AGHT+IF9k4mqMHDZT4xPeBVlBeUi9GYlBtCia1WCeZ1ijhpqPSI1/Qed4oNJGSotMG+tTUu2bl1tJw== X-Received: by 2002:a17:90b:4c47:b0:27c:df02:88b3 with SMTP id np7-20020a17090b4c4700b0027cdf0288b3mr3233848pjb.8.1700155094869; Thu, 16 Nov 2023 09:18:14 -0800 (PST) Original-Received: from raman9 ([2601:646:9e02:3290:b9ef:5be3:7e1c:49ff]) by smtp.gmail.com with ESMTPSA id g17-20020a17090a7d1100b002790ded9c6dsm1791668pjl.31.2023.11.16.09.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 09:18:13 -0800 (PST) In-Reply-To: <87fs169mjj.fsf@posteo.net> (Philip Kaludercic's message of "Thu, 16 Nov 2023 07:37:04 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=raman@google.com; helo=mail-pj1-x1034.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=unavailable 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:312814 Archived-At: Philip Kaludercic writes: RMS' message makes some very valuable points re specialized languages like pcase -- pcase has its strengths, but in general, it's definitely not easy to understand complex code that leverages it -- as an example: I recently tried to understand some of the completion code; -- specifically, completion-at-point, and immediately hit the pcase wall and gave up --- my lack of understanding of pcase made that code in Emacs Core read like line-noise. > Richard Stallman writes: > >> I can see why people want something along those lines. Using `cond' >> and `let' to do these jobs feels long-winded and cumbersome; they were >> not designed to make this easy. So we wish for something to make such >> code more concise. > > [...] > >> I'm looking at adapting some of the features of `pcase' into other >> constructs, so as to make type-discrimination code more concise than >> in old-fashioned Lisp, but _not_ so concise as to be cryptic and >> burdensome. > > The critical feature of pcase is pattern matching. The complexity of > `pcase' is the extensibility -- a lisp-like flexibility that makes it so > attractive -- that a simpler macro might not need. The question is, if > one would restrict pcase to just matching expressions using ` and , like > > (pcase sexp ;match various top-level constructs > (`(defun ,name ,args ,body) ...) > (`(defvar ,name, ,value) ...) > (`(require ',symbol) ...) > ...) > > would that be simple enough in your opinion? Anyone familiar with > ML-style functional programming, Prolog or the notion of unification > should be able to understand this quickly enough, I assume? > --