From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: EARRAYSIZE Date: Fri, 04 Apr 2014 10:45:30 +0300 Message-ID: <83ioqpa679.fsf@gnu.org> References: <83ob0i9pn9.fsf@gnu.org> <533DB7D9.5070407@dancol.org> <878urmfa3j.fsf@fencepost.gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1396597549 10752 80.91.229.3 (4 Apr 2014 07:45:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Apr 2014 07:45:49 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 04 09:45:42 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 1WVyon-0000uh-NS for ged-emacs-devel@m.gmane.org; Fri, 04 Apr 2014 09:45:41 +0200 Original-Received: from localhost ([::1]:48243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVyom-0005VJ-PR for ged-emacs-devel@m.gmane.org; Fri, 04 Apr 2014 03:45:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVyoZ-0005Fz-Jm for emacs-devel@gnu.org; Fri, 04 Apr 2014 03:45:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVyoU-0001Qz-0x for emacs-devel@gnu.org; Fri, 04 Apr 2014 03:45:27 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:58386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVyoN-0001Ma-Qn; Fri, 04 Apr 2014 03:45:15 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N3H00500XHN6V00@a-mtaout20.012.net.il>; Fri, 04 Apr 2014 10:45:14 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N3H004QJXJEUX90@a-mtaout20.012.net.il>; Fri, 04 Apr 2014 10:45:14 +0300 (IDT) In-reply-to: <878urmfa3j.fsf@fencepost.gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 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:171296 Archived-At: > From: David Kastrup > Date: Thu, 03 Apr 2014 22:10:08 +0200 > > Daniel Colascione 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.