From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Charles Millar Newsgroups: gmane.emacs.help Subject: Re: Rationale behind conversion of a nil prefix arg to numeric 1 Date: Wed, 07 Sep 2016 19:11:59 -0400 Message-ID: <6512cbf9-e702-bc96-7489-54fa23f9bfe8@verizon.net> 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> <83bn02cs54.fsf@gnu.org> <83ed1411-dbc1-2fe1-5fe9-4fdc7a4d1b21@online.de> <83shteb26t.fsf@gnu.org> <20160906071015.GB15537@tuxteam.de> <87inu98ipz.fsf@bertrandrussell.Speedport_W_723V_1_40_000> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: blaine.gmane.org 1473302459 22670 195.159.176.226 (8 Sep 2016 02:40:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Sep 2016 02:40:59 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/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 Thu Sep 08 04:40:55 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 1bhpGp-0005MH-AR for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Sep 2016 04:40:55 +0200 Original-Received: from localhost ([::1]:44509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhpGn-0004WJ-3q for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Sep 2016 22:40:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhm1B-0008KV-F2 for help-gnu-emacs@gnu.org; Wed, 07 Sep 2016 19:12:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhm16-0008WH-DT for help-gnu-emacs@gnu.org; Wed, 07 Sep 2016 19:12:32 -0400 Original-Received: from vms173015pub.verizon.net ([206.46.173.15]:57920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhm16-0008Vp-7Y for help-gnu-emacs@gnu.org; Wed, 07 Sep 2016 19:12:28 -0400 Original-Received: from vz-proxy-l004.mx.aol.com ([64.236.82.151]) by vms173015.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0OD500AJ2PS5OS50@vms173015.mailsrvcs.net> for help-gnu-emacs@gnu.org; Wed, 07 Sep 2016 18:12:05 -0500 (CDT) Original-Received: by 70.209.160.173 with SMTP id 16b3fd08; Wed, 07 Sep 2016 23:12:05 GMT In-reply-to: X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=WpDWSorv c=1 sm=1 tr=0 a=eaPqxu9IKnv3tbb7QsXVMw==:117 a=IkcTkHD0fZMA:10 a=GW1xBdLrtEIA:10 a=_CCxNclSEwTJkkys9EgA:9 a=QEXdDO2ut3YA:10 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.46.173.15 X-Mailman-Approved-At: Wed, 07 Sep 2016 22:40:13 -0400 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:111306 Archived-At: On 09/06/2016 10:20 AM, Kaushal Modi wrote: > On Tue, Sep 6, 2016, 7:22 AM Andreas R=C3=B6hler > wrote: > >> But let's go back to the simplest case of lower p in interactive s= pec: >> >> What is easier to read/grasp >> >> (setq counter (or arg 1) >> >> or >> >> (setq counter (prefix-numeric-value arg)) >> >> IOW: in favor of avoiding these complex, tricky things. Let's have= the >> code as explicit as possible. >> > Those 2 forms are not 100=E2=84=85 equivalent. The equivalence goes= only as far as > setting the default value of counter. > > If the user used (interactive "p"), counter need to be set to 4 reg= ardless > of whether the user used "C-4" as prefix or "C-u". In the former ca= se, arg > would be "4", but in the latter case, it would be "(4)", I.e. a lis= t, not a > number. Your simpler representation would not take care of the C-u = case. If > the counter variable is used where a numeric arg is strictly requir= ed, you > will get an error. Here, prefix-numeric-value returns "4" when arg = is > "(4)". > >> -- > I have read this thread as well as the other suggested readings. If t= he=20 purpose of either p or P is to pass arguments, I do not understand th= e=20 rationale of allowing C-u when using the interactive upper case P. As= =20 noted above, It returns an integer as the only element in a list, whi= ch=20 if evaluated returns an error. Is there a use for this? Such as you m= ay=20 want an error? Charlie Millar