unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r117987: * internals.texi (Stack-allocated Objects): Describe this feature.
Date: Tue, 30 Sep 2014 12:15:34 -0700	[thread overview]
Message-ID: <542B0156.1040001@cs.ucla.edu> (raw)
In-Reply-To: <jwv8ul1knak.fsf-monnier+emacs@gnu.org>

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.)



  reply	other threads:[~2014-09-30 19:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1XYzSf-00075J-Dr@vcs.savannah.gnu.org>
2014-09-30 17:55 ` [Emacs-diffs] trunk r117987: * internals.texi (Stack-allocated Objects): Describe this feature Stefan Monnier
2014-09-30 19:15   ` Paul Eggert [this message]
2014-09-30 19:29     ` Eli Zaretskii
2014-09-30 19:49       ` David Kastrup
2014-09-30 20:20     ` Stefan Monnier
2014-10-01  3:31       ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542B0156.1040001@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).