From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: What does ":noerror" do? Date: Sun, 13 Oct 2013 01:06:06 +0200 Organization: Informatimago Message-ID: <87ob6uks2p.fsf@informatimago.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1381619413 3833 80.91.229.3 (12 Oct 2013 23:10:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Oct 2013 23:10:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 13 01:10:18 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VV8KA-0007Oz-IY for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Oct 2013 01:10:18 +0200 Original-Received: from localhost ([::1]:59572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VV8K9-0007Rf-R5 for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Oct 2013 19:10:17 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 55 Original-X-Trace: individual.net PuyWzmbvLoSHJ7DklGHxCAIgddPZYiPPMTRUCNzrm3DaxmjTj4 Cancel-Lock: sha1:ZDM0ZWVlYjY3MGU5MTg3NjllZGIxMWE0ODcxNmY2NTgxZmVmYmE1Yw== sha1:oshTgF2M1dEOX4D8ON7n1lJGJGs= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:201704 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93973 Archived-At: Xue Fuqiao writes: > Hi, > >>>From a recent post in emacs-devel[fn:1], I found a usage like this: > > (message "Loading Emacspeak...%s" > (if (load "emacspeak-loader" :noerror) "success!" "FAILED!")) > > I'm not sure what the ‘:noerror’ is. It seems that the ‘:noerror’ is > just like a random symbol, like ‘(quote noerror)’, but I could't find this > kind of usage in lispref. Any ideas? It is a lisp object that is not the symbol nil, and therefore that is true. That's all it takes for a boolean argument. The doc is quite clear about it: If optional second arg NOERROR is non-nil, report no error if FILE doesn't exist. Now this is what it does to the emacs processor. The question is what it does to the programmer mind of the human readers? I could not say about people in general. It sure looks like it confused you. I can tell that I think it should inspire TERROR in every programmer minds. Think about it: (load file nil :noerror nil :nosuffix) At least, in Common Lisp we'd use keyword arguments writing something like: (load file :verbose t :print nil :if-does-not-exist nil :external-format :utf-8) and if a typo or wrong keyword is given, the function can easily and do signal an error. But with optional arguments, the programmer must ensure that the parameter are given in the right order, and using keywords for true booleans may confuse this, and impact a different meaning to the programmer than to the compiler. Terror should ensue. -- __Pascal Bourguignon__ http://www.informatimago.com/