From: Didier Verna
Subject: array initialization: dimension list not constant
Date: 
Message-ID: <muxmzf6k8tv.fsf@uzeb.lrde.epita.fr>
        Just to be sure ...


in something like (make-array (* width height) ...)

CMUCL might complain that the dimension list is not constant, so it cannot
open-code the array creation routine.


This has an impact on the performance of the array creation, but not on
subsequent operations onto the array, right ?

THX

-- 
Didier Verna, ······@lrde.epita.fr, http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire   Tel.+33 (1) 44 08 01 85
94276 Le Kremlin-Bic�tre, France   Fax.+33 (1) 53 14 59 22   ······@xemacs.org
From: Barry Margolin
Subject: Re: array initialization: dimension list not constant
Date: 
Message-ID: <barmar-486BCF.11285131032006@comcast.dca.giganews.com>
In article <···············@uzeb.lrde.epita.fr>,
 Didier Verna <······@lrde.epita.fr> wrote:

>         Just to be sure ...
> 
> 
> in something like (make-array (* width height) ...)
> 
> CMUCL might complain that the dimension list is not constant, so it cannot
> open-code the array creation routine.
> 
> 
> This has an impact on the performance of the array creation, but not on
> subsequent operations onto the array, right ?

If the compiler knows the size of the array, it may be able to optimize 
some array bounds checks, perhaps even warn you about exceeding them.  
For instance, it could conceivably reject this code:

(let ((new-array (make-array 3)))
  (setf (aref new-array 4) 'x)
  new-array)

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***