From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Scott Bell Newsgroups: gmane.emacs.help Subject: Re: pcase with progn Date: Wed, 27 Nov 2024 15:33:10 -0700 Message-ID: References: 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="20256"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 28 06:02:11 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 1tGWfK-00056M-SI for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 Nov 2024 06:02:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGWel-0007e2-3e; Thu, 28 Nov 2024 00:01:35 -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 1tGQbB-0002Ky-HP for help-gnu-emacs@gnu.org; Wed, 27 Nov 2024 17:33:29 -0500 Original-Received: from pv50p00im-ztdg10011201.me.com ([17.58.6.39]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGQb9-0004L5-2j for help-gnu-emacs@gnu.org; Wed, 27 Nov 2024 17:33:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1732746805; bh=WGYE1DuMLI6N/d+Cvx3jLPlW9Svyn6cgWkrQATSAT08=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type: x-icloud-hme; b=KFEgeyHpR6pWxpN66iEXK9+V7ZInclmJyPP47To6i0j86EOB+pXCmimXlZuMdzO+D OpTwQEI3UFvFQJWgmdXqlBmk2vw0elkpLRuMqapaF2+bSY7eYCZcbxr8AIc4Xs9LxY H1eEanwUkOWN+mi95YcHV27BbFJBNn5RUUvWGTU/jXIco3Pl5dl85DZalMTkJ+H4pv itL0EgvDhQFTdXe2CJ3Zh9LZbxSC4nop+vx+hA6vS+GGKXkMX3bhHVeZIQsXi3WGSM bCeKcyrmh9YFA4FvPeOHsNTEAoxRBtz42ONDHA3RTqydg9GeJtEWBWkRUtcTGq18KU abKzOY4n40xEw== Original-Received: from neun.local (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10011201.me.com (Postfix) with ESMTPSA id BDFE1680210; Wed, 27 Nov 2024 22:33:22 +0000 (UTC) In-Reply-To: (Heime's message of "Wed, 27 Nov 2024 20:50:58 +0000") X-Proofpoint-ORIG-GUID: T7TjAfEiz1B-WtSSVv_RBvg-YUDErTgg X-Proofpoint-GUID: T7TjAfEiz1B-WtSSVv_RBvg-YUDErTgg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-11-27_10,2024-11-27_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 adultscore=0 mlxscore=0 suspectscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2411270176 Received-SPF: pass client-ip=17.58.6.39; envelope-from=sctb@me.com; helo=pv50p00im-ztdg10011201.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, 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_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 28 Nov 2024 00:01:31 -0500 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:148423 Archived-At: Heime writes: > (defun pola-symbol-name (sbl &optional sel) > "Get the string representation of symbol SBL. If it is > already a string, return it unchanged." > ... > The command should return the string representation of symbol if > it exists. When the command fails (symbol does not exist), are commands > customarily return nil or an error?=20 This depends entirely on the meaning of your function and its intended usage. Generally speaking, it=E2=80=99s preferable to return nil to represe= nt failure unless nil is a valid value in the successful case. Since your function always returns a string if it=E2=80=99s successful, it would proba= bly be good to return nil on failure. Errors are most often employed when the program has encountered some value or condition under which it=E2=80=99s not possible to proceed normall= y. In that case, signalling an error stops execution and returns to the nearest enclosing error handler which will decide what to do about it.