Lisp HUG Maillist Archive

Unable to render article 1851 because of ":DEFAULT stream decoding error on #<SB-SYS:FD-STREAM for \"socket 192.168.43.216:64823, peer: 116.202.254.214:119\" {1003A02E13}>: the octet sequence #(252 114 103 101) cannot be decoded." error

Re: Array behaviour?

Unable to parse email body. Email id is 1855

Re: Array behaviour?

On Mon, 9 Feb 2004 12:34:57 GMT, davef@xanalys.com wrote:

> The ANSI Common Lisp standard does not require that the array be
> initialized by such usage of MAKE-ARRAY.
>
> You can pass :INITIAL-ELEMENT if you need to, but it's faster to
> create an uninitialized array.

  CL-USER 5 > (make-array 10)
  #(NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)

Does this mean that an array without an explicit element type is /not/
initialized to NIL? I always thought it was.

Just curious,
Edi.


Re: Array behaviour?

Unable to parse email body. Email id is 1857

Re: Array behaviour?

Edi Weitz <edi@agharta.de> wrote:

> Does this mean that an array without an explicit element type is /not/
> initialized to NIL? I always thought it was.

Implementations would probably skip initialization for those as well,
if they could get away with it.  However, non-conservative garbage
collectors tend to get into trouble when following uninitialized
pointers, so the implementation must make sure to properly initialize
any memory location that gc could interpret as a pointer.  A
specialized array of floats doesn't have that problem.

Marcus


Updated at: 2020-12-10 08:57 UTC