[comp.lang.lisp] fill-pointers and initial-contents in Common Lisp

ledford@berlin.rtp.dg.com (10/20/89)

I have a question about the make-array function in Common Lisp as
defined in "Common Lisp the Language" by Guy L. Steele Jr.  If a
non-nil fill-pointer is specified along with an initial-contents
value, can only the active part of the array be initialized or 
do both the active and inactive parts have to be initialized.
I can't find where Steele addresses this situation.

Thanks in advance,

Bruce Ledford,    
Data General Corp.
62 T.W. Alexander Drive
Research Triangle Park, NC 27709
Internet: ledford@dg-rtp.DG.COM

barmar@kulla (Barry Margolin) (10/21/89)

In article <2013@xyzzy.UUCP> ledford@berlin.rtp.dg.com () writes:
>I have a question about the make-array function in Common Lisp as
>defined in "Common Lisp the Language" by Guy L. Steele Jr.  If a
>non-nil fill-pointer is specified along with an initial-contents
>value, can only the active part of the array be initialized or 
>do both the active and inactive parts have to be initialized.
>I can't find where Steele addresses this situation.

The fill pointer is only used by functions that the documentation
specifically says use it.  Since the MAKE-ARRAY documentation doesn't say
anything about only the active portion being initialized, it must be the
entire thing.  In general, the fill pointer is only used by sequence and
string functions; the fill pointer exists primarily to allow vectors to be
used to implement growable sequences with performance comparable to that of
lists.  Most functions that operate on arrays of any rank ignore the fill
pointer.
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar