From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Andreas_R=c3=b6hler?= Newsgroups: gmane.emacs.help Subject: Re: Rationale behind conversion of a nil prefix arg to numeric 1 Date: Mon, 5 Sep 2016 09:16:00 +0200 Message-ID: References: <87y437c0qg.fsf@bertrandrussell.Speedport_W_723V_1_40_000> <83oa43d9r8.fsf@gnu.org> <06d4a7f1-f116-fb5c-9bd2-c4d1f98934c9@easy-emacs.de> <83k2ercy5u.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1473059407 8074 195.159.176.226 (5 Sep 2016 07:10:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Sep 2016 07:10:07 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.2.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 05 09:10:03 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgo2a-0001Pp-MA for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Sep 2016 09:10:00 +0200 Original-Received: from localhost ([::1]:52658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgo2Y-0004qH-Hs for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Sep 2016 03:09:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgo28-0004py-MK for help-gnu-emacs@gnu.org; Mon, 05 Sep 2016 03:09:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgo24-0004x2-JS for help-gnu-emacs@gnu.org; Mon, 05 Sep 2016 03:09:32 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.133]:52701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgo24-0004wp-8r for help-gnu-emacs@gnu.org; Mon, 05 Sep 2016 03:09:28 -0400 Original-Received: from [192.168.178.35] ([77.12.2.64]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0LxXtj-1b1Uwm0wnr-017GvC for ; Mon, 05 Sep 2016 09:09:27 +0200 In-Reply-To: <83k2ercy5u.fsf@gnu.org> X-Provags-ID: V03:K0:WGS+dGYYNl5KmTC4KYFpi7K5+1ka6DvL6d5nuUQObaTl12Jog7d qJKm1hfqOTF541GcP314tLIUSuC5b9En1jPMeelZwyv4iVb4/bLRF5XJ9kOHKtbJ2GGGQd+ bmccfK5lyzt440wTS4/46ozxud/MMD9TAtyUoJOlhny4qrl62S38eHk5GqD2A0vcRp4Jk3U VXCfo6DxFUiFbu7SZDwAA== X-UI-Out-Filterresults: notjunk:1;V01:K0:R3zHSd7R0mQ=:csV0GOTTAbChqxH8j3z7mx iXJKyTPnpNBSyBjLfWFKqqDOXEWgwa5B0r24Roh7R+g5mQ2leqgaHSUAwGCjYCIBPHaRR+tDu 6EvG1NdAJ/x+vFQ6ON3g2TVwPRURytCPvc767tFCe2A/7ZvSlxcaSlvrCg1ghb8/GbPAptuhg hDNFqvCmQJGnFwTce0KbWzDtnlEMHJ0l+05jiHy/OlGej7oBMIz3iQn9J5mAtPjNtacc5PXlq GHdMnkAuBJckYlHxU/daWBLk3C16OvnZRYE5JHfFo5LQQRb1cF99KrFZW6aj4ESdmGM5u2zRq xilC3DAQFVnN7oRcc8WJ0sDqQKxe6NCKISZ2cqUZFZ4/4Pcmd9kAEscmln3mvlYFqqhXabeT/ TZiKE9ytCLmvQJEX7vR95EQaooE1oTXIXL5E4fc+n3wI+LRGvwE+GtYj8+7BIHE1QH4TfQ0DM rYrE4u6rseGk+J9lvFKQhrh2q7iv+tgbn1QDl8BSFXvYoNo/nn8ZPfc+p9DFPGxo5DCjYVWkE VDTn+QmtIhb84BBNCrJRLDp2WQly0GNx4F9cA6VthhbjPg4yqnMFGz3T5mMFgDmVx2K6ulOTq bn+0rCcbU74geDdxCBPYdXd4LjUAcVn9qc0fvRnO7dEZZheLAngDTK6HFtNr1G+qrYj26ZriG nIAiR7dvMGTYwvvJzljqLtyKru6viIhWHvWu4gpJxEwHPgGZEpACeiSDWI5vKJ9pgUsdkWs4E QLqaNRZD6etJGGmf X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.133 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:111259 Archived-At: On 04.09.2016 20:33, Eli Zaretskii wrote: >> From: Andreas Röhler >> Date: Sun, 4 Sep 2016 19:11:31 +0200 >> >>>> I am still wondering about the >>>> rationale of representing nil as the number one. Does this make sense, >>>> or is it useful, in some way? >>> Yes. Most commands use the argument as a repeat count, so having it >>> default to one makes perfect sense. >>> >> There a difference between "p" sending 1 and nil - which is the result >> from non-interactive use. > "p" is documented as the _numeric_ value of the argument. So it > obviously cannot yield nil. The ideosyncrasy: it yields the same value for arg = 1 as if no arg were given: (defun foo (&optional arg) (interactive "p") (message "My ARG: %s" arg) (message "Value of arg: %s" (prefix-numeric-value arg))) ;; called without ARG (foo) ==> "My ARG: nil" ==> "Value of arg: 1" ;; called without ARG 1 (foo 1) ==> "My ARG: 1" ==> "Value of arg: 1" Regardless of its purpose - such coding style should not be encouraged. It would be easy and consistent to write (or arg (setq arg 1))