From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Possible bugs concerning bool-vectors. Date: Mon, 24 Nov 2003 20:39:41 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200311250239.hAP2dft28755@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1069728705 19320 80.91.224.253 (25 Nov 2003 02:51:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Nov 2003 02:51:45 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Nov 25 03:51:42 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AOTIk-0008Mp-00 for ; Tue, 25 Nov 2003 03:51:42 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AOTIk-0002nx-00 for ; Tue, 25 Nov 2003 03:51:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AOUB6-0005Dn-Bw for emacs-devel@quimby.gnus.org; Mon, 24 Nov 2003 22:47:52 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AOUAz-0005Bp-QY for emacs-devel@gnu.org; Mon, 24 Nov 2003 22:47:45 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AOUAT-00056L-RK for emacs-devel@gnu.org; Mon, 24 Nov 2003 22:47:44 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AOUAT-00056D-JO for emacs-devel@gnu.org; Mon, 24 Nov 2003 22:47:13 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id hAP2jjKk010381 for ; Mon, 24 Nov 2003 20:45:46 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id hAP2dft28755; Mon, 24 Nov 2003 20:39:41 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18097 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18097 Is everything in the ielm run below actually OK or does it illustrate bugs in the handling of bool-vectors? It certainly illustrates "features" that seem quite unintuitive. ===File ~/bool-ielm========================================= *** Welcome to IELM *** Type (describe-mode) for help. ELISP> (setq b1 (make-bool-vector 3 t)) #&3"" ;; Of course, ^G is 7, definitely no bug here. ELISP> (fillarray b1 t) #&3"ÿ" ;; this is the character with code 2303 ELISP> (format "%o" 2303) "4377" ;; the last 3 bits are still 7. b1 has length 3. OK. ELISP> (setq b2 (make-bool-vector 3 t)) #&3"" ELISP> (equal b1 b2) nil ;; this however looks strange to me. ELISP> (setq b3 #&3"ÿ") ;; We set b3 to the printed representation of b1. #&3"" ELISP> (equal b1 b3) nil ;; b1 is not `equal' to the result of evaluating its ;; printed representation. ELISP> (equal b2 b3) t ELISP> (length b1) 3 ;; Yes, b1 still has length 3. ELISP> ============================================================ Comments: I can understand that fillarray winds up filling up an array used for internal representation with length larger than 3, but b1 starts out having length 3 and after the call to fillarray still has length 3. Intuitively, it would seem that there are exactly 2^3 = 8 bool-vectors of length 3, but apparently not, there are a huge number of them, due to differences in additional internal spots. Bug? `fill-array' is supposed to work (give sensible and expected results) for arbitrary arrays. That includes bool-vectors. Actually, the doc string says so. C-h f fillarray: fillarray is a built-in function. (fillarray ARRAY ITEM) Store each element of ARRAY with ITEM. ARRAY is a vector, string, char-table, or bool-vector. My comments again: Does anything in this doc string suggest the above behavior? Sincerely, Luc.