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: cond* Date: Fri, 02 Feb 2024 22:36:15 -0500 Message-ID: References: <87frzuae9n.fsf@posteo.net> <871qbatqc8.fsf@posteo.net> <87wmsz7lzn.fsf@posteo.net> <87edf1m7lq.fsf@localhost> <87cyui76l9.fsf@localhost> <871qauy1io.fsf@localhost> <87wmsjyi2h.fsf@localhost> <875xz86tgu.fsf@localhost> 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="16932"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 03 04:36:37 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 1rW6pZ-0004Eh-Hd for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Feb 2024 04:36:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rW6pG-0003qc-DX; Fri, 02 Feb 2024 22:36:18 -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 1rW6pE-0003oU-Tl for emacs-devel@gnu.org; Fri, 02 Feb 2024 22:36:16 -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 1rW6pE-0006nv-In; Fri, 02 Feb 2024 22:36:16 -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=nrN1oji2okygIpOYBHDvTRz4ftDMKzGoggeGUX++HPk=; b=FLSTSbLW6yy+ d6x4sKi3ukt/TTmvAuVLL7Nr1yjhzcGoPVxLPuF43LGD9hPwAvCfxd5brLfNCHetjoCwDiaLlEnZ1 U6QqrMZsQ3TQ6qUqPGXBDXQZGRycLpie6VBP4Vn3Dr3YKmUUGC93JRHGeF4PLr3JC98uz6va8Nlb6 ptLiC6o16zK6g3juOjtAmFwcJJIFZXNOtseBJQ+4DuW8dYaw3yZzGmrjx6RExYzffE8pMfm3oplr7 osJU2GbL3pUFvmzVoWkY3Y2hTdYYAL279YUJ1dazY42l2fvHDEezjOmJHqGlDTKSROOwwiDEIG2fU id/ORYOB4ZfZOTxC68cFGA==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rW6pD-0002LX-VI; Fri, 02 Feb 2024 22:36:16 -0500 In-Reply-To: <875xz86tgu.fsf@localhost> (message from Ihor Radchenko on Thu, 01 Feb 2024 16:26:57 +0000) 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:315785 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. ]]] > (let ((list-of-three '(1 2))) > (cond* ((match* `(,x ,y ,z) list-of-three)) > ((< 2 (+ x y z)) > 'success))) ; => (wrong-type-argument number-or-marker-p nil) That is not exactly a bug, but it is an unclarity in the design. The match* condition fails, but since it is a non-exit clause, that failure doesn't affect anything -- it goes ahead an executes the next clause. Arguably it is doing exactly what your code said. But it raises the question of what a non-exit match* clause should do when it does not match. What do you think it should do? The idea that occurs to me is this: bind all those variables, initializing by matching those that can match, and initializing the rest to nil. -- 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)