Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!olivea!news.bu.edu!gw1.att.com!nntpa!nntpa.cb.att.com!lgm
From: lgm@polaris.ih.att.com (Lawrence G. Mayka)
Subject: Re: Comparison: Beta - Lisp
In-Reply-To: jeff@aiai.ed.ac.uk's message of Wed, 14 Sep 1994 16:29:14 GMT
Message-ID: <LGM.94Sep16175043@polaris.ih.att.com>
Sender: news@nntpa.cb.att.com (Netnews Administration)
Nntp-Posting-Host: polaris.ih.att.com
Organization: AT&T Bell Laboratories, Naperville, Illinois, USA
References: <34qbac$ohk@infosrv.edvz.univie.ac.at> <34t8gn$1g6@nz12.rz.uni-karlsruhe.de>
	<LGM.94Sep11111230@polaris.ih.att.com> <Cw4oGq.1H8@cogsci.ed.ac.uk>
Date: Fri, 16 Sep 1994 22:50:43 GMT
Lines: 35

In article <Cw4oGq.1H8@cogsci.ed.ac.uk> jeff@aiai.ed.ac.uk (Jeff Dalton) writes:

   In article <LGM.94Sep11111230@polaris.ih.att.com> lgm@polaris.ih.att.com (Lawrence G. Mayka) writes:

   >I have attached the again-modified version of the benchmark.

   >    (dotimes (i n)
   >      (declare (fixnum i))
   >      (setf (svref perm1 i) i))

   I should perhaps point out again that that is not always enough
   to get a fully fixnum loop.  I normally use macros like these:

Yes, I added sufficient declarations for LispWorks, but not
necessarily enough for other CL implementations.

   The root problem seems to be that some Lisps worry that 1 + i may
   not be a fixnum even though i is.  I don't think you can always
   win even by saying (dotimes (i (the fixnum n)) ...).

Yes.  Even if i is declared to be FIXNUM, its value might be
MOST-POSITIVE-FIXNUM or MOST-NEGATIVE-FIXNUM, in which cases (1+ i) or
(1- i) will overflow into a bignum.  Theoretically, a type declaration
of

(declare (type (integer -30000 30000) i))

should suffice to ensure that (1+ i) and (1- i) generate fixnum
arithmetic; but implementations may vary, of course.
--
        Lawrence G. Mayka
        AT&T Bell Laboratories
        lgm@ieain.att.com

Standard disclaimer.
