chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] array-lib - array() constructor - making empty array


From: Kon Lovett
Subject: Re: [Chicken-users] array-lib - array() constructor - making empty array
Date: Fri, 16 Nov 2007 16:14:18 -0800


On Nov 16, 2007, at 1:11 PM, metaperl.j wrote:


Re: http://www.call-with-current-continuation.org/eggs/array-lib.html

The signature for array implies that both prototype and dimensions are
optional:

procedure: (array [PROTOTYPE] SHAPE/DIMENSIONS [ELEMENT ...])

However, my attempt to create an empty 2x3x4 array fails:

The 'array' procedure cannot create an empty array w/ non-zero dimensions. An un-initialized array can be created using 'make- array'. But an array w/ dimensionality but w/o storage is not possible thru the public api.

The 'array' procedure is meant as an analog of the 'vector' procedure so elements are kinda required. The documentation is misleading in indicating that elements are optional, not conditionally optional.


#;67> (make-array-dimensions 2 3 4)
#,(dimensions (2 3 4))
#;68> (array (make-array-dimensions 2 3 4))
Error: (array) wrong number of elements to construct array
#;68> (array '#() (make-array-dimensions 2 3 4))
Error: (array) wrong number of elements to construct array


--
View this message in context: http://www.nabble.com/array-lib--- array%28%29-constructor---making-empty-array-tf4823929.html#a13801670
Sent from the chicken-users mailing list archive at Nabble.com.



_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users

Best Wishes,
Kon






reply via email to

[Prev in Thread] Current Thread [Next in Thread]