From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "James K. Lowden" Newsgroups: gmane.emacs.help Subject: Re: history of argv (was: Re: How to do a massive unfill paragraph operation over several hundred files?) Date: Sat, 29 Sep 2018 17:20:00 -0400 Organization: http://www.NewsDemon.com Message-ID: <20180929172000.8ad18945efea9ef7de6c82a3@speakeasy.net> References: <8636ts4jz3.fsf@zoho.com> <86sh1s33xn.fsf_-_@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1538256206 11984 195.159.176.226 (29 Sep 2018 21:23:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Sep 2018 21:23:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 29 23:23:22 2018 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 1g6Mhu-00030c-3N for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Sep 2018 23:23:22 +0200 Original-Received: from localhost ([::1]:52761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6Mk0-00048c-71 for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Sep 2018 17:25:32 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer04.fr7!futter-mich.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post02.iad!fx05.iad.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Newsreader: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64--netbsd) Original-Lines: 46 Original-X-Complaints-To: abuse@newsdemon.com Original-NNTP-Posting-Date: Sat, 29 Sep 2018 21:20:02 UTC X-Received-Bytes: 2868 X-Received-Body-CRC: 2917173373 Original-Xref: usenet.stanford.edu gnu.emacs.help:223945 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:118071 Archived-At: On Sat, 29 Sep 2018 14:04:36 +0200 Emanuel Berg wrote: > BTW I always thought, without thinking about > it, that "argv" is a convention in and from the > C programming language! > ... > Or argv may trace its origin to yet some other > language or piece of technology! It's a little difficult to disentangle C from Unix, but the argv convention owes more to Unix than to C. ISO C distinguishes between freestanding and hosted environments. main() is defined only in a hosted environment, and the names of the arguments are not defined. So, fair to say, argv is a C convention but not defined by C. Unix on the other hand defines its exec(3) family of functions. Any program thus invoked is provided an array of pointer-to-char and the length of that array. The documentation for exec(3) typically refers to the array as argv. It's hard to overstate the effect Unix had on other operating systems and programmer expectations. Would MS-DOS or even VMS support argv, but for the influence of Unix? Not C, certainly; C didn't dominate the landscape in 1980 as it does now. That was the era of ADA, Modula-2, Turbo-Pascal, and "4th generation" languages. And Cobol, of course. C is the native API for Windows, but the Windows entry point (conventionally, "WinMain") isn't provided with argv. It's given the command line verbatim; parse it as you will. https://msdn.microsoft.com/en-us/library/windows/desktop/ms633559 (v=vs.85).aspx No landscape is more alien to C than IBM, and argv on IBM systems is round peg in a square hole. Cf. IMS and CICS at: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.cbclx01/comlin.htm. Coming back on topic, there's no small intersection between the Unix and elisp communities. When the need arose to name the array of strings passed to the exec'd program, it's little wonder it got named "argv". --jkl