From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.bugs Subject: bug#6878: bool-vectors of length 0 signal error when aref/aset the 0th element Date: Thu, 19 Aug 2010 22:01:43 -0400 Message-ID: References: <87r5hutw2q.fsf@stupidchicken.com> <87fwyauqwy.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1282270155 7220 80.91.229.12 (20 Aug 2010 02:09:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Aug 2010 02:09:15 +0000 (UTC) Cc: Juanma Barranquero , Andreas Schwab , 6878@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 20 04:09:12 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OmH2d-0003Gt-Lj for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Aug 2010 04:09:11 +0200 Original-Received: from localhost ([127.0.0.1]:56073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmH2d-0001KN-3u for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Aug 2010 22:09:11 -0400 Original-Received: from [140.186.70.92] (port=34530 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmH2U-0001IE-U4 for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2010 22:09:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OmH2T-00054L-Am for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2010 22:09:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45783) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmH2T-00054H-9C for bug-gnu-emacs@gnu.org; Thu, 19 Aug 2010 22:09:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OmGuj-0004ao-Nn; Thu, 19 Aug 2010 22:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: MON KEY Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Aug 2010 02:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6878 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6878-submit@debbugs.gnu.org id=B6878.128226963817646 (code B ref 6878); Fri, 20 Aug 2010 02:01:01 +0000 Original-Received: (at 6878) by debbugs.gnu.org; 20 Aug 2010 02:00:38 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmGuM-0004aZ-Gt for submit@debbugs.gnu.org; Thu, 19 Aug 2010 22:00:38 -0400 Original-Received: from mail-gy0-f172.google.com ([209.85.160.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmGuJ-0004aU-Mq for 6878@debbugs.gnu.org; Thu, 19 Aug 2010 22:00:37 -0400 Original-Received: by gyg8 with SMTP id 8so1061872gyg.3 for <6878@debbugs.gnu.org>; Thu, 19 Aug 2010 19:01:43 -0700 (PDT) Original-Received: by 10.100.38.3 with SMTP id l3mr748685anl.197.1282269703743; Thu, 19 Aug 2010 19:01:43 -0700 (PDT) Original-Received: by 10.100.37.18 with HTTP; Thu, 19 Aug 2010 19:01:43 -0700 (PDT) In-Reply-To: <87fwyauqwy.fsf@stupidchicken.com> X-Google-Sender-Auth: Xpk40b11U389DG5vhFVcKV-ES4c X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 19 Aug 2010 22:01:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:39654 Archived-At: On Thu, Aug 19, 2010 at 7:24 PM, Chong Yidong wrote= : > MON KEY writes: > >> The manual says a `t' or `nil' "must" be there. > > Admittedly, the wording in the manual makes it possible for a reader to > misinterpret it, if he is determined to do so. =C2=A0I have changed it to > read It isn't the determined reader its the haphazer user... > > =C2=A0 =C2=A0A @dfn{bool-vector} is a one-dimensional array whose element= s must > =C2=A0be @code{t} or @code{nil}. > > which should be less ambiguous. =C2=A0Thus, I'm closing this bug. > As you wish. Though, I don't think changing the wording solves the real pro= blem If there are no good reasons to create a boole-vectro of length 0 why allow= it? FWICG older lisp dialects from which Emacs lisp derives used bit arrays in special ways e.g. LispM Lisp `bitblt' and `boole' related functions see the= Lisp Machine Manual page 123 (of 484) and page 92 (of 484) of pdf here: (URL `http://www.bitsavers.org/pdf/mit/cadr/chinual_3rdEd_Mar81.pdf') But these systems/dialects allowed array indirction and size extension. Emacs lisp doesn't and I can think of no good reasons to create 0 length bool-vectors. Can any one else? If there are no good reasons to create a boole-vector of length 0 and nothi= ng good to do with them even when you can do it why allow it to occur in the first place? This said, its doubtfull the feature would be missed either way. Though apparently frobbing the lsb has interesting steganographic utility..= . rgrep'ing "make-boole-vector" in lisp/ finds only two active uses of `make-bool-vector' appearing in /lisp: emacs-lisp/sregex.el's `sregex--char-aux' play/mpuz.el `mpuz-found-digits' `make-bool-vector' Its use was deprecated in the following places: lisp/ChangeLog.10 2001-10-21 Miles Bader * wid-edit.el (checkbox): Swap bg/fg colors in image, and invert image bits to compensate. Use `make-string' instead of `make-bool-vector' (XBM apparently wants byte-aligned rows). revno: 40075 :from ! :off-glyph (create-image (make-bool-vector 49 1) :to ! :off-glyph (create-image (make-string 7 0) lisp/ChangeLog.9 2000-08-09 Stefan Monnier * emacs-lisp/regexp-opt.el (make-bool-vector): Remove. revno: 32042 :from ! (let* ((charwidth 256) ; Yeah, right. ! (charmap (make-bool-vector charwidth nil)) :to ! (let* ((charmap (make-char-table 'case-table)) -- /s_P\