From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Tue, 19 Dec 2023 22:28:03 -0500 Message-ID: References: Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7428"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 20 04:28:32 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 1rFnG4-0001g5-DK for ged-emacs-devel@m.gmane-mx.org; Wed, 20 Dec 2023 04:28:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFnFl-00044u-BD; Tue, 19 Dec 2023 22:28:13 -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 1rFnFc-00044T-BG for emacs-devel@gnu.org; Tue, 19 Dec 2023 22:28:05 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rFnFb-0005B1-Uc; Tue, 19 Dec 2023 22:28:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=0uceOpkMqBPkl7Jmgj5WvVwbeUXDkb2V3eS52A16dj0=; b=GcV8aHJCFZ14 W3faqvrY3pcbyBthRZ/0n5mj0RQryEtBctGKuhkiRwvOrTREdh6YorvTDb6XQ6h1cayqgcF8botRY VGwddFCn9z2qJu1JPLlAWkM3pEGJ0EL9MVU+L5un5AUk5NbL638Hbu4YuDjwvlwlWbsskvDbhHnB+ rBxT2Mg5xa97nXDAjYlExh9C+WTOWylEarG8xITqlzmiyenx8usZo2JmyqwGp6bDWYxWGytYYve4I T98qUOlqATVPHJQPzeoJnPmdFnVsQEC752DB96dYr7cMPEsvjbd4hyD01FKvSvm18TOo6vsHtWZ9q 4TLdkU9QaJED0PJ8KrWMDg==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rFnFb-00021M-KF; Tue, 19 Dec 2023 22:28:03 -0500 In-Reply-To: (message from Adam Porter on Sat, 16 Dec 2023 00:57:43 -0600) 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:314017 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] I find these examples hard to understand because of the complexity caused by the functions called `bar'. I could not fully make sense of the first one: I don't understand what you intend it to do, or what you think it might do, or why it might do that. It is indeed painfully complex, but I don't think that is the fault of cond*. Is it possible that the explanation of a constrained variable patterm is not clear? Constrained variable: (TESTFN VARIABLE OTHER-ARGS...) This matches any value VALUE provided (TESTFN VALUE OTHER-ARGS...) evaluates to true. If so, it sets VARIABLE to VALUE. (symbolp sym) Match any symbol, store it in `sym'. (> num-foos 1) Match any thing greater than 1, store it in `num-foos'. Only the first argument to a TESTFN is a kind of subpattern. The OTHER-ARGS are handled are not patterns to match; they are expressions to evaluate. Their values are passed to TESTFN as in an ordinary function call. If TESTFN is your function `bar', it will then receive its arguments in the usual way and do what it is defined to do. It is used as a predicate, so all that matters is whether its return value is non-nil. The first parameter of `bar' will be data that this subpattern may match or not. The remaining parameters of `bar' will be the results of evaluating OTHER-ARGS... -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)