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#57673: [PATCH] Parse --help messages for pcomplete Date: Wed, 14 Sep 2022 17:45:34 -0400 Message-ID: References: <87zgfagqfs.fsf@gmail.com> <87sfl1leip.fsf@gmail.com> <87pmg3ef6j.fsf@gmail.com> <877d25day5.fsf@gmail.com> <87edwd3gpv.fsf@gnus.org> <8735ctd9qe.fsf@gmail.com> <87a6713ffm.fsf@gnus.org> <87zgf14pln.fsf@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31785"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 57673@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 14 23:55:13 2022 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 1oYaLg-0007zd-WE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Sep 2022 23:55:13 +0200 Original-Received: from localhost ([::1]:35704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYaLf-0006Y5-Bi for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Sep 2022 17:55:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYaLW-0006Xx-Bq for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 17:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYaLW-0003qP-34 for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 17:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oYaLV-0001Zk-N9 for bug-gnu-emacs@gnu.org; Wed, 14 Sep 2022 17:55: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: Wed, 14 Sep 2022 21:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57673 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57673-submit@debbugs.gnu.org id=B57673.16631924706011 (code B ref 57673); Wed, 14 Sep 2022 21:55:01 +0000 Original-Received: (at 57673) by debbugs.gnu.org; 14 Sep 2022 21:54:30 +0000 Original-Received: from localhost ([127.0.0.1]:56467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYaL0-0001Ys-C6 for submit@debbugs.gnu.org; Wed, 14 Sep 2022 17:54:30 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oYaKv-0001Yc-6L for 57673@debbugs.gnu.org; Wed, 14 Sep 2022 17:54:29 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A9F76100129; Wed, 14 Sep 2022 17:45:36 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 288551000FF; Wed, 14 Sep 2022 17:45:35 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1663191935; bh=/ryz6ZMqvoocqEa/OK3yS/TqmH9StAsIBFOkRKixFAY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HPeHYF0vGm/+0jm7k9nU+reLL/SDwBCxlAlpXS9jK6RQMmKTUlrP3oADDEs6dXBoD bR06N8enrx9ai4b+sOpIHeqKuL9rpZNtOKpZbVmCSh59NLPcwmKwl7jpbEyGYYx9pn sdDpGbA04GwNU9MO1fc98Ppg7SFyRKI2rYzuyXPQqbM0bt2vC+a+lj7k5A9qt62JDs zV90hFNdqWW8alf7TPjHD2ZU+9WhalxFwH4Ntf+KTzmAdfjeBMTFsKqxPmpdQOAD+W qwIEjgxCPrt0NSn93JnN25pHub9auts8swnZJMQYP2HhuuSD4XDJA2RlIIc0QXPW7t eHuGsNbrAR2Kg== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 158DD1209B0; Wed, 14 Sep 2022 17:45:35 -0400 (EDT) In-Reply-To: <87zgf14pln.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 14 Sep 2022 23:23:48 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:242538 Archived-At: >> Tho to be perfectly honest, I think any keyword argument whose default >> value is not the same as nil is a problem (I know, sometimes there can >> be good reasons for that, but we should try to avoid them as much as >> possible). > Hum, that's a strong claim, and if I heard it from a clean code > influencer I would be rather suspicious. So I'm curious why you think > that way. It's convenient for the callers to know that they always pass nil to mean "use the default". It lets you write: (bar baz :hello foo) instead of (if foo (bar baz :hello foo) (bar baz) which gets really tiresome when you have more than 1 such keyword arg to (maybe) pass to the function. But my opinion is also influenced by the convenience of having only `put` and `get` and knowing that there's no difference between a nil property and a property that's absent. Same holds for alists where it's really convenient to try and stick to the principle that absent entries are equivalent to entries associated to nil. The convenience comes mostly from the fact that it's pervasive, rather than from any specific use case. Stefan