From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: hash with zero size Date: Mon, 05 Jul 2004 09:48:14 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <877jtjqqpt.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1088984946 23094 80.91.224.253 (4 Jul 2004 23:49:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 4 Jul 2004 23:49:06 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jul 05 01:48:59 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BhGjC-0008Go-00 for ; Mon, 05 Jul 2004 01:48:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BhGl9-00025P-3o for guile-devel@m.gmane.org; Sun, 04 Jul 2004 19:50:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BhGkx-00025K-RX for guile-devel@gnu.org; Sun, 04 Jul 2004 19:50:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BhGkx-000258-B1 for guile-devel@gnu.org; Sun, 04 Jul 2004 19:50:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BhGkx-000255-8u for guile-devel@gnu.org; Sun, 04 Jul 2004 19:50:47 -0400 Original-Received: from [61.8.0.85] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BhGic-0007LT-78 for guile-devel@gnu.org; Sun, 04 Jul 2004 19:48:22 -0400 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i64NmL5v018975 for ; Mon, 5 Jul 2004 09:48:21 +1000 Original-Received: from localhost (ppp2B88.dyn.pacific.net.au [61.8.43.136]) by mailproxy2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i64NmJnk017101 for ; Mon, 5 Jul 2004 09:48:19 +1000 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1BhGiU-0000gW-00; Mon, 05 Jul 2004 09:48:14 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3828 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3828 --=-=-= Calling (hash #t 0) kills guile with a divide-by-zero, whereas I'd have hoped probably for an out-of-range error throw. * hash.c (scm_hashq, scm_hashv, scm_hash): Restrict to size>=1 rather than just size>=0, since 0<=hashbool (object-documentation hash))) (pass-if-exception "hash #t -1" exception:out-of-range (hash #t -1)) (pass-if-exception "hash #t 0" exception:out-of-range (hash #t 0)) (pass-if (= 0 (hash #t 1))) (pass-if (= 0 (hash #f 1))) (pass-if (= 0 (hash noop 1)))) ;;; ;;; hashv ;;; (with-test-prefix "hashv" (pass-if (->bool (object-documentation hashv))) (pass-if-exception "hashv #t -1" exception:out-of-range (hashv #t -1)) (pass-if-exception "hashv #t 0" exception:out-of-range (hashv #t 0)) (pass-if (= 0 (hashv #t 1))) (pass-if (= 0 (hashv #f 1))) (pass-if (= 0 (hashv noop 1)))) ;;; ;;; hashq ;;; (with-test-prefix "hashq" (pass-if (->bool (object-documentation hashq))) (pass-if-exception "hashq #t -1" exception:out-of-range (hashq #t -1)) (pass-if-exception "hashq #t 0" exception:out-of-range (hashq #t 0)) (pass-if (= 0 (hashq #t 1))) (pass-if (= 0 (hashq #f 1))) (pass-if (= 0 (hashq noop 1)))) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --=-=-=--