Subject: Re: create specialized vector from general array
From: (Rob Warnock)
Date: Sat, 25 Oct 2008 07:49:21 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Tamas K Papp  <> wrote:
| jra wrote:
| > What is the right way to create a new array (1D) from an existing array,
| > where the new array will have the specialized type of the type of the
| > existing array's elements (reguardless of the existing array's type: ie
| > could be t but all elements are double-float, or could be double-float)?
| In case all elements of an array are subtype of some particular type that 
| you want to specialize to, you will have to recognize this yourself and 
| create the new array with an explicit element-type.
| Think about it: what should (vector 1 2 3) specialize to?   Fixnum?  
| (unsigned-byte 2)?  (signed-byte 17)?  You get the idea.

While this is true, the OP might want to look at some of the posts
in the latter half of this thread, "Subject: copying arrays":

There are a couple of suggested implementations of a COPY-ARRAY
which preserves the original array's properties.

Also see <>.


Rob Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607