Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: Andy Walker Newsgroups: comp.compilers Subject: Re: Is multi-level function return possible? Date: Fri, 21 Mar 2014 02:04:51 +0000 Organization: Not very much Lines: 53 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-053@comp.compilers> References: <14-03-020@comp.compilers> <14-03-022@comp.compilers> <14-03-025@comp.compilers> <14-03-030@comp.compilers> <14-03-044@comp.compilers> <14-03-046@comp.compilers> <14-03-047@comp.compilers> <14-03-048@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: miucha.iecc.com 1395368695 52187 2001:470:1f07:1126:0:676f:7373:6970 (21 Mar 2014 02:24:55 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 21 Mar 2014 02:24:55 +0000 (UTC) Keywords: design, history, comment Posted-Date: 20 Mar 2014 22:24:55 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1175 On 18/03/14 17:36, Anton Ertl wrote: > Keeping a feature may just be loyalty, but adding it back after it had > been removed says something about what the language designer thought > about the usefulness of the feature. Well, it certainly implies that the designer [or the committee!] is admitting to a mistake. *Not* adding it back in may be because the feature really was useless, because the particular user base sees no need for the feature, because the feature is too expensive, or because of pig-headedness. I expect contributors could write long articles of examples of each of these .... [...] > "Parameters have a run-time cost": So has access to non-local > variables. That depends on the machine and compiler. The first compiler I used extensively [for Atlas Autocode] accessed variables at lexical depth N by offsetting from register N, so all variables were accessed at exactly the same cost. But that would have been difficult on a machine with few registers. [...] > Did I miss any arguments? Not so much an argument as a philosophy. You can ask about the usefulness of a feature from several viewpoints. Is it needed? Is it something the users want? Is it something they should want, or would want if only they knew about it? Is it something that would attract new users or new applications? Is it consonant with the rest of the language? Is it easy to parse and to generate code for? Is it easy to explain? Is it efficient? And so on. You seem to be approaching your question from the point of view of a compiler writer; I'm more interested in writing programs. Writing programs is itself a very personal activity depending on experience and context, so different people may perfectly reasonably have very different attitudes to any particular feature. In other words, "Are nested functions useful?" does not have a clear and definite answer. They're useful to me [marginally so, and there are things I would add to C more urgently, if urgency makes any sense after 40-ish years]; I guess they'd be more useful to those with a more Pascal-oriented background; they were clearly of very little use to the designers of C and Unix, and by now to the many programmers whose formative years were based around C and its derivatives. They can be worked around; should we have to? -- Andy Walker, Nottingham. [It occurs that a lot of the stuff people used to do with small nested functions we now do with macros, or sometimes with complex types that do dereferencing that used to need explicit code. -John]