From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r117987: * internals.texi (Stack-allocated Objects): Describe this feature. Date: Tue, 30 Sep 2014 12:15:34 -0700 Organization: UCLA Computer Science Department Message-ID: <542B0156.1040001@cs.ucla.edu> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1412104603 5480 80.91.229.3 (30 Sep 2014 19:16:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2014 19:16:43 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 30 21:16:36 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XZ2uZ-0005w8-Lf for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2014 21:16:35 +0200 Original-Received: from localhost ([::1]:45230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ2uZ-00058O-41 for ged-emacs-devel@m.gmane.org; Tue, 30 Sep 2014 15:16:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ2uO-00051D-NM for emacs-devel@gnu.org; Tue, 30 Sep 2014 15:16:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZ2uA-0004qS-W6 for emacs-devel@gnu.org; Tue, 30 Sep 2014 15:16:24 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:50089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ2uA-0004of-P1 for emacs-devel@gnu.org; Tue, 30 Sep 2014 15:16:10 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 0622439E8017 for ; Tue, 30 Sep 2014 12:16:02 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F6DPpHmfdEE2 for ; Tue, 30 Sep 2014 12:15:53 -0700 (PDT) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 2D0C639E8016 for ; Tue, 30 Sep 2014 12:15:53 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:174884 Archived-At: On 09/30/2014 10:55 AM, Stefan Monnier wrote: > I don't know C99 and I hence don't know > what is the "corresponding scope" of those new thingies. I gave a shot at improving that part of the documentation in trunk bzr 117990. > See my other message about these macros. Sorry, I don't remember which message that was? > I'd much prefer > declaration-level macros, which would come with clear scoping. Although I can see the attraction of their clearer scoping, requiring a name for every temporary can make code considerably harder to read. For example, we'd have to replace this: caller = concat3 (SCOPED_STRING (" <"), caller, SCOPED_STRING (">")); with something like this: SCOPED_STRING (space_lessthan, " <"); SCOPED_STRING (greaterthan, ">"); caller = concat3 (space_lessthan, caller, greaterthan); Regardless of whether we use declaration-style macros, there is one thing I'd like to change: the macro names. These macros are not about *scope*; they are about *lifetime*. How about the prefix "auto_" (from the C keyword 'auto') rather than "scope_"? Or maybe "block_" because it's block lifetime? ("auto_" is shorter....) Also, I capitalized SCOPED_STRING on the theory that it is often not implemented as a function. On second thought since it can be (and sometimes is) implemented as a function I'm thinking we should make it lower-case, as scoped_cons etc. are. (Correcting its prefix of course.)