From: Eli Zaretskii <eliz@gnu.org>
To: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: EARRAYSIZE
Date: Fri, 04 Apr 2014 10:45:30 +0300 [thread overview]
Message-ID: <83ioqpa679.fsf@gnu.org> (raw)
In-Reply-To: <878urmfa3j.fsf@fencepost.gnu.org>
> From: David Kastrup <dak@gnu.org>
> Date: Thu, 03 Apr 2014 22:10:08 +0200
>
> Daniel Colascione <dancol@dancol.org> writes:
>
> > On 04/03/2014 12:30 PM, Eli Zaretskii wrote:
> >> +/* Find number of elements in array */
> >> +#define EARRAYSIZE(arr) (sizeof (arr) / sizeof ((arr)[0]))
> >>
> >> I find the name of this macro to be unfortunate: what it returns is
> >> not "size" in the accepted meaning of that word.
> >
> > "Length", "size", and "count" are hopelessly confounded anyway. I'm not
> > attached to any particular term: I chose EARRAYSIZE because ARRAYSIZE
> > and ARRAY_SIZE hace been common in other projects I've worked on.
> >
> >> How about ALEN, or ARRAYELTS instead?
> >
> > Of these, I prefer ARRAYELTS. I'll change the name.
>
> Since Elisp has (length "333"), (length '(4 5 6)), and (length [4 5 3]),
> for Emacs code LENGTH or LEN should be a reasonably straightforward
> naming choice.
I suggested ALEN because we have AREF and ASIZE. Maybe AELTS or
ALENGTH would be better.
next prev parent reply other threads:[~2014-04-04 7:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-03 19:30 EARRAYSIZE Eli Zaretskii
2014-04-03 19:34 ` EARRAYSIZE Daniel Colascione
2014-04-03 20:10 ` EARRAYSIZE David Kastrup
2014-04-04 7:45 ` Eli Zaretskii [this message]
2014-04-04 8:04 ` EARRAYSIZE Paul Eggert
2014-04-04 8:14 ` EARRAYSIZE Eli Zaretskii
2014-04-04 8:41 ` EARRAYSIZE David Kastrup
2014-04-04 8:06 ` EARRAYSIZE Dmitry Antipov
2014-04-04 8:15 ` EARRAYSIZE Eli Zaretskii
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=83ioqpa679.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=dak@gnu.org \
--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).