135 lines
9 KiB
HTML
135 lines
9 KiB
HTML
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>CLHS: Issue ARRAY-DIMENSION-LIMIT-IMPLICATIONS Writeup</TITLE>
|
|
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
|
|
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
|
|
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
|
|
<LINK REL=TOP HREF="../Front/index.htm">
|
|
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
|
|
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
|
|
<LINK REL=PREV HREF="../Issues/iss013_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss014.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss015_w.htm">
|
|
</HEAD>
|
|
<BODY>
|
|
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="../Issues/iss013_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss014.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss015_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue ARRAY-DIMENSION-LIMIT-IMPLICATIONS Writeup</H2>
|
|
|
|
<PRE><B>Issue:</B> <A HREF="iss014.htm">ARRAY-DIMENSION-LIMIT-IMPLICATIONS</A><P>
|
|
<B>Forum:</B> Editorial<P>
|
|
<B>References:</B> <A HREF="iss158.htm">FIXNUM-NON-PORTABLE</A><P>
|
|
<B>Category:</B> CHANGE<P>
|
|
<B>Edit history:</B> 01-Mar-91, Version 1 by Pitman<P>
|
|
13-Mar-91, Version 2 by Pitman<P>
|
|
(comments by Moon, Barrett, and JonL)<P>
|
|
<B>Status:</B> For X3J13 consideration<P>
|
|
<P>
|
|
<B>Problem Description:<P>
|
|
</B><P>
|
|
Issue <A HREF="iss158.htm">FIXNUM-NON-PORTABLE</A> constrains <A REL=DEFINITION HREF="../Body/v_ar_dim.htm#array-dimension-limit"><B>ARRAY-DIMENSION-LIMIT</B></A> to be <P>
|
|
a <A REL=DEFINITION HREF="../Body/t_fixnum.htm#fixnum"><B>fixnum</B></A>, but this means that<P>
|
|
(<A REL=DEFINITION HREF="../Body/f_mk_ar.htm#make-array"><B>MAKE-ARRAY</B></A> (<A REL=DEFINITION HREF="../Body/a_list.htm#list"><B>LIST</B></A> (<A REL=DEFINITION HREF="../Body/f_1pl_1_.htm#1-"><B>1-</B></A> <A REL=DEFINITION HREF="../Body/v_most_p.htm#most-positive-fixnum"><B>MOST-POSITIVE-FIXNUM</B></A>) 2))<P>
|
|
is a valid program. This in turn implies that:<P>
|
|
(<A REL=DEFINITION HREF="../Body/f_row_ma.htm#row-major-aref"><B>ROW-MAJOR-AREF</B></A> (<A REL=DEFINITION HREF="../Body/f_mk_ar.htm#make-array"><B>MAKE-ARRAY</B></A> (<A REL=DEFINITION HREF="../Body/a_list.htm#list"><B>LIST</B></A> (<A REL=DEFINITION HREF="../Body/f_1pl_1_.htm#1-"><B>1-</B></A> <A REL=DEFINITION HREF="../Body/v_most_p.htm#most-positive-fixnum"><B>MOST-POSITIVE-FIXNUM</B></A>) 2)) n)<P>
|
|
might need <A REL=DEFINITION HREF="../Body/t_bignum.htm#bignum"><B>bignum</B></A> values of N to access all elements of the array.<P>
|
|
<P>
|
|
<B>Proposal (ARRAY-DIMENSION-LIMIT-IMPLICATIONS:ALL-FIXNUM):<P>
|
|
</B><P>
|
|
Constrain the upper bound on <A REL=DEFINITION HREF="../Body/v_ar_tot.htm#array-total-size-limit"><B>ARRAY-TOTAL-SIZE-LIMIT</B></A><P>
|
|
(and <A REL=DEFINITION HREF="../Body/v_ar_ran.htm#array-rank-limit"><B>ARRAY-RANK-LIMIT</B></A>, by implication) in the same ways as<P>
|
|
<A REL=DEFINITION HREF="../Body/v_ar_dim.htm#array-dimension-limit"><B>ARRAY-DIMENSION-LIMIT</B></A> is constrained.<P>
|
|
<P>
|
|
Clarify that the subscript arguments to <A REL=DEFINITION HREF="../Body/f_aref.htm#aref"><B>AREF</B></A> and to <A REL=DEFINITION HREF="../Body/f_row_ma.htm#row-major-aref"><B>ROW-MAJOR-AREF</B></A><P>
|
|
must be fixnums.<P>
|
|
<P>
|
|
<B>Example:<P>
|
|
</B><P>
|
|
(<A REL=DEFINITION HREF="../Body/f_mk_ar.htm#make-array"><B>MAKE-ARRAY</B></A> (<A REL=DEFINITION HREF="../Body/a_list.htm#list"><B>LIST</B></A> <A REL=DEFINITION HREF="../Body/v_most_p.htm#most-positive-fixnum"><B>MOST-POSITIVE-FIXNUM</B></A> 2)) would be an error.<P>
|
|
<P>
|
|
<B>Rationale:<P>
|
|
</B><P>
|
|
This makes it safe for users to declare subscripts for <A REL=DEFINITION HREF="../Body/f_row_ma.htm#row-major-aref"><B>ROW-MAJOR-AREF</B></A> to<P>
|
|
be fixnums without knowing the nature of the array internals. Without <P>
|
|
this, in principle, an implementation could support <A REL=DEFINITION HREF="../Body/t_bignum.htm#bignum"><B>bignum</B></A> arithmetic<P>
|
|
internally for multi-dimensional arrays, and some situations involving<P>
|
|
<A REL=DEFINITION HREF="../Body/f_row_ma.htm#row-major-aref"><B>ROW-MAJOR-AREF</B></A> would have to presume that <A REL=DEFINITION HREF="../Body/t_bignum.htm#bignum"><B>bignum</B></A> arithmetic was needed<P>
|
|
in order to `keep up'.<P>
|
|
<P>
|
|
<B>Current Practice:<P>
|
|
</B><P>
|
|
Symbolics Genera makes the array dimension limit smaller than the<P>
|
|
most positive <A REL=DEFINITION HREF="../Body/t_fixnum.htm#fixnum"><B>fixnum</B></A>, so is not affected.<P>
|
|
<P>
|
|
<B>Cost to Implementors:<P>
|
|
</B><P>
|
|
None.<P>
|
|
<P>
|
|
<B>Cost to Users:<P>
|
|
</B><P>
|
|
None.<P>
|
|
<P>
|
|
<B>Cost of Non-Adoption:<P>
|
|
</B><P>
|
|
Some situations would be left fuzzy, and might keep users from making <P>
|
|
certain <A REL=DEFINITION HREF="../Body/t_fixnum.htm#fixnum"><B>fixnum</B></A> declarations where desirable.<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B><P>
|
|
See above. <P>
|
|
<P>
|
|
<B>Aesthetics:<P>
|
|
</B><P>
|
|
Slight improvement--language is more consistent.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B><P>
|
|
Pitman thinks he supports this.<P>
|
|
<P>
|
|
Version 1 of this proposal had two parts:<P>
|
|
1. to allow <A REL=DEFINITION HREF="../Body/v_ar_dim.htm#array-dimension-limit"><B>ARRAY-DIMENSION-LIMIT</B></A> to be a <A REL=DEFINITION HREF="../Body/t_bignum.htm#bignum"><B>bignum</B></A> (the smallest <A REL=DEFINITION HREF="../Body/t_bignum.htm#bignum"><B>bignum</B></A>)<P>
|
|
in implementations which wanted to permit the full <A REL=DEFINITION HREF="../Body/t_fixnum.htm#fixnum"><B>fixnum</B></A> range <P>
|
|
for array size.<P>
|
|
2. the text of the proposal as it now stands.<P>
|
|
Part 1 was removed as controversial in v2 based on conversation which <P>
|
|
followed, which is summarized here.<P>
|
|
<P>
|
|
Barrett said of version 1:<P>
|
|
``I think the second item of the proposal is ok.<P>
|
|
I think the first item is unnecessary.''<P>
|
|
<P>
|
|
Moon says of version 1:<P>
|
|
``... I do agree that <A REL=DEFINITION HREF="../Body/v_ar_tot.htm#array-total-size-limit"><B>ARRAY-TOTAL-SIZE-LIMIT</B></A> should have<P>
|
|
been required to be a <A REL=DEFINITION HREF="../Body/t_fixnum.htm#fixnum"><B>fixnum</B></A>. Maybe <A REL=DEFINITION HREF="../Body/f_row_ma.htm#row-major-aref"><B>ROW-MAJOR-AREF</B></A> didn't exist<P>
|
|
when <A HREF="iss158.htm">FIXNUM-NON-PORTABLE</A> was written?''<P>
|
|
<P>
|
|
JonL says (in reply to Moon):<P>
|
|
<P>
|
|
``Nope -- the relevant dates were March 1988 and January 1989. <P>
|
|
In fact, <A REL=DEFINITION HREF="../Body/f_row_ma.htm#row-major-aref"><B>ROW-MAJOR-AREF</B></A> was suggested (I think) by GLS's <P>
|
|
suggestions list from 6-Dec-85. We probably just overlooked <P>
|
|
<A REL=DEFINITION HREF="../Body/v_ar_tot.htm#array-total-size-limit"><B>ARRAY-TOTAL-SIZE-LIMIT</B></A> in January 1989 [but as I recall, that<P>
|
|
issue accepted then had been argued about for two years or<P>
|
|
more; so the original presentation of <A HREF="iss158.htm">FIXNUM-NON-PORTABLE</A> may<P>
|
|
have occurred before <A REL=DEFINITION HREF="../Body/f_row_ma.htm#row-major-aref"><B>ROW-MAJOR-AREF</B></A>'s.]<P>
|
|
History aside, I too agree that <A REL=DEFINITION HREF="../Body/v_ar_tot.htm#array-total-size-limit"><B>ARRAY-TOTAL-SIZE-LIMIT</B></A> should <P>
|
|
have been required to be a <A REL=DEFINITION HREF="../Body/t_fixnum.htm#fixnum"><B>fixnum</B></A>.''<P>
|
|
<P>
|
|
Note that the effect of removing part 1 of the v1 proposal is that<P>
|
|
the status quo is retained for the case that<P>
|
|
(<A REL=DEFINITION HREF="../Body/f_mk_ar.htm#make-array"><B>MAKE-ARRAY</B></A> <A REL=DEFINITION HREF="../Body/v_most_p.htm#most-positive-fixnum"><B>MOST-POSITIVE-FIXNUM</B></A>)<P>
|
|
is never a valid program in any implementation because of the<P>
|
|
constraints that currently exist on <A REL=DEFINITION HREF="../Body/v_ar_dim.htm#array-dimension-limit"><B>ARRAY-DIMENSION-LIMIT</B></A>.<P>
|
|
</PRE>
|
|
<HR>
|
|
|
|
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
|
|
|
|
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
|
|
</BODY>
|
|
</HTML>
|