From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: EARRAYSIZE Date: Thu, 03 Apr 2014 22:10:08 +0200 Organization: Organization?!? Message-ID: <878urmfa3j.fsf@fencepost.gnu.org> References: <83ob0i9pn9.fsf@gnu.org> <533DB7D9.5070407@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1396555847 6296 80.91.229.3 (3 Apr 2014 20:10:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2014 20:10:47 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 03 22:10:40 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 1WVnyB-0005nT-QN for ged-emacs-devel@m.gmane.org; Thu, 03 Apr 2014 22:10:39 +0200 Original-Received: from localhost ([::1]:46207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVnyB-00076v-BF for ged-emacs-devel@m.gmane.org; Thu, 03 Apr 2014 16:10:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVny1-0006ye-Vh for emacs-devel@gnu.org; Thu, 03 Apr 2014 16:10:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVnxv-0001Ly-1g for emacs-devel@gnu.org; Thu, 03 Apr 2014 16:10:29 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVnxu-0001Lk-SA for emacs-devel@gnu.org; Thu, 03 Apr 2014 16:10:23 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WVnxt-0005YC-Qd for emacs-devel@gnu.org; Thu, 03 Apr 2014 22:10:21 +0200 Original-Received: from x2f461f8.dyn.telefonica.de ([2.244.97.248]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Apr 2014 22:10:21 +0200 Original-Received: from dak by x2f461f8.dyn.telefonica.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Apr 2014 22:10:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: x2f461f8.dyn.telefonica.de X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:eoQM7mlvXqZlGniUmRLyS2GBmpc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:171285 Archived-At: 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. -- David Kastrup