From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: Symbols or strings as arguments Date: Thu, 28 Nov 2024 11:59:20 +0000 Message-ID: References: <87cyifq5rp.fsf@gnu.org> Reply-To: Heime Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28370"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 28 13:00:09 2024 Return-path: Envelope-to: geh-help-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 1tGdBo-0007BE-IJ for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 Nov 2024 13:00:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGdBD-0004FQ-Bx; Thu, 28 Nov 2024 06:59:31 -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 1tGdBA-0004FC-VJ for help-gnu-emacs@gnu.org; Thu, 28 Nov 2024 06:59:28 -0500 Original-Received: from mail-43166.protonmail.ch ([185.70.43.166]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGdB9-0000Gm-7y for help-gnu-emacs@gnu.org; Thu, 28 Nov 2024 06:59:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1732795163; x=1733054363; bh=FQk70Kn3/mIK/Hly8+z63rPeaysGLwHwqOHlv3d8xKE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=A1jz4YtpmCbqm7Qz/rs13bWePOkaag6FsUURwJGQj4RpL3PIbbvnIFUG9cpykvHoI 8Al9EMdX+AWb5J3gBy713tjiRl3rMHRiZvBp0IOkSiZn8SvNRFBsD+JBcJ6uUaHxY9 yPx6kxI/EplULzKolCLEBfun9VQTLE07k6br0vHb++ymmDbGEEM2gAaIHFY/Ux6x4Q bSXEZIwX03n8ioGv/vOo+E7zBqeoBhNG0WP+OVYL+TVq6qblSGElLLD0yb96J1eejD tEpevd31RTs3a+uUnbAbD5gTVw6iK+PsfHRyX8AAQGu7CMB2coztZF8yrFjIN/2EIe HvXgDMbJCK6pw== In-Reply-To: <87cyifq5rp.fsf@gnu.org> Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 880ba9453a9f2e47b48d696dab4b3f993b091d2c Received-SPF: pass client-ip=185.70.43.166; envelope-from=heimeborgia@protonmail.com; helo=mail-43166.protonmail.ch 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148430 Archived-At: Sent with Proton Mail secure email. On Thursday, November 28th, 2024 at 5:36 PM, Tassilo Horn wr= ote: > Heime via Users list for the GNU Emacs text editor help-gnu-emacs@gnu.org= writes: >=20 > > I wonder whether developers would preferentially use symbols rather > > than strings in arguments. > >=20 > > Consider calling (cupola '(72 tabtrail local)) versus (cupola '(72 > > "tabtrail" "local")) >=20 >=20 > Obviously, it depends. If the arguments are essentially an enumeration, > i.e., the possible/allowed values are just a small set, then I'd use > symbols or keywords. E.g., an argument location with possible values > local and remote =3D> :local / :remote. An argument first-name, well, >=20 > that's a string because it can be anything. >=20 > It also depends on the usage of the argument. If you just print it out, > a string is fine. If you dispatch on it (using case, pcase, cond), > keywords and symbols are probably better. Mostly because they stand out > a bit and it's immediately visible that they have special meaning > affecting the control flow. --- Tassilo Focusing on arguments for dispatching commands on them using case, pcase,= =20 cond, I shall use keywords and symbols to be immediately visible their=20 special meaning.